ct debug

Author: 3f9bc9d798

18 July 2025

Views: 5

try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="085ebaa3-8389-40af-b548-52b98afc694d",e._sentryDebugIdIdentifier="sentry-dbid-085ebaa3-8389-40af-b548-52b98afc694d")}catch(e){}("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"5.3.1"},(self.webpackChunkctrader_web=self.webpackChunkctrader_web||[]).push([[7356],{95:(e,t,s)=>{"use strict";s.d(t,{I:()=>l});var n=s(72199),r=s(97176),o=s(6974),i=s(20412),a=s(58142),c=s(58833);const l=(0,n._N)([c.U,(0,r.Hy)(i.u).status()],((e,t)=>void 0===e||e.lte(0)||t===o.Aq.Stopped))(Object.assign(Object.assign({},(0,a.Z6)()),{keySelector:(0,r.Jk)().accountId()}))},232:(e,t,s)=>{"use strict";s.d(t,{W:()=>d});var n=s(96540),r=s(6738),o=s(27098),i=s(26467),a=s(11079),c=s(63962),l=s(88627);const d=e=>{const t=(0,n.useCallback)((t=>{const s=t.head[e];return void 0!==s?s.sorting:void 0}),[e]),s=(0,a.Y)(t),d=(0,c.K)(),u=(0,l.V)();return[s,(0,n.useCallback)((s=>{const n=(0,r.d)(s.nativeEvent),a=d.getState().head,c=t(d.getState());let l,g;c?c===o.N.ASC?l=o.N.DESC:n||(l=o.N.ASC):l=o.N.ASC,l&&(g=n?Object.values(a).filter((e=>e.sorting)).length:0),n||u(i.v.cleanSorting()),u(i.v.sortColumn({columnId:e,sorting:l,sortingIndex:g}))}),[d,t,e,u])]}},342:(e,t,s)=>{"use strict";s.d(t,{S:()=>c});var n=s(72199),r=s(97176),o=s(58142),i=s(61848),a=s(36865);const c=(0,n._N)([(0,r.Hy)(i.N).data(),(0,r.Jk)().accountId()],((e,t)=>{var s;return null!==(s=e[t])&&void 0!==s?s:a.Z}))(Object.assign(Object.assign({},(0,o.Z6)()),{keySelector:(0,r.Jk)().accountId()}))},510:(e,t,s)=>{"use strict";s.d(t,{g:()=>Bt});var n,r=s(74848),o=s(96540),i=s(47577),a=s(27527),c=s(52019),l=s(33270),d=s(63773);!function(e){const t=(0,d.D)("AccountDealTable");e.updateSearch=t("UPDATE_SEARCH"),e.updateChannel=t("UPDATE_CHANNEL"),e.updateState=t("UPDATE_STATE"),e.updatePeriod=t("UPDATE_PERIOD"),e.changePeriod=t("CHANGE_PERIOD"),e.patch=t("PATCH"),e.destroy=t("DESTROY")}(n||(n={}));var u=s(3743),g=s(98549),m=s(62810);const h=(0,g.h)(u.t).case(n.updateSearch,((e,t)=>{e.search=t})).case(n.updateChannel,((e,t)=>{e.channel=t})).case(n.updateState,((e,t)=>{e.tableState=t})).case(n.updatePeriod,((e,t)=>{const{period:s}=t;Object.assign(e.period,s)})).case(n.patch,((e,t)=>{(0,m.h)(e,t)})).case(n.destroy,(()=>u.t));var p,y=s(82823),x=s(65044),f=s(28452),j=s(67569),b=s(47873),v=s(59060),I=s(81160),S=s(50589),C=s(83895),k=s(1522),O=s(31635),w=s(46269),T=s(30981);!function(e){e.toRemoteData=function(e){return{version:w.p.First,tableState:e.tableState}},e.fromRemoteData=function(e,t){return Object.assign(Object.assign({},e),{tableState:t.tableState})},e.toVersion=function(e){if(void 0!==e)return e.version&&e.version!==w.p.Zero?e:function(e){const{columnInfo:t=[]}=e,s=(0,O.Tt)(e,["columnInfo"]);return Object.assign(Object.assign({},s),{version:w.p.First,tableState:Object.assign(Object.assign({},T.Od),{head:t.reduce(((e,t)=>Object.assign(Object.assign({},e),{[t.id]:t})),{})})})}(e)}}(p||(p={}));var D=s(66847),P=s(24780);const N=(0,y.H)((e=>e.pipe((0,x._)(j.f.pushAccount,j.f.pushInstance),(0,f.Z)((()=>[n.updateSearch(u.t.search),n.updateChannel(u.t.channel)])))),((e,t)=>e.pipe((0,b.l)(n.changePeriod),(0,v.M)(e,t,(e=>{const{period:t,accountId:s}=e;return n.updatePeriod({accountId:s,period:{period:t}})})))),(e=>e.pipe((0,x._)(S.u.clear),(0,I.T)((()=>n.destroy()))))),L=(0,y.H)(((e,t,s)=>s.remoteData.getStream("accountDealTable").pipe((0,C.Y)((()=>t)),(0,f.Z)((([{remoteSegment:e},t])=>{const s=(0,k.c)(t),r=p.toVersion(e),o=p.fromRemoteData(s,r);return[n.patch(o)]})))),((e,t,s)=>t.pipe((0,I.T)(k.c),(0,P.D)(p.toRemoteData,s),(0,f.Z)((e=>(s.remoteData.updateSegment({key:"accountDealTable",value:e}),[]))),(0,D.W)((e=>(s.logger.error("Error update account deal table remote",e),[]))))));var B=s(39701),H=s(72199),E=s(97176),A=s(58142),R=s(57520);const F=(0,H._N)([(0,E.Hy)(R.p).remoteData.isEnabled()],(e=>({isRemoteDataEnabled:e})))(Object.assign(Object.assign({},(0,A.Z6)()),{keySelector:E.eW})),M=(0,o.memo)((()=>{const{isRemoteDataEnabled:e}=(0,B.d4)(F);return(0,c.n)("accountDealTable",h),(0,l.S)(N),(0,l.S)(e?L:void 0),null}));var _=s(46993);const W=(0,H._N)([(0,E.Hy)(_.a).from(),(0,E.Hy)(_.a).to()],((e,t)=>({fromTimestamp:e,toTimestamp:t})))(Object.assign(Object.assign({},(0,A.Z6)()),{keySelector:(0,E.Jk)().accountId()}));var K,Y=s(1767);!function(e){const t=(0,d.D)("AccountDeal");e.load=t("LOAD"),e.protocolLoad=t("PROTOCOL_LOAD"),e.loadDone=t("LOAD_DONE"),e.updateLoadedPeriodList=t("UPDATE_LOADED_PERIOD_LIST"),e.subscribe=t("SUBSCRIBE"),e.unsubscribe=t("UNSUBSCRIBE")}(K||(K={}));var V=s(97756);const Z=(0,s(41233).K)({subscribeAction:K.subscribe,unsubscribeAction:K.unsubscribe});var U=s(99684);const J=(0,g.h)(V.fA).case(K.load,(e=>{e.networkStatus=U.p.Started})).case(K.loadDone,((e,t)=>{const{dealList:s}=t;for(const t of s)e.deals[t.dealId]=t;e.networkStatus=U.p.Done})).case(K.updateLoadedPeriodList,((e,t)=>{const{periodList:s}=t;e.loadedPeriodList=s})),X=(0,g.h)(V.Oz).casesWithAction([K.subscribe,K.unsubscribe],((e,t)=>{e.subscribers=Z(e.subscribers,t)})).casesWithAction([K.load,K.loadDone,K.updateLoadedPeriodList],((e,t)=>{var s;const{accountId:n}=t.payload;e.data[n]=J(null===(s=e.data)||void 0===s?void 0:s[n],t)}));var $=s(16126),q=s(79005),Q=s(51030),z=s(73301),G=s(80070),ee=s(22627),te=s(51863),se=s(91855),ne=s(13580),re=s(23656),oe=s(56136),ie=s(99565);const ae=(0,oe.r)((0,E.Hy)(ie.A).subscribers());var ce=s(84720),le=s(92518),de=s(76269);const ue=(0,y.H)(((e,t)=>e.pipe((0,b.l)(K.load),(0,C.Y)((()=>t)),(0,f.Z)((([e,t])=>{const{accountId:s,period:n}=e,r=(0,E.Hy)(se.j).loadedPeriodList()(t,{accountId:s}),o=(0,G.M)(n,r);return o.length?[...o.flatMap((e=>(0,ee.J)({from:e.from,to:e.to}))).map((e=>K.protocolLoad({accountId:s,fromTimestamp:e.from,toTimestamp:e.to}))),K.updateLoadedPeriodList({accountId:e.accountId,periodList:(0,te.K)([...r,n])})]:[K.loadDone({accountId:s,dealList:[]})]})))),((e,t,s)=>e.pipe((0,b.l)(K.protocolLoad),(0,C.Y)((()=>t)),(0,f.Z)((([e,t])=>{const{accountId:n,fromTimestamp:r,toTimestamp:o,cursor:i}=e,a=(0,E.Hy)(le._).sharingCode()(t);return s.copy.api.traderAccountDealList(Object.assign(Object.assign({},q.V.accountIdToProto(e.accountId)),{closingDealsOnly:!0,limit:V.N6,fromTimestamp:i?void 0:r,toTimestamp:i?void 0:o,cursor:i,sharingCode:a})).pipe((0,f.Z)((e=>{var t;const{nextCursor:s}=e,r=(null!==(t=e.deal)&&void 0!==t?t:[]).map((e=>Q.U.fromProto(e)));return[K.loadDone({accountId:n,dealList:r}),...s?[K.protocolLoad({accountId:n,cursor:s})]:[]]})),(0,de.f)((e=>(s.logger.error("[Effect Error]: load account deal list",e),[]))))})))),((e,t)=>(0,re.g)(t.pipe((0,I.T)(ae)),t.pipe((0,I.T)(ce.E)),{dueTime:V.sh}).pipe((0,f.Z)((({subscribe:e})=>e.map((e=>K.load({accountId:e.accountId,period:{from:e.from,to:e.to}}))))))),((e,t,s)=>s.copy.api.tradingExecutionEvent$.pipe((0,$.p)((e=>{var t;return e.eventType===z.hg.ORDER_FILLED&&void 0!==e.traderLogin&&void 0!==e.plantId&&void 0!==(null===(t=e.jmDeal)||void 0===t?void 0:t.closePositionDetail)})),(0,C.Y)((()=>t)),(0,f.Z)((([e])=>{const t=q.V.accountIdToDomain({traderLogin:e.traderLogin,plantId:e.plantId,environment:e.environment});return[K.loadDone({accountId:t,dealList:[Q.U.fromProto(e.jmDeal)]})]})))),((e,t,s)=>s.copy.api.tradingExecutionEvent$.pipe((0,$.p)((e=>{var t;return e.eventType===z.hg.ORDER_FILLED&&void 0===e.strategyProviderId&&void 0!==(null===(t=e.jmDeal)||void 0===t?void 0:t.closePositionDetail)})),(0,I.T)((e=>{const t=q.V.accountIdToDomain({traderLogin:e.traderLogin,plantId:e.plantId,environment:e.environment}),s=Q.U.fromProto(e.jmDeal);return ne.x.updateBalance({accountId:t,balance:s.closePositionDetail.balance})}))))),ge=(0,o.memo)((()=>((0,c.n)("accountDeals",X),(0,l.S)(ue),null))),me=(0,o.memo)((e=>{const{accountId:t,from:s,to:n}=e,o={accountId:t,from:s,to:n};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ge,{}),(0,r.jsx)(Y.x,{param:o,subscribe:K.subscribe,unsubscribe:K.unsubscribe})]})})),he=(0,o.memo)((e=>{const{accountId:t}=e,{fromTimestamp:s,toTimestamp:n}=(0,B.d4)(W,{accountId:t});return(0,r.jsx)(me,{accountId:t,from:s,to:n})}));var pe=s(16215),ye=s(46642),xe=s(27098),fe=s(15041),je=s(95141),be=s(86233);const ve=(0,H._N)([be.Z],(e=>({realizedProfit:e})))(Object.assign(Object.assign({},(0,A.Z6)()),{keySelector:(0,E.xd)((0,E.Jk)().accountId(),(0,E.Jk)().tableType())}));var Ie=s(72362),Se=s(12307),Ce=s(35026),ke=s(65012),Oe=s(22679);const we=(0,Oe.K)((()=>({root:Object.assign({display:"flex",flexDirection:"row",flexShrink:0,justifyContent:"flex-end"},(0,ke.M)(Ce.YK)),right:{display:"flex",flexDirection:"row"}})));var Te=s(73245),De=s(76639);const Pe=(0,o.memo)((e=>{const{accountId:t,type:s}=e,{t:n}=(0,Te.B)(),{realizedProfit:o}=(0,B.d4)(ve,{accountId:t,tableType:s}),{css:i}=(0,je.X)(we);return(0,r.jsx)("div",{className:i.root,children:(0,r.jsxs)("div",{className:i.right,children:[(0,r.jsx)("div",{children:`${n("Realised P&L")}:`}),(0,r.jsx)(De.X,{}),(0,r.jsx)(Ie.C,{value:o,children:(0,r.jsx)(Se.g,{accountId:t,value:o})})]})})}));var Ne=s(41280),Le=s(73366),Be=s(92191),He=s(27790),Ee=s(52313),Ae=s(10236);const Re=(0,H._N)([(0,E.Hy)(se.j).networkStatus(),Ee.A,Ae.n,(0,E.Hy)(k.c).tableState(),(0,E.Hy)(_.a).from(),(0,E.Hy)(_.a).to(),He.P,(0,E.Hy)(Be.E).depositCurrency(),(0,E.Hy)(Be.E).depositCurrencyDigits()],((e,t,s,n,r,o,i,a,c)=>({isLoading:e!==U.p.Done&&e!==U.p.Failed,isError:e===U.p.Failed,accountDealList:t,search:s,tableState:n,fromTimestamp:r,toTimestamp:o,timeOffset:i,depositCurrency:a,depositCurrencyDigits:c})))(Object.assign(Object.assign({},(0,A.Z6)()),{keySelector:(0,E.xd)((0,E.Jk)().accountId(),(0,E.Jk)().tableType())}));var Fe=s(26909);const Me=(0,o.memo)((e=>{const{accountId:t,type:s}=e,{t:a}=(0,Te.B)(),c=(0,fe.wA)(),{isLoading:l,isError:d,accountDealList:u,search:g,tableState:m,timeOffset:h,depositCurrency:p,depositCurrencyDigits:y}=(0,B.d4)(Re,{accountId:t,tableType:s});(0,Le.y)();const x=(0,o.useCallback)((e=>e.dealId),[]),f=(0,Fe.e)({type:s,timeOffset:h,depositCurrency:p,depositCurrencyDigits:y,accountId:t}),j=(0,o.useCallback)((e=>{c(n.updateState(e))}),[c]);return d?(0,r.jsx)(i.V,{alignItems:"center",justifyContent:"center",children:(0,r.jsx)(Ne.r,{children:a("No data")})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ye.X,{id:"AccountDealTable",type:xe.l.Thin,isLoading:l,data:u,search:g,columns:f,keyAccessor:x,tableState:m,onTableStateChange:j}),(0,r.jsx)(Pe,{accountId:t,type:s})]})}));var _e=s(15644),We=s(63329),Ke=s(54551),Ye=s(81677),Ve=s(32756),Ze=s(99453),Ue=s(63131),Je=s(53632),Xe=s(38538),$e=s(86646),qe=s(39924),Qe=s(91951);const ze=(0,H._N)([qe.e,(0,E.Jk)().tableType()],((e,t)=>{const s=e.map((e=>e.channel));return t===Ue.c.Bot&&s.push(Ue.j.Bot),(0,Qe.d)(s.filter((e=>void 0!==e)).sort(((e,t)=>e.toLowerCase()<t.toLowerCase()?-1:1)))}))(Object.assign(Object.assign({},(0,A.Z6)()),{keySelector:(0,E.xd)((0,E.Jk)().accountId(),(0,E.Jk)().tableType())}));var Ge=s(64525);const et=(0,H._N)([(0,E.Hy)(se.j).networkStatus(),(0,E.Hy)(k.c).search(),(0,E.Hy)(k.c).period(),ze,Xe.h,$e.$,Ge.A,(0,E.Hy)(Be.E).registrationTimestamp(),(0,E.Hy)(R.p).statement.isEnabled()],((e,t,s,n,r,o,i,a,c)=>({isLoading:e!==U.p.Done,search:t,period:s,channelList:n,channel:r,fromDate:o,toDate:i,startDate:a,isStatementEnabled:c})))(Object.assign(Object.assign({},(0,A.Z6)()),{keySelector:(0,E.xd)((0,E.Jk)().accountId(),(0,E.Jk)().tableType())})),tt=(0,Oe.K)((()=>({root:{display:"flex",flexDirection:"row",flexShrink:0,justifyContent:"space-between",marginBottom:Ce.YK,overflow:"hidden"},left:{flexGrow:1,display:"flex",flexDirection:"row",overflow:"hidden"},right:{display:"flex",flexDirection:"row",overflow:"hidden",marginLeft:Ce.YK},search:{maxWidth:180},period:{flexGrow:1,marginLeft:Ce.YK,maxWidth:115}}))),st=(0,o.memo)((e=>{const{accountId:t,type:s}=e,{t:i}=(0,Te.B)(),a=(0,fe.wA)(),c=s===Ue.c.Main||s===Ue.c.Bot?Ve.w.RegularAccount:Ve.w.SubAccount,{isLoading:l,search:d,period:u,channelList:g,channel:m,fromDate:h,toDate:p,startDate:y,isStatementEnabled:x}=(0,B.d4)(et,{accountId:t,tableType:s}),{css:f,rules:j}=(0,je.X)(tt),b=(0,o.useMemo)((()=>[{label:"All Channels",value:Ue.j.All},...g.map((e=>({label:e,value:e})))]),[g]),v=(0,o.useCallback)((e=>{a(n.updateSearch(e))}),[a]),I=(0,o.useCallback)((()=>{a(n.updateSearch(""))}),[a]),S=(0,o.useCallback)((e=>{a(n.updateChannel(e))}),[a]),C=(0,o.useCallback)((e=>{a(n.updatePeriod({accountId:t,period:{kind:e}}))}),[t,a]),k=(0,o.useCallback)((e=>{a(n.updatePeriod({accountId:t,period:{fromDate:e}}))}),[t,a]),O=(0,o.useCallback)((e=>{a(n.updatePeriod({accountId:t,period:{toDate:e}}))}),[t,a]),w=(0,o.useCallback)((e=>{a(n.changePeriod({accountId:t,period:e}))}),[t,a]),T=(0,o.useCallback)((()=>{a(Ze.i.open({type:c,accountId:t}))}),[c,t,a]);return(0,r.jsxs)("div",{className:f.root,children:[(0,r.jsxs)("div",{className:f.left,children:[(0,r.jsx)(_e.D,{value:d,disabled:l,onChange:v,onClear:I,extend:{root:j.search}}),(0,r.jsx)(De.X,{}),(0,r.jsx)(We.l,{options:b,value:m,disabled:l,maxWidth:115,onChange:S}),(0,r.jsx)(De.X,{}),(0,r.jsx)(Ye.o,{viewType:Je.qi.Stationary,label:`${i("Period")}:`,startDate:y,kind:u.kind,period:u.period,fromDate:h,toDate:p,onKindChange:C,onPeriodChange:w,onFromDateChange:k,onToDateChange:O})]}),(0,r.jsx)("div",{className:f.right,children:x&&(0,r.jsx)(Ke.i,{onClick:T,children:i("Statement")})})]})}));var nt=s(10002),rt=s(9779);const ot=(0,H._N)([Ee.A,(0,E.Hy)(Be.E).depositCurrency(),(0,E.Hy)(k.c).period.period()],((e,t,s)=>({accountDealList:e,depositCurrency:t,period:s})))(Object.assign(Object.assign({},(0,A.Z6)()),{keySelector:(0,E.xd)((0,E.Jk)().accountId(),(0,E.Jk)().tableType())}));var it,at=s(46554),ct=s(88386),lt=s(60984);!function(e){e.symbol="symbol",e.direction="direction",e.netProfit="netProfit"}(it||(it={}));var dt=s(61256),ut=s(96412),gt=s(21872),mt=s(15557),ht=s(96159),pt=s(5860),yt=s(49925),xt=s(76551),ft=s(20399),jt=s(19108),bt=s(9728),vt=s(34387),It=s(1038),St=s(51697),Ct=s(6823);const kt=(0,H._N)([Ct.b,(0,E.Jk)().dealId()],((e,t)=>e.find((e=>e.dealId===t))))(Object.assign(Object.assign({},(0,A.Z6)()),{keySelector:(0,E.xd)((0,E.Jk)().dealId(),(0,E.Jk)().accountId())})),Ot=(0,H._N)([kt,(0,E.Hy)(Be.E).depositCurrency(),He.P],((e,t,s)=>{var n;return{tradeSide:e.tradeSide,symbolName:e.symbol.name,symbolDigits:e.symbol.digits,symbolPipPrecision:e.symbol.pipPrecision,positionOpenTimestamp:e.closePositionDetail.positionOpenTimestamp,executionTimestamp:e.executionTimestamp,entryPrice:e.closePositionDetail.entryPrice,takeProfitPrice:e.closePositionDetail.takeProfitPrice,stopLossPrice:e.closePositionDetail.stopLossPrice,executionPrice:e.executionPrice,filledVolume:e.filledVolume,commissions:null===(n=e.closePositionDetail.introducingBrokerCommission)||void 0===n?void 0:n.plus(e.closePositionDetail.commission),pnlConversionFee:e.closePositionDetail.pnlConversionFee,mirroringCommission:e.closePositionDetail.mirroringCommission,channel:e.channel,swap:e.closePositionDetail.swap,profitInPips:e.closePositionDetail.profitInPips,profit:e.closePositionDetail.profit,netProfit:e.closePositionDetail.netProfit,balance:e.closePositionDetail.balance,depositCurrency:t,timeOffset:s}}))(Object.assign(Object.assign({},(0,A.Z6)()),{keySelector:(0,E.xd)((0,E.Jk)().dealId(),(0,E.Jk)().accountId())}));var wt=s(42976),Tt=s(65501);const Dt=(0,Oe.K)((e=>{const{backgroundColor:t}=e.theme.palette.semantic;return{root:Object.assign(Object.assign({display:"flex",flexDirection:"column"},(0,ke.M)(2*Ce.WQ,0)),(0,Tt.T)({color:t.menuNormal}))}})),Pt=(0,o.memo)((e=>{const{accountId:t,dealId:s}=e,{tradeSide:n,symbolName:o,symbolDigits:a,symbolPipPrecision:c,positionOpenTimestamp:l,executionTimestamp:d,entryPrice:u,takeProfitPrice:g,stopLossPrice:m,executionPrice:h,filledVolume:p,commissions:y,pnlConversionFee:x,mirroringCommission:f,channel:j,swap:b,profitInPips:v,profit:I,netProfit:S,balance:C,depositCurrency:k,timeOffset:O}=(0,B.d4)(Ot,{accountId:t,dealId:s}),{t:w}=(0,Te.B)(),{css:T}=(0,je.X)(Dt);return(0,r.jsxs)("div",{className:T.root,children:[(0,r.jsx)(rt.f,{paddingLeft:2*Ce.WQ,paddingRight:2*Ce.WQ,marginBottom:Ce.WQ,children:(0,r.jsx)(i.V,{children:(0,r.jsxs)(yt.Z,{children:[(0,r.jsxs)(xt.n,{children:[(0,r.jsx)(mt.B,{textColor:ht.r.Secondary,children:w("ID")}),`PID${s}`]}),(0,r.jsxs)(xt.n,{children:[(0,r.jsx)(mt.B,{textColor:ht.r.Secondary,children:w("Symbol")}),o]})]})})}),(0,r.jsx)(pt.H,{marginTop:0,marginBottom:0}),(0,r.jsx)(rt.f,{marginTop:Ce.WQ,paddingLeft:2*Ce.WQ,paddingRight:2*Ce.WQ,marginBottom:Ce.WQ,children:(0,r.jsx)(i.V,{children:(0,r.jsxs)(yt.Z,{children:[(0,r.jsxs)(xt.n,{children:[(0,r.jsx)(mt.B,{textColor:ht.r.Secondary,children:w("Opening Direction")}),(0,ft.O)((0,jt.P)(n))]}),(0,r.jsxs)(xt.n,{children:[(0,r.jsx)(mt.B,{textColor:ht.r.Secondary,children:w("Closing Direction")}),(0,ft.O)(n)]}),(0,r.jsxs)(xt.n,{children:[(0,r.jsx)(mt.B,{textColor:ht.r.Secondary,children:`${w("Opening Time")} (${(0,bt.n)(O)})`}),(0,vt.y)(l,O)]}),(0,r.jsxs)(xt.n,{children:[(0,r.jsx)(mt.B,{textColor:ht.r.Secondary,children:`${w("Closing Time")} (${(0,bt.n)(O)})`}),(0,vt.y)(d,O)]})]})})}),(0,r.jsx)(pt.H,{marginTop:0,marginBottom:0}),(0,r.jsx)(rt.f,{marginTop:Ce.WQ,paddingLeft:2*Ce.WQ,paddingRight:2*Ce.WQ,marginBottom:Ce.WQ,children:(0,r.jsx)(i.V,{children:(0,r.jsxs)(yt.Z,{children:[(0,r.jsxs)(xt.n,{children:[(0,r.jsx)(mt.B,{textColor:ht.r.Secondary,children:w("Entry price")}),(0,It.$g)(a)(u)]}),(0,r.jsxs)(xt.n,{children:[(0,r.jsx)(mt.B,{textColor:ht.r.Secondary,children:w("Take profit")}),(0,It.$g)(a)(g)]}),(0,r.jsxs)(xt.n,{children:[(0,r.jsx)(mt.B,{textColor:ht.r.Secondary,children:w("Stop loss")}),(0,It.$g)(a)(m)]}),(0,r.jsxs)(xt.n,{children:[(0,r.jsx)(mt.B,{textColor:ht.r.Secondary,children:w("Closing Price")}),(0,It.$g)(a)(h)]}),(0,r.jsxs)(xt.n,{children:[(0,r.jsx)(mt.B,{textColor:ht.r.Secondary,children:w("Closing Volume")}),(0,St.Qt)(.01)(p)]})]})})}),(0,r.jsx)(pt.H,{marginTop:0,marginBottom:0}),(0,r.jsx)(rt.f,{marginTop:Ce.WQ,paddingLeft:2*Ce.WQ,paddingRight:2*Ce.WQ,marginBottom:Ce.WQ,children:(0,r.jsx)(i.V,{children:(0,r.jsxs)(yt.Z,{children:[(0,r.jsxs)(xt.n,{children:[(0,r.jsx)(mt.B,{textColor:ht.r.Secondary,children:w("Commissions")}),(0,r.jsx)(wt.R,{accountId:t,value:y})]}),(0,r.jsxs)(xt.n,{children:[(0,r.jsx)(mt.B,{textColor:ht.r.Secondary,children:w("Conversion Fee")}),(0,r.jsx)(wt.R,{accountId:t,value:x})]}),(0,r.jsxs)(xt.n,{children:[(0,r.jsx)(mt.B,{textColor:ht.r.Secondary,children:w("Volume fee")}),(0,r.jsx)(wt.R,{accountId:t,value:f})]})]})})}),(0,r.jsx)(pt.H,{marginTop:0,marginBottom:0}),(0,r.jsx)(rt.f,{marginTop:Ce.WQ,paddingLeft:2*Ce.WQ,paddingRight:2*Ce.WQ,marginBottom:Ce.WQ,children:(0,r.jsx)(i.V,{children:(0,r.jsxs)(yt.Z,{children:[(0,r.jsxs)(xt.n,{children:[(0,r.jsx)(mt.B,{textColor:ht.r.Secondary,children:w("Channel")}),j]}),(0,r.jsxs)(xt.n,{children:[(0,r.jsx)(mt.B,{textColor:ht.r.Secondary,children:w("Swap")}),(0,r.jsx)(wt.R,{accountId:t,value:b})]}),(0,r.jsxs)(xt.n,{children:[(0,r.jsx)(mt.B,{textColor:ht.r.Secondary,children:w("Pips")}),(0,It.u)({pipPrecision:c})(v)]})]})})}),(0,r.jsx)(pt.H,{marginTop:0,marginBottom:0}),(0,r.jsx)(rt.f,{marginTop:Ce.WQ,paddingLeft:2*Ce.WQ,paddingRight:2*Ce.WQ,marginBottom:Ce.WQ,children:(0,r.jsx)(i.V,{children:(0,r.jsxs)(yt.Z,{children:[(0,r.jsxs)(xt.n,{children:[(0,r.jsx)(mt.B,{textColor:ht.r.Secondary,children:w("Gross {0}",k)}),(0,r.jsx)(Ie.C,{value:I,children:(0,r.jsx)(Se.g,{accountId:t,value:I})})]}),(0,r.jsxs)(xt.n,{children:[(0,r.jsx)(mt.B,{textColor:ht.r.Secondary,children:w("Net {0}",k)}),(0,r.jsx)(Ie.C,{value:S,children:(0,r.jsx)(Se.g,{value:S,accountId:t})})]}),(0,r.jsxs)(xt.n,{children:[(0,r.jsx)(mt.B,{textColor:ht.r.Secondary,children:`${w("Balance")} ${k}`}),(0,r.jsx)(wt.R,{accountId:t,value:C})]})]})})})]})})),Nt=(0,o.memo)((e=>{const{accountId:t,type:s}=e,{accountDealList:a,depositCurrency:c,period:l}=(0,B.d4)(ot,{accountId:t,tableType:s}),{t:d}=(0,Te.B)(),u=(0,fe.wA)(),g=(e=>{const{depositCurrency:t,accountId:s}=e,{t:n}=(0,Te.B)();return[{id:it.symbol,justifyContent:"flex-start",Header:()=>n("Symbol"),accessor:e=>e.symbol.name},{id:it.direction,flexBasis:"15%",justifyContent:"center",Header:()=>n("Type"),accessor:e=>e.tradeSide,Cell:e=>(0,r.jsx)(dt.I,{source:e===gt.M.Buy?ut.JQ.ArrowBuy:ut.JQ.ArrowSell,size:14,fill:e===gt.M.Buy?ut.$D.Positive:ut.$D.Negative})},{id:it.netProfit,justifyContent:"flex-end",Header:()=>n("Net {0}",t),accessor:e=>e.closePositionDetail.netProfit,Cell:e=>(0,r.jsx)(Ie.C,{value:e,children:(0,r.jsx)(Se.g,{accountId:s,value:e})})}]})({depositCurrency:c,accountId:t}),m=(0,o.useCallback)((e=>{u(n.changePeriod({accountId:t,period:e}))}),[t,u]),h=(0,o.useCallback)((e=>({accountId:t,dealId:e.dealId})),[t]),p=(0,o.useCallback)((e=>(0,r.jsx)(Pt,{dealId:e.dealId,accountId:e.accountId})),[]),y=(0,o.useMemo)((()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(nt.f,{children:d("History")}),(0,r.jsx)(De.X,{width:Ce.WQ}),(0,r.jsx)(at.E,{viewType:Je.qi.Mobile,children:a.length})]})),[d,a]),x=(0,o.useMemo)((()=>(0,r.jsxs)(i.V,{marginLeft:0,children:[(0,r.jsx)(rt.f,{paddingTop:2*Ce.WQ,paddingRight:2*Ce.WQ,paddingBottom:2*Ce.WQ,paddingLeft:2*Ce.WQ,children:(0,r.jsx)(Ye.o,{viewType:Je.qi.Mobile,period:l,onPeriodChange:m})}),(0,r.jsx)(rt.f,{children:(0,r.jsx)(ct.r,{data:a,columns:g,expandAccessor:h,renderRowExpand:p})})]})),[a,g,h,m,l,p]);return(0,r.jsx)(i.V,{children:(0,r.jsx)(lt.n,{title:y,body:x})})}));var Lt=s(93199);const Bt=(0,o.memo)((e=>{const{accountId:t,type:s}=e;if((0,pe.q)()(e))return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(M,{}),(0,r.jsx)(he,{accountId:t}),(0,r.jsx)(Nt,Object.assign({},e))]});const{id:n}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(M,{}),(0,r.jsx)(he,{accountId:t}),(0,r.jsxs)(i.V,{children:[(0,r.jsx)(st,{accountId:t,type:s}),(0,r.jsx)(a.M,{children:(0,r.jsx)(Lt.m,{id:n,children:(0,r.jsx)(Me,Object.assign({},e))})})]})]})}))},703:(e,t,s)=>{"use strict";s.d(t,{m:()=>c});var n=s(72199),r=s(97176),o=s(58142),i=s(15192),a=s(76996);const c=(0,n._N)([(0,r.Hy)(a.z).minInvestmentInUsd()],(e=>{if(void 0!==e)return new i.A(e)}))(Object.assign(Object.assign({},(0,o.Z6)()),{keySelector:(0,r.Jk)().strategyId()}))},954:(e,t,s)=>{"use strict";s.d(t,{x:()=>a});var n=s(25184),r=s(28855),o=s(46935),i=s(99222);function a(e){const t=[i.Bw.Monday,i.Bw.Tuesday,i.Bw.Wednesday,i.Bw.Thursday,i.Bw.Friday],s=(0,n.U)(e,r.v.Daily),a=Object.keys(s).map((e=>parseInt(e,10))),c=[];for(let e=0;e<t.length;e++){const n=t[e];let r;if(-1!==a.indexOf(n)){const e=(new o.oZ).setStatistic(s[n]).build();r={losingTrades:e.losingTradesTotal,losingTradesRatio:e.losingTradesTotalRatio,winningTrades:e.winningTradesTotal,winningTradesRatio:e.winningTradesTotalRatio}}else r={losingTrades:0,losingTradesRatio:0,winningTrades:0,winningTradesRatio:0};c.push(Object.assign({day:n},r))}return c}},1001:(e,t,s)=>{"use strict";s.d(t,{n:()=>o});var n=s(73245),r=s(5938);const o=e=>{const{t}=(0,n.B)();return e===r.K.AddFunds?t("From account"):t("Account")}},1210:(e,t,s)=>{"use strict";s.d(t,{as:()=>a,nu:()=>i,ox:()=>o});var n=s(99222),r=s(99684);const o=3*n._m,i={statistic:{},networkStatus:r.p.None,loadedPeriodList:[]},a={data:{},subscribers:[]}},1383:(e,t,s)=>{"use strict";s.d(t,{l:()=>i});var n=s(32923),r=s(73245),o=s(5938);const i=(e,t)=>{const{t:s}=(0,r.B)();switch(e){case o.K.StartCopying:return s(t?"Invest":"Start copying");case o.K.RestartCopying:return s(t?"Resume investing":"Resume copying");case o.K.AddFunds:return s("Add funds");default:return(0,n.T)(e)}}},1522:(e,t,s)=>{"use strict";s.d(t,{c:()=>o});var n=s(97176),r=s(3743);const o=(0,n.vY)((e=>e.accountDealTable),r.t)},1579:(e,t,s)=>{"use strict";function n(e){const t=e.map((e=>e.symbolId));return[...new Set(t)]}s.d(t,{i:()=>n})},1586:(e,t,s)=>{"use strict";s.d(t,{l:()=>ee});var n=s(74848),r=s(96540),o=s(28953),i=s(62391),a=s(63683),c=s(38284),l=s(91200),d=s(39235),u=s(68184),g=s(48968);const m=(0,r.memo)((e=>{const{children:t}=e,{data:s}=(0,c.w)(),{width:o}=(0,l.W)(),i=(0,r.useMemo)((()=>{const e=o/s.length,t=e/2;return(0,d.m)().domain([0,1]).range([t,e+t])}),[s,o]),a=(0,u.G)({transform:i,range:[0,o]});return(0,n.jsx)(g.i,{value:a,children:t})}));var h=s(16929),p=s(71035),y=s(35026);const x=(0,r.memo)((e=>{const{children:t}=e,{data:s}=(0,c.w)(),{height:o}=(0,l.W)(),{xAxisHeight:i}=(0,p.V)(),[,a]=(0,h.d)(s,(e=>Math.max(e.losingTrades,e.winningTrades))),m=(0,r.useMemo)((()=>(0,d.m)().domain([0,a]).range([o-i,i+4*y.YK])),[a,o,i]),x=(0,u.G)({transform:m,range:[0,1]});return(0,n.jsx)(g.J,{value:x,children:t})}));var f=s(52551),j=s(16575),b=s(80124),v=s(99196);const I=()=>{const{theme:e}=(0,b.D)(),{chart:t}=e.font.semantic,s=(0,v.H)(),n=(0,j.O)({fontSize:t.primary,fontFamily:s});return(0,r.useMemo)((()=>{const[,e]=n((0,f.k)(0,0));return e+4*y.YK}),[n])};var S=s(38936);const C=(0,r.memo)((e=>{const{children:t}=e,s=I(),o=(0,r.useMemo)((()=>({xAxisHeight:s,yAxisWidth:0})),[s]);return(0,n.jsx)(S.V,{value:o,children:t})}));var k=s(88230),O=s(25155),w=s(7581),T=s(47577),D=s(9779),P=s(44320),N=s(72362),L=s(22085),B=s(19231),H=s(95530),E=s(44047),A=s(6627),R=s(88498),F=s(83906),M=s(65411);const _=(0,r.memo)((e=>{const{index:t,winningTrades:s,losingTrades:o,length:i}=e,[a,c]=(0,r.useState)(!1),[d]=(0,F.E)(),[u]=(0,M.X)(),{width:g,height:m}=(0,l.W)(),{positive:h,negative:p}=(0,R.R)(),x=I(),f=e=>{const t=e>0?u(e)-u(0):-2;return t<-2?t:-2},j=(0,r.useCallback)((e=>a?(0,E.a)(e,40):e),[a]),b=(0,r.useCallback)((e=>a?(0,A.T)((0,E.a)(e,40),.6):(0,A.T)(e,.6)),[a]),v=g/i,S=v/2,C=S-3*y.YK,k=d(t)-y.YK/2-C,O=d(t)+y.YK/2,w=u(0)-2*y.YK,T=f(s),D=j(h),P=b(h),N=f(o),L=j(p),_=b(p),W=d(t)-S,K=u(0),Y=-(m-2*x),V=(0,r.useCallback)((()=>{c(!0)}),[]),Z=(0,r.useCallback)((()=>{c(!1)}),[]);return(0,n.jsxs)(B.Y,{onMouseEnter:V,onMouseLeave:Z,children:[(0,n.jsx)(H.M,{x:k,y:w,width:C,height:T,stroke:D,fill:P}),(0,n.jsx)(H.M,{x:O,y:w,width:C,height:N,stroke:L,fill:_}),(0,n.jsx)(H.M,{x:W,y:K,width:v,height:Y})]})}));var W=s(73245);const K=(0,r.memo)((e=>{const{index:t,winningTrades:s,winningTradesRatio:r,losingTrades:o,losingTradesRatio:i,length:a}=e,{t:c}=(0,W.B)(),l=void 0===r?`${s}`:`${s} (${(0,L.l)()(r)})`,d=void 0===i?`${o}`:`${o} (${(0,L.l)()(i)})`;return(0,n.jsxs)(w.p,{placement:"top",placementByCursor:!0,children:[(0,n.jsx)(_,{index:t,winningTrades:s,losingTrades:o,length:a}),(0,n.jsxs)(T.V,{testId:"performance-chart-popup",children:[(0,n.jsxs)(D.f,{justifyContent:"space-between",testId:"winning",children:[(0,n.jsx)(P.f,{testId:"value",children:(0,n.jsx)(N.C,{value:1,children:l})}),(0,n.jsx)(P.f,{justifyContent:"flex-end",testId:"title",children:c("Winning deals")})]}),(0,n.jsxs)(D.f,{justifyContent:"space-between",testId:"losing",children:[(0,n.jsx)(P.f,{testId:"value",children:(0,n.jsx)(N.C,{value:-1,children:d})}),(0,n.jsx)(P.f,{justifyContent:"flex-end",testId:"title",children:`${c("Losing deals")}`})]})]})]})})),Y=(0,r.memo)((()=>{const{data:e}=(0,c.w)();return(0,n.jsx)(n.Fragment,{children:e.map(((t,s)=>{const{winningTrades:r,winningTradesRatio:o,losingTrades:i,losingTradesRatio:a}=t;return(0,n.jsx)(K,{index:s,winningTrades:r,winningTradesRatio:o,losingTrades:i,losingTradesRatio:a,length:e.length},s)}))})}));var V=s(89684);const Z=(0,r.memo)((()=>{const{theme:e}=(0,b.D)(),{chart:t}=e.font.semantic,s=(0,v.H)(),{t:o}=(0,W.B)(),{width:i}=(0,l.W)(),{positive:a,negative:c,legendForeground:d}=(0,R.R)(),u=(()=>{const{theme:e}=(0,b.D)(),{chart:t}=e.font.semantic,s=(0,v.H)(),n=(0,j.O)({fontSize:t.primary,fontFamily:s}),{xAxisHeight:o}=(0,p.V)();return(0,r.useCallback)((e=>{const{prevItemStart:t,fill:s,name:r,text:i}=e,[a,c]=n(i),l=t-y.YK-a,d=l-y.YK-14;return{name:r,start:d-y.YK,text:i,textXPoint:l,textYPoint:o/2-c/2,rectXPoint:d,rectYPoint:o/2-7,rectWidth:14,rectHeight:14,rectStroke:s,rectFill:(0,A.T)(s,.6)}}),[n,o])})(),g=(0,r.useMemo)((()=>[{name:"winning-trades",text:o("Winning deals"),fill:a},{name:"loosing-trades",text:o("Losing deals"),fill:c}].reverse().reduce(((e,t,s)=>{const{text:n,name:r,fill:o}=t,a=s>0?e[s-1].start:i;return e.push(u({prevItemStart:a,fill:o,name:r,text:n})),e}),[])),[o,i,a,c,u]);return(0,n.jsx)(n.Fragment,{children:g.map((e=>{const{name:o,text:i,textXPoint:a,textYPoint:c,rectXPoint:l,rectYPoint:u,rectWidth:g,rectHeight:m,rectStroke:h,rectFill:p}=e;return(0,n.jsxs)(r.Fragment,{children:[(0,n.jsx)(V.E,{text:i,x:a,y:c,fill:d,fontSize:t.primary,fontFamily:s}),(0,n.jsx)(H.M,{x:l,y:u,width:g,height:m,fill:p,stroke:h,strokeWidth:2})]},o)}))})}));var U=s(44390),J=s(16198);const X=(0,r.memo)((e=>{const{index:t,maxWidth:s}=e,{theme:r}=(0,b.D)(),{chart:o}=r.font.semantic,i=(0,v.H)(),{labels:a}=(0,J.N)(),{xAxisHeight:c}=(0,p.V)(),{foreground:d}=(0,R.R)(),[u]=(0,F.E)(),{height:g}=(0,l.W)(),m=(0,U.o)({maxWidth:s}),h=a[t],[y,x]=m(h),f=g-c,j=u(t)-x/2,I=f+c/2;return(0,n.jsx)(V.E,{text:y,x:j,y:I,fill:d,fontSize:o.primary,fontFamily:i})}));var $=s(82411);const q=(0,r.memo)((()=>{const{data:e}=(0,c.w)(),[t]=(0,M.X)(),{width:s}=(0,l.W)(),{axisColor:r}=(0,R.R)(),o=s/e.length;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)($.H,{point:t(0),start:0,end:s,stroke:r}),e.map(((e,t)=>(0,n.jsx)(X,{index:t,maxWidth:o},t)))]})}));var Q=s(87240),z=s(75398);const G=(0,r.memo)((()=>(0,n.jsx)(z.f,{children:(0,n.jsxs)(Q.W,{children:[(0,n.jsx)(Z,{}),(0,n.jsx)(Y,{}),(0,n.jsx)(q,{})]})}))),ee=(0,r.memo)((e=>{const{data:t,labels:s}=e;return(0,n.jsx)(O.P,{children:(0,n.jsx)(k.O,{children:(0,n.jsx)(o.J,{data:t,children:(0,n.jsx)(i.a,{labels:s,children:(0,n.jsx)(C,{children:(0,n.jsx)(a.k,{children:(0,n.jsx)(m,{children:(0,n.jsx)(x,{children:(0,n.jsx)(G,{})})})})})})})})})}))},2331:(e,t,s)=>{"use strict";s.d(t,{L:()=>n});var n,r=s(63773);!function(e){const t=(0,r.D)("CopyingControlForm");e.open=t("OPEN"),e.show=t("SHOW"),e.close=t("CLOSE"),e.destroy=t("DESTROY")}(n||(n={}))},2370:(e,t,s)=>{"use strict";s.d(t,{W:()=>i});var n=s(96540),r=s(28483),o=s(48212);const i=e=>{const t=(0,r.j)(e,"hidden"),s=(0,r.j)(e,"order");return(0,n.useMemo)((()=>(0,o.h)(Object.values(e),t,s)),[e,t,s])}},2915:(e,t,s)=>{"use strict";s.d(t,{c:()=>xe});var n=s(74848),r=s(96540),o=s(73245),i=s(15041),a=s(39701),c=s(79207),l=s(47577),d=s(69427),u=s(51012),g=s(75960),m=s(72199),h=s(97176),p=s(78975),y=s(56674),x=s(99684),f=s(58142),j=s(92191),b=s(44419),v=s(73370),I=s(3926),S=s(70466),C=s(23314),k=s(27790),O=s(56923);const w={period:O.Y.thirtyDaysAgo},T=(0,h.vY)((e=>e.accountRoiChart),w);var D=s(9869),P=s(68293);const N=(0,m._N)([(0,h.Hy)(j.E).registrationTimestamp(),b.E,k.P],((e,t,s)=>{const n=(0,D.w)();return(0,P.A)(n,t,s,e)}))(Object.assign(Object.assign({},(0,f.Z6)()),{keySelector:(0,h.Jk)().accountId()}));var L=s(62517);const B=(0,m._N)([(0,h.Hy)(T).period(),N],((e,t)=>(0,L.v)(t,e)))(Object.assign(Object.assign({},(0,f.Z6)()),{keySelector:(0,h.Jk)().accountId()})),H=(0,m._N)([B,(0,h.Hy)(j.E).registrationTimestamp(),b.E,k.P],((e,t,s,n)=>{const{from:r,to:o}=(0,I.N)({kind:S.k.period,period:e,registrationTimestamp:t,currentTime:s,timeOffset:n});return{from:(0,C.xA)(r,n),to:(0,C.xA)(o,n)}}))(Object.assign(Object.assign({},(0,f.Z6)()),{keySelector:(0,h.Jk)().accountId()})),E=(0,m._N)([v.b,H,k.P],((e,t,s)=>e.filter((e=>e.timestamp>=t.from&&e.timestamp<=(0,C.P9)(t.to,s)))))(Object.assign(Object.assign({},(0,f.Z6)()),{keySelector:(0,h.Jk)().accountId()}));var A=s(70312);const R=(0,m._N)([E],(e=>(0,A.c)(e)))(Object.assign(Object.assign({},(0,f.Z6)()),{keySelector:(0,h.Jk)().accountId()}));var F=s(50322);const M=(0,m._N)([R,(0,h.Hy)(j.E).registrationTimestamp(),b.E,k.P],((e,t,s,n)=>(0,F.N)(e,t,s,n)))(Object.assign(Object.assign({},(0,f.Z6)()),{keySelector:(0,h.Jk)().accountId()})),_=(0,m._N)([M,(0,h.Hy)(y.x).networkStatus(),p.v,B,N,(0,h.Hy)(j.E).accountId()],((e,t,s,n,r,o)=>({isLoading:t!==x.p.Done&&t!==x.p.Failed,isError:t===x.p.Failed,data:e,period:n,activePeriodList:r,allTimeRoi:s,isAccountDeleted:void 0===o})))(Object.assign(Object.assign({},(0,f.Z6)()),{keySelector:(0,h.Jk)().accountId()}));var W=s(41280),K=s(395),Y=s(73944),V=s(73366);const Z=(0,r.memo)((e=>{var t;const{accountId:s}=e,{isLoading:r,isError:i,data:c,period:d,activePeriodList:u,allTimeRoi:m,isAccountDeleted:h}=(0,a.d4)(_,{accountId:s}),{t:p}=(0,o.B)();if((0,V.y)(),c.length<=1||i||h)return(0,n.jsx)(l.V,{alignItems:"center",justifyContent:"center",children:(0,n.jsx)(W.r,{children:p("No historical data")})});if(r)return(0,n.jsx)(l.V,{alignItems:"center",justifyContent:"center",children:(0,n.jsx)(K.a,{display:Y.O.Block})});const y=d!==O.Y.all?null===(t=c[c.length-1])||void 0===t?void 0:t.roi:m;return(0,n.jsx)(g.x,{data:c,roi:y,period:d,availablePeriods:u})}));var U=s(93199);const J=(0,m._N)([B,N,H],((e,t,s)=>({period:e,activePeriodList:t,fromTimestamp:s.from,toTimestamp:s.to})))(Object.assign(Object.assign({},(0,f.Z6)()),{keySelector:(0,h.Jk)().accountId()}));var X,$=s(79312),q=s(21444),Q=s(63773);!function(e){const t=(0,Q.D)("AccountRoiChart");e.setPeriod=t("SET_PERIOD")}(X||(X={}));const z=(0,r.memo)((e=>{const{id:t,accountId:s,infoText:g}=e,{t:m}=(0,o.B)(),h=(0,i.wA)(),{fromTimestamp:p,toTimestamp:y,period:x,activePeriodList:f}=(0,a.d4)(J,{accountId:s}),j=(0,r.useCallback)((e=>{h(X.setPeriod(e))}),[h]);return(0,n.jsxs)(l.V,{children:[(0,n.jsx)(c.i,{accountId:s}),(0,n.jsx)(u.G,{accountId:s,from:p,to:y}),(0,n.jsxs)(d.e,{children:[(0,n.jsx)($.I,{period:x,periodList:f,onChange:j}),(0,n.jsx)(U.m,{id:t,children:(0,n.jsx)(Z,{accountId:s})})]}),void 0!==g&&(0,n.jsx)(q.g,{label:g,tooltip:m("Time-weighted ROI calculation method is applied.")})]})}));var G=s(10002),ee=s(9779),te=s(84769);const se=(0,m._N)([B,N,H],((e,t,s)=>({period:e,activePeriodList:t,fromTimestamp:s.from,toTimestamp:s.to})))(Object.assign(Object.assign({},(0,f.Z6)()),{keySelector:(0,h.Jk)().accountId()})),ne=(0,m._N)([M,p.v,B,N,(0,h.Hy)(y.x).networkStatus(),(0,h.Hy)(j.E).accountId()],((e,t,s,n,r,o)=>({data:e,allTimeRoi:t,period:s,activePeriodList:n,isLoading:r!==x.p.Done&&r!==x.p.Failed,isError:r===x.p.Failed,isAccountDeleted:void 0===o})))(Object.assign(Object.assign({},(0,f.Z6)()),{keySelector:(0,h.Jk)().accountId()}));var re=s(85801);const oe=(0,r.memo)((e=>{var t;const{accountId:s}=e,{t:r}=(0,o.B)(),{data:i,allTimeRoi:c,period:d,activePeriodList:u,isLoading:g,isError:m,isAccountDeleted:h}=(0,a.d4)(ne,{accountId:s}),p=d!==O.Y.all?null===(t=i[i.length-1])||void 0===t?void 0:t.roi:c;return g?(0,n.jsx)(K.a,{}):i.length<=1||m||h?(0,n.jsx)(l.V,{marginLeft:0,alignItems:"center",justifyContent:"center",children:(0,n.jsx)(W.r,{children:r("No historical data")})}):(0,n.jsx)(re.L,{data:i,roi:p,period:d,availablePeriods:u})}));var ie=s(60984),ae=s(35026),ce=s(95141),le=s(40639),de=s(76728);const ue=(0,s(22679).K)((e=>{const{backgroundColor:t}=e.theme.palette.semantic;return{bodyContent:Object.assign({},(0,le.P)(1,t.strokeNormal,de.lQ.Top))}})),ge=(0,r.memo)((e=>{const{accountId:t,chartHeight:s,withAccordion:g,infoText:m}=e,{t:h}=(0,o.B)(),p=(0,i.wA)(),{period:y,activePeriodList:x,fromTimestamp:f,toTimestamp:j}=(0,a.d4)(se,{accountId:t}),{rules:b}=(0,ce.X)(ue),v=(0,r.useCallback)((e=>{p(X.setPeriod(e))}),[p]),I=(0,r.useMemo)((()=>(0,n.jsx)(G.f,{children:h("ROI (%)")})),[h]),S=(0,r.useMemo)((()=>g?(0,n.jsx)(l.V,{paddingTop:2*ae.WQ,paddingRight:2*ae.WQ,paddingBottom:2*ae.WQ,paddingLeft:2*ae.WQ,marginLeft:0,extend:{root:b.bodyContent},children:(0,n.jsx)(ee.f,{children:(0,n.jsxs)(l.V,{children:[(0,n.jsx)(te.O,{period:y,periodList:x,onChange:v}),(0,n.jsx)(ee.f,{minHeight:s,children:(0,n.jsx)(d.e,{children:(0,n.jsx)(oe,{accountId:t})})}),(0,n.jsx)(ee.f,{children:(0,n.jsx)(q.g,{label:m})})]})})}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(te.O,{period:y,periodList:x,onChange:v}),(0,n.jsx)(ee.f,{minHeight:s,children:(0,n.jsx)(d.e,{children:(0,n.jsx)(oe,{accountId:t})})})]})),[t,x,s,v,m,y,b.bodyContent,g]);return(0,n.jsxs)(l.V,{children:[(0,n.jsx)(c.i,{accountId:t}),(0,n.jsx)(u.G,{accountId:t,from:f,to:j}),g?(0,n.jsx)(ie.n,{title:I,body:S}):S]})}));var me=s(16215),he=s(52019);const pe=(0,s(98549).h)(w).case(X.setPeriod,((e,t)=>{e.period=t})),ye=(0,r.memo)((()=>((0,he.n)("accountRoiChart",pe),null))),xe=(0,r.memo)((e=>(0,me.q)()(e)?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ye,{}),(0,n.jsx)(ge,Object.assign({},e))]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ye,{}),(0,n.jsx)(z,Object.assign({},e))]})))},3081:(e,t,s)=>{"use strict";s.d(t,{F:()=>W});var n=s(74848),r=s(96540),o=s(81588),i=s(53632),a=s(47577),c=s(48729),l=s(73245),d=s(95141),u=s(22679),g=s(65012),m=s(64453);const h=(0,u.K)((()=>({itemRoot:Object.assign({width:"100%",height:44,flexShrink:0},(0,g.M)(0)),itemContent:Object.assign(Object.assign({justifyContent:"flex-start",color:"unset",lineHeight:"unset"},(0,m.V)(0)),{boxShadow:"none"})})));var p=s(15041),y=s(39701),x=s(58142),f=s(72199),j=s(97176),b=s(53183),v=s(31548),I=s(20412),S=s(95);const C=(0,f._N)([b.z,v.t,S.I,(0,j.Hy)(I.u).strategyId(),(0,j.Hy)(I.u).isPortfolio()],((e,t,s,n,r)=>({isRemoveFundsAvailable:e,showEquityStopLoss:t&&!s,strategyId:n,isPortfolio:r})))(Object.assign(Object.assign({},(0,x.Z6)()),{keySelector:(0,j.Jk)().accountId()}));var k=s(3699),O=s(67569);const w=(0,r.memo)((e=>{const{accountId:t,hide:s}=e,{t:o}=(0,l.B)(),i=(0,p.wA)(),{rules:u}=(0,d.X)(h),{isRemoveFundsAvailable:g,showEquityStopLoss:m,strategyId:x,isPortfolio:f}=(0,y.d4)(C,{accountId:t}),j=(0,r.useCallback)((()=>{s(),i(O.f.pushRemoveFunds({strategyId:x,accountId:t}))}),[s,i,x,t]),b=(0,r.useCallback)((()=>{s(),i(O.f.pushStopCopying({accountId:t}))}),[s,i,t]),v=(0,r.useCallback)((()=>{s(),i(O.f.pushEquityStopLoss({accountId:t}))}),[s,i,t]);return(0,n.jsxs)(a.V,{children:[g&&(0,n.jsx)(c.B,{onClick:j,extend:{root:u.itemRoot,content:u.itemContent},children:o("Remove funds")}),m&&(0,n.jsx)(c.B,{onClick:v,testId:"set-equity-stop-loss",extend:{root:u.itemRoot,content:u.itemContent},children:o("Set equity stop loss")}),(0,n.jsx)(k.g,{strategyId:x,onClick:s}),(0,n.jsx)(c.B,{onClick:b,extend:{root:u.itemRoot,content:u.itemContent},children:o(f?"Stop investing":"Stop copying")})]})}));var T=s(42577),D=s(81470);const P=(0,f._N)([(0,j.Hy)(D.h).accountId(),T.L,b.z,v.t,(0,j.Hy)(I.u).strategyId(),(0,j.Hy)(I.u).isPortfolio(),S.I],((e,t,s,n,r,o,i)=>({parentAccountId:e,sharingCode:t,strategyId:r,isPortfolio:o,isRemoveFundsAvailable:s,isSetEquityStopLossAvailable:n,isSetEquityStopLossDisabled:i})))(Object.assign(Object.assign({},(0,x.Z6)()),{keySelector:(0,j.Jk)().accountId()}));var N=s(66694),L=s(58528),B=s(5860),H=s(97865),E=s(49019),A=s(36023),R=s(76224);const F=(0,r.memo)((e=>{const{accountId:t,hide:s}=e,o=(0,p.wA)(),{t:i}=(0,l.B)(),{parentAccountId:a,sharingCode:c,strategyId:d,isPortfolio:u,isRemoveFundsAvailable:g,isSetEquityStopLossAvailable:m,isSetEquityStopLossDisabled:h}=(0,y.d4)(P,{accountId:t}),x=(0,r.useCallback)((()=>{o(H.l.open({accountId:a,strategyId:d})),s()}),[o,a,d,s]),f=(0,r.useCallback)((()=>{o(L.t.open(t)),s()}),[o,t,s]),j=(0,r.useCallback)((()=>{o(E.C.open(t)),s()}),[o,t,s]),b=(0,r.useCallback)((()=>{o(A.G.open(t)),s()}),[o,t,s]),v=(0,r.useCallback)((()=>{o(R._.open(t)),s()}),[o,t,s]),I=(0,r.useCallback)((()=>{s()}),[s]);return(0,n.jsxs)(n.Fragment,{children:[g&&(0,n.jsx)(N.k,{onClick:x,children:i("Remove funds")}),(0,n.jsx)(k.g,{strategyId:d,onClick:I}),m&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(B.H,{}),(0,n.jsx)(N.k,{disabled:h,onClick:f,testId:"set-equity-stop-loss",children:i("Set equity stop loss")})]}),(0,n.jsx)(N.k,{onClick:j,children:i(u?"Stop investing":"Stop copying")}),(0,n.jsx)(B.H,{}),(0,n.jsx)(N.k,{onClick:b,children:i(c?"View Investor Access link":"Create Investor Access link")}),c&&(0,n.jsx)(N.k,{onClick:v,children:i("Delete Investor Access link")})]})}));var M=s(50551),_=s(66521);const W=(0,r.memo)((e=>{const{accountId:t,hide:s}=e,{viewType:r}=(0,o.U)();return r===i.qi.Mobile?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(M.h,{accountId:t}),(0,n.jsx)(w,{accountId:t,hide:s})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(_.Y,{accountId:t}),(0,n.jsx)(M.h,{accountId:t}),(0,n.jsx)(F,{accountId:t,hide:s})]})}))},3170:(e,t,s)=>{"use strict";s.d(t,{t:()=>dt});var n=s(74848),r=s(96540),o=s(52019),i=s(56923);const a={period:i.Y.thirtyDaysAgo};var c,l=s(63773);!function(e){const t=(0,l.D)("StrategyFinancialHistoryChart");e.updatePeriod=t("UPDATE_PERIOD")}(c||(c={}));var d=s(98549);const u=(0,d.h)(a).case(c.updatePeriod,((e,t)=>{const{period:s}=t;e.period=s})),g=(0,r.memo)((()=>((0,o.n)("strategyFinancialHistoryChart",u),null)));var m,h=s(81588),p=s(53632),y=s(1767);!function(e){const t=(0,l.D)("StrategyFinancialHistory");e.load=t("LOAD"),e.loadDone=t("LOAD_DONE"),e.loadFailed=t("LOAD_FAILED"),e.updateLoadedPeriodList=t("UPDATE_LOADED_PERIOD_LIST"),e.subscribe=t("SUBSCRIBE"),e.unsubscribe=t("UNSUBSCRIBE"),e.intervalSubscribe=t("INTERVAL_SUBSCRIBE"),e.intervalUnsubscribe=t("INTERVAL_UNSUBSCRIBE")}(m||(m={}));var x=s(47837),f=s(33270),j=s(99222),b=s(99684);const v=15*j.Cg,I=j._m,S={history:{},networkStatus:b.p.None,loadedPeriodList:[]},C={data:{},subscribers:[]},k=(0,s(41233).K)({subscribeAction:m.subscribe,unsubscribeAction:m.unsubscribe}),O=(0,d.h)(S).case(m.loadDone,((e,t)=>{const{historyList:s}=t;for(const t of s)e.history[t.timestamp]=t;e.networkStatus=b.p.Done})).case(m.loadFailed,(e=>{e.networkStatus=b.p.Failed})).case(m.updateLoadedPeriodList,((e,t)=>{const{periodList:s}=t;e.loadedPeriodList=s})),w=(0,d.h)(C).casesWithAction([m.subscribe,m.unsubscribe],((e,t)=>{e.subscribers=k(e.subscribers,t)})).casesWithAction([m.loadDone,m.loadFailed,m.updateLoadedPeriodList],((e,t)=>{var s;const{strategyId:n}=t.payload;e.data[n]=O(null===(s=e.data)||void 0===s?void 0:s[n],t)}));var T=s(82823),D=s(47873),P=s(83895),N=s(28452),L=s(81160),B=s(79005),H=s(97176),E=s(80070),A=s(51863),R=s(49510),F=s(72199),M=s(58142);const _=(0,H.vY)((e=>e.strategyFinancialHistory),C),W=(0,F._N)([(0,H.Hy)(_).data(),(0,H.Jk)().strategyId()],((e,t)=>Object.assign(Object.assign({},S),e[t])))(Object.assign(Object.assign({},(0,M.Z6)()),{keySelector:(0,H.Jk)().strategyId()}));var K,Y=s(12157);!function(e){e.fromProto=function(e){return{timestamp:e.timestamp,minEquity:(0,Y.c8)(e.minEquity,e.moneyDigits),maxEquity:(0,Y.c8)(e.maxEquity,e.moneyDigits),equity:(0,Y.c8)(e.equity,e.moneyDigits),balance:(0,Y.c8)(e.balance,e.moneyDigits)}}}(K||(K={}));var V=s(76269),Z=s(23656),U=s(92963),J=s(52293);const X=(0,F._N)([J.c],(e=>e))(Object.assign(Object.assign({},(0,M.Z6)()),{keySelector:(0,H.Jk)().strategyId()})),$=(0,U._)((0,H.Hy)(_).subscribers(),X);var q=s(84720),Q=s(43481);const z=(0,T.H)(((e,t)=>(0,Z.g)(t.pipe((0,L.T)($)),t.pipe((0,L.T)(q.E)),{dueTime:I,unsubscribeCurrentKeysOnPause:!0}).pipe((0,N.Z)((({subscribe:e,unsubscribe:t})=>{const s=[];return e.length>0&&s.push(m.intervalSubscribe(e)),t.length>0&&s.push(m.intervalUnsubscribe(t)),s})))),(e=>(0,Q.a)(e.pipe((0,D.l)(m.intervalSubscribe)),e.pipe((0,D.l)(m.intervalUnsubscribe)),{updateInterval:v}).pipe((0,N.Z)((e=>e.map((e=>{const{strategyId:t,from:s,to:n}=e;return m.load({strategyId:t,period:{from:s,to:n}})})))))),((e,t,s)=>e.pipe((0,D.l)(m.load),(0,P.Y)((()=>t)),(0,N.Z)((([e,t])=>{const{strategyId:n,period:r}=e,o=(0,H.Hy)(W).loadedPeriodList()(t,{strategyId:n}),i=(0,E.M)(r,o);if(!i.length)return[m.loadDone({strategyId:n,historyList:[]})];const a=i.map((e=>s.copy.api.getProviderFinancialHistory({strategyProviderId:B.V.strategyIdToProto(n),fromTimestamp:e.from,toTimestamp:e.to}).pipe((0,L.T)((e=>e.financialHistoryCommissionAdjusted||[])))));return(0,R.z)(a).pipe((0,N.Z)((e=>{const t=e.flat().map((e=>K.fromProto(e)));return[m.loadDone({strategyId:n,historyList:t}),m.updateLoadedPeriodList({strategyId:n,periodList:(0,A.K)([...o,r])})]})),(0,V.f)((e=>(s.logger.error("[Effect Error]: load strategy financial history",e),[m.loadFailed({strategyId:n})]))))}))))),G=(0,r.memo)((()=>((0,o.n)("strategyFinancialHistory",w),(0,f.S)(z),null))),ee=(0,r.memo)((e=>{const{strategyId:t,from:s,to:r}=e,o={strategyId:t,from:s,to:r};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(x.c,{strategyId:t}),(0,n.jsx)(G,{}),(0,n.jsx)(y.x,{param:o,subscribe:m.subscribe,unsubscribe:m.unsubscribe})]})}));var te=s(4265),se=s(39701),ne=s(3926),re=s(70466),oe=s(23314),ie=s(90311),ae=s(44064),ce=s(80681),le=s(44419),de=s(27790),ue=s(68293);const ge=(0,F._N)([(0,H.Hy)(ae.b).traderRegistrationTimestamp(),le.E,de.P],((e,t,s)=>{const n=[i.Y.ago1week,i.Y.thirtyDaysAgo,i.Y.ninetyDaysAgo,i.Y.hundredEightyThreeDaysAgo,i.Y.threeHundredSixtyFiveDaysAgo,i.Y.all];return(0,ue.A)(n,t,s,e)}))(Object.assign(Object.assign({},(0,M.Z6)()),{keySelector:(0,H.Jk)().strategyId()})),me=(0,H.vY)((e=>e.strategyFinancialHistoryChart),a);var he=s(62517);const pe=(0,F._N)([(0,H.Hy)(me).period(),ge],((e,t)=>(0,he.v)(t,e)))(Object.assign(Object.assign({},(0,M.Z6)()),{keySelector:(0,H.Jk)().strategyId()})),ye=(0,F._N)([pe,(0,H.Hy)(ae.b).traderRegistrationTimestamp(),(0,H.Hy)(ce.j).serverTime(),(0,H.Hy)(ie.j).serverTimeOffset()],((e,t,s,n)=>{const{from:r,to:o}=(0,ne.N)({kind:re.k.period,period:e,registrationTimestamp:t,currentTime:s,timeOffset:n});return{from:(0,oe.xA)(r,n),to:(0,oe._b)(o,n)}}))(Object.assign(Object.assign({},(0,M.Z6)()),{keySelector:(0,H.Jk)().strategyId()})),xe=(0,F._N)([(0,H.Hy)(ye).from(),(0,H.Hy)(ye).to()],((e,t)=>({fromTimestamp:e,toTimestamp:t})))(Object.assign(Object.assign({},(0,M.Z6)()),{keySelector:(0,H.Jk)().strategyId()}));var fe=s(15041),je=s(47577),be=s(10002),ve=s(9779),Ie=s(69427),Se=s(57135),Ce=s(11098),ke=s(41280),Oe=s(395),we=s(73944),Te=s(73245),De=s(83064),Pe=s(41089),Ne=s(61477),Le=s(1467);const Be=(0,F._N)([(0,H.Hy)(W).history()],(e=>Object.values(e)))(Object.assign(Object.assign({},(0,M.Z6)()),{keySelector:(0,H.Jk)().strategyId()})),He=(0,F._N)([Be,(0,H.Hy)(ae.b).traderRegistrationTimestamp(),(0,H.Hy)(ce.j).serverTime()],((e,t,s)=>((e,t,s)=>{var n,r,o,i,a,c,l,d;const u=[],g=(0,Le.k)(t).utcOffset(0),m=(0,Le.k)(s).utcOffset(0);for(let t=g;t<=m;t=t.add(1,"day")){const s=e.find((e=>e.timestamp===t.valueOf()));s?u.push(s):u.push({timestamp:t.valueOf(),balance:null!==(r=null===(n=u[u.length-1])||void 0===n?void 0:n.balance)&&void 0!==r?r:0,equity:null!==(i=null===(o=u[u.length-1])||void 0===o?void 0:o.equity)&&void 0!==i?i:0,maxEquity:null!==(c=null===(a=u[u.length-1])||void 0===a?void 0:a.maxEquity)&&void 0!==c?c:0,minEquity:null!==(d=null===(l=u[u.length-1])||void 0===l?void 0:l.minEquity)&&void 0!==d?d:0})}return u})(e,(0,oe.xA)(t,0),(0,oe.xA)(s,0))))(Object.assign(Object.assign({},(0,M.Z6)()),{keySelector:(0,H.Jk)().strategyId()}));var Ee=s(15192);const Ae=(0,F._N)([He],(e=>Object.values(e).map((e=>Object.assign(Object.assign({},e),{balance:new Ee.A(e.balance),equity:new Ee.A(e.equity),maxEquity:new Ee.A(e.maxEquity),minEquity:new Ee.A(e.minEquity)})))))(Object.assign(Object.assign({},(0,M.Z6)()),{keySelector:(0,H.Jk)().strategyId()})),Re=(0,F._N)([Ae,(0,H.Hy)(ae.b).traderRegistrationTimestamp(),pe,le.E,de.P],((e,t,s,n,r)=>{const{from:o,to:i}=(0,ne.N)({kind:re.k.period,period:s,registrationTimestamp:t,currentTime:n,timeOffset:r});return[...e.filter((e=>e.timestamp>=(0,oe.xA)(o,r)&&e.timestamp<=(0,oe.P9)(i,r)))].sort(((e,t)=>e.timestamp-t.timestamp))}))(Object.assign(Object.assign({},(0,M.Z6)()),{keySelector:(0,H.Jk)().strategyId()}));var Fe=s(62299);const Me=(0,F._N)([Fe.z,(0,H.Hy)(ae.b).traderRegistrationTimestamp(),pe,(0,H.Hy)(ce.j).serverTime(),de.P],((e,t,s,n,r)=>{const{from:o,to:i}=(0,ne.N)({kind:re.k.period,period:s,registrationTimestamp:t,currentTime:n,timeOffset:r});return[...e.filter((e=>e.changeBalanceTimestamp>=o&&e.changeBalanceTimestamp<=(0,oe.P9)(i,r)))].sort(((e,t)=>e.changeBalanceTimestamp-t.changeBalanceTimestamp))}))(Object.assign(Object.assign({},(0,M.Z6)()),{keySelector:(0,H.Jk)().strategyId()})),_e=(0,F._N)([J.c,(0,H.Hy)(W).networkStatus(),Re,Me,(0,H.Hy)(ae.b).depositCurrency(),(0,H.Hy)(ae.b).depositCurrencyDigits()],((e,t,s,n,r,o)=>{const i=n.filter((e=>(0,Pe.I)(e.operationType))),a=(0,Ne.I)(i);return{isLoading:e&&t!==b.p.Done&&t!==b.p.Failed,isError:t===b.p.Failed,data:(0,De.n)(s,a),depositCurrency:r,depositCurrencyDigits:o}}))(Object.assign(Object.assign({},(0,M.Z6)()),{keySelector:(0,H.Jk)().strategyId()}));var We=s(10740);const Ke=(0,r.memo)((e=>{const{strategyId:t}=e,{isLoading:s,isError:r,data:o,depositCurrency:i,depositCurrencyDigits:a}=(0,se.d4)(_e,{strategyId:t}),{t:c}=(0,Te.B)();return s?(0,n.jsx)(je.V,{alignItems:"center",justifyContent:"center",children:(0,n.jsx)(Oe.a,{display:we.O.Block})}):o.length<=1||r?(0,n.jsx)(je.V,{alignItems:"center",justifyContent:"center",children:(0,n.jsx)(ke.r,{children:c("No historical data")})}):(0,n.jsx)(We.u,{data:o,assetName:i,assetDigits:a,showLegend:!1,showTriangles:!0})})),Ye=(0,F._N)([pe,ge],((e,t)=>({activePeriod:e,activePeriodList:t})))(Object.assign(Object.assign({},(0,M.Z6)()),{keySelector:(0,H.Jk)().strategyId()}));var Ve=s(35026),Ze=s(60984),Ue=s(95141),Je=s(40639),Xe=s(76728);const $e=(0,s(22679).K)((e=>{const{backgroundColor:t}=e.theme.palette.semantic;return{bodyContent:Object.assign({},(0,Je.P)(1,t.strokeNormal,Xe.lQ.Top))}}));var qe=s(88498),Qe=s(32912),ze=s(74572);const Ge=(0,F._N)([Re,Me],((e,t)=>{const s=t.filter((e=>(0,Pe.I)(e.operationType))),n=(0,Ne.I)(s);return{data:(0,De.n)(e,n)}}))(Object.assign(Object.assign({},(0,M.Z6)()),{keySelector:(0,H.Jk)().strategyId()})),et=(0,r.memo)((e=>{const{strategyId:t}=e,{t:s}=(0,Te.B)(),{data:o}=(0,se.d4)(Ge,{strategyId:t}),{balanceStroke:i,equityAreaStroke:a,depositsStroke:c,withdrawalsStroke:l}=(0,qe.R)(),d=s("Balance"),u=s("Equity"),g=`${s("Deposits")} / ${s("Withdrawals")}`,m=(0,r.useMemo)((()=>o.some((e=>e.equity))),[o]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(ve.f,{marginBottom:Ve.WQ,children:[(0,n.jsx)(je.V,{maxWidth:107,children:(0,n.jsx)(Qe.W,{iconColor:i,text:d})}),(0,n.jsx)(je.V,{maxWidth:107,children:(0,n.jsx)(Qe.W,{iconColor:a,text:u})})]}),(0,n.jsx)(ve.f,{children:m&&(0,n.jsx)(ze.R,{triangleColor1:c,triangleColor2:l,text:g})})]})})),tt=(0,r.memo)((e=>{const{strategyId:t,infoText:s}=e,{t:o}=(0,Te.B)(),i=(0,fe.wA)(),{activePeriod:a,activePeriodList:l}=(0,se.d4)(Ye,{strategyId:t}),{rules:d}=(0,Ue.X)($e),u=(0,r.useCallback)((e=>{i(c.updatePeriod({period:e}))}),[i]);return(0,n.jsx)(je.V,{children:(0,n.jsx)(Ze.n,{title:(0,n.jsx)(be.f,{children:o("Equity")}),body:(0,n.jsxs)(je.V,{paddingTop:2*Ve.WQ,paddingRight:2*Ve.WQ,paddingBottom:2*Ve.WQ,paddingLeft:2*Ve.WQ,marginLeft:0,extend:{root:d.bodyContent},children:[(0,n.jsx)(ve.f,{marginBottom:0,children:(0,n.jsxs)(je.V,{children:[(0,n.jsx)(Se.F,{period:a,periodList:l,onChange:u}),(0,n.jsx)(ve.f,{minHeight:189,marginBottom:2*Ve.WQ,children:(0,n.jsx)(Ie.e,{children:(0,n.jsx)(Ke,{strategyId:t})})}),(0,n.jsx)(et,{strategyId:t})]})}),s&&(0,n.jsx)(Ce.b,{children:s})]})})})}));var st=s(93199),nt=s(45137),rt=s(73366);const ot=(0,F._N)([J.c,(0,H.Hy)(W).networkStatus(),Re,Me,(0,H.Hy)(ae.b).depositCurrency(),(0,H.Hy)(ae.b).depositCurrencyDigits()],((e,t,s,n,r,o)=>{const i=n.filter((e=>(0,Pe.I)(e.operationType))),a=(0,Ne.I)(i);return{isLoading:e&&t!==b.p.Done&&t!==b.p.Failed,isError:t===b.p.Failed,data:(0,De.n)(s,a),depositCurrency:r,depositCurrencyDigits:o}}))(Object.assign(Object.assign({},(0,M.Z6)()),{keySelector:(0,H.Jk)().strategyId()})),it=(0,r.memo)((e=>{const{strategyId:t}=e,{isLoading:s,isError:r,data:o,depositCurrency:i,depositCurrencyDigits:a}=(0,se.d4)(ot,{strategyId:t});(0,rt.y)();const{t:c}=(0,Te.B)();return s?(0,n.jsx)(je.V,{alignItems:"center",justifyContent:"center",children:(0,n.jsx)(Oe.a,{display:we.O.Block})}):o.length<=1||r?(0,n.jsx)(je.V,{alignItems:"center",justifyContent:"center",children:(0,n.jsx)(ke.r,{children:c("No historical data")})}):(0,n.jsx)(nt.a,{data:o,assetName:i,assetDigits:a})})),at=(0,F._N)([pe,ge],((e,t)=>({activePeriod:e,activePeriodList:t})))(Object.assign(Object.assign({},(0,M.Z6)()),{keySelector:(0,H.Jk)().strategyId()})),ct=(0,r.memo)((e=>{const{id:t,strategyId:s,infoText:o}=e,i=(0,fe.wA)(),{activePeriod:a,activePeriodList:l}=(0,se.d4)(at,{strategyId:s}),d=(0,r.useCallback)((e=>{i(c.updatePeriod({period:e}))}),[i]);return(0,n.jsxs)(je.V,{children:[(0,n.jsxs)(Ie.e,{children:[(0,n.jsx)(Se.F,{period:a,periodList:l,onChange:d}),(0,n.jsx)(st.m,{id:t,children:(0,n.jsx)(it,{strategyId:s})})]}),o&&(0,n.jsx)(Ce.b,{children:o})]})})),lt=(0,r.memo)((e=>{const{id:t,strategyId:s,infoText:r}=e,{fromTimestamp:o,toTimestamp:i}=(0,se.d4)(xe,{strategyId:s}),{viewType:a}=(0,h.U)();return a===p.qi.Mobile?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ee,{strategyId:s,from:o,to:i}),(0,n.jsx)(te.q,{strategyId:s}),(0,n.jsx)(tt,{strategyId:s,infoText:r})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ee,{strategyId:s,from:o,to:i}),(0,n.jsx)(te.q,{strategyId:s}),(0,n.jsx)(ct,{id:t,strategyId:s,infoText:r})]})})),dt=(0,r.memo)((e=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(g,{}),(0,n.jsx)(lt,Object.assign({},e))]})))},3699:(e,t,s)=>{"use strict";s.d(t,{g:()=>D});var n=s(74848),r=s(96540),o=s(81588),i=s(53632),a=s(73245),c=s(95141),l=s(48729),d=s(22679),u=s(65012),g=s(64453);const m=(0,d.K)((()=>({root:Object.assign({height:44,width:"100%",flexGrow:1,flexShrink:0},(0,u.M)(0)),content:Object.assign(Object.assign({justifyContent:"flex-start",color:"unset",lineHeight:"unset"},(0,g.V)(0)),{boxShadow:"none"})})));var h=s(2331),p=s(15041),y=s(39701),x=s(72199),f=s(97176),j=s(58142),b=s(44064),v=s(91069),I=s(70265);const S=(0,x._N)([I.E,(0,f.Hy)(b.b).status(),(0,f.Hy)(b.b).isPortfolio()],((e,t,s)=>{var n;const r=null===(n=e[0])||void 0===n?void 0:n.accountId;return{anotherAccountId:r,isVisible:Boolean(r)&&!(0,v.fn)(t)&&!(0,v.zz)(t),isPortfolio:s}}))(Object.assign(Object.assign({},(0,j.Z6)()),{keySelector:(0,f.Jk)().strategyId()})),C=(0,r.memo)((e=>{const{onClick:t,strategyId:s}=e,{t:o}=(0,a.B)(),i=(0,p.wA)(),{anotherAccountId:d,isVisible:u,isPortfolio:g}=(0,y.d4)(S,{strategyId:s}),{rules:x}=(0,c.X)(m),f=(0,r.useCallback)((()=>{i(h.L.open({accountId:d,strategyId:s})),t()}),[t,d,i,s]);return u?(0,n.jsx)(l.B,{wide:!0,onClick:f,extend:{root:x.root,content:x.content},children:o(g?"Invest with another account":"Start copying with another account")}):null}));var k=s(66694);const O=(0,x._N)([I.E,(0,f.Hy)(b.b).status(),(0,f.Hy)(b.b).isPortfolio()],((e,t,s)=>{var n;const r=null===(n=e[0])||void 0===n?void 0:n.accountId;return{anotherAccountId:r,isVisible:Boolean(r)&&!(0,v.fn)(t)&&!(0,v.zz)(t),isPortfolio:s}}))(Object.assign(Object.assign({},(0,j.Z6)()),{keySelector:(0,f.Jk)().strategyId()})),w=(0,r.memo)((e=>{const{strategyId:t,onClick:s}=e,{t:o}=(0,a.B)(),i=(0,p.wA)(),{anotherAccountId:c,isVisible:l,isPortfolio:d}=(0,y.d4)(O,{strategyId:t}),u=(0,r.useCallback)((()=>{i(h.L.open({accountId:c,strategyId:t})),s()}),[c,t,i,s]);return l?(0,n.jsx)(k.k,{testId:"start-copying-with-another-account",onClick:u,children:o(d?"Invest with another account":"Start copying with another account")}):null}));var T=s(11733);const D=(0,r.memo)((e=>{const{strategyId:t,onClick:s}=e,{viewType:r}=(0,o.U)();return r===i.qi.Mobile?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(T.z,{strategyId:t}),(0,n.jsx)(C,{strategyId:t,onClick:s})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(T.z,{strategyId:t}),(0,n.jsx)(w,{strategyId:t,onClick:s})]})}))},3743:(e,t,s)=>{"use strict";s.d(t,{t:()=>i});var n=s(30981),r=s(70466),o=s(56923);const i={search:"",channel:void 0,tableState:n.Od,period:{kind:r.k.period,period:o.Y.beginOfMonth,fromDate:void 0,toDate:void 0}}},3926:(e,t,s)=>{"use strict";s.d(t,{N:()=>c});var n=s(70466),r=s(30692),o=s(23314);function i(e,t,s){const n=Math.max(e,t);return(0,o.xA)(n,s)}function a(e,t,s,n=!0){const r=Math.min(e,t);return n?(0,o.P9)(r,s):(0,o.ii)(r,s).valueOf()}function c(e){if(function(e){return e.kind===n.k.period}(e)){const{period:t,registrationTimestamp:s,currentTime:n,timeOffset:o,adjustTo:c}=e;return function(e){const{period:t,registrationTimestamp:s,currentTime:n,timeOffset:o,adjustTo:c}=e,{from:l,to:d}=(0,r.u)(t,n,o);return{from:i(l,s,o),to:a(d,n,o,c)}}({period:t,adjustTo:c,registrationTimestamp:s,currentTime:n,timeOffset:o})}if(function(e){return e.kind===n.k.interval}(e)){const{fromTimestamp:t,toTimestamp:s,registrationTimestamp:n,currentTime:r,timeOffset:o,adjustTo:c}=e;return function(e){const{fromTimestamp:t,toTimestamp:s,registrationTimestamp:n,currentTime:r,timeOffset:o,adjustTo:c}=e;return{from:i(t,n,o),to:a(s,r,o,c)}}({fromTimestamp:t,toTimestamp:s,adjustTo:c,registrationTimestamp:n,currentTime:r,timeOffset:o})}}},4021:(e,t,s)=>{"use strict";s.d(t,{c:()=>r,o:()=>n});const n=42,r=29},4151:(e,t,s)=>{"use strict";s.d(t,{P:()=>d});var n,r=s(74848),o=s(96540);function i(e,t,s){return{height:t,position:"absolute",left:0,top:e,width:"100%",visibility:s?"visible":"hidden"}}function a(e,t,s,n){return e.find((e=>e.index===t&&e.itemType===n&&e.isFull===s))}function c(e,t,s){for(let n=0;n<e.length;n++)if(e[n].itemType===t&&e[n].isFull===s)return{index:n,key:e[n]}}!function(e){e.Vertical="Vertical",e.Horizontal="Horizontal"}(n||(n={}));var l=s(25279);const d=(0,o.memo)((e=>{const{orientation:t=n.Vertical,data:s,scrollTop:d,clientHeight:u,getItemHeight:g,fullRowRenderer:m,lightRowRenderer:h,hasLightVersion:p,getItemType:y,overscrollItemsCount:x,idleScrollTimeout:f=300,testId:j}=e,b=function(e,t){return(0,o.useMemo)((()=>{const s=[];for(let n=0;n<e.length;n++){const r=0===n?0:s[n-1].top+s[n-1].height,o=t(e[n]);s.push({top:r,height:o})}return s}),[e,t])}(s,g),v=function(e,t,s){return(0,o.useMemo)((()=>{for(let n=0;n<t.length;n++)if(s[n].top+s[n].height>=e)return n}),[e,t,s])}(d,s,b),I=function(e,t,s,n){return(0,o.useMemo)((()=>{if(void 0===e)return;const r=t+s;for(let t=e;t<n.length;t++)if(n[t].top>r)return t-1;return n.length-1}),[e,t,s,n])}(v,d,u,b),S=function(e){return(0,o.useMemo)((()=>e.length>0?e[e.length-1].top+e[e.length-1].height:0),[e])}(b),C=function(e,t,s,n,r,i){const[a,c]=(0,o.useState)(!0),l=(0,o.useRef)(s),d=Math.abs(l.current-s)>=n;return(0,o.useEffect)((()=>{d&&i&&c(!1),l.current=s}),[d,s,i]),(0,o.useEffect)((()=>{if(i){const s=window.setTimeout((()=>{void 0!==e&&void 0!==t&&c(!0)}),r);return()=>{window.clearTimeout(s)}}}),[e,t,c,i,r]),!i||!d&&a}(v,I,d,u,f,void 0!==h&&void 0!==p),k=function(e,t,s){return(0,o.useMemo)((()=>void 0!==t&&s?void 0!==e?Math.max(0,e-t):void 0:e),[e,t,s])}(v,x,C),O=function(e,t,s,n){return(0,o.useMemo)((()=>void 0!==s&&n?void 0!==e&&0!==t.length?Math.min(t.length-1,e+s):void 0:e),[e,s,t,n])}(I,s,x,C),w=function(e,t,s,n,r,i,d,u){const[g,m]=(0,o.useState)([]),h=(0,o.useMemo)((()=>{if(void 0===e||void 0===t||void 0===s||void 0===n)return[];const o=new Set(g),m=[];for(let e=s;e<=n;e++){const t=null==u?void 0:u(d[e]),s=r||!i(t),n=a(g,e,s,t);void 0!==n?o.delete(n):m.push(e)}const h=[...o];let p=[...g],y=!1;for(const e of m){const t=null==u?void 0:u(d[e]),s=r||!i(t),n=c(h,t,s);if(void 0!==n){h.splice(n.index,1);const t=p.indexOf(n.key);t>-1&&(p[t]=Object.assign(Object.assign({},n.key),{index:e})),y=!0}else{const n=s?"full":"light";p.push({index:e,isFull:s,itemType:t,key:`${n}-${t}-${(0,l.A)()}`}),y=!0}}return void 0!==p.find((e=>e.index>=d.length))&&(p=p.filter((e=>e.index<d.length)),y=!0),y?p:g}),[e,t,s,n,g,r,i,d,u]);return(0,o.useEffect)((()=>{h===g||0===h.length&&0===g.length||m(h)}),[h,g,m]),h}(v,I,k,O,C,p,s,y),T=[];for(const e of w){const t=s[e.index],n=null==y?void 0:y(t),o=C||void 0===p||!p(n),a=e.index>=k&&e.index<=O&&e.itemType===n&&e.isFull===o,c=e.isFull?m:h,{top:l,height:d}=b[e.index],u=c(t,e.index);if(null!==u){if(null==u?void 0:u.key)throw new Error("Key is used in RecyclerListView. Keys kill the idea of recycling.");T.push((0,r.jsx)("div",{"cache-key":e.key,style:i(l,d,a),children:u},e.key))}}const D=(0,o.useMemo)((()=>t===n.Vertical?{height:S,minWidth:1}:{width:S,minHeight:1}),[t,S]);return(0,r.jsx)("div",{style:Object.assign({position:"relative"},D),children:T})}))},4187:(e,t,s)=>{"use strict";s.d(t,{K:()=>i});var n=s(97665),r=s(67632),o=s(3303);function i(e,t){const s=(0,o.E)(t);return Boolean((0,n.B6)(`${s}${r.LR.Portfolios}`,e))}},4265:(e,t,s)=>{"use strict";s.d(t,{q:()=>M});var n,r=s(74848),o=s(96540),i=s(47837),a=s(1767),c=s(63773);!function(e){const t=(0,c.D)("StrategyTransaction");e.subscribe=t("SUBSCRIBE"),e.unsubscribe=t("UNSUBSCRIBE"),e.load=t("LOAD"),e.loadDone=t("LOAD_DONE"),e.add=t("ADD")}(n||(n={}));var l=s(52019),d=s(33270),u=s(98549),g=s(99684),m=s(16010);const h=(0,u.h)(m.R).case(n.load,(e=>{e.networkStatus=g.p.Started})).case(n.loadDone,((e,t)=>{const{transactionList:s}=t;for(const t of s)e.transactions[t.transactionId]=t;e.networkStatus=g.p.Done})).case(n.add,((e,t)=>{const{transaction:s}=t;e.transactions[s.transactionId]=s})),p=(0,s(41233).K)({subscribeAction:n.subscribe,unsubscribeAction:n.unsubscribe}),y=(0,u.h)(m.C).casesWithAction([n.subscribe,n.unsubscribe],((e,t)=>{e.subscribers=p(e.subscribers,t)})).casesWithAction([n.load,n.loadDone,n.add],((e,t)=>{var s;const{strategyId:n}=t.payload;e.data[n]=h(null===(s=e.data)||void 0===s?void 0:s[n],t)}));var x=s(82823),f=s(16126),j=s(81160),b=s(73301),v=s(79005),I=s(11269),S=s(47873),C=s(28452),k=s(76269),O=s(23656),w=s(92963),T=s(72199),D=s(97176),P=s(38471),N=s(52293),L=s(58142);const B=(0,T._N)([N.c],(e=>e))(Object.assign(Object.assign({},(0,L.Z6)()),{keySelector:(0,D.Jk)().strategyId()})),H=(0,T._N)([(0,D.Hy)(P.w).subscribers()],(e=>e.map((e=>({key:{strategyId:e.key},count:e.count})))))(Object.assign(Object.assign({},(0,L.Z6)()),{keySelector:D.eW})),E=(0,w._)(H,B);var A=s(84720);const R=(0,x.H)(((e,t)=>(0,O.g)(t.pipe((0,j.T)(E)),t.pipe((0,j.T)(A.E))).pipe((0,C.Z)((({subscribe:e})=>e.map((e=>n.load({strategyId:e.strategyId}))))))),((e,t,s)=>e.pipe((0,S.l)(n.load),(0,C.Z)((e=>{const{strategyId:t,cursor:r}=e;return s.copy.api.strategyProviderDepositWithdrawHistory({strategyProviderId:v.V.strategyIdToProto(t),cursor:r}).pipe((0,C.Z)((e=>{var s;const{nextCursor:r}=e,o=(null!==(s=e.history)&&void 0!==s?s:[]).map((e=>I.F.fromCopyProto(e))).reverse();return[n.loadDone({strategyId:t,transactionList:o}),...r?[n.load({strategyId:t,cursor:r})]:[]]})),(0,k.f)((t=>(s.logger.error(`[Effect Error]: load strategy transaction list for ${e.strategyId}`,t),[]))))})))),((e,t,s)=>s.copy.api.tradingExecutionEvent$.pipe((0,f.p)((e=>e.eventType===b.hg.DEPOSIT_WITHDRAW&&void 0!==e.strategyProviderId)),(0,j.T)((e=>({strategyId:v.V.strategyIdToDomain(e.strategyProviderId),transaction:I.F.fromCopyProto(e.depositWithdraw)}))),(0,j.T)((e=>n.add({strategyId:e.strategyId,transaction:e.transaction})))))),F=(0,o.memo)((()=>((0,l.n)("strategyTransactions",y),(0,d.S)(R),null))),M=(0,o.memo)((e=>{const{strategyId:t}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.c,{strategyId:t}),(0,r.jsx)(F,{}),(0,r.jsx)(a.x,{param:t,subscribe:n.subscribe,unsubscribe:n.unsubscribe})]})}))},4354:(e,t,s)=>{"use strict";function n(e){return e.reduce(((e,t)=>e*(1+t.roi)),1)-1}s.d(t,{X:()=>n})},4383:(e,t,s)=>{"use strict";s.d(t,{Y:()=>o});var n=s(9729),r=s(1467);function o(e,t){return void 0===e?n.xH:(0,r.k)(e).utcOffset(t).format("DD MMM YYYY")}},4511:(e,t,s)=>{"use strict";s.d(t,{v:()=>b});var n=s(74848),r=s(96540),o=s(38366),i=s(35026),a=s(22679);const c=(0,a.K)((e=>{const{backgroundColor:t}=e.theme.palette.semantic;return{root:{display:"flex",borderRight:`1px solid ${t.strokeNormal}`,flexGrow:1,flexBasis:0,paddingLeft:2*i.YK,paddingRight:2*i.YK,nested:{":last-child":{borderRight:"none",paddingRight:0},":first-child":{paddingLeft:0}}},value:{whiteSpace:"nowrap"}}}));var l=s(95141),d=s(24985),u=s(96159),g=s(76639);const m=(0,r.memo)((e=>{const{label:t,tooltip:s,children:r,testId:i}=e,{css:a}=(0,l.X)(c);return(0,n.jsxs)("div",{className:a.root,children:[(0,n.jsx)(d.X,{textColor:u.r.Secondary,children:(0,n.jsxs)(o.x,{children:[t,s]})}),(0,n.jsx)(g.X,{}),(0,n.jsx)("div",{className:a.value,children:r})]})}));var h=s(8819),p=s(96412),y=s(65012),x=s(20499);const f=(0,a.K)((e=>{const{backgroundColor:t,foregroundColor:s}=e.theme.palette.semantic;return{root:{borderRight:`1px solid ${t.strokeNormal}`,paddingLeft:2*i.YK,paddingRight:2*i.YK,flexGrow:1,flexBasis:0,nested:{":last-child":{borderRight:"none",paddingRight:0},":first-child":{paddingLeft:0}}},label:{display:"flex",alignItems:"center",justifyContent:"center",paddingBottom:i.YK,borderBottom:`1px solid ${s.tertiary}`},text:Object.assign(Object.assign(Object.assign({color:s.secondary},(0,y.M)(3)),{marginRight:5}),x.EJ),value:{position:"relative",display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column",marginLeft:3,marginRight:3,paddingTop:3,whiteSpace:"nowrap"}}})),j=(0,r.memo)((e=>{const{label:t,tooltip:s,children:r,testId:o}=e,{css:i}=(0,l.X)(f);return(0,n.jsxs)("div",{className:i.root,children:[(0,n.jsxs)("div",{className:i.label,children:[(0,n.jsx)("div",{className:i.text,children:t}),(0,n.jsx)(h.V,{source:p.JQ.Info,placement:"top",children:s})]}),(0,n.jsx)("div",{className:i.value,children:r})]})})),b=(0,r.memo)((e=>{const{label:t,tooltip:s,expanded:r,children:o,testId:i}=e;return r?(0,n.jsx)(j,{label:t,tooltip:s,testId:i,children:o}):(0,n.jsx)(m,{label:t,tooltip:s,testId:i,children:o})}))},4623:(e,t,s)=>{"use strict";s.d(t,{n:()=>o});var n=s(97176),r=s(13378);const o=(0,n.vY)((e=>e.portfolioFilter),r.SS)},4786:(e,t,s)=>{"use strict";s.d(t,{D:()=>n});var n,r=s(63773);!function(e){const t=(0,r.D)("AccountPosition");e.load=t("LOAD"),e.subscribe=t("SUBSCRIBE"),e.unsubscribe=t("UNSUBSCRIBE"),e.intervalSubscribe=t("INTERVAL_SUBSCRIBE"),e.intervalUnsubscribe=t("INTERVAL_UNSUBSCRIBE"),e.loadDone=t("LOAD_DONE"),e.loadFailed=t("LOAD_FAILED"),e.update=t("UPDATE")}(n||(n={}))},5353:(e,t,s)=>{"use strict";s.d(t,{n:()=>r});var n=s(15192);function r(e){return e.reduce(((e,t)=>{var s,n,r,o;return{commission:e.commission.add(null!==(s=t.commission)&&void 0!==s?s:0),swap:e.swap.add(null!==(n=t.swap)&&void 0!==n?n:0),totalProfit:e.totalProfit.add(null!==(r=t.profit)&&void 0!==r?r:0),mirroringCommission:e.mirroringCommission.add(null!==(o=t.mirroringCommission)&&void 0!==o?o:0)}}),{commission:new n.A(0),swap:new n.A(0),totalProfit:new n.A(0),mirroringCommission:new n.A(0)})}},5409:(e,t,s)=>{"use strict";s.d(t,{i:()=>we});var n=s(74848),r=s(30692),o=s(96540),i=s(44419),a=s(72199),c=s(97176),l=s(58142),d=s(42245),u=s(27790);const g=(0,a._N)([(0,c.Hy)(d.y).filter.period(),i.E,u.P],((e,t,s)=>({period:e,currentTime:t,timeOffset:s})))(Object.assign(Object.assign({},(0,l.Z6)()),{keySelector:c.eW}));var m=s(15622),h=s(69427),p=s(39701),y=s(395),x=s(44468),f=s(99684),j=s(52293),b=s(44064),v=s(91069),I=s(67025),S=s(3926),C=s(70466);const k=(0,a._N)([(0,c.Hy)(d.y).filter.period(),(0,c.Hy)(b.b).traderRegistrationTimestamp(),i.E,u.P],((e,t,s,n)=>(0,S.N)({kind:C.k.period,period:e,registrationTimestamp:t,currentTime:s,timeOffset:n})))(Object.assign(Object.assign({},(0,l.Z6)()),{keySelector:(0,c.Jk)().strategyId()}));var O=s(23314);const w=(0,a._N)([I.j,k,u.P],((e,t,s)=>e.filter((e=>e.timestamp>=(0,O.xA)(t.from,s)&&e.timestamp<=(0,O.P9)(t.to,s)))))(Object.assign(Object.assign({},(0,l.Z6)()),{keySelector:(0,c.Jk)().strategyId()}));var T=s(70312);const D=(0,a._N)([w],(e=>(0,T.c)(e)))(Object.assign(Object.assign({},(0,l.Z6)()),{keySelector:(0,c.Jk)().strategyId()}));var P=s(77679),N=s(50322);const L=(0,a._N)([D,(0,c.Hy)(b.b).traderRegistrationTimestamp(),(0,c.Hy)(b.b).status(),i.E,u.P],((e,t,s,n,r)=>0===e.length&&(0,v.fn)(s)?[(0,P.e)(n-1),(0,P.e)(n)]:(0,N.N)(e,t,n,r)))(Object.assign(Object.assign({},(0,l.Z6)()),{keySelector:(0,c.Jk)().strategyId()})),B=(0,a._N)([j.c,(0,c.Hy)(x.f).networkStatus(),L,(0,c.Hy)(b.b).periodRoi([]),(0,c.Hy)(d.y).filter.period()],((e,t,s,n,r)=>{const o=n.find((e=>e.period===r));return{isLoading:e&&t!==f.p.Done&&t!==f.p.Failed,data:s,period:r,roi:null==o?void 0:o.roi}}))(Object.assign(Object.assign({},(0,l.Z6)()),{keySelector:(0,c.Jk)().strategyId()}));var H=s(16929);const E=(0,o.createContext)(null),A=()=>(0,o.useContext)(E);var R=s(91200),F=s(39235),M=s(68184),_=s(87245),W=s(48968);const K=(0,o.memo)((e=>{const{children:t}=e,{data:s}=A(),{width:r}=(0,R.W)(),[i,a]=(0,H.d)(s,(e=>e.timestamp)),c=(0,o.useMemo)((()=>(0,F.m)().domain([i,a]).range([0,r])),[i,a,r]),l=(0,M.G)({transform:c,range:[0,r]}),[,d]=l;return(0,o.useLayoutEffect)((()=>{d(_.x.setRange([0,r]))}),[r,d]),(0,n.jsx)(W.i,{value:l,children:t})}));var Y=s(71035),V=s(38936);const Z=(0,o.memo)((e=>{const{children:t}=e,s=(0,Y.V)();return(0,n.jsx)(V.V,{value:s,children:t})}));var U=s(35026);const J=(0,o.memo)((e=>{const{children:t}=e,{data:s}=A(),{height:r}=(0,R.W)(),[i,a]=(0,H.d)(s,(e=>e.roi)),c=(0,o.useMemo)((()=>(0,F.m)().domain([i,a]).range([r-U.YK,U.YK])),[i,a,r]),l=(0,M.G)({transform:c,range:[0,r]}),[,d]=l;return(0,o.useLayoutEffect)((()=>{d(_.x.setRange([0,r]))}),[r,d]),(0,n.jsx)(W.J,{value:l,children:t})})),X=(0,o.memo)((e=>{const{data:t,children:s}=e,r=(0,o.useMemo)((()=>({data:t})),[t]);return(0,n.jsx)(E,{value:r,children:s})})),$=(0,o.createContext)(null),q=(0,o.memo)((e=>{const{roi:t,availablePeriods:s,period:r,children:i}=e,a=(0,o.useMemo)((()=>({roi:t,availablePeriods:s,period:r})),[t,s,r]);return(0,n.jsx)($,{value:a,children:i})}));var Q=s(88230),z=s(25155),G=s(6627),ee=s(88498),te=s(83906),se=s(65411),ne=s(18929);const re=(0,o.memo)((()=>{const{data:e}=A(),[t]=(0,te.E)(),[s]=(0,se.X)(),[r,i]=(0,H.d)(e,(e=>e.roi)),a=(0,o.useMemo)((()=>e.length?[...e.map((e=>({x:t(e.timestamp),y:s(e.roi)}))),{x:t(e[e.length-1].timestamp)+6*U.YK,y:s(r)+2*U.YK},{x:t(e[0].timestamp)-6*U.YK,y:s(r)+2*U.YK},{x:t(e[0].timestamp)-6*U.YK,y:2*s(e[0].roi)}]:[]),[e,r,t,s]),{roiStroke:c,roiGradient:l}=(0,ee.R)(),d=(0,G.T)(l,.2),u=(0,G.T)(d,.2),g=(0,G.T)(u,0);return(0,n.jsx)(ne.H,{dataList:a,stroke:c,strokeWidth:2,startPoint:s(i),endPoint:s(r),stops:[{point:0,color:d},{point:.7,color:u},{point:1,color:g}]})}));var oe=s(87240),ie=s(33451);const ae=e=>{const{width:t,height:s,grid:r,gridOpacity:o,yGridStep:i,xGridStep:a}=e;let c=a,l=i;const d=[];if(a)for(;c<t;)d.push((0,n.jsx)(ie.N,{dataList:[{x:c,y:0},{x:c,y:s}],stroke:r,opacity:o},`x${c}`)),c+=a;if(i)for(;l<t;)d.push((0,n.jsx)(ie.N,{dataList:[{x:0,y:l},{x:t,y:l}],stroke:r,opacity:o},`y${l}`)),l+=i;return d},ce=(0,o.memo)((()=>{const{width:e,height:t}=(0,R.W)(),{grid:s,gridOpacity:r}=(0,ee.R)(),o=ae({width:e,height:t,grid:s,gridOpacity:r,xGridStep:32,yGridStep:32});return(0,n.jsx)(n.Fragment,{children:o})})),le=(0,o.memo)((()=>{const{width:e,height:t}=(0,R.W)(),{grid:s,gridOpacity:r}=(0,ee.R)(),o=ae({width:e,height:t,grid:s,gridOpacity:r,yGridStep:25,xGridStep:0});return(0,n.jsx)(n.Fragment,{children:o})}));var de=s(81588),ue=s(53632);const ge=(0,o.memo)((()=>{const{viewType:e}=(0,de.U)();return e===ue.qi.Mobile?(0,n.jsx)(le,{}):(0,n.jsx)(ce,{})}));var me=s(80124),he=s(99196),pe=s(16575),ye=s(19231),xe=s(95530),fe=s(89684),je=s(63568),be=s(22085),ve=s(62517);const Ie=(0,o.memo)((()=>{const{availablePeriods:e,period:t,roi:s}=(0,o.useContext)($),{theme:r}=(0,me.D)(),{foregroundColor:i}=r.palette.semantic,{chart:a}=r.font.semantic,c=(0,he.H)(),{foreground:l,background:d}=(0,ee.R)(),u=(0,pe.O)({fontSize:a.primary,fontFamily:c}),g=(0,je.X)(),m=(0,o.useMemo)((()=>(0,ve.v)(e,t)),[e,t]),[h,p,y]=(0,o.useMemo)((()=>{const e=g(m),t=(0,be.l)({forceSign:!0})(s),[n,r]=u(e),[o,a]=u(t),c=Math.max(r,a),l=(c-r)/2+U.YK,d=n+o+3*U.YK,h=c+2*U.YK;return[{x:U.YK,y:U.YK+5,width:d,height:h},{x:U.YK,y:l,width:n,text:e},{x:n+2*U.YK,y:l,width:o,text:t,fill:s>=0?i.positive:i.negative}]}),[s,i,u,m,g]);return(0,n.jsxs)(ye.Y,{x:h.x,y:h.y,children:[(0,n.jsx)(xe.M,{x:0,y:0,width:h.width,height:h.height,radius:U.r8,fill:d}),(0,n.jsx)(fe.E,{text:p.text,x:p.x,y:p.y,fill:l,fontSize:a.primary,fontFamily:c}),(0,n.jsx)(fe.E,{text:y.text,x:y.x,y:y.y,fill:y.fill,fontSize:a.primary,fontFamily:c})]})}));var Se=s(75398);const Ce=(0,o.memo)((()=>(0,n.jsx)(Se.f,{children:(0,n.jsxs)(oe.W,{children:[(0,n.jsx)(ge,{}),(0,n.jsx)(re,{}),(0,n.jsx)(Ie,{})]})}))),ke=(0,o.memo)((e=>{const{data:t,roi:s,availablePeriods:r,period:o}=e;return(0,n.jsx)(z.P,{children:(0,n.jsx)(Q.O,{children:(0,n.jsx)(X,{data:t,children:(0,n.jsx)(q,{roi:s,availablePeriods:r,period:o,children:(0,n.jsx)(Z,{children:(0,n.jsx)(K,{children:(0,n.jsx)(J,{children:(0,n.jsx)(Ce,{})})})})})})})})})),Oe=(0,o.memo)((e=>{const{strategyId:t}=e,{isLoading:s,period:r,data:i,roi:a}=(0,p.d4)(B,{strategyId:t}),c=(0,o.useMemo)((()=>[{period:r}]),[r]);return s?(0,n.jsx)(y.a,{}):(0,n.jsx)(ke,{data:i,roi:a,period:r,availablePeriods:c})})),we=(0,o.memo)((e=>{const{strategyId:t}=e,{period:s,currentTime:o,timeOffset:i}=(0,p.d4)(g,{strategyId:t}),{from:a}=(0,r.u)(s,o,i);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(m.U,{strategyId:t,from:a,to:o}),(0,n.jsx)(h.e,{children:(0,n.jsx)(Oe,{strategyId:t})})]})}))},5509:(e,t,s)=>{"use strict";s.d(t,{X:()=>o});var n=s(32923),r=s(5938);const o=e=>{switch(e){case r.K.StartCopying:case r.K.RestartCopying:return{width:500,minHeight:420};case r.K.AddFunds:return{width:385,minHeight:250};default:return(0,n.T)(e)}}},5756:(e,t,s)=>{"use strict";s.d(t,{Bz:()=>E,EN:()=>y,Ex:()=>P,Fw:()=>w,I3:()=>m,IB:()=>N,If:()=>I,J6:()=>h,KD:()=>u,NQ:()=>a,Pk:()=>n,QV:()=>B,QW:()=>r,Sb:()=>C,V6:()=>i,WS:()=>p,Wt:()=>f,Zf:()=>k,_7:()=>T,ag:()=>b,bB:()=>c,cN:()=>x,d3:()=>H,jH:()=>D,jX:()=>g,kc:()=>O,nP:()=>d,oW:()=>L,pP:()=>l,qc:()=>o,rs:()=>S,vR:()=>v,yv:()=>j});const n=e=>e.id,r=e=>e.isLoading,o=e=>e.dataKeys,i=e=>e.columns,a=e=>e.rowFormat,c=e=>e.containerWidth,l=e=>e.isResizing,d=e=>e.rowHeight,u=e=>e.onRowClick,g=e=>e.onRowDoubleClick,m=e=>e.onRowEnter,h=e=>e.onRowLeave,p=e=>e.search,y=e=>e.groupBy,x=e=>e.isInitialized,f=e=>e.isScrollPresent,j=e=>e.BodyContextMenu,b=e=>e.RowContextMenu,v=e=>e.AggregatedContextMenu,I=e=>e.isOrderingDisabled,S=e=>e.isResizingDisabled,C=e=>e.isSortingDisabled,k=e=>e.isHidingDisabled,O=e=>e.isHoveringDisabled,w=e=>e.isScrollDisabled,T=e=>e.Head,D=e=>e.Header,P=e=>e.Resizer,N=e=>e.Body,L=e=>e.Row,B=e=>e.Cell,H=e=>e.Expander,E=e=>e.body.collapsed},5846:(e,t,s)=>{"use strict";s.d(t,{J:()=>l});var n=s(74848),r=s(96540),o=s(1767),i=s(23449),a=s(39987),c=s(87621);const l=(0,r.memo)((()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(c.q,{}),(0,n.jsx)(o.x,{param:a.w4,subscribe:i.z.subscribe,unsubscribe:i.z.unsubscribe})]})))},5938:(e,t,s)=>{"use strict";var n;s.d(t,{K:()=>n}),function(e){e.StartCopying="StartCopying",e.RestartCopying="RestartCopying",e.AddFunds="AddFunds"}(n||(n={}))},6008:(e,t,s)=>{"use strict";s.d(t,{Z:()=>c});var n=s(58142),r=s(72199),o=s(97176),i=s(58085),a=s(44064);const c=(0,r._N)([i.i,(0,o.Hy)(a.b).brokerNameBlackList([])],((e,t)=>e.length>0&&e.every((e=>t.includes(e)))))(Object.assign(Object.assign({},(0,n.Z6)()),{keySelector:(0,o.Jk)().strategyId()}))},6156:(e,t,s)=>{"use strict";s.d(t,{I:()=>o});var n=s(97176),r=s(66869);const o=(0,n.vY)((e=>e.strategyInitialBalance),r.nB)},6630:(e,t,s)=>{"use strict";s.d(t,{I:()=>a});var n=s(74848),r=s(96540),o=s(73245),i=s(4511);const a=(0,r.memo)((e=>{const{expanded:t,children:s}=e,{t:r}=(0,o.B)(),a=`${r("Unr. gross P&L")}:`,c=r("Current profit and loss for all open positions, not including deducted or added expenses (swaps, commissions, etc.)");return(0,n.jsx)(i.v,{label:a,tooltip:c,expanded:t,testId:"gross-profit",children:s})}))},6823:(e,t,s)=>{"use strict";s.d(t,{b:()=>c});var n=s(58142),r=s(72199),o=s(97176),i=s(91855),a=s(15192);const c=(0,r._N)([(0,o.Hy)(i.j).deals()],(e=>Object.values(e).map((e=>Object.assign(Object.assign({},e),{closePositionDetail:e.closePositionDetail?Object.assign(Object.assign({},e.closePositionDetail),{profit:new a.A(e.closePositionDetail.profit),netProfit:new a.A(e.closePositionDetail.netProfit),balance:new a.A(e.closePositionDetail.balance),commission:new a.A(e.closePositionDetail.commission),swap:new a.A(e.closePositionDetail.swap),mirroringCommission:new a.A(e.closePositionDetail.mirroringCommission),introducingBrokerCommission:new a.A(e.closePositionDetail.introducingBrokerCommission),pnlConversionFee:new a.A(e.closePositionDetail.pnlConversionFee)}):void 0})))))(Object.assign(Object.assign({},(0,n.Z6)()),{keySelector:(0,o.Jk)().accountId()}))},6929:(e,t,s)=>{"use strict";s.d(t,{s:()=>n});const n=(e,t,s={})=>{const{leading:n=!1,trailing:r=!0}=s;let o,i;if(!n&&!r)return Object.assign((()=>{}),{cancel:()=>{}});const a=()=>{o&&(void 0!==t?window.clearTimeout(o):window.cancelAnimationFrame(o),o=void 0)};return Object.assign(((...s)=>{!o&&n?e(...s):i=s,a(),o=void 0!==t?window.setTimeout((()=>{r&&i&&e(...s),i=void 0,o=void 0}),t):window.requestAnimationFrame((()=>{r&&i&&e(...s),i=void 0,o=void 0}))}),{cancel:a})}},6973:(e,t,s)=>{"use strict";s.d(t,{W:()=>c});var n=s(74848),r=s(96540),o=s(35026);const i=(0,s(22679).K)((()=>({root:{flexGrow:1,display:"flex",paddingLeft:5*o.YK,whiteSpace:"nowrap"},text:{overflow:"hidden",textOverflow:"ellipsis"}})));var a=s(95141);const c=(0,r.memo)((e=>{const{children:t,onClick:s,extend:r}=e,{css:o}=(0,a.X)(i,{extend:r});return(0,n.jsx)("div",{className:o.root,onClick:s,children:(0,n.jsx)("div",{className:o.text,children:t})})}))},6982:(e,t,s)=>{"use strict";s.d(t,{$:()=>o});var n=s(96540),r=s(77956);const o=(e,t)=>{const{data:s}=(0,r.K)();return(0,n.useMemo)((()=>{const n=s.find((t=>t.roi===e)),r=s.find((e=>e.roi===t));return{minBadgeTimestamp:null==n?void 0:n.timestamp,maxBadgeTimestamp:null==r?void 0:r.timestamp}}),[s,e,t])}},7556:(e,t,s)=>{"use strict";s.d(t,{S:()=>m});var n=s(74848),r=s(96540),o=s(12181),i=s(39701),a=s(9729),c=s(72199),l=s(97176),d=s(58142),u=s(92191);const g=(0,c._N)([(0,l.Hy)(u.E).environment(),(0,l.Hy)(u.E).depositCurrency()],((e,t)=>({accountEnvironment:e,accountDepositCurrency:t})))(Object.assign(Object.assign({},(0,d.Z6)()),{keySelector:(0,l.xd)((0,l.Jk)().accountId())})),m=(0,r.memo)((e=>{const{accountId:t}=e,{accountDepositCurrency:s,accountEnvironment:r}=(0,i.d4)(g,{accountId:t});return(0,n.jsx)(o.c,{accountId:t,environment:r,fromAssetName:a.B3,toAssetName:s})}))},7581:(e,t,s)=>{"use strict";s.d(t,{p:()=>y});var n=s(74848),r=s(96540),o=s(95141),i=s(89491),a=s(22679);const c=(0,a.K)((e=>{const{maxWidth:t,minWidth:s,border:n,pointerEvents:r="auto",transparent:o}=e,{tooltip:a}=e.theme.palette.semantic;return{popper:Object.assign(Object.assign(Object.assign({},(0,i.b)({style:a,transparent:o})),{pointerEvents:r,maxWidth:null!=t?t:"none",minWidth:null!=s?s:"auto"}),n?{borderStyle:"solid",borderWidth:1,borderColor:a.borderColor}:{})}})),l=(0,a.K)((()=>({popper:{}})));var d=s(91999),u=s(3961),g=s(19231),m=s(48959);const h=(0,r.memo)((e=>{const{children:t,enterDelay:s=200,leaveDelay:i=50,open:a,onOpen:c,onClose:h,placement:p,placementByCursor:y,point:x,offset:f,isPanelScrollEnabled:j,maxPanelHeight:b,extend:v}=e,I=(0,r.useRef)({x:0,y:0}),[S,C]=(0,d.M)(),[k,O]=(0,d.M)(),[w,T]=(0,u.q)({value:a,defaultValue:!1}),D=(0,r.useCallback)((()=>{null==c||c(),T(!0)}),[c,T]),P=(0,r.useCallback)((()=>{null==h||h(),T(!1)}),[h,T]),N=(0,r.useCallback)((()=>{C(),O(),s?S(D,s):D()}),[C,O,S,D,s]),L=(0,r.useCallback)((()=>{C(),O(),k(P,i)}),[C,O,k,P,i]),B=(0,r.useCallback)((e=>{I.current={x:e.evt.clientX,y:e.evt.clientY},N()}),[N]),H=(0,r.useCallback)((()=>{N()}),[N]),E=(0,r.useCallback)((()=>{L()}),[L]),A=(0,r.useCallback)((e=>{I.current={x:e.evt.clientX,y:e.evt.clientY}}),[I]),{rules:R}=(0,o.X)(l,{extend:v}),[F,M]=t,_=(0,r.useMemo)((()=>y?{getBoundingClientRect:()=>({x:I.current.x,y:I.current.y,top:I.current.y,bottom:I.current.y,left:I.current.x,right:I.current.x,width:0,height:0,toJSON:()=>{}})}:{getBoundingClientRect:()=>({x:x.x,y:x.y,top:x.y,bottom:x.y,left:x.x,right:x.x,width:0,height:0,toJSON:()=>{}})}),[y,I,x]);return(0,n.jsxs)(g.Y,{onMouseOver:B,onMouseLeave:E,onMouseMove:A,children:[F,w&&(0,n.jsx)(m.w,{targetElement:_,placement:p,offset:f,isScrollEnabled:j,maxHeight:b,extend:{root:R.popper},children:(0,n.jsx)("div",{onMouseOver:H,onMouseLeave:E,children:M})})]})}));var p=s(35026);const y=(0,r.memo)((e=>{const{children:t,open:s,onOpen:r,onClose:i,placement:a,placementByCursor:l,point:d,maxWidth:u,minWidth:g,border:m,offsetX:y=0,offsetY:x=p.YK,isTooltipScrollEnabled:f,maxTooltipHeight:j,pointerEvents:b,transparent:v}=e,{rules:I}=(0,o.X)(c,{placement:a,maxWidth:u,minWidth:g,border:m,pointerEvents:b,transparent:v});return(0,n.jsx)(h,{open:s,onOpen:r,onClose:i,placement:a,placementByCursor:l,isPanelScrollEnabled:f,maxPanelHeight:j,point:d,offset:[y,x],extend:{popper:I.popper},children:t})}))},7875:(e,t,s)=>{"use strict";s.d(t,{h:()=>u});var n=s(97176),r=s(58142),o=s(72199),i=s(44064),a=s(6974);const c=(0,o._N)([(0,n.Hy)(i.b).positionShowing()],(e=>e===a.Yw.Everyone))(Object.assign(Object.assign({},(0,r.Z6)()),{keySelector:(0,n.Jk)().strategyId()}));var l=s(28892),d=s(57520);const u=(0,n.T_)((0,n.Hy)(d.p).strategy.isStrategyDisplayingForEveryone(),r.CO).chain((e=>e?c:l.c)).build()},7953:(e,t,s)=>{"use strict";s.d(t,{w:()=>a});var n=s(97176),r=s(58142),o=s(74408),i=s(7875);const a=(0,n.T_)((0,n.Hy)(o.Y).strategyId(),r.CO).chain((e=>(0,r.$s)(i.h,{strategyId:e}))).build()},8219:(e,t,s)=>{"use strict";s.d(t,{_:()=>u});var n=s(74848),r=s(96540),o=s(35026),i=s(65501),a=s(64453),c=s(65012);const l=(0,s(22679).K)((e=>{const{disabled:t,isSelected:s}=e,{backgroundColor:n,foregroundColor:r}=e.theme.palette.semantic;return{root:Object.assign(Object.assign(Object.assign(Object.assign({position:"relative",display:"flex",justifyContent:"space-between",alignItems:"center"},(0,i.T)({color:s?n.menuHover:"initial"})),(0,a.V)(o.r8)),(0,c.M)(o.YK,7)),{marginBottom:o.YK,whiteSpace:"nowrap",fill:t?r.muted1:r.primary2,color:t?r.muted1:r.primary2,boxSizing:"content-box",cursor:t||s?void 0:"pointer",nested:{"> a":{cursor:"default",color:r.primary2,textDecoration:"none",flexGrow:1},":hover":Object.assign(Object.assign({},(0,i.T)({color:n.menuHover})),{fill:t?r.muted1:r.primary2}),":last-child":{marginBottom:0}}})}}));var d=s(95141);const u=(0,r.memo)((e=>{const{disabled:t,isSelected:s,onClick:o,children:i,extend:a,testId:c}=e,{css:u}=(0,d.X)(l,{disabled:t,isSelected:s,extend:a}),g=(0,r.useCallback)((()=>{t||o()}),[t,o]);return(0,n.jsx)("div",{className:u.root,onClick:g,children:i})}))},8437:(e,t,s)=>{"use strict";var n;s.d(t,{N:()=>n}),function(e){e[e.POSITION_STATUS_OPEN=1]="POSITION_STATUS_OPEN",e[e.POSITION_STATUS_CLOSED=2]="POSITION_STATUS_CLOSED",e[e.POSITION_STATUS_CREATED=3]="POSITION_STATUS_CREATED",e[e.POSITION_STATUS_ERROR=4]="POSITION_STATUS_ERROR",e[e.POSITION_STATUS_DECLINED=5]="POSITION_STATUS_DECLINED",e[e.POSITION_STATUS_PENDING_CLOSED=6]="POSITION_STATUS_PENDING_CLOSED",e[e.POSITION_STATUS_FINAL_ERROR=7]="POSITION_STATUS_FINAL_ERROR"}(n||(n={}))},8539:(e,t,s)=>{"use strict";s.d(t,{R:()=>u});var n=s(20919),r=s(6158),o=s(42692),i=s(83361),a=s(9729),c=s(8201),l=s(22085),d=s(46529);function u(e){const t=(0,i.y)(e);if(void 0!==t)return t;if((0,o.o)(e.toString())>a.nH)return(0,n.L)("Maximum of {0} digits after the decimal point",a.nH);const s=(0,c.d)(e);return s<d.CX?(0,n.L)("Performance fee should be higher than or equal to {0}",(0,l.l)()((0,r.g)(d.CX))):s>d.AR?(0,n.L)("Performance fee should be lower than or equal to {0}",(0,l.l)()((0,r.g)(d.AR))):void 0}},9251:(e,t,s)=>{"use strict";s.d(t,{r:()=>ge});var n=s(74848),r=s(70174),o=s(15864),i=s(96540),a=s(35026),c=s(17313),l=s(76728),d=s(65012),u=s(65501),g=s(64453),m=s(22679);const h=(0,m.K)((e=>{const{backgroundColor:t,foregroundColor:s}=e.theme.palette.semantic,n=(0,c.WB)(24,12,l.bO.UP,t.secondaryNormal);return{popper:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({overflow:"visible",display:"flex"},(0,d.M)(a.YK)),(0,u.T)({color:t.secondaryNormal})),{color:s.primary2,boxShadow:"0 0 30px black"}),(0,g.V)(a.r8)),{nested:{":after":Object.assign({position:"absolute",top:-12,left:76},n)}})}}));var p=s(15041),y=s(39701);const x=(0,m.K)((()=>({root:{},list:Object.assign({},(0,d.M)(a.YK))})));var f=s(9779),j=s(44320),b=s(24985),v=s(96159),I=s(86241),S=s(95141),C=s(73245),k=s(53632);const O=(0,i.memo)((e=>{const{strategyIds:t,hidePopup:s}=e,{t:r}=(0,C.B)(),{css:a}=(0,S.X)(x),c=(0,i.useCallback)((e=>{const t=e?void 0!==(s=e)?s.replace(/@.*/,"..."):void 0:r("n/a");var s;return(0,n.jsxs)(f.f,{marginBottom:0,children:[(0,n.jsx)(j.f,{flexBasis:"50%",children:(0,n.jsx)(b.X,{textColor:v.r.Secondary,children:(0,n.jsx)(o.S,{children:r("Strategy provider")})})}),(0,n.jsx)(j.f,{justifyContent:"flex-end",children:(0,n.jsx)(o.S,{children:t})})]})}),[r]);return(0,n.jsx)("div",{className:a.root,children:(0,n.jsx)("div",{className:a.list,children:t.map((e=>(0,n.jsx)(I.P,{viewType:k.qi.Stationary,strategyId:e,renderItemInfo:c,hidePopup:s,isLight:!0},e)))})})}));var w=s(72199),T=s(97176),D=s(58142),P=s(84795),N=s(1484),L=s(99684),B=s(57520);const H=(0,w._N)([P.i,(0,T.Hy)(N.z).networkStatus(),(0,T.Hy)(B.p).strategy.providerPopup.showStrategyList()],((e,t,s)=>({strategyIds:e,isLoading:t!==L.p.Done,isProviderStrategyListShown:s})))(Object.assign(Object.assign({},(0,D.Z6)()),{keySelector:(0,T.Jk)().profileName()}));var E=s(20943);const A=(0,m.K)((e=>{const{hasStrategies:t}=e,{backgroundColor:s}=e.theme.palette.semantic;return{root:{width:900,display:"flex",flexDirection:"column"},scrollRoot:Object.assign(Object.assign({},(0,d.M)(0)),{flexGrow:1}),scrollContent:Object.assign({flexGrow:1,display:"flex",flexDirection:"column"},(0,u.T)({color:s.primaryNormal})),scrollView:t?{}:{display:"flex",flexDirection:"column",nested:{"> div":{display:"flex",flex:1,flexDirection:"column"}}},noStrategies:{display:"flex",flexGrow:1,justifyContent:"center",alignItems:"center",height:140},panel:Object.assign({},(0,E.L)(0,4,a.YK,a.YK))}}));var R=s(27527),F=s(64120),M=s(32700),_=s(32625),W=s(80681),K=s(44064),Y=s(99724),V=s(22612);const Z=(0,w._N)([(0,T.Hy)(K.b).mirroringFundsInUsd(),Y.N,(0,T.Hy)(K.b).utcCreateTimestamp(),(0,T.Hy)(V.k).statistic.activeLiveFollowersCount(0)],((e,t,s,n)=>({mirroringFundsInUsd:e,allTimeRoi:t,utcCreateTimestamp:s,activeLiveFollowersCount:n})))(Object.assign(Object.assign({},(0,D.Z6)()),{keySelector:(0,T.Jk)().strategyId()})),U=(0,T.T_)(P.i,D.CO).chain((e=>(0,T.bk)(e.map((e=>(0,D.$s)(Z,{strategyId:e}))))(Object.assign(Object.assign({},(0,D.Z6)()),{keySelector:T.eW})))).build(),J=(0,w._N)([U,(0,T.Hy)(W.j).serverTime()],((e,t)=>Math.min(...e.map((e=>e.utcCreateTimestamp)),t)))(Object.assign(Object.assign({},(0,D.Z6)()),{keySelector:(0,T.Jk)().profileName()})),X=(0,T.T_)(P.i,D.CO).chain((e=>(0,T.bk)(e.map((e=>(0,D.$s)((0,T.Hy)(V.k).statistic(),{strategyId:e}))))(Object.assign(Object.assign({},(0,D.Z6)()),{keySelector:T.eW})))).build(),$=(0,w._N)([X],(e=>e.reduce(((e,t)=>({currentTraders:e.currentTraders+t.activeDemoFollowersCount+t.activeLiveFollowersCount,allTimeCopiers:e.allTimeCopiers+t.allTimeActiveFollowersCount})),{currentTraders:0,allTimeCopiers:0})))(Object.assign(Object.assign({},(0,D.Z6)()),{keySelector:(0,T.Jk)().profileName()})),q=(0,w._N)([U],(e=>e.reduce(((e,t)=>({totalMirroringFundsInUsd:e.totalMirroringFundsInUsd+t.mirroringFundsInUsd,totalAllTimeRoi:e.totalAllTimeRoi+t.allTimeRoi,totalActiveLiveFollowersCount:e.totalActiveLiveFollowersCount+t.activeLiveFollowersCount})),{totalMirroringFundsInUsd:0,totalAllTimeRoi:0,totalActiveLiveFollowersCount:0})))(Object.assign(Object.assign({},(0,D.Z6)()),{keySelector:(0,T.Jk)().profileName()}));var Q=s(27790);const z=(0,w._N)([$,q,J,P.i,Q.P],((e,t,s,n,r)=>{const{allTimeCopiers:o,currentTraders:i}=e,{totalAllTimeRoi:a,totalMirroringFundsInUsd:c,totalActiveLiveFollowersCount:l}=t;return{allTimeCopiers:o,currentTraders:i,totalMirroringFundsInUsd:c,totalActiveLiveFollowersCount:l,averageAllTimeRoi:a/n.length,activeSince:(0,_.k)(s,r)}}))(Object.assign(Object.assign({},(0,D.Z6)()),{keySelector:(0,T.Jk)().profileName()})),G=(0,m.K)((()=>({root:{width:"100%"}})));var ee=s(41280),te=s(7089),se=s(47577),ne=s(5860),re=s(22085),oe=s(50296),ie=s(47197);const ae=(0,i.memo)((e=>{const{profileName:t,hidePopup:s}=e,{totalMirroringFundsInUsd:r,activeSince:i,averageAllTimeRoi:c,currentTraders:l,allTimeCopiers:d,totalActiveLiveFollowersCount:u}=(0,y.d4)(z,{profileName:t}),{t:g}=(0,C.B)(),{css:m}=(0,S.X)(G),h=void 0!==l?l.toString():"0",p=void 0!==d?d.toString():"0",x=void 0!==u?u.toString():"0";return(0,n.jsx)("div",{className:m.root,children:(0,n.jsxs)(R.M,{paddingTop:2*a.YK,paddingBottom:2*a.YK,paddingLeft:4*a.YK,paddingRight:4*a.YK,children:[(0,n.jsx)(f.f,{testId:"provider-name",children:(0,n.jsx)(ie.N,{onClick:s,nickname:t,children:(0,n.jsx)(ee.r,{children:(0,n.jsx)(o.S,{children:t})})})}),(0,n.jsx)(te.l,{height:2*a.YK}),(0,n.jsxs)(f.f,{children:[(0,n.jsxs)(se.V,{marginLeft:8*a.YK,children:[(0,n.jsxs)(f.f,{testId:"total-copying-capital-live",marginBottom:0,justifyContent:"space-between",children:[(0,n.jsx)(j.f,{testId:"title",children:(0,n.jsx)(b.X,{textColor:v.r.Secondary,children:g("Total investor funds (live)")})}),(0,n.jsx)(j.f,{testId:"value",justifyContent:"flex-end",children:(0,n.jsx)(o.S,{children:(0,n.jsx)(oe.q,{value:r,average:!0,prefix:!0})})})]}),(0,n.jsx)(ne.H,{}),(0,n.jsxs)(f.f,{testId:"active-since",marginBottom:0,justifyContent:"space-between",children:[(0,n.jsx)(j.f,{testId:"title",children:(0,n.jsx)(b.X,{textColor:v.r.Secondary,children:g("Active since")})}),(0,n.jsx)(j.f,{testId:"value",justifyContent:"flex-end",children:(0,n.jsx)(o.S,{children:i})})]})]}),(0,n.jsxs)(se.V,{marginLeft:8*a.YK,children:[(0,n.jsxs)(f.f,{testId:"average-profit",marginBottom:0,justifyContent:"space-between",children:[(0,n.jsx)(j.f,{testId:"title",children:(0,n.jsx)(b.X,{textColor:v.r.Secondary,children:g("Average profit")})}),(0,n.jsx)(j.f,{testId:"value",justifyContent:"flex-end",children:(0,n.jsx)(o.S,{children:(0,re.l)({forceSign:!0})(c)})})]}),(0,n.jsx)(ne.H,{}),(0,n.jsxs)(f.f,{testId:"all-time-copiers",marginBottom:0,justifyContent:"space-between",children:[(0,n.jsx)(j.f,{testId:"title",children:(0,n.jsx)(b.X,{textColor:v.r.Secondary,children:g("Investors over all time")})}),(0,n.jsx)(j.f,{testId:"value",justifyContent:"flex-end",children:(0,n.jsx)(o.S,{children:p})})]})]}),(0,n.jsxs)(se.V,{marginLeft:8*a.YK,children:[(0,n.jsxs)(f.f,{testId:"current-copiers",marginBottom:0,justifyContent:"space-between",children:[(0,n.jsx)(j.f,{testId:"title",children:(0,n.jsx)(b.X,{textColor:v.r.Secondary,children:g("Investors")})}),(0,n.jsx)(j.f,{testId:"value",justifyContent:"flex-end",children:(0,n.jsx)(o.S,{children:h})})]}),(0,n.jsx)(ne.H,{}),(0,n.jsxs)(f.f,{testId:"active-live-copiers",marginBottom:0,justifyContent:"space-between",children:[(0,n.jsx)(j.f,{testId:"title",children:(0,n.jsx)(b.X,{textColor:v.r.Secondary,children:g("Active live investors")})}),(0,n.jsx)(j.f,{testId:"value",justifyContent:"flex-end",children:(0,n.jsx)(o.S,{children:x})})]})]})]})]})})}));var ce=s(75815),le=s(395),de=s(82440);const ue=(0,i.memo)((e=>{const{profileName:t,forOwnAccount:s,hidePopup:r}=e,o=(0,p.wA)(),{t:c}=(0,C.B)(),{strategyIds:l,isLoading:d,isProviderStrategyListShown:u}=(0,y.d4)(H,{profileName:t}),{css:g,rules:m}=(0,S.X)(A,{hasStrategies:l.length>0});(0,i.useLayoutEffect)((()=>{o(F.v.load({userNickname:t,forOwnAccount:s}))}),[o,t,s]);const h=(0,i.useMemo)((()=>d?(0,n.jsx)("div",{className:g.noStrategies,children:(0,n.jsx)(le.a,{})}):0===l.length?(0,n.jsx)("div",{className:g.noStrategies,children:c("Other strategies of the provider will be displayed here.")}):(0,n.jsx)(O,{strategyIds:l,hidePopup:r})),[d,l,r,g,c]);return(0,n.jsxs)(n.Fragment,{children:[l.map((e=>(0,n.jsx)(de.B,{strategyId:e},e))),(0,n.jsx)("div",{className:g.root,children:(0,n.jsxs)(M.O,{autoHeight:!0,autoHeightMax:330,extend:{content:m.scrollContent,root:m.scrollRoot,view:m.scrollView},children:[(0,n.jsx)(ae,{profileName:t,hidePopup:r}),u&&(0,n.jsx)(ce.Z,{header:c("Strategies"),extend:{root:m.panel},children:(0,n.jsx)(R.M,{paddingTop:a.YK,paddingBottom:a.YK,paddingLeft:a.YK,paddingRight:a.YK,children:h})})]})})]})})),ge=(0,i.memo)((e=>{const{profileName:t,forOwnAccount:s}=e,{rules:a}=(0,S.X)(h),c=(0,i.useCallback)((e=>{const{hide:r}=e;return(0,n.jsx)(ue,{profileName:t,forOwnAccount:s,hidePopup:r})}),[t,s]);return(0,n.jsxs)(r.m,{testId:"strategy",placement:"bottom-start",arrow:!0,offsetX:-50,offsetY:10,extend:{popper:a.popper},children:[(0,n.jsx)(o.S,{children:t}),c]})}))},9386:(e,t,s)=>{"use strict";s.d(t,{O:()=>l});var n=s(58142),r=s(72199),o=s(97176),i=s(66877),a=s(24771),c=s(6974);const l=(0,r._N)([(0,o.Hy)(i.x).portfolio.isEnabled(),(0,o.Hy)(a.K).strategyType()],((e,t)=>e?t:c.IB.Strategy))(Object.assign(Object.assign({},(0,n.Z6)()),{keySelector:o.eW}))},9404:(e,t,s)=>{"use strict";s.d(t,{e:()=>ft});var n=s(74848),r=s(96540),o=s(16215),i=s(15041),a=s(39701),c=s(395),l=s(47577),d=s(9779),u=s(9851),g=s(96159),m=s(15557),h=s(5860),p=s(16994),y=s(44320),x=s(24985),f=s(35026),j=s(73245),b=s(38062),v=s(99997),I=s(35012),S=s(59455),C=s(8201),k=s(91613),O=s(43679),w=s(54551),T=s(28185),D=s(58142),P=s(72199),N=s(97176),L=s(52293),B=s(44064),H=s(12740),E=s(98299),A=s(32873),R=s(65001),F=s(97155),M=s(19152),_=s(99684),W=s(92191),K=s(55663);const Y={networkStatus:_.p.None,networkError:void 0},V=(0,N.vY)((e=>e.startCopyingForm),Y);var Z=s(67221),U=s(32568);const J=(0,P._N)([L.c,(0,N.Hy)(H.$).networkStatus(),(0,N.Hy)(E.i).networkStatus(),(0,N.Hy)(A.s).networkStatus(),(0,N.Hy)(V).networkStatus(),(0,N.Hy)(V).networkError()],((e,t,s,n,r,o)=>({isStrategyExist:e,equityNetworkStatus:t,strategyToUsdExchangeNetworkStatus:s,usdToAccountExchangeNetworkStatus:n,formNetworkStatus:r,formNetworkError:o})))(Object.assign(Object.assign({},(0,D.Z6)()),{keySelector:(0,N.xd)((0,N.Jk)().accountId(),(0,N.Jk)().strategyId())})),X=(0,P._N)([J,(0,N.Hy)(W.E).depositCurrencyDigits(),(0,N.Hy)(W.E).isFollowingDisabledInGroup(),(0,N.Hy)(W.E).live(),(0,N.Hy)(U.k).freeMargin(),(0,N.Hy)(U.k).nonWithdrawableBonus(),R.f,F.U,(0,N.Hy)(B.b).isPortfolio(),(0,N.Hy)(K.I).copy.isFollowingConfirmationEnabled(),Z.n],((e,t,s,n,r,o,i,a,c,l,d)=>{const{isStrategyExist:u,equityNetworkStatus:g,strategyToUsdExchangeNetworkStatus:m,usdToAccountExchangeNetworkStatus:h,formNetworkStatus:p,formNetworkError:y}=e,x=g!==_.p.Done,f=m!==_.p.Done,j=h!==_.p.Done,b=p===_.p.Started;return{isLoading:x||f||j||b,isStrategyExist:u,isDisabled:s||i===M.C.LiveOnly,accountDepositCurrencyDigits:t,restriction:i!==M.C.ProvidingDisabled?i:void 0,shouldConfirm:l&&n,freeMargin:o?r.minus(o):r,minInvestmentInAccountCurrency:void 0!==a?k.D.ceil(a,t):void 0,networkError:y,isFavoriteStrategy:d,isPortfolio:c}}))(Object.assign(Object.assign({},(0,D.Z6)()),{keySelector:(0,N.xd)((0,N.Jk)().accountId(),(0,N.Jk)().strategyId())}));var $=s(20919),q=s(42692),Q=s(15192),z=s(83361);function G(e){const{amount:t,assetDigits:s,minInvestment:n,availableFunds:r,isPortfolio:o}=e,i=(0,z.y)(t);if(void 0!==i)return i;if((0,q.o)(t)>s)return(0,$.L)("Maximum of {0} digits after the decimal point",s);const a=new Q.A((0,C.d)(t));return a.gt(null!=r?r:0)?o?(0,$.L)("Insufficient funds to invest in this portfolio"):(0,$.L)("Insufficient funds to copy this strategy"):a.lt(null!=n?n:0)?(0,$.L)("Amount should be greater than or equal to the min investment"):void 0}var ee=s(42976),te=s(49925),se=s(76551),ne=s(22372),re=s(26898),oe=s(72727),ie=s(31453);function ae(e,t,s){return void 0!==e?(0,v.c)(e,s):void 0!==t?t:void 0}var ce=s(95141),le=s(22679),de=s(71431);const ue=(0,le.K)((e=>{const{actionRoot:t,actionContent:s}=(0,de.$)(e.theme);return{actionRoot:t,actionContent:s}}));var ge=s(44973),me=s(31118),he=s(23449),pe=s(67569);const ye=(0,P._N)([(0,N.Hy)(W.E).brokerName()],(e=>({brokerName:e})))(Object.assign(Object.assign({},(0,D.Z6)()),{keySelector:(0,N.Jk)().accountId()}));var xe=s(52466),fe=s(78449),je=s(81865),be=s(69e3),ve=s(25296),Ie=s(6495),Se=s(81588),Ce=s(53632),ke=s(76639);const Oe=(0,r.memo)((e=>{const{title:t,actionTitle:s,onClick:r}=e;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(d.f,{marginTop:f.YK,children:[(0,n.jsx)(y.f,{flexGrow:0,flexShrink:0,flexBasis:290,children:t}),(0,n.jsx)(ke.X,{width:2*f.YK}),(0,n.jsx)(y.f,{children:(0,n.jsx)(w.i,{wide:!0,onClick:r,children:s})})]}),(0,n.jsx)(h.H,{marginTop:2*f.YK,marginBottom:2*f.YK})]})}));var we=s(7089),Te=s(64453);const De=(0,le.K)((e=>{const{actionRoot:t,actionContent:s}=(0,de.$)(e.theme);return{actionRoot:Object.assign(Object.assign({},t),{height:36,position:"static"}),actionContent:Object.assign(Object.assign({},s),(0,Te.V)(18))}})),Pe=(0,r.memo)((e=>{const{title:t,actionTitle:s,onClick:r}=e,{rules:o}=(0,ce.X)(De);return(0,n.jsx)(d.f,{marginBottom:2*f.WQ,children:(0,n.jsxs)(l.V,{children:[(0,n.jsx)(m.B,{textColor:g.r.Secondary,isMultiLine:!0,children:t}),(0,n.jsx)(we.l,{height:2*f.WQ}),(0,n.jsx)(w.i,{wide:!0,onClick:r,extend:{root:o.actionRoot,content:o.actionContent},children:s}),(0,n.jsx)(h.H,{marginTop:2*f.WQ,marginBottom:0})]})})})),Ne=(0,r.memo)((e=>{const{viewType:t}=(0,Se.U)();return t===Ce.qi.Mobile?(0,n.jsx)(Pe,Object.assign({},e)):(0,n.jsx)(Oe,Object.assign({},e))}));var Le=s(37286),Be=s(6974),He=s(28359),Ee=s(342);const Ae=(0,P._N)([F.U,(0,N.Hy)(W.E).balance(),(0,N.Hy)(Ee.S).nonWithdrawableBonus()],((e,t,s)=>{var n;const r=t&&s?t-s:t;return void 0!==e?null===(n=(0,He.C)(r))||void 0===n?void 0:n.lt(e):void 0}))(Object.assign(Object.assign({},(0,D.Z6)()),{keySelector:(0,N.xd)((0,N.Jk)().strategyId(),(0,N.Jk)().accountId())})),Re=(0,N.T_)((0,N.Z8)({accountList:Le.L,strategyId:(0,N.Jk)().strategyId()})(Object.assign(Object.assign({},(0,D.Z6)()),{keySelector:(0,N.Jk)().strategyId()})),D.CO).chain((e=>{const{accountList:t,strategyId:s}=e;return(0,N.bk)(t.map((e=>{const{accountId:t}=e;return(0,D.$s)(Ae,{accountId:t,strategyId:s})})))(Object.assign(Object.assign({},(0,D.Z6)()),{keySelector:N.eW}))})).map((e=>e.length>0&&e.every((e=>e)))).build();var Fe=s(57520),Me=s(26679),_e=s(3442),We=s(400);const Ke=(0,P._N)([Z.n,Le.L,(0,N.Hy)(B.b).isPortfolio(),(0,N.Hy)(B.b).allowFollowing(),Re,(0,N.Hy)(Fe.p).copy.showCopyingActionSuggestion(),(0,N.Hy)(K.I).fundsManagement.isEnabled(),Me.Q,_e.p,(0,N.Hy)(We.i).settings.CreateLiveAccount.AllowCreationOfAdditionalLiveAccounts(),(0,N.Jk)().accountId()],((e,t,s,n,r,o,i,a,c,l,d)=>{const u=t.length>0,g=Boolean(t.find((e=>e.accountId===d))),m=c&&l,h=i||!a;return{shouldShowLiveCreation:n===Be.TT.LiveOnly&&!u&&m,shouldShowDeposit:r&&g&&h,isApplicable:o,isFavoriteStrategy:e,isPortfolio:s}}))(Object.assign(Object.assign({},(0,D.Z6)()),{keySelector:(0,N.xd)((0,N.Jk)().strategyId(),(0,N.Jk)().accountId())}));var Ye=s(42339);const Ve=(0,r.memo)((e=>{const{strategyId:t,accountId:s}=e,{t:o}=(0,j.B)(),c=(0,i.wA)(),{shouldShowLiveCreation:l,shouldShowDeposit:d,isApplicable:u,isFavoriteStrategy:g,isPortfolio:m}=(0,a.d4)(Ke,{strategyId:t,accountId:s}),h=(0,r.useCallback)((()=>{c(je.X.open({tab:be.n.Live,skipDialog:!0})),g||c(ve.k.mark({strategyId:t}))}),[c,g,t]),p=(0,r.useCallback)((()=>{c(Ye.d.open({operation:Ie.j.Deposit,openFrom:me.vq.CopyingDialog,accountId:s}))}),[c,s]);return u?l?(0,n.jsx)(Ne,{title:o(m?"You can start investing in this portfolio only with a live account":"You can start copying this strategy only with a live account"),actionTitle:o("Open live account"),onClick:h}):d?(0,n.jsx)(Ne,{title:o(m?"You cannot start investing in this portfolio because you do not have enough funds on your account.":"You cannot start copying this strategy because you do not have enough funds on your account."),actionTitle:o("Deposit [[verb]]"),onClick:p}):null:null})),Ze=(0,r.memo)((e=>{const{strategyId:t,accountId:s}=e,{brokerName:r}=(0,a.d4)(ye,{strategyId:t,accountId:s});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(fe.w,{}),(0,n.jsx)(xe.O,{brokerName:r}),(0,n.jsx)(Ve,{strategyId:t,accountId:s})]})}));var Ue=s(68617),Je=s(92563);const Xe=(0,r.memo)((e=>{const{accountId:t,strategyId:s}=e,{t:o}=(0,j.B)(),D=(0,i.wA)(),{rules:P}=(0,ce.X)(ue),{isLoading:N,isStrategyExist:L,isDisabled:B,accountDepositCurrencyDigits:H,restriction:E,shouldConfirm:A,freeMargin:R,minInvestmentInAccountCurrency:F,networkError:M,isFavoriteStrategy:_,isPortfolio:W}=(0,a.d4)(X,{accountId:t,strategyId:s}),K=(0,b.b)(W),[Y,V]=(0,r.useState)(""),[Z,U]=(0,r.useState)(void 0),[J,$]=(0,r.useState)(void 0),[q,Q]=(0,r.useState)(!0),z=B||void 0!==J||void 0!==M,le=(0,r.useMemo)((()=>o(A?"Continue":W?"Invest":"Start copying")),[W,A,o]),de=(0,r.useCallback)((()=>{Q((e=>!e))}),[]),ye=(0,r.useCallback)((e=>{const t=ae(E,e,W);$(t)}),[E,W]),xe=(0,r.useCallback)((e=>{const t=G({amount:e,assetDigits:H,minInvestment:F,availableFunds:R,isPortfolio:W});return U(t),ye(t),t}),[H,ye,F,R,W]),fe=(0,r.useCallback)((e=>{D(S.K.clearError()),V(e),xe(e)}),[D,xe]),je=(0,r.useCallback)((()=>{xe(Y)||(A?D(pe.f.pushCopyingConfirmation({accountId:t,strategyId:s,deposit:(0,C.d)(Y),isFavoriteActive:q})):(D(ge.z.tag({label:me.t_.CopyingStarted})),D(he.z.create({accountId:t,strategyId:s,deposit:(0,C.d)(Y),isFavoriteActive:q}))))}),[t,s,Y,xe,q,A,D]);return(0,r.useEffect)((()=>{F&&V(k.D.ceil(F,H).toFixed(H))}),[F,H]),(0,r.useEffect)((()=>{$(E?(0,v.c)(E,W):void 0)}),[E,W]),L?N?(0,n.jsx)(c.a,{}):(0,n.jsxs)(l.V,{children:[(0,n.jsx)(d.f,{marginBottom:2*f.WQ,children:(0,n.jsxs)(l.V,{paddingLeft:2*f.WQ,paddingRight:2*f.WQ,children:[(0,n.jsx)(d.f,{marginBottom:2*f.WQ,children:(0,n.jsxs)(l.V,{children:[(0,n.jsx)(d.f,{marginBottom:f.WQ,children:(0,n.jsx)(Ue.U,{type:Je._n.Description,text:o(W?"Funds that are added from the selected trading account to invest in this portfolio. The amount should be greater than or equal to the minimum investment.":"Funds that are added from the selected trading account to copy this strategy. The amount should be greater than or equal to the minimum investment."),children:(0,n.jsx)(u.r,{textColor:g.r.AccentSpecial,children:o("Amount")})})}),(0,n.jsx)(d.f,{flexGrow:1,children:(0,n.jsx)(I.J,{accountId:t,value:Y,error:Z,max:null==R?void 0:R.toFixed(),onChange:fe,variant:O.S.Underline})})]})}),(0,n.jsx)(d.f,{marginBottom:2*f.WQ,children:(0,n.jsx)(l.V,{children:(0,n.jsx)(te.Z,{children:(0,n.jsxs)(se.n,{children:[(0,n.jsx)(m.B,{textColor:g.r.Secondary,children:o("Available to invest")}),(0,n.jsx)(ee.R,{value:R,accountId:t,prefix:!0})]})})})}),(0,n.jsx)(h.H,{marginTop:0,marginBottom:2*f.WQ}),(0,n.jsx)(Ze,{accountId:t,strategyId:s}),(0,n.jsx)(d.f,{marginBottom:2*f.WQ,children:(0,n.jsxs)(l.V,{children:[(0,n.jsx)(d.f,{marginBottom:2*f.WQ,children:(0,n.jsx)(p.L,{children:o("Fees and conditions")})}),(0,n.jsx)(ne.V,{accountId:t,strategyId:s})]})}),(0,n.jsx)(h.H,{marginTop:0,marginBottom:2*f.WQ}),(0,n.jsx)(d.f,{marginBottom:2*f.WQ,children:(0,n.jsxs)(l.V,{children:[(0,n.jsx)(re.e,{accountId:t,strategyId:s}),(0,n.jsx)(oe.q,{})]})}),!_&&(0,n.jsx)(d.f,{marginBottom:2*f.WQ,children:(0,n.jsx)(y.f,{children:(0,n.jsx)(ie.o,{testId:"add-to-favorites",onChange:de,checked:q,children:o("Add to Favourites")})})}),z&&(0,n.jsx)(d.f,{marginBottom:2*f.WQ,children:(0,n.jsx)(x.X,{textColor:g.r.Error,isMultiLine:!0,children:J||K(M)})})]})}),(0,n.jsx)(d.f,{children:(0,n.jsx)(w.i,{testId:"submit",type:T.V.submit,wide:!0,disabled:z,onClick:je,extend:{root:P.actionRoot,content:P.actionContent},children:le})})]}):null})),$e=(0,r.memo)((e=>{const{accountId:t,strategyId:s}=e;return(0,n.jsx)(Xe,{accountId:t,strategyId:s})}));var qe=s(72879);const Qe=(0,P._N)([(0,N.Hy)(W.E).depositCurrencyDigits(),(0,N.Hy)(W.E).isFollowingDisabledInGroup(),(0,N.Hy)(W.E).live(),(0,N.Hy)(U.k).freeMargin(),(0,N.Hy)(U.k).nonWithdrawableBonus(),R.f,F.U,(0,N.Hy)(V).networkError(),(0,N.Hy)(K.I).copy.isFollowingConfirmationEnabled(),Z.n,(0,N.Hy)(B.b).isPortfolio()],((e,t,s,n,r,o,i,a,c,l,d)=>{const u=o===M.C.LiveOnly;return{accountDepositCurrencyDigits:e,restriction:o!==M.C.ProvidingDisabled?o:void 0,shouldConfirm:c&&s,freeMargin:r?n.minus(r):n,minInvestmentInAccountCurrency:void 0!==i?k.D.ceil(i,e):void 0,isDisabled:t||u,networkError:a,isFavoriteStrategy:l,isPortfolio:d}}))(Object.assign(Object.assign({},(0,D.Z6)()),{keySelector:(0,N.xd)((0,N.Jk)().strategyId(),(0,N.Jk)().accountId())}));var ze=s(8819),Ge=s(48517);const et=(0,r.memo)((e=>{const{accountId:t,strategyId:s,onClose:o,isFavoriteActive:c,onFavoriteChange:l}=e,{isDisabled:u,minInvestmentInAccountCurrency:m,accountDepositCurrencyDigits:p,freeMargin:O,restriction:D,networkError:P,shouldConfirm:N,isFavoriteStrategy:L,isPortfolio:B}=(0,a.d4)(Qe,{accountId:t,strategyId:s}),H=(0,i.wA)(),{t:E}=(0,j.B)(),A=(0,b.b)(B),[R,F]=(0,r.useState)(""),[M,_]=(0,r.useState)(void 0),[W,K]=(0,r.useState)(void 0),Y=(0,r.useMemo)((()=>E(N?"Continue":B?"Invest":"Start copying")),[B,N,E]),V=(0,r.useCallback)((e=>{const t=ae(D,e,B);K(t)}),[D,B]),Z=(0,r.useCallback)((e=>{const t=G({amount:e,assetDigits:p,minInvestment:m,availableFunds:O,isPortfolio:B});return _(t),V(t),t}),[p,V,m,O,B]),U=(0,r.useCallback)((e=>{H(S.K.clearError()),F(e),Z(e)}),[H,Z]),J=u||void 0!==W||void 0!==P,X=(0,r.useCallback)((()=>{Z(R)||(N?H(Ge.U.openConfirmDialog({accountId:t,strategyId:s,deposit:(0,C.d)(R),isFavoriteActive:c})):(H(ge.z.tag({label:me.t_.CopyingStarted})),H(he.z.create({accountId:t,strategyId:s,deposit:(0,C.d)(R),isFavoriteActive:c}))))}),[t,s,R,Z,c,N,H]);return(0,r.useEffect)((()=>{m&&F(k.D.ceil(m,p).toFixed(p))}),[m,p]),(0,r.useEffect)((()=>{K(D?(0,v.c)(D,B):void 0)}),[D,B]),(0,r.useEffect)((()=>{M&&Z(R)}),[R,M,Z]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(d.f,{testId:"amount",marginBottom:2*f.YK,children:[(0,n.jsxs)(y.f,{testId:"title",flexBasis:"40%",children:[E("Amount"),(0,n.jsx)(ke.X,{}),(0,n.jsx)(ze.V,{children:E(B?"Funds that are added from the selected trading account to invest in this portfolio. The amount should be greater than or equal to the minimum investment.":"Funds that are added from the selected trading account to copy this strategy. The amount should be greater than or equal to the minimum investment.")})]}),(0,n.jsx)(y.f,{testId:"amount-selector",children:(0,n.jsx)(I.J,{accountId:t,value:R,error:M,max:null==O?void 0:O.toFixed(),onChange:U})})]}),(0,n.jsxs)(d.f,{testId:"available-funds",marginBottom:2*f.YK,children:[(0,n.jsx)(y.f,{testId:"title",flexBasis:"40%",children:E("Available to invest")}),(0,n.jsx)(y.f,{testId:"value",children:(0,n.jsx)(ee.R,{value:O,accountId:t,prefix:!0})})]}),(0,n.jsx)(h.H,{marginTop:2*f.YK,marginBottom:2*f.YK}),(0,n.jsx)(Ze,{accountId:t,strategyId:s}),(0,n.jsx)(ne.V,{accountId:t,strategyId:s}),(0,n.jsx)(h.H,{marginTop:2*f.YK,marginBottom:2*f.YK}),(0,n.jsx)(re.e,{accountId:t,strategyId:s}),(0,n.jsx)(oe.q,{}),!L&&(0,n.jsx)(d.f,{marginBottom:2*f.YK,children:(0,n.jsx)(y.f,{children:(0,n.jsx)(ie.o,{testId:"add-to-favorites",onChange:l,checked:c,children:E("Add to Favourites")})})}),P&&(0,n.jsx)(d.f,{marginBottom:2*f.YK,children:(0,n.jsx)(x.X,{textColor:g.r.Error,isMultiLine:!0,children:A(P)})}),(0,n.jsxs)(d.f,{children:[(0,n.jsx)(y.f,{children:(0,n.jsx)(w.i,{testId:"submit",type:T.V.submit,wide:!0,disabled:J,title:W,onClick:X,children:Y})}),(0,n.jsx)(y.f,{children:(0,n.jsx)(qe.t,{testId:"cancel",wide:!0,onClick:o,children:E("Cancel")})})]})]})})),tt=(0,P._N)([L.c,(0,N.Hy)(H.$).networkStatus(),(0,N.Hy)(E.i).networkStatus(),(0,N.Hy)(A.s).networkStatus(),(0,N.Hy)(V).networkStatus(),(0,N.Hy)(W.E).depositCurrencyDigits(),(0,N.Hy)(U.k).nonWithdrawableBonus(),(0,N.Hy)(U.k).freeMargin(),F.U,(0,N.Hy)(W.E).plantId(),(0,N.Hy)(B.b).plantId()],((e,t,s,n,r,o,i,a,c,l,d)=>{const u=t!==_.p.Done,g=s!==_.p.Done,m=n!==_.p.Done,h=r===_.p.Started;return{isLoading:u||g||m||h,isStrategyExist:e,accountDepositCurrencyDigits:o,freeMargin:i?a.minus(i):a,minInvestmentInAccountCurrency:void 0!==c?k.D.ceil(c,o):void 0,accountPlantId:l,strategyPlantId:d}}))(Object.assign(Object.assign({},(0,D.Z6)()),{keySelector:(0,N.xd)((0,N.Jk)().accountId(),(0,N.Jk)().strategyId())}));var st=s(65501);const nt=(0,le.K)((e=>{const{isLoading:t}=e,{backgroundColor:s}=e.theme.palette.semantic;return{root:{position:"relative"},loader:Object.assign(Object.assign(Object.assign({},!t&&{display:"none"}),{position:"absolute",zIndex:12,width:"100%",height:"100%"}),(0,st.T)({color:s.secondaryNormal}))}})),rt=(0,r.memo)((e=>{const{accountId:t,strategyId:s,onClose:o}=e,{isLoading:i,isStrategyExist:d}=(0,a.d4)(tt,{accountId:t,strategyId:s}),[u,g]=(0,r.useState)(!0),{css:m,rules:h}=(0,ce.X)(nt,{isLoading:i}),p=(0,r.useCallback)((()=>{g((e=>!e))}),[]);return(0,n.jsx)(n.Fragment,{children:d&&(0,n.jsxs)(l.V,{marginLeft:0,extend:{root:h.root},children:[(0,n.jsx)("div",{className:m.loader,children:(0,n.jsx)(c.a,{})}),(0,n.jsx)(et,{accountId:t,strategyId:s,onClose:o,isFavoriteActive:u,onFavoriteChange:p})]})})}));var ot=s(52019),it=s(33270);const at=(0,s(98549).h)(Y).case(Ge.U.setStatus,((e,t)=>{e.networkStatus=t})).case(Ge.U.setError,((e,t)=>{e.networkError=t})).case(Ge.U.clearError,(e=>{e.networkError=void 0}));var ct=s(82823),lt=s(47873),dt=s(28452);const ut=(0,ct.H)((e=>e.pipe((0,lt.l)(he.z.create),(0,dt.Z)((()=>[Ge.U.setStatus(_.p.Started)])))),(e=>e.pipe((0,lt.l)(he.z.createDone),(0,dt.Z)((()=>[Ge.U.setStatus(_.p.Done)])))),(e=>e.pipe((0,lt.l)(he.z.createFailed),(0,dt.Z)((e=>{const{errorCode:t,description:s}=e;return[ge.z.tag({label:me.t_.StartCopyingError,params:{description:s}}),Ge.U.setStatus(_.p.Failed),Ge.U.setError(t)]}))))),gt=(0,r.memo)((()=>((0,ot.n)("startCopyingForm",at),(0,it.S)(ut),null)));var mt=s(17591),ht=s(50551),pt=s(27497),yt=s(38281);const xt=(0,P._N)([(0,N.Hy)(W.E).plantId(),(0,N.Hy)(B.b).plantId()],((e,t)=>({accountPlantId:e,strategyPlantId:t})))(Object.assign(Object.assign({},(0,D.Z6)()),{keySelector:(0,N.xd)((0,N.Jk)().accountId(),(0,N.Jk)().strategyId())})),ft=(0,r.memo)((e=>{const{accountId:t,strategyId:s}=e,{accountPlantId:r,strategyPlantId:i}=(0,a.d4)(xt,{accountId:t,strategyId:s});return(0,o.q)()(e)?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(gt,{}),(0,n.jsx)(fe.w,{}),(0,n.jsx)(mt.e,{plantId:r}),(0,n.jsx)(mt.e,{plantId:i}),(0,n.jsx)(ht.h,{accountId:t}),(0,n.jsx)(pt.t,{accountId:t}),(0,n.jsx)(yt.O,{strategyId:s}),(0,n.jsx)($e,Object.assign({},e))]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(gt,{}),(0,n.jsx)(fe.w,{}),(0,n.jsx)(mt.e,{plantId:r}),(0,n.jsx)(mt.e,{plantId:i}),(0,n.jsx)(ht.h,{accountId:t}),(0,n.jsx)(pt.t,{accountId:t}),(0,n.jsx)(yt.O,{strategyId:s}),(0,n.jsx)(fe.w,{}),(0,n.jsx)(rt,Object.assign({},e))]})}))},9468:(e,t,s)=>{"use strict";s.d(t,{f:()=>d,x:()=>l});var n=s(1065),r=s(65501),o=s(31287),i=s(19710),a=s(35026),c=s(22679);const l={display:"block",position:"absolute",height:1,right:0,left:0,content:'""'},d=(0,c.K)((e=>{const{fixed:t,columnWidth:s,rowHeight:c,isRowSelected:d,isLeftRound:u,isRightRound:g}=e,{backgroundColor:m}=e.theme.palette.semantic,h=(0,n.r)("withUnderline"),p=(0,n.r)("withoutUnderline"),y=(0,n.r)("withHighlight"),x=(0,n.r)("withoutHighlight"),f=(0,n.r)("withLastRow"),j=t?p:h,b=t?x:y,v=d?{":before":Object.assign(Object.assign(Object.assign({},l),{top:-3}),(0,r.T)({color:m.primaryNormal}))}:{},I=t||d?{}:{":after":Object.assign(Object.assign(Object.assign({},l),{bottom:-3}),(0,r.T)({color:m.strokeNormal}))},S=u?{borderTopLeftRadius:a.r8,borderBottomLeftRadius:a.r8}:{},C=g?{borderTopRightRadius:a.r8,borderBottomRightRadius:a.r8}:{},k=d&&!t?Object.assign({},(0,r.T)({color:m.secondaryNormal})):{};return{root:(0,o.N)(j,b,f,Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({position:"relative",display:"flex"},(0,i.U)(0,0,s)),{alignItems:"center",justifyContent:"center",height:c,paddingLeft:u?2:0,paddingRight:g?2:0}),S),C),k),{whiteSpace:"nowrap",minWidth:0,nested:Object.assign(Object.assign({},v),I)})),content:{flexGrow:1,display:"flex",overflow:"hidden",alignItems:"center",justifyContent:"center"},text:{overflow:"hidden",textOverflow:"ellipsis"}}}))},9571:(e,t,s)=>{"use strict";s.d(t,{A:()=>D});var n=s(74848),r=s(96540),o=s(81588),i=s(53632),a=s(91069),c=s(4202),l=s(22085),d=s(51697),u=s(39701),g=s(91200),m=s(95141),h=s(73245),p=s(58142),y=s(72199),x=s(97176),f=s(44064);const j=(0,y._N)([(0,x.Hy)(f.b).managementFee(),(0,x.Hy)(f.b).performanceFee(),(0,x.Hy)(f.b).commissionRate(),(0,x.Hy)(f.b).live(),(0,x.Hy)(f.b).isPortfolio()],((e,t,s,n,r)=>({managementFee:e,performanceFee:t,volumeFee:s,isLive:n,isPortfolio:r})))(Object.assign(Object.assign({},(0,p.Z6)()),{keySelector:(0,x.Jk)().strategyId()}));var b=s(22679),v=s(35026);const I=(0,b.K)((e=>{const{isLive:t,width:s}=e;return{fees:{display:"inline-flex",flexWrap:"wrap",justifyContent:"center",textAlign:"center",marginTop:5,fontSize:12,color:t?"#b8ecb2":"#b2daec",letterSpacing:1},feeStroke:Object.assign({marginRight:v.YK},s<=250&&{nested:{":last-of-type":{display:"none"}}}),feeValue:{fontWeight:600,color:"#fff"}}})),S=(0,r.memo)((e=>{const{strategyId:t}=e,{isLive:s,managementFee:r,performanceFee:o,volumeFee:i,isPortfolio:p}=(0,u.d4)(j,{strategyId:t}),{width:y}=(0,g.W)(),{css:x}=(0,m.X)(I,{isLive:s,width:y}),{t:f}=(0,h.B)();if((0,a.yr)({managementFee:r,performanceFee:o,volumeFee:i}))return(0,n.jsx)("div",{className:`${x.fees} ${x.feeValue}`,children:f("Free")});const b=[f("P: performance fee. It is applied to the net profit using a high-water mark model and is paid at the end of each month."),f("M: management fee. It is an annual percentage of investor equity calculated daily and paid at the end of each month."),f(p?"V: volume fee. It is based on the volume traded while investing in the portfolio. The fee is charged when opening and closing each position.":"V: volume fee. It is based on the volume traded while copying the strategy. The fee is charged when opening and closing each position.")].join("\n\n");return(0,n.jsxs)(c.I,{children:[(0,n.jsxs)("div",{className:x.fees,children:[(0,n.jsxs)("div",{children:["P:"," ",(0,n.jsx)("span",{className:x.feeValue,children:(0,l.l)()(o)})]}),(0,n.jsx)("span",{className:x.feeStroke,children:"|"}),(0,n.jsxs)("div",{children:["M:"," ",(0,n.jsx)("span",{className:x.feeValue,children:(0,l.l)()(r)})]}),(0,n.jsx)("span",{className:x.feeStroke,children:"|"}),(0,n.jsxs)("div",{children:["V:"," ",(0,n.jsx)("span",{className:x.feeValue,children:(0,d.MZ)()(i)})]})]}),b]})}));var C=s(64028),k=s(65012);const O=(0,b.K)((e=>{const{foregroundColor:t}=e.theme.palette.semantic,{body:s}=e.theme.typography.semantic,n=Object.assign({flexGrow:1,display:"flex",color:t.tertiary},(0,C.I)(s.secondary));return{root:Object.assign({flexGrow:1,display:"flex",flexDirection:"row"},(0,k.M)(0,2*v.WQ)),performanceFee:Object.assign(Object.assign({},n),{justifyContent:"flex-start"}),managementFee:Object.assign(Object.assign({},n),{justifyContent:"center"}),volumeFee:Object.assign(Object.assign({},n),{justifyContent:"flex-end"}),freeValue:Object.assign(Object.assign({},n),{justifyContent:"center"})}})),w=(0,y._N)([(0,x.Hy)(f.b).managementFee(),(0,x.Hy)(f.b).performanceFee(),(0,x.Hy)(f.b).commissionRate()],((e,t,s)=>({managementFee:e,performanceFee:t,volumeFee:s})))(Object.assign(Object.assign({},(0,p.Z6)()),{keySelector:(0,x.Jk)().strategyId()})),T=(0,r.memo)((e=>{const{strategyId:t}=e,{t:s}=(0,h.B)(),{managementFee:r,performanceFee:o,volumeFee:i}=(0,u.d4)(w,{strategyId:t}),{css:c}=(0,m.X)(O);return(0,a.yr)({managementFee:r,performanceFee:o,volumeFee:i})?(0,n.jsx)("div",{className:c.root,children:(0,n.jsx)("div",{className:c.freeValue,children:s("Free")})}):(0,n.jsxs)("div",{className:c.root,children:[(0,n.jsxs)("div",{className:c.performanceFee,children:["P:"," ",(0,l.l)()(o)]}),(0,n.jsxs)("div",{className:c.managementFee,children:["M:"," ",(0,l.l)()(r)]}),(0,n.jsxs)("div",{className:c.volumeFee,children:["V:"," ",(0,d.MZ)()(i)]})]})})),D=(0,r.memo)((e=>{const{strategyId:t}=e,{viewType:s}=(0,o.U)();return s===i.qi.Mobile?(0,n.jsx)(T,{strategyId:t}):(0,n.jsx)(S,{strategyId:t})}))},9728:(e,t,s)=>{"use strict";s.d(t,{n:()=>o});var n=s(90935),r=s(99222);function o(e){var t;return null===(t=r.EM.find((t=>(0,n.Z)(t.value*r.s0,e*r.Cg))))||void 0===t?void 0:t.label}},9808:(e,t,s)=>{var n={"./offline.gif":30737,"./online.png":96430};function r(e){var t=o(e);return s(t)}function o(e){if(!s.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}r.keys=function(){return Object.keys(n)},r.resolve=o,e.exports=r,r.id=9808},9851:(e,t,s)=>{"use strict";s.d(t,{r:()=>l});var n=s(74848),r=s(96540),o=s(95141),i=s(36177),a=s(64028);const c=(0,s(22679).K)((e=>{const{subtitle:t}=e.theme.typography.semantic;return{root:Object.assign({},(0,a.I)(t.secondary))}})),l=(0,r.memo)((e=>{const{isMultiLine:t,textColor:s,textAlign:r,extend:a,children:l,testId:d}=e,{rules:u}=(0,o.X)(c,{extend:a});return(0,n.jsx)(i.E,{testId:null!=d?d:"subtitle-secondary",textColor:s,isMultiLine:t,textAlign:r,extend:u,children:l})}))},9869:(e,t,s)=>{"use strict";s.d(t,{w:()=>r});var n=s(56923);function r(){return[n.Y.ago1week,n.Y.thirtyDaysAgo,n.Y.ninetyDaysAgo,n.Y.hundredEightyThreeDaysAgo,n.Y.threeHundredSixtyFiveDaysAgo,n.Y.all]}},10236:(e,t,s)=>{"use strict";s.d(t,{n:()=>a});var n=s(72199),r=s(97176),o=s(58142),i=s(1522);const a=(0,n._N)([(0,r.Hy)(i.c).search()],(e=>e.trim()))(Object.assign(Object.assign({},(0,o.Z6)()),{keySelector:r.eW}))},10593:(e,t,s)=>{"use strict";s.d(t,{u:()=>a});var n=s(58142),r=s(72199),o=s(97176),i=s(39289);const a=(0,r._N)([(0,o.Hy)(i.$).data(),(0,o.Jk)().accountId()],((e,t)=>e[t]))(Object.assign(Object.assign({},(0,n.Z6)()),{keySelector:(0,o.Jk)().accountId()}))},10643:(e,t,s)=>{"use strict";s.d(t,{n:()=>i});var n=s(96540),r=s(78174),o=s(23823);const i=(0,n.memo)((e=>{const{strategyId:t}=e;var s;return s=[t],(0,r.l)(s,o.y.subscribeInterval,o.y.unsubscribeInterval),null}))},10740:(e,t,s)=>{"use strict";s.d(t,{u:()=>de});var n=s(74848),r=s(96540),o=s(16929);const i=(0,r.createContext)(null),a=()=>(0,r.useContext)(i);var c=s(91200),l=s(71035),d=s(39235),u=s(68184),g=s(48968);const m=(0,r.memo)((e=>{const{children:t}=e,{data:s}=a(),{width:i}=(0,c.W)(),{yAxisWidth:m}=(0,l.V)(),[h,p]=(0,o.d)(s,(e=>e.timestamp)),y=(0,r.useMemo)((()=>(0,d.m)().domain([h,p]).range([0,i-m])),[h,p,i,m]),x=(0,u.G)({transform:y,range:[0,i]});return(0,n.jsx)(g.i,{value:x,children:t})}));var h=s(35026);const p=(0,r.memo)((e=>{const{children:t}=e,{height:s}=(0,c.W)(),{xAxisHeight:i}=(0,l.V)(),{data:m}=a(),p=m.map((e=>{const{balance:t,minEquity:s,maxEquity:n}=e;return[s.toNumber(),n.toNumber(),t.toNumber()]})),[y,x]=(0,o.d)(p.flat(),(e=>e)),f=(0,r.useMemo)((()=>(0,d.m)().domain([y,x]).range([s-i-2*h.YK,10*h.YK])),[y,x,s,i]),j=(0,u.G)({transform:f,range:[0,1]});return(0,n.jsx)(g.J,{value:j,children:t})})),y=(0,r.memo)((e=>{const{data:t,assetName:s,assetDigits:o,children:a}=e,c=(0,r.useMemo)((()=>({data:t,assetName:s,assetDigits:o})),[t,s,o]);return(0,n.jsx)(i,{value:c,children:a})}));var x=s(52551),f=s(16575),j=s(80124),b=s(99196),v=s(86547),I=s(38936);const S=(0,r.memo)((e=>{const{children:t}=e,s=(()=>{const{theme:e}=(0,j.D)(),{chart:t}=e.font.semantic,s=(0,b.H)(),n=(0,f.O)({fontSize:t.primary,fontFamily:s});return(0,r.useMemo)((()=>{const[,e]=n((0,x.k)(0,0));return e+2*h.YK}),[n])})(),i=(()=>{const{theme:e}=(0,j.D)(),{chart:t}=e.font.semantic,s=(0,b.H)(),{data:n,assetDigits:i}=a(),c=(0,f.O)({fontSize:t.primary,fontFamily:s}),l=n.map((e=>{const{minEquity:t,maxEquity:s,balance:n}=e;return[t.toNumber(),s.toNumber(),n.toNumber()]})),[d,u]=(0,o.d)(l.flat(),(e=>e));return(0,r.useMemo)((()=>{const[e]=c((0,v.v)({assetDigits:i})(d)),[t]=c((0,v.v)({assetDigits:i})(u));return Math.max(e,t)}),[d,u,i,c])})(),c=(0,r.useMemo)((()=>({xAxisHeight:s,yAxisWidth:i})),[s,i]);return(0,n.jsx)(I.V,{value:c,children:t})})),C=(0,r.createContext)(null);var k=s(4383),O=s(59554),w=s(84188);const T=(0,r.memo)((e=>{const{children:t}=e,{theme:s}=(0,j.D)(),{chart:o}=s.font.semantic,i=(0,b.H)(),d=(0,f.O)({fontSize:o.primary,fontFamily:i}),{assetDigits:u}=a(),{width:g,height:m}=(0,c.W)(),{xAxisHeight:p,yAxisWidth:y}=(0,l.V)(),x=(0,r.useMemo)((()=>{const[,e]=d((0,v.v)({assetDigits:u})(0));return e}),[d,u]),I=(0,r.useMemo)((()=>{const[e]=d((0,k.Y)(0,0));return e}),[d]),S=(0,O.i)(0,g-y,I+2*h.YK),T=(0,w.r)(0,m-p,x);return(0,n.jsx)(C,{value:{xTicks:S,yTicks:T},children:t})}));var D=s(88230),P=s(25155),N=s(87240),L=s(89124),B=s(95530),H=s(14730);const E=()=>(0,r.useContext)(C);var A=s(88498),R=s(89684),F=s(39701),M=s(72199),_=s(97176),W=s(27790),K=s(58142);const Y=(0,M._N)([W.P],(e=>({timeOffset:e})))(Object.assign(Object.assign({},(0,K.Z6)()),{keySelector:_.eW}));var V=s(83906);const Z=(0,r.memo)((e=>{const{timestamp:t}=e,{timeOffset:s}=(0,F.d4)(Y),{theme:o}=(0,j.D)(),{chart:i}=o.font.semantic,a=(0,b.H)(),{height:d}=(0,c.W)(),{xAxisHeight:u}=(0,l.V)(),[g]=(0,V.E)(),m=(0,f.O)({fontSize:i.primary,fontFamily:a}),{foreground:h}=(0,A.R)(),p=(0,r.useMemo)((()=>{const e=(0,k.Y)(t,s),[n,r]=m(e),o=d-u;return{x:g(t)-n/2,y:o+(u-r)/2,text:e}}),[m,d,s,t,g,u]);return(0,n.jsx)(R.E,{text:p.text,x:p.x,y:p.y,fill:h,fontSize:i.primary,fontFamily:a,preventDefault:!1})})),U=(0,r.memo)((()=>{const{width:e,height:t}=(0,c.W)(),{xAxisHeight:s}=(0,l.V)(),{xTicks:r}=E(),{axisBackground:o,foreground:i}=(0,A.R)();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(B.M,{x:0,y:t,width:e,height:-s,fill:o,preventDefault:!1}),r.map((e=>(0,n.jsx)(Z,{timestamp:e},e))),(0,n.jsx)(H.w,{tickList:r,stroke:i,ticks:!1,preventDefault:!1})]})}));var J=s(65104),X=s(65411);const $=(0,r.memo)((e=>{const{equity:t}=e,{theme:s}=(0,j.D)(),{chart:o}=s.font.semantic,i=(0,b.H)(),{width:a}=(0,c.W)(),[l]=(0,X.X)(),d=(0,f.O)({fontSize:o.primary,fontFamily:i}),{foreground:u}=(0,A.R)(),g=(0,r.useMemo)((()=>{const e=(0,v.v)({assetDigits:0})(t),[s,n]=d(e);return{x:a-s,y:l(t)-n/2,text:e}}),[d,t,a,l]);return(0,n.jsx)(R.E,{text:g.text,x:g.x,y:g.y,fill:u,fontSize:o.primary,fontFamily:i,preventDefault:!1})})),q=(0,r.memo)((()=>{const{width:e,height:t}=(0,c.W)(),{yAxisWidth:s}=(0,l.V)(),{yTicks:r}=E(),{axisBackground:o,foreground:i}=(0,A.R)();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(B.M,{x:e,y:0,width:-s,height:t,fill:o,preventDefault:!1}),r.map((e=>(0,n.jsx)($,{equity:e},e))),(0,n.jsx)(J.h,{tickList:r,stroke:i,ticks:!1,preventDefault:!1})]})}));var Q=s(33451);const z=(0,r.memo)((()=>{const{data:e}=a(),[t]=(0,V.E)(),[s]=(0,X.X)(),{balanceStroke:o,equityAreaStroke:i}=(0,A.R)(),c=(0,r.useMemo)((()=>{const n=[];for(let r=e.length-1;r>=0;r--){const{timestamp:o,maxEquity:i,minEquity:a}=e[r];n.unshift({x:t(o),y:s(i.toNumber())}),n.push({x:t(o),y:s(a.toNumber())})}return n}),[e,t,s]),l=(0,r.useMemo)((()=>e.map((e=>{const{balance:n,timestamp:r}=e;return{x:t(r),y:s(n.toNumber())}}))),[e,t,s]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Q.N,{dataList:c,stroke:i,strokeWidth:2,fill:i,close:!0,preventDefault:!1}),(0,n.jsx)(Q.N,{dataList:l,stroke:o,strokeWidth:2,preventDefault:!1})]})}));var G=s(73245),ee=s(19231);const te=(0,r.memo)((e=>{const{children:t,rowHeight:s}=e;return(0,n.jsx)(n.Fragment,{children:t.map(((e,t)=>(0,n.jsx)(ee.Y,{x:4,y:4+s*t+4,preventDefault:!1,children:e},t)))})}));var se=s(82411);const ne=(0,r.memo)((e=>{const{lineColor:t,text:s,symbolWidth:r,lineHeight:o}=e,{theme:i}=(0,j.D)(),{chart:a}=i.font.semantic,c=(0,b.H)(),{legendForeground:l}=(0,A.R)(),d=o/2,u=r+h.YK;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(se.H,{point:d,start:0,end:r,stroke:t,strokeWidth:2,preventDefault:!1}),(0,n.jsx)(R.E,{text:s,x:u,y:0,fill:l,fontSize:a.primary,fontFamily:c,preventDefault:!1})]})})),re=(0,r.memo)((()=>{const{theme:e}=(0,j.D)(),{chart:t}=e.font.semantic,s=(0,b.H)(),{height:o,width:i}=(0,c.W)(),{xAxisHeight:a,yAxisWidth:d}=(0,l.V)(),{t:u}=(0,G.B)(),{balanceStroke:g,equityAreaStroke:m,legendStroke:p,legendBackground:y}=(0,A.R)(),x=(0,f.O)({fontSize:t.primary,fontFamily:s}),v=u("Balance"),I=u("Equity"),[S,C]=(0,r.useMemo)((()=>{const[e,t]=x(v),[s]=x(I);return[Math.max(e,s),t]}),[x,v,I]),k=(0,r.useMemo)((()=>2*h.YK+h.YK),[]),O=4+C,w=4+k+h.YK+S+4,T=4+2*O+2+4;return(0,n.jsxs)(ee.Y,{x:i-d-h.YK-w,y:o-a-h.YK-T,preventDefault:!1,children:[(0,n.jsx)(B.M,{x:0,y:0,width:w,height:T,fill:y,stroke:p,preventDefault:!1}),(0,n.jsxs)(te,{rowHeight:O,children:[(0,n.jsx)(ne,{lineColor:g,text:v,symbolWidth:k,lineHeight:C}),(0,n.jsx)(ne,{lineColor:m,text:I,symbolWidth:k,lineHeight:C})]})]})}));var oe=s(75398),ie=s(58331),ae=s(32241);const ce=(0,r.memo)((()=>{const{data:e}=a(),{height:t}=(0,c.W)(),{xAxisHeight:s}=(0,l.V)(),[o]=(0,V.E)(),[i]=(0,ie.W)(),{depositsStroke:d,withdrawalsStroke:u}=(0,A.R)(),g=(0,r.useMemo)((()=>{const n=[];for(let r=0;r<e.length;r++){const{timestamp:i,deposits:a,withdrawals:c}=e[r];if(void 0!==a||void 0!==c){const e=(null==a?void 0:a.gte(c))?d:u;n.push({xPoint:o(i),yPoint:t-s,fill:e})}}return n}),[e,d,u,o,t,s]);return(0,n.jsx)(n.Fragment,{children:g.map(((e,t)=>{const{xPoint:s,yPoint:r,fill:o}=e;return(0,n.jsx)(ae.l,{x:s,y:r-i.invert(5),fill:o,radius:5},t)}))})})),le=(0,r.memo)((e=>{const{showLegend:t,showTriangles:s}=e,{xTicks:r,yTicks:o}=E(),{gridColor:i}=(0,A.R)();return(0,n.jsx)(oe.f,{children:(0,n.jsxs)(N.W,{children:[(0,n.jsx)(L.x,{xTickList:r,yTickList:o,stroke:i,preventDefault:!1}),(0,n.jsx)(z,{}),s&&(0,n.jsx)(ce,{}),t&&(0,n.jsx)(re,{}),(0,n.jsx)(U,{}),(0,n.jsx)(q,{})]})})})),de=(0,r.memo)((e=>{const{data:t,assetName:s,assetDigits:r,showLegend:o,showTriangles:i}=e;return(0,n.jsx)(D.O,{children:(0,n.jsx)(P.P,{children:(0,n.jsx)(y,{data:t,assetName:s,assetDigits:r,children:(0,n.jsx)(S,{children:(0,n.jsx)(m,{children:(0,n.jsx)(p,{children:(0,n.jsx)(T,{children:(0,n.jsx)(le,{showLegend:o,showTriangles:i})})})})})})})})}))},11e3:(e,t,s)=>{"use strict";s.d(t,{z:()=>g});var n=s(74848),r=s(96540),o=s(35026);function i(e){return s(9808)(`./${e}`)}const a=i("online.png"),c=i("offline.gif");var l=s(65501);const d=(0,s(22679).K)((e=>{const{isOnline:t}=e;return{root:Object.assign({display:"flex",flexShrink:0,width:o.YK,height:o.YK},(0,l.T)({image:`url(${t?a:c})`,size:"contain",repeat:"no-repeat",positionX:"50%",positionY:"50%"}))}}));var u=s(95141);const g=(0,r.memo)((e=>{const{isOnline:t,extend:s}=e,{css:r}=(0,u.X)(d,{isOnline:t,extend:s});return(0,n.jsx)("div",{className:r.root})}))},11079:(e,t,s)=>{"use strict";s.d(t,{Y:()=>o});var n=s(15041),r=s(70442);const o=(0,n.jO)(r.R)},11098:(e,t,s)=>{"use strict";s.d(t,{b:()=>h});var n=s(74848),r=s(81588),o=s(53632),i=s(96540),a=s(95141),c=s(35026),l=s(22679);const d=(0,l.K)((e=>{const{foregroundColor:t}=e.theme.palette.semantic;return{root:{display:"flex",marginTop:2*c.WQ,color:t.tertiary}}})),u=(0,i.memo)((e=>{const{children:t}=e,{css:s}=(0,a.X)(d);return(0,n.jsx)("div",{className:s.root,children:t})})),g=(0,l.K)((()=>({root:{display:"flex",marginTop:c.YK}}))),m=(0,i.memo)((e=>{const{children:t}=e,{css:s}=(0,a.X)(g);return(0,n.jsx)("div",{className:s.root,children:t})})),h=(0,i.memo)((e=>{const{children:t}=e,{viewType:s}=(0,r.U)();return s===o.qi.Mobile?(0,n.jsx)(u,{children:t}):(0,n.jsx)(m,{children:t})}))},11185:(e,t,s)=>{"use strict";s.d(t,{k:()=>a});var n=s(74848),r=s(96540),o=s(1586),i=s(48663);const a=(0,r.memo)((e=>{const{data:t}=e,s=(0,i.y)(),a=(0,r.useMemo)((()=>t.reduce(((e,t,n)=>Object.assign(Object.assign({},e),{[n]:s(t.month)})),{})),[t,s]);return(0,n.jsx)(o.l,{data:t,labels:a})}))},11318:(e,t,s)=>{"use strict";s.d(t,{T:()=>l});var n=s(74848),r=s(95141),o=s(96540),i=s(22679),a=s(20499);const c=(0,i.K)((()=>({root:Object.assign({},a.Ls)}))),l=(0,o.memo)((e=>{const{children:t}=e,{css:s}=(0,r.X)(c);return(0,n.jsx)("div",{className:s.root,children:t})}))},11413:(e,t,s)=>{"use strict";s.d(t,{m:()=>o});var n=s(97665),r=s(3303);function o(e,t){return Boolean((0,n.B6)(`${(0,r.E)(t)}`,e))}},11434:(e,t,s)=>{"use strict";s.d(t,{W:()=>f});var n=s(74848),r=s(96540),o=s(15864),i=s(95141),a=s(22679);const c=(0,a.K)((()=>({root:{flexDirection:"row"}}))),l=(0,a.K)((e=>{const{checked:t}=e,{foregroundColor:s}=e.theme.palette.semantic;return{root:{width:"100%",alignItems:"center",flexDirection:"row"},radio:{display:"none"},label:{height:44,alignItems:"center",justifyContent:"flex-start",marginLeft:0,color:t?s.accentSpecial:s.primary2}}}));var d=s(96412),u=s(61256),g=s(35026),m=s(76639),h=s(21078);const p=(0,r.memo)((e=>{const{children:t,title:s,testId:r,checked:o,disabled:a,onChange:c,value:p,extend:y}=e,{rules:x}=(0,i.X)(l,{checked:o,extend:y}),f=o?d.JQ.RadioButtonChecked:d.JQ.RadioButtonUnchecked,j=o?d.$D.AccentSpecial:d.$D.Secondary;return(0,n.jsx)(h.s,{value:p,checked:o,disabled:a,onChange:c,title:s,testId:r,extend:{root:x.root,radio:x.radio,label:x.label},children:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(u.I,{size:d.lK.Midsize,source:f,fill:j}),(0,n.jsx)(m.X,{width:g.WQ}),(0,n.jsx)("div",{children:t})]})})}));var y=s(73227),x=s(31523);const f=(0,r.memo)((e=>{const{data:t,value:s,disabled:a,testId:l,onChange:d}=e,{rules:u}=(0,i.X)(c),g=(0,r.useCallback)((e=>{if(a||!d)return;const s=t.find((t=>t.value===e));s&&!s.disabled&&d(e)}),[t,a,d]);return(0,n.jsx)(y.z,{layout:x.J.Vertical,value:s,disabled:a,itemsGap:0,onChange:g,testId:l,extend:{root:u.root},children:t.map(((e,t)=>(0,n.jsx)(p,{value:e.value,disabled:a||e.disabled,title:e.title,testId:e.testId,children:(0,n.jsx)(o.S,{children:e.label})},`${e.label}-${t}`)))})}))},11733:(e,t,s)=>{"use strict";s.d(t,{z:()=>m});var n=s(74848),r=s(96540),o=s(17591),i=s(72199),a=s(97176),c=s(58142),l=s(61829),d=s(91951);const u=(0,i._N)([l.m],(e=>{const t=e.map((e=>e.plantId));return{plantIds:(0,d.d)(t)}}))(Object.assign(Object.assign({},(0,c.Z6)()),{keySelector:(0,a.Jk)().strategyId()}));var g=s(39701);const m=(0,r.memo)((e=>{const{strategyId:t}=e,{plantIds:s}=(0,g.d4)(u,{strategyId:t});return(0,n.jsx)(n.Fragment,{children:s.map((e=>(0,n.jsx)(o.e,{plantId:e},e)))})}))},12041:(e,t,s)=>{"use strict";s.d(t,{Z:()=>d});var n=s(64053),r=s(30981),o=s(74954),i=s(47552),a=s(33017),c=s(37650),l=s(15192);class d{setStatistic(e){return this.statistic=e,this}sortBy(e,t){return this.sortByField=e,this.sortDirection=t,this}build(){return void 0===this.statistic||0===this.statistic.length?[]:(new u).setStatistic(this.statistic).sortBy(this.sortByField,this.sortDirection).calculate()}}class u{setStatistic(e){return this.statistic=e,this}sortBy(e,t){return this.sortByField=e,this.sortDirection=t,this}calculate(){const e=(0,n.$)(this.statistic,"symbolId"),t=[],s=Object.keys(e);for(let n=0;n<s.length;n++){const r=s[n];t.push(this.calculateForSymbol(e[parseInt(r,10)],parseInt(r,10)))}return void 0!==this.sortByField&&void 0!==this.sortDirection&&t.sort(((e,t)=>{if(e[this.sortByField]instanceof l.A&&t[this.sortByField]instanceof l.A){if(e[this.sortByField].lt(t[this.sortByField]))return this.sortDirection===r.UE.Asc?-1:1;if(e[this.sortByField].gt(t[this.sortByField]))return this.sortDirection===r.UE.Asc?1:-1}else{if(e[this.sortByField]<t[this.sortByField])return this.sortDirection===r.UE.Asc?-1:1;if(e[this.sortByField]>t[this.sortByField])return this.sortDirection===r.UE.Asc?1:-1}return 0})),t}calculateForSymbol(e,t){const s=this.getLosingTrades(e),n=this.getWinningTrades(e),r=s.all+n.all,o=s.long+n.long,i=s.short+n.short,a=this.getNetProfit(e),c=this.getTotalPipsWon(e);return{symbolName:e[0]&&e[0].symbolName,symbolId:t,totalTrades:r,totalTradesLong:o,totalTradesShort:i,totalPipsWon:c.all,totalPipsWonLong:c.long,totalPipsWonShort:c.short,netProfitTotal:a.all,netProfitLong:a.long,netProfitShort:a.short,losingTrades:s.all,losingTradesRatio:s.all/r,winningTrades:n.all,winningTradesRatio:n.all/r}}getLosingTrades(e){return(0,o.l)(this.getLosingTradesData(e))}getLosingTradesData(e){return e.map((e=>this.getLosingTradesItemData(e)))}getLosingTradesItemData(e){return{losingTradesLong:e.losingTradesLong,losingTradesShort:e.losingTradesShort}}getWinningTrades(e){return(0,c.N)(this.getWinningTradesData(e))}getWinningTradesData(e){return e.map((e=>this.getWinningTradesItemData(e)))}getWinningTradesItemData(e){return{winningTradesLong:e.winningTradesLong,winningTradesShort:e.winningTradesShort}}getNetProfit(e){return i.F.build(this.getNetProfitData(e))}getNetProfitData(e){return e.map((e=>this.getNetProfitItemData(e)))}getNetProfitItemData(e){return{positiveNetProfitLong:e.positiveNetProfitLong,positiveNetProfitShort:e.positiveNetProfitShort,negativeNetProfitLong:e.negativeNetProfitLong,negativeNetProfitShort:e.negativeNetProfitShort}}getTotalPipsWon(e){return a.u.build(this.getTotalPipsWonData(e))}getTotalPipsWonData(e){return e.map((e=>this.getTotalPipsWonItemData(e)))}getTotalPipsWonItemData(e){return{totalPipsWonLong:e.totalPipsWonLong,totalPipsWonShort:e.totalPipsWonShort}}}},12181:(e,t,s)=>{"use strict";s.d(t,{c:()=>c});var n=s(74848),r=s(96540),o=s(1767);const i=(0,r.memo)((()=>null));var a=s(32246);const c=(0,r.memo)((e=>{const{accountId:t,environment:s,fromAssetName:r,toAssetName:c}=e,l={accountId:t,environment:s,fromAssetName:r,toAssetName:c};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(i,{}),(0,n.jsx)(o.x,{param:l,subscribe:a.E.subscribe,unsubscribe:a.E.unsubscribe})]})}))},12183:(e,t,s)=>{"use strict";s.d(t,{L:()=>S});var n=s(74848),r=s(96540),o=s(61256),i=s(96412),a=s(17600),c=s(70332),l=s(62252),d=s(39701),u=s(58142),g=s(72199),m=s(97176),h=s(66877),p=s(29148),y=s(68694),x=s(12166),f=s(97665),j=s(67632),b=s(98986),v=s(44064);const I=(0,g._N)([(0,m.Hy)(h.x).attribution.isEnabled(),(0,m.Hy)(h.x).web.platformUrl(),(0,m.Hy)(b.m).data.nickname(),(0,m.Hy)(v.b).isPortfolio(),(0,m.Jk)().strategyId()],((e,t,s,n,r)=>{const o=n?j.LR.Portfolio:j.LR.Strategy;return{strategyUrl:(0,p.r)(Object.assign(Object.assign({},(0,y.D)(t)),{pathname:(0,f.tW)(`${j.P$.Copy}${o}`,{strategyId:r}),search:(0,x.K)({u:e?s:void 0})}))}}))(Object.assign(Object.assign({},(0,u.Z6)()),{keySelector:(0,m.Jk)().strategyId()})),S=(0,r.memo)((e=>{const{strategyId:t}=e,{strategyUrl:s}=(0,d.d4)(I,{strategyId:t});return(0,n.jsx)(a.j,{text:s,children:(e,t)=>e?(0,n.jsx)(c.h,{children:(0,n.jsx)(o.I,{source:i.JQ.Share,size:i.lK.Midsize})}):(0,n.jsx)(l.m,{onClick:e=>{e.stopPropagation(),t()},isTransparent:!0,children:(0,n.jsx)(o.I,{source:i.JQ.Share,size:i.lK.Midsize})})})}))},12298:(e,t,s)=>{"use strict";s.d(t,{O:()=>o});var n=s(97176),r=s(77575);const o=(0,n.vY)((e=>e.accountRoiHistory),r.wY)},12307:(e,t,s)=>{"use strict";s.d(t,{g:()=>x});var n=s(74848),r=s(96540),o=s(39701),i=s(9729),a=s(63426),c=s(12843),l=s(72199),d=s(97176),u=s(58142),g=s(92191);const m=(0,l._N)([(0,d.Hy)(g.E).depositCurrency(),(0,d.Hy)(g.E).depositCurrencyDigits()],((e,t)=>({depositCurrency:e,depositCurrencyDigits:t})))(Object.assign(Object.assign({},(0,u.Z6)()),{keySelector:(0,d.Jk)().accountId()}));var h=s(95141),p=s(20499);const y=(0,s(22679).K)((()=>({root:Object.assign({},p.Ls)}))),x=(0,r.memo)((e=>{const{children:t}=e,{formattedValue:s,isValid:r,displayName:l}=(e=>{const{value:t,accountId:s,placeholder:n=i.xH,hideZero:r=!1,prefix:l=!1}=e,{depositCurrency:d,depositCurrencyDigits:u}=(0,o.d4)(m,{accountId:s}),g=(0,c.E)(t,u,r),h=l?d:void 0;return{formattedValue:g?(0,a._)({digits:u,prefix:h,average:!1,defaultValue:n})(t):n,isValid:g,displayName:d}})(e),{css:d}=(0,h.X)(y);return"function"==typeof t?(0,n.jsx)(n.Fragment,{children:t({formattedValue:s,isValid:r,displayName:l})}):(0,n.jsx)("span",{className:d.root,children:s})}))},12428:(e,t,s)=>{"use strict";s.d(t,{c:()=>u});var n=s(6158),r=s(42692),o=s(20919),i=s(83361),a=s(9729),c=s(8201),l=s(22085),d=s(46529);function u(e){const t=(0,i.y)(e);if(void 0!==t)return t;if((0,r.o)(e.toString())>a.nH)return(0,o.L)("Maximum of {0} digits after the decimal point",a.nH);const s=(0,c.d)(e);return s<d.B_?(0,o.L)("Management fee should be higher than or equal to {0}",(0,l.l)()((0,n.g)(d.B_))):s>d.xF?(0,o.L)("Management fee should be lower than or equal to {0}",(0,l.l)()((0,n.g)(d.xF))):void 0}},12740:(e,t,s)=>{"use strict";s.d(t,{$:()=>a});var n=s(58142),r=s(72199),o=s(97176),i=s(20057);const a=(0,r._N)([(0,o.Hy)(i.H).data(),(0,o.Jk)().accountId()],((e,t)=>e[t]))(Object.assign(Object.assign({},(0,n.Z6)()),{keySelector:(0,o.Jk)().accountId()}))},12843:(e,t,s)=>{"use strict";s.d(t,{E:()=>n});const n=(e,t,s)=>Number.isFinite(t)&&void 0!==e&&!(s&&e.eq(0))},12996:(e,t,s)=>{"use strict";s.d(t,{C:()=>o});var n=s(6974),r=s(20919);const o=e=>{switch(e){case n.VZ.FreeAccount:return{isProviderAllowed:!1,errorMessage:(0,r.L)("Free accounts are not allowed")};case n.VZ.NettedOrSpreadBetting:return{isProviderAllowed:!1,errorMessage:(0,r.L)("Netting or spread-betting accounts are not allowed")};case n.VZ.ProvidingDisabled:return{isProviderAllowed:!1,errorMessage:(0,r.L)("You cannot become a strategy provider with this account. Please contact your broker for details.")};case n.VZ.ResumeProvidingDisabled:return{isProviderAllowed:!1,errorMessage:(0,r.L)("You cannot resume providing strategy on this account. Please contact your broker for details.")};case n.VZ.InvalidPlantStatus:return{isProviderAllowed:!1,errorMessage:void 0};case n.VZ.PlantStatusGuestOrUnknown:return{isProviderAllowed:!1,errorMessage:(0,r.L)("You cannot become a strategy provider because your broker is a Guest Member broker. Please contact your broker for more info.")};default:return{isProviderAllowed:!0,errorMessage:void 0}}}},13191:(e,t,s)=>{"use strict";var n;s.d(t,{l:()=>n}),function(e){e[e.POSITION_STATUS_OPEN=1]="POSITION_STATUS_OPEN",e[e.POSITION_STATUS_CLOSED=2]="POSITION_STATUS_CLOSED",e[e.POSITION_STATUS_CREATED=3]="POSITION_STATUS_CREATED",e[e.POSITION_STATUS_ERROR=4]="POSITION_STATUS_ERROR",e[e.POSITION_STATUS_DECLINED=5]="POSITION_STATUS_DECLINED",e[e.POSITION_STATUS_PENDING_CLOSED=6]="POSITION_STATUS_PENDING_CLOSED",e[e.POSITION_STATUS_FINAL_ERROR=7]="POSITION_STATUS_FINAL_ERROR"}(n||(n={}))},13378:(e,t,s)=>{"use strict";s.d(t,{SS:()=>c,mQ:()=>a});var n=s(27956),r=s(6974),o=s(46529),i=s(99684);const a={riskProfile:n.Jx.Any,roiFrom:r.Pn.Any,limit:20,copiers:o.cO,skip:0,sortingField:n.hj.Rank},c={isSilentLoad:!1,filter:a,pagination:{currentPage:1,totalCount:void 0,totalPages:void 0},data:[],subscribers:[],networkStatus:i.p.None}},13448:(e,t,s)=>{"use strict";s.d(t,{D:()=>$});var n,r=s(74848),o=s(96540),i=s(39701),a=s(15041),c=s(63773);!function(e){const t=(0,c.D)("StrategyMonthlyRoiChart");e.changeYear=t("CHANGE_YEAR")}(n||(n={}));var l=s(25870),d=s(72199),u=s(97176),g=s(44064),m=s(23314),h=s(58142),p=s(65229);const y={year:void 0},x=(0,u.vY)((e=>e.strategyMonthlyRoiChart),y),f=(0,d._N)([(0,u.Hy)(x).year(),p.w],((e,t)=>null!=e?e:t))(Object.assign(Object.assign({},(0,h.Z6)()),{keySelector:u.eW}));var j=s(27790),b=s(80681),v=s(41761);const I=(0,d._N)([f,(0,u.Hy)(g.b).traderRegistrationTimestamp(),(0,u.Hy)(b.j).serverTime(),j.P],((e,t,s,n)=>{const r=(0,m.Cp)(t,n),o=(0,m.Cp)(s,n);return{yearList:(0,v.L)(r,o),year:e,currentTime:s}}))(Object.assign(Object.assign({},(0,h.Z6)()),{keySelector:(0,u.Jk)().strategyId()}));var S=s(15622),C=s(93199),k=s(69545),O=s(44468),w=s(99684),T=s(52293),D=s(26736),P=s(67025),N=s(4354),L=s(99222),B=s(88389);const H=(0,d._N)([P.j,f,(0,u.Hy)(b.j).serverTime(),D.R],((e,t,s,n)=>{const r=t===(0,m.Cp)(s,n)?(0,m.tj)(s,n):L.fF.December;return(0,B.H)().map((s=>{const o=(0,l.E)(s,t,n),i=(0,m.Bu)(o,n),a=(0,m.Xf)(o,n),c=e.filter((e=>e.timestamp>=i&&e.timestamp<=a));return{timestamp:i,roi:r>=s?(0,N.X)(c):void 0}}))}))(Object.assign(Object.assign({},(0,h.Z6)()),{keySelector:(0,u.Jk)().strategyId()})),E=(0,d._N)([T.c,(0,u.Hy)(O.f).networkStatus(),H],((e,t,s)=>({isLoading:e&&t!==w.p.Done&&t!==w.p.Failed,isError:t===w.p.Failed,data:s})))(Object.assign(Object.assign({},(0,h.Z6)()),{keySelector:(0,u.Jk)().strategyId()}));var A=s(47577),R=s(41280),F=s(395),M=s(73944),_=s(35026),W=s(73366),K=s(73245);const Y=(0,o.memo)((e=>{const{strategyId:t}=e,{t:s}=(0,K.B)(),{isLoading:n,isError:o,data:a}=(0,i.d4)(E,{strategyId:t});return(0,W.y)(),n?(0,r.jsx)(A.V,{alignItems:"center",justifyContent:"center",children:(0,r.jsx)(F.a,{display:M.O.Block})}):o?(0,r.jsx)(A.V,{alignItems:"center",justifyContent:"center",children:(0,r.jsx)(R.r,{children:s("No historical data")})}):(0,r.jsx)(A.V,{marginLeft:2*_.YK,marginRight:2*_.YK,children:(0,r.jsx)(k.q,{data:a})})}));var V=s(77031);const Z=(0,o.memo)((e=>{const{id:t,strategyId:s}=e,{yearList:c,year:d,currentTime:u}=(0,i.d4)(I,{strategyId:s}),g=(0,a.wA)(),m=(0,o.useCallback)((e=>{g(n.changeYear(e))}),[g]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(S.U,{strategyId:s,from:(0,l.E)(L.fF.January,d,0),to:u}),(0,r.jsx)(V.t,{year:d,yearList:c,onChange:m}),(0,r.jsx)(C.m,{id:t,children:(0,r.jsx)(Y,{strategyId:s})})]})}));var U=s(52019);const J=(0,s(98549).h)(y).case(n.changeYear,((e,t)=>{e.year=t})),X=(0,o.memo)((()=>((0,U.n)("strategyMonthlyRoiChart",J),null))),$=(0,o.memo)((e=>{const{id:t,strategyId:s}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(X,{}),(0,r.jsx)(Z,{id:t,strategyId:s})]})}))},13631:(e,t,s)=>{"use strict";s.d(t,{z:()=>w});var n=s(74848),r=s(96540),o=s(81588),i=s(53632),a=s(73245),c=s(39701),l=s(15041),d=s(81470),u=s(72199),g=s(97176),m=s(58142),h=s(20412);const p=(0,u._N)([(0,g.Hy)(d.h).accountId(),(0,g.Hy)(h.u).strategyId(),(0,g.Hy)(h.u).isPortfolio()],((e,t,s)=>({parentAccountId:e,strategyId:t,isPortfolio:s})))(Object.assign(Object.assign({},(0,m.Z6)()),{keySelector:(0,g.Jk)().accountId()}));var y=s(27721),x=s(51015),f=s(2331);const j=(0,r.memo)((e=>{const{accountId:t}=e,{parentAccountId:s,strategyId:o,isPortfolio:i}=(0,c.d4)(p,{accountId:t}),d=(0,l.wA)(),{t:u}=(0,a.B)(),g=u(i?"Resume investing":"Resume copying"),m=(0,x.t)(t),h=(0,r.useCallback)((()=>{d(f.L.open({accountId:s,strategyId:o}))}),[s,o,d]);return(0,n.jsx)(y.a,{content:g,onClick:h,isDisabled:Boolean(m),title:m})}));var b=s(54551);const v=(0,u._N)([(0,g.Hy)(d.h).accountId(),(0,g.Hy)(h.u).strategyId(),(0,g.Hy)(h.u).isPortfolio()],((e,t,s)=>({parentAccountId:e,strategyId:t,isPortfolio:s})))(Object.assign(Object.assign({},(0,m.Z6)()),{keySelector:(0,g.Jk)().accountId()}));var I=s(22679),S=s(71431);const C=(0,I.K)((e=>{const{actionRoot:t,actionContent:s}=(0,S.$)(e.theme);return{root:Object.assign(Object.assign({},t),{position:"static"}),content:s}}));var k=s(95141);const O=(0,r.memo)((e=>{const{accountId:t}=e,{parentAccountId:s,strategyId:o,isPortfolio:i}=(0,c.d4)(v,{accountId:t}),d=(0,l.wA)(),{t:u}=(0,a.B)(),{rules:g}=(0,k.X)(C),m=(0,x.t)(t),h=(0,r.useCallback)((()=>{d(f.L.open({accountId:s,strategyId:o}))}),[s,o,d]);return(0,n.jsx)(b.i,{wide:!0,disabled:Boolean(m),onClick:h,extend:{root:g.root,content:g.content},children:u(i?"Resume investing":"Resume copying")})})),w=(0,r.memo)((e=>{const{accountId:t}=e,{viewType:s}=(0,o.U)();return s===i.qi.Mobile?(0,n.jsx)(O,{accountId:t}):(0,n.jsx)(j,{accountId:t})}))},14730:(e,t,s)=>{"use strict";s.d(t,{w:()=>l});var n=s(74848),r=s(96540),o=s(99766),i=s(91200),a=s(71035),c=s(83906);const l=(0,r.memo)((e=>{const{tickList:t,stroke:s,strokeWidth:l=1,opacity:d,ticks:u=!0,preventDefault:g=!0}=e,[m]=(0,c.E)(),{width:h,height:p}=(0,i.W)(),{xAxisHeight:y}=(0,a.V)(),x=(0,r.useMemo)((()=>{const e=2*l;return[[{x:0,y:p-y},{x:h,y:p-y}],...u?t.map((t=>[{x:m(t),y:p-y},{x:m(t),y:p-y+e}])):[]]}),[u,t,h,p,l,y,m]);return(0,n.jsx)(o.m,{dataList:x,stroke:s,strokeWidth:l,opacity:d,preventDefault:g})}))},15171:(e,t,s)=>{"use strict";s.d(t,{h:()=>n});var n,r=s(1973),o=s(47280),i=s(68828),a=s(34016),c=s(23328),l=s(70768),d=s(12157),u=s(32923),g=s(99222),m=s(69991),h=s(25279),p=s(11468);!function(e){function t(e){switch(e){case r.SN.SYMBOL_DISTANCE_IN_POINTS:return o.G3.IN_POINTS;case r.SN.SYMBOL_DISTANCE_IN_PERCENTAGE:return o.G3.IN_PERCENTAGE;default:return o.G3.NO_DISTANCE}}function s(e){switch(e){case r.IG.CURRENCY:return o.MS.CURRENCY;case r.IG.QUOTE_CURRENCY:return o.MS.QUOTE_CURRENCY;default:return}}function n(e){switch(e){case r.T0.PERCENTAGE:return o.VR.Percent;case r.T0.POINTS:return o.VR.Points;case r.T0.PIPS:default:return o.VR.Pips}}e.fromProtoLightSymbol=function(e){var t;return Object.assign(Object.assign({},e),{name:null!==(t=e.name)&&void 0!==t?t:"Unknown Symbol",symbolId:e.id,translation:e.translation?[{locale:void 0,title:e.translation}]:void 0})},e.fromProtoSwapCalculationType=n,e.toProtoSwapCalculationType=e=>{switch(e){case o.VR.Percent:return r.T0.PERCENTAGE;case o.VR.Pips:return r.T0.PIPS;case o.VR.Points:return r.T0.POINTS;default:return(0,u.T)(e)}};const y=e=>{if(!e)return;const t=Object.values(p.T);return e.filter((e=>t.some((t=>t===e.locale)))).map((e=>e))};function x(e){switch(e){case r.I9.NONE:return;case r.I9.MONDAY:return g.Bw.Monday;case r.I9.TUESDAY:return g.Bw.Tuesday;case r.I9.WEDNESDAY:return g.Bw.Wednesday;case r.I9.THURSDAY:return g.Bw.Thursday;case r.I9.FRIDAY:return g.Bw.Friday;case r.I9.SATURDAY:return g.Bw.Saturday;case r.I9.SUNDAY:return g.Bw.Sunday;default:return(0,u.T)(e)}}function f(e){switch(e){case r.I9.MONDAY:return g.Bw.Monday;case r.I9.TUESDAY:return g.Bw.Tuesday;case r.I9.WEDNESDAY:return g.Bw.Wednesday;case r.I9.THURSDAY:return g.Bw.Thursday;case r.I9.FRIDAY:return g.Bw.Friday;case r.I9.SATURDAY:return g.Bw.Saturday;case r.I9.SUNDAY:return g.Bw.Sunday;default:return}}e.calculateFields=e=>{const{digits:t,pipPosition:s,distanceSetIn:n,slDistance:r,tpDistance:c,gslDistance:l,gslCharge:d}=e;return{pipPrecision:void 0!==t&&void 0!==s?t-s:void 0,slDistanceInPips:n===o.G3.IN_POINTS?(0,i.b1)((0,i.u8)(null!=r?r:0,t),s):void 0,slDistanceInPercent:n===o.G3.IN_PERCENTAGE?(0,a.u)(null!=r?r:0):void 0,tpDistanceInPips:n===o.G3.IN_POINTS?(0,i.b1)((0,i.u8)(null!=c?c:0,t),s):void 0,tpDistanceInPercent:n===o.G3.IN_PERCENTAGE?(0,a.u)(null!=c?c:0):void 0,gslDistanceInPips:n===o.G3.IN_POINTS?(0,i.b1)((0,i.u8)(null!=l?l:0,t),s):void 0,gslDistanceInPercent:n===o.G3.IN_PERCENTAGE?(0,a.u)(null!=l?l:0):void 0,gslChargeInPips:n===o.G3.IN_POINTS?(0,i.b1)((0,i.u8)(null!=d?d:0,t),s):void 0,gslChargeInPercent:n===o.G3.IN_PERCENTAGE?(0,a.u)(null!=d?d:0):void 0}},e.fromProto=function(g){var p,j,b,v,I,S,C,k;const O=function(e){switch(e){case r.k$.USD_PER_MILLION_USD:return o.Ge.USD_PER_MILLION_USD_VOLUME;case r.k$.USD_PER_LOT:return o.Ge.USD_PER_ONE_LOT;case r.k$.PERCENTAGE_OF_VALUE:return o.Ge.PERCENTAGE_OF_TRADING_VOLUME;case r.k$.QUOTE_CCY_PER_LOT:return o.Ge.QUOTE_CURRENCY_PER_ONE_LOT;default:return(0,u.T)(e)}}(g.commissionType),w=((e,t)=>{let s;switch(t){case o.Ge.USD_PER_MILLION_USD_VOLUME:case o.Ge.USD_PER_ONE_LOT:case o.Ge.QUOTE_CURRENCY_PER_ONE_LOT:s=(0,d.Ze)(e);break;case o.Ge.PERCENTAGE_OF_TRADING_VOLUME:s=(0,i.Bw)(e);break;default:(0,u.T)(t)}return s})(g.preciseTradingCommissionRate,O),T=(null!==(p=g.schedule)&&void 0!==p?p:[]).reduce(((e,t)=>{const s=(0,h.A)();return Object.assign(Object.assign({},e),{[s]:Object.assign(Object.assign({},t),{id:s})})}),{}),D=(0,c.RU)(g.minStake),P=(0,c.rS)(g.minVolume),N=null===(j=g.holiday)||void 0===j?void 0:j.map((e=>({holidayId:e.holidayId,name:e.name,scheduleTimeZone:e.scheduleTimeZone,holidayDate:e.holidayDate,timeStart:e.startSecond,timeEnd:e.endSecond,isAnnual:e.isRecurring}))),L=Object.assign(Object.assign({},g),{minCommissionAsset:(0,m.p)(g.minCommissionAsset),bbspAlias:g.bbspAlias||g.tradingCentralAlias,distanceSetIn:t(g.distanceSetIn),commissionType:O,minCommissionType:s(g.minCommissionType),swapCalculationType:n(g.swapCalculationType),commission:w,rolloverCommission:(0,l.G)(g.rolloverCommission),schedule:T,scheduleTimeZone:null!==(b=g.scheduleTimeZone)&&void 0!==b?b:"UTC",holiday:N,futuresSettings:g.futuresSettings,slDistance:null!==(v=g.slDistance)&&void 0!==v?v:0,tpDistance:null!==(I=g.tpDistance)&&void 0!==I?I:0,gslDistance:null!==(S=g.gslDistance)&&void 0!==S?S:0,minCommission:(0,d.Ze)(g.preciseMinCommission),lotSize:(0,c.rS)(g.lotSize),minStake:D,maxStake:(0,c.RU)(g.maxStake),stepStake:null!==(C=(0,c.RU)(g.stepStake))&&void 0!==C?C:D,minVolume:(0,c.rS)(g.minVolume),maxVolume:(0,c.rS)(g.maxVolume),stepVolume:null!==(k=(0,c.rS)(g.stepVolume))&&void 0!==k?k:P,swapRollover3Days:f(g.swapRollover3Days),skipSwapPeriods:g.skipSWAPPeriods,pnlConversionFeeRate:g.pnlConversionFeeRate?(0,a.u)(g.pnlConversionFeeRate):void 0,rolloverCommission3Days:x(g.rolloverCommission3Days),translation:y(g.translation)});return Object.assign(Object.assign({},L),e.calculateFields(L))},e.fromProtoArchived=function(e){return Object.assign(Object.assign({},e),{lotSize:(0,c.rS)(e.lotSize)})}}(n||(n={}))},15608:(e,t,s)=>{"use strict";s.d(t,{s:()=>u});var n=s(74848),r=s(96540),o=s(35026),i=s(1065),a=s(31287),c=s(64453);const l=(0,s(22679).K)((e=>{const{disabled:t,isHighlighted:s}=e,n=(0,i.r)("menuContent");return{root:(0,a.N)(n,Object.assign(Object.assign({display:"flex",overflow:"hidden",flexGrow:1,alignItems:"center",paddingRight:o.YK,paddingLeft:o.YK},(0,c.V)(o.r8)),{cursor:t||s?void 0:"pointer"}))}}));var d=s(95141);const u=(0,r.memo)((e=>{const{children:t,onClick:s,disabled:r,isHighlighted:o,testId:i="menu-item-content"}=e,{css:a}=(0,d.X)(l,{disabled:r,isHighlighted:o});return(0,n.jsx)("div",{className:a.root,onClick:s,children:t})}))},15622:(e,t,s)=>{"use strict";s.d(t,{U:()=>X});var n,r=s(74848),o=s(96540),i=s(47837),a=s(1767),c=s(63773);!function(e){const t=(0,c.D)("StrategyRoiHistory");e.load=t("LOAD"),e.loadDone=t("LOAD_DONE"),e.loadFailed=t("LOAD_FAILED"),e.subscribe=t("SUBSCRIBE"),e.unsubscribe=t("UNSUBSCRIBE"),e.intervalSubscribe=t("INTERVAL_SUBSCRIBE"),e.intervalUnsubscribe=t("INTERVAL_UNSUBSCRIBE"),e.updateLoadedPeriodList=t("UPDATE_LOADED_PERIOD_LIST")}(n||(n={}));var l=s(52019),d=s(33270),u=s(71853),g=s(98549),m=s(99684);const h=(0,g.h)(u.DM).case(n.loadDone,((e,t)=>{const{history:s}=t;for(const t of s)e.data[t.timestamp]=t;e.networkStatus=m.p.Done})).case(n.loadFailed,(e=>{e.networkStatus=m.p.Failed})).case(n.updateLoadedPeriodList,((e,t)=>{const{periodList:s}=t;e.loadedPeriodList=s})),p=(0,s(41233).K)({subscribeAction:n.subscribe,unsubscribeAction:n.unsubscribe}),y=(0,g.h)(u.ZN).casesWithAction([n.subscribe,n.unsubscribe],((e,t)=>{e.subscribers=p(e.subscribers,t)})).casesWithAction([n.loadDone,n.loadFailed,n.updateLoadedPeriodList],((e,t)=>{var s;const{strategyId:n}=t.payload;e.data[n]=h(null===(s=e.data)||void 0===s?void 0:s[n],t)}));var x,f=s(82823),j=s(47873),b=s(83895),v=s(28452),I=s(81160),S=s(49510),C=s(79005),k=s(97176),O=s(80070),w=s(23314),T=s(51863),D=s(31635),P=s(34016);!function(e){e.fromProto=function(e){const{strategyProviderId:t,providerTimeWeightedRoi:s}=e,n=(0,D.Tt)(e,["strategyProviderId","providerTimeWeightedRoi"]);return Object.assign(Object.assign({},n),{roi:(0,P.u)(s)})}}(x||(x={}));var N=s(44468),L=s(76269),B=s(23656),H=s(72199),E=s(56136),A=s(58932),R=s(64053),F=s(58142),M=s(79516);const _=(0,H._N)([(0,E.r)((0,k.Hy)(A.i).subscribers())],(e=>Object.entries((0,R.$)(e,"strategyId")).map((([e,t])=>{const[s]=(0,M.K)(t,(e=>e.from)),[,n]=(0,M.K)(t,(e=>e.to));return{strategyId:e,from:s,to:n}}))))(Object.assign(Object.assign({},(0,F.Z6)()),{keySelector:k.eW}));var W=s(84720),K=s(43481);const Y=(0,f.H)(((e,t)=>(0,B.g)(t.pipe((0,I.T)(_)),t.pipe((0,I.T)(W.E)),{dueTime:u.y_,unsubscribeCurrentKeysOnPause:!0}).pipe((0,v.Z)((({subscribe:e,unsubscribe:t})=>{const s=[];return e.length>0&&s.push(n.intervalSubscribe(e)),t.length>0&&s.push(n.intervalUnsubscribe(t)),s})))),(e=>(0,K.a)(e.pipe((0,j.l)(n.intervalSubscribe)),e.pipe((0,j.l)(n.intervalUnsubscribe)),{updateInterval:u.g4}).pipe((0,v.Z)((e=>e.map((e=>n.load({strategyId:e.strategyId,period:{from:e.from,to:e.to}}))))))),((e,t,s)=>e.pipe((0,j.l)(n.load),(0,b.Y)((()=>t)),(0,v.Z)((([e,t])=>{const{strategyId:r,period:o}=e,i=(0,k.Hy)(N.f).loadedPeriodList()(t,{strategyId:r}),a=(0,O.M)(o,i);if(!a.length)return[n.loadDone({strategyId:r,history:[]})];const c=a.map((e=>s.copy.api.tWRoiByProvider({strategyProviderId:[C.V.strategyIdToProto(r)],fromTimestamp:(0,w.xA)(e.from,0),toTimestamp:(0,w.xA)(e.to,0)}).pipe((0,I.T)((e=>e.roi||[])))));return(0,S.z)(c).pipe((0,v.Z)((e=>{const t=e.flat().map((e=>x.fromProto(e)));return[n.loadDone({strategyId:r,history:t}),n.updateLoadedPeriodList({strategyId:r,periodList:(0,T.K)([...i,{from:o.from,to:o.to}])})]})),(0,L.f)((e=>(s.logger.error("[Effect Error]: load strategy roi history",e),[n.loadFailed({strategyId:r})]))))}))))),V=(0,o.memo)((()=>((0,l.n)("strategyRoiHistory",y,!1),(0,d.S)(Y),null)));var Z=s(39701),U=s(52293);const J=(0,H._N)([U.c],(e=>({isStrategyExist:e})))(Object.assign(Object.assign({},(0,F.Z6)()),{keySelector:(0,k.Jk)().strategyId()})),X=(0,o.memo)((e=>{const{strategyId:t,from:s,to:o}=e,{isStrategyExist:c}=(0,Z.d4)(J,{strategyId:t}),l={strategyId:t,from:s,to:o};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.c,{strategyId:t}),(0,r.jsx)(V,{}),c&&(0,r.jsx)(a.x,{param:l,subscribe:n.subscribe,unsubscribe:n.unsubscribe})]})}))},15644:(e,t,s)=>{"use strict";s.d(t,{D:()=>I});var n=s(74848),r=s(96540),o=s(95141),i=s(22679),a=s(35026);const c=(0,i.K)((e=>{const{foregroundColor:t}=e.theme.palette.semantic,{body:s}=e.theme.font.semantic;return{root:{position:"relative",fill:t.secondary,width:"100%"},input:{paddingRight:s.primary+2*a.YK},clear:{position:"absolute",top:1,right:1,":hover":{cursor:"pointer"}}}}));var l=s(96412),d=s(61256),u=s(4585),g=s(17481);const m=(0,r.memo)((e=>{const{value:t,placeholder:s,disabled:i,autoFocus:a,forceCrossIcon:m,onChange:h,onKeyUp:p,onClear:y,onFocus:x,onBlur:f,testId:j,extend:b}=e,{css:v,rules:I}=(0,o.X)(c,{extend:b}),S=t&&y||m?l.JQ.Cross:l.JQ.Search,C=(0,r.useCallback)((e=>{e.stopPropagation(),null==y||y("")}),[y]);return(0,n.jsxs)("div",{className:v.root,children:[(0,n.jsx)(g.p,{value:t,placeholder:s,disabled:i,autoFocus:a,onChange:h,onKeyUp:p,onFocus:x,onBlur:f,testId:j,extend:{input:I.input}}),(0,n.jsx)(u.E,{onClick:C,testId:"clear-control",extend:{root:I.clear},children:(0,n.jsx)(d.I,{source:S,size:l.lK.Control})})]})}));var h=s(81588),p=s(53632),y=s(64028),x=s(65012),f=s(65501);const j=(0,i.K)((e=>{const{buttonBackgroundColor:t}=e.theme.palette.semantic,{subtitle:s}=e.theme.typography.semantic;return{root:Object.assign(Object.assign(Object.assign({minHeight:32},(0,x.M)(0,a.WQ)),(0,f.T)({color:t.accentNormal})),{nested:{":hover":Object.assign({},(0,f.T)({color:t.accentNormal}))}}),input:Object.assign(Object.assign({},(0,y.I)(s.secondary)),{letterSpacing:"-0.34px"}),control:{width:28,height:28},prefix:Object.assign({},(0,x.M)(0,a.WQ,0,0))}}));var b=s(43679);const v=(0,r.memo)((e=>{const{value:t,placeholder:s,onChange:i,onClear:a,testId:c,extend:m}=e,{rules:h}=(0,o.X)(j,{extend:m}),p=(0,r.useCallback)((e=>{e.stopPropagation(),null==a||a("")}),[a]),y=(0,r.useMemo)((()=>(0,n.jsx)(u.E,{extend:{root:h.control},children:(0,n.jsx)(d.I,{fill:l.$D.Secondary,source:l.JQ.SearchMobile})})),[h.control]),x=(0,r.useMemo)((()=>t?(0,n.jsx)(u.E,{onClick:p,extend:{root:h.control},children:(0,n.jsx)(d.I,{fill:l.$D.Secondary,source:l.JQ.Cross})}):null),[t,p,h.control]);return(0,n.jsx)(g.p,{variant:b.S.Unset,value:t,placeholder:s,onChange:i,prefix:y,postfix:x,testId:c,extend:{root:h.root,input:h.input,prefix:h.prefix}})})),I=(0,r.memo)((e=>{const{value:t,placeholder:s,disabled:r,autoFocus:o,forceCrossIcon:i,onChange:a,onKeyUp:c,onFocus:l,onBlur:d,onClear:u,extend:g,testId:y}=e,{viewType:x}=(0,h.U)();return x===p.qi.Mobile?(0,n.jsx)(v,{value:t,placeholder:s,onChange:a,onClear:u,testId:y,extend:g}):(0,n.jsx)(m,{value:t,placeholder:s,disabled:r,autoFocus:o,forceCrossIcon:i,onChange:a,onClear:u,onKeyUp:c,onFocus:l,onBlur:d,testId:y,extend:g})}))},15682:(e,t,s)=>{"use strict";s.d(t,{E:()=>j});var n=s(74848),r=s(96540),o=s(95141),i=s(64453),a=s(35026),c=s(22679);const l=(0,c.K)((e=>{const{stretch:t}=e;return{root:Object.assign({},t&&{flexGrow:1,display:"flex"}),title:{},radioBlock:Object.assign({},t&&{flexGrow:1,display:"flex"}),radio:Object.assign(Object.assign(Object.assign({marginRight:0},(0,i.V)(2*a.JI)),{nested:{":first-child":{marginLeft:0}}}),t&&{flexGrow:1,justifyContent:"center"})}}));var d=s(21078),u=s(40639),g=s(65501),m=s(65012),h=s(20943);const p=(0,c.K)((e=>{const{checked:t,disabled:s}=e,{buttonBackgroundColor:n,foregroundColor:r}=e.theme.palette.semantic,{secondary:o}=e.theme.font.semantic.body;let i=Object.assign(Object.assign({color:n.playNormal},(0,u.P)(1,n.playNormal)),{nested:{":hover":Object.assign({color:r.primary1},(0,g.T)({color:n.playHover}))}});return t&&(i=Object.assign(Object.assign(Object.assign({color:r.primary1},(0,u.P)(1,n.playNormal)),(0,g.T)({color:n.playHover})),{nested:{":hover":Object.assign({color:r.primary1},(0,g.T)({color:n.playHover}))}})),s&&(i=Object.assign(Object.assign(Object.assign({color:r.primary1},(0,u.P)(1,n.playNormal)),(0,g.T)({color:n.playDisabled})),{nested:{":hover":Object.assign({color:r.primary1},(0,g.T)({color:n.playDisabled}))}})),{root:Object.assign(Object.assign({marginLeft:a.WQ},(0,m.M)(4,12)),i),radio:{display:"none"},label:Object.assign(Object.assign({},(0,h.L)(0)),{textTransform:"uppercase",whiteSpace:"nowrap",color:"inherit",fontSize:o,lineHeight:1})}})),y=(0,r.memo)((e=>{const{children:t,title:s,testId:r,checked:i,disabled:a,onChange:c,value:l,extend:u}=e,{rules:g}=(0,o.X)(p,{checked:i,disabled:a,extend:u});return(0,n.jsx)(d.s,{value:l,checked:i,disabled:a,onChange:c,title:s,testId:r,extend:g,children:t})}));var x=s(73227),f=s(31523);const j=(0,r.memo)((e=>{const{data:t,value:s,disabled:i,stretch:a,onChange:c,extend:d}=e,{rules:u}=(0,o.X)(l,{stretch:a,extend:d}),g=(0,r.useCallback)((e=>{if(i||!c)return;const s=t.find((t=>t.value===e));s&&!s.disabled&&c(e)}),[t,i,c]);return(0,n.jsx)(x.z,{layout:f.J.Horizontal,value:s,disabled:i,onChange:g,itemsGap:0,extend:{root:u.root,title:u.title,radioBlock:u.radioBlock,radio:u.radio},children:t.map(((e,t)=>(0,n.jsx)(y,{value:e.value,disabled:i||e.disabled,title:e.title,testId:e.testId,children:e.label},`${e.label}-${t}`)))})}))},16010:(e,t,s)=>{"use strict";s.d(t,{C:()=>r,R:()=>n});const n={transactions:{},networkStatus:s(99684).p.None},r={data:{},subscribers:[]}},16145:(e,t,s)=>{"use strict";function n(e,t,s){const n={};for(let r=0;r<e.length;r++){const o=e[r],i=s.head[o.id];n[o.id]=i&&i[t]}return n}s.d(t,{c:()=>n})},16198:(e,t,s)=>{"use strict";s.d(t,{N:()=>o});var n=s(96540),r=s(25888);const o=()=>(0,n.useContext)(r.L)},16282:(e,t,s)=>{"use strict";s.d(t,{q:()=>l});var n=s(74848),r=s(96540),o=s(73245),i=s(4511),a=s(22085),c=s(9729);const l=(0,r.memo)((e=>{const{margin:t,marginLevel:s,expanded:r}=e,{t:l}=(0,o.B)(),d=`${l("Margin level")}:`,u=l("Margin level = (equity - estimated closing commission) / margin used expressed as a percentage. When your margin level is equal to the stop out level, your positions get stopped out");return(0,n.jsx)(i.v,{label:d,tooltip:u,expanded:r,testId:"margin-level",children:(null==t?void 0:t.gt(0))&&void 0!==s?(0,a.l)()(s):c.xH})}))},16420:(e,t,s)=>{"use strict";s.d(t,{C:()=>A});var n,r=s(74848),o=s(96540),i=s(1767),a=s(63773);!function(e){const t=(0,a.D)("AccountEvent");e.subscribe=t("SUBSCRIBE"),e.protocolSubscribe=t("PROTOCOL_SUBSCRIBE"),e.unsubscribe=t("UNSUBSCRIBE"),e.protocolUnsubscribe=t("PROTOCOL_UNSUBSCRIBE")}(n||(n={}));var c=s(52019),l=s(33270);const d={subscribers:[]};var u=s(98549);const g=(0,s(41233).K)({subscribeAction:n.subscribe,unsubscribeAction:n.unsubscribe}),m=(0,u.h)(d).casesWithAction([n.subscribe,n.unsubscribe],((e,t)=>{e.subscribers=g(e.subscribers,t)}));var h=s(82823),p=s(47873),y=s(83895),x=s(28452),f=s(92518),j=s(79005),b=s(97176),v=s(76269),I=s(92191),S=s(23656),C=s(81160),k=s(84720),O=s(72199),w=s(92963);const T=(0,b.vY)((e=>e.accountEvent),d);var D=s(39311),P=s(56045),N=s(58142);const L=(0,O._N)([D.O,P.W],((e,t)=>e&&!t))(Object.assign(Object.assign({},(0,N.Z6)()),{keySelector:(0,b.Jk)().accountId()})),B=(0,w._)((0,b.Hy)(T).subscribers(),L),H=(0,h.H)(((e,t)=>(0,S.g)(t.pipe((0,C.T)(B)),t.pipe((0,C.T)(k.E))).pipe((0,x.Z)((({subscribe:e,unsubscribe:t})=>[...e.map((e=>n.protocolSubscribe(e))),...t.map((e=>n.protocolUnsubscribe(e)))])))),((e,t,s)=>e.pipe((0,p.l)(n.protocolSubscribe),(0,y.Y)((()=>t)),(0,x.Z)((([e,t])=>{const{accountId:n}=e,r=(0,b.Hy)(f._).sharingCode()(t);return s.copy.api.subscribeTraderExecutionEvents(Object.assign(Object.assign({},j.V.accountIdToProto(n)),{sharingCode:r})).pipe((0,x.Z)((()=>[])),(0,v.f)((e=>(s.logger.error("[Effect Error]: subscribe to account",e),[]))))})))),((e,t,s)=>e.pipe((0,p.l)(n.protocolUnsubscribe),(0,y.Y)((()=>t)),(0,x.Z)((([e,t])=>{const{accountId:n}=e;if(!(0,b.Hy)(I.E).accountId()(t,{accountId:n}))return[];const r=(0,b.Hy)(f._).sharingCode()(t);return s.copy.api.unsubscribeTraderExecutionEvents(Object.assign(Object.assign({},j.V.accountIdToProto(n)),{sharingCode:r})).pipe((0,x.Z)((()=>[])),(0,v.f)((e=>(s.logger.error("[Effect Error]: unsubscribe from account",e),[]))))}))))),E=(0,o.memo)((()=>((0,c.n)("accountEvent",m),(0,l.S)(H),null))),A=(0,o.memo)((e=>{const{accountId:t}=e,s={accountId:t};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(E,{}),(0,r.jsx)(i.x,{param:s,subscribe:n.subscribe,unsubscribe:n.unsubscribe})]})}))},16575:(e,t,s)=>{"use strict";s.d(t,{O:()=>d});var n=s(96540),r=s(72199),o=s(97176),i=s(58142);let a;const c=(0,r._N)([(0,o.Jk)().text(),(0,o.Jk)().fontFamily(),(0,o.Jk)().fontSize()],((e,t,s)=>{const n=a||(a=document.createElement("canvas").getContext("2d"),a);n.font=`${s}px ${t}`;const r=n.measureText(e);return{width:r.width,height:Math.abs(r.actualBoundingBoxAscent)+Math.abs(r.actualBoundingBoxDescent)}}))(Object.assign(Object.assign({},(0,i.Z6)()),{keySelector:(0,o.xd)((0,o.Jk)().fontFamily(),(0,o.Jk)().fontSize(),(0,o.Jk)().text())}));var l=s(58331);const d=e=>{const{fontSize:t,lineHeight:s,fontFamily:r}=e,[o]=(0,l.W)(),i=(0,n.useMemo)((()=>(e=>{const{fontSize:t,lineHeight:s=1,fontFamily:n}=e;return(e="")=>{const r=e.split("\n"),o=[];let i=0;for(let e=0,s=r.length;e<s;++e){const s=r[e],{width:a}=c(void 0,{fontSize:t,fontFamily:n,text:s});o.push({text:s,width:a,lastInParagraph:!1}),i=Math.max(i,a),o[o.length-1]&&(o[o.length-1].lastInParagraph=!0)}return[i,t*s*o.length]}})({fontSize:o.smooth(t),lineHeight:s,fontFamily:r})),[t,s,r,o]);return(0,n.useCallback)((e=>{if(void 0===e)return[0,0];const[t,s]=i(e);return[Math.ceil(o.invert(t)),Math.ceil(o.invert(s))]}),[i,o])}},16929:(e,t,s)=>{"use strict";s.d(t,{d:()=>o});var n=s(96540),r=s(79516);const o=(e,t)=>(0,n.useMemo)((()=>(0,r.K)(e,t)),[e,t])},16972:(e,t,s)=>{"use strict";s.d(t,{m:()=>W});var n=s(96540),r=s(52019),o=s(33270),i=s(98549),a=s(99684),c=s(18888),l=s(4786);const d=(0,i.h)(c.ub).case(l.D.loadDone,((e,t)=>{const{positionList:s}=t;e.positions={};for(const t of s)e.positions[t.positionId]=t;e.networkStatus=a.p.Done})).case(l.D.loadFailed,(e=>{e.networkStatus=a.p.Failed})).case(l.D.update,((e,t)=>{const{position:s}=t;e.positions[s.positionId]=t.position})),u=(0,s(41233).K)({subscribeAction:l.D.subscribe,unsubscribeAction:l.D.unsubscribe}),g=(0,i.h)(c.H5).casesWithAction([l.D.subscribe,l.D.unsubscribe],((e,t)=>{e.subscribers=u(e.subscribers,t)})).casesWithAction([l.D.load,l.D.loadDone,l.D.loadFailed,l.D.update],((e,t)=>{var s;const{accountId:n}=t.payload;e.data[n]=d(null===(s=e.data)||void 0===s?void 0:s[n],t)}));var m=s(82823),h=s(72199),p=s(97176),y=s(39289),x=s(92963),f=s(39311),j=s(58142);const b=(0,h._N)([f.O],(e=>e))(Object.assign(Object.assign({},(0,j.Z6)()),{keySelector:(0,p.Jk)().accountId()})),v=(0,x._)((0,p.Hy)(y.$).subscribers(),b);var I,S=s(23656),C=s(81160),k=s(28452),O=s(84720),w=s(47873),T=s(83895),D=s(92518),P=s(79005),N=s(73301),L=s(46533),B=s(8437),H=s(23328),E=s(12157),A=s(32923),R=s(15171);!function(e){function t(e){return Object.assign({name:e.symbolName,digits:e.digits,pipPosition:e.pipPosition,baseAssetName:e.baseAssetName},R.h.calculateFields(e))}function s(e){switch(e){case N.ZN.POSITION_STATUS_OPEN:return B.N.POSITION_STATUS_OPEN;case N.ZN.POSITION_STATUS_CLOSED:return B.N.POSITION_STATUS_CLOSED;case N.ZN.POSITION_STATUS_CREATED:return B.N.POSITION_STATUS_CREATED;case N.ZN.POSITION_STATUS_ERROR:return B.N.POSITION_STATUS_ERROR;case N.ZN.POSITION_STATUS_DECLINED:return B.N.POSITION_STATUS_DECLINED;case N.ZN.POSITION_STATUS_PENDING_CLOSED:return B.N.POSITION_STATUS_PENDING_CLOSED;case N.ZN.POSITION_STATUS_FINAL_ERROR:return B.N.POSITION_STATUS_FINAL_ERROR;default:return(0,A.T)(e)}}e.toDomain=function(e){var n;return Object.assign(Object.assign({},e),{tradeSide:L.L.fromProtoTradeSide(e.tradeSide),positionStatus:s(e.positionStatus),volume:(0,H.rS)(e.volume),commission:(0,E.c8)(e.commission,e.moneyDigits),mirroringCommission:(0,E.c8)(e.mirroringCommission,e.moneyDigits),introducingBrokerCommission:(0,E.c8)(e.introducingBrokerCommission,e.moneyDigits),profitInPips:null!==(n=e.profitInPips)&&void 0!==n?n:0,profit:(0,E.c8)(e.profit,e.moneyDigits),swap:(0,E.c8)(e.swap,e.moneyDigits),usedMargin:(0,E.c8)(e.usedMargin,e.moneyDigits),symbol:t(e.symbol)})},e.fromProtoSymbol=t,e.fromProtoPositionStatus=s}(I||(I={}));var F=s(76269),M=s(43481);const _=(0,m.H)(((e,t)=>(0,S.g)(t.pipe((0,C.T)(v)),t.pipe((0,C.T)(O.E)),{unsubscribeCurrentKeysOnPause:!0}).pipe((0,k.Z)((({subscribe:e,unsubscribe:t})=>{const s=[];return e.length>0&&s.push(l.D.intervalSubscribe(e)),t.length>0&&s.push(l.D.intervalUnsubscribe(t)),s})))),((e,t,s)=>e.pipe((0,w.l)(l.D.load),(0,T.Y)((()=>t)),(0,k.Z)((([e,t])=>{const{accountId:n,cursor:r}=e,o=(0,p.Hy)(D._).sharingCode()(t);return s.copy.api.traderPositionList(Object.assign(Object.assign({},P.V.accountIdToProto(n)),{limit:c.mJ,cursor:r,sharingCode:o})).pipe((0,k.Z)((e=>{var t;const{nextCursor:s}=e,r=null!==(t=e.position)&&void 0!==t?t:[];return[l.D.loadDone({accountId:n,positionList:r.map((e=>I.toDomain(e)))}),...s?[l.D.load({accountId:n,cursor:s})]:[]]})),(0,F.f)((e=>(s.logger.error(`[Effect Error]: load account position list for ${n}`,e),[l.D.loadFailed({accountId:n})]))))})))),(e=>(0,M.a)(e.pipe((0,w.l)(l.D.intervalSubscribe)),e.pipe((0,w.l)(l.D.intervalUnsubscribe)),{updateInterval:c.Hp}).pipe((0,k.Z)((e=>e.map((e=>l.D.load(e)))))))),W=(0,n.memo)((()=>((0,r.n)("accountPosition",g,!1),(0,o.S)(_),null)))},17015:(e,t,s)=>{"use strict";s.d(t,{p:()=>oe});var n,r,o=s(74848),i=s(96540);!function(e){e.Untitled="Untitled",e.Long="Long",e.Short="Short",e.Total="Total"}(n||(n={})),function(e){e.SymbolName="symbolName",e.TotalTrades="totalTrades",e.TotalTradesLong="totalTradesLong",e.TotalTradesShort="totalTradesShort",e.TotalPipsWon="totalPipsWon",e.TotalPipsWonLong="totalPipsWonLong",e.TotalPipsWonShort="totalPipsWonShort",e.NetProfitTotal="netProfitTotal",e.NetProfitLong="netProfitLong",e.NetProfitShort="netProfitShort",e.LosingTrades="losingTrades",e.WinningTrades="winningTrades"}(r||(r={}));var a=s(46642),c=s(27098),l=s(73245),d=s(36969),u=s(9729),g=s(1038),m=s(63426),h=s(50930),p=s(28359),y=s(96159);function x(e){const t=(0,p.C)(e);return(null==t?void 0:t.gt(0))?y.r.Positive:(null==t?void 0:t.lt(0))?y.r.Negative:y.r.Primary}var f=s(24985),j=s(21884),b=s(95141),v=s(22679),I=s(1065),S=s(65501);const C=(0,v.K)((e=>{const{backgroundColor:t}=e.theme.palette.semantic,s=(0,I.r)("withUnderline");return{root:{position:"relative",zIndex:3,nested:{[`:last-child > .${s}`]:{nested:{":after":Object.assign({bottom:-2},(0,S.T)({color:t.strokeNormal}))}}}}}}));var k=s(41401);const O=(0,i.memo)((e=>{const{flattenKey:t,isLastElement:s}=e,{rules:n}=(0,b.X)(C);return(0,o.jsx)(k.w,{flattenKey:t,isLastElement:s,extend:{root:n.root}})}));var w=s(88946),T=s(64453),D=s(35026);const P=e=>({justifyContent:e===r.SymbolName?"flex-start":"flex-end",paddingLeft:e===r.SymbolName?2*D.YK:0,paddingRight:e===r.NetProfitLong||e===r.NetProfitShort?8*D.YK:D.YK}),N=(0,v.K)((e=>{const{columnId:t,flexBasis:s}=e;return{root:Object.assign({flexBasis:s},(0,T.V)(0)),content:Object.assign({},P(t))}}));var L=s(90539),B=s(5756),H=s(45265);const E=e=>{const t=(0,L.X)(B.bB),s=(0,L.X)(B.V6)[e];return(0,H.c)(s.basis,t-7*D.YK)},A=(0,i.memo)((e=>{const{flattenKey:t,columnId:s}=e,n=E(s),{rules:r}=(0,b.X)(N,{columnId:s,flexBasis:n});return(0,o.jsx)(w.e,{flattenKey:t,columnId:s,extend:{root:r.root,content:r.content}})}));var R=s(30981);const F=(0,v.K)((e=>{const{columnId:t,sorting:s,columnWidth:n,backgroundColor:r,tableHeight:o,isSortingAvailable:i}=e,{foregroundColor:a,backgroundColor:c}=e.theme.palette.semantic;return{root:Object.assign(Object.assign(Object.assign({display:"flex",width:n,alignItems:"center",justifyContent:"center",whiteSpace:"nowrap",position:"relative",color:a.tertiary,fill:a.tertiary,minWidth:0,cursor:i?"pointer":"default"},(0,S.T)({color:r})),(0,T.V)(0)),{nested:{":before":Object.assign({content:'""',display:"block",position:"absolute",top:30,height:o,right:0,left:0,bottom:0,zIndex:2,pointerEvents:"none"},(0,S.T)({color:r})),":after":Object.assign({display:"block",position:"absolute",height:1,right:0,left:0,content:'""',bottom:0},(0,S.T)({color:c.strokeNormal}))}}),title:Object.assign(Object.assign({},P(t)),{display:"flex",flexGrow:1,alignItems:"center",overflow:"hidden"}),icon:{transform:s===R.UE.Asc?"rotate(180deg)":void 0}}}));var M=s(38366),_=s(61256),W=s(96412),K=s(91200),Y=s(80124);const V=()=>{const{t:e}=(0,l.B)(),{theme:t}=(0,Y.D)(),{backgroundColor:s}=t.palette.semantic;return(0,i.useMemo)((()=>[{id:n.Untitled,backgroundColor:s.primaryNormal,columns:[r.SymbolName]},{id:n.Long,title:e("Long"),backgroundColor:s.tertiaryNormal,columns:[r.TotalTradesLong,r.TotalPipsWonLong,r.NetProfitLong]},{id:n.Short,title:e("Short"),backgroundColor:s.primaryNormal,columns:[r.TotalTradesShort,r.TotalPipsWonShort,r.NetProfitShort]},{id:n.Total,title:e("Total"),backgroundColor:s.tertiaryNormal,columns:[r.TotalTrades,r.TotalPipsWon,r.NetProfitTotal,r.WinningTrades,r.LosingTrades]}]),[e,s])},Z=(0,i.memo)((e=>{const{columnId:t,sorting:s,onChangeSort:n,isSortingAvailable:r}=e,a=(0,L.X)(B.V6)[t],{height:c}=(0,K.W)(),l=E(t),d=V().find((e=>e.columns.some((e=>e===t)))),u=(0,i.useCallback)((()=>{r&&n(t)}),[t,r,n]),{css:g}=(0,b.X)(F,{columnId:t,sorting:s,columnWidth:l,isSortingAvailable:r,backgroundColor:d.backgroundColor,tableHeight:c});return(0,o.jsx)("div",{className:g.root,onClick:u,children:(0,o.jsxs)("div",{className:g.title,children:[(0,o.jsxs)(M.x,{placement:"top-end",children:[a.Header?a.Header():"",a.title]}),Boolean(s)&&(0,o.jsx)("div",{className:g.icon,children:(0,o.jsx)(_.I,{size:W.lK.Small,source:W.JQ.TreeExpanded})})]})})}));var U=s(65012);const J=(0,v.K)((()=>({root:Object.assign({display:"flex",flexDirection:"row",flexShrink:0,height:60},(0,U.M)(0,0,0,4*D.YK))})));var X=s(2370),$=s(15557),q=s(40639),Q=s(76728);const z=(0,v.K)((e=>{const{backgroundColor:t}=e,{backgroundColor:s}=e.theme.palette.semantic;return{root:Object.assign(Object.assign({display:"flex",flexDirection:"column"},(0,S.T)({color:t})),{nested:{":last-child":{paddingRight:5*D.YK}}}),title:Object.assign({display:"flex",alignItems:"center",justifyContent:"center",height:30},(0,q.P)(1,s.strokeNormal,Q.lQ.Bottom)),headerItem:{display:"flex",height:30}}}));var G=s(54601);const ee=(0,i.memo)((e=>{const{title:t,visibleColumnList:s,groupColumnList:n,groupIndex:r,backgroundColor:i}=e,a=(0,G.x)(B.jH),c=V(),{css:l}=(0,b.X)(z,{backgroundColor:i});return(0,o.jsxs)("div",{className:l.root,children:[(0,o.jsx)("div",{className:l.title,children:(0,o.jsx)($.B,{textColor:y.r.Tertiary,children:t})}),(0,o.jsx)("div",{className:l.headerItem,children:n.map(((e,t)=>{let i,l;const d=c[r-1],u=c[r+1];if(n[t-1])i=n[t-1];else if(d){const e=d.columns.filter((e=>s.some((t=>t.id===e))));i=e[e.length-1]}return n[t+1]?l=n[t+1]:u&&(l=u.columns.filter((e=>s.some((t=>t.id===e))))[0]),(0,o.jsx)(a,{columnId:e,prevColumnId:i,nextColumnId:l},e)}))})]})})),te=(0,i.memo)((()=>{const e=(0,L.X)(B.V6),t=(0,X.W)(e),s=V(),{css:n}=(0,b.X)(J);return(0,o.jsx)("div",{className:n.root,children:s.map(((e,s)=>{const{title:n="",columns:r,id:i,backgroundColor:a}=e,c=r.filter((e=>t.some((t=>t.id===e))));return c.length?(0,o.jsx)(ee,{title:n,groupIndex:s,visibleColumnList:t,groupColumnList:c,backgroundColor:a},i):null}))})}));var se=s(32161);const ne=(0,v.K)((e=>{const{backgroundColor:t}=e.theme.palette.semantic;return{root:Object.assign({},(0,U.M)(0,0,0,4*D.YK)),scroll:Object.assign(Object.assign({},(0,U.M)(0,2*D.YK,2*D.YK,0)),(0,S.T)({color:t.tertiaryNormal}))}})),re=(0,i.memo)((()=>{const{rules:e}=(0,b.X)(ne);return(0,o.jsx)(se.I,{extend:{root:e.root,scroll:e.scroll}})})),oe=(0,i.memo)((e=>{const{data:t,assetDigits:s,depositDisplayName:n,onChangeSort:p,sortingDirection:y,sortingColumn:b}=e,v=(e=>{const{assetDigits:t,depositDisplayName:s}=e,{t:n}=(0,l.B)();return(0,i.useMemo)((()=>[{id:r.SymbolName,Header:()=>n("Symbol"),title:n("Symbol"),basis:"15%",accessor:e=>e.symbolName,filterKeys:(e,t)=>{if(t.translation)return[...t.translation.map((e=>e.title))]},ExpandComponent:e=>(0,o.jsx)(j.J,{symbolName:e}),Cell:e=>(0,o.jsx)(j.J,{symbolName:e})},{id:r.TotalTradesLong,Header:()=>n("Deals"),title:n("Deals"),basis:"5%",accessor:e=>e.totalTradesLong,formatter:e=>e?(0,d.B)()(e):u.xH},{id:r.TotalPipsWonLong,Header:()=>n("Pips"),title:n("Pips"),basis:"7.5%",accessor:e=>e.totalPipsWonLong,formatter:e=>e?(0,g.nR)()(e):u.xH,Cell:(e,t)=>{const s=x(e);return(0,o.jsx)(f.X,{textColor:s,children:t})}},{id:r.NetProfitLong,Header:()=>n("Net profit"),title:n("Net profit"),basis:"12.5%",accessor:e=>e.netProfitLong,formatter:e=>e?(0,m._)({digits:t,prefix:s,average:!0})(e):u.xH,Cell:(e,t)=>{const s=x(e);return(0,o.jsx)(f.X,{textColor:s,children:t})}},{id:r.TotalTradesShort,Header:()=>n("Deals"),title:n("Deals"),basis:"5%",accessor:e=>e.totalTradesShort,formatter:e=>e?(0,d.B)()(e):u.xH},{id:r.TotalPipsWonShort,Header:()=>n("Pips"),title:n("Pips"),basis:"7.5%",accessor:e=>e.totalPipsWonShort,formatter:e=>e?(0,g.nR)()(e):u.xH,Cell:(e,t)=>{const s=x(e);return(0,o.jsx)(f.X,{textColor:s,children:t})}},{id:r.NetProfitShort,Header:()=>n("Net profit"),title:n("Net profit"),basis:"12.5%",accessor:e=>e.netProfitShort,formatter:e=>e?(0,m._)({digits:t,prefix:s,average:!0})(e):u.xH,Cell:(e,t)=>{const s=x(e);return(0,o.jsx)(f.X,{textColor:s,children:t})}},{id:r.TotalTrades,Header:()=>n("Deals"),title:n("Deals"),basis:"5.25%",accessor:e=>e.totalTrades,formatter:e=>e?(0,d.B)()(e):u.xH},{id:r.TotalPipsWon,Header:()=>n("Pips"),title:n("Pips"),basis:"7%",accessor:e=>e.totalPipsWon,formatter:e=>e?(0,g.nR)()(e):u.xH,Cell:(e,t)=>{const s=x(e);return(0,o.jsx)(f.X,{textColor:s,children:t})}},{id:r.NetProfitTotal,Header:()=>n("Net profit"),title:n("Net profit"),basis:"8.75%",accessor:e=>e.netProfitTotal,formatter:e=>e?(0,m._)({digits:t,prefix:s,average:!0})(e):u.xH,Cell:(e,t)=>{const s=x(e);return(0,o.jsx)(f.X,{textColor:s,children:t})}},{id:r.WinningTrades,Header:()=>`${n("Won")} (%)`,title:`${n("Won")} (%)`,basis:"7%",accessor:e=>e.symbolId,formatter:(e,t)=>t?(0,h.W)(t.winningTradesRatio)(t.winningTrades):u.xH},{id:r.LosingTrades,Header:()=>`${n("Lost")} (%)`,title:`${n("Lost")} (%)`,basis:"7%",accessor:e=>e.symbolId,formatter:(e,t)=>t?(0,h.W)(t.losingTradesRatio)(t.losingTrades):u.xH}]),[t,s,n])})({assetDigits:s,depositDisplayName:n}),I=(0,i.useCallback)((e=>e.symbolName),[]),S=(0,i.useCallback)((e=>{p(e)}),[p]),C=(0,i.useCallback)((e=>{const{columnId:t}=e;return(0,o.jsx)(Z,{columnId:t,sorting:t===b&&y,onChangeSort:S,isSortingAvailable:t!==r.SymbolName})}),[S,b,y]);return(0,o.jsx)(a.X,{id:"SymbolStatisticTable",type:c.l.Thin,data:t,columns:v,keyAccessor:I,rowHeight:30,isHoveringDisabled:!0,isResizingDisabled:!0,isHidingDisabled:!0,Row:O,Cell:A,Head:te,Header:C,Body:re,testId:"symbols-statistic"})}))},17145:(e,t,s)=>{"use strict";s.d(t,{S:()=>i});var n=s(73245),r=s(96540),o=s(6974);const i=()=>{const{t:e}=(0,n.B)();return(0,r.useCallback)((t=>{switch(t){case o.Pn.Any:return e("Any [[strategy]]");case o.Pn.Zero:return"> 0%";case o.Pn.Five:return"> 5%";case o.Pn.Ten:return"> 10%";case o.Pn.Fifteen:return"> 15%";case o.Pn.TwentyFive:return"> 25%";case o.Pn.Fifty:return"> 50%";default:return}}),[e])}},17165:(e,t,s)=>{"use strict";s.d(t,{b:()=>U});var n,r=s(74848),o=s(96540),i=s(47837),a=s(1767),c=s(63773);!function(e){const t=(0,c.D)("StrategyPosition");e.load=t("LOAD"),e.subscribe=t("SUBSCRIBE"),e.unsubscribe=t("UNSUBSCRIBE"),e.intervalSubscribe=t("INTERVAL_SUBSCRIBE"),e.intervalUnsubscribe=t("INTERVAL_UNSUBSCRIBE"),e.loadDone=t("LOAD_DONE"),e.loadFailed=t("LOAD_FAILED"),e.update=t("UPDATE")}(n||(n={}));var l=s(52019),d=s(33270),u=s(46274),g=s(98549);const m=(0,s(41233).K)({subscribeAction:n.subscribe,unsubscribeAction:n.unsubscribe});var h=s(99684);const p=(0,g.h)(u.e9).case(n.loadDone,((e,t)=>{const{positionList:s}=t;e.positions={};for(const t of s)e.positions[t.positionId]=t;e.networkStatus=h.p.Done})).case(n.loadFailed,(e=>{e.networkStatus=h.p.Failed})).case(n.update,((e,t)=>{const{position:s}=t;e.positions[s.positionId]=t.position})),y=(0,g.h)(u.fF).casesWithAction([n.subscribe,n.unsubscribe],((e,t)=>{e.subscribers=m(e.subscribers,t)})).casesWithAction([n.load,n.loadDone,n.loadFailed,n.update],((e,t)=>{var s;const{strategyId:n}=t.payload;e.data[n]=p(null===(s=e.data)||void 0===s?void 0:s[n],t)}));var x=s(82823),f=s(72199),j=s(97176),b=s(57519),v=s(92963),I=s(52293),S=s(58142),C=s(28892);const k=(0,f._N)([I.c,C.c],((e,t)=>e&&t))(Object.assign(Object.assign({},(0,S.Z6)()),{keySelector:(0,j.Jk)().strategyId()})),O=(0,f._N)([(0,j.Hy)(b.R).subscribers()],(e=>e.map((e=>({key:{strategyId:e.key},count:e.count})))))(Object.assign(Object.assign({},(0,S.Z6)()),{keySelector:j.eW})),w=(0,v._)(O,k);var T,D=s(23656),P=s(81160),N=s(28452),L=s(17760),B=s(47873),H=s(79005),E=s(73301),A=s(46533),R=s(23328),F=s(12157),M=s(32923),_=s(13191),W=s(15171);!function(e){function t(e){switch(e){case E.ZN.POSITION_STATUS_OPEN:return _.l.POSITION_STATUS_OPEN;case E.ZN.POSITION_STATUS_CLOSED:return _.l.POSITION_STATUS_CLOSED;case E.ZN.POSITION_STATUS_CREATED:return _.l.POSITION_STATUS_CREATED;case E.ZN.POSITION_STATUS_ERROR:return _.l.POSITION_STATUS_ERROR;case E.ZN.POSITION_STATUS_DECLINED:return _.l.POSITION_STATUS_DECLINED;case E.ZN.POSITION_STATUS_PENDING_CLOSED:return _.l.POSITION_STATUS_PENDING_CLOSED;case E.ZN.POSITION_STATUS_FINAL_ERROR:return _.l.POSITION_STATUS_FINAL_ERROR;default:return(0,M.T)(e)}}e.toDomain=function(e){var s,n;return Object.assign(Object.assign({},e),{tradeSide:A.L.fromProtoTradeSide(e.tradeSide),positionStatus:t(e.positionStatus),volume:(0,R.rS)(e.volume),commission:(0,F.c8)(e.commission,e.moneyDigits),mirroringCommission:(0,F.c8)(e.mirroringCommission,e.moneyDigits),introducingBrokerCommission:(0,F.c8)(e.introducingBrokerCommission,e.moneyDigits),profitInPips:null!==(s=e.profitInPips)&&void 0!==s?s:0,profit:(0,F.c8)(e.profit,e.moneyDigits),swap:(0,F.c8)(e.swap,e.moneyDigits),usedMargin:(0,F.c8)(e.usedMargin,e.moneyDigits),symbol:(n=e.symbol,Object.assign({name:n.symbolName,digits:n.digits,pipPosition:n.pipPosition,baseAssetName:n.baseAssetName},W.h.calculateFields(n))),pnlConversionFee:(0,F.c8)(e.pnlConversionFee,e.moneyDigits)})}}(T||(T={}));var K=s(76269),Y=s(43481);const V=(0,x.H)(((e,t,s)=>e.pipe((0,B.l)(n.load),(0,N.Z)((e=>{const{strategyId:t,cursor:r}=e;return s.copy.api.providerPositionList({strategyProviderId:H.V.strategyIdToProto(t),limit:u.Gz,cursor:r}).pipe((0,N.Z)((e=>{var s;const{nextCursor:r}=e,o=null!==(s=e.position)&&void 0!==s?s:[];return[n.loadDone({strategyId:t,positionList:o.map((e=>T.toDomain(e)))}),...r?[n.load({strategyId:t,cursor:r})]:[]]})),(0,K.f)((e=>(s.logger.error(`[Effect Error]: load strategy position list for ${t}`,e),[n.loadFailed({strategyId:t,errorCode:e.errorCode})]))))})))),(e=>(0,Y.a)(e.pipe((0,B.l)(n.intervalSubscribe)),e.pipe((0,B.l)(n.intervalUnsubscribe)),{updateInterval:u.Dw}).pipe((0,N.Z)((e=>e.map((e=>n.load({strategyId:e}))))))),((e,t)=>(0,D.g)(t.pipe((0,P.T)(w)),t.pipe((0,P.T)(L.c)),{unsubscribeCurrentKeysOnPause:!0}).pipe((0,N.Z)((({subscribe:e,unsubscribe:t})=>{const s=[];return e.length>0&&s.push(n.intervalSubscribe(e.map((e=>e.strategyId)))),t.length>0&&s.push(n.intervalUnsubscribe(t.map((e=>e.strategyId)))),s}))))),Z=(0,o.memo)((()=>((0,l.n)("strategyPosition",y),(0,d.S)(V),null))),U=(0,o.memo)((e=>{const{strategyId:t}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.c,{strategyId:t}),(0,r.jsx)(Z,{}),(0,r.jsx)(a.x,{param:t,subscribe:n.subscribe,unsubscribe:n.unsubscribe})]})}))},17491:(e,t,s)=>{"use strict";s.d(t,{e:()=>c});var n=s(72199),r=s(97176),o=s(28359),i=s(58142),a=s(55252);const c=(0,n._N)([(0,r.Hy)(a.d).balance()],(e=>(0,o.C)(e)))(Object.assign(Object.assign({},(0,i.Z6)()),{keySelector:(0,r.Jk)().strategyId()}))},17600:(e,t,s)=>{"use strict";s.d(t,{j:()=>c});var n=s(74848),r=s(59042);const o=(0,s(22679).K)((e=>{const{wide:t}=e;return{root:Object.assign({display:"flex",justifyContent:"center"},t&&{flexGrow:1})}}));var i=s(96540),a=s(95141);const c=(0,i.memo)((e=>{const{children:t,text:s,wide:c}=e,[l,d]=(0,i.useState)(!1),u=(0,i.useRef)(void 0),{css:g}=(0,a.X)(o,{wide:c});(0,i.useLayoutEffect)((()=>()=>{window.clearTimeout(u.current)}),[]);const m=(0,i.useCallback)((()=>{d(!0),u.current=window.setTimeout((()=>{d(!1)}),1e3)}),[]),h=(0,i.useCallback)((()=>{(0,r.l)(s),m()}),[s,m]);return(0,n.jsx)("div",{className:g.root,children:t(l,h,m)})}))},17745:(e,t,s)=>{"use strict";s.d(t,{l:()=>i});var n=s(54576),r=s(25617),o=s(6974);const i=(e,t,s,i,a,c)=>e?o.VZ.FreeAccount:s===n.CO.Netting||s===n.CO.SpreadBetting||a?o.VZ.NettedOrSpreadBetting:t?c===o.Aq.Stopped?o.VZ.ResumeProvidingDisabled:o.VZ.ProvidingDisabled:void 0===i?o.VZ.InvalidPlantStatus:[r.i.Guest,r.i.Unknown].includes(i)?o.VZ.PlantStatusGuestOrUnknown:o.VZ.Allowed},17763:(e,t,s)=>{"use strict";s.d(t,{G:()=>xe});var n,r=s(74848),o=s(96540),i=s(39701),a=s(15041),c=s(61183),l=s(63773);!function(e){const t=(0,l.D)("StrategyRoiChart");e.setPeriod=t("SET_PERIOD")}(n||(n={}));var d=s(47577),u=


Edit Code:

Please enter an edit code

Edit codes must be at least 20 characters

Share