1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[88],{50088:function(e,t,n){n.r(t),n.d(t,{default:function(){return xe}});n(9405);var r=n(89552),a=(n(30467),n(55673)),i=(n(58136),n(5789)),s=(n(1131),n(28465)),o=(n(56120),n(74253)),c=(n(45673),n(8448)),l=(n(89858),n(51024)),u=(n(92015),n(4863)),d=(n(76259),n(29297)),p=(n(1025),n(65400)),f=(n(77785),n(59361)),m=(n(53294),n(56697)),h=n(50029),y=(n(29809),n(97538)),x=n(16835),b=(n(44230),n(20838)),j=n(87794),g=n.n(j),v=n(67294),w=n(25675),k=n.n(w),Z=n(24107),O=n(82826),C=n(8177),P=n(11163),I=n(30381),R=n.n(I),S=n(59499),T=n(37054),M=n(39873),D=n(85893);function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var A=["places"],B={width:"100%",height:"400px"},q={lat:parseFloat(4.0470446),lng:parseFloat(102.0039173)},L=function(e){var t=(0,v.useState)(null),n=t[0],r=t[1],a=(0,v.useState)(null),i=a[0],s=a[1],o=(0,v.useState)(!1),c=o[0],l=o[1],u=(0,v.useState)({}),d=u[0],p=u[1];(0,v.useEffect)((function(){m()}),[n]);var f=(0,T.Ji)({googleMapsApiKey:M.ZS,libraries:A}).isLoaded,m=function(){var e=(0,h.Z)(g().mark((function e(){return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!c&&n){e.next=2;break}return e.abrupt("return");case 2:l(!0);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),y=v.useCallback((function(t){var n=new window.google.maps.LatLngBounds;t.fitBounds(n),r(t),setTimeout((function(){if(e.MarkerLocation)return t.setZoom(16),t.setCenter({lat:parseFloat(e.MarkerLocation.lat),lng:parseFloat(e.MarkerLocation.lng)}),void p({lat:parseFloat(e.MarkerLocation.lat),lng:parseFloat(e.MarkerLocation.lng)});t.setZoom(7),t.setCenter(q)}),500)}),[]),x=v.useCallback((function(e){r(null)}),[]);return f?(0,D.jsxs)(T.b6,{zoom:10,mapContainerStyle:B,onUnmount:x,onLoad:y,children:[(0,D.jsx)(T.Jx,{position:d,draggable:e.MarkerDragable,onDragEnd:function(t){return e.HandleMarkerOnDrag(t.latLng.toJSON())}}),e.SearchBar&&(0,D.jsx)(T.Zk,{onLoad:function(e){return s(e)},onPlacesChanged:function(){var t=i.getPlaces();if(t&&t.length>0){var r=t[0].geometry.location.toJSON();p(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach((function(t){(0,S.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},r)),n.setCenter(r),n.setZoom(16),e.HandleMarkerOnDrag(r)}},children:(0,D.jsx)("input",{type:"text",placeholder:"Search your premise location",style:{boxSizing:"border-box",border:"1px solid transparent",width:"240px",height:"32px",padding:"0 12px",borderRadius:"3px",boxShadow:"0 2px 6px rgba(0, 0, 0, 0.3)",fontSize:"14px",outline:"none",textOverflow:"ellipses",position:"absolute",left:"130px",top:"62px",marginLeft:"-120px"}})})]}):(0,D.jsx)(D.Fragment,{})},F=v.memo(L);L.defaultProps={MarkerDragable:!1};n(59567);var Y=n(8799),E=(n(15267),n(64713)),V=(n(15144),n(2307)),N=(n(62713),n(14321)),W=(n(75314),n(11187)),G=n(27812),U=n(92777),H=n(82262),z=n(10748),K=n(45959),J=n(63553),Q=n(37247),X=n(93846),$=n(21517),ee=n(85998),te=n.n(ee),ne=n(85060),re=n(47399),ae=n(83461);n(54975),n(82212);function ie(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function se(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ie(Object(n),!0).forEach((function(t){(0,S.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ie(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function oe(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,Q.Z)(e);if(t){var a=(0,Q.Z)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return(0,J.Z)(this,n)}}var ce=function(e){(0,K.Z)(n,e);var t=oe(n);function n(){var e;(0,U.Z)(this,n);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return e=t.call.apply(t,[this].concat(a)),(0,S.Z)((0,z.Z)(e),"state",{loading:!1,transactionModalVisible:!1,statement_list:[],date_range:[R()().subtract(1,"month").startOf("day"),R()().endOf("day")],csv_data:[],csv_header:[{label:"Transaction_Date",key:"transactionDate"},{label:"Transaction_ID",key:"_id"},{label:"Remark",key:"remark"},{label:"Cash_In",key:"amount"},{label:"Commission",key:"commission"},{label:"Balance",key:"balance"}]}),(0,S.Z)((0,z.Z)(e),"formRef",v.createRef()),(0,S.Z)((0,z.Z)(e),"GetTransactionList",(0,h.Z)(g().mark((function t(){var n;return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.setState({loading:!0}),t.next=3,$.Z.businessTransactionList(e.props.router.query._id,e.state.date_range[0].unix(),e.state.date_range[1].unix());case 3:n=t.sent,e.setState({loading:!1,statement_list:n.transactions});case 5:case"end":return t.stop()}}),t)})))),(0,S.Z)((0,z.Z)(e),"HandleTransaction",(0,h.Z)(g().mark((function t(){var n;return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.formRef.current.validateFields();case 2:return(n=t.sent).amount=100*n.amount,e.setState({loading:!0}),t.next=7,$.Z.addBusinessTransaction(e.props.router.query._id,n);case 7:t.sent,e.setState({loading:!1,transactionModalVisible:!1}),m.Z.success({title:"Add Transaction Successful!",onOk:function(){e.GetTransactionList()}});case 10:case"end":return t.stop()}}),t)})))),(0,S.Z)((0,z.Z)(e),"generateCSV",(function(){for(var t=(0,G.Z)(e.state.statement_list),n=[],r=0;r<t.length;r++){var a=t[r];n.push({transactionDate:R()(a.transactionDate).format("DD-MMM-YYYY hh:mm A"),_id:a._id,remark:a.remark?a.remark:"N/A",amount:"RM"+a.amount/100,commission:a.commission?"RM"+a.commission/100:"RM0",balance:"RM"+a.balance/100})}return e.setState({csv_data:n}),!0})),e}
1return(0,H.Z)(n,[{key:"componentDidMount",value:function(){this.GetTransactionList(),this.mounted=!0}},{key:"componentWillUnmount",value:function(){this.mounted=!1}},{key:"render",value:function(){var e=this,t=[{title:"Transaction Date",dataIndex:"transactionDate",key:"transactionDate",render:function(e){if(e)return R()(e).format("DD-MMM-YYYY hh:mm A")}},{title:"Transaction ID",dataIndex:"_id",key:"_id"},{title:"Name",dataIndex:"relativeParty",key:"relativeParty",render:function(e){return e?e.name:"Created by Admin"}},{title:"Remark",dataIndex:"remark",key:"remark",render:function(e){return e||"N/A"}},{title:"Cash In",align:"right",dataIndex:"amount",key:"amount",render:function(e,t){return(0,D.jsx)(te(),{quantity:e/100,currency:"MYR",pattern:"! #,##0.00"})}},{title:"Commission",align:"right",dataIndex:"commission",key:"commission",render:function(e,t){return(0,D.jsx)(te(),{quantity:e?e/100:0,currency:"MYR",pattern:"! #,##0.00"})}},{title:"Balance",align:"right",dataIndex:"balance",key:"balance",render:function(e){return(0,D.jsx)(te(),{quantity:e/100,currency:"MYR",pattern:"! #,##0.00"})}}],n=(0,D.jsxs)("div",{style:{backgroundColor:"#fff"},children:[(0,D.jsx)(a.Z,{justify:"end",align:"middle",style:{marginBottom:16},children:(0,D.jsx)(i.Z,{children:(0,D.jsxs)(a.Z,{align:"middle",children:[(0,D.jsx)(i.Z,{style:{marginRight:16,marginBottom:window.innerWidth<M._G.md&&16},children:(0,D.jsx)(N.default.RangePicker,{value:this.state.date_range,disabledDate:function(e){return e&&e>R()().endOf("day")},defaultPickerValue:[R()().subtract(1,"month").startOf("day"),R()().endOf("day")],onChange:function(t){null!==t?e.setState({date_range:[R()(t[0]).startOf("day"),R()(t[1]).endOf("day")]},(function(){R().unix(e.state.date_range[1].unix()).diff(R().unix(e.state.date_range[0].unix()),"day")<=90?e.GetTransactionList():W.default.error("can't exceed than 90 days")})):e.setState({date_range:[R()().subtract(1,"month").startOf("day"),R()().endOf("day")]},(function(){e.GetTransactionList()}))},style:{marginRight:8}})}),(0,D.jsx)(i.Z,{style:{marginRight:24},children:(0,D.jsx)(ae.CSVLink,{data:this.state.csv_data,headers:this.state.csv_header,filename:"Transaction Record.csv",onClick:this.generateCSV,children:(0,D.jsx)(p.default,{icon:(0,D.jsx)(ne.Z,{}),type:"primary",children:"Export CSV"})})}),(0,D.jsx)(i.Z,{children:(0,D.jsx)(p.default,{onClick:function(){return e.setState({transactionModalVisible:!0})},icon:(0,D.jsx)(re.Z,{}),type:"primary",children:"Add Transaction"})})]})})}),(0,D.jsx)(V.Z,{bordered:!0,size:"small",rowKey:"_id",dataSource:this.state.statement_list,columns:t,loading:this.state.loading,scroll:{x:!0}})]}),r=(0,D.jsx)(m.Z,{title:"Add Transaction",visible:this.state.transactionModalVisible,maskClosable:!1,afterClose:function(){e.formRef.current.resetFields()},onCancel:function(){return e.setState({transactionModalVisible:!1})},okText:"Submit",onOk:this.HandleTransaction,children:(0,D.jsxs)(y.Z,se(se({},{labelCol:{xs:{span:24},md:{span:8},xl:{span:8}},wrapperCol:{xs:{span:24},md:{span:16},xl:{span:16}}}),{},{ref:this.formRef,initialValues:{action:"add"},hideRequiredMark:!0,colon:!0,name:"registration",scrollToFirstError:!0,children:[(0,D.jsx)(y.Z.Item,{label:"Action",name:"action",children:(0,D.jsxs)(E.default.Group,{children:[(0,D.jsx)(E.default,{value:"add",children:"Add"}),(0,D.jsx)(E.default,{value:"deduct",children:"Deduct"})]})}),(0,D.jsx)(y.Z.Item,{label:"Amount (RM)",name:"amount",rules:[{required:!0,message:"Amount is required"}],children:(0,D.jsx)(Y.Z,{disabled:this.state.loading,placeholder:"50"})}),(0,D.jsx)(y.Z.Item,{label:"Remark",name:"remark",rules:[{required:!0,message:"Please insert remark"}],children:(0,D.jsx)(l.default,{disabled:this.state.loading,placeholder:"Add Amount for user"})})]}))});d.Z;return(0,D.jsxs)("div",{children:[n,r]})}}]),n}(v.Component),le=(0,X.HJ)((0,P.withRouter)(ce)),ue=(n(35797),n(64749)),de=(n(58587),n(49640));n(11523);function pe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function fe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?pe(Object(n),!0).forEach((function(t){(0,S.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}b.default.TabPane;var me=(0,P.withRouter)((function(e){var t=y.Z.useForm(),n=(0,x.Z)(t,1)[0],s=y.Z.useForm(),l=(0,x.Z)(s,1)[0],u=(0,v.useState)(!1),d=u[0],f=u[1],b=(0,v.useState)(!1),j=b[0],w=b[1],k=(0,v.useState)(!1),Z=k[0],O=k[1],C=(0,v.useState)([]),P=C[0],I=C[1],R=(0,v.useState)({policy:{},contact:{},address:{}}),S=R[0],T=R[1];(0,v.useEffect)((function(){var t=function(){var t=(0,h.Z)(g().mark((function t(){var n;return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return f(!0),t.next=3,$.Z.businessWalletPolicy(e.router.query._id);case 3:n=t.sent,f(!1),T(n);case 6:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),r=function(){var e=(0,h.Z)(g().mark((function e(t){var r,a;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return f(!0),e.next=3,$.Z.businessWalletPolicy(t);case 3:return r=e.sent,e.next=6,de.Z.getWalletPolicyType("business");case 6:a=e.sent,f(!1),I(a.walletPolicies),n.setFieldsValue({policyId:r.policy._id});case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return t(),r(e.router.query._id),function(){}}),[e,n]);var _=function(){var t=(0,h.Z)(g().mark((function t(){var n;return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return f(!0),t.next=3,$.Z.businessWalletPolicy(e.router.query._id);case 3:n=t.sent,f(!1),T(n);case 6:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),A=function(){var t=(0,h.Z)(g().mark((function t(){var r;return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.validateFields();case 2:return r=t.sent,f(!0),t.next=6,de.Z.changeBusinessWalletPolicy(e.router.query._id,{policyId:r.policyId});case 6:t.sent,f(!1),w(!1),m.Z.success({title:"Change Wallet Policy Successful!",onOk:function(){return _()}});case 10:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),B=function(){var t=(0,h.Z)(g().mark((function t(){var n;return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,l.validateFields();case 2:if(n=t.sent,f(!0),"fix"!==n.type){t.next=10;break}return t.next=7,de.Z.specialBusinessCommission(e.router.query._id,{fixCommission:100*n.fixCommission,type:n.type});case 7:t.sent,t.next=13;break;case 10:return t.next=12,de.Z.specialBusinessCommission(e.router.query._id,{commissionRate:n.commissionRate,type:n.type});case 12:t.sent;case 13:f(!1),O(!1),m.Z.success({title:"Apply Special Commission Successful!",onOk:function(){_()}});case 16:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),q=function(){var t=(0,h.Z)(g().mark((function t(){return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return f(!0),t.next=3,de.Z.deleteSpecialBusinessCommission(e.router.query._id);case 3:t.sent,f(!1),O(!1),m.Z.success({title:"Remove Special Commission Successful!",onOk:function(){_()}});case 7:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),L={labelCol:{xs:{span:24},md:{span:10},xl:{span:10}},wrapperCol:{xs:{span:24},md:{span:14},xl:{span:14}}},F=(0,D.jsx)(m.Z,{visible:j,title:"Change Wallet Policy",onCancel:function(){return w(!1)},onOk:A,okButtonProps:{loading:d},cancelButtonProps:{disabled:d},children:(0,D.jsx)(y.Z,fe(fe({},L),{},{form:n,requiredMark:!1,style:{marginTop:16},children:(0,D.jsx)(y.Z.Item,{label:"Wallet Policy",name:"policyId",rules:[{required:!0,message:"Wallet Policy is required"}],children:(0,D.jsx)(ue.default,{onChange:function(e){},children:P.map((function(e){return(0,D.jsx)(ue.default.Option,{value:e._id,children:e.name},e._id)}))})})}))}),V=(0,D.jsx)(m.Z,{visible:Z,title:"Special Commission Rate",afterClose:function(){return l.resetFields()},onCancel:function(){return O(!1)},onOk:B,okButtonProps:{loading:d},cancelButtonProps:{disabled:d},children:(0,D.jsxs)(y.Z,fe(fe({},L),{},{form:l,initialValues:{type:"fix"},requiredMark:!1,style:{marginTop:16},children:[(0,D.jsx)(y.Z.Item,{label:"Type",name:"type",children:(0,D.jsxs)(E.default.Group,{children:[(0,D.jsx)(E.default,{value:"fix",children:"Fix"}),(0,D.jsx)(E.default,{value:"percentage",children:"Percentage"})]})}),(0,D.jsx)(y.Z.Item,{noStyle:!0,shouldUpdate:!0,children:function(e){return"fix"===(0,e.getFieldValue)("type")?(0,D.jsx)(y.Z.Item,{label:"Amount (RM)",name:"fixCommission",rules:[{required:!0,message:"Amount is required"}],children:(0,D.jsx)(Y.Z,{disabled:d,precision:2,placeholder:"50"})}):(0,D.jsx)(y.Z.Item,{label:"Special Commission Rate (%)",name:"commissionRate",rules:[{required:!0,message:"Special Commission Rate is required"}],children:(0,D.jsx)(Y.Z,{min:0,max:100,precision:2,disabled:d,placeholder:"5"})})}}),S.commissionType?(0,D.jsx)(y.Z.Item,{wrapperCol:{offset:window.innerWidth<M._G.md?0:10},children:(0,D.jsx)(p.default,{type:"primary",style:{backgroundColor:"#CE1E22",borderColor:"#CE1E22",borderRadius:100},loading:d,onClick:function(){return m.Z.confirm({title:"Confirm Remove Special Commission Rate?",onOk:function(){return q()}})},children:"Remove Special Commission Rate"})}):null]}))}),N=(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(c.default,{title:"Wallet Policy",extra:(0,D.jsxs)(a.Z,{gutter:16,children:[(0,D.jsx)(i.Z,{children:(0,D.jsx)(p.default,{type:"primary",onClick:function(){O(!0),l.setFieldsValue({commissionRate:S.commissionRate,fixCommission:S.fixCommission?S.fixCommission/100:null,type:S.commissionType?S.commissionType:"fix"})},children:"Special Commission Rate"})}),(0,D.jsx)(i.Z,{children:(0,D.jsx)(p.default,{type:"primary",onClick:function(){return w(!0)},children:"Change Wallet Policy"})})]}),children:[(0,D.jsx)(c.default.Item,{label:"name",children:S.policy.name}),(0,D.jsx)(c.default.Item,{label:"Type",children:S.policy.type}),(0,D.jsx)(c.default.Item,{label:"Wallet Limit",children:(0,D.jsx)(te(),{quantity:S.policy.walletLimit/100,currency:"MYR",pattern:"! #,##0.00"})}),(0,D.jsx)(c.default.Item,{label:"Daily Limit",children:(0,D.jsx)(te(),{quantity:S.policy.dailyVolumeLimit/100,currency:"MYR",pattern:"! #,##0.00"})}),(0,D.jsx)(c.default.Item,{label:"Monthly Limit",children:(0,D.jsx)(te(),{quantity:S.policy.monthlyVolumeLimit/100,currency:"MYR",pattern:"! #,##0.00"})}),(0,D.jsxs)(c.default.Item,{label:"Daily Quota",children:[(0,D.jsx)(te(),{quantity:S.todayTransferred/100,currency:"MYR",pattern:"! #,##0.00"}),"\xa0/\xa0",(0,D.jsx)(te(),{quantity:S.policy.dailyVolumeLimit/100,currency:"MYR",pattern:"! #,##0.00"})]}),(0,D.jsxs)(c.default.Item,{label:"Monthly Quota",children:[(0,D.jsx)(te(),{quantity:S.thisMonthTransferred/100,currency:"MYR",pattern:"! #,##0.00"}),"\xa0/\xa0",(0,D.jsx)(te(),{quantity:S.policy.monthlyVolumeLimit/100,currency:"MYR",pattern:"! #,##0.00"})]}
1),S.policy.commissionType?(0,D.jsx)(c.default.Item,{label:"Commission Type",children:"fix"===S.policy.commissionType?"Fix":"Percentage"}):null,"fix"===S.policy.commissionType?(0,D.jsx)(c.default.Item,{label:"Commission Amount",children:(0,D.jsx)(te(),{quantity:S.policy.fixCommission/100,currency:"MYR",pattern:"! #,##0.00"})}):"percentage"===S.policy.commissionType?(0,D.jsxs)(c.default.Item,{label:"Commission Rate",children:[S.policy.commissionRate,"%"]}):null]}),(0,D.jsx)(o.Z,{}),(0,D.jsxs)(c.default,{title:"Special Commission",children:[S.commissionType?(0,D.jsx)(c.default.Item,{label:"Special Commission Type",children:"fix"===S.commissionType?"Fix":"Percentage"}):null,"fix"===S.commissionType?(0,D.jsx)(c.default.Item,{label:"Special Commission Amount",children:(0,D.jsx)(te(),{quantity:S.fixCommission/100,currency:"MYR",pattern:"! #,##0.00"})}):"percentage"===S.commissionType?(0,D.jsxs)(c.default.Item,{label:"Special Commission Rate",children:[S.commissionRate,"%"]}):null]})]});return(0,D.jsxs)("div",{style:{backgroundColor:"#fff"},children:[(0,D.jsx)(r.default,{size:"large",spinning:d,children:N}),F,V]})})),he=(n(66991),n(15069),b.default.TabPane);function ye(e){return new Promise((function(t,n){var r=new FileReader;
1r.readAsDataURL(e),r.onload=function(){return t(r.result)},r.onerror=function(e){return n(e)}}))}var xe=(0,P.withRouter)((function(e){var t,n,j=y.Z.useForm(),w=(0,x.Z)(j,1)[0],P=(0,v.useState)(!1),I=P[0],S=P[1],T=(0,v.useState)(!1),M=T[0],_=T[1],A=(0,v.useState)(""),B=A[0],q=A[1],L=(0,v.useState)({contact:{countryCode:"",number:""},wallet_info:{},location:{coordinates:[0,0]},userId:{contact:{countryCode:"",number:""}},walletInfo:{}}),Y=L[0],E=L[1],V=(0,v.useState)(""),N=V[0],W=V[1],G=(0,v.useState)(!1),U=G[0],H=G[1],z=(0,v.useState)(!1),K=z[0],J=z[1],Q=(0,v.useState)([]),X=Q[0],$=Q[1],ee=(0,v.useState)([]),te=ee[0],ne=ee[1],re=(0,v.useState)([]),ae=re[0],ie=re[1],se=(0,v.useState)([]),oe=se[0],ce=se[1],ue=(0,v.useState)([]),de=ue[0],pe=ue[1];(0,v.useEffect)((function(){return q(e.router.query._id),fe(e.router.query._id),"true"===e.router.query.isApproval&&J(!0),function(){}}),[e]);var fe=function(){var e=(0,h.Z)(g().mark((function e(t){var n;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return S(!0),e.next=3,C.Z.getBusinessDetail(t);case 3:n=e.sent,E(n),$(n.premisePhotos),ne([n.bankAccountStatement]),ie([n.logo]),ce(n.ssms),pe(n.otherDocuments),S(!1),"pending"===n.verificationStatus&&J(!0);case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),xe=function(){var t=(0,h.Z)(g().mark((function t(){return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return S(!0),t.next=3,C.Z.verifyBusiness(B,{action:"approve",remark:""});case 3:t.sent,S(!1),m.Z.success({title:"Application Approve",okText:"Back to Manage Business",onOk:function(){return e.router.push("/business-approval")},onCancel:function(){return e.router.push("/business-approval")},cancelText:""});case 6:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),be=function(){var t=(0,h.Z)(g().mark((function t(){var n;return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,w.validateFields();case 2:return n=t.sent,t.next=5,C.Z.verifyBusiness(B,{action:"reject",remark:n.remark});case 5:t.sent,S(!1),m.Z.success({title:"Application Rejected",okText:"Back to Manage Business",onOk:function(){return e.router.push("/business-approval")},onCancel:function(){return e.router.push("/business-approval")},cancelText:""});case 8:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),je=function(){var e=(0,h.Z)(g().mark((function e(t){return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.url||t.preview){e.next=4;break}return e.next=3,ye(t.originFileObj);case 3:t.preview=e.sent;case 4:W(t.url||t.preview),H(!0);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ge=(0,D.jsx)(d.Z,{style:{backgroundColor:"#fff",marginTop:4},title:"Merchant Info",subTitle:Y.rejectedReason&&""!==Y.rejectedReason&&(0,D.jsx)("span",{children:(0,D.jsxs)(f.default,{color:"pink",children:[" ","Last Reject Remark:"," ",(0,D.jsx)("strong",{children:Y.rejectedReason})]})}),backIcon:(0,D.jsx)(O.Z,{}),onBack:function(){return e.router.push(e.router.query.path?e.router.query.path:"/user-approval")},extra:K&&(0,D.jsxs)(p.default.Group,{children:[(0,D.jsx)(p.default,{type:"danger",onClick:function(){_(!0)},disabled:I,children:"Reject"},"rejectAccount"),(0,D.jsx)(p.default,{type:"primary",disabled:I,onClick:function(){return m.Z.confirm({title:"Approve User?",onOk:function(){xe()}})},children:"Approve"},"approveAccount")]})}),ve=(0,D.jsxs)(m.Z,{visible:M,title:"Reject Associate Registration",onCancel:function(){return _(!1)},onOk:be,okButtonProps:{loading:I},cancelButtonProps:{disabled:I},children:[(0,D.jsx)(u.default,{message:"Informational Notes",description:"Additional description and information about copywriting.",type:"info",showIcon:!0}),(0,D.jsx)(y.Z,{form:w,style:{marginTop:16},children:(0,D.jsx)(y.Z.Item,{label:"Remark",name:"remark",rules:[{required:!0,message:"Remark is required"}],children:(0,D.jsx)(l.default,{disabled:I})})})]}),we=(0,D.jsx)(m.Z,{visible:U,footer:null,onCancel:function(){return H(!1)},children:(0,D.jsx)(k(),{alt:"Image",width:520,height:520,objectFit:"contain",src:N})}),ke=(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(c.default,{title:"Merchant Information",children:[(0,D.jsx)(c.default.Item,{label:"Shop Name",children:Y.name}),(0,D.jsx)(c.default.Item,{label:"Preferred Name",children:Y.displayName}),(0,D.jsx)(c.default.Item,{label:"Sign Up Date",children:R()(Y.createAt).format("DD-MMM-YYYY")}
1)]}),(0,D.jsx)(o.Z,{}),(0,D.jsxs)(c.default,{title:"Owner",children:[(0,D.jsx)(c.default.Item,{label:"Full Name",children:Y.name}),(0,D.jsxs)(c.default.Item,{label:"Contact",children:[null===(t=Y.contact)||void 0===t?void 0:t.countryCode," ",null===(n=Y.contact)||void 0===n?void 0:n.number]}),(0,D.jsx)(c.default.Item,{label:"Email",children:Y.email})]}),(0,D.jsx)(o.Z,{}),(0,D.jsx)(c.default,{title:"Business Address"}),!I&&(0,D.jsx)(F,{MarkerDragable:!1,MarkerLocation:{lat:Y.location.coordinates[1],lng:Y.location.coordinates[0]}}),(0,D.jsx)(o.Z,{}),(0,D.jsxs)(c.default,{title:"Bank Account",children:[(0,D.jsx)(c.default.Item,{label:"Bank Account Name",children:Y.walletInfo&&Y.walletInfo.bankAccountName}),(0,D.jsx)(c.default.Item,{label:"Bank Name",children:Y.walletInfo&&Y.walletInfo.bankAccountNumber}),(0,D.jsx)(c.default.Item,{label:"Bank Account Number",children:Y.walletInfo&&Y.walletInfo.bankName}),(0,D.jsx)(c.default.Item,{label:"Bank Header",children:(0,D.jsx)(s.Z,{accept:"image/*",fileList:te,listType:"picture-card",showUploadList:{showDownloadIcon:!1,showPreviewIcon:!0,showRemoveIcon:!1},onPreview:je,withCredentials:!0})})]}),(0,D.jsx)(o.Z,{}),(0,D.jsxs)(c.default,{title:(0,D.jsx)(a.Z,{justify:"space-between",children:(0,D.jsx)(i.Z,{children:"Documents"})}),children:[(0,D.jsx)(c.default.Item,{label:"Business Logo",children:(0,D.jsx)(s.Z,{accept:"image/*",fileList:ae,listType:"picture-card",showUploadList:{showDownloadIcon:!1,showPreviewIcon:!0,showRemoveIcon:!1},onPreview:je,withCredentials:!0})}),(0,D.jsx)(c.default.Item,{label:"Premise Photo",children:(0,D.jsx)(s.Z,{accept:"image/*",fileList:X,listType:"picture-card",showUploadList:{showDownloadIcon:!1,showPreviewIcon:!0,showRemoveIcon:!1},onPreview:je,withCredentials:!0})}),(0,D.jsx)(c.default.Item,{label:"SSM",children:(0,D.jsx)(s.Z,{accept:"image/*",fileList:oe,listType:"picture-card",showUploadList:{showDownloadIcon:!1,showPreviewIcon:!0,showRemoveIcon:!1},onPreview:je,withCredentials:!0})}),(0,D.jsx)(c.default.Item,{label:"Others Document",children:de.length>0?(0,D.jsx)(s.Z,{accept:"image/*",fileList:de,listType:"picture-card",showUploadList:{showDownloadIcon:!1,showPreviewIcon:!0,showRemoveIcon:!1},onPreview:je,withCredentials:!0}):"N/A"})]})]});return(0,D.jsxs)(Z.Z,{ViewPageHeader:ge,menu:"manage-associate",children:[(0,D.jsx)("div",{style:{backgroundColor:"#fff",padding:"0px 16px 16px"},children:(0,D.jsx)(r.default,{size:"large",spinning:I,children:(0,D.jsxs)(b.default,{defaultActiveKey:"dormant"===e.router.query.mode?"2":"1",children:[(0,D.jsx)(he,{tab:"Business Information",children:ke},"1"),(0,D.jsx)(he,{tab:"Transaction History",children:(0,D.jsx)(le,{})},"2"),(0,D.jsx)(he,{tab:"Wallet Policy",children:(0,D.jsx)(me,{})},"3")]})})}),we,ve]})}))},8177:function(e,t,n){var r=n(59499),a=n(79043),i=n(70510);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var c=a.wR;a.lp,a.kP;t.Z={useGetBusiness:function(e,t){return(0,i.w)("businesses",(function(e,t){return c.get("/api/businesses/aggregation",{params:o({},t)})}),e,{onError:t,shouldFetch:!0})},useGetPendingApprovalBusiness:function(e,t){return(0,i.w)("businesses",(function(e,t){return c.get("/api/businesses/aggregation",{params:o({},t)})}),e,{onError:t,shouldFetch:!0})},getBusinessDetail:function(e){return c.get("/api/businesses/"+e).then((function(e){return e})).catch((function(e){return e}))},verifyBusiness:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{action:["approve","reject"],remarks:String};return c.patch("/api/businesses/".concat(e,"/approval-action"),t).then((function(e){return e})).catch((function(e){return e}))},createBusinessToken:function(e){return c.post("/api/businesses/".concat(e,"/hashKey")).then((function(e){return e})).catch((function(e){return e}))},modifyBusinessToken:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ban:[!0,!1],remark:String};return c.patch("/api/businesses/".concat(e,"/hashKey"),t).then((function(e){return e})).catch((function(e){return e}))},deleteBusinessToken:function(e){return c.delete("/api/businesses/".concat(e,"/hashKey")).then((function(e){return e})).catch((function(e){return e}))},delistMerchant:function(e){return c.post("/api/businesses/".concat(e,"/delist-merchant")).then((function(e){return e})).catch((function(e){return e}))}}}}]);
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.