PageSourceSearch

https://www.xstable.ai/_next/static/chunks/1822.0c78e113da80820b.js

js xstable.ai collected 2026-10-05 14:38:22 UTC 128,876 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1822],{2250:(e,t,l)=>{l.d(t,{B:()=>r,N:()=>n});var a=l(76273);function r(e){if(null==e||""===e)return!1;let t=Number(e);return Number.isFinite(t)&&0!==t}function n(e,t,l){let n=(0,a.gF)(e,t);return r(l)?(0,a.gF)(n,null!=l?l:0):n}},6033:(e,t,l)=>{l.d(t,{A:()=>s});var a,r=l(20801);function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let s=function(e){return r.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none"},e),a||(a=r.createElement("path",{fill:"currentColor",d:"M12 6a2 2 0 1 0-1.985-1.753L5.388 6.56a2 2 0 1 0 0 2.88l4.627 2.313Q10 11.873 10 12a2 2 0 1 0 .612-1.44L5.985 8.247a2 2 0 0 0 0-.494l4.627-2.313c.36.347.849.56 1.388.56"})))}},12565:(e,t,l)=>{l.d(t,{cn:()=>n});var a=l(1631),r=l(69203);function n(){for(var e=arguments.length,t=Array(e),l=0;l<e;l++)t[l]=arguments[l];return(0,r.QP)((0,a.$)(t))}},26124:(e,t,l)=>{l.d(t,{A:()=>s});var a,r=l(20801);function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let s=function(e){return r.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",width:6,height:10,fill:"none"},e),a||(a=r.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M.228 9.782a.72.72 0 0 1 0-1.053L4.122 5 .228 1.271a.72.72 0 0 1 0-1.053.8.8 0 0 1 1.1 0l4.444 4.255a.72.72 0 0 1 0 1.054L1.328 9.782a.8.8 0 0 1-1.1 0",clipRule:"evenodd"})))}},27442:(e,t,l)=>{l.r(t),l.d(t,{default:()=>le});var a,r,n,s,i,c,o,d,x,u,m,h,p,f,g,v,b,j,y,N,w,A,k,E,_,S,C,P,M,U,z,T,R,D=l(80069),I=l(12007),O=l(95702),V=l(75395),H=l(20801),L=l(70140);function B(){return(B=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let F=function(e){return H.createElement("svg",B({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},e),a||(a=H.createElement("path",{fill:"currentColor",d:"M12 23c6.075 0 11-4.925 11-11S18.075 1 12 1 1 5.925 1 12s4.925 11 11 11M8.818 7.403 12 10.586l3.182-3.182 1.414 1.414L13.414 12l3.182 3.182-1.415 1.414L12 13.414l-3.182 3.182-1.415-1.414L10.586 12 7.403 8.818z"})))},G=l.p+"static/media/ic_union.81f5ff26.svg";var q=l(33872),W=l(66926);function X(){return(X=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let Q=function(e){return H.createElement("svg",X({xmlns:"http://www.w3.org/2000/svg",width:6,height:10,fill:"none"},e),r||(r=H.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M5.772 9.782a.72.72 0 0 0 0-1.053L1.878 5l3.894-3.729a.72.72 0 0 0 0-1.053.8.8 0 0 0-1.1 0L.228 4.473a.72.72 0 0 0 0 1.054l4.444 4.255c.304.29.796.29 1.1 0",clipRule:"evenodd"})))};var Y=l(26124),J=l(6560),Z=l(98503),$=l(57684),K=l(81430),ee=l(63764),et=l(34733);let el=H.memo(e=>{let{token:t,index:l,onSelect:a}=e,{t:r}=(0,W.Bd)(),n=(0,$.e0)(e=>{var l,a;return null!=(a=null==(l=e.symbolStatusMap[t.symbol])?void 0:l.showOffHour)&&a}),s=(0,H.useCallback)(()=>{(0,Z.$s)(Z.De,{symbol:t.symbol}),a(t)},[t,a]);return(0,D.jsxs)("div",{className:"flex shrink-0 flex-row items-center cursor-pointer",onClick:s,children:[0!==l&&(0,D.jsx)("div",{className:"flex w-[1px] h-4 bg-border-color ml-4.5"}),(0,D.jsx)("div",{className:"".concat(0!==l?"ml-3":""),children:(0,D.jsx)(J.A,{className:"w-4 h-4 shrink-1",image:t.imageUrl,width:16,height:16,name:t.name,symbol:t.symbol})}),(0,D.jsx)("span",{className:"ml-1.5 text-text-dark text-[12px] whitespace-nowrap font-medium",children:"".concat(t.name," ").concat(t.symbol)}),(0,D.jsx)("span",{className:"ml-1.5 text-[12px] whitespace-nowrap font-medium ".concat(n?"text-text-light":t.changePercent>
10?"text-[#2ebd85]":"text-[#E43C5A]"),children:n?r("trade.closed"):t.changePercent>0?"+".concat((0,et.hE)(t.changePercent),"%"):"".concat((0,et.hE)(t.changePercent),"%")})]})},function(e,t){if(e.index!==t.index||e.onSelect!==t.onSelect)return!1;let l=e.token,a=t.token;return l.symbol===a.symbol&&l.name===a.name&&l.imageUrl===a.imageUrl&&l.changePercent===a.changePercent});el.displayName="TokenItem";let ea=H.memo(e=>{let{callback:t}=e,l=(0,K.WG)(e=>e.tokenListDisplay),a=(0,H.useRef)(t),r=(0,H.useRef)(null),n=(0,H.useRef)(null),[s,i]=(0,H.useState)(!1),[c,o]=(0,H.useState)(!1),d=(0,H.useCallback)(()=>{let e=r.current;if(!e)return;let t=e.scrollWidth-e.clientWidth;i(e.scrollLeft>1),o(e.scrollLeft<t-1)},[]);(0,H.useEffect)(()=>{a.current=t},[t]);let x=(0,H.useCallback)(e=>{var t;let l=null!=(t=K.WG.getState().tokenMap[e.symbol])?t:e;(0,ee.vj)(l),a.current(l)},[]),u=(0,H.useCallback)(e=>{var t;let l=r.current,a=null==(t=n.current)?void 0:t.children[0];l&&a&&l.scrollBy({left:a.getBoundingClientRect().width*e,behavior:"smooth"})},[]);return((0,H.useEffect)(()=>{let e=window.requestAnimationFrame(d);return window.addEventListener("resize",d),()=>{window.cancelAnimationFrame(e),window.removeEventListener("resize",d)}},[null==l?void 0:l.length,d]),null==l?void 0:l.length)?(0,D.jsxs)("div",{className:"relative w-[calc(100vw-24px)] ml-3",children:[s&&(0,D.jsx)("div",{className:"absolute left-0 top-1/2 z-10 flex h-8 w-5 -translate-y-1/2 items-center justify-center rounded-[4px] bg-withdraw-button-color/90 text-text-dark shadow cursor-pointer select-none",onClick:()=>u(-1),children:(0,D.jsx)(Q,{className:"text-text-dark"})}),(0,D.jsx)("div",{ref:r,className:"overflow-x-auto scrollbar-none",onScroll:d,children:(0,D.jsx)("div",{ref:n,className:"flex items-center w-full h-10 py-2.5",children:l.map((e,t)=>(0,D.jsx)(el,{token:e,index:t,onSelect:x},e.symbol))})}),c&&(0,D.jsx)("div",{className:"absolute right-0 top-1/2 z-10 flex h-8 w-5 -translate-y-1/2 items-center justify-center rounded-[4px] bg-withdraw-button-color/90 text-text-dark shadow cursor-pointer select-none",onClick:()=>u(1),children:(0,D.jsx)(Y.A,{className:"text-text-dark"})})]}):(0,D.jsx)("div",{className:"w-screen overflow-x-auto",children:(0,D.jsx)("div",{className:"flex items-center w-full h-10 py-2.5"})})});ea.displayName="HorizontalTokenList";var er=l(83046),en=l(17268),es=l(85087);function ei(){return(ei=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let ec=function(e){return H.createElement("svg",ei({xmlns:"http://www.w3.org/2000/svg",width:14,height:14,fill:"none"},e),n||(n=H.createElement("path",{fill:"currentColor",d:"M9.513 7.651a.8.8 0 0 0 0-1.21L5.535 2.998A.8.8 0 0 0 4.21 3.6v6.89a.8.8 0 0 0 1.324.605z"})))};var eo=l(22505);function ed(){return(ed=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let ex=function(e){return H.createElement("svg",ed({xmlns:"http://www.w3.org/2000/svg",width:8,height:4,fill:"none"},e),s||(s=H.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M.174.152a.66.66 0 0 1 .843 0L4 2.748 6.983.152a.66.66 0 0 1 .843 0 .472.472 0 0 1 0 .733L4.42 3.848a.66.66 0 0 1-.842 0L.174.885a.472.472 0 0 1 0-.733",clipRule:"evenodd"})))};function eu(){return(eu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let em=function(e){return H.createElement("svg",eu({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,fill:"none"},e),i||(i=H.createElement("path",{fill:"#6C757D",d:"M2.654 1c.2 0 .394.08.536.22l1.897 1.888a.75.75 0 0 1 0 1.065.76.76 0 0 1-1.07 0L3.41 3.57v6.677a.755.755 0 0 1-.756.753.756.756 0 0 1-.757-.753V3.571l-.605.602a.76.76 0 0 1-1.07 0 .75.75 0 0 1 0-1.065l1.897-1.887A.76.76 0 0 1 2.654 1M7.345 1c.418 0 .757.337.757.753V8.43l.606-.603a.76.76 0 0 1 1.07 0 .75.75 0 0 1 0 1.065L7.882 10.78a.76.76 0 0 1-1.072 0L4.913 8.892a.75.75 0 0 1 0-1.065.76.76 0 0 1 1.07 0l.606.602V1.753c0-.416.339-.753.756-.753"})))},eh=e=>{let t=Math.max(1,Math.ceil(e/6e4));return"".concat(Math.floor(t/60).toString().padStart(2,"0"),":").concat((t%60).toString().padStart(2,"0"))},ep=H.memo(e=>{var t,l;let{symbol:a,closedOnly:r=!1,compact:n=!1,className:s="",onDone:i}=e,{t:c}=(0,W.Bd)(),o=(0,$.e0)(e=>e.symbolStatusMap[a]),[d,x]=(0,H.useState)(()=>(0,et.mI)()),u=(0,H.useRef)(0),m=null!=(l=null==o?void 0:o.showOffHour)&&l,h=null==o||null==(t=o.marketClosedDay)?void 0:t.closedRange,p=(0,H.useMemo)(()=>{var e;let t=(h||[]).map(e=>({start:new Date("".concat(e.start,"Z")).getTime(),end:new Date("".concat(e.end,"Z")).getTime()})),l=t.find(e=>d>=e.start&&d<=e.end);return l?l.end:m?0:(null==(e=t.filter(e=>e.start>d).sort((e,t)=>
1e.start-t.start)[0])?void 0:e.start)||0},[m,d,h]);if((0,H.useEffect)(()=>{let e=setInterval(()=>x((0,et.mI)()),1e3),t=setInterval(()=>{(0,$.tE)()},6e4);return()=>{clearInterval(e),clearInterval(t)}},[]),(0,H.useEffect)(()=>{p&&d>=p&&u.current!==p&&(u.current=p,null==i||i())},[d,i,p]),!p||r&&!m)return null;let f=p-d;if(f<=0)return null;let g=c(m?"trade.time_to_open":"trade.time_to_close");return n?(0,D.jsx)("div",{className:"flex h-5 shrink-0 items-center rounded-[10px] bg-segment-background px-2 ".concat(s),children:(0,D.jsx)("span",{className:"text-xs font-normal leading-4 text-text-light",children:"".concat(g," ").concat(eh(f))})}):r?(0,D.jsxs)("div",{className:"flex h-5 w-full items-center justify-center gap-1 ".concat(s),children:[(0,D.jsx)("span",{className:"text-[13px] font-normal leading-[13px] text-text-light",children:g}),(0,D.jsx)("span",{className:"text-[13px] font-normal leading-[13px] text-text-dark",children:eh(f)})]}):(0,D.jsxs)("div",{className:"flex w-[114px] flex-col justify-center ".concat(s),children:[(0,D.jsx)("span",{className:"text-[13px] text-text-light",children:g}),(0,D.jsx)("span",{className:"text-[13px] font-medium text-text-dark",children:eh(f)})]})});var ef=l(72146),eg=l(99065);function ev(){return(ev=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let eb=function(e){return H.createElement("svg",ev({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},e),c||(c=H.createElement("rect",{width:24,height:24,fill:"currentColor",className:"ic_trade_balance_add_svg__path1",rx:6})),o||(o=H.createElement("path",{fill:"currentColor",d:"M12 6a1 1 0 0 1 1 1v4h4a1 1 0 1 1 0 2h-4v4a1 1 0 1 1-2 0v-4H7a1 1 0 1 1 0-2h4V7a1 1 0 0 1 1-1",className:"ic_trade_balance_add_svg__path2"})))};var ej=l(76055),ey=l(57454),eN=l(76273);let ew=e=>{let t=e||void 0,l=(0,ey.wt)(t);return l&&"CARD"!==l?(0,ey.Aq)(t):0},eA=e=>{let{availableBalance:t,userInfo:l,useBonus:a}=e;return 0!==t&&a?Math.min(t,ew(l)):0},ek=e=>{let{availableBalance:t,userInfo:l,useBonus:a}=e;if(0===t)return 0;let r=eA({availableBalance:t,userInfo:l,useBonus:a});return 0===r?t:Number((0,eN.gF)(t,r))},eE=e=>{let{useBonus:t,marginMode:l}=e,{t:a}=(0,W.Bd)(),{showActiveCodeDialog:r,showDepositDialog:n,showSelectWalletDialog:s}=(0,ej.s)(),i=(0,ey.kH)(e=>e.userInfo),c=(0,ey.kH)(e=>e.crossAvailableBalance),o=(0,ey.kH)(e=>e.isolatedAvailableBalance),d="cross"===l?c:o,x=eA({availableBalance:d,userInfo:i,useBonus:t}),u=ek({availableBalance:d,userInfo:i,useBonus:t}),m=ew(i);return(0,D.jsxs)("div",{className:"flex w-full items-center",children:[(0,D.jsx)("span",{className:"text-sm md:text-xs text-text-light underline decoration-dotted balance-tip",children:a("trade.available_text")}),(0,D.jsxs)("div",{className:"flex items-center ml-auto gap-2.5",children:[(0,D.jsx)("span",{className:"text-sm md:text-xs font-semibold text-text-dark",children:i?"".concat((0,et.tu)(u)," USD"):"0 USD"}),!(0,ey.Iv)()&&(0,D.jsx)(eb,{className:"cursor-pointer fill-current text-add-balance-content",onClick:()=>{if(i){if(!i.isActive)return void r();n(!i.accountAddress)}else s()}})]}),(0,D.jsx)(eg.m,{target:".balance-tip",position:"top",pt:{root:{className:"w-[264px]"}},children:(0,D.jsxs)("div",{className:"flex flex-col font-medium text-[12px] gap-2",children:[(0,D.jsx)("div",{children:a("trade.available_source")}),(0,D.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,D.jsxs)("div",{className:"flex justify-between items-center",children:[(0,D.jsx)("div",{children:a("assets.available_balance")}),(0,D.jsx)("div",{className:"ml-auto font-semibold",children:i?"".concat((0,et.tu)(d)," USD"):"0 USD"})]}),(0,D.jsxs)("div",{className:"flex justify-between items-center",children:[(0,D.jsx)("div",{children:a("trade.available_trial_funds")}),(0,D.jsx)("div",{className:"ml-auto font-semibold",children:"".concat((0,et.tu)(x)," USD")})]}),(0,D.jsxs)("div",{className:"flex justify-between items-center",children:[(0,D.jsx)("div",{children:a("trade.trial_fund_remaining_balance")}),(0,D.jsx)("div",{className:"ml-auto font-semibold",children:"".concat((0,et.tu)(m)," USD")}
1)]})]}),(0,D.jsx)("div",{className:"w-full h-[1px] border-t border-panel-border-color border-dashed"}),(0,D.jsx)("div",{children:a("trade.trial_funds_tip_hint")})]})})]})},e_=e=>{let{label:t,value:l,tipClass:a,tip:r}=e;return(0,D.jsxs)("div",{className:"flex items-center justify-between text-sm md:text-xs",children:[(0,D.jsxs)("div",{className:"flex items-center",children:[r&&a&&(0,D.jsx)(eg.m,{target:".".concat(a),position:"top",content:r,pt:{root:{className:"w-[264px]"}}}),(0,D.jsx)("span",{className:"text-text-light ".concat(a?"".concat(a," underline decoration-dotted"):""),children:t})]}),(0,D.jsx)("span",{className:"text-right font-medium text-text-dark",children:l})]})},eS=()=>{var e,t;let{t:l}=(0,W.Bd)(),a=(0,ey.kH)(e=>e.isLogined),r=(0,ey.kH)(e=>e.totalBalance),n=(0,ey.kH)(e=>{var t;return(null==(t=e.userInfo)?void 0:t.unRealizedPnl)||0}),s=(0,K.WG)(e=>e.crossContractInfo),i=null!=(e=null==s?void 0:s.unrealizedPnl)?e:n,c=null!=(t=null==s?void 0:s.crossRiskEquity)?t:r,o=e=>(0,et.hE)(e||0,2,!0,"floor");return(0,H.useEffect)(()=>{a&&(0,K.eG)()},[a]),(0,D.jsxs)("div",{className:"mt-4 flex w-full flex-col pb-15 md:pb-18 gap-3",children:[(0,D.jsx)(e_,{label:l("trade.total_equity"),tip:l("trade.equity_tips"),tipClass:"trade-total-equity-tip",value:a?o(c):"0.00"}),(0,D.jsx)(e_,{label:l("trade.unrealized_pnl"),value:a?o(i):"0.00"})]})},eC=e=>{let{symbol:t,type:l,selectSegment:a,onSegmentChange:r}=e,{t:n}=(0,W.Bd)(),s=(0,K.WG)(e=>e.tokenMap[t]),{registerStep:i}=(0,q.Z)(),c=(0,H.useCallback)(e=>{i("step2",e)},[i]),o=[n("trade.buy_long"),n("trade.sell_short")],d=(0,et.hE)((null==s?void 0:s.longPrice)||0,null==s?void 0:s.pricePrecision,!0,"round"),x=(0,et.hE)((null==s?void 0:s.shortPrice)||0,null==s?void 0:s.pricePrecision,!0,"round"),u=[d,x];return(0,D.jsx)(D.Fragment,{children:0===l?(0,D.jsxs)("div",{ref:c,className:"flex w-full flex-shrink-0 py-2.5 px-4 gap-2.5 border-t border-border-color md:border-panel-border-color",children:[(0,D.jsxs)("div",{className:"h-12 flex flex-col items-center justify-center flex-1 bg-[#2EBD85] rounded-[10px] text-white guide-click-area",onClick:()=>r(0),role:"button",tabIndex:0,children:[(0,D.jsx)("span",{className:"text-xs md:text-[15px] leading-5",children:n("trade.buy_long")}),(0,D.jsx)("span",{className:"text-base leading-5 font-semibold",children:d})]}),(0,D.jsxs)("div",{className:"h-12 flex flex-col items-center justify-center flex-1 bg-[#E43C5A] rounded-[10px] text-white guide-click-area",onClick:()=>r(1),role:"button",tabIndex:0,children:[(0,D.jsx)("span",{className:"text-xs md:text-[15px] leading-5",children:n("trade.sell_short")}),(0,D.jsx)("span",{className:"text-base leading-5 font-semibold",children:x})]})]}):(0,D.jsx)("div",{ref:c,className:"mt-2 flex items-center flex-shrink-0",children:(0,D.jsx)("div",{className:"flex items-center w-full h-12.5 p-[3px] bg-segment-background rounded-lg",children:o.map((e,t)=>(0,D.jsxs)("div",{onClick:()=>r(t),className:"guide-click-area cursor-pointer h-11 flex flex-col items-center justify-center flex-1 rounded-[6px] ".concat(a===t?0===a?"text-white bg-[#2ebd85]":"text-white bg-[#E43C5A]":" text-text-light bg-transparent"),children:[(0,D.jsx)("span",{className:"text-xs font-medium",children:e}),(0,D.jsx)("span",{className:"text-[15px] font-semibold leading-4",children:u[t]})]},t))})})})};var eP=l(86294),eM=l(12565);function eU(e){let{className:t,size:l="default",...a}=e;return(0,D.jsx)(eP.bL,{"data-slot":"switch","data-size":l,className:(0,eM.cn)("peer group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80",t),...a,children:(0,D.jsx)(eP.zi,{"data-slot":"switch-thumb",className:(0,eM.cn)("pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0 dar
1k:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground")})})}let ez=e=>{let{useBonus:t,callback:l}=e,{t:a}=(0,W.Bd)(),r=(0,ey.kH)(e=>e.userInfo);return(0,D.jsx)(D.Fragment,{children:(0,ey.Aq)(r)>0&&(0,D.jsx)("div",{className:"flex flex-col mt-3",children:"CARD"===(0,ey.wt)(r)?(0,D.jsxs)("div",{className:"flex items-center text-text-light text-sm md:text-xs whitespace-pre-wrap font-normal",children:[(0,D.jsx)("span",{children:a("trade.card_use_text")}),(0,D.jsx)("span",{className:"text-text-dark font-semibold underline decoration-dotted trade-card-use-tip",children:"".concat((0,et.Ix)((0,ey.Aq)(r))," USD")}),(0,D.jsx)(eg.m,{target:".trade-card-use-tip",position:"top",content:a("trade.card_use_tip"),pt:{root:{className:"w-[264px]"}}})]}):(0,D.jsxs)("div",{className:"flex",children:[(0,D.jsx)("span",{className:"text-sm md:text-xs text-text-light",children:a("trade.use_trial_funds")}),(0,D.jsx)(eU,{className:"ml-auto data-[state=checked]:bg-[#2EBD85] data-[state=unchecked]:bg-voucher-progress-bg-color",checked:t,onCheckedChange:e=>{l(e)}})]})})})};var eT=l(39580),eR=l(47805),eD=l(41886),eI=l(83548),eO=l(42351);let eV=e=>{let{label:t,value:l,tipClass:a,tip:r}=e;return(0,D.jsxs)("div",{className:"flex items-center justify-between text-sm md:text-xs",children:[(0,D.jsxs)("div",{className:"flex items-center",children:[r&&a&&(0,D.jsx)(eg.m,{target:".".concat(a),position:"top",content:r,pt:{root:{className:"w-[264px] whitespace-pre-line"}}}),(0,D.jsx)("span",{className:"text-text-light ".concat(a?"".concat(a," underline decoration-dotted"):""),children:t})]}),(0,D.jsx)("span",{className:"text-right font-medium text-text-dark",children:l})]})},eH=e=>{var t,l;let a,{marginMode:r}=e,{t:n}=(0,W.Bd)(),s=(0,ey.kH)(e=>e.isLogined),i=(0,ey.kH)(e=>e.userInfo),c=(0,ey.kH)(e=>e.crossAvailableBalance),o=(0,ey.kH)(e=>e.isolatedAvailableBalance),d=(0,K.WG)(e=>e.crossContractInfo),x=(null==i?void 0:i.usedMargin)||0,u=e=>(0,et.hE)(e||0,2,!0,"floor"),m=((null==d||null==(t=d.positions)?void 0:t.length)||0)>0||Number((null==d?void 0:d.usedMargin)||x)>0,h=s&&m?(a=(null!=(l=null==d?void 0:d.marginLevel)?l:0)*100,"".concat((0,et.hE)(a||0,2,!0,"floor"),"%")):"--";return(0,D.jsxs)("div",{className:"mt-4 flex w-full flex-col gap-3",children:[(0,D.jsx)(eV,{label:n("trade.margin_ratio"),tip:n("trade.margin_ratio_tip"),tipClass:"trade-margin-ratio-tip",value:h}),(0,D.jsx)(eV,{label:n("trade.available_margin"),tip:n("trade.available_margin_tip"),tipClass:"trade-available-margin-tip",value:s?"".concat(u("cross"===r?c:o)," USD"):"0.00 USD"}),(0,D.jsx)(eV,{label:n("trade.occupied_margin"),tip:n("trade.occupied_margin_tip"),tipClass:"trade-occupied-margin-tip",value:s?"".concat(u(x)," USD"):"0.00 USD"})]})};function eL(){return(eL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let eB=function(e){return H.createElement("svg",eL({xmlns:"http://www.w3.org/2000/svg",width:14,height:14,fill:"none"},e),d||(d=H.createElement("path",{fill:"currentColor",d:"M7 0a1 1 0 0 1 1 1v5h5a1 1 0 1 1 0 2H8v5a1 1 0 1 1-2 0V8H1a1 1 0 0 1 0-2h5V1a1 1 0 0 1 1-1"})))};function eF(){return(eF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let eG=function(e){return H.createElement("svg",eF({xmlns:"http://www.w3.org/2000/svg",width:14,height:2,fill:"none"},e),x||(x=H.createElement("rect",{width:14,height:2,fill:"currentColor",rx:1})))};function eq(e){let{onShortPress:t,onLongPressRepeat:l,delay:a=300,interval:r=80}=e,n=(0,H.useRef)(!1),s=(0,H.useRef)(!1),i=(0,H.useRef)(null),c=(0,H.useRef)(null),o=(0,H.useCallback)(()=>{s.current=!0,n.current=!1,i.current=setTimeout(()=>{s.current&&(n.current=!0,l(),c.current=setInterval(()=>{l()},r))},a)},[a,r,l]),d=(0,H.useCallback)(()=>{s.current&&(s.current=!1,clearTimeout(i.current),clearInterval(c.current),!n.current&&t&&t())},[t]);return{onPointerDown:o,onPointerUp:d,onPointerLeave:d}}let eW=e=>{let{limitPrice:t,limitPriceInputError:l,showSwapLoading:a,tokenInfo:r,callback:n}=e,{t:s}=(0,W.Bd)(),i=(0,H.useRef)(t);i.current=t;let c=e=>{let t=i.current;if(!t)return;let l=r?r.pricePrecision:2,a=new en.A(10).pow(l),s=new en.A(1).div(a),c=new en.A(t),o=(c=1===e?c.plus(s):c.minus(s)).toFixed(l);o!==t&&(i.current=o,n(o))},o=eq({onShortPress:()=>{c(1)},onLongPressRepeat:()=>{c(1)},delay:300,interval:80}),d=eq({onShortPress:()=>{c(2)},onLongPressRepeat:()=>{c(2)},delay:300,interval:80});return(0,D.jsxs)("div",{className:"flex flex-col mt-3",children:[(0,D.jsx)("div",{className:"text-sm md:text-xs text-text-light",children:s("trade.limit_price_text")}),(0,D.jsxs)("div",{className:"flex items-center gap-3 mt-4",children:[(0,D.jsx)("div",{className:"flex items-center justify-center rounded-[8px] bg-segment-background border border-segment-background w-10 h-10 cursor-pointer text-text-light fill-current select-none hover:text-text-light",...d,children:(0,D.jsx)(eG,{})}),(0,D.jsx)("div",{className:"flex flex-1 bg-segment-background border border-segment-background rounded-[8px] items-center justify-between px-2.5 input-wrapper hover:border-input-hover-border focus-within:border-input-hover-border",children:(0,D.jsx)(ef.A,{id:"limitPriceInput",className:"flex-1 w-full h-9 min-w-0 text-sm font-medium ".concat(l?"text-[#E43C5A]":"text-text-dark"," text-center transfer"),value:t,onChange:e=>{if(a)return;let t=e;if(/^\d*(?:\.\d*)?$/.test(t)){if(t.includes(".")){let[,e]=t.split("."),l=2;if(r&&(l=r.pricePrecision||2),e.length>l)return}t.length>12||(t.startsWith(".")&&(t="0".concat(t)),n(t))}},decimalScale:r?r.pricePrecision:2,maxLength:12})}),(0,D.jsx)("div",{className:"flex items-center justify-center rounded-[8px] bg-segment-background border border-segment-background w-10 h-10 cursor-pointer text-text-light fill-current select-none hover:text-text-light",...o,children:(0,D.jsx)(eB,{})})]})]})},eX={BASE_QUANTITY:0,ORDER_VALUE:1,MARGIN:2},eQ={placeOrderInfo0:"",placeOrderInfo1:"",placeOrderInfo2:"",orderQuantity:"",collateralAtOpen:"",btnText:"",estLiqPrice:""},eY=(e,t,l)=>{let a=new en.A(l||0);return a.isFinite()&&a.isGreaterThan(0)?a.toNumber():((e,t)=>("long"===t?e.shortPrice:e.longPrice)||e.currentPrice)(e,t)},eJ=(e,t)=>
1{let l=(0,et.t4)(e,t);return null===l||l.isLessThan(t)?((0,et.Rm)("handleQuantityByStepSize error quantity: ".concat(e,", value: ").concat(l,", stepSize: ").concat(t)),null):l},eZ=e=>(0,et.lr)((e=>e.lotSize?(0,eN.BP)(e.stepSize||1,e.lotSize):"".concat(e.stepSize||1))(e))||2,e$=(e,t)=>{let l=new en.A(t.lotSize||1),a=eZ(t);return new en.A(e).dividedBy(l).decimalPlaces(a,en.A.ROUND_DOWN).multipliedBy(l)},eK=(e,t)=>new en.A(e.quantity||0).isLessThanOrEqualTo(t.quantity||0)?e:t,e0=e=>{let{unitPreference:t,selectSegment:l,orderQuantityInput:a,placeOrderInfo0:r,placeOrderInfo1:n,placeOrderInfo2:s,orderQuantity:i,estLiqPrice:c,tokenInfo:o,marginMode:d,maxQuantity:x,totalQuantity:u}=e,{t:m}=(0,W.Bd)();(0,ey.kH)(e=>e.language);let h=(0,et.vT)(null==o?void 0:o.symbol),p=(0,et.XU)(a||"0"),f=(null==o?void 0:o.lotSize)?(0,eN.BP)(o.stepSize||1,o.lotSize):"".concat((null==o?void 0:o.stepSize)||1),g=(0,et.lr)(f)||2,v=function(e,t){let l=!(arguments.length>2)||void 0===arguments[2]||arguments[2],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"floor";return e?(0,et.hE)(e,t,l,a):""},b=e=>{let t=v(e||"0",g,!1);return new en.A(e||0).isZero()?t:(0,et.XU)(t)},j=e=>{let t=Math.min(Math.max(2,new en.A(e).decimalPlaces()||0),8),l=v(e,t,!1);return new en.A(e||0).isZero()?l:(0,et.XU)(l)},y=m("trade.order_value_lot_suffix",0===t?{quantity:b(p)}:{quantity:(e=>{let t=(null==o?void 0:o.lotSize)||1;return b((0,eN.BP)(e||"0",t))})(i)}),N=r?"".concat(v(r,2,!0,"round")," USD").concat(y?" (".concat(y,")"):""):"0.00",w=n?"".concat(v(n,2)," USD"):"0.00",A=0===t?s?"".concat(b(s)," ").concat(m("trade.lot_unit")):"0.00 ".concat(m("trade.lot_unit")):s?"".concat((0,et.XU)(v(s,2))," USD"):"0.00",k=en.A.max(new en.A(0),new en.A(x||1e3).minus(u||0)).toFixed(),E=0===t&&s?j(s):(e=>{let t=(null==o?void 0:o.lotSize)||1;return j((0,eN.BP)(e||"0",t))})(k);return(0,D.jsxs)("div",{className:"flex flex-col mt-4 gap-3",children:[(0,D.jsxs)("div",{className:"flex items-center justify-between text-[12px]","data-guide-step4-end":!0,children:[(0,D.jsx)("div",{className:"flex items-center",children:(0,D.jsx)("span",{className:"text-text-light text-sm md:text-xs",children:m("trade.order_value")})}),(0,D.jsx)("span",{className:"text-text-dark font-medium text-sm md:text-xs",children:N})]}),(0,D.jsxs)("div",{className:"flex items-center justify-between text-[12px]",children:[(0,D.jsxs)("div",{className:"flex items-center",children:[(0,D.jsx)(eg.m,{target:".leverage-tip",position:"top",content:m("trade.cost_tips"),pt:{root:{className:"w-[264px]"}}}),(0,D.jsx)("span",{className:"leverage-tip text-text-light text-sm md:text-xs underline decoration-dotted",children:m("trade.cost")})]}),(0,D.jsx)("span",{className:"text-text-dark font-medium text-sm md:text-xs",children:w})]}),(0,D.jsxs)("div",{className:"flex items-center justify-between text-[12px]",children:[(0,D.jsxs)("div",{className:"flex items-center",children:[0===l?(0,D.jsx)("span",{className:"text-text-light text-sm md:text-xs underline decoration-dotted position-tip",children:m("trade.max_long")}):(0,D.jsx)("span",{className:"text-text-light text-sm md:text-xs underline decoration-dotted position-tip",children:m("trade.max_short")}),(0,D.jsx)(eg.m,{target:".position-tip",position:"top",pt:{root:{className:"w-[264px]"}},children:(0,D.jsx)("div",{className:"font-normal",children:(0,D.jsx)(W.x6,{i18nKey:"trade.position_tips",values:{symbol:h,marginMode:m("cross"===d?"trade.cross":"trade.isolated"),maxQuantity:E,lotUnit:m("trade.lot_unit")},components:{white:(0,D.jsx)("span",{className:"text-[#212529] font-semibold"})}})})})]}),(0,D.jsx)("span",{className:"text-text-dark font-medium text-sm md:text-xs",children:A})]}),(0,D.jsxs)("div",{className:"hidden items-center justify-between text-[12px]",children:[(0,D.jsx)("span",{className:"text-text-light text-sm md:text-xs underline decoration-dotted trade-liq-price-tip",children:m("trade.liq_price")}),(0,D.jsx)("span",{className:"text-text-dark font-medium text-sm md:text-xs",children:c?v(c,(null==o?void 0:o.pricePrecision)||2):v("0",(null==o?void 0:o.pricePrecision)||2)}),(0,D.jsx)(eg.m,{target:".trade-liq-price-tip",position:"top",content:m("trade.liq_price_tip"),pt:{root:{className:"w-[264px]"}}})]})]})};var e1=l(49500),e2=l(23682),e3=l(75555);let e5=e=>{let{showTPSL:t,profitPercentState:l,lossPercentState:a,selectSegment:r,leverage:n,collateralAtOpen:s,limitPriceInputContent:i,tokenInfo:c,marginMode:o,onToggleTPSL:d,onChangeTradeProfit:x,onChangeTradeLoss:u}=e,{t:m}=(0,W.Bd)();return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)("div",{className:"h-10 flex items-center mt-4 bg-segment-background cursor-default ".concat(t?"rounded-t-[8px] ":"rounded-[8px]"," px-3"),onClick:d,children:[(0,D.jsxs)("div",{className:"h-10 text-sm md:text-xs text-text-light flex flex-row font-medium items-center",children:[(0,D.jsx)("div",{className:"",children:"".concat(m("trade.tp"))}),(0,D.jsx)("div",{className:"ml-1 text-text-light",children:"".concat(0===l?m("trade.none"):"".concat(l,"%"))}),(0,D.jsx)("div",{className:"ml-1 ",children:"/ ".concat(m("trade.sl"))}),(0,D.jsx)("div",{className:"ml-1 text-text-light",children:"".concat(0===a?m("trade.none"):"".concat(a,"%"))})]}),(0,D.jsx)(e1.P.div,{animate:{rotate:t?270:90},transition:{duration:.3},className:"w-[14px] h-[14px] ml-auto",children:(0,D.jsx)(ec,{className:"fill-current text-text-dark "})})]}),t&&(0,D.jsxs)("div",{className:"bg-segment-background rounded-b-[8px] pt-1 pb-1 px-3",children:[(0,D.jsx)("div",{className:"w-full",children:(0,D.jsx)(e3.A,{value:l,fromDialog:!1,onChange:x,selectSegment:r,leverage:n,estimatedProfitAndLossValue:s,price:i,spread:(null==c?void 0:c.spread)||0,tokenDecimal:(null==c?void 0:c.pricePrecision)||2})}),(0,D.jsx)("div",{className:"w-full mt-4",children:(0,D.jsx)(e2.A,{value:a,fromDialog:!1,onChange:u,selectSegment:r,leverage:n,estimatedProfitAndLossValue:s,price:i,spread:(null==c?void 0:c.spread)||0,tokenDecimal:(null==c?void 0:c.pricePrecision)||2,marginMode:o})})]})]})},e4=e=>(0,et.lr)((e=>(null==e?void 0:e.lotSize)?Number((0,eN.BP)(e.stepSize||1,e.lotSize)):(null==e?void 0:e.stepSize)||
11)(e))||2,e8={ACTIVE_CODE_REQUIRED:7010,QUANTITY_ADJUSTMENT_REQUIRED:8058,MARGIN_MODE_CHANGED:8096},e6=e=>1===e?"cross":"isolated",e7=e=>{if("cross"===e||"isolated"===e)return e},e9=e=>{var t,l,a,r,n,s;let{symbol:i,tokenActionType:c,onPlaceOrder:o}=e,{t:d}=(0,W.Bd)(),x=(0,ey.kH)(e=>e.isLogined),u=(0,ey.kH)(e=>e.userInfo),m=(0,$.e0)(e=>{var t;return null==(t=e.symbolStatusMap[i])?void 0:t.showOffHour}),h=(0,$.e0)(e=>{var t,l;return null!=(l=null==(t=e.symbolStatusMap[i])?void 0:t.isRestrictionActive)&&l}),p=(0,K.WG)(e=>Number((0,eN.gF)(e.positionQuantity[i]||0,e.openOrderQuantity[i]||0))),f=(0,K.WG)(e=>e.tokenMap[i]),g=(0,H.useRef)(""),v=(0,H.useRef)(null),{registerStep:b}=(0,q.Z)(),j=(0,H.useCallback)(e=>{b("step3",e)},[b]),y=(0,H.useCallback)(e=>{b("step4",e)},[b]),[N,w]=(0,H.useState)(()=>(0,ey.mC)()),A=(0,H.useRef)(N),{showModifyLeverDialog:k,showDepositDialog:E,showSelectWalletDialog:_,showActiveCodeDialog:S,showOrderSettingsDialog:C,showMarginModeDialog:P}=(0,ej.s)(),M=(0,H.useRef)({id:1,name:"USD"}),[U,z]=(0,H.useState)(""),[T,R]=(0,H.useState)(""),[I,V]=(0,H.useState)(!1),[B,F]=(0,H.useState)(!1),[G,X]=(0,H.useState)(!1),Q=(0,eI.l)(e=>e.isMobile),[Y,ee]=(0,H.useState)(!1),el=[d("trade.market_price"),d("trade.limit")],ea=(0,H.useRef)(0),[er,ei]=(0,H.useState)(0),[ed,eu]=(0,H.useState)(0),eh=(0,H.useRef)(20),[eg,ev]=(0,H.useState)(20),eb=null!=(n=null==f?void 0:f.feeRate)?n:45e-5,[ew,eA]=(0,H.useState)(eQ),{placeOrderInfo0:e_,placeOrderInfo1:eP,placeOrderInfo2:eM,collateralAtOpen:eU,btnText:eV,estLiqPrice:eL}=ew,eB=(0,H.useRef)(""),eF=(0,H.useRef)(0),[eG,eq]=(0,H.useState)(0),[e1,e2]=(0,H.useState)(0),[e3,e9]=(0,H.useState)(null),te=(0,H.useRef)(Number(null==f?void 0:f.shortPrice)||0),tt=(0,H.useRef)(Number(null==f?void 0:f.longPrice)||0),tl=(0,H.useRef)(!1),ta=(0,eR.JH)(e=>e.configInfo),tr=(0,K.WG)(e=>e.symbolMarginModeMap[i]),tn=(0,H.useRef)(e6(null==ta||null==(t=ta.marginMode)?void 0:t.defaultMarginMode)),[ts,ti]=(0,H.useState)(()=>e7(tr)||tn.current),tc=(null!=(s=null==ta||null==(a=ta.marginMode)||null==(l=a.enabledMarginModes)?void 0:l.length)?s:0)>1,to=(0,ey.kH)(e=>e.crossAvailableBalance),td=(0,ey.kH)(e=>e.isolatedAvailableBalance),tx="cross"===ts?to:td,tu=(0,O.useSearchParams)().get("p"),[tm,th]=(0,H.useState)(()=>{let e=localStorage.getItem(eO.Yz);return e&&"true"!==e&&"true"!==tu||"true"!==tu||localStorage.setItem(eO.Yz,"true"),!e||"true"===e||"true"===tu}),tp=(0,H.useRef)(tm),tf=H.useMemo(()=>{if(null==ta?void 0:ta.marginLimit)return(0,eR.D9)(i)},[i,ta]),tg=(null==tf?void 0:tf.maxQuantity)||1e3;(0,H.useEffect)(()=>{var e;tn.current=e6(null==ta||null==(e=ta.marginMode)?void 0:e.defaultMarginMode),i&&ti(e7(tr)||tn.current)},[i,tr,null==ta||null==(r=ta.marginMode)?void 0:r.defaultMarginMode]);let tv=e=>{eh.current=e,ev(e)},tb=e=>{A.current=e,w(e),(0,ey.z6)(e),tC()},tj=()=>{f&&0!==f.leverageRange.length&&f&&1!==f.leverageRange.length&&k(f.name,f.symbol,eg,f.minLeverage,f.maxLeverage,f.restrictedMaxLeverage,f.leverageRange,e=>{eh.current=e,ev(e),tA(U)})},ty=e=>{if(B)return;e9(null);let t=e.replaceAll(",","");if(/^\d*(?:\.\d*)?$/.test(t)){if(t.includes(".")){let[,e]=t.split(".");if(A.current===eX.BASE_QUANTITY&&e.length>e4(f)||A.current!==eX.BASE_QUANTITY&&e.length>2)return}t.length>12||(t.startsWith(".")&&(t="0".concat(t)),z(t),tA(t))}},tN=(0,H.useCallback)(e=>{R(t=>t===e?t:e)},[]),tw=()=>{if(1!==ed)return;let e=T.replaceAll(",","");return Number(e)>0?e:void 0},tA=e=>{if(""===e&&(e="0"),!f||!u)return;let t=0===ea.current?"long":"short",l=(e=>{var t,l,a,r,n;
1let{input:s,shouldConvertTokenInputToUsd:i,tokenInfo:c,userInfo:o,unitPreference:d,side:x,leverage:u,feeRate:m,maxQuantity:h,totalQuantity:p,availableBalanceWithTrialFund:f,marginMode:g,priceOverride:v,t:b}=e;if(""===s)return eQ;let j=eY(c,x,v),y=s;i&&(y=(0,eN.ez)(y,j.toString())),d===eX.BASE_QUANTITY&&(y=(0,eN.ez)(y,c.lotSize||1));let N=Number(y.replaceAll(",","")),w=1-o.disCountRate/100,A=(0,eN.sX)(N,(0,eN.ez)(w,(0,eN.ez)(N,(0,eN.ez)(u,m)))),k=((e,t,l,a)=>{let r=eY(e,t,a);return"long"===t?(0,eN.gF)((0,eN.BP)((0,eN.ez)(r,(0,eN.sX)(1,(0,eN.BP)(1,l))),(0,eN.sX)(1,e.feeRate)),(0,eN.ez)(2,e.spread)):(0,eN.sX)((0,eN.BP)((0,eN.ez)(r,(0,eN.gF)(1,(0,eN.BP)(1,l))),(0,eN.gF)(1,e.feeRate)),(0,eN.ez)(2,e.spread))})(c,x,u,v),E="",_="",S="",C="",P="",M="",U="",z="",T=new en.A(f),R=new en.A(u),D=new en.A(j.toString()),I=new en.A(m),O=new en.A(o.disCountRate),V=new en.A(c.stepSize),H=en.A.max(new en.A(0),new en.A(h).minus(p)),L=new en.A(c.minOrderQuantity||c.stepSize||0),B=L.isGreaterThan(0)?L.toFixed():"",F=(0,et.LV)(T,R,D,I,O,V,et.r6.FEE),G=H.isGreaterThanOrEqualTo(V)?(0,et.iz)(H,R,D,I,O,V,et.r6.FEE):null,q=F&&G?eK(F,G):null,W=L.isGreaterThan(0)?(0,et.iz)(L,R,D,I,O,V,et.r6.FEE):null,X=c.lotSize?(0,et.XU)((0,et.hE)((0,eN.BP)(B||0,c.lotSize),eZ(c),!1)):(0,et.XU)((0,et.hE)(B,c.pricePrecision,!1)),Q=(null==W?void 0:W.orderValue)||"0",Y=(null==W?void 0:W.cost)||"0";if(d===eX.MARGIN){let e=new en.A(N),l=(0,et.LV)(e,R,D,I,O,V,et.r6.FEE),a=e$((null==l?void 0:l.quantity)||"0",c),r=a.isGreaterThan(0)?(0,et.iz)(a,R,D,I,O,V,et.r6.FEE):null;E=Y,Number(_=(0,et.hE)((null==q?void 0:q.cost)||"0",2,!1,"round"))>f&&(_=(null==q?void 0:q.cost)||"0"),S=(null==F?void 0:F.cost)||"",C=(null==r?void 0:r.orderValue)||"0",P=(null==r?void 0:r.cost)||"0",M=_,U=(null==r||null==(t=r.quantity)?void 0:t.toString())||"0"}else if(d===eX.ORDER_VALUE){let e=new en.A(N),t=(0,et.iV)(e,R,D,I,O,V,et.r6.FEE),r=e$((null==t?void 0:t.quantity)||"0",c),n=r.isGreaterThan(0)?(0,et.iz)(r,R,D,I,O,V,et.r6.FEE):null;E=Q,_=(null==q?void 0:q.orderValue)||"0",S=(null==F?void 0:F.orderValue)||"",C=(null==n||null==(l=n.orderValue)?void 0:l.toString())||"0",P=(null==n?void 0:n.cost)||"0",M=_,U=(null==n||null==(a=n.quantity)?void 0:a.toString())||"0",A=(0,eN.sX)((null==n?void 0:n.cost)||"0",(0,eN.ez)(w,(0,eN.ez)((null==n?void 0:n.cost)||"0",(0,eN.ez)(u,m))))}else{let e=new en.A(N),t=e.isGreaterThan(0)?eJ(e,V):null;null!==t&&(e=t);let l=e.isGreaterThan(0)?(0,et.iz)(e,R,D,I,O,V,et.r6.FEE):null;E=B,_=(null==q?void 0:q.quantity)||"0",S=(null==F?void 0:F.quantity)||"",C=(null==l||null==(r=l.orderValue)?void 0:r.toString())||"",P=(null==l?void 0:l.cost)||"",M=c.lotSize?(0,eN.BP)(_||0,c.lotSize):_,U=(null==l||null==(n=l.quantity)?void 0:n.toString())||"",A=(0,eN.sX)((null==l?void 0:l.cost)||"0",(0,eN.ez)(w,(0,eN.ez)((null==l?void 0:l.cost)||"0",(0,eN.ez)(u,m))))}if(""!==_&&""!==E){let e=d===eX.MARGIN||d===eX.ORDER_VALUE?new en.A(U||0).isGreaterThan(H):N>Number(_);(d===eX.MARGIN?new en.A(N).isGreaterThan(T):d===eX.ORDER_VALUE?new en.A(N).isGreaterThan(S||0):N>Number(S))?z=b("trade.not_enough_collateral"):e?z=b("trade.not_enough_position"):(N<Number(E)||(d===eX.ORDER_VALUE||d===eX.MARGIN)&&L.isGreaterThan(0)&&new en.A(U||0).isLessThan(L))&&(z=d===eX.MARGIN?b("trade.min_margin_cost_warning",{value:(0,et.hE)(Y,2,!0,"round")}):d===eX.ORDER_VALUE?b("trade.min_order_value_warning",{lots:X,value:(0,et.hE)(Q,2,!0,"round")}):b("trade.min_input_warning_0",{amount:"".concat(X," ").concat(b("trade.lot_unit"))}))}return{placeOrderInfo0:C,placeOrderInfo1:P,placeOrderInfo2:M,orderQuantity:U,collateralAtOpen:A,btnText:z,estLiqPrice:k}})({input:e,shouldConvertTokenInputToUsd:2===M.current.id,tokenInfo:f,userInfo:u,unitPreference:A.current,side:t,leverage:eh.current,feeRate:eb,maxQuantity:tg,totalQuantity:p,availableBalanceWithTrialFund:tE,marginMode:ts,priceOverride:tw(),t:d});eA(l),eB.current=l.placeOrderInfo2},tk=(e,t)=>{(0,Z.$s)(e,{symbol:f.symbol,side:0===ea.current?"long":"short",order_type:0===ed?"market":"limit",quantity:(0,et.Pj)(Number(t)),leverage:(0,et.Pj)(eh.current),use_bonus:tp.current,margin_mode:"cross"===ts?"cross":"isolated"})},tE=H.useMemo(()=>ek({availableBalance:tx,userInfo:u,useBonus:tm}),[tx,tm,u]),t_=(e,t)=>
1{e9(t),z("".concat(e.value)),tA("".concat(e.value)),(0,Z.$s)(Z.WL,(0,et.Pj)(e.value))},tS=e=>{z(e),tA(e)},tC=()=>{if(u&&f){let e=tM(A.current,tE),t=0;e&&e.length>0&&(t=""!==e[0].value?Number(e[0].value):0);let l=(e=>{let{unitPreference:t,userInfo:l,tokenInfo:a,side:r,maxQuantity:n,totalQuantity:s,availableBalanceWithTrialFund:i,leverage:c,priceOverride:o}=e,d=new en.A(c),x=new en.A(eY(a,r,o).toString()),u=new en.A(a.feeRate),m=new en.A(l.disCountRate),h=new en.A(a.stepSize),p=en.A.max(new en.A(0),new en.A(n).minus(s)),f=(0,et.LV)(new en.A(i),d,x,u,m,h,et.r6.FEE),g=p.isGreaterThanOrEqualTo(h)?(0,et.iz)(p,d,x,u,m,h,et.r6.FEE):null,v=f&&g?eK(f,g):null;return t===eX.BASE_QUANTITY?(0,et.hE)(a.lotSize?(0,eN.BP)((null==v?void 0:v.quantity)||0,a.lotSize):(null==v?void 0:v.quantity)||"",a.pricePrecision||2):t===eX.ORDER_VALUE?(0,et.hE)((null==v?void 0:v.orderValue)||""):(0,et.hE)((null==v?void 0:v.cost)||"")})({unitPreference:A.current,userInfo:u,tokenInfo:f,side:0===ea.current?"long":"short",maxQuantity:tg,totalQuantity:p,availableBalanceWithTrialFund:tE,leverage:eh.current,priceOverride:tw()}),a=""!==l?Number(l.replaceAll(",","")):10,r=(0,ey.bu)(A.current),n=Math.min(""!==r?Number(r):Math.min(t,a),a);tS("".concat(n))}else tS("")};(0,H.useEffect)(()=>{u&&f&&g.current!==f.symbol&&tC()},[u,f]),(0,H.useEffect)(()=>{x?tC():(tS(""),eA(eQ))},[x]),(0,H.useEffect)(()=>{(()=>{if(!f)return;let e=localStorage.getItem("".concat(f.symbol,"_lever"));if(e){let t=f.maxLeverage,l=f.minLeverage;0===f.leverageRange.length?(tv(f.leverage),localStorage.setItem("".concat(f.symbol,"_lever"),f.leverage.toString())):Number(e)>t?tv(t):Number(e)<l?tv(f.leverage):tv(Number(e))}else tv(f.leverage)})()},[i]),(0,H.useEffect)(()=>{if(f){U&&tA(U);let e=Date.now();(0===ed||g.current&&g.current!==f.symbol)&&(te.current=Number(f.shortPrice),tt.current=Number(f.longPrice),0===eF.current?(eF.current=e,tP()):(e-eF.current>1e3||g.current!==f.symbol)&&(eF.current=e,tP())),g.current=f.symbol}},[f]);let tP=()=>{if(f){if(0===ea.current){let e;e=tl.current?(0,eN.sX)(tt.current,(0,eN.ez)(tt.current,25e-5)):tt.current.toString(),R((0,et.hE)(e,f.pricePrecision,!1))}else if(1===ea.current){let e;e=tl.current?(0,eN.gF)(te.current,(0,eN.ez)(te.current,25e-5)):te.current.toString(),R((0,et.hE)(e,f.pricePrecision,!1))}}},tM=(e,t)=>{let l,a;if(e===eX.BASE_QUANTITY){var r,n;let e=(null==f?void 0:f.lotSize)||0,t=e4(f);l=e?null==f||null==(r=f.amountRange)?void 0:r.map(l=>(0,et.XU)((0,et.hE)((0,eN.BP)(l,e),t,!1))):null==f||null==(n=f.amountRange)?void 0:n.map(e=>e.toString()),a=t}else e===eX.ORDER_VALUE?(l=null==f?void 0:f.valueRange,a=2):e===eX.MARGIN&&(l=null==f?void 0:f.marginRange,a=2);return l?[...l.map(e=>({label:e.toString(),value:Number(e)})),{label:"Max",value:Number((0,et.XU)((0,et.hE)(eB.current,a,!1)))}]:[...(0,et.OI)(t).map(e=>({label:e.toString(),value:e})),{label:"Max",value:(0,et.XU)((0,et.hE)(eB.current,2,!1))}]};(0,H.useEffect)(()=>{f&&(te.current=Number(f.shortPrice),tt.current=Number(f.longPrice)),tP()},[er,ed]),(0,H.useEffect)(()=>{if(f&&1===ed){let e=Number(T);0===er&&e>Number(f.longPrice)||1===er&&e<Number(f.shortPrice)?V(!0):V(!1)}else V(!1)},[f,ed,er,T]),(0,H.useEffect)(()=>{x&&U&&tA(U)},[T,ed,er,ts]),(0,H.useEffect)(()=>{let e=tM(A.current,tE||0);if(U){let t=e.findIndex((e,t)=>"".concat(e.label,"-").concat(t)===e3);if(t>=0&&e[t].value===Number(U))return;let l=e.findIndex(e=>e.value===Number(U)&&"Max"!==e.label);l>=0?e9("".concat(e[l].label,"-").concat(l)):e9(null)}},[U,u,tm,e3]),(0,H.useEffect)(()=>{x&&(U?tA(U):tC())},[tm,tg,p]),(0,H.useEffect)(()=>{let e=()=>{let e=document.activeElement;null!=e&&("INPUT"===e.tagName||"TEXTAREA"===e.tagName)&&window.setTimeout(()=>{let t=window.visualViewport;t&&(window.innerHeight-t.height-t.offsetTop>0?ee(!0):ee(!1)),"scrollIntoView"in e?e.scrollIntoView(!1):e.scrollIntoViewIfNeeded(!1)},0)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);let tU=e=>{ei(e),ea.current=e};(0,H.useEffect)(()=>{Q&&(2===c?tU(-1):tU(c))},[c]),(0,H.useEffect)(()=>{tu&&window.history.replaceState(null,"","/trade")},[]);let tz=!!u&&tE>0&&(!U||0===Number(U)||G&&(eG<0||e1<0)||I||""!==eV||B),tT=h&&Number(null==f?void 0:f.restrictedMaxLeverage)>0&&eg>Number(null==f?void 0:f.restrictedMaxLeverage),tR=-1===er||m||tT||tz,tD=x?m?d("trade.market_is_closed"):tT?d("trade.session_leverage_limit",{max:null==f?void 0:f.restrictedMaxLeverage}):u&&tE>0?eV||d("trade.place_order"):d("home.deposit"):d("home.connect_wallet");return(0,D.jsxs)("div",{className:"flex flex-col w-full md:pb-3 md:px-3 md:w-[338px] md:border-t md:border-l md:border-panel-border-color h-full",children:[Q&&f&&(0,D.jsxs)("div",{className:"flex items-center gap-3",children:[(0,D.jsx)(J.A,{className:"w-9 h-9 shrink-1",image:f.imageUrl,width:36,height:36,name:f.name,symbol:f.symbol}),(0,D.jsxs)("div",{className:"flex flex-col",children:[(0,D.jsxs)("div",{className:"flex gap-2 items-baseline text-text-dark",children:[(0,D.jsx)("span",{className:"text-base font-semibold",children:f.name}),(0,D.jsx)("span",{className:"text-sm font-semibold",children:f.symbol})]}),(0,D.jsx)("span",{className:"w-fit text-[13px] !font-medium whitespace-nowrap rounded-[6px] mt-0.5 px-2 py-[3px] ".concat(m?"text-text-light font-normal 
1!px-0":f.changePercent>0?"text-[#2EBD85] bg-[#2EBD851A]":"text-[#E43C5A] bg-[#E43C5A1A]"),children:m?d("trade.closed"):f.changePercent>0?"+".concat((0,et.hE)(f.changePercent),"%"):"".concat((0,et.hE)(f.changePercent),"%")})]})]}),(0,D.jsxs)("div",{className:"hidden items-center mt-4 gap-2",children:[(0,D.jsxs)("div",{className:"hidden flex-1 items-center px-3 bg-segment-background rounded-[6px] py-1.5 ".concat(tc?"justify-between cursor-pointer":"justify-center"),onClick:()=>{tc&&P(i,ts,e=>{ti(e7(e)||tn.current)})},children:[(0,D.jsx)("span",{className:"text-xs text-text-dark font-medium text-center",children:"cross"===ts?d("trade.cross"):d("trade.isolated")}),tc&&(0,D.jsx)(ex,{className:"fill-current text-text-dark"})]}),(0,D.jsxs)("div",{className:"flex flex-1 items-center px-3 rounded-[6px] py-1.5 ".concat((null==f?void 0:f.leverageRange.length)>0?"justify-between bg-segment-background":"justify-center bg-segment-background/40"),onClick:tj,children:[(0,D.jsx)("span",{className:"text-xs text-text-dark font-medium text-center",children:"".concat(d("partner.leverage")," ").concat(eg,"x")}),(null==f?void 0:f.leverageRange.length)>0&&(0,D.jsx)(ex,{className:"fill-current text-text-dark "})]})]}),(0,D.jsx)(eC,{symbol:i,type:1,selectSegment:er,onSegmentChange:e=>{ei(e),ea.current=e,tA(U),(0,Z.$s)(Z.nX,{switch:0===e?"long":"short"})}}),(0,D.jsxs)("div",{className:"flex flex-col w-full h-full overflow-y-auto mt-4",children:[(0,D.jsxs)("div",{className:"flex items-start justify-between border-b border-border-color md:border-panel-border-color ",children:[(0,D.jsx)("div",{className:"flex items-center gap-8 mt-0.75",children:el.map((e,t)=>(0,D.jsxs)("div",{className:"relative h-[27px] cursor-pointer text-left text-sm leading-[18px]",onClick:()=>(e=>{tl.current=1===e,eu(e),(0,Z.$s)(Z.eV,{type:0===e?"market":"limit"})})(t),children:[(0,D.jsx)("span",{className:"text-sm ".concat(ed===t?"text-text-dark font-semibold":"text-text-light font-medium"),children:e}),ed===t&&(0,D.jsx)("span",{className:"absolute left-1/2 -translate-x-1/2 bottom-0 w-6 h-[3px] bg-text-dark rounded-full transition-all"})]},e))}),(0,D.jsxs)("div",{className:"ml-auto flex h-6 items-center justify-center rounded-md px-2 ".concat((null==f?void 0:f.leverageRange.length)>0?"justify-between bg-segment-background":"justify-center bg-segment-background/40"),onClick:tj,children:[(0,D.jsx)("span",{className:"text-center text-xs font-medium leading-[22px] text-text-dark",children:"".concat(d("partner.leverage"),": ").concat(eg,"x")}),(null==f?void 0:f.leverageRange.length)>1&&(0,D.jsx)(ec,{className:"ml-2 mt-0.5 fill-current text-text-dark rotate-90"})]})]}),(0,D.jsxs)("div",{className:"flex flex-col mt-4 mb-3",children:[(0,D.jsx)(eE,{useBonus:tm,marginMode:ts}),(0,D.jsx)(ez,{useBonus:tm,callback:e=>{th(e),tp.current=e,localStorage.setItem(eO.Yz,"".concat(e))}}),1===ed&&(0,D.jsx)(eW,{limitPrice:T,limitPriceInputError:I,tokenInfo:f,showSwapLoading:B,callback:tN})]}),(0,D.jsxs)("div",{ref:j,className:"flex flex-col",children:[(0,D.jsxs)("div",{className:"flex bg-segment-background border border-border-color rounded-[8px] items-center justify-between p-3 gap-4 input-wrapper hover:border-input-hover-border focus-within:border-input-hover-border cursor-pointer",onClick:()=>{var e;return null==(e=v.current)?void 0:e.focus()},children:[(0,D.jsxs)("div",{className:"flex flex-col w-full flext-1 gap-0.5",children:[(0,D.jsx)("span",{className:"text-sm md:text-xs font-medium text-text-light",children:"".concat(N===eX.MARGIN?d("trade.cost"):d("trade.size"))}),(0,D.jsx)(ef.A,{ref:v,className:"flex-1 w-full h-9 min-w-0 text-base font-medium text-text-dark text-left transfer",value:U,onChange:ty,decimalScale:N===eX.BASE_QUANTITY?e4(f):2,maxLength:12})]}),(0,D.jsxs)("div",{className:"flex flex-row items-center mt-4.5",onClick:e=>{e.stopPropagation(),C((0,et.vT)(i),N,tb)},children:[(0,D.jsx)("span",{className:"text-text-dark text-sm font-bold cursor-pointer",onClick:()=>void(f&&R(f.currentPrice.toFixed(2))),children:"".concat(N===eX.BASE_QUANTITY?d("trade.lot_unit"):"USD")}),(0,D.jsx)(em,{className:"ml-1.5 w-3 h-3"})]})]}),(0,D.jsx)("div",{className:"flex items-center gap-1 mt-3",children:tM(N,tE||0).map((e,t)=>(0,D.jsx)("div",{role:"button",tabIndex:0,"aria-label":N===eX.BASE_QUANTITY?e.label:"Max"===e.label?"Max":"$".concat(e.label),className:"flex-1 flex h-6.5 rounded-md items-center justify-center input-wrapper cursor-pointer ".concat(e3==="".concat(e.label,"-").concat(t)?"text-[#2EBD85] bg-[#2EBD8526] font-[600]":"text-text-light bg-segment-background h-6.5"),onClick:()=>t_(e,"".concat(e.label,"-").concat(t)),onKeyDown:l=>((e,t,l)=>
1{("Enter"===l.key||" "===l.key)&&(l.preventDefault(),t_(e,t))})(e,"".concat(e.label,"-").concat(t),l),children:N===eX.BASE_QUANTITY?(0,D.jsx)("span",{className:"text-[13px] font-medium ",children:"".concat(e.label)}):(0,D.jsx)("span",{className:"text-[13px] font-medium ",children:"Max"===e.label?"Max":"$".concat(e.label)})},e.label+t))})]}),(0,D.jsx)(e0,{unitPreference:N,selectSegment:er,orderQuantityInput:U,placeOrderInfo0:e_,placeOrderInfo1:eP,placeOrderInfo2:eM,orderQuantity:ew.orderQuantity,estLiqPrice:eL,tokenInfo:f,marginMode:ts,maxQuantity:tg,totalQuantity:p}),(0,D.jsx)(e5,{showTPSL:G,profitPercentState:eG,lossPercentState:e1,selectSegment:er,leverage:eg,collateralAtOpen:eU,limitPriceInputContent:T,tokenInfo:f,marginMode:ts,onToggleTPSL:()=>{X(!G),(0,Z.$s)(Z.iT)},onChangeTradeProfit:e=>{if(""===e)return void eq(0);eq(Number(e))},onChangeTradeLoss:e=>{if(""===e)return void e2(0);e2(Number(e))}}),(0,D.jsxs)("div",{className:"".concat(Q?Y?"static bottom-4 w-full z-55":"absolute bottom-4 w-[calc(100%-32px)] z-55":"sticky bottom-0 pb-1 bg-main-background"),children:[(0,D.jsx)("div",{className:"text-[#E43C5A] text-[11px] bg-main-background pt-2.5 md:py-1 ".concat(I?"visible":Q?"hidden":"invisible pointer-events-none"),children:0===er?d("trade.limit_price_buy_error"):d("trade.limit_price_sell_error")}),(0,D.jsxs)("div",{className:"w-full pt-2.5 md:pt-0 bg-main-background",children:[(0,D.jsxs)("div",{ref:y,className:"w-full relative guide-click-area",children:[(0,D.jsx)(es.$,{className:"flex w-full !justify-center !border-none !text-white !text-[14px] !font-semibold !h-12 md:!h-10 !rounded-[8px] [&:disabled]:!opacity-40 [&_.p-button-label]:!transition-none ".concat(m&&Q?"!p-0":""," ").concat(1===er?"!bg-[#E43C5A]":"!bg-[#2EBD85]"),disabled:tR,rounded:!0,label:m&&Q?void 0:tD,onClick:e=>(e=>{if(u){if(!u.isActive)return void S();tE>0?(()=>{let e,t;if(!f)return console.log("No symbol found");let l=U.replaceAll(",","");1===ed&&(e=Number(T.replaceAll(",","")));let a=eG/100;if(A.current===eX.MARGIN)t="margin";else if(A.current===eX.ORDER_VALUE)t="order_value";else{t="base_quantity",f.lotSize&&(l=(0,eN.ez)(l,f.lotSize));let e=eJ(new en.A(l),new en.A(f.stepSize));null!==e&&(l=e.toString())}let r={symbol:f.symbol,side:0===ea.current?"long":"short",type:0===ed?"market":"limit",quantity:l,leverage:eh.current,quantityType:t,price:e,useExperienceFund:tp.current,marginMode:ts,clientOrderId:Date.now()};a>0&&(r.takeProfitRate=a),e1>0&&(r.stopLossRate=e1/100),tk(Z.TJ,l),F(!0),(0,L.wH)(r).then(()=>{(0,eD.P0)("success",d("trade.place_order_success"),3e3),(0,ey.zU)(A.current,l),o(),eT.z.isConnected()||(0,K.K)(),tk(Z.cK,l)}).catch(e=>{if(e.code===e8.ACTIVE_CODE_REQUIRED)(0,eD.P0)("error",e.message,3e3),S();else if(e.code===e8.QUANTITY_ADJUSTMENT_REQUIRED){let t=e.message.match(/\d+(\.\d+)?/g),l=t?t[t.length-1]:null;l&&ty(l)}else e.code===e8.MARGIN_MODE_CHANGED&&(0,K.JZ)();(0,Z.$s)(Z.Rd,{error_msg:e.message})}).finally(()=>{F(!1)})})():E(!u.accountAddress)}else _()})(0),children:m&&Q&&(0,D.jsxs)("div",{className:"flex h-full w-full flex-col items-center justify-center text-center",children:[(0,D.jsx)("span",{children:tD}),(0,D.jsx)(ep,{symbol:i,closedOnly:!0,className:"!h-auto !w-auto [&_span]:!text-white [&_span]:!text-[12px]"})]})}),B?(0,D.jsx)("img",{className:"w-5 h-5 circle-progress absolute right-20 top-[50%] -translate-y-1/2",src:eo,alt:""}):null]}),m&&!Q&&(0,D.jsx)(ep,{symbol:i,closedOnly:!0,className:"mt-2 w-full text-center"})]})]}),(0,D.jsx)(eH,{tokenActionType:c,tokenInfo:f,symbol:i,marginMode:ts}),(0,D.jsx)("div",{className:"border-t border-panel-border-color mt-4"}),(0,D.jsx)(eS,{tokenActionType:c})]})]})};var te=l(87671),tt=l(58205),tl=l(6033),ta=l(75608),tr=l(34202),tn=l(2250),ts=l(41028);let ti=e=>{let{symbolChangeCallback:t}=e,{t:l,i18n:a}=(0,W.Bd)(),{showTransactionDetailsDialog:r,showShareProfitDialog:n}=(0,ej.s)(),s=(0,eI.l)(e=>e.isMobile),[i,c]=(0,H.useState)(!0),[o,d]=(0,H.useState)(""),x=(0,ey.kH)(e=>e.isLogined),u=(0,ey.kH)(e=>e.userInfo),m=(null==u?void 0:u.accountType)===0,h=(0,K.WG)(e=>e.orderList),p=(0,K.WG)(e=>e.tokenMap),f=h.length>20?h.splice(0,20):h,g=(0,O.useRouter)(),v=async e=>{var t;if(m)return;let a=o;if(!a){try{let e=await (0,L.ir)();a=(null==e?void 0:e.inviteCode)||""}catch(e){(0,eD.P0)("error",l("home.network_error"));return}a&&d(a)}if(!a)return;let r=e.returnRate?"".concat((Number.parseFloat(e.returnRate)>0?"+":"")+e.returnRate,"%"):"".concat((e.realizedPnl>0?"+":"")+(0,et.Ix)(e.realizedPnl/e.margin*100,2,"up"),"%"),s=new Date,i=s.getUTCFullYear(),c=String(s.getUTCMonth()+1).padStart(2,"0"),x=String(s.getUTCDate()).padStart(2,"0"),h=String(s.getUTCHours()).padStart(2,"0"),p=String(s.getUTCMinutes()).padStart(2,"0"),f=String(s.getUTCSeconds()).padStart(2,"0"),g="".concat(i,"/").concat(c,"/").concat(x," (UTC+0)").concat(h,":").concat(p,":").concat(f);n({referralCode:a,symbol:e.symbol,side:null==(t=e.positionSide)?void 0:t.toUpperCase(),leverage:e.leverage,profitPercent:r,profitAmount:"".concat(e.realizedPnl>0?"+":"").concat((0,et.Ix)(e.realizedPnl,2,"up")," USD"),entryPrice:"".concat((0,et.tu)(e.entryPrice,e.pricePrecision||2)," USD"),closePrice:"".concat((0,et.tu)(e.price,e.pricePrecision||2)," USD"),displayName:(null==u?void 0:u.accountAddress)?(0,et.UQ)(u.accountAddress):"Anonymous",time:g,isOpenPosition:!1})},b=async()=>
1{if(!(0,ey.W5)()||h.length>0)return void c(!1);c(!0),await (0,K.n7)(),c(!1)};return(0,H.useEffect)(()=>{x?b():c(!1)},[x]),(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)("div",{className:"min-h-[250px] cus-table relative overflow-y-auto",children:[(0,D.jsx)("div",{className:"guide-click-area",children:(0,D.jsxs)(tt.b,{value:f,scrollable:!0,scrollHeight:"flex",pt:{thead:()=>({className:"!bg-main-background"}),bodyRow:()=>({className:"hover:!bg-token-list-item-hover-color"})},emptyMessage:(0,D.jsx)("div",{className:"text-text-dark flex items-center justify-center h-[218px]",children:(0,D.jsx)(tr.A,{text:l("trade.no_orders_yet")})}),children:[(0,D.jsx)(te.V,{header:l("trade.time"),style:{width:"10%"},body:e=>{let[t,l]=(0,et.Ey)(e.timestamp).split(" ");return(0,D.jsxs)("div",{className:"flex flex-col justify-center px-4 py-3",children:[(0,D.jsx)("div",{className:"text-text-light text-xs",children:t}),(0,D.jsxs)("div",{className:"flex items-center gap-1 text-text-dark text-xs",children:[(0,D.jsx)("span",{children:l}),e.txHash&&(0,D.jsx)("div",{onClick:()=>{e.txHash&&(s?r(e.txHash):window.open("/tx/".concat(e.txHash),"_blank"))},className:"hover:opacity-80 transition-opacity cursor-pointer",children:(0,D.jsx)(ta.A,{className:"w-3.5 h-2.75 fill-current"})})]})]})},pt:{headerTitle:()=>({className:"text-text-light text-xs font-normal"}),headerCell:()=>({className:"!py-2"}),bodyCell:()=>({className:"text-text-light text-xs !p-0"})}}),(0,D.jsx)(te.V,{header:l("trade.coin"),body:e=>(0,D.jsx)("div",{className:"flex px-4 text-text-dark cursor-pointer",onClick:()=>{t(e.symbol)},children:"".concat((0,et.vT)(e.symbol))}),pt:{headerTitle:()=>({className:"text-text-light text-xs font-normal"}),headerCell:()=>({className:"!py-2"}),bodyCell:()=>({className:"text-text-light text-xs !p-0"})}}),(0,D.jsx)(te.V,{header:l("trade.size"),body:e=>(0,D.jsx)("div",{className:"flex px-4 text-text-dark",children:(e=>(0,ts.U)(e.quantity,p[e.symbol]))(e)}),pt:{headerTitle:()=>({className:"text-text-light text-xs font-normal"}),headerCell:()=>({className:"!py-2"}),bodyCell:()=>({className:"text-text-dark text-xs !p-0"})}}),(0,D.jsx)(te.V,{header:l("trade.direction"),style:{width:"17%"},body:e=>{let t="";"open"===e.tradeType&&"long"===e.positionSide?t=l("trade.open_long"):"open"===e.tradeType&&"short"===e.positionSide?t=l("trade.open_short"):"close"===e.tradeType&&"long"===e.positionSide?t=l("trade.close_long"):"close"===e.tradeType&&"short"===e.positionSide&&(t=l("trade.close_short"));let a="open"===e.tradeType&&"long"===e.positionSide||"close"===e.tradeType&&"short"===e.positionSide;return(0,D.jsx)("div",{className:"flex whitespace-pre-wrap px-4 ".concat(a?"text-[#2ebd85]":"text-[#E43C5A]"),children:"".concat("liquidation"===e.orderTypeDetail?l("trade.order_liquidation"):"").concat(t,"  ").concat(e.leverage,"x")})},pt:{headerTitle:()=>({className:"text-text-light text-xs font-normal"}),headerCell:()=>({className:"!py-2"}),bodyCell:()=>({className:"text-text-dark text-xs !p-0"})}}),(0,D.jsx)(te.V,{header:l("trade.price"),body:e=>(0,D.jsx)("div",{className:"flex px-4",children:"".concat((0,et.tu)(e.price,e.pricePrecision||2))}),pt:{headerTitle:()=>({className:"text-text-light text-xs font-normal"}),headerCell:()=>({className:"!py-2"}),bodyCell:()=>({className:"text-text-dark text-xs !p-0"})}}),(0,D.jsx)(te.V,{header:l("trade.trade_value"),body:e=>(0,D.jsx)("div",{className:"flex px-4",children:"".concat((0,et.tu)(e.cost)," USD")}),pt:{headerTitle:()=>({className:"text-text-light text-xs font-normal"}),headerCell:()=>({className:"!py-2"}),bodyCell:()=>({className:"text-text-dark text-xs !p-0"})}}),(0,D.jsx)(te.V,{header:l("trade.collateral"),body:e=>(0,D.jsx)("div",{className:"flex px-4",children:"".concat((0,et.tu)(e.margin)," USD")}),pt:{headerTitle:()=>({className:"text-text-light text-xs font-normal"}),headerCell:()=>({className:"!py-2"}),bodyCell:()=>({className:"text-text-dark text-xs !p-0"})}}),(0,D.jsx)(te.V,{header:l("trade.fee"),body:e=>{var t;let a="fee-tip-".concat(e.id),r=(0,tn.B)(e.lpFee);return(0,D.jsxs)("div",{className:"flex px-4 text-text-dark",children:[(0,D.jsx)(eg.m,{target:".".concat(a),position:"top",pt:{root:{className:"w-[200px]"}},children:(0,D.jsxs)("div",{className:"font-medium text-[12px]",children:[(0,D.jsx)("div",{children:l("trade.fee_details")}),(0,D.jsxs)("div",{className:"grid grid-cols-2 mt-1",children:[(0,D.jsx)("div",{className:"pb-1",children:l("trade.trading_fee")}),(0,D.jsx)("div",{className:" pb-1 ml-auto font-semibold",children:"".concat((0,et.Ix)(e.fee,2,"truncate")," USD")}
1),(0,D.jsx)("div",{className:"pb-1",children:l("trade.holding_fee")}),(0,D.jsx)("div",{className:" pb-1 ml-auto font-semibold",children:"".concat((0,et.Ix)(e.fundingFee,2,"truncate")," USD")}),r&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)("div",{className:"pb-1",children:l("trade.lp_fee")}),(0,D.jsx)("div",{className:" pb-1 ml-auto font-semibold",children:"".concat((0,et.Ix)(null!=(t=e.lpFee)?t:0,2,"truncate")," USD")})]})]})]})}),(0,D.jsx)("span",{className:"".concat(a," underline decoration-dotted decoration-0.5 underline-offset-2"),children:"".concat((0,et.Ix)((0,tn.N)(e.fee,e.fundingFee,e.lpFee),2,"truncate")," USD")})]})},pt:{headerTitle:()=>({className:"text-text-light text-xs font-normal"}),headerCell:()=>({className:"!py-2"}),bodyCell:()=>({className:"text-text-dark text-xs !p-0"})}}),(0,D.jsx)(te.V,{header:l("trade.position_pnl"),body:e=>{let t=e.positionPnl,l="open"===e.tradeType,a=l?"text-text-dark":Number(t)>0?"text-[#2ebd85]":0>Number(t)?"text-[#E43C5A]":"text-text-dark";return(0,D.jsx)("div",{className:"flex px-4 ".concat(a),children:"".concat(l?"0":(0,et.Ix)(t,2,"truncate")," USD")})},pt:{headerTitle:()=>({className:"text-text-light text-xs font-normal"}),headerCell:()=>({className:"!py-2"}),bodyCell:()=>({className:"text-text-dark text-xs !p-0"})}}),(0,D.jsx)(te.V,{header:l("trade.closed_pnl"),body:e=>{let t="close"===e.tradeType,l=t&&e.realizedPnl>0?"text-[#2ebd85]":t&&e.realizedPnl<0?"text-[#E43C5A]":"text-text-dark";return(0,D.jsxs)("div",{className:"flex w-full px-4 items-center gap-1 ".concat(l),children:[(0,D.jsx)("span",{children:"".concat((0,et.Ix)(e.realizedPnl,2,"up")," USD")}),t&&!m&&(0,D.jsx)("button",{type:"button",className:"flex h-7 w-7 cursor-pointer items-center justify-center rounded-md opacity-100 transition-opacity hover:opacity-60",onClick:()=>v(e),children:(0,D.jsx)(tl.A,{className:"w-3.5 h-3.5 fill-current text-text-light"})})]})},pt:{headerTitle:()=>({className:"text-text-light text-xs font-normal"}),headerCell:()=>({className:"!py-2"}),bodyCell:()=>({className:"text-text-dark text-xs !p-0"})}})]},a.language)}),i?(0,D.jsx)("div",{className:"text-text-dark w-full min-h-[218px] h-[calc(100%-40px)] flex items-center justify-center bg-main-background absolute top-[32px] left-[50%] translate-x-[-50%] ",children:(0,D.jsx)(er.A,{className:"w-12 h-12"})}):(0,D.jsx)(D.Fragment,{})]}),!i&&f.length>19&&(0,D.jsx)("div",{className:"sticky bottom-0 text-main-color text-sm font-medium pl-3 py-1.5 bg-main-background border-t border-border-color cursor-pointer",onClick:()=>{g.push("/portfolio?p=1")},children:l("trade.view_all")})]})},tc=e=>{let{symbolChangeCallback:t}=e,{t:l,i18n:a}=(0,W.Bd)(),[r,n]=(0,H.useState)(!0),s=(0,ey.kH)(e=>e.isLogined),i=(0,K.WG)(e=>e.openOrderList),c=(0,K.WG)(e=>e.tokenMap),o=async()=>{if(!(0,ey.W5)()||i.length>0)return void n(!1);n(!0),await (0,K.vX)(),n(!1)};return(0,H.useEffect)(()=>{s?o():n(!1)},[s]),(0,D.jsxs)("div",{className:"min-h-[250px] cus-table relative overflow-y-auto",children:[(0,D.jsx)("div",{className:"guide-click-area",children:(0,D.jsxs)(tt.b,{value:i,scrollable:!0,scrollHeight:"flex",pt:{thead:()=>({className:"!bg-main-background"}),bodyRow:()=>({className:"hover:!bg-token-list-item-hover-color"})},emptyMessage:(0,D.jsx)("div",{className:"text-text-dark flex items-center justify-center h-[218px]",children:(0,D.jsx)(tr.A,{text:l("trade.no_open_order_yet")})}),children:[(0,D.jsx)(te.V,{body:e=>(0,D.jsx)("div",{className:"flex relative h-[42px] items-center",children:(0,et.Ey)(e.timestamp)}),header:l("trade.time"),pt:{headerTitle:()=>({className:"text-text-light text-xs font-normal"}),headerCell:()=>({className:"!py-2"}),bodyCell:()=>({className:"text-text-light text-xs !py-1"})}}),(0,D.jsx)(te.V,{body:e=>{let t="";return"limit"===e.type?t=l("trade.limit"):"stop_market"===e.type?t=l("trade.stop_market"):"take_profit_market"===e.type&&(t=l("trade.take_profit_market")),(0,D.jsx)("div",{className:"flex text-text-dark",children:"".concat(t)})},header:l("trade.type"),pt:{headerTitle:()=>({className:"text-text-light text-xs font-normal"}),headerCell:()=>({className:"!py-2"}),bodyCell:()=>({className:"text-text-light text-xs !py-1"})}}),(0,D.jsx)(te.V,{body:e=>(0,D.jsx)("div",{className:"flex cursor-pointer ".concat("long"===e.side&&!e.reduceOnly||"short"===e.side&&e.reduceOnly?"text-[#2ebd85]":"text-[#E43C5A]"),onClick:()=>{t(e.symbol)},children:"".concat((0,et.vT)(e.symbol))}),header:l("trade.coin"),pt:{headerTitle:()=>({className:"text-text-light text-xs font-normal"}),headerCell:()=>({className:"!py-2"}),bodyCell:()=>({className:"text-text-light text-xs !py-1"})}}),(0,D.jsx)(te.V,{body:e=>(0,D.jsx)("div",{className:"flex whitespace-pre-wrap ".concat("long"===e.side&&!e.reduceOnly||"short"===e.side&&e.reduceOnly?"text-[#2ebd85]":"text-[#E43C5A]"),
1children:"".concat(e.reduceOnly?"Close":""," ").concat("long"===e.side?l("trade.long"):l("trade.short"))}),header:l("trade.direction"),pt:{headerTitle:()=>({className:"text-text-light text-xs font-normal"}),headerCell:()=>({className:"!py-2"}),bodyCell:()=>({className:"text-text-light text-xs !py-1"})}}),(0,D.jsx)(te.V,{body:e=>{let t=(0,ts.U)(e.quantity,c[e.symbol]);return(0,D.jsx)("div",{className:"flex text-text-dark",children:t})},header:l("trade.size"),pt:{headerTitle:()=>({className:"text-text-light text-xs font-normal"}),headerCell:()=>({className:"!py-2"}),bodyCell:()=>({className:"text-text-light text-xs !py-1"})}}),(0,D.jsx)(te.V,{body:e=>{let t=(0,eN.ez)(e.triggerPrice,e.quantity);return(0,D.jsx)("div",{className:"flex text-text-dark",children:"".concat((0,et.hE)(t)," USD")})},header:l("trade.order_value"),pt:{headerTitle:()=>({className:"text-text-light text-xs font-normal"}),headerCell:()=>({className:"!py-2"}),bodyCell:()=>({className:"text-text-dark text-xs !py-1"})}}),(0,D.jsx)(te.V,{body:e=>(0,D.jsx)("div",{className:"flex text-text-dark",children:"".concat((0,et.hE)("long"===e.side?e.longPrice:e.shortPrice,e.pricePrecision,!0,"round"))}),header:l("trade.current_rate"),pt:{headerTitle:()=>({className:"text-text-light text-xs font-normal"}),headerCell:()=>({className:"!py-2"}),bodyCell:()=>({className:"text-text-dark text-xs !py-1"})}}),(0,D.jsx)(te.V,{body:e=>{let t=l("trade.price_above");return e.reduceOnly&&"limit"===e.type&&"long"!==e.side?t=l("trade.price_below"):e.reduceOnly||"limit"!==e.type||"short"===e.side?"short"===e.side&&"take_profit_market"===e.type?t=l("trade.price_below"):"long"===e.side&&"stop_market"===e.type&&(t=l("trade.price_below")):t=l("trade.price_below"),(0,D.jsx)("div",{className:"w-fit flex text-xs text-text-dark",children:"".concat(t," ").concat((0,et.hE)((0,et.Ik)(e.side,e.triggerPrice,e.firstSpread),e.pricePrecision))})},header:l("trade.trigger_conditions"),pt:{headerTitle:()=>({className:"text-text-light text-xs font-normal"}),headerCell:()=>({className:"!py-2"}),bodyCell:()=>({className:"text-text-dark text-xs !py-1"})}}),(0,D.jsx)(te.V,{body:e=>{let t="limit"===e.type;return(0,D.jsxs)("div",{className:"w-fit flex flex-row",children:[!t&&(0,D.jsx)(eg.m,{target:".has-tip",position:"top",content:l("trade.can_not_cancel"),pt:{root:{className:"w-[320px]"},arrow:{className:"border-t-white!"}}}),(0,D.jsx)("div",{className:"w-fit flex text-xs ".concat(t?"text-[#2ebd85]":"has-tip text-text-light"," cursor-pointer  underline decoration-dotted decoration-0.5 underline-offset-2"),onClick:()=>(e=>{(0,Z.$s)(Z.Sc),"limit"===e.type&&(0,L.Qh)(e.orderId).then(()=>{o(),(0,eD.P0)("success",l("trade.open_order_cancel_success"))}).catch(()=>{})})(e),children:l("trade.cancel")})]})},header:l("trade.cancel"),style:{width:"10%"},pt:{headerTitle:()=>({className:"text-text-light text-xs font-normal"}),headerCell:()=>({className:"!py-2"}),bodyCell:()=>({className:"text-text-dark text-[10px] !py-1"})}})]},a.language)}),r?(0,D.jsx)("div",{className:"text-text-dark w-full min-h-[218px] h-[calc(100%-40px)] flex items-center justify-center bg-main-background absolute top-[32px] left-[50%] translate-x-[-50%] ",children:(0,D.jsx)(er.A,{className:"w-12 h-12"})}):(0,D.jsx)(D.Fragment,{})]})};var to=l(38767);let td=e=>{let{symbolChangeCallback:t}=e,{t:l,i18n:a}=(0,W.Bd)(),r=(0,K.WG)(e=>e.positionList),n=(0,K.WG)(e=>e.tokenMap),{showClosePositionDialog:s,showEditOpenOrderTPSLDialog:i,showCloseAllPositionDialog:c,showShareProfitDialog:o}=(0,ej.s)(),[d,x]=(0,H.useState)(!0),[u,m]=(0,H.useState)(""),h=(0,ey.kH)(e=>e.isLogined),p=(0,ey.kH)(e=>e.userInfo),f=(null==p?void 0:p.accountType)===0,g=async e=>{var t;if(f)return;let a=u;if(!a){try{let e=await (0,L.ir)();a=(null==e?void 0:e.inviteCode)||""}catch(e){(0,eD.P0)("error",l("home.network_error"));return}a&&m(a)}if(!a)return;let r=e.returnRate?"".concat((e.returnRate>0?"+":"")+(0,et.Ix)(e.returnRate,2,"up"),"%"):"".concat((e.unrealizedPnl>0?"+":"")+(0,et.Ix)(e.unrealizedPnl/e.margin*100,2,"up"),"%"),n=new Date,s=n.getUTCFullYear(),i=String(n.getUTCMonth()+1).padStart(2,"0"),c=String(n.getUTCDate()).padStart(2,"0"),d=String(n.getUTCHours()).padStart(2,"0"),x=String(n.getUTCMinutes()).padStart(2,"0"),h=String(n.getUTCSeconds()).padStart(2,"0"),g="".concat(s,"/").concat(i,"/").concat(c," (UTC+0)").concat(d,":").concat(x,":").concat(h);o({referralCode:a,symbol:e.symbol,side:null==(t=e.positionSide)?void 0:t.toUpperCase(),leverage:Number(e.leverage),profitPercent:r,profitAmount:"".concat(e.unrealizedPnl>0?"+":"").concat((0,et.Ix)(e.unrealizedPnl,2,"up")," USD"),entryPrice:"".concat((0,et.hE)(e.showEntryPrice,e.pricePrecision||2)," USD"),closePrice:"".concat((0,et.hE)(e.currentRate,e.pricePrecision||2,!0,"round")," USD"),displayName:(null==p?void 0:p.accountAddress)?(0,et.UQ)(p.accountAddress):"Anonymous",time:g,isOpenPosition:!0})},v=()=>{0!==r.length&&c()},b=async()=>
1{if(!(0,ey.W5)())return void x(!1);0===r.length&&x(!0),await (0,K.cR)(),x(!1)};return(0,H.useEffect)(()=>{h&&b()},[h]),(0,D.jsxs)("div",{className:"min-h-[250px] cus-table relative overflow-y-auto",children:[(0,D.jsx)("div",{className:"guide-click-area",children:(0,D.jsxs)(tt.b,{value:r,scrollHeight:"flex",pt:{thead:()=>({className:"!bg-main-background"}),bodyRow:()=>({className:"hover:!bg-token-list-item-hover-color"})},emptyMessage:(0,D.jsx)("div",{className:"text-text-dark flex items-center justify-center h-[218px]",children:(0,D.jsx)(tr.A,{text:l("trade.no_positions_yet")})}),children:[(0,D.jsx)(te.V,{body:e=>(0,D.jsx)("div",{className:"flex text-text-dark h-[42px] items-center cursor-pointer",onClick:()=>{t(e.symbol,e.positionId)},children:"".concat((0,et.vT)(e.symbol))}),header:l("trade.coin"),pt:{headerTitle:()=>({className:"text-text-light text-xs font-normal"}),headerCell:()=>({className:"!py-2 !pl-4 !pr-2"}),bodyCell:()=>({className:"text-text-light text-xs !py-1 !pl-4 !pr-2"})}}),(0,D.jsx)(te.V,{body:e=>{let t=(0,ts.U)(e.quantity,n[e.symbol]);return(0,D.jsx)("div",{className:"flex text-text-dark",children:t})},header:l("trade.size"),pt:{headerTitle:()=>({className:"text-text-light text-xs font-normal"}),headerCell:()=>({className:"!py-2 !px-2"}),bodyCell:()=>({className:"text-text-light text-xs !py-1 !px-2"})}}),(0,D.jsx)(te.V,{body:e=>(0,D.jsx)("div",{className:"flex whitespace-pre-wrap ".concat("long"===e.positionSide?"text-[#2ebd85]":"text-[#E43C5A]"),children:"".concat("long"===e.positionSide?l("trade.long"):l("trade.short"),"  ").concat(e.leverage,"x")}),header:l("trade.direction"),pt:{headerTitle:()=>({className:"text-text-light text-xs font-normal"}),headerCell:()=>({className:"!py-2 !px-2"}),bodyCell:()=>({className:"text-text-light text-xs !py-1 !px-2"})}}),(0,D.jsx)(te.V,{body:e=>(0,D.jsx)("div",{className:"flex text-text-dark",children:"".concat((0,et.hE)(e.notionalValue)," USD")}),header:l("trade.position_value"),pt:{headerTitle:()=>({className:"text-text-light text-xs font-normal"}),headerCell:()=>({className:"!py-2 !px-2"}),bodyCell:()=>({className:"text-text-dark text-xs !py-1 !px-2"})}}),(0,D.jsx)(te.V,{body:e=>(0,D.jsx)("div",{className:"flex text-text-dark",children:"".concat((0,et.hE)((0,et.Ik)(e.positionSide,e.entryPrice,0),e.pricePrecision||2))}),header:l("trade.enter_price"),pt:{headerTitle:()=>({className:"text-text-light text-xs font-normal"}),headerCell:()=>({className:"!py-2 !px-2"}),bodyCell:()=>({className:"text-text-dark text-xs !py-1 !px-2"})}}),(0,D.jsx)(te.V,{body:e=>(0,D.jsx)("div",{className:"flex text-text-dark",children:"".concat((0,et.hE)(e.currentRate,e.pricePrecision||2,!0,"round"))}),header:l("trade.current_rate"),pt:{headerTitle:()=>({className:"text-text-light text-xs font-normal"}),headerCell:()=>({className:"!py-2 !px-2"}),bodyCell:()=>({className:"text-text-dark text-xs !py-1 !px-2"})}}),(0,D.jsx)(te.V,{body:e=>(0,D.jsx)("div",{className:"flex flex-col text-text-dark",children:(0,D.jsx)("span",{children:"".concat((0,et.hE)(e.margin)," USD")})}),header:l("trade.collateral"),pt:{headerTitle:()=>({className:"text-text-light text-xs font-normal"}),headerCell:()=>({className:"!py-2 !px-2"}),bodyCell:()=>({className:"text-text-dark text-xs !py-1 !px-2"})}}),(0,D.jsx)(te.V,{body:e=>{let t=e.unrealizedPnl>0?"text-[#2ebd85]":"text-[#E43C5A]";return(0,D.jsxs)("div",{className:"flex w-full items-center gap-1 ".concat(t),children:[(0,D.jsxs)("div",{className:"flex flex-col",children:[(0,D.jsx)("span",{children:"".concat((0,et.ax)(e.unrealizedPnl,2))}),(0,D.jsx)("span",{children:"".concat((0,et.wd)(e.returnRate),"%")})]}),!f&&(0,D.jsx)("button",{type:"button",className:"flex h-7 w-7 cursor-pointer items-center justify-center rounded-md opacity-100 transition-opacity hover:opacity-60",onClick:()=>g(e),children:(0,D.jsx)(tl.A,{className:"w-3.5 h-3.5 fill-current text-text-light"})})]})},header:l("trade.pnl"),style:{width:"15%"},pt:{headerTitle:()=>({className:"text-text-light text-xs font-normal"}),headerCell:()=>({className:"!py-2 !px-2"}),bodyCell:()=>({className:"text-text-dark text-xs !py-1 !px-2"})}}),(0,D.jsx)(te.V,{body:e=>(0,D.jsx)("div",{className:"flex text-text-dark",children:"".concat(0!==e.liquidationPrice?(0,et.hE)(e.liquidationPrice,e.pricePrecision||2):"--")}),header:(0,D.jsxs)("div",{className:"text-text-light text-xs underline decoration-dotted",children:[(0,D.jsx)(eg.m,{target:".liq-price-tip",position:"top",content:l("trade.liq_price_tip"),pt:{root:{className:"w-[280px]"}}}),(0,D.jsx)("span",{className:"liq-price-tip",children:l("trade.liq_price")})]}),pt:{headerTitle:()=>({className:"text-text-light text-xs font-normal"}),headerCell:()=>({className:"!py-2 !px-2"}),bodyCell:()=>({className:"text-text-dark text-xs !py-1 !px-2"})}}),(0,D.jsx)(te.V,{body:e=>{let t,l;
1(e.takeProfitStopLossOrders||[]).forEach(a=>{"take_profit_market"===a.type?t=Number((0,et.oT)(e.positionSide,(null==a?void 0:a.triggerPrice)||0,(null==a?void 0:a.spread)||0)):"stop_market"===a.type&&(l=Number((0,et.oT)(e.positionSide,(null==a?void 0:a.triggerPrice)||0,(null==a?void 0:a.spread)||0)))});let a=void 0===t?"--":(0,et.hE)(t,e.pricePrecision),r=void 0===l?"--":(0,et.hE)(l,e.pricePrecision),n="".concat(a," / ").concat(r);return(0,D.jsxs)("div",{className:"flex flex-row items-center cursor-pointer",onClick:()=>{(0,Z.$s)(Z.$Q),(0,Z.$s)(Z.U3),i(0,e.positionId,e=>{e&&!eT.z.isConnected()&&(0,K.gX)()})},children:[(0,D.jsx)("span",{className:"text-text-dark underline decoration-dotted decoration-0.5 underline-offset-2",children:n}),(0,D.jsx)(to.A,{className:"ml-2 h-4 w-4 shrink-0 text-text-light fill-current"})]})},header:l("trade.tp_sl"),style:{width:"15%"},pt:{headerTitle:()=>({className:"text-text-light text-xs font-normal"}),headerCell:()=>({className:"!py-2 !px-2"}),bodyCell:()=>({className:"text-text-dark text-xs !py-1 !px-2"})}}),(0,D.jsx)(te.V,{body:e=>(0,D.jsx)("div",{className:"w-fit flex flex-row",children:(0,D.jsx)("div",{className:"w-fit flex text-xs font-medium text-[#2ebd85]  cursor-pointer underline decoration-dotted decoration-0.5 underline-offset-2",onClick:()=>{var t;return t=e,void((0,Z.$s)(Z.bX),s(t,()=>{}))},children:l("trade.market_price")})}),header:()=>(0,D.jsx)("div",{className:"text-main-color text-xs font-medium rounded-[6px] cursor-pointer underline decoration-dotted",onClick:v,children:(0,D.jsx)("span",{children:l("trade.close_all")})}),style:{width:"7%"},pt:{headerTitle:()=>({className:"text-text-light text-xs font-normal"}),headerCell:()=>({className:"!py-2 !px-2"}),bodyCell:()=>({className:"text-text-dark text-[10px] !py-1 !px-2"})}})]},a.language)}),d?(0,D.jsx)("div",{className:"text-text-dark w-full min-h-[218px] h-[calc(100%-40px)] flex items-center justify-center bg-main-background absolute top-[32px] left-[50%] translate-x-[-50%] ",children:(0,D.jsx)(er.A,{className:"w-12 h-12"})}):(0,D.jsx)(D.Fragment,{})]})};var tx=l(56185);let tu=e=>{let{recordRef:t,symbolChangeCallback:l}=e,{t:a}=(0,W.Bd)(),r=(0,ey.kH)(e=>e.isLogined),n=(0,K.WG)(e=>e.positionNum),s=(0,K.WG)(e=>e.openOrderNum),{showSelectWalletDialog:i}=(0,ej.s)(),c=[a("trade.holder_position"),a("trade.open_orders"),a("assets.trade_history")],[o,d]=(0,H.useState)(0),x=(e,t)=>{l(e,t)},u=()=>{};return(0,H.useEffect)(()=>{t&&"function"!=typeof t&&(t.current={refreshData:u,symbolChangeCallback:x})},[t]),(0,D.jsxs)("div",{className:"flex flex-col w-full h-[calc(100vh-209px)]",children:[(0,D.jsx)("div",{className:"flex items-center border-b border-border-color md:border-panel-border-color",children:c.map((e,t)=>(0,D.jsxs)("div",{className:"px-3 py-2.5 flex justify-center relative text-base cursor-pointer",onClick:()=>(e=>{if(e!==o)switch(d(e),e){case 0:(0,Z.$s)(Z.L$);break;case 1:(0,Z.$s)(Z.O1);break;case 2:(0,Z.$s)(Z.mE)}})(t),children:[(0,D.jsx)("span",{className:"text-sm ".concat(o===t?"text-text-dark font-semibold":"text-text-light font-medium"),children:((e,t)=>0===e?n>0?"".concat(t," (").concat(n,")"):t:1===e&&s>0?"".concat(t," (").concat(s,")"):t)(t,e)}),o===t&&(0,D.jsx)("span",{className:"absolute left-1/2 -translate-x-1/2 bottom-0 w-6 h-[3px] bg-text-dark rounded-full transition-all"})]},e))}),!r&&(0,D.jsx)("div",{className:"text-text-dark w-full h-[218px] flex items-center justify-center",children:(0,D.jsx)(tx.A,{text:a("home.trade_connect_wallet_title"),onClick:i})}),r&&0===o&&(0,D.jsx)(td,{symbolChangeCallback:l}),r&&1===o&&(0,D.jsx)(tc,{symbolChangeCallback:l}),r&&2===o&&(0,D.jsx)(ti,{symbolChangeCallback:l})]})};var tm=l(34852),th=l(66693);function tp(){return(tp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let tf=function(e){return H.createElement("svg",tp({xmlns:"http://www.w3.org/2000/svg",width:40,height:20,fill:"none"},e),u||(u=H.createElement("path",{fill:"currentColor",d:"M16 10.242c0-2.23 1.663-4.035 4.03-4.035 1.437 0 2.318.501 3.049 1.203l-.882 1.003c-.63-.577-1.284-.978-2.191-.978-1.487 0-2.57 1.228-2.57 2.732v.025c0 1.529 1.083 2.757 2.57 2.757.957 0 1.561-.376 2.242-1.003l.881.878c-.806.852-1.713 1.378-3.174 1.378-2.267.025-3.955-1.73-3.955-3.96m8.339-3.91h1.46l2.369 3.685 2.393-3.685h1.461v7.77h-1.385V8.538l-2.47 3.659h-.024l-2.444-3.634v5.539h-1.36zm9.144 0h5.795V7.56h-4.41v2.005h3.906v1.229h-3.905v2.08h4.459v1.228h-5.845z"})),m||(m=H.createElement("path",{fill:"#0071BA",d:"M10.047 9.499H6.734V6.41h2.773c.324.934.504 1.975.54 3.089M3.025 6.41H.612L0 7.02V9.5h2.52c0-1.114.18-2.155.505-3.089M2.52 9.965H0v2.514l.576.575h2.449a9.4 9.4 0 0 1-.504-3.089m4.213 3.556v2.729h.54c.865-.682 1.549-1.58 2.053-2.73zM5.006 3.25h-1.26L1.08 5.943h2.125a7.54 7.54 0 0 1 1.8-2.693m4.933 9.804h2.449l.612-.61V9.93h-2.52q-.056 1.723-.54 3.124m1.98-7.11L9.22 3.25H7.994a7.54 7.54 0 0 1 1.801 2.693zm-1.872 4.021H6.734v3.089h2.737c.36-.934.54-1.975.576-3.089m2.34-3.555H9.976c.324.934.504 1.975.504 3.089H13V7.02zm-8.894 6.644h2.773V9.965H2.953c.036 1.114.216 2.155.54 3.089m.18-7.11h2.593V3.25H5.69c-.865.646-1.549 1.58-2.017 2.693M7.31 3.25h-.576v2.693h2.593C8.859 4.83 8.175 3.896 7.31 3.25M1.044 13.52l2.737 2.73h1.26a7.8 7.8 0 0 1-1.836-2.73zm4.682 2.73h.54v-2.73H3.673c.504 1.114 1.189 2.048 2.053 2.73m2.232 0h1.26l2.738-2.73H9.795a7.8 7.8 0 0 1-1.837 2.73M2.953 9.499h3.313V6.41H3.493c-.324.934-.504 1.975-.54 3.089"})))};function tg(){return(tg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let tv=function(e){return H.createElement("svg",tg({xmlns:"http://www.w3.org/2000/svg",width:37,height:12,fill:"none"},e),h||(h=H.createElement("path",{fill:"currentColor",d:"M14.676 6.224c0-2.046 1.525-3.7 3.696-3.7 1.317 0 2.126.46 2.796 1.103l-.809.92c-.577-.53-1.178-.897-2.01-.897-1.363 0-2.356 1.126-2.356 2.505v.023c0 1.402.993 2.529 2.356 2.529.878 0 1.433-.345 2.057-.92l.808.805c-.739.781-1.57 1.264-2.91 1.264-2.08.023-3.628-1.586-3.628-3.632m7.647-3.586h1.34l2.172 3.38 2.195-3.38h1.34v7.126H28.1V4.66l-2.265 3.356h-.023l-2.241-3.333v5.08h-1.248zm8.387 0h5.314v1.127h-4.043v1.839h3.581V6.73h-3.581v1.908h4.09v1.126h-5.36z"})),p||(p=H.createElement("path",{fill:"#0071BA",d:"M9.249 5.768h-3.05v-2.85H8.75c.299.861.464 1.822.498 2.85m-6.464-2.85H.564L0 3.48v2.287h2.32c0-1.028.166-1.989.465-2.85m-.465 3.28H0V8.52l.53.53h2.255A8.7 8.7 0 0 1 2.32 6.2M6.2 9.482V12h.497c.796-.63 1.426-1.459 1.89-2.52zM4.608 0h-1.16L.994 2.486H2.95A7 7 0 0 1 4.608 0m4.541 9.05h2.254l.564-.564v-2.32h-2.32q-.051 1.59-.498 2.884m1.823-6.564L8.486 0H7.36a7 7 0 0 1 1.658 2.486zM9.25 6.2h-3.05v2.85h2.52c.33-.861.496-1.822.53-2.85m2.154-3.282h-2.22c.298.862.463 1.823.463 2.851h2.32V3.481zM3.215 9.05h2.553V6.199h-3.05c.033 1.028.2 1.989.497 2.85m.166-6.564h2.387V0h-.53C4.442.597 3.812 1.459 3.38 2.486M6.73 0H6.2v2.486h2.387C8.155 1.46 7.525.596 6.729 0M.961 9.48 3.481 12h1.16a7.2 7.2 0 0 1-1.69-2.52zM5.271 12h.497V9.48H3.381c.464 1.028 1.094 1.89 1.89 2.52m2.055 0h1.16l2.52-2.52h-1.99A7.2 7.2 0 0 1 7.327 12M2.718 5.768h3.05v-2.85H3.215c-.298.861-.464 1.822-.497 2.85"})))};function tb(){return(tb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let tj=function(e){return H.createElement("svg",tb({xmlns:"http://www.w3.org/2000/svg",width:38,height:20,fill:"none"},e),H.createElement("g",{clipPath:"url(#ic_ice_svg__a)"},f||(f=H.createElement("path",{fill:"currentColor",d:"M4.727 16.107h.777v-3.845h-.777z"})),H.createElement("mask",{id:"ic_ice_svg__b",width:435,height:563,x:-371,y:-482,maskUnits:"userSpaceOnUse",style:{maskType:"luminance"}},g||(g=H.createElement("path",{fill:"#fff",d:"M-370.57 80.844H63.809v-562.138H-370.57z"}))),v||(v=H.createElement("g",{fill:"currentColor",mask:"url(#ic_ice_svg__b)"},H.createElement("path",{d:"M8.18 12.74c.384 0 .628.094.765.172l.053.03.183-.623-.036-.018c-.182-.092-.546-.2-.966-.2-.607 0-1.126.2-1.5.577-.362.365-.562.885-.562 1.462s.181 1.07.523 1.424c.345.357.826.545 1.392.545.486 0 .896-.124 1.099-.23l.033-.018-.137-.604-.054.023c-.2.088-.445.183-.817.183-.75 0-1.253-.544-1.253-1.354 0-.383.116-.727.328-.97.228-.261.555-.399.948-.399M11.193 12.678q.385 0 .615.233c.242.246.278.616.282.778h-1.887c.062-.4.33-1.01.99-1.01m1.328.062c-.279-.423-.72-.646-1.274-.646-.538 0-.996.209-1.325.604-.31.372-.48.892-.48 1.465s.173 1.06.501 1.406c.336.354.816.54 1.39.54.6 0 1.02-.133 1.266-.245l.036-.016-.138-.582-.053.022c-.232.099-.517.19-1.018.19-.35 0-.647-.101-.861-.293q-.351-.317-.375-.911h2.62
16l.008-.074c.009-.072.02-.169.02-.292 0-.204-.031-.725-.323-1.168"}))),b||(b=H.createElement("path",{fill:"#73C7E8",d:"M.113 3.36v12.777h2.532v-1.453h-1.08v-9.87h9.9v5.453h1.424V3.36z"}))),j||(j=H.createElement("path",{fill:"currentColor",d:"M27.799 5.25q1.12 0 1.88.5.773.497 1.221 1.47l-1.183.648a2.1 2.1 0 0 0-.698-.985q-.46-.375-1.22-.374-1.01 0-1.583.698t-.573 1.907v1.334q0 1.196.573 1.87.574.672 1.582.673.773 0 1.27-.4.5-.41.736-1.046l1.134.685a3.6 3.6 0 0 1-1.234 1.483q-.785.537-1.905.537-1.134 0-1.957-.5-.822-.51-1.259-1.494-.435-.986-.436-2.456 0-1.458.436-2.468.437-1.021 1.26-1.545.821-.537 1.956-.537M22.764 6.547H21.58v6.406h1.184V14.1H19v-1.147h1.172V6.547H19V5.4h3.764zM38 6.646h-4.161v2.43h3.775v1.247H33.84v2.53H38V14.1h-5.57V5.4H38z"})),y||(y=H.createElement("defs",null,H.createElement("clipPath",{id:"ic_ice_svg__a"},H.createElement("path",{fill:"#fff",d:"M0 3.25h13v13H0z"})))))};function ty(){return(ty=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let tN=function(e){return H.createElement("svg",ty({xmlns:"http://www.w3.org/2000/svg",width:36,height:12,fill:"none"},e),H.createElement("g",{clipPath:"url(#ic_ice_mobile_svg__a)"},H.createElement("mask",{id:"ic_ice_mobile_svg__b",width:402,height:520,x:-343,y:-448,maskUnits:"userSpaceOnUse",style:{maskType:"luminance"}},N||(N=H.createElement("path",{fill:"#fff",d:"M-342.066 71.625H58.899v-518.897h-400.965z"}))),w||(w=H.createElement("g",{fill:"currentColor",mask:"url(#ic_ice_mobile_svg__b)"},H.createElement("path",{d:"M7.552 8.757c.355 0 .58.087.707.159l.049.028.169-.576-.034-.016a2.1 2.1 0 0 0-.891-.185c-.56 0-1.04.185-1.385.533-.334.337-.519.816-.519 1.35 0 .532.168.986.483 1.313.318.33.762.504 1.285.504.448 0 .827-.115 1.014-.213l.03-.016-.126-.558-.05.022c-.185.081-.41.168-.754.168-.692 0-1.156-.502-1.156-1.25 0-.353.107-.67.302-.895.21-.24.513-.368.876-.368M10.332 8.7q.355 0 .567.215c.224.227.257.568.26.718H9.418c.057-.369.305-.933.914-.933m1.226.057c-.258-.39-.665-.597-1.176-.597-.497 0-.92.194-1.224.558-.286.344-.443.824-.443 1.353 0 .53.16.979.463 1.298.31.326.753.498 1.283.498.554 0 .941-.123 1.169-.226l.033-.015-.128-.537-.048.02c-.215.091-.478.176-.94.176-.323 0-.598-.094-.795-.27q-.324-.293-.347-.842h2.425l.007-.068c.008-.066.02-.156.02-.27 0-.188-.03-.67-.3-1.078M4.363 11.866h.718v-3.55h-.718z"}))),A||(A=H.createElement("path",{fill:"#73C7E8",d:"M.102.101v11.794h2.337v-1.341h-.997V1.442h9.138v5.034h1.315V.101z"}))),k||(k=H.createElement("path",{fill:"currentColor",d:"M25.66 1.848q1.036 0 1.737.46.713.46 1.127 1.358l-1.092.598a1.94 1.94 0 0 0-.645-.909q-.425-.345-1.126-.345-.932 0-1.461.644-.53.645-.53 1.76v1.232q.001 1.104.53 1.725.529.622 1.46.622.714 0 1.173-.368.46-.38.68-.967l1.046.633a3.33 3.33 0 0 1-1.14 1.37q-.723.494-1.758.494-1.047 0-1.806-.46-.76-.472-1.162-1.38-.403-.91-.403-2.268 0-1.346.403-2.277.402-.944 1.162-1.427.759-.495 1.806-.495M21.013 3.045H19.92v5.913h1.093v1.06H17.54v-1.06h1.082V3.045h-1.082v-1.06h3.474zM35.078 3.136h-3.842V5.38h3.486v1.15h-3.486v2.337h3.842v1.15h-5.141V1.986h5.14z"})),E||(E=H.createElement("defs",null,H.createElement("clipPath",{id:"ic_ice_mobile_svg__a"},H.createElement("path",{fill:"#fff",d:"M0 0h12v12H0z"})))))};function tw(){return(tw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let tA=function(e){return H.createElement("svg",tw({xmlns:"http://www.w3.org/2000/svg",width:47,height:20,fill:"none"},e),_||(_=H.createElement("path",{fill:"#A59267",d:"M7.475 2.25c.146.334 1.291 3.088 1.437 3.4a4.376 4.376 0 0 0-5.83 4.13 4.376 4.376 0 0 0 4.372 4.382c.48 0 .937-.083 1.374-.23-.104.251-.208.543-.353.877l-1 2.441-1-2.44-1.853 1.877v-2.65L2.186 15.06l1.02-2.44H.563l1.874-1.857L0 9.74l2.436-1.002L.562 6.881h2.645l-1.02-2.44 2.435 1.022v-2.65l1.854 1.878z"})),S||(S=H.createElement("path",{fill:"currentColor",d:"m42.76 7.523.461-1.318.415 1.409c.23.772.968 3 .968 3h-2.811s.921-2.91.967-3.091m-.184-2.273-3.041 9h1.106l.875-2.773h3.41l.876 2.773H47l-2.995-9zm-12.627 9h1.06l.507-6.41a56 56 0 0 0 .092-1.726c.139.636.277 1.09.461 1.772l1.797 6.364h.922l1.936-6.727c.092-.364.276-.955.368-1.41 0 0 .046.955.046 1.546l.553 6.591h1.106l-.783-9H36.4l-1.705 5.954c-.138.455-.184.728-.323 1.455-.138-.682-.184-.955-.368-1.59l-1.66-5.819h-1.612zM23.82 6.16c.461 0 2.028 0 2.304.09.646.136 1.014.727 1.014 1.41 0 .226-.046.5-.138.68-.276.592-.6.774-1.613.774H23.82zm-1.06 8.09h2.35c1.337 0 1.567-.046 2.074-.227.922-.319 1.521-1.273 1.521-2.273 0-.727-.322-1.41-.83-1.818-.322-.227-.552-.318-1.198-.5 1.014-.318 1.613-1.046 1.613-1.955s-.645-1.727-1.566-2.045c-.461-.137-.922-.182-2.72-.182h-1.336v9zm2.673-4.227c.461 0 .83.045 1.06.09.645.137 1.106.819 1.106 1.592 0 .272-.046.5-.138.727-.277.727-.691.909-1.797.909h-1.798V9.97
17h1.567zm-7.327 3.318V5.25H17v9h4.562l.139-.91z"})),C||(C=H.createElement("path",{fill:"#A8A9AD",d:"M10.514 10.258c0-1.877-.563-3.63-1.541-5.09 2.27.584 3.956 2.65 3.956 5.09a5.28 5.28 0 0 1-3.956 5.112 9.24 9.24 0 0 0 1.54-5.112"})))};function tk(){return(tk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let tE=function(e){return H.createElement("svg",tk({xmlns:"http://www.w3.org/2000/svg",width:38,height:12,fill:"none"},e),P||(P=H.createElement("path",{fill:"#A59267",d:"M5.98 0c.117.267 1.033 2.47 1.15 2.72a3.501 3.501 0 0 0-4.664 3.305A3.5 3.5 0 0 0 5.962 9.53c.384 0 .75-.067 1.1-.184-.083.2-.167.434-.283.701L5.98 12l-.8-1.953-1.482 1.502V9.43l-1.949.819.816-1.953H.45l1.499-1.486L0 5.992l1.949-.801-1.5-1.486h2.116L1.75 1.752l1.949.818V.45L5.18 1.954z"})),M||(M=H.createElement("path",{fill:"currentColor",d:"m34.21 4.217.368-1.055.332 1.127c.185.619.775 2.4.775 2.4h-2.25s.738-2.327.775-2.472m-.148-1.819-2.433 7.2h.885l.7-2.218h2.729l.7 2.218h.959l-2.397-7.2zm-10.101 7.2h.848l.406-5.127c.036-.436.073-1.382.073-1.382.11.51.221.873.369 1.419l1.438 5.09h.737l1.548-5.381c.074-.291.222-.764.295-1.128 0 0 .037.764.037 1.237l.443 5.272h.884l-.626-7.2h-1.29l-1.365 4.764c-.11.364-.147.582-.258 1.164-.11-.546-.147-.764-.295-1.273l-1.327-4.655h-1.29zm-4.903-6.472c.368 0 1.622 0 1.843.072.516.11.811.582.811 1.128 0 .182-.037.4-.11.545-.222.473-.48.618-1.29.618h-1.254zm-.848 6.472h1.88c1.07 0 1.253-.036 1.659-.181.737-.255 1.217-1.019 1.217-1.819 0-.581-.259-1.127-.664-1.454-.258-.182-.442-.255-.959-.4.811-.255 1.29-.836 1.29-1.564 0-.727-.515-1.382-1.253-1.636-.368-.11-.737-.146-2.175-.146h-1.069v7.2zm2.138-3.381c.369 0 .664.036.848.072.516.11.885.655.885 1.273 0 .218-.037.4-.11.582-.222.582-.554.727-1.439.727h-1.437v-2.69h1.253zM14.486 8.87V2.398h-.884v7.2h3.65l.11-.727z"})),U||(U=H.createElement("path",{fill:"#A8A9AD",d:"M8.412 6.408A7.3 7.3 0 0 0 7.18 2.336c1.815.467 3.165 2.12 3.165 4.072 0 1.97-1.35 3.622-3.165 4.09a7.4 7.4 0 0 0 1.232-4.09"})))},t_={src:"/_next/static/media/ic_lppm.e8c73ba8.png",height:59,width:184,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAADCAMAAACZFr56AAAAJ1BMVEUfJB0jIyjlKTAfHygSJyfrWV7qREnMKjDUKjHAIiIAIyf/c3j/UVdm07tUAAAAC3RSTlMIVHofFn50WiQlQRCaKBUAAAAJcEhZcwAAITgAACE4AUWWMWAAAAAjSURBVHicY2BlZeJgYGZmYeDm5mHnYmRkZGBjYuNkYWBgAAAGjABwVTa/vwAAAABJRU5ErkJggg==",blurWidth:8,blurHeight:3},tS={src:"/_next/static/media/ic_lppm_dark.20c1a193.png",height:59,width:184,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAADCAMAAACZFr56AAAAJ1BMVEX/+PjpQkj////79/fnKjDqRUzrWV7/+vr/////XWP/e3//TlT/bXEHJJmQAAAAC3RSTlMIdBYfeiR+SFZa/hA/pNoAAAAJcEhZcwAAITgAACE4AUWWMWAAAAAhSURBVHicBcGFAQAwDMCg1G3/3zsg0wMzZd9NVTfiEgp8BvAAc9SiAXoAAAAASUVORK5CYII=",blurWidth:8,blurHeight:3},tC={src:"/_next/static/media/ic_lppm_mobile.ae3c103b.png",height:36,width:161,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAACCAMAAABSSm3fAAAAIVBMVEUkJigAERcvJSojIyndLzUfJCnbLzXpTVHucnb7SU7sV1tcSMhXAAAACXRSTlNEFTArgDGA+/vEKoF2AAAACXBIWXMAACE4AAAhOAFFljFgAAAAGklEQVR4nGPg4uBkY2RgYGDgYudkY2RiZgUAAw4ATsxI2W4AAAAASUVORK5CYII=",blurWidth:8,blurHeight:2},tP={src:"/_next/static/media/ic_lppm_mobile_dark.640dd25b.png",height:36,width:161,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAACCAMAAABSSm3fAAAAHlBMVEX/+vr////////nOz/pO0H/9PTpTVLucnb6R03sV1um2JaaAAAACHRSTlMuFUKAgEn7+9K+mc8AAAAJcEhZcwAAITgAACE4AUWWMWAAAAAaSURBVHicY+Bk52BmZGViYuBk42BhZGBgAAAC6gBCSkrtPwAAAABJRU5ErkJggg==",blurWidth:8,blurHeight:2};function tM(){return(tM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let tU=function(e){return H.createElement("svg",tM({xmlns:"http://www.w3.org/2000/svg",width:37,height:20,fill:"none"},e),z||(z=H.createElement("path",{fill:"#001EFF",d:"M36.294 11.149v2.281c0 .599.048 1.008.117 1.263v.069c-.785.255-1.996.461-2.887.461-3.37 0-5.551-1.958-5.551-4.962 0-3.005 2.065-5.011 5.248-5.011.97 0 1.948.176 2.564.461v1.986h-.07c-.615-.578-1.538-.92-2.525-.92-2.006 0-3.18 1.233-3.18 3.418s1.273 3.503 3.493 3.503c.292 0 .599-.03.881-.089v-2.388c-.881 0-1.37.069-1.82.158h-.07v-1.83h.07c.46.089.977.158 1.92.158h1.958v.068c-.09.265-.148.792-.148 1.38zM23.185 13.657h-1.098v-2.802h1.098c1.03 0 1.587.07 2.106.176h.07V9.152h-.07c-.52.117-1.067.176-2.106.176h-1.098V6.812h1.126c1.184 0 2.075.127 2.632.41h.049V5.39h-6.167v.068c.234.403.392 1.215.392 2.048v5.444c0 .843-.158 
11.656-.392 2.048v.069h6.5V13.11h-.068c-.733.382-1.732.547-2.977.547zM15.041 9.454c-1.252-.489-1.947-.733-1.947-1.556 0-.743.536-1.146 1.497-1.146.801 0 1.486.282 2.202.881h.069V5.675c-.637-.275-1.418-.41-2.203-.41-2.192 0-3.534 1.126-3.534 2.957s1.253 2.309 2.612 2.839c1.253.489 1.948.733 1.948 1.555 0 .744-.558 1.136-1.556 1.136s-1.82-.351-2.75-1.184h-.068v2.113c.774.362 1.783.568 2.732.568 2.234 0 3.614-1.125 3.614-2.936s-1.242-2.33-2.612-2.86zM6.242 13.657H5.36v-6.14c0-.842.158-1.654.392-2.054v-.068H3v.068c.234.403.392 1.215.392 2.055v5.444c0 .843-.158 1.655-.392 2.048v.069h6.284v-1.98h-.069c-.743.383-1.73.558-2.977.558z"})))};function tz(){return(tz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let tT=function(e){return H.createElement("svg",tz({xmlns:"http://www.w3.org/2000/svg",width:38,height:12,fill:"none"},e),T||(T=H.createElement("path",{fill:"#001EFF",d:"M35.29 6.898V9.18c0 .6.047 1.009.116 1.263v.07c-.784.254-1.995.46-2.887.46-3.369 0-5.55-1.958-5.55-4.962S29.033 1 32.216 1c.97 0 1.948.176 2.564.461v1.986h-.069c-.616-.578-1.538-.92-2.526-.92-2.006 0-3.18 1.233-3.18 3.418S30.28 9.448 32.5 9.448c.292 0 .598-.031.88-.09V6.97c-.88 0-1.369.07-1.82.159h-.069V5.298h.07c.46.09.976.158 1.92.158h1.957v.069c-.09.265-.148.791-.148 1.38zM22.181 9.406h-1.098v-2.8h1.098c1.029 0 1.586.068 2.106.175h.069V4.9h-.07c-.519.118-1.066.176-2.105.176h-1.098V2.562h1.126c1.183 0 2.075.127 2.632.41h.048V1.14h-6.166v.068c.234.403.392 1.215.392 2.048V8.7c0 .843-.158 1.655-.392 2.047v.069h6.5V8.859h-.069c-.733.382-1.73.547-2.977.547zM14.037 5.203c-1.253-.488-1.948-.733-1.948-1.555 0-.743.537-1.146 1.497-1.146.802 0 1.487.282 2.203.881h.068V1.425c-.636-.275-1.417-.41-2.202-.41-2.192 0-3.534 1.126-3.534 2.957s1.253 2.309 2.612 2.838c1.252.49 1.948.733 1.948 1.556 0 .743-.558 1.135-1.556 1.135s-1.82-.35-2.75-1.183h-.068v2.113c.774.36 1.782.567 2.732.567 2.233 0 3.613-1.125 3.613-2.935s-1.242-2.33-2.612-2.86zM5.242 9.407H4.36v-6.14c0-.842.158-1.654.392-2.054v-.068H2v.068c.234.403.392 1.215.392 2.055v5.444c0 .843-.158 1.655-.392 2.047v.069h6.283V8.849h-.068c-.744.382-1.731.558-2.977.558z"})))};function tR(){return(tR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let tD=function(e){return H.createElement("svg",tR({xmlns:"http://www.w3.org/2000/svg",width:8,height:5,fill:"none"},e),R||(R=H.createElement("path",{fill:"#6C757D",d:"M7.104 0c.69 0 1.12.521.775.938l-3.103 3.75c-.344.416-1.206.416-1.55 0L.12.938C-.223.52.208 0 .898 0z"})))};var tI=l(37127);let tO=H.memo(e=>{let{data:t}=e;return(0,D.jsxs)("div",{className:"flex items-center",children:[(0,D.jsx)("div",{className:"",children:(0,D.jsx)(J.A,{className:"w-6 h-6 shrink-1",image:t.imageUrl,width:24,height:24,name:t.name,symbol:t.symbol})}),(0,D.jsx)("span",{className:"text-text-dark text-sm ml-1.5 font-semibold",children:"".concat(t.name," ").concat(t.symbol)}),(0,D.jsx)("span",{className:"text-text-dark text-xs ml-1.5 bg-token-list-item-hover-color rounded-[6px] px-1.5 py-[2px]",children:"".concat(t.maxLeverage,"x")}),(0,D.jsx)(tV,{symbol:t.symbol})]})},function(e,t){let l=e.data,a=t.data;return l.symbol===a.symbol&&l.name===a.name&&l.imageUrl===a.imageUrl&&l.maxLeverage===a.maxLeverage});function tV(e){let{symbol:t}=e,l=(0,$.e0)(e=>{var l,a;return null!=(a=null==(l=e.symbolStatusMap[t])?void 0:l.showOffHour)&&a});return(0,D.jsx)("div",{className:"w-1.5 h-1.5 rounded-full ml-2 ".concat(l?"bg-[#E43C5A]":"bg-[#2EBD85]"),title:l?"Market closed":"Market open"})}function tH(e){var t,l;let{symbol:a,pricePrecision:r}=e,n=(0,K.WG)(e=>e.tokenMap[a]),s=null==n?void 0:n.currentPrice,i=null!=(l=null!=(t=null==n?void 0:n.pricePrecision)?t:r)?l:2;return(0,D.jsx)("div",{className:"text-[13px] w-full flex justify-end",children:(0,et.hE)(null!=s?s:0,i,!0,"round")})}tO.displayName="SymbolCell";let tL=e=>{let{callback:t}=e,{t:l}=(0,W.Bd)(),a=(0,K.WG)(e=>e.tokenListDisplay),r=(0,H.useCallback)(e=>(0,D.jsx)(tO,{data:e}),[]),n=(0,H.useCallback)(e=>(0,D.jsx)(tH,{symbol:e.symbol,pricePrecision:e.pricePrecision}),[]);return(0,D.jsx)("div",{className:"w-[520px] bg-panel-background rounded-[20px] py-2 ",children:(0,D.jsxs)(tt.b,{value:a,selectionMode:"single",metaKeySelection:!1,onSelectionChange:e=>(e=>{if(null!==e){var l;let a=null!=(l=K.WG.getState().tokenMap[e.symbol])?l:e;t(a),(0,Z.$s)(Z.De,{symbol:a.symbol})}})(e.value),pt:{thead:()=>({className:"border-b border-border-color"})},children:[(0,D.jsx)(te.V,{header:l("trade.token"),body:r,pt:{headerTitle:()=>({className:"text-text-light text-xs font-normal"}),headerCell:()=>({className:"!py-1.5 !border-[#40404A]"}),bodyCell:()=>({className:"text-text-dark text-xs !py-3"})}}),(0,D.jsx)(te.V,{body:n,header:l("trade.current_price"),pt:{headerTitle:()=>({className:"text-text-light text-xs font-normal"}),headerCell:()=>({className:"!py-1.5 !border-[#40404A]"}),headerContent:()=>({className:"flex justify-end"}),bodyCell:()=>({className:"text-text-dark text-xs !py-3"})}}),(0,D.jsx)(te.V,{body:e=>{let t=(0,$.e0)(t=>{var l,a;return null!=(a=null==(l=t.symbolStatusMap[e.symbol])?void 0:l.showOffHour)&&a});return(0,D.jsx)("span",{className:"text-[13px] whitespace-nowrap w-full flex justify-end ".concat(t?"text-text-light font-normal":e.changePercent>
10?"text-[#2ebd85]":"text-[#E43C5A]"),children:t?l("trade.closed"):e.changePercent>0?"+".concat((0,et.hE)(e.changePercent),"%"):"".concat((0,et.hE)(e.changePercent),"%")})},header:l("trade.24h_change"),pt:{headerTitle:()=>({className:"text-text-light text-xs font-normal"}),headerCell:()=>({className:"!py-1.5 !border-[#40404A]"}),headerContent:()=>({className:"flex justify-end"}),bodyCell:()=>({className:"text-xs !py-3"})}})]})})},tB=[1,2,3,4,5,6,0],tF=tW("01:10","23:55"),tG=[...tW("00:01","23:59",[1,2,3,4]),{dayIndex:5,start:"00:01",end:"23:55"}],tq={"XAU/USD":tF,"XAG/USD":tF,"XPT/USD":tF,"XPD/USD":tF,"NAS/USD":tF,"EUR/USD":tG,"GBP/USD":tG,"USD/JPY":tG};function tW(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[1,2,3,4,5];return l.map(l=>({dayIndex:l,start:e,end:t}))}function tX(e){let[t,l]=e.split(":").map(Number);return 60*t+l}function tQ(e){let t=(e%1440+1440)%1440,l=Math.floor(t/60);return"".concat(l.toString().padStart(2,"0"),":").concat((t%60).toString().padStart(2,"0"))}function tY(e){return(Math.floor(e/1440)%7+7)%7}let tJ=H.memo(e=>{let{variant:t}=e,l=(0,ee.mF)(e=>{var t;return null==(t=e.tokenInfo)?void 0:t.symbol}),a=(0,ee.mF)(e=>{var t;return(null==(t=e.tokenInfo)?void 0:t.currentPrice)||0}),r=(0,ee.mF)(e=>{var t;return(null==(t=e.tokenInfo)?void 0:t.pricePrecision)||2}),n=(0,ee.mF)(e=>{var t;return(null==(t=e.tokenInfo)?void 0:t.changePercent)||0});return l?"mobile"===t?(0,D.jsxs)("div",{className:"flex flex-col justify-center ml-4",children:[(0,D.jsx)("title",{children:"".concat((0,et.hE)(null!=a?a:0,r,!0,"round")," | ").concat(l," | XStable")}),(0,D.jsx)("span",{className:"".concat(n>0?"text-[#2ebd85]":"text-[#E43C5A]"," text-[30px] font-semibold"),children:(0,et.hE)(a||0,r,!0,"round")})]}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)("title",{children:"".concat((0,et.hE)(null!=a?a:0,r,!0,"round")," | ").concat(l," | XStable")}),(0,D.jsx)("span",{className:"".concat(n>0?"text-[#2ebd85]":"text-[#E43C5A]"," text-xl font-semibold ml-7 w-30"),children:(0,et.hE)(a||0,r,!0,"round")})]}):null});tJ.displayName="PriceNumber";let tZ=H.memo(e=>{let{variant:t,priceSourceNode:l,showOffHour:a}=e,{t:r}=(0,W.Bd)(),n=(0,ee.mF)(e=>{var t;return null==(t=e.tokenInfo)?void 0:t.changePercent}),s=(n||0)>0,i=a?r("trade.closed"):s?"+".concat((0,et.hE)(null!=n?n:0),"%"):"".concat((0,et.hE)(null!=n?n:0),"%");return"mobile"===t?(0,D.jsxs)("div",{className:"flex items-center gap-1 -mt-1 ml-4",children:[(0,D.jsx)("span",{className:"text-xs font-medium whitespace-nowrap ".concat(a?"text-text-light":s?"text-[#2ebd85]":"text-[#E43C5A]"),children:i}),l&&(0,D.jsx)("div",{className:"flex border border-dialog-divide-color rounded-[3px] px-1 py-0.5",children:l})]}):(0,D.jsxs)("div",{className:"flex flex-col justify-center",children:[(0,D.jsx)("span",{className:"text-text-light text-[13px]",children:r("trade.24h_change")}),(0,D.jsx)("span",{className:"text-[13px] font-medium whitespace-nowrap ".concat(a?"text-text-light":s?"text-[#2ebd85]":"text-[#E43C5A]"),children:i})]})});tZ.displayName="ChangePercentBlock";let t$=H.memo(e=>{let{symbol:t,name:l,imageUrl:a,onCountdownDone:r,onShowDialog:n,registerStep:s,currentStep:i}=e,{showTokenListDialog:c}=(0,ej.s)(),{next:o}=(0,q.Z)(),d=0===i;return(0,D.jsxs)("div",{className:"flex items-center ml-4 w-fit ".concat(d?"guide-click-area":""),onClick:e=>{if(d){e.preventDefault(),e.stopPropagation(),o();return}c(e=>{n(e,()=>{})})},ref:s,children:[(0,D.jsxs)("div",{className:"flex h-8 items-center cursor-pointer w-fit",children:[(0,D.jsx)(J.A,{className:"h-8 w-8 shrink-0",image:a,width:32,height:32,name:l,symbol:t}),(0,D.jsx)("span",{className:"text-text-dark text-base font-semibold ml-2.5",children:l}),(0,D.jsx)("span",{className:"text-text-dark text-base font-semibold py-0.5 rounded-[4px] ml-2",children:t})]}),(0,D.jsx)(ep,{symbol:t,compact:!0,className:"ml-2",onDone:r}),(0,D.jsx)(tD,{className:"ml-2"})]})});t$.displayName="MobileTokenHeader";let tK=e=>(0,et.fU)(e).slice(0,5),t0=H.memo(e=>{let{onDone:t,variant:l}=e,{t:a}=(0,W.Bd)(),r=(0,ee.mF)(e=>{var t;return null==(t=e.tokenInfo)?void 0:t.fundingRate}),n=(0,ee.mF)(e=>{var t;return null==(t=e.tokenInfo)?void 0:t.countdown}),[s,i]=(0,H.useState)(0);return((0,H.useEffect)(()=>
1{if(!n)return void i(0);let e=setInterval(()=>{let l=n-(0,et.mI)();i(l>0?l:0),l<=0&&(t(),clearInterval(e))},1e3);return()=>clearInterval(e)},[n,t]),"mobile"===l)?(0,D.jsxs)("div",{className:"flex flex-col justify-center ml-auto mr-4 gap-0.5",children:[(0,D.jsxs)("div",{className:"flex",children:[(0,D.jsx)("span",{className:"text-text-light text-xs",children:a("trade.hourly_holding_fee_8h")}),(0,D.jsx)("span",{className:"nl-auto w-16 text-text-dark text-xs font-semibold text-right ",children:"".concat((0,et.Ix)((0,eN.ez)(r||0,100)),"%")})]}),(0,D.jsxs)("div",{className:"flex",children:[(0,D.jsx)("span",{className:"text-text-light text-xs",children:a("trade.countdown")}),(0,D.jsx)("span",{className:"ml-auto w-16 text-text-dark text-xs font-semibold text-right",children:"".concat(0===s?"00:00":tK(s))})]})]}):(0,D.jsxs)("div",{className:"flex flex-col justify-center ml-7",children:[(0,D.jsx)("span",{className:"text-text-light text-[13px]",children:a("trade.funding_rate_time")}),(0,D.jsx)("span",{className:"text-text-dark text-[13px] font-medium",children:"".concat((0,et.Ix)((0,eN.ez)(r||0,100)),"% / ").concat(0===s?"00:00":tK(s))})]})});t0.displayName="FundingCountdown";let t1=H.memo(e=>{let{activeTab:t,onTabChange:l}=e,{t:a}=(0,W.Bd)(),r=[{key:"chart",label:a("trade.chart")},{key:"info",label:a("trade.info")}];return(0,D.jsx)("div",{className:"flex h-9 w-full items-center border-b border-border-color md:border-panel-border-color bg-main-background px-[18px]",children:(0,D.jsx)("div",{className:"flex h-full items-center gap-[25px]",children:r.map(e=>(0,D.jsxs)("button",{type:"button",className:"relative h-full text-sm font-medium ".concat(t===e.key?"text-text-dark":"text-text-light"),onClick:()=>l(e.key),children:[e.label,t===e.key&&(0,D.jsx)("span",{className:"absolute bottom-0 left-1/2 h-[3px] w-[18px] -translate-x-1/2 rounded-[2px] bg-text-dark"})]},e.key))})})});function t2(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,l=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(null==e||""===e)return"--";if(0===t){let t=Number(e);return Number.isFinite(t)?l?Math.round(t).toLocaleString("en-US"):"".concat(Math.round(t)):String(e)}return(0,et.hE)(e,t,l,"round")}function t3(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"--";return null==e?t:"".concat((0,et.Ix)((0,eN.ez)(e,100),4,"truncate"),"%")}function t5(e,t){return null!=e&&t?t2((0,eN.BP)(e,t),2,!1):"--"}t1.displayName="TraderInfoTabs";let t4=H.memo(e=>{let{week:t,rows:l}=e;return(0,D.jsx)("div",{className:"flex-1 flex w-full flex-col ".concat(t?"gap-3":""),children:l.map((e,l)=>(0,D.jsxs)(H.Fragment,{children:["-"===e.label&&(0,D.jsx)("div",{className:"my-[14px] h-px w-full bg-panel-border-color"}),"-"!==e.label&&(0,D.jsxs)("div",{className:"flex w-full justify-between items-center text-sm ".concat(e.value.includes("\n")?"min-h-[32px]":"h-[32px]"),children:[(0,D.jsxs)("div",{className:"flex min-h-6 items-center",children:[e.tooltip&&(0,D.jsx)(eg.m,{target:".contract-info-tip-".concat(l),position:"top",my:"left bottom",at:"left top",content:e.tooltip,pt:{root:{className:"w-[264px] whitespace-pre-line -mt-2"}}}),(0,D.jsx)("span",{className:"".concat(t?"text-text-dark":"text-text-light"," ").concat(e.tooltip?"contract-info-tip-".concat(l," underline decoration-dotted"):""),children:e.label})]}),(0,D.jsx)("span",{className:"ml-4 whitespace-pre-line text-right font-medium text-text-dark",children:e.value})]})]},"".concat(e.label,"-").concat(l)))})});t4.displayName="ContractInfoList";let t8=H.memo(()=>{let{t:e}=(0,W.Bd)(),t=(0,ee.mF)(e=>e.tokenInfo),l=null==t?void 0:t.symbol,a=null==t?void 0:t.name,r=null==t?void 0:t.imageUrl,n=(null==t?void 0:t.pricePrecision)||2,s=(0,H.useMemo)(()=>-new Date().getTimezoneOffset()/60,[]),[i,c]=(0,H.useState)("local"),o="local"===i?s:3,d=(0,H.useMemo)(()=>[e("trade.sunday"),e("trade.monday"),e("trade.tuesday"),e("trade.wednesday"),e("trade.thursday"),e("trade.friday"),e("trade.saturday")],[e]),x=(null==t?void 0:t.leverageRange)||[],u=1===x.length,m=x.length>0?Math.max(...x):null==t?void 0:t.maxLeverage,h=m?u?"".concat(x[0],"x"):e("trade.tradfi_max_multi",{max:m}):"--",p=u?e("trade.tradfi_fixed_leverage"):e("trade.tradfi_leverage_adj"),f=[{label:e("trade.contract_size"),value:t2(null==t?void 0:t.lotSize,0,!1),tooltip:e("trade.contract_size_tips")},{label:e("trade.min_order_amount"),value:t5(null==t?void 0:t.minOrderQuantity,null==t?void 0:t.lotSize),tooltip:e("trade.min_lot_size_tips")},{label:e("trade.max_order_amount"),value:t5(null==t?void 0:t.maxOrderQuantity,null==t?void 0:t.lotSize),tooltip:e("trade.max_lot_size_tips")},{label:"-",value:""},{label:e("trade.tradfi_leverage_future"),value:h,tooltip:p},{label:e("trade.price_precision"),value:function(e){return"0.".concat("0".repeat(Math.max((null!=e?e:2)-1,0)),"1")}(n),tooltip:e("trade.price_precision_tips")},{label:e("trade.liquidation_level"),value:t3(null==t?void 0:t.stopOutLevel),tooltip:e("trade.liquidation_level_tips")},{label:"-",value:""},{label:e("trade.trading_fee_rate"),value:t3(null==t?void 0:t.feeRate),tooltip:e("trade.trading_fee_rate_tips")},{label:e("trade.holding_fee"),value:"".concat(t3(null==t?void 0:t.fundingRate)," (8h)"),tooltip:e("trade.contract_holding_fee_tips")}],g=(0,H.useMemo)(()=>(function(e){let t=new Map;
1return e.forEach(e=>{let l=t.get(e.dayIndex)||[];l.push("".concat(e.start,"-").concat(e.end)),t.set(e.dayIndex,l)}),tB.filter(e=>t.has(e)).map(e=>{var l;return{dayIndex:e,start:(null==(l=t.get(e))?void 0:l.join("\n"))||"",end:""}})})(function(e,t){let l=(t-3)*60,a=[];return e.forEach(e=>{let t=1440*e.dayIndex+tX(e.start)+l,r=1440*e.dayIndex+tX(e.end)+l;for(;tY(t)!==tY(r);){let e=1440*Math.floor(t/1440)+1440-1;a.push({dayIndex:tY(t),start:tQ(t),end:tQ(e)}),t=e+1}a.push({dayIndex:tY(t),start:tQ(t),end:tQ(r)})}),a}(tq[l||""]||tF,o)).map(e=>({label:d[e.dayIndex],value:e.start})),[d,o,l]),v=[{key:"local",label:"".concat(e("trade.local_time"))},{key:"utc3",label:"GMT+3"}];return l?(0,D.jsxs)("div",{className:"min-h-full w-full bg-main-background px-4 pb-4 pt-4 md:px-[18px] md:pt-4",children:[(0,D.jsxs)("div",{className:"flex items-center",children:[(0,D.jsx)(J.A,{className:"h-7 w-7 md:h-6 md:w-6",image:r||"",width:28,height:28,name:a||"",symbol:l}),(0,D.jsx)("span",{className:"ml-2 text-[20px] font-semibold text-text-dark md:text-[20px]",children:"".concat(l.replace("/","")," ").concat(e("trade.instrument_info"))})]}),(0,D.jsxs)("div",{className:"mt-[11px] flex flex-col gap-10 md:mt-[11px] md:flex md:flex-row md:gap-16",children:[(0,D.jsx)(t4,{rows:f,week:!1}),(0,D.jsxs)("div",{className:"flex-1",children:[(0,D.jsx)("div",{className:"mb-[14px] flex h-[30px] w-[200px]  md:w-[180px] rounded-lg bg-segment-background p-0.5",children:v.map(e=>(0,D.jsx)("button",{type:"button",className:"flex shrink-0 items-center justify-center rounded-md px-2 text-sm font-medium md:text-xs ".concat("local"===e.key?"flex-1":"w-20"," ").concat(i===e.key?"h-[26px] bg-panel-background text-text-dark md:h-full":"h-6 text-text-light md:h-full"),onClick:()=>c(e.key),children:e.label},e.key))}),(0,D.jsxs)("div",{className:"mb-[14px] flex h-[18px] justify-between text-sm text-text-light",children:[(0,D.jsx)("span",{children:e("trade.week")}),(0,D.jsx)("span",{children:e("trade.trading_time")})]}),(0,D.jsx)(t4,{rows:g,week:!0})]})]})]}):null});t8.displayName="TraderContractInfo";let t6=e=>{let{callback:t,countdownDone:l,activeTab:a,onTabChange:r}=e,{t:n}=(0,W.Bd)(),{theme:s}=(0,tm.D)(),{symbol:i,name:c,imageUrl:o}=function(){let e=(0,ee.mF)(e=>{var t;return null==(t=e.tokenInfo)?void 0:t.symbol});return{symbol:e,name:(0,ee.mF)(e=>{var t;return null==(t=e.tokenInfo)?void 0:t.name}),imageUrl:(0,ee.mF)(e=>{var t;return null==(t=e.tokenInfo)?void 0:t.imageUrl})}}(),d=(0,$.e0)(e=>{var t;return null==(t=e.symbolStatusMap[i||""])?void 0:t.showOffHour}),x=(0,eI.l)(e=>e.isMobile),{registerStep:u,currentStep:m}=(0,q.Z)(),h=(0,H.useCallback)(e=>{u("step1",e)},[u]),p=(0,H.useRef)(t),f=(0,H.useRef)(l);(0,H.useEffect)(()=>{p.current=t},[t]),(0,H.useEffect)(()=>{f.current=l},[l]);let g=(0,H.useCallback)(()=>{f.current()},[]),v=(0,H.useCallback)((e,t)=>{(0,ee.vj)(e),p.current(e),t()},[]);(0,H.useEffect)(()=>{i&&localStorage.setItem(eO.Ro,i||"")},[i]);let{showPriceSource:b,priceSourceNode:j}=(0,H.useMemo)(()=>{if("XAU/USD"!==i&&"XAG/USD"!==i&&"XPD/USD"!==i&&"XPT/USD"!==i&&"EUR/USD"!==i&&"BTC/USD"!==i&&"ETH/USD"!==i&&"SOL/USD"!==i&&"GBP/USD"!==i&&"USD/JPY"!==i&&"NAS/USD"!==i||!i)return{showPriceSource:!1,priceSourceNode:void 0};switch(i){case"XAU/USD":case"XAG/USD":return{showPriceSource:!0,priceSourceNode:x?(0,D.jsx)(tE,{className:"text-text-dark fill-current"}):(0,D.jsx)(tA,{className:"text-text-dark fill-current"})};case"EUR/USD":return{showPriceSource:!0,priceSourceNode:x?(0,D.jsx)(tT,{}):(0,D.jsx)(tU,{})};case"XPD/USD":case"XPT/USD":return{showPriceSource:!0,priceSourceNode:x?(0,D.jsx)(th.default,{className:"w-auto h-3",src:"light"===s?tC:tP,alt:""}):(0,D.jsx)(th.default,{className:"w-auto h-5",src:"light"===s?t_:tS,alt:""})};case"BTC/USD":case"ETH/USD":case"SOL/USD":case"NAS/USD":return{showPriceSource:!0,priceSourceNode:x?(0,D.jsx)(tv,{className:"text-text-dark fill-current"}):(0,D.jsx)(tf,{className:"text-text-dark fill-current"})};case"GBP/USD":case"USD/JPY":return{showPriceSource:!0,priceSourceNode:x?(0,D.jsx)(tN,{className:"text-text-dark fill-current"}):(0,D.jsx)(tj,{className:"text-text-dark fill-current"})};default:return{showPriceSource:!1,priceSourceNode:void 0}}},[x,i,s]);return(0,D.jsx)(D.Fragment,{children:x?(0,D.jsxs)("div",{className:"flex w-full flex-col",children:[(0,D.jsx)("div",{className:"flex h-[122px] w-full flex-col justify-center border-b border-border-color md:border-panel-border-color",children:i?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(t$,{symbol:i,name:c||"",imageUrl:o||"",onCountdownDone:g,onShowDialog:v,registerStep:h,currentStep:m}),(0,D.jsxs)("div",{className:"flex",children:[(0,D.jsxs)("div",{className:"flex flex-col",children:[(0,D.jsx)(tJ,{variant:"mobile"}),(0,D.jsx)(tZ,{variant:"mobile",priceSourceNode:b?j:void 0,showOffHour:d})]}),(0,D.jsx)(t0,{variant:"mobile",onDone:g})]})]}):(0,D.jsx)(D.Fragment,{})}),(0,D.jsx)(t1,{activeTab:a,onTabChange:r})]}):(0,D.jsxs)("div",{className:"flex w-full flex-col",children:[(0,D.jsx)("div",{className:"flex h-[63px] w-full items-center border-t border-b border-border-color md:border-panel-border-color",children:i?(0,D.jsxs)(D.Fragment,{children:[0===m?(0,D.jsxs)("div",{ref:h,className:"flex items-center ml-4 py-1.5 cursor-pointer guide-click-area",children:[(0,D.jsx)(J.A,{className:"w-6 h-6 shrink-1",image:o||"",width:24,height:24,name:c||"",symbol
1:i||""}),(0,D.jsx)("span",{className:"text-text-dark text-xl font-semibold ml-2",children:c}),(0,D.jsx)("span",{className:"bg-segment-background text-text-dark text-xs font-medium px-2 py-0.5 rounded-[4px] ml-2",children:i}),d&&(0,D.jsx)("span",{className:"text-text-light text-xs px-2 py-0.5 rounded-[8px] ml-2",children:n("trade.closed")})]}):(0,D.jsx)(tI.A,{panelClassName:"ml-4 !mt-4 !rounded-[20px] !border !border-panel-outer-border-color !shadow-md",trigger:(0,D.jsxs)("div",{ref:h,className:"flex items-center ml-4 py-1.5 cursor-pointer guide-click-area",children:[(0,D.jsx)(J.A,{className:"w-6 h-6 shrink-1",image:o||"",width:24,height:24,name:c||"",symbol:i||""}),(0,D.jsx)("span",{className:"text-text-dark text-xl font-semibold ml-2",children:c}),(0,D.jsx)("span",{className:"bg-segment-background text-text-dark text-xs font-medium px-2 py-0.5 rounded-[4px] ml-2",children:i}),d&&(0,D.jsx)("span",{className:"text-text-light text-xs px-2 py-0.5 rounded-[8px] ml-2",children:n("trade.closed")})]}),children:e=>(0,D.jsx)(tL,{callback:t=>v(t,e)})}),(0,D.jsx)(tJ,{variant:"desktop"}),b&&(0,D.jsxs)("div",{className:"flex flex-col mr-10 ",children:[(0,D.jsx)("span",{className:"text-[13px] text-text-light",children:n("trade.price_source")}),j]}),(0,D.jsx)(tZ,{variant:"desktop",showOffHour:d}),(0,D.jsx)(t0,{variant:"desktop",onDone:g}),(0,D.jsx)(ep,{symbol:i,className:"ml-7 mr-4",onDone:g})]}):(0,D.jsx)(D.Fragment,{})}),(0,D.jsx)(t1,{activeTab:a,onTabChange:r})]})})},t7=(0,I.default)(()=>l.e(4635).then(l.bind(l,27027)).then(e=>e.TVChartContainer),{loadableGenerated:{webpack:()=>[27027]},ssr:!1}),t9="XAU/USD";function le(){var e;let[t,l]=(0,H.useState)(!1),[a,r]=(0,H.useState)(""),n=(0,H.useRef)(""),s=(0,O.useParams)(),i=(null==s||null==(e=s.symbol)?void 0:e.toString())||"",c=(0,O.useSearchParams)(),o=c.get("ref"),d=c.get("posId"),[x,u]=(0,H.useState)(()=>d?Number(d):null),[m,h]=(0,H.useState)(!0),[p,f]=(0,H.useState)(!1),g=(0,H.useRef)(null),v=(0,eI.l)(e=>e.isMobile),b=(0,ey.kH)(e=>e.isLogined),j=(0,ey.kH)(e=>e.totalBalance),y=(0,ey.kH)(e=>e.pendingGuideStart),N=(0,K.WG)(e=>e.tokenList.length>0),w=(0,H.useRef)(null),A=(0,ey.kH)(e=>e.uiLoginSuccess),k=(0,ey.kH)(e=>e.triggerLogin),{start:E}=(0,q.Z)(),[_,S]=(0,H.useState)(()=>{let e=localStorage.getItem("topPercent");return e?Number.parseFloat(e):60}),[C,P]=(0,H.useState)(!1),[M,U]=(0,H.useState)(0),[z,T]=(0,H.useState)(60),[R,I]=(0,H.useState)(-1),[B,W]=(0,H.useState)("chart"),{showReceiveVoucherV2Dialog:X,showDepositDialog:Q}=(0,ej.s)(),Y={symbol:a,library_path:"/static/charting_library/",locale:"en",timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,user_id:(0,ey.IP)(),fullscreen:!1,autosize:!0,theme:"dark"},J=(0,H.useCallback)(e=>{r(e),u(null),n.current=e,es()},[]),$=(0,H.useCallback)(e=>{J(e.symbol)},[J]),el=(0,H.useCallback)(e=>{let t=K.WG.getState().tokenList.filter(t=>t.symbol===e);t.length>0&&(J(e),(0,ee.vj)(t[0]))},[J]),en=(0,H.useCallback)((e,t)=>{el(e),u(null!=t?t:null)},[el]),es=()=>{let e=o?"/trade/".concat((0,et.vT)(n.current),"?ref=").concat(o):"/trade/".concat((0,et.vT)(n.current));window.history.replaceState(null,"",e)},ei=()=>{if(!eT.z.isConnected()){var e;null==(e=g.current)||e.refreshData()}},ec=()=>{(0,K.bI)().then(e=>{if(e&&e.length>0){if(h(!1),i){let t=e.filter(e=>e.symbol===(0,et.m_)(i));t&&t.length>0?eo(t[0]):(eo(e[0]),es())}else{let t=localStorage.getItem(eO.Ro);if(t&&t.length>0){let l=e.filter(e=>e.symbol===t);l&&l.length>0?eo(l[0]):((0,ee.vj)(e[0]),r(e[0].symbol))}else eo(e[0])}f(!0)}})},eo=e=>{(0,ee.vj)(e);let t=e.symbol;r(t),n.current=t},ed=()=>{h(!1)},ex=()=>{(0,L.Gm)().then(e=>{e&&(console.log("reqVoucherTip.........",e,j),(0===j||1e-7>Math.abs(j))&&X(e,()=>{},()=>{Q(!1)}))})};(0,H.useEffect)(()=>{b&&(k?A&&ex():ex())},[b,k,A]);let eu=()=>{console.log("handleRewardArrive",b,k,A),b&&(k?A&&ex():ex())};return((0,H.useEffect)(()=>(window.addEventListener("RECEIVE_REWARD_ARRIVE",eu),()=>{window.removeEventListener("RECEIVE_REWARD_ARRIVE",eu)}),[]),(0,H.useEffect)(()=>{(0,Z.$s)(Z.cw),(0,ey.W5)()&&(0,L.r3)(),d&&window.history.replaceState(null,"",i?"/trade/".concat(i):"/trade"),ec()},[]),(0,H.useEffect)(()=>
1{if(y&&p&&N){if(a!==t9)return void el(t9);E(),ey.kH.setState({pendingGuideStart:!1})}},[y,p,N,a]),(0,H.useEffect)(()=>{C||localStorage.setItem("topPercent","".concat(_))},[C,_]),(0,H.useEffect)(()=>{let e=e=>{if(!w.current)return;let t=e.clientY-M,l=w.current.clientHeight,a=z+t/l*100;S(a=Math.max(0,Math.min(100-110/l*100,a)))},t=()=>{P(!1),window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t)};return C&&(window.addEventListener("pointermove",e),window.addEventListener("pointerup",t)),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t)}},[C,M,z]),v)?(0,D.jsx)(D.Fragment,{children:m?(0,D.jsx)("div",{className:"w-full h-full flex items-center justify-center",children:(0,D.jsx)(er.A,{className:"w-12 h-12"})}):(0,D.jsx)("div",{className:"flex flex-col h-full",children:(0,D.jsxs)("div",{className:"flex w-full h-full relative",children:[(0,D.jsxs)("div",{className:"flex flex-1 flex-col h-full",children:[(0,D.jsx)("div",{className:"w-full",children:N?(0,D.jsx)(t6,{activeTab:B,callback:$,countdownDone:ec,onTabChange:W}):(0,D.jsx)("div",{className:"w-full h-[122px]"})}),(0,D.jsx)("div",{className:"flex-1 flex flex-col relative h-[calc(100%-158px)] overflow-y-scroll",children:"chart"===B?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)("div",{className:"relative w-full flex flex-col flex-1",children:[(0,D.jsx)(V.default,{src:"/static/datafeeds/udf/dist/bundle.js",strategy:"lazyOnload",onReady:()=>{l(!0)}}),t?(0,D.jsx)("div",{id:"tv_chart_container",className:C?"w-full h-full select-none pointer-events-none":"w-full h-full select-none",children:(0,D.jsx)(t7,{props:Y,showChart:p,dataLoadedCallback:ed,selectedPositionId:x})}):(0,D.jsx)(D.Fragment,{})]}),(0,D.jsx)(eC,{symbol:a,type:0,selectSegment:0,onSegmentChange:e=>{(0,Z.$s)(Z.nX,{switch:0===e?"long":"short"}),I(e)}})]}):(0,D.jsx)(t8,{})})]}),R>=0&&(0,D.jsxs)("div",{className:"absolute top-0 left-0 w-full h-full z-51 bg-main-background p-4 ",children:[(0,D.jsx)(e9,{symbol:a,tokenActionType:R,onPlaceOrder:ei}),(0,D.jsx)(F,{className:"absolute top-6 right-4 cursor-pointer text-text-light",onClick:()=>I(-1)})]})]})})}):(0,D.jsxs)("div",{className:"flex flex-col h-[calc(100vh-112px)]",children:[(0,D.jsx)(ea,{callback:$}),(0,D.jsxs)("div",{className:"flex w-full relative h-[calc(100%-40px)]",children:[(0,D.jsxs)("div",{className:"flex flex-1 flex-col h-full",children:[(0,D.jsx)("div",{className:"w-full",children:N?(0,D.jsx)(t6,{activeTab:B,callback:$,countdownDone:ec,onTabChange:W}):(0,D.jsx)("div",{className:"w-full h-[99px]"})}),(0,D.jsx)("div",{ref:w,className:"flex-1 flex flex-col relative h-[calc(100%-99px)] overflow-y-scroll",children:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)("div",{className:"relative w-full flex flex-col overflow-y-auto",style:{height:"".concat(_,"%")},children:"chart"===B?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(V.default,{src:"/static/datafeeds/udf/dist/bundle.js",strategy:"lazyOnload",onReady:()=>{l(!0)}}),t?(0,D.jsx)("div",{id:"tv_chart_container",className:C?"w-full h-full select-none pointer-events-none":"w-full h-full select-none",children:(0,D.jsx)(t7,{props:Y,showChart:p,dataLoadedCallback:ed,selectedPositionId:x})}):(0,D.jsx)(D.Fragment,{})]}):(0,D.jsx)(t8,{})}),(0,D.jsx)("div",{className:"h-2 select-none flex w-full items-center justify-center cursor-ns-resize",tabIndex:-1,onPointerDown:e=>{e.preventDefault(),e.stopPropagation(),P(!0),U(e.clientY),T(_),e.currentTarget.setPointerCapture(e.pointerId)},children:(0,D.jsx)("div",{className:"h-1 flex w-full items-center justify-center bg-token-list-item-hover-color",children:(0,D.jsx)("img",{src:G,alt:""})})}),(0,D.jsx)("div",{className:"flex-1",style:{height:"calc(".concat(100-_,"%)")},children:(0,D.jsx)(tu,{recordRef:g,symbolChangeCallback:(e,t)=>en(e,t)})})]})})]}),(0,D.jsx)(e9,{symbol:a,tokenActionType:0,onPlaceOrder:ei})]})]})}},37127:(e,t,l)=>{l.d(t,{A:()=>c});var a=l(80069),r=l(49500),n=l(81983),s=l(20801),i=l(79477);function c(e){let{trigger:t,children:l,position:c="left",showArrow:o=!0,className:d,panelClassName:x}
1=e,[u,m]=(0,s.useState)(!1),h=(0,s.useRef)(null),p=(0,s.useRef)(null);return(0,a.jsxs)("div",{ref:p,className:"relative inline-block ".concat(d),children:[(0,a.jsxs)("div",{className:"flex items-center cursor-pointer",onClick:e=>{var t,l;u?(null==(t=h.current)||t.hide(),m(!1)):(null==(l=h.current)||l.show(e,p.current),m(!0))},children:[t,o&&(0,a.jsx)(r.P.div,{animate:{rotate:u?-180:0},transition:{duration:.3},className:"ml-1.5 w-4 h-4",children:(0,a.jsx)(i.A,{className:"w-4 h-4 text-text-light fill-current"})})]}),(0,a.jsx)(n.j,{ref:h,className:"!bg-transparent !mt-1 ".concat(x),style:{visibility:"hidden"},dismissable:!0,onHide:()=>m(!1),onShow:()=>{var e;let t=p.current,l=null==(e=h.current)?void 0:e.getElement();if(t&&l){if("right"!==c){l.style.visibility="visible";return}l.style.visibility="hidden",requestAnimationFrame(()=>{let e=t.getBoundingClientRect(),a=e.left+e.width-l.offsetWidth;l.style.left="".concat(a,"px"),l.style.visibility="visible"})}},children:l(()=>{var e;null==(e=h.current)||e.hide(),m(!1)})})]})}},38767:(e,t,l)=>{l.d(t,{A:()=>s});var a,r=l(20801);function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let s=function(e){return r.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none"},e),a||(a=r.createElement("path",{fill:"currentColor",d:"M7.756 5.426a.5.5 0 0 1 .707 0l2.11 2.111a.5.5 0 0 1 0 .707l-4.357 4.358h7.082a.7.7 0 0 1 0 1.4h-8.8L4.477 14H2.5a.5.5 0 0 1-.5-.5v-2.11a.5.5 0 0 1 .146-.354zM11.04 2.143a.5.5 0 0 1 .706 0l2.111 2.11a.5.5 0 0 1 0 .708l-1.646 1.645a.5.5 0 0 1-.707 0L9.393 4.495a.5.5 0 0 1 0-.707z"})))}},40470:(e,t,l)=>{l.d(t,{A:()=>u});var a,r,n,s,i,c,o,d=l(20801);function x(){return(x=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let u=function(e){return d.createElement("svg",x({xmlns:"http://www.w3.org/2000/svg",width:52,height:48,fill:"none"},e),a||(a=d.createElement("path",{fill:"#8D8E92",fillOpacity:.6,d:"M22.384 2.381c2.982-1.84 7.038-1.842 10.02 0l9.375 5.788-5.057-.036c-1.41-.01-2.91-.01-4.51-.01h-9.637c-1.6 0-3.1 0-4.51.01l-5.057.036zm9.19 1.166c-2.48-1.53-5.881-1.53-8.36 0l-5.16 3.186c1.417-.01 2.922-.01 4.521-.01h9.637c1.599 0 3.104 0 4.52.01z"})),r||(r=d.createElement("path",{fill:"#8D8E92",fillOpacity:.6,fillRule:"evenodd",d:"M43 24.7a2 2 0 1 1-4 0 2 2 0 0 1 4 0",clipRule:"evenodd"})),n||(n=d.createElement("path",{stroke:"#8D8E92",strokeLinecap:"round",strokeWidth:1.4,d:"M14.086 15.7h9.75"})),s||(s=d.createElement("path",{fill:"#8D8E92",d:"m49 29.9-.002 1.578c-.012 3.453-.107 5.356-.87 6.853a8 8 0 0 1-3.496 3.496c-1.498.763-3.4.858-6.854.87L36.2 42.7H19.247q.266-.68.44-1.4H36.2c2.263 0 3.877 0 5.14-.104 1.248-.102 2.03-.296 2.656-.615a6.6 6.6 0 0 0 2.885-2.885c.318-.625.513-1.408.615-2.655.103-1.264.104-2.877.104-5.14v-.2H49zM37.778 6.7c3.454.012 5.356.107 6.854.87a8 8 0 0 1 3.496 3.496C49 12.78 49 15.02 49 19.5v.2h-1.4v-.2c0-2.263 0-3.877-.104-5.14-.102-1.248-.297-2.03-.615-2.656a6.6 6.6 0 0 0-2.885-2.885c-.625-.318-1.408-.513-2.655-.615C40.077 8.1 38.463 8.1 36.2 8.1H16.8c-2.263 0-3.877 0-5.14.103-1.248.102-2.03.297-2.656.615a6.6 6.6 0 0 0-2.885 2.885c-.318.625-.513 1.408-.615 2.655C5.4 15.622 5.4 17.236 5.4 19.5v8.805q-.725.252-1.4.598V19.5c0-4.2 0-6.432.719-8.104l.153-.328A8 8 0 0 1 8.09 7.721l.28-.15c1.71-.872 3.95-.872 8.43-.872H36.2z"})),i||(i=d.createElement("path",{stroke:"#8D8E92",strokeWidth:1.4,d:"M40 19.4h9a2.3 2.3 0 0 1 2.3 2.3v6a2.3 2.3 0 0 1-2.3 2.299h-9a5.3 5.3 0 1 1 0-10.6Z"})),c||(c=d.createElement("circle",{cx:9,cy:38.699,r:8.3,stroke:"#8D8E92",strokeOpacity:.6,strokeWidth:1.4})),o||(o=d.createElement("path",{fill:"#8D8E92",fillOpacity:.6,d:"M8.997 34a.7.7 0 0 1 .7.7v3.298h3.3a.7.7 0 0 1 0 1.4h-3.3V42.7a.7.7 0 0 1-1.4 0v-3.302h-3.3a.7.7 0 0 1 0-1.4h3.3V34.7a.7.7 0 0 1 .7-.7"})))}},56185:(e,t,l)=>{l.d(t,{A:()=>o});var a=l(80069),r=l(34852);l(20801);var n=l(66926),s=l(78937),i=l(40470),c=l(34733);let o=e=>{let{className:t,text:l,onClick:o}=e,{t:d}=(0,n.Bd)(),{theme:x}=(0,r.D)(),u=d("home.connect_wallet_action"),m=null==l?void 0:l.split(new RegExp("(".concat(u,")")));
1return(0,a.jsxs)("div",{className:(0,c.cn)("flex flex-col items-center justify-center text-text-light text-[13px] gap-1",t),children:["light"===x?(0,a.jsx)(s.A,{className:"w-[56px] h-auto"}):(0,a.jsx)(i.A,{className:"w-[56px] h-auto"}),(0,a.jsx)("span",{className:"text-center",children:null==m?void 0:m.map((e,t)=>e===u?(0,a.jsx)("span",{onClick:o,className:"text-main-color font-semibold cursor-pointer hover:underline mr-0.5",children:e},t):(0,a.jsx)("span",{children:e},t))})]})}},63764:(e,t,l)=>{l.d(t,{TD:()=>s,gs:()=>n,mF:()=>i,vj:()=>r});var a=l(6558);let r=e=>{e&&i.setState({tokenInfo:e})},n=(e,t,l,a)=>{let r=i.getState().tokenInfo,n=i.getState().type;null==t||r&&r.symbol!==e||r&&l!==n||(a&&a(),i.setState(e=>({...e,tokenInfo:e.tokenInfo?{...e.tokenInfo,currentPrice:t}:void 0})))},s=e=>{i.setState(()=>({type:e}))},i=(0,a.v)(()=>({tokenInfo:void 0,type:""}))},75608:(e,t,l)=>{l.d(t,{A:()=>i});var a,r,n=l(20801);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let i=function(e){return n.createElement("svg",s({xmlns:"http://www.w3.org/2000/svg",width:14,height:11,fill:"none"},e),a||(a=n.createElement("g",{clipPath:"url(#ic_solana_tx_svg__a)"},n.createElement("path",{fill:"url(#ic_solana_tx_svg__b)",d:"M2.273 8.397a.46.46 0 0 1 .323-.135H13.77a.228.228 0 0 1 .224.274.23.23 0 0 1-.062.117l-2.207 2.213A.46.46 0 0 1 11.4 11H.228a.228.228 0 0 1-.224-.273.23.23 0 0 1 .062-.117z"}),n.createElement("path",{fill:"url(#ic_solana_tx_svg__c)",d:"M2.273.134A.47.47 0 0 1 2.596 0H13.77a.228.228 0 0 1 .224.274.23.23 0 0 1-.062.118l-2.207 2.212a.46.46 0 0 1-.324.135H.228a.228.228 0 0 1-.224-.273.23.23 0 0 1 .062-.118z"}),n.createElement("path",{fill:"url(#ic_solana_tx_svg__d)",d:"M11.725 4.24a.46.46 0 0 0-.324-.135H.23a.23.23 0 0 0-.225.275.23.23 0 0 0 .063.117L2.274 6.71a.46.46 0 0 0 .324.134H13.77a.228.228 0 0 0 .225-.274.23.23 0 0 0-.063-.118z"}))),r||(r=n.createElement("defs",null,n.createElement("linearGradient",{id:"ic_solana_tx_svg__b",x1:12.702,x2:4.938,y1:-1.32,y2:13.511,gradientUnits:"userSpaceOnUse"},n.createElement("stop",{stopColor:"#00FFA3"}),n.createElement("stop",{offset:1,stopColor:"#DC1FFF"})),n.createElement("linearGradient",{id:"ic_solana_tx_svg__c",x1:9.321,x2:1.557,y1:-3.091,y2:11.741,gradientUnits:"userSpaceOnUse"},n.createElement("stop",{stopColor:"#00FFA3"}),n.createElement("stop",{offset:1,stopColor:"#DC1FFF"})),n.createElement("linearGradient",{id:"ic_solana_tx_svg__d",x1:11.002,x2:3.238,y1:-2.211,y2:12.621,gradientUnits:"userSpaceOnUse"},n.createElement("stop",{stopColor:"#00FFA3"}),n.createElement("stop",{offset:1,stopColor:"#DC1FFF"})),n.createElement("clipPath",{id:"ic_solana_tx_svg__a"},n.createElement("path",{fill:"#fff",d:"M0 0h14v11H0z"})))))}},78937:(e,t,l)=>{l.d(t,{A:()=>u});var a,r,n,s,i,c,o,d=l(20801);function x(){return(x=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e}).apply(null,arguments)}let u=function(e){return d.createElement("svg",x({xmlns:"http://www.w3.org/2000/svg",width:52,height:48,fill:"none"},e),a||(a=d.createElement("path",{fill:"#6C757D",fillOpacity:.6,d:"M22.384 2.381c2.982-1.84 7.038-1.842 10.02 0l9.375 5.788-5.057-.036c-1.41-.01-2.91-.01-4.51-.01h-9.637c-1.6 0-3.1 0-4.51.01l-5.057.036zm9.19 1.166c-2.48-1.53-5.881-1.53-8.36 0l-5.16 3.186c1.417-.01 2.922-.01 4.521-.01h9.637c1.599 0 3.104 0 4.52.01z"})),r||(r=d.createElement("path",{fill:"#6C757D",fillOpacity:.6,fillRule:"evenodd",d:"M43 24.7a2 2 0 1 1-4 0 2 2 0 0 1 4 0",clipRule:"evenodd"})),n||(n=d.createElement("path",{stroke:"#6C757D",strokeLinecap:"round",strokeWidth:1.4,d:"M14.086 15.7h9.75"})),s||(s=d.createElement("path",{fill:"#6C757D",d:"m49 29.9-.002 1.578c-.012 3.453-.107 5.356-.87 6.853a8 8 0 0 1-3.496 3.496c-1.498.763-3.4.858-6.854.87L36.2 42.7H19.247q.266-.68.44-1.4H36.2c2.263 0 3.877 0 5.14-.104 1.248-.102 2.03-.296 2.656-.615a6.6 6.6 0 0 0 2.885-2.885c.318-.625.513-1.408.615-2.655.103-1.264.104-2.877.104-5.14v-.2H49zM37.778 6.7c3.454.012 5.356.107 6.854.87a8 8 0 0 1 3.496 3.496C49 12.78 49 15.02 49 19.5v.2h-1.4v-.2c0-2.263 0-3.877-.104-5.14-.102-1.248-.297-2.03-.615-2.656a6.6 6.6 0 0 0-2.885-2.885c-.625-.318-1.408
1-.513-2.655-.615C40.077 8.1 38.463 8.1 36.2 8.1H16.8c-2.263 0-3.877 0-5.14.103-1.248.102-2.03.297-2.656.615a6.6 6.6 0 0 0-2.885 2.885c-.318.625-.513 1.408-.615 2.655C5.4 15.622 5.4 17.236 5.4 19.5v8.805q-.725.252-1.4.598V19.5c0-4.2 0-6.432.719-8.104l.153-.328A8 8 0 0 1 8.09 7.721l.28-.15c1.71-.872 3.95-.872 8.43-.872H36.2z"})),i||(i=d.createElement("path",{stroke:"#6C757D",strokeWidth:1.4,d:"M40 19.4h9a2.3 2.3 0 0 1 2.3 2.3v6a2.3 2.3 0 0 1-2.3 2.299h-9a5.3 5.3 0 1 1 0-10.6Z"})),c||(c=d.createElement("circle",{cx:9,cy:38.699,r:8.3,stroke:"#6C757D",strokeOpacity:.6,strokeWidth:1.4})),o||(o=d.createElement("path",{fill:"#6C757D",fillOpacity:.6,d:"M8.997 34a.7.7 0 0 1 .7.7v3.298h3.3a.7.7 0 0 1 0 1.4h-3.3V42.7a.7.7 0 0 1-1.4 0v-3.302h-3.3a.7.7 0 0 1 0-1.4h3.3V34.7a.7.7 0 0 1 .7-.7"})))}}}]);

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.