PageSourceSearch

https://www.tapbit.com/_next_app/price/0.1.227/_next/static/chunks/4799.0b5e4c03b22c6818.js

js tapbit.com collected 2026-10-03 21:42:29 UTC 65,781 bytes, 1 lines download raw bytes

1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="85c37110-b936-45fb-ba3d-e2b37856adc6",e._sentryDebugIdIdentifier="sentry-dbid-85c37110-b936-45fb-ba3d-e2b37856adc6")}()}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4799],{1605:(e,t,r)=>{r.d(t,{Uh:()=>b,m4:()=>f,nJ:()=>v});var n=r(93924),i=r(66960),l=r(47387),a=r(10935),o=r(95696),s=r(38113),c=r(3030),u=r(95496),d=r(84605),m=r(22675);let p="openOrderCancelNeverRemind",h="planCancelNeverRemind",g="triggerOrderCancelNeverRemind";function f(){let{$t:e,locale:t}=(0,i.B)(),[r,a]=(0,s.useState)(!1),d=(0,s.useCallback)(()=>l.hv.get(p),[]),m=(0,s.useCallback)(e=>{l.hv.set({[p]:e})},[]);return{cancel:(0,s.useCallback)(async r=>{a(!0);try{let i=await (0,c.p)("order_cancel",()=>(0,o.Ph)({locale:t,params:{orderId:String(r)}}));if((null==i?void 0:i.code)===200)return(0,n.toast)({type:"success",title:e("Order cancel submitted")}),await (0,u.j6)(),!0;if((null==i?void 0:i.code)===10325)return(0,n.toast)({type:"error",title:e("Cancelling")}),await (0,u.j6)(),!0;return!1}catch(e){return console.error("Unhandled async action error",e),!1}finally{a(!1)}},[e,t]),getNeverRemind:d,setNeverRemind:m,loading:r}}function v(){let{$t:e,locale:t}=(0,i.B)(),[r,u]=(0,s.useState)(!1),m=(0,s.useCallback)(()=>l.hv.get(h),[]),p=(0,s.useCallback)(e=>{l.hv.set({[h]:e})},[]);return{cancel:(0,s.useCallback)(async r=>{u(!0);try{let i=await (0,c.p)("order_cancel",()=>(0,o.c6)({locale:t,requestType:a.Yw.JsonString,body:{planId:String(r)}}));if((null==i?void 0:i.code)!==200)return!1;return(0,n.toast)({type:"success",title:e("Success")}),await (0,d.JH)(),!0}catch(e){return console.error("Unhandled async action error",e),!1}finally{u(!1)}},[e,t]),getNeverRemind:m,setNeverRemind:p,loading:r}}function b(){let{$t:e,locale:t}=(0,i.B)(),[r,u]=(0,s.useState)(!1),d=(0,s.useCallback)(()=>l.hv.get(g),[]),p=(0,s.useCallback)(e=>{l.hv.set({[g]:e})},[]);return{cancel:(0,s.useCallback)(async r=>{u(!0);try{let i=await (0,c.p)("order_cancel",()=>(0,o.c6)({locale:t,requestType:a.Yw.JsonString,body:{planId:String(r)}}));if((null==i?void 0:i.code)===200)return(0,n.toast)({type:"success",title:e("Order cancel submitted")}),await (0,m.WJ)(),!0;if((null==i?void 0:i.code)===10325)return(0,n.toast)({type:"error",title:e("Cancelling")}),await (0,m.WJ)(),!0;return!1}catch(e){return console.error("Unhandled async action error",e),!1}finally{u(!1)}},[e,t]),getNeverRemind:d,setNeverRemind:p,loading:r}}},3849:(e,t,r)=>{r.d(t,{W:()=>a});var n=r(79237),i=r(46540),l=r(90477);function a(e){let{className:t,label:r,labelClassName:a,layout:o="stack",onLabelClick:s,value:c,valueClassName:u,tooltip:d,tooltipAlign:m="start",tooltipClassName:p="text-c12",tooltipDisableHoverTriggerClick:h,tooltipShowArrow:g=!0,tooltipSide:f="bottom",trigger:v="all"}=e,b=(0,n.jsx)("button",{type:"button",onClick:s,className:(0,l.cn)("text-t3 inline-flex cursor-default items-center border-b border-transparent pb-px text-left whitespace-nowrap","inline"===o?"text-cm11":"text-c12",d&&"border-t3 cursor-help border-dashed",s&&"hover:text-t2 cursor-pointer",a),children:r}),y=(0,n.jsx)("div",{className:p,children:d}),x=d&&"label"===v?(0,n.jsx)(i.Tooltip,{content:y,disableHoverTriggerClick:h,showArrow:g,side:f,align:m,children:b}):b,C=(0,n.jsx)("div",{className:(0,l.cn)("inline"===o?"text-cm11 text-t1 min-w-0 truncate text-right":"text-t1 text-m12 mt-1 whitespace-nowrap",u),children:c}),w="inline"===o?(0,n.jsxs)("div",{className:(0,l.cn)("flex min-w-0 items-center justify-between gap-2",t),children:[x,C]}):(0,n.jsxs)("div",{className:(0,l.cn)("shrink-0",t),children:[(0,n.jsx)("div",{children:x}),C]});return d&&"all"===v?(0,n.jsx)(i.Tooltip,{content:y,disableHoverTriggerClick:h,showArrow:g,side:f,align:m,children:w}):w}},5684:(e,t,r)=>{r.d(t,{o:()=>a});var n=r(79237),i=r(22522),l=r(24558);function a(e){let{locale:t,symbol:r}=e;return(0,n.jsx)(i.o,{href:(0,l.Gj)(t,r)}
1)}},14994:(e,t,r)=>{r.d(t,{q:()=>a});var n=r(79237),i=r(38113),l=r(65375);let a=i.forwardRef((e,t)=>(0,n.jsx)(l.B,{ref:t,viewBox:"0 0 1024 1024",...e,children:(0,n.jsx)("path",{d:"M597.333333 128a42.666667 42.666667 0 0 1 42.666667-42.666667h256a42.666667 42.666667 0 0 1 42.666667 42.666667v256a42.666667 42.666667 0 1 1-85.333334 0V230.997333l-268.501333 268.501334a42.666667 42.666667 0 0 1-60.330667-60.330667L793.002667 170.666667H640a42.666667 42.666667 0 0 1-42.666667-42.666667zM331.050667 170.666667H426.666667a42.666667 42.666667 0 1 1 0 85.333333H332.8c-36.565333 0-61.397333 0-80.597333 1.621333-18.688 1.493333-28.288 4.266667-34.944 7.68a85.333333 85.333333 0 0 0-37.290667 37.290667c-3.413333 6.656-6.186667 16.213333-7.68 34.944C170.666667 356.736 170.666667 381.568 170.666667 418.133333v273.066667c0 36.565333 0 61.397333 1.621333 80.597333 1.493333 18.688 4.266667 28.288 7.68 34.944a85.333333 85.333333 0 0 0 37.290667 37.290667c6.656 3.413333 16.213333 6.186667 34.944 7.68C271.402667 853.333333 296.234667 853.333333 332.8 853.333333h273.066667c36.565333 0 61.397333 0 80.597333-1.621333 18.688-1.493333 28.288-4.266667 34.944-7.68a85.333333 85.333333 0 0 0 37.290667-37.290667c3.413333-6.656 6.186667-16.213333 7.68-34.944 1.578667-19.2 1.621333-44.032 1.621333-80.597333V597.333333a42.666667 42.666667 0 1 1 85.333333 0v95.616c0 34.346667 0 62.72-1.877333 85.76-1.962667 24.021333-6.186667 46.08-16.725333 66.773334a170.666667 170.666667 0 0 1-74.581334 74.581333c-20.693333 10.538667-42.752 14.762667-66.730666 16.725333-23.082667 1.877333-51.456 1.877333-85.76 1.877334H331.008c-34.346667 0-62.72 0-85.76-1.877334-24.021333-1.962667-46.08-6.186667-66.773333-16.725333a170.666667 170.666667 0 0 1-74.581334-74.581333c-10.538667-20.693333-14.762667-42.752-16.725333-66.730667C85.333333 755.626667 85.333333 727.296 85.333333 692.992V416.341333c0-34.346667 0-62.72 1.877334-85.76 1.962667-24.021333 6.186667-46.08 16.725333-66.773333a170.666667 170.666667 0 0 1 74.581333-74.581333c20.693333-10.538667 42.752-14.762667 66.730667-16.725334C268.373333 170.666667 296.704 170.666667 331.008 170.666667z"})}));a.displayName="LinkIcon"},21415:(e,t,r)=>{r.r(t),r.d(t,{ContractTradingView:()=>W});var n=r(79237),i=r(52293),l=r(63125),a=r(97943),o=r(21219),s=r(47776),c=r(8188),u=r(41387),d=r(66960),m=r(90477),p=r(3849),h=r(559),g=r(15977),f=r(5684);function v(){let{$t:e}=(0,d.B)(),{summary:t}=(0,h.b)();return(0,n.jsx)("div",{className:"flex items-center justify-between gap-4 px-4 pt-3 pb-2",children:(0,n.jsx)(g.T,{trigger:(0,n.jsx)("button",{type:"button",className:"flex w-full max-w-full min-w-0 cursor-pointer items-center gap-1",children:(0,n.jsx)("span",{className:"flex max-w-full min-w-0 flex-1 flex-col items-start justify-center gap-[2px]",children:(0,n.jsxs)("span",{className:"flex w-full max-w-full min-w-0 items-center gap-1",children:[(0,n.jsx)("span",{className:"text-t16 text-t1 min-w-0 truncate font-semibold",children:t.displaySymbol}),(0,n.jsx)("span",{className:"bg-bg2 text-cm11 text-t3 rounded-r1 px-1 py-0.5 leading-[1.4]",children:e("Demo")}),(0,n.jsx)(s.C,{className:"text-t3 size-3 shrink-0"})]})})})})})}function b(){let{$t:e,locale:t}=(0,d.B)(),{summary:r}=(0,h.b)(),i="text-p2"===r.lastPriceClassName?c.K:"text-p3"===r.lastPriceClassName?u.Z:null,l="--"===r.markPrice?"--":"≈".concat(r.markPrice);return(0,n.jsxs)("div",{className:"flex items-center gap-6 px-4 pt-1 pb-3",children:[(0,n.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col justify-center",children:[(0,n.jsxs)("div",{className:"flex min-w-0 items-center gap-1",children:[(0,n.jsx)("span",{className:(0,m.cn)("text-tm20 min-w-0 truncate",r.lastPriceClassName),children:r.lastPrice}),i?(0,n.jsx)(i,{className:(0,m.cn)("size-4 shrink-0",r.lastPriceClassName)}):null]}),(0,n.jsxs)("div",{className:"mt-1 flex min-w-0 items-center gap-2",children:[(0,n.jsx)("span",{className:"text-cm11 text-t1 min-w-0 truncate",children:l}),(0,n.jsx)("span",{className:(0,m.cn)("text-cm11 shrink-0",r.changeClassName),children:r.changePercentText})]})]}),(0,n.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,n.jsx)(p.W,{layout:"inline",className:"min-w-0",label:e("Mark Price"),value:r.markPrice,tooltip:(0,n.jsx)(f.o,{locale:t,symbol:r.symbol}),trigger:"all",tooltipShowArrow:!1}
1),(0,n.jsx)(p.W,{layout:"inline",className:"min-w-0",label:e("High_r_1"),value:r.highPrice,tooltip:e("UTC 0:00-24:00 High"),trigger:"label",tooltipShowArrow:!1}),(0,n.jsx)(p.W,{layout:"inline",className:"min-w-0",label:e("Low_r_1"),value:r.lowPrice,tooltip:e("UTC 0:00-24:00 Low"),trigger:"label",tooltipShowArrow:!1}),(0,n.jsx)(p.W,{layout:"inline",className:"min-w-0",label:e("24h Vol_r_1"),value:r.volumeText})]})]})}function y(){return(0,n.jsxs)("div",{className:"bg-bg7",children:[(0,n.jsx)(v,{}),(0,n.jsx)(b,{})]})}var x=r(85403),C=r(76656);function w(e){let{symbol:t}=e,r=(0,i.bZ)((0,C.k)(e=>({contractType:e.contractType||i.h$.USDT,contractConfig:e.symbolsConfigBySymbol[t]})));return(0,n.jsx)(x.V,{symbol:t,contractType:r.contractType,contractConfig:r.contractConfig,isDemoTrading:!0})}var N=r(93924),T=r(31508),j=r(83054),P=r(25825),k=r(96620),L=r(64951),S=r(51025),O=r(34178),I=r(39679),_=r(40394),M=r(38113),q=r(2815),B=r(10209),D=r(28598),F=r(39422),R=r(28373),A=r(56856),E=r(11636);function Q(){var e,t,r,l;let{$t:a,locale:s}=(0,d.B)(),{user:c,gotoLogin:u}=(0,S.k)(),m=(0,o.T)(),p=(0,A.Mr)(e=>e.form),h=Number(null!=(t=null==(e=(0,q.tQ)())?void 0:e.availableBalance)?t:0),{tradeUnit:g}=p,f=(0,i.bZ)(e=>e.symbolsConfigBySymbol[m]),v=(0,i.bZ)(e=>e.siteConfig),b=(0,E.w)(e=>e.getQuantityPrecisionByUnit),y=(0,E.w)(e=>e.getDisplayUnitLabel),x=(null==f?void 0:f.baseAsset)||m.split("-")[0]||m,C=(0,_.k)(y({tradeUnit:g,baseAsset:x}),a),w=b({tradeUnit:g,contractPrecision:Number(null!=(r=null==f?void 0:f.precision)?r:2),coinPrecision:(0,j.DF)(null==f?void 0:f.multiplier)}),Q=(0,M.useRef)(!1),W=async e=>{let{direction:t,price:r,quantity:n}=e;if(!(null==c?void 0:c.userId))return u(),!1;if(Q.current)return!1;if(!(0,B.Hk)({orderType:"limit",orderPrice:r,triggerPrice:""}))return(0,N.toast)({type:"error",title:a("Please enter order price.")}),!1;let i=(0,L.u)(k.p.USDT.ORDER_BOOK(m)),l=P.G.getState().topicData[i],o="buy"===t?"openLong":"openShort",d=(0,I.Ir)({orderbook:l,lastPrice:Number(r),orderType:"limit",orderPrice:r,contract:f}),b=(0,I.Op)({quantityCont:1,longLeverage:p.longLeverage,shortLeverage:p.shortLeverage,prices:d,contract:f,siteConfig:v}),y=(0,B.Qx)({direction:o,longQuantity:"buy"===t?n:"",shortQuantity:"sell"===t?n:"",quantity:"",tradeUnit:g,multiplier:Number((null==f?void 0:f.multiplier)||0),calcPrice:Number(r),usdtCost:p.usdtCost,oneContCostBuy:b.buy,oneContCostSell:b.sell}),x=(0,B.vC)({orderType:"limit",availableBalance:h,quantityCont:y});if(!x.valid){let e="INSUFFICIENT_AVAILABLE_BALANCE"===x.errorCode?a("Insufficient available balance"):a("Please enter order quantity.");return(0,N.toast)({type:"error",title:e}),!1}Q.current=!0;
1try{return await (0,F.Ts)({locale:s,params:{symbol:(0,D.bh)(m),direction:o,orderType:"limit",orderPrice:r,quantity:y,leverage:"buy"===t?p.longLeverage:p.shortLeverage,marginMode:p.marginMode,positionMode:p.positionMode}}),(0,N.toast)({type:"success",title:a("Order place success")}),(0,R.B$)({locale:s,symbol:m}).catch(e=>{console.error("[QuickOrder] 刷新开仓成功后数据失败:",e)}),!0}catch(e){return(0,T.d)(e)&&e.errorType===T.TT.Backend||(0,N.toast)({type:"error",title:function(e){var t,r;if(e&&"object"==typeof e)return(null==(t=e.getResponseMessage)?void 0:t.call(e))||(null==(r=e.data)?void 0:r.message)||e.message}(e)||a("Failed")}),!1}finally{Q.current=!1}};return(0,n.jsx)(O.G,{symbol:m,pricePrecision:(0,i.CR)(m),minPriceChange:String(null!=(l=null==f?void 0:f.minPriceChange)?l:""),quantityPrecision:w,quantityUnit:C,tradeUnit:g,usdtCost:p.usdtCost,onSubmitOrder:W})}function W(e){let{mode:t="pc",onTradeClick:r}=e,s=(0,o.T)();return(0,n.jsx)(l.d,{mode:t,symbol:s,isDemoTrading:!0,pricePrecisionFn:i.CR,h5Header:(0,n.jsx)(y,{}),watermark:(0,n.jsx)(a.$,{variant:"demo"}),infoPanel:(0,n.jsx)(w,{symbol:s}),quickOrderOverlay:(0,n.jsx)(Q,{}),onTradeClick:r})}},22522:(e,t,r)=>{r.d(t,{N:()=>a,o:()=>l});var n=r(79237),i=r(66960);function l(e){let{href:t}=e,{$t:r}=(0,i.B)();return(0,n.jsxs)("div",{className:"max-w-[260px]",children:[(0,n.jsx)("div",{children:r("Mark price is used for the calculation of the liquidation price and the unrealized PnL.")}),(0,n.jsx)("a",{href:t,target:"_blank",rel:"noreferrer",className:"text-p1 text-b14 text-c12 mt-2 inline-flex hover:underline",children:r("Click to check more")})]})}function a(){let{$t:e}=(0,i.B)();return(0,n.jsx)("div",{className:"max-w-[260px]",children:e("Index price is the average market price of crypto on major spot exchanges.")})}},31913:(e,t,r)=>{r.r(t),r.d(t,{ContractTradingView:()=>ex});var n=r(79237),i=r(749),l=r(12733),a=r(63125),o=r(97943),s=r(93924),c=r(66960),u=r(41760),d=r(96620),m=r(95696),p=r(51025),h=r(89719),g=r(10022),f=r(40882),v=r(37973),b=r(31483),y=r(38113),x=r(50791),C=r(50965),w=r(32837),N=r(97867),T=r(22675),j=r(1605),P=r(27644);function k(){g.ZC.getState().refreshCharts()}function L(e){let t=Number(e);return Number.isFinite(t)?t:0}function S(e){return"string"==typeof e&&e?e:void 0}function O(e){return"string"==typeof e||"number"==typeof e?e:void 0}function I(e){return e===b.Tt.StopLoss?b.Tt.StopLoss:b.Tt.TakeProfit}function _(e){return e===b.Ll.Normal?b.Ll.Normal:b.Ll.Position}function M(e){return e===b.Pr.Latest?b.Pr.Latest:b.Pr.Mark}var q=r(92413),B=r(47776),D=r(37392),F=r(41445),R=r(13207),A=r(8188),E=r(41387),Q=r(90477),W=r(3849),U=r(78493),V=r(19024),z=r(43231),H=r(9106),K=r(87052),$=r(47606);function Z(){let{$t:e}=(0,c.B)(),{summary:t}=(0,U.b)(),{favoriteLoading:r,isSymbolFavorite:i,toggleSymbolFavorite:l}=(0,V.C)(),a=i(t.symbol),o=!!r[t.symbol],s=t.isTradfi;return(0,n.jsxs)("div",{className:"flex items-center justify-between gap-4 px-4 pt-3 pb-2",children:[(0,n.jsxs)("div",{className:"flex max-w-full min-w-0 flex-1 flex-col items-start justify-center gap-[2px]",children:[(0,n.jsx)(K.T,{trigger:(0,n.jsxs)("button",{type:"button",className:"flex max-w-full min-w-0 cursor-pointer items-center gap-1 text-left rtl:text-right",children:[(0,n.jsx)("span",{className:"text-t16 text-t1 min-w-0 truncate font-semibold",children:t.displaySymbol}),(0,n.jsx)("span",{className:"bg-bg2 text-cm11 text-t3 rounded-r1 px-1 py-0.5 leading-[1.4]",children:e("Perp")}),(0,n.jsx)(B.C,{className:"text-t3 size-3 shrink-0"})]})}),s?(0,n.jsxs)("span",{className:"text-mm12 flex w-full max-w-full min-w-0 items-center gap-1 leading-4",children:[(0,n.jsx)(z.K,{}),t.contractBrief?(0,n.jsx)("span",{className:"text-t3 min-w-0 truncate text-left rtl:text-right",title:t.contractBrief,children:t.contractBrief}):null]}):null]}),(0,n.jsx)("div",{className:"flex shrink-0 items-center gap-4",children:(0,n.jsx)("button",{type:"button","aria-label":"Toggle favorite",onClick:()=>{l(t.symbol,a)},disabled:o,className:"text-t3 hover:text-p1-dark flex size-5 shrink-0 items-center justify-center transition-colors",children:o?(0,n.jsx)(D.m,{className:"text-p1-dark size-[18px] animate-spin"}):a?(0,n.jsx)(F.t,{className:"text-p1-dark size-[18px]"}):(0,n.jsx)(R.V,{className:"text-t3 size-[18px]"})})})]})}function J(){let{$t:e,locale:t}=(0,c.B)(),{summary:r}=(0,U.b)(),i="text-p2"===r.lastPriceClassName?A.K:"text-p3"===r.lastPriceClassName?E.Z:null,l="--"===r.markPrice?"--":"≈".concat(r.markPrice);return(0,n.jsxs)("div",{className:"flex items-center gap-6 px-4 pt-1 pb-3",children:[(0,n.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col justify-center",children:[(0,n.jsxs)("div",{className:"flex min-w-0 items-center gap-1",children:[(0,n.jsx)("span",{className:(0,Q.cn)("text-tm20 min-w-0 truncate",r.lastPriceClassName),children:r.lastPrice}),i?(0,n.jsx)(i,{className:(0,Q.cn)("size-4 shrink-0",r.lastPriceClassName)}):null]}),(0,n.jsxs)("div",{className:"mt-1 flex min-w-0 items-center gap-2",children:[(0,n.jsx)("span",{className:"text-cm11 text-t1 min-w-0 truncate",children:l}),(0,n.jsx)("span",{className:(0,Q.cn)("text-cm11 shrink-0",r.changeClassName),children:r.changePercentText})]}),r.isPreIpo?(0,n.jsx)("div",{className:"mt-1 flex",children:(0,n.jsx)(H.b,{})}):null]}),(0,n.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,n.jsx)(W.W,{layout:"inline",className:"min-w-0",label:e("Mark Price"),value:r.markPrice,tooltip:(0,n.jsx)($.o,{locale:t,symbol:r.symbol}),trigger:"all",tooltipShowArrow:!1}
1),(0,n.jsx)(W.W,{layout:"inline",className:"min-w-0",label:e("High_r_1"),value:r.highPrice,tooltip:e("UTC 0:00-24:00 High"),trigger:"label",tooltipShowArrow:!1}),(0,n.jsx)(W.W,{layout:"inline",className:"min-w-0",label:e("Low_r_1"),value:r.lowPrice,tooltip:e("UTC 0:00-24:00 Low"),trigger:"label",tooltipShowArrow:!1}),(0,n.jsx)(W.W,{layout:"inline",className:"min-w-0",label:e("24h Vol_r_1"),value:r.volumeText})]})]})}function Y(){return(0,n.jsxs)("div",{className:"bg-bg7",children:[(0,n.jsx)(Z,{}),(0,n.jsx)(J,{})]})}var G=r(43129),X=r(85403),ee=r(76656);function et(e){let{symbol:t}=e,r=(0,l.bZ)((0,ee.k)(e=>({contractType:e.contractType||l.h$.USDT,contractConfig:e.symbolsConfigBySymbol[t]})));return(0,n.jsx)(X.V,{symbol:t,contractType:r.contractType,contractConfig:r.contractConfig})}var er=r(31508),en=r(83054),ei=r(25825),el=r(64951),ea=r(3529),eo=r(17883),es=r(34178),ec=r(39679),eu=r(40394),ed=r(90877),em=r(79043),ep=r(25318),eh=r(3030),eg=r(80156),ef=r(13751),ev=r(10522),eb=r(5694);function ey(){var e,t,r,i;let{$t:a,locale:o}=(0,c.B)(),{user:u,gotoLogin:g}=(0,p.k)(),f=(0,x.W5)(),v=(0,x.oh)(),b=(0,q.T)(),{isExecuting:C}=(0,em.p)(b),{active:w,pending:T}=(0,ep.Y)(),{contractProtocol:j,preIpoRiskProtocol:P,completeQuiz:k}=(0,h.TY)((0,ee.k)(e=>({contractProtocol:e.configs.usdtContract_protocol,preIpoRiskProtocol:e.configs.Pre_IPO_risk_protocol,completeQuiz:e.configs.usdt_complete_quiz}))),L=(0,ev.Mr)(e=>e.form),S=Number(null!=(t=null==(e=(0,ed.t)())?void 0:e.availableBalance)?t:0),{tradeUnit:O}=L,I=(0,l.bZ)(e=>e.symbolsConfigBySymbol[b]),_=(0,l.bZ)(e=>e.siteConfig),M=(0,eb.w)(e=>e.getQuantityPrecisionByUnit),B=(0,eb.w)(e=>e.getDisplayUnitLabel),D=(null==I?void 0:I.baseAsset)||b.split("-")[0]||b,F=(0,eu.k)(B({tradeUnit:O,baseAsset:D}),a),R=M({tradeUnit:O,contractPrecision:Number(null!=(r=null==I?void 0:I.precision)?r:2),coinPrecision:(0,en.DF)(null==I?void 0:I.multiplier)}),A=(0,y.useRef)(!1),E=async e=>{let{direction:t,price:r,quantity:n}=e;if(!(null==u?void 0:u.userId))return g(),!1;if(A.current||C||T||w)return!1;let i=(0,eg.I)({Pre_IPO_risk_protocol:P,usdtContract_protocol:j,usdt_complete_quiz:k},(0,eo.YV)(I));if(i)return v.showLayer(i),!1;if(!(0,ef.Hk)({orderType:"limit",orderPrice:r,triggerPrice:""}))return(0,s.toast)({type:"error",title:a("Please enter order price.")}),!1;let l=(0,el.u)(d.p.USDT.ORDER_BOOK(b)),c=ei.G.getState().topicData[l],p="buy"===t?"openLong":"openShort",h=(0,ec.Ir)({orderbook:c,lastPrice:Number(r),orderType:"limit",orderPrice:r,contract:I}),y=(0,ec.Op)({quantityCont:1,longLeverage:L.longLeverage,shortLeverage:L.shortLeverage,prices:h,contract:I,siteConfig:_}),x="buy"===t?y.buy:y.sell,M=(0,ef.wL)({direction:p,longQuantity:"buy"===t?n:"",shortQuantity:"sell"===t?n:"",quantity:""}),q=(0,ef.Qx)({direction:p,longQuantity:"buy"===t?n:"",shortQuantity:"sell"===t?n:"",quantity:"",tradeUnit:O,multiplier:Number((null==I?void 0:I.multiplier)||0),calcPrice:Number(r),usdtCost:L.usdtCost,oneContCostBuy:y.buy,oneContCostSell:y.sell}),B=(0,ef.eT)({minTradeAmount:null==I?void 0:I.minTradeAmount,tradeUnit:O,multiplier:Number((null==I?void 0:I.multiplier)||0),calcPrice:Number(r),usdtCost:L.usdtCost,oneContCost:x}),D=(0,ef.vC)({orderType:"limit",availableBalance:S,displayQuantity:M,minDisplayQuantity:B,quantityCont:q});if(!D.valid){let e="INSUFFICIENT_AVAILABLE_BALANCE"===D.errorCode?a("Insufficient available balance"):"BELOW_MIN_ORDER_QUANTITY"===D.errorCode?a("The minimum order quantity is {0} {1}",{0:D.minQuantity,1:F}):a("Please enter order quantity.");return(0,s.toast)({type:"error",title:e}),!1}A.current=!0;try{return await (0,eh.p)("order_open",()=>
1(0,m.gA)({locale:o,params:{symbol:b.endsWith("-SWAP")?b:(0,ea.Qx)(b,"-"),direction:p,orderType:"limit",orderPrice:r,quantity:q,leverage:"buy"===t?L.longLeverage:L.shortLeverage,marginMode:L.marginMode,positionMode:L.positionMode}})),(0,s.toast)({type:"success",title:a("Order placed successfully")}),(0,N.B$)({locale:o,symbol:b}).catch(e=>{console.error("[QuickOrder] 刷新开仓成功后数据失败:",e)}),!0}catch(e){var R;return 10307===Number((null==e||null==(R=e.data)?void 0:R.code)||0)?f.showLayer():(0,er.d)(e)&&e.errorType===er.TT.Backend||(0,s.toast)({type:"error",title:function(e){var t,r;if(e&&"object"==typeof e)return(null==(t=e.getResponseMessage)?void 0:t.call(e))||(null==(r=e.data)?void 0:r.message)||e.message}(e)||a("Failed")}),!1}finally{A.current=!1}};return(0,n.jsx)(es.G,{symbol:b,pricePrecision:(0,l.CR)(b),minPriceChange:String(null!=(i=null==I?void 0:I.minPriceChange)?i:""),quantityPrecision:R,quantityUnit:F,tradeUnit:O,usdtCost:L.usdtCost,onSubmitOrder:E})}function ex(e){let{mode:t="pc",onTradeClick:r}=e,B=(0,q.T)(),D=(0,G.J)(e=>e.strategyMode),F=function(){let{$t:e,locale:t}=(0,c.B)(),r=(0,p.k)(e=>{var t,r;return null!=(r=null==(t=e.user)?void 0:t.userId)?r:0}),n=(0,h.QA)().usdt_user_confirm||"11111111",a=(0,l.bZ)(e=>e.symbolsConfigBySymbol),o=(0,g.ZC)(e=>e.symbol),q=(0,u.N1)(o?d.p.USDT.SIMPLE_TICKER(o):void 0),{unit:B}=(0,P.A)({symbol:o}),{showLayer:D}=(0,x.HC)(),{showLayer:F}=(0,x.g2)(),{showLayer:R}=(0,x.x3)(),A=(0,j.m4)(),E=(0,j.nJ)(),Q=(0,j.Uh)(),[,W]=(0,y.useState)(!1),U=async(r,n)=>{let i=function(e){var t,r,n;let{item:i,triggerPrice:l}=e,a=null!=(t=i.planId)?t:i.id,o=function(e){if(e.direction===b.$A.CloseLong)return b.$A.CloseLong;if(e.direction===b.$A.CloseShort)return b.$A.CloseShort;let t=function(e){let t=S(e.side);return t===b.DR.Long?b.DR.Long:t===b.DR.Short?b.DR.Short:e.direction===b.$A.CloseLong?b.DR.Long:e.direction===b.$A.CloseShort?b.DR.Short:void 0}(e);return t===b.DR.Long?b.$A.CloseLong:t===b.DR.Short?b.$A.CloseShort:void 0}(i);if(!i.symbol||!a||!o)return;let s=I(i.planType),c=_(i.tpslType),u=i.orderType===b.Cf.PlanLimit?b.Cf.PlanLimit:b.Cf.PlanMarket,d=M(i.triggerWay),m={symbol:i.symbol,direction:o,separatedPositionId:O(i.separatedPositionId)};return s===b.Tt.TakeProfit?{...m,tpPlanId:a,tpOrderType:u,tpTpslType:c,tpTriggerPrice:l,tpOrderPrice:null!=(r=O(i.orderPrice))?r:"",tpQuantity:L(i.quantity),tpTriggerWay:d}:{...m,slPlanId:a,slOrderType:u,slTpslType:c,slTriggerPrice:l,slOrderPrice:null!=(n=O(i.orderPrice))?n:"",slQuantity:L(i.quantity),slTriggerWay:d}}({item:r,triggerPrice:n});if(!i)return!1;let l=await (0,m.I3)({locale:t,params:i});return(null==l?void 0:l.code)===200&&((0,s.toast)({type:"success",title:e("Order placed successfully")}),(0,N.nJ)({locale:t,symbol:r.symbol}).catch(e=>{console.error("[useContractKlineLayerHandlers] 刷新 TP/SL 修改后数据失败:",e)}),!0)},V=async(r,n)=>{if(!r.orderId)return!1;let i=await (0,m.Hw)({locale:t,params:{orderId:r.orderId,orderPrice:n}});return(null==i?void 0:i.code)!==200?((null==i?void 0:i.code)===10307&&(0,x.NK)(C.k.InsufficientBalance),!1):((0,s.toast)({type:"success",title:e("Order placed successfully")}),(0,N.B$)({locale:t,symbol:r.symbol}).catch(e=>{console.error("[useContractKlineLayerHandlers] 刷新当前委托修改后数据失败:",e)}),!0)},z=async(n,i)=>{var l;let a=null!=(l=n.planId)?l:n.id;if(!a||!r)return!1;let o=await (0,m.I$)({locale:t,params:{planId:a,userId:r,triggerPrice:i.triggerPrice,...i.triggerWay?{triggerWay:i.triggerWay}:{},...i.orderPrice?{orderPrice:i.orderPrice}:{}}});return(null==o?void 0:o.code)!==200?((null==o?void 0:o.code)===10307&&(0,x.NK)(C.k.InsufficientBalance),!1):((0,s.toast)({type:"success",title:e("Order placed successfully")}),await (0,T.WJ)(),!0)},H=(e,t)=>((0,f.R4)(n,5)?(0,x.NK)(C.k.ChangePlanOrder,{order:e,triggerPrice:t,triggerWay:e.triggerWay,orderPrice:e.orderPrice,onClose:k}):z(e,{triggerPrice:String(t)}).catch(()=>void 0),!0);return{onPositionClose:(r,i)=>{let l=L(i.quantity);if(!i.symbol||"long"!==i.side&&"short"!==i.side||!l)return;let o=L(null==q?void 0:q.last)||L(i.last)||L(i.avgPrice),s=a[i.symbol],c=L(null==s?void 0:s.multiplier);(0,w.Ie)({$t:e,confirmStr:n,item:function(e){var t;let{item:r,unit:n,values:i}=e;return{...r,leverage:L(null!=(t=i.leverage)?t:r.leverage)||void 0,quantity:L(r.quantity),side:r.side,symbol
1:r.symbol,unit:n}}({item:i,values:r,unit:B}),lastPrice:o,locale:t,request:{orderType:r.orderType,quantity:l,displayQuantityText:r.quantity,lastPrice:o,multiplier:c},setLoading:W})},onOpenOrderMove:(e,t)=>{let r=t.getPrice();if(!e.orderId||!e.symbol||!Number.isFinite(r))return;let l=function(e){if("openLong"===e||"openShort"===e||"closeLong"===e||"closeShort"===e)return e}(e.direction),s=L(null==q?void 0:q.last),c=()=>((e,t)=>{if(!(0,f.R4)(n,5)){let r=e.symbol||o;if(!r)return;V(e,function(e,t){let r=String((null==t?void 0:t.minPriceChange)||"0.5");if(!r.endsWith("5"))return String(e);let n=Number(null==t?void 0:t.precision),l=Number.isFinite(n)?n:function(e){var t;let r=e.split(".")[1];return null!=(t=null==r?void 0:r.length)?t:0}(r);return(0,i.Xt)(e,l,r)}(t,a[r])).catch(()=>void 0);return}(0,x.NK)(C.k.ChangeOpenOrder,{order:e,orderPrice:t,onClose:k})})(e,r);if("limit"===e.orderType&&l&&s){let e=(0,f.B2)(l,r,s);if(e.greater)return void(0,x.NK)(C.k.PositionCloseDifferenceDialog,{direction:e.direction,onClose:k,onConfirm:c})}c()},onOpenOrderCancel:e=>{if(e.orderId){if(A.getNeverRemind())return void A.cancel(e.orderId).catch(()=>void 0);D({orderId:e.orderId})}},onTpslOrderMove:(e,r,i)=>{let l=r.getPrice();if(e.symbol&&Number.isFinite(l)){if(!(0,f.R4)(n,6))return void U(e,l).catch(()=>void 0);(0,x.NK)(C.k.PlanCloseOrder,{...function(e){var t;let{item:r,quantity:n,triggerPrice:i}=e,l=function(e){let t=e.copyTrade;if(null!=t)return!1!==t&&"0"!==String(t);let r=S(e.tradeType);return!!(r&&"common"!==r)}(r),a=I(r.planType),o=_(r.tpslType),s=r.orderType===b.Cf.PlanLimit?b.Cf.PlanLimit:b.Cf.PlanMarket,c=M(r.triggerWay),u=a===b.Tt.TakeProfit,d=function(e){let t=S(e.side);return t===b.DR.Long?b.DR.Long:t===b.DR.Short?b.DR.Short:void 0}(r),m={triggerPrice_TP:u?i:"",triggerPrice_SL:u?"":i,quantity_TP:u?n:"",quantity_SL:u?"":n,orderType_TP:s,orderType_SL:s,orderPrice_TP:r.orderPrice,orderPrice_SL:r.orderPrice,triggerWay_TP:c,triggerWay_SL:c},p={avgPrice:r.avgPrice,contQuantity:r.quantity,direction:r.direction,entireTpsl:r.entireTpsl,leverage:r.leverage,orderPrice:r.orderPrice,planId:null!=(t=r.planId)?t:r.id,planType:a,separatedPositionId:r.separatedPositionId,...d?{side:d}:{},symbol:r.symbol,tpslType:o};return{param:l?b.uj.CopyTrade:null,TPSLType:function(e){let{copyTrade:t,planType:r,tabType:n}=e,i=r===b.Tt.TakeProfit;return n===b.Ll.Position?i?b.zb.KlineEntirePositionTakeProfit:b.zb.KlineEntirePositionStopLoss:t?i?b.zb.CopyTradeTakeProfit:b.zb.CopyTradeStopLoss:i?b.zb.NormalTakeProfit:b.zb.NormalStopLoss}({copyTrade:l,planType:a,tabType:o}),isEdit:!0,isKline:!0,modelState:{values:m,position:p,notShowConfirm:!1}}}({item:e,quantity:i,triggerPrice:l}),onClose:k,onSubmitSuccess:()=>(0,N.nJ)({locale:t,symbol:e.symbol})})}},onTpslOrderCancel:e=>{var t;let r=null!=(t=e.planId)?t:e.id;if(r){if(E.getNeverRemind())return void E.cancel(r).catch(()=>void 0);F({planId:r})}},onTriggerOrderMove:(e,t)=>{let r=t.getPrice();if(!e.symbol||!Number.isFinite(r))return;let n=e.triggerWay===b.Pr.Mark?null==q?void 0:q.markPrice:null==q?void 0:q.last;if((0,v.C)({previousTriggerPrice:e.triggerPrice,nextTriggerPrice:r,comparePrice:n}))return void(0,x.NK)(C.k.PlanTriggered,{triggerPrice:r,onClose:k,onConfirm:()=>H(e,r)});H(e,r)},onTriggerOrderCancel:e=>{var t;let r=null!=(t=e.planId)?t:e.id;if(r){if(Q.getNeverRemind())return void Q.cancel(r).catch(()=>void 0);R({planId:r})}}}}();return(0,n.jsx)(a.d,{mode:t,symbol:B,pricePrecisionFn:l.CR,h5Header:(0,n.jsx)(Y,{}),watermark:(0,n.jsx)(o.$,{variant:"brand"}),infoPanel:(0,n.jsx)(et,{symbol:B}),klineOrderHandlers:F,quickOrderOverlay:D===i.n1.Standard?(0,n.jsx)(ey,{}):void 0,onTradeClick:r})}},34178:(e,t,r)=>{r.d(t,{G:()=>j});var n=r(79237),i=r(51924),l=r(38113),a=r(65375);let o=l.forwardRef((e,t)=>(0,n.jsx)(a.B,{ref:t,width:14,height:14,viewBox:"0 0 14 14","aria-hidden":"true",focusable:"false",...e,children:(0,n.jsx)("path",{d:"M12 6.73307C12 3.82437 9.64177 1.46615 6.73307 1.46615C3.82437 1.46615 1.46615 3.82437 1.46615 6.73307C1.46615 9.64177 3.82437 12 6.73307 12C9.64177 12 12 9.64177 12 6.73307ZM6 9.13281V7.46615H4.33333C3.92832 7.46615 3.59961 7.13808 3.59961 6.73307C3.59961 6.32806 3.92832 6 4.33333 6H6V4.33333C6 3.92832 6.32806 3.59961 6.73307 3.59961C7.13808 3.59961 7.46615 3.92832 7.46615 4.33333V6H9.13281C9.53782 
16 9.86654 6.32806 9.86654 6.73307C9.86654 7.13808 9.53782 7.46615 9.13281 7.46615H7.46615V9.13281C7.46615 9.53782 7.13808 9.86654 6.73307 9.86654C6.32806 9.86654 6 9.53782 6 9.13281ZM13.4661 6.73307C13.4661 10.4518 10.4518 13.4661 6.73307 13.4661C3.01436 13.4661 0 10.4518 0 6.73307C0 3.01436 3.01436 0 6.73307 0C10.4518 0 13.4661 3.01436 13.4661 6.73307Z",fill:"currentColor"})}));o.displayName="QuickOrderIcon";var s=r(44031),c=r(70659),u=r(46540),d=r(66960),m=r(41760),p=r(96620),h=r(51025),g=r(10022),f=r(17979),v=r(40394),b=r(749),y=r(19490),x=r(39679);function C(e,t){if(!(!Number.isFinite(e)||!Number.isFinite(t)||e<=0||0>=Number(t)))return e<=Number(t)?"buy":"sell"}function w(e,t,r){return r?(0,b.Xt)(e,t,r):e.toFixed(t)}function N(e,t){try{let r=e.activeChart().getPanes().find(e=>e.hasMainSeries()),n=null==r?void 0:r.getMainSourcePriceScale(),i=null==n?void 0:n.getVisiblePriceRange();if(!r||!n||!i)return;return function(e){let{price:t,visiblePriceRange:r,paneHeight:n,isInverted:i=!1,toolbarHeight:l=40,overlayHeight:a=52}=e;if(!r||!Number.isFinite(t)||!Number.isFinite(n)||n<=0)return;let o=Math.min(r.from,r.to),s=Math.max(r.from,r.to)-o;if(!Number.isFinite(s)||s<=0)return;let c=Math.min(Math.max((t-o)/s,0),1),u=Math.max(n-a,0);return l+Math.min(Math.max((i?c:1-c)*n-a/2,0),u)}({price:t,visiblePriceRange:i,paneHeight:r.getHeight(),isInverted:n.isInverted(),overlayHeight:52})}catch(e){return}}function T(){let e=document.querySelector("#tv_chart_container iframe");try{var t;let r=null==e?void 0:e.getBoundingClientRect().width,n=null==e||null==(t=e.contentDocument)?void 0:t.querySelectorAll("canvas");if(!r||!n)return;let i=Array.from(n).map(e=>e.getBoundingClientRect()).filter(e=>e.width>0&&e.width<r/2&&e.height>24&&1>=Math.abs(e.right-r)).sort((e,t)=>t.height-e.height)[0];return null==i?void 0:i.width}catch(e){return}}function j(e){let{symbol:t,pricePrecision:r,minPriceChange:a,quantityPrecision:b,quantityUnit:j,tradeUnit:P,usdtCost:k,onSubmitOrder:L}=e,{$t:S}=(0,d.B)(),O=(0,v.k)(j,S),I=(0,h.k)(e=>e.user),_=(0,h.k)(e=>e.gotoLogin),M=(0,g.ZC)(e=>e.tradingViewStatus),q=(0,g.ZC)(e=>e.tradingViewDataReady),B=(0,g.ZC)(e=>e.tradingViewWidget),D=(0,g.ZC)(e=>e.themeMode),F=(0,m.N1)(p.p.USDT.SIMPLE_TICKER(t)),[R,A]=(0,l.useState)(),[E,Q]=(0,l.useState)(""),[W,U]=(0,l.useState)(!1),[V,z]=(0,l.useState)(40),[H,K]=(0,l.useState)(90),[$,Z]=(0,l.useState)("buy"),[J,Y]=(0,l.useState)(!1),[G,X]=(0,l.useState)(0),ee=(0,l.useRef)(!1),et=(0,l.useRef)(0),er=(0,l.useRef)(!1),en=(0,l.useRef)(null),ei=Number(null==F?void 0:F.last),el=(0,l.useRef)(e
1i),ea=(0,l.useCallback)(e=>{ee.current=e,U(e)},[]),eo=(0,l.useCallback)(()=>{let e=en.current;en.current=null;try{null==e||e.remove()}catch(e){}},[]),es=(0,l.useCallback)(()=>{et.current+=1,eo(),ea(!1),A(void 0),Q("")},[eo,ea]);(0,l.useEffect)(()=>{el.current=ei},[ei]),(0,l.useEffect)(()=>{es()},[es,t,P,k,r,b,a,D,B,M,q]),(0,l.useEffect)(()=>{let e,t,n;if("ready"!==M||!q||!B)return;let i=()=>{let e=window.setTimeout(()=>X(e=>e+1),150);return()=>window.clearTimeout(e)};try{e=B.activeChart()}catch(e){return i()}let{lineColor:l,lineStyle:o,lineWidth:s,bodyBorderColor:c,bodyBackgroundColor:u,bodyTextColor:d,bodyFont:m,quantityBorderColor:p,quantityBackgroundColor:h,quantityTextColor:g,quantityFont:v}=(0,f.kh)(D),b=t=>{let{price:n}=t;if(!Number.isFinite(n)){ee.current||(eo(),A(void 0));return}if(ee.current)return;let i=Number(w(n,r,a));if(!(e=>{let t=N(B,e);if(void 0===t)return!1;z(t);let r=T();return void 0!==r&&K(e=>e===r?e:r),!0})(i)||!(t=>{try{var r;let n=null!=(r=en.current)?r:(()=>{try{let t=e.createOrderLine();return en.current=t,t.setText("").setQuantity("").setEditable(!1).setCancellable(!1).setExtendLeft(!0).setLineLength(100).setLineStyle(o).setLineWidth(s).setLineColor(l).setBodyBorderColor(c).setBodyBackgroundColor(u).setBodyTextColor(d).setBodyFont(m).setQuantityBorderColor(p).setQuantityBackgroundColor(h).setQuantityTextColor(g).setQuantityFont(v),t}catch(e){return eo(),null}})();if(!n)return!1;return n.setPrice(t),!0}catch(e){return eo(),!1}})(i)){eo(),A(void 0);return}A(i)},y=()=>{ee.current||(eo(),A(void 0))},x=()=>{try{null==t||t.unsubscribe(null,b)}catch(e){}try{null==n||n.unsubscribe(null,y)}catch(e){}};try{t=e.crossHairMoved(),n=e.onVisibleRangeChanged(),t.subscribe(null,b),n.subscribe(null,y)}catch(e){return x(),i()}let C=document.querySelector("#tv_chart_container iframe"),j=null==C?void 0:C.contentDocument,P=0,k=e=>{if(ee.current)return;let t=T(),r=null==j?void 0:j.documentElement.clientWidth;if(t&&r){var n;(n={pointerX:e.clientX,chartWidth:r,priceScaleWidth:t}).pointerX>=n.chartWidth-n.priceScaleWidth?(cancelAnimationFrame(P),P=requestAnimationFrame(()=>{eo(),A(void 0)})):cancelAnimationFrame(P)}};return null==j||j.addEventListener("pointermove",k,!0),()=>{x(),null==j||j.removeEventListener("pointermove",k,!0),cancelAnimationFrame(P),eo()}},[G,eo,t,r,a,q,M,D,B]);let ec=()=>{if(void 0===R||!Number.isFinite(R))return;if(!(null==I?void 0:I.userId))return void _();Q("");let e=C(R,Number.isFinite(el.current)?el.current:void 0);e&&(Z(e),et.current+=1,ea(!0))};(0,l.useEffect)(()=>{if(!W||void 0===R||!B)return;let e=0,t=()=>{let t=N(B,R);if(void 0!==t)e=0,z(e=>e===t?e:t);else{(e+=1)>=3&&es();return}let r=T();void 0!==r&&K(e=>e===r?e:r)};t();let r=window.setInterval(t,150);return()=>window.clearInterval(r)},[es,W,R,q,M,B]),(0,l.useEffect)(()=>{if(!W||void 0===R)return;let e=C(R,ei);e&&e===$||es()},[es,ei,W,R,$]);let eu=async()=>{if(er.current||J||void 0===R||!Number.isFinite(R)||!E)return;let e=C(R,Number.isFinite(ei)?ei:void 0);if(!e||e!==$)return void es();if(!(null==I?void 0:I.userId))return void _();er.current=!0;let t=et.current;Y(!0);try{let e=await L({direction:$,price:w(R,r),quantity:E});if(!1===e||t!==et.current)return;es()}catch(e){}finally{er.current=!1,Y(!1)}};return void 0===R?null:(0,n.jsxs)("div",{className:"pointer-events-none absolute inset-x-0 z-30 h-[52px]",style:{top:V},children:[W?(0,n.jsxs)("div",{className:"shadow-1 pointer-events-auto absolute top-0 flex h-[52px] w-[252px] rounded-[8px] dark:shadow-none",style:{right:H+24},children:[(0,n.jsx)("div",{className:"w-[120px] shrink-0",children:(0,n.jsx)(s.Input,{value:E,onChange:e=>{var t;let r=(t={value:e.target.value,precision:b,tradeUnit:P},/^\d*\.?\d*$/.test(t.value)?(0,x.p0)({value:t.value,precision:t.precision,tradeUnit:t.tradeUnit}):null);if(null===r){e.currentTarget.value=E;return}Q(r)},placeholder:"".concat(S("key_qty_1_3_11_copy"),"(").concat(O,")"),inputMode:"decimal",autoComplete:"off",autoFocus:!0,variant:"outlined",wrapperClassName:"!h-[52px] !rounded-l-[8px] !rounded-r-none !border !border-r-0 !bg-bg4 !px-4",className:"!text-t1 placeholder:!text-t3 !text-[14px] !leading-5 !font-normal dark:!text-white dark:placeholder:!text-white/35"})}),(0,n.jsx)(c.$,{type:"button","aria-label":S("buy"===$?"Open Long":"Open Short"),"aria-busy":J,disabled:J,className:"!h-[52px] !w-[100px] !shrink-0 !rounded-none !px-0 !font-normal",variant:"buy"===$?"bullish":"bearish",onClick:eu,children:(0,n.jsxs)("span",{className:"flex flex-col items-start",children:[(0,n.jsx)("span",{className:"text-[12px] leading-4 text-white dark:text-white/75",children:S("buy"===$?"Open Long":"Open Short")}),(0,n.jsx)("span",{className:"text-[14px] leading-5 text-white",children:(0,y.iT)(w(R,r))})]})}),(0,n.jsx)("button",{type:"button","aria-label":S("Close"),className:"border-l1 bg-bg4 text-t3 hover:text-t1 flex h-[52px] w-8 shrink-0 cursor-pointer items-center justify-center rounded-r-[8px] border border-l-0 transition-colors dark:text-white/55 dark:hover:text-white",onClick:es,children:(0,n.jsx)(i.U,{className:"size-4"})})]}):null,(0,n.jsxs)("div",{className:"absolute top-1/2 flex h-6 -translate-y-1/2 items-stretch text-white drop-shadow-[0_4px_8px_rgba(0,0,0,0.05)]",style:{left:"calc(100% - ".concat(H+24,"px)")},children:[(0,n.jsx)(u.Tooltip,{content:S("key_quick_order_1_3_10"),side:"top",align:"center",sideOffset:16,delayDuration:0,disabled:W,children:(0,n.jsx)("button",{type:"button","aria-label":S("key_quick_order_1_3_10"),disabled:W,className:"border-l1 pointer-events-auto relative z-[1] flex w-6 shrink-0 cursor-pointer touch-none items-center justify-center rounded-l-[4px] border border-r-0 bg-[#29292B] disabled:cursor-default",onPointerDown:e=>{e.preventDefault(),e.stopPropagation(),ec()},onClick:e=>{e.stopPropagation(),0===e.detail&&ec()},children:(0,n.jsx)(o,{className:"size-[14px] text-white"})})}),(0,n.jsx)("span",{className:"border-l1 flex h-6 shrink-0 items-center rounded-r-[4px] border bg-[#29292B] pr-2 pl-[10px] font-[Inter] text-[12px] leading-4 font-normal whitespace-nowrap",children:w(R,r)})]})]})}},34652:(e,t,r)=>{r.d(t,{H4:()=>m,Lb:()=>d,MK:()=>s,Qq:()=>c,UA:()=>u,sK:()=>p});var n=r(19490),i=r(6334),l=r.n(i);function a(e){let t=Number(e);return Number.isFinite(t)?t:null}function o(e,t){let r=a(e);if(null===r||0===r)return"--";let i="number"==typeof t?r.toFixed(t):String(e);return(0,n.iT)(i)}function s(e,t){let r=a(e);if(null===r)return"--";let i="number"==typeof t?r.toFixed(t):String(e);return(0,n.iT)(i)}function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,r=a(e);return null===r?"--":"".concat((0,n.iT)((100*r).toFixed(t)),"%")}function u(e){if(!e)return"--";let t=a(e),r=null===t?l()(e):l()(t);return r.isValid()?r.format("YYYY-MM-DD"):"--"}function d(e,t){let r=o(e);return"--"===r?r:"".concat(r," ").concat(t||"").trim()}function m(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4,r=o(e,t);return"--"===r?r:"$".concat(r)}function p(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,r=a(e);return null===r||0===r?"--":"$".concat((0,n.x0)(r,t))}},47606:(e,t,r)=>{r.d(t,{o:()=>a});var n=r(79237),i=r(22522),l=r(68924);function a(e){let{locale:t,symbol:r}=e;return(0,n.jsx)(i.o,{href:(0,l.Gj)(t,r)}
1)}},63125:(e,t,r)=>{r.d(t,{d:()=>ev});var n=r(79237),i=r(70659),l=r(13603),a=r(66960),o=r(90477),s=r(91346),c=r(81742),u=r(99082),d=r(91931),m=r(35349),p=r(88518),h=r(51025),g=r(14275),f=r(4390),v=r(21083),b=r(38113),y=r(76656),x=r(18523),C=r(10022),w=r(35725),N=r(47387),T=r(26212),j=r(83054);function P(e,t,r){let n=T.ep.getConfig(t);if(!n.symbol)return e;let i=N.hv.get("tradeUnit")||"0",l=1,a=0;return("0"===i||"2"===i)&&(l=Number(n.multiplier)||0)&&(a=(0,j.DF)(l)),(0,j.SD)({quantityCont:e,tradeUnit:i,multiplier:l,price:r,quantityPrecision:a,usdtPrecision:n.precision})}var k=r(51430),L=r(38455),S=r(41760),O=r(96620),I=r(19490),_=r(89719),M=r(5676),q=r(97773);function B(e){let t=Number(e);return Number.isFinite(t)?t:null}function D(e){let t=B(e);return null===t?"--":(0,I.iT)(t)}function F(e){return e.btnBg||"rgba(0, 0, 0, 0.75)"}function R(e,t){return"openShort"===t||"closeLong"===t?e.down:e.up}function A(e,t){return t?(e||[]).filter(e=>e.symbol===t):[]}function E(e){if(e)try{e.remove()}catch(e){}}function Q(e){let{store:t,items:r,getKey:n,create:i,update:l}=e,a=new Set;r.forEach((e,r)=>{let o=n(e,r);if(null===o||a.has(o))return;a.add(o);let s=t.get(o);s?l(s,e):t.set(o,i(e,o))}),t.forEach((e,r)=>{a.has(r)||(E(e.line),t.delete(r))})}function W(e){e.current.forEach(e=>E(e.line)),e.current.clear()}function U(e){let t=B(e.quantity),r=e.symbol,n=B(e.price);if(null===t)return"--";if(!r)return D(t);try{return(0,I.iT)(e.getQuantity(t,r,null!=n?n:void 0))}catch(e){return D(t)}}function V(e){return e.line.setLineStyle(1).setLineLength(3).setText(e.text).setExtendLeft(!1).setQuantity(e.quantity).setPrice(e.price).setBodyBorderColor(e.color).setQuantityBorderColor(e.color).setLineColor(e.color).setQuantityBackgroundColor(e.color).setBodyTextColor(e.color).setBodyBackgroundColor("#FFFFFF").setCancelButtonBorderColor(e.color).setCancelButtonBackgroundColor(e.buttonBg).setCancelButtonIconColor(e.color)}function z(e,t){return e===t||e.length===t.length&&e.every((e,r)=>(0,M.x)(e,t[r]))}function H(e,t){return e&&z(e,t)?e:t}let K={position:!0,order:!0,tpslOrder:!0,triggerOrder:!0,historyOrder:!0},$={};var Z=r(30511),J=r(66541),Y=r(47582),G=r(83125);function X(e){var t;let{asset:r,symbol:l,coinInfo:o}=e,{$t:s}=(0,a.B)(),[c,u]=(0,b.useState)(!1),d=null==o||null==(t=o.introduction)?void 0:t.trim();return(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"gap-s2 flex items-center",children:[(0,n.jsx)(G.Image,{src:l?"/resource-upload/".concat(l.split("-")[0],".png"):"",bucket:"res",width:24,height:24,alt:r,className:"size-6 rounded-full",unoptimized:!0}),(0,n.jsxs)("div",{className:"text-t16 text-t1 font-semibold",children:[r,"USDT"]})]}),d?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"text-c12 text-t1 mt-s3 max-w-[520px] leading-[1.4] break-words ".concat(c?"":"line-clamp-3"),children:d}),(0,n.jsx)(i.$,{type:"button",variant:"link",size:"xs",className:"mt-s1 text-c12 h-auto p-0",onClick:()=>u(e=>!e),children:s(c?"Show less":"Show more")})]}):(0,n.jsx)("div",{className:"text-c12 text-t4 mt-s4",children:"--"})]})}var ee=r(14994),et=r(95468),er=r(9238);function en(e){let{coinInfo:t}=e,{$t:r,locale:i}=(0,a.B)(),l=[{label:r("Explorer"),href:null==t?void 0:t.blockExplorer},{label:r("Whitepaper"),href:null==t?void 0:t.whitePaper},{label:r("Official Website"),href:null==t?void 0:t.officialWebsite},{label:r("Error Reporting"),href:"".concat((0,et.j0)(),"/hc/").concat((0,er.FQ)(i),"/requests/new")}].filter(e=>!!e.href);return(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-t16 text-t1 mt-s4 font-semibold",children:r("Links")}),(0,n.jsx)("div",{className:"mt-s3 gap-s3 flex flex-wrap items-center",children:l.map(e=>(0,n.jsxs)("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:"bg-bg2 text-c12 text-t2 hover:text-t1 gap-s2 rounded-r1 px-s3 inline-flex h-8 items-center transition-colors",children:[(0,n.jsx)("span",{children:e.label}),(0,n.jsx)(ee.q,{className:"size-3"})]},e.label))}),(0,n.jsx)("div",{className:"text-c12 text-t4 mt-s4 max-w-[520px] leading-[1.4]",children:r("Note:Data is provided by CMC and is for reference only. It is presented on this basis and does not serve as any form of representation or guarantee.")})]})}var ei=r(46540),el=r(34652);function ea(e,t,r){let n=Number(e);if(!Number.isFinite(n)||n<=0)return"--";let i=(0,el.UA)(t),l=(0,el.H4)(n*r,4);return"--"===i?l:"".concat(l,"(").concat(i,")")}function eo(e){return(0,n.jsx)(ei.Tooltip,{content:e.tooltip,children:(0,n.jsx)("span",{className:"border-t3 cursor-help border-b border-dashed pb-[1px]",children:e.label})})}function es(e){let{asset:t,coinInfo:r,rate:i,spotLatestPrice:l}=e,{$t:o}=(0,a.B)(),s=function(e){let t=Number(e.circulationSupply),r=Number(e.latestPrice),n=Number(e.rate);if(!Number.isFinite(t)||!Number.isFinite(r)||!Number.isFinite(n))return null;let i=t*r*n;return Number.isFinite(i)&&i>0?i:null}({circulationSupply:null==r?void 0:r.circulationSupply,latestPrice:l,rate:i}),c=[{label:o("Ranking"),tooltip:o("The coin's ranking in the crypto market based on market capitalization."),value:(null==r?void 0:r.rank)?"No. ".concat(r.rank):"--"},{label:o("Market Cap"),tooltip:o("The circulating supply of the coin multiplied by its current price."),value:(0,el.sK)(s)},{label:o("Market Dominance Index"),tooltip:o("Tracks the total market capitalization of the asset relative to the total market capitalization of all assets."),value:(0,el.Qq)(null==r?void 0:r.dominance)},{label:o("Circulating Supply"),tooltip:o("The number of tokens in circulation in the market held by the public."),value:(0,el.Lb)(null==r?void 0:r.circulationSupply,t)},{label:o("Maximum Supply"),tooltip:o("The maximum number of tokens that will exist in the asset's lifecycle."),value:(0,el.Lb)(null==r?void 0:r.maxSupply,t)},{label:o("Total Supply"),tooltip:o("The total number of tokens mined minus the number of tokens burned."),value:(0,el.Lb)(null==r?void 0:r.totalSupply,t)},{label:o("Issue Date"),tooltip:o("Asset initial offering date"),value:(0,el.UA)(null==r?void 0:r.issueTime)},{label:o("Historical High"),tooltip:o("The highest price this asset has reached in its trading history."),value:ea(null==r?void 0:r.hisHighPrice,null==r?void 0:r.hisHighDate,i)},{label:o("Historical Low"),tooltip:o("The lowest price this asset has reached in its trading history."),value:ea(null==r?void 0:r.hisLowPrice,null==r?void 0:r.hisLowDate,i)}];return(0,n.jsx)("div",{className:"gap-s1 grid",children:c.map(e=>(0,n.jsxs)("div",{className:"gap-s4 flex min-h-9 items-center justify-between",children:[(0,n.jsx)("div",{className:"text-c12 text-t3 max-w-[48%]",children:(0,n.jsx)(eo,{label:e.label,tooltip:e.tooltip})}),(0,n.jsx)("div",{className:"text-c12 text-t1 max-w-[48%] text-right break-words",children:e.value})]},e.label))})}function ec(e){var t,r,i,l,o;let{symbol:s}=e,{locale:c}=(0,a.B)(),u=(0,h.k)(e=>{var t,r;return null!=(r=null==(t=e.user)?void 0:t.userId)?r:null}),d=(0,b.useMemo)(()=>(function(e){let t=null==e?void 0:e.toUpperCase();return t?t.endsWith("-SWAP")||t.endsWith("-USDT")?t.split("-")[0]||"BTC":t.endsWith("USDT")?t.slice(0,-4)||"BTC":t:"BTC"})(s),[s]),m=(0,f.useQuery)({queryKey:["futures-tradingview-overview-coin",c,d,null!=u?u:"guest"],queryFn:()=>{let e={locale:c,params:{asset:d}};return u?(0,J.EC)(e):(0,J.Bd)(e)},enabled:!!c&&!!d,staleTime:3e5}),p=(0,f.useQuery)({queryKey:["futures-tradingview-overview-latest-price",c,d],queryFn:()=>(0,Y.Zd)({locale:c}),enabled:!!c&&!!d,staleTime:3e4}),g=(0,f.useQuery)({queryKey:["futures-tradingview-overview-rates",c],queryFn:()=>(0,Y.tv)({locale:c}),enabled:!!c,staleTime:3e5}),v=null==(t=m.data)?void 0:t.data,y=function(e){let t=Number(e);return Number.isFinite(t)&&t>0?t:1}(null==(l=g.data)||null==(i=l.data)||null==(r=i[0])?void 0:r.rate),x=function(e,t){let r="".concat(t.toUpperCase(),"USDT"),n=Object.values(e||{}).find(e=>{var t;return(null==e||null==(t=e.s)?void 0:t.toUpperCase())===r}),i=Number(null==n?void 0:n.n);return Number.isFinite(i)&&i>0?i:null}(null==(o=p.data)?void 0:o.data,d);return(m.isLoading||p.isLoading||g.isLoading)&&!v?(0,n.jsx)("div",{className:"py-s8 flex h-full min-h-0 items-center justify-center",children:(0,n.jsx)(Z.t,{type:"global",size:"s"})}):(0,n.jsx)("div",{className:"px-s4 py-s4 h-full min-h-0 overflow-auto",children:(0,n.jsxs)("div",{className:"gap-s6 grid lg:grid-cols-[minmax(0,1fr)_minmax(0,1fr)]",children:[(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)(X,{asset:d,symbol:s,coinInfo:v}),(0,n.jsx)(en,{coinInfo:v})]}),(0,n.jsx)("div",{className:"lg:pl-s4 min-w-0",children:(0,n.jsx)(es,{asset:d,coinInfo:v,rate:y,spotLatestPrice:x})})]})})}let eu=["chart","overview","info"],ed=["left_toolbar"],em={lineFilterOptions:{},disabledFeatures:ed,enabledFeatures:[]},ep={disabledFeatures:ed,enabledFeatures:[]};function eh(){return(0,n.jsx)("section",{className:"border-l1 bg-bg7 h-[400px] min-h-[360px] overflow-hidden border-b",children:(0,n.jsx)(s.t,{mode:"mobile"})})}function eg(e){let{watermark:t}=e;return(0,n.jsx)("div",{className:"relative h-full min-h-0",children:(0,n.jsx)(s.t,{watermark:t})})}function ef(e){let{label:t,onClick:r}=e;return(0,n.jsx)("div",{className:"bg-bg7 p-s4 pb-14",children:(0,n.jsx)(i.$,{type:"button",size:"m",className:"w-full",onClick:r,children:t})})}function ev(e){let{mode:t="pc",symbol:r,pricePrecisionFn:i,isDemoTrading:s=!1,h5Header:N,watermark:T,infoPanel:j,klineOrderHandlers:I,onTradeClick:M,quickOrderOverlay:E}=e,{$t:Z}=(0,a.B)(),[J,Y]=(0,b.useState)("chart"),G="h5"===t,X=Z("Trade"),ee=(0,b.useMemo)(()=>s?ep:em,[s]);return!function(e){var t,r,n;let{isH5:i=!1,isDemoTrading:l=!1,symbol:o,pricePrecisionFn:s,initOptions:N,klineOrderHandlers:T,getQuantity:j}=e,{$t:I,locale:M}=(0,a.B)(),{theme:E="dark"}=(0,c.W)(),{userId:Z,userReady:J}=(0,h.k)((0,y.k)(e=>{var t;return{userId:null==(t=e.user)?void 0:t.userId,userReady:!!e.userLoadFromStorage}})),Y=J&&!!Z,G=(0,g.useQueryClient)(),X=(0,b.useRef)(""),ee=(0,b.useRef)(void 0),et=(0,C.ZC)((0,y.k)(e=>({klineTopic:e.klineTopic,tradingViewInitialized:e.tradingViewInitialized,symbol:e.symbol,interval:e.interval,klineModel:e.klineModel,lineFilterOptions:e.lineFilterOptions,themeMode:e.themeMode,tradingViewStatus:e.tradingViewStatus}))),er=(0,C.ZC)((0,y.k)(e=>({initTradingView:e.initTradingView,changeTheme:e.changeTheme,reloadCharts:e.reloadCharts}))),en=(0,v.A)(()=>{let{lineFilterOptions:e,disabledFeatures:t,enabledFeatures:r}=null!=N?N:{};return{lineFilterOptions:null!=e?e:l?$:K,disabledFeatures:t,enabledFeatures:r,drawingSyncSupported:!i&&!l}}),ei=(0,v.A)(e=>
1({symbol:e,tradingViewType:"contract",isDemoTrading:l,themeMode:E,locale:M,contractEvents:{$t:I},pricePrecisionFn:s,...en()})),el=(0,v.A)(async e=>{await er.initTradingView(ei(e))}),ea=!l&&Y&&!!(null==(t=et.lineFilterOptions)?void 0:t.historyOrder)&&!!(null==(n=et.klineModel)||null==(r=n.filters)?void 0:r.historyOrder)&&!!et.symbol&&!!et.interval,eo=(0,b.useMemo)(()=>["usdt-order-api","getHistoryOrderKline",Z,M,et.symbol,et.interval],[M,et.interval,et.symbol,Z]),{data:es}=(0,f.useQuery)({queryKey:eo,queryFn:()=>(0,p.A_)({locale:M,params:{symbol:et.symbol,resolution:x.Wl[et.interval],userId:Z}}),enabled:ea,staleTime:0}),ec=(0,b.useMemo)(()=>{var e;if(!es)return[];let t=null!=(e=null==es?void 0:es.data)?e:null==es?void 0:es.item;return(0,w.K)(t)},[es]),eu=(0,v.A)(()=>{ea&&(0,u.k)(G,eo)});!function(e){let{handlers:t,isLoggedIn:r=!1,getQuantity:n=P}=e,{$t:i}=(0,a.B)(),l=(0,_.wc)(),o=(0,C.ZC)((0,y.k)(e=>({tradingViewStatus:e.tradingViewStatus,tradingViewDataReady:e.tradingViewDataReady,symbol:e.symbol,klineModel:e.klineModel,lineFilterOptions:e.lineFilterOptions,addDrawChartsFn:e.addDrawChartsFn,removeDrawChartsFn:e.removeDrawChartsFn}))),{symbol:s,lineFilterOptions:c,klineModel:u}=o,d="ready"===o.tradingViewStatus&&o.tradingViewDataReady,m=null==u?void 0:u.filters,p=!!(null==m?void 0:m.position)&&!!(null==c?void 0:c.position),h=!!(null==m?void 0:m.order)&&!!(null==c?void 0:c.order),g=!!(null==m?void 0:m.tpslOrder)&&!!(null==c?void 0:c.tpslOrder),f=!!(null==m?void 0:m.triggerOrder)&&!!(null==c?void 0:c.triggerOrder),x=p||h||g||f,w=r&&x?O.p.USDT.USER_KLINE():void 0,N=p&&s?O.p.USDT.SIMPLE_TICKER(s):void 0,T=b.useRef(new Map),j=b.useRef(new Map),I=b.useRef(new Map),M=b.useRef(new Map),E=b.useRef(t);E.current=t;let K=b.useRef(null),{positionLineData:$,openOrderLineData:Z,tpslOrderLineData:J,triggerOrderLineData:Y}=(0,S.T4)({topics:[w,N],dataTransformer:e=>{var t;let r=e[0],n=e[1],i={positionLineData:s?A((t={items:null==r?void 0:r.positions,symbol:s,ticker:n,basePriceConfig:l}).items,t.symbol).map(e=>({...e,pnl:function(e){var t,r,n,i;let{item:l,basePriceConfig:a,ticker:o}=e,s="1"===a?null!=(r=null!=(t=l.unrealisedPnl)?t:l.pnl)?r:l.unrealisedPnlLatest:null!=(i=null!=(n=l.unrealisedPnlLatest)?n:l.pnl)?i:l.unrealisedPnl,c=B("1"===a?null==o?void 0:o.markPrice:null==o?void 0:o.last),u=B(l.avgPrice),d=B(l.quantity);return l.symbol&&("long"===l.side||"short"===l.side)&&null!==c&&null!==u&&null!==d?(0,k.eh)((0,L.b0)({symbol:l.symbol,side:l.side,basePrice:c,openPrice:u,contQuantity:d}),2):null!=s?s:0}({item:e,ticker:t.ticker,basePriceConfig:t.basePriceConfig})})):[],openOrderLineData:s?A(null==r?void 0:r.orders,s):[],tpslOrderLineData:s?A(null==r?void 0:r.tpslOrders,s):[],triggerOrderLineData:s?A(null==r?void 0:r.triggerOrders,s):[]},a=K.current,o={positionLineData:H(null==a?void 0:a.positionLineData,i.positionLineData),openOrderLineData:H(null==a?void 0:a.openOrderLineData,i.openOrderLineData),tpslOrderLineData:H(null==a?void 0:a.tpslOrderLineData,i.tpslOrderLineData),triggerOrderLineData:H(null==a?void 0:a.triggerOrderLineData,i.triggerOrderLineData)};return K.current=o,o},shouldUpdate:(e,t)=>!z(e.positionLineData,t.positionLineData)||!z(e.openOrderLineData,t.openOrderLineData)||!z(e.tpslOrderLineData,t.tpslOrderLineData)||!z(e.triggerOrderLineData,t.triggerOrderLineData),deps:[s,l]}),G=(0,v.A)(()=>{W(T)}),X=(0,v.A)(()=>{W(j)}),ee=(0,v.A)(()=>{W(I)}),et=(0,v.A)(()=>{W(M)}),er=(0,v.A)((e,t,r)=>{let l=F(t),a=e=>{var r,a,o,s,c;let u=e.item,d=null!=(r=B(u.avgPrice))?r:0,m="short"===u.side?t.down:t.up,p="short"===u.side?i("Short"):i("Long"),h=null!=(s=null!=(o=null!=(a=u.pnl)?a:u.unrealisedPnl)?o:u.unrealisedPnlLatest)?s:0;e.quantity=U({quantity:u.quantity,symbol:u.symbol,price:d,getQuantity:n}),(c={line:e.line,color:m,buttonBg:l,text:"".concat(p," ").concat(D(h)),quantity:e.quantity,price:d}).line.setLineStyle(1).setText(c.text).setQuantity(c.quantity).setLineLength(100).setPrice(c.price).setQuantityBackgroundColor(c.color).setBodyTextColor(c.color).setBodyBorderColor(c.color).setQuantityBorderColor(c.color).setLineColor(c.color).setBodyBackgroun
1dColor("#FFFFFF").setCloseButtonBorderColor(c.color).setCloseButtonBackgroundColor(c.buttonBg).setCloseButtonIconColor(c.color)};Q({store:T.current,items:r,getKey:(e,t)=>{var r,n;return null===B(e.avgPrice)?null:String(null!=(n=null!=(r=e.id)?r:e.separatedPositionId)?n:t)},create:(t,r)=>{let n={line:e.createPositionLine(),item:t,quantity:""};return a(n),n.line.onClose(()=>{var e,t;let n=T.current.get(r);n&&(null==(t=E.current)||null==(e=t.onPositionClose)||e.call(t,{separatedPositionId:n.item.separatedPositionId,orderType:"market",quantity:n.quantity,leverage:n.item.leverage},n.item))}),n},update:(e,t)=>{e.item=t,a(e)}})}),en=(0,v.A)((e,t,r)=>{let l=F(t),a=e=>{var r;let a=e.item,o=null!=(r=B(a.orderPrice))?r:0,s=R(t,a.direction);e.quantity=U({quantity:a.quantity,symbol:a.symbol,price:o,getQuantity:n}),V({line:e.line,color:s,buttonBg:l,text:function(e,t){let r=t("postOnly"===e.orderType?"Post Only":"planLimit"===e.orderType?"Trigger Order":"Limit");return"".concat(r,": ").concat(D(e.orderPrice))}(a,i),quantity:e.quantity,price:o}),e.line.setEditable(!!a.editable)};Q({store:j.current,items:r,getKey:(e,t)=>{var r;return null===B(e.orderPrice)?null:String(null!=(r=e.orderId)?r:t)},create:(t,r)=>{let n={line:e.createOrderLine(),item:t,quantity:""};return a(n),n.line.onCancel(()=>{let e=j.current.get(r);if(e){var t,n;null==(n=E.current)||null==(t=n.onOpenOrderCancel)||t.call(n,e.item)}}),n.line.onMove(()=>{var e,t;let n=j.current.get(r);n&&n.item.editable&&(null==(t=E.current)||null==(e=t.onOpenOrderMove)||e.call(t,n.item,n.line))}),n},update:(e,t)=>{e.item=t,a(e)}})}),ei=(0,v.A)((e,t,r)=>{let l=F(t),a=e=>{var r;let a=e.item,o=null!=(r=B(a.triggerPrice))?r:0;e.quantity=U({quantity:a.quantity,symbol:a.symbol,price:"planLimit"===a.orderType?a.orderPrice:a.triggerPrice,getQuantity:n});let s=R(t,a.direction);V({line:e.line,color:s,buttonBg:l,text:function(e,t){let r=t("stopLoss"===e.planType?"Stop Loss":"Take Profit"),n="planMarket"===e.orderType?t("Market Trigger"):t("Limit {0} Trigger",{0:D(e.orderPrice)}),i="lt"===e.triggerDirection?"≤":"≥";return"".concat(r,": ").concat(n," ").concat(i," ").concat(D(e.triggerPrice))}(a,i),quantity:"position"===a.tpslType?i("ALL"):e.quantity,price:o})};Q({store:I.current,items:r,getKey:(e,t)=>{var r,n;return null===B(e.triggerPrice)?null:String(null!=(n=null!=(r=e.id)?r:e.planId)?n:t)},create:(t,r)=>{let n={line:e.createOrderLine(),item:t,quantity:""};return a(n),n.line.onCancel(()=>{let e=I.current.get(r);if(e){var t,n;null==(n=E.current)||null==(t=n.onTpslOrderCancel)||t.call(n,e.item)}}),n.line.onMove(()=>{let e=I.current.get(r);if(e){var t,n;null==(n=E.current)||null==(t=n.onTpslOrderMove)||t.call(n,e.item,e.line,e.quantity)}}),n},update:(e,t)=>{e.item=t,a(e)}})}),el=(0,v.A)((e,t,r)=>{let l=F(t),a=e=>{var r;let a=e.item,o=null!=(r=B(a.triggerPrice))?r:0;e.quantity=U({quantity:a.quantity,symbol:a.symbol,price:"planLimit"===a.orderType?a.orderPrice:a.triggerPrice,getQuantity:n});let s=R(t,a.direction);V({line:e.line,color:s,buttonBg:l,text:function(e,t){let r=t("mark"===e.triggerWay?"Mark Price":"Last Price"),n="lt"===e.triggerDirection?"≤":"≥";return"".concat(t("Trigger"),": ").concat(r," ").concat(n," ").concat(D(e.triggerPrice))}(a,i),quantity:e.quantity,price:o})};Q({store:M.current,items:r,getKey:(e,t)=>{var r,n;return null===B(e.triggerPrice)?null:String(null!=(n=null!=(r=e.id)?r:e.planId)?n:t)},create:(t,r)=>{let n={line:e.createOrderLine(),item:t,quantity:""};return a(n),n.line.onCancel(()=>{let e=M.current.get(r);if(e){var t,n;null==(n=E.current)||null==(t=n.onTriggerOrderCancel)||t.call(n,e.item)}}),n.line.onMove(()=>{let e=M.current.get(r);if(e){var t,n;null==(n=E.current)||null==(t=n.onTriggerOrderMove)||t.call(n,e.item,e.line,e.quantity)}}),n},update:(e,t)=>{e.item=t,a(e)}})}),ea=(0,q.P)(e=>{let{tradingViewWidget:t,theme:r}=e;if(!p)return void G();er(t.chart(),r,$)}),eo=(0,q.P)(e=>{let{tradingViewWidget:t,theme:r}=e;if(!h)return void X();en(t.chart(),r,Z)}),es=(0,q.P)(e=>{let{tradingViewWidget:t,theme:r}=e;if(!g)return void ee();ei(t.chart(),r,J)}),ec=(0,q.P)(e=>{let{tradingViewWidget:t,theme:r}=e;if(!f)return void et();el(t.chart(),r,Y)}),eu=(0,v.A)(()=>{G(),X(),ee(),et(),ea(),eo(),es(),ec()});b.useEffect(()=>(o.addDrawChartsFn(eu),()=>{o.removeDrawChartsFn(eu),G(),X(),ee(),et()}),[]),b.useEffect(()=>{"ready"!==o.tradingViewStatus&&(G(),X(),ee(),et())},[o.tradingViewStatus,G,X,ee,et]),b.useEffect(()=>{d&&ea()},[p,$,ea,d]),b.useEffect(()=>{d&&eo()},[Z,h,eo,d]),b.useEffect(()=>{d&&es()},[es,d,g,J]),b.useEffect(()=>{d&&ec()},[ec,d,f,Y])}({handlers:T,isLoggedIn:Y,getQuantity:j}),(0,w.n)({historyOrders:l?[]:ec}),(0,d.E)({onHisorderChanged:eu},{enabled:ea}),(0,b.useEffect)(()=>
1{if(o){if(!et.tradingViewInitialized||!X.current){X.current=o,ee.current=i,el(o);return}if(ee.current!==i){X.current=o,ee.current=i,er.reloadCharts(en());return}}},[er,en,ei,el,l,i,et.symbol,et.tradingViewInitialized,o]),(0,m.kO)([et.klineTopic])}({isH5:G,isDemoTrading:s,symbol:r,pricePrecisionFn:i,initOptions:G?ee:void 0,klineOrderHandlers:G?void 0:I}),(0,n.jsxs)(l.Tabs,{value:J,onValueChange:e=>Y(e),variant:"text",size:"s",className:(0,o.cn)("bg-bg7",G?"overflow-hidden":"h-full min-h-0"),showUnderline:!0,children:[G?N:null,(0,n.jsx)("div",{className:(0,o.cn)("flex shrink-0 items-center",G?"bg-bg7 h-10 w-full":"h-11"),children:(0,n.jsx)(l.TabsList,{className:(0,o.cn)("h-full bg-transparent",G?"w-full px-4":"px-s4"),underlineClassName:"dark:border-l3",scrollGradientClass:"to-bg7",scrollArrowBgClass:"bg-bg7",children:eu.map(e=>(0,n.jsx)(l.TabsTrigger,{value:e,className:G?"text-t14":void 0,children:"chart"===e?Z("Chart_r_1"):"overview"===e?Z("Overview_r_1"):Z("Contract Info")},e))})}),(0,n.jsxs)("div",{className:(0,o.cn)("min-h-0",G?void 0:"flex-1"),children:[(0,n.jsx)(l.TabsContent,{value:"chart",forceMount:!0,className:(0,o.cn)("mt-0 min-h-0",G?void 0:"h-full"),children:G?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eh,{}),M?(0,n.jsx)(ef,{label:X,onClick:M}):null]}):(0,n.jsxs)("div",{className:"relative h-full min-h-0",children:[(0,n.jsx)(eg,{watermark:T}),E]})}),(0,n.jsxs)(l.TabsContent,{value:"overview",className:(0,o.cn)("mt-0 min-h-0",G?void 0:"h-full"),children:[(0,n.jsx)(ec,{symbol:r}),G&&M?(0,n.jsx)(ef,{label:X,onClick:M}):null]}),(0,n.jsx)(l.TabsContent,{value:"info",className:(0,o.cn)("mt-0 min-h-0",G?void 0:"h-full"),children:j})]})]})}},85403:(e,t,r)=>{r.d(t,{V:()=>x});var n=r(79237),i=r(14994),l=r(46540),a=r(30511),o=r(69233),s=r(66960),c=r(3529),u=r(90477),d=r(28824),m=r(4390),p=r(61877),h=r.n(p),g=r(34652);function f(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return null==e||""===e?"--":"".concat(e).concat(t)}function v(e){return(0,n.jsxs)("div",{className:"gap-s4 flex min-h-8 items-center justify-between",children:[(0,n.jsx)("div",{className:"text-cm12 text-t3 max-w-[58%]",children:e.label}),(0,n.jsx)("div",{className:"text-cm12 text-t1 max-w-[40%] text-right break-words",children:e.value})]})}function b(e){let{symbol:t,contractType:r,contractConfig:i}=e,{$t:l}=(0,s.B)(),a=[{label:l("Name"),value:(0,c.A2)(t,"")||"--"},{label:l("Margin Asset"),value:f(null==i?void 0:i.quoteAsset)},{label:l("Price with Minimum Change"),value:(null==i?void 0:i.minPriceChange)&&(null==i?void 0:i.quoteAsset)?"".concat(i.minPriceChange," ").concat(i.quoteAsset):"--"},{label:l("Max Leverage"),value:f(null==i?void 0:i.maxLeverage,"X")}],o=[{label:l("Derivatives Type"),value:f(r)},{label:l("Contract Value(Cont)"),value:(null==i?void 0:i.multiplier)&&(null==i?void 0:i.baseAsset)?"".concat(i.multiplier," ").concat(i.baseAsset):"--"},{label:l("Min No. of Trades(Cont)"),value:f(null==i?void 0:i.minTradeAmount)},{label:l("Price Protection Threshold"),value:(0,g.Qq)(null==i?void 0:i.priceProtectRate,0)}];return(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-t16 text-t1 font-semibold",children:l("Trading Rules")}),(0,n.jsxs)("div",{className:"mt-s4 grid lg:grid-cols-2",children:[(0,n.jsx)("div",{className:"border-l1 lg:pr-s6 lg:border-r",children:a.map(e=>(0,n.jsx)(v,{label:e.label,value:e.value},e.label))}),(0,n.jsx)("div",{className:"lg:pl-s6",children:o.map(e=>(0,n.jsx)(v,{label:e.label,value:e.value},e.label))})]})]})}function y(e){return(0,n.jsx)(l.Tooltip,{content:e.tooltip,children:(0,n.jsx)("span",{className:"border-t3 cursor-help border-b border-dashed pb-[1px]",children:e.label})})}function x(e){var t,r,l;let{symbol:p,contractType:f,contractConfig:v,isDemoTrading:x=!1}=e,{$t:C,locale:w}=(0,s.B)(),N=x?(0,c.oA)(p):p,T=(0,m.useQuery)({queryKey:["futures-tradingview-contract-info-tier",w,N,x],queryFn:()=>
1(0,d.Nd)({locale:w,params:{symbol:N},...x?{isDemoTrading:!0}:{}}),enabled:!!w&&!!N,staleTime:6e4}),j=null!=(l=null==(r=T.data)||null==(t=r.data)?void 0:t.tierList)?l:[],P=j.map((e,t)=>({...e,id:"".concat(e.tier,"-").concat(t),quantity:"".concat((0,g.MK)(e.quantityMin),"-").concat((0,g.MK)(e.quantityMax))})),k=C("The Maintenance Margin Rate (MMR) refers to the minimum margin ratio that users must maintain while holding current positions. If the margin ratio of a position falls below the Maintenance Margin Rate, it will trigger forced liquidation."),L=C("The Initial Margin Rate (IMR) is the ratio of the initial margin that users need to provide when opening a position to the position's value. The Initial Margin Rate can be expressed by the formula IMR = 1 / leverage."),S=[{title:(0,n.jsx)("div",{className:"pl-s3 whitespace-nowrap",children:C("Tier")}),dataIndex:"tier",key:"tier",width:"16%",render:e=>(0,n.jsx)("span",{className:"pl-s3",children:e||"--"}),mobile:{label:C("Tier"),value:e=>e||"--"}},{title:(0,n.jsx)("span",{className:"whitespace-nowrap",children:C("Qty(Cont)")}),dataIndex:"quantity",key:"quantity",width:"30%",mobile:{label:C("Qty(Cont)")}},{title:(0,n.jsx)(y,{label:C("MMR"),tooltip:k}),dataIndex:"mmr",key:"mmr",width:"18%",render:e=>(0,g.Qq)(e),mobile:{label:(0,n.jsx)(y,{label:C("MMR"),tooltip:k}),value:e=>(0,g.Qq)(e)}},{title:(0,n.jsx)(y,{label:C("IMR"),tooltip:L}),dataIndex:"imr",key:"imr",width:"18%",render:e=>(0,g.Qq)(e),mobile:{label:(0,n.jsx)(y,{label:C("IMR"),tooltip:L}),value:e=>(0,g.Qq)(e)}},{title:(0,n.jsx)("div",{className:"pr-s3 text-right whitespace-nowrap",children:C("Max Leverage")}),dataIndex:"levelMax",key:"levelMax",align:"right",width:"18%",render:e=>(0,n.jsx)("span",{className:"pr-s3",children:e||"--"}),mobile:{label:C("Max Leverage"),value:e=>e||"--"}}];return(0,n.jsxs)("div",{className:"px-s4 py-s4 h-full min-h-0 overflow-auto",children:[(0,n.jsx)(b,{symbol:p,contractType:f,contractConfig:v}),T.isLoading&&0===j.length?(0,n.jsx)("div",{className:"flex h-40 items-center justify-center",children:(0,n.jsx)(a.t,{type:"global",size:"s"})}):(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"gap-s4 mt-s6 mb-s4 flex items-center justify-between",children:[(0,n.jsx)("div",{className:"text-t16 text-t1 font-semibold",children:C("Position Tiers")}),(0,n.jsxs)(h(),{href:"/".concat(w,"/futures/data/position-tiers"),className:"text-cm12 text-t3 hover:text-t1 gap-s1 inline-flex items-center transition-colors",children:[(0,n.jsx)("span",{children:C("View More")}),(0,n.jsx)(i.q,{className:"size-3"})]})]}),(0,n.jsx)("div",{className:"scrollbar-none max-h-none overflow-auto lg:max-h-[260px]",children:(0,n.jsx)(o.WrapTable,{columns:S,dataSource:P,rowKey:"id",hoverable:!1,emptyText:"--",responsive:!0,mobileMode:"card",enableMobileDefaultCollapse:!1,showMobileCardDivier:!1,className:(0,u.cn)("text-cm12 gap-3 lg:min-w-[760px]","[&_td]:py-s3 [&_td]:text-cm12","[&_th]:bg-bg7 [&_th]:text-cm12 [&_th]:font-normal","[&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10","[&_[data-slot=wrap-table-card]]:border-l1 [&_[data-slot=wrap-table-card]]:bg-bg7 [&_[data-slot=wrap-table-card]]:rounded-r2 [&_[data-slot=wrap-table-card]]:border","[&_[data-slot=wrap-table-card]]:px-s4 [&_[data-slot=wrap-table-card]]:py-s4 [&_[data-slot=wrap-table-card]]:gap-3","[&_[data-slot=wrap-table-card]>div]:gap-3","[&_[data-slot=wrap-table-card-row]]:min-h-6 [&_[data-slot=wrap-table-card-row]]:py-0")})})]})]})}},97943:(e,t,r)=>{r.d(t,{$:()=>a});var n=r(79237),i=r(81742),l=r(66960);function a(e){let{variant:t,isH5:r=!1}=e,{$t:a}=(0,l.B)(),{theme:o}=(0,i.W)();return"demo"===t?a("Demo Trading"):(0,n.jsx)("img",{src:"".concat("https://cdn.tapbit.mobi/contract/futures","/water-logo-").concat("dark"===o?"dark":"light",".png"),height:r?30:64,className:r?"h-[30px]":"h-16",alt:"TAPBIT"})}}}]);

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.