1"use strict";(self.webpackChunkbitycle=self.webpackChunkbitycle||[]).push([[8470],{8680:function(e,t,n){n.d(t,{K:function(){return i},n:function(){return r}});var r={ENTRY_REASONS:["technical","onchain","fundamental","news","others_suggestion","sentiment","macroeconomics"],TRADING_ENVIRONMENT_CONDITIONS:["trading_calm_env","trading_unstable_env","non_trading_calm_env","non_trading_unstable_env"],TRADING_TYPE:["short_term","scalp","swing","long_term"],DOMINANT_SENSE:["apprehension_fear","vigilance","happiness","distractions","sadness","tiredness","anger_annoyance"],SPENT_TIME:["<10","10-20","20-40","40-70",">70"]},i={STATUS:["open","profit_limit","close_in_profit","limit_of_lost","close_at_loss"],FAILURE_REASONS:["wrong_analysis","unexpected_event","properly_manage_failure","emotional_decision","check_other_time_frames_failure"]}},27836:function(e,t,n){n.d(t,{Z:function(){return c}});var r=n(16961),i=["date","detail","from","manner","fillAndAmount","triggerAndPrice","total","fee","status","journal"],s=["date","detail","manner","triggerAndPrice","total","fillAndAmount","fee","status","liqPrice","pnl","profitAndLoss","closePrice","closeTime","journal"],l=["date","detail","manner","trigger","priceAndAveragePrice","fillAndAmount","fee","status","unPnl","journal"],a=["detail","avgPrice","amount","liqPrice","unPnl","takeProfitAndStopLoss","operation"],o=[{id:"date",title:"order.date",sortable:!0,sortKey:"date",skeletonProps:{rows:[{isLine:!0},{isLine:!0,width:"80%"}]}},{id:"detail",title:"order.detail",sortable:!0,sortKey:"market",skeletonProps:{rows:[{isLine:!0},{isLine:!0,width:"80%"}]}},{id:"from",title:"order.from",sortable:!0},{id:"market",title:"order.market",sortable:!0},{id:"manner",title:"order.manner",sortable:!0,sortKey:"manner"},{id:"side",title:"order.side",sortable:!0},{id:"leverage",title:"order.leverage",sortable:!0},{id:"fill",title:"order.fill",sortKey:"filled",sortable:!0},{id:"stopPrice",title:"order.stopPrice",sortable:!0},{id:"price",title:"order.price",sortKey:"price",sortable:!0},{id:"total",title:"order.total",sortable:!0,sortKey:"total"},{id:"amount",title:"order.amount",sortable:!0,sortKey:"amount"},{id:"fillAndAmount",title:"order.fillAndAmount",sortable:!0,sortKey:"filled",skeletonProps:{rows:[{isLine:!0,width:"80%"},{isLine:!0}]}},{id:"priceAndAveragePrice",title:"order.priceAndAveragePrice",sortable:!0,sortKey:"filled",skeletonProps:{rows:[{isLine:!0,width:"80%"},{isLine:!0}]}},{id:"trigger",title:"order.trigger",sortable:!0,sortKey:"price"},{id:"avgPrice",title:"order.avgPrice",sortable:!0,sortKey:"price"},{id:"triggerAndPrice",title:"order.triggerAndPrice",sortable:!0,sortKey:"price",skeletonProps:{rows:[{isLine:!0,width:"80%"},{isLine:!0}]}},{id:"fee",title:"order.fee",sortable:!0,sortKey:"fee"},{id:"status",title:"order.status",sortable:!0,sortKey:"status"},{id:"liqPrice",title:"order.liqPrice",sortable:!0,sortKey:"liqPrice"},{id:"pnl",title:"order.pnl",sortable:!0,sortKey:"pnl",skeletonProps:{rows:[{isLine:!0},{isLine:!0,width:"50%"}]}},{id:"unPnl",title:"order.unPnl",sortable:!0,sortKey:"pnl",skeletonProps:{rows:[{isLine:!0},{isLine:!0,width:"50%"}]}},{id:"takeProfit",title:"order.takeProfit",sortKey:"takeProfit",sortable:!0},{id:"profitAndLoss",title:"order.profitAndLoss",sortable:!0,sortKey:"takeProfit",skeletonProps:{rows:[{isLine:!0,width:"80%"},{isLine:!0}]}},{id:"stopLoss",title:"order.stopLoss",sortable:!0},{id:"closePrice",title:"order.closePrice",sortable:!0,sortKey:"closePrice"},{id:"closeTime",title:"order.closeTime",sortable:!0,sortKey:"closeTime"},{id:"subAccount",title:"sub_account",sortable:!0,sortKey:"subAccount"},{id:"takeProfitAndStopLoss",title:"order.takeProfitAndStopLoss",sortable:!1,skeletonProps:{rows:[{isLine:!0,width:"80%"},{isLine:!0,width:"60%"}]}},{id:"journal",title:"order.journal",sortable:!1,skeletonProps:{rows:[{icon:r.Z}]}},{id:"operation",title:"order.operation",sortable:!1}];function c(e,t,n){return o.filter((function(r){return("spot"===e?n?i.filter((function(e){return"from"!==e})):i:"futures"===e?"history"===t?s:s.filter((function(e){return"closeTime"!==e})):"perpetual"===e?"current"===t?a:l:i).includes(r.id)}))}},37306:function(e,t,n){n.d(t,{Z:function(){return ce}});var r=n(4942),i=n(1413),s=n(29439),l=n(24813),a=n(66149),o=n(96467),c=n(4117),d=n(69099),u=n(40699),p=n(8680),m=n(198
160),x=n(35898),f=n(5178),h=n(9506),g=n(5845),j=n.n(g),v=n(97548),Z=n.n(v),_=n(59505),b=n.n(_),y=n(46417);b()(j());var k=function(e){var t=e.series,n=e.title,r=e.height,i=e.width,s={chart:{type:"pie",options3d:{enabled:!!e._3D,alpha:65,beta:0},backgroundColor:"transparent",spacingBottom:0,height:r,width:i,spacingTop:0,style:{fontFamily:"Yekan Bakh"}},accessibility:{enabled:!0,description:"".concat(n," pie chart")},credits:{enabled:!1},title:{text:n,align:"center",verticalAlign:"bottom",floating:!0,margin:0,style:{fontSize:"15px"}},tooltip:{pointFormat:"<b>{point.percentage:.1f}%</b>"},plotOptions:{pie:{startAngle:180,cursor:"pointer",depth:40}},series:t};return(0,y.jsx)(Z(),{highcharts:j(),options:s})},N=n(61113),w=function(e){var t=e.title;return(0,y.jsx)(N.Z,{variant:"h3",children:t})},P=n(23885),A=function(e){var t=e.data,n=(0,m.Z)();return(0,y.jsxs)(x.Z,{mb:3,children:[(0,y.jsx)(w,{title:(0,P.t)("bitycle_owl")}),(0,y.jsx)(f.Z,{sx:{mt:2},children:(0,P.t)("journal_bitycle_owl_subtitle")}),(0,y.jsx)(h.Z,{display:"flex",justifyContent:"center",p:2,children:t.technical_n_count&&(0,y.jsx)(k,{title:(0,P.t)("technical"),height:180,width:260,_3D:!0,series:[{data:[{name:(0,P.t)("error"),y:t.technical_n_count,color:n.palette.error.dark},{name:(0,P.t)("approval"),y:t.technical_p_count,color:n.palette.success.main}]}]})})]})},S=n(70109),T=n(27786),C=n(93433),E=n(1550),D=n(16429),R=n(83929),L=n(44758),O=n(23931),z=n(51405),I=n(24631),K=n(19034),F=400,M=function(e){var t=e.data,n=e.setData,r=e.loading;return(0,y.jsxs)(x.Z,{mb:3,children:[(0,y.jsx)(w,{title:(0,P.t)("transaction_entry_info")}),(0,y.jsxs)(x.Z,{spacing:2,mt:2,children:[(0,y.jsxs)(E.Z,{component:"fieldset",children:[(0,y.jsx)(f.Z,{component:"legend",children:(0,P.t)("transaction_entry_reason")}),(0,y.jsx)(D.Z,{"aria-label":"reason",row:!0,children:p.n.ENTRY_REASONS.map((function(e){return(0,y.jsx)(R.Z,{value:e,control:(0,y.jsx)(L.Z,{disabled:r,checked:t.entry_reasons.includes(e),onChange:function(r){r.target.checked?n("entry_reasons",[].concat((0,C.Z)(t.entry_reasons),[e])):t.entry_reasons.includes(e)&&n("entry_reasons",t.entry_reasons.filter((function(t){return t!==e})))}}),label:(0,P.t)(e),labelPlacement:"end"},e)}))})]}),(0,y.jsxs)(E.Z,{component:"fieldset",size:"small",sx:{maxWidth:F},children:[(0,y.jsx)(f.Z,{component:"legend",children:(0,P.t)("trade_condition")}),(0,y.jsx)(O.Z,{value:t.env_conditions,onChange:function(e){return n("env_conditions",e.target.value)},disabled:r,children:p.n.TRADING_ENVIRONMENT_CONDITIONS.map((function(e){return(0,y.jsx)(z.Z,{value:e,children:(0,P.t)(e)},e)}))})]}),(0,y.jsxs)(E.Z,{component:"fieldset",size:"small",sx:{maxWidth:F},children:[(0,y.jsx)(f.Z,{component:"legend",children:(0,P.t)("journal_trade_type")}),(0,y.jsx)(O.Z,{value:t.trade_type,onChange:function(e){return n("trade_type",e.target.value)},disabled:r,children:p.n.TRADING_TYPE.map((function(e){return(0,y.jsx)(z.Z,{value:e,children:(0,P.t)(e)},e)}))})]}),(0,y.jsxs)(E.Z,{component:"fieldset",size:"small",sx:{maxWidth:F},children:[(0,y.jsx)(f.Z,{component:"legend",children:(0,P.t)("journal_dominant_sense")}),(0,y.jsx)(O.Z,{value:t.dominant_sense,disabled:r,onChange:function(e){return n("dominant_sense",e.target.value)},children:p.n.DOMINANT_SENSE.map((function(e){return(0,y.jsx)(z.Z,{value:e,children:(0,P.t)(e)},e)}))})]}),(0,y.jsxs)(E.Z,{component:"fieldset",size:"small",sx:{maxWidth:F},children:[(0,y.jsx)(f.Z,{component:"legend",children:(0,P.t)("how_is_your_feeling")}),(0,y.jsx)(K.Z,{size:"small",disabled:r,step:1,value:t.sense_sensitivity,onChange:function(e){return n("sense_sensitivity",e.target.value)},marks:!0,min:0,max:3,"aria-label":"feeling",valueLabelDisplay:"auto"})]}),(0,y.jsxs)(E.Z,{component:"fieldset",size:"small",sx:{maxWidth:F},children:[(0,y.jsx)(f.Z,{component:"legend",children:(0,P.t)("journal_trade_time")}),(0,y.jsx)(O.Z,{value:t.entry_spent_time,onChange:function(e){return n("entry_spent_time",e.target.value)},disabled:r,children:p.n.SPENT_TIME.map((function(e){return(0,y.jsx)(z.Z,{value:e,children:(0,P.t)(e)},e)}))})]}),(0,y.jsxs)(E.Z,{component:"fieldset",size:"small",children:[(0,y.jsx)(f.Z,{component:"legend",children:(0,P.t)("more_description")}),(0,y.jsx)(I.Z,{placeholder:(0,P.t)("trade_entry_more_description_placeholder"),minRows:4,multiline:!0,value:t.entry_desc,disabled:r,onChange:function(e){return n("entry_desc",e.target.value)}})]})]})]})},q=n(41727),J=n(9019),W=n(64704),Y=n(47313),B=n(46632),U=n(93584),H=["the_first","the_second","the_third"],G=function(e){var t=e.data,n=e.setData,a=e.loading,o=e.price,c=(0,m.Z)(),u=(0,l.Z)(c.breakpoints.down("sm")),p=(0,Y.useState)((0,r.Z)({},H[0],{price:"",riskReward:""})),g=(0,s.Z)(p,2),j=g[0],v=g[1],Z=function(e,t){if(""===e||""===t)return"";var n=o-t,r=e-o;return(0,B.xu)((r/n).toFixed(2))};return(0,Y.useEffect)((function(){if(!a){var e=j;t.tp.map((function(n,s){e=(0,i.Z)((0,i.Z)({},e),{},(0,r.Z)({},H[s],{price:n,riskReward:Z(n,t.sl)}))})),v(e)}}),[a]),(0,Y.useEffect)((function(){var e=Object.keys(j).map((function(e){return parseFloat(j[e].price)})).filter((function(e){return!Number.isNaN(e)}));n("tp",e)}),[j]),(0,y.jsxs)(x.Z,{mb:3,children:[(0,y.jsx)(w,{title:(0,P.t)("transaction_exit_info")}),(0,y.jsxs)(x.Z,{mt:2,spacing:2,children:[(0,y.jsxs)(E.Z,{component:"fieldset",sx:{maxWidth:400},children:[(0,y.jsx)(f.Z,{component:"legend",children:(0,P.t)("stop_lost_price")}),(0,y.jsx)(I.Z,{size:"small",type:"number",disabled:a,value:t.sl||"",onChange:function(e){n("sl",parseFloat(e.target.value));var t=(0,i.Z)({},j);
1Object.keys(j).forEach((function(n){t[n].riskReward=Z(j[n].price,e.target.value)})),v(t)},InputProps:{endAdornment:(0,y.jsx)(q.Z,{position:"end",children:"SL"})}})]}),(0,y.jsxs)(h.Z,{children:[(0,y.jsx)(x.Z,{spacing:2,children:Object.keys(j).map((function(e){return(0,y.jsxs)(J.ZP,{container:!0,alignItems:"center",rowSpacing:1,children:[(0,y.jsx)(J.ZP,{item:!0,xs:12,sm:6,children:(0,y.jsxs)(E.Z,{component:"fieldset",fullWidth:u,children:[(0,y.jsxs)(f.Z,{component:"legend",children:[(0,P.t)("nth_profit_limit",{nth:(0,P.t)(e)}),Object.keys(j).length>1&&(0,y.jsx)(d.Z,{size:"small",color:"error",sx:{p:0,mb:"-2px"},onClick:function(){return function(e){var t=Object.keys(j).filter((function(t){return t!==e})),n={};t.map((function(e,t){n=(0,i.Z)((0,i.Z)({},n),{},(0,r.Z)({},H[t],j[e]))})),v(n)}(e)},children:(0,P.t)("delete")})]}),(0,y.jsx)(I.Z,{size:"small",type:"number",disabled:a,value:j[e].price,onChange:function(n){return v((0,i.Z)((0,i.Z)({},j),{},(0,r.Z)({},e,(0,i.Z)((0,i.Z)({},j[e]),{},{price:n.target.value,riskReward:Z(n.target.value,t.sl)}))))},InputProps:{endAdornment:(0,y.jsx)(q.Z,{position:"end",children:"TP"})}})]})}),(0,y.jsx)(J.ZP,{item:!0,xs:12,sm:6,children:(0,y.jsxs)(E.Z,{component:"fieldset",fullWidth:u,children:[(0,y.jsx)(f.Z,{component:"legend",children:(0,P.t)("nth_risk_reward",{nth:(0,P.t)(e)})}),(0,y.jsx)(I.Z,{disabled:a,size:"small",value:j[e].riskReward,InputProps:{readOnly:!0,endAdornment:(0,y.jsx)(q.Z,{position:"end",children:"R/R"})}})]})})]},e)}))}),Object.keys(j).length<3&&(0,y.jsxs)(d.Z,{sx:{width:"fit-content",mt:"3px"},size:"small",onClick:function(e){v((0,i.Z)((0,i.Z)({},j),{},(0,r.Z)({},H[Object.keys(j).length],{price:"",riskReward:""})))},disabled:a,children:[(0,y.jsx)(W.Z,{size:"18px",style:{marginLeft:"rtl"===c.direction?"2px":0,marginRight:"ltr"===c.direction?"2px":0,marginBottom:"2px"}}),(0,P.t)("add_profit_limit")]})]}),(0,y.jsxs)(E.Z,{component:"fieldset",size:"small",fullWidth:!0,children:[(0,y.jsx)(f.Z,{component:"legend",children:(0,P.t)("trade_exit_estimated_time")}),(0,y.jsx)(J.ZP,{container:!0,spacing:1,children:(0,y.jsx)(J.ZP,{item:!0,xs:6,children:(0,y.jsx)(U.Z,{disabled:a,value:t.estimated_exit_time?new Date(t.estimated_exit_time):null,onChange:function(e){n("estimated_exit_time",e)}})})})]}),(0,y.jsxs)(E.Z,{component:"fieldset",size:"small",children:[(0,y.jsx)(f.Z,{component:"legend",children:(0,P.t)("more_description")}),(0,y.jsx)(I.Z,{disabled:a,placeholder:(0,P.t)("trade_Exit_more_description_placeholder"),minRows:4,multiline:!0,value:t.exit_desc,onChange:function(e){return n("exit_desc",e.target.value)}})]})]})]})},V=function(e){var t=e.data,n=e.setData,r=e.loading;return(0,y.jsxs)(x.Z,{mb:2,children:[(0,y.jsx)(w,{title:(0,P.t)("transaction_result")}),(0,y.jsxs)(x.Z,{spacing:2,mt:2,children:[(0,y.jsxs)(E.Z,{component:"fieldset",size:"small",sx:{maxWidth:400},children:[(0,y.jsx)(f.Z,{component:"legend",children:(0,P.t)("trade_condition")}),(0,y.jsx)(O.Z,{value:t.result_status,onChange:function(e){return n("result_status",e.target.value)},disabled:r,children:p.K.STATUS.map((function(e){return(0,y.jsx)(z.Z,{value:e,children:(0,P.t)(e)},e)}))})]}),"limit_of_lost"===t.result_status||"close_at_loss"===t.result_status?(0,y.jsxs)(E.Z,{component:"fieldset",children:[(0,y.jsx)(f.Z,{component:"legend",children:(0,P.t)("whats_your_failure_reason")}),(0,y.jsx)(D.Z,{"aria-label":"reason",row:!0,children:p.K.FAILURE_REASONS.map((function(e){return(0,y.jsx)(R.Z,{value:e,control:(0,y.jsx)(L.Z,{disabled:r,checked:t.failure_reasons.includes(e),onChange:function(r){r.target.checked?n("failure_reasons",[].concat((0,C.Z)(t.failure_reasons),[e])):t.failure_reasons.includes(e)&&n("failure_reasons",t.failure_reasons.filter((function(t){return t!==e})))}}),label:(0,P.t)(e),labelPlacement:"end"},e)}))})]}):null,(0,y.jsxs)(E.Z,{component:"fieldset",size:"small",children:[(0,y.jsx)(f.Z,{component:"legend",children:(0,P.t)("more_explanation_and_suggestion")}),(0,y.jsx)(I.Z,{placeholder:(0,P.t)("more_explanation_and_suggestion_placeholder"),minRows:4,multiline:!0,disabled:r,value:t.result_desc,onChange:function(e){return n("result_desc",e.target.value)}})]})]})]})},X=n(66212),$=n(28111),Q=n(67216),ee=n(47131),te=n(89840),ne=n(36555),re=n(3910),ie=n(85554),se=n(63660),le=n(69446),ae=function(e){var t=e.data,n=e.setData,r=(e.loading,(0,Y.useState)(!1)),l=(0,s.Z)(r,2),a=l[0],o=l[1],c=(0,Y.useState)(""),d=(0,s.Z)(c,2),u=d[0],p=d[1],m=(0,ie.v9)((function(e){return e.user.journal})),h=(0,ie.I0)(),g=(0,Y.useState)([]),j=(0,s.Z)(g,2),v=j[0],Z=j[1];return(0,Y.useEffect)((function(){m&&(m.init?Z(m.tags):se.J5.getUserOrderJournalTags().then((function(e){Z(e.tags),h(le.u.setJournalTags(e.tags))})))}),[m]),(0,y.jsxs)(x.Z,{mb:3,children:[(0,y.jsx)(w,{title:(0,P.t)("transaction_tags")}),(0,y.jsx)(x.Z,{spacing:2,mt:2,children:(0,y.jsxs)(E.Z,{component:"fieldset",children:[(0,y.jsx)(f.Z,{component:"legend",children:(0,P.t)("transaction_tags_des")}),(0,y.jsxs)(x.Z,{direction:"row",flexWrap:"wrap",width:1,children:[t.tags.map((function(e){return(0,y.jsx)(X.Z,{label:e,onDelete:function(){n("tags",t.tags.filter((function(t){return t!==e})))}},e)})),a?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(E.Z,{component:"fieldset",size:"small",style:{width:"200px"},children:(0,y.jsx)($.Z,{size:"small",placeholder:(0,P.t)("tag"),freeSolo:!0,onInputChange:function(e,t){p(t)},onChange:function(e,r){o(!1),p(""),n("tags",[].concat((0,C.Z)(t.tags),[r]))},options:null===v||void 0===v?void 0:v.filter((function(e){return!t.tags.includes(e)})).map((function(e){return e})),renderOption:function(e,t){return(0,y.jsx)(Q.ZP,{dense:!0,secondaryAction:(0,y.jsx)(ee.Z,{onClick:function(e){e.stopPropagation(),Z(v.filter((function(e){return e!==t}))),se.J5.userOrderJournalTags(v.filter((function(e){return e!==t}))).then((function(){h(le.u.setJournalTags(v.filter((function(e){return e!==t}))))}))},children:(0,y.jsx)(ne.Z,{size:18})}),children:(0,y.jsx)(te.Z,{onClick:e.onClick,children:(0,y.jsx)(N.Z,{children:t})})})},renderInput:function(e){return(0,y.jsx)(I.Z,(0,i.Z)((0,i.Z)({},e),{},{label:(0,P.t)("tag"),inputProps:(0,i.Z)((0,i.Z)({},e.inputProps),{},{maxLength:20})}))}})}),(0,y.jsx)(ee.Z,{onClick:function(){o(!1),p("")},children:(0,y.jsx)(ne.Z,{size:18})}),(0,y.jsx)(ee.Z,{onClick:function(){o(!1),p(""),n("tags",[].concat((0,C.Z)(t.tags),[u])),v.includes(u)||(Z([].concat((0,C.Z)(v),[u])),se.J5.userOrderJournalTags([].concat((0,C.Z)(v),[u])).then((function(){h(le.u.setJournalTags([].concat((0,C.Z)(v),[u]))
1)})))},children:(0,y.jsx)(re.Z,{size:18})})]}):(0,y.jsx)(ee.Z,{onClick:function(){o(!0)},children:(0,y.jsx)(W.Z,{size:18})})]})]})})]})},oe=n(90842),ce=function(e){var t=e.open,n=e.onClose,x=e.id,f=e.price,h=e.marketType,g=void 0===h?u.IH.Spot:h,j=(0,m.Z)(),v=(0,oe.Ds)().enqueueSnackbar,Z=(0,Y.useState)({entry_reasons:[],env_conditions:p.n.TRADING_ENVIRONMENT_CONDITIONS[0],trade_type:p.n.TRADING_TYPE[0],dominant_sense:p.n.DOMINANT_SENSE[0],sense_sensitivity:0,sl:null,tp:[],tags:[],result_status:p.K.STATUS[0],failure_reasons:[],entry_spent_time:p.n.SPENT_TIME[0],entry_desc:"",exit_desc:"",result_desc:"",estimated_exit_time:null}),_=(0,s.Z)(Z,2),b=_[0],k=_[1],N=(0,Y.useState)(!1),w=(0,s.Z)(N,2),C=w[0],E=w[1],D=(0,Y.useState)(!0),R=(0,s.Z)(D,2),L=R[0],O=R[1],z=(0,l.Z)(j.breakpoints.down("sm"));(0,Y.useEffect)((function(){O(!0),se.J5.getOrderJournal(g,x,window.location.pathname.includes(u.mD.SHARE.TRADES)).then((function(e){var t={};Object.keys(e).map((function(n){(e[n]||void 0===b[n])&&(t[n]=e[n])})),k((0,i.Z)((0,i.Z)({},b),t)),O(!1)})),T.ZP.event({category:"open_journal",action:"open_journal"})}),[x]);var I=function(e,t){k((0,i.Z)((0,i.Z)({},b),{},(0,r.Z)({},e,t)))};return(0,y.jsxs)(a.Z,{open:t,onClose:n,maxWidth:"800px",dir:j.direction,fullScreen:z,children:[(0,y.jsx)(S.Z,{title:(0,P.t)("journal"),handleClose:n}),(0,y.jsxs)(o.Z,{sx:{mt:1},children:[(0,y.jsx)(ae,{data:b,setData:I,loading:L}),(0,y.jsx)(M,{data:b,setData:I,loading:L}),(0,y.jsx)(G,{price:f,data:b,setData:I,loading:L}),(0,y.jsx)(V,{data:b,setData:I,loading:L}),null!==b&&void 0!==b&&b.onchain_n_count||null!==b&&void 0!==b&&b.technical_n_count||null!==b&&void 0!==b&&b.onchain_p_count||null!==b&&void 0!==b&&b.technical_p_count?(0,y.jsx)(A,{data:b}):null]}),(0,y.jsx)(c.Z,{sx:{px:2},children:!window.location.pathname.includes(u.mD.SHARE.TRADES)&&(0,y.jsx)(d.Z,{variant:"contained",sx:{minWidth:100},onClick:function(e){E(!0),se.J5.postOrderJournal(g,x,b).then((function(e){v((0,P.t)("journal_successfully_updated"),{variant:"success"}),n(),E(!1)})).catch((function(e){v((0,P.t)("error_occurred"),{variant:"error"}),E(!1)}))},disabled:C,children:(0,P.t)("update")})})]})}},26622:function(e,t,n){n.d(t,{Z:function(){return j}});var r=n(1413),i=n(29439),s=n(1550),l=n(15103),a=n(49914),o=n(15480),c=n(41727),d=n(19860),u=n(23885),p=n(47313),m=n(32261),x=n(29864),f=n(92075),h=n(46417),g=function(e){var t=e.value,n=e.onChange,r=e.ep,d=e.position,m=e.type,x=e.label,f=e.leverage,g=e.liq,j=(0,p.useState)(t||""),v=(0,i.Z)(j,2),Z=v[0],_=v[1],b="long"===d?1:-1,y=(Z||0)*b,k=!!Z&&("tp"===m?y<r*b:y<=g*b||y>r*b);return(0,p.useEffect)((function(){return _(t||""),function(){_("")}}),[t]),(0,h.jsxs)("div",{className:"flex gap-1",children:[(0,h.jsxs)(s.Z,{fullWidth:!0,children:[(0,h.jsx)(l.Z,{htmlFor:"outlined-adornment-email-login",children:x}),(0,h.jsx)(a.Z,{onChange:function(e){_(parseFloat(e.target.value)),null===n||void 0===n||n(parseFloat(e.target.value))},label:x,type:"number",error:k,value:Z,sx:{width:1}}),k?(0,h.jsx)(o.Z,{error:!0,children:(0,u.t)("tp"===m?"long"===d?"invalidLongTp":"invalidShortTp":"long"===d?"invalidLongSl":"invalidShortSl")}):null]}),(0,h.jsxs)(s.Z,{children:[(0,h.jsx)(l.Z,{htmlFor:"outlined-adornment-email-login",children:(0,u.t)("percent")}),(0,h.jsx)(a.Z,{onChange:function(e){var t=Number(e.target.value)*r/(100*b*f)+r;_(t),null===n||void 0===n||n(t)},placeholder:"",label:(0,u.t)("percent"),type:"number",error:k,readOnly:!0,value:Z?(b*((Z||0)-r)*100*f/r).toFixed(2):"",sx:{width:1},inputProps:{dir:"ltr"},endAdornment:(0,h.jsx)(c.Z,{position:"end",children:"%"})},r)]})]})};function j(e){var t=e.open,n=e.onClose,s=e.onSetTpSl,l=e.order,a=((0,d.Z)(),(0,m.n)((function(e){return e.marketData.marketsPrice}))),o=(0,p.useState)({tp:l.tp||0,sl:l.sl||0}),c=(0,i.Z)(o,2),j=c[0],v=c[1];(0,p.useEffect)((function(){return v({tp:l.tp||0,sl:l.sl||0}),function(){v({tp:0,sl:0})}}),[t,l.tp,l.sl]);var Z=function(){null===n||void 0===n||n()};return(0,h.jsx)(x.Z,{children:(0,h.jsx)(f.Z,{title:(0,u.t)("setTpAndSl"),open:t,onClose:n,classNames:{wrapper:"w-[600px]",content:"!"},actions:[{children:(0,u.t)("cancel"),color:"secondary",variant:"outlined",onClick:Z,sx:{flex:1}},{children:(0,u.t)("confirm"),color:"primary",variant:"contained",onClick:function(){null===s||void 0===s||s(j),Z()},sx:{flex:1}}],children:(0,h.jsxs)("div",{className:"space-y-4",children:[(0,h.jsxs)("div",{className:"bg-primary-main px-4 pt-4 pb-2 roun
1ded-lg bg-opacity-10 space-y-2",children:[(0,h.jsxs)("p",{className:"font-medium",dir:"ltr",children:[l.market," ",l.position," ",l.leverage,"X"]}),(0,h.jsxs)("div",{className:"grid grid-cols-3",children:[(0,h.jsxs)("div",{className:"flex flex-col items-center",children:[(0,h.jsx)("p",{className:"opacity-40 text-sm",children:(0,u.t)("order.price")}),(0,h.jsx)("p",{className:"font-medium",children:l.price||"--"})]}),(0,h.jsxs)("div",{className:"flex flex-col items-center",children:[(0,h.jsx)("p",{className:"opacity-40 text-sm",children:(0,u.t)("manners.Market")}),(0,h.jsx)("p",{className:"font-medium",children:a[l.market]||"--"})]}),(0,h.jsxs)("div",{className:"flex flex-col items-center",children:[(0,h.jsx)("p",{className:"opacity-40 text-sm",children:(0,u.t)("order.liqPrice")}),(0,h.jsx)("p",{className:"font-medium",children:l.liq||"--"})]})]})]}),(0,h.jsx)(g,{leverage:l.leverage||1,ep:l.price,liq:l.liq||0,type:"tp",position:l.position||"long",label:(0,u.t)("take_profit"),onChange:function(e){return v((function(t){return(0,r.Z)((0,r.Z)({},t),{},{tp:e})}))},value:j.tp}),(0,h.jsx)(g,{leverage:l.leverage||1,ep:l.price,liq:l.liq||0,type:"sl",position:l.position||"long",label:(0,u.t)("stop_loss"),onChange:function(e){return v((function(t){return(0,r.Z)((0,r.Z)({},t),{},{sl:e})}))},value:j.sl}),(0,h.jsx)("p",{children:(0,u.t)("setTpSlDescription")})]})})})}},35569:function(e,t,n){var r=n(74165),i=n(15861),s=n(14224),l=n(93694),a=n(35134),o=n(61043),c=n(87253),d=n(47131),u=n(63585),p=n(31346),m=n(10658),x=n.n(m),f=n(90987),h=n(23885),g=n(47313),j=n(92238),v=n(83322),Z=n(40699),_=n(32261),b=n(74213),y=n(63660),k=n(46632),N=n(14754),w=n(70135),P=n(38912),A=n(92075),S=n(35989),T=n(46417);t.Z=function(e){var t,n=e.open,m=e.onClose,C=e.order,E=e.marketType,D=e.orderType,R=(0,g.useRef)(null),L=(0,_.n)((function(e){return e.user.profile})),O=(0,_.n)((function(e){return e.marketData.marketsPrice})),z=(0,_.n)((function(e){return e.exchange.marketsInfo.markets})),I=(0,g.useMemo)((function(){return Object.keys(Z.YI).filter((function(e){return(0,S.R4)(e).marketType===E}))}),[E]),K=(0,b.I)().getSelected,F=(0,g.useMemo)((function(){return K(I)}),[K,I]),M=null!==F&&void 0!==F&&F.source?(0,S.R4)(F.source).exchange:"binance",q=C?"futures"===E?(0,N.o6)(C,O[C.market]):(0,N.$_)(C,D,O[C.market]):0,J=n?C.position:"",W=n?C.side:"",Y="".concat(L.firstName+""+L.lastName,"-").concat(null===C||void 0===C?void 0:C.market,"-").concat(x()().unix(),".png"),B=function(){var e=(0,i.Z)((0,r.Z)().mark((function e(t){var n;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!R.current){e.next=3;break}return n={cacheBust:!1},e.abrupt("return",(0,f.SE)(R.current,n).then(function(){var e=(0,i.Z)((0,r.Z)().mark((function e(n){var i;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=new File([n],Y,{type:"image/png"}),e.abrupt("return",y.hi.account.uploadUserMedia.post({kind:"pnl_card",media:i}).then((function(e){return t?URL.createObjectURL(i):(0,P.n)(e.media)})));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){return""})));case 3:return e.abrupt("return",Promise.resolve(""));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return(0,T.jsx)(A.Z,{open:n,onClose:m,title:(0,h.t)("shareOrder"),size:"sm",classNames:{content:"flex justify-center"},customAction:(0,T.jsxs)("div",{className:"relative flex w-full items-start justify-center gap-2",children:[(0,T.jsx)(d.Z,{onClick:function(){var e=(0,i.Z)((0,r.Z)().mark((function e(t){var n,i;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),e.next=3,B(!0);case 3:n=e.sent,(i=document.createElement("a")).href=n,i.download=Y,i.classList.add("hidden"),document.body.appendChild(i),i.click(),document.body.removeChild(i);case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),className:"flex h-[35px] w-[35px] items-center justify-center rounded-full bg-primary-dark hover:bg-primary-dark",children:(0,T.jsx)(p.Z,{size:24,className:"stroke-grey-50"})}),(0,T.jsx)(s.Z,{url:B,children:(0,T.jsx)(l.Z,{size:35,round:!0})}),(0,T.jsx)(a.Z,{url:B,children:(0,T.jsx)(o.Z,{size:35,round:!0})}),(0,T.jsx)(c.Z,{url:B,children:(0,T.jsx)(j.b0,{size:35,round:!0})})]}),children:(0,T.jsx)("div",{ref:R,style:{backgroundImage:"url('/images/sh
1areOrderBg.jpg'), linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7))"},className:"aspect-square w-[360px] rounded-lg bg-cover bg-no-repeat bg-blend-multiply",children:(0,T.jsxs)("div",{className:"flex h-full w-full flex-col p-3",children:[(0,T.jsxs)("div",{className:"flex items-center justify-between",children:[(0,T.jsx)("div",{className:"w-[150px]",children:(0,T.jsx)(v.Z,{mode:"light"})}),(0,T.jsxs)("div",{className:"flex items-center gap-1",children:[(0,T.jsx)("div",{className:"mt-1 text-lg font-semibold text-grey-400",children:M.charAt(0).toUpperCase()+(null===M||void 0===M?void 0:M.slice(1))}),(0,T.jsx)(u.Z,{src:null===(t=Z.rJ[M])||void 0===t?void 0:t.logo,sx:{width:22,height:22,background:"transparent"}})]})]}),C?(0,T.jsxs)("div",{className:"flex flex-1 flex-col items-start justify-center gap-4 px-3",children:[(0,T.jsxs)("div",{className:"flex items-center gap-3 text-2xl font-medium text-grey-100",children:[(0,T.jsx)("div",{children:C.market}),(0,T.jsx)("span",{className:"h-[60%] w-[1px] bg-grey-800"}),(0,T.jsx)("div",{className:"buy"===W||"long"===J?"text-primary-main":"text-secondary-main",children:"current"===D?Boolean(J)?(0,h.t)(J):(0,h.t)(W):Boolean(J)?(0,h.t)(("buy"===W?"open":"close")+"_"+J):(0,h.t)(W)}),(0,T.jsx)("span",{className:"h-[60%] w-[1px] bg-grey-800"}),(0,T.jsx)("div",{children:C.leverage+"X"})]}),(0,T.jsxs)("div",{dir:"ltr",className:"".concat(q>0?"text-success-main":"text-error-main"," text-5xl font-semibold"),children:[(0,k.xu)(null===q||void 0===q?void 0:q.toFixed(2)),"%"]}),(0,T.jsxs)("div",{className:"flex flex-col gap-2 text-base text-grey-500",children:[(0,T.jsxs)("div",{className:"flex items-center gap-4",children:["current"===D?(0,h.t)("market_price"):(0,h.t)("close_price"),(0,T.jsx)("span",{className:"text-grey-400",children:"current"===D?(0,k.xu)(O[C.market].toFixed(z[C.market].exponent)):"futures"===E?(0,k.xu)(C.closePrice.toFixed(z[C.market].exponent)):(0,k.xu)((C.price||C.avgPrice).toFixed(z[C.market].exponent))})]}),(0,T.jsxs)("div",{className:"flex items-center gap-4",children:[(0,h.t)("entry_price"),(0,T.jsx)("span",{className:"text-grey-400",dir:"ltr",children:"futures"===E?(0,k.xu)((C.price||C.avgPrice).toFixed(z[C.market].exponent)):"~ "+(0,k.xu)(((C.price||C.avgPrice)*(100-("long"===C.position?1:-1)*q/C.leverage)/100).toFixed(z[C.market].exponent))})]})]})]}):null,(0,T.jsxs)("div",{className:"flex items-center justify-between",children:[(0,T.jsx)("div",{className:"flex items-center gap-2",children:(0,T.jsxs)("div",{className:"flex flex-col text-sm",children:[(0,T.jsx)("div",{className:"text-grey-100",children:(0,w.of)(L.email||"")}),(0,T.jsx)("div",{className:"text-grey-500",children:x()().format("MM/DD HH:mm")})]})}),(0,T.jsxs)("div",{className:"flex flex-col items-end text-sm",children:[(0,T.jsx)("div",{className:"text-grey-500",children:(0,h.t)("invitation_code")}),(0,T.jsx)("div",{className:"text-grey-100",children:L.invite.code})]})]})]})})})}},56261:function(e,t,n){var r=n(93433),i=n(1413),s=n(17376),l=n(10658),a=n.n(l),o=n(23885),c=n(47313),d=n(10530),u=n(14417),p=n(57575),m=n(10199),x=n(46417),f=function(e){var t=e.rowsPerPage,n=e.headersLength,i=e.hasDate,l=e.editable,a=e.removable,o=e.actions,c=void 0===o?[]:o;return(0,r.Z)(Array(t)).map((function(e,t){return(0,x.jsxs)("div",{className:"flex flex-col gap-2 pt-2",children:[(0,x.jsxs)("div",{className:"flex items-center justify-between",children:[(0,x.jsxs)("div",{className:"flex items-center gap-2",children:[(0,x.jsx)(p.Z,{className:"w-16"}),(0,x.jsx)(p.Z,{className:"w-8"})]}),i?(0,x.jsx)(p.Z,{className:"w-24"}):null]}),(0,r.Z)(Array(n)).map((function(e,t){return(0,x.jsxs)("div",{className:"flex items-center justify-between",children:[(0,x.jsx)(p.Z,{}),(0,x.jsx)(p.Z,{})]},t)})),(0,x.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[c.map((function(e,t){return(0,x.jsx)(u.Z,{disabled:!0,children:(0,x.jsx)(e.icon,{size:20})},t)})),l?(0,x.jsx)("div",{className:"animate-pulse",children:(0,x.jsx)(u.Z,{disabled:!0,children:(0,x.jsx)(s.Z,{size:20})})}):null,a?(0,x.jsx)("div",{className:"animate-pulse",children:(0,x.jsx)(d.Z,{disabled:!0,size:20})}):null]})]},t)}))};t.Z=function(e){var t=e.headers,n=e.renderRow,r=e.rows,l=e.loading,h=void 0!==l&&l,g=e.onRemove,j=e.deleteButtonProps,v=e.onEdit,Z=e.rowsPerPage,_=void 0===Z?8:Z,b=e.marketType,y=e.orderType,k=e.actions,N=void 0===k?[]:k,w=(0,c.useMemo)((function(){return t.filter((function(e){return"date"===e.id})).length>0}),[t]);return h?(0,x.jsx)(f,{rowsPerPage:_,headersLength:t.length,hasDate:w,removable:Boolean(g),editable:Boolean(v),actions:N}):r.map((function(e,r){var l,c;return(0,x.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg bg-background-main p-2",children:[(0,x.jsxs)("div",{className:"flex items-center justify-between",children:[(0,x.jsxs)("div",{className:"flex items-center gap-2",children:[h?(0,x.jsx)(p.Z,{className:"w-16"}):(0,x.jsx)("p",{className:"mt-1 font-medium",children:e.market}),h?(0,x.jsx)(p.Z,{className:"w-8"}):(0,x.jsxs)("div",{className:"flex items-center gap-1 ",children:[(0,x.jsx)("p",{children:"spot"!==b?e.leverage+"X":""}),(0,x.jsxs)("p",{className:"rounded-sm px-1 text-xs ".concat("buy"===e.side?"bg-primary-50 text-primary-dark":"bg-secondary-50 text-secondary-dark","\n "),children:["perpetual"===b?"current"===y?(0,o.t)(null===(l=e.position)||void 0===l?void 0:l.toString()):(0,o.t)(e.kind+"_"+e.position):(0,o.t)(null===(c=e.side)||void 0===c?void 0:c.toString())," "]})]})]}),w?(0,x.jsx)("p",{dir:"ltr",className:"text-xs",children:a()(e.date).format("YYYY/MM/DD, HH:mm:ss")}):null]}),t.filter((function(e){return"date"!==e.id&&"detail"!==e.id&&"market"!==e.id}
1)).map((function(t){return(0,x.jsx)(m.Z,{header:(0,o.t)(t.title),value:n(t.id,e)},t.id)})),(0,x.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[N.map((function(t,n){var r;return null!==(r=t.hidden)&&void 0!==r&&r.call(t,e.id)?null:(0,x.jsx)(u.Z,{onClick:function(){return t.onClick(e.id)},children:(0,x.jsx)(t.icon,{size:20,className:"text-grey-700"})},n)})),v?(0,x.jsx)(u.Z,{onClick:function(){return v(e.id)},children:(0,x.jsx)(s.Z,{size:20})}):null,g?(0,x.jsx)(d.Z,(0,i.Z)((0,i.Z)({size:20,sureText:(null===j||void 0===j?void 0:j.sureText)||""},j),{},{onAgree:function(){return g(e.id)}})):null]})]},r)}))}}}]);
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.