1(self.webpackChunk_aqx_member_web=self.webpackChunk_aqx_member_web||[]).push([["7006"],{5513:function(e,t,n){"use strict";n.d(t,{useDroppable:()=>eX,VK:()=>X,useDraggable:()=>ek,useDndContext:()=>eM,LB:()=>e_,g4:()=>g});var r,o,i,l,a,c,s,u,d,f,p,h,g,y,m,b,v,x,w,C=n(32735),j=n(12788),P=n(759);let O={display:"none"};function S(e){let{id:t,value:n}=e;return C.createElement("div",{id:t,style:O},n)}function T(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;return C.createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":r,"aria-atomic":!0},n)}let E=(0,C.createContext)(null),I={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},R={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Z(e){let{announcements:t=R,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=I}=e,{announce:i,announcement:l}=function(){let[e,t]=(0,C.useState)("");return{announce:(0,C.useCallback)(e=>{null!=e&&t(e)},[]),announcement:e}}(),a=(0,P.Ld)("DndLiveRegion"),[c,s]=(0,C.useState)(!1);(0,C.useEffect)(()=>{s(!0)},[]);var u=(0,C.useMemo)(()=>({onDragStart(e){let{active:n}=e;i(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&i(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;i(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;i(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;i(t.onDragCancel({active:n,over:r}))}}),[i,t]);let d=(0,C.useContext)(E);if((0,C.useEffect)(()=>{if(!d)throw Error("useDndMonitor must be used within a children of <DndContext>");return d(u)},[u,d]),!c)return null;let f=C.createElement(C.Fragment,null,C.createElement(S,{id:r,value:o.draggable}),C.createElement(T,{id:a,announcement:l}));return n?(0,j.createPortal)(f,n):f}function A(){}(r=f||(f={})).DragStart="dragStart",r.DragMove="dragMove",r.DragEnd="dragEnd",r.DragCancel="dragCancel",r.DragOver="dragOver",r.RegisterDroppable="registerDroppable",r.SetDroppableDisabled="setDroppableDisabled",r.UnregisterDroppable="unregisterDroppable";let _=Object.freeze({x:0,y:0});function L(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}let D=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,o=[];for(let e of r){let{id:r}=e,i=n.get(r);if(i){let n=function(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height);if(r<o&&n<i){let l=t.width*t.height,a=e.width*e.height,c=(o-r)*(i-n);return Number((c/(l+a-c)).toFixed(4))}return 0}(i,t);n>0&&o.push({id:r,data:{droppableContainer:e,value:n}})}}return o.sort(L)};function k(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:_}let M=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.reduce((e,t)=>({...e,top:e.top+ +t.y,bottom:e.bottom+ +t.y,left:e.left+ +t.x,right:e.right+ +t.x}),{...e})},N={ignoreTransform:!1};function X(e,t){void 0===t&&(t=N);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=(0,P.getWindow)(e).getComputedStyle(e);t&&(n=function(e,t,n){let r=function(e){if(e.startsWith("matrix3d(")){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}(t);if(!r)return e;let{scaleX:o,scaleY:i,x:l,y:a}=r,c=e.left-l-(1-o)*parseFloat(n),s=e.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),u=o?e.width/o:e.width,d=i?e.height/i:e.height;return{width:u,height:d,top:s,right:c+u,bottom:s+d,left:c}}(n,t,r))}let{top:r,left:o,width:i,height:l,bottom:a,right:c}=n;return{top:r,left:o,width:i,height:l,bottom:a,right:c}}function U(e){return X(e,{ignoreTransform:!0})}function z(e,t){let n=[];return e?function r(o){var i;if(null!=t&&n.length>=t||!o)return n;if((0,P.qk)(o)&&null!=o.scrollingElement&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!(0,P.Re)(o)||(0,P.vZ)(o)||n.includes(o))return n;let l=(0,P.getWindow)(e).getComputedStyle(o);return(o!==e&&function(e,t){void 0===t&&(t=(0,P.getWindow)(e).getComputedStyle(e));let n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(e=>{let r=t[e];return"string"==typeof r&&n.test(r)})}(o,l)&&n.push(o),void 0===(i=l)&&(i=(0,P.getWindow)(o).getComputedStyle(o)),"fixed"===i.position)?n:r(o.parentNode)}(e):n}function G(e){let[t]=z(e,1);return null!=t?t:null}function F(e){return P.Nq&&e?(0,P.FJ)(e)?e:(0,P.UG)(e)?(0,P.qk)(e)||e===(0,P.r3)(e).scrollingElement?window:(0,P.Re)(e)?e:null:null:null}function B(e){return(0,P.FJ)(e)?e.scrollX:e.scrollLeft}function Y(e){return(0,P.FJ)(e)?e.scrollY:e.scrollTop}function V(e){return{x:B(e),y:Y(e)}}function H(e){return!!P.Nq&&!!e&&e===document.scrollingElement}function W(e){let t={x:0,y:0},n=H(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,i=e.scrollLeft<=t.x;return{isTop:o,isLeft:i,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}(o=p||(p={}))[o.Forward=1]="Forward",o[o.Backward=-1]="Backward";let $={x:.2,y:.2};function K(e){return e.reduce((e,t)=>
1(0,P.IH)(e,V(t)),_)}let q=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+B(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+Y(t),0)}]];class J{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let n=z(t),r=K(n);for(let[t,o,i]of(this.rect={...e},this.width=e.width,this.height=e.height,q))for(let e of o)Object.defineProperty(this,e,{get:()=>{let o=i(n),l=r[t]-o;return this.rect[e]+l},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Q{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function ee(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}function et(e){e.preventDefault()}function en(e){e.stopPropagation()}(i=h||(h={})).Click="click",i.DragStart="dragstart",i.Keydown="keydown",i.ContextMenu="contextmenu",i.Resize="resize",i.SelectionChange="selectionchange",i.VisibilityChange="visibilitychange",(l=g||(g={})).Space="Space",l.Down="ArrowDown",l.Right="ArrowRight",l.Left="ArrowLeft",l.Up="ArrowUp",l.Esc="Escape",l.Enter="Enter",l.Tab="Tab";let er={start:[g.Space,g.Enter],cancel:[g.Esc],end:[g.Space,g.Enter,g.Tab]},eo=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case g.Right:return{...n,x:n.x+25};case g.Left:return{...n,x:n.x-25};case g.Down:return{...n,y:n.y+25};case g.Up:return{...n,y:n.y-25}}};class ei{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;let{event:{target:t}}=e;this.props=e,this.listeners=new Q((0,P.r3)(t)),this.windowListeners=new Q((0,P.getWindow)(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(h.Resize,this.handleCancel),this.windowListeners.add(h.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(h.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&function(e,t){if(void 0===t&&(t=X),!e)return;let{top:n,left:r,bottom:o,right:i}=t(e);G(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(n),t(_)}handleKeyDown(e){if((0,P.vd)(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:o=er,coordinateGetter:i=eo,scrollBehavior:l="smooth"}=r,{code:a}=e;if(o.end.includes(a))return void this.handleEnd(e);if(o.cancel.includes(a))return void this.handleCancel(e);let{collisionRect:c}=n.current,s=c?{x:c.left,y:c.top}:_;this.referenceCoordinates||(this.referenceCoordinates=s);let u=i(e,{active:t,context:n.current,currentCoordinates:s});if(u){let t=(0,P.$X)(u,s),r={x:0,y:0},{scrollableAncestors:o}=n.current;for(let n of o){let o=e.code,{isTop:i,isRight:a,isLeft:c,isBottom:s,maxScroll:d,minScroll:f}=W(n),p=function(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}(n),h={x:Math.min(o===g.Right?p.right-p.width/2:p.right,Math.max(o===g.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(o===g.Down?p.bottom-p.height/2:p.bottom,Math.max(o===g.Down?p.top:p.top+p.height/2,u.y))},y=o===g.Right&&!a||o===g.Left&&!c,m=o===g.Down&&!s||o===g.Up&&!i;if(y&&h.x!==u.x){let e=n.scrollLeft+t.x,i=o===g.Right&&e<=d.x||o===g.Left&&e>=f.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:l});i?r.x=n.scrollLeft-e:r.x=o===g.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:l});break}if(m&&h.y!==u.y){let e=n.scrollTop+t.y,i=o===g.Down&&e<=d.y||o===g.Up&&e>=f.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:l});i?r.y=n.scrollTop-e:r.y=o===g.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:l});break}}this.handleMove(e,(0,P.IH)((0,P.$X)(u,this.referenceCoordinates),r))}}}handleMove(e,t){let{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function el(e){return!!(e&&"distance"in e)}function ea(e){return!!(e&&"delay"in e)}ei.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=er,onActivation:o}=t,{active:i}=n,{code:l}=e.nativeEvent;if(r.start.includes(l)){let t=i.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==o||o({event:e.nativeEvent}),!0)}return!1}}];class ec{constructor(e,t,n){var r;void 0===n&&(n=function(e){let{EventTarget:t}=(0,P.getWindow)(e);return e instanceof t?e:(0,P.r3)(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;let{event:o}=e,{target:i}=o;this.props=e,this.events=t,this.document=(0,P.r3)(i),this.documentListeners=new Q(this.document),this.listeners=new Q(n),this.windowListeners=new Q((0,P.getWindow)(i)),this.initialCoordinates=null!=(r=(0,P.DC)(o)
1)?r:_,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(h.Resize,this.handleCancel),this.windowListeners.add(h.DragStart,et),this.windowListeners.add(h.VisibilityChange,this.handleCancel),this.windowListeners.add(h.ContextMenu,et),this.documentListeners.add(h.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(ea(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(el(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(h.Click,en,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(h.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;let{activated:n,initialCoordinates:r,props:o}=this,{onMove:i,options:{activationConstraint:l}}=o;if(!r)return;let a=null!=(t=(0,P.DC)(e))?t:_,c=(0,P.$X)(r,a);if(!n&&l){if(el(l)){if(null!=l.tolerance&&ee(c,l.tolerance))return this.handleCancel();if(ee(c,l.distance))return this.handleStart()}return ea(l)&&ee(c,l.tolerance)?this.handleCancel():void this.handlePending(l,c)}e.cancelable&&e.preventDefault(),i(a)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===g.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}let es={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class eu extends ec{constructor(e){let{event:t}=e;super(e,es,(0,P.r3)(t.target))}}eu.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!!n.isPrimary&&0===n.button&&(null==r||r({event:n}),!0)}}];(a=y||(y={}))[a.RightClick=2]="RightClick";(c=m||(m={}))[c.Pointer=0]="Pointer",c[c.DraggableRect=1]="DraggableRect",(s=b||(b={}))[s.TreeOrder=0]="TreeOrder",s[s.ReversedTreeOrder=1]="ReversedTreeOrder";let ed={x:{[p.Backward]:!1,[p.Forward]:!1},y:{[p.Backward]:!1,[p.Forward]:!1}};(u=v||(v={}))[u.Always=0]="Always",u[u.BeforeDragging=1]="BeforeDragging",u[u.WhileDragging=2]="WhileDragging",(x||(x={})).Optimized="optimized";let ef=new Map;function ep(e,t){return(0,P.Gj)(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function eh(e){let{callback:t,disabled:n}=e,r=(0,P.zX)(t),o=(0,C.useMemo)(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,C.useEffect)(()=>()=>null==o?void 0:o.disconnect(),[o]),o}function eg(e){return new J(X(e),e)}function ey(e,t,n){void 0===t&&(t=eg);let[r,o]=(0,C.useState)(null);function i(){o(r=>{if(!e)return null;if(!1===e.isConnected){var o;return null!=(o=null!=r?r:n)?o:null}let i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}let l=function(e){let{callback:t,disabled:n}=e,r=(0,P.zX)(t),o=(0,C.useMemo)(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;let{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,C.useEffect)(()=>()=>null==o?void 0:o.disconnect(),[o]),o}({callback(t){if(e)for(let n of t){let{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){i();break}}}}),a=eh({callback:i});return(0,P.LI)(()=>{i(),e?(null==a||a.observe(e),null==l||l.observe(document.body,{childList:!0,subtree:!0})):(null==a||a.disconnect(),null==l||l.disconnect())},[e]),r}let em=[];function eb(e,t){void 0===t&&(t=[]);let n=(0,C.useRef)(null);return(0,C.useEffect)(()=>{n.current=null},t),(0,C.useEffect)(()=>{let t=e!==_;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?(0,P.$X)(e,n.current):_}function ev(e){return(0,C.useMemo)(()=>
1e?function(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null,[e])}let ex=[],ew=[{sensor:eu,options:{}},{sensor:ei,options:{}}],eC={current:{}},ej={draggable:{measure:U},droppable:{measure:U,strategy:v.WhileDragging,frequency:x.Optimized},dragOverlay:{measure:X}};class eP extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}let eO={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new eP,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:A},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ej,measureDroppableContainers:A,windowRect:null,measuringScheduled:!1},eS={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:A,draggableNodes:new Map,over:null,measureDroppableContainers:A},eT=(0,C.createContext)(eS),eE=(0,C.createContext)(eO);function eI(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new eP}}}function eR(e,t){switch(t.type){case f.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case f.DragMove:if(null==e.draggable.active)return e;return{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case f.DragEnd:case f.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case f.RegisterDroppable:{let{element:n}=t,{id:r}=n,o=new eP(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case f.SetDroppableDisabled:{let{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let l=new eP(e.droppable.containers);return l.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:l}}}case f.UnregisterDroppable:{let{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;let i=new eP(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function eZ(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:o}=(0,C.useContext)(eT),i=(0,P.D9)(r),l=(0,P.D9)(null==n?void 0:n.id);return(0,C.useEffect)(()=>{if(!t&&!r&&i&&null!=l){if(!(0,P.vd)(i)||document.activeElement===i.target)return;let e=o.get(l);if(!e)return;let{activatorNode:t,node:n}=e;(t.current||n.current)&&requestAnimationFrame(()=>{for(let e of[t.current,n.current]){if(!e)continue;let t=(0,P.so)(e);if(t){t.focus();break}}})}},[r,t,o,l,i]),null}let eA=(0,C.createContext)({..._,scaleX:1,scaleY:1});(d=w||(w={}))[d.Uninitialized=0]="Uninitialized",d[d.Initializing=1]="Initializing",d[d.Initialized=2]="Initialized";let e_=(0,C.memo)(function(e){var t,n,r,o,i,l;let{id:a,accessibility:c,autoScroll:s=!0,children:u,sensors:d=ew,collisionDetection:h=D,measuring:g,modifiers:y,...x}=e,[O,S]=(0,C.useReducer)(eR,void 0,eI),[T,I]=function(){let[e]=(0,C.useState)(()=>new Set),t=(0,C.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,C.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)})},[e]),t]}(),[R,A]=(0,C.useState)(w.Uninitialized),L=R===w.Initialized,{draggable:{active:N,nodes:U,translate:B},droppable:{containers:Y}}=O,q=null!=N?U.get(N):null,Q=(0,C.useRef)({initial:null,translated:null}),ee=(0,C.useMemo)(()=>{var e;return null!=N?{id:N,data:null!=(e=null==q?void 0:q.data)?e:eC,rect:Q}:null},[N,q]),et=(0,C.useRef)(null),[en,er]=(0,C.useState)(null),[eo,ei]=(0,C.useState)(null),el=(0,P.Ey)(x,Object.values(x)),ea=(0,P.Ld)("DndDescribedBy",a),ec=(0,C.useMemo)(()=>Y.getEnabled(),[Y]),es=(0,C.useMemo)(()=>({draggable:{...ej.draggable,...null==g?void 0:g.draggable},droppable:{...ej.droppable,...null==g?void 0:g.droppable},dragOverlay:{...ej.dragOverlay,...null==g?void 0:g.dragOverlay}}),[null==g?void 0:g.draggable,null==g?void 0:g.droppable,null==g?void 0:g.dragOverlay]),{droppableRects:eu,measureDroppableContainers:eg,measuringScheduled:eP}=function(e,t){let{dragging:n,dependencies:r,config:o}=t,[i,l]=(0,C.useState)(null),{frequency:a,measure:c,strategy:s}=o,u=(0,C.useRef)(e),d=function(){switch(s){case v.Always:return!1;case v.BeforeDragging:return n;default:return!n}}(),f=(0,P.Ey)(d),p=(0,C.useCallback)(function(e){void 0===e&&(e=[]),f.current||l(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),h=(0,C.useRef)(null),g=(0,P.Gj)(t=>{if(d&&!n)return ef;if(!t||t===ef||u.current!==e||null!=i){let t=new Map;for(let n of e){if(!n)continue;if(i&&i.length>
10&&!i.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}let e=n.node.current,r=e?new J(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,i,n,d,c]);return(0,C.useEffect)(()=>{u.current=e},[e]),(0,C.useEffect)(()=>{d||p()},[n,d]),(0,C.useEffect)(()=>{i&&i.length>0&&l(null)},[JSON.stringify(i)]),(0,C.useEffect)(()=>{d||"number"!=typeof a||null!==h.current||(h.current=setTimeout(()=>{p(),h.current=null},a))},[a,d,p,...r]),{droppableRects:g,measureDroppableContainers:p,measuringScheduled:null!=i}}(ec,{dragging:L,dependencies:[B.x,B.y],config:es.droppable}),eO=function(e,t){let n=null!=t?e.get(t):void 0,r=n?n.node.current:null;return(0,P.Gj)(e=>{var n;return null==t?null:null!=(n=null!=r?r:e)?n:null},[r,t])}(U,N),eS=(0,C.useMemo)(()=>eo?(0,P.DC)(eo):null,[eo]),e_=function(){let e=(null==en?void 0:en.autoScrollEnabled)===!1,t="object"==typeof s?!1===s.enabled:!1===s,n=L&&!e&&!t;return"object"==typeof s?{...s,enabled:n}:{enabled:n}}(),eL=ep(eO,es.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e,i=(0,C.useRef)(!1),{x:l,y:a}="boolean"==typeof o?{x:o,y:o}:o;(0,P.LI)(()=>{if(!l&&!a||!t){i.current=!1;return}if(i.current||!r)return;let e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;let o=k(n(e),r);if(l||(o.x=0),a||(o.y=0),i.current=!0,Math.abs(o.x)>0||Math.abs(o.y)>0){let t=G(e);t&&t.scrollBy({top:o.y,left:o.x})}},[t,l,a,r,n])}({activeNode:null!=N?U.get(N):null,config:e_.layoutShiftCompensation,initialRect:eL,measure:es.draggable.measure});let eD=ey(eO,es.draggable.measure,eL),ek=ey(eO?eO.parentElement:null),eM=(0,C.useRef)({activatorEvent:null,active:null,activeNode:eO,collisionRect:null,collisions:null,droppableRects:eu,draggableNodes:U,draggingNode:null,draggingNodeRect:null,droppableContainers:Y,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),eN=Y.getNodeFor(null==(t=eM.current.over)?void 0:t.id),eX=function(e){let{measure:t}=e,[n,r]=(0,C.useState)(null),o=eh({callback:(0,C.useCallback)(e=>{for(let{target:n}of e)if((0,P.Re)(n)){r(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),i=(0,C.useCallback)(e=>{let n=function(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return(0,P.Re)(t)?t:e}(e);null==o||o.disconnect(),n&&(null==o||o.observe(n)),r(n?t(n):null)},[t,o]),[l,a]=(0,P.wm)(i);return(0,C.useMemo)(()=>({nodeRef:l,rect:n,setRef:a}),[n,l,a])}({measure:es.dragOverlay.measure}),eU=null!=(n=eX.nodeRef.current)?n:eO,ez=L?null!=(r=eX.rect)?r:eD:null,eG=!!(eX.nodeRef.current&&eX.rect),eF=function(e){let t=ep(e);return k(e,t)}(eG?null:eD),eB=ev(eU?(0,P.getWindow)(eU):null),eY=function(e){let t=(0,C.useRef)(e),n=(0,P.Gj)(n=>e?n&&n!==em&&e&&t.current&&e.parentNode===t.current.parentNode?n:z(e):em,[e]);return(0,C.useEffect)(()=>{t.current=e},[e]),n}(L?null!=eN?eN:eO:null),eV=function(e,t){void 0===t&&(t=X);let[n]=e,r=ev(n?(0,P.getWindow)(n):null),[o,i]=(0,C.useState)(ex);function l(){i(()=>e.length?e.map(e=>H(e)?r:new J(t(e),e)):ex)}let a=eh({callback:l});return(0,P.LI)(()=>{null==a||a.disconnect(),l(),e.forEach(e=>null==a?void 0:a.observe(e))},[e]),o}(eY),eH=function(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}(y,{transform:{x:B.x-eF.x,y:B.y-eF.y,scaleX:1,scaleY:1},activatorEvent:eo,active:ee,activeNodeRect:eD,containerNodeRect:ek,draggingNodeRect:ez,over:eM.current.over,overlayNodeRect:eX.rect,scrollableAncestors:eY,scrollableAncestorRects:eV,windowRect:eB}),eW=eS?(0,P.IH)(eS,B):null,e$=function(e){let[t,n]=(0,C.useState)(null),r=(0,C.useRef)(e),o=(0,C.useCallback)(e=>{let t=F(e.target);t&&n(e=>e?(e.set(t,V(t)),new Map(e)):null)},[]);return(0,C.useEffect)(()=>{let t=r.current;if(e!==t){i(t);let l=e.map(e=>{let t=F(e);return t?(t.addEventListener("scroll",o,{passive:!0}),[t,V(t)]):null}).filter(e=>null!=e);n(l.length?new Map(l):null),r.current=e}return()=>{i(e),i(t)};function i(e){e.forEach(e=>{let t=F(e);null==t||t.removeEventListener("scroll",o)})}},[o,e]),(0,C.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>(0,P.IH)(e,t),_):K(e):_,[e,t])}(eY),eK=eb(e$),eq=eb(e$,[eD]),eJ=(0,P.IH)(eH,eK),eQ=ez?M(ez,eH):null,e0=ee&&eQ?h({active:ee,collisionRect:eQ,droppableRects:eu,droppableContainers:ec,pointerCoordinates:eW}):null,e1=function(e,t){if(!e||0===e.length)return null;let[n]=e;return n.id}(e0,"id"),[e2,e3]=(0,C.useState)(null),e8=(i=eG?eH:(0,P.IH)(eH,eq),l=null!=(o=null==e2?void 0:e2.rect)?o:null,{...i,scaleX:l&&eD?l.width/eD.width:1,scaleY:l&&eD?l.height/eD.height:1}),e9=(0,C.useRef)(null),e4=(0,C.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(null==et.current)return;let o=U.get(et.current);if(!o)return;let i=e.nativeEvent,l=new n({active:et.current,activeNode:o,event:i,options:r,context:eM,onAbort(e){if(!U.get(e))return;let{onDragAbort:t}=el.current,n={id:e};null==t||t(n),T({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!U.get(e))return;let{onDragPending:o}
1=el.current,i={id:e,constraint:t,initialCoordinates:n,offset:r};null==o||o(i),T({type:"onDragPending",event:i})},onStart(e){let t=et.current;if(null==t)return;let n=U.get(t);if(!n)return;let{onDragStart:r}=el.current,o={activatorEvent:i,active:{id:t,data:n.data,rect:Q}};(0,j.unstable_batchedUpdates)(()=>{null==r||r(o),A(w.Initializing),S({type:f.DragStart,initialCoordinates:e,active:t}),T({type:"onDragStart",event:o}),er(e9.current),ei(i)})},onMove(e){S({type:f.DragMove,coordinates:e})},onEnd:a(f.DragEnd),onCancel:a(f.DragCancel)});function a(e){return async function(){let{active:t,collisions:n,over:r,scrollAdjustedTranslate:o}=eM.current,l=null;if(t&&o){let{cancelDrop:a}=el.current;l={activatorEvent:i,active:t,collisions:n,delta:o,over:r},e===f.DragEnd&&"function"==typeof a&&await Promise.resolve(a(l))&&(e=f.DragCancel)}et.current=null,(0,j.unstable_batchedUpdates)(()=>{S({type:e}),A(w.Uninitialized),e3(null),er(null),ei(null),e9.current=null;let t=e===f.DragEnd?"onDragEnd":"onDragCancel";if(l){let e=el.current[t];null==e||e(l),T({type:t,event:l})}})}}e9.current=l},[U]),e7=(0,C.useCallback)((e,t)=>(n,r)=>{let o=n.nativeEvent,i=U.get(r);null!==et.current||!i||o.dndKit||o.defaultPrevented||!0===e(n,t.options,{active:i})&&(o.dndKit={capturedBy:t.sensor},et.current=r,e4(n,t))},[U,e4]),e6=(0,C.useMemo)(()=>d.reduce((e,t)=>{let{sensor:n}=t;return[...e,...n.activators.map(e=>({eventName:e.eventName,handler:e7(e.handler,t)}))]},[]),[d,e7]);(0,C.useEffect)(()=>{if(!P.Nq)return;let e=d.map(e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()});return()=>{for(let t of e)null==t||t()}},d.map(e=>{let{sensor:t}=e;return t})),(0,P.LI)(()=>{eD&&R===w.Initializing&&A(w.Initialized)},[eD,R]),(0,C.useEffect)(()=>{let{onDragMove:e}=el.current,{active:t,activatorEvent:n,collisions:r,over:o}=eM.current;if(!t||!n)return;let i={active:t,activatorEvent:n,collisions:r,delta:{x:eJ.x,y:eJ.y},over:o};(0,j.unstable_batchedUpdates)(()=>{null==e||e(i),T({type:"onDragMove",event:i})})},[eJ.x,eJ.y]),(0,C.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:o}=eM.current;if(!e||null==et.current||!t||!o)return;let{onDragOver:i}=el.current,l=r.get(e1),a=l&&l.rect.current?{id:l.id,rect:l.rect.current,data:l.data,disabled:l.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:o.x,y:o.y},over:a};(0,j.unstable_batchedUpdates)(()=>{e3(a),null==i||i(c),T({type:"onDragOver",event:c})})},[e1]),(0,P.LI)(()=>{eM.current={activatorEvent:eo,active:ee,activeNode:eO,collisionRect:eQ,collisions:e0,droppableRects:eu,draggableNodes:U,draggingNode:eU,draggingNodeRect:ez,droppableContainers:Y,over:e2,scrollableAncestors:eY,scrollAdjustedTranslate:eJ},Q.current={initial:ez,translated:eQ}},[ee,eO,e0,eQ,U,eU,ez,eu,Y,e2,eY,eJ]),function(e){let{acceleration:t,activator:n=m.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:l=5,order:a=b.TreeOrder,pointerCoordinates:c,scrollableAncestors:s,scrollableAncestorRects:u,delta:d,threshold:f}=e,h=function(e){let{delta:t,disabled:n}=e,r=(0,P.D9)(t);return(0,P.Gj)(e=>{if(n||!r||!e)return ed;let o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[p.Backward]:e.x[p.Backward]||-1===o.x,[p.Forward]:e.x[p.Forward]||1===o.x},y:{[p.Backward]:e.y[p.Backward]||-1===o.y,[p.Forward]:e.y[p.Forward]||1===o.y}}},[n,t,r])}({delta:d,disabled:!i}),[g,y]=(0,P.Yz)(),v=(0,C.useRef)({x:0,y:0}),x=(0,C.useRef)({x:0,y:0}),w=(0,C.useMemo)(()=>{switch(n){case m.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case m.DraggableRect:return o}},[n,o,c]),j=(0,C.useRef)(null),O=(0,C.useCallback)(()=>{let e=j.current;if(!e)return;let t=v.current.x*x.current.x,n=v.current.y*x.current.y;e.scrollBy(t,n)},[]),S=(0,C.useMemo)(()=>a===b.TreeOrder?[...s].reverse():s,[a,s]);(0,C.useEffect)(()=>{if(!i||!s.length||!w)return void y();for(let e of S){if((null==r?void 0:r(e))===!1)continue;let n=u[s.indexOf(e)];if(!n)continue;let{direction:o,speed:i}=function(e,t,n,r,o){let{top:i,left:l,right:a,bottom:c}=n;void 0===r&&(r=10),void 0===o&&(o=$);let{isTop:s,isBottom:u,isLeft:d,isRight:f}=W(e),h={x:0,y:0},g={x:0,y:0},y={height:t.height*o.y,width:t.width*o.x};return!s&&i<=t.top+y.height?(h.y=p.Backward,g.y=r*Math.abs((t.top+y.height-i)/y.height)):!u&&c>=t.bottom-y.height&&(h.y=p.Forward,g.y=r*Math.abs((t.bottom-y.height-c)/y.height)),!f&&a>=t.right-y.width?(h.x=p.Forward,g.x=r*Math.abs((t.right-y.width-a)/y.width)):!d&&l<=t.left+y.width&&(h.x=p.Backward,g.x=r*Math.abs((t.left+y.width-l)/y.width)),{direction:h,speed:g}}(e,n,w,t,f);for(let e of["x","y"])h[e][o[e]]||(i[e]=0,o[e]=0);if(i.x>0||i.y>0){y(),j.current=e,g(O,l),v.current=i,x.current=o;return}}v.current={x:0,y:0},x.current={x:0,y:0},y()},[t,O,r,y,i,l,JSON.stringify(w),JSON.stringify(h),g,s,S,u,JSON.stringify(f)])}({...e_,delta:B,draggingRect:eQ,pointerCoordinates:eW,scrollableAncestors:eY,scrollableAncestorRects:eV});let e5=(0,C.useMemo)(()=>({active:ee,activeNode:eO,activeNodeRect:eD,activatorEvent:eo,collisions:e0,containerNodeRect:ek,dragOverlay:eX,draggableNodes:U,droppableContainers:Y,droppableRects:eu,over:e2,measureDroppableContainers:eg,scrollableAncestors:eY,scrollableAncestorRects:eV,measuringConfiguration:es,measuringScheduled:eP,windowRect:eB}
1),[ee,eO,eD,eo,e0,ek,eX,U,Y,eu,e2,eg,eY,eV,es,eP,eB]),te=(0,C.useMemo)(()=>({activatorEvent:eo,activators:e6,active:ee,activeNodeRect:eD,ariaDescribedById:{draggable:ea},dispatch:S,draggableNodes:U,over:e2,measureDroppableContainers:eg}),[eo,e6,ee,eD,S,ea,U,e2,eg]);return C.createElement(E.Provider,{value:I},C.createElement(eT.Provider,{value:te},C.createElement(eE.Provider,{value:e5},C.createElement(eA.Provider,{value:e8},u)),C.createElement(eZ,{disabled:(null==c?void 0:c.restoreFocus)===!1})),C.createElement(Z,{...c,hiddenTextDescribedById:ea}))}),eL=(0,C.createContext)(null),eD="button";function ek(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e,i=(0,P.Ld)("Draggable"),{activators:l,activatorEvent:a,active:c,activeNodeRect:s,ariaDescribedById:u,draggableNodes:d,over:f}=(0,C.useContext)(eT),{role:p=eD,roleDescription:h="draggable",tabIndex:g=0}=null!=o?o:{},y=(null==c?void 0:c.id)===t,m=(0,C.useContext)(y?eA:eL),[b,v]=(0,P.wm)(),[x,w]=(0,P.wm)(),j=(0,C.useMemo)(()=>l.reduce((e,n)=>{let{eventName:r,handler:o}=n;return e[r]=e=>{o(e,t)},e},{}),[l,t]),O=(0,P.Ey)(n);return(0,P.LI)(()=>(d.set(t,{id:t,key:i,node:b,activatorNode:x,data:O}),()=>{let e=d.get(t);e&&e.key===i&&d.delete(t)}),[d,t]),{active:c,activatorEvent:a,activeNodeRect:s,attributes:(0,C.useMemo)(()=>({role:p,tabIndex:g,"aria-disabled":r,"aria-pressed":!!y&&p===eD||void 0,"aria-roledescription":h,"aria-describedby":u.draggable}),[r,p,g,y,h,u.draggable]),isDragging:y,listeners:r?void 0:j,node:b,over:f,setNodeRef:v,setActivatorNodeRef:w,transform:m}}function eM(){return(0,C.useContext)(eE)}let eN={timeout:25};function eX(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e,i=(0,P.Ld)("Droppable"),{active:l,dispatch:a,over:c,measureDroppableContainers:s}=(0,C.useContext)(eT),u=(0,C.useRef)({disabled:n}),d=(0,C.useRef)(!1),p=(0,C.useRef)(null),h=(0,C.useRef)(null),{disabled:g,updateMeasurementsFor:y,timeout:m}={...eN,...o},b=(0,P.Ey)(null!=y?y:r),v=eh({callback:(0,C.useCallback)(()=>{if(!d.current){d.current=!0;return}null!=h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{s(Array.isArray(b.current)?b.current:[b.current]),h.current=null},m)},[m]),disabled:g||!l}),x=(0,C.useCallback)((e,t)=>{v&&(t&&(v.unobserve(t),d.current=!1),e&&v.observe(e))},[v]),[w,j]=(0,P.wm)(x),O=(0,P.Ey)(t);return(0,C.useEffect)(()=>{v&&w.current&&(v.disconnect(),d.current=!1,v.observe(w.current))},[w,v]),(0,C.useEffect)(()=>(a({type:f.RegisterDroppable,element:{id:r,key:i,disabled:n,node:w,rect:p,data:O}}),()=>a({type:f.UnregisterDroppable,key:i,id:r})),[r]),(0,C.useEffect)(()=>{n!==u.current.disabled&&(a({type:f.SetDroppableDisabled,id:r,key:i,disabled:n}),u.current.disabled=n)},[r,i,n,a]),{active:l,rect:p,isOver:(null==c?void 0:c.id)===r,node:w,over:c,setNodeRef:j}}},95339:function(e,t,n){"use strict";n.d(t,{DL:()=>r}),n(759);let r=e=>{let{transform:t}=e;return{...t,x:0}}},67445:function(e,t,n){"use strict";n.d(t,{Fo:()=>p,Rp:()=>l,nB:()=>x,qw:()=>u});var r=n(32735),o=n(5513),i=n(759);function l(e,t,n){let r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function a(e){return null!==e&&e>=0}let c=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e,i=l(t,r,n),a=t[o],c=i[o];return c&&a?{x:c.left-a.left,y:c.top-a.top,scaleX:c.width/a.width,scaleY:c.height/a.height}:null},s={scaleX:1,scaleY:1},u=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:i,overIndex:l}=e,a=null!=(t=i[n])?t:r;if(!a)return null;if(o===n){let e=i[l];return e?{x:0,y:n<l?e.top+e.height-(a.top+a.height):e.top-a.top,...s}:null}let c=function(e,t,n){let r=e[t],o=e[t-1],i=e[t+1];return r?n<t?o?r.top-(o.top+o.height):i?i.top-(r.top+r.height):0:i?i.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}(i,o,n);return o>n&&o<=l?{x:0,y:-a.height-c,...s}:o<n&&o>=l?{x:0,y:a.height+c,...s}:{x:0,y:0,...s}},d="Sortable",f=r.createContext({activeIndex:-1,containerId:d,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:c,disabled:{draggable:!1,droppable:!1}});function p(e){let{children:t,id:n,items:l,strategy:a=c,disabled:s=!1}=e,{active:u,dragOverlay:p,droppableRects:h,over:g,measureDroppableContainers:y}=(0,o.useDndContext)(),m=(0,i.Ld)(d,n),b=null!==p.rect,v=(0,r.useMemo)(()=>l.map(e=>"object"==typeof e&&"id"in e?e.id:e),[l]),x=null!=u,w=u?v.indexOf(u.id):-1,C=g?v.indexOf(g.id):-1,j=(0,r.useRef)(v),P=!function(e,t){if(e===t)return!0;
1if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(v,j.current),O=-1!==C&&-1===w||P,S="boolean"==typeof s?{draggable:s,droppable:s}:s;(0,i.LI)(()=>{P&&x&&y(v)},[P,v,x,y]),(0,r.useEffect)(()=>{j.current=v},[v]);let T=(0,r.useMemo)(()=>({activeIndex:w,containerId:m,disabled:S,disableTransforms:O,items:v,overIndex:C,useDragOverlay:b,sortedRects:v.reduce((e,t,n)=>{let r=h.get(t);return r&&(e[n]=r),e},Array(v.length)),strategy:a}),[w,m,S.draggable,S.droppable,O,v,C,h,b,a]);return r.createElement(f.Provider,{value:T},t)}let h=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return l(n,r,o).indexOf(t)},g=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:i,newIndex:l,previousItems:a,previousContainerId:c,transition:s}=e;return!!s&&!!r&&(a===i||o!==l)&&(!!n||l!==o&&t===c)},y={duration:200,easing:"ease"},m="transform",b=i.ux.Transition.toString({property:m,duration:0,easing:"linear"}),v={roleDescription:"sortable"};function x(e){var t,n,l,c;let{animateLayoutChanges:s=g,attributes:u,disabled:d,data:p,getNewIndex:x=h,id:w,strategy:C,resizeObserverConfig:j,transition:P=y}=e,{items:O,containerId:S,activeIndex:T,disabled:E,disableTransforms:I,sortedRects:R,overIndex:Z,useDragOverlay:A,strategy:_}=(0,r.useContext)(f),L=(t=d,n=E,"boolean"==typeof t?{draggable:t,droppable:!1}:{draggable:null!=(l=null==t?void 0:t.draggable)?l:n.draggable,droppable:null!=(c=null==t?void 0:t.droppable)?c:n.droppable}),D=O.indexOf(w),k=(0,r.useMemo)(()=>({sortable:{containerId:S,index:D,items:O},...p}),[S,p,D,O]),M=(0,r.useMemo)(()=>O.slice(O.indexOf(w)),[O,w]),{rect:N,node:X,isOver:U,setNodeRef:z}=(0,o.useDroppable)({id:w,data:k,disabled:L.droppable,resizeObserverConfig:{updateMeasurementsFor:M,...j}}),{active:G,activatorEvent:F,activeNodeRect:B,attributes:Y,setNodeRef:V,listeners:H,isDragging:W,over:$,setActivatorNodeRef:K,transform:q}=(0,o.useDraggable)({id:w,data:k,attributes:{...v,...u},disabled:L.draggable}),J=(0,i.HB)(z,V),Q=!!G,ee=Q&&!I&&a(T)&&a(Z),et=!A&&W,en=et&&ee?q:null,er=ee?null!=en?en:(null!=C?C:_)({rects:R,activeNodeRect:B,activeIndex:T,overIndex:Z,index:D}):null,eo=a(T)&&a(Z)?x({id:w,items:O,activeIndex:T,overIndex:Z}):D,ei=null==G?void 0:G.id,el=(0,r.useRef)({activeId:ei,items:O,newIndex:eo,containerId:S}),ea=O!==el.current.items,ec=s({active:G,containerId:S,isDragging:W,isSorting:Q,id:w,index:D,items:O,newIndex:el.current.newIndex,previousItems:el.current.items,previousContainerId:el.current.containerId,transition:P,wasDragging:null!=el.current.activeId}),es=function(e){let{disabled:t,index:n,node:l,rect:a}=e,[c,s]=(0,r.useState)(null),u=(0,r.useRef)(n);return(0,i.LI)(()=>{if(!t&&n!==u.current&&l.current){let e=a.current;if(e){let t=(0,o.VK)(l.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&s(n)}}n!==u.current&&(u.current=n)},[t,n,l,a]),(0,r.useEffect)(()=>{c&&s(null)},[c]),c}({disabled:!ec,index:D,node:X,rect:N});return(0,r.useEffect)(()=>{Q&&el.current.newIndex!==eo&&(el.current.newIndex=eo),S!==el.current.containerId&&(el.current.containerId=S),O!==el.current.items&&(el.current.items=O)},[Q,eo,S,O]),(0,r.useEffect)(()=>{if(ei===el.current.activeId)return;if(null!=ei&&null==el.current.activeId){el.current.activeId=ei;return}let e=setTimeout(()=>{el.current.activeId=ei},50);return()=>clearTimeout(e)},[ei]),{active:G,activeIndex:T,attributes:Y,data:k,rect:N,index:D,newIndex:eo,items:O,isOver:U,isSorting:Q,isDragging:W,listeners:H,node:X,overIndex:Z,over:$,setNodeRef:J,setActivatorNodeRef:K,setDroppableNodeRef:z,setDraggableNodeRef:V,transform:null!=es?es:er,transition:es||ea&&el.current.newIndex===D?b:(!et||(0,i.vd)(F))&&P&&(Q||ec)?i.ux.Transition.toString({...P,property:m}):void 0}}o.g4.Down,o.g4.Right,o.g4.Up,o.g4.Left},759:function(e,t,n){"use strict";n.d(t,{$X:()=>P,D9:()=>v,DC:()=>S,Ey:()=>y,FJ:()=>l,Gj:()=>m,HB:()=>o,IH:()=>j,LI:()=>p,Ld:()=>w,Nq:()=>i,Re:()=>u,UG:()=>a,Yz:()=>g,getWindow:()=>c,qk:()=>s,r3:()=>f,so:()=>I,ux:()=>T,vZ:()=>d,vd:()=>O,wm:()=>b,zX:()=>h});var r=n(32735);function o(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,r.useMemo)(()=>e=>{t.forEach(t=>t(e))},t)}let i="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function l(e){let t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function a(e){return"nodeType"in e}function c(e){var t,n;return e?l(e)?e:a(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function s(e){let{Document:t}=c(e);return e instanceof t}function u(e){return!l(e)&&e instanceof c(e).HTMLElement}function d(e){return e instanceof c(e).SVGElement}function f(e){return e?l(e)?e.document:a(e)?s(e)?e:u(e)||d(e)?e.ownerDocument:document:document:document}let p=i?r.useLayoutEffect:r.useEffect;function h(e){let t=(0,r.useRef)(e);return p(()=>{t.current=e}),(0,r.useCallback)(function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}function g(){let e=(0,r.useRef)(null);return[(0,r.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,r.useCallback)(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}function y(e,t){void 0===t&&(t=[e]);let n=(0,r.useRef)(e);return p(()=>{n.current!==e&&(n.current=e)},t),n}function m(e,t){let n=(0,r.useRef)();return(0,r.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function b(e){let t=h(e),n=(0,r.useRef)(null),o=(0,r.useCallback)(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,o]}function v(e){let t=(0,r.useRef)();return(0,r.useEffect)(()=>{t.current=e},[e]),t.current}let x={};function w(e,t){return(0,r.useMemo)(()=>
1{if(t)return t;let n=null==x[e]?0:x[e]+1;return x[e]=n,e+"-"+n},[e,t])}function C(e){return function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((t,n)=>{for(let[r,o]of Object.entries(n)){let n=t[r];null!=n&&(t[r]=n+e*o)}return t},{...t})}}let j=C(1),P=C(-1);function O(e){if(!e)return!1;let{KeyboardEvent:t}=c(e.target);return t&&e instanceof t}function S(e){if(function(e){if(!e)return!1;let{TouchEvent:t}=c(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return"clientX"in e&&"clientY"in e?{x:e.clientX,y:e.clientY}:null}let T=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[T.Translate.toString(e),T.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),E="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function I(e){return e.matches(E)?e:e.querySelector(E)}},38415:function(e,t,n){"use strict";var r=n(19303),o=n(41340),i=n(84488),l=RangeError;e.exports=function(e){var t=o(i(this)),n="",a=r(e);
1if(a<0||a==1/0)throw l("Wrong number of repetitions");for(;a>0;(a>>>=1)&&(t+=t))1&a&&(n+=t);return n}},34553:function(e,t,n){"use strict";var r=n(82109),o=n(42092).findIndex,i=n(51223),l="findIndex",a=!0;l in[]&&[,][l](function(){a=!1}),r({target:"Array",proto:!0,forced:a},{findIndex:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),i(l)},56977:function(e,t,n){"use strict";var r=n(82109),o=n(1702),i=n(19303),l=n(50863),a=n(38415),c=n(47293),s=RangeError,u=String,d=Math.floor,f=o(a),p=o("".slice),h=o(1..toFixed),g=function(e,t,n){return 0===t?n:t%2==1?g(e,t-1,n*e):g(e*e,t/2,n)},y=function(e){for(var t=0,n=e;n>=4096;)t+=12,n/=4096;for(;n>=2;)t+=1,n/=2;return t},m=function(e,t,n){for(var r=-1,o=n;++r<6;)o+=t*e[r],e[r]=o%1e7,o=d(o/1e7)},b=function(e,t){for(var n=6,r=0;--n>=0;)r+=e[n],e[n]=d(r/t),r=r%t*1e7},v=function(e){for(var t=6,n="";--t>=0;)if(""!==n||0===t||0!==e[t]){var r=u(e[t]);n=""===n?r:n+f("0",7-r.length)+r}return n};r({target:"Number",proto:!0,forced:c(function(){return"0.000"!==h(8e-5,3)||"1"!==h(.9,0)||"1.25"!==h(1.255,2)||"1000000000000000128"!==h(0xde0b6b3a7640080,0)})||!c(function(){h({})})},{toFixed:function(e){var t,n,r,o,a=l(this),c=i(e),d=[0,0,0,0,0,0],h="",x="0";if(c<0||c>20)throw s("Incorrect fraction digits");if(a!=a)return"NaN";if(a<=-1e21||a>=1e21)return u(a);if(a<0&&(h="-",a=-a),a>1e-21)if(n=((t=y(a*g(2,69,1))-69)<0?a*g(2,-t,1):a/g(2,t,1))*0x10000000000000,(t=52-t)>0){for(m(d,0,n),r=c;r>=7;)m(d,1e7,0),r-=7;for(m(d,g(10,r,1),0),r=t-1;r>=23;)b(d,8388608),r-=23;b(d,1<<r),m(d,1,1),b(d,2),x=v(d)}else m(d,0,n),m(d,1<<-t,0),x=v(d)+f("0",c);return c>0?h+((o=x.length)<=c?"0."+f("0",c-o)+x:p(x,0,o-c)+"."+p(x,o-c)):h+x}})},38559:function(e,t,n){var r=n(82109),o=n(20408),i=n(86135);r({target:"Object",stat:!0},{fromEntries:function(e){var t={};return o(e,function(e,n){i(t,e,n)},{AS_ENTRIES:!0}),t}})},26833:function(e,t,n){var r=n(82109),o=n(44699).values;r({target:"Object",stat:!0},{values:function(e){return o(e)}})},16829:function(e,t,n){"use strict";n.d(t,{FS:()=>h,L6:()=>m,Ld:()=>j,ML:()=>g,OT:()=>d,Pp:()=>C,Qn:()=>v,Ro:()=>w,SV:()=>p,Uj:()=>u,X0:()=>x,d3:()=>y,fV:()=>b,t7:()=>f,zs:()=>s}),n(803),n(92274),n(75654),n(86305),n(42295),n(62307),n(36809),n(68233),n(45263),n(5196),n(33382),n(48868),n(54861),n(81874),n(66251);var r=n(43489),o=n(27662),i=n(479),l=n(76898);function a(e,t,n,r,o,i,l){try{var a=e[i](l),c=a.value}catch(e){n(e);return}a.done?t(c):Promise.resolve(c).then(r,o)}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var s=function(e){for(var t=r.Z.lib.WordArray.random(e),n=t.words,i=t.sigBytes,l=[],a=0;a<i;a++){var c=n[a>>>2]>>>24-a%4*8&255;l.push(o.Z2[c%o.Z2.length])}return l.join("")};function u(){return s(128)}function d(e){var t;return(t=function(){var t;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return l.next=a(0),l.throw=a(1),l.return=a(2),"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function a(a){return function(c){var s=[a,c];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,s[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}}(this,function(n){for(t=r.Z.SHA256(e).toString(r.Z.enc.Base64).split("+").join("-").split("/").join("_");t.endsWith("=");)t=t.slice(0,-1);return[2,t]})},function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function l(e){a(i,r,o,l,c,"next",e)}function c(e){a(i,r,o,l,c,"throw",e)}l(void 0)})})()}var f=function(){[l.V.ACTION,l.V.VERIFIER,l.V.STATE,l.V.SIGN_UP_STATE_VERIFIER].forEac
1h(function(e){l.Z.removeItem(e)})},p=function(){return"undefined"!=typeof window?"".concat(window.location.origin,"/").concat("web"):""},h=function(e,t){var n,r;return null!=(r=(c(n={},o.xY.UNSUITABLE,i.ag.t("Unsuitable",{lng:t})),c(n,o.xY.LOW,i.ag.t("Lower",{lng:t})),c(n,o.xY.MEDIUM,i.ag.t("Medium",{lng:t})),c(n,o.xY.HIGH,i.ag.t("High",{lng:t})),n)[e])?r:e},g=function(e){return e===o.Xo.FIXED?o.JX:o.pH},y=function(e,t){var n,r;return null!=(r=(c(n={},o.Xo.FIXED,i.ag.t("Fixed",{lng:t})),c(n,o.Xo.MIRROR_SIZE,i.ag.t("Mirror Size",{lng:t})),c(n,o.Xo.MIRROR_RISK_BY_EQUITY,i.ag.t("Proportional by Equity",{lng:t})),c(n,o.Xo.MIRROR_RISK_BY_BALANCE,i.ag.t("Proportional by Balance",{lng:t})),n)[e])?r:e},m=function(e,t){var n,r;return null!=(r=(c(n={},o._k.MIRROR,i.ag.t("Continue to mirror open trades",{lng:t})),c(n,o._k.CLOSE,i.ag.t("Close all open trades",{lng:t})),c(n,o._k.MANUAL,i.ag.t("Manually manage trades",{lng:t})),n)[e])?r:e},b=function(e,t){var n,r;return null!=(r=(c(n={},o.yt.TRADE_EXPIRED,i.ag.t("Your account was not connected to the Strategy when their trade was opened.",{lng:t})),c(n,o.yt.EXCEEDED_SOFT_STOP_LIMIT,i.ag.t("Trading account drawdown has exceeded the Soft Stop limit.",{lng:t})),c(n,o.yt.INSUFFICIENT_FUNDS,i.ag.t("Insufficient Funds, please top up your balance. Or close some of your open trades.",{lng:t})),c(n,o.yt.EXCEEDED_HARD_STOP_LIMIT,i.ag.t("Trading account drawdown has exceeded the Hard Stop limit.",{lng:t})),c(n,o.yt.DUE_TO_BROKER_ERROR,i.ag.t("Trade was missed due to broker error.",{lng:t})),c(n,o.yt.MINIMUM_EQUITY_NOT_MET,i.ag.t("Insufficient funds to open trade.",{lng:t})),n)[e])?r:e},v=function(e,t,n,r){var i=new URL(o.bk),l=i.searchParams;return l.append("response_type",o.lf),l.append("client_id",e),l.append("scope",o.ZU),l.append("redirect_uri",r),l.append("code_challenge",n),l.append("code_challenge_method",o.kg),l.append("acr_values","tenant:".concat(t)),l.append("prompt","login"),i.toString()},x=function(e,t,n,r,i){var l=new URLSearchParams({response_type:o.lf,state:r,code_challenge:n,code_challenge_method:o.kg,client_id:e,scope:o.l$,redirect_uri:i,acr_values:"screen_hint:sign_up tenant:".concat(t)}),a=o.wU+l.toString(),c=new URL(o.Sq);return c.searchParams.append("tenant",t),c.searchParams.append("returnUrl",a),c.toString()},w=function(e){var t=new URL(o.JR);return t.searchParams.append("tenant",e),t.toString()},C=function(e,t){try{var n=l.Z.getItem(l.V.SIGN_UP_STATE_VERIFIER),r=n?JSON.parse(n):{};r[e]=t,l.Z.setItem(l.V.SIGN_UP_STATE_VERIFIER,JSON.stringify(r))}catch(e){console.error("Failed to store copy trade verifier",e)}},j=function(e){try{var t=l.Z.getItem(l.V.SIGN_UP_STATE_VERIFIER);return(t?JSON.parse(t):{})[e]}catch(e){return console.error("Failed to get copy trade verifier from state",e),null}}},24861:function(e,t,n){"use strict";n.d(t,{j:()=>o});var r=n(61230),o=function(e){return e?r.Y9[e]:r.Y9[r.Jc.USD]}},37507:function(e,t,n){"use strict";n.d(t,{Z:()=>a}),n(92222);var r=n(74512),o=n(32735),i=n(10281),l=n(80199);let a=function(e){var t=e.isFolded,n=e.direction,i=e.onClick,a=(0,o.useMemo)(function(){switch(n){case"left":default:return l.Ro.ARROW_LEFT;case"right":return l.Ro.ARROW_RIGHT;case"top":return l.Ro.ARROW_UP;case"bottom":return l.Ro.ARROW_DOWN}},[n]);return(0,r.jsx)(c,{$direction:n,children:(0,r.jsx)(s,{$direction:n,onClick:i,children:(0,r.jsx)(u,{$isFolded:t,icon:a,size:l.sk.XS})})})};var c=i.ZP.div.withConfig({componentId:"sc-efb3d5d9-0"})(["box-sizing:border-box;display:flex;align-items:center;justify-content:center;background-color:",";"," ",""],function(e){return e.theme.themeColors.background.default},function(e){switch(e.$direction){case"left":case"right":default:return"\n width: 8px;\n height: 100%;\n ";case"top":case"bottom":return"\n width: 100%;\n height: 8px;\n "}},function(e){var t,n=e.$direction,r=e.theme;switch(n){case"left":default:t="right";break;case"right":t="left";break;case"top":t="bottom";break;case"bottom":t="top"}return"border-".concat(t,": 1px solid ").concat(r.themeColors.border.subtle,";")}),s=i.ZP.div.withConfig({componentId:"sc-efb3d5d9-1"})([""," background-color:",";flex-direction:",";cursor:pointer;display:flex;align-items:center;justify-content:center;"],function(e){switch(e.$direction){case"left":case"right":default:return"\n width: 100%;\n height: 99px;\n ";case"top":case"bottom":return"\n width: 99px;\n height: 100%;\n "}},function(e){return e.theme.themeColors.border.subtle},function(e){var t=e.$direction;return("left"===t||"right"===t)&&"column"}),u=(0,i.ZP)(l.ZP).withConfig({componentId:"sc-efb3d5d9-2"})(["",""],function(e){return e.$isFolded&&"transform: rotate(180deg);"})},79908:function(e,t,n){"use strict";n.d(t,{dz:()=>l,ol:()=>i,y7:()=>a});var r=n(10281),o=n(71225),i=r.zo.div.withConfig({componentId:"sc-7f41d9e3-0"})(["display:flex;align-items:center;width:100%;height:32px;"]),l=r.zo.div.withConfig({componentId:"sc-7f41d9e3-1"})(["display:flex;justify-content:space-between;align-items:center;padding:0 ","px;gap:","px;width:100%;"],o.A.L,o.A.XS),a=r.zo.div.withConfig({componentId:"sc-7f41d9e3-2"})(["display:flex;align-items:center;gap:","px;"],o.A.XXS)},42014:function(e,t,n){"use strict";n.d(t,{g:()=>u});var r=n(74512);n(32735);var o=n(10281),i=n(80199),l=n(38074),a=n(13589),c=n(16029),s={display:"flex",margin:"auto 0px"};let u=function(e){var t=e.withArrow,n=e.profitLoss,o=e.stretch,l=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["withArrow","profitLoss","stretch"]);return(0,r.jsxs)(d,{$stretch:o,children:[(0,r.jsx)(f,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({$profitLoss:n},l)),t&&n===c.a.PROFIT&&(0,r.jsx)(p,{icon:i.Ro.DIAGRAM_ARROW_UP,size:i.sk.S,$profitLoss:n,style:s}),t&&n===c.a.LOSS&&(0,r.jsx)(p,{icon:i.Ro.DIAGRAM_ARROW_DOWN,size:i.sk.S,$profitLoss:n,style:s})]})};var d=o.ZP.div.withConfig({componentId:"sc-23ee41ff-0"})(["display:flex;align-items:center;",""],function(e){return e.$stretch&&"\n width: 100%;\n justify-content: flex-end;\n "}),f=(0,o.ZP)(l.ZP).withConfig({componentId:"sc-23ee41ff-1"})(["color:",";"],function(e){var t=e.$profitLoss,n=e.theme;return(0,a.n1)(n.themeColors,t)}),p=(0,o.ZP)(i.ZP).withConfig({componentId:"sc-23ee41ff-2"})(["color:",";"],function(e){var t=e.$profitLoss,n=e.theme;return(0,a.n1)(n.themeColors,t)})},88399:function(e,t,n){"use strict";n.d(t,{Z:()=>u});var r=n(74512);n(32735);var o=n(10281),i=n(81182),l=n(38074),a=n(19367),c=n(18699),s=function(e,t){switch(e){case c.B9.BUY:return t.pnl.positive.default;case c.B9.SELL:default:return t.pnl.negative.default}};let u=function(e){var t=e.orderType,n=e.getTextFromOrderType,o=void 0===n?a.su:n,l=e.dataTestId,c=(0,i.$G)().i18n.language,s=(0,a.cj)(t);return(0,r.jsx)(d,{$buySellType:s,dataTestId:l,children:o(t,!1,c)})};var d=(0,o.zo)(l.ZP).withConfig({componentId:"sc-bea6ccfc-0"})(["color:",";"],function(e){return s(e.$buySellType,e.theme.themeColors)})},50449:function(e,t,n){"use strict";n.d(t,{Z:()=>tp});var r=n(32735),o=n(81182),i=n(97186),l=n(27662),a=n(93004),c=n(2871),s=n(17580);function u(e,t,n,r,o,i,l){try{var a=e[i](l),c=a.value}catch(e){n(e);return}a.done?t(c):Promise.resolve(c).then(r,o)}function d(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function l(e){u(i,r,o,l,a,"next",e)}function a(e){u(i,r,o,l,a,"throw",e)}l(void 0)})}}function f(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return l.next=a(0),l.throw=a(1),l.return=a(2),"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function a(a){return function(c){var s=[a,c];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,s[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}}var p=n(74512),h=n(78459),g=n(45954),y=n(88651);n(96752);
1var m=n(99773),b=n(66698),v=n(36333),x=n(81613),w=n(16829),C=n(84823),j=function(){var e,t=(0,o.$G)().t,n=(0,x.n6)(),i=(0,x.RJ)(),a=(null!=(e=null==n?void 0:n.tenantCopyTradeConfig)?e:{}).minimumTradeSize;return{schema:(0,r.useMemo)(function(){var e=null!=a?a:0;return C.Ry().shape({tradeSizeType:C.Z_().required(t("Please select a trade size type.")),tradeSizeValue:C.Rx().required(t("Please enter a valid trade size value.")).typeError(t("Please enter a valid trade size value.")).when("tradeSizeType",{is:l.Xo.FIXED,then:function(n){return n.min(e,t("Trade size value must be greater or equal to {{value}}.",{value:e})).max(l.JX,t("Trade size value must not exceed {{value}}.",{value:l.JX}))},otherwise:function(e){return e.min(l._l,t("Proportion minimum should be {{value}}",{value:l._l})).max(l.pH,t("Trade size value must not exceed {{value}}.",{value:l.pH}))}}),isOpenExistingTrades:C.O7(),isRoundUpToMinimumSize:C.O7()})},[a,t]),defaultValues:(0,r.useMemo)(function(){var e,t,n,r,o;return{tradeSizeType:null!=(e=null==i?void 0:i.tradeSizeType)?e:"",tradeSizeValue:null!=(n=null!=(t=null==i?void 0:i.tradeSizeValue)?t:a)?n:"",isOpenExistingTrades:null!=(r=null==i?void 0:i.isOpenExistingTrades)&&r,isRoundUpToMinimumSize:null!=(o=null==i?void 0:i.isRoundUpToMinimumSize)&&o}},[i,a]),minimumTradeSize:a}};function P(e,t,n,r,o,i,l){try{var a=e[i](l),c=a.value}catch(e){n(e);return}a.done?t(c):Promise.resolve(c).then(r,o)}var O=function(e){var t=e.isEdit,n=e.onSuccess,o=e.onError,i=(0,x.jW)(),a=(0,x.rx)(),c=(0,x.xW)(),s=(0,x.dT)(),u=j(),d=u.sc
1hema,f=u.defaultValues,p=u.minimumTradeSize,h=(0,r.useMemo)(function(){return(0,m.X)(d)},[d]),g=(0,v.w)({resolver:h,mode:"all",reValidateMode:"onChange",shouldFocusError:!1,defaultValues:f}),y=g.handleSubmit,C=g.reset,O=g.formState;(0,r.useEffect)(function(){C(f)},[f,C]);var S=(0,r.useCallback)(function(e){var t=e.target.value;if(""===t)return void g.setValue("tradeSizeValue","",{shouldValidate:!0});var n=Number(t);!isNaN(n)&&n>(0,w.ML)(g.getValues("tradeSizeType"))||g.setValue("tradeSizeValue",t,{shouldValidate:!0})},[g]),T=(0,r.useCallback)(function(e){if(""===e)return void g.setValue("tradeSizeValue","",{shouldValidate:!0});var t=new b.BigNumber(e).toNumber();!isNaN(t)&&t>(0,w.ML)(g.getValues("tradeSizeType"))||g.setValue("tradeSizeValue",e,{shouldValidate:!0})},[g]),E=(0,r.useCallback)(function(e){g.setValue("tradeSizeType",e,{shouldValidate:!0});var t=e===l.Xo.FIXED?null!=p?p:"":l._l;g.setValue("tradeSizeValue",t,{shouldValidate:!0}),g.clearErrors("tradeSizeType")},[g,p]),I=(0,r.useCallback)(function(e){return function(r){var l;return(l=function(){var l,c,s,u,d;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return l.next=a(0),l.throw=a(1),l.return=a(2),"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function a(a){return function(c){var s=[a,c];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,s[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}}(this,function(f){switch(f.label){case 0:var p,h;if(c=null!=(l=null==i?void 0:i.id)?l:"",u=null!=(s=null==a?void 0:a.id)?s:"",!c||!u)return null==o||o(),[2];d={values:(p=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},{tradeSizeType:r.tradeSizeType,tradeSizeValue:Number(r.tradeSizeValue),isOpenExistingTrades:r.isOpenExistingTrades,isRoundUpToMinimumSize:r.isRoundUpToMinimumSize}),h=h={copierId:c,strategyId:u},Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(h)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(h)).forEach(function(e){Object.defineProperty(p,e,Object.getOwnPropertyDescriptor(h,e))}),p),onSuccess:function(){null==e||e(),null==n||n()},onError:function(e){null==o||o(e)}},f.label=1;case 1:return f.trys.push([1,3,,4]),[4,t?x.Bz.editCopySettings(d):x.Bz.createCopySettings(d)];case 2:return f.sent(),[3,4];case 3:return f.sent(),null==o||o(),[3,4];case 4:return[2]}})},function(){var e=this,t=arguments;return new Promise(function(n,r){var o=l.apply(e,t);function i(e){P(o,n,r,i,a,"next",e)}function a(e){P(o,n,r,i,a,"throw",e)}i(void 0)})})()}},[null==i?void 0:i.id,t,o,n,null==a?void 0:a.id]);return{formMethods:g,submit:(0,r.useCallback)(function(e){return function(t){return y(I(e))(t)}},[y,I]),isSubmitting:c||s,formState:O,handleSubmit:y,handleTradeSizeValueChange:S,handleTradeSizeValueChangeText:T,handleTradeSizeTypeChange:E}},S=n(73407),T=n(56740);function E(e,t,n,r,o,i,l){try{var a=e[i](l),c=a.value}catch(e){n(e);return}a.done?t(c):Promise.resolve(c).then(r,o)}var I=function(e){var t=e.onSuccess,n=(0,o.$G)().t,i=(0,r.useMemo)(function(){return C.Ry().shape({isAgreeStatements:C.O7().oneOf([!0],n("Please confirm that you accept the above statements.")),isAgreeTerms:C.O7().oneOf([!0],n("Please confirm that you agree to the terms."))})},[n]),l=(0,r.useMemo)(function(){return(0,m.X)(i)},[i]),a=(0,v.w)({resolver:l,mode:"onSubmit",reValidateMode:"onChange",shouldFocusError:!1,defaultValues:{isAgreeStatements:!1,isAgreeTerms:!1}}),c=a.handleSubmit,s=(0,r.useCallback)(function(e){return function(){var n;return(n=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return l.next=a(0),l.throw=a(1),l.return=a(2),"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function a(a){return function(c){var s=[a,c];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,s[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}}(this,function(n){return null==e||e(),null==t||t(),[2]})},function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function l(e){E(i,r,o,l,a,"next",e)}function a(e){E(i,r,o,l,a,"throw",e)}l(void 0)})})()}},[t]);return{formMethods:a,submit:(0,r.useCallback)(function(e){return function(t){return c(s(e))(t)}},[c,s]),handleSubmit:c}},R=n(10281),Z=n(74307),A=n(18354),_=n(62715),L=n(71225),D=n(38074);let k=function(){var e=(0,o.$G)().t,t=(0,h.Gc)().control;return(0,p.jsxs)(M,{children:[(0,p.jsx)(N,{typography:_.wZ.TEXT_M_MEDIUM,children:e("Social Trading Authorization and Subscription Terms ('STAST')")}),(0,p.jsx)(X,{typography:_.wZ.TEXT_M_REGULAR,children:e("You have subscribed to follow or copy the trades of a Signal Provider where you will be required to pay a performance fee and/or connection charge as stated in the subscription information provided. To read the full terms of the Social Trading Authorisation and Subscription Terms ('STAST'), click Axi Group.")}),(0,p.jsx)(X,{typography:_.wZ.TEXT_M_REGULAR,children:e("You acknowledge and agree to the following. All capitalised terms not defined below are defined within the STAST:")}),(0,p.jsxs)(U,{children:[(0,p.jsx)("li",{children:(0,p.jsx)(z,{typography:_.wZ.TEXT_M_REGULAR,children:e("I understand that my executing broker is facilitating the trades I wish to copy, and I understand the Broker does not, by implication or otherwise, end
1orse the operating methods of the Signal Provider.")})}),(0,p.jsx)("li",{children:(0,p.jsx)(z,{typography:_.wZ.TEXT_M_REGULAR,children:e("I hereby release the Broker from any and all liability with respect to the damage, losses or lost profits sustained or alleged to have been sustained as a result of the Broker following the instructions of Pelican and/or a Signal Provider chosen by me, or for any matter arising out of the relationship between myself, the Signal Provider, or Pelican Group.")})}),(0,p.jsx)("li",{children:(0,p.jsx)(z,{typography:_.wZ.TEXT_M_REGULAR,children:e("I agree to hold the Broker harmless and to indemnify it as to any expense, damage or liability sustained by it with respect to any and all acts and practices of the Signal Provider regarding my account, including all losses arising therefrom.")})})]}),(0,p.jsxs)(G,{children:[(0,p.jsx)(A.ZP,{children:(0,p.jsx)(h.Qr,{name:"isAgreeStatements",control:t,render:function(t){var n,r,o=t.field,i=t.fieldState;return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(Z.Z,{variant:Z.Q.WITH_LABEL_DESCRIPTION,label:e("I confirm I have read, understood and agree to the above statements."),checked:o.value,onClick:function(){return o.onChange(!o.value)},error:!!(null==(n=i.error)?void 0:n.message)}),(0,p.jsx)(D.ZP,{variant:D.fD.ERROR,error:null==(r=i.error)?void 0:r.message})]})}})}),(0,p.jsx)(A.ZP,{children:(0,p.jsx)(h.Qr,{name:"isAgreeTerms",control:t,render:function(t){var n,r,o=t.field,i=t.fieldState;return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(F,{children:[(0,p.jsx)(Z.Z,{checked:o.value,onClick:function(){return o.onChange(!o.value)},error:!!(null==(n=i.error)?void 0:n.message)}),(0,p.jsx)(B,{htmlFor:"isAgreeTerms",onClick:function(){return o.onChange(!o.value)},children:(0,p.jsxs)(Y,{children:[e("I have read, understood and agree to the")," ",(0,p.jsx)("a",{href:l.fN,target:"_blank",rel:"noreferrer",children:e("Social Trading Authorization and Subscription Terms ('STAST')")}),"."]})})]}),(0,p.jsx)(D.ZP,{variant:D.fD.ERROR,error:null==(r=i.error)?void 0:r.message})]})}})})]})]})};var M=R.ZP.div.withConfig({componentId:"sc-aeb6773d-0"})(["width:100%;display:flex;flex-direction:column;padding:","px ","px;max-width:488px;"],L.A.M,L.A.L),N=(0,R.ZP)(D.ZP).withConfig({componentId:"sc-aeb6773d-1"})(["margin-bottom:","px;"],L.A.M),X=(0,R.ZP)(D.ZP).withConfig({componentId:"sc-aeb6773d-2"})(["margin-bottom:","px;"],L.A.S),U=R.ZP.ul.withConfig({componentId:"sc-aeb6773d-3"})(["padding-left:","px;> li::marker{content:'â¢';color:",";position:absolute;font-size:1em;}"],L.A.REGULAR,function(e){return e.theme.themeColors.text.default}),z=(0,R.ZP)(D.ZP).withConfig({componentId:"sc-aeb6773d-4"})(["margin-left:","px;margin-bottom:","px;"],L.A.REGULAR,L.A.S),G=R.ZP.div.withConfig({componentId:"sc-aeb6773d-5"})(["display:flex;flex-direction:column;gap:","px;"],L.A.XS),F=R.ZP.div.withConfig({componentId:"sc-aeb6773d-6"})(["display:flex;align-items:flex-start;"]),B=R.ZP.label.withConfig({componentId:"sc-aeb6773d-7"})(["cursor:pointer;margin-inline-start:","px;"],L.A.XXS),Y=(0,R.ZP)(D.ZP).withConfig({componentId:"sc-aeb6773d-8"})(["a{color:",";text-decoration:underline;cursor:pointer;}"],function(e){return e.theme.themeColors.primary});function V(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function H(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}var W=function(e){var t=e.onOk,n=e.onCancel,r=(0,o.$G)().t,l=I({onSuccess:function(){t&&(t(),null==n||n())},onError:function(){null==n||n()}}).formMethods;return(0,p.jsx)(h.RV,H(V({},l),{children:(0,p.jsx)("form",{onSubmit:function(e){e.preventDefault(),t&&l.handleSubmit(function(){t(),null==n||n()})()},children:(0,p.jsx)(i.ZP,{variant:i.KH.CONFIRMATION,modalTitle:r("Authorization"),onCancel:n,cancelText:r("Cancel"),okText:r("Confirm"),okButtonProps:{htmlType:"submit",disabled:l.formState.isSubmitting},children:(0,p.jsx)(k,{})})})}))},$=function(e){var t=function(t){var n;null==e||null==(n=e.onCancel)||n.call(e),t()};(0,y.ZP)(function(n){return(0,p.jsx)(r.Suspense,{children:(0,p.jsx)(W,H(V({},e),{onCancel:function(){return t(n)}}))})})};n(68309);var K=n(80199),q=n(33007);n(62353),n(42295);var J=n(46645);function Q(e,t,n,r,o,i,l){try{var a=e[i](l),c=a.value}catch(e){n(e);return}a.done?t(c):Promise.resolve(c).then(r,o)}var ee=function(e){var t=e.onSuccess,n=e.onError,i=(0,o.$G)().t,l=(0,x.jW)(),a=(0,r.useCallback)(function(e){var t;return null==e?null:null!=(t=(0,J.eI)(new b.BigNumber(e).times(100)))?t:null},[]),c=(0,r.useCallback)(function(e,t){return void 0===t||""===t||Number.isNaN(e)?null:e},[]),s=(0,r.useMemo)(function(){return C.Ry().shape({currentLevel:C.Rx().nullable(),softStopLevel:C.Rx().transform(c).min(0,i("âSoft Stop Levelâ must be greater than or equal to 0.00%")).max(100,i("âSoft Stop Levelâ must be less than or equal to 100.00%")).typeError(i("âSoft Stop Levelâ is invali
1d")).test("soft-greater-than-current",function(e){var t=this.parent.currentLevel;return null==e||null==t||!(e<=t)||this.createError({message:i("âSoft Stop Levelâ must be greater than âCurrent Levelâ")})}).nullable(),hardStopLevel:C.Rx().transform(c).min(0,i("âHard Stop Levelâ must be greater than or equal to 0.00%")).max(100,i("âHard Stop Levelâ must be less than or equal to 100.00%")).typeError(i("âHard Stop Levelâ is invalid")).test("hard-greater-than-current",function(e){var t=this.parent.currentLevel;return null==e||null==t||!(e<=t)||this.createError({message:i("âHard Stop Levelâ must be greater than âCurrent Levelâ")})}).test("hard-greater-than-soft",function(e){var t=this.parent.softStopLevel;return null==e||null==t||!(e<=t)||this.createError({message:i("âHard Stop Levelâ must be greater than âSoft Stop Levelâ")})}).nullable()})},[i,c]),u=(0,r.useMemo)(function(){return(0,m.X)(s)},[s]),d=(0,v.w)({resolver:u,mode:"all",reValidateMode:"onBlur",shouldFocusError:!1}),f=d.handleSubmit,p=d.setValue;(0,r.useEffect)(function(){var e=null==l?void 0:l.drawdown;p("currentLevel",a(null==e?void 0:e.currentLevel),{shouldValidate:!0}),p("softStopLevel",a(null==e?void 0:e.softStopLevel),{shouldValidate:!0}),p("hardStopLevel",a(null==e?void 0:e.hardStopLevel),{shouldValidate:!0})},[null==l?void 0:l.drawdown,a,p]);var h=(0,r.useCallback)(function(e){return function(r){var o;return(o=function(){var o,i,a,c,s,u,d;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return l.next=a(0),l.throw=a(1),l.return=a(2),"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function a(a){return function(c){var s=[a,c];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,s[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}}(this,function(f){return o=r.hardStopLevel,i=r.softStopLevel,a=r.currentLevel,s={copierId:null!=(c=null==l?void 0:l.id)?c:""},null!=a&&(s.currentLevel=a),null!=i&&(s.softStopLevel=null!=(u=(0,J.eI)(new b.BigNumber(i).dividedBy(100)))?u:void 0),null!=o&&(s.hardStopLevel=null!=(d=(0,J.eI)(new b.BigNumber(o).dividedBy(100)))?d:void 0),x.Bz.editCopierDrawdown({values:s,onSuccess:function(){null==e||e(),null==t||t()},onError:function(){null==n||n()}}),[2]})},function(){var e=this,t=arguments;return new Promise(function(n,r){var i=o.apply(e,t);function l(e){Q(i,n,r,l,a,"next",e)}function a(e){Q(i,n,r,l,a,"throw",e)}l(void 0)})})()}},[null==l?void 0:l.id,t,n]);return{formMethods:d,submit:(0,r.useCallback)(function(e){return function(t){return f(h(e))(t)}},[f,h]),handleSubmit:f}},et=n(38416),en=n(96838),er=n(33481);n(21249),n(92222);let eo=function(){var e=(0,o.$G)().t;return[e("Drawdown protections are not guaranteed"),e("Regularly reviewing your trading activity is critical to manage your risk"),e("Excessive risk (trade size) may result in drawdown protection levels being missed")]},ei=function(){var e=(0,o.$G)().t,t=eo();return(0,p.jsxs)(el,{children:[(0,p.jsxs)(ea,{typography:_.wZ.TEXT_M_REGULAR,children:[e("You accept that"),":"]}),(0,p.jsx)(ec,{children:t.map(function(e){return(0,p.jsx)("li",{children:(0,p.jsx)(es,{typography:_.wZ.TEXT_M_REGULAR,children:e})},e)})}),(0,p.jsxs)(eu,{typography:_.wZ.TEXT_M_REGULAR,children:["".concat(e("Tap Agree and Confirm to accept our"))," ",(0,p.jsxs)("a",{href:l.nv,target:"_blank",rel:"noreferrer",children:[e("Signal Drawdown Terms")," "]}),"."]})]})};var el=R.ZP.div.withConfig({componentId:"sc-4197d4fa-0"})(["width:100%;display:flex;flex-direction:column;"]),ea=(0,R.ZP)(D.ZP).withConfig({componentId:"sc-4197d4fa-1"})(["white-space:pre-wrap;word-break:break-word;"]),ec=R.ZP.ul.withConfig({componentId:"sc-4197d4fa-2"})(["padding-left:","px;> li::marker{content:'â¢';position:absolute;font-size:1em;color:",";}"],L.A.REGULAR,function(e){return e.theme.themeColors.text.default}),es=(0,R.ZP)(D.ZP).withConfig({componentId:"sc-4197d4fa-3"})(["margin-left:","px;"],L.A.XS),eu=(0,R.ZP)(D.ZP).withConfig({componentId:"sc-4197d4fa-4"})(["a{color:",";text-decoration:underline;cursor:pointer;}"],function(e){return e.theme.themeColors.primary});n(56977),n(41539),n(39714);var ed=n(18909),ef=n(15226),ep=n(32972);function eh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let eg=function(){var e,t,n,i,a=(0,o.$G)().t,c=(0,q.VC)().theme,s=(0,h.Gc)(),u=s.watch,d=s.register,f=s.formState,g=s.setValue,y=s.getValues,m=s.trigger,v=(e=u(["hardStopLevel"]),function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(n=o.next()).done)&&(i.push(n.value),i.length!==t);l=!0);}catch(e){a=!0,r=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw r}}return i}}(e,1)||function(e,t){if(e){if("string"==typeof e)return eh(e,1);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eh(e,t)}}
1(e,1)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],x=f.errors.hardStopLevel,w=function(e){var t=y("hardStopLevel")||l._z;g("hardStopLevel",(e?new b.BigNumber(t).plus(l.NC):new b.BigNumber(t).minus(l.NC)).toFixed(2),{shouldValidate:!0}),m("softStopLevel")},C=(0,r.useCallback)(function(e){g("hardStopLevel",e,{shouldValidate:!0}),m("softStopLevel")},[g,m]);return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(ey,{children:[(0,p.jsxs)(eb,{children:[(0,p.jsx)(D.ZP,{typography:_.wZ.TEXT_M_REGULAR,children:a("Hard Stop Level")}),(0,p.jsx)(ef.Z,{variant:ef.q.BASE,placement:"top",trigger:"mouseenter",content:(0,p.jsx)(ex,{children:a("If triggered, all trades will close and copying will be suspended.")}),children:(0,p.jsx)(K.ZP,{icon:K.Ro.INFO,size:K.sk.SM,color:c.themeColors.text.placeholder})})]}),(0,p.jsx)(em,{children:(0,p.jsx)(A.ZP,{children:(0,p.jsx)(ed.ZP,(t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({variant:ed.Bv.BORDERED_NUMERIC},d("hardStopLevel")),n=n={inputDataTestId:"",addButtonDataTestId:"",subtractButtonDataTestId:"",placeholder:"0.00",unit:"%",value:null!=v?String(v):void 0,onChange:function(e){C(e.target.value)},onClickPlus:function(){w(!0)},onClickSubtract:function(){w(!1)},maxDecimals:(0,ep.N)(l.NC)},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))})})]}),x&&(0,p.jsx)(ev,{color:c.themeColors.error,typography:_.wZ.TEXT_S_REGULAR,children:null==x||null==(i=x.message)?void 0:i.toString()})]})};var ey=R.ZP.div.withConfig({componentId:"sc-be972f46-0"})(["display:flex;justify-content:space-between;gap:","px;"],L.A.XS),em=R.ZP.div.withConfig({componentId:"sc-be972f46-1"})(["width:140px;"]),eb=R.ZP.div.withConfig({componentId:"sc-be972f46-2"})(["display:flex;flex-direction:row;justify-content:space-between;align-items:center;gap:","px;"],L.A.XXS),ev=(0,R.ZP)(D.ZP).withConfig({componentId:"sc-be972f46-3"})(["text-align:end;"]),ex=(0,R.ZP)(D.ZP).withConfig({componentId:"sc-be972f46-4"})(["color:",";padding:","px ","px;"],function(e){return e.theme.themeColors.background.default},L.A.XS,L.A.M);function ew(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let eC=function(){var e,t,n,i,a=(0,o.$G)().t,c=(0,q.VC)().theme,s=(0,h.Gc)(),u=s.watch,d=s.register,f=s.formState,g=s.setValue,y=s.getValues,m=s.trigger,v=(e=u(["softStopLevel"]),function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(n=o.next()).done)&&(i.push(n.value),i.length!==t);l=!0);}catch(e){a=!0,r=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw r}}return i}}(e,1)||function(e,t){if(e){if("string"==typeof e)return ew(e,1);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ew(e,t)}}(e,1)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],x=f.errors.softStopLevel,w=function(e){var t=y("softStopLevel")||l._z;g("softStopLevel",(e?new b.BigNumber(t).plus(l.NC):new b.BigNumber(t).minus(l.NC)).toFixed(2),{shouldValidate:!0}),m("hardStopLevel")},C=(0,r.useCallback)(function(e){g("softStopLevel",e,{shouldValidate:!0}),m("hardStopLevel")},[g,m]);return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(ej,{children:[(0,p.jsxs)(eO,{children:[(0,p.jsx)(D.ZP,{typography:_.wZ.TEXT_M_REGULAR,children:a("Soft Stop Level")}),(0,p.jsx)(ef.Z,{variant:ef.q.BASE,placement:"top",trigger:"mouseenter",content:(0,p.jsx)(eT,{children:a("If triggered, copying will be suspended.")}),children:(0,p.jsx)(K.ZP,{icon:K.Ro.INFO,size:K.sk.SM,color:c.themeColors.text.placeholder})})]}),(0,p.jsx)(eP,{children:(0,p.jsx)(A.ZP,{children:(0,p.jsx)(ed.ZP,(t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({variant:ed.Bv.BORDERED_NUMERIC},d("softStopLevel")),n=n={inputDataTestId:"",addButtonDataTestId:"",subtractButtonDataTestId:"",placeholder:"0.00",unit:"%",value:null!=v?String(v):void 0,onChange:function(e){return C(e.target.value)},onClickPlus:function(){w(!0)},onClickSubtract:function(){w(!1)},maxDecimals:(0,ep.N)(l.NC)},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}
1)(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t))})})]}),x&&(0,p.jsx)(eS,{color:c.themeColors.error,typography:_.wZ.TEXT_S_REGULAR,children:null==x||null==(i=x.message)?void 0:i.toString()})]})};var ej=R.ZP.div.withConfig({componentId:"sc-f9da38ae-0"})(["display:flex;justify-content:space-between;gap:","px;"],L.A.XS),eP=R.ZP.div.withConfig({componentId:"sc-f9da38ae-1"})(["width:140px;"]),eO=R.ZP.div.withConfig({componentId:"sc-f9da38ae-2"})(["display:flex;flex-direction:row;justify-content:space-between;align-items:center;gap:","px;"],L.A.XXS),eS=(0,R.ZP)(D.ZP).withConfig({componentId:"sc-f9da38ae-3"})(["text-align:end;"]),eT=(0,R.ZP)(D.ZP).withConfig({componentId:"sc-f9da38ae-4"})(["color:",";padding:","px ","px;"],function(e){return e.theme.themeColors.background.default},L.A.XS,L.A.M);function eE(e,t,n,r,o,i,l){try{var a=e[i](l),c=a.value}catch(e){n(e);return}a.done?t(c):Promise.resolve(c).then(r,o)}let eI=function(e){var t=e.onResetSuccess,n=(0,o.$G)().t,i=(0,c.jW)(),l=(0,c.Pc)(),a=(0,c.ml)(),s=(0,r.useMemo)(function(){var e,t;return null!=(t=null==i||null==(e=i.drawdown)?void 0:e.currentLevel)?t:0},[null==i?void 0:i.drawdown]),u=(0,r.useCallback)(function(){var e;return(e=function(){var e;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return l.next=a(0),l.throw=a(1),l.return=a(2),"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function a(a){return function(c){var s=[a,c];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,s[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}}(this,function(n){switch(n.label){case 0:return[4,x.Bz.resetCopierDrawdown({copierId:null!=(e=null==i?void 0:i.id)?e:"",onSuccess:function(){null==t||t()}})];case 1:return n.sent(),[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function l(e){eE(i,r,o,l,a,"next",e)}function a(e){eE(i,r,o,l,a,"throw",e)}l(void 0)})})()},[null==i?void 0:i.id,t]);return(0,p.jsxs)(eR,{children:[(0,p.jsxs)(e_,{children:[(0,p.jsx)(D.ZP,{typography:_.wZ.TEXT_L_SEMIBOLD,children:n("Current Level")}),(0,p.jsxs)(eZ,{children:[(0,p.jsx)(eA,{children:a?(0,p.jsx)(g.ZP,{size:g.iO.S,absolute:!1}):(0,p.jsxs)(D.ZP,{typography:_.wZ.TEXT_L_SEMIBOLD,children:[(0,er.Wi)((0,J.eI)(new b.BigNumber(s).times(100)),2,!1),"%"]})}),(0,p.jsx)(en.ZP,{variant:en.eF.OUTLINED_THEMED,size:"small",className:"edit-copier-drawdown-reset-button",onClick:u,disabled:l||a,children:n("Reset")})]})]}),(0,p.jsx)(eL,{}),(0,p.jsxs)(eD,{children:[(0,p.jsx)(eC,{}),(0,p.jsx)(eg,{})]}),(0,p.jsx)(eL,{}),(0,p.jsx)(ei,{})]})};var eR=R.ZP.div.withConfig({componentId:"sc-ba2198c4-0"})(["display:flex;width:488px;padding:","px ","px ","px ","px;flex-direction:column;align-items:stretch;justify-content:start;gap:","px;"],L.A.L,L.A.L,L.A.XXS,L.A.L,L.A.XS),eZ=R.ZP.div.withConfig({componentId:"sc-ba2198c4-1"})(["display:flex;flex-direction:row;justify-content:space-between;align-items:center;gap:","px;.edit-copier-drawdown-reset-button{min-width:40px !important;}"],L.A.XS),eA=R.ZP.div.withConfig({componentId:"sc-ba2198c4-2"})(["display:flex;align-items:center;gap:","px;"],L.A.XXS),e_=R.ZP.div.withConfig({componentId:"sc-ba2198c4-3"})(["display:flex;flex-direction:row;justify-content:space-between;align-items:center;
1"]),eL=R.ZP.span.withConfig({componentId:"sc-ba2198c4-4"})(["border:none;width:100%;background-color:",";height:1px;"],function(e){return e.theme.themeColors.border.subtle}),eD=R.ZP.div.withConfig({componentId:"sc-ba2198c4-5"})(["display:flex;flex-direction:column;gap:","px;"],L.A.S);function ek(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function eM(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}var eN=function(e){var t=e.isCopier,n=e.onCancel,a=(0,o.$G)().t,s=(0,c.Pc)(),u=(0,x.jW)(),d=(0,r.useCallback)(function(){t&&(null==u?void 0:u.id)&&et.bD.getCopyTradeProfile({copierId:u.id,isCustomLoading:!0})},[t,null==u?void 0:u.id]),f=ee({onSuccess:function(){d(),null==n||n()}}),g=f.submit,y=f.formMethods;return(0,p.jsx)(h.RV,eM(ek({},y),{children:(0,p.jsx)(i.ZP,{variant:i.KH.CONFIRMATION,modalTitleNode:(0,p.jsxs)(eU,{children:[(0,p.jsx)(D.ZP,{typography:_.wZ.TEXT_L_SEMIBOLD,children:a("Edit Copier Drawdown")}),(0,p.jsx)("a",{href:l.Sf,target:"_blank",rel:"noreferrer",children:(0,p.jsx)(K.ZP,{icon:K.Ro.INFO,size:K.sk.L})})]}),okButtonProps:{disabled:!y.formState.isValid},onCancel:n,cancelText:a("Cancel"),okText:a("Agree and Confirm"),onOk:function(){g()()},loading:s,children:(0,p.jsx)(eI,{onResetSuccess:d})})}))},eX=function(e){var t=function(t){var n;null==e||null==(n=e.onCancel)||n.call(e),t()};(0,y.ZP)(function(n){return(0,p.jsx)(r.Suspense,{children:(0,p.jsx)(eN,eM(ek({},e),{onCancel:function(){return t(n)}}))})})},eU=R.ZP.div.withConfig({componentId:"sc-375dcf76-0"})(["display:flex;align-items:center;justify-content:center;gap:","px;"],L.A.XXS),ez=function(e){var t,n=e.code,l=e.isSuccess,a=e.onCancel,c=(0,o.$G)().t,s=(0,q.VC)().theme,u=(0,x.rx)(),d=null!=(t=null==u?void 0:u.name)?t:"",f=(0,r.useMemo)(function(){return{title:l?c("Copy Trade Successful"):c("Failed to Copy Trade"),icon:l?K.Ro.CHECK_CIRCLE:K.Ro.INFO,iconColor:l?s.themeColors.success:s.themeColors.error,content:l?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(D.ZP,{children:c("Your application to auto-copy {{strategyName}} is complete.",{strategyName:d})}),(0,p.jsx)(D.ZP,{children:c("It may take a few minutes while your account is enabled.")}),(0,p.jsx)(D.ZP,{children:c("You can manage your risk by clicking on the âMax Drawdownâ option.")})]}):(0,p.jsx)(D.ZP,{children:(0,S.yi)(n,c("Failed to copy strategy, please try again later."))})}},[l,c,s.themeColors.success,s.themeColors.error,d,n]);return(0,p.jsx)(i.ZP,{maxWidth:376,variant:i.KH.BASIC,cancelText:c("Max Drawdown"),onCancel:l?function(){eX({onCancel:function(){null==a||a()}})}:void 0,okText:c("Confirm"),onOk:a,title:f.title,titlePrefix:(0,p.jsx)(K.ZP,{icon:f.icon,color:f.iconColor,size:K.sk.M}),children:(0,p.jsx)(eF,{children:f.content})})},eG=function(e){var t=function(t){var n;null==e||null==(n=e.onCancel)||n.call(e),t()};(0,y.ZP)(function(n){var o,i;return(0,p.jsx)(r.Suspense,{children:(0,p.jsx)(ez,(o=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e),i=i={onCancel:function(){return t(n)}},Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}
1)(Object(i)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(i,e))}),o))})})},eF=R.ZP.div.withConfig({componentId:"sc-b626e8d2-0"})(["width:376px;"]),eB=function(e){var t=e.onOk,n=e.onCancel,r=(0,o.$G)().t,l=(0,q.VC)().theme,a=(0,x.xy)(),c=(0,x.Wh)(),s=(0,x.dT)(),u=null==a?void 0:a.name;return(0,p.jsx)(i.ZP,{variant:i.KH.BASIC,onCancel:n,cancelText:r("Cancel"),okText:r("Confirm"),onOk:function(){null==t||t(n)},title:r("Edit Copy Trade Confirmation"),titlePrefix:(0,p.jsx)(K.ZP,{icon:K.Ro.INFO,color:l.themeColors.warning.background,size:K.sk.M}),loading:c||s,children:(0,p.jsx)(D.ZP,{children:r("Are you sure you want to proceed with editing your current auto copy for {{strategyName}}?",{strategyName:u})})})},eY=function(e){var t=function(t){var n;null==e||null==(n=e.onCancel)||n.call(e),t()};(0,y.ZP)(function(n){var o,i;return(0,p.jsx)(r.Suspense,{children:(0,p.jsx)(eB,(o=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e),i=i={onCancel:function(){return t(n)}},Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(i)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(i,e))}),o))})})},eV=function(e){var t=e.code,n=e.isSuccess,l=e.onCancel,a=(0,o.$G)().t,c=(0,q.VC)().theme,s=(0,x.xy)(),u=null==s?void 0:s.name,d=(0,r.useMemo)(function(){return{title:n?a("Copy Trade Updated"):a("Failed to Update Copy Trade"),icon:n?K.Ro.CHECK_CIRCLE:K.Ro.INFO,iconColor:n?c.themeColors.success:c.themeColors.error,content:n?a("Youâve successfully updated your copy trading Strategy for {{strategyName}}.",{strategyName:u}):(0,S.yi)(t,a("Failed to update your copy trading Strategy for {{strategyName}}, please try again later.",{strategyName:u}))}}
1,[n,a,c.themeColors.success,c.themeColors.error,u,t]);return(0,p.jsx)(i.ZP,{variant:i.KH.BASIC,cancelText:a("Max Drawdown"),onCancel:n?function(){eX({onCancel:function(){null==l||l()}})}:void 0,okText:a("Confirm"),onOk:l,title:d.title,titlePrefix:(0,p.jsx)(K.ZP,{icon:d.icon,color:d.iconColor,size:K.sk.M}),children:(0,p.jsx)(D.ZP,{children:d.content})})},eH=function(e){var t=function(t){var n;null==e||null==(n=e.onCancel)||n.call(e),t()};(0,y.ZP)(function(n){var o,i;return(0,p.jsx)(r.Suspense,{children:(0,p.jsx)(eV,(o=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e),i=i={onCancel:function(){return t(n)}},Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(i)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(i,e))}),o))})})},eW=function(e){var t=e.onOk,n=e.onCancel,r=(0,o.$G)().t,l=(0,q.VC)().theme,a=(0,x.xW)();return(0,p.jsx)(i.ZP,{variant:i.KH.BASIC,onCancel:n,cancelText:r("Cancel"),okText:r("Confirm"),onOk:function(){t?t(n):(eG({isSuccess:!1}),null==n||n())},title:r("Leverage Warning"),titlePrefix:(0,p.jsx)(K.ZP,{icon:K.Ro.INFO,color:l.themeColors.warning.background,size:K.sk.M}),loading:a,children:(0,p.jsx)(D.ZP,{children:r("Copying an account with different leverage can cause trading discrepancies. Click âConfirmâ to accept the risk.")})})},e$=function(e){var t=function(t){var n;null==e||null==(n=e.onCancel)||n.call(e),t()};(0,y.ZP)(function(n){var o,i;return(0,p.jsx)(r.Suspense,{children:(0,p.jsx)(eW,(o=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e),i=i={onCancel:function(){return t(n)}},Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(i)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(i,e))}),o))})})};n(26833);var eK=n(67492),eq=n(76594);function eJ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let eQ=function(e){var t,n,i,a,c,s=e.isEdit,u=e.onTradeSizeValueChange,d=e.onTradeSizeTypeChange,f=(0,o.$G)().t,g=(0,q.VC)().theme,y=(0,x.jW)(),m=(0,x.n6)(),b=(0,x.rx)(),v=(0,x.xy)();(0,r.useEffect)(function(){y&&b&&y.id&&b.id&&x.Bz.getCopySettings(y.id,b.id)},[y,b]);var C=(0,r.useMemo)(function(){return Object.values(l.Xo).map(function(e){return{label:(0,w.d3)(e),value:e}})},[]),j=(0,h.Gc)(),P=j.watch,O=j.register,S=j.formState,T=j.setValue,E=(t=P(["tradeSizeType","tradeSizeValue","isRoundUpToMinimumSize","isOpenExistingTrades"]),function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(n=o.next()).done)&&(i.push(n.value),i.length!==t);l=!0);}catch(e){a=!0,r=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw r}}return i}}(t,4)||function(e,t){if(e){if("string"==typeof e)return eJ(e,4);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eJ(e,t)}}
1(t,4)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),I=E[0],R=E[1],L=E[2],k=E[3],M=(0,r.useMemo)(function(){return I===l.Xo.FIXED?f("Fixed Size"):f("Proportion")},[f,I]),N=(0,r.useMemo)(function(){return I===l.Xo.FIXED?"0.01":"0.1"},[I]),X=S.errors,U=X.tradeSizeType,z=X.tradeSizeValue;return(0,p.jsxs)(e0,{children:[(null==v?void 0:v.performanceFee)?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(e1,{children:[(0,p.jsxs)(e2,{children:[(0,p.jsx)(D.ZP,{children:f("Performance Fee")}),(0,p.jsx)("a",{href:l.Ws,target:"_blank",rel:"noreferrer",children:(0,p.jsx)(K.ZP,{icon:K.Ro.INFO,size:K.sk.SM,color:g.themeColors.icon.default})})]}),(0,p.jsxs)(D.ZP,{typography:_.wZ.TEXT_M_MEDIUM,children:[(0,er.Wi)(null==v?void 0:v.performanceFee,2),"%"]})]}),(0,p.jsx)(e3,{})]}):null,(0,p.jsxs)(e8,{children:[(0,p.jsx)(A.ZP,{variant:A.vI.ITEM_WITH_FIELD_LABEL,label:f("Trade Size"),labelIcon:(0,p.jsx)("a",{href:l.pf,target:"_blank",rel:"noreferrer",children:(0,p.jsx)(K.ZP,{icon:K.Ro.INFO,size:K.sk.SM})}),children:(0,p.jsx)(eK.Z,{options:C,placeholder:f("Select trade size"),selectedValue:I,onSelect:function(e){return null==d?void 0:d(e)},error:null==U||null==(a=U.message)?void 0:a.toString()})}),I&&(0,p.jsx)(A.ZP,{variant:A.vI.ITEM_WITH_FIELD_LABEL,label:M,children:(0,p.jsx)(ed.ZP,(n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},O("tradeSizeValue")),i=i={variant:ed.Bv.BORDERED_NUMERIC,placeholder:N,value:R,onChange:u,error:null==z||null==(c=z.message)?void 0:c.toString(),maxDecimals:(0,ep.N)(null==m?void 0:m.tenantCopyTradeConfig.minimumTradeSize)},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}),n))}),I!==l.Xo.FIXED&&(0,p.jsx)(eq.ZP,{content:f("Cent accounts behave differently to dollar accounts. It is advised not to use 'Proportional by equity' or 'Mirror master size' and you do so at your own risk.")}),(0,p.jsx)(A.ZP,{variant:A.vI.ITEM_WITH_FIELD_LABEL,children:(0,p.jsxs)(e4,{children:[(0,p.jsx)(D.ZP,{children:f("Round Up to Minimum Trade Size")}),(0,p.jsx)(Z.Z,{variant:Z.Q.CHECKBOX_ONLY,checked:L,onClick:function(){return T("isRoundUpToMinimumSize",!L)}})]})}),(0,p.jsx)(A.ZP,{variant:A.vI.ITEM_WITH_FIELD_LABEL,children:(0,p.jsxs)(e4,{children:[(0,p.jsx)(D.ZP,{color:s?g.themeColors.text.muted:g.themeColors.text.default,children:f("Copy Existing Trades")}),(0,p.jsx)(Z.Z,{disabled:s,variant:Z.Q.CHECKBOX_ONLY,checked:k,onClick:function(){return T("isOpenExistingTrades",!k)}})]})})]}),!s&&(0,p.jsxs)(e9,{children:[f("By clicking âAgree and Copyâ, I confirm that I agree with")," ",(0,p.jsx)("a",{href:l.P1,target:"_blank",rel:"noreferrer",children:f("Copier Agreement")}),", ",(0,p.jsxs)("a",{href:l.gq,target:"_blank",rel:"noreferrer",children:[f("Copier Authorisation")," "]}),f("and")," ",(0,p.jsx)("a",{href:l.nv,target:"_blank",rel:"noreferrer",children:f("Signal Drawdown Term")}),"."]})]})};var e0=R.ZP.div.withConfig({componentId:"sc-2790199c-0"})(["width:448px;"]),e1=R.ZP.div.withConfig({componentId:"sc-2790199c-1"})(["display:flex;justify-content:space-between;align-items:center;"]),e2=R.ZP.div.withConfig({componentId:"sc-2790199c-2"})(["display:flex;align-items:center;gap:","px;"],L.A.XXS),e3=R.ZP.div.withConfig({componentId:"sc-2790199c-3"})(["width:100%;height:1px;background-color:",";margin:","px 0;"],function(e){return e.theme.themeColors.border.default},L.A.REGULAR),e8=R.ZP.div.withConfig({componentId:"sc-2790199c-4"})(["display:flex;flex-direction:column;gap:","px;"],L.A.S),e9=(0,R.ZP)(D.ZP).withConfig({componentId:"sc-2790199c-5"})(["color:",";font-size:11px;line-height:14px;margin-top:","px;a{color:",";text-decoration:underline;cursor:pointer;}"],function(e){return e.theme.themeColors.text.muted},L.A.XL,function(e){return e.theme.themeColors.primary}),e4=R.ZP.div.withConfig({componentId:"sc-2790199c-6"})(["display:flex;justify-content:space-between;align-items:center;height:32px;"]);function e7(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function e6(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}
1)(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}var e5=function(e){var t=e.isEdit,n=e.onCancel,l=(0,o.$G)().t,a=(0,r.useRef)(null),c=(0,r.useRef)(null),s=(0,r.useRef)(null),u=(0,x.Wh)(),d=(0,x.dT)(),f=(0,x.xW)(),y=O({isEdit:t,onSuccess:function(){var e,n;null==(e=c.current)||e.call(c),null==(n=s.current)||n.call(s),t?eH({isSuccess:!0}):eG({isSuccess:!0})},onError:function(e){var n,r,o;null==(n=c.current)||n.call(c),null==(r=s.current)||r.call(s),T.Yu.showAlert({message:(o=t?l("Failed to Update Copy Trade"):l("Failed to Copy Trade"),e===S.c4.PW_1003?o:(0,S.yi)(e,o)),description:e===S.c4.PW_1003?l("Copy trading missing authentication"):l("Please try again."),messageType:T.KK.ERROR})}}),m=y.submit,b=y.formMethods,v=y.handleTradeSizeValueChange,w=y.handleTradeSizeTypeChange,C=function(){x.Bz.resetCopySettings(),null==n||n()};return(0,p.jsx)(h.RV,e6(e7({},b),{children:(0,p.jsx)("form",{onSubmit:function(e){e.preventDefault(),b.handleSubmit(function(){t?(a.current=function(){b.handleSubmit(function(){m(C)(e)})()},eY({onOk:function(e){var t;c.current=e||null,null==(t=a.current)||t.call(a)},onCancel:function(){a.current=null,c.current=null}})):(a.current=function(){b.handleSubmit(function(){m(C)(e)})()},$({onOk:function(){e$({onOk:function(e){var t;s.current=e||null,null==(t=a.current)||t.call(a)},onCancel:function(){a.current=null,s.current=null}})}}))})()},children:(0,p.jsxs)(i.ZP,{variant:i.KH.BASIC,modalTitle:l("Copy Trade Configuration"),onCancel:C,cancelText:l("Cancel"),okText:t?l("Update"):l("Agree and Copy"),okButtonProps:{htmlType:"submit",disabled:b.formState.isSubmitting||!b.formState.isValid},maxWidth:448,loading:d||f,children:[u?(0,p.jsx)(g.ZP,{absolute:!0}):null,(0,p.jsx)(eQ,{isEdit:t,onTradeSizeValueChange:v,onTradeSizeTypeChange:w})]})})}))},te=function(e){var t=function(t){var n;null==e||null==(n=e.onCancel)||n.call(e),t()};(0,y.ZP)(function(n){return(0,p.jsx)(r.Suspense,{children:(0,p.jsx)(e5,e6(e7({},e),{onCancel:function(){return t(n)}}))})})},tt=function(e){var t=e.onCancel,n=(0,o.$G)().t,r=(0,q.VC)().theme;return(0,p.jsx)(i.ZP,{variant:i.KH.BASIC,onCancel:t,cancelText:n("Cancel"),okText:n("Confirm"),onOk:te,title:n("Copy Trade Confirmation"),titlePrefix:(0,p.jsx)(K.ZP,{icon:K.Ro.INFO,color:r.themeColors.warning.background,size:K.sk.M}),children:(0,p.jsx)(D.ZP,{children:n("Copying an account with different leverage can cause trading discrepancies. Click âConfirmâ to accept the risk.")})})},tn=function(e){var t=function(t){var n;null==e||null==(n=e.onCancel)||n.call(e),t()};(0,y.ZP)(function(n){var o,i;return(0,p.jsx)(r.Suspense,{children:(0,p.jsx)(tt,(o=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e),i=i={onCancel:function(){return t(n)}},Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(i)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(i,e))}),o))})})},tr=n(1753),to=n(83837),ti=n(61088);let tl=function(e){var t=e.onModeChange,n=(0,o.$G)(),i=n.t,a=n.i18n.language,c=(0,r.useMemo)(function(){return Object.values(l._k).map(function(e){return{value:e,label:(0,w.L6)(e,a)}})},[a]);return(0,p.jsxs)(ta,{children:[(0,p.jsxs)(D.ZP,{typography:_.wZ.TEXT_M_REGULAR,children:[i("Please select how to handle the current open trades"),":"]}),(0,p.jsx)(ti.ZP.Group,{variant:ti.O$.WITH_LABEL_DESCRIPTION,children:c.map(function(e){var n;return(0,p.jsx)(ti.ZP,{value:null!=(n=e.value)?n:"",label:e.label,dataTestId:"radio-".concat(e.value),onClick:function(){return t(e.value)}},e.value)})})]})};var ta=R.ZP.div.withConfig({componentId:"sc-ce3f6d2a-0"})(["display:flex;flex-direction:column;gap:","px;"],L.A.M);function tc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ts(e,t,n,r,o,i,l){try{var a=e[i](l),c=a.value}catch(e){n(e);return}a.done?t(c):Promise.resolve(c).then(r,o)}function tu(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);l=!0);}catch(e){a=!0,r=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return tc(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tc(e,t)}}
1(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var td=function(e){var t=e.onCancel,n=(0,o.$G)().t,l=(0,x.jW)(),a=(0,x.rx)(),c=(0,x.ci)(),s=tu((0,r.useState)(),2),u=s[0],d=s[1],f=tu((0,r.useState)(),2),h=f[0],g=f[1],y=(0,r.useCallback)(function(){var e;return(e=function(){var e,r,o,i;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return l.next=a(0),l.throw=a(1),l.return=a(2),"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function a(a){return function(c){var s=[a,c];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,s[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}}(this,function(c){switch(c.label){case 0:if(r=null!=(e=null==l?void 0:l.id)?e:"",i=null!=(o=null==a?void 0:a.id)?o:"",!r||!i)return g(n("Failed to stop copy trade")),[2];if(!u)return g(n("Please select a mode.")),[2];return[4,x.Bz.stopCopySettings({values:{copierId:r,strategyId:i,mode:u},onSuccess:function(){null==t||t(),T.Yu.showAlert({message:n("Stop Copy Trade Successful."),messageType:T.KK.SUCCESS})},onError:function(e){var t;T.Yu.showAlert({message:(t=n("Failed to Stop Copy Trade"),e===S.c4.PW_1003?t:(0,S.yi)(e,t)),description:e===S.c4.PW_1003?n("Copy trading missing authentication"):n("Please try again."),messageType:T.KK.ERROR})}})];case 1:return c.sent(),[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function l(e){ts(i,r,o,l,a,"next",e)}function a(e){ts(i,r,o,l,a,"throw",e)}l(void 0)})})()},[null==l?void 0:l.id,null==a?void 0:a.id,u,n,t]);return(0,p.jsxs)(i.ZP,{variant:i.KH.BASIC,modalTitle:n("Stop Copy Trade"),onCancel:t,cancelText:n("Cancel"),okText:n("Confirm"),onOk:y,okButtonProps:{disabled:!u},loading:c,children:[(0,p.jsx)(tl,{onModeChange:function(e){d(e),g(void 0)}}),(0,p.jsx)(D.ZP,{variant:D.fD.ERROR,error:h})]})},tf=function(e){var t=function(t){var n;null==e||null==(n=e.onCancel)||n.call(e),t()};(0,y.ZP)(function(n){var r,o;return(0,p.jsx)(td,(r=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e),o=o={onCancel:function(){return t(n)}},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(o)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}),r))})};let tp=function(e){var t,n=(0,o.$G)().t,u=(null!=e?e:{}).isCopier;return t=(0,r.useMemo)(function(){return{showAlreadyCopiedModal:function(){(0,i.OQ)({title:n("This strategy is already copied"),cancelText:n("OK")})},showAlreadyStoppedModal:function(){(0,i.OQ)({title:n("This strategy is already stopped"),cancelText:n("OK")})},showNoCopyTradeAccountFound:function(){return(0,tr.x)()},showManageCopyTradeAccount:function(){return(0,to.N)()},showCopyTradeConfirmation:function(){return tn()},showCopyTradeConfiguration:function(e){return te({isEdit:e.isEdit})},showStopCopyTrade:function(){return tf()},showEditCopierDrawdown:function(){return eX({isCopier:u})}}},[n,u]),{isCopyStrategyPrechecking:(0,c.Mw)(),isEditCopyStrategyPrechecking:(0,c.US)(),isStopCopyingPrechecking:(0,c.Cm)(),isPrecheckingDrawdown:(0,c.x3)(),handleCopyStrategy:(0,r.useCallback)(function(){return d(function(){return f(this,function(e){switch(e.label){case 0:return[4,a.B.precheckStrategyDetail({loadingType:l.GE.COPY,onSuccess:function(e,n){var r=e.linkedCopiers||[];return 0===r.length?void t.showNoCopyTradeAccountFound():(0,s.x6)(r)?void((null==n?void 0:n.copied)?t.showAlreadyCopiedModal():t.showCopyTradeConfirmation()):void t.showManageCopyTradeAccount()}})];case 1:return e.sent(),[2]}})})()},[t]),handleEditCopyStrategy:(0,r.useCallback)(function(){return d(function(){return f(this,function(e){switch(e.label){case 0:return[4,a.B.precheckStrategyDetail({loadingType:l.GE.EDIT,onSuccess:function(e,n){var r=e.linkedCopiers||[];if(0===r.length){(null==n?void 0:n.id)&&a.B.refetchStrategyListAndDetailsAfterCopySettings(n.id),t.showNoCopyTradeAccountFound();return}if(!(0,s.x6)(r))return void t.showManageCopyTradeAccount();(null==n?void 0:n.copied)?t.showCopyTradeConfiguration({isEdit:!0}):((null==n?void 0:n.id)&&a.B.refetchStrategyListAndDetailsAfterCopySettings(n.id),t.showAlreadyStoppedModal())}})];case 1:return e.sent(),[2]}})})()},[t]),handleStopCopying:(0,r.useCallback)(function(){return d(function(){return f(this,function(e){switch(e.label){case 0:return[4,a.B.precheckStrategyDetail({loadingType:l.GE.STOP,onSuccess:function(e,n){var r=e.linkedCopiers||[];if(0===r.length){(null==n?void 0:n.id)&&a.B.refetchStrategyListAndDetailsAfterCopySettings(n.id),t.showNoCopyTradeAccountFound();return}if(!(0,s.x6)(r))return void t.showManageCopyTradeAccount();(null==n?void 0:n.copied)?t.showStopCopyTrade():((null==n?void 0:n.id)&&a.B.refetchStrategyListAndDetailsAfterCopySettings(n.id),t.showAlreadyStoppedModal())}})];case 1:return e.sent(),[2]}})})()},[t]),handleEditCopierDrawdown:(0,r.useCallback)(function(){return d(function(){return f(this,function(e){switch(e.label){case 0:return[4,a.B.precheckUserInfo({loadingType:l.GE.DRAWDOWN,onSuccess:function(e){return d(function(){var n;return f(this,function(r){switch(r.label){case 0:if(0!==(n=(null==e?void 0:e.linkedCopiers)||[]).length)return[3,2];return[4,a.B.refetchStrategyListAndDetailsAfterCopySettings()];case 1:return r.sent(),t.showNoCopyTradeAccountFound(),[2];case 2:if(!(0,s.x6)(n))return t.showManageCopyTradeAccount(),[2];return t.showEditCopierDrawdown(),[2]}})})()}})];case 1:return e.sent(),[2]}})})()},[t])}}},1753:function(e,t,n){"use strict";n.d(t,{x:()=>h});var r=n(74512),o=n(32735),i=n(81182),l=n(80199),a=n(97186),c=n(88651),s=n(38074),u=n(81613),d=n(33007),f=n(21180),p=function(e){var t=e.onCancel,n=(0,i.$G)().t,o=(0,d.VC)().theme;return(0,r.jsx)(a.ZP,{variant:a.KH.BASIC,title:n("No Copy Trade Account Found"),onCancel:function(){null==t||t(),u.Bz.setShouldShowLinkAccountToPelicanCopyTradeModal(!1)},cancelText:n("Cancel"),okText:n("Confirm"),onOk:function(){(0,f.D)({onCancel:t}),u.Bz.setShouldShowLinkAccountToPelicanCopyTradeModal(!1),t()}
1,titlePrefix:(0,r.jsx)(l.ZP,{icon:l.Ro.INFO,color:o.themeColors.warning.background,size:l.sk.M}),children:(0,r.jsx)(s.ZP,{children:n("To proceed with Copy Trade, please link your trading account to a Pelican Social account. Click Confirm to begin the account linking process.")})})},h=function(e){var t=function(t){var n;null==e||null==(n=e.onCancel)||n.call(e),t()};(0,c.ZP)(function(n){var i,l;return(0,r.jsx)(o.Suspense,{children:(0,r.jsx)(p,(i=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e),l=l={onCancel:function(){return t(n)}},Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(l)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}
1)(Object(l)).forEach(function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(l,e))}),i))})})}},34950:function(e,t,n){"use strict";n.d(t,{Z:()=>t1});var r=n(74512),o=n(10281),i=n(81182),l=n(71225),a=n(45954),c=n(38416),s=n(2871),u=n(17580),d=n(61305),f=n(37507),p=n(25932);n(60285),n(83753),n(41637),n(66992),n(33948),n(78783),n(41539),n(68309);var h=n(32735),g=n(96838),y=n(62715),m=n(38074),b=n(33007),v=n(33481),x=n(50449);function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let C=function(){var e,t=(0,i.$G)().t,n=(0,b.VC)().theme,o=(0,s.xy)(),l=(0,s.UT)(),a=(0,x.Z)(),c=a.isCopyStrategyPrechecking,u=a.isEditCopyStrategyPrechecking,d=a.isStopCopyingPrechecking,f=a.handleCopyStrategy,p=a.handleEditCopyStrategy,C=a.handleStopCopying,Z=(e=(0,h.useState)(""),function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(n=o.next()).done)&&(i.push(n.value),i.length!==t);l=!0);}catch(e){a=!0,r=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw r}}return i}}(e,2)||function(e,t){if(e){if("string"==typeof e)return w(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return w(e,t)}}(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),A=Z[0],_=Z[1];return(0,h.useEffect)(function(){return l&&!A&&_(URL.createObjectURL(l)),function(){A&&URL.revokeObjectURL(A)}},[l,A]),(0,r.jsxs)(j,{children:[(0,r.jsxs)(O,{children:[(0,r.jsxs)(S,{children:[A?(0,r.jsx)(I,{children:(0,r.jsx)(R,{src:A})}):(0,r.jsx)(P,{}),(0,r.jsx)(m.ZP,{typography:y.wZ.TEXT_XL_MEDIUM,children:null==o?void 0:o.name})]}),(null==o?void 0:o.performanceFee)?(0,r.jsxs)(T,{children:[(0,r.jsxs)(m.ZP,{children:[t("Performance Fee"),":"]}),(0,r.jsxs)(m.ZP,{children:[(0,v.Wi)(null==o?void 0:o.performanceFee,2),"%"]})]}):null,(0,r.jsxs)(T,{children:[(0,r.jsxs)(m.ZP,{children:[t("Copiers"),":"]}),(0,r.jsx)(m.ZP,{children:(0,v.Wi)(null==o?void 0:o.numCopiers,0,!1)})]})]}),(null==o?void 0:o.copied)?(0,r.jsxs)(E,{children:[(0,r.jsx)(g.ZP,{variant:g.eF.FILLED_THEMED,onClick:p,loading:u,disabled:d,children:t("Edit Copy")}),(0,r.jsx)(g.ZP,{variant:g.eF.FILLED,backgroundColor:n.themeColors.error,textColor:n.themeColors.white,hoverBackgroundColor:n.themeColors.pnl.negative.hover,loading:d,disabled:u,onClick:C,children:t("Stop Copying")})]}):(0,r.jsx)(g.ZP,{variant:g.eF.FILLED_THEMED,onClick:f,loading:c,disabled:!(null==o?void 0:o.enabled),children:t("Copy Strategy")})]})};var j=o.ZP.div.withConfig({componentId:"sc-b1d27e92-0"})(["display:flex;justify-content:space-between;padding:","px;background-color:",";border-bottom:1px solid ",";"],l.A.M,function(e){return e.theme.themeColors.background.default},function(e){return e.theme.themeColors.border.default}),P=o.ZP.div.withConfig({componentId:"sc-b1d27e92-1"})(["width:24px;aspect-ratio:1;border-radius:50%;background-color:",";"],function(e){return e.theme.themeColors.primary}),O=o.ZP.div.withConfig({componentId:"sc-b1d27e92-2"})(["display:flex;gap:","px;"],l.A.M),S=o.ZP.div.withConfig({componentId:"sc-b1d27e92-3"})(["display:flex;align-items:center;gap:","px;"],l.A.XS),T=o.ZP.div.withConfig({componentId:"sc-b1d27e92-4"})(["display:flex;align-items:center;gap:","px;"],l.A.XXS),E=o.ZP.div.withConfig({componentId:"sc-b1d27e92-5"})(["display:flex;gap:","px;"],l.A.XS),I=o.ZP.div.withConfig({componentId:"sc-b1d27e92-6"})(["width:","px;aspect-ratio:1;border-radius:50%;background-color:",";overflow:hidden;"],l.A.XL,function(e){return e.theme.themeColors.primary}),R=o.ZP.img.withConfig({componentId:"sc-b1d27e92-7"})(["width:100%;height:100%;object-fit:cover;"]);n(92222);var Z=n(66698),A=n(33202),_=n(63450),L=n(91893);n(2707),n(21249);var D=n(97186),k=n(88651),M=n(81613),N=n(80199),X=n(21180),U=n(73407),z=n(93004),G=n(56740),F=n(76898);n(82526),n(41817);let B=function(e){var t=e.description,n=e.account,o=(0,b.VC)().theme,l=(0,i.$G)().t;return(0,r.jsxs)(Y,{children:[(0,r.jsx)(m.ZP,{typography:y.wZ.TEXT_M_REGULAR,children:t}),(0,r.jsxs)(V,{children:[(0,r.jsx)(A.ZP,{size:A.Dv.L,img:n.avatar}),(0,r.jsxs)(H,{children:[(0,r.jsx)(m.ZP,{typography:y.wZ.TEXT_L_MEDIUM,children:n.name}
1),(0,r.jsx)(m.ZP,{typography:y.wZ.TEXT_M_REGULAR,color:o.themeColors.text.subtle,children:n.id})]})]}),(0,r.jsx)(m.ZP,{typography:y.wZ.TEXT_M_REGULAR,children:l("Would you like to proceed?")})]})};var Y=o.ZP.div.withConfig({componentId:"sc-e70202d2-0"})(["display:flex;flex-direction:column;gap:","px;min-width:376px;"],l.A.XS),V=o.ZP.div.withConfig({componentId:"sc-e70202d2-1"})(["display:flex;padding:","px;border-radius:","px;border:1px solid ",";"],l.A.REGULAR,l.A.XS,function(e){return e.theme.themeColors.border.subtle}),H=o.ZP.div.withConfig({componentId:"sc-e70202d2-2"})(["display:flex;flex-direction:column;justify-content:center;flex:1 1 0;min-width:0;margin-left:","px;"],l.A.REGULAR),W=function(e){var t=e.account,n=e.type,o=e.onConfirm,l=e.onCancel,a=(0,i.$G)().t,c=(0,b.VC)().theme,s=(0,M.ae)(),u=(0,M.iA)(),d=(0,h.useMemo)(function(){return{modalTitle:"switch"===n?a("Account Switch Confirmation"):a("Account Removal Confirmation"),iconColor:"switch"===n?c.themeColors.warning.background:c.themeColors.error,title:"switch"===n?a("Ready to switch accounts?"):a("Remove this account?"),description:"switch"===n?a("This will end the current session and switch to:"):a("This action will unlink your account and cannot be undone.")}},[a,c.themeColors.error,c.themeColors.warning.background,n]);return(0,r.jsx)(D.ZP,{maxWidth:448,variant:D.KH.BASIC,modalTitle:d.modalTitle,okText:a("Confirm"),onOk:function(){return null==o?void 0:o(l)},cancelText:a("Cancel"),onCancel:l,titlePrefix:(0,r.jsxs)(K,{children:[(0,r.jsx)(N.ZP,{icon:N.Ro.INFO,color:d.iconColor,size:N.sk.M}),(0,r.jsx)(m.ZP,{typography:y.wZ.TEXT_L_MEDIUM,children:d.title})]}),loading:s||u,children:(0,r.jsx)(B,{description:d.description,account:t,type:n})})},$=function(e){var t=function(t){var n;null==e||null==(n=e.onCancel)||n.call(e),t()};(null==e?void 0:e.account)&&(null==e?void 0:e.type)&&(0,k.ZP)(function(n){var o,i;return(0,r.jsx)(h.Suspense,{children:(0,r.jsx)(W,(o=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e),i=i={onCancel:function(){return t(n)}},Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(i)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(i,e))}),o))})})},K=o.ZP.div.withConfig({componentId:"sc-5667d19c-0"})(["display:flex;flex-direction:row;align-items:center;justify-content:center;gap:","px;"],l.A.XS);let q=function(e){var t=e.data,n=e.onCancel,o=(0,b.VC)().theme,l=(0,i.$G)().t;return(0,r.jsxs)(J,{children:[(0,r.jsx)(A.ZP,{size:A.Dv.L,img:t.avatar}),(0,r.jsxs)(Q,{children:[(0,r.jsx)(m.ZP,{typography:y.wZ.TEXT_L_MEDIUM,children:t.name}),(0,r.jsxs)(m.ZP,{typography:y.wZ.TEXT_M_REGULAR,color:o.themeColors.text.subtle,children:[l("Copier ID"),": ",t.id]})]}),(0,r.jsxs)(ee,{children:[(0,u.dV)(t)?(0,r.jsx)(_.ZP,{variant:_.L9.SOLID_THEMED,children:l("Current")}):(0,r.jsxs)(g.ZP,{variant:g.eF.TEXT_ONLY_THEMED,onClick:function(){$({account:t,type:"switch",onConfirm:function(e){var r=t.id;null==n||n(),null==e||e(),z.B.switchCopier({copierId:r,onSuccess:function(){G.Yu.showAlert({message:l("Account switched successfully."),description:"".concat(l("Copier ID"),": ").concat(r),messageType:G.KK.SUCCESS}),F.Z.setItem(F.V.COPY_TRADE_SELECTED_COPIER_ID_KEY,r),c.bD.getCopyTradeProfile({copierId:r}),c.bD.getCopyTradeProfileImage(r)},onError:function(e){var t;G.Yu.showAlert({message:null!=(t=(0,U.yi)(e))?t:l("Failed to switch account."),description:l("Please try again."),messageType:G.KK.ERROR})}})}})},children:[(0,r.jsx)(et,{icon:N.Ro.SWITCH_ACCOUNT,color:o.themeColors.primary,size:N.sk.M}),l("Switch")]}
1),(0,u.dV)(t)?null:(0,r.jsxs)(g.ZP,{textColor:o.themeColors.error,hoverTextColor:o.themeColors.pnl.negative.hover,activeTextColor:o.themeColors.pnl.negative.default,disabledTextColor:o.themeColors.pnl.positive.disabled,variant:g.eF.TEXT_ONLY,onClick:function(){$({account:t,type:"remove",onConfirm:function(e){z.B.unlinkCopier({copierId:t.id,onSuccess:function(){G.Yu.showAlert({message:l("Account removed successfully."),description:"".concat(l("Copier ID"),": ").concat(t.id),messageType:G.KK.SUCCESS}),null==n||n(),null==e||e()},onError:function(t){var r;G.Yu.showAlert({message:null!=(r=(0,U.yi)(t))?r:l("Failed to remove account."),description:l("Please try again."),messageType:G.KK.ERROR}),null==n||n(),null==e||e()}})}})},children:[(0,r.jsx)(et,{icon:N.Ro.REMOVE_ACCOUNT,color:o.themeColors.error,size:N.sk.M}),l("Remove")]})]})]})};var J=o.ZP.div.withConfig({componentId:"sc-252e8bb8-0"})(["display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:","px ","px;border-bottom:1px solid ",";"],l.A.REGULAR,l.A.L,function(e){return e.theme.themeColors.border.subtle}),Q=o.ZP.div.withConfig({componentId:"sc-252e8bb8-1"})(["display:flex;flex-direction:column;justify-content:center;flex:1 1 0;min-width:0;margin-left:","px;"],l.A.REGULAR),ee=o.ZP.div.withConfig({componentId:"sc-252e8bb8-2"})(["display:flex;flex-direction:row;align-items:center;justify-content:center;min-width:0;gap:","px;"],l.A.REGULAR),et=(0,o.ZP)(N.ZP).withConfig({componentId:"sc-252e8bb8-3"})(["margin-right:","px;"],l.A.XXS);let en=function(e){var t=e.data,n=e.onCancel,o=(0,i.$G)().t,l=(0,b.VC)().theme;return(0,r.jsxs)(er,{children:[(0,r.jsx)(ei,{children:t.map(function(e){return(0,r.jsx)(q,{data:e,onCancel:n},e.id)})}),(0,r.jsx)(eo,{children:(0,r.jsxs)(g.ZP,{variant:g.eF.TEXT_ONLY_THEMED,onClick:function(){(0,X.D)(),null==n||n()},children:[(0,r.jsx)(N.ZP,{icon:N.Ro.PLUS,color:l.themeColors.primary,size:N.sk.M}),o("Link Copy Trade Account")]})})]})};var er=o.ZP.div.withConfig({componentId:"sc-add5e9e7-0"})(["display:flex;flex-direction:column;width:488px;"]),eo=o.ZP.div.withConfig({componentId:"sc-add5e9e7-1"})(["display:flex;padding:0 ","px;margin-top:","px;"],l.A.L,l.A.REGULAR),ei=o.ZP.div.withConfig({componentId:"sc-add5e9e7-2"})(["display:flex;flex-direction:column;max-height:396px;overflow-y:auto;"]);function el(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ea(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function ec(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function es(e,t){if(e){if("string"==typeof e)return el(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return el(e,t)}}var eu=function(e){var t,n=e.onCancel,o=(0,i.$G)().t,l=(0,s.n6)(),c=(t=(0,h.useState)(!0),function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(n=o.next()).done)&&(i.push(n.value),i.length!==t);l=!0);}catch(e){a=!0,r=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw r}}return i}}(t,2)||es(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),d=c[0],f=c[1];(0,h.useEffect)(function(){M.Bz.getUserInfo({isCustomLoading:!0,onFinally:function(){return f(!1)}})},[]);var p=(0,h.useMemo)(function(){var e;return(null==l?void 0:l.linkedCopiers)?((function(e){if(Array.isArray(e))return el(e)}
1)(e=l.linkedCopiers)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||es(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).sort(function(e,t){return(0,u.dV)(e)?-1:+!!(0,u.dV)(t)}).map(function(e){return ec(ea({},e),{avatar:void 0})}):[]},[null==l?void 0:l.linkedCopiers]);return(0,r.jsxs)(D.ZP,{variant:D.KH.CONFIRMATION,modalTitle:o("Manage Copy Trade Accounts"),okText:o("Cancel"),onOk:n,children:[d?(0,r.jsx)(a.ZP,{absolute:!0}):null,(0,r.jsx)(en,{data:p,onCancel:n})]})},ed=function(e){var t=function(t){var n;null==e||null==(n=e.onCancel)||n.call(e),t()};(0,k.ZP)(function(n){return(0,r.jsx)(h.Suspense,{children:(0,r.jsx)(eu,ec(ea({},e),{onCancel:function(){return t(n)}}))})})};function ef(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let ep=function(){var e,t,n,o=(0,i.$G)().t,l=(0,b.VC)().theme,a=(0,L.Hy)(),c=(0,L.Qt)(),s=(0,x.Z)({isCopier:!0}),u=s.isPrecheckingDrawdown,d=s.handleEditCopierDrawdown,f=(e=(0,h.useState)(""),function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(n=o.next()).done)&&(i.push(n.value),i.length!==t);l=!0);}catch(e){a=!0,r=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw r}}return i}}(e,2)||function(e,t){if(e){if("string"==typeof e)return ef(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ef(e,t)}}(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),p=f[0],v=f[1];(0,h.useEffect)(function(){return c&&!p&&v(URL.createObjectURL(c)),function(){p&&URL.revokeObjectURL(p)}},[c,p]);var w=(0,h.useMemo)(function(){var e;return new Z.BigNumber(null!=(e=null==a?void 0:a.currentDrawdown)?e:0).times(100).toNumber()},[null==a?void 0:a.currentDrawdown]);return(0,r.jsxs)(eh,{children:[(0,r.jsxs)(eg,{children:[(0,r.jsxs)(ey,{children:[p?(0,r.jsx)(ev,{children:(0,r.jsx)(ex,{src:p})}):(0,r.jsx)(A.ZP,{size:A.Dv.S,text:null!=(n=null==a||null==(t=a.name)?void 0:t.at(0))?n:"-"}),(0,r.jsx)(m.ZP,{typography:y.wZ.TEXT_XL_MEDIUM,children:null==a?void 0:a.name})]}),(0,r.jsxs)(em,{children:[(0,r.jsxs)(m.ZP,{color:l.themeColors.text.muted,typography:y.wZ.TEXT_L_REGULAR,children:[o("ID"),":"]}),(0,r.jsx)(m.ZP,{typography:y.wZ.TEXT_L_REGULAR,children:null==a?void 0:a.id})]}),(0,r.jsx)(eb,{variant:_.L9.LIGHT_THEMED,size:"xsmall",textColor:(null==a?void 0:a.isCopying)?l.themeColors.tag.success.color:l.themeColors.tag.error.color,backgroundColor:(null==a?void 0:a.isCopying)?l.themeColors.tag.success.background:l.themeColors.tag.error.background,children:o((null==a?void 0:a.isCopying)?"Copying":"Not Copying")}),(0,r.jsx)(g.ZP,{variant:g.eF.OUTLINED_THEMED,size:"small",onClick:d,loading:u,children:"".concat(w,"% ").concat(o("Drawdown"))})]}),(0,r.jsx)(g.ZP,{variant:g.eF.FILLED_THEMED,onClick:function(){ed()},children:o("Manage Account")})]})};var eh=o.ZP.div.withConfig({componentId:"sc-56dde578-0"})(["display:flex;justify-content:space-between;padding:","px;background-color:",";border-bottom:1px solid ",";"],l.A.M,function(e){return e.theme.themeColors.background.default},function(e){return e.theme.themeColors.border.default}),eg=o.ZP.div.withConfig({componentId:"sc-56dde578-1"})(["display:flex;align-items:center;gap:","px;"],l.A.M),ey=o.ZP.div.withConfig({componentId:"sc-56dde578-2"})(["display:flex;align-items:center;gap:","px;"],l.A.XS),em=o.ZP.div.withConfig({componentId:"sc-56dde578-3"})(["display:flex;align-items:center;gap:","px;"],l.A.XXS),eb=(0,o.ZP)(_.ZP).withConfig({componentId:"sc-56dde578-4"})(["height:fit-content;"]),ev=o.ZP.div.withConfig({componentId:"sc-56dde578-5"})(["width:","px;aspect-ratio:1;border-radius:50%;background-color:",";overflow:hidden;"],l.A.XL,function(e){return e.theme.themeColors.primary}),ex=o.ZP.img.withConfig({componentId:"sc-56dde578-6"})(["width:100%;height:100%;object-fit:cover;"]),ew=n(81468),eC=n(27662);function ej(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let eP=function(){var e,t=[{label:(0,(0,i.$G)().t)("Strategy Details"),value:"details"}],n=(e=(0,h.useState)("details"),function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(n=o.next()).done)&&(i.push(n.value),i.length!==t);l=!0);}catch(e){a=!0,r=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw r}}return i}}(e,2)||function(e,t){if(e){if("string"==typeof e)return ej(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ej(e,t)}}
1(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=n[0],l=n[1];return(0,r.jsx)(ew.Z,{variant:ew.N.UNDERLINED,tabList:t,selectedValue:o,onClick:l})},eO=function(){var e,t=(0,i.$G)().t,n=(0,s.n6)(),o=(0,s.Tr)(),l=(0,s.pZ)(),a=(0,s.Lm)(),c=(0,s.vB)(),d=(0,h.useMemo)(function(){return[{label:t("Strategy Profile"),value:eC.ww.STRATEGY_PROFILE},{label:t("Open Positions"),value:eC.ww.OPEN_POSITIONS},{label:t("History"),value:eC.ww.HISTORY}]},[t]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(eP,{}),(0,r.jsx)(ew.Z,{disabled:a||c,variant:ew.N.TEXT_ONLY,tabList:d,selectedValue:l,onClick:z.B.onStrategyDetailTabChange,suffix:(0,u.x6)(null!=(e=null==n?void 0:n.linkedCopiers)?e:[])&&o?(0,r.jsxs)(eS,{children:[t("Copier ID"),": ",o]}):null})]})};var eS=(0,o.ZP)(m.ZP).withConfig({componentId:"sc-3b42a0d7-0"})(["margin-right:","px;"],l.A.XS),eT=n(6807),eE=n(15226);let eI=function(e){var t=e.title,n=e.tooltipContent,o=e.externalLink,i=e.titleDataTestId,l=e.children,a=e.minHeight,c=e.hasTopBorder;return(0,r.jsxs)(eR,{$minHeight:a,children:[(0,r.jsx)(eZ,{$hasTopBorder:void 0===c||c,children:(0,r.jsxs)(eD,{children:[(0,r.jsx)(eA,{typography:y.wZ.TEXT_M_MEDIUM,dataTestId:i,children:t}),n&&(0,r.jsx)(eE.Z,{placement:"top",trigger:"mouseenter",content:(0,r.jsx)(eL,{children:n}),children:(0,r.jsx)(N.ZP,{icon:N.Ro.INFO,size:N.sk.S})}),o&&(0,r.jsx)("a",{href:o,target:"_blank",rel:"noreferrer",children:(0,r.jsx)(N.ZP,{icon:N.Ro.INFO,size:N.sk.S})})]})}),(0,r.jsx)(e_,{children:l})]})};var eR=o.ZP.div.withConfig({componentId:"sc-5d93ac24-0"})(["display:flex;flex-direction:column;background-color:",";box-sizing:border-box;min-height:",";height:100%;"],function(e){return e.theme.themeColors.background.default},function(e){var t=e.$minHeight;return t?"".concat(t,"px"):"fit-content"}),eZ=o.ZP.div.withConfig({componentId:"sc-5d93ac24-1"})(["height:","px;padding:0 ","px;background-color:",";display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid ",";border-top:",";"],l.A.XXL,l.A.XS,function(e){return e.theme.themeColors.background.subtle},function(e){return e.theme.themeColors.border.default},function(e){var t=e.$hasTopBorder,n=e.theme;return t?"1px solid ".concat(n.themeColors.border.default):"none"}),eA=(0,o.ZP)(m.ZP).withConfig({componentId:"sc-5d93ac24-2"})(["color:",";"],function(e){return e.theme.themeColors.text.default}),e_=o.ZP.div.withConfig({componentId:"sc-5d93ac24-3"})(["position:relative;width:100%;height:100%;overflow:hidden;display:flex;flex:1;flex-direction:column;"]),eL=(0,o.ZP)(m.ZP).withConfig({componentId:"sc-5d93ac24-4"})(["color:",";padding:","px ","px;"],function(e){return e.theme.themeColors.background.default},l.A.XS,l.A.M),eD=o.ZP.div.withConfig({componentId:"sc-5d93ac24-5"})(["display:flex;flex-direction:row;align-items:center;gap:","px;"],l.A.XXS);n(9653);var ek=n(48881),eM=n(82337),eN=n(3082),eX=n(24861),eU=n(13589),ez=n(42014),eG=n(88399);let eF=function(e){var t=e.historyItem,n=t.openTimestamp,o=t.closeTimestamp,i=t.tradeId,l=t.direction,a=t.instrument,c=t.realisedProfit,s=t.volume,u=t.units,d=t.openPrice,f=t.closePrice,p=t.limitPrice,g=t.stopPrice,b=t.currencyCode,x=(0,h.useMemo)(function(){var e="Buy"===l?ek.pE.BUY:ek.pE.SELL;return{openDate:eN._.convertToDayjsWithOffset({input:Number(n)}).format(eM.ju),closeDate:eN._.convertToDayjsWithOffset({input:Number(o)}).format(eM.ju),tradeId:i,direction:(0,r.jsx)(eG.Z,{orderType:e,children:e}),symbol:a,realisedProfit:(0,r.jsx)(r.Fragment,{children:c?(0,r.jsxs)(ez.g,{profitLoss:(0,eU.Ov)(Number(c)),children:[Number(c)>0?"+":"-",(0,eX.j)(b),(0,v.Wi)(Number(c),2,!0,!1,!0)]}):"--"}),volume:(0,v.Wi)(Number(s),2),units:(0,v.Wi)(Number(u),2),openPrice:(0,v.Wi)(Number(d),5),closePrice:(0,v.Wi)(Number(f),5),limitPrice:(0,v.Wi)(Number(p),5),stopPrice:(0,v.Wi)(Number(g),5)}},[l,n,o,i,a,c,b,s,u,d,f,p,g]);return(0,r.jsxs)(eY,{children:[(0,r.jsx)(eB,{children:(0,r.jsx)(m.ZP,{typography:y.wZ.TEXT_M_REGULAR,children:x.openDate})}),(0,r.jsx)(eB,{children:(0,r.jsx)(m.ZP,{typography:y.wZ.TEXT_M_REGULAR,children:x.closeDate})}),(0,r.jsx)(eB,{children:(0,r.jsx)(m.ZP,{typography:y.wZ.TEXT_M_REGULAR,children:x.symbol})}),(0,r.jsx)(eB,{children:(0,r.jsx)(m.ZP,{typography:y.wZ.TEXT_M_REGULAR,children:x.tradeId})}),(0,r.jsx)(eB,{children:(0,r.jsx)(m.ZP,{typography:y.wZ.TEXT_M_REGULAR,children:x.direction})}),(0,r.jsx)(eB,{children:(0,r.jsx)(m.ZP,{typography:y.wZ.TEXT_M_REGULAR,children:x.realisedProfit})}),(0,r.jsx)(eB,{children:(0,r.jsx)(m.ZP,{typography:y.wZ.TEXT_M_REGULAR,children:x.volume})}),(0,r.jsx)(eB,{children:(0,r.jsx)(m.ZP,{typography:y.wZ.TEXT_M_REGULAR,children:x.units})}),(0,r.jsx)(eB,{children:(0,r.jsx)(m.ZP,{typography:y.wZ.TEXT_M_REGULAR,children:x.openPrice})}),(0,r.jsx)(eB,{children:(0,r.jsx)(m.ZP,{typography:y.wZ.TEXT_M_REGULAR,children:x.closePrice})}),(0,r.jsx)(eB,{children:(0,r.jsx)(m.ZP,{typography:y.wZ.TEXT_M_REGULAR,children:x.limitPrice})}),(0,r.jsx)(eB,{children:(0,r.jsx)(m.ZP,{typography:y.wZ.TEXT_M_REGULAR,children:x.stopPrice})})]})};var eB=o.ZP.td.withConfig({componentId:"sc-b357addc-0"})(["padding:","px;border-right:1px solid transparent;cursor:default;&:first-child{width:160px;min-width:160px;}&:nth-child(2){width:160px;min-width:160px;}&:nth-child(3){width:130px;min-width:130px;}&:nth-child(4),&:nth-child(5),&:nth-child(6),&:nth-child(7),&:nth-child(8),&:nth-child(9),&:nth-child(10),&:nth-child(11),&:last-child{width:120px;min-width:120px;}"],l.A.XS),eY=o.ZP.tr.withConfig({componentId:"sc-b357addc-1"})(["&:hover{background-color:",";}&.selected{background-color:",";border-bottom:",";}"],function(e){return e.theme.themeColors.background.subtle},function(e){return e.theme.themeColors.background.active},function(e){var t=e.theme;return"1px solid ".concat(t.themeColors.background.default)});let eV=function(){var e=(0,i.$G)().t,t=(0,h.useMemo)(function(){return[{header:e("Open Date"),key:eT.Of.COPY_TRADE_HISTORY_COLUMN_OPEN_DATE},{header:e("Close Date"),key:eT.Of.COPY_TRADE_HISTORY_COLUMN_CLOSE_DATE},{header:e("Symbol"),key:eT.Of.COPY_TRADE_HISTORY_COLUMN_SIGNAL},{header:e("Order No."),key:eT.Of.COPY_TRADE_HISTORY_COLUMN_TRADE_ID},{header:e("Type"),key:eT.Of.COPY_TRADE_HISTORY_COLUMN_STRATEGY_TYPE},{header:e("Profit/Loss"),key:eT.Of.COPY_TRADE_HISTORY_COLUMN_PROFIT},{header:e("Volume"),key:eT.Of.COPY_TRADE_HISTORY_COLUMN_VOLUME},{header:e("Units"),key:eT.Of.COPY_TRADE_HISTORY_COLUMN_UNITS},{header:e("Entry Price"),key:eT.Of.COPY_TRADE_HISTORY_COLUMN_ENTRY_PRICE},{header:e("Close Price"),key:eT.Of.COPY_TRADE_HISTORY_COLUMN_CLOSE_PRICE},{header:e("Take Profit"),key:eT.Of.COPY_TRADE_HISTORY_COLUMN_TAKE_PROFIT},{header:e("Stop Loss"),key:eT.Of.COPY_TRADE_HISTORY_COLUMN_STOP_LOSS}]},[e]);return(0,r.jsx)("thead",{children:(0,r.jsx)("tr",{children:t.map(function(e){return(0,r.jsx)(eH,{children:(0,r.jsx)(m.ZP,{typography:y.wZ.TEXT_M_REGULAR,children:e.header})},e.key)})})})};var eH=o.ZP.th.withConfig({componentId:"sc-2b0a224e-0"})(["padding:","px;border-right:1px solid ",";background-color:",";border-bottom:1px solid ",";position:sticky;top:0;text-align:start;z-index:1;&:first-child{width:160px;min-width:160px;}&:nth-child(2){width:160px;min-width:160px;}&:nth-child(3){width:130px;min-width:130px;}&:nth-child(4),&:nth-child(5),&:nth-child(6),&:nth-child(7),&:nth-child(8),&:nth-child(9),&:nth-child(10),&:last-child{width:120px;min-width:120px;}"],l.A.XS,function(e){return e.theme.themeColors.border.subtle},function(e){return e.theme.themeColors.background.default},function(e){return e.theme.themeColors.border.subtle});function eW(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let e$=function(){var e=(0,s.oQ)(),t=(0,s.zj)(),n=(0,s.SY)(),o=(0,s.pg)(),i=(0,s.rx)(),l=(0,h.useRef)(null),c=(0,h.useRef)(null);return((0,h.useEffect)(function(){var e=l.current;if(e&&o&&!t&&!n&&(null==i?void 0:i.id)){var r=new IntersectionObserver(function(e){((function(e){if(Array.isArray(e))return e})(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(n=o.next()).done)&&(i.push(n.value),i.length!==t);l=!0);}catch(e){a=!0,r=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw r}}return i}}(e,1)||function(e,t){if(e){if("string"==typeof e)return eW(e,1);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eW(e,t)}}
1(e,1)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0].isIntersecting&&o&&!t&&!n&&z.B.loadMoreCopyTradeHistory(i.id)},{root:c.current,rootMargin:"100px",threshold:.1});return r.observe(e),function(){r.disconnect()}}},[o,t,n,null==i?void 0:i.id,e.length]),t)?(0,r.jsx)(eK,{children:(0,r.jsx)(a.ZP,{absolute:!0})}):e.length?(0,r.jsxs)(eK,{ref:c,children:[(0,r.jsxs)(eq,{children:[(0,r.jsx)(eV,{}),(0,r.jsx)("tbody",{children:e.map(function(e){return(0,r.jsx)(eF,{historyItem:e},e.tradeId)})})]}),o&&(0,r.jsx)(eJ,{ref:l,children:n&&(0,r.jsx)(a.ZP,{})})]}):(0,r.jsxs)(eK,{children:[(0,r.jsx)(eq,{children:(0,r.jsx)(eV,{})}),(0,r.jsx)(eQ,{children:(0,r.jsx)(p.Z,{variant:p.R.ORDER_HISTORY})})]})};var eK=o.ZP.div.withConfig({componentId:"sc-47bc0184-0"})(["height:100%;flex:1;overflow:auto;display:flex;flex-direction:column;position:relative;"]),eq=o.ZP.table.withConfig({componentId:"sc-47bc0184-1"})(["width:100%;border-collapse:collapse;border-spacing:0;"]),eJ=o.ZP.div.withConfig({componentId:"sc-47bc0184-2"})(["display:flex;justify-content:center;align-items:center;padding:","px;min-height:40px;position:sticky;left:0;"],l.A.XS),eQ=o.ZP.div.withConfig({componentId:"sc-47bc0184-3"})(["position:sticky;top:0;left:0;"]);let e0=function(){var e=(0,i.$G)().t;return(0,r.jsx)(eI,{minHeight:eC.Nb,title:e("History"),titleDataTestId:eT.Of.COPY_TRADE_STRATEGY_DETAILS_HISTORY,hasTopBorder:!1,children:(0,r.jsx)(e1,{children:(0,r.jsx)(e$,{})})})};var e1=o.ZP.div.withConfig({componentId:"sc-b28463fc-0"})(["display:flex;height:100%;background-color:",";flex-direction:column;"],function(e){return e.theme.themeColors.background.default});let e2=function(){var e=(0,i.$G)().t,t=(0,s.xy)(),n=(0,h.useMemo)(function(){return(0,eX.j)(null==t?void 0:t.copiersBalanceCurrency)},[null==t?void 0:t.copiersBalanceCurrency]);return(null==t?void 0:t.copiersBalance)?(0,r.jsx)(eI,{title:e("Copierâs AuM"),titleDataTestId:"strategy-details-copiers-UAM",children:(0,r.jsx)(e3,{children:(0,r.jsxs)(m.ZP,{typography:y.wZ.TEXT_L_MEDIUM,children:[n,(0,v.Wi)(t.copiersBalance,2,!1)]})})}):null};var e3=o.ZP.div.withConfig({componentId:"sc-3e87b65c-0"})(["padding:","px;row-gap:","px;"],l.A.L,l.A.XL);function e8(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}n(38559),n(69720);let e9=function(){var e=(0,i.$G)().t,t=(0,b.VC)().theme,n=(0,s.xy)(),o=(0,h.useMemo)(function(){return n?Object.fromEntries(Object.entries(n).map(function(e){var t,n=function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(n=o.next()).done)&&(i.push(n.value),i.length!==t);l=!0);}catch(e){a=!0,r=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw r}}return i}}(e,2)||function(e,t){if(e){if("string"==typeof e)return e8(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e8(e,t)}}(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();return[n[0],0===(t=n[1])?"":t<0?"-":"+"]})):{}},[n]),l=(0,h.useMemo)(function(){return(0,eX.j)(null==n?void 0:n.copiersProfitCurrency)},[null==n?void 0:n.copiersProfitCurrency]);return(null==n?void 0:n.copiersYearProfit)||(null==n?void 0:n.copiersMonthProfit)?(0,r.jsx)(eI,{title:e("Copierâs Profit"),titleDataTestId:"strategy-details-copiers-profit",children:(0,r.jsx)(e4,{children:(0,r.jsxs)(e6,{children:[(0,r.jsxs)(e7,{children:[(0,r.jsx)(m.ZP,{color:t.themeColors.text.subtle,typography:y.wZ.TEXT_L_REGULAR,children:e("Current Year")}),(0,r.jsxs)(m.ZP,{typography:y.wZ.TEXT_L_MEDIUM,children:[o.copiersYearProfit,l,(0,v.Wi)(n.copiersYearProfit,2,!1)]})]}),(0,r.jsxs)(e7,{children:[(0,r.jsx)(m.ZP,{color:t.themeColors.text.subtle,typography:y.wZ.TEXT_L_REGULAR,children:e("Current Month")}),(0,r.jsxs)(m.ZP,{typography:y.wZ.TEXT_L_MEDIUM,children:[o.copiersMonthProfit,l,(0,v.Wi)(n.copiersMonthProfit,2,!1)]})]})]})})}):null};var e4=o.ZP.div.withConfig({componentId:"sc-c103b244-0"})(["padding:","px;display:flex;flex-direction:column;row-gap:","px;column-gap:","px;"],l.A.L,l.A.XL,l.A.L),e7=o.ZP.div.withConfig({componentId:"sc-c103b244-1"})(["display:flex;flex-direction:column;gap:","px;
1width:200px;"],l.A.XXXS),e6=o.ZP.div.withConfig({componentId:"sc-c103b244-2"})(["display:flex;flex-direction:row;column-gap:","px;"],l.A.L);n(67285);var e5=n(16672);let te=function(e){var t=e.copyTradeProfileData,n=(0,i.$G)().t,o=(0,b.VC)().theme,l=(0,h.useMemo)(function(){var e;return(null!=(e=null==t?void 0:t.markets)?e:[]).sort(function(e,t){var n,r,o=null!=(n=e.percentages)?n:0,i=null!=(r=t.percentages)?r:0;return o===i?e.marketName.localeCompare(t.marketName):i-o})},[null==t?void 0:t.markets]);return(0,r.jsx)(eI,{title:n("Markets Traded"),titleDataTestId:"strategy-details-markets-traded",minHeight:420,hasTopBorder:!1,children:(0,r.jsx)(tt,{children:0===l.length?(0,r.jsx)(p.Z,{variant:p.R.NO_DATA_TO_DISPLAY}):l.map(function(e){return(0,r.jsxs)(tn,{children:[(0,r.jsx)(m.ZP,{typography:y.wZ.TEXT_L_REGULAR,color:o.themeColors.text.subtle,children:e.marketName}),(0,r.jsxs)(m.ZP,{typography:y.wZ.TEXT_L_MEDIUM,children:[(0,e5.vl)(e.percentages,2),"%"]})]},e.marketName)})})})};var tt=o.ZP.div.withConfig({componentId:"sc-91ebd39f-0"})(["display:flex;flex-direction:column;gap:","px;padding:","px;overflow:auto;height:100%;flex:1;"],l.A.REGULAR,l.A.XL),tn=o.ZP.div.withConfig({componentId:"sc-91ebd39f-1"})(["display:flex;flex-direction:row;justify-content:space-between;align-items:center;"]),tr=n(16829);let to=function(e){var t,n=e.isCopier,o=e.copyTradeProfileData,l=(0,i.$G)(),a=l.t,c=l.i18n.language,s=(0,b.VC)().theme,u=(0,h.useMemo)(function(){return(0,eX.j)(null==o?void 0:o.currencyCode)},[null==o?void 0:o.currencyCode]),d=(0,h.useMemo)(function(){if(!o)return{};var e=function(e){return 0===e?"":e<0?"-":"+"};return{realisedReturn:e(o.realisedReturn),unrealisedReturn:e(o.unrealisedReturn),unrealisedPnl:e(o.unrealisedPnl),realisedPnl:e(o.realisedPnl),equity:e(o.equity),balance:e(o.balance),maxDrawdown:e(o.maxDrawdown)}},[o]);return o?(0,r.jsx)(eI,{title:a("Profitability"),externalLink:eC.gR,titleDataTestId:"strategy-details-profitability",hasTopBorder:!1,children:(0,r.jsxs)(ti,{children:[(0,r.jsxs)(tc,{children:[(0,r.jsxs)(ta,{children:[(0,r.jsx)(m.ZP,{color:s.themeColors.text.subtle,typography:y.wZ.TEXT_L_REGULAR,children:a("Realized Return")}),(0,r.jsxs)(ez.g,{profitLoss:(0,eU.Ov)(o.realisedReturn),typography:y.wZ.TEXT_L_MEDIUM,children:[d.realisedReturn,(0,v.Wi)(o.realisedReturn,2,!0,!1,!0),"%"]})]}),(0,r.jsxs)(ta,{children:[(0,r.jsx)(m.ZP,{color:s.themeColors.text.subtle,typography:y.wZ.TEXT_L_REGULAR,children:a("Live Return")}),(0,r.jsxs)(ez.g,{profitLoss:(0,eU.Ov)(null==o?void 0:o.unrealisedReturn),typography:y.wZ.TEXT_L_MEDIUM,children:[d.unrealisedReturn,(0,v.Wi)(null==o?void 0:o.unrealisedReturn,2,!0,!1,!0),"%"]})]})]}),(0,r.jsxs)(tc,{children:[(0,r.jsxs)(ta,{children:[(0,r.jsx)(tl,{children:!n&&o.unrealisedPnl?(0,r.jsxs)(ts,{variant:g.eF.TEXT_ONLY,onClick:function(){M.Bz.onStrategyDetailTabChange(eC.ww.OPEN_POSITIONS)},children:[(0,r.jsx)(m.ZP,{color:s.themeColors.text.subtle,typography:y.wZ.TEXT_L_REGULAR,children:a("Unrealized P/L")}),(0,r.jsx)(N.ZP,{icon:N.Ro.CHEVRON_RIGHT,size:N.sk.M,color:s.themeColors.text.subtle})]}):(0,r.jsx)(m.ZP,{color:s.themeColors.text.subtle,typography:y.wZ.TEXT_L_REGULAR,children:a("Unrealized P/L")})}),(0,r.jsxs)(ez.g,{profitLoss:(0,eU.Ov)(o.unrealisedPnl),typography:y.wZ.TEXT_L_MEDIUM,children:[d.unrealisedPnl,u,(0,v.Wi)(o.unrealisedPnl,2,!0,!1,!0)]})]}),(0,r.jsxs)(ta,{children:[(0,r.jsx)(tl,{children:!n&&o.realisedPnl?(0,r.jsxs)(ts,{variant:g.eF.TEXT_ONLY,onClick:function(){M.Bz.onStrategyDetailTabChange(eC.ww.HISTORY)},children:[(0,r.jsx)(m.ZP,{color:s.themeColors.text.subtle,typography:y.wZ.TEXT_L_REGULAR,children:a("Realized P/L")}),(0,r.jsx)(N.ZP,{icon:N.Ro.CHEVRON_RIGHT,size:N.sk.M,color:s.themeColors.text.subtle})]}):(0,r.jsx)(m.ZP,{color:s.themeColors.text.subtle,typography:y.wZ.TEXT_L_REGULAR,children:a("Realized P/L")})}),(0,r.jsxs)(ez.g,{profitLoss:(0,eU.Ov)(o.realisedPnl),typography:y.wZ.TEXT_L_MEDIUM,children:[d.realisedPnl,u,(0,v.Wi)(o.realisedPnl,2,!0,!1,!0)]})]})]}),(0,r.jsxs)(tc,{children:[(0,r.jsxs)(ta,{children:[(0,r.jsx)(m.ZP,{color:s.themeColors.text.subtle,typography:y.wZ.TEXT_L_REGULAR,children:a("Equity")}),(0,r.jsxs)(m.ZP,{typography:y.wZ.TEXT_L_MEDIUM,children:[d.equity,u,(0,v.Wi)(null==o?void 0:o.equity,2,!0,!1,!0)]})]}),(0,r.jsxs)(ta,{children:[(0,r.jsx)(m.ZP,{color:s.themeColors.text.subtle,typography:y.wZ.TEXT_L_REGULAR,children:a("Balance")}),(0,r.jsxs)(m.ZP,{typography:y.wZ.TEXT_L_MEDIUM,children:[d.balance,u,(0,v.Wi)(null==o?void 0:o.balance,2,!0,!1,!0)]})]})]}),(0,r.jsxs)(tc,{children:[null===o.leverage?(0,r.jsx)(ta,{}):(0,r.jsxs)(ta,{children:[(0,r.jsx)(m.ZP,{color:s.themeColors.text.subtle,typography:y.wZ.TEXT_L_REGULAR,children:a("Leverage")}),(0,r.jsxs)(m.ZP,{typography:y.wZ.TEXT_L_MEDIUM,children:[null==o?void 0:o.leverage,": 1"]})]}),(0,r.jsxs)(ta,{children:[(0,r.jsx)(m.ZP,{color:s.themeColors.text.subtle,typography:y.wZ.TEXT_L_REGULAR,children:a("Max Drawdown (Equity)")}),(0,r.jsxs)(ez.g,{profitLoss:(0,eU.Ov)(o.maxDrawdown),typography:y.wZ.TEXT_L_MEDIUM,children:[d.maxDrawdown,(0,v.Wi)(o.maxDrawdown,2,!0,!1,!0),"%"]})]})]}),(null==o?void 0:o.risk)&&(0,r.jsx)(tc,{children:(0,r.jsxs)(ta,{children:[(0,r.jsx)(m.ZP,{color:s.themeColors.text.subtle,typography:y.wZ.TEXT_L_REGULAR,children:a("Risk")}),(0,r.jsx)(m.ZP,{color:s.themeColors.riskLevel[null==o||null==(t=o.risk)?void 0:t.toLowerCase()],typography:y.wZ.TEXT_L_MEDIUM,children:(0,tr.FS)(null==o?void 0:o.risk,c)})]})})]})}):(0,r.jsx)(p.Z,{variant:p.R.NO_DATA_TO_DISPLAY})};var ti=o.ZP.div.withConfig({componentId:"sc-31299802-0"})(["padding:","px;display:flex;flex-direction:column;row-gap:","px;column-gap:","px;"],l.A.L,l.A.XL,l.A.L),tl=o.ZP.div.withConfig({componentId:"sc-31299802-1"})(["display:flex;flex-direction:row;align-items:center;gap:","px;"],l.A.XXXS),ta=o.ZP.div.withConfig({componentId:"sc-31299802-2"})(["display:flex;flex-direction:column;gap:","px;
1width:200px;"],l.A.XXXS),tc=o.ZP.div.withConfig({componentId:"sc-31299802-3"})(["display:flex;flex-direction:row;column-gap:","px;"],l.A.L),ts=(0,o.ZP)(g.ZP).withConfig({componentId:"sc-31299802-4"})(["width:fit-content;text-align:left;justify-content:flex-start;align-items:start;"]);n(70189);var tu=n(95148),td=n(86151),tf=n(479),tp=n(81555),th=n(1403),tg=n(91714),ty=n(67294);function tm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function tb(e,t,n,r,o,i,l){try{var a=e[i](l),c=a.value}catch(e){n(e);return}a.done?t(c):Promise.resolve(c).then(r,o)}var tv=(0,h.createContext)(void 0),tx=function(e){var t,n,o=e.children,i=e.copyTradeProfileData,l=e.isCopier,a=void 0!==l&&l,s=null==(n=(0,M.jW)())?void 0:n.id,u=(0,M.rZ)(),d=(0,M.Hp)(),f=(t=(0,h.useState)(!1),function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],l=!0,a=!1;try{for(o=o.call(e);!(l=(n=o.next()).done)&&(i.push(n.value),i.length!==t);l=!0);}catch(e){a=!0,r=e}finally{try{l||null==o.return||o.return()}finally{if(a)throw r}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return tm(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tm(e,t)}}(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),p=f[0],g=f[1];return(0,r.jsx)(tv.Provider,{value:{timeframe:u,isChartLoading:p,isExpanded:d,handleTimeframeChange:function(e,t){var n;return(n=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return l.next=a(0),l.throw=a(1),l.return=a(2),"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function a(a){return function(c){var s=[a,c];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,s[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}}(this,function(n){switch(n.label){case 0:if(e.stopPropagation(),!i&&!a)return[2];if(g(!0),ty.p.setReturnHistoryChartTimeframe(t),!(a&&s))return[3,2];return[4,c.bD.getCopyTradeProfile({copierId:s,timeframe:t,isCustomLoading:!0,onFinally:function(){g(!1)}})];case 1:return n.sent(),[3,4];case 2:if(!i)return[3,4];return[4,M.Bz.getStrategyDetail({isCustomLoading:!0,strategyId:i.id,copierId:s,timeframe:t,onFinally:function(){g(!1)}})];case 3:n.sent(),n.label=4;case 4:return[2]}})},function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function l(e){tb(i,r,o,l,a,"next",e)}function a(e){tb(i,r,o,l,a,"throw",e)}l(void 0)})})()},toggleExpanded:function(){ty.p.setIsReturnHistoryChartExpanded(!d)}},children:o})},tw=function(){var e=(0,h.useContext)(tv);if(!e)throw Error("useReturnHistoryChart must be used within ReturnHistoryChartProvider");return e};n(26833);let tC=function(){var e=(0,i.$G)().t,t=tw(),n=t.timeframe,o=t.isChartLoading,l=t.handleTimeframeChange;return(0,r.jsx)(tj,{children:Object.values(eC.xi).map(function(t){return(0,r.jsx)(tP,{$selected:n===t,onClick:function(e){return l(e,t)},disabled:o,children:(0,M.vx)(t,e)},t)})})};var tj=o.ZP.div.withConfig({componentId:"sc-aad37e-0"})(["display:flex;gap:","px;border-left:1px solid ",";padding-left:","px;"],l.A.XS,function(e){return e.theme.themeColors.border.default},l.A.XS),tP=o.ZP.button.withConfig({componentId:"sc-aad37e-1"})(["padding:0 ","px;background:none;border:none;cursor:pointer;font-size:14px;color:",";font-weight:",";&:hover{color:",";}"],l.A.XXS,function(e){var t=e.$selected,n=e.theme;return t?n.themeColors.primary:n.themeColors.text.subtle},function(e){return e.$selected?600:400},function(e){return e.theme.themeColors.primary});let tO=function(){var e=(0,i.$G)().t,t=(0,b.VC)().theme;return(0,r.jsxs)(tS,{children:[(0,r.jsx)(m.ZP,{typography:y.wZ.TEXT_M_MEDIUM,color:t.themeColors.text.default,children:e("Return History Chart")}),(0,r.jsx)(tC,{})]})};var tS=o.ZP.div.withConfig({componentId:"sc-14a35d90-0"})(["display:flex;padding:","px ","px;align-items:center;width:100%;gap:","px;background-color:",";border-bottom:1px solid ",";border-top:1px solid ",";&:hover{background-color:",";}"],l.A.XS,l.A.REGULAR,l.A.S,function(e){return e.theme.themeColors.background.subtle},function(e){return e.theme.themeColors.border.default},function(e){return e.theme.themeColors.border.default},function(e){return e.theme.themeColors.background.active}),tT=function(e){return e?window.innerHeight-250:300},tE=function(e){var t=e.copyTradeProfileData,n=(0,i.$G)(),o=n.t,l=n.i18n.language,c=(0,b.VC)().theme,s=(0,th.Ug)(),u=tw(),d=u.isChartLoading,f
1=u.isExpanded,p=u.toggleExpanded,y=(0,h.useMemo)(function(){var e,n;return null!=(n=null==t||null==(e=t.history)?void 0:e.map(function(e){return{time:new Date(e.timestamp).getTime(),value:e.valueReturn}}))?n:[]},[null==t?void 0:t.history]),x=(0,h.useMemo)(function(){var t=e.data&&e.data.length?e.data:y;if(!t.length)return{seriesData:[],whitespaceData:[]};for(var n=(0,eM.ZP)(t[0].time).startOf("month"),r=(0,eM.ZP)(t[t.length-1].time).startOf("month"),o=new Set(t.map(function(e){return(0,eM.ZP)(e.time).startOf("month").valueOf()})),i=[],l=n.clone();l.isBefore(r);)o.has(l.valueOf())||i.push({time:l.valueOf()}),l=l.add(1,"month");return{seriesData:t,whitespaceData:i}},[y,e.data]),w=x.seriesData,C=x.whitespaceData,j=e.data,P=void 0===j?history:j,O=e.colors,S=void 0===O?{}:O,T=S.backgroundColor,E=void 0===T?c.themeColors.background.default:T,I=S.lineColor,R=void 0===I?c.themeColors.primary:I,Z=S.textColor,A=void 0===Z?c.themeColors.text.muted:Z,_=(0,h.useRef)(null),L=(0,h.useRef)(null);return(0,h.useEffect)(function(){if(0!==w.length){var e,t,n,r,o=function(){var e,t,n,r=null!=(n=null==(e=_.current)?void 0:e.clientWidth)?n:0,o=tT(f);null==(t=L.current)||t.applyOptions({width:r,height:o})},i=(0,tu.C2)(null!=(n=_.current)?n:"",{layout:{background:{type:tu.Mr.Solid,color:E},textColor:A},timeScale:{borderVisible:!1,timeVisible:!0,tickMarkFormatter:function(e){var t=new Date(e),n=(0,eM.ZP)(t,{locale:(0,tp.R)(l)}).utcOffset(s),r=0===n.month();return n.format(r?"MMM YYYY":"MMM")}},rightPriceScale:{borderColor:c.themeColors.border.default},grid:{horzLines:{color:c.themeColors.border.default},vertLines:{color:c.themeColors.border.default}},localization:{locale:(0,tf.SN)(),timeFormatter:function(e){var t=new Date(e);return(0,eM.ZP)(t,{locale:(0,tp.R)(l)}).utcOffset(s).format("YYYY MMM DD HH:mm")},priceFormatter:function(e){return"".concat((0,e5.TK)((0,v.Wi)(e,2,!1)),"%")}
1},width:null!=(r=null==(e=_.current)?void 0:e.clientWidth)?r:0,height:tT(f)});i.timeScale().fitContent(),L.current=i,i.addSeries(tu.eh,{visible:!1}).setData(C),i.addSeries(tu.eh,{color:R}).setData(w),window.addEventListener("resize",o);var a=new ResizeObserver(function(){o()});return(null==(t=_.current)?void 0:t.parentElement)&&a.observe(_.current.parentElement),function(){window.removeEventListener("resize",o),a.disconnect(),i.remove(),L.current=null}}},[P,E,R,A,c.themeColors.border.default,w,C,s,o,l,f]),(0,h.useEffect)(function(){var e;null==(e=L.current)||e.applyOptions({height:tT(f)})},[f]),(0,r.jsxs)(tA,{$isExpanded:f,children:[d&&(0,r.jsx)(a.ZP,{absolute:!0}),f?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(tD,{children:[(0,r.jsxs)(tL,{children:[(0,r.jsx)(m.ZP,{children:o("Return History Chart")}),(0,r.jsx)(tC,{})]}),(0,r.jsx)(g.ZP,{variant:g.eF.ICON_ONLY,icon:N.Ro.FULLSCREEN_MINIMISE,onClick:p,textColor:c.themeColors.primary})]}),(0,r.jsx)(tR,{children:0===w.length?(0,r.jsx)(tg.Z,{}):(0,r.jsx)("div",{ref:_})})]}):(0,r.jsxs)(t_,{children:[(0,r.jsx)(td.Z,{selector:(0,r.jsx)(tO,{}),defaultExpanded:!0,variant:td.y.BASE,children:(0,r.jsx)(tR,{children:0===w.length?(0,r.jsx)(tg.Z,{}):(0,r.jsx)(tZ,{$height:tT(f),ref:_})})}),(0,r.jsx)(tk,{variant:g.eF.ICON_ONLY,icon:N.Ro.FULLSCREEN_OPEN,onClick:p})]})]})};let tI=function(e){return(0,r.jsx)(tx,{copyTradeProfileData:e.copyTradeProfileData,isCopier:e.isCopier,children:(0,r.jsx)(tE,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e))})};var tR=o.ZP.div.withConfig({componentId:"sc-65b0af5f-0"})(["display:flex;flex-direction:column;padding-top:","px;flex:1;"],l.A.REGULAR),tZ=o.ZP.div.withConfig({componentId:"sc-65b0af5f-1"})(["min-height:","px;"],function(e){return e.$height}),tA=o.ZP.div.withConfig({componentId:"sc-65b0af5f-2"})(["display:flex;flex-direction:column;background-color:",";",""],function(e){return e.theme.themeColors.background.default},function(e){return e.$isExpanded&&"\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 1;\n "}),t_=o.ZP.div.withConfig({componentId:"sc-65b0af5f-3"})(["position:relative;"]),tL=o.ZP.div.withConfig({componentId:"sc-65b0af5f-4"})(["display:flex;align-items:center;gap:","px;"],l.A.S),tD=o.ZP.div.withConfig({componentId:"sc-65b0af5f-5"})(["height:","px;padding:0 ","px;background-color:",";display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid ",";"],l.A.XXL,l.A.XS,function(e){return e.theme.themeColors.background.subtle},function(e){return e.theme.themeColors.border.default}),tk=(0,o.ZP)(g.ZP).withConfig({componentId:"sc-65b0af5f-6"})(["position:absolute;top:0;right:","px;padding:","px;"],l.A.XL,l.A.XS),tM=n(16029);let tN=function(e){var t=e.copyTradeProfileData,n=(0,i.$G)().t,o=(0,b.VC)().theme;return(0,r.jsx)(eI,{title:n("Traded"),titleDataTestId:"strategy-details-traded",children:(0,r.jsxs)(tX,{children:[(0,r.jsxs)(tz,{children:[(0,r.jsxs)(tU,{children:[(0,r.jsx)(m.ZP,{color:o.themeColors.text.subtle,typography:y.wZ.TEXT_L_REGULAR,children:n("12 month total")}),(0,r.jsx)(m.ZP,{typography:y.wZ.TEXT_L_MEDIUM,children:(0,v.Wi)(null==t?void 0:t.totalTrades,0,!1)})]}),(0,r.jsxs)(tU,{children:[(0,r.jsx)(m.ZP,{color:o.themeColors.text.subtle,typography:y.wZ.TEXT_L_REGULAR,children:n("Min p/m")}),(0,r.jsx)(m.ZP,{typography:y.wZ.TEXT_L_MEDIUM,children:(0,v.Wi)(null==t?void 0:t.minPerMonth,0,!1)})]}),(0,r.jsxs)(tU,{children:[(0,r.jsx)(m.ZP,{color:o.themeColors.text.subtle,typography:y.wZ.TEXT_L_REGULAR,children:n("Max p/m")}),(0,r.jsx)(m.ZP,{typography:y.wZ.TEXT_L_MEDIUM,children:(0,v.Wi)(null==t?void 0:t.maxPerMonth,0,!1)})]})]}),(0,r.jsxs)(tz,{children:[(0,r.jsxs)(tU,{children:[(0,r.jsx)(m.ZP,{color:o.theme
1Colors.text.subtle,typography:y.wZ.TEXT_L_REGULAR,children:n("Wins")}),(0,r.jsxs)(tG,{$profitLoss:tM.a.PROFIT,typography:y.wZ.TEXT_L_MEDIUM,children:[(0,v.Wi)(null==t?void 0:t.wins,2,!1),"%"]})]}),(0,r.jsxs)(tU,{children:[(0,r.jsx)(m.ZP,{color:o.themeColors.text.subtle,typography:y.wZ.TEXT_L_REGULAR,children:n("Losses")}),(0,r.jsxs)(tG,{$profitLoss:tM.a.LOSS,typography:y.wZ.TEXT_L_MEDIUM,children:[(0,v.Wi)(null==t?void 0:t.losses,2,!1),"%"]})]})]})]})})};var tX=o.ZP.div.withConfig({componentId:"sc-e3d2f9bd-0"})(["padding:","px;display:flex;flex-direction:column;row-gap:","px;column-gap:","px;"],l.A.L,l.A.XL,l.A.L),tU=o.ZP.div.withConfig({componentId:"sc-e3d2f9bd-1"})(["display:flex;flex-direction:column;gap:","px;width:200px;"],l.A.XXXS),tz=o.ZP.div.withConfig({componentId:"sc-e3d2f9bd-2"})(["display:flex;flex-direction:row;flex-wrap:wrap;row-gap:","px;column-gap:","px;"],l.A.XL,l.A.L),tG=(0,o.ZP)(m.ZP).withConfig({componentId:"sc-e3d2f9bd-3"})(["color:",";"],function(e){var t=e.$profitLoss,n=e.theme;return(0,eU.n1)(n.themeColors,t)});let tF=function(e){var t=e.isCopier,n=void 0!==t&&t,o=(0,M.xy)(),i=(0,c.Hy)(),l=(0,h.useMemo)(function(){return n?i:o},[n,i,o]);return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(tB,{$isCopier:n,children:[(0,r.jsxs)(tY,{children:[(0,r.jsx)(to,{isCopier:n,copyTradeProfileData:l}),!n&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(e9,{}),(0,r.jsx)(e2,{})]}),(0,r.jsx)(tN,{copyTradeProfileData:l})]}),(0,r.jsxs)(tV,{children:[(0,r.jsx)(te,{copyTradeProfileData:l}),(0,r.jsx)(tI,{copyTradeProfileData:l,isCopier:n})]})]})})};var tB=o.ZP.div.withConfig({componentId:"sc-72799aab-0"})(["position:relative;display:flex;flex-direction:row;overflow:auto;height:100%;"]),tY=o.ZP.div.withConfig({componentId:"sc-72799aab-1"})(["display:flex;flex-direction:column;flex:1;height:100%;overflow-y:auto;&::-webkit-scrollbar{display:none;}"]),tV=o.ZP.div.withConfig({componentId:"sc-72799aab-2"})(["display:flex;flex-direction:column;min-width:400px;border-left:1px solid ",";height:100%;overflow-y:auto;"],function(e){return e.theme.themeColors.border.default}),tH=n(52617),tW=n(81002);n(57327);var t$=n(38370),tK=n(19367);function tq(e){var t=e.accessorKey,n=e.headerText,o=e.size,i=e.sortDescFirst,l=e.formatter,a=e.cellTestId;return{accessorKey:t,size:o,sortDescFirst:void 0!==i&&i,header:function(){return(0,r.jsx)(m.ZP,{children:n})},cell:function(e){var t,n=e.getValue(),o=null==(t=e.row)?void 0:t.original;return"function"==typeof l&&("number"==typeof n||"string"==typeof n)&&(n=l(n,o)),(0,r.jsx)(m.ZP,{dataTestId:a,children:null!=n?n:"--"})}}}var tJ=function(){var e=(0,i.$G)().t;return{tableColumns:(0,h.useMemo)(function(){return Object.values({openTimestamp:tq({cellTestId:eT.Of.ASSET_OPEN_COLUMN_OPEN_DATE,accessorKey:"openTimestamp",headerText:e("Open Date"),size:160,formatter:function(e){return eN._.convertToDayjsWithOffset({input:Number(e)}).format(eM.ju)}}),symbol:tq({cellTestId:eT.Of.COPY_TRADE_OPEN_COLUMN_SIGNAL,accessorKey:"instrument",headerText:e("Symbol"),size:120}),tradeId:tq({cellTestId:eT.Of.COPY_TRADE_OPEN_COLUMN_TRADE_ID,accessorKey:"tradeId",headerText:e("Order No."),size:120}),direction:{accessorKey:"direction",header:function(){return(0,r.jsx)(m.ZP,{children:e("Type")})},size:120,cell:function(e){var t="Buy"===e.getValue()?t$.pE.BUY:t$.pE.SELL;return(0,r.jsx)(m.ZP,{children:(0,r.jsx)(eG.Z,{orderType:t,getTextFromOrderType:tK.Lx})})}},unrealisedProfit:{accessorKey:"unrealisedProfit",header:function(){return(0,r.jsx)(m.ZP,{children:e("Profit/Loss")})},size:120,cell:function(e){var t=e.getValue();return t?(0,r.jsxs)(ez.g,{dataTestId:eT.Of.COPY_TRADE_OPEN_COLUMN_PROFIT,profitLoss:(0,eU.Ov)(Number(t)),children:[Number(t)>0?"+":"-",(0,eX.j)(e.row.original.currencyCode),(0,v.Wi)(Number(t),2,!0,!1,!0)]}):(0,r.jsx)(m.ZP,{dataTestId:eT.Of.COPY_TRADE_OPEN_COLUMN_PROFIT,children:"--"})}},volume:tq({cellTestId:eT.Of.COPY_TRADE_OPEN_COLUMN_VOLUME,accessorKey:"volume",headerText:e("Volume"),size:120}),units:tq({cellTestId:eT.Of.COPY_TRADE_OPEN_COLUMN_UNITS,accessorKey:"units",headerText:e("Units"),size:120}),openPrice:tq({cellTestId:eT.Of.COPY_TRADE_OPEN_COLUMN_ENTRY_PRICE,accessorKey:"openPrice",headerText:e("Entry Price"),size:120}),currentPrice:tq({cellTestId:eT.Of.COPY_TRADE_OPEN_COLUMN_CLOSE_PRICE,accessorKey:"currentPrice",headerText:e("Current Price"),size:120}),limitPrice:tq({cellTestId:eT.Of.COPY_TRADE_OPEN_COLUMN_TAKE_PROFIT,accessorKey:"limitPrice",headerText:e("Take Profit"),size:120}),stopPrice:tq({cellTestId:eT.Of.COPY_TRADE_OPEN_COLUMN_STOP_LOSS,accessorKey:"stopPrice",headerText:e("Stop Loss"),size:120})}).filter(function(e){return!!e})},[e])}};let tQ=function(){var e=(0,i.$G)().t,t=(0,s.eS)(),n=(0,s.g5)(),o=tJ().tableColumns,l=t.length<tW.XP;return(0,r.jsx)(eI,{minHeight:eC.Nb,title:e("Open Positions"),titleDataTestId:eT.Of.COPY_TRADE_STRATEGY_DETAILS_OPEN_POSITIONS,hasTopBorder:!1,children:n?(0,r.jsx)(a.ZP,{absolute:!0}):(0,r.jsx)(tH.Z,{data:t,columns:o,listEmptyComponent:(0,r.jsx)(p.Z,{variant:p.R.OPEN_POSITION}),paginationLabel:e("positions"),hidePagination:l,pageLabel:e("Page"),ofLabel:e("of"),onSortingChange:function(){},rowTestId:eT.Of.ASSET_OPEN_LIST_ITEM})})},t0=function(e){var t=e.isCopier,n=void 0!==t&&t,o=(0,s.pZ)();if(n)return(0,r.jsx)(tF,{isCopier:!0});switch(o){case eC.ww.OPEN_POSITIONS:return(0,r.jsx)(tQ,{});case eC.ww.HISTORY:return(0,r.jsx)(e0,{});default:return(0,r.jsx)(tF,{isCopier:n})}},t1=function(e){var t,n=e.isCopier,o=void 0!==n&&n,l=(0,i.$G)().t,h=(0,d.GR)().leftPanelState,g=(0,s.rx)(),y=(0,s.vB)(),m=(0,c.gV)(),b=(0,s.Lm)(),v=(0,s.iM)(),x=(0,s.iA)(),w=(0,s.n6)();
1return y||m||b||v||x?(0,r.jsxs)(t9,{$isCopier:o,children:[!o&&(0,r.jsx)(f.Z,{direction:"left",onClick:d.Pw.toggleLeftPanel,isFolded:!d.Pw.isExpandState(h)}),(0,r.jsxs)(t4,{children:[!o&&(0,r.jsx)(eO,{}),(0,r.jsx)(t7,{children:(0,r.jsx)(a.ZP,{})})]})]}):g||o?o&&!(0,u.x6)(null!=(t=null==w?void 0:w.linkedCopiers)?t:[])?(0,r.jsx)(t3,{children:(0,r.jsx)(p.Z,{variant:p.R.NO_COPY_TRADE_FOUND})}):(0,r.jsxs)(t9,{$isCopier:o,children:[!o&&(0,r.jsx)(f.Z,{direction:"left",onClick:d.Pw.toggleLeftPanel,isFolded:!d.Pw.isExpandState(h)}),(0,r.jsxs)(t4,{children:[!o&&(0,r.jsx)(eO,{}),o?(0,r.jsx)(ep,{}):(0,r.jsx)(C,{}),(0,r.jsx)(t0,{isCopier:o})]})]}):(0,r.jsxs)(t8,{children:[(0,r.jsx)("div",{children:(0,r.jsx)(eP,{})}),(0,r.jsx)(p.Z,{variant:p.R.NO_DATA_TO_DISPLAY,label:l("Select a strategy from the lists to view strategy details.")})]})};var t2=o.ZP.div.withConfig({componentId:"sc-f00c3a1b-0"})(["display:flex;height:100%;flex:1;background-color:",";border-left:1px solid ",";"],function(e){return e.theme.themeColors.background.default},function(e){return e.theme.themeColors.border.default}),t3=(0,o.ZP)(t2).withConfig({componentId:"sc-f00c3a1b-1"})(["align-items:center;justify-content:center;"]),t8=(0,o.ZP)(t2).withConfig({componentId:"sc-f00c3a1b-2"})(["flex-direction:column;margin-inline-start:","px;"],l.A.XS),t9=o.ZP.div.withConfig({componentId:"sc-f00c3a1b-3"})(["display:flex;align-items:flex-start;height:100%;flex:1;margin-inline-start:","px;"," overflow-x:hidden;overflow-y:auto;"],l.A.XS,function(e){return e.$isCopier?"margin-inline-start: 0;":""}),t4=o.ZP.div.withConfig({componentId:"sc-f00c3a1b-4"})(["display:flex;flex-direction:column;flex:1;width:100%;height:100%;overflow:hidden;"]),t7=o.ZP.div.withConfig({componentId:"sc-f00c3a1b-5"})(["display:flex;align-items:center;justify-content:center;height:100%;background-color:",";"],function(e){return e.theme.themeColors.background.default})}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.