1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1170],{77349:function(e,s,t){"use strict";t.d(s,{Z:function(){return a}});var r=t(83946),o=t(19013),n=t(13882);function a(e,s){(0,n.Z)(2,arguments);var t=(0,o.Z)(e),a=(0,r.Z)(s);return isNaN(a)?new Date(NaN):a?(t.setDate(t.getDate()+a),t):t}},11640:function(e,s,t){"use strict";t.d(s,{Z:function(){return a}});var r=t(83946),o=t(19013),n=t(13882);function a(e,s){(0,n.Z)(2,arguments);var t=(0,o.Z)(e),a=(0,r.Z)(s);if(isNaN(a))return new Date(NaN);if(!a)return t;var i=t.getDate(),l=new Date(t.getTime());l.setMonth(t.getMonth()+a+1,0);var u=l.getDate();return i>=u?l:(t.setFullYear(l.getFullYear(),l.getMonth(),i),t)}},13441:function(e,s,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/kyb",function(){return t(12943)}])},57190:function(e,s,t){"use strict";function r(e,s){return function(e){if(Array.isArray(e))return e}(e)||function(e,s){var t=[],r=!0,o=!1,n=void 0;try{for(var a,i=e[Symbol.iterator]();!(r=(a=i.next()).done)&&(t.push(a.value),!s||t.length!==s);r=!0);}catch(l){o=!0,n=l}finally{try{r||null==i.return||i.return()}finally{if(o)throw n}}return t}(e,s)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}Object.defineProperty(s,"__esModule",{value:!0}),s.useIntersection=function(e){var s=e.rootMargin,t=e.disabled||!a,l=o.useRef(),u=r(o.useState(!1),2),c=u[0],d=u[1],p=o.useCallback((function(e){l.current&&(l.current(),l.current=void 0),t||c||e&&e.tagName&&(l.current=function(e,s,t){var r=function(e){var s=e.rootMargin||"",t=i.get(s);if(t)return t;var r=new Map,o=new IntersectionObserver((function(e){e.forEach((function(e){var s=r.get(e.target),t=e.isIntersecting||e.intersectionRatio>0;s&&t&&s(t)}))}),e);return i.set(s,t={id:s,observer:o,elements:r}),t}(t),o=r.id,n=r.observer,a=r.elements;return a.set(e,s),n.observe(e),function(){a.delete(e),n.unobserve(e),0===a.size&&(n.disconnect(),i.delete(o))}}(e,(function(e){return e&&d(e)}),{rootMargin:s}))}),[t,s,c]);return o.useEffect((function(){if(!a&&!c){var e=n.requestIdleCallback((function(){return d(!0)}));return function(){return n.cancelIdleCallback(e)}}}),[c]),[p,c]};var o=t(67294),n=t(9311),a="undefined"!==typeof IntersectionObserver;var i=new Map},95659:function(e,s,t){"use strict";var r=t(85893),o=t(67294),n=t(82580),a=t(86893),i=t(3753),l=t(29656),u=t(87559),c=t.n(u);function d(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function p(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){d(e,s,t[s])}))}return e}function m(e,s){if(null==e)return{};var t,r,o=function(e,s){if(null==e)return{};var t,r,o={},n=Object.keys(e);for(r=0;r<n.length;r++)t=n[r],s.indexOf(t)>=0||(o[t]=e[t]);return o}(e,s);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r<n.length;r++)t=n[r],s.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function f(e,s){return function(e){if(Array.isArray(e))return e}(e)||function(e,s){var t=[],r=!0,o=!1,n=void 0;try{for(var a,i=e[Symbol.iterator]();!(r=(a=i.next()).done)&&(t.push(a.value),!s||t.length!==s);r=!0);}catch(l){o=!0,n=l}finally{try{r||null==i.return||i.return()}finally{if(o)throw n}}return t}(e,s)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var h=i.c.MenuList,x=i.c.ValueContainer,v=i.c.SingleValue,y=i.c.Placeholder,g={container:function(e){return p({},e,{flex:"4.4",border:"none"})},option:function(e,s){return p({},e,{backgroundColor:s.isSelected?"#FCA311":"white",color:s.isSelected?"white":"black","&:hover":{backgroundColor:s.isSelected?"#FCA311":"#FFF6E7"}})},menu:function(e){return p({},e,{marginTop:"0px",bottom:"auto",width:"200%",height:"300px",overflow:"hidden"})},control:function(e,s){return p({},e,{borderRadius:"4px",borderColor:"transparent",borderBottom:s.isDisabled?"none":"1px solid #979797",borderBottomColor:s.isFocused?"#FB8110":"#979797",boxShadow:"none","&:hover":{borderBottomColor:"#FB8110"},backgroundColor:s.isDisabled?"#f1f1f1":"transparent"})},dropdownIndicator:function(e){return p({},e,{color:"#979797","&:hover":{color:"#434343"}})},indicatorSeparator:function(e){return p({},e,{display:"none"})},multiValue:function(e){return p({},e,{borderRadius:"40px",background:"#FEE6CF",border:"1px solid #FB8110",padding:"0px 10px"})},multiValueRemove:function(e){return p({},e,{display:"none"})},placeholder:function(e){return p({},e,{color:"#9ca3af"})},groupHeading:function(e){return p({},e,{color:"#00000",fontWeight:"600",textTransform:"Capitalize"})}},j=function(e){var s=e.selectProps,t=m(e,["selectProps"]),o=s.onInputChange,n=s.inputValue,i=s.onMenuInputFocus,l={"aria-autocomplete":"list","aria-label":s["aria-label"],"aria-labelledby":s["aria-labelledby"]};return(0,r.jsxs)("div",{className:"sprout-p-3",children:[(0,r.jsxs)("div",{className:"".concat(c().input," sprout-flex sprout-text-xs md:sprout-text-sm"),children:[(0,r.jsx)("div",{className:"sprout-self-ce
1nter sprout-mx-2",children:(0,r.jsx)(a.jRj,{className:"sprout-text-faded"})}),(0,r.jsx)("input",p({style:{all:"unset",overflow:"hidden",textOverflow:"ellipsis"},autoCorrect:"off",autoComplete:"off",spellCheck:"false",type:"text",value:n,onChange:function(e){return o(e.currentTarget.value,{action:"input-change"})},onMouseDown:function(e){e.stopPropagation(),e.target.focus()},onTouchEnd:function(e){e.stopPropagation(),e.target.focus()},onFocus:i,placeholder:"Search Country & Dial Code"},l))]}),(0,r.jsx)(h,p({},t,{selectProps:s}))]})},b=function(e){var s=e.children,t=e.selectProps,n=m(e,["children","selectProps"]),a={cx:n.cx,clearValue:n.clearValue,getStyles:n.getStyles,getValue:n.getValue,hasValue:n.hasValue,isMulti:n.isMulti,isRtl:n.isRtl,options:n.options,selectOption:n.selectOption,setValue:n.setValue,selectProps:t,theme:n.theme,getClassNames:n.getClassNames};return(0,r.jsx)(x,p({},n,{selectProps:t,children:o.Children.map(s,(function(e){return e||(n.hasValue?(0,r.jsx)(v,p({},a,{isFocused:t.isFocused,isDisabled:t.isDisabled,children:t.getOptionLabel(n.getValue()[0])})):(0,o.createElement)(y,p({},a,{key:"placeholder",isDisabled:t.isDisabled,data:n.getValue(),children:t.placeholder})))}))}))};s.Z=function(e){var s=(0,o.useRef)(null),t=(0,o.useState)(!1),a=t[0],i=t[1],u=(0,o.useState)(""),c=u[0],d=u[1],p=function(e){var t=s.current.querySelector(".select__menu");s.current.contains(e.target)&&t&&t.contains(e.target)||(i(!1),d(""))},m=f((0,n.useField)(e.name),3),h=m[0],x=m[2];(0,o.useEffect)((function(){return document.addEventListener("mousedown",p),function(){document.removeEventListener("mousedown",p)}}),[]);return(0,r.jsx)("div",{ref:s,children:(0,r.jsx)(l.default,{placeholder:e.placeholder,value:h.value,className:"basic-single",classNamePrefix:"select",name:"color",options:e.options,components:{MenuList:j,ValueContainer:b},inputValue:c,isSearchable:!1,onMenuInputFocus:function(){return i(!0)},onChange:function(e){!function(e){x.setValue(e)}(e),i(!1)},onInputChange:function(e){return d(e)},menuIsOpen:a||void 0,isFocused:a||void 0,styles:g,formatOptionLabel:function(e){return(0,r.jsxs)("div",{className:"sprout-flex sprout-align-bottom",children:[e.icon,(0,r.jsx)("div",{children:e.label}),e.tag]})}})})}},63781:function(e,s,t){"use strict";t.d(s,{xV:function(){return r},AU:function(){return o},b2:function(){return n},Gi:function(){return l},xF:function(){return a},Vv:function(){return i}});var r={src:"/_next/static/media/calender.76a89c8a.svg",height:16,width:16},o={src:"/_next/static/media/clear-field.189134de.svg",height:20,width:20},n={src:"/_next/static/media/close.088102a8.svg",height:20,width:20},a={src:"/_next/static/media/no-data-with-keyword-category.ff04bef2.png",height:94,width:100,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAMAAADz0U65AAAASFBMVEVMaXHg4NrEwMbAwMSztrzR0dxudoPY2t3Y2Nnc3Nvd3d3b29uHjJnZ2dmytbvJy87AwseorLPq6emXnKe8vcPo6evi4uGan6sEdtf2AAAAFXRSTlMAGC8g+gtD+2WMlrX+PsjO7f2Y+LeWmB+xAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAPklEQVR4nB3KSRaAIAzA0ACFlkFxQu9/Ux9k9RcBvAVmQUddyCpa4sR7yjBwRVo7ssGl99ddhK0+u183KQE/NnUBm3oUXMUAAAAASUVORK5CYII="},i={src:"/_next/static/media/no-data-with-keyword.89418c05.svg",height:100,width:78},l={src:"/_next/static/media/no-data.7ff88708.svg",height:161,width:161}},92197:function(e,s,t){"use strict";t.d(s,{wC:function(){return r},Gi:function(){return o}});var r={src:"/_next/static/media/chart-blur.055fa24c.png",height:611,width:1354,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAECAMAAACEE47CAAAAD1BMVEWHYTlsYmWeaSpyUzGYYx/+sE7SAAAABXRSTlMUByAqPcWSyZMAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAgSURBVHicNcHBEQAwDMIwY9h/5l4fkQj5wDYp0k7nOA8DfgAuL4RLewAAAABJRU5ErkJggg=="},o={src:"/_next/static/media/no-data.7ff88708.svg",height:161,width:161}},39323:function(e,s,t){"use strict";t.d(s,{W:function(){return r}});var r=function(e,s){var t=void 0===s?" ":s;return e.join(t)}},53952:function(e,s,t){"use strict";t.d(s,{Uy:function(){return o},Xf:function(){return n},$e:function(){return a},dr:function(){return i},Qr:function(){return l}});var r=t(85893),o=function(e){return(0,r.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M2.66669 6L8.00002 11.3333L13.3334 6",stroke:e.fill||"#111111",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},n=function(e){return(0,r.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("mask",{id:"mask0_893_15826",style:{maskType:"alpha"}
1,maskUnits:"userSpaceOnUse",x:"1",y:"6",width:"14",height:"7",children:(0,r.jsx)("path",{d:"M14 12L8 7L2 12",stroke:e.fill||"#111111",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),(0,r.jsx)("g",{mask:"url(#mask0_893_15826)",children:(0,r.jsx)("rect",{width:"16",height:"16",fill:"#757575"})})]})},a=function(e){var s,t=e.className;return(0,r.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:null===t||void 0===t?void 0:t.svg,children:(0,r.jsx)("path",{d:"M6 13.3333L11.3333 7.99992L6 2.66659",stroke:null!==(s=null===t||void 0===t?void 0:t.stroke)&&void 0!==s?s:"#FB8110",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},i=function(){return(0,r.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M10 2.66699L4.66667 8.00033L10 13.3337",stroke:"#FB8110",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},l=function(){return(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[(0,r.jsxs)("mask",{id:"mask0_1663_10926",maskUnits:"userSpaceOnUse",x:"3",y:"2",width:"10",height:"12",children:[(0,r.jsx)("path",{d:"M8.23657 2.48692C8.09964 2.37155 7.90075 2.37155 7.76382 2.48692L3.33306 6.22026C3.1764 6.35225 3.15524 6.58766 3.28578 6.74606C3.41633 6.90446 3.64915 6.92586 3.80581 6.79386L8.0002 3.2597L12.1946 6.79386C12.3512 6.92586 12.5841 6.90446 12.7146 6.74606C12.8452 6.58766 12.824 6.35225 12.6673 6.22026L8.23657 2.48692Z",fill:"#8E8E8E"}),(0,r.jsx)("path",{d:"M3.80581 9.20691C3.64915 9.07492 3.41633 9.09632 3.28578 9.25472C3.15524 9.41311 3.1764 9.64852 3.33306 9.78052L7.76382 13.5139C7.90075 13.6292 8.09964 13.6292 8.23657 13.5139L12.6673 9.78052C12.824 9.64852 12.8452 9.41311 12.7146 9.25472C12.5841 9.09632 12.3512 9.07492 12.1946 9.20691L8.0002 12.7411L3.80581 9.20691Z",fill:"#8E8E8E"})]}),(0,r.jsx)("g",{mask:"url(#mask0_1663_10926)",children:(0,r.jsx)("rect",{x:"2",y:"2",width:"12",height:"12",fill:"#8E8E8E"})})]})}},2622:function(e,s,t){"use strict";t.d(s,{g:function(){return o}});var r=t(85893),o=function(e){var s=e.fill,t=void 0===s?"black":s;return(0,r.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("rect",{x:"0.75",y:"0.75",width:"18.5",height:"18.5",rx:"9.25",stroke:t,strokeWidth:"1.5"}),(0,r.jsx)("path",{d:"M14 7.25L8.5 12.75L6 10.25",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}},17421:function(e,s,t){"use strict";t.d(s,{t:function(){return o}});var r=t(85893),o=function(e){return(0,r.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"M8 9.5C8.82843 9.5 9.5 8.82843 9.5 8C9.5 7.17157 8.82843 6.5 8 6.5C7.17157 6.5 6.5 7.17157 6.5 8C6.5 8.82843 7.17157 9.5 8 9.5Z",fill:e.color?e.color:"black"}),(0,r.jsx)("path",{d:"M8 14.5C8.82843 14.5 9.5 13.8284 9.5 13C9.5 12.1716 8.82843 11.5 8 11.5C7.17157 11.5 6.5 12.1716 6.5 13C6.5 13.8284 7.17157 14.5 8 14.5Z",fill:e.color?e.color:"black"}),(0,r.jsx)("path",{d:"M8 4.5C8.82843 4.5 9.5 3.82843 9.5 3C9.5 2.17157 8.82843 1.5 8 1.5C7.17157 1.5 6.5 2.17157 6.5 3C6.5 3.82843 7.17157 4.5 8 4.5Z",fill:e.color?e.color:"black"})]})}},337:function(e,s,t){"use strict";t.d(s,{r:function(){return o}});var r=t(85893),o=function(e){return(0,r.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("g",{id:"mingcute:copy-line",clipPath:"url(#clip0_512_10526)",children:(0,r.jsx)("g",{id:"Group",children:(0,r.jsx)("path",{id:"Vector",d:"M19 2C19.5304 2 20.0391 2.21071 20.4142 2.58579C20.7893 2.96086 21 3.46957 21 4V16C21 16.5304 20.7893 17.0391 20.4142 17.4142C20.0391 17.7893 19.5304 18 19 18H17V20C17 20.5304 16.7893 21.0391 16.4142 21.4142C16.0391 21.7893 15.5304 22 15 22H5C4.46957 22 3.96086 21.7893 3.58579 21.4142C3.21071 21.0391 3 20.5304 3 20V8C3 7.46957 3.21071 6.96086 3.58579 6.58579C3.96086 6.21071 4.46957 6 5 6H7V4C7 3.46957 7.21071 2.96086 7.58579 2.58579C7.96086 2.21071 8.46957 2 9 2H19ZM15 8H5V20H15V8ZM10 15C10.2652 15 10.5196 15.1054 10.7071 15.2929C10.8946 15.4804 11 15.7348 11 16C11 16.2652 10.8946 16.5196 10.7071 16.7071C10.5196 16.8946 10.2652 17 10 17H8C7.73478 17 7.48043 16.8946 7.29289 16.7071C7.10536 16.5196 7 16.2652 7 16C7 15.7348 7.10536 15.4804 7.29289 15.2929C7.48043 15.1054 7.73478 15 8 15H10ZM19 4H9V6H15C15.5304 6 16.0391 6.21071 16.4142 6.58579C16.7893 6.96086 17 7.46957 17 8V16H19V4ZM12 11C12.2549 11.0003 12.5 11.0979 12.6854 11.2728C12.8707 11.4478 12.9822 11.687 12.9972 11.9414C13.0121 12.1958 12.9293 12.4464 12.7657 12.6418C12.6021 12.8373 12.3701 12.9629 12.117 12.993L12 13H8C7.74512 12.9997 7.49997 12.9021 7.31463 12.7272C7.1293 12.5522 7.01777 12.313 7.00283 12.0586C6.98789 11.8042 7.07067 11.5536 7.23426 11.3582C7.39786 11.1627 7.6299 11.
10371 7.883 11.007L8 11H12Z",fill:e.fill||"#FB8110"})})}),(0,r.jsx)("defs",{children:(0,r.jsx)("clipPath",{id:"clip0_512_10526",children:(0,r.jsx)("rect",{width:"24",height:"24",fill:"white"})})})]})}},52119:function(e,s,t){"use strict";t.d(s,{Z:function(){return n}});var r=t(85893),o=t(67294);function n(e){var s,t,n=(0,o.useRef)(null);return s=n,t=e.outsideCallback,(0,o.useEffect)((function(){var e=function(e){s.current&&!s.current.contains(e.target)&&t()};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[t,s]),(0,r.jsx)("div",{ref:n,children:e.children})}},12943:function(e,s,t){"use strict";t.r(s),t.d(s,{default:function(){return Ua}});var r=t(85893),o=t(54894),n=t(81023),a=t(67294),i=t(47516),l=t(17726),u=t(51235),c=t(30690);var d=function(){var e=(0,u.SS)(),s=e.step,t=e.emitter,o=e.selectedOption,n=e.isACRAError,d=e.applicationProgressModal,p=e.mode,m=e.isAgentMode,f=s>5?c.Ch:c.yo,h="";o.corpSec?h="Appoint Grof as My Secretary":o.incorporation?h="Set up a Company (Pte. Ltd.)":o.finance&&(h="Payments & Expense Management"),s>5&&(h="Application Progress");var x=f.map((function(e,a){var l="";return e.step===s&&10!==s?l="sprout-border-4 sprout-border-white":(e.step<s||10===s)&&(l="sprout-bg-white"),0!==e.step&&(!(!o.corpSec&&4===e.step)&&(!(!o.incorporation&&n&&3===e.step)&&(!(!o.incorporation&&n&&4===e.step)&&(0,r.jsxs)("div",{className:"sprout-flex sprout-cursor-pointer",onClick:function(){s>e.step&&6!==e.step&&6!==s&&t.emit("@stepper",e.step)},children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"sprout-border sprout-border-white sprout-w-5 sprout-h-5 sprout-mr-4 sprout-rounded-full ".concat(l),children:[s>e.step&&(0,r.jsx)(i.hXj,{color:"#387EB6"}),10===s&&(0,r.jsx)(i.hXj,{color:"#387EB6"})]}),a<f.length-1&&(0,r.jsx)("div",{className:"sprout-h-12 sprout-w-[2px] sprout-mt-[5px] sprout-mb-[5px] sprout-ml-[.55rem] sprout-bg-white"})]}),(0,r.jsx)("div",{className:"sprout-mb-auto",children:e.label})]},e.label))))})),v=(0,a.useMemo)((function(){return!o.finance&&"upgrade"!==(null===p||void 0===p?void 0:p.toLowerCase())&&s>=3&&s<=5}),[p,o.finance,s]);return(0,r.jsx)("div",{className:"lg:sprout-w-[248px] sprout-h-full sprout-flex sprout-flex-col sprout-bg-[#14213D] sprout-overflow-hidden sprout-w-[35vh]",children:(0,r.jsxs)("nav",{className:"sprout-flex sprout-flex-col sprout-h-screen sprout-pl-6 sprout-pr-6 sprout-text-white",children:[(0,r.jsx)("div",{className:"sprout-pt-4 sprout-pb-10",children:(0,r.jsx)(l.vw,{})}),0===s&&(0,r.jsxs)("div",{className:"sprout-p-2",children:[(0,r.jsx)("h2",{className:"sprout-text-base lg:sprout-text-2xl sprout-font-semibold",children:"Welcome Onboard!"}),(0,r.jsx)("p",{className:"sprout-mt-8",children:"Thrilled to have you join us! Let's get started with our services for a journey of seamless solutions tailored just for you."})]}),0!==s&&(0,r.jsxs)(a.Fragment,{children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-row sprout-items-center sprout-justify-between",children:[(0,r.jsx)("h2",{className:"sprout-text-xl sprout-font-semibold",children:h}),s>5&&(0,r.jsx)("div",{className:"sprout-w-6 sprout-h-6 sprout-cursor-pointer",onClick:d.onOpen,children:(0,r.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsxs)("g",{clipPath:"url(#clip0_739_4109)",children:[(0,r.jsx)("path",{d:"M7.99967 14.6663C11.6816 14.6663 14.6663 11.6816 14.6663 7.99967C14.6663 4.31778 11.6816 1.33301 7.99967 1.33301C4.31778 1.33301 1.33301 4.31778 1.33301 7.99967C1.33301 11.6816 4.31778 14.6663 7.99967 14.6663Z",stroke:"#FB8110",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M6.66699 5.65633C7.00033 4.99633 7.33366 4.66699 8.00033 4.66699C8.83099 4.66699 9.33366 5.32633 9.33366 5.98566C9.33366 6.64499 9.00033 6.97433 8.00033 7.63433V8.66699M8.00033 11.0003V11.3337",stroke:"#FB8110",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"})]}),(0,r.jsx)("defs",{children:(0,r.jsx)("clipPath",{id:"clip0_739_4109",children:(0,r.jsx)("rect",{width:"16",height:"16",fill:"white"})})})]})})]}),(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-gap-16 sprout-mt-5",children:(0,r.jsx)("div",{children:x})})]}),v&&(m||3===s)&&(0,r.jsx)("div",{className:"sprout-fixed sprout-bottom-[26px] sprout-underline sprout-font-semibold sprout-text-[#C4C4C4]
1sprout-text-[14px] sprout-cursor-pointer",onClick:function(){m?t.emit("@modal/cancel-partner-code"):t.emit("@modal/partner-code")},children:m?"Go back to normal form":"For Grof Partners"})]})})},p=t(19945),m=t(20474),f=function(){return(0,r.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("g",{id:"Glyphs",clipPath:"url(#clip0_512_30029)",children:(0,r.jsx)("path",{id:"Vector",fillRule:"evenodd",clipRule:"evenodd",d:"M15.1313 11.994C15.456 13.1233 15.7673 14.206 15.9673 14.9067C15.9893 14.9853 16 15.064 16 15.14C16 15.488 15.7867 15.81 15.4467 15.9407L15.4453 15.942C15.0427 16.0967 14.588 15.9333 14.3793 15.5567C13.9167 14.7213 13.1353 13.354 12.7327 12.652L13.018 12.6627C13.8047 12.6627 14.5333 12.4153 15.1313 11.994ZM12.3213 15.9953H3.686L3.532 12.2047C3.532 12.2047 2.26467 14.3347 1.62067 15.496C1.412 15.8727 0.957333 16.036 0.554667 15.882L0.553333 15.88C0.213333 15.7493 0 15.428 0 15.0793C0 15.0033 0.0106667 14.9247 0.0326667 14.8467C0.456 13.36 1.39133 10.212 1.88 8.496C2.062 7.85667 2.648 7.41667 3.316 7.41667H9.704C9.47467 7.89467 9.346 8.43067 9.346 8.996C9.346 10.83 10.6973 12.3513 12.4593 12.6207L12.3213 15.9953ZM13 6C14.656 6 16 7.344 16 9C16 10.656 14.656 12 13 12C11.344 12 10 10.656 10 9C10 7.344 11.344 6 13 6ZM13.3333 7.33333H12.6667V8.66667H11.3333V9.33333H12.6667V10.6667H13.3333V9.33333H14.6667V8.66667H13.3333V7.33333ZM8.004 0C9.85533 0 11.358 1.49533 11.358 3.33733C11.358 5.17933 9.85533 6.67467 8.004 6.67467C6.15267 6.67467 4.65 5.17933 4.65 3.33733C4.65 1.49533 6.15267 0 8.004 0Z",fill:"#757575"})}),(0,r.jsx)("defs",{children:(0,r.jsx)("clipPath",{id:"clip0_512_30029",children:(0,r.jsx)("rect",{width:"16",height:"16",fill:"white"})})})]})},h=function(){return(0,r.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("g",{id:"Glyphs",children:(0,r.jsx)("path",{id:"Vector",d:"M9.24741 8L12.739 4.50842C12.9047 4.343 12.9979 4.11853 12.9981 3.88439C12.9983 3.65025 12.9055 3.42562 12.7401 3.25991C12.5747 3.0942 12.3502 3.00099 12.1161 3.00078C11.8819 3.00057 11.6573 3.09339 11.4916 3.2588L8 6.75038L4.50842 3.2588C4.34271 3.09309 4.11796 3 3.88361 3C3.64926 3 3.42451 3.09309 3.2588 3.2588C3.09309 3.42451 3 3.64926 3 3.88361C3 4.11796 3.09309 4.34271 3.2588 4.50842L6.75038 8L3.2588 11.4916C3.09309 11.6573 3 11.882 3 12.1164C3 12.3507 3.09309 12.5755 3.2588 12.7412C3.42451 12.9069 3.64926 13 3.88361 13C4.11796 13 4.34271 12.9069 4.50842 12.7412L8 9.24962L11.4916 12.7412C11.6573 12.9069 11.882 13 12.1164 13C12.3507 13 12.5755 12.9069 12.7412 12.7412C12.9069 12.5755 13 12.3507 13 12.1164C13 11.882 12.9069 11.6573 12.7412 11.4916L9.24741 8Z",fill:"#8E8E8E"})})})},x=function(){var e=(0,u.SS)(),s=e.step,t=e.selectedOption,o=e.isACRAError,n=e.applicationProgressModal,i=e.emitter,d=e.isAgentMode,x=e.mode,v=s>5?c.Ch:c.yo,y="";t.corpSec?y="Appoint Grof as My Secretary":t.incorporation?y="Set up a Company (Pte. Ltd.)":t.finance&&(y="Payments & Expense Management");var g=(0,a.useMemo)((function(){return!t.finance&&"upgrade"!==(null===x||void 0===x?void 0:x.toLowerCase())&&s>=3&&s<=5}),[x,t.finance,s]);return s>5&&(y="Application Progress"),(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("header",{className:"sprout-flex sprout-flex-col sprout-bg-[#14213D] sprout-p-6 sprout-gap-5 sprout-z-[1] sprout-shadow-md",children:[(0,r.jsx)("div",{className:"sprout-w-full",children:(0,r.jsxs)("div",{className:"",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-justify-between",children:[(0,r.jsx)("div",{onClick:function(){return window.location.reload()},children:(0,r.jsx)(l.bg,{})}),g&&(d||3===s)&&(0,r.jsxs)("div",{className:"sprout-underline sprout-font-semibold sprout-text-[#C4C4C4]
1sprout-text-[14px] sprout-cursor-pointer",onClick:function(){d?i.emit("@modal/cancel-partner-code"):i.emit("@modal/partner-code")},children:[(0,r.jsx)("span",{className:"sprout-hidden md:sprout-flex",children:d?"Go back to normal form":"For Grof Partners"}),(0,r.jsx)("div",{className:"sprout-flex md:sprout-hidden",children:d?(0,r.jsx)(h,{}):(0,r.jsx)(f,{})})]})]}),0===s&&(0,r.jsxs)("div",{className:"sprout-p-2 sprout-text-white sprout-mt-4",children:[(0,r.jsx)("h2",{className:"sprout-text-lg lg:sprout-text-2xl sprout-font-semibold",children:"Welcome Onboard!"}),(0,r.jsx)("p",{className:"sprout-mt-4 md:sprout-mt-8",children:"Thrilled to have you join us! Let's get started with our services for a journey of seamless solutions tailored just for you."})]})]})}),(0,r.jsxs)("div",{className:"sprout-w-full sprout-flex-col sprout-space-y-4",children:[0!==s&&(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-row sprout-items-center sprout-gap-4",children:[(0,r.jsx)("h2",{className:"sprout-text-white sprout-font-semibold",children:y}),s>5&&(0,r.jsx)("div",{className:"sprout-w-4 sprout-h-4 sprout-cursor-pointer",onClick:n.onOpen,children:(0,r.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsxs)("g",{clipPath:"url(#clip0_739_4109)",children:[(0,r.jsx)("path",{d:"M7.99967 14.6663C11.6816 14.6663 14.6663 11.6816 14.6663 7.99967C14.6663 4.31778 11.6816 1.33301 7.99967 1.33301C4.31778 1.33301 1.33301 4.31778 1.33301 7.99967C1.33301 11.6816 4.31778 14.6663 7.99967 14.6663Z",stroke:"#FB8110",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M6.66699 5.65633C7.00033 4.99633 7.33366 4.66699 8.00033 4.66699C8.83099 4.66699 9.33366 5.32633 9.33366 5.98566C9.33366 6.64499 9.00033 6.97433 8.00033 7.63433V8.66699M8.00033 11.0003V11.3337",stroke:"#FB8110",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"})]}),(0,r.jsx)("defs",{children:(0,r.jsx)("clipPath",{id:"clip0_739_4109",children:(0,r.jsx)("rect",{width:"16",height:"16",fill:"white"})})})]})})]}),(0,r.jsx)("div",{className:"sprout-flex sprout-cursor-pointer",children:0!==s&&v.map((function(e,n){var a=(0,r.jsx)(p.rl,{});return e.step===s?a=(0,r.jsx)(p.US,{}):e.step<s&&0!==s&&(a=(0,r.jsx)(p.s0,{})),!(!t.corpSec&&4===e.step)&&(!(!t.incorporation&&o&&3===e.step)&&(!(!t.incorporation&&o&&4===e.step)&&(0!==e.step&&(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col",onClick:function(){s>e.step&&e.step<6&&s<6&&i.emit("@stepper",e.step)},children:(0,r.jsxs)("div",{className:"sprout-flex sprout-items-center",children:[a,n<v.length-1&&(0,r.jsx)("div",{className:"sprout-border sprout-border-white sprout-w-[48px] md:sprout-w-[120px]"})]})},n))))}))}),(0,r.jsx)("div",{children:0!==s&&v.map((function(e,n){var a=!1;return 1===s?e.step<1&&(a=!0):2===s&&e.step<1&&(a=!0),!(!t.corpSec&&4===e.step)&&(!(!t.incorporation&&o&&3===e.step)&&(!(!t.incorporation&&o&&4===e.step)&&(0!==e.step&&(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col",onClick:function(){s>e.step&&e.step<6&&s<6&&i.emit("@stepper",e.step)},children:(0,r.jsx)("div",{className:"sprout-text-[#FAFAFA] sprout-pt-1 sprout-text-xs sprout-leading-4 sprout-pr-2",children:(0,r.jsx)("span",{className:"".concat(n<s&&"sprout-font-semibold"," ").concat(a&&"sprout-hidden"," md:sprout-block"),children:(0,r.jsx)("span",{className:(0,m.WD)([e.step===s&&"sprout-block",e.step!==s&&"sprout-hidden"]),children:e.label})})})},n))))}))})]})]})})},v=t(85495),y=t(54431),g=t(96486),j=t.n(g),b=t(93479),N=t(81526),C=t(22074),D=t(19982),w=t(82580);function k(){var e=(0,u.SS)().generalDropdownResponse,s=(0,g.get)(e,"data.data",[]).find((function(e){return"IntendedUseOfAccount"in e}));return(0,r.jsx)("div",{className:(0,m.WD)(["sprout-relative sprout-flex sprout-flex-col","sprout-border sprout-border-[#CDCDCD] sprout-border-solid sprout-rounded-[16px]"]),children:(0,r.jsxs)("div",{className:"sprout-p-6 sprout-flex sprout-flex-col sprout-space-y-6",children:[(0,r.jsx)("h3",{className:"sprout-font-semibold",children:"Expense Management"}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-sp
1ace-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," What is your purpose for using Expense Management?"]}),(0,r.jsx)(b.Z.select2,{name:"intendedUseOfAccount",placeholder:"Select option",options:null===s||void 0===s?void 0:s.IntendedUseOfAccount.filter((function(e){return"IU001"!==e.value}))})]})]})})}function O(){var e=(0,u.SS)().generalDropdownResponse,s=(0,g.get)(e,"data.data",[]).find((function(e){return"IndustrySectorType"in e}));return(0,r.jsx)("div",{className:(0,m.WD)(["sprout-relative sprout-flex sprout-flex-col","sprout-border sprout-border-[#CDCDCD] sprout-border-solid sprout-rounded-[16px]"]),children:(0,r.jsxs)("div",{className:"sprout-p-6 sprout-flex sprout-flex-col sprout-space-y-6",children:[(0,r.jsx)("h3",{className:"sprout-font-semibold",children:"General"}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:["Please provide your company\u2019s website"," ",(0,r.jsx)("span",{className:"sprout-text-[#757575]",children:"(if available)"})]}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"Enter company website",name:"website"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"Is there a brand name the company is trading under?"}),(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"If yes, please enter your company's brand name."}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"Enter brand name",name:"doingBusinessAs"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," What is the primary business industry?"]}),(0,r.jsx)(b.Z.select2,{name:"primaryIndustry",placeholder:"Select business industry",options:null===s||void 0===s?void 0:s.IndustrySectorType})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Brief description of the business"]}),(0,r.jsx)(b.Z.textarea,{name:"businessDescription",placeholder:"Enter description of the business",rows:4})]})]})})}function A(){var e=(0,u.SS)().generalDropdownResponse,s=(0,w.useFormikContext)(),t=s.values,o=s.setFieldValue,n=(0,g.get)(e,"data.data",[]),a=n.find((function(e){return"EmployeesSizeType"in e})),i=n.find((function(e){return"TurnOverType"in e})),l=n.find((function(e){return"NumberOfTransactionsMonthly"in e})),c=n.find((function(e){return"TransactionsValueMonthly"in e})),d=n.find((function(e){return"KybPrimaryBanks"in e}));return(0,r.jsx)("div",{className:(0,m.WD)(["sprout-relative sprout-flex sprout-flex-col","sprout-border sprout-border-[#CDCDCD] sprout-border-solid sprout-rounded-[16px]","sprout-overflow-hidden"]),children:(0,r.jsxs)("div",{className:"sprout-p-6 sprout-flex sprout-flex-col sprout-space-y-6",children:[(0,r.jsx)("h3",{className:"sprout-font-semibold",children:"Operational"}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Total Full Time Employees"]}),(0,r.jsx)(b.Z.select2,{name:"totalEmployees",placeholder:"Select total full time employees",options:null===a||void 0===a?void 0:a.EmployeesSizeType})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Estimated Annual Turnover"]}),(0,r.jsx)(b.Z.select2,{name:"annualTurnover",placeholder:"Select estimated annual turnover",options:null===i||void 0===i?void 0:i.TurnOverType})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-4",children:[(0,r.jsx)("h4",{className:"sprout-text-sm sprout-font-semibold",children:"Amount and Frequency of expected transaction inflow/outflow"}),(0,r.jsxs)("div",{className:"sprout-p-2 md:sprout-p-4 sprout-sp
1ace-y-2 md:sprout-space-y-4",children:[(0,r.jsx)("p",{className:"sprout-text-sm sprout-font-semibold",children:"A. Inflow"}),(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"e.g. sales income, investment income, shareholder capital injection, loans proceeds."}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Estimated no. of transactions per month"]}),(0,r.jsx)(b.Z.select2,{name:"inflowNumberOfTransactionMonthly",placeholder:"Select estimated transaction per month",options:null===l||void 0===l?void 0:l.NumberOfTransactionsMonthly.map((function(e){return{label:e,value:e}}))})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Estimated value per month (SGD)"]}),(0,r.jsx)(b.Z.select2,{name:"inflowTransactionsValueMonthly",placeholder:"Select estimated value per month",options:null===c||void 0===c?void 0:c.TransactionsValueMonthly.map((function(e){return{label:e,value:e}}))})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Nature of inflow"]}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"Enter nature of inflow",name:"natureOfInflow"})]})]}),(0,r.jsxs)("div",{className:"sprout-p-2 md:sprout-p-4 sprout-space-y-2 md:sprout-space-y-4",children:[(0,r.jsx)("p",{className:"sprout-text-sm sprout-font-semibold",children:"B. Outflow"}),(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"e.g. finance expense, rental, staff costs, cost of goods sold, operating expenses."}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Estimated no. of transactions per month"]}),(0,r.jsx)(b.Z.select2,{name:"outflowNumberOfTransactionMonthly",placeholder:"Select estimated transaction per month",options:null===l||void 0===l?void 0:l.NumberOfTransactionsMonthly.map((function(e){return{label:e,value:e}}))})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Estimated value per month (SGD)"]}),(0,r.jsx)(b.Z.select2,{name:"outflowTransactionsValueMonthly",placeholder:"Select estimated value per month",options:null===c||void 0===c?void 0:c.TransactionsValueMonthly.map((function(e){return{label:e,value:e}})),menuPosition:"top"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Nature of outflow"]}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"Enter nature of outflow",name:"natureOfOutflow"})]})]}),(0,r.jsxs)("div",{className:"sprout-p-2 md:sprout-p-4 sprout-space-y-2 md:sprout-space-y-4",children:[(0,r.jsx)("p",{className:"sprout-text-sm sprout-font-semibold",children:"C. Bank Accounts"}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Please select all banks where your company holds accounts"]}),(0,r.jsx)(b.Z.select2,{name:"primaryBanks",placeholder:"Select bank name",options:null===d||void 0===d?void 0:d.KybPrimaryBanks.map((function(e){return{label:e,value:e}})),isMulti:!0,menuPosition:"top",customChangeHandler:function(e,s){e.some((function(e){return"Others"===e.value}))&&0===(null===t||void 0===t?void 0:t.otherPrimaryBanks.length)&&o("otherPrimaryBanks.0",""),e.some((function(e){return"None"===e.value}))&&t.primaryBanks.some((function(e){return"None"===e.value}))?o("primaryBanks",e.filter((function(e){return"None"!==e.value}))):e.some((function(e){return"None"===e.value}))?o("primaryBanks",[{value:"None",label:"None"}]):s.setValue(e)}})]}),t.primaryBanks.some((function(e){return"Others"===e.value}))&&(0,r.jsx)("div",{className:"sprout-flex sprout-flex-row sprout-justify-between sprout-gap-2",children:(0,r.jsx)("div",{className:"sprout-w-full",children:(0,r.jsx)(w.FieldArray,{name:"otherPrimaryBanks",render:function(e){var s;return(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-gap-4",children:[null===t||void 0===t||null===(s=t.otherPrimaryBanks)||void 0===s?void 0:s.map((function(s,t){return(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-row sprout-justify-between sprout-gap-2",children:[(0,r.jsx)("div",{className:"sprout-w-full",children:(0,r.jsx)(b.Z.inputWithError,{placeholder:"Enter other bank name",name:"otherPrimaryBanks.".concat(t)})}),(0,r.jsx)("div",{className:"sprout-justify-start sprout-flex sprout-flex-row sprout-gap-2",children:(0,r.jsx)(D.iR,{tertiary:!0,type:"button",onClick:function(){return e.remove(t)},children:(0,r.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M6.24741 5L9.73899 1.50842C9.9047 1.343 9.99791 1.11853 9.99812 0.884393C9.99833 0.650251 9.90551 0.425617 9.74009 0.259907C9.57468 0.0941973 9.35021 0.000986589 9.11606 0.000779811C8.88192 0.000573033 8.65729 0.0933872 8.49158 0.258804L5 3.75038L1.50842 0.258804C1.34271 0.0930948 1.11796 0 0.883613 0C0.649264 0 0.424514 0.0930948 0.258804 0.258804C0.0930948 0.424514 0 0.649264 0 0.883613C0 1.11796 0.0930948 1.34271 0.258804 1.50842L3.75038 5L0.258804 8.49158C0.0930948 8.65729 0 8.88204 0 9.11639C0 9.35074 0.0930948 9.57549 0.258804 9.7412C0.424514 9.90691 0.649264 10 0.883613 10C1.11796 10 1.34271 9.90691 1.50842 9.7412L5 6.24962L8.49158 9.7412C8.65729 9.90691 8.88204 10 9.11639 10C9.35074 10 9.57549 9.90691 9.7412 9.7412C9.90691 9.57549 10 9.35074 10 9.11639C10 8.88204 9.90691 8.65729 9.7412 8.49158L6.24741 5Z",fill:"#8E8E8E"})})})})]},t)})),(0,r.jsx)("div",{className:"sprout-flex sprout-justify-end",children:(0,r.jsx)(D.iR,{type:"button",secondary:!0,onClick:function(){return e.push("")},children:"Add Other Bank"})})]})}})})})]})]})]})})}var S=t(93967),E=t.n(S),P=t(87649),T=t(43786);function I(){return(0,r.jsxs)("div",{className:"sprout-grid sprout-grid-cols-1 md:sprout-grid-cols-2 sprout-gap-4",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-sp
1ace-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Address Line 1"]}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. 123 Maple Street",name:"addressLine1"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"Address Line 2"}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. Suite 4B",name:"addressLine2"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"City"}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. Los Angeles",name:"city"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"State"}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. California",name:"state"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Postal Code"]}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. 90001",name:"postalCode"})]})]})}function F(){return(0,r.jsxs)("div",{className:"sprout-grid sprout-grid-cols-1 md:sprout-grid-cols-2 sprout-gap-4",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Block / House No"]}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. 123",name:"blockHouse"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Street Name"]}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. Orchard Road",name:"streetName"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"Level No"}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. 01",name:"level"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"Unit No"}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. 05",name:"unit"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"Building Name"}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g Orchard Towers",name:"buildingName"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Postal Code"]}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. 018956",name:"postalCode"})]})]})}function R(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function L(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){R(e,s,t[s])}))}return e}function _(e){var s=e.isSingapore,t=e.registeredCountryCode,o=(0,w.useFormikContext)(),n=o.values,i=o.setValues,l=o.setFieldValue,c=(0,u.SS)(),d=c.generalCountry,p=c.companyInformation,f=function(){var e=d.data.data.find((function(e){var s,t;return e.countryIso2Code===(null===(s=null===p||void 0===p?void 0:p.data.data.company.addresses)||void 0===s||null===(t=s.principalPlaceOfBusiness)||void 0===t?void 0:t.country)}));return{label:null===e||void 0===e?void 0:e.description,value:null===e||void 0===e?void 0:e.countryIso2Code,icon:(0,r.jsx)("img",{className:"sprout-mr-3 sprout-h-6",src:null===e||void 0===e?void 0:e.countryFlagUrl,alt:""})}},h=(0,a.useState)(null),x=h[0],v=h[1],y="048762"===(0,g.get)(p,"data.data.company.addresses.registeredAddress.postalCode","");return(0,r.jsx)("div",{className:(0,m.WD)(["sprout-relative sprout-flex sprout-flex-col","sprout-border sprout-border-[#CDCDCD] sprout-border-solid sprout-rounded-[16px]","sprout-overflow-hidden"]),children:(0,r.jsxs)("div",{className:"sprout-p-6 sprout-flex sprout-flex-col sprout-sp
1ace-y-6",children:[(0,r.jsx)("h3",{className:"sprout-font-semibold",children:"Place of Business"}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"Principal Place of Business"}),(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Grof's registered address is not considered a principal place of business"})]}),(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col",children:(0,r.jsxs)("div",{className:"checkbox-container mb-2",children:[(0,r.jsx)("input",{type:"checkbox",disabled:y,checked:n.isSameBusinessAddress,onChange:function(e){return function(e){if(e){var s=d.data.data.find((function(e){return e.countryIso2Code===t}));i(L({},n,{country:{value:null===s||void 0===s?void 0:s.countryIso2Code,label:null===s||void 0===s?void 0:s.description,icon:(0,r.jsx)("img",{className:"sprout-mr-3 sprout-h-6",src:null===s||void 0===s?void 0:s.countryFlagUrl,alt:""})},isSameBusinessAddress:e}))}else i(L({},n,x?{country:x,isSameBusinessAddress:e}:{country:f,isSameBusinessAddress:e}))}(e.target.checked)}}),(0,r.jsx)("label",{htmlFor:"is-apply-for-business-account",children:(0,r.jsx)("div",{className:E()("checkbox-label sprout-text-sm md:sprout-text-base",{"sprout-text-[#9E9E9E]":y}),children:"Use registered address as principal place of business"})})]})}),y&&(0,r.jsx)(P.Z,{variant:"info",classNames:"!sprout-px-4 !sprout-py-2 sprout-mb-[10px]",leftIcon:(0,r.jsx)(T.Z,{color:"#057EB6",width:"24"}),children:(0,r.jsx)("p",{className:"sprout-font-normal sprout-normal-case sprout-text-sm",children:"The registered address, provided by Grof is official communications with government agencies, and it differs from the principal place of business where your company operates\u2014knowing your principal place helps us better understand your business."})}),!n.isSameBusinessAddress&&(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-6",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Country Address"]}),(0,r.jsx)(b.Z.select2,{name:"country",placeholder:"Select country",customChangeHandler:function(e){!function(e){l("country",e),v(e)}(e)},options:(0,g.get)(d,"data.data",[]).map((function(e){return{label:e.description,value:e.countryIso2Code,icon:(0,r.jsx)("img",{className:"sprout-mr-3 sprout-h-6",src:e.countryFlagUrl,alt:""})}}))})]}),s?(0,r.jsx)(F,{}):(0,r.jsx)(I,{})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Country of Operation"]}),(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Your Country of Operation is selected based on your Principal Place of Business."}),(0,r.jsx)(b.Z.select2,{isDisabled:!0,name:"country",placeholder:"Option Reflected from Country Address"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Top 3 countries where business is transacting"]}),(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"This can refer to countries where your business operates, where your main customer base is, or where your major suppliers are located."}),(0,r.jsx)(b.Z.select2,{name:"transactionCountries",placeholder:"Select countries",isMulti:!0,menuPosition:"top",options:(0,g.get)(d,"data.data",[]).map((function(e){return{label:e.description,value:e.countryIso2Code,icon:(0,r.jsx)("img",{className:"sprout-mr-3 sprout-h-6",src:e.countryFlagUrl,alt:""})}})),customChangeHandler:function(e,s){(null==e||e.length<4)&&s.setValue(e)}})]})]})})}function B(e){var s,t,o=e.companyInformation,n=e.handleOnSave,i=e.confirmationModal,l=e.setValidate,u=(0,w.useFormikContext)().values,c=!1,d=Object.values(u).filter((function(e){return""!==e&&!Array.isArray(e)})),p=Object.values(u).filter((function(e){return Array.isArray(e)&&e.length}));(d.length||p.length)&&(c=!0);var m=(0,a.useMemo)((function(){var e;return"SG"===((null===(e=u.country)||void 0===e?void 0:e.value)||"")}),[u.country]),f=(0,a.useMemo)((function(){var e,s,t,r;return null===o||void 0===o||null===(e=o.data)||void 0===e||null===(s=e.data)||void 0===s||null===(t=s.company)||void 0===t||null===(r=t.addresses)||void 0===r?void 0:r.isUseGrofRegisteredAddress}),[o]),h=(0,a.useMemo)((function(){var e,s,t,r,n;return null===o||void 0===o||null===(e=o.data)||void 0===e||null===(s=e.data)||void 0===s||null===(t=s.company)||void 0===t||null===(r=t.addresses)||void 0===r||null===(n=r.registeredAddress)||void 0===n?void 0:n.country}),[o]);return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-sp
1ace-y-8",children:[(0,r.jsx)(O,{}),(0,r.jsx)(_,{isSingapore:m,isUseGrofRegisteredAddress:f,registeredCountryCode:h}),(0,r.jsx)(A,{}),(null===o||void 0===o||null===(s=o.data)||void 0===s||null===(t=s.data)||void 0===t?void 0:t.services.finance)&&(0,r.jsx)(k,{})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-justify-end sprout-space-x-6 sprout-mt-8",children:[(0,r.jsx)(D.iR,{secondary:!0,onClick:function(){return n(u)},disabled:!c,children:"Save"}),(0,r.jsx)(D.iR,{primary:!0,type:"submit",disabled:!c,onClick:function(){return l(!0)},children:"Next Step"})]}),(0,r.jsxs)("p",{className:"sprout-mt-6",children:["If you wish to discard the existing onboarding process or start a new one,",(0,r.jsx)("span",{className:"sprout-ml-2 sprout-font-semibold sprout-text-[#960F21] sprout-cursor-pointer",onClick:function(){return i.onOpen()},children:"click here"})]})]})}var V=t(35666),U=t.n(V),M=t(58949),Z=t(63388);function q(e,s,t,r,o,n,a){try{var i=e[n](a),l=i.value}catch(u){return void t(u)}i.done?s(l):Promise.resolve(l).then(r,o)}function W(e){return function(){var s=this,t=arguments;return new Promise((function(r,o){var n=e.apply(s,t);function a(e){q(n,r,o,a,i,"next",e)}function i(e){q(n,r,o,a,i,"throw",e)}a(void 0)}))}}var G=function(e){var s,t=e.emitter,r=(0,a.useRef)(N.q.getState()).current.setGlobalSnackbar,o=(0,u.SS)(),n=o.companyInformation,i=o.isACRAError,l=o.selectedOption,c=o.serviceType,d=(0,y.a)().profileState,p=(0,M.Z)(),f=i&&!l.incorporation?5:3,h=(0,a.useCallback)((function(e){var s,o=(null===(s=e.country)||void 0===s?void 0:s.label)?[e.country.label]:[],a=[];(0,g.get)(e,"primaryBanks",[]).map((function(e){return a.push(e.value)}));var i={company:{addresses:{isSameBusinessAddress:e.isSameBusinessAddress,principalPlaceOfBusiness:{blockHouse:e.blockHouse||"",buildingName:e.buildingName||"",level:e.level||"",unit:e.unit||"",postalCode:e.postalCode||"",country:(0,g.get)(e,"country.value",null)||"",streetName:e.streetName||"",city:e.city||"",state:e.state||"",addressLine1:e.addressLine1||"",addressLine2:e.addressLine2||""}},businessDetails:{businessWebsite:e.website||"",doingBusinessAs:e.doingBusinessAs||"",primaryIndustry:(0,g.get)(e,"primaryIndustry.value",null),businessDescription:e.businessDescription||""},riskProfileAssessment:{countryOfOperations:o,annualTurnover:(0,g.get)(e,"annualTurnover.value",null),totalEmployees:(0,g.get)(e,"totalEmployees.value",null),transactionCountries:e.transactionCountries.map((function(e){return e.value}))||[],intendedUseOfAccount:(0,g.get)(e,"intendedUseOfAccount.value",null),inflowExpectedTransactions:{numberOfTransactionMonthly:(0,g.get)(e,"inflowNumberOfTransactionMonthly.value",null),transactionsValueMonthly:(0,g.get)(e,"inflowTransactionsValueMonthly.value",null),natureOfInflow:e.natureOfInflow},outflowExpectedTransactions:{numberOfTransactionMonthly:(0,g.get)(e,"outflowNumberOfTransactionMonthly.value",null),transactionsValueMonthly:(0,g.get)(e,"outflowTransactionsValueMonthly.value",null),natureOfOutflow:e.natureOfOutflow},primaryBanks:a,otherPrimaryBanks:e.primaryBanks.some((function(e){return"Others"===e.value}))?e.otherPrimaryBanks:[]}},currentStep:2};i.company.riskProfileAssessment.annualTurnover||delete i.company.riskProfileAssessment.annualTurnover,i.company.riskProfileAssessment.totalEmployees||delete i.company.riskProfileAssessment.totalEmployees,i.company.businessDetails.primaryIndustry||delete i.company.businessDetails.primaryIndustry,i.company.riskProfileAssessment.intendedUseOfAccount||delete i.company.riskProfileAssessment.intendedUseOfAccount,i.company.riskProfileAssessment.inflowExpectedTransactions.numberOfTransactionMonthly||delete i.company.riskProfileAssessment.inflowExpectedTransactions.numberOfTransactionMonthly,i.company.riskProfileAssessment.inflowExpectedTransactions.transactionsValueMonthly||delete i.company.riskProfileAssessment.inflowExpectedTransactions.transactionsValueMonthly,i.company.riskProfileAssessment.outflowExpectedTransactions.numberOfTransactionMonthly||delete i.company.riskProfileAssessment.outflowExpectedTransactions.numberOfTransactionMonthly,i.company.riskProfileAssessment.outflowExpectedTransactions.transactionsValueMonthly||delete i.company.riskProfileAssessment.outflowExpectedTransactions.transactionsValueMonthly;var l=(0,g.get)(n,"data.data._id").toString();return t.emit("@set-is-page-loading",!0),p.put("/kyb/application/".concat(l),i).then(W(U().mark((function e(s){return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("OK"!==(null===s||void 0===s?void 0:s.status)){e.next=3;break}return r("Successfully saved the progress","success"),e.abrupt("return",t.emit("@stepper",2));case 3:return r("Something went wrong","error"),e.abrupt("return",null);case 5:case"end":return e.stop()}}),e)})))).catch((function(e){r(e.message,"error")})).finally((function(){t.emit("@set-is-page-loading",!1)}))}),[r,t,p,n]);return{handleOnBack:(0,a.useCallback)((function(){return n.mutate(),t.emit("@stepper",1)}),[n,t]),handleOnSave:h,handleOnNext:(0,a.useCallback)((function(){return t.emit("@stepper",3)}),[t]),handleOnSubmit:(0,a.useCallback)((function(e){var s,o=(null===(s=e.country)||void 0===s?void 0:s.label)?[e.country.label]:[],a=[];if((0,g.get)(e,"primaryBanks",[]).map((function(e){return a.push(e.value)})),"SG"===(0,g.get)(e,"country.value","")&&"32"===e.blockHouse&&"pekin street"===(e.streetName||"").toLowerCase()&&"048762"===e.postalCode)return r("Please enter another address as Grof's registered address cannot be considered as your company's principle place of business","error"),null;var i={company:{addresses:{isSameBusinessAddress:e.isSameBusinessAddress,principalPlaceOfBusiness:{blockHouse:e.blockHouse||"",buildingName:e.buildingName||"",level:e.level||"",unit:e.unit||"",postalCode:e.postalCode||"",country:(0,g.get)(e,"country.value",null)||"",streetName:e.streetName||"",city:e.city||"",state:e.state||"",addressLine1:e.addressLine1||"",addressLine2:e.addressLine2||""}}
1,businessDetails:{businessWebsite:e.website||"",doingBusinessAs:e.doingBusinessAs||"",primaryIndustry:(0,g.get)(e,"primaryIndustry.value",null),businessDescription:e.businessDescription||""},riskProfileAssessment:{countryOfOperations:o,annualTurnover:(0,g.get)(e,"annualTurnover.value",null),totalEmployees:(0,g.get)(e,"totalEmployees.value",null),transactionCountries:e.transactionCountries.map((function(e){return e.value}))||[],intendedUseOfAccount:(0,g.get)(e,"intendedUseOfAccount.value",void 0),inflowExpectedTransactions:{numberOfTransactionMonthly:(0,g.get)(e,"inflowNumberOfTransactionMonthly.value",null),transactionsValueMonthly:(0,g.get)(e,"inflowTransactionsValueMonthly.value",null),natureOfInflow:e.natureOfInflow},outflowExpectedTransactions:{numberOfTransactionMonthly:(0,g.get)(e,"outflowNumberOfTransactionMonthly.value",null),transactionsValueMonthly:(0,g.get)(e,"outflowTransactionsValueMonthly.value",null),natureOfOutflow:e.natureOfOutflow},primaryBanks:a,otherPrimaryBanks:e.primaryBanks.some((function(e){return"Others"===e.value}))?e.otherPrimaryBanks:[]}},currentStep:f},l=(0,g.get)(n,"data.data._id").toString();return t.emit("@set-is-page-loading",!0),p.put("/kyb/application/".concat(l),i).then(W(U().mark((function e(s){var o,a,i;return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("OK"!==(null===s||void 0===s?void 0:s.status)){e.next=7;break}return e.next=4,n.mutate();case 4:return r("Successfully saved the progress","success"),Z.Z.track("Additional Follow-up Question",{userID:d.userId,email:null===(o=d.profile)||void 0===o?void 0:o.emailAddresses[0],organizationID:s.data.organizationId,organizationName:null===(a=n.data.data)||void 0===a||null===(i=a.company)||void 0===i?void 0:i.companyName,serviceType:c,completedAt:(0,m.gS)(),deviceType:"Web"}),e.abrupt("return",t.emit("@stepper",f));case 7:return r("Something went wrong","error"),e.abrupt("return",null);case 9:case"end":return e.stop()}}),e)})))).catch((function(e){r(e.message,"error")})).finally((function(){t.emit("@set-is-page-loading",!1)}))}),[f,n,t,p,r,d.userId,null===(s=d.profile)||void 0===s?void 0:s.emailAddresses,c])}},K=t(51093);function H(e,s,t,r,o,n,a){try{var i=e[n](a),l=i.value}catch(u){return void t(u)}i.done?s(l):Promise.resolve(l).then(r,o)}var z=function(e){var s=e.emitter,t=(0,K.Z)(),r=(0,a.useRef)(N.q.getState()).current.setGlobalSnackbar,o=(0,u.SS)().companyInformation,n=(0,a.useMemo)((function(){var e,s;return null===o||void 0===o||null===(e=o.data)||void 0===e||null===(s=e.data)||void 0===s?void 0:s._id}),[o]),i=(0,M.Z)(),l=(0,a.useCallback)((function(){var e,t={applicationId:n};return i.post("kyb/core/discard-company-info",t).then((e=U().mark((function e(t){return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("OK"!==(null===t||void 0===t?void 0:t.status)){e.next=8;break}return o.mutate(),r("Successfully discarded the process.","info"),s.emit("@set-is-acra-error",!1),s.emit("@select-option",{key:"incorporation",value:!1}),s.emit("@select-option",{key:"corpSec",value:!1}),s.emit("@select-option",{key:"finance",value:!1}),e.abrupt("return",s.emit("@stepper",0));case 8:return r("Something went wrong","error"),e.abrupt("return",t);case 10:case"end":return e.stop()}}),e)})),function(){var s=this,t=arguments;return new Promise((function(r,o){var n=e.apply(s,t);function a(e){H(n,r,o,a,i,"next",e)}function i(e){H(n,r,o,a,i,"throw",e)}a(void 0)}))})).catch((function(e){r(e.message,"error")}))}),[n,i,r,o,s]);return(0,a.useEffect)((function(){return s.on("@modal/confirm",t.onToggle),function(){s.off("@modal/confirm",t.onToggle)}}),[t.onToggle,s]),{handleOnConfirm:l,confirmationModal:t}};function Y(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}var X=function(){var e=(0,u.SS)(),s=e.emitter,t=e.companyInformation,o=e.generalDropdownResponse,n=e.generalCountry,i=G({emitter:s}),l=i.handleOnSave,c=i.handleOnSubmit,d=(0,a.useState)(!1),p=d[0],m=d[1],f=(0,a.useRef)(N.q.getState()).current.setGlobalSnackbar;(0,a.useEffect)((function(){null===t||void 0===t||t.mutate()}),[]);var h=z({emitter:s}
1),x=h.confirmationModal,v=h.handleOnConfirm,y=(0,g.get)(t,"data.data",{}),j=(0,g.get)(o,"data.data",[]),D=(0,g.get)(t,"data.data.company.businessDetails.primaryIndustry",""),w=(0,g.get)(t,"data.data.company.riskProfileAssessment.totalEmployees",""),k=(0,g.get)(y,"company.riskProfileAssessment.annualTurnover",""),O=(0,g.get)(y,"company.riskProfileAssessment.intendedUseOfAccount",""),A=(0,g.get)(y,"company.riskProfileAssessment.inflowExpectedTransactions.numberOfTransactionMonthly",""),S=(0,g.get)(y,"company.riskProfileAssessment.outflowExpectedTransactions.numberOfTransactionMonthly",""),E=(0,g.get)(y,"company.addresses.isSameBusinessAddress",!1)?(0,g.get)(y,"company.addresses.registeredAddress.country",""):(0,g.get)(y,"company.addresses.principalPlaceOfBusiness.country",""),P=(0,g.get)(y,"company.riskProfileAssessment.transactionCountries",[]),T=(0,g.get)(y,"company.riskProfileAssessment.inflowExpectedTransactions.transactionsValueMonthly",""),I=(0,g.get)(y,"company.riskProfileAssessment.outflowExpectedTransactions.transactionsValueMonthly",""),F=(0,g.get)(y,"company.riskProfileAssessment.primaryBanks",[]),R=j.find((function(e){return"KybPrimaryBanks"in e})),L=null===R||void 0===R?void 0:R.KybPrimaryBanks.map((function(e){return{label:e,value:e}})),_=[];F.map((function(e){var s=null===L||void 0===L?void 0:L.find((function(s){return e===s.value}));return s?_.push(s):s}));var V=j.find((function(e){return"IndustrySectorType"in e})),U=j.find((function(e){return"EmployeesSizeType"in e})),M=j.find((function(e){return"TurnOverType"in e})),Z=j.find((function(e){return"NumberOfTransactionsMonthly"in e})),q=null===Z||void 0===Z?void 0:Z.NumberOfTransactionsMonthly.map((function(e){return{label:e,value:e}})),W=j.find((function(e){return"TransactionsValueMonthly"in e})),K=null===W||void 0===W?void 0:W.TransactionsValueMonthly.map((function(e){return{label:e,value:e}})),H=j.find((function(e){return"IntendedUseOfAccount"in e})),X=(0,g.get)(n,"data.data",[]).map((function(e){return{label:e.description,value:e.countryIso2Code,icon:(0,r.jsx)("img",{className:"sprout-mr-3 sprout-h-6",src:e.countryFlagUrl,alt:""})}})),Q=(0,g.get)(y,"company.addresses.isUseGrofRegisteredAddress",!1),$={website:(0,g.get)(y,"company.businessDetails.businessWebsite",""),doingBusinessAs:(0,g.get)(y,"company.businessDetails.doingBusinessAs",""),primaryIndustry:null===V||void 0===V?void 0:V.IndustrySectorType.find((function(e){return D===e.value})),businessDescription:(0,g.get)(y,"company.businessDetails.businessDescription",""),totalEmployees:null===U||void 0===U?void 0:U.EmployeesSizeType.find((function(e){return w===e.value})),annualTurnover:null===M||void 0===M?void 0:M.TurnOverType.find((function(e){return k===e.value})),inflowNumberOfTransactionMonthly:null===q||void 0===q?void 0:q.find((function(e){return A===e.value})),inflowTransactionsValueMonthly:null===K||void 0===K?void 0:K.find((function(e){return T===e.value})),natureOfInflow:(0,g.get)(y,"company.riskProfileAssessment.inflowExpectedTransactions.natureOfInflow",""),outflowNumberOfTransactionMonthly:null===q||void 0===q?void 0:q.find((function(e){return S===e.value})),outflowTransactionsValueMonthly:null===K||void 0===K?void 0:K.find((function(e){return I===e.value})),natureOfOutflow:(0,g.get)(y,"company.riskProfileAssessment.outflowExpectedTransactions.natureOfOutflow",""),primaryBanks:_,intendedUseOfAccount:null===H||void 0===H?void 0:H.IntendedUseOfAccount.find((function(e){return O===e.value})),transactionCountries:X.filter((function(e){return P.includes(e.value)})),blockHouse:(0,g.get)(y,"company.addresses.principalPlaceOfBusiness.blockHouse",null)||"",buildingName:(0,g.get)(y,"company.addresses.principalPlaceOfBusiness.buildingName",null)||"",level:(0,g.get)(y,"company.addresses.principalPlaceOfBusiness.level",null)||"",unit:(0,g.get)(y,"company.addresses.principalPlaceOfBusiness.unit",null)||"",postalCode:(0,g.get)(y,"company.addresses.principalPlaceOfBusiness.postalCode",null)||"",country:X.find((function(e){return E===e.value})),streetName:(0,g.get)(y,"company.addresses.principalPlaceOfBusiness.streetName",null)||"",city:(0,g.get)(y,"company.addresses.principalPlaceOfBusiness.city",null)||"",state:(0,g.get)(y,"company.addresses.principalPlaceOfBusiness.state",null)||"",addressLine1:(0,g.get)(y,"company.addresses.principalPlaceOfBusiness.addressLine1",null)||"",addressLine2:(0,g.get)(y,"company.addresses.principalPlaceOfBusiness.addressLine2",null)||"",isSameBusinessAddress:(0,g.get)(y,"company.addresses.isSameBusinessAddress"),otherPrimaryBanks:(0,g.get)(y,"company.riskProfileAssessment.otherPrimaryBanks",[])};return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)(C.Z,{open:x.isOpen,title:"Are you sure to discard this process?",okText:"Discard",okVariant:"primary",cancelVariant:"secondary",okRed:!0,onOk:v,onCancel:x.onClose,children:(0,r.jsx)("p",{className:"sprout-text-sm sprout-pt-4 sprout-pb-6 sprout-px-3",children:"This action will discard all inputted data, and it cannot be undone"})}),(0,r.jsx)(b.Z.form,{initialValues:$,onSubmit:function(e){var s=function(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){Y(e,s,t[s])}))}return e}({},e,{isUseGrofRegisteredAddress:"048762"===(0,g.get)(t,"data.data.company.addresses.registeredAddress.postalCode","")});c(s)},validation:function(e){return function(e){var s=e.isSameBusinessAddress,t={};return e.primaryIndustry||(t.primaryIndustry="This field is required"),e.businessDescription||(t.businessDescription="This field is required"),e.country?"SG"!==e.country.value||s||Q?"SG"===e.country.value||s||(e.addressLine1||(t.addressLine1="This field is required"),e.postalCode||(t.postalCode="This field is required")):(e.blockHouse||(t.blockHouse="This field is required"),"pekin"===e.streetName&&(t.postalCode="Grofs address is not considered a principal place of business"),e.postalCode||(t.postalCode="This field is required"),"05"===e.level&&"048762"===e.postalCode&&(t.postalCode="Grofs address is not considered a principal place of business")):t.country="This field is required",e.transactionCountries.length||(t.transactionCountries="This field is required"),e.totalEmployees||(t.totalEmployees="This field is required"),e.annualTurnover||(t.annualTurnover="This field is required"),e.inflowNumberOfTransactionMonthly||(t.inflowNumberOfTransactionMonthly="This field is required"),e.inflowTransactionsValueMonthly||(t.inflowTransactionsValueMonthly="This field is required"),e.natureOfInflow||(t.natureOfInflow="This field is required"),e.outflowNumberOfTransactionMonthly||(t.outflowNumberOfTransactionMonthly="This field is required"),e.outflowTransactionsValueMonthly||(t.outflowTransactionsValueMonthly="This field is required"),e.natureOfOutflow||(t.natureOfOutflow="This field is required"),0===e.primaryBanks.length&&(t.primaryBanks="This field is required"),e.primaryBanks.some((function(e){return"Others"===e.value}))&&(0===e.otherPrimaryBanks.length||e.otherPrimaryBanks.some((function(e){return 0===e.length})))&&(e.otherPrimaryBanks.length>0?e.otherPrimaryBanks.forEach((function(e,s){e.length<1&&(Array.isArray(t.otherPrimaryBanks)||(t.otherPrimaryBanks=[]),t.otherPrimaryBanks[s]="This field is required")})):t.otherPrimaryBanks="This field is required"),(0,g.get)(y,"services.finance",!1)&&(e.intendedUseOfAccount||(t.intendedUseOfAccount="This field is required")),Object.keys(t).length>0&&!p&&f("Please fill the required fields","error"),t}(e)}
1,validateOnChange:p,validateOnBlur:!1,scrollOnError:!0,children:(0,r.jsx)(B,{handleOnSave:l,confirmationModal:x,companyInformation:t,setValidate:m})})]})},Q=t(53952);function $(){var e=(0,w.useFormikContext)().errors,s=(0,u.SS)().mode,t=(0,a.useMemo)((function(){return Object.keys(e).some((function(e){return["_UEN"].includes(e)}))}),[e]);return(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2 md:sprout-flex-row sprout-w-full sprout-mt-9",children:[(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col md:sprout-flex-col sprout-w-full sprout-mt-2",children:(0,r.jsx)(b.Z.inputWithError,{name:"UEN",placeholder:"Enter your Company UEN",containerClass:"sprout-w-full sprout-flex-row",autoFocus:!0,required:!0,errorClass:"sprout-text-red-500 sprout-text-xs sprout-w-full",disabled:"upgrade"===s})}),(0,r.jsx)("div",{className:"sprout-mt-0",children:(0,r.jsx)(D.iR,{primary:!0,className:"sprout-mt-2 md:sprout-mt-0 md:sprout-ml-2.5 sprout-w-max",type:"submit",disabled:t,children:"Get Info"})})]})}var J=t(74201),ee=t(83068);function se(e,s,t,r,o,n,a){try{var i=e[n](a),l=i.value}catch(u){return void t(u)}i.done?s(l):Promise.resolve(l).then(r,o)}function te(e){return function(){var s=this,t=arguments;return new Promise((function(r,o){var n=e.apply(s,t);function a(e){se(n,r,o,a,i,"next",e)}function i(e){se(n,r,o,a,i,"throw",e)}a(void 0)}))}}function re(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function oe(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){re(e,s,t[s])}))}return e}var ne=function(e){var s,t,r=e.emitter,o=(0,a.useRef)(N.q.getState()).current.setGlobalSnackbar,n=(0,u.SS)(),i=n.isChecked,l=n.companyInformation,c=n.isACRAError,d=n.serviceType,p=n.mode,f=n.isUseGrofND,h=(0,y.a)().profileState,x=(0,M.Z)({isHideErrorSnackBar:!0}),v=(0,a.useCallback)((function(e,s){var t={};return s.forEach((function(s){"undefined"!==typeof e[s]&&null!==e[s]&&(t[s]=e[s])})),t}),[]),j=(0,a.useCallback)((function(e,s){var t,r,o=(null===e||void 0===e?void 0:e.company)||{},n=(null===o||void 0===o?void 0:o.members)||[];if(n.length){for(var a=0;a<n.length;a+=1){for(var u,d,m=n[a],h=(null===m||void 0===m?void 0:m.sharesDetails)||[],x=0;x<h.length;x+=1){var y=h[x];h[x]=v(y,["shareAllotted","shareType","sharePercentage","shareCurrency","appointmentDate","cessationDate","status","holderType"])}n[a].sharesDetails=h;for(var g,j=(null===m||void 0===m?void 0:m.appointments)||[],b=0;b<j.length;b+=1){var N=j[b];j[b]=v(N,["_id","position","appointmentDate","resignedDate","status"])}if(n[a].appointments=j,m.companyDetails){var C,D;if(null===(C=m.companyDetails.addresses)||void 0===C?void 0:C.registeredAddress){var w=m.companyDetails.addresses.registeredAddress;n[a].companyDetails.addresses.registeredAddress=v(w,["addressLine1:","addressLine2","city","state","postalCode","country","blockHouse","streetName","buildingName","level","unit"])}(null===(D=m.companyDetails.legalDetails)||void 0===D?void 0:D.registrationDate)&&(n[a].companyDetails.legalDetails.registrationDate=(0,J.Z)(new Date(m.companyDetails.legalDetails.registrationDate),"yyyy-MM-dd"))}if((null===(u=m.personDetails)||void 0===u||null===(d=u.personalDetails)||void 0===d?void 0:d.alias)&&(n[a].personDetails.personalDetails.alias=n[a].personDetails.personalDetails.alias.filter((function(e){return!!e}))),n[a].personDetails)n[a].personDetails.createdAt=void 0,n[a].personDetails.updatedAt=void 0,n[a].personDetails._id=void 0,n[a].personDetails.__v=void 0,n[a].personDetails.isMatchWithUser=void 0,(null===(g=n[a].personDetails.address)||void 0===g?void 0:g.postcode)&&(n[a].personDetails.address.postalCode=n[a].personDetails.address.postcode,n[a].personDetails.address.postcode=void 0);"upgrade"===p&&(n[a].userId=void 0)}o.members=n}var k=null===o||void 0===o?void 0:o.isAppointGrofND;"upgrade"===p&&(k=void 0),c&&(k=f);var O=(null===(t=o.legalDetails)||void 0===t?void 0:t.registrationDate)?(0,J.Z)(new Date(o.legalDetails.registrationDate),"yyyy-MM-dd"):void 0;return oe({uen:c?s.UEN:null===l||void 0===l||null===(r=l.temporaryData)||void 0===r?void 0:r.uen},c?{isManualFill:!0}:{},{company:oe({},o,{addresses:oe({},(null===o||void 0===o?void 0:o.addresses)||{},{isUseGrofRegisteredAddress:i||!1,isSameBusinessAddress:!i&&s.isSameBusinessAddress}),legalDetails:oe({},o.legalDetails,c?{uen:s.UEN}:{},{registrationDate:O}),isAppointGrofND:k})})}),[p,c,null===l||void 0===l||null===(s=l.temporaryData)||void 0===s?void 0:s.uen,i,v,f]),b=(0,a.useCallback)(te(U().mark((function e(s){var t,n,a,i,u,c,d;return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=(null===l||void 0===l||null===(t=l.temporaryData)||void 0===t?void 0:t.company)||{},u=(null===l||void 0===l||null===(n=l.data)||void 0===n||null===(a=n.data)||void 0===a?void 0:a.organizationId)||"",c=oe({}
1,j(null===l||void 0===l?void 0:l.temporaryData,s),{currentStep:1}),d=(0,g.get)(l,"data.data._id",""),r.emit("@set-is-page-loading",!0),e.abrupt("return",x.put("/kyb/application/".concat(d),c).then(te(U().mark((function e(s){var t,n,a,l,c;return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("OK"!==(null===s||void 0===s?void 0:s.status)){e.next=7;break}return a=i.companyName,l=null===(t=i.legalDetails)||void 0===t?void 0:t.uen,c=null===(n=i.legalDetails)||void 0===n?void 0:n.countryOfRegisteredBusiness,a||l||c?x.put("/organization/".concat(u),{companyName:a,freemiumDetails:{registrationCountry:c,uen:l}}).then((function(){o("Successfully saved the progress","success")})).finally((function(){r.emit("@set-is-page-loading",!1)})):(o("Successfully saved the progress","success"),r.emit("@set-is-page-loading",!1)),e.abrupt("return",r.emit("@stepper",1));case 7:throw r.emit("@set-is-page-loading",!1),o("Something went wrong","error"),new Error("Something went wrong");case 10:case"end":return e.stop()}}),e)})))).catch((function(e){throw r.emit("@set-is-page-loading",!1),o(e.message,"error"),e})));case 7:case"end":return e.stop()}}),e)}))),[l,j,r,x,o]);return{handleOnBack:(0,a.useCallback)((function(){return l.mutate(),r.emit("@stepper",0)}),[l,r]),handleOnSave:b,handleOnNext:(0,a.useCallback)(te(U().mark((function e(s){var t,n,a,i,u,p,v;return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.emit("@set-company-information-next-button-clicked",!0),!c||null!==f){e.next=4;break}return e.abrupt("return",null);case 4:return i=(null===l||void 0===l||null===(t=l.temporaryData)||void 0===t?void 0:t.company)||{},u=(null===l||void 0===l||null===(n=l.data)||void 0===n||null===(a=n.data)||void 0===a?void 0:a.organizationId)||"",p=oe({},j(null===l||void 0===l?void 0:l.temporaryData,s),{currentStep:2}),v=(0,g.get)(l,"data.data._id",""),r.emit("@set-is-page-loading",!0),e.abrupt("return",x.put("/kyb/application/".concat(v),p).then(te(U().mark((function e(s){var t,n,a,c,p,f;return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("OK"!==(null===s||void 0===s?void 0:s.status)){e.next=8;break}return c=i.companyName,p=null===(t=i.legalDetails)||void 0===t?void 0:t.uen,f=null===(n=i.legalDetails)||void 0===n?void 0:n.countryOfRegisteredBusiness,Z.Z.track("Company Information",{userID:h.userId,email:null===(a=h.profile)||void 0===a?void 0:a.emailAddresses[0],organizationID:s.data.organizationId,organizationName:c,serviceType:d,completedAt:(0,m.gS)(),deviceType:"Web"}),c||p||f?x.put("/organization/".concat(u),{companyName:c,freemiumDetails:{registrationCountry:f,uen:p}}).then(te(U().mark((function e(){return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,l.mutate();case 2:o("Successfully saved the progress","success");case 3:case"end":return e.stop()}}),e)})))).finally((function(){r.emit("@set-is-page-loading",!1)})):(l.mutate(),o("Successfully saved the progress","success"),r.emit("@set-is-page-loading",!1)),e.abrupt("return",r.emit("@stepper",2));case 8:throw r.emit("@set-is-page-loading",!1),o("Something went wrong","error"),new Error("Something went wrong");case 11:case"end":return e.stop()}}),e)})))).catch((function(e){throw r.emit("@set-is-page-loading",!1),o(e.message,"error"),e})));case 10:case"end":return e.stop()}}),e)}))),[l,j,r,x,o,h.userId,null===(t=h.profile)||void 0===t?void 0:t.emailAddresses,d,c,f]),handleOnSubmit:(0,a.useCallback)((function(e,s){var t=e.uen,n=s.setFieldError;return r.emit("@submit-uen",t),x.post("kyb/core/generate-company-info",{uen:t,mode:p}).then(te(U().mark((function e(s){return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"OK"!==(null===s||void 0===s?void 0:s.status)&&(n("UEN",null===s||void 0===s?void 0:s.message),["51","52","53","54","55","56"].includes(null===s||void 0===s?void 0:s.code)||r.emit("@set-is-acra-error",!0)),l.setTemporaryData(s.data),l.mutate(),e.abrupt("return",s);case 4:case"end":return e.stop()}}),e)})))).catch((function(){o("Something went wrong","error"),r.emit("@set-is-acra-error",!0)}))}),[x,l,o,r,p]),handleOnChecked:(0,a.useCallback)((function(e){return r.emit("@set-reg-a
1ddress",e)}),[r]),handleOnCheckedND:(0,a.useCallback)((function(e){return r.emit("@set-use-grof-nd",e)}),[r])}};function ae(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function ie(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){ae(e,s,t[s])}))}return e}function le(){var e,s,t,o=(0,u.SS)(),n=o.emitter,i=o.companyInformation,l=o.selectedOption,c=ne({emitter:n}).handleOnChecked,d=(0,a.useMemo)((function(){var e,s;return(null===i||void 0===i||null===(e=i.temporaryData)||void 0===e?void 0:e.company)?i.temporaryData:(null===i||void 0===i||null===(s=i.data)||void 0===s?void 0:s.data)?i.data.data:{uen:""}}),[i]),p=(0,a.useCallback)((function(e){var s=(0,g.get)(e,"country",null),t=(0,g.get)(e,"streetName",null),r=(0,g.get)(e,"blockHouse",null),o=(0,g.get)(e,"level",null),n=(0,g.get)(e,"unit",null),a=(0,g.get)(e,"postalCode",null),i=(0,g.get)(e,"buildingName",null),l=(0,g.get)(e,"city",null),u=(0,g.get)(e,"state",null),c=(0,g.get)(e,"addressLine1",null),d=(0,g.get)(e,"addressLine1",null);if("SG"===s){var p="".concat(r,", ").concat(t),m="";return(o||n)&&(m="#".concat(o||"01","-").concat(n||"01")),i&&(m=m?"".concat(m," ").concat(i):i),ie({addressLine1:p},m?{addressLine2:m}:{addressLine2:""},{postcode:a,city:"Singapore",state:"Singapore",country:s})}return ie({addressLine1:c},d?{addressLine2:d}:{},{state:u,city:l,postcode:a,country:s})}),[]),m=(null===d||void 0===d?void 0:d.company.sharesDetails.filter((function(e){return e.shareAllotted&&!Number.isNaN(Number(e.shareAllotted))&&Number(e.shareAllotted)||e.paidUpShareCapital&&!Number.isNaN(Number(e.paidUpShareCapital))&&Number(e.paidUpShareCapital)})))||[],f=(0,a.useMemo)((function(){return(null===d||void 0===d?void 0:d.company.addresses)?p(d.company.addresses.registeredAddress):null}),[d,p]),h=String((null===d||void 0===d||null===(e=d.company)||void 0===e||null===(s=e.addresses)||void 0===s||null===(t=s.registeredAddress)||void 0===t?void 0:t.postalCode)||"").includes("048762");if((null===d||void 0===d?void 0:d.uen)&&(null===d||void 0===d?void 0:d.company.legalDetails)&&(null===d||void 0===d?void 0:d.company.addresses)){var x="".concat(null===f||void 0===f?void 0:f.addressLine1," ").concat(null===f||void 0===f?void 0:f.addressLine2," ").concat(null===f||void 0===f?void 0:f.country," ").concat(null===f||void 0===f?void 0:f.postcode),v=(0,g.get)(i,"data.data.company.addresses.isUseGrofRegisteredAddress",!1);return(0,r.jsxs)("div",{className:"sprout-grid md:sprout-grid-cols-2 sprout-gap-6",children:[(0,r.jsx)("div",{className:"sprout-p-5 sprout-border-2 sprout-border-gray sprout-rounded-2xl",children:(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-4",children:[(0,r.jsx)("h3",{className:"sprout-font-semibold",children:"Company Summary Information"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:"Company Name"}),(0,r.jsx)("p",{children:(0,g.get)(d,"company.companyName","")})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:"Company Type"}),(0,r.jsx)("p",{children:(0,g.get)(d,"company.legalDetails.companyType","")})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:"Formerly Known As"}),(0,r.jsx)("p",{children:(null===d||void 0===d?void 0:d.company.legalDetails.historyName)||"-"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:"Entity Status"}),(0,r.jsx)("p",{children:(0,g.get)(d,"company.legalDetails.entityStatus","")})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:"Entity Type"}),(0,r.jsx)("p",{children:(0,g.get)(d,"company.legalDetails.entityType","")})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:"Incorporation Date"}),(0,r.jsx)("p",{children:(0,g.get)(d,"company.legalDetails.registrationDate",null)?(0,J.Z)(new Date((0,g.get)(d,"company.legalDetails.registrationDate","")),"dd/MM/yyyy"):""})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:"Country of Registration"}),(0,r.jsx)("p",{children:(0,g.get)(d,"company.legalDetails.countryOfRegisteredBusiness","")})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:"Registered Address"}),(0,r.jsx)("p",{children:x})]}),l.corpSec&&(0,r.jsxs)("div",{className:"sprout-flex",children:[(0,r.jsxs)("label",{className:"sprout-inline-flex sprout-cursor-pointer",children:[(0,r.jsx)("input",{type:"checkbox",value:"",checked:h||v,defaultChecked:v||h,disabled:h,className:"sprout-sr-only sprout-peer",onChange:function(e){return c(e.target.checked)}}),(0,r.jsx)("div",{className:"sprout-relative sprout-w-11 sprout-h-6 sprout-bg-gray-200 peer-focus:sprout-outline-none peer-focus:sprout-ring-4 peer-focus:sprout-ring-orange-300 sprout-rounded-full peer peer-checked:after:sprout-translate-x-full rtl:peer-checked:after:-sprout-translate-x-full peer-checked:after:sprout-border-white after:sprout-content-[''] after:sprout-absolute after:sprout-top-[2px] after:sprout-start-[2px] after:sprout-bg-white after:sprout-border-gray-300 after:sprout-border after:sprout-rounded-full after:sprout-h-5 after:sprout-w-5 after:sprout-transition-all peer-checked:sprout-bg-orange-600"})]}),(0,r.jsxs)("div",{className:"sprout-ml-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"Use Grof\u2019s Registered Address"}),(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:"Use Grof's address for all official correspondence and records relating to your company."})]})]})]})}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-sp
1ace-y-6",children:[(0,r.jsx)("div",{className:"sprout-p-5 sprout-border-2 sprout-border-gray sprout-rounded-2xl",children:(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-4",children:[(0,r.jsx)("h3",{className:"sprout-font-semibold",children:"Business Activity"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:"Primary SSIC"}),(0,r.jsx)("p",{children:(0,g.get)(d,"company.ssic.primary.description","")})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:"Description of Primary SSIC"}),(0,r.jsx)("p",{children:"-"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:"Secondary SSIC"}),(0,r.jsx)("p",{children:(0,g.get)(d,"company.ssic.primary.otherDescription","-")})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:"Description of Secondary SSIC"}),(0,r.jsx)("p",{children:"-"})]})]})}),(0,r.jsx)("div",{className:"sprout-p-5 sprout-border-2 sprout-border-gray sprout-rounded-2xl",children:(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-4",children:[(0,r.jsx)("h3",{className:"sprout-font-semibold",children:"Capital Summary"}),m.length?m.map((function(e,s){return(0,r.jsxs)("div",{className:"sprout-grid sprout-grid-cols-2 sprout-gap-4",children:[(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-4",children:(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:"Total Paid-Up Capital"}),(0,r.jsx)("p",{children:(0,ee.Z)(e.paidUpShareCapital,e.currency)})]})}),(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-4",children:(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:"Share Type"}),(0,r.jsx)("p",{children:e.shareType})]})}),(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-4",children:(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:"Total Number of Shares"}),(0,r.jsx)("p",{children:(0,ee.t)(e.shareAllotted,2)})]})})]},"shares_".concat(s))})):(0,r.jsxs)("div",{className:"sprout-grid sprout-grid-cols-2 sprout-gap-4",children:[(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-4",children:(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:"Total Paid-Up Capital"}),(0,r.jsx)("p",{children:"-"})]})}),(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-4",children:(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:"Share Type"}),(0,r.jsx)("p",{children:"-"})]})}),(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-4",children:(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:"Total Number of Shares"}),(0,r.jsx)("p",{children:"-"})]})})]})]})})]})]})}return null}function ue(){return(0,r.jsx)("div",{className:"md:sprout-p-5 sprout-border-2 sprout-border-gray sprout-rounded-2xl",children:(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-justify-between sprout-items-center sprout-py-32",children:[(0,r.jsx)(v.S,{}),(0,r.jsx)("p",{className:"sprout-mt-4",children:"Loading data, please wait"})]})})}function ce(e,s,t,r,o,n,a){try{var i=e[n](a),l=i.value}catch(u){return void t(u)}i.done?s(l):Promise.resolve(l).then(r,o)}var de=function(e){var s=e.emitter,t=(0,a.useRef)(N.q.getState()).current.setGlobalSnackbar,r=(0,K.Z)(),o=(0,u.SS)().companyInformation,n=(0,a.useMemo)((function(){var e,s;return null===o||void 0===o||null===(e=o.data)||void 0===e||null===(s=e.data)||void 0===s?void 0:s._id}),[o]),i=(0,M.Z)(),l=(0,a.useCallback)((function(){var e,r={applicationId:n};return i.post("kyb/core/discard-company-info",r).then((e=U().mark((function e(r){return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("OK"!==(null===r||void 0===r?void 0:r.status)){e.next=8;break}return o.mutate(),t("Successfully discarded the process.","info"),s.emit("@set-is-acra-error",!1),s.emit("@select-option",{key:"incorporation",value:!1}
1),s.emit("@select-option",{key:"corpSec",value:!1}),s.emit("@select-option",{key:"finance",value:!1}),e.abrupt("return",s.emit("@stepper",0));case 8:return t("Something went wrong","error"),e.abrupt("return",r);case 10:case"end":return e.stop()}}),e)})),function(){var s=this,t=arguments;return new Promise((function(r,o){var n=e.apply(s,t);function a(e){ce(n,r,o,a,i,"next",e)}function i(e){ce(n,r,o,a,i,"throw",e)}a(void 0)}))})).catch((function(e){t(e.message,"error")}))}),[n,i,t,o,s]);return(0,a.useEffect)((function(){return s.on("@modal/confirm",r.onToggle),function(){s.off("@modal/confirm",r.onToggle)}}),[r.onToggle,s]),{handleOnConfirm:l,confirmationModal:r}};function pe(){var e=(0,u.SS)(),s=e.emitter,t=e.isChecked,o=e.selectedOption,n=e.isUseGrofND,a=e.isCompanyInformationNextButtonClicked,i=ne({emitter:s}),l=i.handleOnChecked,c=i.handleOnCheckedND;return(0,r.jsx)("div",{className:"sprout-p-5 sprout-border-2 sprout-border-gray sprout-rounded-2xl",children:(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-4",children:[(0,r.jsx)("h3",{className:"sprout-font-semibold",children:"UEN"}),(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:"Our services will help to retrieve your company's information based on the UEN you have provided."}),(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col md:sprout-flex-col sprout-w-full sprout-mt-2",children:(0,r.jsx)(b.Z.inputWithError,{name:"UEN",placeholder:"Enter your Company UEN",containerClass:"sprout-w-full sprout-flex-row",autoFocus:!0,required:!0,errorClass:"sprout-text-red-500 sprout-text-xs sprout-w-full"})}),o.corpSec&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("h3",{className:"sprout-font-semibold",children:"Company\u2019s Registered Address"}),(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:"Please provide the official registered address for your company. This address will be used for official notifications and correspondence."}),(0,r.jsxs)("div",{className:"sprout-flex",children:[(0,r.jsxs)("label",{className:"sprout-inline-flex sprout-cursor-pointer",children:[(0,r.jsx)("input",{type:"checkbox",value:"",defaultChecked:t,className:"sprout-sr-only sprout-peer",onChange:function(e){return l(e.target.checked)}}),(0,r.jsx)("div",{className:"sprout-relative sprout-w-11 sprout-h-6 sprout-bg-gray-200 peer-focus:sprout-outline-none peer-focus:sprout-ring-4 peer-focus:sprout-ring-orange-300 sprout-rounded-full peer peer-checked:after:sprout-translate-x-full rtl:peer-checked:after:-sprout-translate-x-full peer-checked:after:sprout-border-white after:sprout-content-[''] after:sprout-absolute after:sprout-top-[2px] after:sprout-start-[2px] after:sprout-bg-white after:sprout-border-gray-300 after:sprout-border after:sprout-rounded-full after:sprout-h-5 after:sprout-w-5 after:sprout-transition-all peer-checked:sprout-bg-orange-600"})]}),(0,r.jsxs)("div",{className:"sprout-ml-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"Use Grof\u2019s Registered Address."}),(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:"Use Grof's address for all official correspondence and records relating to your company."})]})]}),(0,r.jsx)("h4",{className:"sprout-text-sm sprout-font-semibold",children:"Would you like to appoint Grof's Resident Director?"}),(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Every company in Singapore is required to have at least one Resident Director who is either a Singaporean citizen, a permanent resident, or a holder of an EntrePass/Employment/Dependent Pass with a locally registered address. A Resident Director fulfills this legal requirement without being involved in the day-to-day operations or management decisions of the company."}),(0,r.jsxs)("div",{className:"sprout-flex sprout-mt-4",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-items-center sprout-me-4",children:[(0,r.jsx)("input",{type:"radio",value:"Yes",name:"company.isAppointGrofND",checked:!0===n,onChange:function(){return c(!0)},className:"sprout-box-border sprout-appearance-none sprout-w-[14px] sprout-h-[14px] sprout-border-[2px] sprout-border-solid sprout-border-white sprout-rounded-sm sprout-outline sprout-outline-1 sprout-outline-[#8E8E8E] checked:sprout-bg-primary"}),(0,r.jsx)("label",{className:"sprout-ms-2 sprout-text-gray-900",children:"Yes"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-items-center sprout-me-4",children:[(0,r.jsx)("input",{type:"radio",value:"No",name:"company.isAppointGrofND",checked:!1===n,onChange:function(){return c(!1)},className:"sprout-box-border sprout-appearance-none sprout-w-[14px] sprout-h-[14px] sprout-border-[2px] sprout-border-solid sprout-border-white sprout-rounded-sm sprout-outline sprout-outline-1 sprout-outline-[#8E8E8E] checked:sprout-bg-primary"}),(0,r.jsx)("label",{className:"sprout-ms-2 sprout-text-gray-900 ",children:"No"})]})]}),(0,r.jsx)("div",{className:"sprout-text-red-500 sprout-text-xs",children:null===n&&a?"This field is required":""})]})]})})}function me(e,s,t,r,o,n,a){try{var i=e[n](a),l=i.value}catch(u){return void t(u)}i.done?s(l):Promise.resolve(l).then(r,o)}var fe=function(e){var s=e.isAllowSave,t=(0,w.useFormikContext)().values,o=(0,u.SS)(),n=o.emitter,a=o.isACRAError,i=ne({emitter:n}).handleOnSave;return(0,r.jsx)(D.iR,{disabled:!s&&!a,secondary:!0,onClick:function(){return i(t)},children:"Save"})},he=function(e){var s=e.isAllowNext,t=(0,w.useFormikContext)().values,o=(0,u.SS)(),n=o.emitter,a=o.isACRAError,i=o.isUseGrofND,l=o.isCompanyInformationNextButtonClicked,c=ne({emitter:n}).handleOnNext;return(0,r.jsxs)(D.iR,{primary:!0,disabled:!s&&!a||a&&null===i&&l,onClick:function(){return c(t)},children:["Next Step"," ",(0,r.jsx)(Q.$e,{className:{svg:"sprout-ml-2",stroke:s?"#FFFFFF":"#8E8E8E"}})]})},xe=function(){var e,s,t,o,n,i,l,c,d,p,m,f,h,x,v,y,g,j,N,D,w=(0,u.SS)(),k=w.companyInformation,O=w.emitter,A=w.isACRAError,S=de({emitter:O}),E=S.confirmationModal,P=S.handleOnConfirm,T=ne({emitter:O}).handleOnSubmit,I=(0,a.useState)(!1),F=I[0],R=I[1],L=(0,a.useCallback)((function(e){var s={};return e.UEN||(s._UEN="This field is required"),s}),[]),_=(0,a.useCallback)((D=U().mark((function e(s,t){var r,o;return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=s.UEN,o=t.setFieldError,R(!0),e.next=4,T({uen:r},{setFieldError:o});case 4:R(!1);case 5:case"end":return e.stop()}}),e)})),function(){var e=this,s=arguments;return new Promise((function(t,r){var o=D.apply(e,s);function n(e){me(o,t,r,n,a,"next",e)}function a(e){me(o,t,r,n,a,"throw",e)}n(void 0)}))}),[T]);return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)(C.Z,{open:E.isOpen,title:"Are you sure to discard this process?",okText:"Discard",okVariant:"primary",cancelVariant:"secondary",okRed:!0,onOk:P,onCancel:E.onClose,children:(0,r.jsx)("p",{className:"sprout-text-sm sprout-pt-4 sprout-pb-6 sprout-px-3",children:"This action will discard all inputted data, and it cannot be undone"})}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col",children:[!A&&(0,r.jsx)("p",{className:"sprout-font-semibold",children:"Unique Entity Number"}),(0,r.jsxs)(b.Z.form,{validateOnMount:!0,onSubmit:_,validation:L,initialValues:{UEN:null===k||void 0===k||null===(e=k.data)||void 0===e||null===(s=e.data)||void 0===s?void 0:s.uen}
1,scrollOnError:!0,children:[!A&&(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)($,{}),(0,r.jsx)("div",{className:"sprout-mt-8 ",children:F?(0,r.jsx)(ue,{}):((null===(t=k.temporaryData)||void 0===t?void 0:t.company)||(null===k||void 0===k||null===(o=k.data)||void 0===o||null===(n=o.data)||void 0===n?void 0:n.company))&&(0,r.jsx)(le,{})})]}),A&&(0,r.jsx)(pe,{}),(0,r.jsxs)("div",{className:"sprout-flex sprout-justify-end sprout-space-x-6 sprout-mt-8",children:[(0,r.jsx)(fe,{isAllowSave:(null===(i=k.temporaryData)||void 0===i||null===(l=i.company)||void 0===l||null===(c=l.members)||void 0===c?void 0:c.length)>0||(null===k||void 0===k||null===(d=k.data)||void 0===d||null===(p=d.data)||void 0===p||null===(m=p.company)||void 0===m||null===(f=m.members)||void 0===f?void 0:f.length)>0}),(0,r.jsx)(he,{isAllowNext:(null===(h=k.temporaryData)||void 0===h||null===(x=h.company)||void 0===x||null===(v=x.members)||void 0===v?void 0:v.length)>0||(null===k||void 0===k||null===(y=k.data)||void 0===y||null===(g=y.data)||void 0===g||null===(j=g.company)||void 0===j||null===(N=j.members)||void 0===N?void 0:N.length)>0})]}),(0,r.jsxs)("p",{className:"sprout-mt-6",children:["If you wish to discard the existing onboarding process or start a new one,",(0,r.jsx)("span",{className:"sprout-ml-2 sprout-font-semibold sprout-text-[#960F21] sprout-cursor-pointer",onClick:E.onOpen,children:"click here"})]})]})]})]})};function ve(e,s,t,r,o,n,a){try{var i=e[n](a),l=i.value}catch(u){return void t(u)}i.done?s(l):Promise.resolve(l).then(r,o)}var ye=function(e){var s,t,r=e.emitter,o=(0,u.SS)(),n=o.selectedOption,i=o.companyInformation,l=(0,y.a)(),c=l.mutate,d=l.profileState,p=(0,a.useRef)(N.q.getState()).current.setGlobalSnackbar,f=(0,M.Z)(),h={services:n};return{handleOnChangeSelect:(0,a.useCallback)((function(e,s){r.emit("@select-option",{key:e,value:s})}),[r]),handleOnSubmit:(0,a.useCallback)((function(){return r.emit("@set-is-page-loading",!0),f.post("/kyb/application/create",h).then((e=U().mark((function e(s){var t;return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("OK"!==(null===s||void 0===s?void 0:s.status)){e.next=7;break}return Z.Z.track("Click start application",{userID:d.userId,email:null===(t=d.profile)||void 0===t?void 0:t.emailAddresses[0],organizationID:s.data.organizationId,organizationName:"",completedAt:(0,m.gS)(),deviceType:"Web"}),r.emit("@set-is-loaded",!0),c(),i.mutate(),e.abrupt("return",r.emit("@stepper",1));case 7:return p("Something went wrong","error"),e.abrupt("return",null);case 9:case"end":return e.stop()}}),e)})),function(){var s=this,t=arguments;return new Promise((function(r,o){var n=e.apply(s,t);function a(e){ve(n,r,o,a,i,"next",e)}function i(e){ve(n,r,o,a,i,"throw",e)}a(void 0)}))})).catch((function(e){p(e.message,"error")})).finally((function(){r.emit("@set-is-page-loading",!1)}));var e}),[r,f,h,p,d.userId,null===(s=d.profile)||void 0===s?void 0:s.emailAddresses,c,i]),handleOnChooseService:(0,a.useCallback)((function(e){var s;Z.Z.track(["Appoint Grof as My Secretary","Set up a Company (Pte. Ltd.)","Payments & Expense Management"][e],{userID:d.userId,email:null===(s=d.profile)||void 0===s?void 0:s.emailAddresses[0],completedAt:(0,m.gS)(),deviceType:"Web"})}),[d.userId,null===(t=d.profile)||void 0===t?void 0:t.emailAddresses])}},ge=function(){var e=(0,y.a)().profileState.profile,s=(0,u.SS)(),t=s.emitter,o=s.selectedOption,n=ye({emitter:t}),i=n.handleOnSubmit,l=n.handleOnChangeSelect,c=n.handleOnChooseService;return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)("div",{className:(0,m.WD)(["sprout-relative sprout-flex sprout-flex-col","sprout-border sprout-border-[#CDCDCD] sprout-border-solid sprout-rounded-[16px]","sprout-overflow-hidden"]),children:(0,r.jsxs)("div",{className:"sprout-p-4 md:sprout-p-8 sprout-flex sprout-flex-col sprout-space-y-4 md:sprout-space-y-8",children:[(0,r.jsxs)("p",{className:"sprout-text-sm md:sprout-text-base",children:["Hello, ",null===e||void 0===e?void 0:e.callFirstName," ",null===e||void 0===e?void 0:e.callLastName]}),(0,r.jsx)("p",{className:"sprout-text-sm md:sprout-text-base",children:"Congratulations on successfully creating an account. To ensure a smooth and efficie
1nt onboarding process for your company with Grof, please select the service you wish to onboard with us:"}),(0,r.jsx)("p",{className:"!sprout-font-semibold sprout-text-sm md:sprout-text-base",children:"Pick service you want to onboard:"}),(0,r.jsxs)("div",{className:(0,m.WD)(["sprout-relative sprout-flex sprout-flex-col","sprout-border sprout-border-[#CDCDCD] sprout-border-solid sprout-rounded-[16px] sprout-p-4","sprout-overflow-hidden","sprout-cursor-pointer","xl:hover:sprout-bg-[#FFF2E7] xl:hover:sprout-border-[#C4C4C4] sprout-border-2",o.corpSec&&"!sprout-border-[#FB8110] !sprout-bg-[#FEE6CF]"]),onClick:function(){l("corpSec",!0),l("finance",!1),l("incorporation",!1),c(0)},children:[(0,r.jsx)("h3",{className:"sprout-text-base md:sprout-text-xl sprout-font-semibold",children:"Appoint Grof as My Secretary"}),(0,r.jsx)("p",{className:"sprout-mt-2 sprout-text-sm md:sprout-text-base",children:"Get expert guidance, meticulous attention to filings, and ensure timely submissions simplifying your company administration."})]}),(0,r.jsxs)("div",{className:(0,m.WD)(["sprout-relative sprout-flex sprout-flex-col","sprout-border sprout-border-[#CDCDCD] sprout-border-solid sprout-rounded-[16px] sprout-p-4","sprout-overflow-hidden","sprout-cursor-pointer","xl:hover:sprout-bg-[#FEE6CF] xl:hover:sprout-border-[#C4C4C4] sprout-border-2",o.incorporation&&"!sprout-border-[#FB8110] !sprout-bg-[#FEE6CF]"]),onClick:function(){l("corpSec",!1),l("incorporation",!0),l("finance",!1),c(1)},children:[(0,r.jsx)("h3",{className:"sprout-text-base md:sprout-text-xl sprout-font-semibold",children:"Set up a Company (Pte. Ltd.)"}),(0,r.jsx)("p",{className:"sprout-mt-2 sprout-text-sm md:sprout-text-base",children:"Discover the simplicity of establishing your business entity with our incorporation services."})]})]})}),(0,r.jsx)(D.iR,{primary:!0,className:"sprout-mt-8",onClick:i,disabled:!o.corpSec&&!o.finance&&!o.incorporation,children:"Start Application"})]})},je=t(11163);function be(e,s,t,r,o,n,a){try{var i=e[n](a),l=i.value}catch(u){return void t(u)}i.done?s(l):Promise.resolve(l).then(r,o)}function Ne(e){return function(){var s=this,t=arguments;return new Promise((function(r,o){var n=e.apply(s,t);function a(e){be(n,r,o,a,i,"next",e)}function i(e){be(n,r,o,a,i,"throw",e)}a(void 0)}))}}function Ce(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function De(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){Ce(e,s,t[s])}))}return e}var we=function(e){var s,t=e.emitter,r=(0,M.Z)(),o=(0,a.useRef)(N.q.getState()).current.setGlobalSnackbar,n=(0,y.a)().profileState,i=(0,u.SS)(),l=i.companyInformation,c=i.selectedOption,d=i.isACRAError,p=i.serviceType,f=i.mode,h=i.service,x=(0,g.get)(l,"data.data",{_id:""}),v=(0,a.useCallback)((function(e){return e.map((function(e){var s,t,r,o,n,a=e;((null===(s=a.personDetails)||void 0===s||null===(t=s.personalDetails)||void 0===t?void 0:t.alias)&&(a.personDetails.personalDetails.alias=a.personDetails.personalDetails.alias.filter((function(e){return!!e}))),a.personDetails)&&(a.personDetails.createdAt=void 0,a.personDetails.updatedAt=void 0,a.personDetails._id=void 0,a.personDetails.__v=void 0,a.personDetails.isMatchWithUser=void 0,(null===(r=a.personDetails.address)||void 0===r?void 0:r.postcode)&&(a.personDetails.address.postalCode=a.personDetails.address.postcode,a.personDetails.address.postcode=void 0),a.personDetails.documents&&(a.personDetails.documents=a.personDetails.documents.map((function(e){return{id:e._id}}))),(null===(o=a.personDetails.personalDetails)||void 0===o?void 0:o.alias)&&(a.personDetails.personalDetails.alias=a.personDetails.personalDetails.alias.filter((function(e){return!!e}))),(null===(n=a.personDetails.personalDetails)||void 0===n?void 0:n.idDocument)&&(a.personDetails.personalDetails.idDocument.dateOfIssuance=a.personDetail
1s.personalDetails.idDocument.dateOfIssuance||void 0),a.personDetails.personalDetails&&(a.personDetails.personalDetails.gender=a.personDetails.personalDetails.gender||void 0,a.personDetails.personalDetails.countryOfBirth=a.personDetails.personalDetails.countryOfBirth||void 0,a.personDetails.personalDetails.dateOfBirth=a.personDetails.personalDetails.dateOfBirth||void 0));return De({},a,{appointments:a.appointments.filter((function(e){return"Corporate Representative of"!==e.position})),companyDetails:De({},e.companyDetails,{documents:(0,g.get)(e,"companyDetails.documents",[]).map((function(e){return{id:e._id}})),legalDetails:De({},e.companyDetails.legalDetails,{registrationDate:(0,J.Z)(new Date((0,g.get)(e,"companyDetails.legalDetails.registrationDate",null)),"yyyy-MM-dd")})})})}))}),[]),j=(0,a.useCallback)((function(e,s){var n,a=void 0===s||s,i={acraUpdateMode:"acra-update",company:{members:v(null===(n=e.company)||void 0===n?void 0:n.members)}},u=(0,g.get)(l,"data.data._id").toString();return t.emit("@set-is-page-loading",!0),r.put("/kyb/application/".concat(u),i).then(Ne(U().mark((function e(s){var t;return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("OK"!==(null===s||void 0===s?void 0:s.status)){e.next=4;break}return a&&o("Successfully saved the progress","success"),e.abrupt("return",null);case 4:return a&&o((null===s||void 0===s||null===(t=s.data)||void 0===t?void 0:t.message)||"Something went wrong","error"),e.abrupt("return",null);case 6:case"end":return e.stop()}}),e)})))).catch((function(e){a&&o(e.message,"error")})).finally((function(){t.emit("@set-is-page-loading",!1)}))}),[r,l,t,v,o]);return{handleOnBack:(0,a.useCallback)((function(){var e=3;return d&&!c.incorporation&&(e=2),!d&&c.corpSec&&(e=4),t.emit("@stepper",e)}),[t,d,c.corpSec,c.incorporation]),handleOnSave:j,handleOnNext:(0,a.useCallback)((function(){return t.emit("@stepper",6)}),[t]),handleOnEdit:(0,a.useCallback)((function(e){return t.emit("@stepper",e)}),[t]),handleOnSubmit:(0,a.useCallback)((function(){var e={applicationId:x._id};return t.emit("@set-is-page-loading",!0),r.post("/kyb/core/submit",e).then(Ne(U().mark((function e(s){var r,a,i,u,c,d;return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("OK"!==(null===s||void 0===s?void 0:s.status)){e.next=9;break}return e.next=4,l.mutate();case 4:if(o("Successfully submit KYB","success"),Z.Z.track("Review Application",{userID:n.userId,email:null===(r=n.profile)||void 0===r?void 0:r.emailAddresses[0],organizationID:null===(a=l.data)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.organizationId,organizationName:null===(u=l.data)||void 0===u||null===(c=u.data)||void 0===c||null===(d=c.company)||void 0===d?void 0:d.companyName,serviceType:p,completedAt:(0,m.gS)(),deviceType:"Web"}),"upgrade"!==f||"corporate-secretary"!==h){e.next=8;break}return e.abrupt("return",je.default.push("/compliance"));case 8:return e.abrupt("return",t.emit("@stepper",6));case 9:return o("Something went wrong","error"),e.abrupt("return",null);case 11:case"end":return e.stop()}}),e)})))).catch((function(e){o(e.message,"error")})).finally((function(){t.emit("@set-is-page-loading",!1)}))}),[r,x._id,l,t,f,null===(s=n.profile)||void 0===s?void 0:s.emailAddresses,n.userId,h,p,o])}};function ke(){var e,s,t,o,n,a,i,l,c,d,p,f,h,x,v,y,j,b,N,C,D,w,k,O,A=(0,u.SS)(),S=A.emitter,E=A.companyInformation,P=A.generalCountry,T=A.generalDropdownResponse,I=A.selectedOption,F=we({emitter:S}).handleOnEdit,R=(0,g.get)(E,"data.data"),L=(0,g.get)(E,"data.data.company.addresses.isUseGrofRegisteredAddress",!1),_=null===E||void 0===E||null===(e=E.data)||void 0===e?void 0:e.data,B=(0,g.get)(P,"data.data",[]),V=(0,g.find)(B,{countryName:null===_||void 0===_||null===(s=_.company)||void 0===s||null===(t=s.riskProfileAssessment)||void 0===t?void 0:t.countryOfOperations[0]}),U=(0,g.find)(B,{countryIso2Code:null===_||void 0===_||null===(o=_.company)||void 0===o||null===(n=o.addresses)||void 0===n||null===(a=n.principalPlaceOfBusiness)||void 0===a?void 0:a.country}),M=(0,g.get)(T,"data.data",[]),Z=M.find((function(e){return"IndustrySectorType"in e}
1)),q=(0,g.get)(R,"company.businessDetails.primaryIndustry",""),W=M.find((function(e){return"EmployeesSizeType"in e})),G=M.find((function(e){return"TurnOverType"in e})),K=M.find((function(e){return"IntendedUseOfAccount"in e})),H=(0,g.get)(R,"company.riskProfileAssessment.primaryBanks",[]),z=(0,g.get)(R,"company.riskProfileAssessment.otherPrimaryBanks",[]),Y=H.concat(z).join(", ");return(0,r.jsxs)("div",{className:(0,m.WD)(["sprout-relative sprout-flex sprout-flex-col","sprout-border sprout-border-[#CDCDCD] sprout-border-solid sprout-rounded-[16px] sprout-p-4","sprout-overflow-hidden"]),children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-justify-between",children:[(0,r.jsx)("h4",{className:"sprout-font-semibold sprout-mb-6",children:"Additional Follow-up Questions"}),(0,r.jsx)("button",{className:"sprout-text-primary sprout-font-semibold",onClick:function(){return F(2)},children:"Edit"})]}),(0,r.jsxs)("div",{className:"sprout-grid md:sprout-grid-cols-2 sprout-gap-4 sprout-py-6",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-4",children:[(0,r.jsx)("p",{className:"sprout-text-sm sprout-font-semibold",children:"General"}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:["Please provide your company\u2019s website"," ",(0,r.jsx)("span",{className:"sprout-text-[#757575]",children:"(if available)"})]}),(0,r.jsx)("p",{children:(0,g.get)(R,"company.businessDetails.businessWebsite","-")})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Is there a brand name the company is trading under?"}),(0,r.jsx)("p",{children:(0,g.get)(R,"company.businessDetails.doingBusinessAs","-")})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"What is the primary business industry?"}),(0,r.jsx)("p",{children:null===(i=null===Z||void 0===Z?void 0:Z.IndustrySectorType.find((function(e){return q===e.value})))||void 0===i?void 0:i.label})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Brief description of the business"}),(0,r.jsx)("p",{className:"sprout-break-all",children:(0,g.get)(R,"company.businessDetails.businessDescription","-")})]})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-4",children:[(0,r.jsx)("p",{className:"sprout-text-sm sprout-font-semibold",children:"Place of Business"}),(0,g.get)(R,"company.addresses.isSameBusinessAddress",!1)?(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col",children:(0,r.jsxs)("div",{className:"checkbox-container mb-2",children:[(0,r.jsx)("input",{type:"checkbox",disabled:L,checked:(0,g.get)(R,"company.addresses.isSameBusinessAddress",!1),readOnly:!0}),(0,r.jsx)("label",{htmlFor:"is-apply-for-business-account",children:(0,r.jsx)("div",{className:"checkbox-label sprout-text-sm md:sprout-text-base",children:"Use registered address as principal place of business"})})]})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Country Address"}),(0,r.jsxs)("div",{className:"sprout-flex sprout-space-x-2",children:[(0,r.jsx)("img",{src:null===U||void 0===U?void 0:U.countryFlagUrl,width:36,alt:null===U||void 0===U?void 0:U.countryName}),(0,r.jsx)("p",{className:"sprout-text-sm md:sprout-text-base",children:null===U||void 0===U?void 0:U.countryName})]})]}),"SG"===(null===U||void 0===U?void 0:U.countryIso2Code)?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"sprout-gap-4 sprout-grid sprout-grid-cols-2",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Block / House No"}
1),(0,r.jsx)("div",{className:"sprout-flex sprout-space-x-2",children:(0,r.jsx)("p",{className:"sprout-text-sm md:sprout-text-base",children:null===_||void 0===_?void 0:_.company.addresses.principalPlaceOfBusiness.blockHouse})})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Street Name"}),(0,r.jsx)("div",{className:"sprout-flex sprout-space-x-2",children:(0,r.jsx)("p",{className:"sprout-text-sm md:sprout-text-base",children:null===_||void 0===_?void 0:_.company.addresses.principalPlaceOfBusiness.streetName})})]})]}),(0,r.jsxs)("div",{className:"sprout-gap-4 sprout-grid sprout-grid-cols-2",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Level No"}),(0,r.jsx)("div",{className:"sprout-flex sprout-space-x-2",children:(0,r.jsx)("p",{className:"sprout-text-sm md:sprout-text-base",children:(null===_||void 0===_?void 0:_.company.addresses.principalPlaceOfBusiness.level)||"-"})})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Unit No"}),(0,r.jsx)("div",{className:"sprout-flex sprout-space-x-2",children:(0,r.jsx)("p",{className:"sprout-text-sm md:sprout-text-base",children:(null===_||void 0===_?void 0:_.company.addresses.principalPlaceOfBusiness.unit)||"-"})})]})]}),(0,r.jsxs)("div",{className:"sprout-gap-4 sprout-grid sprout-grid-cols-2",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Building Name"}),(0,r.jsx)("div",{className:"sprout-flex sprout-space-x-2",children:(0,r.jsx)("p",{className:"sprout-text-sm md:sprout-text-base",children:(null===_||void 0===_?void 0:_.company.addresses.principalPlaceOfBusiness.buildingName)||"-"})})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Postal Code"}),(0,r.jsx)("div",{className:"sprout-flex sprout-space-x-2",children:(0,r.jsx)("p",{className:"sprout-text-sm md:sprout-text-base",children:(null===_||void 0===_?void 0:_.company.addresses.principalPlaceOfBusiness.postalCode)||"-"})})]})]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"sprout-gap-4 sprout-grid sprout-grid-cols-2",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Address Line 1"}),(0,r.jsx)("div",{className:"sprout-flex sprout-space-x-2",children:(0,r.jsx)("p",{className:"sprout-text-sm md:sprout-text-base",children:null===_||void 0===_||null===(l=_.company)||void 0===l||null===(c=l.addresses)||void 0===c||null===(d=c.principalPlaceOfBusiness)||void 0===d?void 0:d.addressLine1})})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Address Line 2"}),(0,r.jsx)("div",{className:"sprout-flex sprout-space-x-2",children:(0,r.jsx)("p",{className:"sprout-text-sm md:sprout-text-base",children:(null===_||void 0===_||null===(p=_.company)||void 0===p||null===(f=p.addresses)||void 0===f||null===(h=f.principalPlaceOfBusiness)||void 0===h?void 0:h.addressLine2)||"-"})})]})]}),(0,r.jsxs)("div",{className:"sprout-gap-4 sprout-grid sprout-grid-cols-2",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"City"}),(0,r.jsx)("div",{className:"sprout-flex sprout-space-x-2",children:(0,r.jsx)("p",{className:"sprout-text-sm md:sprout-text-base",children:(null===_||void 0===_||null===(x=_.company)||void 0===x||null===(v=x.addresses)||void 0===v||null===(y=v.principalPlaceOfBusiness)||void 0===y?void 0:y.city)||"-"})})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-sp
1ace-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"State"}),(0,r.jsx)("div",{className:"sprout-flex sprout-space-x-2",children:(0,r.jsx)("p",{className:"sprout-text-sm md:sprout-text-base",children:(null===(j=null===_||void 0===_?void 0:_.company.addresses.principalPlaceOfBusiness)||void 0===j?void 0:j.state)||"-"})})]})]}),(0,r.jsx)("div",{className:"sprout-gap-4 sprout-grid sprout-grid-cols-2",children:(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Postal Code"}),(0,r.jsx)("div",{className:"sprout-flex sprout-space-x-2",children:(0,r.jsx)("p",{className:"sprout-text-sm md:sprout-text-base",children:(null===(b=null===_||void 0===_?void 0:_.company.addresses.principalPlaceOfBusiness)||void 0===b?void 0:b.postalCode)||"-"})})]})})]})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Country of Operation"}),(0,r.jsxs)("div",{className:"sprout-flex sprout-space-x-2",children:[(0,r.jsx)("img",{src:null===V||void 0===V?void 0:V.countryFlagUrl,width:36,alt:null===V||void 0===V?void 0:V.countryName}),(0,r.jsx)("p",{className:"sprout-text-sm md:sprout-text-base",children:null===V||void 0===V?void 0:V.countryName})]})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Top 3 countries business is transacting"}),(0,r.jsx)("div",{className:"sprout-flex sprout-flex-wrap",children:null===R||void 0===R||null===(N=R.company)||void 0===N||null===(C=N.riskProfileAssessment)||void 0===C||null===(D=C.transactionCountries)||void 0===D?void 0:D.map((function(e){var s=(0,g.find)(B,{countryIso2Code:e});return(0,r.jsxs)("div",{className:"sprout-flex sprout-items-center sprout-space-x-2 sprout-bg-[#FEE6CF] sprout-border-[#FB8110] sprout-border-[1px] sprout-rounded-full sprout-py-1 sprout-px-2 sprout-mr-2 sprout-my-2 sprout-w-fit",children:[(0,r.jsx)("img",{src:null===s||void 0===s?void 0:s.countryFlagUrl,width:36,alt:null===s||void 0===s?void 0:s.countryName}),(0,r.jsx)("p",{className:"sprout-text-[10px] md:sprout-text-xs",children:null===s||void 0===s?void 0:s.countryName})]},e)}))})]})]})]}),(0,r.jsxs)("div",{className:"sprout-py-6",children:[(0,r.jsx)("p",{className:"sprout-text-sm sprout-font-semibold sprout-mb-4",children:"Operational"}),(0,r.jsxs)("div",{className:"sprout-grid md:sprout-grid-cols-2 sprout-gap-4",children:[(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-4",children:(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Total Full Time Employees"}),(0,r.jsx)("p",{children:null===(w=null===W||void 0===W?void 0:W.EmployeesSizeType.find((function(e){return(0,g.get)(R,"company.riskProfileAssessment.totalEmployees","")===e.value})))||void 0===w?void 0:w.label})]})}),(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-4",children:(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Estimated Annual Turnover"}),(0,r.jsx)("p",{children:null===(k=null===G||void 0===G?void 0:G.TurnOverType.find((function(e){return(0,g.get)(R,"company.riskProfileAssessment.annualTurnover","")===e.value})))||void 0===k?void 0:k.label})]})})]})]}),(0,r.jsxs)("div",{className:"sprout-py-6",children:[(0,r.jsx)("p",{className:"sprout-text-sm sprout-font-semibold sprout-mb-4",children:"Amount and Frequency of expected transaction inflow/outflow"}),(0,r.jsxs)("div",{className:"sprout-grid md:sprout-grid-cols-2 sprout-gap-4",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-4",children:[(0,r.jsx)("p",{className:"sprout-text-sm sprout-font-semibold",children:"A. Inflow"}),(0,r.jsx)("p",{className:"sprout-text-xs",children:"e.g. sales income, investment income, shareholder capital injection, loans proceeds."}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-sp
1ace-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Estimated no. of transactions per month"}),(0,r.jsx)("p",{children:(0,g.get)(R,"company.riskProfileAssessment.inflowExpectedTransactions.numberOfTransactionMonthly","")})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Estimated value per month (SGD)"}),(0,r.jsx)("p",{children:(0,g.get)(R,"company.riskProfileAssessment.inflowExpectedTransactions.transactionsValueMonthly","")})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Nature of inflow"}),(0,r.jsx)("p",{children:(0,g.get)(R,"company.riskProfileAssessment.inflowExpectedTransactions.natureOfInflow","")})]})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-4",children:[(0,r.jsx)("p",{className:"sprout-text-sm sprout-font-semibold",children:"B. Outflow"}),(0,r.jsx)("p",{className:"sprout-text-xs",children:"e.g. finance expense, rental, staff costs, cost of goods sold, operating expenses."}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Estimated value per month (SGD)"}),(0,r.jsx)("p",{children:(0,g.get)(R,"company.riskProfileAssessment.outflowExpectedTransactions.numberOfTransactionMonthly","")})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Estimated no. of transactions per month"}),(0,r.jsx)("p",{children:(0,g.get)(R,"company.riskProfileAssessment.outflowExpectedTransactions.transactionsValueMonthly","")})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Nature of outflow"}),(0,r.jsx)("p",{children:(0,g.get)(R,"company.riskProfileAssessment.outflowExpectedTransactions.natureOfOutflow","")})]})]}),!I.incorporation&&(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-4",children:[(0,r.jsx)("p",{className:"sprout-text-sm sprout-font-semibold",children:"C. Bank Accounts"}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Please select all bank accounts held by your company"}),(0,r.jsx)("p",{children:Y})]})]})]})]}),I.finance&&(0,r.jsxs)("div",{className:"sprout-py-6",children:[(0,r.jsx)("p",{className:"sprout-text-sm sprout-font-semibold sprout-mb-4",children:"Expense Management"}),(0,r.jsx)("div",{className:"sprout-grid md:sprout-grid-cols-2 sprout-gap-4",children:(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-4",children:(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"What is your purpose for using Expense Management?"}),(0,r.jsx)("p",{children:null===(O=null===K||void 0===K?void 0:K.IntendedUseOfAccount.find((function(e){return(0,g.get)(R,"company.riskProfileAssessment.intendedUseOfAccount","")===e.value})))||void 0===O?void 0:O.label})]})})})]})]})}function Oe(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function Ae(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){Oe(e,s,t[s])}))}return e}function Se(){var e,s,t,o,n=(0,u.SS)(),i=n.companyInformation,l=n.isChecked,c=n.generalCountry,d=n.emitter,p=n.selectedOption,f=we({emitter:d}).handleOnEdit,h=null===i||void 0===i||null===(e=i.data)||void 0===e?void 0:e.data,x=(0,g.get)(c,"data.data",[]),v=(0,g.find)(x,{countryIso2Code:null===h||void 0===h?void 0:h.company.legalDetails.countryOfRegisteredBusiness}),y=(0,a.useCallback)((function(e){var s=e.country,t=e.streetName,r=e.blockHouse,o=e.level,n=e.unit,a=e.postalCode,i=e.buildingName,l=e.city,u=e.state,c=e.addressLine1,d=e.addressLine2;if("SG"===s){var p="".concat(r,", ").concat(t),m="";return(o||n)&&(m="#".concat(o||"01","-").concat(n||"01")),i&&(m=m?"".concat(m," ").concat(i):i),Ae({addressLine1:p},m?{addressLine2:m}:{},{postcode:a,city:"Singapore",state:"Singapore",country:s})}return Ae({addressLine1:c},d?{addressLine2:d}:{},{state:u,city:l,postcode:a,country:s})}),[]),j=(0,a.useMemo)((function(){return(null===h||void 0===h?void 0:h.company.addresses)?y(h.company.addresses.registeredAddress):null}),[null===h||void 0===h?void 0:h.company,y]),b=(0,a.useMemo)((function(){return(null===h||void 0===h?void 0:h.company.sharesDetails.filter((function(e){return e.shareAllotted&&!Number.isNaN(Number(e.shareAllotted))&&Number(e.shareAllotted)||e.paidUpShareCapital&&!Number.isNaN(Number(e.paidUpShareCapital))&&Number(e.paidUpShareCapital)})))||[]}),[null===h||void 0===h?void 0:h.company.sharesDetails]),N="048762"===(null===h||void 0===h||null===(s=h.company)||void 0===s||null===(t=s.addresses)||void 0===t||null===(o=t.registeredAddress)||void 0===o?void 0:o.postalCode);return(0,r.jsxs)("div",{className:(0,m.WD)(["sprout-relative sprout-flex sprout-flex-col","sprout-border sprout-border-[#CDCDCD] sprout-border-solid sprout-rounded-[16px] sprout-p-4","sprout-overflow-hidden"]),children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-justify-between",children:[(0,r.jsx)("h4",{className:"sprout-font-semibold sprout-mb-6",children:"Company Information"}),(0,r.jsx)("button",{className:"sprout-text-primary sprout-font-semibold",onClick:function(){return f(1)},children:"Edit"})]}),(0,r.jsxs)("div",{className:"sprout-grid md:sprout-grid-cols-2 sprout-gap-4",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-sp
1ace-y-4",children:[(0,r.jsx)("p",{className:"sprout-text-sm sprout-font-semibold",children:"Company Summary Information"}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Company Name"}),(0,r.jsx)("p",{children:null===h||void 0===h?void 0:h.company.companyName})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Unique Entity Number"}),(0,r.jsx)("p",{children:null===h||void 0===h?void 0:h.uen})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Company Type"}),(0,r.jsx)("p",{children:null===h||void 0===h?void 0:h.company.legalDetails.companyType})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Formerly Known As"}),(0,r.jsx)("p",{children:(null===h||void 0===h?void 0:h.company.legalDetails.historyName)||"-"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Entity Status"}),(0,r.jsx)("p",{children:null===h||void 0===h?void 0:h.company.legalDetails.entityStatus})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Entity Type"}),(0,r.jsx)("p",{children:null===h||void 0===h?void 0:h.company.legalDetails.entityType})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Incorporation Date"}),(0,r.jsx)("p",{children:(null===h||void 0===h?void 0:h.company.legalDetails.registrationDate)?(0,J.Z)(new Date(null===h||void 0===h?void 0:h.company.legalDetails.registrationDate),"dd/MM/yyyy"):""})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Country"}),(0,r.jsxs)("div",{className:"sprout-flex sprout-space-x-2",children:[(0,r.jsx)("img",{src:null===v||void 0===v?void 0:v.countryFlagUrl,width:36,alt:null===v||void 0===v?void 0:v.countryName}),(0,r.jsx)("p",{children:null===v||void 0===v?void 0:v.countryName})]})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Registered Address"}),(0,r.jsx)("p",{children:"".concat(null===j||void 0===j?void 0:j.addressLine1," ").concat(null===j||void 0===j?void 0:j.addressLine2," ").concat(null===j||void 0===j?void 0:j.country," ").concat(null===j||void 0===j?void 0:j.postcode)})]}),p.corpSec&&(0,r.jsxs)("div",{className:"sprout-flex",children:[(0,r.jsxs)("label",{className:"sprout-inline-flex sprout-cursor-pointer",children:[(0,r.jsx)("input",{type:"checkbox",checked:N,readOnly:!0}),(0,r.jsx)("div",{className:"sprout-relative sprout-w-11 sprout-h-6 sprout-bg-gray-200 peer-focus:sprout-outline-none peer-focus:sprout-ring-4 peer-focus:sprout-ring-orange-300 sprout-rounded-full peer peer-checked:after:sprout-translate-x-full rtl:peer-checked:after:-sprout-translate-x-full peer-checked:after:sprout-border-white after:sprout-content-[''] after:sprout-absolute after:sprout-top-[2px] after:sprout-start-[2px] after:sprout-bg-white after:sprout-border-gray-300 after:sprout-border after:sprout-rounded-full after:sprout-h-5 after:sprout-w-5 after:sprout-transition-all peer-checked:sprout-bg-orange-600"})]}),(0,r.jsxs)("div",{className:"sprout-ml-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[l&&"Use Grof's address for all official correspondence and records relating to your company.",!l&&"Retain My Current Registered Address."]}),(0,r.jsxs)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:[l&&"You have appointed Grof as your company's secretary and are using Grof's address for all official correspondence and records.",!l&&"You are using your current registered address for all official company correspondence and records."]})]})]})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-sp
1ace-y-4",children:[(0,r.jsx)("p",{className:"sprout-text-sm sprout-font-semibold",children:"Business Activity"}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Primary SSIC"}),(0,r.jsx)("p",{children:null===h||void 0===h?void 0:h.company.ssic.primary.description})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Description of Primary SSIC"}),(0,r.jsx)("p",{children:"-"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Secondary SSIC"}),(0,r.jsx)("p",{children:(null===h||void 0===h?void 0:h.company.ssic.primary.otherDescription)||"-"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Decription of Secondary SSIC"}),(0,r.jsx)("p",{children:"-"})]}),(0,r.jsx)("p",{className:"sprout-text-sm sprout-font-semibold sprout-mt-6",children:"Capital Summary"}),b.length?b.map((function(e,s){return(0,r.jsxs)("div",{className:"sprout-grid sprout-grid-cols-2 sprout-gap-4",children:[(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-4",children:(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:"Total Paid-Up Capital"}),(0,r.jsx)("p",{children:(0,ee.Z)(e.paidUpShareCapital,e.currency)})]})}),(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-4",children:(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:"Share Type"}),(0,r.jsx)("p",{children:e.shareType})]})}),(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-4",children:(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:"Total Number of Shares"}),(0,r.jsx)("p",{children:(0,ee.t)(e.shareAllotted,2)})]})})]},"shares_".concat(s))})):(0,r.jsxs)("div",{className:"sprout-grid sprout-grid-cols-2 sprout-gap-4",children:[(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-4",children:(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:"Total Paid-Up Capital"}),(0,r.jsx)("p",{children:"-"})]})}),(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-4",children:(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:"Share Type"}),(0,r.jsx)("p",{children:"-"})]})}),(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-4",children:(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:"Total Number of Shares"}),(0,r.jsx)("p",{children:"-"})]})})]})]})]})]})}function Ee(){var e=(0,u.SS)(),s=e.emitter,t=e.companyInformation,o=we({emitter:s}).handleOnEdit,n={secretaries:[]};return(0,g.get)(t.data.data,"company.members",[]).forEach((function(e){var s=e.appointments.filter((function(e){return c.mB.includes(e.position)}));e.appointments.filter((function(e){return"Active"===e.status})).length>0&&s.length>0&&n.secretaries.push(e)})),(0,r.jsxs)("div",{className:(0,m.WD)(["sprout-relative sprout-flex sprout-flex-col","sprout-border sprout-border-[#CDCDCD] sprout-border-solid sprout-rounded-[16px] sprout-p-4","sprout-overflow-hidden"]),children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-justify-between sprout-p-4",children:[(0,r.jsx)("h4",{className:"sprout-font-semibold sprout-mb-6",children:"Secretary Listing"}),(0,r.jsx)("button",{className:"sprout-text-primary sprout-font-semibold",onClick:function(){return o(4)},children:"Edit"})]}),(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col",children:n.secretaries.map((function(e){var s,t=e.appointments.filter((function(e){return c.mB.includes(e.position)&&"Active"===e.status}));if(!(null===t||void 0===t?void 0:t.length))return(0,r.jsx)(r.Fragment,{});var o=(0,g.findIndex)(e.appointments,{_id:t[0]._id});return(0,r.jsxs)("div",{className:"sprout-grid sprout-grid-cols-2 sprout-p-4",children:[(0,r.jsx)("p",{children:e.personDetail
1s.personalDetails.fullName}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("div",{className:"checkbox-container",children:[(0,r.jsx)("input",{type:"checkbox",checked:e.appointments[o].isOutgoing,disabled:!0}),(0,r.jsx)("label",{htmlFor:"is-apply-for-business-account",children:(0,r.jsx)("div",{className:"checkbox-label sprout-text-sm",children:"Outgoing Secretary"})})]}),e.appointments[o].isOutgoing?(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:e.isOutgoing?"Grof will send resignation email to this person.":"Tick this if Secretary will resign."}),(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:"Email"}),(0,r.jsx)("p",{className:"sprout-break-words",children:null===(s=null===e||void 0===e?void 0:e.appointments[o])||void 0===s?void 0:s.outgoingEmail})]}):(0,r.jsx)("p",{children:"-"})]})]},e._id)}))})]})}function Pe(e){var s,t=e.shareholder,o=(0,u.SS)().companyInformation,n=(0,K.Z)(!0),i=(0,g.find)((null===(s=o.data.data)||void 0===s?void 0:s.company.members)||[],{_id:t.corporateRepresentativeOf});return(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-p-4 sprout-space-y-2",children:[(0,r.jsxs)("div",{className:"sprout-grid md:sprout-grid-cols-5 sprout-gap-6 sprout-text-[#121212] sprout-text-sm",children:[(0,r.jsx)("div",{className:"sprout-col-span-2 sprout-flex sprout-flex-col sprout-space-y-2",children:(0,r.jsxs)("div",{className:"sprout-flex sprout-justify-between",children:[(0,r.jsx)("p",{className:"sprout-text-base",children:t.companyDetails.companyName}),(0,r.jsx)("div",{onClick:n.onToggle,className:"sprout-cursor-pointer",children:(0,r.jsx)(Q.Uy,{})})]})}),(0,r.jsx)("div",{className:"hidden md:sprout-flex sprout-flex-col sprout-space-y-6",children:(0,r.jsx)("p",{children:t.sharesDetails.length>0&&t.sharesDetails[0].shareType})}),(0,r.jsx)("div",{className:"hidden md:sprout-flex sprout-flex-col sprout-space-y-6",children:(0,r.jsx)("p",{children:"N/A"})}),(0,r.jsx)("div",{className:"hidden md:sprout-flex sprout-flex-col sprout-space-y-6",children:(0,r.jsx)("p",{children:t.sharesDetails.length>0&&(0,ee.t)(t.sharesDetails[0].shareAllotted,0)})})]}),n.isOpen&&(0,r.jsxs)("div",{className:"sprout-grid md:sprout-grid-cols-5 sprout-gap-6 sprout-text-[#121212] sprout-text-sm",children:[(0,r.jsxs)("div",{className:"sprout-col-span-2 sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Corporate"}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Corporate Representative"}),(0,r.jsx)("p",{className:"sprout-text-base",children:null===i||void 0===i?void 0:i.personDetails.personalDetails.fullName})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2 sprout-pt-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"List of Documents"}),t.companyDetails.documents.map((function(e){return(0,r.jsx)("div",{className:"sprout-border sprout-rounded-lg sprout-p-2 sprout-pl-5 sprout-pr-5 sprout-grid sprout-grid-flow-row sprout-grid-cols-8 sprout-gap-2 sprout-items-center",children:(0,r.jsx)("span",{className:"sprout-col-span-7 sprout-font-semibold sprout-cursor-pointer sprout-break-words",children:e.fileName})},e.documentId)}))]})]}),t.sharesDetails.map((function(e,s){return s>0&&(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)("div",{className:"hidden md:sprout-flex sprout-flex-col sprout-space-y-6",children:(0,r.jsx)("p",{children:e.shareType})}),(0,r.jsx)("div",{className:"hidden md:sprout-flex sprout-flex-col sprout-space-y-6",children:(0,r.jsx)("p",{children:"N/A"})}),(0,r.jsx)("div",{className:"hidden md:sprout-flex sprout-flex-col sprout-space-y-6",children:(0,r.jsx)("p",{children:(0,ee.t)(e.shareAllotted,0)})})]},s)})),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-col-span-2 md:sprout-hidden",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-mb-2",children:"Share information"}),(0,r.jsxs)("div",{className:"sprout-grid sprout-grid-cols-3 sprout-text-[#757575] sprout-text-xs",children:[(0,r.jsx)("p",{children:"Type"}),(0,r.jsx)("p",{children:"Amount"}),(0,r.jsx)("p",{children:"Total No. of Shares"})]}),(0,r.jsx)("div",{className:"sprout-grid sprout-grid-cols-3 sprout-text-xs",children:t.sharesDetails.map((function(e,s){return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)("p",{children:e.shareType}),(0,r.jsx)("p",{children:"N/A"}),(0,r.jsx)("p",{children:(0,ee.t)(e.shareAllotted,0)})]},s)}))})]})]})]})}function Te(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}var Ie=function(e,s,t){var r,o,n=function(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){Te(e,s,t[s])}))}return e}({},e);return(null===n||void 0===n||null===(r=n.shareholders)||void 0===r?void 0:r[s])&&(n.shareholders[s].currentStep=t),(null===n||void 0===n||null===(o=n.officers)||void 0===o?void 0:o[s])&&(n.officers[s].currentStep=t),n},Fe=function(){return{setStakeholderStep:(0,a.useCallback)((function(e,s,t){return Ie(e,s,t)}),[]),setStakeholderStepOnReview:(0,a.useCallback)((function(e,s,t){return function(e,s,t){var r=(null===e||void 0===e?void 0:e.members)||[],o=r.findIndex((function(e){return e._id===s}));return o>-1&&(r[o].currentStep=t),{company:{members:r}}}(e,s,t)}),[])}};function Re(e,s,t,r,o,n,a){try{var i=e[n](a),l=i.value}catch(u){return void t(u)}i.done?s(l):Promise.resolve(l).then(r,o)}function Le(e){var s,t,o,n,i,l,c=e.shareholder,d=(0,K.Z)(!0),p=(0,u.SS)(),m=p.isAgentMode,f=p.companyInformation,h=p.emitter,x=Fe().setStakeholderStepOnReview,v=we({emitter:h}).handleOnSave,y=(0,a.useCallback)((function(e,s){return"FACIAL_VERIFICATION"===s?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"sprout-text-xs md:sprout-text-[14px] md:sprout-mt-[16px] md:sprout-mb-[8px] sprout-mt-[8px] sprout-mb-[8px] sprout-text-[#757575]",children:["You've chosen to provide the stakeholder information using:",(0,r.jsxs)("span",{className:"sprout-font-bold sprout-text-[12px] md:sprout-text-[14px]",children:[" ","Facial Verification"]})]}),(0,r.jsx)("div",{children:(0,r.jsx)(D.iR,{secondary:!0,onClick:(t=U().mark((function s(){var t,r,o;return U().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return o=x(null===(t=f.data)||void 0===t||null===(r=t.data)||void 0===r?void 0:r.company,e,0),s.next=4,v(o,!1);case 4:je.default.push("/kyc?type=facial-verification&id=".concat(e));case 5:case"end":return s.stop()}}),s)})),function(){var e=this,s=arguments;return new Promise((function(r,o){var n=t.apply(e,s);function a(e){Re(n,r,o,a,i,"next",e)}function i(e){Re(n,r,o,a,i,"throw",e)}a(void 0)}))}),children:"Edit Information"})})]}):"NOTARIZED_DOCUMENT"===s?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"sprout-text-xs md:sprout-text-[14px] md:sprout-mt-[16px] md:sprout-mb-[8px] sprout-mt-[8px] sprout-mb-[8px] sprout-text-[#757575]",children:["You've chosen to provide the stakeholder information using:",(0,r.jsxs)("span",{className:"sprout-font-bold sprout-text-[12px] md:sprout-text-[14px]",children:[" ","Notarized Document"]})]}),(0,r.jsx)("div",{children:(0,r.jsx)(D.iR,{secondary:!0,onClick:function(){return je.default.push("/kyc?type=notarized-document&id=".concat(e))},children:"Edit Information"})})]}):(0,r.jsx)(r.Fragment,{});var t}),[null===(s=f.data)||void 0===s||null===(t=s.data)||void 0===t?void 0:t.company,v,x]),g=(0,a.useCallback)((function(e,s){return(0,r.jsxs)("div",{className:"sprout-w-full",children:[(0,r.jsx)("div",{className:"sprout-text-[14px] md:sprout-text-[16
1px]",children:"Personal Information"}),s?y(e,s):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"sprout-text-[12px] md:sprout-text-[14px] md:sprout-mt-[16px] md:sprout-mb-[8px] sprout-mt-[8px] sprout-mb-[8px]",children:"Please provide the stakeholder's personal information via one of these 2 methods:"}),(0,r.jsxs)("div",{className:"sprout-flex md:sprout-flex-row sprout-flex-col",children:[(0,r.jsx)(D.iR,{primary:!0,className:"sprout-w-fit",onClick:function(){je.default.push("/kyc?type=facial-verification&id=".concat(e))},children:"Facial Verification"}),(0,r.jsx)("span",{className:"md:sprout-block sprout-hidden sprout-text-[14px] sprout-ml-[8px] sprout-mr-[8px] sprout-content-center",children:"or"}),(0,r.jsx)(D.iR,{className:"sprout-mt-[8px] md:sprout-mt-[0px] sprout-w-fit",secondary:!0,onClick:function(){je.default.push("/kyc?type=notarized-document&id=".concat(e))},children:"Notarized Document"})]})]})]})}),[y]);return(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-p-4 sprout-space-y-2",children:[(0,r.jsxs)("div",{className:"sprout-grid md:sprout-grid-cols-5 sprout-gap-6 sprout-text-[#121212] sprout-text-sm",children:[(0,r.jsx)("div",{className:"sprout-col-span-2 sprout-flex sprout-flex-col sprout-space-y-2",children:(0,r.jsxs)("div",{className:"sprout-flex sprout-justify-between",children:[(0,r.jsx)("p",{className:"sprout-text-base",children:null===c||void 0===c||null===(o=c.personDetails)||void 0===o||null===(n=o.personalDetails)||void 0===n?void 0:n.fullName}),(0,r.jsx)("div",{onClick:d.onToggle,className:"sprout-cursor-pointer",children:(0,r.jsx)(Q.Uy,{})})]})}),(0,r.jsx)("div",{className:"hidden md:sprout-flex sprout-flex-col sprout-space-y-6",children:(0,r.jsx)("p",{children:c.sharesDetails.length>0&&c.sharesDetails[0].shareType})}),(0,r.jsx)("div",{className:"hidden md:sprout-flex sprout-flex-col sprout-space-y-6",children:(0,r.jsx)("p",{children:"N/A"})}),(0,r.jsx)("div",{className:"hidden md:sprout-flex sprout-flex-col sprout-space-y-6",children:(0,r.jsx)("p",{children:c.sharesDetails.length>0&&(0,ee.t)(c.sharesDetails[0].shareAllotted,2)})})]}),d.isOpen&&(0,r.jsxs)("div",{className:"sprout-grid md:sprout-grid-cols-5 sprout-gap-6 sprout-text-[#121212] sprout-text-sm",children:[(0,r.jsxs)("div",{className:"sprout-col-span-2 sprout-flex sprout-flex-col sprout-space-y-2 sprout-overflow-hidden md:sprout-overflow-visible",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Individual"}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[m&&!(null===c||void 0===c?void 0:c.isApplicant)&&g(c._id,c.agentEkycType),(!m||(null===c||void 0===c?void 0:c.isApplicant))&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Email Address"}),(0,r.jsx)("p",{className:"sprout-break-words sprout-text-base md:sprout-break-normal",children:null===c||void 0===c||null===(i=c.personDetails)||void 0===i||null===(l=i.contactDetails)||void 0===l?void 0:l.email})]})]})]}),c.sharesDetails.map((function(e,s){return s>0&&(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)("div",{className:"hidden md:sprout-flex sprout-flex-col sprout-space-y-6",children:(0,r.jsx)("p",{children:e.shareType})}),(0,r.jsx)("div",{className:"hidden md:sprout-flex sprout-flex-col sprout-space-y-6",children:(0,r.jsx)("p",{children:"N/A"})}),(0,r.jsx)("div",{className:"hidden md:sprout-flex sprout-flex-col sprout-space-y-6",children:(0,r.jsx)("p",{children:(0,ee.t)(e.shareAllotted,2)})})]},s)})),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-col-span-2 md:sprout-hidden",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-mb-2",children:"Share information"}),(0,r.jsxs)("div",{className:"sprout-grid sprout-grid-cols-3 sprout-text-[#757575] sprout-text-xs",children:[(0,r.jsx)("p",{children:"Type"}),(0,r.jsx)("p",{children:"Amount"}),(0,r.jsx)("p",{children:"Total No. of Shares"})]}),(0,r.jsx)("div",{className:"sprout-grid sprout-grid-cols-3 sprout-text-xs",children:c.sharesDetails.map((function(e,s){return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)("p",{children:e.shareType}),(0,r.jsx)("p",{children:"N/A"}),(0,r.jsx)("p",{children:(0,ee.t)(e.shareAllotted,2)})]},s)}))})]})]})]})}function _e(e,s,t,r,o,n,a){try{var i=e[n](a),l=i.value}catch(u){return void t(u)}i.done?s(l):Promise.resolve(l).then(r,o)}function Be(e){return function(e){if(Array.isArray(e)){for(var s=0,t=new Array(e.length);s<e.length;s++)t[s]=e[s];return t}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function Ve(){var e,s,t,o,n,i,l=(0,u.SS)(),d=l.emitter,p=l.companyInformation,f=l.selectedOption,h=l.isAgentMode,x=we({emitter:d}),v=x.handleOnEdit,y=x.handleOnSave,j=(0,K.Z)(!1),b=Fe().setStakeholderStepOnReview,N=(0,a.useCallback)((function(e,s){return"FACIAL_VERIFICATION"===s?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"sprout-text-xs md:sprout-text-[14px] md:sprout-mt-[16px] md:sprout-mb-[8px] sprout-mt-[8px] sprout-mb-[8px] sprout-text-[#757575]",children:["You've chosen to provide the stakeholder information using:",(0,r.jsxs)("span",{className:"sprout-font-bold sprout-text-[12px] md:sprout-text-[14px]",children:[" ","Facial Verification"]})]}),(0,r.jsx)("div",{children:(0,r.jsx)(D.iR,{secondary:!0,onClick:(t=U().mark((function s(){var t,r,o;return U().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return o=b(null===(t=p.data)||void 0===t||null===(r=t.data)||void 0===r?void 0:r.company,e,0),s.next=4,y(o,!1);case 4:je.default.push("/kyc?type=facial-verification&id=".concat(e));case 5:case"end":return s.stop()}}),s)})),function(){var e=this,s=arguments;return new Promise((function(r,o){var n=t.apply(e,s);function a(e){_e(n,r,o,a,i,"next",e)}function i(e){_e(n,r,o,a,i,"throw",e)}a(void 0)}))}),children:"Edit Information"})})]}):"NOTARIZED_DOCUMENT"===s?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"sprout-text-xs md:sprout-text-[14px] md:sprout-mt-[16px] md:sprout-mb-[8px] sprout-mt-[8px] sprout-mb-[8px] sprout-text-[#757575]",children:["You've chosen to provide the stakeholder information using:",(0,r.jsxs)("span",{className:"sprout-font-bold sprout-text-[12px] md:sprout-text-[14px]",children:[" ","Notarized Document"]})]}),(0,r.jsx)("div",{children:(0,r.jsx)(D.iR,{secondary:!0,onClick:function(){return je.default.push("/kyc?type=notarized-document&id=".concat(e))},children:"Edit Information"})})]}):(0,r.jsx)(r.Fragment,{});var t}),[null===(e=p.data)||void 0===e||null===(s=e.data)||void 0===s?void 0:s.company,y,b]),C=(0,a.useCallback)((function(e,s){return(0,r.jsxs)("div",{className:"sprout-w-full",children:[(0,r.jsx)("div",{className:"sprout-text-[14px] md:sprout-text-[16
1px]",children:"Personal Information"}),s?N(e,s):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"sprout-text-[12px] md:sprout-text-[14px] md:sprout-mt-[16px] md:sprout-mb-[8px] sprout-mt-[8px] sprout-mb-[8px]",children:"Please provide the stakeholder's personal information via one of these 2 methods:"}),(0,r.jsxs)("div",{className:"sprout-flex md:sprout-flex-row sprout-flex-col",children:[(0,r.jsx)(D.iR,{primary:!0,className:"sprout-w-fit",onClick:function(){je.default.push("/kyc?type=facial-verification&id=".concat(e))},children:"Facial Verification"}),(0,r.jsx)("span",{className:"md:sprout-block sprout-hidden sprout-text-[14px] sprout-ml-[8px] sprout-mr-[8px] sprout-content-center",children:"or"}),(0,r.jsx)(D.iR,{className:"sprout-mt-[8px] md:sprout-mt-[0px] sprout-w-fit",secondary:!0,onClick:function(){je.default.push("/kyc?type=notarized-document&id=".concat(e))},children:"Notarized Document"})]})]})]})}),[N]),w=(0,a.useCallback)((function(e){return 0===e.appointments.filter((function(e){return"Corporate Representative"!==e.position&&"Corporate Representative of"!==e.position&&"Active"===e.status&&!e.isOutgoing})).length}),[]),k={officers:[],shareholders:[],corporateRepresentative:[]};(0,g.get)(null===(t=p.data)||void 0===t?void 0:t.data,"company.members",[]).forEach((function(e){for(var s=e,t=[],r=[],o=0;o<s.appointments.length;o+=1){var n=s.appointments[o];c.UK.includes(n.position)&&("Active"===n.status||n.isOutgoing)&&t.push(n),c.Kh.includes(n.position)&&("Active"===n.status||n.isOutgoing)&&r.push(n)}t.length>0&&"INDIVIDUAL"===s.category&&k.officers.push(s),r.length>0&&k.shareholders.push(s)}));var O=(0,a.useCallback)((function(e){return e.appointments.find((function(e){return c.Ax.includes(e.position)&&e.isOutgoing}))}),[]),A=(0,a.useMemo)((function(){return k.shareholders.some((function(e){return"CORPORATE"===e.category}))}),[k.shareholders]),S=(0,a.useCallback)((function(e){var s=null,t=[],r=[];e.forEach((function(e){Be(c.UK).concat(Be(c.Kh),["Nominator"]).includes(e.position)&&("Active"===e.status||e.isOutgoing)&&("Corporate Representative of"===e.position?t.push(e):"Corporate Representative"===e.position?s=e:r.push(e))}));var o,n=Be(r);t.length?(o=n).push.apply(o,Be(t)):s&&n.push(s);return n}),[]);return(0,r.jsxs)("div",{className:(0,m.WD)(["sprout-relative sprout-flex sprout-flex-col","sprout-border sprout-border-[#CDCDCD] sprout-border-solid sprout-rounded-[16px]","sprout-overflow-hidden"]),children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-justify-between sprout-p-4",children:[(0,r.jsx)("h4",{className:"sprout-font-semibold sprout-mb-6",children:"Stakeholders Listing"}),(0,r.jsx)("button",{className:"sprout-text-primary sprout-font-semibold",onClick:function(){return v(3)},children:"Edit"})]}),f.corpSec&&(0,r.jsxs)("div",{className:"sprout-py-4 sprout-p-4",children:[(0,r.jsx)("h4",{className:"sprout-text-sm sprout-font-semibold",children:"Would you like to appoint Grof's Resident Director?"}),(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Every company in Singapore is required to have at least one Resident Director who is either a Singaporean citizen, a permanent resident, or a holder of an EntrePass/Employment/Dependent Pass with a locally registered address. A Resident Director fulfills this legal requirement without being involved in the day-to-day operations or management decisions of the company."}),(0,r.jsx)("div",{className:"sprout-flex sprout-mt-4",children:(0,r.jsxs)("div",{className:"sprout-flex sprout-items-center sprout-me-4",children:[(0,r.jsx)("input",{disabled:!0,id:"inline-radio",type:"radio",value:"",name:"as-director",checked:!0,className:"sprout-box-border sprout-appearance-none sprout-w-[14px] sprout-h-[14px] sprout-border-[2px] sprout-border-solid sprout-border-white sprout-rounded-sm sprout-outline sprout-outline-1 sprout-outline-[#8E8E8E] checked:sprout-bg-[#757575]",readOnly:!0}),(0,r.jsx)("label",{className:"sprout-ms-2 sprout-text-gray-900 ",children:(null===(o=p.data.data)||void 0===o?void 0:o.company.isAppointGrofND)?"Yes":"No"})]})})]}
1),(0,r.jsx)("div",{className:"sprout-border-[#C4C4C4] sprout-border-b-[1px] sprout-mb-4"}),(0,r.jsx)("h4",{className:"sprout-font-semibold sprout-p-4",children:"Officer Listing"}),(0,r.jsx)("div",{className:"sprout-border-[#C4C4C4] sprout-border-b-[1px] sprout-mb-4"}),(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col",children:k.officers.sort((function(e,s){var t,r,o,n,a=(null===(t=e.personDetails)||void 0===t||null===(r=t.personalDetails)||void 0===r?void 0:r.fullName)||e.companyDetails.companyName||"",i=(null===(o=s.personDetails)||void 0===o||null===(n=o.personalDetails)||void 0===n?void 0:n.fullName)||s.companyDetails.companyName||"";return a.localeCompare(i)})).map((function(e){var s,t,o,n,a=O(e);return h?(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"sprout-grid md:sprout-grid-cols-2",children:[(0,r.jsxs)("div",{className:"sprout-p-4 sprout-flex sprout-flex-col sprout-space-y-2 sprout-overflow-hidden",children:[(0,r.jsx)("p",{children:e.personDetails.personalDetails.fullName}),(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:S(e.appointments).map((function(e){var s=e.position,t=e.companyName;return"Corporate Representative of"===s?"".concat(s," ").concat(t):s})).join(", ")})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col",children:[e.isApplicant&&(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-gap-1 sprout-mt-2 sprout-p-4",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-items-center sprout-me-4",children:[(0,r.jsx)("input",{checked:!0,id:"inline-radio",type:"radio",value:"",name:"is-you",className:"sprout-box-border sprout-appearance-none sprout-w-[14px] sprout-h-[14px] sprout-border-[2px] sprout-border-solid sprout-border-white sprout-rounded-sm sprout-outline sprout-outline-1 sprout-outline-[#8E8E8E] checked:sprout-bg-[#757575]",readOnly:!0}),(0,r.jsx)("label",{className:"sprout-ms-2 sprout-text-gray-900 ",children:"This is me"})]}),(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Check this if this person is yourself."})]}),(null===a||void 0===a?void 0:a.isOutgoing)&&f.corpSec&&(0,r.jsxs)("div",{className:"sprout-grid sprout-gap-1 sprout-mt-2 sprout-p-4",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-items-center sprout-me-4",children:[(0,r.jsx)("input",{type:"checkbox",disabled:!0,checked:!0,readOnly:!0}),(0,r.jsx)("label",{className:"sprout-ms-2 sprout-text-gray-900 ",children:"Outgoing Director"})]}),(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:(null===a||void 0===a?void 0:a.isOutgoing)?"Grof will send resignation email to this person.":"Check this to remove this Director."}),(0,r.jsx)("p",{className:"sprout-mt-2 sprout-text-[#757575] sprout-text-xs",children:"Email"}),(0,r.jsx)("p",{className:"sprout-break-words sprout-overflow-hidden",children:null===a||void 0===a?void 0:a.outgoingEmail})]}),!(null===a||void 0===a?void 0:a.isOutgoing)&&(e.isApplicant||w(e))&&(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-p-4",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Email"}),(0,r.jsx)("p",{className:"sprout-break-words sprout-text-base md:sprout-break-normal",children:null===e||void 0===e||null===(o=e.personDetails)||void 0===o||null===(n=o.contactDetails)||void 0===n?void 0:n.email})]})]})]},"officer-".concat(e._id)),!(null===a||void 0===a?void 0:a.isOutgoing)&&!e.isApplicant&&!w(e)&&(0,r.jsx)("div",{className:"sprout-p-4 ",children:C(e._id,e.agentEkycType)}),(0,r.jsx)("div",{className:"sprout-border-[#C4C4C4] sprout-border-b-[1px] sprout-mb-4"})]},"officer-".concat(e._id)):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"sprout-grid md:sprout-grid-cols-2",children:[(0,r.jsxs)("div",{className:"sprout-p-4 sprout-flex sprout-flex-col sprout-space-y-2 sprout-overflow-hidden",children:[(0,r.jsx)("p",{children:e.personDetails.personalDetails.fullName}),(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:S(e.appointments).map((function(e){var s=e.position,t=e.companyName;return"Corporate Representative of"===s?"".concat(s," ").concat(t):s})).join(", ")}),(0,r.jsx)("p",{className:"sprout-mt-2 sprout-text-[#757575] sprout-text-xs",children:"Email Address"}),(0,r.jsx)("p",{className:"sprout-break-words sprout-overflow-hidden",children:null===(s=e.personDetail
1s)||void 0===s||null===(t=s.contactDetails)||void 0===t?void 0:t.email})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col",children:[e.isApplicant&&(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-gap-1 sprout-mt-2 sprout-p-4",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-items-center sprout-me-4",children:[(0,r.jsx)("input",{checked:!0,id:"inline-radio",type:"radio",value:"",name:"is-you",className:"sprout-box-border sprout-appearance-none sprout-w-[14px] sprout-h-[14px] sprout-border-[2px] sprout-border-solid sprout-border-white sprout-rounded-sm sprout-outline sprout-outline-1 sprout-outline-[#8E8E8E] checked:sprout-bg-[#757575]",readOnly:!0}),(0,r.jsx)("label",{className:"sprout-ms-2 sprout-text-gray-900 ",children:"This is me"})]}),(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Check this if this person is yourself."})]}),(null===a||void 0===a?void 0:a.isOutgoing)&&f.corpSec&&(0,r.jsxs)("div",{className:"sprout-grid sprout-gap-1 sprout-mt-2 sprout-p-4",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-items-center sprout-me-4",children:[(0,r.jsx)("input",{type:"checkbox",disabled:!0,checked:!0,readOnly:!0}),(0,r.jsx)("label",{className:"sprout-ms-2 sprout-text-gray-900 ",children:"Outgoing Director"})]}),(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:(null===a||void 0===a?void 0:a.isOutgoing)?"Grof will send resignation email to this person.":"Check this to remove this Director."}),(0,r.jsx)("p",{className:"sprout-mt-2 sprout-text-[#757575] sprout-text-xs",children:"Email"}),(0,r.jsx)("p",{className:"sprout-break-words sprout-overflow-hidden",children:null===a||void 0===a?void 0:a.outgoingEmail})]})]})]},"officer-".concat(e._id)),(0,r.jsx)("div",{className:"sprout-border-solid sprout-border-[#C4C4C4] sprout-border-b-[1px]"})]})}))}),(0,r.jsx)("h4",{className:"sprout-font-semibold sprout-p-4",children:"Shareholder Listing"}),A&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-justify-between sprout-px-4",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"Documents Needed for Corporate Shareholder"}),(0,r.jsx)("div",{className:"sprout-cursor-pointer",onClick:j.onToggle,children:(0,r.jsx)(Q.Uy,{})})]}),(0,r.jsxs)("div",{className:(0,m.WD)(["sprout-p-4",j.isOpen?"sprout-w-full":"hidden"]),children:[(0,r.jsx)(D.pi,{information:!0,label:"Certified true copy can be certified by company secretary or director"}),(0,r.jsxs)("div",{className:"sprout-mt-2 sprout-grid sprout-grid-cols-1 md:sprout-grid-cols-2",children:[(0,r.jsxs)("div",{className:"sprout-text-xs",children:[(0,r.jsx)("p",{children:"Singapore"}),(0,r.jsxs)("ol",{className:"sprout-list-decimal sprout-list-inside sprout-text-[#757575]",children:[(0,r.jsx)("li",{children:"ACRA BizFile"}),(0,r.jsx)("li",{children:"Constitution (a.k.a M&A, or Articles of Association)"}),(0,r.jsx)("li",{children:"Certificate of Corporate Representative"})]})]}),(0,r.jsxs)("div",{className:"sprout-text-xs",children:[(0,r.jsx)("p",{children:"Overseas"}),(0,r.jsxs)("ol",{className:"sprout-list-decimal sprout-list-inside sprout-text-[#757575]",children:[(0,r.jsx)("li",{children:"Certified true copy of Certificate of Incorporation"}),(0,r.jsx)("li",{children:"Certified true copy of Constitution/Memorandum & Articles of Association/By-Law"}),(0,r.jsx)("li",{children:"Certified true copy of Register of Shareholders or Certificate of Incumbency (not more than 3 months)"}),(0,r.jsx)("li",{children:"Certified true copy of Register of Directors/Certificate of Incumbency (not more than 3 months)"}),(0,r.jsx)("li",{children:"Certificate of Corporate Representative"})]})]})]})]})]}),(0,r.jsx)("div",{className:"sprout-border-[#C4C4C4] sprout-border-b-[1px] sprout-mb-4"}),(0,r.jsxs)("div",{className:"hidden md:sprout-grid sprout-grid-cols-5 sprout-gap-6 sprout-p-4 sprout-bg-[#FAFAFA] sprout-text-xs",children:[(0,r.jsxs)("div",{className:"sprout-col-span-2 sprout-flex sprout-justify-between sprout-items-center",children:[(0,r.jsx)("p",{children:"Name"}),(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[(0,r.jsxs)("mask",{id:"mask0_1663_10926",maskUnits:"userSpaceOnUse",x:"3",y:"2",width:"10",height:"12",children:[(0,r.jsx)("path",{d:"M8.23657 2.48692C8.09964 2.37155 7.90075 2.37155 7.76382 2.48692L3.33306 6.22026C3.1764 6.35225 3.15524 6.58766 3.28578 6.74606C3.41633 6.90446 3.64915 6.92586 3.80581 6.79386L8.0002 3.2597L12.1946 6.79386C12.3512 6.92586 12.5841 6.90446 12.7146 6.74606C12.8452 6.58766 12.824 6.35225 12.6673 6.22026L8.23657 2.48692Z",fill:"#8E8E8E"}),(0,r.jsx)("path",{d:"M3.80581 9.20691C3.64915 9.07492 3.41633 9.09632 3.28578 9.25472C3.15524 9.41311 3.1764 9.64852 3.33306 9.78052L7.76382 13.5139C7.90075 13.6292 8.09964 13.6292 8.23657 13.5139L12.6673 9.78052C12.824 9.64852 12.8452 9.41311 12.7146 9.25472C12.5841 9.09632 12.3512 9.07492 12.1946 9.20691L8.0002 12.7411L3.80581 9.20691Z",fill:"#8E8E8E"})]}),(0,r.jsx)("g",{mask:"url(#mask0_1663_10926)",children:(0,r.jsx)("rect",{x:"2",y:"2",width:"12",height:"12",fill:"#8E8E8E"})})]})]}),(0,r.jsx)("div",{children:(0,r.jsx)("p",{children:"Type"})}),(0,r.jsx)("div",{children:(0,r.jsx)("p",{children:"Amount"})}),(0,r.jsx)("div",{children:(0,r.jsx)("p",{children:"Total No. of Shares"})})]}),(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-divide-y-2",children:null===(i=null===(n=k.shareholders)||void 0===n?void 0:n.sort((function(e,s){var t,r,o,n,a=(null===(t=e.personDetail
1s)||void 0===t||null===(r=t.personalDetails)||void 0===r?void 0:r.fullName)||e.companyDetails.companyName||"",i=(null===(o=s.personDetails)||void 0===o||null===(n=o.personalDetails)||void 0===n?void 0:n.fullName)||s.companyDetails.companyName||"";return a.localeCompare(i)})))||void 0===i?void 0:i.map((function(e){return(0,r.jsxs)(a.Fragment,{children:["INDIVIDUAL"===e.category&&(0,r.jsx)(Le,{shareholder:e}),"CORPORATE"===e.category&&(0,r.jsx)(Pe,{shareholder:e})]},"shareholder-".concat(e._id))}))})]})}var Ue=t(92518);function Me(e,s,t,r,o,n,a){try{var i=e[n](a),l=i.value}catch(u){return void t(u)}i.done?s(l):Promise.resolve(l).then(r,o)}var Ze=function(e){var s=e.emitter,t=(0,K.Z)(),r=(0,a.useRef)(N.q.getState()).current.setGlobalSnackbar,o=(0,u.SS)().companyInformation,n=(0,a.useMemo)((function(){var e,s;return null===o||void 0===o||null===(e=o.data)||void 0===e||null===(s=e.data)||void 0===s?void 0:s._id}),[o]),i=(0,Ue.Z)(),l=(0,a.useCallback)((function(){var e,t={applicationId:n};return i.post("kyb/core/discard-company-info",t).then((e=U().mark((function e(t){return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("OK"!==(null===t||void 0===t?void 0:t.status)){e.next=8;break}return o.mutate(),r("Successfully discarded the process.","info"),s.emit("@set-is-acra-error",!1),s.emit("@select-option",{key:"incorporation",value:!1}),s.emit("@select-option",{key:"corpSec",value:!1}),s.emit("@select-option",{key:"finance",value:!1}),e.abrupt("return",s.emit("@stepper",0));case 8:return r("Something went wrong","error"),e.abrupt("return",t);case 10:case"end":return e.stop()}}),e)})),function(){var s=this,t=arguments;return new Promise((function(r,o){var n=e.apply(s,t);function a(e){Me(n,r,o,a,i,"next",e)}function i(e){Me(n,r,o,a,i,"throw",e)}a(void 0)}))})).catch((function(e){r(e.message,"error")}))}),[n,i,o,s,r]);return(0,a.useEffect)((function(){return s.on("@modal/confirm",t.onToggle),function(){s.off("@modal/confirm",t.onToggle)}}),[t.onToggle,s]),{handleOnConfirm:l,confirmationModal:t}};function qe(){var e,s,t=(0,u.SS)(),o=t.companyInformation,n=t.emitter,a=t.selectedOption,i=t.isChecked,l=we({emitter:n}).handleOnEdit,c=null===o||void 0===o||null===(e=o.data)||void 0===e?void 0:e.data;return(0,r.jsxs)("div",{className:(0,m.WD)(["sprout-relative sprout-flex sprout-flex-col","sprout-border sprout-border-[#CDCDCD] sprout-border-solid sprout-rounded-[16px] sprout-p-4","sprout-overflow-hidden"]),children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-justify-between",children:[(0,r.jsx)("h4",{className:"sprout-font-semibold sprout-mb-6",children:"Company Information"}),(0,r.jsx)("button",{className:"sprout-text-primary sprout-font-semibold",onClick:function(){return l(1)},children:"Edit"})]}),(0,r.jsx)("div",{className:"sprout-w-full",children:(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-4",children:[(0,r.jsx)("p",{className:"sprout-text-sm sprout-font-semibold",children:"UEN"}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Our services will help to retrieve your company's information based on the UEN you have provided."}),(0,r.jsx)("p",{children:null===c||void 0===c?void 0:c.uen})]}),a.corpSec&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"sprout-text-sm sprout-font-semibold",children:"Company\u2019s Registered Address"}),(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Please provide the official registered address for your company. This address will be used for official notifications and correspondence."})}),(0,r.jsxs)("div",{className:"sprout-flex",children:[(0,r.jsxs)("label",{className:"sprout-inline-flex sprout-cursor-pointer",children:[(0,r.jsx)("input",{type:"checkbox",checked:i,className:"sprout-sr-only sprout-peer",readOnly:!0}),(0,r.jsx)("div",{className:"sprout-relative sprout-w-11 sprout-h-6 sprout-bg-gray-200 peer-focus:sprout-outline-none peer-focus:sprout-ring-4 peer-focus:sprout-ring-orange-300 sprout-rounded-full peer peer-checked:after:sprout-translate-x-full rtl:peer-checked:after:-sprout-translate-x-full peer-checked:after:sprout-border-white after:sprout-content-[''] after:sprout-absolute after:sprout-top-[2px] after:sprout-start-[2px] after:sprout-bg-white after:sprout-border-gray-300 after:sprout-border after:sprout-rounded-full after:sprout-h-5 after:sprout-w-5 after:sprout-transition-all peer-checked:sprout-bg-orange-600"})]}),(0,r.jsxs)("div",{className:"sprout-ml-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"Use Grof\u2019s Registered Address"}),(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:"Use Grof's address for all official correspondence and records relating to your company."})]})]}),(0,r.jsx)("h4",{className:"sprout-text-sm sprout-font-semibold",children:"Would you like to appoint Grof's Resident Director?"}),(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Every company in Singapore is required to have at least one Resident Director who is either a Singaporean citizen, a permanent resident, or a holder of an EntrePass/Employment/Dependent Pass with a locally registered address. A Resident Director fulfills this legal requirement without being involved in the day-to-day operations or management decisions of the company."}),(0,r.jsx)("div",{className:"sprout-flex sprout-mt-4",children:(0,r.jsxs)("div",{className:"sprout-flex sprout-items-center sprout-me-4",children:[(0,r.jsx)("input",{disabled:!0,id:"inline-radio",type:"radio",value:"",name:"as-director",checked:!0,className:"sprout-box-border sprout-appearance-none sprout-w-[14px] sprout-h-[14px] sprout-border-[2px] sprout-border-solid sprout-border-white sprout-rounded-sm sprout-outline sprout-outline-1 sprout-outline-[#8E8E8E] checked:sprout-bg-[#757575]",readOnly:!0}),(0,r.jsx)("label",{className:"sprout-ms-2 sprout-text-gray-900 ",children:(null===(s=o.data.data)||void 0===s?void 0:s.company.isAppointGrofND)?"Yes":"No"})]})})]})]})})]})}var We=t(28045),Ge=t(63781);function Ke(){return(0,r.jsxs)("div",{className:"sprout-flex-1 sprout-flex sprout-flex-col sprout-justify-center sprout-items-center sprout-mx-3 sprout-my-6",children:[(0,r.jsx)(We.default,{src:Ge.Gi,alt:"no records foun
1d",height:240,width:240}),(0,r.jsx)("div",{className:"sprout-px-2 sprout-mt-4 sprout-flex sprout-flex-col sprout-text-sm sprout-text-[#828282]",children:(0,r.jsx)("span",{className:"sprout-text-center",children:"Click the 'Add New' button and provide the required details for each new officer you wish to include in your company's profile."})})]})}var He=t(39323),ze=function(e){var s=e.className,t=e.label;return t?(0,r.jsx)("span",{className:(0,m.WD)(["sprout-inline sprout-text-xs sprout-text-center","sprout-px-[8px] sprout-rounded-full sm:sprout-py-[3px]",s]),children:t}):null};function Ye(e,s,t,r,o,n,a){try{var i=e[n](a),l=i.value}catch(u){return void t(u)}i.done?s(l):Promise.resolve(l).then(r,o)}var Xe=function(e){var s,t,o=e.officer,n=(0,u.SS)(),i=n.isAgentMode,l=n.emitter,c=n.companyInformation,d=we({emitter:l}).handleOnSave,p=Fe().setStakeholderStepOnReview,m=(0,a.useCallback)((function(e,s){return"FACIAL_VERIFICATION"===s?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"sprout-text-xs md:sprout-text-[14px] md:sprout-mt-[16px] md:sprout-mb-[8px] sprout-mt-[8px] sprout-mb-[8px] sprout-text-[#757575]",children:["You've chosen to provide the stakeholder information using:",(0,r.jsxs)("span",{className:"sprout-font-bold sprout-text-[12px] md:sprout-text-[14px]",children:[" ","Facial Verification"]})]}),(0,r.jsx)("div",{children:(0,r.jsx)(D.iR,{secondary:!0,onClick:(t=U().mark((function s(){var t,r,o;return U().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return o=p(null===(t=c.data)||void 0===t||null===(r=t.data)||void 0===r?void 0:r.company,e,0),s.next=4,d(o,!1);case 4:je.default.push("/kyc?type=facial-verification&id=".concat(e));case 5:case"end":return s.stop()}}),s)})),function(){var e=this,s=arguments;return new Promise((function(r,o){var n=t.apply(e,s);function a(e){Ye(n,r,o,a,i,"next",e)}function i(e){Ye(n,r,o,a,i,"throw",e)}a(void 0)}))}),children:"Edit Information"})})]}):"NOTARIZED_DOCUMENT"===s?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"sprout-text-xs md:sprout-text-[14px] md:sprout-mt-[16px] md:sprout-mb-[8px] sprout-mt-[8px] sprout-mb-[8px] sprout-text-[#757575]",children:["You've chosen to provide the stakeholder information using:",(0,r.jsxs)("span",{className:"sprout-font-bold sprout-text-[12px] md:sprout-text-[14px]",children:[" ","Notarized Document"]})]}),(0,r.jsx)("div",{children:(0,r.jsx)(D.iR,{secondary:!0,onClick:function(){return je.default.push("/kyc?type=notarized-document&id=".concat(e))},children:"Edit Information"})})]}):(0,r.jsx)(r.Fragment,{});var t}),[null===(s=c.data)||void 0===s||null===(t=s.data)||void 0===t?void 0:t.company,d,p]),f=(0,a.useCallback)((function(e){return 0===e.appointments.filter((function(e){return"Corporate Representative"!==e.position&&"Corporate Representative of"!==e.position&&"Active"===e.status})).length}),[]),h=(0,a.useCallback)((function(e){return 0===e.appointments.filter((function(e){return"Corporate Representative"!==e.position&&"Member"!==e.position&&"Beneficial Owner"!==e.position&&"Active"===e.status})).length}),[]);return(0,r.jsxs)("div",{className:(0,He.W)(["sprout-hidden sm:sprout-grid sprout-grid-cols-12 sprout-grid-rows-[min-content] sprout-items-center","sprout-p-4 sprout-border-b sprout-border-[#DADADA] sprout-border-solid"]),children:[(0,r.jsxs)("div",{className:"sprout-col-span-4 sprout-flex sprout-flex-col",children:[(0,r.jsx)("p",{children:o.personDetails.personalDetails.fullName}),o.isApplicant?(0,r.jsx)(ze,{label:"This is me",className:"sprout-bg-[#FFF6E7] sprout-w-fit"}):(0,r.jsx)(r.Fragment,{})]}),(0,r.jsx)("div",{className:"sprout-col-span-3 sprout-flex sprout-flex-col",children:o.appointments.map((function(e){return"Corporate Representative of"===e.position?(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("div",{className:"sprout-col-span-3 sprout-flex sprout-flex-col",children:[(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-sm",children:"Corporate Representative:"}),(0,r.jsx)("p",{children:e.companyName})]})}):"Corporate Representative"!==e.position||h(o)?(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("div",{className:"sprout-col-span-3 sprout-flex sprout-flex-col",children:(0,r.jsx)("p",{children:e.position})})}):(0,r.jsx)(r.Fragment,{})}))}),(0,r.jsx)("div",{className:"sprout-col-span-4",children:!i||o.isApplicant||f(o)?(0,r.jsx)("p",{children:o.personDetail
1s.contactDetails.email}):m(o._id,o.agentEkycType)}),(0,r.jsx)("div",{className:"sprout-col-span-1"})]})};function Qe(e,s,t,r,o,n,a){try{var i=e[n](a),l=i.value}catch(u){return void t(u)}i.done?s(l):Promise.resolve(l).then(r,o)}var $e=function(e){var s,t,o=e.officer,n=(0,u.SS)(),i=n.isAgentMode,l=n.emitter,c=n.companyInformation,d=we({emitter:l}).handleOnSave,p=Fe().setStakeholderStepOnReview,m=(0,a.useCallback)((function(e,s){return"FACIAL_VERIFICATION"===s?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"sprout-text-xs md:sprout-text-[14px] md:sprout-mt-[16px] md:sprout-mb-[8px] sprout-mt-[8px] sprout-mb-[8px] sprout-text-[#757575]",children:["You've chosen to provide the stakeholder information using:",(0,r.jsxs)("span",{className:"sprout-font-bold sprout-text-[12px] md:sprout-text-[14px]",children:[" ","Facial Verification"]})]}),(0,r.jsx)("div",{children:(0,r.jsx)(D.iR,{secondary:!0,onClick:(t=U().mark((function s(){var t,r,o;return U().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return o=p(null===(t=c.data)||void 0===t||null===(r=t.data)||void 0===r?void 0:r.company,e,0),s.next=4,d(o,!1);case 4:je.default.push("/kyc?type=facial-verification&id=".concat(e));case 5:case"end":return s.stop()}}),s)})),function(){var e=this,s=arguments;return new Promise((function(r,o){var n=t.apply(e,s);function a(e){Qe(n,r,o,a,i,"next",e)}function i(e){Qe(n,r,o,a,i,"throw",e)}a(void 0)}))}),children:"Edit Information"})})]}):"NOTARIZED_DOCUMENT"===s?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"sprout-text-xs md:sprout-text-[14px] md:sprout-mt-[16px] md:sprout-mb-[8px] sprout-mt-[8px] sprout-mb-[8px] sprout-text-[#757575]",children:["You've chosen to provide the stakeholder information using:",(0,r.jsxs)("span",{className:"sprout-font-bold sprout-text-[12px] md:sprout-text-[14px]",children:[" ","Notarized Document"]})]}),(0,r.jsx)("div",{children:(0,r.jsx)(D.iR,{secondary:!0,onClick:function(){return je.default.push("/kyc?type=notarized-document&id=".concat(e))},children:"Edit Information"})})]}):(0,r.jsx)(r.Fragment,{});var t}),[null===(s=c.data)||void 0===s||null===(t=s.data)||void 0===t?void 0:t.company,d,p]),f=(0,a.useCallback)((function(e){return 0===e.appointments.filter((function(e){return"Corporate Representative"!==e.position&&"Corporate Representative of"!==e.position&&"Active"===e.status})).length}),[]),h=(0,a.useCallback)((function(e){return 0===e.appointments.filter((function(e){return"Corporate Representative"!==e.position&&"Member"!==e.position&&"Beneficial Owner"!==e.position&&"Active"===e.status})).length}),[]);return(0,r.jsxs)("div",{className:(0,He.W)(["sprout-flex sm:sprout-hidden sprout-flex-row sprout-items-center sprout-gap-3 sprout-justify-between","sprout-px-4 sprout-py-2 sprout-border-b sprout-border-[#DADADA] sprout-border-solid"]),children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-gap-3",children:[(0,r.jsx)("div",{className:"sprout-col-span-5 sprout-flex sprout-flex-col",children:(0,r.jsx)("p",{children:o.personDetails.personalDetails.fullName})}),(0,r.jsx)("div",{className:"sprout-col-span-3 sprout-flex sprout-flex-col",children:o.appointments.map((function(e){return"Corporate Representative of"===e.position?(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("div",{className:"sprout-col-span-3 sprout-flex sprout-flex-col",children:[(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-sm",children:"Corporate Representative:"}),(0,r.jsx)("p",{children:e.companyName})]})}):"Corporate Representative"!==e.position||h(o)?(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("div",{className:"sprout-col-span-3 sprout-flex sprout-flex-col",children:(0,r.jsx)("p",{children:e.position})})}):(0,r.jsx)(r.Fragment,{})}))}),(0,r.jsx)("div",{className:"sprout-col-span-3",children:o.isApplicant&&!i?(0,r.jsx)(ze,{label:"This is me",className:"sprout-bg-[#FFF6E7] sprout-w-fit"}):(0,r.jsx)(r.Fragment,{})}),i&&(o.isApplicant||f(o))&&(0,r.jsxs)("div",{className:"sprout-col-span-3",children:[(0,r.jsx)("div",{children:"Personal Information"}),(0,r.jsx)("p",{className:"sprout-mt-[8px]",children:o.personDetail
1s.contactDetails.email})]}),i&&!o.isApplicant&&!f(o)&&(0,r.jsxs)("div",{className:"sprout-col-span-3",children:[(0,r.jsx)("div",{children:"Personal Information"}),m(o._id,o.agentEkycType)]})]}),(0,r.jsx)("div",{className:"sprout-col-span-1"}),(0,r.jsx)("div",{className:"sprout-border-b sprout-border-[#DADADA] sprout-border-solid"})]})},Je=function(){var e=(0,u.SS)().companyInformation,s={officers:[]};return(0,g.get)(e.data.data,"company.members",[]).forEach((function(e){e.appointments.filter((function(e){return c.UK.includes(e.position)})).length>0&&"INDIVIDUAL"===e.category&&s.officers.push(e)})),Object.keys(s.officers).length?(0,r.jsx)(a.Fragment,{children:(0,r.jsx)("div",{className:"sprout-flex-1 sprout-overflow-scroll",children:Object.keys(s.officers).map((function(e){return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)(Xe,{officer:s.officers[e]},e),(0,r.jsx)($e,{officer:s.officers[e]},e)]},e)}))})}):(0,r.jsx)("div",{className:"sprout-flex-1 sprout-flex",children:(0,r.jsx)(Ke,{})})},es=function(){var e=(0,u.SS)().isAgentMode,s=(0,He.W)(["sprout-bg-[#FAFAFA]","sprout-hidden sprout-items-center md:sprout-grid md:sprout-grid-cols-12","sprout-h-16 sprout-py-4 sprout-px-3","sprout-text-xs"]);return(0,r.jsxs)("div",{className:s,children:[(0,r.jsxs)("div",{className:"sprout-col-span-4 sprout-flex sprout-justify-between sprout-items-center",children:[(0,r.jsx)("p",{children:"Name"}),(0,r.jsx)(Q.Qr,{})]}),(0,r.jsx)("div",{className:"sprout-col-span-3",children:(0,r.jsx)("p",{children:"Position"})}),e?(0,r.jsx)("div",{className:"sprout-col-span-4",children:(0,r.jsx)("p",{children:"Personal Information"})}):(0,r.jsx)("div",{className:"sprout-col-span-4",children:(0,r.jsx)("p",{children:"Email"})}),(0,r.jsx)("div",{className:"sprout-col-span-1"})]})},ss=function(){return(0,r.jsxs)("div",{className:"sprout-flex-1 sprout-flex sprout-flex-col sprout-overflow-hidden",children:[(0,r.jsx)(es,{}),(0,r.jsx)(Je,{})]})};function ts(){return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)("div",{className:"sprout-flex sprout-justify-between sprout-p-4 sprout-items-center",children:(0,r.jsx)("h3",{className:"sprout-font-semibold",children:"Officer Listing"})}),(0,r.jsx)("div",{className:"sprout-border-solid sprout-border-[#C4C4C4] sprout-border-b-[1px]"}),(0,r.jsx)(ss,{})]})}function rs(e,s,t,r,o,n,a){try{var i=e[n](a),l=i.value}catch(u){return void t(u)}i.done?s(l):Promise.resolve(l).then(r,o)}var os=function(e){var s,t,o,n=e.shareholder,i=e.totalNumberOfShares,l=e.listOfficers,c=(0,g.find)(l,{_id:n.corporateRepresentativeOf}),d=(0,u.SS)(),p=d.isAgentMode,m=d.emitter,f=d.companyInformation,h=we({emitter:m}).handleOnSave,x=Fe().setStakeholderStepOnReview,v=(0,a.useCallback)((function(e,s){return"FACIAL_VERIFICATION"===s?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"sprout-text-xs md:sprout-text-[14px] md:sprout-mt-[16px] md:sprout-mb-[8px] sprout-mb-[8px] sprout-text-[#757575]",children:["You've chosen to provide the stakeholder information using:",(0,r.jsxs)("span",{className:"sprout-font-bold sprout-text-[12px] md:sprout-text-[14px]",children:[" ","Facial Verification"]})]}),(0,r.jsx)("div",{children:(0,r.jsx)(D.iR,{secondary:!0,onClick:(t=U().mark((function s(){var t,r,o;return U().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return o=x(null===(t=f.data)||void 0===t||null===(r=t.data)||void 0===r?void 0:r.company,e,0),s.next=4,h(o,!1);case 4:je.default.push("/kyc?type=facial-verification&id=".concat(e));case 5:case"end":return s.stop()}}),s)})),function(){var e=this,s=arguments;return new Promise((function(r,o){var n=t.apply(e,s);function a(e){rs(n,r,o,a,i,"next",e)}function i(e){rs(n,r,o,a,i,"throw",e)}a(void 0)}))}),children:"Edit Information"})})]}):"NOTARIZED_DOCUMENT"===s?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"sprout-text-xs md:sprout-text-[14px] md:sprout-mt-[16px] md:sprout-mb-[8px] sprout-mb-[8px] sprout-text-[#757575]",children:["You've chosen to provide the stakeholder information using:",(0,r.jsxs)("span",{className:"sprout-font-bold sprout-text-[12px] md:sprout-text-[14px]",children:[" ","Notarized Document"]})]}),(0,r.jsx)("div",{children:(0,r.jsx)(D.iR,{secondary:!0,onClick:function(){return je.default.push("/kyc?type=notarized-document&id=".concat(e))},children:"Edit Information"})})]}):(0,r.jsx)(r.Fragment,{});var t}),[null===(s=f.data)||void 0===s||null===(t=s.data)||void 0===t?void 0:t.company,h,x]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:(0,He.W)(["sprout-hidden md:sprout-grid sprout-grid-cols-12 sprout-grid-rows-[min-content]","sprout-p-4"]),children:[(0,r.jsxs)("div",{className:"sprout-col-span-4 sprout-flex sprout-flex-col sprout-sp
1ace-y-2",children:[(0,r.jsx)("p",{children:"INDIVIDUAL"===n.category?n.personDetails.personalDetails.fullName:n.companyDetails.companyName}),(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:n.category}),n.corporateRepresentativeOf&&(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-sm",children:"Corporate Representative:"})," ",(0,r.jsx)("p",{className:"sprout-text-sm",children:null===c||void 0===c?void 0:c.personDetails.personalDetails.fullName})]}),!p||n.isApplicant&&(0,r.jsx)("p",{className:"sprout-text-sm",children:"INDIVIDUAL"===n.category&&n.personDetails.contactDetails.email}),null===(o=n.companyDetails.documents)||void 0===o?void 0:o.map((function(e){return(0,r.jsx)("div",{className:"sprout-border sprout-rounded-lg sprout-p-2 sprout-pl-5 sprout-pr-5 sprout-grid sprout-grid-flow-row sprout-grid-cols-8 sprout-gap-2 sprout-items-center",children:(0,r.jsx)("span",{className:"sprout-col-span-7 sprout-font-semibold sprout-cursor-pointer sprout-break-words",children:e.fileName})},e.documentId)}))]}),(0,r.jsx)("div",{className:"sprout-col-span-2 sprout-flex sprout-flex-col sprout-space-y-2",children:n.sharesDetails.map((function(e,s){return(0,r.jsx)("p",{children:e.shareType},s)}))}),(0,r.jsx)("div",{className:"sprout-col-span-2 sprout-flex sprout-flex-col sprout-space-y-2",children:n.sharesDetails.map((function(e,s){return(0,r.jsx)("p",{children:(0,ee.t)(e.shareAllotted,0)},s)}))}),(0,r.jsx)("div",{className:"sprout-col-span-2 sprout-flex sprout-flex-col sprout-space-y-2",children:n.sharesDetails.map((function(e,s){return(0,r.jsx)("p",{className:"sprout-break-all",children:(0,ee.Z)(e.paidUpShareCapital,e.shareCurrency)},s)}))}),(0,r.jsx)("div",{className:"sprout-col-span-2 sprout-space-y-2",children:n.sharesDetails.map((function(e,s){var t=e.shareAllotted/i*100;return(0,r.jsx)("p",{children:t.toFixed(2)},s)}))})]}),(0,r.jsx)(r.Fragment,{children:p&&!n.isApplicant&&"INDIVIDUAL"===n.category?(0,r.jsxs)("div",{className:"sprout-hidden md:sprout-grid sprout-px-4 sprout-mb-[16px]",children:[(0,r.jsx)("div",{children:"Personal Information"}),v(n._id,n.agentEkycType)]}):(0,r.jsx)(r.Fragment,{})}),(0,r.jsx)("div",{className:"sprout-border-solid sprout-border-[#C4C4C4] sprout-border-b-[1px] md:sprout-mt-[16px]"})]})};function ns(){return(0,r.jsxs)("div",{className:"sprout-flex-1 sprout-flex sprout-flex-col sprout-justify-center sprout-items-center sprout-mx-3 sprout-my-6",children:[(0,r.jsx)(We.default,{src:Ge.Gi,alt:"no records found",height:240,width:240}),(0,r.jsx)("div",{className:"sprout-px-2 sprout-mt-4 sprout-flex sprout-flex-col sprout-text-sm sprout-text-[#828282]",children:(0,r.jsx)("span",{className:"sprout-text-center",children:"Click the 'Add New' button and provide the required details to register a new shareholder you wish to include in your company's profile."})})]})}function as(e,s,t,r,o,n,a){try{var i=e[n](a),l=i.value}catch(u){return void t(u)}i.done?s(l):Promise.resolve(l).then(r,o)}var is=function(e){var s,t,o,n,i=e.shareholder,l=e.totalNumberOfShares,c=e.listOfficers,d=(0,g.find)(c,{_id:i.corporateRepresentativeOf}),p=(0,u.SS)(),m=p.isAgentMode,f=p.emitter,h=p.companyInformation,x=we({emitter:f}).handleOnSave,v=Fe().setStakeholderStepOnReview,y=(0,a.useCallback)((function(e,s){return"FACIAL_VERIFICATION"===s?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"sprout-text-xs md:sprout-text-[14px] md:sprout-mt-[16px] md:sprout-mb-[8px] sprout-mb-[8px] sprout-text-[#757575]",children:["You've chosen to provide the stakeholder information using:",(0,r.jsxs)("span",{className:"sprout-font-bold sprout-text-[12px] md:sprout-text-[14px]",children:[" ","Facial Verification"]})]}),(0,r.jsx)("div",{children:(0,r.jsx)(D.iR,{secondary:!0,onClick:(t=U().mark((function s(){var t,r,o;return U().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return o=v(null===(t=h.data)||void 0===t||null===(r=t.data)||void 0===r?void 0:r.company,e,0),s.next=4,x(o,!1);case 4:je.default.push("/kyc?type=facial-verification&id=".concat(e));case 5:case"end":return s.stop()}}),s)})),function(){var e=this,s=arguments;return new Promise((function(r,o){var n=t.apply(e,s);function a(e){as(n,r,o,a,i,"next",e)}function i(e){as(n,r,o,a,i,"throw",e)}a(void 0)}))}),children:"Edit Information"})})]}):"NOTARIZED_DOCUMENT"===s?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"sprout-text-xs md:sprout-text-[14px] md:sprout-mt-[16px] md:sprout-mb-[8px] sprout-mb-[8px] sprout-text-[#757575]",children:["You've chosen to provide the stakeholder information using:",(0,r.jsxs)("span",{className:"sprout-font-bold sprout-text-[12px] md:sprout-text-[14px]",children:[" ","Notarized Document"]})]}),(0,r.jsx)("div",{children:(0,r.jsx)(D.iR,{secondary:!0,onClick:function(){return je.default.push("/kyc?type=notarized-document&id=".concat(e))},children:"Edit Information"})})]}):(0,r.jsx)(r.Fragment,{});var t}),[null===(s=h.data)||void 0===s||null===(t=s.data)||void 0===t?void 0:t.company,x,v]),j=(0,a.useCallback)((function(){return m?i.isApplicant?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{children:"Personal Information"}),(0,r.jsx)("p",{className:"sprout-text-sm sprout-mt-[8px]",children:"INDIVIDUAL"===i.category&&i.personDetail
1s.contactDetails.email})]}):"INDIVIDUAL"===i.category?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{children:"Personal Information"}),y(i._id,i.agentEkycType)]}):(0,r.jsx)(r.Fragment,{}):(0,r.jsx)("p",{className:"sprout-text-sm",children:"INDIVIDUAL"===i.category&&i.personDetails.contactDetails.email})}),[y,m,i._id,i.agentEkycType,i.category,i.isApplicant,null===(o=i.personDetails.contactDetails)||void 0===o?void 0:o.email]);return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsxs)("div",{className:(0,He.W)(["sprout-flex md:sprout-hidden sprout-flex-row sprout-gap-3 sprout-justify-between","sprout-px-4 sprout-py-2"]),children:[(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-gap-3",children:(0,r.jsxs)("div",{className:"sprout-col-span-5 sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{children:"INDIVIDUAL"===i.category?i.personDetails.personalDetails.fullName:i.companyDetails.companyName}),(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:i.category}),i.corporateRepresentativeOf&&(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-sm",children:"Corporate Representative:"})," ",(0,r.jsx)("p",{className:"sprout-text-sm",children:null===d||void 0===d?void 0:d.personDetails.personalDetails.fullName})]}),j()]})}),(0,r.jsx)("div",{className:"sprout-col-span-1"})]}),!!(null===(n=i.companyDetails.documents)||void 0===n?void 0:n.length)&&(0,r.jsx)("div",{className:(0,He.W)(["sprout-flex sm:sprout-hidden sprout-flex-col sprout-gap-2","sprout-px-4 sprout-py-2"]),children:i.companyDetails.documents.map((function(e){return(0,r.jsx)("div",{className:"sprout-border sprout-rounded-lg sprout-p-2 sprout-pl-5 sprout-pr-5 sprout-grid sprout-grid-flow-row sprout-grid-cols-8 sprout-gap-2 sprout-items-center",children:(0,r.jsx)("span",{className:"sprout-col-span-7 sprout-font-semibold sprout-cursor-pointer sprout-break-words",children:e.fileName})},e.documentId)}))}),(0,r.jsx)("div",{className:(0,He.W)(["sprout-px-4 sprout-py-2"]),children:(0,r.jsxs)("div",{className:"sprout-flex sm:sprout-hidden sprout-flex-col sprout-border-[1px] sprout-border-[#DADADA] sprout-border-solid sprout-rounded-lg",children:[(0,r.jsxs)("div",{className:(0,He.W)(["sprout-bg-[#FAFAFA]","sprout-items-center sprout-grid sprout-grid-cols-12 sprout-gap-3","sprout-h-16 sprout-p-2 sprout-rounded-lg","sprout-text-xs"]),children:[(0,r.jsx)("div",{className:"sprout-col-span-3 sprout-flex sprout-justify-between sprout-items-center",children:(0,r.jsx)("p",{className:"sprout-text-[10px]",children:"Share Type"})}),(0,r.jsx)("div",{className:"sprout-col-span-3",children:(0,r.jsx)("p",{className:"sprout-text-[10px]",children:"No. of Shares"})}),(0,r.jsx)("div",{className:"sprout-col-span-3 sprout-flex sprout-justify-between sprout-items-center",children:(0,r.jsx)("p",{className:"sprout-text-[10px]",children:"Paid-up and Issued"})}),(0,r.jsx)("div",{className:"sprout-col-span-3",children:(0,r.jsx)("p",{className:"sprout-text-[10px]",children:"Percentage (%)"})})]}),i.sharesDetails.map((function(e,s){var t,o,n,a=e.shareAllotted/l*100;return(0,r.jsxs)("div",{className:(0,He.W)(["sprout-grid sprout-grid-cols-12 sprout-grid-rows-[min-content] sprout-gap-3","sprout-p-4"]),children:[(0,r.jsx)("div",{className:"sprout-col-span-3 sprout-flex sprout-justify-between",children:(0,r.jsx)("p",{className:"sprout-text-[10px]",children:null!==(t=e.shareType)&&void 0!==t?t:""})}),(0,r.jsx)("div",{className:"sprout-col-span-3",children:(0,r.jsx)("p",{className:"sprout-text-[10px] sprout-break-all",children:null!==(o=(0,ee.t)(e.shareAllotted,0))&&void 0!==o?o:""})}),(0,r.jsx)("div",{className:"sprout-col-span-3",children:(0,r.jsx)("p",{className:"sprout-text-[10px] sprout-break-all",children:(0,ee.Z)(e.paidUpShareCapital,e.shareCurrency)})}),(0,r.jsx)("div",{className:"sprout-col-span-3",children:(0,r.jsx)("p",{className:"sprout-text-[10px]",children:null!==(n=a.toFixed(2))&&void 0!==n?n:""})})]},s)}))]})})]})},ls=function(){var e=(0,u.SS)().companyInformation,s={officers:[],shareholders:[]};
1if((0,g.get)(e.data.data,"company.members",[]).forEach((function(e){var t=e.appointments.filter((function(e){return c.UK.includes(e.position)})),r=e.appointments.filter((function(e){return c.Kh.includes(e.position)}));t.length>0&&"INDIVIDUAL"===e.category&&s.officers.push(e),r.length>0&&s.shareholders.push(e)})),!Object.keys(s.shareholders).length)return(0,r.jsx)("div",{className:"sprout-flex-1 sprout-flex",children:(0,r.jsx)(ns,{})});var t=0;return Object.keys(s.shareholders).forEach((function(e){var r=s.shareholders[e];Object.keys(r.sharesDetails).forEach((function(e){t+=Number(r.sharesDetails[e].shareAllotted)}))})),(0,r.jsx)(a.Fragment,{children:(0,r.jsx)("div",{className:"sprout-flex-1 sprout-overflow-scroll",children:Object.keys(s.shareholders).map((function(e){return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)(os,{shareholder:s.shareholders[e],totalNumberOfShares:t,listOfficers:s.officers},e),(0,r.jsx)(is,{shareholder:s.shareholders[e],totalNumberOfShares:t,listOfficers:s.officers},e)]},e)}))})})},us=function(){var e=(0,He.W)(["sprout-bg-[#FAFAFA]","sprout-hidden sprout-items-center md:sprout-grid md:sprout-grid-cols-12","sprout-h-16 sprout-py-4 sprout-px-3","sprout-text-xs"]);return(0,r.jsxs)("div",{className:e,children:[(0,r.jsxs)("div",{className:"sprout-col-span-4 sprout-flex sprout-justify-between sprout-items-center",children:[(0,r.jsx)("p",{children:"Name"}),(0,r.jsx)(Q.Qr,{})]}),(0,r.jsx)("div",{className:"sprout-col-span-2",children:(0,r.jsx)("p",{children:"Share Type"})}),(0,r.jsx)("div",{className:"sprout-col-span-2",children:(0,r.jsx)("p",{children:"No of Shares"})}),(0,r.jsx)("div",{className:"sprout-col-span-2",children:(0,r.jsx)("p",{children:"Paid-up and Issued"})}),(0,r.jsx)("div",{className:"sprout-col-span-2",children:(0,r.jsx)("p",{children:"Percentage (%)"})})]})},cs=function(){return(0,r.jsxs)("div",{className:"sprout-flex-1 sprout-flex sprout-flex-col sprout-overflow-hidden",children:[(0,r.jsx)(us,{}),(0,r.jsx)(ls,{})]})};function ds(){return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)("div",{className:"sprout-flex sprout-justify-between sprout-p-4 sprout-items-center",children:(0,r.jsx)("h3",{className:"sprout-font-semibold",children:"Shareholder Listing"})}),(0,r.jsx)("div",{className:"sprout-border-solid sprout-border-[#C4C4C4] sprout-border-b-[1px]"}),(0,r.jsx)(cs,{})]})}function ps(){return(0,r.jsxs)("div",{className:"sprout-flex-1 sprout-flex sprout-flex-col sprout-justify-center sprout-items-center sprout-mx-3 sprout-my-6",children:[(0,r.jsx)(We.default,{src:Ge.Gi,alt:"no records found",height:240,width:240}),(0,r.jsx)("div",{className:"sprout-px-2 sprout-mt-4 sprout-flex sprout-flex-col sprout-text-sm sprout-text-[#828282]",children:(0,r.jsx)("span",{className:"sprout-text-center",children:"This summary reflects the total number of shares, the issued share capital, and the paid-up capital for each share type."})})]})}var ms=function(e){var s,t=e.share;return(0,r.jsxs)("div",{className:(0,He.W)(["sprout-grid sprout-grid-cols-12 sprout-grid-rows-[min-content]","sprout-p-4 sprout-border-b sprout-border-[#DADADA] sprout-border-solid"]),children:[(0,r.jsx)("div",{className:"sprout-col-span-6 sprout-flex sprout-justify-between sprout-items-center",children:(0,r.jsx)("p",{children:null!==(s=(0,ee.t)(t.shareAllotted,0))&&void 0!==s?s:""})}),(0,r.jsx)("div",{className:"sprout-col-span-6",children:(0,r.jsx)("p",{children:(0,ee.Z)(t.paidUpShareCapital,t.shareCurrency)})})]})},fs=function(e){var s=e.title,t=(0,He.W)(["sprout-items-center sprout-grid sprout-grid-cols-12","sprout-h-16 sprout-py-4 sprout-px-3 sprout-border sprout-border-b-[2px]","sprout-text-xs"]);return(0,r.jsx)("div",{className:t,children:(0,r.jsx)("div",{className:"sprout-col-span-12 sprout-flex sprout-justify-between sprout-items-center",children:(0,r.jsxs)("p",{className:"sprout-font-semibold sprout-text-[10px]",children:[s," Shares"]})})})};function hs(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}var xs=function(){var e=(0,u.SS)().companyInformation,s={shareholders:[]};
1(0,g.get)(e.data.data,"company.members",[]).forEach((function(e){for(var t=[],r=0;r<e.appointments.length;r+=1){var o=e.appointments[r];c.Kh.includes(o.position)&&("Active"===o.status||o.isOutgoing)&&t.push(o)}t.length>0&&s.shareholders.push(e)}));var t={};Object.keys(s.shareholders).forEach((function(e){s.shareholders[e].sharesDetails.forEach((function(e){var s=e.shareType,r=e.shareCurrency,o=e.shareAllotted,n=e.paidUpShareCapital;t[s]||(t[s]={}),t[s][r]||(t[s][r]={shareAllotted:0,paidUpShareCapital:0}),t[s][r].shareAllotted+=Number(o),t[s][r].paidUpShareCapital+=Number(n)}))}));var o=Object.keys(t).map((function(e){return{shareType:e,currencies:Object.keys(t[e]).map((function(s){return function(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){hs(e,s,t[s])}))}return e}({shareCurrency:s},t[e][s])}))}}));return Object.keys(s.shareholders).length?(0,r.jsx)(a.Fragment,{children:Object.keys(o).map((function(e,s){return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)(fs,{title:"".concat(s+1,". ").concat(o[e].shareType)}),o[e].currencies.map((function(e,s){return(0,r.jsx)(ms,{share:e},"".concat(e.shareType,"-").concat(s))}))]},o[e].shareType)}))}):(0,r.jsx)("div",{className:"sprout-flex-1 sprout-flex",children:(0,r.jsx)(ps,{})})},vs=function(){var e=(0,He.W)(["sprout-bg-[#FAFAFA]","sprout-hidden sprout-items-center lg:sprout-grid lg:sprout-grid-cols-12","sprout-h-16 sprout-py-4 sprout-px-3","sprout-text-xs"]);return(0,r.jsxs)("div",{className:e,children:[(0,r.jsxs)("div",{className:"sprout-col-span-6 sprout-flex sprout-justify-between sprout-items-center",children:[(0,r.jsx)("p",{children:"No. of Shares"}),(0,r.jsx)(Q.Qr,{})]}),(0,r.jsx)("div",{className:"sprout-col-span-6",children:(0,r.jsx)("p",{children:"Paid-up Capital"})})]})},ys=function(){return(0,r.jsxs)("div",{className:"sprout-flex-1 sprout-flex sprout-flex-col sprout-overflow-hidden",children:[(0,r.jsx)(vs,{}),(0,r.jsx)(xs,{})]})};function gs(){return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)("div",{className:"sprout-flex sprout-justify-between sprout-p-4 sprout-items-center",children:(0,r.jsx)("h3",{className:"sprout-font-semibold",children:"Shares Summary"})}),(0,r.jsx)("div",{className:"sprout-border-solid sprout-border-[#C4C4C4] sprout-border-b-[1px]"}),(0,r.jsx)(ys,{})]})}function js(){var e=(0,u.SS)().emitter,s=we({emitter:e}).handleOnEdit;return(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col",children:(0,r.jsxs)("div",{className:(0,m.WD)(["sprout-relative sprout-flex sprout-flex-col","sprout-border sprout-border-[#CDCDCD] sprout-border-solid sprout-rounded-[16px]","sprout-overflow-hidden"]),children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-justify-between sprout-p-4 sprout-items-center",children:[(0,r.jsx)("h3",{className:"sprout-font-semibold",children:"Stakeholder Listing"}),(0,r.jsx)("button",{className:"sprout-text-primary sprout-font-semibold",onClick:function(){return s(3)},children:"Edit"})]}),(0,r.jsx)("div",{className:"sprout-border-solid sprout-border-[#C4C4C4] sprout-border-b-[1px]"}),(0,r.jsx)(ts,{}),(0,r.jsx)(ds,{}),(0,r.jsx)(gs,{})]})})}function bs(){var e,s,t,o,n,a,i,l=(0,u.SS)(),c=l.companyInformation,d=l.emitter,p=l.generalSSIC,f=we({emitter:d}).handleOnEdit,h=null===c||void 0===c||null===(e=c.data)||void 0===e?void 0:e.data,x=(0,g.get)(p,"data.data",[]),v=x.find((function(e){var s=Object.keys(e)[0];return(null===h||void 0===h?void 0:h.company.ssic.primary.code)===s})),y=x.find((function(e){var s=Object.keys(e)[0];return(null===h||void 0===h?void 0:h.company.ssic.secondary.code)===s})),j="",b="";if(v){var N=Object.keys(v)[0];j="".concat(N," - ").concat(v[N])}if(y){var C=Object.keys(y)[0];b="".concat(C," - ").concat(y[C])}return(0,r.jsxs)("div",{className:(0,m.WD)(["sprout-relative sprout-flex sprout-flex-col","sprout-border sprout-border-[#CDCDCD] sprout-border-solid sprout-rounded-[16px] sprout-p-4","sprout-overflow-hidden"]),children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-justify-between",children:[(0,r.jsx)("h4",{className:"sprout-font-semibold sprout-mb-6",children:"Company Information"}),(0,r.jsx)("button",{className:"sprout-text-primary sprout-font-semibold",onClick:function(){return f(1)},children:"Edit"})]}),(0,r.jsx)("div",{className:"sprout-w-full",children:(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-sp
1ace-y-4",children:[(0,r.jsx)("p",{className:"sprout-text-sm sprout-font-semibold",children:"Company Summary Information"}),(0,r.jsxs)("div",{className:"sprout-grid sprout-grid-cols-1 md:sprout-grid-cols-2",children:[(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-gap-2",children:(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Company Name"}),(0,r.jsx)("p",{children:null===h||void 0===h?void 0:h.company.companyName})]})}),(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-gap-2",children:(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Financial Year End"}),(0,r.jsx)("p",{children:null===h||void 0===h?void 0:h.company.legalDetails.fyeDate})]})})]}),(0,r.jsx)("p",{className:"sprout-text-sm sprout-font-semibold",children:"Business Activity"}),(0,r.jsxs)("div",{className:"sprout-grid sprout-grid-cols-1 md:sprout-grid-cols-2",children:[(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-gap-2",children:(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Primary SSIC"}),(0,r.jsx)("p",{children:j})]})}),(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-gap-2",children:(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Description of Primary SSIC"}),(0,r.jsx)("p",{children:(null===h||void 0===h?void 0:h.company.ssic.primary.otherDescription)||"-"})]})}),(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-gap-2",children:(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Secondary SSIC"}),(0,r.jsx)("p",{children:b||"-"})]})}),(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-gap-2",children:(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Description of Secondary SSIC"}),(0,r.jsx)("p",{children:(null===h||void 0===h?void 0:h.company.ssic.secondary.otherDescription)||"-"})]})})]}),(0,r.jsx)("p",{className:"sprout-text-sm sprout-font-semibold",children:"Company's Registered Address"}),(0,r.jsxs)("div",{className:"sprout-flex",children:[(0,r.jsx)("label",{className:"sprout-inline-flex sprout-cursor-pointer",children:(0,r.jsx)("input",{type:"checkbox",checked:null===h||void 0===h?void 0:h.company.addresses.isUseGrofRegisteredAddress})}),(0,r.jsx)("div",{className:"sprout-ml-2",children:(0,r.jsx)("p",{className:"sprout-text-sm",children:"Use Grof\u2019s Registered Address"})})]}),!(null===h||void 0===h?void 0:h.company.addresses.isUseGrofRegisteredAddress)&&(0,r.jsxs)("div",{className:"sprout-grid sprout-grid-cols-1 md:sprout-grid-cols-2",children:[(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-gap-2",children:(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Block / House No"}),(0,r.jsx)("p",{children:null!==(s=null===h||void 0===h?void 0:h.company.addresses.registeredAddress.blockHouse)&&void 0!==s?s:"-"})]})}),(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-gap-2",children:(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Street Name"}),(0,r.jsx)("p",{children:null!==(t=null===h||void 0===h?void 0:h.company.addresses.registeredAddress.streetName)&&void 0!==t?t:"-"})]})}),(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-gap-2",children:(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Unit No"}),(0,r.jsx)("p",{children:null!==(o=null===h||void 0===h?void 0:h.company.addresses.registeredAddress.unit)&&void 0!==o?o:"-"})]})}),(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-gap-2",children:(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-sp
1ace-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Level No"}),(0,r.jsx)("p",{children:null!==(n=null===h||void 0===h?void 0:h.company.addresses.registeredAddress.level)&&void 0!==n?n:"-"})]})}),(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-gap-2",children:(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Building Name"}),(0,r.jsx)("p",{children:null!==(a=null===h||void 0===h?void 0:h.company.addresses.registeredAddress.buildingName)&&void 0!==a?a:"-"})]})}),(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-gap-2",children:(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Postal Code"}),(0,r.jsx)("p",{children:null!==(i=null===h||void 0===h?void 0:h.company.addresses.registeredAddress.postalCode)&&void 0!==i?i:"-"})]})})]})]})})]})}var Ns=t(27374);function Cs(e,s,t,r,o,n,a){try{var i=e[n](a),l=i.value}catch(u){return void t(u)}i.done?s(l):Promise.resolve(l).then(r,o)}function Ds(e){return function(){var s=this,t=arguments;return new Promise((function(r,o){var n=e.apply(s,t);function a(e){Cs(n,r,o,a,i,"next",e)}function i(e){Cs(n,r,o,a,i,"throw",e)}a(void 0)}))}}function ws(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}var ks=function(e){var s,t,r,o,n,i,l,c=e.emitter,d=(0,je.useRouter)(),p=(0,u.SS)().companyInformation,m=(0,M.Z)({isHideErrorSnackBar:!0,isThrowError:!0}),f=(0,a.useRef)(N.q.getState()).current.setGlobalSnackbar;return{handleOnCheckAgentPartnerCode:(0,a.useCallback)((function(e,s,t){var r,o,n,a=null===p||void 0===p||null===(r=p.data)||void 0===r||null===(o=r.data)||void 0===o||null===(n=o._id)||void 0===n?void 0:n.toString();return c.emit("@set-is-page-loading",!0),m.post("/kyb/core/check-agent-code",{agentCode:e}).then(Ds(U().mark((function s(r){return U().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:if("OK"!==(null===r||void 0===r?void 0:r.status)){s.next=8;break}return c.emit("@set-is-agent-mode",!0),c.emit("@modal/partner-code",!1),c.emit("@set-agent-partner-code",e),s.next=6,m.put("/kyb/application/".concat(a),{agentCode:null===e||void 0===e?void 0:e.toUpperCase(),isAgentFlow:!0});case 6:setTimeout((function(){t("agentPartnerCode","")}),2e3),d.push("/kyb?isRefetch=true");case 8:case"end":return s.stop()}}),s)})))).catch((function(){s("agentPartnerCode","Please enter a correct Grof partner code"),f("Invalid partner code. Please double check and try again","error")})).finally((function(){c.emit("@set-is-page-loading",!1)}))}),[m,null===p||void 0===p||null===(s=p.data)||void 0===s||null===(t=s.data)||void 0===t?void 0:t._id,c,d,f]),handleOnCancelAgentPartnerCode:(0,a.useCallback)((function(){var e,s,t,r,o,n,a;c.emit("@modal/cancel-partner-code",!1),c.emit("@set-is-page-loading",!0);var i=null===p||void 0===p||null===(e=p.data)||void 0===e||null===(s=e.data)||void 0===s||null===(t=s._id)||void 0===t?void 0:t.toString(),l=[];return null===p||void 0===p||null===(r=p.data)||void 0===r||null===(o=r.data)||void 0===o||null===(n=o.company)||void 0===n||null===(a=n.members)||void 0===a||a.forEach((function(e){var s,t,r,o,n,a,i,u,c,d;e.companyDetails&&(u=function(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){ws(e,s,t[s])}))}return e}({},e.companyDetails,{documents:null===(c=e.companyDetails.documents)||void 0===c?void 0:c.map((function(e){return{id:e._id,type:e.fileType}}))}),(null===(d=e.companyDetails.legalDetails)||void 0===d?void 0:d.registrationDate)&&(u.legalDetails.registrationDate=(0,J.Z)(new Date(e.companyDetails.legalDetails.registrationDate),"yyyy-MM-dd")));l.push({appointments:null===(s=e.appointments)||void 0===s?void 0:s.filter((function(e){return"Corporate Representative of"!==e.position}
1)),sharesDetails:e.sharesDetails,personDetails:{contactDetails:{email:null===(t=e.personDetails)||void 0===t||null===(r=t.contactDetails)||void 0===r?void 0:r.email},personalDetails:{fullName:null===(o=e.personDetails)||void 0===o||null===(n=o.personalDetails)||void 0===n?void 0:n.fullName},documents:null===(a=e.personDetails)||void 0===a||null===(i=a.documents)||void 0===i?void 0:i.map((function(e){return{id:e._id,type:e.fileType}}))},onfidoApplicantId:e.onfidoApplicantId,onfidoWorkflowRunId:e.onfidoWorkflowRunId,isApplicant:e.isApplicant,personId:e.personId,eKycLink:e.eKycLink,category:e.category,corporateRepresentativeOf:e.corporateRepresentativeOf,companyDetails:u,_id:e._id})})),m.put("/kyb/application/".concat(i),{isAgentFlow:!1,company:{members:l},currentStep:3}).then(Ds(U().mark((function e(s){return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:"OK"===(null===s||void 0===s?void 0:s.status)&&(c.emit("@set-is-agent-mode",!1),c.emit("@set-agent-partner-code",""),d.push("/kyb?isRefetch=true"),c.emit("@stepper",3));case 1:case"end":return e.stop()}}),e)})))).catch((function(){})).finally((function(){c.emit("@set-is-page-loading",!1)}))}),[m,null===p||void 0===p||null===(r=p.data)||void 0===r||null===(o=r.data)||void 0===o?void 0:o._id,null===p||void 0===p||null===(n=p.data)||void 0===n||null===(i=n.data)||void 0===i||null===(l=i.company)||void 0===l?void 0:l.members,c,d])}},Os=function(){var e=(0,u.SS)(),s=e.agentPartnerCodeModal,t=e.emitter,o=e.cancelAgentPartnerCodeModal,n=ks({emitter:t}),a=n.handleOnCheckAgentPartnerCode,i=n.handleOnCancelAgentPartnerCode,l=function(){var e=(0,w.useFormikContext)(),s=e.setFieldError,t=e.isValid,o=e.values,n=e.validateForm,i=e.setFieldValue;return(0,r.jsx)(D.iR,{className:"sprout-whitespace-nowrap",secondary:!0,onClick:function(){n().then((function(){t&&a(o.agentPartnerCode,s,i)}))},children:"Continue"})};return(0,r.jsxs)("div",{className:"sprout-fixed sprout-z-[100]",children:[(0,r.jsxs)(D.BT,{className:"sprout-w-[325px] md:sprout-w-[400px] !sprout-p-4",show:s.isOpen,useBackground:!0,onClose:s.onClose,children:[(0,r.jsxs)("div",{className:"sprout-text-center md:sprout-text-[16px] sprout-text-[14px]",children:[(0,r.jsx)("div",{className:"sprout-text-base sprout-font-semibold sprout-mb-[16px]",children:"This Process is Exclusive to Grof Partners"}),(0,r.jsx)("div",{className:"sprout-mb-[16px] md:sprout-text-[14px] sprout-text-[12px]",children:"Please enter your Grof partner code to proceed. If you don't have one, you can go back by clicking the Close button below."})]}),(0,r.jsxs)(D._O.form,{initialValues:{agentPartnerCode:""},validate:function(e){var s={};return e.agentPartnerCode||(s.agentPartnerCode="This field is required"),s},onSubmit:function(){},children:[(0,r.jsx)(Ns.K,{name:"agentPartnerCode",className:"sprout-w-full sprout-flex-row sprout-leading-5 sprout-text-[#434343] sprout-outline-none sprout-border-b sprout-border-b-[#979797] sprout-h-full sprout-bg-white sprout-p-2 sprout-rounded focus:sprout-border-b-[#FB8110] disabled:sprout-bg-[#f1f1f1] disabled:sprout-text-[#999999]",placeholder:"Enter Grof partner code",errorClass:"!sprout-text-[12px]"}),(0,r.jsxs)("div",{className:E()(["sprout-grid sprout-gap-6","sprout-grid-cols-2","sprout-mt-[16px]"]),children:[(0,r.jsx)(D.iR,{tertiary:!0,onClick:s.onClose,children:"Close"}),(0,r.jsx)(l,{})]})]})]}),(0,r.jsx)(C.Z,{open:o.isOpen,title:"Are you sure to leave this process?",okText:"Leave",okVariant:"primary",cancelVariant:"secondary",okRed:!0,onOk:i,onCancel:o.onClose,children:(0,r.jsx)("p",{className:"sprout-text-sm sprout-pt-4 sprout-pb-6 sprout-px-3",children:"This action will discard all inputted data, and it cannot be undone"})})]})};function As(){var e=(0,u.SS)(),s=e.emitter,t=e.selectedOption,o=e.isACRAError,n=we({emitter:s}),i=n.handleOnSave,l=n.handleOnSubmit,c=Ze({emitter:s}),d=c.confirmationModal,p=c.handleOnConfirm;return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)(C.Z,{open:d.isOpen,title:"Are you sure to discard this process?",okText:"Discard",okVariant:"primary",cancelVariant:"secondary",okRed:!0,onOk:p,onCancel:d.onClose,children:(0,r.jsx)("p",{className:"sprout-text-sm sprout-pt-4 sprout-pb-6 sprout-px-3",children:"This action will discard all inputted data, and it cannot be undone"})}),(0,r.jsx)(Os,{}),(0,r.jsxs)(b.Z.form,{onSubmit:l,children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-sp
1ace-y-8",children:[!o&&!t.incorporation&&(0,r.jsx)(Se,{}),t.incorporation&&(0,r.jsx)(bs,{}),o&&!t.incorporation&&(0,r.jsx)(qe,{}),(0,r.jsx)(ke,{}),!o&&!t.incorporation&&(0,r.jsx)(Ve,{}),!o&&t.corpSec&&(0,r.jsx)(Ee,{}),t.incorporation&&(0,r.jsx)(js,{})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-justify-end sprout-space-x-6 sprout-mt-8",children:[(0,r.jsx)(D.iR,{secondary:!0,onClick:i,children:"Save"}),(0,r.jsx)(D.iR,{primary:!0,type:"submit",children:"Submit"})]}),(0,r.jsxs)("p",{className:"sprout-mt-6",children:["If you wish to discard the existing onboarding process or start a new one,",(0,r.jsx)("span",{className:"sprout-ml-2 sprout-font-semibold sprout-text-[#960F21] sprout-cursor-pointer",onClick:d.onOpen,children:"click here"})]})]})]})}var Ss=t(92197),Es=function(){return(0,r.jsxs)("div",{className:"sprout-flex-1 sprout-flex sprout-flex-col sprout-justify-center sprout-items-center sprout-mx-3 sprout-my-6",children:[(0,r.jsx)(We.default,{src:Ss.Gi,alt:"no records found"}),(0,r.jsx)("div",{className:"sprout-px-2 sprout-flex sprout-flex-col sprout-text-sm sprout-text-[#828282]",children:(0,r.jsx)("span",{className:"sprout-text-center",children:"No Data pulled from Acra"})})]})},Ps=t(60493);function Ts(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function Is(e){var s=e.secretary,t=e.index,o=(0,w.useFormikContext)(),n=o.values,a=o.setValues,i=null===n||void 0===n?void 0:n.secretaries["".concat(s._id)].appointments.filter((function(e){return c.mB.includes(e.position)&&"Active"===e.status}));if(!(null===i||void 0===i?void 0:i.length))return(0,r.jsx)(r.Fragment,{});var l=(0,g.findIndex)(null===n||void 0===n?void 0:n.secretaries["".concat(s._id)].appointments,{_id:i[0]._id}),u=n.secretaries,d=u[s._id].appointments[l];return(0,r.jsxs)("div",{className:"sprout-grid md:sprout-grid-cols-2 sprout-gap-2 sprout-p-4",children:[(0,r.jsx)("p",{children:s.personDetails.personalDetails.fullName}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("div",{className:"checkbox-container",children:[(0,r.jsx)(Ps.I,{id:"outgoingCheckbox_".concat(t),type:"checkbox",name:"secretaries.".concat(s._id,".appointments[").concat(l,"].isOutgoing"),checked:n.secretaries["".concat(s._id)].appointments["".concat(l)].isOutgoing,value:n.secretaries["".concat(s._id)].appointments["".concat(l)].isOutgoing,onChange:function(e){d.isOutgoing=e.target.checked,e.target.checked||(d.outgoingEmail=""),a(function(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){Ts(e,s,t[s])}))}return e}({},n,{secretaries:u}))}}),(0,r.jsx)("label",{htmlFor:"is-apply-for-business-account",children:(0,r.jsx)("div",{className:"checkbox-label sprout-text-sm",children:"Outgoing Secretary"})})]}),(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:n.secretaries["".concat(s._id)].appointments["".concat(l)].isOutgoing?"Grof will send resignation email to this person.":"Tick this if Secretary will resign."}),n.secretaries["".concat(s._id)].appointments["".concat(l)].isOutgoing&&(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Email"]}),(0,r.jsx)(Ns.K,{id:"emailInput_".concat(t),placeholder:"Enter email address",name:"secretaries.".concat(s._id,".appointments[").concat(l,"].outgoingEmail")})]})]})]})}function Fs(e,s,t,r,o,n,a){try{var i=e[n](a),l=i.value}catch(u){return void t(u)}i.done?s(l):Promise.resolve(l).then(r,o)}function Rs(e){return function(){var s=this,t=arguments;return new Promise((function(r,o){var n=e.apply(s,t);function a(e){Fs(n,r,o,a,i,"next",e)}function i(e){Fs(n,r,o,a,i,"throw",e)}a(void 0)}))}}function Ls(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function _s(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){Ls(e,s,t[s])}))}return e}function Bs(e){return function(e){if(Array.isArray(e)){for(var s=0,t=new Array(e.length);s<e.length;s++)t[s]=e[s];return t}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var Vs=function(e){var s,t=e.emitter,r=(0,u.SS)(),o=r.companyInformation,n=r.serviceType,i=(0,y.a)().profileState,l=(0,M.Z)(),d=(0,a.useRef)(N.q.getState()).current.setGlobalSnackbar,p=(0,a.useCallback)((function(e){var s={officers:[],shareholders:[],secretaries:[],others:[]};
1e.company.members.forEach((function(e){var t=e.appointments.filter((function(e){return c.UK.includes(e.position)})),r=e.appointments.filter((function(e){return c.Kh.includes(e.position)})),o=e.appointments.filter((function(e){return c.KJ.includes(e.position)})),n=e.appointments.filter((function(e){return c.mB.includes(e.position)}));t.length>0&&"INDIVIDUAL"===e.category&&s.officers.push(e),(r.length>0||"CORPORATE"===e.category)&&s.shareholders.push(e),o.length>0&&s.others.push(e),n.length>0&&s.secretaries.push(e)})),Object.keys(e.secretaries).forEach((function(t){var r=(0,g.findIndex)(s.secretaries,{_id:t}),o=e.secretaries[t].appointments.filter((function(e){return c.mB.includes(e.position)&&"Active"===e.status}));if(null===o||void 0===o?void 0:o.length){var n=(0,g.findIndex)(e.secretaries[t].appointments,{_id:o[0]._id});s.secretaries[r].appointments[n].isOutgoing=e.secretaries[t].appointments[n].isOutgoing,e.secretaries[t].appointments[n].isOutgoing&&(s.secretaries[r].appointments[n]=_s({},s.secretaries[r].appointments[n],{outgoingEmail:e.secretaries[t].appointments[n].outgoingEmail}))}}));var t=[];s.officers.map((function(e){return t.push(e._id)})),s.shareholders.map((function(e){return t.push(e._id)})),s.secretaries.map((function(e){return t.push(e._id)}));var r=Bs(s.officers).concat(Bs(s.shareholders),Bs(s.others.filter((function(e){return!t.includes(e._id)}))),Bs(s.secretaries)).map((function(e){var s,t,r,o,n,a,i,l,u,c,d,p=e,m=[];(null===(s=p.personDetails)||void 0===s?void 0:s.documents)&&(p.personDetails.documents.forEach((function(e){m.push({id:e._id||e.id,type:e.fileType||e.type})})),p.personDetails.documents=m);var f=_s({},(null===(t=p.personDetails)||void 0===t?void 0:t.address)||{},{postalCode:(null===(r=p.personDetails)||void 0===r||null===(o=r.address)||void 0===o?void 0:o.postalCode)||(null===(n=p.personDetails)||void 0===n||null===(a=n.address)||void 0===a?void 0:a.postcode),postcode:void 0});return(null===(i=p.personDetails)||void 0===i?void 0:i.address)&&(p.personDetails.address=f),(null===(l=p.personDetails)||void 0===l||null===(u=l.personalDetails)||void 0===u?void 0:u.alias)&&(p.personDetails.personalDetails.alias=p.personDetails.personalDetails.alias.filter((function(e){return!!e}))),p.personDetails.personalDetails&&(p.personDetails.personalDetails.gender=p.personDetails.personalDetails.gender||void 0,p.personDetails.personalDetails.countryOfBirth=p.personDetails.personalDetails.countryOfBirth||void 0,p.personDetails.personalDetails.dateOfBirth=p.personDetails.personalDetails.dateOfBirth||void 0,p.personDetails.personalDetails.idDocument&&(p.personDetails.personalDetails.idDocument.dateOfIssuance=p.personDetails.personalDetails.idDocument.dateOfIssuance||void 0)),p.personDetails.riskProfileAssessment&&(p.personDetails.riskProfileAssessment.sourceOfIncome=void 0,p.personDetails.riskProfileAssessment.sourceOfFunds=void 0,p.personDetails.riskProfileAssessment.otherSourceOfFunds=void 0,p.personDetails.riskProfileAssessment.occupation=void 0,p.personDetails.riskProfileAssessment.sourceOfWealth=void 0,p.personDetails.riskProfileAssessment.isShareOnBehalfAnotherPerson=void 0,p.personDetails.riskProfileAssessment.shareOnBehalfAnotherPerson=void 0,p.personDetails.riskProfileAssessment.isNomineeDirector=void 0,p.personDetails.riskProfileAssessment.isAcceptDirectorCriteria=void 0),(null===(c=p.personDetails)||void 0===c?void 0:c.kycStatus)&&(p.personDetails.kycStatus=void 0),_s({},p,{appointments:p.appointments.filter((function(e){return"Corporate Representative of"!==e.position})),companyDetails:_s({},e.companyDetails,{documents:(0,g.get)(e,"companyDetails.documents",[]).map((function(e){return{id:e._id}})),legalDetails:_s({},(null===(d=e.companyDetails)||void 0===d?void 0:d.legalDetails)||{},{registrationDate:(0,J.Z)(new Date((0,g.get)(e,"companyDetails.legalDetails.registrationDate",null)),"yyyy-MM-dd")})}),personDetails:_s({},e.personDetails||{},{__v:void 0,createdAt:void 0,updatedAt:void 0,isMatchWithUser:void 0,_id:void 0,archivedData:void 0})})}));return r=(0,g.uniqBy)(r,"_id")}),[]),f=(0,a.useCallback)((function(e){var s={company:{members:p(e)},currentStep:4},r=(0,g.get)(o,"data.data._id","");return t.emit("@set-is-page-loading",!0),l.put("/kyb/application/".concat(r),s).then(Rs(U().mark((function e(s){return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("OK"!==(null===s||void 0===s?void 0:s.status)){e.next=2;break}return e.abrupt("return",d("Successfully saved the progress","success"));case 2:return d("Something went wrong","error"),e.abrupt("return",null);case 4:case"end":return e.stop()}}),e)})))).catch((function(e){d(e.message,"error")})).finally((function(){t.emit("@set-is-page-loading",!1)}))}),[l,o,t,p,d]);return{handleOnBack:(0,a.useCallback)((function(){return o.mutate(),t.emit("@stepper",3)}),[o,t]),handleOnSave:f,handleOnNext:(0,a.useCallback)((function(){return t.emit("@stepper",5)}),[t]),handleOnSubmit:(0,a.useCallback)((function(e){var s={company:{members:p(e)},currentStep:5},r=(0,g.get)(o,"data.data._id","");return t.emit("@set-is-page-loading",!0),l.put("/kyb/application/".concat(r),s).then(Rs(U().mark((function e(s){var r,a,l,u;return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("OK"!==(null===s||void 0===s?void 0:s.status)){e.next=7;break}return d("Successfully saved the progress","success"),e.next=5,o.mutate();case 5:return Z.Z.track("List of Secretary",{userID:i.userId,email:null===(r=i.profile)||void 0===r?void 0:r.emailAddresses[0],organizationID:s.data.organizationId,organizationName:null===(a=o.data)||void 0===a||null===(l=a.data)||void 0===l||null===(u=l.company)||void 0===u?void 0:u.companyName,serviceType:n,completedAt:(0,m.gS)(),deviceType:"Web"}),e.abrupt("return",t.emit("@stepper",5));case 7:return d("Something went wrong","error"),e.abrupt("return",null);case 9:case"end":return e.stop()}}),e)})))).catch((function(e){d(e.message,"error")})).finally((function(){t.emit("@set-is-page-loading",!1)}))}),[l,o,t,null===(s=i.profile)||void 0===s?void 0:s.emailAddresses,i.userId,p,n,d])}};function Us(e,s,t,r,o,n,a){try{var i=e[n](a),l=i.value}catch(u){return void t(u)}i.done?s(l):Promise.resolve(l).then(r,o)}var Ms=function(e){var s=e.emitter,t=(0,K.Z)(),r=(0,a.useRef)(N.q.getState()).current.setGlobalSnackbar,o=(0,u.SS)().companyInformation,n=(0,a.useMemo)((function(){var e,s;return null===o||void 0===o||null===(e=o.data)||void 0===e||null===(s=e.data)||void 0===s?void 0:s._id}),[o]),i=(0,Ue.Z)(),l=(0,a.useCallback)((function(){var e,t={applicationId:n};return i.post("kyb/core/discard-company-info",t).then((e=U().mark((function e(t){return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("OK"!==(null===t||void 0===t?void 0:t.status)){e.next=8;break}return o.mutate(),r("Successfully discarded the process.","info"),s.emit("@set-is-acra-error",!1),s.emit("@select-option",{key:"incorporation",value:!1}
1),s.emit("@select-option",{key:"corpSec",value:!1}),s.emit("@select-option",{key:"finance",value:!1}),e.abrupt("return",s.emit("@stepper",0));case 8:return r("Something went wrong","error"),e.abrupt("return",t);case 10:case"end":return e.stop()}}),e)})),function(){var s=this,t=arguments;return new Promise((function(r,o){var n=e.apply(s,t);function a(e){Us(n,r,o,a,i,"next",e)}function i(e){Us(n,r,o,a,i,"throw",e)}a(void 0)}))})).catch((function(e){r(e.message,"error")}))}),[n,i,o,s,r]);return(0,a.useEffect)((function(){return s.on("@modal/confirm",t.onToggle),function(){s.off("@modal/confirm",t.onToggle)}}),[t.onToggle,s]),{handleOnConfirm:l,confirmationModal:t}};function Zs(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function qs(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){Zs(e,s,t[s])}))}return e}var Ws=function(){var e=(0,w.useFormikContext)().values,s=(0,u.SS)().emitter,t=Vs({emitter:s}).handleOnSave;return(0,r.jsx)(D.iR,{secondary:!0,onClick:function(){return t(e)},children:"Save"})},Gs=function(){var e=(0,w.useFormikContext)().isValid;return(0,r.jsx)(D.iR,{primary:!0,type:"submit",disabled:!e,children:"Next Step"})};function Ks(){var e=(0,u.SS)(),s=e.emitter,t=e.companyInformation,o=Vs({emitter:s}).handleOnSubmit,n=Ms({emitter:s}),i=n.confirmationModal,l=n.handleOnConfirm,d={secretaries:[]};(0,g.get)(t.data.data,"company.members",[]).forEach((function(e){var s=e.appointments.filter((function(e){return c.mB.includes(e.position)}));e.appointments.filter((function(e){return"Active"===e.status})).length>0&&s.length>0&&d.secretaries.push(e)}));var p=qs({},t.data.data||{},{secretaries:function(){var e={};return d.secretaries.forEach((function(s){e[s._id]=qs({},s)})),e}()});return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)(C.Z,{open:i.isOpen,title:"Are you sure to discard this process?",okText:"Discard",okVariant:"primary",cancelVariant:"secondary",okRed:!0,onOk:l,onCancel:i.onClose,children:(0,r.jsx)("p",{className:"sprout-text-sm sprout-pt-4 sprout-pb-6 sprout-px-3",children:"This action will discard all inputted data, and it cannot be undone"})}),(0,r.jsx)(Os,{}),(0,r.jsxs)(b.Z.form,{initialValues:p,onSubmit:o,validation:function(e){return function(e){var s={},t=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;return Object.keys(e.secretaries).forEach((function(r){var o,n=null===e||void 0===e?void 0:e.secretaries[r].appointments.filter((function(e){return c.mB.includes(e.position)&&"Active"===e.status}));if(null===n||void 0===n?void 0:n.length){var a=(0,g.findIndex)(null===e||void 0===e?void 0:e.secretaries[r].appointments,{_id:null===(o=n[0])||void 0===o?void 0:o._id});(0,g.get)(e,"secretaries.".concat(r,".appointments[").concat(a,"].isOutgoing"),!1)&&!(0,g.get)(e,"secretaries.".concat(r,".appointments[").concat(a,"].outgoingEmail"),null)&&(s=qs({},s,{secretaries:qs({},s.secretaries,Zs({},r,{appointments:Zs({},a,{outgoingEmail:"This field is required"})}))})),(0,g.get)(e,"secretaries.".concat(r,".appointments[").concat(a,"].outgoingEmail"),null)&&!t.test((0,g.get)(e,"secretaries.".concat(r,".appointments[").concat(a,"].outgoingEmail"),null))&&(s=qs({},s,{secretaries:qs({},s.secretaries,Zs({},r,{appointments:Zs({},a,{outgoingEmail:"Invalid email address"})}))}))}})),s}(e)},validateOnChange:!0,validateOnBlur:!0,validateOnMount:!0,children:[(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-8",children:(0,r.jsxs)("div",{className:(0,m.WD)(["sprout-relative sprout-flex sprout-flex-col","sprout-border sprout-border-[#CDCDCD] sprout-border-solid sprout-rounded-[16px]","sprout-overflow-hidden"]),children:[0===d.secretaries.length&&(0,r.jsx)(Es,{}),(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-divide-y",children:(0,r.jsx)(w.FieldArray,{name:"members",render:function(){return(0,r.jsx)("div",{children:d.secretaries.map((function(e,s){return(0,r.jsx)(Is,{index:s,secretary:e},e.id)}))})}})})]})}),(0,r.jsxs)("div",{className:"sprout-flex sprout-justify-end sprout-sp
1ace-x-6 sprout-mt-8",children:[(0,r.jsx)(Ws,{}),(0,r.jsx)(Gs,{})]}),(0,r.jsxs)("p",{className:"sprout-mt-6",children:["If you wish to discard the existing onboarding process or start a new one,",(0,r.jsx)("span",{className:"sprout-ml-2 sprout-font-semibold sprout-text-[#960F21] sprout-cursor-pointer",onClick:i.onOpen,children:"click here"})]})]})]})}var Hs=t(137);function zs(e,s,t,r,o,n,a){try{var i=e[n](a),l=i.value}catch(u){return void t(u)}i.done?s(l):Promise.resolve(l).then(r,o)}function Ys(e){return function(){var s=this,t=arguments;return new Promise((function(r,o){var n=e.apply(s,t);function a(e){zs(n,r,o,a,i,"next",e)}function i(e){zs(n,r,o,a,i,"throw",e)}a(void 0)}))}}function Xs(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function Qs(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){Xs(e,s,t[s])}))}return e}function $s(e){return function(e){if(Array.isArray(e)){for(var s=0,t=new Array(e.length);s<e.length;s++)t[s]=e[s];return t}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var Js=function(e){var s,t=e.emitter,r=(0,u.SS)(),o=r.companyInformation,n=r.selectedOption,i=r.serviceType,l=(0,y.a)().profileState,d=l.profile,p=(0,M.Z)(),f=(0,a.useRef)(N.q.getState()).current.setGlobalSnackbar,h=(0,a.useCallback)((function(e){var s={officers:[],shareholders:[],secretaries:[],others:[]};e.company.members.forEach((function(e){var t=e.appointments.filter((function(e){return c.UK.includes(e.position)})),r=e.appointments.filter((function(e){return c.Kh.includes(e.position)})),o=e.appointments.filter((function(e){return c.KJ.includes(e.position)})),n=e.appointments.filter((function(e){return c.mB.includes(e.position)}));t.length>0&&"INDIVIDUAL"===e.category&&s.officers.push(e),(r.length>0||"CORPORATE"===e.category)&&s.shareholders.push(e),o.length>0&&s.others.push(e),n.length>0&&s.secretaries.push(e)})),Object.keys(e.officers).forEach((function(t){var r=(0,g.findIndex)(s.officers,{_id:t});if(-1===r)s.officers.push(e.officers[t]);else{var o,n,a,i,l,u;if(null===(o=null===e||void 0===e?void 0:e.officers[t])||void 0===o||null===(n=o.personDetails)||void 0===n||null===(a=n.contactDetails)||void 0===a?void 0:a.email){var p=e.officers[t].personDetails.contactDetails.email;Array.isArray(p)&&p.length>0&&(p=p[0]),s.officers[r].personDetails=Qs({},s.officers[r].personDetails,{contactDetails:{email:p,phoneNumber:e.officers[t].personDetails.contactDetails.phoneNumber,phoneCountry:e.officers[t].personDetails.contactDetails.phoneCountry}})}else!e.officers[t].isApplicant&&(null===(i=null===e||void 0===e?void 0:e.officers[t])||void 0===i||null===(l=i.personDetails)||void 0===l||null===(u=l.contactDetails)||void 0===u?void 0:u.email)&&delete s.officers[r].personDetails.contactDetails.email;if(e.officers[t].isApplicant?(s.officers[r].isApplicant=!0,s.officers[r].personDetails=Qs({},s.officers[r].personDetails,{contactDetails:Qs({},s.officers[r].personDetails.contactDetails,{email:null===d||void 0===d?void 0:d.emailAddresses[0]})})):s.officers[r].isApplicant=!1,!e.officers[t].appointments.filter((function(e){return c.UK.includes(e.position)&&"Active"===e.status})).length)return;for(var m=0;m<e.officers[t].appointments.length;m+=1)s.officers[r].appointments[m].isOutgoing=e.officers[t].appointments[m].isOutgoing,s.officers[r].appointments[m].outgoingEmail=e.officers[t].appointments[m].outgoingEmail}}));var t=Object.keys(e.officers),r=s.officers.filter((function(e){return-1!==t.findIndex((function(s){return e._id===s}))||-1===e.appointments.findIndex((function(e){return"Corporate Representative"===e.position}))}));Object.keys(e.shareholders).forEach((function(t){var r=(0,g.findIndex)(s.shareholders,{_id:t}),o=(0,g.find)(s.shareholders,{_id:t});if(o){var n,a,i,l,u,c,p,m,f,h,x,v,y,j,b,N,C,D,w,k,O,A,S,E,P,T,I,F,R,L,_,B,V,U,M,Z,q,W,G,K,H,z,Y,X,Q=(0,g.findIndex)(s.shareholders,{_id:o._id});if(e.shareholders[t].corporateRepresentativeOf)s.shareholders[Q].corporateRepresentativeOf=(null===(E=e.shareholders[t].corporateRepresentativeOf)||void 0===E?void 0:E.value)||e.shareholders[t].corporateRepresentativeOf;if((null===(n=null===e||void 0===e?void 0:e.shareholders[t])||void 0===n||null===(a=n.personDetail
1s)||void 0===a||null===(i=a.contactDetails)||void 0===i?void 0:i.email)?s.shareholders[Q].personDetails=Qs({},s.shareholders[Q].personDetails,{contactDetails:{email:e.shareholders[t].personDetails.contactDetails.email,phoneNumber:e.shareholders[t].personDetails.contactDetails.phoneNumber,phoneCountry:e.shareholders[t].personDetails.contactDetails.phoneCountry}}):!e.shareholders[t].isApplicant&&(null===(l=null===e||void 0===e?void 0:e.shareholders[t])||void 0===l||null===(u=l.personDetails)||void 0===u||null===(c=u.contactDetails)||void 0===c?void 0:c.email)&&delete s.shareholders[Q].personDetails.contactDetails.email,e.shareholders[t].isApplicant?(s.shareholders[r].isApplicant=!0,s.shareholders[r].personDetails=Qs({},s.shareholders[r].personDetails,{contactDetails:Qs({},s.shareholders[r].personDetails.contactDetails,{email:null===d||void 0===d?void 0:d.emailAddresses[0]})})):s.shareholders[r].isApplicant=!1,(null===(p=e.shareholders[t])||void 0===p||null===(m=p.companyDetails)||void 0===m?void 0:m.documents)&&0!==(null===(f=e.shareholders[t])||void 0===f||null===(h=f.companyDetails)||void 0===h?void 0:h.documents.length))s.shareholders[r].companyDetails.documents=null===(P=e.shareholders[t])||void 0===P||null===(T=P.companyDetails)||void 0===T?void 0:T.documents;if(null===(x=e.shareholders[t].companyDetails)||void 0===x||null===(v=x.legalDetails)||void 0===v?void 0:v.historyName)s.shareholders[Q].companyDetails.legalDetails.historyName=null===(I=e.shareholders[t].companyDetails)||void 0===I||null===(F=I.legalDetails)||void 0===F?void 0:F.historyName;if(null===(y=e.shareholders[t].companyDetails)||void 0===y||null===(j=y.legalDetails)||void 0===j?void 0:j.companyType)s.shareholders[Q].companyDetails.legalDetails.companyType=(null===(R=e.shareholders[t].companyDetails)||void 0===R||null===(L=R.legalDetails)||void 0===L||null===(_=L.companyType)||void 0===_?void 0:_.value)||(null===(B=e.shareholders[t].companyDetails)||void 0===B||null===(V=B.legalDetails)||void 0===V?void 0:V.companyType);if(null===(b=e.shareholders[t].companyDetails)||void 0===b||null===(N=b.legalDetails)||void 0===N?void 0:N.countryOfRegisteredBusiness)s.shareholders[Q].companyDetails.legalDetails.countryOfRegisteredBusiness=(null===(U=e.shareholders[t].companyDetails)||void 0===U||null===(M=U.legalDetails)||void 0===M||null===(Z=M.countryOfRegisteredBusiness)||void 0===Z?void 0:Z.value)||(null===(q=e.shareholders[t].companyDetails)||void 0===q||null===(W=q.legalDetails)||void 0===W?void 0:W.countryOfRegisteredBusiness);if((null===(C=e.shareholders[t].companyDetails)||void 0===C||null===(D=C.riskProfileAssessment)||void 0===D||null===(w=D.countryOfOperations)||void 0===w?void 0:w.length)>0)s.shareholders[Q].companyDetails.riskProfileAssessment.countryOfOperations=null===(G=e.shareholders[t].companyDetails)||void 0===G||null===(K=G.riskProfileAssessment)||void 0===K?void 0:K.countryOfOperations;if(null===(k=e.shareholders[t].companyDetails)||void 0===k||null===(O=k.addresses)||void 0===O?void 0:O.registeredAddress)s.shareholders[Q].companyDetails.addresses.registeredAddress=null===(H=e.shareholders[t].companyDetails)||void 0===H||null===(z=H.addresses)||void 0===z?void 0:z.registeredAddress;if(null===(A=e.shareholders[t].companyDetails)||void 0===A||null===(S=A.addresses)||void 0===S?void 0:S.principalPlaceOfBusiness)s.shareholders[Q].companyDetails.addresses.principalPlaceOfBusiness=null===(Y=e.shareholders[t].companyDetails)||void 0===Y||null===(X=Y.addresses)||void 0===X?void 0:X.principalPlaceOfBusiness}}));var o=[];s.officers.map((function(e){return o.push(e._id)})),s.shareholders.map((function(e){return o.push(e._id)})),s.secretaries.map((function(e){return o.push(e._id)}));var n=$s(r).concat($s(s.shareholders),$s(s.others.filter((function(e){return!o.includes(e._id)}))),$s(s.secretaries)).map((function(e){var s,t,r,o,n,a,i,l,u,c,d,p,m=e,f=[],h=Qs({},(null===(s=m.personDetails)||void 0===s?void 0:s.address)||{},{postalCode:(null===(t=m.personDetails)||void 0===t||null===(r=t.address)||void 0===r?void 0:r.postalCode)||(null===(o=m.personDetails)||void 0===o||null===(n=o.address)||void 0===n?void 0:n.postcode),postcode:void 0});
1return(null===(a=m.personDetails)||void 0===a?void 0:a.address)&&(m.personDetails.address=h),(null===m||void 0===m||null===(i=m.personDetails)||void 0===i?void 0:i.documents)&&(m.personDetails.documents.forEach((function(e){f.push({id:e._id,type:e.fileType})})),m.personDetails.documents=f),(null===(l=m.personDetails)||void 0===l||null===(u=l.personalDetails)||void 0===u?void 0:u.alias)&&(m.personDetails.personalDetails.alias=m.personDetails.personalDetails.alias.filter((function(e){return!!e}))),(null===(c=m.personDetails)||void 0===c||null===(d=c.personalDetails)||void 0===d?void 0:d.idDocument)&&(m.personDetails.personalDetails.idDocument.dateOfIssuance=m.personDetails.personalDetails.idDocument.dateOfIssuance||void 0),m.personDetails.personalDetails&&(m.personDetails.personalDetails.gender=m.personDetails.personalDetails.gender||void 0,m.personDetails.personalDetails.countryOfBirth=m.personDetails.personalDetails.countryOfBirth||void 0,m.personDetails.personalDetails.dateOfBirth=m.personDetails.personalDetails.dateOfBirth||void 0),m.personDetails.riskProfileAssessment&&(m.personDetails.riskProfileAssessment.sourceOfIncome=void 0,m.personDetails.riskProfileAssessment.sourceOfFunds=void 0,m.personDetails.riskProfileAssessment.otherSourceOfFunds=void 0,m.personDetails.riskProfileAssessment.occupation=void 0,m.personDetails.riskProfileAssessment.sourceOfWealth=void 0,m.personDetails.riskProfileAssessment.isShareOnBehalfAnotherPerson=void 0,m.personDetails.riskProfileAssessment.shareOnBehalfAnotherPerson=void 0,m.personDetails.riskProfileAssessment.isNomineeDirector=void 0,m.personDetails.riskProfileAssessment.isAcceptDirectorCriteria=void 0),m.kycSubmittedBy=m.kycSubmittedBy?m.kycSubmittedBy:void 0,Qs({},m,{appointments:m.appointments.filter((function(e){return"Corporate Representative of"!==e.position})),companyDetails:Qs({},e.companyDetails,{documents:(0,g.get)(e,"companyDetails.documents",[]).map((function(e){return{id:e._id}})),legalDetails:Qs({},(null===(p=e.companyDetails)||void 0===p?void 0:p.legalDetails)||{},{registrationDate:(0,J.Z)(new Date((0,g.get)(e,"companyDetails.legalDetails.registrationDate",null)),"yyyy-MM-dd")})}),personDetails:Qs({},e.personDetails||{},{__v:void 0,createdAt:void 0,updatedAt:void 0,isMatchWithUser:void 0,_id:void 0,archivedData:void 0,kycStatus:void 0})})})),a=(n=(0,g.uniqBy)(n,"_id")).filter((function(e){return"INDIVIDUAL"===e.category})).filter((function(e){return!1===e.isApplicant})).find((function(e){return(0,g.get)(e,"personDetails.contactDetails.email",null)===(null===d||void 0===d?void 0:d.emailAddresses[0])}));if(a){var i=(0,g.find)(n,{_id:a._id});(0,g.assign)(i,{isApplicant:!0})}return n}),[null===d||void 0===d?void 0:d.emailAddresses]),x=(0,a.useCallback)((function(e,s){var r,n,a=void 0===s||s,i=h(e),l=null===(r=e.company)||void 0===r||null===(n=r.documents)||void 0===n?void 0:n.map((function(e){return{id:e._id,type:e.fileType}})),u={acraUpdateMode:"acra-update",company:Qs({},e.company,{isAppointGrofND:e.company.isAppointGrofND,legalDetails:Qs({},e.company.legalDetails,{registrationDate:(0,J.Z)(new Date(e.company.legalDetails.registrationDate),"yyyy-MM-dd")}),members:i,chargeBeeSubscriptionId:void 0,documents:l}),currentStep:3},c=(0,g.get)(o,"data.data._id").toString();return t.emit("@set-is-page-loading",!0),p.put("/kyb/application/".concat(c),u).then(Ys(U().mark((function e(s){var t;return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("OK"!==(null===s||void 0===s?void 0:s.status)){e.next=4;break}return a&&f("Successfully saved the progress","success"),e.abrupt("return",null);case 4:return a&&f((null===s||void 0===s||null===(t=s.data)||void 0===t?void 0:t.message)||"Something went wrong","error"),e.abrupt("return",null);case 6:case"end":return e.stop()}}),e)})))).catch((function(e){a&&f(e.message,"error")})).finally((function(){t.emit("@set-is-page-loading",!1)}))}),[p,o,t,f,h]);return{handleOnBack:(0,a.useCallback)((function(){return o.mutate(),t.emit("@stepper",2)}),[o,t]),handleOnSave:x,handleOnNext:(0,a.useCallback)((function(){return t.emit("@stepper",4)}),[t]),handleOnSubmit:(0,a.useCallback)((function(e){var s,r,a=h(e),u=null===(s=e.company)||void 0===s||null===(r=s.documents)||void 0===r?void 0:r.map((function(e){return{id:e.id,type:e.type}})),c={acraUpdateMode:"acra-update",company:Qs({},e.company,{isAppointGrofND:e.company.isAppointGrofND,legalDetails:Qs({},e.company.legalDetails,{registrationDate:(0,J.Z)(new Date(e.company.legalDetails.registrationDate),"yyyy-MM-dd")}),members:a,chargeBeeSubscriptionId:void 0,documents:u}),currentStep:n.corpSec?4:5},d=(0,g.get)(o,"data.data._id").toString();return t.emit("@set-is-page-loading",!0),p.put("/kyb/application/".concat(d),c).then(Ys(U().mark((function e(s){var r,a,u,c;return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("OK"!==(null===s||void 0===s?void 0:s.status)){e.next=7;break}return f("Successfully saved the progress","success"),e.next=5,o.mutate();case 5:return Z.Z.track("List of Stakeholders",{userID:l.userId,email:null===(r=l.profile)||void 0===r?void 0:r.emailAddresses[0],organizationID:s.data.organizationId,organizationName:null===(a=o.data)||void 0===a||null===(u=a.data)||void 0===u||null===(c=u.company)||void 0===c?void 0:c.companyName,serviceType:i,completedAt:(0,m.gS)(),deviceType:"Web"}),e.abrupt("return",n.corpSec?t.emit("@stepper",4):t.emit("@stepper",5));case 7:return f("Something went wrong","error"),e.abrupt("return",null);case 9:case"end":return e.stop()}}),e)})))).catch((function(e){f(e.message,"error")})).finally((function(){t.emit("@set-is-page-loading",!1)}))}
1),[h,n.corpSec,o,t,p,f,l.userId,null===(s=l.profile)||void 0===s?void 0:s.emailAddresses,i])}};function et(e,s,t,r,o,n,a){try{var i=e[n](a),l=i.value}catch(u){return void t(u)}i.done?s(l):Promise.resolve(l).then(r,o)}function st(e){return function(){var s=this,t=arguments;return new Promise((function(r,o){var n=e.apply(s,t);function a(e){et(n,r,o,a,i,"next",e)}function i(e){et(n,r,o,a,i,"throw",e)}a(void 0)}))}}function tt(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function rt(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){tt(e,s,t[s])}))}return e}var ot=function(e){var s=e.emitter,t=(0,K.Z)(),r=(0,K.Z)(),o=(0,K.Z)(),n=(0,K.Z)(),i=(0,a.useState)(),l=i[0],c=i[1],d=(0,a.useState)({shareholder:void 0,type:""}),p=d[0],f=d[1],h=(0,a.useRef)(N.q.getState()).current.setGlobalSnackbar,x=(0,u.SS)().companyInformation,v=(0,a.useMemo)((function(){var e,s;return null===x||void 0===x||null===(e=x.data)||void 0===e||null===(s=e.data)||void 0===s?void 0:s._id}),[x]),y=(0,M.Z)(),j=(0,a.useCallback)((function(){var e={applicationId:v};return y.post("kyb/core/discard-company-info",e).then(st(U().mark((function e(t){return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("OK"!==(null===t||void 0===t?void 0:t.status)){e.next=8;break}return x.mutate(),h("Successfully discarded the process.","info"),s.emit("@select-option",{key:"incorporation",value:!1}),s.emit("@select-option",{key:"corpSec",value:!1}),s.emit("@select-option",{key:"finance",value:!1}),s.emit("@set-is-acra-error",!1),e.abrupt("return",s.emit("@stepper",0));case 8:return h("Something went wrong","error"),e.abrupt("return",t);case 10:case"end":return e.stop()}}),e)})))).catch((function(e){h(e.message,"error")}))}),[v,y,x,s,h]),b=(0,a.useCallback)(st(U().mark((function e(t,r,o,n,a){var i,l,u,c,d,p,f,x,v,y,j,b,N,C;return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=void 0===a?"":a,l=(0,g.cloneDeep)(t),u=(0,m.qX)(),c={_id:u,appointments:[{position:"Corporate Representative",status:"Active",isOutgoing:!1}],category:"INDIVIDUAL",isApplicant:!1,personDetails:{contactDetails:{email:r.emailAddress},personalDetails:{fullName:r.fullName}},companyDetails:{documents:[],riskProfileAssessment:{countryOfOperations:[]}},documents:[],riskAssessment:{documents:[]},sharesDetails:[]},d=l.officers,p=l.shareholders,(f=p[i])&&(y=null===(x=f.corporateRepresentativeOf)||void 0===x?void 0:x.value,j=d[y],b=null===f||void 0===f||null===(v=f.companyDetails)||void 0===v?void 0:v.companyName,j?(-1!==(N=j.appointments.findIndex((function(e){return"Corporate Representative of"===e.position&&e.companyName===b})))&&d[y].appointments.splice(N,1),d[y].appointments.length>1&&0===d[y].appointments.filter((function(e){return"Corporate Representative of"===e.position})).length&&(C=d[y].appointments.findIndex((function(e){return"Corporate Representative"===e.position})),d[y].appointments.splice(C,1)),c.appointments.push({position:"Corporate Representative of",status:"Active",isOutgoing:!1,companyName:b})):c.appointments.push({position:"Corporate Representative of",status:"Active",isOutgoing:!1,companyName:b}),f.corporateRepresentativeOf={label:r.fullName,value:u}),d[u]=c,n(rt({},l,{officers:d})),o(),s.emit("@modal/add-corporate-representative"),e.abrupt("return",h("A new corporate representative has been successfully added.","success"));case 12:case"end":return e.stop()}}),e)}))),[s,h]),C=(0,a.useCallback)(st(U().mark((function e(s,t,r,n){var a,i,l;return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=(0,g.cloneDeep)(s),i=(0,g.filter)(a.officers,(function(e){return e._id!==t})),l=function(){var e={};return i.forEach((function(s){e[s._id]=rt({},s)})),e},n(rt({},a,{officers:l()})),o.onToggle(),e.abrupt("return",h("Stakeholder data successfully deleted","success"));case 6:case"end":return e.stop()}}),e)}
1))),[o,h]),D=(0,a.useCallback)((function(e){o.onToggle(),c(e)}),[o]),w=(0,a.useCallback)((function(){r.onToggle()}),[r]),k=(0,a.useCallback)((function(e){n.onToggle(),f(e)}),[n]);return(0,a.useEffect)((function(){return s.on("@modal/confirm",t.onToggle),s.on("@modal/add-corporate-representative",w),s.on("@modal/delete-corporate-representative",o.onToggle),s.on("@modal/on-delete-corporate-representative",D),s.on("@modal/corporate-shareholder",k),function(){s.off("@modal/confirm",t.onToggle),s.off("@modal/add-corporate-representative",w),s.off("@modal/delete-corporate-representative",o.onToggle),s.off("@modal/on-delete-corporate-representative",D),s.off("@modal/corporate-shareholder",k)}}),[C,D,w,k,r.onToggle,t.onToggle,n.onToggle,o.onToggle,s]),{handleOnConfirm:j,handleOnAddCorporateRepresentative:b,handleOnDeleteCorporateRepresentative:D,handleOnConfirmDeleteCorporateRepresentative:C,meta:{modalData:p},confirmationModal:t,addCorporateRepresentativeModal:r,deleteCorporateRepresentativeModal:o,corporateShareholderModal:n,officer:l}};function nt(){var e,s=(0,w.useFormikContext)(),t=s.errors,o=s.values,n=s.setFieldValue;return(0,r.jsxs)("div",{className:(0,m.WD)(["sprout-relative sprout-flex sprout-flex-col","sprout-border sprout-border-[#CDCDCD] sprout-border-solid sprout-rounded-[16px] sprout-p-4","sprout-overflow-hidden"]),children:[(0,r.jsxs)("h3",{className:"sprout-font-semibold sprout-mb-2",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Would you like to appoint Grof's Resident Director?"]}),(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Every company in Singapore is required to have at least one Resident Director who is either a Singaporean citizen, a permanent resident, or a holder of an EntrePass/Employment/Dependent Pass with a locally registered address. A Resident Director fulfills this legal requirement without being involved in the day-to-day operations or management decisions of the company."}),(0,r.jsxs)("div",{className:"sprout-flex sprout-mt-4",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-items-center sprout-me-4",children:[(0,r.jsx)(w.Field,{type:"radio",value:"Yes",name:"company.isAppointGrofND",checked:!0===o.company.isAppointGrofND,onChange:function(e){return n("company.isAppointGrofND",e.target.checked&&!0)},className:"sprout-box-border sprout-appearance-none sprout-w-[14px] sprout-h-[14px] sprout-border-[2px] sprout-border-solid sprout-border-white sprout-rounded-sm sprout-outline sprout-outline-1 sprout-outline-[#8E8E8E] checked:sprout-bg-primary"}),(0,r.jsx)("label",{className:"sprout-ms-2 sprout-text-gray-900",children:"Yes"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-items-center sprout-me-4",children:[(0,r.jsx)(w.Field,{type:"radio",value:"No",name:"company.isAppointGrofND",checked:!1===o.company.isAppointGrofND,onChange:function(e){return n("company.isAppointGrofND",e.target.checked&&!1)},className:"sprout-box-border sprout-appearance-none sprout-w-[14px] sprout-h-[14px] sprout-border-[2px] sprout-border-solid sprout-border-white sprout-rounded-sm sprout-outline sprout-outline-1 sprout-outline-[#8E8E8E] checked:sprout-bg-primary"}),(0,r.jsx)("label",{className:"sprout-ms-2 sprout-text-gray-900 ",children:"No"})]})]}),(0,r.jsx)("div",{className:"sprout-text-red-500 sprout-text-xs","data-id":"error-for-company.isAppointGrofND",children:null===(e=t.company)||void 0===e?void 0:e.isAppointGrofND})]})}function at(){return(0,r.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"M2 4H3.33333H14",stroke:"#960F21",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M12.6673 4.00065V13.334C12.6673 13.6876 12.5268 14.0267 12.2768 14.2768C12.0267 14.5268 11.6876 14.6673 11.334 14.6673H4.66732C4.3137 14.6673 3.97456 14.5268 3.72451 14.2768C3.47446 14.0267 3.33398 13.6876 3.33398 13.334V4.00065M5.33398 4.00065V2.66732C5.33398 2.3137 5.47446 1.97456 5.72451 1.72451C5.97456 1.47446 6.3137 1.33398 6.66732 1.33398H9.33398C9.68761 1.33398 10.0267 1.47446 10.2768 1.72451C10.5268 1.97456 10.66
173 2.3137 10.6673 2.66732V4.00065",stroke:"#960F21",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function it(e,s,t,r,o,n,a){try{var i=e[n](a),l=i.value}catch(u){return void t(u)}i.done?s(l):Promise.resolve(l).then(r,o)}function lt(e){return function(){var s=this,t=arguments;return new Promise((function(r,o){var n=e.apply(s,t);function a(e){it(n,r,o,a,i,"next",e)}function i(e){it(n,r,o,a,i,"throw",e)}a(void 0)}))}}function ut(e){return function(e){if(Array.isArray(e)){for(var s=0,t=new Array(e.length);s<e.length;s++)t[s]=e[s];return t}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function ct(e){var s,t,o,n,i,l,d,p,m,f,h,x,v,j,b,N,C=e.officer,k=e.index,O=(0,u.SS)(),A=O.emitter,S=O.selectedOption,E=O.isAgentMode,P=(0,y.a)().profileState.profile,T=(0,w.useFormikContext)(),I=T.setFieldValue,F=T.values,R=Js({emitter:A}).handleOnSave,L=Fe().setStakeholderStep,_=(0,a.useCallback)((function(e,s){return"FACIAL_VERIFICATION"===s?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"sprout-text-xs md:sprout-text-[14px] md:sprout-mt-[16px] md:sprout-mb-[8px] sprout-mt-[8px] sprout-mb-[8px] sprout-text-[#757575]",children:["You've chosen to provide the stakeholder information using:",(0,r.jsxs)("span",{className:"sprout-font-bold sprout-text-[12px] md:sprout-text-[14px]",children:[" ","Facial Verification"]})]}),(0,r.jsx)("div",{"data-id":"error-for-unfilledMember.".concat(e),children:(0,r.jsx)(D.iR,{secondary:!0,onClick:lt(U().mark((function s(){var t;return U().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return t=L(F,e,0),s.next=3,R(t,!1);case 3:je.default.push("/kyc?type=facial-verification&id=".concat(e));case 4:case"end":return s.stop()}}),s)}))),children:"Edit Information"})})]}):"NOTARIZED_DOCUMENT"===s?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"sprout-text-xs md:sprout-text-[14px] md:sprout-mt-[16px] md:sprout-mb-[8px] sprout-mt-[8px] sprout-mb-[8px] sprout-text-[#757575]",children:["You've chosen to provide the stakeholder information using:",(0,r.jsxs)("span",{className:"sprout-font-bold sprout-text-[12px] md:sprout-text-[14px]",children:[" ","Notarized Document"]})]}),(0,r.jsx)("div",{"data-id":"error-for-unfilledMember.".concat(e),children:(0,r.jsx)(D.iR,{secondary:!0,onClick:function(){R(F,!1),je.default.push("/kyc?type=notarized-document&id=".concat(e))},children:"Edit Information"})})]}):(0,r.jsx)(r.Fragment,{})}),[R,L,F]),B=(0,a.useCallback)((function(e){return 0===e.appointments.filter((function(e){return"Corporate Representative"!==e.position&&"Corporate Representative of"!==e.position&&"Active"===e.status&&!e.isOutgoing})).length}),[]),V=1===C.appointments.length&&"Corporate Representative"===C.appointments[0].position,M=(0,g.find)(C.appointments,{position:"Director"}),Z=function(e){var s=null,t=[],r=[];e.forEach((function(e){"Active"===e.status&&("Corporate Representative"===e.position?s=e:"Corporate Representative of"===e.position?t.push(e):r.push(e))}));var o,n=ut(r);t.length?(o=n).push.apply(o,ut(t)):s&&n.push(s);return n.map((function(e){var s=e.position,t=e.companyName;return"Corporate Representative of"===s?"".concat(s," ").concat(t):s}))}(C.appointments),q=null===(s=null===F||void 0===F?void 0:F.officers["".concat(C._id)])||void 0===s?void 0:s.appointments.filter((function(e){return c.UK.includes(e.position)&&"Active"===e.status})),W=(0,a.useCallback)(lt(U().mark((function e(s){var t,r,o;return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===q||void 0===q?void 0:q.length){e.next=3;break}return e.abrupt("return");case 3:r=0;case 4:if(!(r<(null===(t=null===F||void 0===F?void 0:F.officers["".concat(C._id)])||void 0===t?void 0:t.appointments.length))){e.next=12;break}if(!c.oK.includes(null===(o=null===F||void 0===F?void 0:F.officers["".concat(C._id)])||void 0===o?void 0:o.appointments[r].position)){e.next=9;break}return e.next=9,I("officers[".concat(C._id,"].appointments[").concat(r,"].isOutgoing"),s);case 9:r+=1,e.next=4;break;case 12:case"end":return e.stop()}}),e)}))),[q,C._id,I,null===F||void 0===F?void 0:F.officers]),G=(0,a.useMemo)((function(){var e;return(null===(e=null===F||void 0===F?void 0:F.officers["".concat(C._id)])||void 0===e?void 0:e.isApplicant)||B(null===F||void 0===F?void 0:F.officers["".concat(C._id)])}),[B,C._id,null===F||void 0===F?void 0:F.officers]),K=(0,a.useMemo)((function(){return null===q||void 0===q?void 0:q.some((function(e){return e.isOutgoing}))}),[q]);if(!(null===q||void 0===q?void 0:q.length))return(0,r.jsx)(r.Fragment,{});var H=(0,g.findIndex)(null===(t=null===F||void 0===F?void 0:F.officers["".concat(C._id)])||void 0===t?void 0:t.appointments,{_id:q[0]._id});return(0,r.jsxs)("div",{className:"sprout-p-4",children:[E?(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("div",{className:"sprout-grid md:sprout-grid-cols-2 sprout-mt-4",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-row sprout-justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{children:null===C||void 0===C||null===(o=C.personDetail
1s)||void 0===o||null===(n=o.personalDetails)||void 0===n?void 0:n.fullName}),(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:Z.join(", ")})]}),V&&(0,r.jsx)("div",{className:"sprout-cursor-pointer sprout-block md:sprout-hidden",onClick:function(){A.emit("@modal/on-delete-corporate-representative",C)},children:(0,r.jsx)(at,{})})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-4",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-gap-1 sprout-mt-[16px]",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-items-center sprout-justify-between sprout-me-4 sprout-w-full",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(w.Field,{onClick:function(){Object.keys(F.officers).forEach((function(e){I("officers[".concat(e,"].isApplicant"),!1)})),Object.keys(F.shareholders).forEach((function(e){I("shareholders[".concat(e,"].isApplicant"),!1)})),I("officers[".concat(C._id,"].isApplicant"),!F.officers["".concat(C._id)].isApplicant),F.shareholders["".concat(C._id)]&&I("shareholders[".concat(C._id,"].isApplicant"),!F.shareholders["".concat(C._id)].isApplicant)},name:"isApplicantOfficer",type:"radio",value:null===(i=null===F||void 0===F?void 0:F.officers["".concat(C._id)])||void 0===i?void 0:i.isApplicant,checked:null===(l=null===F||void 0===F?void 0:F.officers["".concat(C._id)])||void 0===l?void 0:l.isApplicant,className:"sprout-box-border sprout-appearance-none sprout-w-[14px] sprout-h-[14px] sprout-border-[2px] sprout-border-solid sprout-border-white sprout-rounded-sm sprout-outline sprout-outline-1 sprout-outline-[#8E8E8E] checked:sprout-bg-primary"}),(0,r.jsx)("label",{className:"sprout-ms-2 sprout-text-gray-900 ",children:"This is me"})]}),V&&(0,r.jsx)("div",{className:"sprout-cursor-pointer md:sprout-block sprout-hidden",onClick:function(){A.emit("@modal/on-delete-corporate-representative",C)},children:(0,r.jsx)(at,{})})]}),(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Check this if this person is yourself."})]}),G&&!(null===(d=null===F||void 0===F?void 0:F.officers["".concat(C._id)])||void 0===d?void 0:d.isApplicant)?(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-me-4 sprout-w-full",children:[(0,r.jsxs)("div",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Email"]}),(0,r.jsx)("div",{className:"sprout-mt-[8px] lg:sprout-mt-[16px]",children:null===C||void 0===C||null===(p=C.personDetails)||void 0===p||null===(m=p.contactDetails)||void 0===m?void 0:m.email})]}):(null===(f=null===F||void 0===F?void 0:F.officers["".concat(C._id)])||void 0===f?void 0:f.isApplicant)&&(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-me-4 sprout-w-full",children:[(0,r.jsxs)("div",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Email"]}),(0,r.jsx)("div",{className:"sprout-mt-[8px] lg:sprout-mt-[16px]",children:null===P||void 0===P?void 0:P.emailAddresses[0]})]}),M&&S.corpSec&&(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-gap-1 sprout-mt-2",children:(0,r.jsx)("div",{className:"sprout-flex sprout-items-center sprout-me-4",children:(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2 sprout-w-full",children:[(0,r.jsxs)("div",{className:"checkbox-container",children:[(0,r.jsx)(Ps.I,{type:"checkbox",id:"outgoingCheckbox_".concat(k),name:"officers.".concat(C._id,".appointments[").concat(H,"].isOutgoing"),checked:K,onChange:function(){W(!K)},style:{border:0,outline:"0.5px solid #8E8E8E",height:"14px",width:"14px",borderRadius:"0.125rem"},disabled:V}),(0,r.jsx)("label",{htmlFor:"is-apply-for-business-account",children:(0,r.jsx)("div",{className:"checkbox-label sprout-text-sm",children:"Outgoing Director"})})]}),(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:K?"Grof will send resignation email to this person.":"Check this to remove this Director."}),K&&(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"Email"}),(0,r.jsx)(Ns.K,{id:"emailInput_".concat(k),placeholder:"Enter email address",name:"officers.".concat(C._id,".appointments[").concat(H,"].outgoingEmail")})]})]})})})]})]})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"sprout-grid sprout-grid-cols-1 sprout-gap-8 md:sprout-grid-cols-2",children:(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-row sprout-justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{children:null===C||void 0===C||null===(h=C.personDetail
1s)||void 0===h||null===(x=h.personalDetails)||void 0===x?void 0:x.fullName}),(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:Z.join(", ")})]}),V&&(0,r.jsx)("div",{className:"sprout-cursor-pointer sprout-block md:sprout-hidden",onClick:function(){A.emit("@modal/on-delete-corporate-representative",C)},children:(0,r.jsx)(at,{})})]})}),(0,r.jsxs)("div",{className:"sprout-grid md:sprout-grid-cols-2 sprout-gap-8 sprout-mt-4",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Email Address"]}),!(null===(v=null===F||void 0===F?void 0:F.officers["".concat(C._id)])||void 0===v?void 0:v.isApplicant)&&(0,r.jsx)(Ns.K,{id:"emailInput_".concat(k),placeholder:"Enter email address",name:K?"email":"officers.".concat(C._id,".personDetails.contactDetails.email"),onKeyUp:function(e){var s=e.target.value;F.shareholders["".concat(C._id)]&&I("shareholders[".concat(C._id,"].personDetails.contactDetails.email"),s)},disabled:K||V||!!C.grofOfficerId}),(null===(j=null===F||void 0===F?void 0:F.officers["".concat(C._id)])||void 0===j?void 0:j.isApplicant)&&(0,r.jsx)("p",{children:null===P||void 0===P?void 0:P.emailAddresses[0]})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-4",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-gap-1 sprout-mt-2",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-items-center sprout-justify-between sprout-me-4 sprout-w-full",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(w.Field,{onClick:function(){Object.keys(F.officers).forEach((function(e){I("officers[".concat(e,"].isApplicant"),!1)})),Object.keys(F.shareholders).forEach((function(e){I("shareholders[".concat(e,"].isApplicant"),!1)})),I("officers[".concat(C._id,"].isApplicant"),!F.officers["".concat(C._id)].isApplicant),F.shareholders["".concat(C._id)]&&I("shareholders[".concat(C._id,"].isApplicant"),!F.shareholders["".concat(C._id)].isApplicant)},name:"isApplicantOfficer",type:"radio",value:null===(b=null===F||void 0===F?void 0:F.officers["".concat(C._id)])||void 0===b?void 0:b.isApplicant,checked:null===(N=null===F||void 0===F?void 0:F.officers["".concat(C._id)])||void 0===N?void 0:N.isApplicant,className:"sprout-box-border sprout-appearance-none sprout-w-[14px] sprout-h-[14px] sprout-border-[2px] sprout-border-solid sprout-border-white sprout-rounded-sm sprout-outline sprout-outline-1 sprout-outline-[#8E8E8E] checked:sprout-bg-primary"}),(0,r.jsx)("label",{className:"sprout-ms-2 sprout-text-gray-900 ",children:"This is me"})]}),V&&(0,r.jsx)("div",{className:"sprout-cursor-pointer md:sprout-block sprout-hidden",onClick:function(){A.emit("@modal/on-delete-corporate-representative",C)},children:(0,r.jsx)(at,{})})]}),(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Check this if this person is yourself."})]}),M&&S.corpSec&&(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-gap-1 sprout-mt-2",children:(0,r.jsx)("div",{className:"sprout-flex sprout-items-center sprout-me-4",children:(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2 sprout-w-full",children:[(0,r.jsxs)("div",{className:"checkbox-container",children:[(0,r.jsx)(Ps.I,{type:"checkbox",id:"outgoingCheckbox_".concat(k),name:"officers.".concat(C._id,".appointments[").concat(H,"].isOutgoing"),checked:!!K,onChange:function(){W(!K)},style:{border:0,outline:"0.5px solid #8E8E8E",height:"14px",width:"14px",borderRadius:"0.125rem"},disabled:V}),(0,r.jsx)("label",{htmlFor:"is-apply-for-business-account",children:(0,r.jsx)("div",{className:"checkbox-label sprout-text-sm",children:"Outgoing Director"})})]}),(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:K?"Grof will send resignation email to this person.":"Check this to remove this Director."}),K&&(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"Email"}),(0,r.jsx)(Ns.K,{id:"emailInput_".concat(k),placeholder:"Enter email address",name:"officers.".concat(C._id,".appointments[").concat(H,"].outgoingEmail")})]})]})})})]})]})]}),E&&!K&&!(null===F||void 0===F?void 0:F.officers["".concat(C._id)].isApplicant)&&!B(null===F||void 0===F?void 0:F.officers["".concat(C._id)])&&(0,r.jsxs)("div",{className:"sprout-mt-[16px] md:sprout-mt-[24px]",children:[(0,r.jsx)("div",{className:"sprout-text-[14px] md:sprout-text-[16
1px]",children:"Personal Information"}),C.agentEkycType?_(C._id,C.agentEkycType):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"sprout-text-[12px] md:sprout-text-[14px] md:sprout-mt-[16px] md:sprout-mb-[8px] sprout-mt-[8px] sprout-mb-[8px]",children:"Please provide the stakeholder's personal information via one of these 2 methods:"}),(0,r.jsxs)("div",{className:"sprout-flex md:sprout-flex-row sprout-flex-col","data-id":"error-for-unfilledMember.".concat(C._id),children:[(0,r.jsx)(D.iR,{primary:!0,className:"sprout-w-fit",onClick:function(){R(F,!1),je.default.push("/kyc?type=facial-verification&id=".concat(C._id))},children:"Facial Verification"}),(0,r.jsx)("span",{className:"md:sprout-block sprout-hidden sprout-text-[14px] sprout-ml-[8px] sprout-mr-[8px] sprout-content-center",children:"or"}),(0,r.jsx)(D.iR,{className:"sprout-mt-[8px] md:sprout-mt-[0px] sprout-w-fit",secondary:!0,onClick:function(){R(F,!1),je.default.push("/kyc?type=notarized-document&id=".concat(C._id))},children:"Notarized Document"})]})]})]})]})}function dt(e){var s,t,o=e.setValues,n=e.values,a=(0,u.SS)().emitter,i=ot({emitter:a}),l=i.handleOnConfirmDeleteCorporateRepresentative,c=i.deleteCorporateRepresentativeModal,d=i.officer;return(0,r.jsx)(D.BT,{className:"sprout-w-[325px] md:sprout-w-[400px] !sprout-p-4",show:c.isOpen,useBackground:!0,onClose:function(){return a.emit("@modal/delete-corporate-representative")},children:(0,r.jsx)(D._O.form,{onSubmit:function(){},children:(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-4",children:[(0,r.jsx)("div",{className:"sprout-flex sprout-w-full sprout-justify-center sprout-items-center",children:(0,r.jsx)("span",{className:"sprout-text-base sprout-font-semibold sprout-text-center",children:"Delete Corporate Representative?"})}),(0,r.jsxs)("p",{className:"sprout-text-sm sprout-text-center",children:["You are about to delete"," ",null===d||void 0===d||null===(s=d.personDetails)||void 0===s||null===(t=s.personalDetails)||void 0===t?void 0:t.fullName," from stakeholder list. Are you sure?"]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-space-x-2",children:[(0,r.jsx)(D.iR,{secondary:!0,className:"sprout-w-full mt-4",onClick:function(){return a.emit("@modal/delete-corporate-representative")},children:"Cancel"}),(0,r.jsx)(D.iR,{primary:!0,red:!0,className:"sprout-w-full mt-4",onClick:function(){return l(n,(null===d||void 0===d?void 0:d._id)||"",(null===d||void 0===d?void 0:d.personDetails.contactDetails.email)||"",o)},children:"Delete"})]})]})})})}function pt(e){var s=e.values,t=e.setValues,o=(0,g.get)(s,"officers",{}),n=(0,u.SS)().isAgentMode;return(0,r.jsxs)("div",{className:(0,m.WD)(["sprout-relative sprout-flex sprout-flex-col","sprout-border sprout-border-[#CDCDCD] sprout-border-solid sprout-rounded-[16px]","sprout-overflow-hidden"]),children:[(0,r.jsx)(dt,{setValues:t,values:s}),(0,r.jsx)("h3",{className:"sprout-font-semibold sprout-p-4",children:"Officer Listing"}),n?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"sprout-mx-[16px]",children:[(0,r.jsx)(P.Z,{variant:"info",classNames:"!sprout-px-4 !sprout-py-2 sprout-mb-[10px]",leftIcon:(0,r.jsx)(T.Z,{color:"#057EB6"}),children:(0,r.jsx)("p",{className:"sprout-font-semibold sprout-normal-case sprout-text-sm",children:"Notarized Documents must be notarized by a Notary Public"})}),(0,r.jsx)("div",{className:"sprout-text-xs sprout-text-[#757575]",children:"Please update all stakeholder's personal information. There are two options for the collection of personal information:"}),(0,r.jsxs)("ol",{className:"sprout-list-decimal sprout-pl-5 sprout-mb-[16px] sprout-text-xs sprout-text-[#757575]",children:[(0,r.jsxs)("li",{children:["Facial verification",(0,r.jsxs)("ol",{className:"sprout-list-[lower-alpha] sprout-pl-5",children:[(0,r.jsx)("li",{children:"You will fill the personal information for the stakeholders"}),(0,r.jsx)("li",{children:"A link will be generated for you to send to the stakeholder for facial verification and document scanning"})]})]}),(0,r.jsxs)("li",{children:["Notarized document upload",(0,r.jsxs)("ol",{className:"sprout-list-[lower-alpha] sprout-pl-5",children:[(0,r.jsx)("li",{children:"You will fill the personal information for the stakeholders"}),(0,r.jsx)("li",{children:"You will have to upload a notarized copy of the stakeholder's Proof of Identification and Proof of Address"})]})]})]})]}),(0,r.jsx)("div",{className:"sprout-border-solid sprout-border-[#C4C4C4]
1sprout-border-b-[2px] sprout-hidden md:sprout-block md:sprout-mb-[16px]"})]}):(0,r.jsx)("div",{className:"sprout-border-solid sprout-border-[#C4C4C4] sprout-border-b-[1px]"}),(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-divide-y-2",children:(0,r.jsx)(w.FieldArray,{name:"members",render:function(){return(0,r.jsx)("div",{children:Object.keys(o).map((function(e,s){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ct,{index:s,officer:o[e]},"officer_".concat(o[e]._id)),(0,r.jsx)("div",{className:"sprout-border-solid sprout-border-[#C4C4C4] sprout-border-b-[2px] md:sprout-mb-[16px]"})]})}))})}})})]})}var mt=t(2622);function ft(e){var s,t=e.shareholder,o=(0,u.SS)().emitter,n=(0,w.useFormikContext)(),i=n.values,l=n.errors,c=(0,a.useMemo)((function(){var e,s,r=i.shareholders[t._id];return(null===(s=(null===(e=r.corporateRepresentativeOf)||void 0===e?void 0:e.value)||r.corporateRepresentativeOf)||void 0===s?void 0:s.length)>0&&(0,g.get)(r,"companyDetails.documents",[]).length>0}),[t._id,i]),d=(0,K.Z)(!0);return(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-p-4 sprout-space-y-2",children:[(0,r.jsxs)("div",{className:"sprout-grid md:sprout-grid-cols-5 sprout-gap-6 sprout-text-[#121212] sprout-text-sm",children:[(0,r.jsx)("div",{className:"sprout-col-span-2 sprout-flex sprout-flex-col sprout-space-y-2",children:(0,r.jsxs)("div",{className:"sprout-flex sprout-justify-between",children:[(0,r.jsx)("p",{className:"sprout-text-base",children:t.companyDetails.companyName}),(0,r.jsx)("div",{onClick:d.onToggle,className:"sprout-cursor-pointer",children:(0,r.jsx)(Q.Uy,{})})]})}),(null===(s=t.sharesDetails)||void 0===s?void 0:s.length)>0&&(0,r.jsx)("div",{className:"sprout-col-span-3 sprout-flex sprout-flex-col sprout-space-y-2",children:(0,r.jsxs)("div",{className:"sprout-grid md:sprout-grid-cols-3 sprout-gap-6 sprout-text-[#121212] sprout-text-sm",children:[(0,r.jsx)("div",{className:"hidden md:sprout-flex sprout-flex-col sprout-space-y-6",children:(0,r.jsx)("p",{children:t.sharesDetails[0].shareType})}),(0,r.jsx)("div",{className:"hidden md:sprout-flex sprout-flex-col sprout-space-y-6",children:(0,r.jsx)("p",{children:"N/A"})}),(0,r.jsx)("div",{className:"hidden md:sprout-flex sprout-flex-col sprout-space-y-6",children:(0,r.jsx)("p",{children:(0,ee.t)(t.sharesDetails[0].shareAllotted,0)})})]})})]}),d.isOpen&&(0,r.jsxs)("div",{className:"sprout-grid md:sprout-grid-cols-5 sprout-gap-6 sprout-text-[#121212] sprout-text-sm",children:[(0,r.jsxs)("div",{className:"sprout-col-span-2 sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Corporate"}),c?(0,r.jsxs)(D.iR,{className:"!sprout-mt-4 md:sprout-mt-[0px] sprout-w-fit sprout-gap-2",tertiary:!0,onClick:function(){o.emit("@modal/corporate-shareholder",{shareholder:i.shareholders[t._id],type:""})},children:["Revisit Information",(0,r.jsx)(mt.g,{fill:"#FB8110"})]}):(0,r.jsx)(D.iR,{className:"!sprout-mt-4 md:sprout-mt-[0px] sprout-w-fit",secondary:!0,onClick:function(){o.emit("@modal/corporate-shareholder",{shareholder:i.shareholders[t._id],type:""})},children:"Input Information"}),(0,g.get)(l,"shareholders.[".concat(t._id,"]"),null)&&(0,r.jsx)("p",{className:"sprout-text-red-500 sprout-text-xs",children:(0,g.get)(l,"shareholders.[".concat(t._id,"]"),"")})]}),t.sharesDetails.map((function(e,s){return s>0&&(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)("div",{className:"hidden md:sprout-flex sprout-flex-col sprout-space-y-6",children:(0,r.jsx)("p",{children:e.shareType})}),(0,r.jsx)("div",{className:"hidden md:sprout-flex sprout-flex-col sprout-space-y-6",children:(0,r.jsx)("p",{children:"N/A"})}),(0,r.jsx)("div",{className:"hidden md:sprout-flex sprout-flex-col sprout-space-y-6",children:(0,r.jsx)("p",{children:(0,ee.t)(e.shareAllotted,0)})})]},s)})),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col md:sprout-hidden sprout-col-span-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-mb-2",children:"Share information"}),(0,r.jsxs)("div",{className:"sprout-grid sprout-grid-cols-3 sprout-text-[#757575] sprout-text-xs",children:[(0,r.jsx)("p",{children:"Type"}),(0,r.jsx)("p",{children:"Amount"}),(0,r.jsx)("p",{children:"Total No. of Shares"})]}),(0,r.jsx)("div",{className:"sprout-grid sprout-grid-cols-3 sprout-text-xs",children:t.sharesDetails.map((function(e,s){return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)("p",{children:e.shareType}),(0,r.jsx)("p",{children:"N/A"}),(0,r.jsx)("p",{children:(0,ee.t)(e.shareAllotted,0)})]},s)}))})]})]})]})}function ht(e,s,t,r,o,n,a){try{var i=e[n](a),l=i.value}catch(u){return void t(u)}i.done?s(l):Promise.resolve(l).then(r,o)}function xt(e){var s=e.shareholder,t=(0,y.a)().profileState.profile,o=(0,w.useFormikContext)(),n=o.setFieldValue,i=o.values,l=(0,K.Z)(!0),c=(0,u.SS)(),d=c.isAgentMode,p=c.emitter,m=Js({emitter:p}).handleOnSave,f=Fe().setStakeholderStep,h=(0,a.useCallback)((function(e,s){return"FACIAL_VERIFICATION"===s?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"sprout-text-xs md:sprout-text-[14px] md:sprout-mt-[16px] md:sprout-mb-[8px] sprout-mt-[8px] sprout-mb-[8px] sprout-text-[#757575]",children:["You've chosen to provide the stakeholder information using:",(0,r.jsxs)("span",{className:"sprout-font-bold sprout-text-[12px] md:sprout-text-[14px]",children:[" ","Facial Verification"]})]}),(0,r.jsx)("div",{"data-id":"error-for-unfilledMember.".concat(e),children:(0,r.jsx)(D.iR,{secondary:!0,onClick:(t=U().mark((function s(){var t;return U().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return t=f(i,e,0),s.next=3,m(t,!1);case 3:je.default.push("/kyc?type=facial-verification&id=".concat(e));case 4:case"end":return s.stop()}}),s)})),function(){var e=this,s=arguments;return new Promise((function(r,o){var n=t.apply(e,s);function a(e){ht(n,r,o,a,i,"next",e)}function i(e){ht(n,r,o,a,i,"throw",e)}a(void 0)}))}),children:"Edit Information"})})]}):"NOTARIZED_DOCUMENT"===s?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"sprout-text-xs md:sprout-text-[14px] md:sprout-mt-[16px] md:sprout-mb-[8px] sprout-mt-[8px] sprout-mb-[8px] sprout-text-[#757575]",children:["You've chosen to provide the stakeholder information using:",(0,r.jsxs)("span",{className:"sprout-font-bold sprout-text-[12px] md:sprout-text-[14px]",children:[" ","Notarized Document"]})]}),(0,r.jsx)("div",{"data-id":"error-for-unfilledMember.".concat(e),children:(0,r.jsx)(D.iR,{secondary:!0,onClick:function(){m(i,!1),je.default.push("/kyc?type=notarized-document&id=".concat(e))},children:"Edit Information"})})]}):(0,r.jsx)(r.Fragment,{});var t}),[m,f,i]),x=(0,a.useCallback)((function(e,s){return(0,r.jsxs)("div",{className:"sprout-w-full",children:[(0,r.jsx)("div",{className:"sprout-text-[14px] md:sprout-text-[16
1px]",children:"Personal Information"}),s?h(e,s):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"sprout-text-[12px] md:sprout-text-[14px] md:sprout-mt-[16px] md:sprout-mb-[8px] sprout-mt-[8px] sprout-mb-[8px]",children:"Please provide the stakeholder's personal information via one of these 2 methods:"}),(0,r.jsxs)("div",{className:"sprout-flex md:sprout-flex-row sprout-flex-col","data-id":"error-for-unfilledMember.".concat(e),children:[(0,r.jsx)(D.iR,{primary:!0,className:"sprout-w-fit",onClick:function(){m(i,!1),je.default.push("/kyc?type=facial-verification&id=".concat(e))},children:"Facial Verification"}),(0,r.jsx)("span",{className:"md:sprout-block sprout-hidden sprout-text-[14px] sprout-ml-[8px] sprout-mr-[8px] sprout-content-center",children:"or"}),(0,r.jsx)(D.iR,{className:"sprout-mt-[8px] md:sprout-mt-[0px] sprout-w-fit",secondary:!0,onClick:function(){m(i,!1),je.default.push("/kyc?type=notarized-document&id=".concat(e))},children:"Notarized Document"})]})]})]})}),[h,m,i]);return(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-p-4 sprout-space-y-2",children:[(0,r.jsxs)("div",{className:"sprout-grid md:sprout-grid-cols-5 sprout-gap-6 sprout-text-[#121212] sprout-text-sm",children:[(0,r.jsx)("div",{className:"sprout-col-span-2 sprout-flex sprout-flex-col sprout-space-y-2",children:(0,r.jsxs)("div",{className:"sprout-flex sprout-justify-between",children:[(0,r.jsx)("p",{className:"sprout-text-base",children:s.personDetails.personalDetails.fullName}),(0,r.jsx)("div",{onClick:l.onToggle,className:"sprout-cursor-pointer",children:(0,r.jsx)(Q.Uy,{})})]})}),(0,r.jsx)("div",{className:"hidden md:sprout-flex sprout-flex-col sprout-space-y-6",children:(0,r.jsx)("p",{children:s.sharesDetails.length>0&&s.sharesDetails[0].shareType})}),(0,r.jsx)("div",{className:"hidden md:sprout-flex sprout-flex-col sprout-space-y-6",children:(0,r.jsx)("p",{children:"N/A"})}),(0,r.jsx)("div",{className:"hidden md:sprout-flex sprout-flex-col sprout-space-y-6",children:(0,r.jsx)("p",{children:s.sharesDetails.length>0&&(0,ee.t)(s.sharesDetails[0].shareAllotted,2)})})]}),l.isOpen&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"sprout-grid md:sprout-grid-cols-5 sprout-gap-6 sprout-text-[#121212] sprout-text-sm",children:[(0,r.jsxs)("div",{className:"sprout-col-span-2 sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Individual"}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2 sprout-w-full",children:[(0,r.jsxs)("div",{className:"checkbox-container",children:[(0,r.jsx)("input",{onClick:function(){Object.keys(i.officers).forEach((function(e){n("officers[".concat(e,"].isApplicant"),!1)})),Object.keys(i.shareholders).forEach((function(e){n("shareholders[".concat(e,"].isApplicant"),!1)})),n("shareholders[".concat(s._id,"].isApplicant"),!i.shareholders["".concat(s._id)].isApplicant),i.officers["".concat(s._id)]&&n("officers[".concat(s._id,"].isApplicant"),!i.officers["".concat(s._id)].isApplicant)},name:"isApplicantShareholder",type:"radio",value:i.shareholders["".concat(s._id)].isApplicant,checked:i.shareholders["".concat(s._id)].isApplicant,className:"sprout-box-border sprout-appearance-none sprout-w-[14px] sprout-h-[14px] sprout-border-[2px] sprout-border-solid sprout-border-white sprout-rounded-sm sprout-outline sprout-outline-1 sprout-outline-[#8E8E8E] checked:sprout-bg-primary"}),(0,r.jsx)("label",{htmlFor:"is-apply-for-business-account",children:(0,r.jsx)("div",{className:"checkbox-label sprout-text-sm",children:"This is me"})})]}),(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:"Check this if this person is yourself."})]}),!d&&(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Email Address"]}),!i.shareholders["".concat(s._id)].isApplicant&&(0,r.jsx)(Ns.K,{placeholder:"Enter email address",name:i.shareholders["".concat(s._id)].isOutgoing?"email":"shareholders.".concat(s._id,".personDetail
1s.contactDetails.email"),onKeyUp:function(e){var t=e.target.value;i.officers["".concat(s._id)]&&n("officers[".concat(s._id,"].personDetails.contactDetails.email"),t)},disabled:!!s.grofOfficerId}),i.shareholders["".concat(s._id)].isApplicant&&(0,r.jsx)("p",{children:null===t||void 0===t?void 0:t.emailAddresses[0]})]})]}),(0,r.jsxs)("div",{className:"sprout-block md:sprout-hidden",children:[d&&!i.shareholders["".concat(s._id)].isApplicant&&x(s._id,s.agentEkycType),d&&i.shareholders["".concat(s._id)].isApplicant&&(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Email"]}),(0,r.jsx)("div",{className:"sprout-mt-[8px] lg:sprout-mt-[16px]",children:null===t||void 0===t?void 0:t.emailAddresses[0]})]})]}),s.sharesDetails.map((function(e,s){return s>0&&(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)("div",{className:"hidden md:sprout-flex sprout-flex-col sprout-space-y-6",children:(0,r.jsx)("p",{children:e.shareType})}),(0,r.jsx)("div",{className:"hidden md:sprout-flex sprout-flex-col sprout-space-y-6",children:(0,r.jsx)("p",{children:"N/A"})}),(0,r.jsx)("div",{className:"hidden md:sprout-flex sprout-flex-col sprout-space-y-6",children:(0,r.jsx)("p",{children:(0,ee.t)(e.shareAllotted,2)})})]},s)})),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-col-span-2 md:sprout-hidden",children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-mb-2",children:"Share information"}),(0,r.jsxs)("div",{className:"sprout-grid sprout-grid-cols-3 sprout-text-[#757575] sprout-text-xs",children:[(0,r.jsx)("p",{children:"Type"}),(0,r.jsx)("p",{children:"Amount"}),(0,r.jsx)("p",{children:"Total No. of Shares"})]}),(0,r.jsx)("div",{className:"sprout-grid sprout-grid-cols-3 sprout-text-xs",children:s.sharesDetails.map((function(e,s){return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)("p",{children:e.shareType}),(0,r.jsx)("p",{children:"N/A"}),(0,r.jsx)("p",{children:(0,ee.t)(e.shareAllotted,2)})]},s)}))})]})]}),(0,r.jsxs)("div",{className:"sprout-hidden md:sprout-flex md:sprout-mt-[16px]",children:[d&&!i.shareholders["".concat(s._id)].isApplicant&&x(s._id,s.agentEkycType),d&&i.shareholders["".concat(s._id)].isApplicant&&(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-mt-[16px]",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Email"]}),(0,r.jsx)("div",{className:"sprout-mt-[8px] lg:sprout-mt-[16px]",children:null===t||void 0===t?void 0:t.emailAddresses[0]})]})]})]})]})}var vt=[{label:"Information Form",step:0},{label:"Corporate Representative",step:1}];function yt(e){var s=e.step;return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("header",{className:"sprout-flex sprout-flex-col sprout-p-6 sprout-gap-5 sprout-z-[1]",children:(0,r.jsxs)("div",{className:"sprout-w-full sprout-flex-col sprout-space-y-4",children:[(0,r.jsx)("div",{className:"sprout-flex sprout-justify-center sprout-cursor-pointer",children:vt.map((function(e,t){var o=(0,r.jsx)(p.rl,{className:{path:"sprout-stroke-[#14213D]"}});return t===s?o=(0,r.jsx)(p.US,{className:{path:"sprout-stroke-[#14213D]"}}):t<s&&(o=(0,r.jsx)(p.o0,{})),(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col",onClick:function(){return e.onClick?e.onClick():null},children:(0,r.jsxs)("div",{className:"sprout-flex sprout-items-center",children:[o,t<vt.length-1&&(0,r.jsx)("div",{className:"sprout-border-2 sprout-border-[#14213D] sprout-w-[64px] md:sprout-w-[136px]"})]})},t)}))}),(0,r.jsx)("div",{className:"sprout-flex sprout-space-x-2",children:vt.map((function(e,t){return(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col",onClick:function(){return e.onClick?e.onClick():null},children:(0,r.jsx)("div",{className:"sprout-pt-1 sprout-text-xs sprout-leading-4 sprout-pr-2",children:(0,r.jsxs)("span",{className:(0,m.WD)([e.step!==s&&"sprout-text-[#757575]",e.step===s&&"sprout-font-semibold"]),children:[e.step+1,". ",e.label]})})},t)}))})]})})})}function gt(e,s,t,r,o,n,a){try{var i=e[n](a),l=i.value}catch(u){return void t(u)}i.done?s(l):Promise.resolve(l).then(r,o)}function jt(e){return function(){var s=this,t=arguments;return new Promise((function(r,o){var n=e.apply(s,t);function a(e){gt(n,r,o,a,i,"next",e)}function i(e){gt(n,r,o,a,i,"throw",e)}a(void 0)}))}}function bt(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function Nt(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){bt(e,s,t[s])}))}return e}var Ct=function(){var e=(0,Ue.Z)(),s=(0,u.SS)().emitter,t=(0,a.useRef)(N.q.getState()).current.setGlobalSnackbar,r=(0,a.useState)(!1),o=r[0],n=r[1],i=(0,a.useCallback)(jt(U().mark((function r(o,n,a){var i,l,u,c;return U().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(a.target.files){r.next=2;break}return r.abrupt("return");case 2:if(!(a.target.files[0].size>62914560)){r.next=5;break}return t("File size limit exceeded","error"),r.abrupt("return");case 5:return s.emit("@set-is-information-form-modal-loading",!0),i=new FormData,l=a.target.files[0].name,i.append("files",a.target.files[0]),r.next=11,e.post("/user-kyc/documents/upload",i,{headers:{"Content-Type":"multipart/form-data"}});case 11:u=r.sent,"OK"===(0,g.result)(u,"status")?(u.data.fileName=l,u.data._id=u.data.documentId,(c=(0,g.cloneDeep)(n.documents)).push(u.data),o(Nt({},n,{documents:c})),s.emit("@set-is-information-form-modal-loading",!1)):(t("Something went wrong","error"),s.emit("@set-is-information-form-modal-loading",!1));case 13:case"end":return r.stop()}}),r)}))),[e,s,t]),l=(0,a.useCallback)(jt(U().mark((function r(o,n,a){return U().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return s.emit("@set-is-information-form-modal-loading",!0),r.next=3,e.delete("/kyb/documents/".concat(o)).then((function(e){if("OK"===(0,g.result)(e,"status")){var t=n.documents.filter((function(e){return e._id!==o}));a(Nt({},n,{documents:t})),s.emit("@set-is-information-form-modal-loading",!1)}})).catch((function(){t("Something went wrong","error"),s.emit("@set-is-information-form-modal-loading",!1)}));case 3:case"end":return r.stop()}}),r)}))),[e,s,t]),c=(0,a.useCallback)((function(e){n(e)}),[]);return(0,a.useEffect)((function(){return s.on("@set-is-information-form-modal-loading",c),function(){s.off("@set-is-information-form-modal-loading",c)}})),{isFormLoading:o,handleOnFileChange:i,handleOnRemoveFile:l}};function Dt(e,s,t,r,o,n,a){try{var i=e[n](a),l=i.value}catch(u){return void t(u)}i.done?s(l):Promise.resolve(l).then(r,o)}function wt(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function kt(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){wt(e,s,t[s])}))}return e}function Ot(e){var s,t=e.setStep,o=e.parentValues,n=e.parentSetValues,i=e.meta,l=e.isValid,c=e.values,d=e.setValues,p=(0,a.useRef)(null),f=(0,K.Z)(!0),h=Ct(),x=h.handleOnFileChange,y=h.handleOnRemoveFile,j=h.isFormLoading,N=(0,u.SS)(),C=N.generalDropdownResponse,w=N.generalCountry,k=(0,g.get)(C,"data.data",[]).find((function(e){return"CompanyTypeCorpSh"in e})),O=(0,a.useCallback)((function(e){var s=(0,g.cloneDeep)(o).shareholders;s[(0,g.get)(i,"modalData.shareholder._id","")].companyDetails.documents=c.documents.filter((function(s){return s._id!==e})),n(kt({},o,{shareholders:s}))}),[i,n,o,c.documents]),A=(0,a.useMemo)((function(){var e;return"SG"===((null===(e=c.country)||void 0===e?void 0:e.value)||"")}),[c.country]),S=(0,a.useMemo)((function(){var e;return"SG"===((null===(e=c.ppobCountry)||void 0===e?void 0:e.value)||"")}),[c.ppobCountry]);return j?(0,r.jsx)(v.S,{}):(0,r.jsxs)(a.Fragment,{children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-sp
1ace-y-2 sprout-pt-2",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Corporate Shareholder Name"]}),(0,r.jsx)(Ns.K,{placeholder:"Enter name",name:"companyName",required:!0,disabled:!0})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Entity Type"]}),(0,r.jsx)(b.Z.select2,{name:"companyType",placeholder:"Select entity type",options:null===k||void 0===k?void 0:k.CompanyTypeCorpSh.map((function(e){return{label:e,value:e}})),isRequired:!0})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Country of Incorporation"]}),(0,r.jsx)(b.Z.select2,{name:"countryOfRegisteredBusiness",placeholder:"Select country",options:(0,g.get)(w,"data.data",[]).map((function(e){return{label:e.description,value:e.countryIso2Code,icon:(0,r.jsx)("img",{className:"sprout-mr-3 sprout-h-6",src:e.countryFlagUrl,alt:""})}})),isRequired:!0})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Country of Operation"]}),(0,r.jsx)(b.Z.select2,{name:"countryOfOperations",placeholder:"Select country",options:(0,g.get)(w,"data.data",[]).map((function(e){return{label:e.description,value:e.countryName,icon:(0,r.jsx)("img",{className:"sprout-mr-3 sprout-h-6",src:e.countryFlagUrl,alt:""})}})),isRequired:!0})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"Former Name (if any)"}),(0,r.jsx)(Ns.K,{placeholder:"Enter former name",name:"historyName"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Company Registration Number"]}),(0,r.jsx)(Ns.K,{placeholder:"Enter company registration number",name:"businessRegistrationNumber",required:!0})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-justify-between",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," List of Documents"]}),(0,r.jsx)("div",{className:"sprout-cursor-pointer",onClick:f.onToggle,children:(0,r.jsx)(Q.Uy,{})})]}),f.isOpen&&(0,r.jsx)(D.pi,{information:!0,label:"Certified true copy can be certified by company secretary or director"}),(0,r.jsxs)("div",{className:(0,m.WD)(["sprout-p-4",f.isOpen?"sprout-grid sprout-grid-cols-1 md:sprout-grid-cols-2":"hidden"]),children:[(0,r.jsxs)("div",{className:"sprout-text-xs",children:[(0,r.jsx)("p",{children:"Singapore"}),(0,r.jsxs)("ol",{className:"sprout-list-decimal sprout-list-inside sprout-text-[#757575]",children:[(0,r.jsx)("li",{children:"ACRA BizFile"}),(0,r.jsx)("li",{children:"Constitution (a.k.a M&A, or Articles of Association)"}),(0,r.jsx)("li",{children:"Certificate of Corporate Representative"})]})]}),(0,r.jsxs)("div",{className:"sprout-text-xs",children:[(0,r.jsx)("p",{children:"Overseas"}),(0,r.jsxs)("ol",{className:"sprout-list-decimal sprout-list-inside sprout-text-[#757575]",children:[(0,r.jsx)("li",{children:"Certified true copy of Certificate of Incorporation"}),(0,r.jsx)("li",{children:"Certified true copy of Constitution/Memorandum & Articles of Association/By-Law"}),(0,r.jsx)("li",{children:"Certified true copy of Register of Shareholders or Certificate of Incumbency (not more than 3 months)"}),(0,r.jsx)("li",{children:"Certified true copy of Register of Directors/Certificate of Incumbency (not more than 3 months)"}),(0,r.jsx)("li",{children:"Certificate of Corporate Representative"})]})]})]}),null===(s=c.documents)||void 0===s?void 0:s.map((function(e){return(0,r.jsxs)("div",{className:"sprout-border sprout-rounded-lg sprout-p-2 sprout-pl-5 sprout-pr-5 sprout-grid sprout-grid-flow-row sprout-grid-cols-8 sprout-gap-2 sprout-items-center",children:[(0,r.jsx)("span",{className:"sprout-col-span-7 sprout-font-semibold sprout-cursor-pointer sprout-break-words",children:e.fileName}),(0,r.jsx)("span",{className:"sprout-col-span-1 sprout-flex sprout-justify-end sprout-cursor-pointer",onClick:(s=U().mark((function s(){return U().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,y(e._id,c,d);case 2:return s.next=4,O(e._id);case 4:case"end":return s.stop()}}),s)})),function(){var e=this,t=arguments;return new Promise((function(r,o){var n=s.apply(e,t);function a(e){Dt(n,r,o,a,i,"next",e)}function i(e){Dt(n,r,o,a,i,"throw",e)}a(void 0)}))}),children:"X"})]},e.documentId);var s})),(0,r.jsx)(D.iR,{secondary:!0,onClick:function(){var e;return null===(e=p.current)||void 0===e?void 0:e.click()},children:"Attach Document"}),(0,r.jsx)("input",{type:"file",ref:p,onChange:function(e){return x(d,c,e)},className:"sprout-hidden",accept:"image/jpg, image/png, application/pdf"}),(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#8E8E8E]",children:"Supported formats: jpg, pdf, png with maximum size 10 MB"}),(0,r.jsx)("p",{className:"sprout-text-sm sprout-font-semibold sprout-sp
1ace-y-2",children:"Registered Address"}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Country Address"]}),(0,r.jsx)(b.Z.select2,{name:"country",placeholder:"Select country",options:(0,g.get)(w,"data.data",[]).map((function(e){return{label:e.description,value:e.countryIso2Code,icon:(0,r.jsx)("img",{className:"sprout-mr-3 sprout-h-6",src:e.countryFlagUrl,alt:""})}}))})]}),A?(0,r.jsxs)("div",{className:"sprout-grid sprout-grid-cols-1 md:sprout-grid-cols-2 sprout-gap-4",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Block / House No"]}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. 123",name:"blockHouse"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Street Name"]}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. Orchard Road",name:"streetName"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"Level No"}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. 05",name:"level"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"Unit No"}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. 01",name:"unit"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"Building Name"}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g Orchard Towers",name:"buildingName"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Postal Code"]}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. 018956",name:"postalCode"})]})]}):(0,r.jsxs)("div",{className:"sprout-grid sprout-grid-cols-1 md:sprout-grid-cols-2 sprout-gap-4",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Address Line 1"]}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. 123 Maple Street",name:"addressLine1"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"Address Line 2"}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. Suite 4B",name:"addressLine2"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"City"}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. Los Angeles",name:"city"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"State"}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. California",name:"state"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Postal Code"]}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. 90001",name:"postalCode"})]})]}),(0,r.jsx)("p",{className:"sprout-text-sm sprout-font-semibold sprout-space-y-2",children:"Principal Place of Business"}),(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col",children:(0,r.jsxs)("div",{className:"checkbox-container mb-2",children:[(0,r.jsx)("input",{type:"checkbox",checked:c.isUseRegisteredAddress,onChange:function(e){return d(kt({},c,{isUseRegisteredAddress:e.target.checked}))}}),(0,r.jsx)("label",{htmlFor:"is-apply-for-business-account",children:(0,r.jsx)("div",{className:"checkbox-label sprout-text-sm md:sprout-text-base",children:"Use registered address as principal place of business"})})]})}),!c.isUseRegisteredAddress&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-sp
1ace-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Country Address"]}),(0,r.jsx)(b.Z.select2,{name:"ppobCountry",placeholder:"Select country",options:(0,g.get)(w,"data.data",[]).map((function(e){return{label:e.description,value:e.countryIso2Code,icon:(0,r.jsx)("img",{className:"sprout-mr-3 sprout-h-6",src:e.countryFlagUrl,alt:""})}}))})]}),S?(0,r.jsxs)("div",{className:"sprout-grid sprout-grid-cols-1 md:sprout-grid-cols-2 sprout-gap-4",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Block / House No"]}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. 123",name:"ppobBlockHouse"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Street Name"]}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. Orchard Road",name:"ppobStreetName"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"Level No"}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. 01",name:"ppobLevel"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"Unit No"}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. 05",name:"ppobUnit"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"Building Name"}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g Orchard Towers",name:"ppobBuildingName"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Postal Code"]}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. 018956",name:"ppobPostalCode"})]})]}):(0,r.jsxs)("div",{className:"sprout-grid sprout-grid-cols-1 md:sprout-grid-cols-2 sprout-gap-4",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Address Line 1"]}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. 123 Maple Streett",name:"ppobAddressLine1"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"Address Line 2"}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. Suite 4B",name:"ppobAddressLine2"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"City"}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. Los Angeles",name:"ppobCity"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"State"}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. California",name:"ppobState"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Postal Code"]}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. 90001",name:"ppobPostalCode"})]})]})]})]}),(0,r.jsx)(D.iR,{primary:!0,className:"sprout-w-full mt-4 !sprout-text-sm md:sprout-text-base !sprout-font-semibold",disabled:!l,onClick:function(){return t(1)},children:"Next"})]})}var At=t(95591),St=t(4206),Et=t(95659);function Pt(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function Tt(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){Pt(e,s,t[s])}))}return e}function It(e,s){return function(e){if(Array.isArray(e))return e}(e)||function(e,s){var t=[],r=!0,o=!1,n=void 0;try{for(var a,i=e[Symbol.iterator]();!(r=(a=i.next()).done)&&(t.push(a.value),!s||t.length!==s);r=!0);}catch(l){o=!0,n=l}finally{try{r||null==i.return||i.return()}finally{if(o)throw n}}return t}
1(e,s)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var Ft=function(){var e=(0,u.SS)().emitter,s=(0,a.useRef)(N.q.getState()).current.setGlobalSnackbar;return{handleOnOkEditShareholder:(0,a.useCallback)((function(t,r,o,n,a){var i,l=(0,g.cloneDeep)(r),u=l.shareholders,d=l.officers,p=l.shareholders[t],f=o.companyName!==p.companyDetails.companyName,h=(0,m.qX)(),x="SG"===(0,g.get)(o,"country.value",null)?{country:(0,g.get)(o,"country.value",null)||"",blockHouse:o.blockHouse||"",streetName:o.streetName||"",level:o.level||"",unit:o.unit||"",buildingName:o.buildingName||"",postalCode:o.postalCode||""}:{country:(0,g.get)(o,"country.value",null)||"",city:o.city||"",state:o.state||"",addressLine1:o.addressLine1||"",addressLine2:o.addressLine2||"",postalCode:o.postalCode||""},v="SG"===(0,g.get)(o,"ppobCountry.value",null)?{country:(0,g.get)(o,"ppobCountry.value",null)||"",postalCode:o.ppobPostalCode||"",blockHouse:o.ppobBlockHouse||"",buildingName:o.ppobBuildingName||"",level:o.ppobLevel||"",unit:o.ppobUnit||"",streetName:o.ppobStreetName||""}:{country:(0,g.get)(o,"ppobCountry.value",null)||"",postalCode:o.ppobPostalCode||"",city:o.ppobCity||"",state:o.ppobState||"",addressLine1:o.ppobAddressLine1||"",addressLine2:o.ppobAddressLine2||""},y=o.isUseRegisteredAddress?Tt({},x):v;y.isUseRegisteredAddress=o.isUseRegisteredAddress;var j,b=Tt({},p,o.isAddCorpRep?{corporateRepresentativeOf:{label:o.fullName,value:h}}:{corporateRepresentativeOf:o.corporateRepresentativeOf},{category:"CORPORATE",isApplicant:!1,companyDetails:{addresses:{registeredAddress:x,principalPlaceOfBusiness:y},companyName:o.companyName,documents:o.documents,legalDetails:{historyName:o.historyName,countryOfRegisteredBusiness:o.countryOfRegisteredBusiness.value,companyType:o.companyType.value,businessRegistrationNumber:o.businessRegistrationNumber},riskProfileAssessment:{countryOfOperations:[o.countryOfOperations.value],sourceOfFunds:o.sourceOfFunds,otherSourceOfFunds:o.otherSourceOfFunds}},documents:[],riskAssessment:{documents:[]}});if(o.isAddCorpRep){var N={_id:h,appointments:[],category:"INDIVIDUAL",isApplicant:o.isApplicant,personDetails:{contactDetails:{email:o.emailAddress},personalDetails:{fullName:o.fullName}},companyDetails:{documents:[],riskProfileAssessment:{countryOfOperations:[]}},documents:[],riskAssessment:{documents:[]},sharesDetails:[]};d[h]=N,a(Tt({},l,{officers:d}))}((null===(i=b.corporateRepresentativeOf)||void 0===i?void 0:i.value)||b.corporateRepresentativeOf)&&function(e,s,t,r){var o,n=e.shareholders[t],a=e.shareholders,i=e.officers;i[r]||(i[r]=a[r]);var l=(null===(o=n.corporateRepresentativeOf)||void 0===o?void 0:o.value)||n.corporateRepresentativeOf;if(l&&l!==r){var u=i[l].appointments,d=u.findIndex((function(e){return"Corporate Representative of"===e.position&&e.companyName===n.companyDetails.companyName}));-1!==d&&i[l].appointments.splice(d,1);var p=u.findIndex((function(e){return"Corporate Representative"===e.position}));-1!==p&&u.length>1&&i[l].appointments.splice(p,1)}var m=i[r].appointments,f=-1!==m.findIndex((function(e){return"Corporate Representative"===e.position}));-1!==m.findIndex((function(e){return"Corporate Representative of"===e.position&&e.companyName===n.companyDetails.companyName}))||m.push({companyName:n.companyDetails.companyName,position:"Corporate Representative of",status:"Active",isOutgoing:!1}),f||m.push({position:"Corporate Representative",status:"Active",isOutgoing:!1}),e.officers=Object.fromEntries(Object.entries(i).filter((function(e){var s=It(e,2);return s[0],s[1].appointments.some((function(e){return c.UK.includes(e.position)&&"Active"===e.status}))}))),s(Tt({},e))}(l,a,t,(null===(j=b.corporateRepresentativeOf)||void 0===j?void 0:j.value)||b.corporateRepresentativeOf);if(u[t]=b,a(Tt({},l,{shareholders:u})),f){var C,D=d[(null===(C=b.corporateRepresentativeOf)||void 0===C?void 0:C.value)||b.corporateRepresentativeOf],w=D.appointments,k=w.findIndex((function(e){return e.companyName===p.companyDetails.companyName})),O=Tt({},w[k],{companyName:o.companyName});d[D._id].appointments[k]=O}return e.emit("@modal/corporate-shareholder",{shareholder:void 0,type:""}),n(),s("Shareholder data successfully updated.","success")}),[e,s])}};function Rt(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function Lt(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){Rt(e,s,t[s])}))}return e}function _t(e,s){return function(e){if(Array.isArray(e))return e}(e)||function(e,s){var t=[],r=!0,o=!1,n=void 0;try{for(var a,i=e[Symbol.iterator]();!(r=(a=i.next()).done)&&(t.push(a.value),!s||t.length!==s);r=!0);}catch(l){o=!0,n=l}finally{try{r||null==i.return||i.return()}finally{if(o)throw n}}return t}
1(e,s)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Bt(e){var s,t=e.setStep,o=e.parentValues,n=e.parentSetValues,i=e.values,l=e.setValues,u=e.isValid,d=e.meta,p=e.resetForm,f=(0,St.Z)().getCountryListRaw,h=(0,At.ZP)("getCountryList",f).data,x=Ft().handleOnOkEditShareholder,v=function(e){var s=void 0!==e&&e,t=null===h||void 0===h?void 0:h.data.sort((function(e,s){return e.countryName.localeCompare(s.countryName)})).map((function(e){return{icon:(0,r.jsx)("div",{className:"sprout-flex",children:(0,r.jsx)("img",{className:"sprout-h-[25px] sprout-mr-3 sprout-self-center",src:"".concat(e.countryFlagUrl),alt:""})}),label:"".concat(e.countryName," (").concat(e.dialCode,")"),value:e.dialCode}}));return s?null===t||void 0===t?void 0:t.filter((function(e){return"+65"===e.value})):t},j=(0,y.a)().profileState.profile,N=(0,g.find)(o.officers,{isApplicant:!0})||(0,g.find)(o.shareholders,{isApplicant:!0}),C=!N||(null===N||void 0===N?void 0:N._id)===(null===(s=d.modalData.shareholder)||void 0===s?void 0:s._id);return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2 sprout-pt-2",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2 sprout-mb-4",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Corporate Representative"]}),(0,r.jsx)(b.Z.select2,{name:"corporateRepresentativeOf",placeholder:"Select Corporate Representative",options:Object.values(Object.fromEntries(Object.entries(Lt({},o.officers,o.shareholders)).filter((function(e){var s=_t(e,2);s[0];return"INDIVIDUAL"===s[1].category})))).map((function(e){return{label:e.personDetails.personalDetails.fullName,value:e._id}})),isDisabled:i.isAddCorpRep})]}),(0,r.jsxs)("div",{className:"sprout-flex",children:[(0,r.jsxs)("label",{className:"sprout-inline-flex sprout-cursor-pointer",children:[(0,r.jsx)(w.Field,{type:"checkbox",className:"sprout-sr-only sprout-peer",readOnly:!0,name:"isAddCorpRep"}),(0,r.jsx)("div",{className:"sprout-relative sprout-w-11 sprout-h-6 sprout-bg-gray-200 peer-focus:sprout-outline-none peer-focus:sprout-ring-4 peer-focus:sprout-ring-orange-300 sprout-rounded-full peer peer-checked:after:sprout-translate-x-full rtl:peer-checked:after:-sprout-translate-x-full peer-checked:after:sprout-border-white after:sprout-content-[''] after:sprout-absolute after:sprout-top-[2px] after:sprout-start-[2px] after:sprout-bg-white after:sprout-border-gray-300 after:sprout-border after:sprout-rounded-full after:sprout-h-5 after:sprout-w-5 after:sprout-transition-all peer-checked:sprout-bg-orange-600"})]}),(0,r.jsxs)("div",{className:"sprout-ml-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm sprout-font-semibold",children:"Add new corporate representative instead"}),(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:"Note: Do not select from the dropdown if a representative is already listed. New entries are required to maintain current data."})]})]}),i.isAddCorpRep&&(0,r.jsxs)(a.Fragment,{children:[(!N||C)&&(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col",children:[(0,r.jsxs)("div",{className:"checkbox-container mb-2",children:[(0,r.jsx)(w.Field,{name:"isApplicant",type:"checkbox",onClick:function(e){return function(e){e.target.checked?l(Lt({},i,{fullName:"".concat(null===j||void 0===j?void 0:j.callFirstName," ").concat(null===j||void 0===j?void 0:j.callLastName),emailAddress:null===j||void 0===j?void 0:j.emailAddresses[0]})):l(Lt({},i,{fullName:"",emailAddress:""}))}(e)}}),(0,r.jsx)("label",{htmlFor:"is-apply-for-business-account",children:(0,r.jsx)("div",{className:"checkbox-label sprout-text-sm md:sprout-text-base",children:"This is me"})})]}),(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Check this if this person is yourself."})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2 sprout-mb-4",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Full Name"]}),(0,r.jsx)(Ns.K,{placeholder:"Enter name",name:"fullName",required:!0,disabled:i.isApplicant})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-sp
1ace-y-2 sprout-mb-4",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," ID Number"]}),(0,r.jsxs)("div",{className:"sprout-grid sprout-grid-cols-2 sprout-gap-2",children:[(0,r.jsx)(b.Z.select2,{name:"IDNumberType",placeholder:"Select type",options:c.Qo.map((function(e){return{label:e,value:e}}))}),(0,r.jsx)(Ns.K,{placeholder:"Enter number",name:"IDNumber",required:!0,onKeyDown:function(e){return(0,m.kb)(e)}})]})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2 sprout-mb-4",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Contact Number"]}),(0,r.jsxs)("div",{className:"sprout-grid sprout-grid-cols-2 sprout-gap-2",children:[(0,r.jsx)(Et.Z,{placeholder:"Enter dial code",name:"dialCode",isSearchable:!1,options:[{label:"Common Countries",options:v(!0)},{label:"All",options:v()}]}),(0,r.jsx)(Ns.K,{placeholder:"Enter number",name:"contactNumber",required:!0,onKeyDown:function(e){return(0,m.AM)(e)}})]})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2 sprout-mb-4",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Email Address"]}),(0,r.jsx)(Ns.K,{placeholder:"Enter email",name:"emailAddress",required:!0,disabled:i.isApplicant})]})]})]}),(0,r.jsxs)("div",{className:"sprout-grid sprout-grid-cols-2 sprout-gap-2",children:[(0,r.jsx)(D.iR,{className:"!sprout-text-sm md:sprout-text-base !sprout-font-semibold",secondary:!0,onClick:function(){return t(0)},children:"Previous"}),(0,r.jsx)(D.iR,{className:"!sprout-text-sm md:sprout-text-base !sprout-font-semibold",primary:!0,disabled:!u,onClick:function(){var e,s;x(null!==(s=null===(e=d.modalData.shareholder)||void 0===e?void 0:e._id)&&void 0!==s?s:"",o,i,p,n),t(0)},children:"Save"})]})]})}function Vt(e){var s=e.onClose,t=e.parentValues,o=e.parentSetValues,n=(0,u.SS)().emitter,a=ot({emitter:n}).meta,i=(0,w.useFormikContext)(),l=i.values,c=i.setValues,d=i.setFieldValue,p=i.isValid,m=i.resetForm,f=function(e){d("step",e)};return(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-4",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-w-full sprout-justify-center sprout-items-center",children:[(0,r.jsx)("span",{className:"sprout-text-base md:sprout-text-xl sprout-font-semibold sprout-text-center pr-1 md:p-0",children:"Corporate Shareholder"}),(0,r.jsx)("div",{className:"sprout-absolute sprout-right-5 sprout-cursor-pointer",onClick:function(){m(),s()},children:(0,r.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("mask",{id:"mask0_1663_4126",maskUnits:"userSpaceOnUse",x:"2",y:"2",width:"12",height:"12",children:(0,r.jsx)("path",{d:"M2.7879 2.13518C2.60765 1.95494 2.31542 1.95494 2.13518 2.13518C1.95494 2.31542 1.95494 2.60765 2.13518 2.7879L7.34729 8L2.13518 13.2121C1.95494 13.3923 1.95494 13.6846 2.13518 13.8648C2.31542 14.0451 2.60765 14.0451 2.7879 13.8648L8 8.65271L13.2121 13.8648C13.3923 14.0451 13.6846 14.0451 13.8648 13.8648C14.0451 13.6846 14.0451 13.3923 13.8648 13.2121L8.65271 8L13.8648 2.7879C14.0451 2.60765 14.0451 2.31542 13.8648 2.13518C13.6846 1.95494 13.3923 1.95494 13.2121 2.13518L8 7.34729L2.7879 2.13518Z",fill:"#8E8E8E"})}),(0,r.jsx)("g",{mask:"url(#mask0_1663_4126)",children:(0,r.jsx)("rect",{width:"16",height:"16",fill:"#121212"})})]})})]}),(0,r.jsx)("div",{className:"sprout-flex sprout-w-full sprout-justify-center sprout-items-center",children:(0,r.jsx)(yt,{step:l.step})}),0===l.step&&(0,r.jsx)(Ot,{parentValues:t,parentSetValues:o,meta:a,setValues:c,values:l,setStep:f,isValid:p}),1===l.step&&(0,r.jsx)(Bt,{setStep:f,parentValues:t,parentSetValues:o,values:l,isValid:p,setValues:c,meta:a,resetForm:m})]})}function Ut(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function Mt(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){Ut(e,s,t[s])}))}return e}function Zt(e){var s,t,o,n,i,l,c,d,p,m,f,h,x,v,y,j,N,C,w,k,O,A,S,E,P,T,I,F,R,L,_,B,V,U,M,Z,q,W,G,K,H,z,Y,X,Q,$,J,ee,se,te,re,oe,ne,ae,ie,le,ue,ce,de,pe,me,fe,he,xe,ve,ye,ge,je,be,Ne,Ce,De,we,ke,Oe,Ae,Se,Ee,Pe,Te,Ie,Fe,Re,Le,_e,Be,Ve,Ue,Me,Ze,qe,We,Ge,Ke,He,ze,Ye,Xe,Qe,$e,Je,es,ss,ts,rs,os,ns,as,is,ls,us,cs,ds,ps,ms,fs,hs,xs,vs,ys,gs,js,bs,Ns,Cs,Ds,ws,ks,Os,As,Ss,Es,Ps,Ts,Is,Fs,Rs,Ls,_s,Bs,Vs,Us,Ms,Zs,qs,Ws,Gs,Ks,zs,Ys,Xs,Qs,$s,Js,et,st,tt,rt,nt,at,it,lt=e.isOpen,ut=e.onClose,ct=e.parentValues,dt=e.parentSetValues,pt=(0,u.SS)().emitter,mt=ot({emitter:pt}).meta,ft=(0,u.SS)().generalCountry,ht=(0,a.useMemo)((function(){var e,s,t,r,o;return(null===(t=null===mt||void 0===mt||null===(e=mt.modalData)||void 0===e||null===(s=e.shareholder)||void 0===s?void 0:s.corporateRepresentativeOf)||void 0===t?void 0:t.value)||(null===mt||void 0===mt||null===(r=mt.modalData)||void 0===r||null===(o=r.shareholder)||void 0===o?void 0:o.corporateRepresentativeOf)}),[null===mt||void 0===mt||null===(s=mt.modalData)||void 0===s||null===(t=s.shareholder)||void 0===t?void 0:t.corporateRepresentativeOf]),xt=(0,g.find)(ct.officers,{_id:ht}),vt=(0,g.get)(ft,"data.data",[]).map((function(e){return{label:e.description,value:e.countryIso2Code,icon:(0,r.jsx)("img",{className:"sprout-mr-3 sprout-h-6",src:e.countryFlagUrl,alt:""})}})),yt=(0,g.get)(ft,"data.data",[]).map((function(e){return{label:e.description,value:e.countryName,icon:(0,r.jsx)("img",{className:"sprout-mr-3 sprout-h-6",src:e.countryFlagUrl,alt:""})}})),gt=Mt({shareholderId:null!==(st=null===mt||void 0===mt||null===(o=mt.modalData)||void 0===o||null===(n=o.shareholder)||void 0===n?void 0:n._id)&&void 0!==st?st:"",companyName:null!==(tt=null===mt||void 0===mt||null===(i=mt.modalData)||void 0===i||null===(l=i.shareholder)||void 0===l||null===(c=l.companyDetails)||void 0===c?void 0:c.companyName)&&void 0!==tt?tt:""},(null===mt||void 0===mt||null===(d=mt.modalData)||void 0===d||null===(p=d.shareholder)||void 0===p||null===(m=p.companyDetails)||void 0===m||null===(f=m.legalDetails)||void 0===f?void 0:f.companyType)?(null===mt||void 0===mt||null===(h=mt.modalData)||void 0===h||null===(x=h.shareholder)||void 0===x||null===(v=x.companyDetails)||void 0===v||null===(y=v.legalDetails)||void 0===y||null===(j=y.companyType)||void 0===j?void 0:j.value)?{companyType:null===mt||void 0===mt||null===(N=mt.modalData)||void 0===N||null===(C=N.shareholder)||void 0===C||null===(w=C.companyDetails)||void 0===w||null===(k=w.legalDetails)||void 0===k?void 0:k.companyType}:{companyType:{label:null===mt||void 0===mt||null===(O=mt.modalData)||void 0===O||null===(A=O.shareholder)||void 0===A||null===(S=A.companyDetails)||void 0===S||null===(E=S.legalDetails)||void 0===E?void 0:E.
1companyType,value:null===mt||void 0===mt||null===(P=mt.modalData)||void 0===P||null===(T=P.shareholder)||void 0===T||null===(I=T.companyDetails)||void 0===I||null===(F=I.legalDetails)||void 0===F?void 0:F.companyType}}:"",(null===mt||void 0===mt||null===(R=mt.modalData)||void 0===R||null===(L=R.shareholder)||void 0===L||null===(_=L.companyDetails)||void 0===_||null===(B=_.legalDetails)||void 0===B?void 0:B.countryOfRegisteredBusiness)?(null===mt||void 0===mt||null===(V=mt.modalData)||void 0===V||null===(U=V.shareholder)||void 0===U||null===(M=U.companyDetails)||void 0===M||null===(Z=M.legalDetails)||void 0===Z||null===(q=Z.countryOfRegisteredBusiness)||void 0===q?void 0:q.value)?{countryOfRegisteredBusiness:null===mt||void 0===mt||null===(W=mt.modalData)||void 0===W||null===(G=W.shareholder)||void 0===G||null===(K=G.companyDetails)||void 0===K||null===(H=K.legalDetails)||void 0===H?void 0:H.countryOfRegisteredBusiness}:{countryOfRegisteredBusiness:vt.find((function(e){var s,t,r,o;return(null===mt||void 0===mt||null===(s=mt.modalData)||void 0===s||null===(t=s.shareholder)||void 0===t||null===(r=t.companyDetails)||void 0===r||null===(o=r.legalDetails)||void 0===o?void 0:o.countryOfRegisteredBusiness)===e.value}))}:"",(null===mt||void 0===mt||null===(z=mt.modalData)||void 0===z||null===(Y=z.shareholder)||void 0===Y||null===(X=Y.companyDetails)||void 0===X||null===(Q=X.riskProfileAssessment)||void 0===Q?void 0:Q.countryOfOperations[0])?(null===(te=null===mt||void 0===mt||null===($=mt.modalData)||void 0===$||null===(J=$.shareholder)||void 0===J||null===(ee=J.companyDetails)||void 0===ee||null===(se=ee.riskProfileAssessment)||void 0===se?void 0:se.countryOfOperations[0])||void 0===te?void 0:te.value)?{countryOfOperations:null===mt||void 0===mt||null===(re=mt.modalData)||void 0===re||null===(oe=re.shareholder)||void 0===oe||null===(ne=oe.companyDetails)||void 0===ne||null===(ae=ne.riskProfileAssessment)||void 0===ae?void 0:ae.countryOfOperations[0]}:{countryOfOperations:yt.find((function(e){var s,t,r,o;return(null===mt||void 0===mt||null===(s=mt.modalData)||void 0===s||null===(t=s.shareholder)||void 0===t||null===(r=t.companyDetails)||void 0===r||null===(o=r.riskProfileAssessment)||void 0===o?void 0:o.countryOfOperations[0])===e.value}))}:"",{historyName:null!==(rt=null===mt||void 0===mt||null===(ie=mt.modalData)||void 0===ie||null===(le=ie.shareholder)||void 0===le||null===(ue=le.companyDetails)||void 0===ue||null===(ce=ue.legalDetails)||void 0===ce?void 0:ce.historyName)&&void 0!==rt?rt:"",businessRegistrationNumber:null!==(nt=null===mt||void 0===mt||null===(de=mt.modalData)||void 0===de||null===(pe=de.shareholder)||void 0===pe||null===(me=pe.companyDetails)||void 0===me||null===(fe=me.legalDetails)||void 0===fe?void 0:fe.businessRegistrationNumber)&&void 0!==nt?nt:"",documents:null!==(at=null===mt||void 0===mt||null===(he=mt.modalData)||void 0===he||null===(xe=he.shareholder)||void 0===xe?void 0:xe.companyDetails.documents)&&void 0!==at?at:[],shareTypes:function(){var e,s,t=[];(null===(e=mt.modalData.shareholder)||void 0===e?void 0:e.sharesDetails)?null===(s=mt.modalData.shareholder)||void 0===s||s.sharesDetails.forEach((function(e){var s,o=new Intl.DisplayNames(["en"],{type:"currency"}),n=Mt({},e,{shareType:{label:null===e||void 0===e?void 0:e.shareType,value:null===e||void 0===e?void 0:e.shareType},shareCurrency:{label:null!==(s=o.of(null===e||void 0===e?void 0:e.shareCurrency))&&void 0!==s?s:"-",value:null===e||void 0===e?void 0:e.shareCurrency,icon:(0,r.jsx)("div",{className:"sprout-flex sprout-text-sm sprout-font-semibold sprout-text-[rgba(2, 2, 2, 0.75)] sprout-mr-3",children:null===e||void 0===e?void 0:e.shareCurrency})}});t.push(n)})):t=[{issuedShareCapital:"",paidUpShareCapital:"",shareAllotted:"",shareCurrency:"",shareType:""}];return t}(),corporateRepresentativeOf:xt?null===mt||void 0===mt||null===(ve=mt.modalData)||void 0===ve||null===(ye=ve.shareholder)||void 0===ye?void 0:ye.corporateRepresentativeOf:null,step:0,isApplicant:null!==(it=null===(ge=mt.modalData.shareholder)||void 0===ge?void 0:ge.isApplicant)&&void 0!==it&&it,isUseRegisteredAddress:(0,g.get)(mt,"modalData.shareholder.companyDetails.addresses.principalPlaceOfBusiness.isUseRegisteredAddress",!1)},(null===(Ce=null===mt||void 0===mt||null===(je=mt.modalData)||void 0===je||null===(be=je.shareholder)||void 0===be||null===(Ne=be.companyDetails)||void 0===Ne?void 0:Ne.addresses.registeredAddress)||void 0===Ce?void 0:Ce.country)?{country:vt.find((function(e){var s,t,r,o;return(null===(o=null===mt||void 0===mt||null===(s=mt.modalData)||void 0===s||null===(t=s.shareholder)||void 0===t||null===(r=t.companyDetails)||void 0===r?void 0:r.addresses.registeredAddress)||void 0===o?void 0:o.country)===e.value}))}:"",(null===(Oe=null===mt||void 0===mt||null===(De=mt.modalData)||void 0===De||null===(we=De.shareholder)||void 0===we||null===(ke=we.companyDetails)||void 0===ke?void 0:ke.addresses.registeredAddress)||void 0===Oe?void 0:Oe.blockHouse)?{blockHouse:(0,g.get)(mt,"modalData.shareholder.companyDetails.addresses.registeredAddress.blockHouse","")}:"",(null===(Pe=null===mt||void 0===mt||null===(Ae=mt.modalData)||void 0===Ae||null===(Se=Ae.shareholder)||void 0===Se||null===(Ee=Se.companyDetails)||void 0===Ee?void 0:Ee.addresses.registeredAddress)||void 0===Pe?void 0:Pe.streetName)?{streetName:(0,g.get)(mt,"modalData.shareholder.companyDetails.addresses.registeredAddress.streetName","")}:"",(null===(Re=null===mt||void 0===mt||null===(Te=mt.modalData)||void 0===Te||null===(Ie=Te.shareholder)||void 0===Ie||null===(Fe=Ie.companyDetails)||void 0===Fe?void 0:Fe.addresses.registeredAddress)||void 0===Re?void 0:Re.level)?{level:(0,g.get)(mt,"modalData.shareholder.companyDetails.addresses.registeredAddress.level","")}:"",(null===(Ve=null===mt||void 0===mt||null===(Le=mt.modalData)||void 0===Le||null===(_e=Le.shareholder)||void 0===_e||null===(Be=_e.companyDetails)||void 0===Be?void 0:Be.addresses.registeredAddress)||void 0===Ve?void 0:Ve.unit)?{unit:(0,g.get)(mt,"modalData.shareholder.companyDetails.addresses.registeredAddress.unit","")}:"",(null===(qe=null===mt||void 0===mt||null===(Ue=mt.modalData)||void 0===Ue||null===(Me=Ue.shareholder)||void 0===Me||null===(Ze=Me.companyDetails)||void 0===Ze?void 0:Ze.addresses.registeredAddress)||void 0===qe?void 0:qe.buildingName)?{buildingName:(0,g.get)(mt,"modalData.shareholder.companyDetails.addresses.registeredAddress.buildingName","")}:"",(null===(He=null===mt||void 0===mt||null===(We=mt.modalData)||void 0===We||null===(Ge=We.shareholder)||void 0===Ge||null===(Ke=Ge.companyDetails)||void 0===Ke?void 0:Ke.addresses.registeredAddress)||void 0===He?void 0:He.postalCode)?{postalCode:(0,g.get)(mt,"modalData.shareholder.companyDetails.addresses.registeredAddress.postalCode","")}:"",(null===(Qe=null===mt||void 0===mt||null===(ze=mt.modalData)||void 0===ze||null===(Ye=ze.shareholder)||void 0===Ye||null===(Xe=Ye.companyDetails)||void 0===Xe?void 0:Xe.addresses.registeredAddress)||void 0===Qe?void 0:Qe.addressLine1)?{addressLine1:(0,g.get)(mt,"modalData.shareholder.companyDetails.addresses.registeredAddress.addressLine1","")}:"",(null===(ss=null===mt||void 0===mt||null===($e=mt.modalData)||void 0===$e||null===(Je=$e.shareholder)||void 0===Je||null===(es=Je.companyDetails)||void 0===es?void 0:es.addresses.registeredAddress)||void 0===ss?void 0:ss.addressLine2)?{addressLine2:(0,g.get)(mt,"modalData.shareholder.companyDetails.addresses.registeredAddress.addressLine2","")}:"",(null===(ns=null===mt||void 0===mt||null===(ts=mt.modalData)||void 0===ts||null===(rs=ts.shareholder)||void 0===rs||null===(os=rs.companyDetails)||void 0===os?void 0:os.addresses.registeredAddress)||void 0===ns?void 0:ns.city)?{city:(0,g.get)(mt,"modalData.shareholder.companyDetails.addresses.registeredAddress.city","")}
1:"",(null===(us=null===mt||void 0===mt||null===(as=mt.modalData)||void 0===as||null===(is=as.shareholder)||void 0===is||null===(ls=is.companyDetails)||void 0===ls?void 0:ls.addresses.registeredAddress)||void 0===us?void 0:us.state)?{state:(0,g.get)(mt,"modalData.shareholder.companyDetails.addresses.registeredAddress.state","")}:"",(null===(ms=null===mt||void 0===mt||null===(cs=mt.modalData)||void 0===cs||null===(ds=cs.shareholder)||void 0===ds||null===(ps=ds.companyDetails)||void 0===ps?void 0:ps.addresses.principalPlaceOfBusiness)||void 0===ms?void 0:ms.country)?{ppobCountry:vt.find((function(e){var s,t,r,o;return(null===(o=null===mt||void 0===mt||null===(s=mt.modalData)||void 0===s||null===(t=s.shareholder)||void 0===t||null===(r=t.companyDetails)||void 0===r?void 0:r.addresses.principalPlaceOfBusiness)||void 0===o?void 0:o.country)===e.value}))}:"",(null===(vs=null===mt||void 0===mt||null===(fs=mt.modalData)||void 0===fs||null===(hs=fs.shareholder)||void 0===hs||null===(xs=hs.companyDetails)||void 0===xs?void 0:xs.addresses.principalPlaceOfBusiness)||void 0===vs?void 0:vs.blockHouse)?{ppobBlockHouse:(0,g.get)(mt,"modalData.shareholder.companyDetails.addresses.principalPlaceOfBusiness.blockHouse","")}:"",(null===(bs=null===mt||void 0===mt||null===(ys=mt.modalData)||void 0===ys||null===(gs=ys.shareholder)||void 0===gs||null===(js=gs.companyDetails)||void 0===js?void 0:js.addresses.principalPlaceOfBusiness)||void 0===bs?void 0:bs.streetName)?{ppobStreetName:(0,g.get)(mt,"modalData.shareholder.companyDetails.addresses.principalPlaceOfBusiness.streetName","")}:"",(null===(ws=null===mt||void 0===mt||null===(Ns=mt.modalData)||void 0===Ns||null===(Cs=Ns.shareholder)||void 0===Cs||null===(Ds=Cs.companyDetails)||void 0===Ds?void 0:Ds.addresses.principalPlaceOfBusiness)||void 0===ws?void 0:ws.level)?{ppobLevel:(0,g.get)(mt,"modalData.shareholder.companyDetails.addresses.principalPlaceOfBusiness.level","")}:"",(null===(Ss=null===mt||void 0===mt||null===(ks=mt.modalData)||void 0===ks||null===(Os=ks.shareholder)||void 0===Os||null===(As=Os.companyDetails)||void 0===As?void 0:As.addresses.principalPlaceOfBusiness)||void 0===Ss?void 0:Ss.unit)?{ppobUnit:(0,g.get)(mt,"modalData.shareholder.companyDetails.addresses.principalPlaceOfBusiness.unit","")}:"",(null===(Is=null===mt||void 0===mt||null===(Es=mt.modalData)||void 0===Es||null===(Ps=Es.shareholder)||void 0===Ps||null===(Ts=Ps.companyDetails)||void 0===Ts?void 0:Ts.addresses.principalPlaceOfBusiness)||void 0===Is?void 0:Is.buildingName)?{ppobBuildingName:(0,g.get)(mt,"modalData.shareholder.companyDetails.addresses.principalPlaceOfBusiness.buildingName","")}:"",(null===(_s=null===mt||void 0===mt||null===(Fs=mt.modalData)||void 0===Fs||null===(Rs=Fs.shareholder)||void 0===Rs||null===(Ls=Rs.companyDetails)||void 0===Ls?void 0:Ls.addresses.principalPlaceOfBusiness)||void 0===_s?void 0:_s.postalCode)?{ppobPostalCode:(0,g.get)(mt,"modalData.shareholder.companyDetails.addresses.principalPlaceOfBusiness.postalCode","")}:"",(null===(Ms=null===mt||void 0===mt||null===(Bs=mt.modalData)||void 0===Bs||null===(Vs=Bs.shareholder)||void 0===Vs||null===(Us=Vs.companyDetails)||void 0===Us?void 0:Us.addresses.principalPlaceOfBusiness)||void 0===Ms?void 0:Ms.addressLine1)?{ppobAddressLine1:(0,g.get)(mt,"modalData.shareholder.companyDetails.addresses.principalPlaceOfBusiness.addressLine1","")}:"",(null===(Gs=null===mt||void 0===mt||null===(Zs=mt.modalData)||void 0===Zs||null===(qs=Zs.shareholder)||void 0===qs||null===(Ws=qs.companyDetails)||void 0===Ws?void 0:Ws.addresses.principalPlaceOfBusiness)||void 0===Gs?void 0:Gs.addressLine2)?{ppobAddressLine2:(0,g.get)(mt,"modalData.shareholder.companyDetails.addresses.principalPlaceOfBusiness.addressLine2","")}:"",(null===(Xs=null===mt||void 0===mt||null===(Ks=mt.modalData)||void 0===Ks||null===(zs=Ks.shareholder)||void 0===zs||null===(Ys=zs.companyDetails)||void 0===Ys?void 0:Ys.addresses.principalPlaceOfBusiness)||void 0===Xs?void 0:Xs.city)?{ppobCity:(0,g.get)(mt,"modalData.shareholder.companyDetails.addresses.principalPlaceOfBusiness.city","")}:"",(null===(et=null===mt||void 0===mt||null===(Qs=mt.modalData)||void 0===Qs||null===($s=Qs.shareholder)||void 0===$s||null===(Js=$s.companyDetails)||void 0===Js?void 0:Js.addresses.principalPlaceOfBusiness)||void 0===et?void 0:et.state)?{ppobState:(0,g.get)(mt,"modalData.shareholder.companyDetails.addresses.principalPlaceOfBusiness.state","")}:"");return(0,r.jsx)(D.BT,{className:"sprout-w-[325px] md:sprout-w-[640px] sprout-max-h-[540px] sprout-overflow-auto !sprout-p-4",show:lt,useBackgroun
1d:!0,onClose:ut,children:(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-4",children:(0,r.jsx)(b.Z.form,{onSubmit:function(){},initialValues:gt,validation:function(e){return function(e,s){var t,r,o,n={},a=s.officers,i=s.shareholders;if(0===e.step&&(e.companyName||(n.companyName=""),e.companyType||(n.companyType=""),e.countryOfRegisteredBusiness||(n.countryOfRegisteredBusiness=""),e.countryOfOperations||(n.countryOfOperations=""),e.businessRegistrationNumber||(n.businessRegistrationNumber=""),0===(0,g.get)(e,"documents",[]).length&&(n.documents=""),e.country?"SG"===e.country.value?(e.blockHouse||(n.blockHouse="This field is required"),e.streetName||(n.streetName="This field is required"),e.postalCode||(n.postalCode="This field is required")):"SG"!==e.country.value&&(e.addressLine1||(n.addressLine1="This field is required"),e.postalCode||(n.postalCode="This field is required")):n.country="This field is required",e.ppobCountry||e.isUseRegisteredAddress?"SG"!==(null===(t=e.ppobCountry)||void 0===t?void 0:t.value)||e.isUseRegisteredAddress?"SG"===(null===(r=e.ppobCountry)||void 0===r?void 0:r.value)||e.isUseRegisteredAddress||(e.ppobAddressLine1||(n.ppobAddressLine1="This field is required"),e.ppobPostalCode||(n.ppobPostalCode="This field is required")):(e.ppobBlockHouse||(n.ppobBlockHouse="This field is required"),e.ppobStreetName||(n.ppobStreetName="This field is required"),e.ppobPostalCode||(n.ppobPostalCode="This field is required")):n.ppobCountry="This field is required"),1===e.step)if(e.isAddCorpRep)e.isApplicant||(e.fullName||(n.fullName=""),e.emailAddress&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e.emailAddress)&&(n.emailAddress="Invalid email address"),e.emailAddress||(n.emailAddress="")),(null===(o=e.IDNumberType)||void 0===o?void 0:o.value)||(n.IDNumberType=""),e.IDNumber||(n.IDNumber=""),e.contactNumber||(n.contactNumber=""),Object.keys(a).forEach((function(s){var t;s!==e.shareholderId&&(null===(t=a[s].personDetails.contactDetails)||void 0===t?void 0:t.email)&&Hs.Z.transformToLowerCase(a[s].personDetails.contactDetails.email)===Hs.Z.transformToLowerCase(e.emailAddress)&&(n.emailAddress="Email already existed")}
1)),Object.keys(i).forEach((function(s){s!==e.shareholderId&&"INDIVIDUAL"===i[s].category&&Hs.Z.transformToLowerCase(i[s].personDetails.contactDetails.email)===Hs.Z.transformToLowerCase(e.emailAddress)&&(n.emailAddress="Email already existed")}));else if(!e.isAddCorpRep){var l;(null===(l=e.corporateRepresentativeOf)||void 0===l?void 0:l.value)||(n.corporateRepresentativeOf="")}return 2===e.step&&e.shareTypes.forEach((function(e){var s,t;(null===e||void 0===e||null===(s=e.shareType)||void 0===s?void 0:s.value)||(n.shareType=""),(null===e||void 0===e?void 0:e.shareAllotted)||(n.shareAllotted=""),(null===e||void 0===e||null===(t=e.shareCurrency)||void 0===t?void 0:t.value)||(n.shareCurrency=""),(null===e||void 0===e?void 0:e.paidUpShareCapital)||(n.paidUpShareCapital="")})),n}(e,ct)},validateOnChange:!0,validateOnBlur:!0,validateOnMount:!0,children:(0,r.jsx)(Vt,{onClose:ut,parentValues:ct,parentSetValues:dt})})})})}function qt(e){var s=e.shareholders,t=e.values,o=e.setValues,n=(0,u.SS)().emitter,i=ot({emitter:n}).corporateShareholderModal,l=(0,a.useMemo)((function(){return s.some((function(e){return"CORPORATE"===e.category}))}),[s]),c=(0,K.Z)(!0);return(0,r.jsxs)("div",{className:(0,m.WD)(["sprout-relative sprout-flex sprout-flex-col","sprout-border sprout-border-[#CDCDCD] sprout-border-solid sprout-rounded-[16px]","sprout-overflow-auto"]),children:[(0,r.jsx)(Zt,{isOpen:i.isOpen,onClose:i.onClose,parentValues:t,parentSetValues:o}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-p-4",children:[(0,r.jsx)("h3",{className:"sprout-font-semibold sprout-mb-2",children:"Shareholder Listing"}),l&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-justify-between",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"Documents Needed for Corporate Shareholder"}),(0,r.jsx)("div",{className:"sprout-cursor-pointer",onClick:c.onToggle,children:(0,r.jsx)(Q.Uy,{})})]}),(0,r.jsxs)("div",{className:(0,m.WD)(["sprout-pt-4",c.isOpen?"sprout-w-full":"hidden"]),children:[(0,r.jsx)(D.pi,{information:!0,label:"Certified true copy can be certified by company secretary or director"}),(0,r.jsxs)("div",{className:"sprout-mt-2 sprout-grid sprout-grid-cols-1 md:sprout-grid-cols-2",children:[(0,r.jsxs)("div",{className:"sprout-text-xs",children:[(0,r.jsx)("p",{children:"Singapore"}),(0,r.jsxs)("ol",{className:"sprout-list-decimal sprout-list-inside sprout-text-[#757575]",children:[(0,r.jsx)("li",{children:"ACRA BizFile"}),(0,r.jsx)("li",{children:"Constitution (a.k.a M&A, or Articles of Association)"}),(0,r.jsx)("li",{children:"Certificate of Corporate Representative"})]})]}),(0,r.jsxs)("div",{className:"sprout-text-xs",children:[(0,r.jsx)("p",{children:"Overseas"}),(0,r.jsxs)("ol",{className:"sprout-list-decimal sprout-list-inside sprout-text-[#757575]",children:[(0,r.jsx)("li",{children:"Certified true copy of Certificate of Incorporation"}),(0,r.jsx)("li",{children:"Certified true copy of Constitution/Memorandum & Articles of Association/By-Law"}),(0,r.jsx)("li",{children:"Certified true copy of Register of Shareholders or Certificate of Incumbency (not more than 3 months)"}),(0,r.jsx)("li",{children:"Certified true copy of Register of Directors/Certificate of Incumbency (not more than 3 months)"}),(0,r.jsx)("li",{children:"Certificate of Corporate Representative"})]})]})]})]})]})]}),(0,r.jsx)("div",{className:"sprout-border-solid sprout-border-[#C4C4C4] sprout-border-b-[1px]"}),(0,r.jsxs)("div",{className:"hidden md:sprout-grid sprout-grid-cols-5 sprout-gap-6 sprout-p-4 sprout-bg-[#FAFAFA] sprout-text-xs",children:[(0,r.jsxs)("div",{className:"sprout-col-span-2 sprout-flex sprout-justify-between sprout-items-center",children:[(0,r.jsx)("p",{children:"Name"}),(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[(0,r.jsxs)("mask",{id:"mask0_1663_10926",maskUnits:"userSpaceOnUse",x:"3",y:"2",width:"10",height:"12",children:[(0,r.jsx)("path",{d:"M8.23657 2.48692C8.09964 2.37155 7.90075 2.37155 7.76382 2.48692L3.33306 6.22026C3.1764 6.35225 3.15524 6.58766 3.28578 6.74606C3.41633 6.90446 3.64915 6.92586 3.80581 6.79386L8.0002 3.2597L12.1946 6.79386C12.3512 6.92586 12.5841 6.90446 12.7146 6.74606C12.8452 6.58766 12.824 6.35225 12.6673 6.22026L8.23657 2.48692Z",fill:"#8E8E8E"}),(0,r.jsx)("path",{d:"M3.80581 9.20691C3.64915 9.07492 3.41633 9.09632 3.28578 9.25472C3.15524 9.41311 3.1764 9.64852 3.33306 9.78052L7.76382 13.5139C7.90075 13.6292 8.09964 13.6292 8.23657 13.5139L12.6673 9.78052C12.824 9.64852 12.8452 9.41311 12.7146 9.25472C12.5841 9.09632 12.3512 9.07492 12.1946 9.20691L8.0002 12.7411L3.80581 9.20691Z",fill:"#8E8E8E"})]}),(0,r.jsx)("g",{mask:"url(#mask0_1663_10926)",children:(0,r.jsx)("rect",{x:"2",y:"2",width:"12",height:"12",fill:"#8E8E8E"})})]})]}),(0,r.jsx)("div",{children:(0,r.jsx)("p",{children:"Type"})}),(0,r.jsx)("div",{children:(0,r.jsx)("p",{children:"Amount"})}),(0,r.jsx)("div",{children:(0,r.jsx)("p",{children:"Total No. of Shares"})})]}),(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-divide-y-2",children:null===s||void 0===s?void 0:s.map((function(e){return(0,r.jsxs)(a.Fragment,{children:["INDIVIDUAL"===e.category&&(0,r.jsx)(xt,{shareholder:e}),"CORPORATE"===e.category&&(0,r.jsx)(ft,{shareholder:e})]},e._id)}))})]})}var Wt=function(e){var s=e.handleSubmit,t=e.values;return(0,r.jsx)(D.iR,{secondary:!0,onClick:function(){return s(t)},children:"Save"})},Gt=function(e){var s=e.setValidate;return(0,r.jsx)(D.iR,{primary:!0,type:"submit",onClick:function(){return s(!0)},children:"Next Step"})};function Kt(e){var s=e.onOpen,t=e.handleOnSave,o=e.selectedOption,n=e.listStakeholders,i=e.setValidate,l=(0,w.useFormikContext)(),u=l.values,c=l.setValues;return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-sp
1ace-y-8",children:[(0,g.get)(o,"corpSec",!1)&&(0,r.jsx)(nt,{}),(0,r.jsx)(pt,{setValues:c,values:u}),(0,r.jsx)(qt,{shareholders:(0,g.get)(n,"shareholders",[]),setValues:c,values:u})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-justify-end sprout-space-x-6 sprout-mt-8",children:[(0,r.jsx)(Wt,{values:u,handleSubmit:t}),(0,r.jsx)(Gt,{setValidate:i})]}),(0,r.jsxs)("p",{className:"sprout-mt-6",children:["If you wish to discard the existing onboarding process or start a new one,",(0,r.jsx)("span",{className:"sprout-ml-2 sprout-font-semibold sprout-text-[#960F21] sprout-cursor-pointer",onClick:function(){return s()},children:"click here"})]})]})}function Ht(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function zt(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){Ht(e,s,t[s])}))}return e}function Yt(){var e,s=(0,a.useState)(!1),t=s[0],o=s[1],n=(0,y.a)().profileState.profile,i=(0,a.useState)(!1),l=i[0],d=i[1],p=(0,u.SS)(),m=p.emitter,f=p.companyInformation,h=p.selectedOption,x=p.isAgentMode,v=p.isRefetch,j=p.listStakeholders,D=Js({emitter:m}),w=D.handleOnSubmit,k=D.handleOnSave;(0,a.useEffect)((function(){null===f||void 0===f||f.mutate().then((function(){d(!0)})).then((function(){d(!1)}))}),[v]);var O=(0,a.useCallback)((function(e){return 0===e.appointments.filter((function(e){return"Corporate Representative"!==e.position&&"Corporate Representative of"!==e.position&&"Active"===e.status&&!e.isOutgoing})).length}),[]),A=(0,a.useRef)(N.q.getState()).current.setGlobalSnackbar,S=ot({emitter:m}),E=S.confirmationModal,P=S.handleOnConfirm,T=zt({},(null===f||void 0===f||null===(e=f.data)||void 0===e?void 0:e.data)||{},{officers:(0,g.get)(j,"initialValuesOfficer",{}),shareholders:(0,g.get)(j,"initialValuesShareholder",{})});return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)(C.Z,{open:E.isOpen,title:"Are you sure to discard this process?",okText:"Discard",okVariant:"primary",cancelVariant:"secondary",okRed:!0,onOk:P,onCancel:E.onClose,children:(0,r.jsx)("p",{className:"sprout-text-sm sprout-pt-4 sprout-pb-6 sprout-px-3",children:"This action will discard all inputted data, and it cannot be undone"})}),(0,r.jsx)(Os,{}),(0,r.jsx)(b.Z.form,{initialValues:T,onSubmit:w,validation:function(e){return function(e){var s={};h.corpSec&&void 0===e.company.isAppointGrofND&&(s={company:{isAppointGrofND:"This field is required"}});var t=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;if(Object.keys(e.officers).forEach((function(r){var o,a=null===e||void 0===e?void 0:e.officers[r].appointments.filter((function(e){return c.UK.includes(e.position)&&"Active"===e.status}));if(null===a||void 0===a?void 0:a.length){var i=(0,g.findIndex)(null===e||void 0===e?void 0:e.officers[r].appointments,{_id:null===(o=a[0])||void 0===o?void 0:o._id}),l=0===(null===e||void 0===e?void 0:e.officers[r].appointments.filter((function(e){return!c.UK.includes(e.position)&&"Active"===e.status})).length);x||((0,g.get)(e,"officers.".concat(r,".personDetails.contactDetails.email"),null)||(0,g.get)(e,"officers.".concat(r,".isApplicant"),null)||(0,g.get)(e,"officers.".concat(r,".appointments[").concat(i,"].isOutgoing"),null)||!l||(s=zt({},s,{officers:zt({},s.officers,Ht({},r,{personDetails:{contactDetails:{email:"This field is required"}}}))})),(0,g.get)(e,"officers.".concat(r,".isApplicant"),!1)||!(0,g.get)(e,"officers.".concat(r,".personDetails.contactDetails.email"),null)||t.test((0,g.get)(e,"officers.".concat(r,".personDetails.contactDetails.email"),null))||(s=zt({},s,{officers:zt({},s.officers,Ht({},r,{personDetails:{contactDetails:{email:"Invalid email address"}}}))}))),(0,g.get)(e,"officers.".concat(r,".appointments[").concat(i,"].outgoingEmail"),null)&&!t.test((0,g.get)(e,"officers.".concat(r,".appointments[").concat(i,"].outgoingEmail"),null))&&(s=zt({},s,{officers:zt({},s.officers,Ht({},r,{appointments:Ht({},i,{outgoingEmail:"Invalid email address"})}))}
1)),Object.keys(e.officers).forEach((function(t){e.officers[t]._id!==r&&e.officers[t].isApplicant&&Hs.Z.transformToLowerCase((0,g.get)(e,"officers.".concat(r,".personDetails.contactDetails.email"),""))===Hs.Z.transformToLowerCase(null===n||void 0===n?void 0:n.emailAddresses[0])&&(s=zt({},s,{officers:zt({},s.officers,Ht({},t,{personDetails:{contactDetails:{email:"Email already existed"}}})),shareholders:zt({},s.shareholders,Ht({},t,{personDetails:{contactDetails:{email:"Email already existed"}}}))})),e.officers[t]._id!==r&&e.officers[r].isApplicant&&Hs.Z.transformToLowerCase(null===n||void 0===n?void 0:n.emailAddresses[0])===Hs.Z.transformToLowerCase((0,g.get)(e,"officers.".concat(t,".personDetails.contactDetails.email"),""))&&(s=zt({},s,{officers:zt({},s.officers,Ht({},t,{personDetails:{contactDetails:{email:"Email already existed"}}})),shareholders:zt({},s.shareholders,Ht({},t,{personDetails:{contactDetails:{email:"Email already existed"}}}))})),e.officers[t]._id!==r&&(0,g.get)(e,"officers.".concat(t,".personDetails.contactDetails.email"),!1)&&Hs.Z.transformToLowerCase((0,g.get)(e,"officers.".concat(r,".personDetails.contactDetails.email"),null))===Hs.Z.transformToLowerCase((0,g.get)(e,"officers.".concat(t,".personDetails.contactDetails.email"),null))&&(s=zt({},s,{officers:zt({},s.officers,Ht({},t,{personDetails:{contactDetails:{email:"Email already existed"}}})),shareholders:zt({},s.shareholders,Ht({},t,{personDetails:{contactDetails:{email:"Email already existed"}}}))}))}))}})),(0,g.get)(j,"shareholders",[]).length>0&&Object.keys(e.shareholders).forEach((function(t){var r;"INDIVIDUAL"!==(null===(r=null===e||void 0===e?void 0:e.shareholders["".concat(t)])||void 0===r?void 0:r.category)||(0,g.get)(e,"shareholders.".concat(t,".personDetails.contactDetails.email"),null)||(0,g.get)(e,"shareholders.".concat(t,".isApplicant"),null)||x||(s=zt({},s,{shareholders:zt({},s.shareholders,Ht({},t,{personDetails:{contactDetails:{email:"This field is required"}}}))})),Object.keys(e.shareholders).forEach((function(r){e.shareholders[r]._id!==t&&e.shareholders[r].isApplicant&&Hs.Z.transformToLowerCase((0,g.get)(e,"shareholders.".concat(t,".personDetails.contactDetails.email"),null))===Hs.Z.transformToLowerCase(null===n||void 0===n?void 0:n.emailAddresses[0])&&(s=zt({},s,{officers:zt({},s.officers,Ht({},r,{personDetails:{contactDetails:{email:"Email already existed"}}})),shareholders:zt({},s.shareholders,Ht({},r,{personDetails:{contactDetails:{email:"Email already existed"}}}))})),e.shareholders[r]._id!==t&&e.shareholders[t].isApplicant&&Hs.Z.transformToLowerCase(null===n||void 0===n?void 0:n.emailAddresses[0])===Hs.Z.transformToLowerCase((0,g.get)(e,"shareholders.".concat(r,".personDetails.contactDetails.email"),null))&&(s=zt({},s,{officers:zt({},s.officers,Ht({},r,{personDetails:{contactDetails:{email:"Email already existed"}}})),shareholders:zt({},s.shareholders,Ht({},r,{personDetails:{contactDetails:{email:"Email already existed"}}}))})),e.shareholders[r]._id!==t&&"INDIVIDUAL"===e.shareholders[r].category&&(0,g.get)(e,"shareholders.".concat(r,".personDetails.contactDetails.email"),!1)&&Hs.Z.transformToLowerCase((0,g.get)(e,"shareholders.".concat(t,".personDetails.contactDetails.email"),null))===Hs.Z.transformToLowerCase((0,g.get)(e,"shareholders.".concat(r,".personDetails.contactDetails.email"),null))&&(s=zt({},s,{officers:zt({},s.officers,Ht({},r,{personDetails:{contactDetails:{email:"Email already existed"}}})),shareholders:zt({},s.shareholders,Ht({},r,{personDetails:{contactDetails:{email:"Email already existed"}}}))}))}))})),x){for(var r=function(e){var s,t=l[e],r=null===(s=t.appointments)||void 0===s?void 0:s.find((function(e){return"Active"===e.status&&c.UK.includes(e.position)&&!e.isOutgoing&&!O(t)}));(!r||t.agentEkycType||t.isApplicant||"INDIVIDUAL"!==t.category)&&(!r||O(t)||t.isGrofFormFilled)||(i[t._id]="Please provide Personal Information using either Facial Verification or a Notarized Document to proceed.")},a=function(e){var s,t=d[e],r=null===(s=t.appointments)||void 0===s?void 0:s.find((function(e){return"Active"===e.status&&c.Kh.includes(e.position)&&!e.isOutgoing&&"INDIVIDUAL"===t.category&&!t.isApplicant}));r&&!t.agentEkycType?i[t._id]="Please provide Personal Information using either Facial Verification or a Notarized Document to proceed.":!r||O(t)||"INDIVIDUAL"!==t.category||t.isGrofFormFilled||(i[t._id]="Please provide Personal Information using either Facial Verification or a Notarized Document to proceed.")},i={},l=Object.values(e.officers||{}),u=0;u<l.length;u+=1)r(u);for(var d=Object.values(e.shareholders||{}),p=0;p<d.length;p+=1)a(p);Object.keys(i).length>0&&(A("Please provide Personal Information using either Facial Verification or a Notarized Document to proceed.","error"),s.unfilledMember=i)}return(0,g.get)(j,"shareholders",[]).length>
10&&Object.keys(e.shareholders).forEach((function(t){var r;"INDIVIDUAL"===(null===(r=null===e||void 0===e?void 0:e.shareholders["".concat(t)])||void 0===r?void 0:r.category)||(0,g.get)(e,"shareholders.".concat(t,".corporateRepresentativeOf"),null)||(s=zt({},s,{shareholders:zt({},s.shareholders,Ht({},t,{corporateRepresentativeOf:"This field is required"}))}))})),(0,g.get)(j,"shareholders",[]).length>0&&Object.keys(e.shareholders).forEach((function(t){var r;"CORPORATE"===(null===(r=null===e||void 0===e?void 0:e.shareholders["".concat(t)])||void 0===r?void 0:r.category)&&0===(0,g.get)(e,"shareholders.".concat(t,".companyDetails.documents"),[]).length&&(s=zt({},s,{shareholders:zt({},s.shareholders,Ht({},t,"This field is required"))}))})),o(!1),s}(e)},validateOnChange:t,validateOnBlur:!1,enableReinitialize:l,scrollOnError:!0,children:(0,r.jsx)(Kt,{onOpen:E.onOpen,handleOnSave:k,selectedOption:h,listStakeholders:j,setValidate:o})})]})}var Xt=t(41691),Qt=t(19013),$t=t(13882);function Jt(e){(0,$t.Z)(1,arguments);var s=(0,Qt.Z)(e),t=s.getMonth();return s.setFullYear(s.getFullYear(),t+1,0),s.setHours(0,0,0,0),s}var er=t(71002),sr=t(77349),tr=t(11640),rr=t(83946);var or=t(30381),nr=t.n(or),ar=function(e){var s,t,r=(null===e||void 0===e?void 0:e.toUpperCase())||"";return 10===r.length&&/^[C]\d{9}$/.test(r)?(s=r,t=""):9!==r.length&&10!==r.length||!/\b\d{8,9}[A-Z]\b/.test(r)||(t=r,s=""),{acraTransactionId:s,uenSimilarCompany:t}};function ir(e,s,t,r,o,n,a){try{var i=e[n](a),l=i.value}catch(u){return void t(u)}i.done?s(l):Promise.resolve(l).then(r,o)}function lr(e){return function(){var s=this,t=arguments;return new Promise((function(r,o){var n=e.apply(s,t);function a(e){ir(n,r,o,a,i,"next",e)}function i(e){ir(n,r,o,a,i,"throw",e)}a(void 0)}))}}function ur(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function cr(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){ur(e,s,t[s])}))}return e}var dr=function(e){var s,t,r,o,n,i=e.emitter,l=(0,a.useRef)(N.q.getState()).current.setGlobalSnackbar,d=(0,u.SS)(),p=d.companyInformation,f=d.serviceType,h=d.isCompanyNameAppeal,x=(0,y.a)().profileState,v=(0,M.Z)({isHideErrorSnackBar:!0}),j=(0,a.useCallback)((function(e){var s,t,r,o,n,a,i,l,u,d,m,f,x=(null===(s=e.blockHouse)||void 0===s?void 0:s.trim())===c.Rt.blockHouse&&(null===(t=e.streetName)||void 0===t?void 0:t.trim().toUpperCase())===c.Rt.streetName&&(null===(r=e.unit)||void 0===r?void 0:r.trim())===c.Rt.unit&&(null===(o=e.level)||void 0===o?void 0:o.trim())===c.Rt.level&&(null===(n=e.postalCode)||void 0===n?void 0:n.trim())===c.Rt.postalCode&&(e.buildingName||"").trim().toUpperCase()===c.Rt.buildingName,v=(null===(a=e.transactionNoOrUEN)||void 0===a?void 0:a.toUpperCase())||"",y=ar(v),g=y.acraTransactionId,j=y.uenSimilarCompany;e.isSubmitCompanyNameAppeal||(g="",j="");var b={CN06:"IDENTICAL",CN07:"REFERRAL",CN08:"REGULATORY",CN09:"NAME_TOO_SHORT"}[h.code||""],N=e.isUseGrofRegisteredAddress||x;return{company:{companyName:e.companyName,isSubmitCompanyNameAppeal:e.isSubmitCompanyNameAppeal||!1,legalDetails:{fyeDate:e.fyeDate||"",nextFyeDate:nr().utc(e.fyeDate,"DD/MM/YYYY").toISOString()||""},ssic:{primary:{code:e.primarySSIC.value,description:e.primarySSIC.label,otherDescription:e.descriptionPrimarySSIC},secondary:{code:null===(i=e.secondarySSIC)||void 0===i?void 0:i.value,description:null===(l=e.secondarySSIC)||void 0===l?void 0:l.label,otherDescription:e.descriptionSecondarySSIC}},addresses:{registeredAddress:{blockHouse:e.isUseGrofRegisteredAddress?c.Rt.blockHouse:e.blockHouse,buildingName:e.buildingName,level:e.isUseGrofRegisteredAddress?c.Rt.level:e.level,unit:e.isUseGrofRegisteredAddress?c.Rt.unit:e.unit,postalCode:e.isUseGrofRegisteredAddress?c.Rt.postalCode:e.postalCode,streetName:e.isUseGrofRegisteredAddress?c.Rt.streetName:e.streetName},isUseGrofRegisteredAddress:N,isSameBusinessAddress:!N&&!!(null===p||void 0===p||null===(u=p.data)||void 0===u||null===(d=u.data)||void 0===d||null===(m=d.company)||void 0===m||null===(f=m.addresses)||void 0===f?void 0:f.isSameBusinessAddress)},acraTransactionId:g,uenSimilarCompany:j,companyNameIssue:{keyword:e.companyNameKeyword,issue:b}}}}),[null===p||void 0===p||null===(s=p.data)||void 0===s||null===(t=s.data)||void 0===t||null===(r=t.company)||void 0===r||null===(o=r.addresses)||void 0===o?void 0:o.isSameBusinessAddress,h]),b=(0,a.useCallback)((function(e){var s,t,r,o=(null===p||void 0===p||null===(s=p.temporaryData)||void 0===s?void 0:s.company)||{},n=(null===p||void 0===p||null===(t=p.data)||void 0===t||null===(r=t.data)||void 0===r?void 0:r.organizationId)||"",a=cr({},j(e),{currentStep:1}),u=(0,g.get)(p,"data.data._id","");return i.emit("@set-is-page-loading",!0),v.put("/kyb/application/".concat(u),a).then(lr(U().mark((function e(s){var t,r,a,u,c;return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("OK"!==(null===s||void 0===s?void 0:s.status)){e.next=8;break}return a=o.companyName,u=null===(t=o.legalDetails)||void 0===t?void 0:t.uen,c=null===(r=o.legalDetails)||void 0===r?void 0:r.countryOfRegisteredBusiness,a||u||c?v.put("/organization/".concat(n),{companyName:a,freemiumDetails:{registrationCountry:c,uen:u}}).then((function(){l("Successfully saved the progress","success")})).finally((function(){i.emit("@set-is-page-loading",!1)})):(l("Successfully saved the progress","success"),i.emit("@set-is-page-loading",!1)),null===p||void 0===p||p.mutate(),e.abrupt("return",i.emit("@stepper",1));case 8:throw i.emit("@set-is-page-loading",!1),l("Something went wrong","error"),new Error("Something went wrong");case 11:case"end":return e.stop()}}),e)})))).catch((function(e){throw i.emit("@set-is-page-loading",!1),l(e.message,"error"),e}))}),[j,p,i,v,l]),C=(0,a.useCallback)((function(){return p.mutate(),i.emit("@stepper",0)}),[p,i]),D=(0,a.useCallback)((function(e){var s,t,r,o=(null===p||void 0===p||null===(s=p.temporaryData)||void 0===s?void 0:s.company)||{},n=(null===p||void 0===p||null===(t=p.data)||void 0===t||null===(r=t.data)||void 0===r?void 0:r.organizationId)||"",a=cr({},j(e),{currentStep:2}),u=(0,g.get)(p,"data.data._id","");return i.emit("@set-is-page-loading",!0),v.put("/kyb/application/".concat(u),a).then(lr(U().mark((function e(s){var t,r,u,c,d,h,y;return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("OK"!==(null===s||void 0===s?void 0:s.status)){e.next=8;break}return d=o.companyName,h=null===(t=o.legalDetails)||void 0===t?void 0:t.uen,y=null===(r=o.legalDetails)||void 0===r?void 0:r.countryOfRegisteredBusiness,Z.Z.track("Company Information",{userID:x.userId,email:null===(u=x.profile)||void 0===u?void 0:u.emailAddresses[0],organizationID:s.data.organizationId,organizationName:null===a||void 0===a||null===(c=a.company)||void 0===c?void 0:c.companyName,serviceType:f,completedAt:(0,m.gS)(),deviceType:"Web"}),d||h||y?v.put("/organization/".concat(n),{companyName:d,freemiumDetails:{registrationCountry:y,uen:h}}).then((function(){p.mutate(),l("Successfully saved the progress","success")})).finally((function(){i.emit("@set-is-page-loading",!1)})):(p.mutate(),l("Successfully saved the progress","success"),i.emit("@set-is-page-loading",!1)),e.abrupt("return",i.emit("@stepper",2));case 8:throw i.emit("@set-is-page-loading",!1),l("Something went wrong","error"),new Error("Something went wrong");case 11:case"end":return e.stop()}}),e)})))).catch((function(e){throw i.emit("@set-is-page-loading",!1),l(e.message,"error"),e}))}),[p,j,i,v,l,x.userId,null===(n=x.profile)||void 0===n?void 0:n.emailAddresses,f]),w=(0,a.useCallback)(lr(U().mark((function e(s,t,r){var o,n,a,u,c,d;return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i.emit("@set-is-page-loading",!0),o=cr({},r,{isCompanyNameChecked:!0}),!1,e.next=5,v.get("/general/acra/name-search?companyName=".concat(encodeURIComponent(s)).concat(""));case 5:"ERROR"===(n=e.sent).status?(i.emit("@set-is-company-name-appeal",{status:!0,message:n.message,code:n.code}),a="",["CN06","CN07","CN08"].includes(n.code)&&(u=n.message,c=/"([^"]+)"/,(d=u.match(c))&&(a=d[1])),t(cr({},o,{isSubmitCompanyNameAppeal:!1,companyNameKeyword:a})),i.emit("@set-is-page-loading",!1)):(i.emit("@set-is-company-name-appeal",{status:!1,message:"",code:""}),t(cr({},o,{isSubmitCompanyNameAppeal:!1,companyNameKeyword:"",uenSimilarCompany:"",acraTransactionId:""})),l("Success! The company name is available for registration.","success"),i.emit("@set-is-page-loading",!1));case 7:case"end":return e.stop()}}),e)}))),[v,i,l]),k=(0,a.useCallback)(lr(U().mark((function e(s,t,r){var o,n,a;return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=(null===r||void 0===r||null===(o=r.target)||void 0===o?void 0:o.selectionStart)||1,s(cr({},t,{companyName:null===(n=null===r||void 0===r?void 0:r.target.value)||void 0===n?void 0:n.toUpperCase(),isCompanyNameChecked:!1}
1)).then((function(){r.target.setSelectionRange(a,a)}));case 3:case"end":return e.stop()}}),e)}))),[]);return{handleOnBack:C,handleOnSave:b,handleOnNext:D,handleOnChecked:(0,a.useCallback)((function(e){return i.emit("@set-reg-address",e)}),[i]),handleOnCheckCompanyName:w,handleOnChangeCompanyName:k}};function pr(e,s,t,r,o,n,a){try{var i=e[n](a),l=i.value}catch(u){return void t(u)}i.done?s(l):Promise.resolve(l).then(r,o)}var mr=function(e){var s=e.emitter,t=(0,a.useRef)(N.q.getState()).current.setGlobalSnackbar,r=(0,K.Z)(),o=(0,u.SS)().companyInformation,n=(0,a.useMemo)((function(){var e,s;return null===o||void 0===o||null===(e=o.data)||void 0===e||null===(s=e.data)||void 0===s?void 0:s._id}),[o]),i=(0,M.Z)(),l=(0,a.useCallback)((function(){var e,r={applicationId:n};return s.emit("@set-is-company-name-appeal",{status:!1,message:"",code:""}),i.post("kyb/core/discard-company-info",r).then((e=U().mark((function e(r){return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("OK"!==(null===r||void 0===r?void 0:r.status)){e.next=8;break}return o.mutate(),t("Successfully discarded the process.","info"),s.emit("@set-is-acra-error",!1),s.emit("@select-option",{key:"incorporation",value:!1}),s.emit("@select-option",{key:"corpSec",value:!1}),s.emit("@select-option",{key:"finance",value:!1}),e.abrupt("return",s.emit("@stepper",0));case 8:return t("Something went wrong","error"),e.abrupt("return",r);case 10:case"end":return e.stop()}}),e)})),function(){var s=this,t=arguments;return new Promise((function(r,o){var n=e.apply(s,t);function a(e){pr(n,r,o,a,i,"next",e)}function i(e){pr(n,r,o,a,i,"throw",e)}a(void 0)}))})).catch((function(e){t(e.message,"error")}))}),[n,i,t,o,s]);return(0,a.useEffect)((function(){return s.on("@modal/confirm",r.onToggle),function(){s.off("@modal/confirm",r.onToggle)}}),[r.onToggle,s]),{handleOnConfirm:l,confirmationModal:r}};function fr(){return(0,r.jsx)("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.5 1C6.425 1 1.5 5.925 1.5 12C1.5 18.075 6.425 23 12.5 23C18.575 23 23.5 18.075 23.5 12C23.5 5.925 18.575 1 12.5 1ZM13.5 7C13.5 6.73478 13.3946 6.48043 13.2071 6.29289C13.0196 6.10536 12.7652 6 12.5 6C12.2348 6 11.9804 6.10536 11.7929 6.29289C11.6054 6.48043 11.5 6.73478 11.5 7V13C11.5 13.2652 11.6054 13.5196 11.7929 13.7071C11.9804 13.8946 12.2348 14 12.5 14C12.7652 14 13.0196 13.8946 13.2071 13.7071C13.3946 13.5196 13.5 13.2652 13.5 13V7ZM13.5 16.5C13.5 16.2348 13.3946 15.9804 13.2071 15.7929C13.0196 15.6054 12.7652 15.5 12.5 15.5C12.2348 15.5 11.9804 15.6054 11.7929 15.7929C11.6054 15.9804 11.5 16.2348 11.5 16.5V17C11.5 17.2652 11.6054 17.5196 11.7929 17.7071C11.9804 17.8946 12.2348 18 12.5 18C12.7652 18 13.0196 17.8946 13.2071 17.7071C13.3946 17.5196 13.5 17.2652 13.5 17V16.5Z",fill:"#E3930F"})})}var hr=t(12829);function xr(){var e,s,t=(e=["\n .react-calendar__navigation button:enabled:hover,\n .react-calendar__navigation button:enabled:focus {\n background-color: #fb8110;\n color: #ffffff;\n }\n .react-calendar__navigation {\n background: #fb8110;\n color: #ffffff;\n font-style: normal;\n font-weight: 700;\n font-size: 16px;\n line-height: 150%;\n padding: 10px;\n border-radius: 16px 16px 0px 0px;\n display: flex;\n\n .react-calendar__navigation__label {\n font-weight: bold;\n }\n\n .react-calendar__navigation__arrow {\n flex-grow: 0.333;\n :disabled {\n background: none;\n }\n }\n }\n\n .react-calendar__month-view__weekdays {\n text-align: center;\n text-transform: uppercase;\n font-style: normal;\n font-weight: 400;\n font-size: 10px;\n color: rgba(135, 135, 135, 0.75);\n padding-top: 5px;\n margin-bottom: -5px;\n text-decoration: none !important;\n }\n\n abbr:where([title]) {\n text-decoration: none;\n }\n\n .react-calendar__month-view__days {\n padding: 10px;\n font-size: 12px !important;\n color: #434343;\n }\n\n .react-calendar__month-view__days button {\n padding: 10px;\n }\n\n .react-calendar__tile {\n color: #434343;\n border-radius: 50%;\n\n &:disabled {\n background: none;\n color: #e6e6e6;\n }\n\n &--now {\n background: none;\n\n &--hasActive {\n &:hover {\n background: #fb8110;\n }\n\n &:focus {\n background: #fffff;\n }\n }\n }\n }\n\n .react-calendar__month-view__days__day--neighboringMonth {\n // max-width: 100%;\n padding: 10px 6.6667px;\n background: none;\n text-align: center;\n line-height: 16px;\n color: rgba(135, 135, 135, 0.5);\n }\n\n .react-calendar__tile--active {\n background: #fb8010;\n color: #ffffff !important;\n // border-radius: 50%;\n width: 40px;\n height: 40px;\n }\n\n .react-calendar__tile--active:enabled:hover,\n .react-calendar__tile--active:enabled:focus {\n background: #fb8010;\n }\n\n .react-calendar {\n border: none;\n }\n"],s||(s=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(s)}})));return xr=function(){return t},t}var vr=t(85444).default.div(xr()),yr=function(e){var s=e.isOpen,t=void 0!==s&&s,o=e.onClose,n=e.setFieldValue,i=e.name,l=(0,a.useState)(e.value),u=l[0],c=l[1],d=(0,a.useCallback)((function(e){return!Number.isNaN(e.getTime())}),[]),p=Jt((0,tr.Z)(new Date,6)),m=Jt((0,tr.Z)(new Date,18));return(0,r.jsx)(r.Fragment,{children:t?(0,r.jsx)("div",{className:"sprout-absolute sprout-flex sprout-flex-col sprout-justify-center sprout-z-[200] sprout-pb-5",children:(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-justify-center sprout-items-center sprout-w-full",children:(0,r.jsxs)("div",{className:"sprout-bg-white sprout-shadow-card",children:[(0,r.jsx)(vr,{children:(0,r.jsx)(hr.Z,{closeCalendar:!1,onChange:function(e){t&&c(e)},next2Label:null,prev2Label:null,className:"sprout-relative sprout-w-80 sprout-h-70 sprout-text-sm sprout-text-center sprout-left-0 sprout-right-0 sprout-border-white",value:d(u)?u:new Date,defaultValue:new Date,minDate:p,maxDate:m})}),(0,r.jsxs)("div",{className:"sprout-flex sprout-items-center sprout-justify-between sprout-gap-2 sprout-bg-white sprout-rounded-b-[10px] sprout-p-1",children:[(0,r.jsx)(D.iR,{
1className:"sprout-flex sprout-justify-center sprout-w-full",tertiary:!0,onClick:function(){o()},children:"Cancel"}),(0,r.jsx)(D.iR,{className:"sprout-flex sprout-justify-center sprout-w-full",primary:!0,disabled:!u,onClick:function(){t&&(n(i,(0,J.Z)(new Date(u),"dd/MM/yyyy")),o())},children:"Proceed"})]})]})})}):null})};function gr(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function jr(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){gr(e,s,t[s])}))}return e}function br(){var e,s=(0,w.useFormikContext)(),t=s.values,o=s.setFieldValue,n=s.setValues,i=s.errors,l=(0,u.SS)(),c=l.emitter,d=l.generalSSIC,p=l.isCompanyNameAppeal,m=dr({emitter:c}),f=m.handleOnCheckCompanyName,h=m.handleOnChangeCompanyName,x=(0,K.Z)(),v=(0,g.get)(d,"data.data",[]),y=(0,a.useCallback)((function(e,s){if(!e)return new Date;var t=5===e.length?"dd/MM":"dd/MM/yyyy";try{var r=(0,Xt.Z)(e,t,s);return Number.isNaN(r.getTime())?new Date:r}catch(o){return new Date}}),[]),j=(0,a.useRef)(!1),N=null===(e=t.postalCode)||void 0===e?void 0:e.trim(),C=y(t.fyeDate,new Date),k=(0,a.useMemo)((function(){var e,s,r=(null===(e=t.transactionNoOrUEN)||void 0===e?void 0:e.toUpperCase())||"";return 10===(null===(s=ar(r).uenSimilarCompany)||void 0===s?void 0:s.length)}),[t.transactionNoOrUEN]);return(0,a.useEffect)((function(){"048762"!==N||t.isUseGrofRegisteredAddress||j.current||(n(jr({},t,{isUseGrofRegisteredAddress:!0})),j.current=!0),""===N&&(j.current=!1)}),[t.postalCode,t.isUseGrofRegisteredAddress,n,N,t]),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-8",children:[(0,r.jsxs)("div",{className:"sprout-flex- sprout-flex-col",children:[(0,r.jsx)("h3",{className:"sprout-text-base sprout-font-semibold",children:"Company Name"}),(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Please enter the name of your company as you'd like it to appear, without including the business entity type such as 'Pte' or 'Ltd'. We'll add that for you."}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2 md:sprout-flex-row sprout-w-full sprout-mt-9",children:[(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col md:sprout-flex-col sprout-w-full sprout-mt-2",children:(0,r.jsxs)("div",{className:"sprout-relative",children:[(0,r.jsx)(w.Field,{name:"companyName",placeholder:"Enter Company Name",className:"sprout-w-full sprout-flex-row sprout-leading-5 sprout-text-[#434343] sprout-outline-none sprout-border-b sprout-border-b-[#979797] sprout-h-full sprout-bg-white sprout-p-2 sprout-rounded focus:sprout-border-b-[#FB8110] disabled:sprout-bg-[#f1f1f1] disabled:sprout-text-[#999999]",autoFocus:!0,onChange:function(e){h(n,t,e)}}),(0,r.jsx)("div",{className:"sprout-absolute sprout-inset-y-0 sprout-end-0 sprout-flex sprout-items-center sprout-pointer-events-none sprout-z-20 sprout-pe-4",children:(0,r.jsx)("span",{className:"sprout-text-[#C4C4C4]
1sprout-font-semibold sprout-text-base",children:"PTE. LTD."})})]})}),(0,r.jsx)("div",{className:"sprout-mt-0",children:(0,r.jsx)(D.iR,{primary:!0,className:"sprout-mt-2 md:sprout-mt-0 md:sprout-ml-2.5 sprout-w-max",onClick:function(){return f(t.companyName,n,t)},children:"Check Availability"})})]}),i.companyName?(0,r.jsx)("p",{className:"sprout-text-red-500 sprout-text-xs","data-id":"error-for-companyName",children:i.companyName}):p.status&&(0,r.jsx)("p",{className:"sprout-text-red-500 sprout-text-xs",children:p.message}),p.status&&["CN06"].includes(p.code)&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-gap-1 sprout-mt-2",children:(0,r.jsxs)("div",{className:"checkbox-container mb-2",children:[(0,r.jsx)(w.Field,{type:"checkbox",name:"isSubmitCompanyNameAppeal",onChange:function(){n(jr({},t,{isSubmitCompanyNameAppeal:!t.isSubmitCompanyNameAppeal,isCompanyNameChecked:!0}))}}),(0,r.jsx)("label",{htmlFor:"is-business-owner",children:(0,r.jsx)("div",{className:"checkbox-label sprout-text-sm md:sprout-text-base",children:"I am the sole proprietor or I have reserved the name"})})]})}),t.isSubmitCompanyNameAppeal?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575] sprout-ml-[24px]",children:"Please key in the UEN of the identical name entity or the Transaction number if you have reserved the name with ACRA."}),(0,r.jsxs)("div",{className:"sprout-ml-[24px]",children:[(0,r.jsx)(w.Field,{placeholder:"Enter UEN or Transaction No.",name:"transactionNoOrUEN",className:"sprout-w-full sprout-flex-row sprout-leading-5 sprout-text-[#434343] sprout-outline-none sprout-border-b sprout-border-b-[#979797] sprout-h-full sprout-bg-white sprout-p-2 sprout-rounded focus:sprout-border-b-[#FB8110] disabled:sprout-bg-[#f1f1f1] disabled:sprout-text-[#999999]",onChange:function(e){var s,r=e.target.selectionStart;n(jr({},t,{transactionNoOrUEN:null===(s=e.target.value)||void 0===s?void 0:s.toUpperCase()})).then((function(){var s;null===(s=e.target)||void 0===s||s.setSelectionRange(r,r)}))}}),i.transactionNoOrUEN&&(0,r.jsx)("p",{className:"sprout-text-red-500 sprout-text-xs","data-id":"error-for-transactionNoOrUEN",children:i.transactionNoOrUEN})]}),k&&(0,r.jsxs)("div",{className:"sprout-flex sprout-w-full sprout-bg-[#FFF6E7] sprout-justify-start sprout-items-center sprout-p-2 sprout-pl-4 sprout-gap-2 sprout-rounded-xl sprout-ml-[24px] sprout-mt-[16px]",children:[(0,r.jsx)(fr,{}),(0,r.jsx)("span",{className:"sprout-text-[#E3930F] sprout-text-sm sprout-font-semibold",children:"Please note that the incorporation may take an additional 14-60 days due to ACRA\u2019s name appeal process"})]})]}):(0,r.jsxs)("div",{className:"sprout-flex sprout-w-full sprout-bg-[#FFF6E7] sprout-justify-start sprout-items-center sprout-p-2 sprout-pl-4 sprout-gap-2 sprout-rounded-xl sprout-ml-[24px]",children:[(0,r.jsx)(fr,{}),(0,r.jsx)("span",{className:"sprout-text-[#E3930F] sprout-text-sm sprout-font-semibold",children:"If you decide to proceed, the name appeal process will take 14-60 days. We suggest you choose another company name."})]})]})]}),(0,r.jsxs)("div",{className:"sprout-flex- sprout-flex-col",children:[(0,r.jsx)("h3",{className:"sprout-text-base sprout-font-semibold",children:"Financial Year End"}),(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"This is the final day of the company's accounting period. We typically recommend 11 months from your month of incorporation on the last day of the month to maximize tax benefits."}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(b.Z.inputWithError,{name:"fyeDate",placeholder:"DD/MM/YYYY",containerClass:"sprout-w-full sprout-flex-row",errorClass:"sprout-text-red-500 sprout-text-xs sprout-w-full",onClick:x.onOpen}),(0,r.jsx)("div",{className:"sprout-absolute sprout-inset-y-0 sprout-end-0 sprout-flex sprout-items-center sprout-pointer-events-none sprout-z-20 sprout-pe-4",children:(0,r.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"M12.6667 2.66699H3.33333C2.59695 2.66699 2 3.26395 2 4.00033V13.3337C2 14.07 2.59695 14.667 3.33333 14.667H12.6667C13.403 14.667 14 14.07 14 13.3337V4.00033C14 3.26395 13.403 2.66699 12.6667 2.66699Z",stroke:"#757575",strokeWidth:"1.33",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M10.667 1.33301V3.99967",stroke:"#757575",strokeWidth:"1.33",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M5.33301 1.33301V3.99967",stroke:"#757575",strokeWidth:"1.33",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M2 6.66699H14",stroke:"#757575",strokeWidth:"1.33",strokeLinecap:"round",strokeLinejoin:"round"})]})})]}),(0,r.jsx)(yr,{name:"fyeDate",value:C,isOpen:x.isOpen,onClose:x.onClose,setFieldValue:o})]})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col",children:[(0,r.jsx)("h3",{className:"sprout-text-base sprout-font-semibold",children:"Business Activity"}),(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575] sprout-mb-4",children:"Define your company's primary business activity. Use specific keywords that accurately describe what your company does. You may select up to 2 relevant business activities."}),(0,r.jsxs)("div",{className:"sprout-mb-4",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Primary SSIC"]}),(0,r.jsx)(b.Z.select2,{name:"primarySSIC",placeholder:"Select Primary SSIC",options:v.map((function(e){var s=Object.keys(e)[0];return{label:"".concat(s," - ").concat(e[s]),value:s}}))})]}),(0,r.jsxs)("div",{className:"sprout-mb-8",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"Description of Primary SSIC"}),(0,r.jsx)(b.Z.inputWithError,{name:"descriptionPrimarySSIC",placeholder:"Enter Description",maxLength:78}),(0,r.jsxs)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:[t.descriptionPrimarySSIC.length,"/78"]})]}),(0,r.jsxs)("div",{className:"sprout-mb-4",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"Secondary SSIC"}),(0,r.jsx)(b.Z.select2,{name:"secondarySSIC",placeholder:"Select Secondary SSIC",options:v.filter((function(e){return Object.keys(e)[0]!==t.primarySSIC.value})).map((function(e){var s=Object.keys(e)[0];return{label:"".concat(s," - ").concat(e[s]),value:s}})),isClearable:!0})]}),(0,r.jsxs)("div",{className:"sprout-mb-4",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"Description of Secondary SSIC"}),(0,r.jsx)(b.Z.inputWithError,{name:"descriptionSecondarySSIC",placeholder:"Enter Description",maxLength:78}),(0,r.jsxs)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:[t.descriptionSecondarySSIC.length,"/78"]})]})]}),(0,r.jsxs)("div",{className:"sprout-flex- sprout-flex-col sprout-sp
1ace-y-4",children:[(0,r.jsx)("h3",{className:"sprout-text-base sprout-font-semibold",children:"Company's Registered Address"}),(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Please provide the official registered address for your company. This address will be used for official notifications and correspondence."}),(0,r.jsxs)("div",{className:"sprout-flex",children:[(0,r.jsxs)("label",{className:"sprout-inline-flex sprout-cursor-pointer",children:[(0,r.jsx)("input",{type:"checkbox",className:"sprout-sr-only sprout-peer",checked:t.isUseGrofRegisteredAddress,onChange:function(){var e=!t.isUseGrofRegisteredAddress;n(jr({},t,{isUseGrofRegisteredAddress:e,postalCode:e?t.postalCode:""}))}}),(0,r.jsx)("div",{className:"sprout-relative sprout-w-11 sprout-h-6 sprout-bg-gray-200 peer-focus:sprout-outline-none peer-focus:sprout-ring-4 peer-focus:sprout-ring-orange-300 sprout-rounded-full peer peer-checked:after:sprout-translate-x-full rtl:peer-checked:after:-sprout-translate-x-full peer-checked:after:sprout-border-white after:sprout-content-[''] after:sprout-absolute after:sprout-top-[2px] after:sprout-start-[2px] after:sprout-bg-white after:sprout-border-gray-300 after:sprout-border after:sprout-rounded-full after:sprout-h-5 after:sprout-w-5 after:sprout-transition-all peer-checked:sprout-bg-orange-600"})]}),(0,r.jsxs)("div",{className:"sprout-ml-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"Use Grof\u2019s Registered Address"}),(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:"Use Grof's address for all official correspondence and records relating to your company."})]})]}),!t.isUseGrofRegisteredAddress&&(0,r.jsxs)("div",{className:"sprout-grid sprout-grid-cols-1 md:sprout-grid-cols-2 sprout-gap-4",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Block / House No"]}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. 123",name:"blockHouse"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Street Name"]}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. Orchard Road",name:"streetName"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"Level No"}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. 05",name:"level"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"Unit No"}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. 01",name:"unit"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"Building Name"}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g Orchard Towers",name:"buildingName"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Postal Code"]}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. 018956",name:"postalCode"})]})]})]})]})}var Nr=function(){var e=(0,w.useFormikContext)(),s=e.values,t=e.isValid,o=(0,u.SS)(),n=o.emitter,a=o.isACRAError,i=dr({emitter:n}).handleOnSave;return(0,r.jsx)(D.iR,{disabled:!t&&!a,secondary:!0,onClick:function(){return i(s)},children:"Save"})},Cr=function(e){var s=e.setValidate,t=(0,w.useFormikContext)().isValid,o=(0,u.SS)().isACRAError,n=function(){return!t&&!o};return(0,r.jsxs)(D.iR,{primary:!0,disabled:n(),type:"submit",onClick:function(){return s(!0)},children:["Next Step"," ",(0,r.jsx)(Q.$e,{className:{svg:"sprout-ml-2",stroke:n()?"#8E8E8E":"#FFFFFF"}})]})},Dr=function(){var e,s,t,o,n,i,l,c,d,p=(0,u.SS)(),m=p.emitter,f=p.companyInformation,h=p.generalSSIC,x=p.isCompanyNameAppeal,v=dr({emitter:m}).handleOnNext,y=(0,a.useState)(!1),j=y[0],D=y[1],w=(0,g.get)(f,"data.data",{}),k=(0,g.get)(h,"data.data",[]),O=mr({emitter:m}),A=O.confirmationModal,S=O.handleOnConfirm,E=(0,a.useRef)(N.q.getState()).current.setGlobalSnackbar,P=(0,g.get)(w,"company.ssic.primary.code",""),T=(0,g.get)(w,"company.ssic.secondary.c
1ode",""),I=(0,g.get)(w,"company.legalDetails.fyeDate",""),F=(0,a.useCallback)((function(e,s){if(!e)return 0;var t=5===e.length?"dd/MM":"dd/MM/yyyy";try{var r=(0,Xt.Z)(e,t,s);return Number.isNaN(r.getTime())?0:r}catch(o){return 0}}),[]),R=F(I,new Date),L=k.find((function(e){var s=Object.keys(e)[0];return P===s})),_=k.find((function(e){var s=Object.keys(e)[0];return T===s}));if(L){var B=Object.keys(L)[0];c={value:B,label:"".concat(B," - ").concat(L[B])}}if(_){var V=Object.keys(_)[0];d={value:V,label:"".concat(V," - ").concat(_[V])}}var U=Jt(function(e,s){if((0,$t.Z)(2,arguments),!s||"object"!==(0,er.Z)(s))return new Date(NaN);var t=s.years?(0,rr.Z)(s.years):0,r=s.months?(0,rr.Z)(s.months):0,o=s.weeks?(0,rr.Z)(s.weeks):0,n=s.days?(0,rr.Z)(s.days):0,a=s.hours?(0,rr.Z)(s.hours):0,i=s.minutes?(0,rr.Z)(s.minutes):0,l=s.seconds?(0,rr.Z)(s.seconds):0,u=(0,Qt.Z)(e),c=r||t?(0,tr.Z)(u,r+12*t):u,d=n||o?(0,sr.Z)(c,n+7*o):c,p=1e3*(l+60*(i+60*a));return new Date(d.getTime()+p)}(new Date,{months:11})),M=(0,a.useCallback)((function(e){var s,t,r={};if(e.isCompanyNameChecked||(r.companyName="Please check availability of the company name"),e.companyName||(r.companyName="This field is required"),"CN06"===x.code&&(null===(s=x.message)||void 0===s?void 0:s.toLowerCase().includes("temasek"))&&(r.companyName='The use of the word "Temasek" is restricted. Please choose another name.'),e.companyNameKeyword&&"CN06"===x.code&&!e.isSubmitCompanyNameAppeal&&(r.isSubmitCompanyNameAppeal="You must confirm you are the sole proprietor or have reserved the name."),e.isSubmitCompanyNameAppeal&&!(null===(t=e.transactionNoOrUEN)||void 0===t?void 0:t.trim())&&(r.transactionNoOrUEN="UEN or Transaction No. is required"),e.transactionNoOrUEN){var o=ar(e.transactionNoOrUEN);o.acraTransactionId||o.uenSimilarCompany||(r.transactionNoOrUEN="Invalid UEN or transaction number format. Please check the UEN or transaction number and try again.")}if(e.companyName?/temasek/i.test(e.companyName)&&(r.companyName='The company name you have entered contains "Temasek", which is a restricted term. Please remove "Temasek" from your company name.'):r.companyName="This field is required",e.fyeDate){var n=new Date;n.setHours(0,0,0,0);var a=F(e.fyeDate,new Date);a||(r.fyeDate="This field is required")}else r.fyeDate="This field is required";return 0===e.primarySSIC.length&&(r.primarySSIC="This field is required"),e.isUseGrofRegisteredAddress||(e.blockHouse||(r.blockHouse="This field is required"),e.streetName||(r.streetName="This field is required"),e.postalCode||(r.postalCode="This field is required")),Object.keys(r).length>0&&!j&&E("Please fill the required fields","error"),r}),[F,E,j,x]),Z={companyName:(0,g.get)(w,"company.companyName",""),isSubmitCompanyNameAppeal:(0,g.get)(w,"company.isSubmitCompanyNameAppeal",""),fyeDate:I?(0,J.Z)(R,"dd/MM/yyyy"):(0,J.Z)(U,"dd/MM/yyyy"),primarySSIC:null!==c&&void 0!==c?c:[],descriptionPrimarySSIC:(0,g.get)(w,"company.ssic.primary.otherDescription",""),secondarySSIC:null!==d&&void 0!==d?d:[],descriptionSecondarySSIC:(0,g.get)(w,"company.ssic.secondary.otherDescription",""),blockHouse:(0,g.get)(w,"company.addresses.registeredAddress.blockHouse",""),buildingName:(0,g.get)(w,"company.addresses.registeredAddress.buildingName",""),level:(0,g.get)(w,"company.addresses.registeredAddress.level",""),unit:(0,g.get)(w,"company.addresses.registeredAddress.unit",""),postalCode:(0,g.get)(w,"company.addresses.registeredAddress.postalCode",""),streetName:(0,g.get)(w,"company.addresses.registeredAddress.streetName",""),isUseGrofRegisteredAddress:(0,g.get)(w,"company.addresses.isUseGrofRegisteredAddress",""),isCompanyNameChecked:(0,g.get)(w,"company.companyName",!1),transactionNoOrUEN:(null===(e=w)||void 0===e||null===(s=e.company)||void 0===s?void 0:s.acraTransactionId)||(null===(t=w)||void 0===t||null===(o=t.company)||void 0===o?void 0:o.uenSimilarCompany),companyNameKeyword:null===(n=w)||void 0===n||null===(i=n.company)||void 0===i||null===(l=i.companyNameIssue)||void 0===l?void 0:l.keyword};return(0,a.useEffect)((function(){setTimeout((function(){var e,s,t,r,o;"IDENTICAL"===(null===(e=w)||void 0===e||null===(s=e.company)||void 0===s||null===(t=s.companyNameIssue)||void 0===t?void 0:t.issue)&&m.emit("@set-is-company-name-appeal",{status:!0,message:'The proposed name is identical to "'.concat(null===(o=null===(r=w)||void 0===r?void 0:r.company.companyNameIssue)||void 0===o?void 0:o.keyword,"\". Please choose another name unless you're the business owner of the company or have reserved the company name with ACRA."),code:"CN06"})}),1e3)}),[]),(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)(C.Z,{open:A.isOpen,title:"Are you sure to discard this process?",okText:"Discard",okVariant:"primary",cancelVariant:"secondary",okRed:!0,onOk:S,onCancel:A.onClose,children:(0,r.jsx)("p",{className:"sprout-text-sm sprout-pt-4 sprout-pb-6 sprout-px-3",children:"This action will discard all inputted data, and it cannot be undone"})}),(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col",children:(0,r.jsxs)(b.Z.form,{onSubmit:v,validation:M,initialValues:Z,validateOnChange:j,validateOnBlur:j,scrollOnError:!0,
1children:[(0,r.jsx)(br,{}),(0,r.jsxs)("div",{className:"sprout-flex sprout-justify-end sprout-space-x-6 sprout-mt-8",children:[(0,r.jsx)(Nr,{}),(0,r.jsx)(Cr,{setValidate:D})]}),(0,r.jsxs)("p",{className:"sprout-mt-6",children:["If you wish to discard the existing onboarding process or start a new one,",(0,r.jsx)("span",{className:"sprout-ml-2 sprout-font-semibold sprout-text-[#960F21] sprout-cursor-pointer",onClick:A.onOpen,children:"click here"})]})]})})]})};function wr(e,s,t,r,o,n,a){try{var i=e[n](a),l=i.value}catch(u){return void t(u)}i.done?s(l):Promise.resolve(l).then(r,o)}function kr(e){return function(){var s=this,t=arguments;return new Promise((function(r,o){var n=e.apply(s,t);function a(e){wr(n,r,o,a,i,"next",e)}function i(e){wr(n,r,o,a,i,"throw",e)}a(void 0)}))}}function Or(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function Ar(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){Or(e,s,t[s])}))}return e}function Sr(e){return function(e){if(Array.isArray(e)){for(var s=0,t=new Array(e.length);s<e.length;s++)t[s]=e[s];return t}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var Er=function(e){var s,t=e.emitter,r=(0,u.SS)(),o=r.companyInformation,n=r.serviceType,i=(0,M.Z)(),l=(0,a.useRef)(N.q.getState()).current.setGlobalSnackbar,c=(0,y.a)().profileState,d=c.profile,p=(0,a.useCallback)((function(e){var s={officers:[],shareholders:[]};Object.keys(e.officers).forEach((function(t){s.officers.push(e.officers[t])})),Object.keys(e.shareholders).forEach((function(t){s.shareholders.push(e.shareholders[t])}));var t=Sr(s.officers).concat(Sr(s.shareholders)).map((function(e){var s,t,r,o,n,a,i,l,u,c,d,p=e;""===(null===(s=p.personDetails)||void 0===s||null===(t=s.contactDetails)||void 0===t?void 0:t.email)&&delete p.personDetails.contactDetails.email;var m=[];(null===(r=p.personDetails)||void 0===r?void 0:r.documents)&&(p.personDetails.documents.forEach((function(e){m.push({id:e._id||e.id,type:e.fileType||e.type})})),p.personDetails.documents=m);var f,h,x=p.corporateRepresentativeOf;((null===(o=x)||void 0===o?void 0:o.value)&&(x=x.value),null===x&&(x=""),(null===(n=p.personDetails)||void 0===n||null===(a=n.personalDetails)||void 0===a?void 0:a.alias)&&(p.personDetails.personalDetails.alias=p.personDetails.personalDetails.alias.filter((function(e){return!!e}))),p.personDetails)&&(p.personDetails.createdAt=void 0,p.personDetails.updatedAt=void 0,p.personDetails._id=void 0,p.personDetails.__v=void 0,p.personDetails.isMatchWithUser=void 0,p.personDetails.kycStatus=void 0,(null===(f=p.personDetails.address)||void 0===f?void 0:f.postcode)&&(p.personDetails.address.postalCode=p.personDetails.address.postcode,p.personDetails.address.postcode=void 0),(null===(h=p.personDetails.personalDetails)||void 0===h?void 0:h.idDocument)&&(p.personDetails.personalDetails.idDocument.dateOfIssuance=p.personDetails.personalDetails.idDocument.dateOfIssuance||void 0),p.personDetails.personalDetails&&(p.personDetails.personalDetails.gender=p.personDetails.personalDetails.gender||void 0,p.personDetails.personalDetails.countryOfBirth=p.personDetails.personalDetails.countryOfBirth||void 0,p.personDetails.personalDetails.dateOfBirth=p.personDetails.personalDetails.dateOfBirth||void 0,p.personDetails.personalDetails.idDocument&&(p.personDetails.personalDetails.idDocument.dateOfIssuance=p.personDetails.personalDetails.idDocument.dateOfIssuance||void 0)),p.personDetails.riskProfileAssessment&&(p.personDetails.riskProfileAssessment.sourceOfIncome=void 0,p.personDetails.riskProfileAssessment.sourceOfFunds=void 0,p.personDetails.riskProfileAssessment.otherSourceOfFunds=void 0,p.personDetails.riskProfileAssessment.occupation=void 0,p.personDetail
1s.riskProfileAssessment.sourceOfWealth=void 0,p.personDetails.riskProfileAssessment.isShareOnBehalfAnotherPerson=void 0,p.personDetails.riskProfileAssessment.shareOnBehalfAnotherPerson=void 0,p.personDetails.riskProfileAssessment.isNomineeDirector=void 0,p.personDetails.riskProfileAssessment.isAcceptDirectorCriteria=void 0));return Ar({},p,{corporateRepresentativeOf:x,appointments:p.appointments.filter((function(e){return"Corporate Representative of"!==e.position})),companyDetails:Ar({},e.companyDetails,(null===(i=e.companyDetails)||void 0===i?void 0:i.legalDetails)?{legalDetails:Ar({},(null===(l=e.companyDetails.legalDetails)||void 0===l?void 0:l.historyName)?{historyName:null===(u=e.companyDetails.legalDetails)||void 0===u?void 0:u.historyName}:{},e.companyDetails.legalDetails.countryOfRegisteredBusiness?{countryOfRegisteredBusiness:e.companyDetails.legalDetails.countryOfRegisteredBusiness.value||e.companyDetails.legalDetails.countryOfRegisteredBusiness}:{},e.companyDetails.legalDetails.companyType?{companyType:e.companyDetails.legalDetails.companyType.value||e.companyDetails.legalDetails.companyType}:{},e.companyDetails.legalDetails.businessRegistrationNumber?{businessRegistrationNumber:e.companyDetails.legalDetails.businessRegistrationNumber}:{})}:{},(null===(c=e.companyDetails)||void 0===c?void 0:c.riskProfileAssessment)?{riskProfileAssessment:Ar({},(null===(d=e.companyDetails.riskProfileAssessment.countryOfOperations)||void 0===d?void 0:d.length)>0?{countryOfOperations:e.companyDetails.riskProfileAssessment.countryOfOperations}:{},e.companyDetails.riskProfileAssessment.sourceOfFunds?{sourceOfFunds:e.companyDetails.riskProfileAssessment.sourceOfFunds.value||e.companyDetails.riskProfileAssessment.sourceOfFunds}:{},e.companyDetails.riskProfileAssessment.otherSourceOfFunds?{otherSourceOfFunds:e.companyDetails.riskProfileAssessment.otherSourceOfFunds}:{})}:{},{documents:(0,g.get)(e,"companyDetails.documents",[]).map((function(e){return{id:e._id}}))}),kycSubmittedBy:p.kycSubmittedBy?p.kycSubmittedBy:void 0})})),r=(t=(0,g.uniqBy)(t,"_id")).filter((function(e){return"INDIVIDUAL"===e.category})).filter((function(e){return!1===e.isApplicant})).find((function(e){return(0,g.get)(e,"personDetails.contactDetails.email",null)===(null===d||void 0===d?void 0:d.emailAddresses[0])}));if(r){var o=(0,g.find)(t,{_id:r._id});(0,g.assign)(o,{isApplicant:!0})}return t}),[null===d||void 0===d?void 0:d.emailAddresses]),f=(0,a.useCallback)((function(e,s){var r=void 0===s||s,n=p(e),a={company:Ar({},e.company,{members:n}),currentStep:3},u=(0,g.get)(o,"data.data._id").toString();return t.emit("@set-is-page-loading",!0),i.put("/kyb/application/".concat(u),a).then(kr(U().mark((function e(s){var t;return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("OK"!==(null===s||void 0===s?void 0:s.status)){e.next=4;break}return r&&l("Successfully saved the progress","success"),e.abrupt("return",null);case 4:return r&&l((null===s||void 0===s||null===(t=s.data)||void 0===t?void 0:t.message)||"Something went wrong","error"),e.abrupt("return",null);case 6:case"end":return e.stop()}}),e)})))).catch((function(e){r&&l(e.message,"error")})).finally((function(){t.emit("@set-is-page-loading",!1)}))}),[i,o,t,l,p]);return{handleOnBack:(0,a.useCallback)((function(){return o.mutate(),t.emit("@stepper",2)}),[o,t]),handleOnSave:f,handleOnNext:(0,a.useCallback)((function(){return t.emit("@stepper",4)}),[t]),handleOnSubmit:(0,a.useCallback)((function(e){var s=p(e),r={company:Ar({},e.company,{members:s}),currentStep:5},a=(0,g.get)(o,"data.data._id").toString();return t.emit("@set-is-page-loading",!0),i.put("/kyb/application/".concat(a),r).then(kr(U().mark((function e(s){var r,a,i,u;return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("OK"!==(null===s||void 0===s?void 0:s.status)){e.next=7;break}return l("Successfully saved the progress","success"),e.next=5,o.mutate();case 5:return Z.Z.track("List of Stakeholders",{userID:c.userId,email:null===(r=c.profile)||void 0===r?void 0:r.emailAddresses[0],organizationID:s.data.organizationId,organizationName:null===(a=o.data)||void 0===a||null===(i=a.data)||void 0===i||null===(u=i.company)||void 0===u?void 0:u.companyName,serviceType:n,completedAt:(0,m.gS)(),deviceType:"Web"}),e.abrupt("return",t.emit("@stepper",5));case 7:return l("Something went wrong","error"),e.abrupt("return",null);case 9:case"end":return e.stop()}}),e)})))).catch((function(e){l(e.message,"error")})).finally((function(){t.emit("@set-is-page-loading",!1)}))}),[p,o,t,i,l,c.userId,null===(s=c.profile)||void 0===s?void 0:s.emailAddresses,n])}};function Pr(e,s,t,r,o,n,a){try{var i=e[n](a),l=i.value}catch(u){return void t(u)}i.done?s(l):Promise.resolve(l).then(r,o)}function Tr(e){return function(){var s=this,t=arguments;return new Promise((function(r,o){var n=e.apply(s,t);function a(e){Pr(n,r,o,a,i,"next",e)}function i(e){Pr(n,r,o,a,i,"throw",e)}a(void 0)}))}}function Ir(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}var Fr=function(e){var s=e.emitter,t=(0,K.Z)(),r=(0,K.Z)(),o=(0,K.Z)(),n=(0,a.useState)(),i=n[0],l=n[1],c=(0,a.useRef)(N.q.getState()).current.setGlobalSnackbar,d=(0,u.SS)().companyInformation,p=(0,a.useMemo)((function(){var e,s;return null===d||void 0===d||null===(e=d.data)||void 0===e||null===(s=e.data)||void 0===s?void 0:s._id}),[d]),f=(0,M.Z)(),h=(0,a.useCallback)((function(){var e={applicationId:p};return f.post("kyb/core/discard-company-info",e).then(Tr(U().mark((function e(t){return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("OK"!==(null===t||void 0===t?void 0:t.status)){e.next=8;break}return d.mutate(),c("Successfully discarded the process.","info"),s.emit("@set-is-acra-error",!1),s.emit("@select-option",{key:"incorporation",value:!1}
1),s.emit("@select-option",{key:"corpSec",value:!1}),s.emit("@select-option",{key:"finance",value:!1}),e.abrupt("return",s.emit("@stepper",0));case 8:return c("Something went wrong","error"),e.abrupt("return",t);case 10:case"end":return e.stop()}}),e)})))).catch((function(e){c(e.message,"error")}))}),[p,f,d,s,c]),x=(0,a.useCallback)((function(e,s){return f.post("/kyb/application/corp-rep/add",e).then(Tr(U().mark((function e(t){return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("OK"!==(null===t||void 0===t?void 0:t.status)){e.next=5;break}return s(),r.onClose(),d.mutate(),e.abrupt("return",c("A new corporate representative has been successfully added.","success"));case 5:return c("Something went wrong","error"),e.abrupt("return",null);case 7:case"end":return e.stop()}}),e)})))).catch((function(e){c(e.message,"error")}))}),[r,f,d,c]),v=(0,a.useCallback)(Tr(U().mark((function e(t,o){return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!o){e.next=2;break}return e.abrupt("return",f.post("/kyb/application/corp-rep/delete",{emailAddress:o}).then(Tr(U().mark((function e(t){return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("OK"!==(null===t||void 0===t?void 0:t.status)){e.next=5;break}return r.onClose(),d.mutate(),s.emit("@modal/delete-corporate-representative"),e.abrupt("return",c("Stakeholder data successfully deleted","success"));case 5:return c("Something went wrong","error"),e.abrupt("return",null);case 7:case"end":return e.stop()}}),e)})))).catch((function(e){c(e.message,"error")})));case 2:return e.abrupt("return",null);case 3:case"end":return e.stop()}}),e)}))),[r,f,d,s,c]),y=(0,a.useCallback)((function(e,s,t,r){var o=(0,g.cloneDeep)(e),n=(0,m.qX)(),a={_id:n,appointments:[{position:"Director",status:"Active",isOutgoing:!1}],category:"INDIVIDUAL",isApplicant:s.isApplicant,personDetails:{contactDetails:{email:s.emailAddress},personalDetails:{fullName:s.fullName}},companyDetails:{documents:[],riskProfileAssessment:{countryOfOperations:[]}},documents:[],riskAssessment:{documents:[]},sharesDetails:[]},i=o.officers;return i[n]=a,r(function(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){Ir(e,s,t[s])}))}return e}({},o,{officers:i})),t(),c("A new corporate representative has been successfully added.","success")}),[c]),j=(0,a.useCallback)((function(e){s.emit("@modal/delete-corporate-representative"),l(e)}),[s]),b=(0,a.useCallback)((function(){r.onToggle()}),[r]);return(0,a.useEffect)((function(){return s.on("@modal/confirm",t.onToggle),s.on("@modal/add-corporate-representative",b),s.on("@modal/delete-corporate-representative",o.onToggle),s.on("@modal/on-delete-corporate-representative",j),function(){s.off("@modal/confirm",t.onToggle),s.off("@modal/add-corporate-representative",b),s.off("@modal/delete-corporate-representative",o.onToggle),s.off("@modal/on-delete-corporate-representative",j)}}),[v,j,b,r.onToggle,t.onToggle,o.onToggle,s]),{handleOnConfirm:h,handleOnAddCorporateRepresentative:x,handleOnDeleteCorporateRepresentative:j,handleOnConfirmDeleteCorporateRepresentative:v,handleOnAddDirector:y,confirmationModal:t,addCorporateRepresentativeModal:r,deleteCorporateRepresentativeModal:o,officer:i}};function Rr(){return(0,r.jsxs)("div",{className:"sprout-flex-1 sprout-flex sprout-flex-col sprout-justify-center sprout-items-center sprout-mx-3 sprout-my-6",children:[(0,r.jsx)(We.default,{src:Ge.Gi,alt:"no records found",height:240,width:240}),(0,r.jsx)("div",{className:"sprout-px-2 sprout-mt-4 sprout-flex sprout-flex-col sprout-text-sm sprout-text-[#828282]",children:(0,r.jsx)("span",{className:"sprout-text-center",children:"This summary reflects the total number of shares, the issued share capital, and the paid-up capital for each share type."})})]})}var Lr=function(e){var s,t,o=e.share,n=e.index;return(0,r.jsxs)("div",{className:(0,He.W)(["sprout-grid sprout-grid-cols-12 sprout-grid-rows-[min-content]","sprout-p-4",(t=n,Boolean(t%2)?"sprout-bg-[#FAFAFA]":"sprout-bg-white")]),children:[(0,r.jsx)("div",{className:"sprout-col-span-6 sprout-flex sprout-justify-between sprout-items-center",children:(0,r.jsx)("p",{children:null!==(s=(0,ee.t)(o.shareAllotted,0))&&void 0!==s?s:""})}),(0,r.jsx)("div",{className:"sprout-col-span-6",children:(0,r.jsx)("p",{children:(0,ee.Z)(o.paidUpShareCapital,o.shareCurrency)})})]})},_r=function(e){var s=e.title,t=(0,He.W)(["sprout-items-center lg:sprout-grid lg:sprout-grid-cols-12","sprout-h-10 md:sprout-h-16 sprout-py-2 md:sprout-py-4 sprout-px-3 sprout-border sprout-border-b-[2px]","sprout-text-xs"]);return(0,r.jsx)("div",{className:t,children:(0,r.jsx)("div",{className:"sprout-col-span-12 sprout-flex sprout-justify-between sprout-items-center",children:(0,r.jsxs)("p",{className:"sprout-font-semibold sprout-text-[10px]",children:[s," Shares"]})})})};function Br(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}var Vr=function(e){var s=e.values,t={};
1Object.keys(s.shareholders).forEach((function(e){s.shareholders[e].sharesDetails.forEach((function(e){var s=e.shareType,r=e.shareCurrency,o=e.shareAllotted,n=e.paidUpShareCapital;t[s]||(t[s]={}),t[s][r]||(t[s][r]={shareAllotted:0,paidUpShareCapital:0}),t[s][r].shareAllotted+=Number(o),t[s][r].paidUpShareCapital+=Number(n)}))}));var o=Object.keys(t).map((function(e){return{shareType:e,currencies:Object.keys(t[e]).map((function(s){return function(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){Br(e,s,t[s])}))}return e}({shareCurrency:s},t[e][s])}))}}));return Object.keys(s.shareholders).length?(0,r.jsx)(a.Fragment,{children:Object.keys(o).map((function(e,s){return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)(_r,{title:"".concat(s+1,". ").concat(o[e].shareType)}),o[e].currencies.map((function(e,s){return(0,r.jsx)(Lr,{share:e,index:s},"".concat(e.shareType,"-").concat(s))}))]},o[e].shareType)}))}):(0,r.jsx)("div",{className:"sprout-flex-1 sprout-flex",children:(0,r.jsx)(Rr,{})})},Ur=function(){var e=(0,He.W)(["sprout-bg-[#FAFAFA]","sprout-items-center sprout-grid sprout-grid-cols-12","sprout-h-16 sprout-py-4 sprout-px-3","sprout-text-xs"]);return(0,r.jsxs)("div",{className:e,children:[(0,r.jsxs)("div",{className:"sprout-col-span-6 sprout-flex sprout-justify-between sprout-items-center",children:[(0,r.jsx)("p",{children:"No. of Shares"}),(0,r.jsx)("span",{className:"sprout-hidden md:sprout-block",children:(0,r.jsx)(Q.Qr,{})})]}),(0,r.jsx)("div",{className:"sprout-col-span-6",children:(0,r.jsx)("p",{children:"Paid-up Capital"})})]})},Mr=function(e){var s=e.values;return(0,r.jsxs)("div",{className:"sprout-flex-1 sprout-flex sprout-flex-col sprout-overflow-hidden",children:[(0,r.jsx)(Ur,{}),(0,r.jsx)(Vr,{values:s})]})};function Zr(e){var s=e.values;return(0,r.jsx)(a.Fragment,{children:(0,r.jsxs)("div",{className:(0,m.WD)(["sprout-relative sprout-flex sprout-flex-col","sprout-border sprout-border-[#CDCDCD] sprout-border-solid sprout-rounded-[16px]","sprout-overflow-hidden"]),children:[(0,r.jsx)("div",{className:"sprout-flex sprout-justify-between sprout-p-4 sprout-items-center",children:(0,r.jsx)("h3",{className:"sprout-font-semibold",children:"Shares Summary"})}),(0,r.jsx)("div",{className:"sprout-border-solid sprout-border-[#C4C4C4] sprout-border-b-[1px]"}),(0,r.jsx)(Mr,{values:s})]})})}var qr=function(){var e=(0,u.SS)().emitter,s=(0,K.Z)(),t=(0,K.Z)(),r=(0,K.Z)(),o=(0,K.Z)(),n=(0,a.useState)({shareholder:void 0,type:""}),i=n[0],l=n[1],c=(0,a.useCallback)((function(e){switch(e.type){case"add":s.onOpen();break;case"add-individual":case"edit-individual":r.onOpen();break;case"add-corporate":case"edit-corporate":o.onOpen();break;case"delete":t.onOpen();break;case"close":s.onClose(),r.onClose(),o.onClose(),t.onClose()}l(e)}),[s,o,t,r]);return(0,a.useEffect)((function(){return e.on("@modal/toggle-shareholder",c),e.on("@modal/add-shareholder",s.onToggle),e.on("@modal/add-individual-shareholder",r.onToggle),e.on("@modal/add-corporate-shareholder",o.onToggle),function(){e.off("@modal/toggle-shareholder",c),e.off("@modal/add-shareholder",s.onToggle),e.off("@modal/add-individual-shareholder",r.onToggle),e.off("@modal/add-corporate-shareholder",o.onToggle)}}),[c,s.onToggle,o.onToggle,e,r.onToggle]),{meta:{modalData:i},addShareholder:s,individualShareholder:r,corporateShareholder:o,deleteShareholder:t}};function Wr(e){var s=e.isOpen,t=e.onClose,o=(0,u.SS)().emitter,n=function(e){"individual"===e?(o.emit("@modal/add-shareholder"),o.emit("@modal/add-individual-shareholder")):(o.emit("@modal/add-shareholder"),o.emit("@modal/add-corporate-shareholder"))};return(0,r.jsx)(D.BT,{className:"sprout-w-[325px] md:sprout-w-[430px] !sprout-p-4",show:s,useBackground:!0,onClose:t,children:(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-4",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-w-full sprout-justify-center sprout-items-center",children:[(0,r.jsx)("span",{className:"sprout-text-base md:sprout-text-xl sprout-font-semibold sprout-text-center pr-1 md:p-0",children:"Add New Shareholder"}),(0,r.jsx)("div",{className:"sprout-absolute sprout-inset-y-5 sprout-right-5 sprout-cursor-pointer",onClick:function(){t()},children:(0,r.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("mask",{id:"mask0_1663_4126",maskUnits:"userSpaceOnUse",x:"2",y:"2",width:"12",height:"12",children:(0,r.jsx)("path",{d:"M2.7879 2.13518C2.60765 1.95494 2.31542 1.95494 2.13518 2.13518C1.95494 2.31542 1.95494 2.60765 2.13518 2.7879L7.34729 8L2.13518 13.2121C1.95494 13.3923 1.95494 13.6846 2.13518 13.8648C2.31542 14.0451 2.60765 14.0451 2.7879 13.8648L8 8.65271L13.2121 13.8648C13.3923 14.0451 13.6846 14.0451 13.8648 13.8648C14.0451 13.6846 14.0451 13.3923 13.8648 13.2121L8.65271 8L13.8648 2.7879C14.0451 2.60765 14.0451 2.31542 13.8648 2.13518C13.6846 1.95494 13.3923 1.95494 13.2121 2.13518L8 7.34729L2.7879 2.13518Z",fill:"#8E8E8E"})}),(0,r.jsx)("g",{mask:"url(#mask0_1663_4126)",children:(0,r.jsx)("rect",{width:"16",height:"16",fill:"#121212"})})]})})]}),(0,r.jsx)("p",{className:"sprout-text-sm sprout-max-w-xs mx-auto text-center",children:"You\u2019re about to add new stakeholders. Which stakeholders type do you want to add?"}),(0,r.jsxs)("div",{className:"sprout-grid sprout-grid-cols-2 sprout-gap-4 sprout-w-full",children:[(0,r.jsxs)("div",{onClick:function(){return n("individual")},className:"sprout-cursor-pointer sprout-flex sprout-flex-col sprout-items-center sprout-p-4 sprout-border-[#C4C4C4]
1sprout-rounded-xl sprout-border-[1px] sprout-space-y-4",children:[(0,r.jsxs)("svg",{width:"85",height:"84",viewBox:"0 0 85 84",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("circle",{cx:"42.5",cy:"42",r:"41.5",stroke:"#C4C4C4"}),(0,r.jsx)("path",{d:"M42.6675 45.0892C49.7422 45.0892 55.4782 39.3546 55.4782 32.2799C55.4782 25.2052 49.7422 19.4692 42.6675 19.4692C35.5928 19.4692 29.8582 25.2052 29.8582 32.2799C29.8582 39.3546 35.5928 45.0892 42.6675 45.0892ZM55.4262 48.9746H50.8662C49.8515 48.9746 48.8995 49.4706 48.3182 50.3026L45.1302 54.8666C43.8822 56.6519 41.2342 56.6346 40.0102 54.8319L36.9582 50.3359C36.3795 49.4839 35.4168 48.9746 34.3875 48.9746H29.9089C24.1409 48.9746 19.4648 53.6506 19.4648 59.4186V64.0533C19.4648 64.9119 20.1595 65.6079 21.0182 65.6079H64.3168C65.1755 65.6079 65.8702 64.9119 65.8702 64.0533V59.4186C65.8702 53.6506 61.1955 48.9746 55.4262 48.9746ZM60.4662 59.0332C60.4662 59.4012 60.1675 59.6999 59.7995 59.6999H57.3582V62.1399C57.3582 62.5079 57.0595 62.8066 56.6915 62.8066H54.6915C54.3235 62.8066 54.0249 62.5079 54.0249 62.1399V59.6999H51.5835C51.2155 59.6999 50.9168 59.4012 50.9168 59.0332V57.0332C50.9168 56.6652 51.2155 56.3666 51.5835 56.3666H54.0249V53.9252C54.0249 53.5572 54.3235 53.2586 54.6915 53.2586H56.6915C57.0595 53.2586 57.3582 53.5572 57.3582 53.9252V56.3666H59.7995C60.1675 56.3666 60.4662 56.6652 60.4662 57.0332V59.0332Z",fill:"#FB8110"}),(0,r.jsx)("path",{d:"M60.4662 59.0332C60.4662 59.4012 60.1675 59.6999 59.7995 59.6999H57.3582V62.1399C57.3582 62.5079 57.0595 62.8066 56.6915 62.8066H54.6915C54.3235 62.8066 54.0249 62.5079 54.0249 62.1399V59.6999H51.5835C51.2155 59.6999 50.9168 59.4012 50.9168 59.0332V57.0332C50.9168 56.6652 51.2155 56.3666 51.5835 56.3666H54.0249V53.9252C54.0249 53.5572 54.3235 53.2586 54.6915 53.2586H56.6915C57.0595 53.2586 57.3582 53.5572 57.3582 53.9252V56.3666H59.7995C60.1675 56.3666 60.4662 56.6652 60.4662 57.0332V59.0332Z",fill:"#FB8110"}),(0,r.jsx)("path",{d:"M44.2015 48.7399H41.5348C40.6148 48.7399 39.8682 49.4866 39.8682 50.4066C39.8682 51.3266 40.6148 52.0732 41.5348 52.0732H44.2015C45.1215 52.0732 45.8682 51.3266 45.8682 50.4066C45.8682 49.4866 45.1215 48.7399 44.2015 48.7399Z",fill:"#FB8110"})]}),(0,r.jsx)("p",{className:"sprout-text-sm",children:"Individual"})]}),(0,r.jsxs)("div",{onClick:function(){return n("corporate")},className:"sprout-cursor-pointer sprout-flex sprout-flex-col sprout-items-center sprout-justify-center sprout-p-4 sprout-border-[#C4C4C4] sprout-rounded-xl sprout-border-[1px] sprout-space-y-4",children:[(0,r.jsxs)("svg",{width:"85",height:"84",viewBox:"0 0 85 84",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("circle",{cx:"42.5",cy:"42",r:"41.5",stroke:"#C4C4C4"}),(0,r.jsx)("g",{clipPath:"url(#clip0_880_56954)",children:(0,r.jsx)("path",{d:"M60.5 63V30H51.5V21H24.5V63H18.5V66H39.5V57H45.5V66H66.5V63H60.5ZM36.5 51H30.5V45H36.5V51ZM36.5 42H30.5V36H36.5V42ZM36.5 33H30.5V27H36.5V33ZM45.5 51H39.5V45H45.5V51ZM45.5 42H39.5V36H45.5V42ZM45.5 33H39.5V27H45.5V33ZM57.5 51H51.5V45H57.5V51ZM57.5 42H51.5V36H57.5V42Z",fill:"#0083C1"})}),(0,r.jsx)("defs",{children:(0,r.jsx)("clipPath",{id:"clip0_880_56954",children:(0,r.jsx)("rect",{width:"48",height:"48",fill:"white",transform:"translate(18.5 18)"})})})]}),(0,r.jsx)("p",{className:"sprout-text-sm",children:"Corporate"})]})]}),(0,r.jsx)(D.iR,{tertiary:!0,onClick:t,children:"Cancel"})]})})}function Gr(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function Kr(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){Gr(e,s,t[s])}))}return e}function Hr(e){var s,t=e.isValid,o=e.setStep,n=e.meta,i=e.parentValues,l=e.values,c=e.setValues,d=(0,y.a)().profileState.profile,p=(0,u.SS)().isAgentMode,m=(0,g.find)(i.officers,{isApplicant:!0})||(0,g.find)(i.shareholders,{isApplicant:!0}),f=!m||(null===m||void 0===m?void 0:m._id)===(null===(s=n.modalData.shareholder)||void 0===s?void 0:s._id);return(0,r.jsxs)(a.Fragment,{children:[(!m||f)&&(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col",children:[(0,r.jsxs)("div",{className:"checkbox-container mb-2",children:[(0,r.jsx)(w.Field,{name:"isApplicant",type:"checkbox",onClick:function(e){return function(e){e.target.checked?c(Kr({},l,{fullName:"".concat(null===d||void 0===d?void 0:d.callFirstName," ").concat(null===d||void 0===d?void 0:d.callLastName),emailAddress:null===d||void 0===d?void 0:d.emailAddresses[0]})):c(Kr({},l,{fullName:"",emailAddress:""}))}(e)}}),(0,r.jsx)("label",{htmlFor:"is-apply-for-business-account",children:(0,r.jsx)("div",{className:"checkbox-label sprout-text-sm md:sprout-text-base",children:"This is me"})})]}),(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Check this if this person is yourself."})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-sp
1ace-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Full Name"]}),(0,r.jsx)(Ns.K,{placeholder:"Enter Full Name",name:"fullName",required:!0,disabled:l.isApplicant})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[!p&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Email Address"]}),(0,r.jsx)(Ns.K,{placeholder:"Enter Email Address",name:"emailAddress",required:!0,disabled:l.isApplicant})]}),(0,r.jsxs)("div",{className:"sprout-flex",children:[(0,r.jsxs)("label",{className:"sprout-inline-flex sprout-cursor-pointer",children:[(0,r.jsx)(w.Field,{type:"checkbox",className:"sprout-sr-only sprout-peer",readOnly:!0,name:"isAddDirectorPosition"}),(0,r.jsx)("div",{className:"sprout-relative sprout-w-11 sprout-h-6 sprout-bg-gray-200 peer-focus:sprout-outline-none peer-focus:sprout-ring-4 peer-focus:sprout-ring-orange-300 sprout-rounded-full peer peer-checked:after:sprout-translate-x-full rtl:peer-checked:after:-sprout-translate-x-full peer-checked:after:sprout-border-white after:sprout-content-[''] after:sprout-absolute after:sprout-top-[2px] after:sprout-start-[2px] after:sprout-bg-white after:sprout-border-gray-300 after:sprout-border after:sprout-rounded-full after:sprout-h-5 after:sprout-w-5 after:sprout-transition-all peer-checked:sprout-bg-orange-600"})]}),(0,r.jsxs)("div",{className:"sprout-ml-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm sprout-font-semibold",children:"Add director position"}),(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:"Information for this person will appear on both officer and shareholders list."})]})]})]}),(0,r.jsx)(D.iR,{primary:!0,className:"sprout-w-full mt-4 !sprout-text-sm md:sprout-text-base !sprout-font-semibold",disabled:!t,onClick:function(){return o(1)},children:"Next"})]})}function zr(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function Yr(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){zr(e,s,t[s])}))}return e}function Xr(e){var s,t=e.index,o=e.arrayHelpers,n=e.values,a=e.setValues,i=(0,u.SS)().generalDropdownResponse,l=(0,g.get)(i,"data.data",[]).find((function(e){return"CurrencyISO3Letter"in e}));return(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-4",children:[t>0&&(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-row sprout-items-center sprout-justify-between sprout-pt-8 sprout-pb-4",children:[(0,r.jsx)("p",{className:"sprout-text-base sprout-font-semibold",children:"Additional Share"}),(0,r.jsx)(D.iR,{tertiary:!0,onClick:function(){return o.remove(t)},children:"Delete"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Shares Type"]}),(0,r.jsx)(b.Z.select2,{name:"shareTypes.".concat(t,".shareType"),placeholder:"Select type",options:c.t8.map((function(e){return{label:e,value:e}}))})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," No. of Shares"]}),(0,r.jsx)(b.Z.inputCurrencyWithError,{placeholder:"Enter number",name:"shareTypes.".concat(t,".shareAllotted"),required:!0,onChange:function(e){var s=e.target.value,r=n.shareTypes;r[t]=Yr({},r[t],{shareAllotted:s,paidUpShareCapital:s,issuedShareCapital:s}),a(Yr({},n,{shareTypes:r}))},maskOptions:{allowDecimal:!1}})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Paid Up Capital"]}),(0,r.jsxs)("div",{className:"sprout-grid sprout-grid-cols-2 sprout-gap-2",children:[(0,r.jsx)(b.Z.select2,{name:"shareTypes.".concat(t,".shareCurrency"),placeholder:"Select currency",options:null===l||void 0===l||null===(s=l.CurrencyISO3Letter)||void 0===s?void 0:s.map((function(e){var s;return{label:null!==(s=new Intl.DisplayNames(["en"],{type:"currency"}).of(e))&&void 0!==s?s:"-",value:e,icon:(0,r.jsx)("div",{className:"sprout-flex sprout-text-sm sprout-font-semibold sprout-text-[rgba(2, 2, 2, 0.75)] sprout-mr-3",children:e})}}))}),(0,r.jsx)(b.Z.inputCurrencyWithError,{placeholder:"Enter amount",name:"shareTypes.".concat(t,".paidUpShareCapital"),required:!0,onChange:function(e){var s=e.target.value,r=n.shareTypes;r[t]=Yr({},r[t],{paidUpShareCapital:s,issuedShareCapital:s}),a(Yr({},n,{shareTypes:r}))}})]})]})]})}function Qr(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function $r(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){Qr(e,s,t[s])}))}return e}function Jr(e,s){return function(e){if(Array.isArray(e))return e}(e)||function(e,s){var t=[],r=!0,o=!1,n=void 0;try{for(var a,i=e[Symbol.iterator]();!(r=(a=i.next()).done)&&(t.push(a.value),!s||t.length!==s);r=!0);}catch(l){o=!0,n=l}finally{try{r||null==i.return||i.return()}finally{if(o)throw n}}return t}
1(e,s)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var eo=function(){var e=(0,u.SS)().emitter,s=(0,y.a)().profileState.profile,t=(0,a.useRef)(N.q.getState()).current.setGlobalSnackbar;return{handleOnOkAddShareholder:(0,a.useCallback)((function(r,o,n,a){var i,l=(0,g.cloneDeep)(r),u=(0,m.qX)();if(o.shareTypes.length>0){var c=o.shareTypes.reduce((function(e,s){var t="".concat(s.shareType.value,"-").concat(s.shareCurrency.value);return e[t]||(e[t]={shareType:s.shareType.value,shareCurrency:s.shareCurrency.value,paidUpShareCapital:0,shareAllotted:0,issuedShareCapital:0}),e[t].paidUpShareCapital+=Hs.Z.currencyStringToNumber(s.paidUpShareCapital),e[t].issuedShareCapital+=Hs.Z.currencyStringToNumber(s.issuedShareCapital),e[t].shareAllotted+=Hs.Z.currencyStringToNumber(s.shareAllotted),e}),{});i=Object.values(c)}var d={_id:u,appointments:[{position:"Member",status:"Active",isOutgoing:!1}],category:"INDIVIDUAL",isApplicant:o.isApplicant?o.isApplicant:Hs.Z.checkThisIsMe(o.emailAddress,null===s||void 0===s?void 0:s.emailAddresses[0]),personDetails:{contactDetails:{email:o.isApplicant?null===s||void 0===s?void 0:s.emailAddresses[0]:o.emailAddress},personalDetails:{fullName:o.isApplicant?"".concat(null===s||void 0===s?void 0:s.callFirstName," ").concat(null===s||void 0===s?void 0:s.callLastName):o.fullName}},companyDetails:{documents:[],riskProfileAssessment:{countryOfOperations:[]}},documents:[],riskAssessment:{documents:[]},sharesDetails:i};o.isAddDirectorPosition&&d.appointments.push({position:"Director",status:"Active",isOutgoing:!1});var p=l.shareholders;if(p[u]=d,a($r({},l,{shareholders:p})),o.isAddDirectorPosition){var f=l.officers;f[u]=d,a($r({},l,{officers:f}))}return e.emit("@modal/toggle-shareholder",{shareholder:void 0,type:"close"}),n(),t("A new shareholder has been successfully added.","success")}),[e,null===s||void 0===s?void 0:s.callFirstName,null===s||void 0===s?void 0:s.callLastName,null===s||void 0===s?void 0:s.emailAddresses,t]),handleOnOkEditShareholder:(0,a.useCallback)((function(r,o,n,a,i){var l,u=(0,g.cloneDeep)(o),c=u.shareholders[r];if(n.shareTypes.length>0){var d=n.shareTypes.reduce((function(e,s){var t="".concat(s.shareType.value,"-").concat(s.shareCurrency.value);return e[t]||(e[t]={shareType:s.shareType.value,shareCurrency:s.shareCurrency.value,paidUpShareCapital:0,shareAllotted:0,issuedShareCapital:0}),e[t].paidUpShareCapital+=Hs.Z.currencyStringToNumber(s.paidUpShareCapital),e[t].issuedShareCapital+=Hs.Z.currencyStringToNumber(s.issuedShareCapital),e[t].shareAllotted+=Hs.Z.currencyStringToNumber(s.shareAllotted),e}),{});l=Object.values(d)}var p=n.isApplicant?n.isApplicant:Hs.Z.checkThisIsMe(n.emailAddress,null===s||void 0===s?void 0:s.emailAddresses[0]),m=$r({},c,{isApplicant:p,personDetails:{contactDetails:{email:p?null===s||void 0===s?void 0:s.emailAddresses[0]:n.emailAddress},personalDetails:{fullName:p?"".concat(null===s||void 0===s?void 0:s.callFirstName," ").concat(null===s||void 0===s?void 0:s.callLastName):n.fullName}},companyDetails:{documents:[],riskProfileAssessment:{countryOfOperations:[]}},documents:[],riskAssessment:{documents:[]},sharesDetails:l});n.isAddDirectorPosition?0===m.appointments.filter((function(e){return"Director"===e.position})).length&&m.appointments.push({position:"Director",status:"Active",isOutgoing:!1}):m.appointments=m.appointments.filter((function(e){return"Director"!==e.position}));var f=u.shareholders;if(f[r]=m,i($r({},u,{shareholders:f})),n.isAddDirectorPosition){var h=u.officers;h[r]=m,i($r({},u,{officers:h}))}if(!n.isAddDirectorPosition&&(0,g.find)(u.officers,{_id:r})){var x=u.officers;i($r({},u,{officers:$r({},Object.fromEntries(Object.entries(x).filter((function(e){return Jr(e,1)[0]!==r}))))}))}return e.emit("@modal/toggle-shareholder",{shareholder:void 0,type:"close"}),a(),t("Shareholder data successfully updated.","success")}),[e,null===s||void 0===s?void 0:s.callFirstName,null===s||void 0===s?void 0:s.callLastName,null===s||void 0===s?void 0:s.emailAddresses,t])}};function so(e){var s=e.metaData,t=e.setStep,o=e.parentValues,n=e.parentSetValues,i=e.values,l=e.setValues,u=e.isValid,c=e.resetForm,d=eo(),p=d.handleOnOkAddShareholder,m=d.handleOnOkEditShareholder;return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-sp
1ace-y-4",children:(0,r.jsx)(w.FieldArray,{name:"shareTypes",render:function(e){return(0,r.jsxs)("div",{children:[i.shareTypes&&i.shareTypes.map((function(s,t){return(0,r.jsx)(Xr,{index:t,arrayHelpers:e,setValues:l,values:i},t)})),(0,r.jsx)(D.iR,{tertiary:!0,className:"sprout-mt-4",onClick:function(){return e.insert(i.shareTypes?Object.keys(i.shareTypes).length+1:1,"")},children:"Add additional share types"})]})}})}),(0,r.jsxs)("div",{className:"sprout-grid sprout-grid-cols-2 sprout-gap-2",children:[(0,r.jsx)(D.iR,{className:"!sprout-text-sm md:sprout-text-base !sprout-font-semibold",secondary:!0,onClick:function(){return t(0)},children:"Previous"}),"add"===s.type&&(0,r.jsx)(D.iR,{className:"!sprout-text-sm md:sprout-text-base !sprout-font-semibold",primary:!0,disabled:!u,onClick:function(){p(o,i,c,n),t(0)},children:"Save"}),"edit-individual"===s.type&&(0,r.jsx)(D.iR,{className:"!sprout-text-sm md:sprout-text-base !sprout-font-semibold",primary:!0,disabled:!u,onClick:function(){var e,r;m(null!==(r=null===(e=s.shareholder)||void 0===e?void 0:e._id)&&void 0!==r?r:"",o,i,c,n),t(0)},children:"Save Changes"})]})]})}var to=[{label:"Information Form",step:0},{label:"Share Details",step:1}];function ro(e){var s=e.step;return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("header",{className:"sprout-flex sprout-flex-col sprout-p-6 sprout-gap-5 sprout-z-[1]",children:(0,r.jsxs)("div",{className:"sprout-w-full sprout-flex-col sprout-space-y-4",children:[(0,r.jsx)("div",{className:"sprout-flex sprout-justify-center sprout-cursor-pointer",children:to.map((function(e,t){var o=(0,r.jsx)(p.rl,{className:{path:"sprout-stroke-[#14213D]"}});return t===s?o=(0,r.jsx)(p.US,{className:{path:"sprout-stroke-[#14213D]"}}):t<s&&(o=(0,r.jsx)(p.o0,{})),(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col",onClick:function(){return e.onClick?e.onClick():null},children:(0,r.jsxs)("div",{className:"sprout-flex sprout-items-center",children:[o,t<to.length-1&&(0,r.jsx)("div",{className:"sprout-border-2 sprout-border-[#14213D] sprout-w-[64px] md:sprout-w-[136px]"})]})},t)}))}),(0,r.jsx)("div",{className:"sprout-flex sprout-space-x-2",children:to.map((function(e,t){return(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col",onClick:function(){return e.onClick?e.onClick():null},children:(0,r.jsx)("div",{className:"sprout-pt-1 sprout-text-xs sprout-leading-4 sprout-pr-2",children:(0,r.jsxs)("span",{className:(0,m.WD)([e.step!==s&&"sprout-text-[#757575]",e.step===s&&"sprout-font-semibold"]),children:[e.step+1,". ",e.label]})})},t)}))})]})})})}function oo(e){var s=e.onClose,t=e.parentValues,o=e.parentSetValues,n=qr().meta,a=(0,w.useFormikContext)(),i=a.values,l=a.setValues,u=a.setFieldValue,c=a.isValid,d=a.resetForm,p="";"add"===n.modalData.type&&(p="Add Individual Shareholder"),"edit-individual"===n.modalData.type&&(p="Edit Individual Shareholder");var m=function(e){u("step",e)};return(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-4",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-w-full sprout-justify-center sprout-items-center",children:[(0,r.jsx)("span",{className:"sprout-text-base md:sprout-text-xl sprout-font-semibold sprout-text-center pr-1 md:p-0",children:p}),(0,r.jsx)("div",{className:"sprout-absolute sprout-inset-y-5 sprout-right-5 sprout-cursor-pointer",onClick:function(){d(),s()},children:(0,r.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("mask",{id:"mask0_1663_4126",maskUnits:"userSpaceOnUse",x:"2",y:"2",width:"12",height:"12",children:(0,r.jsx)("path",{d:"M2.7879 2.13518C2.60765 1.95494 2.31542 1.95494 2.13518 2.13518C1.95494 2.31542 1.95494 2.60765 2.13518 2.7879L7.34729 8L2.13518 13.2121C1.95494 13.3923 1.95494 13.6846 2.13518 13.8648C2.31542 14.0451 2.60765 14.0451 2.7879 13.8648L8 8.65271L13.2121 13.8648C13.3923 14.0451 13.6846 14.0451 13.8648 13.8648C14.0451 13.6846 14.0451 13.3923 13.8648 13.2121L8.65271 8L13.8648 2.7879C14.0451 2.60765 14.0451 2.31542 13.8648 2.13518C13.6846 1.95494 13.3923 1.95494 13.2121 2.13518L8 7.34729L2.7879 2.13518Z",fill:"#8E8E8E"})}),(0,r.jsx)("g",{mask:"url(#mask0_1663_4126)",children:(0,r.jsx)("rect",{width:"16",height:"16",fill:"#121212"})})]})})]}),(0,r.jsx)("div",{className:"sprout-flex sprout-w-full sprout-justify-center sprout-items-center",children:(0,r.jsx)(ro,{step:i.step})}),0===i.step&&(0,r.jsx)(Hr,{setStep:m,isValid:c,meta:n,parentValues:t,values:i,setValues:l}),1===i.step&&(0,r.jsx)(so,{values:i,setValues:l,setStep:m,isValid:c,resetForm:d,metaData:n.modalData,parentSetValues:o,parentValues:t})]})}function no(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function ao(e){var s,t,o,n=e.isOpen,i=e.onClose,l=e.parentValues,c=e.parentSetValues,d=qr().meta,p=(0,u.SS)().isAgentMode,m=(0,g.find)(null===(s=d.modalData.shareholder)||void 0===s?void 0:s.appointments,{position:"Director"}),f={shareholderId:(0,g.get)(d,"modalData.shareholder._id",""),fullName:(0,g.get)(d,"modalData.shareholder.personDetail
1s.personalDetails.fullName",""),emailAddress:(0,g.get)(d,"modalData.shareholder.personDetails.contactDetails.email",""),isAddDirectorPosition:Boolean(m),shareTypes:function(){var e,s,t=[];(null===(e=d.modalData.shareholder)||void 0===e?void 0:e.sharesDetails)?null===(s=d.modalData.shareholder)||void 0===s||s.sharesDetails.forEach((function(e){var s,o=new Intl.DisplayNames(["en"],{type:"currency"}),n=function(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){no(e,s,t[s])}))}return e}({},e,{shareType:{label:null===e||void 0===e?void 0:e.shareType,value:null===e||void 0===e?void 0:e.shareType},shareCurrency:{label:null!==(s=o.of(null===e||void 0===e?void 0:e.shareCurrency))&&void 0!==s?s:"-",value:null===e||void 0===e?void 0:e.shareCurrency,icon:(0,r.jsx)("div",{className:"sprout-flex sprout-text-sm sprout-font-semibold sprout-text-[rgba(2, 2, 2, 0.75)] sprout-mr-3",children:null===e||void 0===e?void 0:e.shareCurrency})}});t.push(n)})):t=[{issuedShareCapital:"",paidUpShareCapital:"",shareAllotted:"",shareCurrency:"",shareType:""}];return t}(),step:0,isApplicant:null!==(o=null===(t=d.modalData.shareholder)||void 0===t?void 0:t.isApplicant)&&void 0!==o&&o},h=(0,a.useCallback)((function(e,s){var t={},r=s.officers,o=s.shareholders;return e.isApplicant||(e.fullName||(t.fullName=""),e.emailAddress&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e.emailAddress)&&(t.emailAddress="Invalid email address"),e.emailAddress||p||(t.emailAddress=""),p||(Object.keys(r).forEach((function(s){var o;s!==e.shareholderId&&Hs.Z.transformToLowerCase(null===(o=r[s].personDetails.contactDetails)||void 0===o?void 0:o.email)===Hs.Z.transformToLowerCase(e.emailAddress)&&(t.emailAddress="Email already existed")})),Object.keys(o).forEach((function(s){var r;s!==e.shareholderId&&"INDIVIDUAL"===o[s].category&&Hs.Z.transformToLowerCase(null===(r=o[s].personDetails.contactDetails)||void 0===r?void 0:r.email)===Hs.Z.transformToLowerCase(e.emailAddress)&&(t.emailAddress="Email already existed")})))),1===e.step&&e.shareTypes.forEach((function(e){var s,r;(null===e||void 0===e||null===(s=e.shareType)||void 0===s?void 0:s.value)||(t.shareType=""),(null===e||void 0===e?void 0:e.shareAllotted)||(t.shareAllotted=""),(null===e||void 0===e||null===(r=e.shareCurrency)||void 0===r?void 0:r.value)||(t.shareCurrency=""),(null===e||void 0===e?void 0:e.paidUpShareCapital)||(t.paidUpShareCapital="")})),t}),[p]);return(0,r.jsx)(D.BT,{className:"sprout-w-[325px] sprout-max-h-[540px] md:sprout-w-[640px] sprout-overflow-auto !sprout-p-4",show:n,useBackground:!0,onClose:i,children:(0,r.jsx)(b.Z.form,{onSubmit:function(){},validation:function(e){return h(e,l)},initialValues:f,validateOnChange:!0,validateOnBlur:!0,validateOnMount:!0,children:(0,r.jsx)(oo,{onClose:i,parentValues:l,parentSetValues:c})})})}function io(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function lo(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){io(e,s,t[s])}))}return e}function uo(e,s){return function(e){if(Array.isArray(e))return e}(e)||function(e,s){var t=[],r=!0,o=!1,n=void 0;try{for(var a,i=e[Symbol.iterator]();!(r=(a=i.next()).done)&&(t.push(a.value),!s||t.length!==s);r=!0);}catch(l){o=!0,n=l}finally{try{r||null==i.return||i.return()}finally{if(o)throw n}}return t}(e,s)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function co(e){var s,t=e.setStep,o=e.parentValues,n=e.values,i=e.setValues,l=e.isValid,u=e.meta,d=(0,St.Z)().getCountryListRaw,p=(0,At.ZP)("getCountryList",d).data,f=function(e){var s=void 0!==e&&e,t=null===p||void 0===p?void 0:p.data.sort((function(e,s){return e.countryName.localeCompare(s.countryName)})).map((function(e){return{icon:(0,r.jsx)("div",{className:"sprout-flex",children:(0,r.jsx)("img",{className:"sprout-h-[25px] sprout-mr-3 sprout-self-ce
1nter",src:"".concat(e.countryFlagUrl),alt:""})}),label:"".concat(e.countryName," (").concat(e.dialCode,")"),value:e.dialCode}}));return s?null===t||void 0===t?void 0:t.filter((function(e){return"+65"===e.value})):t},h=(0,y.a)().profileState.profile,x=(0,g.find)(o.officers,{isApplicant:!0})||(0,g.find)(o.shareholders,{isApplicant:!0}),v=!x||(null===x||void 0===x?void 0:x._id)===(null===(s=u.modalData.shareholder)||void 0===s?void 0:s._id);return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2 sprout-pt-2",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2 sprout-mb-4",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Corporate Representative"]}),(0,r.jsx)(b.Z.select2,{name:"corporateRepresentativeOf",placeholder:"Select Corporate Representative",options:Object.values(Object.fromEntries(Object.entries(lo({},o.officers,o.shareholders)).filter((function(e){var s=uo(e,2);s[0];return"INDIVIDUAL"===s[1].category})))).map((function(e){return{label:e.personDetails.personalDetails.fullName,value:e._id}})),isDisabled:n.isAddCorpRep})]}),(0,r.jsxs)("div",{className:"sprout-flex",children:[(0,r.jsxs)("label",{className:"sprout-inline-flex sprout-cursor-pointer",children:[(0,r.jsx)(w.Field,{type:"checkbox",className:"sprout-sr-only sprout-peer",readOnly:!0,name:"isAddCorpRep"}),(0,r.jsx)("div",{className:"sprout-relative sprout-w-11 sprout-h-6 sprout-bg-gray-200 peer-focus:sprout-outline-none peer-focus:sprout-ring-4 peer-focus:sprout-ring-orange-300 sprout-rounded-full peer peer-checked:after:sprout-translate-x-full rtl:peer-checked:after:-sprout-translate-x-full peer-checked:after:sprout-border-white after:sprout-content-[''] after:sprout-absolute after:sprout-top-[2px] after:sprout-start-[2px] after:sprout-bg-white after:sprout-border-gray-300 after:sprout-border after:sprout-rounded-full after:sprout-h-5 after:sprout-w-5 after:sprout-transition-all peer-checked:sprout-bg-orange-600"})]}),(0,r.jsxs)("div",{className:"sprout-ml-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm sprout-font-semibold",children:"Add new corporate representative instead"}),(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:"Note: Do not select from the dropdown if a representative is already listed. New entries are required to maintain current data."})]})]}),n.isAddCorpRep&&(0,r.jsxs)(a.Fragment,{children:[(!x||v)&&(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col",children:[(0,r.jsxs)("div",{className:"checkbox-container mb-2",children:[(0,r.jsx)(w.Field,{name:"isApplicant",type:"checkbox",onClick:function(e){return function(e){e.target.checked?i(lo({},n,{fullName:"".concat(null===h||void 0===h?void 0:h.callFirstName," ").concat(null===h||void 0===h?void 0:h.callLastName),emailAddress:null===h||void 0===h?void 0:h.emailAddresses[0]})):i(lo({},n,{fullName:"",emailAddress:""}))}(e)}}),(0,r.jsx)("label",{htmlFor:"is-apply-for-business-account",children:(0,r.jsx)("div",{className:"checkbox-label sprout-text-sm md:sprout-text-base",children:"This is me"})})]}),(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Check this if this person is yourself."})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2 sprout-mb-4",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Full Name"]}),(0,r.jsx)(Ns.K,{placeholder:"Enter name",name:"fullName",required:!0,disabled:n.isApplicant})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2 sprout-mb-4",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," ID Number"]}),(0,r.jsxs)("div",{className:"sprout-grid sprout-grid-cols-2 sprout-gap-2",children:[(0,r.jsx)(b.Z.select2,{name:"IDNumberType",placeholder:"Select type",options:c.Qo.map((function(e){return{label:e,value:e}}))}),(0,r.jsx)(Ns.K,{placeholder:"Enter number",name:"IDNumber",required:!0,onKeyDown:function(e){return(0,m.kb)(e)}})]})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-sp
1ace-y-2 sprout-mb-4",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Contact Number"]}),(0,r.jsxs)("div",{className:"sprout-grid sprout-grid-cols-2 sprout-gap-2",children:[(0,r.jsx)(Et.Z,{placeholder:"Enter dial code",name:"dialCode",isSearchable:!1,options:[{label:"Common Countries",options:f(!0)},{label:"All",options:f()}]}),(0,r.jsx)(Ns.K,{placeholder:"Enter number",name:"contactNumber",required:!0,onKeyDown:function(e){return(0,m.AM)(e)}})]})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2 sprout-mb-4",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Email Address"]}),(0,r.jsx)(Ns.K,{placeholder:"Enter email",name:"emailAddress",required:!0,disabled:n.isApplicant})]})]})]}),(0,r.jsxs)("div",{className:"sprout-grid sprout-grid-cols-2 sprout-gap-2",children:[(0,r.jsx)(D.iR,{className:"!sprout-text-sm md:sprout-text-base !sprout-font-semibold",secondary:!0,onClick:function(){return t(0)},children:"Previous"}),(0,r.jsx)(D.iR,{className:"!sprout-text-sm md:sprout-text-base !sprout-font-semibold",primary:!0,disabled:!l,onClick:function(){return t(2)},children:"Next"})]})]})}function po(e,s,t,r,o,n,a){try{var i=e[n](a),l=i.value}catch(u){return void t(u)}i.done?s(l):Promise.resolve(l).then(r,o)}function mo(e){return function(){var s=this,t=arguments;return new Promise((function(r,o){var n=e.apply(s,t);function a(e){po(n,r,o,a,i,"next",e)}function i(e){po(n,r,o,a,i,"throw",e)}a(void 0)}))}}function fo(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function ho(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){fo(e,s,t[s])}))}return e}var xo=function(){var e=(0,Ue.Z)(),s=(0,u.SS)().emitter,t=(0,a.useRef)(N.q.getState()).current.setGlobalSnackbar,r=(0,a.useState)(!1),o=r[0],n=r[1],i=(0,a.useCallback)(mo(U().mark((function r(o,n,a){var i,l,u,c;return U().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(a.target.files){r.next=2;break}return r.abrupt("return");case 2:if(!(a.target.files[0].size>62914560)){r.next=5;break}return t("File size limit exceeded","error"),r.abrupt("return");case 5:return s.emit("@set-is-information-form-modal-loading",!0),i=new FormData,l=a.target.files[0].name,i.append("files",a.target.files[0]),r.next=11,e.post("/user-kyc/documents/upload",i,{headers:{"Content-Type":"multipart/form-data"}});case 11:u=r.sent,"OK"===(0,g.result)(u,"status")?(u.data.fileName=l,u.data._id=u.data.documentId,(c=n.documents).push(u.data),o(ho({},n,{documents:c})),s.emit("@set-is-information-form-modal-loading",!1)):(t("Something went wrong","error"),s.emit("@set-is-information-form-modal-loading",!1));case 13:case"end":return r.stop()}}),r)}))),[e,s,t]),l=(0,a.useCallback)(mo(U().mark((function r(o,n,a){return U().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return s.emit("@set-is-information-form-modal-loading",!0),r.next=3,e.delete("/kyb/documents/".concat(o)).then((function(e){if("OK"===(0,g.result)(e,"status")){var t=n.documents.filter((function(e){return e._id!==o}));a(ho({},n,{documents:t})),s.emit("@set-is-information-form-modal-loading",!1)}})).catch((function(){t("Something went wrong","error"),s.emit("@set-is-information-form-modal-loading",!1)}));case 3:case"end":return r.stop()}}),r)}))),[e,s,t]),c=(0,a.useCallback)((function(e){n(e)}),[]);return(0,a.useEffect)((function(){return s.on("@set-is-information-form-modal-loading",c),function(){s.off("@set-is-information-form-modal-loading",c)}})),{isFormLoading:o,handleOnFileChange:i,handleOnRemoveFile:l}};function vo(e,s,t,r,o,n,a){try{var i=e[n](a),l=i.value}catch(u){return void t(u)}i.done?s(l):Promise.resolve(l).then(r,o)}function yo(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function go(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}
1)))),r.forEach((function(s){yo(e,s,t[s])}))}return e}function jo(e){var s,t=e.setStep,o=e.parentValues,n=e.parentSetValues,i=e.meta,l=e.isValid,c=e.values,d=e.setValues,p=(0,a.useRef)(null),f=(0,K.Z)(!0),h=xo(),x=h.handleOnFileChange,y=h.handleOnRemoveFile,j=h.isFormLoading,N=(0,u.SS)(),C=N.generalDropdownResponse,w=N.generalCountry,k=(0,g.get)(C,"data.data",[]).find((function(e){return"CompanyTypeCorpSh"in e})),O=(0,a.useCallback)((function(e){var s=(0,g.cloneDeep)(o).shareholders;s[(0,g.get)(i,"modalData.shareholder._id","")].companyDetails.documents=c.documents.filter((function(s){return s._id!==e})),n(go({},o,{shareholders:s}))}),[i,n,o,c.documents]),A=(0,a.useMemo)((function(){var e;return"SG"===((null===(e=c.country)||void 0===e?void 0:e.value)||"")}),[c.country]),S=(0,a.useMemo)((function(){var e;return"SG"===((null===(e=c.ppobCountry)||void 0===e?void 0:e.value)||"")}),[c.ppobCountry]);return j?(0,r.jsx)(v.S,{}):(0,r.jsxs)(a.Fragment,{children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-sp
1ace-y-2 sprout-pt-2",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Corporate Shareholder Name"]}),(0,r.jsx)(Ns.K,{placeholder:"Enter name",name:"companyName",required:!0})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Entity Type"]}),(0,r.jsx)(b.Z.select2,{name:"companyType",placeholder:"Select entity type",options:null===k||void 0===k?void 0:k.CompanyTypeCorpSh.map((function(e){return{label:e,value:e}})),isRequired:!0})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Country of Incorporation"]}),(0,r.jsx)(b.Z.select2,{name:"countryOfRegisteredBusiness",placeholder:"Select country",options:(0,g.get)(w,"data.data",[]).map((function(e){return{label:e.description,value:e.countryIso2Code,icon:(0,r.jsx)("img",{className:"sprout-mr-3 sprout-h-6",src:e.countryFlagUrl,alt:""})}})),isRequired:!0})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Country of Operation"]}),(0,r.jsx)(b.Z.select2,{name:"countryOfOperations",placeholder:"Select country",options:(0,g.get)(w,"data.data",[]).map((function(e){return{label:e.description,value:e.countryName,icon:(0,r.jsx)("img",{className:"sprout-mr-3 sprout-h-6",src:e.countryFlagUrl,alt:""})}})),isRequired:!0})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"Former Name (if any)"}),(0,r.jsx)(Ns.K,{placeholder:"Enter former name",name:"historyName"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Company Registration Number"]}),(0,r.jsx)(Ns.K,{placeholder:"Enter company registration number",name:"businessRegistrationNumber",required:!0})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-justify-between",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," List of Documents"]}),(0,r.jsx)("div",{className:"sprout-cursor-pointer",onClick:f.onToggle,children:(0,r.jsx)(Q.Uy,{})})]}),f.isOpen&&(0,r.jsx)(D.pi,{information:!0,label:"Certified true copy can be certified by company secretary or director"}),(0,r.jsxs)("div",{className:(0,m.WD)(["sprout-p-4",f.isOpen?"sprout-grid sprout-grid-cols-1 md:sprout-grid-cols-2":"hidden"]),children:[(0,r.jsxs)("div",{className:"sprout-text-xs",children:[(0,r.jsx)("p",{children:"Singapore"}),(0,r.jsxs)("ol",{className:"sprout-list-decimal sprout-list-inside sprout-text-[#757575]",children:[(0,r.jsx)("li",{children:"ACRA BizFile"}),(0,r.jsx)("li",{children:"Constitution (a.k.a M&A, or Articles of Association)"}),(0,r.jsx)("li",{children:"Certificate of Corporate Representative"})]})]}),(0,r.jsxs)("div",{className:"sprout-text-xs",children:[(0,r.jsx)("p",{children:"Overseas"}),(0,r.jsxs)("ol",{className:"sprout-list-decimal sprout-list-inside sprout-text-[#757575]",children:[(0,r.jsx)("li",{children:"Certified true copy of Certificate of Incorporation"}),(0,r.jsx)("li",{children:"Certified true copy of Constitution/Memorandum & Articles of Association/By-Law"}),(0,r.jsx)("li",{children:"Certified true copy of Register of Shareholders or Certificate of Incumbency (not more than 3 months)"}),(0,r.jsx)("li",{children:"Certified true copy of Register of Directors/Certificate of Incumbency (not more than 3 months)"}),(0,r.jsx)("li",{children:"Certificate of Corporate Representative"})]})]})]}),null===(s=c.documents)||void 0===s?void 0:s.map((function(e){return(0,r.jsxs)("div",{className:"sprout-border sprout-rounded-lg sprout-p-2 sprout-pl-5 sprout-pr-5 sprout-grid sprout-grid-flow-row sprout-grid-cols-8 sprout-gap-2 sprout-items-center",children:[(0,r.jsx)("span",{className:"sprout-col-span-7 sprout-font-semibold sprout-cursor-pointer sprout-break-words",children:e.fileName}),(0,r.jsx)("span",{className:"sprout-col-span-1 sprout-flex sprout-justify-end sprout-cursor-pointer",onClick:(s=U().mark((function s(){return U().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,y(e._id,c,d);case 2:return s.next=4,O(e._id);case 4:case"end":return s.stop()}}),s)})),function(){var e=this,t=arguments;return new Promise((function(r,o){var n=s.apply(e,t);function a(e){vo(n,r,o,a,i,"next",e)}function i(e){vo(n,r,o,a,i,"throw",e)}a(void 0)}))}),children:"X"})]},e.documentId);var s})),(0,r.jsx)(D.iR,{secondary:!0,onClick:function(){var e;return null===(e=p.current)||void 0===e?void 0:e.click()},children:"Attach Document"}),(0,r.jsx)("input",{type:"file",ref:p,onChange:function(e){return x(d,c,e)},className:"sprout-hidden",accept:"image/jpg, image/png, application/pdf"}),(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#8E8E8E]",children:"Supported formats: jpg, pdf, png with maximum size 10 MB"}),(0,r.jsx)("p",{className:"sprout-text-sm sprout-font-semibold sprout-sp
1ace-y-2",children:"Registered Address"}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Country Address"]}),(0,r.jsx)(b.Z.select2,{name:"country",placeholder:"Select country",options:(0,g.get)(w,"data.data",[]).map((function(e){return{label:e.description,value:e.countryIso2Code,icon:(0,r.jsx)("img",{className:"sprout-mr-3 sprout-h-6",src:e.countryFlagUrl,alt:""})}}))})]}),A?(0,r.jsxs)("div",{className:"sprout-grid sprout-grid-cols-1 md:sprout-grid-cols-2 sprout-gap-4",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Block / House No"]}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. 123",name:"blockHouse"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Street Name"]}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. Orchard Road",name:"streetName"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"Level No"}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. 05",name:"level"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"Unit No"}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. 01",name:"unit"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"Building Name"}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g Orchard Towers",name:"buildingName"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Postal Code"]}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. 018956",name:"postalCode"})]})]}):(0,r.jsxs)("div",{className:"sprout-grid sprout-grid-cols-1 md:sprout-grid-cols-2 sprout-gap-4",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Address Line 1"]}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. 123 Maple Street",name:"addressLine1"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"Address Line 2"}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. Suite 4B",name:"addressLine2"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"City"}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. Los Angeles",name:"city"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"State"}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. California",name:"state"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Postal Code"]}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. 90001",name:"postalCode"})]})]}),(0,r.jsx)("p",{className:"sprout-text-sm sprout-font-semibold sprout-space-y-2",children:"Principal Place of Business"}),(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col",children:(0,r.jsxs)("div",{className:"checkbox-container mb-2",children:[(0,r.jsx)("input",{type:"checkbox",checked:c.isUseRegisteredAddress,onChange:function(e){return d(go({},c,{isUseRegisteredAddress:e.target.checked}))}}),(0,r.jsx)("label",{htmlFor:"is-apply-for-business-account",children:(0,r.jsx)("div",{className:"checkbox-label sprout-text-sm md:sprout-text-base",children:"Use registered address as principal place of business"})})]})}),!c.isUseRegisteredAddress&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-sp
1ace-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Country Address"]}),(0,r.jsx)(b.Z.select2,{name:"ppobCountry",placeholder:"Select country",options:(0,g.get)(w,"data.data",[]).map((function(e){return{label:e.description,value:e.countryIso2Code,icon:(0,r.jsx)("img",{className:"sprout-mr-3 sprout-h-6",src:e.countryFlagUrl,alt:""})}}))})]}),S?(0,r.jsxs)("div",{className:"sprout-grid sprout-grid-cols-1 md:sprout-grid-cols-2 sprout-gap-4",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Block / House No"]}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. 123",name:"ppobBlockHouse"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Street Name"]}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. Orchard Road",name:"ppobStreetName"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"Level No"}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. 01",name:"ppobLevel"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"Unit No"}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. 05",name:"ppobUnit"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"Building Name"}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g Orchard Towers",name:"ppobBuildingName"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Postal Code"]}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. 018956",name:"ppobPostalCode"})]})]}):(0,r.jsxs)("div",{className:"sprout-grid sprout-grid-cols-1 md:sprout-grid-cols-2 sprout-gap-4",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Address Line 1"]}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. 123 Maple Street",name:"ppobAddressLine1"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"Address Line 2"}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. Suite 4B",name:"ppobAddressLine2"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"City"}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. Los Angeles",name:"ppobCity"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm",children:"State"}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. California",name:"ppobState"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Postal Code"]}),(0,r.jsx)(b.Z.inputWithError,{placeholder:"e.g. 90001",name:"ppobPostalCode"})]})]})]})]}),(0,r.jsx)(D.iR,{primary:!0,className:"sprout-w-full mt-4 !sprout-text-sm md:sprout-text-base !sprout-font-semibold",disabled:!l,onClick:function(){return t(1)},children:"Next"})]})}function bo(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function No(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){bo(e,s,t[s])}))}return e}function Co(e){var s,t=e.index,o=e.arrayHelpers,n=e.values,a=e.setValues,i=(0,u.SS)().generalDropdownResponse,l=(0,g.get)(i,"data.data",[]).find((function(e){return"CurrencyISO3Letter"in e}));return(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-sp
1ace-y-4",children:[t>0&&(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-row sprout-items-center sprout-justify-between sprout-pt-8 sprout-pb-2",children:[(0,r.jsx)("p",{className:"sprout-text-base sprout-font-semibold",children:"Additional Share"}),(0,r.jsx)(D.iR,{tertiary:!0,onClick:function(){return o.remove(t)},children:"Delete"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Shares Type"]}),(0,r.jsx)(b.Z.select2,{name:"shareTypes.".concat(t,".shareType"),placeholder:"Select type",options:c.t8.map((function(e){return{label:e,value:e}}))})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," No. of Shares"]}),(0,r.jsx)(b.Z.inputCurrencyWithError,{placeholder:"Enter number",name:"shareTypes.".concat(t,".shareAllotted"),required:!0,onChange:function(e){var s=e.target.value,r=n.shareTypes;r[t]=No({},r[t],{shareAllotted:s,paidUpShareCapital:s,issuedShareCapital:s}),a(No({},n,{shareTypes:r}))},maskOptions:{allowDecimal:!1}})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Paid Up Capital"]}),(0,r.jsxs)("div",{className:"sprout-grid sprout-grid-cols-2 sprout-gap-2",children:[(0,r.jsx)(b.Z.select2,{name:"shareTypes.".concat(t,".shareCurrency"),placeholder:"Select currency",options:null===l||void 0===l||null===(s=l.CurrencyISO3Letter)||void 0===s?void 0:s.map((function(e){var s;return{label:null!==(s=new Intl.DisplayNames(["en"],{type:"currency"}).of(e))&&void 0!==s?s:"-",value:e,icon:(0,r.jsx)("div",{className:"sprout-flex sprout-text-sm sprout-font-semibold sprout-text-[rgba(2, 2, 2, 0.75)] sprout-mr-3",children:e})}}))}),(0,r.jsx)(b.Z.inputCurrencyWithError,{placeholder:"Enter amount",name:"shareTypes.".concat(t,".paidUpShareCapital"),required:!0,onChange:function(e){var s=e.target.value,r=n.shareTypes;r[t]=No({},r[t],{paidUpShareCapital:s,issuedShareCapital:s}),a(No({},n,{shareTypes:r}))}})]})]})]})}function Do(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function wo(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){Do(e,s,t[s])}))}return e}function ko(e,s){return function(e){if(Array.isArray(e))return e}(e)||function(e,s){var t=[],r=!0,o=!1,n=void 0;try{for(var a,i=e[Symbol.iterator]();!(r=(a=i.next()).done)&&(t.push(a.value),!s||t.length!==s);r=!0);}catch(l){o=!0,n=l}finally{try{r||null==i.return||i.return()}finally{if(o)throw n}}return t}(e,s)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var Oo=function(){var e=(0,u.SS)().emitter,s=(0,a.useRef)(N.q.getState()).current.setGlobalSnackbar,t=function(e,s,t,r){var o,n=e.shareholders[t],a=e.shareholders,i=e.officers;i[r]||(i[r]=a[r]);var l=(null===(o=n.corporateRepresentativeOf)||void 0===o?void 0:o.value)||n.corporateRepresentativeOf;if(l&&l!==r){var u=i[l].appointments,d=u.findIndex((function(e){return"Corporate Representative of"===e.position&&e.companyName===n.companyDetails.companyName}));-1!==d&&i[l].appointments.splice(d,1);var p=u.filter((function(e){return"Corporate Representative of"===e.position})).length,m=u.findIndex((function(e){return"Corporate Representative"===e.position}));-1!==m&&0===p&&u.length>1&&i[l].appointments.splice(m,1)}var f=e.officers[r].appointments,h=-1!==f.findIndex((function(e){return"Corporate Representative"===e.position}));-1!==f.findIndex((function(e){return"Corporate Representative of"===e.position&&e.companyName===n.companyDetails.companyName}))||f.push({companyName:n.companyDetails.companyName,position:"Corporate Representative of",status:"Active",isOutgoing:!1}),h||f.push({position:"Corporate Representative",status:"Active",isOutgoing:!1}),e.officers=Object.fromEntries(Object.entries(i).filter((function(e){var s=ko(e,2);s[0];return s[1].appointments.some((function(e){return c.UK.includes(e.position)&&"Active"===e.status}))}))),s(wo({},e))};return{handleOnOkAddShareholder:(0,a.useCallback)((function(r,o,n,a){var i,l,u=(0,g.cloneDeep)(r),c=(0,m.qX)(),d=(0,m.qX)(),p=u.shareholders,f=u.officers;if(o.shareTypes.length>0){var h=o.shareTypes.reduce((function(e,s){var t,r="".concat(s.shareType.value,"-").concat(s.shareCurrency.value);return e[r]||(e[r]={shareType:s.shareType.value,shareCurrency:s.shareCurrency.value,paidUpShareCapital:0,shareAllotted:0,issuedShareCapital:0}),e[r].paidUpShareCapital+=Hs.Z.currencyStringToNumber(s.paidUpShareCapital),e[r].issuedShareCapital+=Hs.Z.currencyStringToNumber(null!==(t=s.issuedShareCapital)&&void 0!==t?t:s.paidUpShareCapital),e[r].shareAllotted+=Hs.Z.currencyStringToNumber(s.shareAllotted),e}),{});l=Object.values(h)}var x="SG"===(0,g.get)(o,"country.value",null)?{country:(0,g.get)(o,"country.value",null)||"",blockHouse:o.blockHouse||"",streetName:o.streetName||"",level:o.level||"",unit:o.unit||"",buildingName:o.buildingName||"",postalCode:o.postalCode||""}:{country:(0,g.get)(o,"country.value",null)||"",city:o.city||"",state:o.state||"",addressLine1:o.addressLine1||"",addressLine2:o.addressLine2||"",postalCode:o.postalCode||""},v="SG"===(0,g.get)(o,"ppobCountry.value",null)?{country:(0,g.get)(o,"ppobCountry.value",null)||"",postalCode:o.ppobPostalCode||"",blockHouse:o.ppobBlockHouse||"",buildingName:o.ppobBuildingName||"",level:o.ppobLevel||"",unit:o.ppobUnit||"",streetName:o.ppobStreetName||""}:{country:(0,g.get)(o,"ppobCountry.value",null)||"",postalCode:o.ppobPostalCode||"",city:o.ppobCity||"",state:o.ppobState||"",addressLine1:o.ppobAddressLine1||"",addressLine2:o.ppobAddressLine2||""},y=o.isUseRegisteredAddress?wo({},x):v;y.isUseRegisteredAddress=o.isUseRegisteredAddress;var j,b=wo({_id:c,appointments:[{position:"Member",status:"Active",isOutgoing:!1}]},o.isAddCorpRep?{corporateRepresentativeOf:{label:o.fullName,value:d}}:{corporateRepresentativeOf:o.corporateRepresentativeOf}
1,{category:"CORPORATE",isApplicant:!1,companyDetails:{addresses:{registeredAddress:x,principalPlaceOfBusiness:y},companyName:o.companyName,documents:o.documents,legalDetails:{historyName:o.historyName,countryOfRegisteredBusiness:o.countryOfRegisteredBusiness.value,companyType:o.companyType.value,businessRegistrationNumber:o.businessRegistrationNumber},riskProfileAssessment:{countryOfOperations:[o.countryOfOperations.value],sourceOfFunds:o.sourceOfFunds,otherSourceOfFunds:o.otherSourceOfFunds}},documents:[],riskAssessment:{documents:[]},sharesDetails:l});if(p[c]=b,a(wo({},u,{shareholders:p})),o.isAddCorpRep){var N={_id:d,appointments:[],category:"INDIVIDUAL",isApplicant:o.isApplicant,personDetails:{contactDetails:{email:o.emailAddress},personalDetails:{fullName:o.fullName}},companyDetails:{documents:[],riskProfileAssessment:{countryOfOperations:[]}},documents:[],riskAssessment:{documents:[]},sharesDetails:[]};f[d]=N,a(wo({},u,{officers:f}))}((null===(i=b.corporateRepresentativeOf)||void 0===i?void 0:i.value)||b.corporateRepresentativeOf)&&t(u,a,c,(null===(j=b.corporateRepresentativeOf)||void 0===j?void 0:j.value)||b.corporateRepresentativeOf);return e.emit("@modal/toggle-shareholder",{shareholder:void 0,type:"close"}),n(),s("A new shareholder has been successfully added.","success")}),[e,s]),handleOnOkEditShareholder:(0,a.useCallback)((function(r,o,n,a,i){var l,u,c=(0,g.cloneDeep)(o),d=c.shareholders,p=c.officers,f=c.shareholders[r],h=n.companyName!==f.companyDetails.companyName,x=(0,m.qX)();if(n.shareTypes.length>0){var v=n.shareTypes.reduce((function(e,s){var t,r="".concat(s.shareType.value,"-").concat(s.shareCurrency.value);return e[r]||(e[r]={shareType:s.shareType.value,shareCurrency:s.shareCurrency.value,paidUpShareCapital:0,shareAllotted:0,issuedShareCapital:0}),e[r].paidUpShareCapital+=Hs.Z.currencyStringToNumber(s.paidUpShareCapital),e[r].issuedShareCapital+=Hs.Z.currencyStringToNumber(null!==(t=s.issuedShareCapital)&&void 0!==t?t:s.paidUpShareCapital),e[r].shareAllotted+=Hs.Z.currencyStringToNumber(s.shareAllotted),e}),{});u=Object.values(v)}var y="SG"===(0,g.get)(n,"country.value",null)?{country:(0,g.get)(n,"country.value",null)||"",blockHouse:n.blockHouse||"",streetName:n.streetName||"",level:n.level||"",unit:n.unit||"",buildingName:n.buildingName||"",postalCode:n.postalCode||""}:{country:(0,g.get)(n,"country.value",null)||"",city:n.city||"",state:n.state||"",addressLine1:n.addressLine1||"",addressLine2:n.addressLine2||"",postalCode:n.postalCode||""},j="SG"===(0,g.get)(n,"ppobCountry.value",null)?{country:(0,g.get)(n,"ppobCountry.value",null)||"",postalCode:n.ppobPostalCode||"",blockHouse:n.ppobBlockHouse||"",buildingName:n.ppobBuildingName||"",level:n.ppobLevel||"",unit:n.ppobUnit||"",streetName:n.ppobStreetName||""}:{country:(0,g.get)(n,"ppobCountry.value",null)||"",postalCode:n.ppobPostalCode||"",city:n.ppobCity||"",state:n.ppobState||"",addressLine1:n.ppobAddressLine1||"",addressLine2:n.ppobAddressLine2||""},b=n.isUseRegisteredAddress?wo({},y):j;b.isUseRegisteredAddress=n.isUseRegisteredAddress;var N,C=wo({},f,n.isAddCorpRep?{corporateRepresentativeOf:{label:n.fullName,value:x}}:{corporateRepresentativeOf:n.corporateRepresentativeOf},{category:"CORPORATE",isApplicant:!1,companyDetails:{addresses:{registeredAddress:y,principalPlaceOfBusiness:b},companyName:n.companyName,documents:n.documents,legalDetails:{historyName:n.historyName,countryOfRegisteredBusiness:n.countryOfRegisteredBusiness.value,companyType:n.companyType.value,businessRegistrationNumber:n.businessRegistrationNumber},riskProfileAssessment:{countryOfOperations:[n.countryOfOperations.value],sourceOfFunds:n.sourceOfFunds,otherSourceOfFunds:n.otherSourceOfFunds}},documents:[],riskAssessment:{documents:[]},sharesDetails:u});if(n.isAddCorpRep){var D={_id:x,appointments:[],category:"INDIVIDUAL",isApplicant:n.isApplicant,personDetails:{contactDetails:{email:n.emailAddress},personalDetails:{fullName:n.fullName}},companyDetails:{documents:[],riskProfileAssessment:{countryOfOperations:[]}},documents:[],riskAssessment:{documents:[]},sharesDetails:[]};p[x]=D,i(wo({},c,{officers:p}))}((null===(l=C.corporateRepresentativeOf)||void 0===l?void 0:l.value)||C.corporateRepresentativeOf)&&t(c,i,r,(null===(N=C.corporateRepresentativeOf)||void 0===N?void 0:N.value)||C.corporateRepresentativeOf);if(d[r]=C,i(wo({},c,{shareholders:d})),h){var w=p[C.corporateRepresentativeOf],k=w.appointments,O=k.findIndex((function(e){return e.companyName===f.companyDetails.companyName})),A=wo({},k[O],{companyName:n.companyName});p[w._id].appointments[O]=A}return e.emit("@modal/toggle-shareholder",{shareholder:void 0,type:"close"}),a(),s("Shareholder data successfully updated.","success")}),[e,s])}};function Ao(e){var s=e.setStep,t=e.parentValues,o=e.parentSetValues,n=e.values,i=e.setValues,l=e.isValid,u=e.resetForm,c=e.metaData,d=Oo(),p=d.handleOnOkAddShareholder,m=d.handleOnOkEditShareholder;return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-sp
1ace-y-4",children:(0,r.jsx)(w.FieldArray,{name:"shareTypes",render:function(e){return(0,r.jsxs)("div",{children:[n.shareTypes&&n.shareTypes.map((function(s,t){return(0,r.jsx)(Co,{index:t,arrayHelpers:e,values:n,setValues:i},t)})),(0,r.jsx)(D.iR,{tertiary:!0,className:"sprout-mt-4",onClick:function(){return e.insert(n.shareTypes?Object.keys(n.shareTypes).length+1:1,"")},children:"Add additional share types"})]})}})}),(0,r.jsxs)("div",{className:"sprout-grid sprout-grid-cols-2 sprout-gap-2",children:[(0,r.jsx)(D.iR,{className:"!sprout-text-sm md:sprout-text-base !sprout-font-semibold",secondary:!0,onClick:function(){return s(1)},children:"Previous"}),"add"===c.type&&(0,r.jsx)(D.iR,{className:"!sprout-text-sm md:sprout-text-base !sprout-font-semibold",primary:!0,disabled:!l,onClick:function(){p(t,n,u,o),s(0)},children:"Save"}),"edit-corporate"===c.type&&(0,r.jsx)(D.iR,{className:"!sprout-text-sm md:sprout-text-base !sprout-font-semibold",primary:!0,disabled:!l,onClick:function(){var e,r;m(null!==(r=null===(e=c.shareholder)||void 0===e?void 0:e._id)&&void 0!==r?r:"",t,n,u,o),s(0)},children:"Save Changes"})]})]})}var So=[{label:"Information Form",step:0},{label:"Corporate Representative",step:1},{label:"Share Details",step:2}];function Eo(e){var s=e.step;return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("header",{className:"sprout-flex sprout-flex-col sprout-p-6 sprout-gap-5 sprout-z-[1]",children:(0,r.jsxs)("div",{className:"sprout-w-full sprout-flex-col sprout-space-y-4",children:[(0,r.jsx)("div",{className:"sprout-flex sprout-justify-center sprout-cursor-pointer",children:So.map((function(e,t){var o=(0,r.jsx)(p.rl,{className:{path:"sprout-stroke-[#14213D]"}});return t===s?o=(0,r.jsx)(p.US,{className:{path:"sprout-stroke-[#14213D]"}}):t<s&&(o=(0,r.jsx)(p.o0,{})),(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col",onClick:function(){return e.onClick?e.onClick():null},children:(0,r.jsxs)("div",{className:"sprout-flex sprout-items-center",children:[o,t<So.length-1&&(0,r.jsx)("div",{className:"sprout-border-2 sprout-border-[#14213D] sprout-w-[64px] md:sprout-w-[136px]"})]})},t)}))}),(0,r.jsx)("div",{className:"sprout-flex sprout-space-x-2",children:So.map((function(e,t){return(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col",onClick:function(){return e.onClick?e.onClick():null},children:(0,r.jsx)("div",{className:"sprout-pt-1 sprout-text-xs sprout-leading-4 sprout-pr-2",children:(0,r.jsxs)("span",{className:(0,m.WD)([e.step!==s&&"sprout-text-[#757575]",e.step===s&&"sprout-font-semibold"]),children:[e.step+1,". ",e.label]})})},t)}))})]})})})}function Po(e){var s=e.onClose,t=e.parentValues,o=e.parentSetValues,n=qr().meta,a=(0,w.useFormikContext)(),i=a.values,l=a.setValues,u=a.setFieldValue,c=a.isValid,d=a.resetForm,p="";"add"===n.modalData.type&&(p="Add Corporate Shareholder"),"edit-corporate"===n.modalData.type&&(p="Edit Corporate Shareholder");var m=function(e){u("step",e)};return(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-4",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-w-full sprout-justify-center sprout-items-center",children:[(0,r.jsx)("span",{className:"sprout-text-base md:sprout-text-xl sprout-font-semibold sprout-text-center pr-1 md:p-0",children:p}),(0,r.jsx)("div",{className:"sprout-absolute sprout-right-5 sprout-cursor-pointer",onClick:function(){d(),s()},children:(0,r.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("mask",{id:"mask0_1663_4126",maskUnits:"userSpaceOnUse",x:"2",y:"2",width:"12",height:"12",children:(0,r.jsx)("path",{d:"M2.7879 2.13518C2.60765 1.95494 2.31542 1.95494 2.13518 2.13518C1.95494 2.31542 1.95494 2.60765 2.13518 2.7879L7.34729 8L2.13518 13.2121C1.95494 13.3923 1.95494 13.6846 2.13518 13.8648C2.31542 14.0451 2.60765 14.0451 2.7879 13.8648L8 8.65271L13.2121 13.8648C13.3923 14.0451 13.6846 14.0451 13.8648 13.8648C14.0451 13.6846 14.0451 13.3923 13.8648 13.2121L8.65271 8L13.8648 2.7879C14.0451 2.60765 14.0451 2.31542 13.8648 2.13518C13.6846 1.95494 13.3923 1.95494 13.2121 2.13518L8 7.34729L2.7879 2.13518Z",fill:"#8E8E8E"})}),(0,r.jsx)("g",{mask:"url(#mask0_1663_4126)",children:(0,r.jsx)("rect",{width:"16",height:"16",fill:"#121212"})})]})})]}),(0,r.jsx)("div",{className:"sprout-flex sprout-w-full sprout-justify-center sprout-items-center",children:(0,r.jsx)(Eo,{step:i.step})}),0===i.step&&(0,r.jsx)(jo,{setValues:l,parentValues:t,parentSetValues:o,values:i,setStep:m,isValid:c,meta:n}),1===i.step&&(0,r.jsx)(co,{setStep:m,parentValues:t,values:i,isValid:c,setValues:l,meta:n}),2===i.step&&(0,r.jsx)(Ao,{setStep:m,parentValues:t,parentSetValues:o,values:i,setValues:l,isValid:c,resetForm:d,metaData:n.modalData})]})}function To(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function Io(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){To(e,s,t[s])}))}return e}function Fo(e){var s,t,o,n,i,l,c,d,p,m,f,h,x,v,y,j,N,C,w,k,O,A,S,E,P,T,I,F,R,L,_,B,V,U,M,Z,q,W,G,K,H,z,Y,X,Q,$,J,ee,se,te,re,oe,ne,ae,ie,le,ue,ce,de,pe,me,fe,he,xe,ve,ye,ge,je,be,Ne,Ce,De,we,ke,Oe,Ae,Se,Ee,Pe,Te,Ie,Fe,Re,Le,_e,Be,Ve,Ue,Me,Ze,qe,We,Ge,Ke,He,ze,Ye,Xe,Qe,$e,Je,es,ss,ts,rs,os,ns,as,is,ls,us,cs,ds,ps,ms,fs,hs,xs,vs,ys,gs,js,bs,Ns,Cs,Ds,ws,ks,Os,As,Ss,Es,Ps,Ts,Is,Fs,Rs,Ls,_s,Bs,Vs,Us,Ms,Zs,qs,Ws,Gs,Ks,zs,Ys,Xs,Qs,$s,Js,et,st,tt,rt,ot,nt,at,it,lt,ut,ct,dt,pt,mt,ft,ht,xt,vt,yt,gt,jt,bt,Nt,Ct,Dt,wt,kt,Ot,At,St=e.isOpen,Et=e.onClose,Pt=e.parentValues,Tt=e.parentSetValues,It=qr().meta,Ft=(0,u.SS)().generalCountry,Rt=(0,a.useMemo)((function(){var e,s,t,r,o;return(null===(t=null===It||void 0===It||null===(e=It.modalData)||void 0===e||null===(s=e.shareholder)||void 0===s?void 0:s.corporateRepresentativeOf)||void 0===t?void 0:t.value)||(null===It||void 0===It||null===(r=It.modalData)||void 0===r||null===(o=r.shareholder)||void 0===o?void 0:o.corporateRepresentativeOf)}),[null===It||void 0===It||null===(s=It.modalData)||void 0===s||null===(t=s.shareholder)||void 0===t?void 0:t.corporateRepresentativeOf]),Lt=(0,g.find)(Pt.officers,{_id:Rt}),_t=(0,g.get)(Ft,"data.data",[]).map((function(e){return{label:e.description,value:e.countryIso2Code,icon:(0,r.jsx)("img",{className:"sprout-mr-3 sprout-h-6",src:e.countryFlagUrl,alt:""})}})),Bt=(0,g.get)(Ft,"data.data",[]).map((function(e){return{label:e.description,value:e.countryName,icon:(0,r.jsx)("img",{className:"sprout-mr-3 sprout-h-6",src:e.countryFlagUrl,alt:""})}})),Vt=Io({shareholderId:null!==(Ct=null===It||void 0===It||null===(o=It.modalData)||void 0===o||null===(n=o.shareholder)||void 0===n?void 0:n._id)&&void 0!==Ct?Ct:"",companyName:null!==(Dt=null===It||void 0===It||null===(i=It.modalData)||void 0===i||null===(l=i.shareholder)||void 0===l||null===(c=l.companyDetails)||void 0===c?void 0:c.companyName)&&void 0!==Dt?Dt:""},(null===It||void 0===It||null===(d=It.modalData)||void 0===d||null===(p=d.shareholder)||void 0===p||null===(m=p.companyDetails)||void 0===m||null===(f=m.legalDetails)||void 0===f?void 0:f.companyType)?(null===It||void 0===It||null===(h=It.modalData)||void 0===h||null===(x=h.shareholder)||void 0===x||null===(v=x.companyDetails)||void 0===v||null===(y=v.legalDetails)||void 0===y||null===(j=y.companyType)||void 0===j?void 0:j.value)?{companyType:null===It||void 0===It||null===(N=It.modalData)||void 0===N||null===(C=N.shareholder)||void 0===C||null===(w=C.companyDetails)||void 0===w||null===(k=w.legalDetails)||void 0===k?void 0:k.companyType}:{companyType:{label:null===It||void 0===It||null===(O=It.modalData)||void 0===O||null===(A=O.shareholder)||void 0===A||null===(S=A.companyDetails)||void 0===S||null===(E=S.legalDetails)||void 0===E?void 0:E.
1companyType,value:null===It||void 0===It||null===(P=It.modalData)||void 0===P||null===(T=P.shareholder)||void 0===T||null===(I=T.companyDetails)||void 0===I||null===(F=I.legalDetails)||void 0===F?void 0:F.companyType}}:"",(null===It||void 0===It||null===(R=It.modalData)||void 0===R||null===(L=R.shareholder)||void 0===L||null===(_=L.companyDetails)||void 0===_||null===(B=_.legalDetails)||void 0===B?void 0:B.countryOfRegisteredBusiness)?(null===It||void 0===It||null===(V=It.modalData)||void 0===V||null===(U=V.shareholder)||void 0===U||null===(M=U.companyDetails)||void 0===M||null===(Z=M.legalDetails)||void 0===Z||null===(q=Z.countryOfRegisteredBusiness)||void 0===q?void 0:q.value)?{countryOfRegisteredBusiness:null===It||void 0===It||null===(W=It.modalData)||void 0===W||null===(G=W.shareholder)||void 0===G||null===(K=G.companyDetails)||void 0===K||null===(H=K.legalDetails)||void 0===H?void 0:H.countryOfRegisteredBusiness}:{countryOfRegisteredBusiness:_t.find((function(e){var s,t,r,o;return(null===It||void 0===It||null===(s=It.modalData)||void 0===s||null===(t=s.shareholder)||void 0===t||null===(r=t.companyDetails)||void 0===r||null===(o=r.legalDetails)||void 0===o?void 0:o.countryOfRegisteredBusiness)===e.value}))}:"",(null===It||void 0===It||null===(z=It.modalData)||void 0===z||null===(Y=z.shareholder)||void 0===Y||null===(X=Y.companyDetails)||void 0===X||null===(Q=X.riskProfileAssessment)||void 0===Q?void 0:Q.countryOfOperations[0])?(null===(te=null===It||void 0===It||null===($=It.modalData)||void 0===$||null===(J=$.shareholder)||void 0===J||null===(ee=J.companyDetails)||void 0===ee||null===(se=ee.riskProfileAssessment)||void 0===se?void 0:se.countryOfOperations[0])||void 0===te?void 0:te.value)?{countryOfOperations:null===It||void 0===It||null===(re=It.modalData)||void 0===re||null===(oe=re.shareholder)||void 0===oe||null===(ne=oe.companyDetails)||void 0===ne||null===(ae=ne.riskProfileAssessment)||void 0===ae?void 0:ae.countryOfOperations[0]}:{countryOfOperations:Bt.find((function(e){var s,t,r,o;return(null===It||void 0===It||null===(s=It.modalData)||void 0===s||null===(t=s.shareholder)||void 0===t||null===(r=t.companyDetails)||void 0===r||null===(o=r.riskProfileAssessment)||void 0===o?void 0:o.countryOfOperations[0])===e.value}))}:"",{historyName:null!==(wt=null===It||void 0===It||null===(ie=It.modalData)||void 0===ie||null===(le=ie.shareholder)||void 0===le||null===(ue=le.companyDetails)||void 0===ue||null===(ce=ue.legalDetails)||void 0===ce?void 0:ce.historyName)&&void 0!==wt?wt:"",businessRegistrationNumber:null!==(kt=null===It||void 0===It||null===(de=It.modalData)||void 0===de||null===(pe=de.shareholder)||void 0===pe||null===(me=pe.companyDetails)||void 0===me||null===(fe=me.legalDetails)||void 0===fe?void 0:fe.businessRegistrationNumber)&&void 0!==kt?kt:"",documents:null!==(Ot=null===It||void 0===It||null===(he=It.modalData)||void 0===he||null===(xe=he.shareholder)||void 0===xe?void 0:xe.companyDetails.documents)&&void 0!==Ot?Ot:[],shareTypes:function(){var e,s,t=[];(null===(e=It.modalData.shareholder)||void 0===e?void 0:e.sharesDetails)?null===(s=It.modalData.shareholder)||void 0===s||s.sharesDetails.forEach((function(e){var s,o=new Intl.DisplayNames(["en"],{type:"currency"}),n=Io({},e,{shareType:{label:null===e||void 0===e?void 0:e.shareType,value:null===e||void 0===e?void 0:e.shareType},shareCurrency:{label:null!==(s=o.of(null===e||void 0===e?void 0:e.shareCurrency))&&void 0!==s?s:"-",value:null===e||void 0===e?void 0:e.shareCurrency,icon:(0,r.jsx)("div",{className:"sprout-flex sprout-text-sm sprout-font-semibold sprout-text-[rgba(2, 2, 2, 0.75)] sprout-mr-3",children:null===e||void 0===e?void 0:e.shareCurrency})}});t.push(n)})):t=[{issuedShareCapital:"",paidUpShareCapital:"",shareAllotted:"",shareCurrency:"",shareType:""}];return t}(),corporateRepresentativeOf:Lt?null===It||void 0===It||null===(ve=It.modalData)||void 0===ve||null===(ye=ve.shareholder)||void 0===ye?void 0:ye.corporateRepresentativeOf:null,step:0,isApplicant:null!==(At=null===(ge=It.modalData.shareholder)||void 0===ge?void 0:ge.isApplicant)&&void 0!==At&&At,isUseRegisteredAddress:(0,g.get)(It,"modalData.shareholder.companyDetails.addresses.principalPlaceOfBusiness.isUseRegisteredAddress",!1)},(null===It||void 0===It||null===(je=It.modalData)||void 0===je||null===(be=je.shareholder)||void 0===be||null===(Ne=be.companyDetails)||void 0===Ne||null===(Ce=Ne.addresses)||void 0===Ce||null===(De=Ce.registeredAddress)||void 0===De?void 0:De.country)?{country:_t.find((function(e){var s,t,r,o,n;return(null===It||void 0===It||null===(s=It.modalData)||void 0===s||null===(t=s.shareholder)||void 0===t||null===(r=t.companyDetails)||void 0===r||null===(o=r.addresses)||void 0===o||null===(n=o.registeredAddress)||void 0===n?void 0:n.country)===e.value}))}:"",(null===It||void 0===It||null===(we=It.modalData)||void 0===we||null===(ke=we.shareholder)||void 0===ke||null===(Oe=ke.companyDetails)||void 0===Oe||null===(Ae=Oe.addresses)||void 0===Ae||null===(Se=Ae.registeredAddress)||void 0===Se?void 0:Se.blockHouse)?{blockHouse:(0,g.get)(It,"modalData.shareholder.companyDetails.addresses.registeredAddress.blockHouse","")}:"",(null===It||void 0===It||null===(Ee=It.modalData)||void 0===Ee||null===(Pe=Ee.shareholder)||void 0===Pe||null===(Te=Pe.companyDetails)||void 0===Te||null===(Ie=Te.addresses)||void 0===Ie||null===(Fe=Ie.registeredAddress)||void 0===Fe?void 0:Fe.streetName)?{streetName:(0,g.get)(It,"modalData.shareholder.companyDetails.addresses.registeredAddress.streetName","")}:"",(null===It||void 0===It||null===(Re=It.modalData)||void 0===Re||null===(Le=Re.shareholder)||void 0===Le||null===(_e=Le.companyDetails)||void 0===_e||null===(Be=_e.addresses)||void 0===Be||null===(Ve=Be.registeredAddress)||void 0===Ve?void 0:Ve.level)?{level:(0,g.get)(It,"modalData.shareholder.companyDetails.addresses.registeredAddress.level","")}:"",(null===It||void 0===It||null===(Ue=It.modalData)||void 0===Ue||null===(Me=Ue.shareholder)||void 0===Me||null===(Ze=Me.companyDetails)||void 0===Ze||null===(qe=Ze.addresses)||void 0===qe||null===(We=qe.registeredAddress)||void 0===We?void 0:We.unit)?{unit:(0,g.get)(It,"modalData.shareholder.companyDetails.addresses.registeredAddress.unit","")}:"",(null===It||void 0===It||null===(Ge=It.modalData)||void 0===Ge||null===(Ke=Ge.shareholder)||void 0===Ke||null===(He=Ke.companyDetails)||void 0===He||null===(ze=He.addresses)||void 0===ze||null===(Ye=ze.registeredAddress)||void 0===Ye?void 0:Ye.buildingName)?{buildingName:(0,g.get)(It,"modalData.shareholder.companyDetails.addresses.registeredAddress.buildingName","")}:"",(null===It||void 0===It||null===(Xe=It.modalData)||void 0===Xe||null===(Qe=Xe.shareholder)||void 0===Qe||null===($e=Qe.companyDetails)||void 0===$e||null===(Je=$e.addresses)||void 0===Je||null===(es=Je.registeredAddress)||void 0===es?void 0:es.postalCode)?{postalCode:(0,g.get)(It,"modalData.shareholder.companyDetails.addresses.registeredAddress.postalCode","")}:"",(null===It||void 0===It||null===(ss=It.modalData)||void 0===ss||null===(ts=ss.shareholder)||void 0===ts||null===(rs=ts.companyDetails)||void 0===rs||null===(os=rs.addresses)||void 0===os||null===(ns=os.registeredAddress)||void 0===ns?void 0:ns.addressLine1)?{addressLine1:(0,g.get)(It,"modalData.shareholder.companyDetails.addresses.registeredAddress.addressLine1","")}:"",(null===It||void 0===It||null===(as=It.modalData)||void 0===as||null===(is=as.shareholder)||void 0===is||null===(ls=is.companyDetails)||void 0===ls||null===(u
1s=ls.addresses)||void 0===us||null===(cs=us.registeredAddress)||void 0===cs?void 0:cs.addressLine2)?{addressLine2:(0,g.get)(It,"modalData.shareholder.companyDetails.addresses.registeredAddress.addressLine2","")}:"",(null===It||void 0===It||null===(ds=It.modalData)||void 0===ds||null===(ps=ds.shareholder)||void 0===ps||null===(ms=ps.companyDetails)||void 0===ms||null===(fs=ms.addresses)||void 0===fs||null===(hs=fs.registeredAddress)||void 0===hs?void 0:hs.city)?{city:(0,g.get)(It,"modalData.shareholder.companyDetails.addresses.registeredAddress.city","")}:"",(null===It||void 0===It||null===(xs=It.modalData)||void 0===xs||null===(vs=xs.shareholder)||void 0===vs||null===(ys=vs.companyDetails)||void 0===ys||null===(gs=ys.addresses)||void 0===gs||null===(js=gs.registeredAddress)||void 0===js?void 0:js.state)?{state:(0,g.get)(It,"modalData.shareholder.companyDetails.addresses.registeredAddress.state","")}:"",(null===It||void 0===It||null===(bs=It.modalData)||void 0===bs||null===(Ns=bs.shareholder)||void 0===Ns||null===(Cs=Ns.companyDetails)||void 0===Cs||null===(Ds=Cs.addresses)||void 0===Ds||null===(ws=Ds.principalPlaceOfBusiness)||void 0===ws?void 0:ws.country)?{ppobCountry:_t.find((function(e){var s,t,r,o;return(null===(o=null===It||void 0===It||null===(s=It.modalData)||void 0===s||null===(t=s.shareholder)||void 0===t||null===(r=t.companyDetails)||void 0===r?void 0:r.addresses.principalPlaceOfBusiness)||void 0===o?void 0:o.country)===e.value}))}:"",(null===It||void 0===It||null===(ks=It.modalData)||void 0===ks||null===(Os=ks.shareholder)||void 0===Os||null===(As=Os.companyDetails)||void 0===As||null===(Ss=As.addresses)||void 0===Ss||null===(Es=Ss.principalPlaceOfBusiness)||void 0===Es?void 0:Es.blockHouse)?{ppobBlockHouse:(0,g.get)(It,"modalData.shareholder.companyDetails.addresses.principalPlaceOfBusiness.blockHouse","")}:"",(null===It||void 0===It||null===(Ps=It.modalData)||void 0===Ps||null===(Ts=Ps.shareholder)||void 0===Ts||null===(Is=Ts.companyDetails)||void 0===Is||null===(Fs=Is.addresses)||void 0===Fs||null===(Rs=Fs.principalPlaceOfBusiness)||void 0===Rs?void 0:Rs.streetName)?{ppobStreetName:(0,g.get)(It,"modalData.shareholder.companyDetails.addresses.principalPlaceOfBusiness.streetName","")}:"",(null===It||void 0===It||null===(Ls=It.modalData)||void 0===Ls||null===(_s=Ls.shareholder)||void 0===_s||null===(Bs=_s.companyDetails)||void 0===Bs||null===(Vs=Bs.addresses)||void 0===Vs||null===(Us=Vs.principalPlaceOfBusiness)||void 0===Us?void 0:Us.level)?{ppobLevel:(0,g.get)(It,"modalData.shareholder.companyDetails.addresses.principalPlaceOfBusiness.level","")}:"",(null===It||void 0===It||null===(Ms=It.modalData)||void 0===Ms||null===(Zs=Ms.shareholder)||void 0===Zs||null===(qs=Zs.companyDetails)||void 0===qs||null===(Ws=qs.addresses)||void 0===Ws||null===(Gs=Ws.principalPlaceOfBusiness)||void 0===Gs?void 0:Gs.unit)?{ppobUnit:(0,g.get)(It,"modalData.shareholder.companyDetails.addresses.principalPlaceOfBusiness.unit","")}:"",(null===It||void 0===It||null===(Ks=It.modalData)||void 0===Ks||null===(zs=Ks.shareholder)||void 0===zs||null===(Ys=zs.companyDetails)||void 0===Ys||null===(Xs=Ys.addresses)||void 0===Xs||null===(Qs=Xs.principalPlaceOfBusiness)||void 0===Qs?void 0:Qs.buildingName)?{ppobBuildingName:(0,g.get)(It,"modalData.shareholder.companyDetails.addresses.principalPlaceOfBusiness.buildingName","")}:"",(null===It||void 0===It||null===($s=It.modalData)||void 0===$s||null===(Js=$s.shareholder)||void 0===Js||null===(et=Js.companyDetails)||void 0===et||null===(st=et.addresses)||void 0===st||null===(tt=st.principalPlaceOfBusiness)||void 0===tt?void 0:tt.postalCode)?{ppobPostalCode:(0,g.get)(It,"modalData.shareholder.companyDetails.addresses.principalPlaceOfBusiness.postalCode","")}:"",(null===It||void 0===It||null===(rt=It.modalData)||void 0===rt||null===(ot=rt.shareholder)||void 0===ot||null===(nt=ot.companyDetails)||void 0===nt||null===(at=nt.addresses)||void 0===at||null===(it=at.principalPlaceOfBusiness)||void 0===it?void 0:it.addressLine1)?{ppobAddressLine1:(0,g.get)(It,"modalData.shareholder.companyDetails.addresses.principalPlaceOfBusiness.addressLine1","")}:"",(null===It||void 0===It||null===(lt=It.modalData)||void 0===lt||null===(ut=lt.shareholder)||void 0===ut||null===(ct=ut.companyDetails)||void 0===ct||null===(dt=ct.addresses)||void 0===dt||null===(pt=dt.principalPlaceOfBusiness)||void 0===pt?void 0:pt.addressLine2)?{ppobAddressLine2:(0,g.get)(It,"modalData.shareholder.companyDetails.addresses.principalPlaceOfBusiness.addressLine2","")}:"",(null===It||void 0===It||null===(mt=It.modalData)||void 0===mt||null===(ft=mt.shareholder)||void 0===ft||null===(ht=ft.companyDetails)||void 0===ht||null===(xt=ht.addresses)||void 0===xt||null===(vt=xt.principalPlaceOfBusiness)||void 0===vt?void 0:vt.city)?{ppobCity:(0,g.get)(It,"modalData.shareholder.companyDetails.addresses.principalPlaceOfBusiness.city","")}:"",(null===It||void 0===It||null===(yt=It.modalData)||void 0===yt||null===(gt=yt.shareholder)||void 0===gt||null===(jt=gt.companyDetails)||void 0===jt||null===(bt=jt.addresses)||void 0===bt||null===(Nt=bt.principalPlaceOfBusiness)||void 0===Nt?void 0:Nt.state)?{ppobState:(0,g.get)(It,"modalData.shareholder.companyDetails.addresses.principalPlaceOfBusiness.state","")}:"");return(0,r.jsx)(D.BT,{className:"sprout-w-[325px] md:sprout-w-[640px] sprout-max-h-[540px] sprout-overflow-auto !sprout-p-4",show:St,useBackgroun
1d:!0,onClose:Et,children:(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-4",children:(0,r.jsx)(b.Z.form,{onSubmit:function(){},initialValues:Vt,validation:function(e){return function(e,s){var t,r,o,n={},a=s.officers,i=s.shareholders;if(0===e.step&&(e.companyName||(n.companyName=""),e.companyType||(n.companyType=""),e.countryOfRegisteredBusiness||(n.countryOfRegisteredBusiness=""),e.countryOfOperations||(n.countryOfOperations=""),e.businessRegistrationNumber||(n.businessRegistrationNumber=""),0===(0,g.get)(e,"documents",[]).length&&(n.documents=""),e.country?"SG"===e.country.value?(e.blockHouse||(n.blockHouse="This field is required"),e.streetName||(n.streetName="This field is required"),e.postalCode||(n.postalCode="This field is required")):"SG"!==e.country.value&&(e.addressLine1||(n.addressLine1="This field is required"),e.postalCode||(n.postalCode="This field is required")):n.country="This field is required",e.ppobCountry||e.isUseRegisteredAddress?"SG"!==(null===(t=e.ppobCountry)||void 0===t?void 0:t.value)||e.isUseRegisteredAddress?"SG"===(null===(r=e.ppobCountry)||void 0===r?void 0:r.value)||e.isUseRegisteredAddress||(e.ppobAddressLine1||(n.ppobAddressLine1="This field is required"),e.ppobPostalCode||(n.ppobPostalCode="This field is required")):(e.ppobBlockHouse||(n.ppobBlockHouse="This field is required"),e.ppobStreetName||(n.ppobStreetName="This field is required"),e.ppobPostalCode||(n.ppobPostalCode="This field is required")):n.ppobCountry="This field is required"),1===e.step)if(e.isAddCorpRep)e.isApplicant||(e.fullName||(n.fullName=""),e.emailAddress&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e.emailAddress)&&(n.emailAddress="Invalid email address"),e.emailAddress||(n.emailAddress="")),(null===(o=e.IDNumberType)||void 0===o?void 0:o.value)||(n.IDNumberType=""),e.IDNumber||(n.IDNumber=""),e.contactNumber||(n.contactNumber=""),Object.keys(a).forEach((function(s){var t,r;s!==e.shareholderId&&(null===(t=a[s].personDetails.contactDetails)||void 0===t?void 0:t.email)&&Hs.Z.transformToLowerCase(null===(r=a[s].personDetails.contactDetails)||void 0===r?void 0:r.email)===Hs.Z.transformToLowerCase(e.emailAddress)&&(n.emailAddress="Email already existed")}
1)),Object.keys(i).forEach((function(s){var t;s!==e.shareholderId&&"INDIVIDUAL"===i[s].category&&Hs.Z.transformToLowerCase(null===(t=i[s].personDetails.contactDetails)||void 0===t?void 0:t.email)===Hs.Z.transformToLowerCase(e.emailAddress)&&(n.emailAddress="Email already existed")}));else if(!e.isAddCorpRep){var l;(null===(l=e.corporateRepresentativeOf)||void 0===l?void 0:l.value)||(n.corporateRepresentativeOf="")}return 2===e.step&&e.shareTypes.forEach((function(e){var s,t;(null===e||void 0===e||null===(s=e.shareType)||void 0===s?void 0:s.value)||(n.shareType=""),(null===e||void 0===e?void 0:e.shareAllotted)||(n.shareAllotted=""),(null===e||void 0===e||null===(t=e.shareCurrency)||void 0===t?void 0:t.value)||(n.shareCurrency=""),(null===e||void 0===e?void 0:e.paidUpShareCapital)||(n.paidUpShareCapital="")})),n}(e,Pt)},validateOnChange:!0,validateOnBlur:!0,validateOnMount:!0,children:(0,r.jsx)(Po,{onClose:Et,parentValues:Pt,parentSetValues:Tt})})})})}var Ro=function(e){var s=e.page,t=e.index,o=e.currentPage,n=e.e,a=t||s;return(0,r.jsx)(D.iR,{className:"sprout-w-8 !sprout-min-h-[32px] !sprout-p-0 !sprout-font-normal ".concat(a===o?"sprout-bg-primary":"sprout-border sprout-border-[#9c9c9b] !sprout-text-[#9c9c9b]"),onClick:function(){n.onChangePage(s,n.rowCount)},children:s})},Lo=function(e){var s=e.currentPage,t=void 0===s?1:s,o=e.rowCount,n=void 0===o?10:o,a=e.rowsPerPage,i=void 0===a?10:a,l=e.onChangePage,u=e.labelFor,c=Math.ceil(n/i),d=function(e){switch(e){case 0:return t-3;case 1:return t-2;case 2:return t-1;case 3:return t;case 4:return t+1;case 5:return t+2;case 6:return t+3;default:return t}};return(0,r.jsxs)("div",{className:"sprout-hidden md:sprout-flex md:sprout-flex-col lg:sprout-flex-row lg:sprout-items-center sprout-justify-between sprout-p-4",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-gap-2 lg:sprout-text-base sprout-whitespace-nowrap",children:[(0,r.jsx)("span",{children:"".concat((t-1)*i+1," - ").concat(t*i," from ").concat(n)}),(0,r.jsxs)("span",{className:"sprout-hidden md:sprout-block md:sprout-mb-2",children:[u," List"]})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-items-center sprout-gap-2",children:[(0,r.jsx)("img",{alt:"<",onClick:function(){1!==t&&l(t-1,n)},src:1!==t?"../assets/icon/transaction-table/previous-page.svg":"../assets/icon/transaction-table/previous-page-disabled.svg",className:"sprout-cursor-pointer"}),c<=9?Array(c).fill(null).map((function(s,o){return(0,r.jsx)(Ro,{currentPage:t,e:e,page:o+1},o)})):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Ro,{page:1,currentPage:t,e:e}),Array.from({length:7},(function(e,s){return s+2})).map((function(s,o){return t>4&&t<c-3?0===o||6===o?(0,r.jsx)("img",{alt:"...",src:"../assets/icon/transaction-table/ellipsis.svg"},o):(0,r.jsx)(Ro,{page:d(o),index:o,currentPage:3,e:e},o):t<=4?6===o?(0,r.jsx)("img",{alt:"...",src:"../assets/icon/transaction-table/ellipsis.svg"},o):(0,r.jsx)(Ro,{currentPage:t,e:e,page:s},o):0===o?(0,r.jsx)("img",{alt:"...",src:"../assets/icon/transaction-table/ellipsis.svg"},o):(0,r.jsx)(Ro,{currentPage:t,e:e,page:c+o-7},o)})),(0,r.jsx)(Ro,{currentPage:t,e:e,page:c})]}),(0,r.jsx)("img",{alt:">",className:"sprout-cursor-pointer",src:t!==c?"../assets/icon/transaction-table/next-page.svg":"../assets/icon/transaction-table/next-page-disabled.svg",onClick:function(){t!==c&&l(t+1,n)}}),(0,r.jsxs)("div",{className:"sprout-flex md:sprout-gap-2 md:sprout-items-center sprout-items-center sprout-gap-2",children:[(0,r.jsx)("span",{className:"lg:sprout-text-base sprout-text-[#000000A6] sprout-whitespace-nowrap",children:"Go to"}),(0,r.jsx)("input",{className:"sprout-w-12 lg:sprout-w-16 sprout-h-8 sprout-text-center !sprout-text-base",placeholder:String(t),style:{border:"1px solid #9B9B9B"},type:"text",onChange:function(e){var s=+e.target.value;!Number.isNaN(s)&&s>=1&&s<=c&&l(s)}})]})]})]})},_o=function(e){var s=e.currentPage,t=void 0===s?1:s,o=e.rowCount,n=void 0===o?100:o,a=e.rowsPerPage,i=void 0===a?10:a,l=e.onChangePage,u=Math.ceil(n/i),c=[];1===t?(c.push(t),u>1&&c.push(t+1),u>2&&c.push(t+2)):u===t?(u>2&&c.push(t-2),c.push(t-1),c.push(t)):(c.push(t-1),c.push(t),c.push(t+1));return(0,r.jsxs)("div",{className:"sprout-flex sprout-items-center sprout-justify-center md:sprout-hidden sm:sprout-justify-between sprout-p-3 sm:sprout-p-4 sprout-overflow-x-auto",children:[(0,r.jsx)("div",{className:"sprout-hidden sprout-gap-2 sm:sprout-flex sprout-text-base sprout-whitespace-nowrap",children:(0,r.jsx)("span",{children:"".concat((t-1)*i+1," - ").concat(t*i," from ").concat(n)})}),(0,r.jsxs)("div",{className:"sprout-flex sprout-items-center sprout-gap-2",children:[(0,r.jsx)("img",{alt:"<",className:"sprout-cursor-pointer",src:1!==t?"../assets/icon/transaction-table/previous-page.svg":"../assets/icon/transaction-table/previous-page-disabled.svg",onClick:function(){1!==t&&l(t-1,n)}}),c.map((function(s){return(0,r.jsx)("div",{children:(0,r.jsx)(Ro,{page:s,currentPage:t,e:e})},s)})),(0,r.jsx)("img",{alt:">",className:"sprout-cursor-pointer",src:t!==u?"../assets/icon/transaction-table/next-page.svg":"../assets/icon/transaction-table/next-page-disabled.svg",onClick:function(){t!==u&&l(t+1,n)}}),(0,r.jsxs)("div",{className:"sprout-flex sprout-items-center sprout-gap-2",children:[(0,r.jsx)("span",{className:"sprout-text-base sprout-text-[#000000A6] sprout-whitespace-nowrap",children:"Go to"}),(0,r.jsx)("input",{className:"sprout-w-12 sprout-h-8 sprout-text-center !sprout-text-base",placeholder:String(t),style:{border:"1px solid #9B9B9B"}
1,type:"text",onChange:function(e){var s=+e.target.value;!Number.isNaN(s)&&s>=1&&s<=u&&l(s)}})]})]})]})},Bo=t(17421),Vo=t(52119),Uo=function(e){var s=e.actions,t=e.onActionClick,o=(0,a.useState)(!1),n=o[0],i=o[1];return(0,r.jsxs)("div",{className:"sprout-relative",children:[(0,r.jsx)("div",{className:(0,m.WD)([n?"":"sprout-hidden","sprout-absolute sprout-top-12 sprout-right-2","sprout-w-44 sprout-rounded-md","sprout-bg-white sprout-shadow-lg sprout-ring-1 sprout-ring-black sprout-ring-opacity-5","sprout-overflow-hidden","sprout-cursor-pointer sprout-z-30"]),children:(0,r.jsx)(Vo.Z,{outsideCallback:function(){return i(!1)},children:s.map((function(e){return(0,r.jsx)("div",{className:"sprout-px-4 sprout-py-2 sprout-border-b sprout-border-[#DADADA] sprout-border-solid hover:sprout-bg-gray-100",onClick:function(){return t(e.value)},children:e.label},e.value)}))})}),(0,r.jsx)("div",{className:"sprout-max-w-max sprout-ml-auto sprout-p-3 sprout-rounded-full hover:sprout-bg-gray-300",onClick:function(){return i((function(e){return!e}))},children:(0,r.jsx)(Bo.t,{})})]})},Mo=[{label:"Edit",value:"edit"},{label:"Delete",value:"delete"}],Zo=[{label:"Edit",value:"edit-individual"},{label:"Delete",value:"delete"}],qo=[{label:"Edit",value:"edit-corporate"},{label:"Delete",value:"delete"}],Wo=function(e){var s=e.shareholder,t=(0,u.SS)().emitter;return{handleOnActionClick:(0,a.useCallback)((function(e){t.emit("@modal/toggle-shareholder",{shareholder:s,type:e})}),[s])}},Go=function(e){var s=e.className,t=e.label;return t?(0,r.jsx)("span",{className:(0,m.WD)(["sprout-inline sprout-text-xs sprout-text-center","sprout-px-[8px] sprout-rounded-full sm:sprout-py-[3px]",s]),children:t}):null};function Ko(e,s,t,r,o,n,a){try{var i=e[n](a),l=i.value}catch(u){return void t(u)}i.done?s(l):Promise.resolve(l).then(r,o)}function Ho(e){return function(){var s=this,t=arguments;return new Promise((function(r,o){var n=e.apply(s,t);function a(e){Ko(n,r,o,a,i,"next",e)}function i(e){Ko(n,r,o,a,i,"throw",e)}a(void 0)}))}}var zo=function(e){var s,t,o=e.shareholder,n=e.totalNumberOfShares,i=e.values,l=Wo({shareholder:o}).handleOnActionClick,c=(0,a.useMemo)((function(){var e;return(null===(e=o.corporateRepresentativeOf)||void 0===e?void 0:e.value)||o.corporateRepresentativeOf}),[o.corporateRepresentativeOf]),d=(0,g.find)(i.officers,{_id:c}),p=(0,u.SS)(),m=p.isAgentMode,f=p.emitter,h=(0,w.useFormikContext)().values,x=Er({emitter:f}).handleOnSave,v=Fe().setStakeholderStep,y=(0,a.useCallback)((function(e,s){return"FACIAL_VERIFICATION"===s?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"sprout-text-xs md:sprout-text-[14px] md:sprout-mt-[16px] md:sprout-mb-[8px] sprout-mt-[8px] sprout-mb-[8px] sprout-text-[#757575]",children:["You've chosen to provide the stakeholder information using:",(0,r.jsxs)("span",{className:"sprout-font-bold sprout-text-[12px] md:sprout-text-[14px]",children:[" ","Facial Verification"]})]}),(0,r.jsx)("div",{"data-id":"error-for-unfilledMember.".concat(e),children:(0,r.jsx)(D.iR,{secondary:!0,onClick:Ho(U().mark((function s(){var t;return U().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return t=v(h,e,0),s.next=3,x(t,!1);case 3:je.default.push("/kyc?type=facial-verification&id=".concat(e));case 4:case"end":return s.stop()}}),s)}))),children:"Edit Information"})})]}):"NOTARIZED_DOCUMENT"===s?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"sprout-text-xs md:sprout-text-[14px] md:sprout-mt-[16px] md:sprout-mb-[8px] sprout-mt-[8px] sprout-mb-[8px] sprout-text-[#757575]",children:["You've chosen to provide the stakeholder information using:",(0,r.jsxs)("span",{className:"sprout-font-bold sprout-text-[12px] md:sprout-text-[14px]",children:[" ","Notarized Document"]})]}),(0,r.jsx)("div",{"data-id":"error-for-unfilledMember.".concat(e),children:(0,r.jsx)(D.iR,{secondary:!0,onClick:Ho(U().mark((function s(){return U().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,x(h,!1);case 2:je.default.push("/kyc?type=notarized-document&id=".concat(e));case 3:case"end":return s.stop()}}),s)}))),children:"Edit Information"})})]}):(0,r.jsx)(r.Fragment,{})}),[h,x,v]),j=(0,a.useCallback)((function(e,s){return(0,r.jsxs)("div",{className:"sprout-w-full",children:[(0,r.jsx)("div",{className:"sprout-text-[14px] md:sprout-text-[16
1px]",children:"Personal Information"}),s?y(e,s):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"sprout-text-[12px] md:sprout-text-[14px] md:sprout-mt-[16px] md:sprout-mb-[8px] sprout-mt-[8px] sprout-mb-[8px]",children:"Please provide the stakeholder's personal information via one of these 2 methods:"}),(0,r.jsxs)("div",{className:"sprout-flex md:sprout-flex-row sprout-flex-col","data-id":"error-for-unfilledMember.".concat(e),children:[(0,r.jsx)(D.iR,{primary:!0,className:"sprout-w-fit",onClick:Ho(U().mark((function s(){return U().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,x(h,!1);case 2:je.default.push("/kyc?type=facial-verification&id=".concat(e));case 3:case"end":return s.stop()}}),s)}))),children:"Facial Verification"}),(0,r.jsx)("span",{className:"md:sprout-block sprout-hidden sprout-text-[14px] sprout-ml-[8px] sprout-mr-[8px] sprout-content-center",children:"or"}),(0,r.jsx)(D.iR,{className:"sprout-mt-[8px] md:sprout-mt-[0px] sprout-w-fit",secondary:!0,onClick:Ho(U().mark((function s(){return U().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,x(h,!1);case 2:je.default.push("/kyc?type=notarized-document&id=".concat(e));case 3:case"end":return s.stop()}}),s)}))),children:"Notarized Document"})]})]})]})}),[h,y,x]);return(0,r.jsxs)("div",{className:(0,He.W)(["sprout-hidden sm:sprout-grid sprout-grid-cols-12 sprout-gap-2 sprout-grid-rows-[min-content]","sprout-p-4 sprout-border-b sprout-border-[#DADADA] sprout-border-solid"]),children:[(0,r.jsxs)("div",{className:"sprout-col-span-4 sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-break-all",children:"INDIVIDUAL"===o.category?o.personDetails.personalDetails.fullName:o.companyDetails.companyName}),o.isApplicant?(0,r.jsx)(Go,{label:"This is me",className:"sprout-bg-[#FFF6E7] sprout-w-fit"}):(0,r.jsx)(r.Fragment,{}),(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:o.category}),o.corporateRepresentativeOf&&(0,g.get)(d,"personDetails.personalDetails.fullName",null)&&(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-sm",children:"Corporate Representative:"})," ",(0,r.jsx)("p",{className:"sprout-text-sm sprout-break-all",children:(0,g.get)(d,"personDetails.personalDetails.fullName","-")})]}),!m&&(0,r.jsx)("p",{className:"sprout-text-sm sprout-break-all",children:"INDIVIDUAL"===o.category&&(null===(s=o.personDetails.contactDetails)||void 0===s?void 0:s.email)}),null===(t=o.companyDetails.documents)||void 0===t?void 0:t.map((function(e){return(0,r.jsx)("div",{className:"sprout-border sprout-rounded-lg sprout-p-2 sprout-pl-5 sprout-pr-5 sprout-grid sprout-grid-flow-row sprout-grid-cols-8 sprout-gap-2 sprout-items-center",children:(0,r.jsx)("span",{className:"sprout-col-span-7 sprout-font-semibold sprout-cursor-pointer sprout-break-words",children:e.fileName})},e.documentId)}))]}),(0,r.jsx)("div",{className:"sprout-col-span-2 sprout-flex sprout-flex-col sprout-space-y-2",children:o.sharesDetails.map((function(e,s){return(0,r.jsx)("p",{className:"sprout-break-all",children:e.shareType},s)}))}),(0,r.jsx)("div",{className:"sprout-col-span-2 sprout-flex sprout-flex-col sprout-space-y-2",children:o.sharesDetails.map((function(e,s){return(0,r.jsx)("p",{className:"sprout-break-all",children:(0,ee.t)(e.shareAllotted,0)},s)}))}),(0,r.jsx)("div",{className:"sprout-col-span-2 sprout-flex sprout-flex-col sprout-space-y-2",children:o.sharesDetails.map((function(e,s){return(0,r.jsx)("p",{className:"sprout-break-all",children:(0,ee.Z)(e.paidUpShareCapital,e.shareCurrency)},s)}))}),(0,r.jsx)("div",{className:"sprout-col-span-1 sprout-space-y-2",children:o.sharesDetails.map((function(e,s){var t=e.shareAllotted/n*100;return(0,r.jsx)("p",{className:"sprout-break-all",children:t.toFixed(2)},s)}))}),(0,r.jsx)("div",{className:"sprout-col-span-1",children:(0,r.jsx)(Uo,{actions:"INDIVIDUAL"===o.category?Zo:qo,onActionClick:l})}),(0,r.jsxs)("div",{className:"sprout-col-span-12 sprout-flex sprout-flex-col",children:[m&&!o.isApplicant&&"INDIVIDUAL"===o.category&&j(o._id,o.agentEkycType),m&&o.isApplicant&&"INDIVIDUAL"===o.category&&(0,r.jsx)("p",{children:o.personDetail
1s.contactDetails.email})]})]})};function Yo(){return(0,r.jsxs)("div",{className:"sprout-flex-1 sprout-flex sprout-flex-col sprout-justify-center sprout-items-center sprout-mx-3 sprout-my-6",children:[(0,r.jsx)(We.default,{src:Ge.Gi,alt:"no records found",height:240,width:240}),(0,r.jsx)("div",{className:"sprout-px-2 sprout-mt-4 sprout-flex sprout-flex-col sprout-text-sm sprout-text-[#828282]",children:(0,r.jsx)("span",{className:"sprout-text-center",children:"Click the 'Add New' button and provide the required details to register a new shareholder you wish to include in your company's profile."})})]})}function Xo(e,s,t,r,o,n,a){try{var i=e[n](a),l=i.value}catch(u){return void t(u)}i.done?s(l):Promise.resolve(l).then(r,o)}function Qo(e){return function(){var s=this,t=arguments;return new Promise((function(r,o){var n=e.apply(s,t);function a(e){Xo(n,r,o,a,i,"next",e)}function i(e){Xo(n,r,o,a,i,"throw",e)}a(void 0)}))}}var $o=function(e){var s,t,o,n,i=e.shareholder,l=e.totalNumberOfShares,c=e.values,d=Wo({shareholder:i}).handleOnActionClick,p=(0,g.find)(c.officers,{_id:i.corporateRepresentativeOf}),m=(0,u.SS)(),f=m.isAgentMode,h=m.emitter,x=Er({emitter:h}).handleOnSave,v=(0,w.useFormikContext)().values,y=Fe().setStakeholderStep,j=(0,a.useCallback)((function(e,s){return"FACIAL_VERIFICATION"===s?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"sprout-text-[14px] md:sprout-text-[16px]",children:"Personal Information"}),(0,r.jsxs)("div",{className:"sprout-text-xs md:sprout-text-[14px] md:sprout-mt-[16px] md:sprout-mb-[8px] sprout-mt-[8px] sprout-mb-[8px] sprout-text-[#757575]",children:["You've chosen to provide the stakeholder information using:",(0,r.jsxs)("span",{className:"sprout-font-bold sprout-text-[12px] md:sprout-text-[14px]",children:[" ","Facial Verification"]})]}),(0,r.jsx)("div",{"data-id":"error-for-unfilledMember.".concat(e),children:(0,r.jsx)(D.iR,{secondary:!0,onClick:Qo(U().mark((function s(){var t;return U().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return t=y(v,e,0),s.next=3,x(t,!1);case 3:je.default.push("/kyc?type=facial-verification&id=".concat(e));case 4:case"end":return s.stop()}}),s)}))),children:"Edit Information"})})]}):"NOTARIZED_DOCUMENT"===s?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"sprout-text-[14px] md:sprout-text-[16px]",children:"Personal Information"}),(0,r.jsxs)("div",{className:"sprout-text-xs md:sprout-text-[14px] md:sprout-mt-[16px] md:sprout-mb-[8px] sprout-mt-[8px] sprout-mb-[8px] sprout-text-[#757575]",children:["You've chosen to provide the stakeholder information using:",(0,r.jsxs)("span",{className:"sprout-font-bold sprout-text-[12px] md:sprout-text-[14px]",children:[" ","Notarized Document"]})]}),(0,r.jsx)("div",{"data-id":"error-for-unfilledMember.".concat(e),children:(0,r.jsx)(D.iR,{secondary:!0,onClick:Qo(U().mark((function s(){return U().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,x(v,!1);case 2:je.default.push("/kyc?type=notarized-document&id=".concat(e));case 3:case"end":return s.stop()}}),s)}))),children:"Edit Information"})})]}):(0,r.jsx)(r.Fragment,{})}),[y,v,x]),b=(0,a.useCallback)((function(e,s){return(0,r.jsx)("div",{className:"sprout-w-full",children:s?j(e,s):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"sprout-text-[14px] md:sprout-text-[16px]",children:"Personal Information"}),(0,r.jsx)("div",{className:"sprout-text-xs md:sprout-text-[14px] md:sprout-mt-[16px] md:sprout-mb-[8px] sprout-mt-[8px] sprout-mb-[8px] sprout-text-[#757575]",children:"Please provide the stakeholder's personal information via one of these 2 methods:"}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col","data-id":"error-for-unfilledMember.".concat(e),children:[(0,r.jsx)(D.iR,{primary:!0,className:"sprout-w-[185px]",onClick:Qo(U().mark((function s(){return U().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,x(v,!1);case 2:je.default.push("/kyc?type=facial-verification&id=".concat(e));case 3:case"end":return s.stop()}}),s)}))),children:"Facial Verification"}),(0,r.jsx)(D.iR,{className:"sprout-mt-[8px] sprout-w-[215px]",secondary:!0,onClick:Qo(U().mark((function s(){return U().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,x(v,!1);case 2:je.default.push("/kyc?type=notarized-document&id=".concat(e));case 3:case"end":return s.stop()}}),s)}))),children:"Notarized Document"})]})]})})}),[j,x,v]),N=(0,a.useCallback)((function(){return"INDIVIDUAL"!==i.category?(0,r.jsx)(r.Fragment,{}):f?i.isApplicant?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"sprout-text-[14px] md:sprout-text-[16
1px]",children:"Personal Information"}),(0,r.jsx)("p",{className:"sprout-text-sm sprout-break-all sprout-mt-[8px]",children:"INDIVIDUAL"===i.category&&(null===(s=i.personDetails.contactDetails)||void 0===s?void 0:s.email)})]}):(0,r.jsx)("div",{children:b(i._id,i.agentEkycType)}):(0,r.jsx)("p",{className:"sprout-text-sm sprout-break-all",children:null===(e=i.personDetails.contactDetails)||void 0===e?void 0:e.email});var e,s}),[b,f,i._id,i.agentEkycType,i.category,i.isApplicant,null===(s=i.personDetails)||void 0===s||null===(t=s.contactDetails)||void 0===t?void 0:t.email]);return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsxs)("div",{className:(0,He.W)(["sprout-flex sm:sprout-hidden sprout-flex-row sprout-gap-3 sprout-justify-between","sprout-px-4 sprout-py-2"]),children:[(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-gap-3",children:(0,r.jsxs)("div",{className:"sprout-col-span-5 sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("p",{className:"sprout-break-all",children:"INDIVIDUAL"===i.category?i.personDetails.personalDetails.fullName:i.companyDetails.companyName}),i.isApplicant&&!f?(0,r.jsx)(Go,{label:"This is me",className:"sprout-bg-[#FFF6E7] sprout-w-fit"}):(0,r.jsx)(r.Fragment,{}),(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:i.category}),i.corporateRepresentativeOf&&(0,g.get)(p,"personDetails.personalDetails.fullName",null)&&(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-sm",children:"Corporate Representative:"})," ",(0,r.jsx)("p",{className:"sprout-text-sm sprout-break-all",children:(0,g.get)(p,"personDetails.personalDetails.fullName","-")})]}),N()]})}),(0,r.jsx)("div",{className:"sprout-col-span-1",children:(0,r.jsx)(Uo,{actions:"INDIVIDUAL"===i.category?Zo:qo,onActionClick:d})})]}),!!(null===(o=i.companyDetails.documents)||void 0===o?void 0:o.length)&&(0,r.jsx)("div",{className:(0,He.W)(["sprout-flex sm:sprout-hidden sprout-flex-col sprout-gap-2","sprout-px-4 sprout-py-2"]),children:null===(n=i.companyDetails.documents)||void 0===n?void 0:n.map((function(e){return(0,r.jsx)("div",{className:"sprout-border sprout-rounded-lg sprout-p-2 sprout-pl-5 sprout-pr-5 sprout-grid sprout-grid-flow-row sprout-grid-cols-8 sprout-gap-2 sprout-items-center",children:(0,r.jsx)("span",{className:"sprout-col-span-7 sprout-font-semibold sprout-cursor-pointer sprout-break-words",children:e.fileName})},e.documentId)}))}),(0,r.jsx)("div",{className:(0,He.W)(["sprout-px-4 sprout-py-2"]),children:(0,r.jsxs)("div",{className:"sprout-flex sm:sprout-hidden sprout-flex-col sprout-border-[1px] sprout-border-[#DADADA] sprout-border-solid sprout-rounded-lg",children:[(0,r.jsxs)("div",{className:(0,He.W)(["sprout-bg-[#FAFAFA]","sprout-items-center sprout-grid sprout-grid-cols-12 sprout-gap-3","sprout-h-16 sprout-p-2 sprout-rounded-lg","sprout-text-xs"]),children:[(0,r.jsx)("div",{className:"sprout-col-span-3 sprout-flex sprout-justify-between sprout-items-center",children:(0,r.jsx)("p",{className:"sprout-text-[10px]",children:"Share Type"})}),(0,r.jsx)("div",{className:"sprout-col-span-3",children:(0,r.jsx)("p",{className:"sprout-text-[10px]",children:"No. of Shares"})}),(0,r.jsx)("div",{className:"sprout-col-span-3 sprout-flex sprout-justify-between sprout-items-center",children:(0,r.jsx)("p",{className:"sprout-text-[10px]",children:"Paid-up and Issued"})}),(0,r.jsx)("div",{className:"sprout-col-span-3",children:(0,r.jsx)("p",{className:"sprout-text-[10px]",children:"Percentage (%)"})})]}),i.sharesDetails.map((function(e,s){var t,o,n,a=e.shareAllotted/l*100;return(0,r.jsxs)("div",{className:(0,He.W)(["sprout-grid sprout-grid-cols-12 sprout-grid-rows-[min-content] sprout-gap-3","sprout-p-4"]),children:[(0,r.jsx)("div",{className:"sprout-col-span-3 sprout-flex sprout-justify-between",children:(0,r.jsx)("p",{className:"sprout-text-[10px] sprout-break-all",children:null!==(t=e.shareType)&&void 0!==t?t:""})}),(0,r.jsx)("div",{className:"sprout-col-span-3",children:(0,r.jsx)("p",{className:"sprout-text-[10px] sprout-break-all",children:null!==(o=(0,ee.t)(e.shareAllotted,0))&&void 0!==o?o:""})}),(0,r.jsx)("div",{className:"sprout-col-span-3",children:(0,r.jsx)("p",{className:"sprout-text-[10px] sprout-break-all",children:(0,ee.Z)(e.paidUpShareCapital,e.shareCurrency)})}),(0,r.jsx)("div",{className:"sprout-col-span-3",children:(0,r.jsx)("p",{className:"sprout-text-[10px] sprout-break-all",children:null!==(n=a.toFixed(2))&&void 0!==n?n:""})})]},s)}))]})}),(0,r.jsx)("div",{className:"sprout-py-2 sprout-border-b sprout-border-[#DADADA] sprout-border-solid"})]})};function Jo(e,s){return function(e){if(Array.isArray(e))return e}(e)||function(e,s){var t=[],r=!0,o=!1,n=void 0;try{for(var a,i=e[Symbol.iterator]();!(r=(a=i.next()).done)&&(t.push(a.value),!s||t.length!==s);r=!0);}catch(l){o=!0,n=l}finally{try{r||null==i.return||i.return()}finally{if(o)throw n}}return t}
1(e,s)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var en=function(e){var s=e.shareholders,t=e.values;if(!s.length)return(0,r.jsx)("div",{className:"sprout-flex-1 sprout-flex",children:(0,r.jsx)(Yo,{})});var o=0;return s.forEach((function(e){var s=Jo(e,2)[1];Object.keys(s.sharesDetails).forEach((function(e){o+=Number(s.sharesDetails[e].shareAllotted)}))})),(0,r.jsx)(a.Fragment,{children:(0,r.jsx)("div",{className:"sprout-flex-1 sprout-overflow-scroll sprout-min-h-96",children:s.map((function(e){var s=Jo(e,2),n=s[0],i=s[1];return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)(zo,{values:t,shareholder:i,totalNumberOfShares:o},"shareholder-desktop-".concat(n)),(0,r.jsx)($o,{values:t,shareholder:i,totalNumberOfShares:o},"shareholder-mobile-".concat(n))]},"shareholder-".concat(n))}))})})},sn=function(){var e=(0,He.W)(["sprout-bg-[#FAFAFA]","sprout-hidden sprout-items-center md:sprout-grid md:sprout-grid-cols-12 sprout-gap-2","sprout-h-16 sprout-py-4 sprout-px-3","sprout-text-xs"]);return(0,r.jsxs)("div",{className:e,children:[(0,r.jsxs)("div",{className:"sprout-col-span-4 sprout-flex sprout-justify-between sprout-items-center",children:[(0,r.jsx)("p",{children:"Name"}),(0,r.jsx)(Q.Qr,{})]}),(0,r.jsx)("div",{className:"sprout-col-span-2",children:(0,r.jsx)("p",{children:"Share Type"})}),(0,r.jsx)("div",{className:"sprout-col-span-2",children:(0,r.jsx)("p",{children:"No of Shares"})}),(0,r.jsx)("div",{className:"sprout-col-span-2",children:(0,r.jsx)("p",{children:"Paid-up and Issued"})}),(0,r.jsx)("div",{className:"sprout-col-span-1",children:(0,r.jsx)("p",{children:"Percentage (%)"})}),(0,r.jsx)("div",{className:"sprout-col-span-1"})]})},tn=function(e){var s=e.values,t=(0,a.useState)(1),o=t[0],n=t[1],i=Object.keys(s.shareholders).length,l=Object.entries(s.shareholders).slice(5*(o-1),5*o);return(0,r.jsxs)("div",{className:"sprout-flex-1 sprout-flex sprout-flex-col sprout-overflow-hidden",children:[(0,r.jsx)(sn,{}),(0,r.jsx)(en,{shareholders:l,values:s}),(0,r.jsx)(Lo,{labelFor:"Shareholder",currentPage:o,rowCount:i,rowsPerPage:5,onChangePage:n}),(0,r.jsx)(_o,{currentPage:o,rowCount:i,rowsPerPage:5,onChangePage:n})]})};function rn(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function on(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){rn(e,s,t[s])}))}return e}function nn(e,s){return function(e){if(Array.isArray(e))return e}(e)||function(e,s){var t=[],r=!0,o=!1,n=void 0;try{for(var a,i=e[Symbol.iterator]();!(r=(a=i.next()).done)&&(t.push(a.value),!s||t.length!==s);r=!0);}catch(l){o=!0,n=l}finally{try{r||null==i.return||i.return()}finally{if(o)throw n}}return t}(e,s)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var an=function(){var e=(0,u.SS)().emitter,s=(0,a.useRef)(N.q.getState()).current.setGlobalSnackbar;return{handleOnOkDeleteShareholder:(0,a.useCallback)((function(t,r,o){var n=(0,g.cloneDeep)(t),a=Object.fromEntries(Object.entries(n.shareholders).filter((function(e){return nn(e,1)[0]!==(null===o||void 0===o?void 0:o._id)})));Object.keys(n.officers).forEach((function(e){var s=n.officers[e].appointments.filter((function(e){return"Corporate Representative of"===e.position&&e.companyName!==(null===o||void 0===o?void 0:o.companyDetails.companyName)}));n.officers[e].appointments=s})),Object.keys(n.officers).forEach((function(e){var s=n.officers[e].appointments.filter((function(e){return e.memberId!==(null===o||void 0===o?void 0:o._id)}));n.officers[e].appointments=s}));var i=Object.fromEntries(Object.entries(n.officers).filter((function(e){return nn(e,1)[0]!==(null===o||void 0===o?void 0:o._id)})));return r(on({},n,{officers:on({},i),shareholders:on({},a)})),e.emit("@modal/toggle-shareholder",{shareholder:void 0,type:"close"}),s("Stakeholder data successfully deleted","success")}),[e,s])}};function ln(e){var s=e.isOpen,t=e.onClose,o=e.parentValues,n=e.parentSetValues,a=qr().meta,i=an().handleOnOkDeleteShareholder,l=a.modalData.shareholder;return(0,r.jsx)(D.BT,{className:"sprout-w-[325px] md:sprout-w-[400px] !sprout-p-4",show:s,useBackgroun
1d:!0,onClose:t,children:(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-4 sprout-text-center",children:[(0,r.jsx)("h2",{className:"sprout-text-base sprout-font-semibold sprout-mb-4",children:"Confirm Deletion"}),(0,r.jsxs)("p",{children:["Are you sure you want to delete"," ",(0,r.jsx)("span",{className:"sprout-font-semibold",children:"INDIVIDUAL"===(null===l||void 0===l?void 0:l.category)?null===l||void 0===l?void 0:l.personDetails.personalDetails.fullName:null===l||void 0===l?void 0:l.companyDetails.companyName})," ","from the list?"]}),(0,r.jsx)("p",{children:"All the data will be permanently removed and cannot be recovered."}),(0,r.jsxs)("div",{className:"sprout-grid sprout-grid-cols-2 sprout-gap-4",children:[(0,r.jsx)(D.iR,{secondary:!0,onClick:t,children:"Cancel"}),(0,r.jsx)(D.iR,{primary:!0,red:!0,onClick:function(){return i(o,n,l)},children:"Delete"})]})]})})}function un(e){var s=e.values,t=e.setValues,o=(0,u.SS)().emitter,n=qr(),i=n.addShareholder,l=n.individualShareholder,c=n.corporateShareholder,d=n.deleteShareholder;return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)(Wr,{isOpen:i.isOpen,onClose:i.onClose}),(0,r.jsx)(ao,{isOpen:l.isOpen,onClose:l.onClose,parentValues:s,parentSetValues:t}),(0,r.jsx)(Fo,{isOpen:c.isOpen,onClose:c.onClose,parentValues:s,parentSetValues:t}),(0,r.jsx)(ln,{isOpen:d.isOpen,onClose:d.onClose,parentValues:s,parentSetValues:t}),(0,r.jsxs)("div",{className:(0,m.WD)(["sprout-relative sprout-flex sprout-flex-col","sprout-mb-8 sprout-border sprout-border-[#CDCDCD] sprout-border-solid sprout-rounded-[16px]","sprout-overflow-hidden"]),children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-justify-between sprout-p-4 sprout-items-center",children:[(0,r.jsx)("h3",{className:"sprout-font-semibold",children:"Shareholder Listing"}),(0,r.jsxs)(D.iR,{primary:!0,onClick:function(){return o.emit("@modal/toggle-shareholder",{shareholder:void 0,type:"add"})},"data-id":"error-for-shareholders",children:[(0,r.jsx)("span",{className:"sprout-hidden md:sprout-block sprout-font-semibold",children:"Add New Shareholder"}),(0,r.jsx)("span",{className:"md:sprout-hidden sprout-block",children:"+"})]})]}),(0,r.jsx)("div",{className:"sprout-border-solid sprout-border-[#C4C4C4] sprout-border-b-[1px]"}),(0,r.jsx)(tn,{values:s})]})]})}var cn=function(){var e=(0,u.SS)().emitter,s=(0,K.Z)(),t=(0,K.Z)(),r=(0,a.useState)({officer:void 0,type:""}),o=r[0],n=r[1],i=(0,a.useCallback)((function(e){switch(e.type){case"add":case"edit":s.onOpen();break;case"close":s.onClose(),t.onClose();break;case"delete":t.onOpen()}n(e)}),[s,t]);return(0,a.useEffect)((function(){return e.on("@modal/add-director",i),function(){e.off("@modal/add-director",i)}}),[i,s.onOpen,s.onToggle,e]),{meta:{modalData:o},addOfficer:s,deleteOfficer:t}};function dn(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function pn(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){dn(e,s,t[s])}))}return e}function mn(e,s){return function(e){if(Array.isArray(e))return e}(e)||function(e,s){var t=[],r=!0,o=!1,n=void 0;try{for(var a,i=e[Symbol.iterator]();!(r=(a=i.next()).done)&&(t.push(a.value),!s||t.length!==s);r=!0);}catch(l){o=!0,n=l}finally{try{r||null==i.return||i.return()}finally{if(o)throw n}}return t}(e,s)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var fn=function(){var e=(0,u.SS)().emitter,s=(0,y.a)().profileState.profile,t=(0,a.useRef)(N.q.getState()).current.setGlobalSnackbar;return{handleOnOkAddDirector:(0,a.useCallback)((function(r,o,n,a){var i,l=(0,g.cloneDeep)(r),u=(0,m.qX)();if(o.shareTypes.length>0){var c=o.shareTypes.reduce((function(e,s){var t,r="".concat(s.shareType.value,"-").concat(s.shareCurrency.value);return e[r]||(e[r]={shareType:s.shareType.value,shareCurrency:s.shareCurrency.value,paidUpShareCapital:0,shareAllotted:0,issuedShareCapital:0}),e[r].paidUpShareCapital+=Hs.Z.currencyStringToNumber(s.paidUpShareCapital),e[r].issuedShareCapital+=Hs.Z.currencyStringToNumber(null!==(t=s.issuedShareCapital)&&void 0!==t?t:s.paidUpShareCapital),e[r].shareAllotted+=Hs.Z.currencyStringToNumber(s.shareAllotted),e}),{});i=Object.values(c)}var d=o.isApplicant?o.isApplicant:Hs.Z.checkThisIsMe(o.emailAddress,null===s||void 0===s?void 0:s.emailAddresses[0]),p={_id:u,appointments:[{position:"Director",status:"Active",isOutgoing:!1}
1],category:"INDIVIDUAL",isApplicant:d,personDetails:{contactDetails:{email:d?null===s||void 0===s?void 0:s.emailAddresses[0]:o.emailAddress},personalDetails:{fullName:d?"".concat(null===s||void 0===s?void 0:s.callFirstName," ").concat(null===s||void 0===s?void 0:s.callLastName):o.fullName}},companyDetails:{documents:[],riskProfileAssessment:{countryOfOperations:[]}},documents:[],riskAssessment:{documents:[]},sharesDetails:o.isAddShareholderPosition?i:[]};o.isAddShareholderPosition&&p.appointments.push({position:"Member",status:"Active",isOutgoing:!1});var f=l.officers;if(f[u]=p,a(pn({},l,{officers:f})),o.isAddShareholderPosition){var h=l.shareholders;h[u]=p,a(pn({},l,{shareholders:h}))}return n(),e.emit("@modal/add-director",{officer:void 0,type:"close"}),t("A new officer has been added successfully.","success")}),[e,null===s||void 0===s?void 0:s.callFirstName,null===s||void 0===s?void 0:s.callLastName,null===s||void 0===s?void 0:s.emailAddresses,t]),handleOnOkEditDirector:(0,a.useCallback)((function(r,o,n,a,i){var l,u=(0,g.cloneDeep)(o),c=u.officers[r];if(n.shareTypes.length>0){var d=n.shareTypes.reduce((function(e,s){var t,r="".concat(s.shareType.value,"-").concat(s.shareCurrency.value);return e[r]||(e[r]={shareType:s.shareType.value,shareCurrency:s.shareCurrency.value,paidUpShareCapital:0,shareAllotted:0,issuedShareCapital:0}),e[r].paidUpShareCapital+=Hs.Z.currencyStringToNumber(s.paidUpShareCapital),e[r].issuedShareCapital+=Hs.Z.currencyStringToNumber(null!==(t=s.issuedShareCapital)&&void 0!==t?t:s.paidUpShareCapital),e[r].shareAllotted+=Hs.Z.currencyStringToNumber(s.shareAllotted),e}),{});l=Object.values(d)}var p=n.isApplicant?n.isApplicant:Hs.Z.checkThisIsMe(n.emailAddress,null===s||void 0===s?void 0:s.emailAddresses[0]),m=pn({},c,{isApplicant:p,personDetails:{contactDetails:{email:p?null===s||void 0===s?void 0:s.emailAddresses[0]:n.emailAddress},personalDetails:{fullName:p?"".concat(null===s||void 0===s?void 0:s.callFirstName," ").concat(null===s||void 0===s?void 0:s.callLastName):n.fullName}},sharesDetails:n.isAddShareholderPosition?l:[]});n.isAddShareholderPosition?0===m.appointments.filter((function(e){return"Member"===e.position})).length&&m.appointments.push({position:"Member",status:"Active",isOutgoing:!1}):m.appointments=m.appointments.filter((function(e){return"Member"!==e.position}));var f=u.officers;if(f[r]=pn({},m),i(pn({},u,{officers:f})),n.isAddShareholderPosition){var h=u.shareholders;h[r]=m,i(pn({},u,{shareholders:h}))}if(!n.isAddShareholderPosition&&(0,g.find)(u.shareholders,{_id:r})){var x=u.shareholders;i(pn({},u,{shareholders:pn({},Object.fromEntries(Object.entries(x).filter((function(e){return mn(e,1)[0]!==r}))))}))}return a(),e.emit("@modal/add-director",{officer:void 0,type:"close"}),t("Officer data successfully updated.","success")}),[e,null===s||void 0===s?void 0:s.callFirstName,null===s||void 0===s?void 0:s.callLastName,null===s||void 0===s?void 0:s.emailAddresses,t]),handleOnOkDeleteDirector:(0,a.useCallback)((function(s,r,o){var n=(0,g.cloneDeep)(s),a=n.officers,i=n.shareholders,l=Object.fromEntries(Object.entries(a).filter((function(e){return mn(e,1)[0]!==(null===o||void 0===o?void 0:o._id)}))),u=Object.fromEntries(Object.entries(i).filter((function(e){return mn(e,1)[0]!==(null===o||void 0===o?void 0:o._id)})));return Object.keys(u).forEach((function(e){u[e].corporateRepresentativeOf===(null===o||void 0===o?void 0:o._id)&&(u[e].corporateRepresentativeOf="")})),r(pn({},n,{officers:pn({},l),shareholders:pn({},u)})),e.emit("@modal/add-director",{officer:void 0,type:"close"}),t("Stakeholder data successfully deleted","success")}),[e,t])}};function hn(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function xn(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){hn(e,s,t[s])}))}return e}function vn(e){var s,t=e.index,o=e.arrayHelpers,n=e.values,a=e.setValues,i=(0,u.SS)().generalDropdownResponse,l=(0,g.get)(i,"data.data",[]).find((function(e){return"CurrencyISO3Letter"in e}));return(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-sp
1ace-y-4",children:[t>0&&(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-row sprout-items-center sprout-justify-between sprout-pt-8 sprout-pb-2",children:[(0,r.jsx)("p",{className:"sprout-text-base sprout-font-semibold",children:"Additional Share"}),(0,r.jsx)(D.iR,{tertiary:!0,onClick:function(){return o.remove(t)},children:"Delete"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Shares Type"]}),(0,r.jsx)(b.Z.select2,{name:"shareTypes.".concat(t,".shareType"),placeholder:"Select type",options:c.t8.map((function(e){return{label:e,value:e}}))})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," No. of Shares"]}),(0,r.jsx)(b.Z.inputCurrencyWithError,{placeholder:"Enter number",name:"shareTypes.".concat(t,".shareAllotted"),required:!0,onChange:function(e){var s=e.target.value,r=n.shareTypes;r[t]=xn({},r[t],{shareAllotted:s,paidUpShareCapital:s,issuedShareCapital:s}),a(xn({},n,{shareTypes:r}))},maskOptions:{allowDecimal:!1}})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Paid Up Capital"]}),(0,r.jsxs)("div",{className:"sprout-grid sprout-grid-cols-2 sprout-gap-2 sprout-h-auto",children:[(0,r.jsx)(b.Z.select2,{name:"shareTypes.".concat(t,".shareCurrency"),placeholder:"Select currency",options:null===l||void 0===l||null===(s=l.CurrencyISO3Letter)||void 0===s?void 0:s.map((function(e){var s;return{label:null!==(s=new Intl.DisplayNames(["en"],{type:"currency"}).of(e))&&void 0!==s?s:"-",value:e,icon:(0,r.jsx)("div",{className:"sprout-flex sprout-text-sm sprout-font-semibold sprout-text-[rgba(2, 2, 2, 0.75)] sprout-mr-3",children:e})}}))}),(0,r.jsx)(b.Z.inputCurrencyWithError,{placeholder:"Enter amount",name:"shareTypes.".concat(t,".paidUpShareCapital"),required:!0,onChange:function(e){var s=e.target.value,r=n.shareTypes;r[t]=xn({},r[t],{paidUpShareCapital:s,issuedShareCapital:s}),a(xn({},n,{shareTypes:r}))}})]})]})]})}function yn(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function gn(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){yn(e,s,t[s])}))}return e}var jn=function(e){var s=e.parentValues,t=e.setValues,o=fn().handleOnOkAddDirector,n=(0,w.useFormikContext)(),a=n.isValid,i=n.values,l=n.resetForm;return(0,r.jsx)(D.iR,{primary:!0,className:"sprout-w-full mt-4 !sprout-text-sm md:sprout-text-base !sprout-font-semibold",disabled:!a,onClick:function(){return o(s,i,l,t)},children:"Save"})},bn=function(e){var s=e.id,t=e.parentValues,o=e.setValues,n=fn().handleOnOkEditDirector,a=(0,w.useFormikContext)(),i=a.isValid,l=a.values,u=a.resetForm;return(0,r.jsx)(D.iR,{primary:!0,className:"sprout-w-full mt-4 !sprout-text-sm md:sprout-text-base !sprout-font-semibold",disabled:!i,onClick:function(){n(s,t,l,u,o)},children:"Save Changes"})};function Nn(e){var s,t,o=e.parentValues,n=e.setValues,a=e.onClose,i=cn().meta,l=(0,w.useFormikContext)(),c=l.resetForm,d=l.values,p=l.setValues,m=(0,y.a)().profileState,f=(0,u.SS)().isAgentMode,h=m.profile,x="";"add"===i.modalData.type&&(x="Add New Director"),"edit"===i.modalData.type&&(x="Edit New Director");var v,j=(0,g.find)(o.officers,{isApplicant:!0})||(0,g.find)(o.shareholders,{isApplicant:!0}),b=!j||(null===j||void 0===j?void 0:j._id)===(null===(s=i.modalData.officer)||void 0===s?void 0:s._id);return(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-4",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-w-full sprout-justify-center sprout-items-center",children:[(0,r.jsx)("span",{className:"sprout-text-base md:sprout-text-xl sprout-font-semibold sprout-text-center pr-1 md:p-0",children:x}),(0,r.jsx)("div",{className:"sprout-absolute sprout-inset-y-5 sprout-right-5 sprout-cursor-pointer",onClick:function(){c(),a()},children:(0,r.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("mask",{id:"mask0_1663_4126",maskUnits:"userSpaceOnUse",x:"2",y:"2",width:"12",height:"12",children:(0,r.jsx)("path",{d:"M2.7879 2.13518C2.60765 1.95494 2.31542 1.95494 2.13518 2.13518C1.95494 2.31542 1.95494 2.60765 2.13518 2.7879L7.34729 8L2.13518 13.2121C1.95494 13.3923 1.95494 13.6846 2.13518 13.8648C2.31542 14.0451 2.60765 14.0451 2.7879 13.8648L8 8.65271L13.2121 13.8648C13.3923 14.0451 13.6846 14.0451 13.8648 13.8648C14.0451 13.6846 14.0451 13.3923 13.8648 13.2121L8.65271 8L13.8648 2.7879C14.0451 2.60765 14.0451 2.31542 13.8648 2.13518C13.6846 1.95494 13.3923 1.95494 13.2121 2.13518L8 7.34729L2.7879 2.13518Z",fill:"#8E8E8E"})}),(0,r.jsx)("g",{mask:"url(#mask0_1663_4126)",children:(0,r.jsx)("rect",{width:"16",height:"16",fill:"#121212"})})]})})]}),(!j||b)&&(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col",children:[(0,r.jsxs)("div",{className:"checkbox-container mb-2",children:[(0,r.jsx)(w.Field,{name:"isApplicant",type:"checkbox",onClick:function(e){return function(e){e.target.checked?p(gn({},d,{fullName:"".concat(null===h||void 0===h?void 0:h.callFirstName," ").concat(null===h||void 0===h?void 0:h.callLastName),emailAddress:null===h||void 0===h?void 0:h.emailAddresses[0]})):p(gn({},d,{fullName:"",emailAddress:""}))}(e)}}),(0,r.jsx)("label",{htmlFor:"is-apply-for-business-account",children:(0,r.jsx)("div",{className:"checkbox-label sprout-text-sm md:sprout-text-base",children:"This is me"})})]}),(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Check this if this person is yourself."})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-sp
1ace-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Full Name"]}),(0,r.jsx)(Ns.K,{placeholder:"Enter Full Name",name:"fullName",required:!0,disabled:d.isApplicant&&!f})]}),!f&&(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-2",children:[(0,r.jsxs)("p",{className:"sprout-text-sm",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Email Address"]}),(0,r.jsx)(Ns.K,{placeholder:"Enter Email Address",name:"emailAddress",required:!0,disabled:d.isApplicant})]}),(0,r.jsxs)("div",{className:"sprout-flex",children:[(0,r.jsxs)("label",{className:"sprout-inline-flex sprout-cursor-pointer",children:[(0,r.jsx)(w.Field,{type:"checkbox",className:"sprout-sr-only sprout-peer",readOnly:!0,name:"isAddShareholderPosition"}),(0,r.jsx)("div",{className:"sprout-relative sprout-w-11 sprout-h-6 sprout-bg-gray-200 peer-focus:sprout-outline-none peer-focus:sprout-ring-4 peer-focus:sprout-ring-orange-300 sprout-rounded-full peer peer-checked:after:sprout-translate-x-full rtl:peer-checked:after:-sprout-translate-x-full peer-checked:after:sprout-border-white after:sprout-content-[''] after:sprout-absolute after:sprout-top-[2px] after:sprout-start-[2px] after:sprout-bg-white after:sprout-border-gray-300 after:sprout-border after:sprout-rounded-full after:sprout-h-5 after:sprout-w-5 after:sprout-transition-all peer-checked:sprout-bg-orange-600"})]}),(0,r.jsxs)("div",{className:"sprout-ml-2",children:[(0,r.jsx)("p",{className:"sprout-text-sm sprout-font-semibold",children:"Add shareholder position"}),(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-xs",children:"Information for this person will appear on both officer and shareholders list."})]})]}),d.isAddShareholderPosition&&(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-4",children:(0,r.jsx)(w.FieldArray,{name:"shareTypes",render:function(e){return(0,r.jsxs)("div",{children:[d.shareTypes&&d.shareTypes.map((function(s,t){return(0,r.jsx)(vn,{index:t,arrayHelpers:e,values:d,setValues:p},t)})),(0,r.jsx)(D.iR,{tertiary:!0,className:"sprout-mt-4",onClick:function(){return e.insert(d.shareTypes?Object.keys(d.shareTypes).length+1:1,"")},children:"Add additional share types"})]})}})}),"add"===i.modalData.type&&(0,r.jsx)(jn,{parentValues:o,setValues:n}),"edit"===i.modalData.type&&(0,r.jsx)(bn,{id:null!==(v=null===(t=i.modalData.officer)||void 0===t?void 0:t._id)&&void 0!==v?v:"",parentValues:o,setValues:n})]})}function Cn(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function Dn(e){var s,t,o,n,i,l,c,d,p,m,f,h,x=e.isOpen,v=e.onClose,y=e.parentValues,g=e.setValues,j=cn().meta,N=(0,u.SS)().isAgentMode,C=(0,a.useCallback)((function(e,s){var t={},r=s.officers,o=s.shareholders;return e.isApplicant||(e.fullName||(t.fullName=""),N||e.emailAddress||(t.emailAddress=""),e.emailAddress&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e.emailAddress)&&(t.emailAddress="Invalid email address")),N||(Object.keys(r).forEach((function(s){var o;s!==e.officerId&&Hs.Z.transformToLowerCase(null===(o=r[s].personDetails.contactDetails)||void 0===o?void 0:o.email)===Hs.Z.transformToLowerCase(e.emailAddress)&&(t.emailAddress="Email already existed")})),Object.keys(o).forEach((function(s){var r;s!==e.officerId&&"INDIVIDUAL"===o[s].category&&Hs.Z.transformToLowerCase(null===(r=o[s].personDetails.contactDetails)||void 0===r?void 0:r.email)===Hs.Z.transformToLowerCase(e.emailAddress)&&(t.emailAddress="Email already existed")}))),e.isAddShareholderPosition&&e.shareTypes.forEach((function(e){var s,r;(null===e||void 0===e||null===(s=e.shareType)||void 0===s?void 0:s.value)||(t.shareType=""),(null===e||void 0===e?void 0:e.shareAllotted)||(t.shareAllotted=""),(null===e||void 0===e||null===(r=e.shareCurrency)||void 0===r?void 0:r.value)||(t.shareCurrency=""),(null===e||void 0===e?void 0:e.paidUpShareCapital)||(t.paidUpShareCapital="")})),t}),[N]),w={officerId:null!==(d=null===(s=j.modalData.officer)||void 0===s?void 0:s._id)&&void 0!==d?d:"",isApplicant:null!==(p=null===(t=j.modalData.officer)||void 0===t?void 0:t.isApplicant)&&void 0!==p&&p,fullName:null!==(m=null===(o=j.modalData.officer)||void 0===o?void 0:o.personDetail
1s.personalDetails.fullName)&&void 0!==m?m:"",emailAddress:null!==(f=null===(i=null===(n=j.modalData.officer)||void 0===n?void 0:n.personDetails.contactDetails)||void 0===i?void 0:i.email)&&void 0!==f?f:"",isAddShareholderPosition:null!==(h=(null===(l=j.modalData.officer)||void 0===l?void 0:l.sharesDetails)&&(null===(c=j.modalData.officer)||void 0===c?void 0:c.sharesDetails.length)>0)&&void 0!==h&&h,shareTypes:function(){var e,s,t,o=[];0!==(null===(e=j.modalData.officer)||void 0===e?void 0:e.sharesDetails.length)&&(null===(s=j.modalData.officer)||void 0===s?void 0:s.sharesDetails)?null===(t=j.modalData.officer)||void 0===t||t.sharesDetails.forEach((function(e){var s,t=new Intl.DisplayNames(["en"],{type:"currency"}),n=function(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){Cn(e,s,t[s])}))}return e}({},e,{shareType:{label:null===e||void 0===e?void 0:e.shareType,value:null===e||void 0===e?void 0:e.shareType},shareCurrency:{label:null!==(s=t.of(null===e||void 0===e?void 0:e.shareCurrency))&&void 0!==s?s:"-",value:null===e||void 0===e?void 0:e.shareCurrency,icon:(0,r.jsx)("div",{className:"sprout-flex sprout-text-sm sprout-font-semibold sprout-text-[rgba(2, 2, 2, 0.75)] sprout-mr-3",children:null===e||void 0===e?void 0:e.shareCurrency})}});o.push(n)})):o=[{issuedShareCapital:"",paidUpShareCapital:"",shareAllotted:"",shareCurrency:"",shareType:""}];return o}()};return(0,r.jsx)(D.BT,{className:"sprout-w-[325px] md:sprout-w-[640px] sprout-max-h-[540px] sprout-overflow-auto !sprout-p-4",show:x,useBackground:!0,onClose:v,children:(0,r.jsx)(b.Z.form,{onSubmit:function(){},validation:function(e){return C(e,y)},initialValues:w,validateOnChange:!0,validateOnBlur:!0,validateOnMount:!0,children:(0,r.jsx)(Nn,{parentValues:y,setValues:g,onClose:v})})})}var wn=function(e){var s=e.officer,t=(0,u.SS)().emitter;return{handleOnActionClick:(0,a.useCallback)((function(e){t.emit("@modal/add-director",{officer:s,type:e})}),[s])}};function kn(e,s,t,r,o,n,a){try{var i=e[n](a),l=i.value}catch(u){return void t(u)}i.done?s(l):Promise.resolve(l).then(r,o)}function On(e){return function(){var s=this,t=arguments;return new Promise((function(r,o){var n=e.apply(s,t);function a(e){kn(n,r,o,a,i,"next",e)}function i(e){kn(n,r,o,a,i,"throw",e)}a(void 0)}))}}var An=function(e){var s=e.officer,t=wn({officer:s}).handleOnActionClick,o=(0,u.SS)(),n=o.isAgentMode,i=o.emitter,l=(0,g.groupBy)(s.appointments,"position"),c=Er({emitter:i}).handleOnSave,d=(0,w.useFormikContext)().values,p=Fe().setStakeholderStep,m=(0,a.useCallback)((function(e){return 0===e.appointments.filter((function(e){return"Corporate Representative"!==e.position&&"Corporate Representative of"!==e.position&&"Active"===e.status})).length}),[]),f=(0,a.useCallback)((function(e){return 0===e.appointments.filter((function(e){return"Corporate Representative"!==e.position&&"Member"!==e.position&&"Beneficial Owner"!==e.position&&"Active"===e.status})).length}),[]),h=(0,a.useCallback)((function(e,s){return"FACIAL_VERIFICATION"===s?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"sprout-text-xs md:sprout-text-[14px] md:sprout-mt-[16px] md:sprout-mb-[8px] sprout-mt-[8px] sprout-mb-[8px] sprout-text-[#757575]",children:["You've chosen to provide the stakeholder information using:",(0,r.jsxs)("span",{className:"sprout-font-bold sprout-text-[12px] md:sprout-text-[14px]",children:[" ","Facial Verification"]})]}),(0,r.jsx)("div",{"data-id":"error-for-unfilledMember.".concat(e),children:(0,r.jsx)(D.iR,{secondary:!0,onClick:On(U().mark((function s(){var t;return U().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return t=p(d,e,0),s.next=3,c(t,!1);case 3:je.default.push("/kyc?type=facial-verification&id=".concat(e));case 4:case"end":return s.stop()}}),s)}))),children:"Edit Information"})})]}):"NOTARIZED_DOCUMENT"===s?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"sprout-text-xs md:sprout-text-[14px] md:sprout-mt-[16px] md:sprout-mb-[8px] sprout-mt-[8px] sprout-mb-[8px] sprout-text-[#757575]",children:["You've chosen to provide the stakeholder information using:",(0,r.jsxs)("span",{className:"sprout-font-bold sprout-text-[12px] md:sprout-text-[14px]",children:[" ","Notarized Document"]})]}),(0,r.jsx)("div",{"data-id":"error-for-unfilledMember.".concat(e),children:(0,r.jsx)(D.iR,{secondary:!0,onClick:On(U().mark((function s(){return U().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,c(d,!1);case 2:je.default.push("/kyc?type=notarized-document&id=".concat(e));case 3:case"end":return s.stop()}}),s)}))),children:"Edit Information"})})]}):(0,r.jsx)(r.Fragment,{})}),[c,p,d]),x=(0,a.useCallback)((function(e,s){return(0,r.jsx)("div",{className:"sprout-w-full",children:s?h(e,s):(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col","data-id":"error-for-unfilledMember.".concat(e),children:[(0,r.jsx)(D.iR,{primary:!0,className:"sprout-w-fit",onClick:On(U().mark((function s(){return U().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,c(d,!1);case 2:je.default.push("/kyc?type=facial-verification&id=".concat(e));case 3:case"end":return s.stop()}}),s)}))),children:"Facial Verification"}
1),(0,r.jsx)(D.iR,{className:"sprout-mt-[8px] sprout-w-fit",secondary:!0,onClick:On(U().mark((function s(){return U().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,c(d,!1);case 2:je.default.push("/kyc?type=notarized-document&id=".concat(e));case 3:case"end":return s.stop()}}),s)}))),children:"Notarized Document"})]})})})}),[h,c,d]),v=(0,a.useCallback)((function(){var e,t,o,a,i,l;return n?s.isApplicant?(0,r.jsx)("div",{className:"sprout-col-span-4",children:(0,r.jsx)("p",{className:"sprout-break-all",children:null===(o=s.personDetails)||void 0===o||null===(a=o.contactDetails)||void 0===a?void 0:a.email})}):m(s)?(0,r.jsx)("div",{className:"sprout-col-span-4",children:null===(i=s.personDetails)||void 0===i||null===(l=i.contactDetails)||void 0===l?void 0:l.email}):(0,r.jsx)("div",{className:"sprout-col-span-4",children:x(s._id,s.agentEkycType)}):(0,r.jsx)("div",{className:"sprout-col-span-4",children:(0,r.jsx)("p",{className:"sprout-break-all",children:null===(e=s.personDetails)||void 0===e||null===(t=e.contactDetails)||void 0===t?void 0:t.email})})}),[x,m,n,s]);return(0,r.jsxs)("div",{className:(0,He.W)(["sprout-hidden sm:sprout-grid sprout-grid-cols-12 sprout-grid-rows-[min-content] sprout-items-center","sprout-p-4 sprout-border-b sprout-border-[#DADADA] sprout-border-solid"]),"data-id":"error-for-unfilledMember.".concat(s._id),children:[(0,r.jsxs)("div",{className:"sprout-col-span-4 sprout-flex sprout-flex-col",children:[(0,r.jsx)("p",{className:"sprout-break-all",children:s.personDetails.personalDetails.fullName}),s.isApplicant?(0,r.jsx)(Go,{label:"This is me",className:"sprout-bg-[#FFF6E7] sprout-w-fit"}):(0,r.jsx)(r.Fragment,{})]}),(0,r.jsx)("div",{className:"sprout-col-span-3 sprout-flex sprout-flex-col",children:Object.keys(l).map((function(e,t){return"Corporate Representative of"===e?(0,r.jsxs)("div",{className:"sprout-col-span-3 sprout-flex sprout-flex-col",children:[(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-sm",children:"Corporate Representative:"}),(0,r.jsx)("p",{className:"sprout-break-words",children:l[e].map((function(e){return e.companyName})).join(", ")})]},t):"Corporate Representative"!==e||f(s)?"undefined"===e?(0,r.jsx)(r.Fragment,{}):(0,r.jsx)("div",{className:"sprout-col-span-3 sprout-flex sprout-flex-col",children:(0,r.jsx)("p",{className:"sprout-break-all",children:e})},t):(0,r.jsx)(r.Fragment,{})}))}),v(),(0,r.jsx)("div",{className:"sprout-col-span-1",children:(0,r.jsx)(Uo,{actions:Mo,onActionClick:t})})]})};function Sn(){return(0,r.jsxs)("div",{className:"sprout-flex-1 sprout-flex sprout-flex-col sprout-justify-center sprout-items-center sprout-mx-3 sprout-my-6",children:[(0,r.jsx)(We.default,{src:Ge.Gi,alt:"no records found",height:240,width:240}),(0,r.jsx)("div",{className:"sprout-px-2 sprout-mt-4 sprout-flex sprout-flex-col sprout-text-sm sprout-text-[#828282]",children:(0,r.jsx)("span",{className:"sprout-text-center",children:"Click the 'Add New' button and provide the required details for each new officer you wish to include in your company's profile."})})]})}function En(e,s,t,r,o,n,a){try{var i=e[n](a),l=i.value}catch(u){return void t(u)}i.done?s(l):Promise.resolve(l).then(r,o)}function Pn(e){return function(){var s=this,t=arguments;return new Promise((function(r,o){var n=e.apply(s,t);function a(e){En(n,r,o,a,i,"next",e)}function i(e){En(n,r,o,a,i,"throw",e)}a(void 0)}))}}var Tn=function(e){var s=e.officer,t=wn({officer:s}).handleOnActionClick,o=(0,g.groupBy)(s.appointments,"position"),n=(0,u.SS)(),i=n.isAgentMode,l=n.emitter,c=Er({emitter:l}).handleOnSave,d=(0,w.useFormikContext)().values,p=Fe().setStakeholderStep,m=(0,a.useCallback)((function(e,s){return"FACIAL_VERIFICATION"===s?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"sprout-text-[14px] md:sprout-text-[16px]",children:"Personal Information"}),(0,r.jsxs)("div",{className:"sprout-text-xs md:sprout-text-[14px] md:sprout-mt-[16px] md:sprout-mb-[8px] sprout-mt-[8px] sprout-mb-[8px] sprout-text-[#757575]",children:["You've chosen to provide the stakeholder information using:",(0,r.jsxs)("span",{className:"sprout-font-bold sprout-text-[12px] md:sprout-text-[14px]",children:[" ","Facial Verification"]})]}),(0,r.jsx)("div",{"data-id":"error-for-unfilledMember.".concat(e),children:(0,r.jsx)(D.iR,{secondary:!0,onClick:Pn(U().mark((function s(){var t;return U().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return t=p(d,e,0),s.next=3,c(t,!1);case 3:je.default.push("/kyc?type=facial-verification&id=".concat(e));case 4:case"end":return s.stop()}}),s)}))),children:"Edit Information"})})]}):"NOTARIZED_DOCUMENT"===s?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"sprout-text-[14px] md:sprout-text-[16
1px]",children:"Personal Information"}),(0,r.jsxs)("div",{className:"sprout-text-xs md:sprout-text-[14px] md:sprout-mt-[16px] md:sprout-mb-[8px] sprout-mt-[8px] sprout-mb-[8px] sprout-text-[#757575]",children:["You've chosen to provide the stakeholder information using:",(0,r.jsxs)("span",{className:"sprout-font-bold sprout-text-[12px] md:sprout-text-[14px]",children:[" ","Notarized Document"]})]}),(0,r.jsx)("div",{"data-id":"error-for-unfilledMember.".concat(e),children:(0,r.jsx)(D.iR,{secondary:!0,onClick:Pn(U().mark((function s(){return U().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,c(d,!1);case 2:je.default.push("/kyc?type=notarized-document&id=".concat(e));case 3:case"end":return s.stop()}}),s)}))),children:"Edit Information"})})]}):(0,r.jsx)(r.Fragment,{})}),[c,p,d]),f=(0,a.useCallback)((function(e,s){return(0,r.jsx)("div",{className:"sprout-w-full",children:s?m(e,s):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"sprout-text-[14px] md:sprout-text-[16px]",children:"Personal Information"}),(0,r.jsx)("div",{className:"sprout-text-xs md:sprout-text-[14px] md:sprout-mt-[16px] md:sprout-mb-[8px] sprout-mt-[8px] sprout-mb-[8px] sprout-text-[#757575]",children:"Please provide the stakeholder's personal information via one of these 2 methods:"}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col","data-id":"error-for-unfilledMember.".concat(e),children:[(0,r.jsx)(D.iR,{primary:!0,className:"sprout-w-fit",onClick:Pn(U().mark((function s(){return U().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,c(d,!1);case 2:je.default.push("/kyc?type=facial-verification&id=".concat(e));case 3:case"end":return s.stop()}}),s)}))),children:"Facial Verification"}),(0,r.jsx)(D.iR,{className:"sprout-mt-[8px] sprout-w-fit",secondary:!0,onClick:Pn(U().mark((function s(){return U().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,c(d,!1);case 2:je.default.push("/kyc?type=notarized-document&id=".concat(e));case 3:case"end":return s.stop()}}),s)}))),children:"Notarized Document"})]})]})})}),[m,c,d]),h=(0,a.useCallback)((function(e){return 0===e.appointments.filter((function(e){return"Corporate Representative"!==e.position&&"Corporate Representative of"!==e.position&&"Active"===e.status})).length}),[]),x=(0,a.useCallback)((function(e){return 0===e.appointments.filter((function(e){return"Corporate Representative"!==e.position&&"Member"!==e.position&&"Beneficial Owner"!==e.position&&"Active"===e.status})).length}),[]),v=(0,a.useCallback)((function(){var e,t,o;return i?s.isApplicant?(0,r.jsxs)("div",{className:"sprout-col-span-3",children:[(0,r.jsx)("div",{className:"sprout-text-[14px] md:sprout-text-[16px]",children:"Personal Information"}),(0,r.jsx)("p",{className:"sprout-break-all sprout-mt-[8px]",children:null===(t=s.personDetails.contactDetails)||void 0===t?void 0:t.email})]}):h(s)?(0,r.jsxs)("div",{className:"sprout-col-span-3",children:[(0,r.jsx)("div",{className:"sprout-text-[14px] md:sprout-text-[16px]",children:"Personal Information"}),(0,r.jsx)("p",{className:"sprout-break-all sprout-mt-[8px]",children:null===(o=s.personDetails.contactDetails)||void 0===o?void 0:o.email})]}):(0,r.jsx)("div",{children:f(s._id,s.agentEkycType)}):(0,r.jsxs)("div",{className:"sprout-col-span-3",children:[(0,r.jsx)("div",{className:"sprout-text-[14px] md:sprout-text-[16px]",children:"Personal Information"}),(0,r.jsx)("p",{className:"sprout-break-all sprout-mt-[8px]",children:null===(e=s.personDetails.contactDetails)||void 0===e?void 0:e.email})]})}),[f,h,i,s]);return(0,r.jsxs)("div",{className:(0,He.W)(["sprout-flex sm:sprout-hidden sprout-flex-row sprout-items-center sprout-gap-3 sprout-justify-between","sprout-px-4 sprout-py-2 sprout-border-b sprout-border-[#DADADA] sprout-border-solid"]),children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-gap-3",children:[(0,r.jsx)("div",{className:"sprout-col-span-5 sprout-flex sprout-flex-col",children:(0,r.jsx)("p",{className:"sprout-break-all",children:s.personDetails.personalDetails.fullName})}),(0,r.jsx)("div",{className:"sprout-col-span-3 sprout-flex sprout-flex-col",children:Object.keys(o).map((function(e,t){return"Corporate Representative of"===e?(0,r.jsxs)("div",{className:"sprout-col-span-3 sprout-flex sprout-flex-col",children:[(0,r.jsx)("p",{className:"sprout-text-[#757575] sprout-text-sm",children:"Corporate Representative:"}),(0,r.jsx)("p",{className:"sprout-break-words",children:o[e].map((function(e){return e.companyName})).join(", ")})]},t):"Corporate Representative"!==e||x(s)?"undefined"===e?(0,r.jsx)(r.Fragment,{}):(0,r.jsx)("div",{className:"sprout-col-span-3 sprout-flex sprout-flex-col",children:(0,r.jsx)("p",{className:"sprout-break-all",children:e})},t):(0,r.jsx)(r.Fragment,{})}))}),(0,r.jsx)("div",{className:"sprout-col-span-3",children:s.isApplicant&&!i?(0,r.jsx)(Go,{label:"This is me",className:"sprout-bg-[#FFF6E7] sprout-w-fit"}):(0,r.jsx)(r.Fragment,{})}),v()]}),(0,r.jsx)("div",{className:"sprout-col-span-1",children:(0,r.jsx)(Uo,{actions:Mo,onActionClick:t})})]})};function In(e,s){return function(e){if(Array.isArray(e))return e}(e)||function(e,s){var t=[],r=!0,o=!1,n=void 0;try{for(var a,i=e[Symbol.iterator]();!(r=(a=i.next()).done)&&(t.push(a.value),!s||t.length!==s);r=!0);}catch(l){o=!0,n=l}finally{try{r||null==i.return||i.return()}finally{if(o)throw n}}return t}
1(e,s)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var Fn=function(e){var s=e.officers;return s.length?(0,r.jsx)(a.Fragment,{children:(0,r.jsx)("div",{className:"sprout-flex-1 sprout-overflow-scroll sprout-min-h-96",children:s.map((function(e){var s=In(e,2),t=s[0],o=s[1];return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)(An,{officer:o},"officer-desktop-".concat(t)),(0,r.jsx)(Tn,{officer:o},"officer-mobile-".concat(t))]},"officer-".concat(t))}))})}):(0,r.jsx)("div",{className:"sprout-flex-1 sprout-flex",children:(0,r.jsx)(Sn,{})})},Rn=function(){var e=(0,u.SS)().isAgentMode,s=(0,He.W)(["sprout-bg-[#FAFAFA]","sprout-hidden sprout-items-center md:sprout-grid md:sprout-grid-cols-12","sprout-h-16 sprout-py-4 sprout-px-3","sprout-text-xs"]);return(0,r.jsxs)("div",{className:s,children:[(0,r.jsxs)("div",{className:"sprout-col-span-4 sprout-flex sprout-justify-between sprout-items-center",children:[(0,r.jsx)("p",{children:"Name"}),(0,r.jsx)(Q.Qr,{})]}),(0,r.jsx)("div",{className:"sprout-col-span-3",children:(0,r.jsx)("p",{children:"Position"})}),e?(0,r.jsx)("div",{className:"sprout-col-span-4",children:(0,r.jsx)("p",{children:"Personal Information"})}):(0,r.jsx)("div",{className:"sprout-col-span-4",children:(0,r.jsx)("p",{children:"Email"})}),(0,r.jsx)("div",{className:"sprout-col-span-1"})]})},Ln=function(e){var s=e.values,t=(0,a.useState)(1),o=t[0],n=t[1],i=Object.keys(s.officers).length,l=Object.entries(s.officers).slice(5*(o-1),5*o);return(0,r.jsxs)("div",{className:"sprout-flex-1 sprout-flex sprout-flex-col sprout-overflow-hidden",children:[(0,r.jsx)(Rn,{}),(0,r.jsx)(Fn,{officers:l}),(0,r.jsx)(Lo,{labelFor:"Officer",currentPage:o,rowCount:i,rowsPerPage:5,onChangePage:n}),(0,r.jsx)(_o,{currentPage:o,rowCount:i,rowsPerPage:5,onChangePage:n})]})};function _n(e){var s=e.isOpen,t=e.onClose,o=e.parentValues,n=e.setValues,a=cn().meta,i=fn().handleOnOkDeleteDirector,l=a.modalData.officer;return(0,r.jsx)(D.BT,{className:"sprout-w-[325px] md:sprout-w-[400px] !sprout-p-4",show:s,useBackground:!0,onClose:t,children:(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-space-y-4 sprout-text-center",children:[(0,r.jsx)("h2",{className:"sprout-text-base sprout-font-semibold sprout-mb-4",children:"Confirm Deletion"}),(0,r.jsxs)("p",{children:["Are you sure you want to delete"," ",(0,r.jsx)("span",{className:"sprout-font-semibold",children:null===l||void 0===l?void 0:l.personDetails.personalDetails.fullName})," ","from the list?"]}),(0,r.jsx)("p",{children:"All the data will be permanently removed and cannot be recovered."}),(0,r.jsxs)("div",{className:"sprout-grid sprout-grid-cols-2 sprout-gap-4",children:[(0,r.jsx)(D.iR,{secondary:!0,onClick:t,children:"Cancel"}),(0,r.jsx)(D.iR,{primary:!0,red:!0,onClick:function(){return i(o,n,l)},children:"Delete"})]})]})})}function Bn(e){var s=e.values,t=e.setValues,o=(0,u.SS)(),n=o.emitter,i=o.isAgentMode,l=cn(),c=l.addOfficer,d=l.deleteOfficer,p=(0,a.useMemo)((function(){return 0===Object.keys(s.officers).length}),[s.officers]),f=(0,a.useMemo)((function(){return 0===Object.keys(s.shareholders).length}),[s.shareholders]);return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)(Dn,{isOpen:c.isOpen,onClose:c.onClose,parentValues:s,setValues:t}),(0,r.jsx)(_n,{isOpen:d.isOpen,onClose:d.onClose,parentValues:s,setValues:t}),(0,r.jsxs)("div",{className:(0,m.WD)(["sprout-relative sprout-flex sprout-flex-col","sprout-mb-8 sprout-border sprout-border-[#CDCDCD] sprout-border-solid sprout-rounded-[16px]","sprout-overflow-hidden"]),children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-justify-between sprout-p-4 sprout-items-center",children:[(0,r.jsx)("h3",{className:"sprout-font-semibold",children:"Officer Listing"}),(0,r.jsxs)(D.iR,{primary:!0,onClick:function(){return n.emit("@modal/add-director",{officer:void 0,type:"add"})},"data-id":"error-for-officers",children:[(0,r.jsx)("span",{className:"sprout-hidden md:sprout-block sprout-font-semibold",children:"Add New Director"}),(0,r.jsx)("span",{className:"md:sprout-hidden sprout-block",children:"+"})]})]}),i&&(!p||!f)&&(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("div",{className:"sprout-mx-[16px]",children:[(0,r.jsx)(P.Z,{variant:"info",classNames:"!sprout-px-4 !sprout-py-2 sprout-mb-[10px]",leftIcon:(0,r.jsx)(T.Z,{color:"#057EB6"}),children:(0,r.jsx)("p",{className:"sprout-font-semibold sprout-normal-case sprout-text-sm",children:"Notarized Documents must be notarized by a Notary Public"})}),(0,r.jsx)("div",{className:"sprout-text-xs sprout-text-[#757575]",children:"Please update all stakeholder's personal information. There are two options for the collection of personal information:"}),(0,r.jsxs)("ol",{className:"sprout-list-decimal sprout-pl-5 sprout-mb-[16px] sprout-text-xs sprout-text-[#757575]",children:[(0,r.jsxs)("li",{children:["Facial verification",(0,r.jsxs)("ol",{className:"sprout-list-[lower-alpha] sprout-pl-5",children:[(0,r.jsx)("li",{children:"You will fill the personal information for the stakeholders"}),(0,r.jsx)("li",{children:"A link will be generated for you to send to the stakeholder for facial verification and document scanning"})]})]}),(0,r.jsxs)("li",{children:["Notarized document upload",(0,r.jsxs)("ol",{className:"sprout-list-[lower-alpha] sprout-pl-5",children:[(0,r.jsx)("li",{children:"You will fill the personal information for the stakeholders"}),(0,r.jsx)("li",{children:"You will have to upload a notarized copy of the stakeholder's Proof of Identification and Proof of Address"})]})]})]})]})})]}),(0,r.jsx)("div",{className:"sprout-border-solid sprout-border-[#C4C4C4]
1sprout-border-b-[1px]"}),(0,r.jsx)(Ln,{values:s})]})]})}function Vn(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function Un(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){Vn(e,s,t[s])}))}return e}function Mn(e){var s,t,o=e.values,n=e.setValues,a=e.errors;return(0,r.jsxs)("div",{className:(0,m.WD)(["sprout-relative sprout-flex sprout-flex-col","sprout-mb-8 sprout-border sprout-border-[#CDCDCD] sprout-border-solid sprout-rounded-[16px] sprout-p-4","sprout-overflow-hidden"]),children:[(0,r.jsxs)("h3",{className:"sprout-font-semibold sprout-mb-2",children:[(0,r.jsx)("span",{className:"sprout-text-[#960F21]",children:"*"})," Would you like to appoint Grof's Resident Director?"]}),(0,r.jsx)("p",{className:"sprout-text-xs sprout-text-[#757575]",children:"Every company in Singapore is required to have at least one Resident Director who is either a Singaporean citizen, a permanent resident, or a holder of an EntrePass/Employment/Dependent Pass with a locally registered address. A Resident Director fulfills this legal requirement without being involved in the day-to-day operations or management decisions of the company."}),(0,r.jsxs)("div",{className:"sprout-flex sprout-mt-4",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-items-center sprout-me-4",children:[(0,r.jsx)(w.Field,{type:"radio",value:"Yes",name:"company.isAppointGrofND",checked:!0===o.company.isAppointGrofND,onChange:function(){return n(Un({},o,{company:Un({},o.company,{isAppointGrofND:!0})}))},className:"sprout-box-border sprout-appearance-none sprout-w-[14px] sprout-h-[14px] sprout-border-[2px] sprout-border-solid sprout-border-white sprout-rounded-sm sprout-outline sprout-outline-1 sprout-outline-[#8E8E8E] checked:sprout-bg-primary"}),(0,r.jsx)("label",{className:"sprout-ms-2 sprout-text-gray-900",children:"Yes"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-items-center sprout-me-4",children:[(0,r.jsx)(w.Field,{type:"radio",value:"No",name:"company.isAppointGrofND",checked:!1===o.company.isAppointGrofND,onChange:function(){return n(Un({},o,{company:Un({},o.company,{isAppointGrofND:!1})}))},className:"sprout-box-border sprout-appearance-none sprout-w-[14px] sprout-h-[14px] sprout-border-[2px] sprout-border-solid sprout-border-white sprout-rounded-sm sprout-outline sprout-outline-1 sprout-outline-[#8E8E8E] checked:sprout-bg-primary"}),(0,r.jsx)("label",{className:"sprout-ms-2 sprout-text-gray-900 ",children:"No"})]})]}),(null===(s=a.company)||void 0===s?void 0:s.isAppointGrofND)&&(0,r.jsx)("div",{className:"sprout-text-red-500 sprout-text-xs","data-id":"error-for-company.isAppointGrofND",children:null===(t=a.company)||void 0===t?void 0:t.isAppointGrofND})]})}var Zn=function(e){var s=e.values,t=e.handleOnSave;return(0,r.jsx)(D.iR,{secondary:!0,onClick:function(){return t(s)},children:"Save"})},qn=function(){return(0,r.jsx)(D.iR,{primary:!0,type:"submit",children:"Next Step"})};function Wn(e){var s=e.handleOnSave,t=(0,u.SS)().emitter,o=(0,w.useFormikContext)(),n=o.values,i=o.setValues,l=o.errors,c=Fr({emitter:t}),d=c.confirmationModal,p=c.handleOnConfirm;return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsxs)(C.Z,{open:d.isOpen,title:"Are you sure to discard this process?",okText:"Discard",okVariant:"primary",cancelVariant:"secondary",okRed:!0,onOk:p,onCancel:d.onClose,children:[" ",(0,r.jsx)("p",{className:"sprout-text-sm sprout-pt-4 sprout-pb-6 sprout-px-3",children:"This action will discard all inputted data, and it cannot be undone"})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col",children:[(0,r.jsx)(Mn,{values:n,setValues:i,errors:l}),(0,r.jsx)(Bn,{values:n,setValues:i}),(0,r.jsx)(un,{values:n,setValues:i}),(0,r.jsx)(Zr,{values:n})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-justify-end sprout-space-x-6 sprout-mt-8",children:[(0,r.jsx)(Zn,{handleOnSave:s,values:n}),(0,r.jsx)(qn,{})]}),(0,r.jsxs)("p",{className:"sprout-mt-6",children:["If you wish to discard the existing onboarding process or start a new one,",(0,r.jsx)("span",{className:"sprout-ml-2 sprout-font-semibold sprout-text-[#960F21] sprout-cursor-pointer",onClick:d.onOpen,children:"click here"})]})]})}function Gn(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}function Kn(){var e=(0,u.SS)(),s=e.emitter,t=e.companyInformation,o=e.isAgentMode,n=e.listStakeholders,i=(0,a.useRef)(N.q.getState()).current.setGlobalSnackbar,l=Er({emitter:s}
1),d=l.handleOnSubmit,p=l.handleOnSave,m=Fr({emitter:s}),f=m.confirmationModal,h=m.handleOnConfirm,x=function(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){Gn(e,s,t[s])}))}return e}({},t.data.data||{},{officers:(0,g.get)(n,"initialValuesOfficer",{}),shareholders:(0,g.get)(n,"initialValuesShareholder",{})}),v=(0,a.useCallback)((function(e){return 0===e.appointments.filter((function(e){return"Corporate Representative"!==e.position&&"Corporate Representative of"!==e.position&&"Active"===e.status})).length}),[]);return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)(C.Z,{open:f.isOpen,title:"Are you sure to discard this process?",okText:"Discard",okVariant:"primary",cancelVariant:"secondary",okRed:!0,onOk:h,onCancel:f.onClose,children:(0,r.jsx)("p",{className:"sprout-text-sm sprout-pt-4 sprout-pb-6 sprout-px-3",children:"This action will discard all inputted data, and it cannot be undone"})}),(0,r.jsx)(Os,{}),(0,r.jsx)(b.Z.form,{initialValues:x,onSubmit:d,validation:function(e){var s={},t=Object.values(e.officers||{}).some((function(e){return e.appointments.some((function(e){return c.oK.includes(e.position)&&"Active"===e.status}))}));if(void 0===e.company.isAppointGrofND?(s={company:{isAppointGrofND:"Field is required"}},i("Please choose Grof's Resident Director","error")):e.company.isAppointGrofND?0===Object.keys(e.shareholders).length&&(s.shareholders="Please add minimum 1 shareholder to proceed",i("Please add minimum 1 shareholder to proceed","error")):0!==Object.keys(e.officers).length&&t?0===Object.keys(e.shareholders).length&&(s.shareholders="",i("Please add minimum 1 director and 1 shareholder to proceed","error")):(s.officers="",i("Please add minimum 1 director and 1 shareholder to proceed","error")),Object.keys(e.shareholders).forEach((function(t){var r;"CORPORATE"!==e.shareholders[t].category||(null===(r=e.shareholders[t])||void 0===r?void 0:r.corporateRepresentativeOf)||(s.shareholders="",i("Please add corporate representative for corporate shareholder to proceed","error"))})),o){for(var r=function(e){var s,t=l[e],r=null===(s=t.appointments)||void 0===s?void 0:s.find((function(e){return"Active"===e.status&&c.UK.includes(e.position)&&!t.isApplicant}));(!r||t.agentEkycType||v(t))&&(!r||v(t)||t.isGrofFormFilled)||(a[t._id]="Please provide Personal Information using either Facial Verification or a Notarized Document to proceed.")},a={},l=Object.values(e.officers||{}),u=0;u<l.length;u+=1)r(u);for(var d=Object.values(e.shareholders||{}),p=0;p<d.length;p+=1){var m,f=d[p],h=null===(m=f.appointments)||void 0===m?void 0:m.find((function(e){return"Active"===e.status&&c.Kh.includes(e.position)}));(!h||f.agentEkycType||"INDIVIDUAL"!==f.category||f.isApplicant)&&(!h||v(f)||"INDIVIDUAL"!==f.category||f.isGrofFormFilled)||(a[f._id]="Please provide Personal Information using either Facial Verification or a Notarized Document to proceed.")}Object.keys(a).length>0&&(i("Please provide Personal Information using either Facial Verification or a Notarized Document to proceed.","error"),s.unfilledMember=a)}return(0,g.get)(n,"shareholders",[]).length>0&&Object.keys(e.shareholders).forEach((function(t){var r;"CORPORATE"===(null===(r=null===e||void 0===e?void 0:e.shareholders["".concat(t)])||void 0===r?void 0:r.category)&&0===(0,g.get)(e,"shareholders.".concat(t,".companyDetails.documents"),[]).length&&(s.shareholders="",i("Please add at least 1 Document for Corporate Shareholder","error"))})),s},validateOnChange:!1,validateOnBlur:!1,scrollOnError:!0,children:(0,r.jsx)(Wn,{onOpen:f.onOpen,handleOnSave:p})})]})}var Hn=function(e){var s=e.emitter,t=(0,u.SS)().companyInformation,r=(0,K.Z)(),o=(0,a.useCallback)((function(){t.mutate(),s.emit("@set-is-rfi",!1)}),[t,s]);return(0,a.useEffect)((function(){return s.on("@modal/confirm",r.onToggle),function(){s.off("@modal/confirm",r.onToggle)}}
1),[r.onToggle,s]),{handleOnConfirm:o,confirmationModal:r}};function zn(e,s,t,r,o,n,a){try{var i=e[n](a),l=i.value}catch(u){return void t(u)}i.done?s(l):Promise.resolve(l).then(r,o)}function Yn(e){return function(){var s=this,t=arguments;return new Promise((function(r,o){var n=e.apply(s,t);function a(e){zn(n,r,o,a,i,"next",e)}function i(e){zn(n,r,o,a,i,"throw",e)}a(void 0)}))}}var Xn=function(){var e=(0,u.SS)(),s=e.emitter,t=e.companyInformation,r=(0,M.Z)(),o=(0,a.useRef)(N.q.getState()).current.setGlobalSnackbar,n=(0,a.useCallback)((function(e){var s=[];return e.answers.forEach((function(e){var t,r,o=e.type,n="UPLOAD_DOC"===o,a="FREE_TEXT"===o;if(n){var i,l=null===(i=e.documents)||void 0===i?void 0:i.map((function(e){return e._id}));(r={questionId:e.questionId,isAnswer:e.isAnswer,comment:e.isAnswer?e.comment:"",type:o,documents:e.isAnswer?l:[],reason:e.reason}).isAnswer&&delete r.reason,r.reason||delete r.reason}else a&&(r={questionId:e.questionId,isAnswer:!0,answer:e.answer||"",type:o});(n&&(null===r||void 0===r||null===(t=r.documents)||void 0===t?void 0:t.length)||n&&!(null===r||void 0===r?void 0:r.isAnswer)&&(null===r||void 0===r?void 0:r.reason)||a&&""!==(null===r||void 0===r?void 0:r.answer))&&s.push(r)})),e.childrenAnswers.forEach((function(e){var t,r,o=e.type,n="UPLOAD_DOC"===o,a="FREE_TEXT"===o;if(n){var i=e.documents.map((function(e){return e._id}));(r={questionId:e.questionId,isAnswer:e.isAnswer,comment:e.isAnswer?e.comment:"",type:o,documents:e.isAnswer?i:[],reason:e.reason}).isAnswer&&delete r.reason,r.reason||delete r.reason}else a&&(r={questionId:e.questionId,isAnswer:!0,answer:e.answer||"",type:o});(n&&(null===r||void 0===r||null===(t=r.documents)||void 0===t?void 0:t.length)||n&&!(null===r||void 0===r?void 0:r.isAnswer)&&(null===r||void 0===r?void 0:r.reason)||a&&""!==(null===r||void 0===r?void 0:r.answer))&&s.push(r)})),s}),[]);return{handleOnOkSubmit:(0,a.useCallback)(Yn(U().mark((function e(a){var i;return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(i=n(a)).length){e.next=5;break}return s.emit("@set-is-page-loading",!0),e.next=5,r.post("/kyb/application/".concat(a.applicationID,"/rfi/").concat(a._id,"/respond"),i).then(Yn(U().mark((function e(r){return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s.emit("@set-is-page-loading",!1),"OK"!==(null===r||void 0===r?void 0:r.status)){e.next=4;break}return t.mutate(),e.abrupt("return",o("Your RFI has been successfully submitted and will need to be reviewed by our team.","success"));case 4:return e.abrupt("return",o("Something went wrong","error"));case 5:case"end":return e.stop()}}),e)})))).catch((function(e){return s.emit("@set-is-page-loading",!1),o(e.message,"error")})).finally((function(){s.emit("@set-is-page-loading",!1)}));case 5:case"end":return e.stop()}}),e)}))),[r,t,s,n,o]),handleOnOkSave:(0,a.useCallback)(Yn(U().mark((function e(a){var i;return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(i=n(a)).length){e.next=5;break}return s.emit("@set-is-page-loading",!0),e.next=5,r.post("/kyb/application/".concat(a.applicationID,"/rfi/").concat(a._id,"/save"),i).then(Yn(U().mark((function e(r){return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s.emit("@set-is-page-loading",!1),"OK"!==(null===r||void 0===r?void 0:r.status)){e.next=4;break}return t.mutate(),e.abrupt("return",o("Successfully saved the progress","success"));case 4:return e.abrupt("return",o("Something went wrong","error"));case 5:case"end":return e.stop()}}),e)})))).catch((function(e){return s.emit("@set-is-page-loading",!1),o(e.message,"error")})).finally((function(){s.emit("@set-is-page-loading",!1)}));case 5:case"end":return e.stop()}}),e)}))),[r,t,s,n,o])}},Qn=t(64037),$n=t(49374);function Jn(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}var ea=function(e){var s=e.handleOnSave,t=(0,w.useFormikContext)().values;return(0,r.jsx)(D.iR,{secondary:!0,onClick:function(){return s(t)},children:"Save"})},sa=function(e){var s=e.initialValues,t=e.confirmationModal,o=e.handleOnConfirm,n=(0,w.useFormikContext)().values,i=(0,a.useCallback)((function(){var e=s.answers,r=n.answers,a=s.childrenAnswers,i=n.childrenAnswers;j().isEqual(e,r)&&j().isEqual(a,i)?o():t.onOpen()}),[t,o,s.answers,s.childrenAnswers,n.answers,n.childrenAnswers]);return(0,r.jsx)("span",{className:"sprout-text-[#960F21] sprout-font-semibold sprout-cursor-pointer",onClick:i,children:"Exit"})};function ta(){var e,s,t,o,n,i=(0,y.a)().profileState.userId,l=(0,u.SS)(),d=l.emitter,p=l.companyInformation,m=l.applicationProgressModal,f=(0,a.useRef)(N.q.getState()).current.setGlobalSnackbar,h=(0,a.useState)(!1),x=h[0],v=h[1],j=null===p||void 0===p||null===(e=p.data)||void 0===e||null===(s=e.data)||void 0===s||null===(t=s.company)||void 0===t?void 0:t.rfi,w=null===j||void 0===j?void 0:j.filter((function(e){return e.status===c.Ph.PENDING}))[0],k=null===j||void 0===j?void 0:j.filter((function(e){return e.status===c.Ph.FILLED}
1))[0],O=w||k,A=null===O||void 0===O?void 0:O.questions.map((function(e){return e.answers.filter((function(e){return e.answeredBy===i&&"PUBLISHED"===e.status})).length>0})),S=null===O||void 0===O?void 0:O.questions.map((function(e){var s;return(null===(s=null===e||void 0===e?void 0:e.children[0])||void 0===s?void 0:s.answers.filter((function(e){return e.answeredBy===i&&"PUBLISHED"===e.status})).length)>0})),E=(0,a.useMemo)((function(){return!!(null===O||void 0===O?void 0:O.questions.find((function(e){return e.answers.some((function(e){return"PUBLISHED"===e.status}))})))}),[null===O||void 0===O?void 0:O.questions]),P=null===A||void 0===A?void 0:A.includes(!0),T=!0;(null===O||void 0===O?void 0:O.questions.some((function(e){return e.children.length>0})))&&(T=null===S||void 0===S?void 0:S.includes(!0));var I=Hn({emitter:d}),F=I.confirmationModal,R=I.handleOnConfirm,L=Xn(),_=L.handleOnOkSubmit,B=L.handleOnOkSave,V=(0,a.useCallback)((function(){var e,s=[];return null===O||void 0===O||null===(e=O.questions)||void 0===e||e.forEach((function(e,t){var r,o=null===O||void 0===O?void 0:O.questions[t].answers.filter((function(e){return e.answeredBy===i&&"DRAFT"===e.status}));(null===o||void 0===o?void 0:o.length)>0?null===O||void 0===O||O.questions[t].answerType.forEach((function(e){var n="UPLOAD_DOC"===e,a="FREE_TEXT"===e,i=o.filter((function(e){return"FREE_TEXT"===e.type}))[0],l=o.filter((function(e){return"UPLOAD_DOC"===e.type}))[0];if(n){var u=!1;i&&"string"!==typeof(null===l||void 0===l?void 0:l.reason)?u=!0:l?u=l.isAnswer:E||(u=!0),r={questionId:null===O||void 0===O?void 0:O.questions[t]._id,isAnswer:u,comment:(null===l||void 0===l?void 0:l.comment)||"",type:e,documents:(null===l||void 0===l?void 0:l.documents)||[],reason:"string"===typeof(null===l||void 0===l?void 0:l.reason)?l.reason:null}}else a&&(r={questionId:null===O||void 0===O?void 0:O.questions[t]._id,isAnswer:"boolean"===typeof(null===i||void 0===i?void 0:i.isAnswer)&&i.isAnswer,answer:(null===i||void 0===i?void 0:i.answer)||"",type:e});s.push(r)})):null===O||void 0===O||O.questions[t].answerType.forEach((function(e){var o="FREE_TEXT"===e;"UPLOAD_DOC"===e?r={questionId:null===O||void 0===O?void 0:O.questions[t]._id,isAnswer:!E,comment:"",type:e,documents:[],reason:null}:o&&(r={questionId:null===O||void 0===O?void 0:O.questions[t]._id,isAnswer:!E,answer:"",type:e}),s.push(r)}))})),(0,g.sortBy)(s,["type"])}),[E,null===O||void 0===O?void 0:O.questions,i]),U=(0,a.useCallback)((function(){var e,s=[];return null===O||void 0===O||null===(e=O.questions)||void 0===e||e.forEach((function(e,t){var r,o,n,a,l,u=null===(r=null===O||void 0===O?void 0:O.questions[t].children[0])||void 0===r?void 0:r.answers.filter((function(e){return e.answeredBy===i&&"DRAFT"===e.status})),c=null===(o=null===O||void 0===O?void 0:O.questions[t].children[0])||void 0===o?void 0:o.answers.some((function(e){return"PUBLISHED"===e.status}));(null===u||void 0===u?void 0:u.length)>0?null===(a=null===O||void 0===O?void 0:O.questions[t].children[0])||void 0===a||a.answerType.forEach((function(e){var r="UPLOAD_DOC"===e,o="FREE_TEXT"===e,a=u.filter((function(e){return"UPLOAD_DOC"===e.type}))[0],i=u.filter((function(e){return"FREE_TEXT"===e.type}))[0];if(r){var l,d=!1;i&&"string"!==typeof(null===a||void 0===a?void 0:a.reason)?d=!0:a?d=a.isAnswer:c||(d=!0),n={parentId:null===O||void 0===O?void 0:O.questions[t]._id,questionId:null===(l=null===O||void 0===O?void 0:O.questions[t].children[0])||void 0===l?void 0:l._id,isAnswer:d,comment:(null===a||void 0===a?void 0:a.comment)||"",type:e,documents:(null===a||void 0===a?void 0:a.documents)||[],reason:"string"===typeof(null===a||void 0===a?void 0:a.reason)?a.reason:null}}else if(o){var p;n={parentId:null===O||void 0===O?void 0:O.questions[t]._id,questionId:null===(p=null===O||void 0===O?void 0:O.questions[t].children[0])||void 0===p?void 0:p._id,isAnswer:"boolean"===typeof(null===i||void 0===i?void 0:i.isAnswer)&&i.isAnswer,answer:(null===i||void 0===i?void 0:i.answer)||"",type:e}}s.push(n)})):null===(l=null===O||void 0===O?void 0:O.questions[t].children[0])||void 0===l||l.answerType.forEach((function(e){var r,o="FREE_TEXT"===e;if("UPLOAD_DOC"===e)n={parentId:null===O||void 0===O?void 0:O.questions[t]._id,questionId:null===(r=null===O||void 0===O?void 0:O.questions[t].children[0])||void 0===r?void 0:r._id,isAnswer:!c,comment:"",type:e,documents:[],reason:null};else if(o){var a;n={parentId:null===O||void 0===O?void 0:O.questions[t]._id,questionId:null===(a=null===O||void 0===O?void 0:O.questions[t].children[0])||void 0===a?void 0:a._id,isAnswer:!c,answer:"",type:e}}s.push(n)}))})),(0,g.sortBy)(s,["type"])}),[null===O||void 0===O?void 0:O.questions,i]),M=(0,a.useMemo)((function(){var e,s;return function(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){Jn(e,s,t[s])}))}return e}({},O||{},{applicationID:null===p||void 0===p||null===(e=p.data)||void 0===e||null===(s=e.data)||void 0===s?void 0:s._id,answers:V(),childrenAnswers:U()})}),[O,null===p||void 0===p||null===(o=p.data)||void 0===o||null===(n=o.data)||void 0===n?void 0:n._id,V,U]),Z=(0,a.useMemo)((function(){var e=(null===O||void 0===O?void 0:O.questions)||[];return(0,r.jsx)(r.Fragment,{children:e.map((function(e,s){return(0,r.jsx)($n.Z,{index:s,question:e,isAlreadyFilled:P,isAlreadyFilledAdditional:T,isSubmitted:x,setIsSubmitted:v},e._id)}))})}),[null===O||void 0===O?void 0:O.questions,P,T,x]);return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)(Qn.Z,{isOpen:m.isOpen,onClose:m.onClose}),(0,r.jsx)(C.Z,{open:F.isOpen,title:"Leave The Process?",okText:"Leave",okVariant:"primary",cancelVariant:"secondary",okRed:!0,onOk:R,onCancel:F.onClose,children:(0,r.jsx)("p",{className:"sprout-text-sm sprout-pt-4 sprout-pb-6 sprout-px-3",children:"Any unsaved data won\u2019t be saved."})}),(0,r.jsx)(b.Z.form,{initialValues:M,onSubmit:function(e){v(!0),_(e)},validation:function(e){var s,t,r={},o=e.answers,n=e.childrenAnswers;o.forEach((function(e,s){var t,o=e.type,n="FREE_TEXT"===o;if("UPLOAD_DOC"===o){var a,i,l;
1if(e.isAnswer)if(0===e.documents.length)(null===(a=r.answers)||void 0===a?void 0:a[s])||(0,g.set)(r,"answers[".concat(s,"]"),{}),r.answers[s].documents="This field is required";if(!e.isAnswer&&!E)if(!e.reason)(null===(i=r.answers)||void 0===i?void 0:i[s])||(0,g.set)(r,"answers[".concat(s,"]"),{}),r.answers[s].reason="This field is required";if(!e.isAnswer&&E)if("string"===typeof(null===e||void 0===e?void 0:e.reason)&&""===(null===e||void 0===e?void 0:e.reason))(null===(l=r.answers)||void 0===l?void 0:l[s])||(0,g.set)(r,"answers[".concat(s,"]"),{}),r.answers[s].reason="This field is required"}n&&(!e.answer&&e.isAnswer&&((null===(t=r.answers)||void 0===t?void 0:t[s])||(0,g.set)(r,"answers[".concat(s,"]"),{}),r.answers[s].answer="This field is required"))}));var a=null!==(t=null===O||void 0===O||null===(s=O.questions)||void 0===s?void 0:s.some((function(e){var s;return null===(s=e.children)||void 0===s?void 0:s.some((function(e){var s;return null===(s=e.answers)||void 0===s?void 0:s.some((function(e){return"PUBLISHED"===e.status}))}))})))&&void 0!==t&&t;return n.forEach((function(e,s){var t,o=e.type,n="FREE_TEXT"===o;if("UPLOAD_DOC"===o){var i,l,u;if(e.isAnswer)if(0===e.documents.length)(null===(i=r.childrenAnswers)||void 0===i?void 0:i[s])||(0,g.set)(r,"childrenAnswers[".concat(s,"]"),{}),r.childrenAnswers[s].documents="This field is required";if(!e.isAnswer&&!a)if(!e.reason)(null===(l=r.childrenAnswers)||void 0===l?void 0:l[s])||(0,g.set)(r,"childrenAnswers[".concat(s,"]"),{}),r.childrenAnswers[s].reason="This field is required";if(!e.isAnswer&&a)if("string"===typeof(null===e||void 0===e?void 0:e.reason)&&""===(null===e||void 0===e?void 0:e.reason))(null===(u=r.childrenAnswers)||void 0===u?void 0:u[s])||(0,g.set)(r,"childrenAnswers[".concat(s,"]"),{}),r.childrenAnswers[s].reason="This field is required"}n&&(!e.answer&&e.isAnswer&&((null===(t=r.childrenAnswers)||void 0===t?void 0:t[s])||(0,g.set)(r,"childrenAnswers[".concat(s,"]"),{}),r.childrenAnswers[s].answer="This field is required"))})),Object.keys(r).length>0&&f("Please answer all questions","error"),r},validateOnBlur:!1,validateOnChange:!1,scrollOnError:!0,children:(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-gap-6",children:[Z,(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-row sprout-items-center sprout-justify-end sprout-gap-6",children:[(0,r.jsx)(sa,{initialValues:M,confirmationModal:F,handleOnConfirm:R}),(!P||!T)&&(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)(ea,{handleOnSave:B}),(0,r.jsx)(D.iR,{primary:!0,type:"submit",children:"Submit"})]})]})]})})]})}var ra=t(34824),oa=t(62842),na=t(40084),aa=t(95939),ia=t(337),la=t(55639),ua=t(82834);function ca(e,s,t,r,o,n,a){try{var i=e[n](a),l=i.value}catch(u){return void t(u)}i.done?s(l):Promise.resolve(l).then(r,o)}function da(e){return function(){var s=this,t=arguments;return new Promise((function(r,o){var n=e.apply(s,t);function a(e){ca(n,r,o,a,i,"next",e)}function i(e){ca(n,r,o,a,i,"throw",e)}a(void 0)}))}}var pa=function(e){var s=e.emitter,t=(0,u.SS)().companyInformation,r=(0,Ue.Z)(),o=(0,a.useRef)(N.q.getState()).current.setGlobalSnackbar,n=(0,je.useRouter)(),i=(0,ua.E)().setPageLoading,l=(0,a.useCallback)((function(){o("Successfully saved the progress","success")}),[o]);return{handleOnBack:(0,a.useCallback)((function(){return s.emit("@stepper",5)}),[s]),handleOnSave:l,handleOnNext:(0,a.useCallback)((function(){return s.emit("@stepper",5)}),[s]),handleOnResend:(0,a.useCallback)((function(e){return r.post("/kyb/core/resend-ekyc-link/".concat(e)).then(da(U().mark((function e(s){return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("OK"!==(null===s||void 0===s?void 0:s.status)){e.next=3;break}return t.mutate(),e.abrupt("return",o("Your invitation has been sent","success"));case 3:return o("Something went wrong","error"),e.abrupt("return",null);case 5:case"end":return e.stop()}}),e)})))).catch((function(e){o(e.message,"error")}))}),[r,t,o]),handleOnApplicantOpenEKyc:(0,a.useCallback)(da(U().mark((function e(){var s,o,a,i,l,u,c,d,p;return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(l=null===t||void 0===t||null===(s=t.data)||void 0===s||null===(o=s.data)||void 0===o||null===(a=o.company)||void 0===a||null===(i=a.members)||void 0===i?void 0:i.find((function(e){return e.isApplicant})))){e.next=12;break}if(u=l._id,c=l.eKycStatus,d=l.eKycLink,"Expired"!==c){e.next=11;break}return e.next=8,r.post("/kyb/core/resend-ekyc-link/".concat(u));case 8:p=e.sent.data,d=p,t.mutate();case 11:d&&n.push(d);case 12:case"end":return e.stop()}}),e)}))),[r,t,n]),handleOnGenerateOnfidoLink:(0,a.useCallback)(da(U().mark((function e(s){return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i(!0),e.prev=1,e.next=4,r.get("/kyb/application/".concat(s,"/generate-onfido-link"));case 4:e.sent.data&&t.mutate(),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),o("Something went wrong","error");case 11:return e.prev=11,i(!1),e.finish(11);case 14:case"end":return e.stop()}}),e,null,[[1,8,11,14]])}
1))),[r,t,o,i])}},ma=t(85614),fa=function(){return(0,r.jsxs)("p",{className:"sprout-text-xs sprout-flex sprout-gap-2",children:[(0,r.jsxs)("svg",{"aria-hidden":"true",className:"sprout-w-8 sprout-h-8 sprout-text-gray-200 sprout-animate-spin sprout-dark:text-gray-600 sprout-fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),(0,r.jsx)("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"#14213D"})]}),(0,r.jsx)("span",{className:"sprout-my-auto",children:"Generating..."})]})};function ha(e){var s=e.name,t=e.company,o=e.role,n=e.status,i=e.officer,l=e.isCurrentUserApplicant,c=(0,u.SS)(),d=c.emitter,p=c.isAgentMode,f=pa({emitter:d}),h=f.handleOnResend,x=f.handleOnGenerateOnfidoLink,v=f.handleOnApplicantOpenEKyc,y=(0,a.useState)(!1),g=y[0],j=y[1],b=(0,a.useRef)(null),N=(0,a.useState)("00:00:00"),C=N[0],w=N[1],k=(0,a.useCallback)((function(e){var s=function(e){var s=Date.parse(String(e))-Date.parse(String(new Date)),t=Math.floor(s/1e3%60),r=Math.floor(s/1e3/60%60);return{total:s,hours:Math.floor(s/1e3/60/60%24),minutes:r,seconds:t}}(e),t=s.total,r=s.minutes,o=s.seconds;t>=0&&w("".concat(r>9?r:"0".concat(r),":").concat(o>9?o:"0".concat(o))),t<=0&&j(!1)}),[]),O=(0,a.useCallback)((function(e){w("10:00"),b.current&&clearInterval(b.current);var s=setInterval((function(){k(e)}),1e3);b.current=s}),[k]),A=function(){var e=new Date;return e.setSeconds(e.getSeconds()+600),e},S=g||!["Pending eKYC","Expired"].includes(n),P=(0,a.useMemo)((function(){return new Date}),[]),T=(0,la.Z)(),I=(0,a.useCallback)((function(e){return e.isApplicant?"Pending"===e.eKycStatus?(0,r.jsx)(D.iR,{primary:!0,onClick:function(){return v()},children:"Start eKYC"}):(0,r.jsx)(D.iR,{primary:!0,disabled:!0,children:"Start eKYC"}):e.isFlaggedAsOutgoing?(0,r.jsx)(r.Fragment,{}):"NOTARIZED_DOCUMENT"===e.agentEkycType?(0,r.jsxs)("div",{className:"sprout-text-[12px]",children:[(0,r.jsx)("div",{className:"sprout-text-[#757575]",children:"You've chosen to provide the stakeholder information using:"}),(0,r.jsxs)("span",{className:"sprout-font-bold sprout-text-[12px] sprout-text-[#757575]",children:[" ","Notarized Document"]})]}):e.appointments.some((function(e){return"Authorized Person"===e.position&&"Active"===e.status}))?e.eKycLink&&e.urlExpiredDate&&!(P>new Date(e.urlExpiredDate))||["Compliance Review","Completed"].includes(e.eKycStatus)?(0,r.jsx)(D.iR,{primary:!0,orange:!0,onClick:function(){return T.copy(e.eKycLink)},className:"sprout-cursor-pointer",children:"Copy Link"}):(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"sprout-text-[16px] sprout-font-semibold sprout-text-[#FB8110] sprout-mt-[8px] sprout-mb-[8px] sprout-text-center sprout-cursor-pointer",onClick:function(){return h(e._id)},children:"Generate"}),(0,r.jsx)("div",{className:"sprout-text-[#960F21] sprout-font-semibold sprout-text-[10px] sprout-mt-[8px]",children:"The eKYC link was expired. Please generate a new one."})]}):"FACIAL_VERIFICATION"!==e.agentEkycType||e.eKycLink&&e.urlExpiredDate&&!(P>new Date(e.urlExpiredDate))||["Compliance Review","Completed"].includes(e.eKycStatus)?(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"sprout-text-[#757575] sprout-text-[12px]",children:"You've chosen to provide the stakeholder information using:"}),(0,r.jsxs)("span",{className:"sprout-text-[#757575] sprout-text-[12px] sprout-font-bold",children:[" ","Facial Verification"]}),(0,r.jsxs)("div",{className:"sprout-mt-[8px] sprout-flex",children:[(0,r.jsx)("div",{className:"sprout-w-9/12 sprout-break-words sprout-text-[#121212] sprout-text-[12px] md:sprout-text-[14px]",children:e.eKycLink}),(0,r.jsx)("div",{className:"sprout-cursor-pointer sprout-col-span-3 sprout-ml-[8px]",onClick:function(){return T.copy(e.eKycLink)},children:(0,r.jsx)(ia.r,{})})]})]}):(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"sprout-text-[#757575] sprout-text-[12px]",children:"You've chosen to provide the stakeholder information using:"}),(0,r.jsxs)("span",{className:"sprout-text-[#757575] sprout-text-[12px] sprout-font-bold",children:[" ","Facial Verification"]}
1),(0,r.jsx)("div",{className:"sprout-text-[16px] sprout-font-semibold sprout-text-[#FB8110] sprout-mt-[8px] sprout-mb-[8px] sprout-text-center sprout-cursor-pointer",onClick:function(){return x(e._id)},children:"Generate"}),(0,r.jsx)("div",{className:"sprout-text-[#960F21] sprout-font-semibold sprout-text-[10px] sprout-mt-[8px]",children:"The eKYC link was expired. Please generate a new one."})]})}),[T,v,x,h,P]),F=(0,a.useCallback)((function(e){return l?p?I(e):!i.isApplicant&&l&&i.eKycLink?(0,r.jsx)("div",{className:"sprout-hidden md:sprout-block",children:(0,r.jsxs)(D.iR,{className:"sprout-text-primary sprout-font-semibold sprout-w-fit",tertiary:!0,onClick:function(){h(i._id),O(A()),j(!0)},disabled:S,children:["Resend ",g&&C]})}):i.isFlaggedAsOutgoing||i.eKycLink?(0,r.jsx)(r.Fragment,{}):(0,r.jsx)("div",{className:"sprout-hidden md:sprout-block",children:(0,r.jsx)("div",{className:"sprout-w-fit",children:(0,r.jsx)("div",{className:(0,m.WD)(["sprout-rounded-full sprout-py-1 sprout-px-2","sprout-bg-[#FFF6E7]"]),children:(0,r.jsx)(fa,{})})})}):(0,r.jsx)(r.Fragment,{})}),[p,i.isApplicant,i.eKycLink,i.isFlaggedAsOutgoing,i._id,l,I,S,g,C,h,O]);return(0,r.jsxs)("div",{className:E()(["sprout-grid md:sprout-grid-cols-4 sprout-py-3 sprout-gap-2",p?"sprout-grid-cols-1":"sprout-grid-cols-2"]),children:[(0,r.jsxs)("div",{className:(0,m.WD)([l?"md:sprout-col-span-2":"md:sprout-col-span-3","sprout-flex sprout-flex-col"]),children:[(0,r.jsx)("p",{className:"sprout-text-[#121212]",children:s}),(0,r.jsx)("p",{className:"sprout-text-sm sprout-text-[#757575]",dangerouslySetInnerHTML:{__html:o},children:t&&(0,r.jsx)("span",{className:"sprout-font-semibold",children:t})})]}),(0,r.jsx)("div",{className:"sprout-hidden md:sprout-block sprout-w-fit",children:(0,r.jsx)("div",{className:(0,m.WD)(["sprout-rounded-full sprout-py-1 sprout-px-2",l?"":"sprout-ml-[16px]",(0,ma.Z)(n)]),children:i.eKycStatus||i.isFlaggedAsOutgoing||i.isApplicant?(0,r.jsx)("p",{className:"sprout-text-xs",children:n||"N/A"}):(0,r.jsx)(fa,{})})}),(0,r.jsx)("div",{className:"sprout-hidden md:sprout-block",children:F(i)}),p?(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-row sprout-justify-between md:sprout-hidden",children:[(0,r.jsx)("div",{className:"sprout-w-1/2",children:(0,r.jsx)("div",{className:(0,m.WD)(["sprout-rounded-full sprout-py-1 sprout-px-2 sprout-w-fit",(0,ma.Z)(n)]),children:i.eKycStatus||i.isFlaggedAsOutgoing||i.isApplicant?(0,r.jsx)("p",{className:"sprout-text-xs",children:n||"N/A"}):(0,r.jsx)(fa,{})})}),(0,r.jsx)("div",{className:"sprout-w-1/2",children:F(i)})]})}):(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("div",{className:"sprout-flex sprout-items-end md:sprout-hidden sprout-flex-col sprout-space-y-2",children:[(0,r.jsx)("div",{className:"sprout-w-fit",children:(0,r.jsx)("div",{className:(0,m.WD)(["sprout-rounded-full sprout-py-1 sprout-px-2",(0,ma.Z)(n)]),children:i.eKycStatus||i.isFlaggedAsOutgoing||i.isApplicant?(0,r.jsx)("p",{className:"sprout-text-xs",children:n||"N/A"}):(0,r.jsx)(fa,{})})}),!i.isApplicant&&l&&(i.eKycLink?(0,r.jsx)("div",{className:"sprout-block md:sprout-hidden",children:(0,r.jsxs)(D.iR,{className:"sprout-text-primary sprout-font-semibold sprout-w-fit",tertiary:!0,onClick:function(){h(i._id),O(A()),j(!0)},disabled:S,children:["Resend ",g&&C]})}):(0,r.jsx)("div",{className:"sprout-block md:sprout-hidden",children:(0,r.jsx)("div",{className:"sprout-w-fit",children:i.isFlaggedAsOutgoing?(0,r.jsx)(r.Fragment,{}):(0,r.jsx)("div",{className:(0,m.WD)(["sprout-rounded-full sprout-py-1 sprout-px-2","sprout-bg-[#FFF6E7]"]),children:(0,r.jsx)(fa,{})})})}))]})})]})}var xa=t(81565);function va(e){return function(e){if(Array.isArray(e)){for(var s=0,t=new Array(e.length);s<e.length;s++)t[s]=e[s];return t}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function ya(e){var s,t=e.isCurrentUserApplicant,o=(0,u.SS)(),n=o.companyInformation,i=o.submissionCompletedModal,l=o.isAgentMode,d={members:[]},p=(0,y.a)().profileState,m=p.userId,f=p.profile,h=(0,a.useState)(!1),x=h[0],v=h[1];
1n.data&&(0,g.get)(n.data.data,"company.members",[]).forEach((function(e){for(var s,r,o,n,a,i,u,p,h,x,v=e,y=[],g=[],j=[],b=[],N=[],C=[],D=0;D<v.appointments.length;D+=1){var w=v.appointments[D];va(c.Ax).concat(["Authorized Person","Nominator"]).includes(w.position)&&("Active"!==w.status||w.isOutgoing?w.isOutgoing&&(y.push(w),b.push(w)):(y.push(w),N.push(w))),["Corporate Representative of","Corporate Representative"].includes(w.position)&&"Active"===w.status&&C.push(w),c.Kh.includes(w.position)&&("Active"===w.status?g.push(w):w.isOutgoing&&(g.push(w),b.push(w))),"Active"===w.status&&j.push(w)}(v.isApplicant||!b.length||N.length)&&(!C.length||y.length||g.length)||(v.isFlaggedAsOutgoing=!0,v.eKycLink="",v.eKycStatus=""),(v.userId===m||t&&v.isApplicant||(null===(s=v.personDetails)||void 0===s||null===(r=s.contactDetails)||void 0===r||null===(o=r.email)||void 0===o?void 0:o.toLowerCase())===(null===f||void 0===f||null===(n=f.emailAddresses)||void 0===n||null===(a=n[0])||void 0===a?void 0:a.toLowerCase()))&&!l||t&&v.isApplicant||(null===(i=v.personDetails)||void 0===i||null===(u=i.contactDetails)||void 0===u||null===(p=u.email)||void 0===p?void 0:p.toLowerCase())===(null===f||void 0===f||null===(h=f.emailAddresses)||void 0===h||null===(x=h[0])||void 0===x?void 0:x.toLowerCase())?d.currentUser=v:(y.length>0&&"INDIVIDUAL"===v.category||g.length>0&&"INDIVIDUAL"===v.category||C.length>0)&&d.members.push(v)}));var j=null===(s=d.currentUser)||void 0===s?void 0:s.eKycStatus,b=(0,a.useCallback)((function(e){var s=null,t=[],r=[];e.forEach((function(e){va(c.UK).concat(va(c.Kh),["Nominator"]).includes(e.position)&&("Active"===e.status||e.isOutgoing)&&("Corporate Representative of"===e.position?t.push(e):"Corporate Representative"===e.position?s=e:r.push(e))}));var o,n=va(r);t.length?(o=n).push.apply(o,va(t)):s&&n.push(s);return n}),[]);return(0,a.useEffect)((function(){!j||x||["Completed","Compliance Review"].includes(j)||(i.onOpen(),v(!0))}),[j]),m?(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col",children:[(0,r.jsx)(aa.Z,{isApplicant:t}),n.data&&d.members.sort((function(e,s){var t,r,o,n,a=(null===(t=e.personDetails)||void 0===t||null===(r=t.personalDetails)||void 0===r?void 0:r.fullName)||e.companyDetails.companyName||"",i=(null===(o=s.personDetails)||void 0===o||null===(n=o.personalDetails)||void 0===n?void 0:n.fullName)||s.companyDetails.companyName||"";return a.localeCompare(i)})).map((function(e){var s,o,n,a=e.eKycStatus;e.eKycStatus||(a="N/A"),"Pending"===e.eKycStatus&&(a="".concat(e.eKycStatus," eKYC")),"Compliance Review"!==e.eKycStatus&&"Completed"!==e.eKycStatus||(a="eKYC Submitted");var i=b(e.appointments).map((function(e){return"Corporate Representative of"===e.position?"".concat(e.position,' <span class="sprout-font-semibold">').concat(e.companyName,"<span>"):e.position}));return(0,r.jsx)(ha,{name:(null===(s=e.personDetails)||void 0===s||null===(o=s.personalDetails)||void 0===o?void 0:o.fullName)||(null===(n=e.companyDetails)||void 0===n?void 0:n.companyName),role:i.join(", "),status:a,officer:e,isCurrentUserApplicant:null!==t&&void 0!==t&&t},e._id)})),(0,r.jsx)(xa.Z,{isApplicant:t}),function(){if(d.currentUser){var e=d.currentUser.eKycStatus;return d.currentUser.eKycStatus||(e="N/A"),"Pending"===d.currentUser.eKycStatus&&(e="".concat(d.currentUser.eKycStatus," eKYC")),"Compliance Review"!==d.currentUser.eKycStatus&&"Completed"!==d.currentUser.eKycStatus||(e="eKYC Submitted"),(0,r.jsx)(ha,{name:d.currentUser.personDetails.personalDetails.fullName,role:b(d.currentUser.appointments).map((function(e){return"Corporate Representative of"===e.position?"".concat(e.position,' <span class="sprout-font-semibold">').concat(e.companyName,"<span>"):e.position})).join(", "),status:e,officer:d.currentUser,isCurrentUserApplicant:null!==t&&void 0!==t&&t},d.currentUser._id)}return(0,r.jsx)(r.Fragment,{})}()]}):(0,r.jsx)(r.Fragment,{})}function ga(e){var s=e.isCurrentUserApplicant,t=e.isOpen,o=e.onClose,n=e.eKycLink,a=(0,u.SS)().emitter,i=pa({emitter:a}).handleOnApplicantOpenEKyc,l=(0,je.useRouter)();
1return(0,r.jsxs)(D.BT,{show:t,useBackground:!0,onClose:function(){return o()},className:"!sprout-p-4 sprout-w-11/12 md:sprout-w-8/12 lg:sprout-w-[489px]",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col",children:[(0,r.jsx)("h3",{className:"sprout-font-semibold sprout-text-base sprout-text-center sprout-mb-4",children:"Submission Completed!"}),(0,r.jsx)("div",{className:"sprout-flex sprout-justify-center",children:(0,r.jsx)(na.g,{})}),(0,r.jsx)("div",{className:"sprout-mt-[8px]",children:"You've successfully completed the company details portion of onboarding."}),(0,r.jsx)("div",{className:"sprout-mt-6",children:"The next step is to gather and submit personal information for you and other stakeholders."}),(0,r.jsx)("div",{className:"sprout-mt-6",children:"You need to prepare these documents:"}),(0,r.jsxs)("ol",{className:"sprout-list-decimal sprout-list-inside sprout-mt-6",children:[(0,r.jsx)("li",{className:"sprout-font-semibold",children:"NRIC/Passport"}),(0,r.jsx)("li",{className:"sprout-font-semibold",children:"Proof of Address (if you are non-Singaporean)"}),(0,r.jsx)("li",{className:"sprout-font-semibold",children:"FIN card number (if you are FIN card holder)"})]}),(0,r.jsx)("div",{className:"sprout-mt-6",children:"If you do not have all of the documents ready, you can save this session and continue with all of documents ready."})]}),(0,r.jsxs)("div",{className:"sprout-flex sprout-justify-between sprout-mt-8",children:[(0,r.jsx)(D.iR,{secondary:!0,onClick:o,className:"sprout-w-full sprout-mr-[12px]",children:"Do It Later"}),(0,r.jsx)(D.iR,{primary:!0,onClick:function(){s?i():n&&l.push(n)},className:"sprout-w-full sprout-ml-[12px]",children:"Start Now"})]})]})}function ja(){var e,s=(0,y.a)().profileState.userId,t=(0,u.SS)(),o=t.emitter,n=null===(e=t.companyInformation.data.data)||void 0===e?void 0:e.company.rfi,i=[],l=[],d=[];n.forEach((function(e){e.status===c.Ph.PENDING?i.push(e):e.status===c.Ph.FILLED?l.push(e):e.status===c.Ph.COMPLETED&&d.push(e)}));var p=null;i.length>0?p=i[0]:l.length>0?p=l[0]:d.length>0&&(p=d[0]);var f=null===p||void 0===p?void 0:p.questions.map((function(e){return e.answers.filter((function(e){return e.answeredBy===s&&"PUBLISHED"===e.status})).length>0})),h=null===p||void 0===p?void 0:p.questions.map((function(e){var t;return(null===(t=e.children[0])||void 0===t?void 0:t.answers.filter((function(e){return e.answeredBy===s&&"PUBLISHED"===e.status})).length)>0})),x=null===p||void 0===p?void 0:p.questions.some((function(e){return e.children.length>0})),v=null===f||void 0===f?void 0:f.includes(!0),g=!0;x&&(g=!!(null===h||void 0===h?void 0:h.includes(!0)));var j=i.length+l.length>0?c.Ph.PENDING:c.Ph.COMPLETED,b=v&&g,N=b||j===c.Ph.COMPLETED,C=(0,a.useMemo)((function(){return b?{label:"Response Submitted",color:"sprout-bg-[#CEFEBF]"}:{label:"Pending Response",color:"sprout-bg-[#FFF6E7]"}}),[b]);return(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col",children:[(0,r.jsx)("div",{className:"sprout-grid md:sprout-grid-cols-2 sprout-py-3 sprout-border-[#EFEFEF] sprout-border-b-[1px]",children:(0,r.jsx)("p",{className:"sprout-text-sm sprout-font-semibold",children:"Company RFI"})}),(0,r.jsxs)("div",{className:"sprout-grid sprout-grid-cols-2 md:sprout-grid-cols-4 sprout-py-3 sprout-gap-2",children:[(0,r.jsxs)("div",{className:"md:sprout-col-span-3 sprout-flex sprout-flex-col",children:[(0,r.jsx)("p",{className:"sprout-text-[10px] sprout-text-[#757575] sprout-font-semibold",children:"Submission Log:"}),n.map((function(e){var s;return null===e||void 0===e||null===(s=e.submissionLogs)||void 0===s?void 0:s.map((function(e,s){return(0,r.jsxs)("p",{className:"sprout-text-[10px] sprout-text-[#757575]",children:["RFI submission ",s+1,":"," ",(0,J.Z)(new Date(e.date),"dd/MM/yyyy HH:mm")]},e._id)}))}))]}),(0,r.jsx)("div",{className:"sprout-hidden md:sprout-block sprout-w-fit",children:(0,r.jsx)("div",{className:(0,m.WD)(["sprout-rounded-full sprout-py-1 sprout-px-2",C.color]),children:(0,r.jsx)("p",{className:"sprout-text-xs",children:C.label})})})]}),(0,r.jsx)("div",{className:"sprout-flex md:sprout-hidden sprout-flex-row sprout-justify-between sprout-items-center",children:(0,r.jsx)("div",{className:"sprout-w-fit",children:(0,r.jsx)("div",{className:(0,m.WD)(["sprout-rounded-full sprout-py-1 sprout-px-2",C.color]),children:(0,r.jsx)("p",{className:"sprout-text-xs",children:C.label})})})}),(0,r.jsx)(D.iR,{primary:!0,className:"sprout-w-full sprout-mt-[24px]",disabled:N,onClick:function(){return o.emit("@set-is-rfi",!0)},children:"Provide Response"})]})}function ba(){var e,s,t,o,n,i,l,d,p,f,h,x,v,j,N,C,w=(0,u.SS)(),k=w.applicationProgressModal,O=w.isACRAError,A=w.selectedOption,S=w.companyInformation,E=w.submissionCompletedModal,I=w.isAgentMode,F=w.emitter,R=(0,oa.Z)(),L=R.state,_=R.action,B=R.router,V=(0,g.get)(null===(e=S.data)||void 0===e||null===(s=e.data)||void 0===s?void 0:s.company,"rfi",[]).filter((function(e){return"DRAFT"!==e.status})).length>0,U=(0,y.a)().profileState,M=U.userId,Z=U.profile,q=null===Z||void 0===Z||null===(t=Z.emailAddresses)||void 0===t||null===(o=t[0])||void 0===o?void 0:o.toLowerCase(),W=pa({emitter:F}),G=W.handleOnResend,K=W.handleOnApplicantOpenEKyc,H=(0,a.useMemo)((function(){var e,s;return(null===(e=S.data)||void 0===e||null===(s=e.data)||void 0===s?void 0:s.kybSubmittedBy)===M}),[null===(n=S.data)||void 0===n||null===(i=n.data)||void 0===i?void 0:i.kybSubmittedBy,M]),z=(0,a.useMemo)((function(){var e,s,t;return null===(e=S.data)||void 0===e||null===(s=e.data)||void 0===s||null===(t=s.company)||void 0===t?void 0:t.members.find((function(e){var s,t,r;return e.userId===M||H&&e.isApplicant||(null===(s=e.personDetail
1s)||void 0===s||null===(t=s.contactDetails)||void 0===t||null===(r=t.email)||void 0===r?void 0:r.toLowerCase())===q}))}),[null===(l=S.data)||void 0===l||null===(d=l.data)||void 0===d||null===(p=d.company)||void 0===p?void 0:p.members,q,H,M]),Y=(0,a.useMemo)((function(){var e,s,t;return!!(null===z||void 0===z||null===(e=z.appointments)||void 0===e?void 0:e.some((function(e){return"Authorized Person"===e.position&&"Active"===e.status})))&&(null===(s=S.data)||void 0===s||null===(t=s.data)||void 0===t?void 0:t.isAgentFlow)}),[null===(f=S.data)||void 0===f||null===(h=f.data)||void 0===h?void 0:h.isAgentFlow,null===z||void 0===z?void 0:z.appointments]),X=(0,a.useMemo)((function(){return(null===z||void 0===z?void 0:z.eKycStatus)===c.aW.EXPIRED&&(H||Y)?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{children:"Your eKYC link is expired. Please click button below to regenerate new link."}),(0,r.jsx)(D.iR,{primary:!0,className:"sprout-w-full sprout-mt-[24px]",onClick:function(){G(z._id)},children:"Regenerate"})]}):"Pending"===(null===z||void 0===z?void 0:z.eKycStatus)?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{children:"For your next step, stakeholders will have to provide personal information to complete the KYC (know your customer) process. You can start by clicking on Start eKYC button below."}),(0,r.jsx)(D.iR,{primary:!0,className:"sprout-w-full sprout-mt-[24px]",onClick:function(){I?K():B.push(z.eKycLink)},children:"Start eKYC"})]}):(0,r.jsx)("div",{children:"You have completed your portion of the process. Once all your company stakeholders have completed their portion, we will start processing the application."})}),[null===z||void 0===z?void 0:z._id,null===z||void 0===z?void 0:z.eKycLink,null===z||void 0===z?void 0:z.eKycStatus,K,G,Y,I,H,B]);return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)(Qn.Z,{isOpen:k.isOpen,onClose:k.onClose}),(0,r.jsx)(ga,{isCurrentUserApplicant:H||Y,eKycLink:null===z||void 0===z?void 0:z.eKycLink,isOpen:E.isOpen,onClose:E.onClose}),(0,r.jsx)(ra.Z,{state:L,action:_,router:B}),(0,r.jsx)("div",{className:"sprout-mb-[32px] sprout-text-2xl sprout-font-semibold sprout-text-center",children:"Congratulations!"}),(0,r.jsx)("div",{className:"sprout-flex sprout-justify-center sprout-mb-[32px]",children:(0,r.jsx)(na.g,{})}),(0,r.jsx)("div",{className:"sprout-mb-[24px]",children:"We're pleased to inform you that your application has been successfully submitted."}),(0,r.jsxs)("div",{className:"sprout-flex sprout-justify-between sprout-mb-[24px]",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-gap-2",children:[(0,r.jsx)("div",{className:"sprout-font-semibold sprout-text-lg md:sprout-text-2xl",children:null===S||void 0===S||null===(x=S.data)||void 0===x||null===(v=x.data)||void 0===v||null===(j=v.company)||void 0===j?void 0:j.companyName}),(0,r.jsxs)("p",{className:"sprout-text-[#757575] sprout-font-semibold sprout-text-base md:sprout-text-xl",children:["UEN ",(null===S||void 0===S||null===(N=S.data)||void 0===N||null===(C=N.data)||void 0===C?void 0:C.uen)||"-"]})]}),(0,r.jsx)(D.iR,{secondary:!0,onClick:_.openModal,children:"Switch Organization"})]}),(0,r.jsx)(b.Z.form,{onSubmit:function(){},children:(0,r.jsx)("div",{className:(0,m.WD)(["sprout-relative sprout-flex sprout-flex-col","sprout-border sprout-border-[#CDCDCD] sprout-border-solid sprout-rounded-[16px]","sprout-overflow-hidden"]),children:(0,r.jsxs)("div",{className:"sprout-p-4 md:sprout-p-8 sprout-flex sprout-flex-col sprout-space-y-4 md:sprout-space-y-8",children:[(0,r.jsx)(ya,{isCurrentUserApplicant:H||Y}),O&&!A.incorporation&&(0,r.jsx)(P.Z,{variant:"info",classNames:"!sprout-px-4 !sprout-py-2 sprout-w-fit",leftIcon:(0,r.jsx)(T.Z,{color:"#057EB6"}),children:(0,r.jsx)("p",{className:"sprout-normal-case sprout-text-sm",children:"You can return to this page again to review the eKYC status for all other stakeholders as soon as we are able to retrieve their information from ACRA."})})]})})}),(0,r.jsx)("div",{className:"sprout-mt-[32px]",children:X}),V&&(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)(P.Z,{variant:"warning",classNames:"!sprout-px-4 !sprout-py-2 sprout-w-full sprout-mt-[32px]",leftIcon:(0,r.jsx)(T.Z,{color:"#E3930F"}),children:(0,r.jsx)("p",{className:"sprout-normal-case sprout-font-semibold sprout-text-sm",children:"We require additional information from your company for c
1ompliance. Please click the \u201cProvide Response\u201d button below to begin your RFI process."})}),(0,r.jsx)(ja,{})]})]})}function Na(e,s,t,r,o,n,a){try{var i=e[n](a),l=i.value}catch(u){return void t(u)}i.done?s(l):Promise.resolve(l).then(r,o)}var Ca=function(e){var s=e.emitter,t=(0,K.Z)(),r=(0,u.SS)(),o=r.selectedOption,n=r.companyInformation,i=(0,y.a)().mutate,l=(0,a.useRef)(N.q.getState()).current.setGlobalSnackbar,c=(0,M.Z)(),d=(0,a.useCallback)((function(){var e,r={services:o};s.emit("@set-is-page-loading",!0),t.onClose(),c.post("/kyb/application/upgrade",r).then((e=U().mark((function e(t){return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("OK"!==(null===t||void 0===t?void 0:t.status)){e.next=5;break}return s.emit("@set-is-loaded",!0),i(),n.mutate(),e.abrupt("return",s.emit("@stepper",1));case 5:return l("Something went wrong","error"),e.abrupt("return",null);case 7:case"end":return e.stop()}}),e)})),function(){var s=this,t=arguments;return new Promise((function(r,o){var n=e.apply(s,t);function a(e){Na(n,r,o,a,i,"next",e)}function i(e){Na(n,r,o,a,i,"throw",e)}a(void 0)}))})).catch((function(e){l(e.message,"error")})).finally((function(){s.emit("@set-is-page-loading",!1)}))}),[o,s,t,c,l,i,n]);return(0,a.useEffect)((function(){return s.on("@modal/confirm",t.onToggle),function(){s.off("@modal/confirm",t.onToggle)}}),[t.onToggle,s]),{handleOnConfirm:d,confirmationModal:t}};function Da(e,s,t,r,o,n,a){try{var i=e[n](a),l=i.value}catch(u){return void t(u)}i.done?s(l):Promise.resolve(l).then(r,o)}var wa=function(e){var s,t=e.emitter,r=(0,u.SS)(),o=r.selectedOption,n=r.companyInformation,i=(0,y.a)().mutate,l=(0,a.useCallback)((function(e,s){t.emit("@select-option",{key:e,value:s})}),[t]),c=(0,a.useRef)(N.q.getState()).current.setGlobalSnackbar,d=(0,M.Z)(),p=(0,a.useMemo)((function(){return{services:o}}),[o]);return{handleOnChangeSelect:l,handleOnSubmit:(0,a.useCallback)((s=U().mark((function e(){var s;return U().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.emit("@set-is-page-loading",!0),e.prev=1,e.next=4,d.post("/kyb/application/upgrade",p);case 4:if("OK"!==(null===(s=e.sent)||void 0===s?void 0:s.status)){e.next=12;break}return t.emit("@set-is-loaded",!0),i(),e.next=10,n.mutate();case 10:return t.emit("@stepper",1),e.abrupt("return");case 12:c("Something went wrong","error"),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(1),c(e.t0.message,"error");case 18:return e.prev=18,t.emit("@set-is-page-loading",!1),e.finish(18);case 21:case"end":return e.stop()}}),e,null,[[1,15,18,21]])})),function(){var e=this,t=arguments;return new Promise((function(r,o){var n=s.apply(e,t);function a(e){Da(n,r,o,a,i,"next",e)}function i(e){Da(n,r,o,a,i,"throw",e)}a(void 0)}))}),[t,d,p,c,i,n])}};function ka(e){return function(e){if(Array.isArray(e)){for(var s=0,t=new Array(e.length);s<e.length;s++)t[s]=e[s];return t}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var Oa=function(){var e,s,t=(0,y.a)().profileState.profile,o=(0,u.SS)(),n=o.emitter,i=o.selectedOption,l=o.service,c=o.companyInformation,d=wa({emitter:n}),p=d.handleOnSubmit,f=d.handleOnChangeSelect,h=Ca({emitter:n}),x=h.confirmationModal,v=h.handleOnConfirm;return(0,a.useEffect)((function(){setTimeout((function(){"corporate-secretary"===l?(f("corpSec",!0),f("finance",!1)):"incorporation"===l?f("incorporation",!0):"finance"===l&&(f("finance",!0),f("corpSec",!1))}),1e3)}),[f,l,c,null===c||void 0===c||null===(e=c.data)||void 0===e||null===(s=e.data)||void 0===s?void 0:s.services]),(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)(C.Z,{open:x.isOpen,title:"Are you sure to proceed without Expense Management upgrade?",okText:"Continue",cancelText:"Close",okVariant:"secondary",cancelVariant:"tertiary",onOk:v,onCancel:x.onClose,children:(0,r.jsx)("p",{className:"sprout-text-sm sprout-pt-4 sprout-pb-6 sprout-px-3",children:"We suggest you to upgrade so you don't have to redo the KYB process if you want to apply Expense Management in the future."})}),(0,r.jsx)("div",{className:(0,m.WD)(["sprout-relative sprout-flex sprout-flex-col","sprout-border sprout-border-[#CDCDCD] sprout-border-solid sprout-rounded-[16px]","sprout-overflow-hidden"]),children:(0,r.jsxs)("div",{className:"sprout-p-4 md:sprout-p-8 sprout-flex sprout-flex-col sprout-sp
1ace-y-4 md:sprout-space-y-8",children:[(0,r.jsxs)("p",{className:"sprout-text-sm md:sprout-text-base",children:["Hello, ",null===t||void 0===t?void 0:t.callFirstName," ",null===t||void 0===t?void 0:t.callLastName]}),(0,r.jsx)("p",{className:"sprout-text-sm md:sprout-text-base",children:"Congratulations on successfully creating an account. To ensure a smooth and efficient onboarding process for your company with Grof, please select the service you wish to onboard with us:"}),(0,r.jsx)("p",{className:"!sprout-font-semibold sprout-text-sm md:sprout-text-base",children:"Pick service you want to onboard:"}),(0,r.jsxs)("div",{className:(0,m.WD)(["sprout-relative sprout-flex sprout-flex-col","sprout-border sprout-border-[#CDCDCD] sprout-border-solid sprout-rounded-[16px] sprout-p-4","sprout-overflow-hidden","sprout-border-2",i.corpSec&&"!sprout-border-[#FB8110] !sprout-bg-[#FEE6CF]"].concat(ka((null===l||void 0===l?void 0:l.includes("corporate-secretary"))?["sprout-cursor-pointer","xl:hover:sprout-border-[#C4C4C4]","xl:hover:sprout-bg-[#FFF2E7]"]:["sprout-bg-[#E0E0E0]","sprout-text-[#9E9E9E]"]))),onClick:function(){(null===l||void 0===l?void 0:l.includes("corporate-secretary"))&&(f("corpSec",!0),f("finance",!1),f("incorporation",!1))},children:[(0,r.jsx)("h3",{className:"sprout-text-base md:sprout-text-xl sprout-font-semibold",children:"Appoint Grof as My Secretary"}),(0,r.jsx)("p",{className:"sprout-mt-2 sprout-text-sm md:sprout-text-base",children:"Get expert guidance, meticulous attention to filings, and ensure timely submissions simplifying your company administration."})]}),(0,r.jsxs)("div",{className:(0,m.WD)(["sprout-relative sprout-flex sprout-flex-col","sprout-border sprout-border-[#CDCDCD] sprout-border-solid sprout-rounded-[16px] sprout-p-4","sprout-overflow-hidden","sprout-border-2",i.incorporation&&"!sprout-border-[#FB8110] !sprout-bg-[#FEE6CF]"].concat(ka((null===l||void 0===l?void 0:l.includes("incorporation"))?["sprout-cursor-pointer","xl:hover:sprout-bg-[#FEE6CF] xl:hover:sprout-border-[#C4C4C4]"]:["sprout-bg-[#E0E0E0]","sprout-text-[#9E9E9E]"]))),onClick:function(){(null===l||void 0===l?void 0:l.includes("incorporation"))&&(f("corpSec",!1),f("finance",!1),f("incorporation",!0))},children:[(0,r.jsx)("h3",{className:"sprout-text-base md:sprout-text-xl sprout-font-semibold",children:"Set up a Company (Pte. Ltd.)"}),(0,r.jsx)("p",{className:"sprout-mt-2 sprout-text-sm md:sprout-text-base",children:"Discover the simplicity of establishing your business entity with our incorporation services."})]})]})}),(0,r.jsx)(D.iR,{primary:!0,className:"sprout-mt-8",onClick:function(){return p()},disabled:!i.corpSec&&!i.finance,children:"Start Application"})]})};function Aa(e,s,t){return s in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}var Sa=function(){var e=(0,u.SS)(),s=e.step,t=e.isPageLoading,o=e.companyInformation,n=e.selectedOption,i=e.isRFI,l=e.mode,c=(0,y.a)();(0,a.useEffect)((function(){var e;(null===(e=c.profileState)||void 0===e?void 0:e.userId)||c.mutate()}),[c]);var d=(0,a.useMemo)((function(){return Boolean(!(null===o||void 0===o?void 0:o.data))||Boolean(!c.profileState.userId)}),[null===o||void 0===o?void 0:o.data,c.profileState.userId]),p=s;return"upgrade"===l&&s>=6&&(p=0),(0,a.useEffect)((function(){d||t||window.scrollTo(function(e){for(var s=1;s<arguments.length;s++){var t=null!=arguments[s]?arguments[s]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(s){Aa(e,s,t[s])}))}return e}({top:0},navigator.userAgent.toLowerCase().includes("firefox")?{}:{behavior:"smooth"}))}),[d,t]),(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)(v.V,{show:d||t}),0===p&&"upgrade"===l&&(0,r.jsx)(Oa,{}),0===s&&"upgrade"!==l&&(0,r.jsx)(ge,{}),1===s&&!n.incorporation&&(0,r.jsx)(xe,{}),1===s&&n.incorporation&&(0,r.jsx)(Dr,{}),2===s&&(0,r.jsx)(X,{}),3===s&&!n.incorporation&&(0,r.jsx)(Yt,{}),3===s&&n.incorporation&&(0,r.jsx)(Kn,{}),4===s&&(0,r.jsx)(Ks,{}),5===s&&(0,r.jsx)(As,{}),s>=6&&!i&&"upgrade"!==l&&(0,r.jsx)(ba,{}),s>=6&&i&&(0,r.jsx)(ta,{})]})},Ea=function(){var e=(0,u.SS)().emitter,s=G({emitter:e}).handleOnBack;return(0,r.jsx)("div",{className:"sprout-flex sprout-flex-col sprout-my-2 sprout-mb-8 sprout-flex sprout-justify-between",children:(0,r.jsxs)("div",{className:"sprout-flex sprout-w-full sprout-sp
1ace-x-4 sprout-items-center",children:[(0,r.jsx)("img",{className:"cursor",src:"../assets/icon/arrow-left.svg",alt:"",onClick:function(){return s()}}),(0,r.jsx)("h1",{className:"sprout-font-semibold sprout-text-xl md:sprout-text-2xl",children:"Additional Questions"})]})})},Pa=function(){var e=(0,u.SS)(),s=e.emitter,t=e.isACRAError,o=ne({emitter:s}).handleOnBack;return(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-my-2 sprout-mb-8 sprout-flex sprout-justify-between",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-w-full sprout-space-x-4 sprout-items-center sprout-mb-4",children:[(0,r.jsx)("img",{className:"cursor",src:"../assets/icon/arrow-left.svg",alt:"",onClick:function(){return o()}}),(0,r.jsx)("h1",{className:"sprout-font-semibold sprout-text-xl md:sprout-text-2xl",children:"Company Information"})]}),!t&&(0,r.jsx)("p",{className:"sprout-pt-2",children:"After submitting your Company UEN, we will retrieve and generate your data from ACRA. Currently, we only support Private Limited Companies (Pte Ltd)."}),t&&(0,r.jsx)(P.Z,{variant:"warning",classNames:"!sprout-px-4 !sprout-py-2 sprout-w-fit",leftIcon:(0,r.jsx)(T.Z,{color:"#E3930F"}),children:(0,r.jsx)("p",{className:"sprout-normal-case sprout-text-sm",children:"Sorry, we are currently unable to retrieve your company's information from ACRA. Once you have confirmed your Company's Registered Address, please proceed to the next step."})})]})},Ta=function(){return(0,r.jsx)("div",{className:"sprout-my-2 sprout-mb-8 sprout-flex sprout-justify-between",children:(0,r.jsx)("h1",{className:"sprout-font-semibold sprout-text-xl md:sprout-text-2xl",children:"Get Started"})})},Ia=function(){var e=(0,u.SS)().emitter,s=we({emitter:e}).handleOnBack;return(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-my-2 sprout-mb-8 sprout-flex sprout-justify-between",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-w-full sprout-space-x-4 sprout-items-center sprout-mb-4",children:[(0,r.jsx)("img",{className:"cursor",src:"../assets/icon/arrow-left.svg",alt:"",onClick:function(){return s()}}),(0,r.jsx)("h1",{className:"sprout-font-semibold sprout-text-xl md:sprout-text-2xl",children:"Review Application"})]}),(0,r.jsx)("p",{className:"sprout-pt-2",children:"Check your application before submitting it"})]})},Fa=function(){var e=(0,u.SS)().emitter,s=Vs({emitter:e}).handleOnBack;return(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-my-2 sprout-mb-8 sprout-flex sprout-justify-between",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-w-full sprout-space-x-4 sprout-items-center sprout-mb-4",children:[(0,r.jsx)("img",{className:"cursor",src:"../assets/icon/arrow-left.svg",alt:"",onClick:function(){return s()}}),(0,r.jsx)("h1",{className:"sprout-font-semibold sprout-text-xl md:sprout-text-2xl",children:"Secretary Listing"})]}),(0,r.jsx)("p",{className:"sprout-pt-2",children:"Please select the outgoing secretary"})]})},Ra=function(){var e=(0,u.SS)().emitter,s=Js({emitter:e}).handleOnBack;return(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-my-2 sprout-mb-8 sprout-flex sprout-justify-between",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-w-full sprout-space-x-4 sprout-items-center sprout-mb-4",children:[(0,r.jsx)("img",{className:"cursor",src:"../assets/icon/arrow-left.svg",alt:"",onClick:function(){return s()}}),(0,r.jsx)("h1",{className:"sprout-font-semibold sprout-text-xl md:sprout-text-2xl",children:"Stakeholder Listing"})]}),(0,r.jsx)("p",{className:"sprout-pt-2",children:"Please provide your stakeholders' information, and we will send them an email invitation to complete the e-KYC process."})]})},La=function(){var e=(0,u.SS)().emitter,s=dr({emitter:e}).handleOnBack;return(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-my-2 sprout-mb-8 sprout-flex sprout-justify-between",children:[(0,r.jsxs)("div",{className:"sprout-flex sprout-w-full sprout-space-x-4 sprout-items-center sprout-mb-4",children:[(0,r.jsx)("img",{className:"cursor",src:"../assets/icon/arrow-left.svg",alt:"",onClick:function(){return s()}}),(0,r.jsx)("h1",{className:"sprout-font-semibold sprout-text-xl md:sprout-text-2xl",children:"Company Information"})]}),(0,r.jsx)("p",{className:"sprout-pt-2",children:"Welcome to the first step in onboarding your company with Grof. Let's get your company details set up."})]})},_a=function(){return(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-my-2 sprout-mb-8 sprout-flex sprout-justify-between",children:[(0,r.jsx)("div",{className:"sprout-flex sprout-w-full sprout-sp
1ace-x-4 sprout-items-center sprout-mb-4",children:(0,r.jsx)("h1",{className:"sprout-font-semibold sprout-text-xl md:sprout-text-2xl",children:"Request for Additional Information (RFI)"})}),(0,r.jsx)("p",{className:"sprout-pt-2",children:"Please complete the following questions to provide us with the necessary information for your RFI application."})]})},Ba=function(){var e=(0,u.SS)(),s=e.step,t=e.selectedOption,o=e.isRFI;return(0,r.jsxs)(a.Fragment,{children:[0===s&&(0,r.jsx)(Ta,{}),1===s&&!t.incorporation&&(0,r.jsx)(Pa,{}),1===s&&t.incorporation&&(0,r.jsx)(La,{}),2===s&&(0,r.jsx)(Ea,{}),3===s&&(0,r.jsx)(Ra,{}),4===s&&(0,r.jsx)(Fa,{}),5===s&&(0,r.jsx)(Ia,{}),s>=6&&o&&(0,r.jsx)(_a,{})]})},Va=function(){return(0,r.jsx)(u.le,{children:(0,r.jsx)(o.Z,{children:(0,r.jsx)(n.Z,{children:(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col lg:sprout-flex-row",children:[(0,r.jsx)("div",{className:"lg:sprout-hidden sprout-w-full",children:(0,r.jsx)(x,{})}),(0,r.jsx)("div",{className:"sprout-hidden lg:sprout-block",children:(0,r.jsx)(d,{})}),(0,r.jsx)("section",{className:"sprout-overflow-auto xl:sprout-m-0 sprout-w-full sprout-p-4 md:sprout-p-12",children:(0,r.jsxs)("div",{className:"sprout-flex sprout-flex-col sprout-h-full md:sprout-mt-0 sprout-overflow-scroll ",children:[(0,r.jsx)(Ba,{}),(0,r.jsx)(Sa,{})]})})]})})})})},Ua=function(){return(0,r.jsx)(Va,{})}}},function(e){e.O(0,[4885,8166,3874,9250,6962,4201,8045,9141,9704,3732,1691,8029,3735,1302,3479,7726,5094,1166,6811,9774,2888,179],(function(){return s=13441,e(e.s=s);var s}));var s=e.O();_N_E=s}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.