PageSourceSearch

https://www.tapbit.com/_next_app/price/0.1.227/_next/static/chunks…on-adjust-margin-dialog.76ecf418e2efe553.js

js tapbit.com collected 2026-10-03 21:41:40 UTC 45,286 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:{},r=(new e.Error).stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="ed03da5b-3eee-433d-ad12-aaee42c2b117",e._sentryDebugIdIdentifier="sentry-dbid-ed03da5b-3eee-433d-ad12-aaee42c2b117")}()}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3951,9881],{16393:(e,r,t)=>{t.d(r,{E9:()=>o,Gb:()=>n,IY:()=>d,RS:()=>i,XQ:()=>s,mg:()=>c});var a=t(75787);function l(e){return{...e,isDemoTrading:!0}}let n=e=>(0,a.xJ)(l(e)),i=e=>(0,a.mV)(l(e)),s=e=>(0,a.Kv)(l(e)),d=e=>(0,a.fh)(l(e)),o=e=>(0,a.Xc)(l(e)),c=e=>(0,a.Pb)(l(e))},18983:(e,r,t)=>{t.d(r,{b:()=>i});var a=t(79237),l=t(38113),n=t(65375);let i=l.forwardRef((e,r)=>(0,a.jsx)(n.B,{ref:r,viewBox:"0 0 1024 1024",...e,children:(0,a.jsx)("path",{d:"M197.290667 283.392L104.362667 190.464 156.16 138.752l722.432 722.389333-51.754667 51.754667-119.381333-118.954667-17.109333-17.109333c-55.04 21.973333-115.328 34.218667-178.474667 34.218667-203.733333 0-377.728-126.72-448.213333-305.578667A480.938667 480.938667 0 0 1 216.021333 302.08l-18.773333-18.773333z m518.272 222.037333a203.818667 203.818667 0 0 0-203.733334-203.733333c-26.453333 0-51.328 5.290667-74.581333 14.677333L349.269333 228.352a474.496 474.496 0 0 1 162.133334-28.501333c203.733333 0 377.728 126.72 448.213333 305.578666a481.450667 481.450667 0 0 1-139.733333 193.536l-118.997334-118.954666c9.386667-23.253333 14.677333-48.085333 14.677334-74.581334z m-385.877334-89.6a201.941333 201.941333 0 0 0-21.589333 89.6 203.818667 203.818667 0 0 0 203.733333 203.733334c32.213333 0 62.336-8.106667 89.642667-21.589334l-63.146667-63.146666c-8.533333 2.048-17.493333 3.242667-26.453333 3.242666a122.069333 122.069333 0 0 1-122.282667-122.197333c0-8.96 1.237333-17.92 3.285334-26.496l-63.146667-63.146667z m304 96.554667l-128.341333-128.341333 6.912-0.426667a122.069333 122.069333 0 0 1 122.24 122.282667l-0.853333 6.485333z"})}));i.displayName="EyeOff1Icon"},21219:(e,r,t)=>{t.d(r,{T:()=>d});var a=t(26212),l=t(10022),n=t(77222),i=t(28598);function s(e){return(0,i.lf)(e)}function d(){let{slug:e}=(0,n.useParams)(),r=(0,l.ZC)(e=>e.symbol);return function(){let e=window.location.pathname.split("/").filter(Boolean),r=e.indexOf("futures"),t=e.indexOf("demo-trading"),a=t>=0?e[t+1]:r>=0?e[r+1]:void 0;return s(a?decodeURIComponent(a):void 0)}()||r||s(e)||s(a.UP.getCurrent())}},25749:(e,r,t)=>{t.d(r,{H3:()=>j,HC:()=>O,Hx:()=>h,J5:()=>x,Lt:()=>v,N5:()=>N,NK:()=>s,T3:()=>P,TH:()=>c,g2:()=>D,j9:()=>o,ki:()=>g,me:()=>y,oK:()=>T,oh:()=>w,r4:()=>p,ve:()=>u,vs:()=>b,wZ:()=>d,x3:()=>S,x9:()=>f,xO:()=>m,zR:()=>C,zr:()=>L});var a=t(42959),l=t(80004),n=t(54327);function i(e){let r=(0,a.Z)(e);return{visible:r.visible,params:r.params,status:r.status,error:r.error,preload:r.preload,showLayer:r.open,hideLayer:r.close}}function s(e,r){(0,l.c2)(e,r)}function d(e){(0,l.mC)(e)}let o=()=>i(n.b.ContractBulkActionDialog),c=()=>i(n.b.OrderSettingsDrawer),u=()=>i(n.b.TpslEditorDialog),m=()=>i(n.b.PositionLeverageDialog),p=()=>i(n.b.PositionAdjustMarginDialog),x=()=>i(n.b.PositionShareDialog),f=()=>i(n.b.PositionCloseDifferenceDialog),g=()=>i(n.b.PositionCloseOrderConfirmDialog),h=()=>i(n.b.PlaceOrderSettings),v=()=>i(n.b.PlaceOrderTpslAdvanced),b=()=>i(n.b.PlaceOrderDifference),y=()=>i(n.b.PlaceOrderConfirm),N=()=>i(n.b.AccountResetConfirm),j=()=>i(n.b.PlaceTriggerOrdersNotice),w=()=>i(n.b.OpenService),C=()=>i(n.b.ChangeOpenOrder),O=()=>i(n.b.CancelOrder),D=()=>i(n.b.CancelPlan),T=()=>i(n.b.ChangePlanOrder),S=()=>i(n.b.CancelTriggerOrder),P=()=>i(n.b.OrderHistoryTradeDetails),L=()=>i(n.b.PlanTriggered)},28598:(e,r,t)=>{t.d(r,{Hp:()=>c,QT:()=>l,bh:()=>o,kG:()=>u,lf:()=>s,oI:()=>d});var a=t(3529);let l="XUSDT",n="-SWAP";function i(e){let r=null==e?void 0:e.trim().toUpperCase();if(!r)return"";if(r.endsWith("XUSDT"))return(0,a.IK)(r,"");if(r.endsWith(n)){if(!r.endsWith(n))return r;let e=r.slice(0,-n.length);return e.length>1&&e.endsWith("X")?"".concat(e.slice(0,-1)).concat(n):r}return r.endsWith("-USDT")?(0,a.Qx)(r,"-"):r.endsWith("USDT")?(0,a.Qx)(r,""):""}function s(e){return i(e)||i("BTCXUSDT")}function d(e){return i(e)}function o(e){return(0,a.oA)(s(e),"")}function c(e){let r=i(e);return r?(0,a.oA)(r,""):""}function u(e){return e?"/resource-upload/".concat(e.split("-")[0],".png"):""}},30511:(e,r,t)=>{t.d(r,{t:()=>o});var a=t(79237),l=t(90477),n=t(4487),i=t(38113),s=t(37392);let d=(0,n.F)("inline-block",{variants:{type:{global:"",general:"animate-spin"},size:{l:"",m:"",s:"",xs:""}},compoundVariants:[{type:"global",size:"l",className:"w-12 h-12"},{type:"global",size:"m",className:"w-10 h-10"},{type:"global",size:"s",className:"w-8 h-8"},{type:"general",size:"l",className:"w-6 h-6"},{type:"general",size:"m",className:"w-5 h-5"},{type:"general",size:"s",className:"w-4 h-4"},{type:"general",size:"xs",className:"w-3 h-3"}],defaultVariants:{type:"general",size:"m"}}),o=i.forwardRef((e,r)=>{let{className:t,type:n="general",size:i="m",...o}=e;return(0,a.jsx)("div",{ref:r,className:(0,l.Q)(d({type:n,size:i}),t),...o,children:"global"===n?(0,a.jsxs)("svg",{viewBox:"0 0 20 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"h-full w-full",children:[(0,a.jsx)("rect",{x:"0",y:"0",width:"12",height:"12",rx:"1",fill:"var(--color-p1)",className:"animate-rect1"}
1),(0,a.jsx)("rect",{x:"4.7",y:"19.6",width:"7.3",height:"7.5",rx:"1",fill:"var(--color-p1)",className:"animate-rect2"}),(0,a.jsx)("rect",{x:"12",y:"12",width:"7.5",height:"7.5",rx:"1",fill:"var(--color-p1)",className:"animate-rect3"})]}):(0,a.jsx)(s.m,{className:"h-full w-full"})})});o.displayName="Spin"},33162:(e,r,t)=>{t.d(r,{c:()=>i});var a=t(79237),l=t(38113),n=t(65375);let i=l.forwardRef((e,r)=>(0,a.jsx)(n.B,{ref:r,viewBox:"0 0 1024 1024",...e,children:(0,a.jsx)("path",{d:"M512 207.061333c-100.394667 0-191.232 28.16-272.512 84.821334C158.165333 348.586667 99.754667 421.845333 64 512c35.541333 90.197333 93.952 163.712 175.488 220.117333 81.28 56.618667 172.117333 84.864 272.512 84.864 100.394667 0 191.232-28.245333 272.512-84.906666 81.322667-56.618667 139.733333-129.92 175.488-220.074667-35.541333-90.197333-93.952-163.712-175.488-220.117333C703.232 235.264 612.394667 207.018667 512 207.018667z m0 508.842667c-36.864 0-70.826667-9.088-101.973333-27.562667a209.493333 209.493333 0 0 1-74.368-74.368A196.266667 196.266667 0 0 1 308.053333 512a196.266667 196.266667 0 0 1 27.562667-101.973333A209.493333 209.493333 0 0 1 410.026667 335.701333 196.181333 196.181333 0 0 1 512 308.053333c36.864 0 70.826667 9.088 101.973333 27.562667a209.493333 209.493333 0 0 1 74.368 74.410667c18.432 31.061333 27.562667 65.066667 27.562667 101.930666a196.266667 196.266667 0 0 1-27.562667 101.973334 209.365333 209.365333 0 0 1-74.368 74.368 196.266667 196.266667 0 0 1-101.973333 27.562666z m0-325.845333c-34.218667 0-63.317333 11.776-86.613333 35.328-23.552 23.552-35.328 52.394667-35.328 86.613333 0 34.218667 11.776 63.317333 35.328 86.613333 23.552 23.552 52.394667 35.328 86.613333 35.328 34.218667 0 63.317333-11.776 86.613333-35.328 23.552-23.552 35.328-52.394667 35.328-86.613333 0-34.218667-11.776-63.317333-35.328-86.613333-23.296-23.552-52.394667-35.328-86.613333-35.328z"})}));i.displayName="Eye1Icon"},44031:(e,r,t)=>{t.r(r),t.d(r,{Input:()=>h,OTPInput:()=>y,PasswordInput:()=>b,TextArea:()=>v});var a=t(79237),l=t(90477),n=t(4487),i=t(38113),s=t(71591),d=t(65375);let o=i.forwardRef((e,r)=>(0,a.jsx)(d.B,{ref:r,viewBox:"0 0 1024 1024",...e,children:(0,a.jsx)("path",{d:"M829.013333 516.096a51.2 51.2 0 1 1 72.362667 72.405333l-301.653333 301.738667a51.242667 51.242667 0 0 1-72.448-72.448l301.696-301.653333z m-63.402666-358.997333a51.2 51.2 0 0 1 72.405333 72.405333l-597.333333 597.333333a51.2 51.2 0 0 1-72.405334-72.405333l597.333334-597.333333z"})}));o.displayName="TextAreaIcon";var c=t(33162),u=t(18983);let m=(0,n.F)(["w-0","flex-1","border-0","bg-transparent","outline-none","text-t1","placeholder:text-t3","transition-all","duration-200","disabled:cursor-not-allowed","disabled:text-t5","disabled:placeholder:text-t5"],{variants:{variant:{default:[],filled:[]},size:{l:["text-bm16","placeholder:text-bm16"],m:["text-bm14","placeholder:text-bm14"],s:["text-bm14","placeholder:text-bm14"]}},defaultVariants:{variant:"default",size:"l"}}),p=(0,n.F)(["relative","flex","items-center","w-full","rounded-r2","transition-all","duration-200"],{variants:{variant:{default:["bg-bg2","border","border-transparent"],focused:["bg-bg3","border","border-p1"]},size:{l:["h-12","px-s4"],m:["h-10","px-s4"],s:["h-9","px-s3"]}},defaultVariants:{variant:"default",size:"l"}}),x=(0,n.F)(["block","mb-2","text-t1"],{variants:{size:{l:"text-bm14",m:"text-bm14",s:"text-bm14"}},defaultVariants:{size:"l"}}),f=(0,n.F)(["relative","flex","w-full","rounded-r3","transition-all","duration-200"],{variants:{variant:{default:["bg-bg2","border","border-transparent"],focused:["bg-bg3","border","border-p1"]},size:{m:["min-h-[150px]","p-s4","text-bm14"]}},defaultVariants:{variant:"default",size:"m"}}),g=e=>{let{placeholder:r,className:t,disabled:n,value:s,hasValue:d,isFocused:o,inputRef:c,leftInset:u=0,rightInset:m=0,onFocus:p,onBlur:x,onChange:f,onCompositionStart:g,onCompositionEnd:h,readOnly:v,...b}=e,y=i.useRef(null),N=i.useCallback(e=>{y.current=e,"function"==typeof c?c(e):c&&(c.current=e)},[c]),j=o||d,w=i.useMemo(()=>({marginLeft:u>0?"".concat(u,"px"):void 0,marginRight:m>0?"".concat(m,"px"):void 0}),[u,m]);return(0,a.jsx)("div",{className:"relative min-w-0 flex-1 cursor-text","data-motion-state":j?"raised":"idle",onMouseDown:e=>{var r;n||v||e.target!==y.current&&(e.preventDefault(),null==(r=y.current)||r.focus())},children:(0,a.jsxs)("div",{className:"relative h-full min-w-0",style:w,children:[(0,a.jsx)("input",{ref:N,disabled:n,value:s,readOnly:v,placeholder:" ",className:(0,l.Q)("peer h-full w-full border-0 bg-transparent px-0 pt-[16
1px] pb-[2px] outline-none","text-bm14 text-t1 placeholder:text-transparent","disabled:text-t5 disabled:cursor-not-allowed",t),onFocus:p,onBlur:x,onChange:f,onCompositionStart:g,onCompositionEnd:h,...b}),r?(0,a.jsx)("label",{"aria-hidden":"true",className:(0,l.Q)("text-bm14 pointer-events-none absolute top-1/2 right-0 left-0 origin-left truncate leading-[20px] will-change-transform rtl:origin-right","font-normal transition-all duration-300 ease-[cubic-bezier(0.22,1,0.36,1)]",j?"text-t1 -translate-y-[18px] scale-[0.785714]":"text-t4 -translate-y-1/2 scale-100"),children:r}):null]})})},h=i.forwardRef((e,r)=>{let{className:t,variant:n="borderless",size:d="l",label:o,labelClassName:c,error:u,leftSlot:f,rightSlot:h,clearable:v,onClear:b,wrapperClassName:y,enablePlaceholderMotion:N=!1,placeholder:j,disabled:w,value:C,type:O="text",onChange:D,defaultValue:T,onFocus:S,onBlur:P,onCompositionStart:L,onCompositionEnd:z,...k}=e,[q,A]=i.useState(!1),[I,R]=i.useState(!1),F=void 0!==C,[E,B]=i.useState(F?null!=C?C:"":null!=T?T:""),M=i.useRef(null),Q=i.useRef(null),H=i.useRef(null),[U,G]=i.useState(0),[K,V]=i.useState(0),$=i.useCallback(e=>{M.current=e,"function"==typeof r?r(e):r&&(r.current=e)},[r]);i.useEffect(()=>{!I&&F&&B(null!=C?C:"")},[F,C,I]);let J=F?I?E:null!=C?C:"":E,_=""!==J,W="outlined"===n,X=N&&"hidden"!==O;i.useLayoutEffect(()=>{if(!X){G(0),V(0);return}let e=Q.current,r=H.current,t=()=>{var t,a;let l=null!=(t=null==e?void 0:e.offsetWidth)?t:0,n=null!=(a=null==r?void 0:r.offsetWidth)?a:0;G(l>0?l:0),V(n>0?n:0)};if(t(),"undefined"==typeof ResizeObserver)return;let a=new ResizeObserver(t);return e&&a.observe(e),r&&a.observe(r),()=>{a.disconnect()}},[X,f,h,v,_,w,k.readOnly]);let Y=e=>{let r=!!e.nativeEvent.isComposing;(!F||I||r)&&B(e.target.value),null==D||D(e)},Z=()=>{if(w||k.readOnly)return;F||B("");let e=M.current;if(e){var r;let t=null==(r=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value"))?void 0:r.set;null==t||t.call(e,"");let a=new Event("input",{bubbles:!0});e.dispatchEvent(a)}null==b||b()};return(0,a.jsxs)("div",{className:"w-full",children:[o&&(0,a.jsx)("label",{className:(0,l.Q)(x({size:d}),c),children:o}),(0,a.jsxs)("div",{className:(0,l.Q)(p({variant:q?"focused":"default",size:d}),!X&&"l"===d&&"!rounded-r3",X&&"!rounded-r2 px-s2 py-s1 h-[44px] items-stretch",W&&"bg-transparent",W&&!q&&"border-l1",w&&"bg-bg07 border-l1 cursor-not-allowed",y),children:[X?(0,a.jsx)(g,{...k,inputRef:$,type:O,disabled:w,readOnly:k.readOnly,value:J,hasValue:_,isFocused:q,placeholder:j,className:t,leftInset:U,rightInset:K,onFocus:e=>{A(!0),null==S||S(e)},onBlur:e=>{A(!1),null==P||P(e)},onChange:Y,onCompositionStart:e=>{R(!0),B(e.currentTarget.value),null==L||L(e)},onCompositionEnd:e=>{R(!1),B(e.currentTarget.value),null==z||z(e)}}):(0,a.jsxs)(a.Fragment,{children:[f&&(0,a.jsx)("div",{className:"mr-2 flex items-center rtl:mr-0 rtl:ml-2",children:f}),(0,a.jsx)("input",{ref:$,type:O,disabled:w,value:J,placeholder:j,className:(0,l.Q)(m({size:d}),t),onFocus:e=>{A(!0),null==S||S(e)},onBlur:e=>{A(!1),null==P||P(e)},onChange:Y,onCompositionStart:e=>{R(!0),B(e.currentTarget.value),null==L||L(e)},onCompositionEnd:e=>{R(!1),B(e.currentTarget.value),null==z||z(e)},...k})]}),X&&f&&(0,a.jsx)("div",{ref:Q,className:"left-s2 absolute top-1/2 z-[1] flex -translate-y-1/2 items-center",children:f}),X?(h||v&&_&&!w&&!k.readOnly)&&(0,a.jsxs)("div",{ref:H,className:"right-s2 absolute top-1/2 z-[1] flex -translate-y-1/2 items-center gap-1",children:[v&&_&&!w&&!k.readOnly&&(0,a.jsx)("button",{type:"button",onClick:Z,className:"text-t3 hover:text-t1 cursor-pointer leading-0 transition-colors","aria-label":"Clear input",children:(0,a.jsx)(s.v,{className:"h-5 w-5 cursor-pointer"})}),h&&(0,a.jsx)("div",{className:"flex items-center",children:h})]}):(0,a.jsxs)(a.Fragment,{children:[v&&_&&!w&&!k.readOnly&&(0,a.jsx)("button",{type:"button",onClick:Z,className:"text-t3 hover:text-t1 ml-2 cursor-pointer leading-0 transition-colors rtl:mr-2 rtl:ml-0","aria-label":"Clear input",children:(0,a.jsx)(s.v,{className:"h-5 w-5 cursor-pointer"})}),h&&(0,a.jsx)("div",{className:"ml-2 flex items-center rtl:mr-2 rtl:ml-0",children:h})]})]}),u&&(0,a.jsx)("p",{className:"text-b14 mt-1 text-red-500",children:u})]})});h.displayName="Input";let v=i.forwardRef((e,r)=>{let{className:t,variant:n="borderless",label:s,error:d,wrapperClassName:c,showCount:u,maxLength:m,showResizeIndicator:p=!0,size:g="m",value:h,defaultValue:v,onCh
1ange:b,onFocus:y,onBlur:N,disabled:j,...w}=e,[C,O]=i.useState(!1),D=void 0!==h,[T,S]=i.useState(D?null!=h?h:"":null!=v?v:""),P=i.useRef(null),L=i.useCallback(e=>{P.current=e,"function"==typeof r?r(e):r&&(r.current=e)},[r]);i.useEffect(()=>{D&&S(null!=h?h:"")},[D,h]);let z=D?null!=h?h:"":T,k=z.length,q=null!=u?u:void 0!==m;return(0,a.jsxs)("div",{className:"w-full",children:[s&&(0,a.jsx)("label",{className:x({size:"s"}),children:s}),(0,a.jsxs)("div",{className:(0,l.Q)(f({variant:C?"focused":"default",size:g}),"outlined"===n&&"bg-transparent","outlined"===n&&!C&&"border-l1","gap-s1 flex-col items-start justify-center",j&&"bg-bg07 border-l1 cursor-not-allowed",c),children:[(0,a.jsx)("textarea",{ref:L,value:z,disabled:j,maxLength:m,className:(0,l.Q)("text-t1 placeholder:text-t3 w-full flex-1 resize-none border-0 bg-transparent outline-none","disabled:text-t5 disabled:placeholder:text-t5","text-b14 placeholder:text-b14",j&&"cursor-not-allowed",t),onFocus:e=>{O(!0),null==y||y(e)},onBlur:e=>{O(!1),null==N||N(e)},onChange:e=>{D||S(e.target.value),null==b||b(e)},...w}),q&&(0,a.jsxs)("div",{className:"text-c11 gap-s0 flex w-full items-center justify-end text-right",children:[(0,a.jsx)("span",{className:(0,l.Q)("pointer-events-none select-none",0===k?"text-t4":"text-t1"),children:k}),void 0!==m&&(0,a.jsxs)("span",{className:"text-t4 pointer-events-none select-none",children:["/",m]})]}),p&&(0,a.jsx)("button",{type:"button","aria-label":"Resize textarea",className:"text-t4 right-s1 bottom-s1 absolute inline-flex size-3 cursor-ns-resize items-center justify-center p-0",onPointerDown:e=>{if(!p||j||w.readOnly)return;let r=P.current;if(!r)return;e.preventDefault();let t=e.clientY,a=r.getBoundingClientRect().height,l=Number.parseFloat(window.getComputedStyle(r).minHeight)||0;r.style.height="".concat(a,"px");let n=e=>{let n=Math.max(l,a+(e.clientY-t));r.style.height="".concat(n,"px")},i=()=>{window.removeEventListener("pointermove",n),window.removeEventListener("pointerup",i),window.removeEventListener("pointercancel",i)};window.addEventListener("pointermove",n),window.addEventListener("pointerup",i),window.addEventListener("pointercancel",i)},children:(0,a.jsx)(o,{className:"size-3"})})]}),d&&(0,a.jsx)("p",{className:"text-b14 mt-1 text-red-500",children:d})]})});v.displayName="TextArea";let b=i.forwardRef((e,r)=>{let[t,l]=i.useState(!1);return(0,a.jsx)(h,{...e,ref:r,type:t?"text":"password",rightSlot:(0,a.jsx)("button",{type:"button",onClick:()=>l(!t),className:"text-t3 hover:text-t1 cursor-pointer leading-0 transition-colors","aria-label":t?"Hide password":"Show password",children:t?(0,a.jsx)(c.c,{className:"h-5 w-5"}):(0,a.jsx)(u.b,{className:"h-5 w-5"})})})});b.displayName="PasswordInput";let y=i.forwardRef((e,r)=>{let{length:t=6,onChange:n,value:s="",disabled:d,className:o}=e,c=i.useRef([]),[u,m]=i.useState(s.split("").concat(Array(t).fill("")).slice(0,t)),[p,x]=i.useState(-1);i.useEffect(()=>{m(s.split("").concat(Array(t).fill("")).slice(0,t))},[s,t]);let f=e=>{var r;e.preventDefault();let a=e.clipboardData.getData("text/plain").slice(0,t),l=a.split("").concat(Array(t).fill("")).slice(0,t);m(l),null==n||n(l.join(""));let i=Math.min(a.length,t-1);null==(r=c.current[i])||r.focus()};return(0,a.jsx)("div",{ref:r,className:(0,l.Q)("gap-s2 flex",o),children:Array.from({length:t}).map((e,r)=>{u[r];let i=p===r;return(0,a.jsx)("div",{className:(0,l.Q)("rounded-r2 flex h-11 w-11 items-center justify-center border transition-all md:h-15 md:w-15","bg-bg2 border-l1",i&&"bg-bg3 border-p1",d&&"cursor-not-allowed opacity-30"),children:(0,a.jsx)("input",{ref:e=>{c.current[r]=e},type:"text",inputMode:"numeric",maxLength:1,value:u[r]||"",onChange:e=>((e,r)=>{if(r&&!/^\d$/.test(r))return;let a=[...u];if(a[e]=r,m(a),null==n||n(a.join("")),r&&e<t-1){var l;null==(l=c.current[e+1])||l.focus()}})(r,e.target.value),onKeyDown:e=>((e,r)=>{if("Backspace"===r.key&&!u[e]&&e>0){var t;null==(t=c.current[e-1])||t.focus()}})(r,e),onFocus:()=>x(r),onBlur:()=>x(-1),onPaste:f,disabled:d,className:"text-tm24 text-t1 h-full w-full border-0 bg-transparent text-center font-semibold outline-none"})},r)})})});y.displayName="OTPInput"},50791:(e,r,t)=>{t.d(r,{H3:()=>L,HC:()=>A,Hx:()=>C,J5:()=>b,Lt:()=>D,NK:()=>s,T3:()=>E,T5:()=>o,TH:()=>u,Te:()=>P,Ui:()=>O,W5:()=>z,g2:()=>I,gO:()=>j,hQ:()=>g,j9:()=>c,ki:()=>N,kw:()=>f,me:()=>S,oK:()=>R,og:()=>w,oh:()=>k,r4:()=>v,ve:()=>m,vs:()=>T,wT:()=>x,wZ:()=>d,x3:()=>F,x9:()=>y,xO:()=>h,zR:()=>q,zr:()=>B,zx:()=>p});var a=t(42959),l=t(80004),n=t(50965);function i(e){let r=(0,a.Z)(e);return{visible:r.visible,params:r.params,status:r.status,error:r.error,preload:r.preload,showLayer:r.open,hideLayer:r.close}}function s(e,r){(0,l.c2)(e,r)}function d(e){(0,l.mC)(e)}let o=()=>i(n.b.GuideDialog),c=()=>i(n.b.ContractBulkActionDialog),u=()=>i(n.b.OrderSettingsDrawer),m=()=>i(n.b.TpslEditorDialog),p=()=>i(n.b.GridGuideDialog),x=()=>i(n.b.GridServiceDialog),f=()=>i(n.b.GridOrderSettings),g=()=>i(n.b.GridOrderConfirm),h=()=>i(n.b.PositionLeverageDialog),v=()=>i(n.b.PositionAdjustMarginDialog),b=()=>i(n.b.PositionShareDialog),y=()=>i(n.b.PositionCloseDifferenceDialog),N=()=>i(n.b.PositionCloseOrderConfirmDialog),j=()=>i(n.b.PositionReverseConfirmDialog),w=()=>i(n.b.GridStopStrategyDialog),C=()=>i(n.b.PlaceOrderSettings),O=()=>i(n.b.PlaceOrderCalculator),D=()=>i(n.b.PlaceOrderTpslAdvanced),T=()=>i(n.b.PlaceOrderDifference),S=()=>i(n.b.PlaceOrderConfirm),P=()=>i(n.b.LiquidityStatus),L=()=>i(n.b.PlaceTriggerOrdersNotice),z=()=>i(n.b.InsufficientBalance),k=()=>i(n.b.OpenService),q=()=>i(n.b.ChangeOpenOrder),A=()=>i(n.b.CancelOrder),I=()=>i(n.b.CancelPlan),R=()=>i(n.b.ChangePlanOrder),F=()=>i(n.b.CancelTriggerOrder),E=()=>i(n.b.OrderHistoryTradeDetails),B=()=>i(n.b.PlanTriggered)},50965:(e,r,t)=>{t.d(r,{b:()=>a,k:()=>a});var a=function(e){return e.GuideDialog="futuresGuider",e.GridGuideDialog="gridGuider",e.ContractBulkActionDialog="contractBulkActionDialog",e.OrderSettingsDrawer="setOrderSettings",e.TpslEditorDialog="tpslEditorLayer",e.GridServiceDialog="gridService",e.GridOrderSettings="gridOrderSettings",e.GridOrderConfirm="gridOrderConfirm",e.PositionLeverageDialog="positionLeverageLayer",e.PositionAdjustMarginDialog="positionAdjustMarginLayer",e.PositionShareDialog="positionShareLayer",e.PositionCloseDifferenceDialog="placeDifferenceLayer",e.PositionCloseOrderConfirmDialog="placeCloseOrderConfirm",e.PositionReverseConfirmDialog="placeReverseOrderConfirm",e.GridStopStrategyDialog="stopGrid",e.PlaceOrderSettings="placeOrderSettings",e.PlaceOrderCalculator="placeOrderCalculator",e.PlaceOrderTpslAdvanced="placeOrderTpslAdvanced",e.PlaceOrderDifference="placeOrderDifference",e.PlaceOrderConfirm="placeOrderConfirm",e.LiquidityStatus="liquidityStatusLayer",e.PlaceTriggerOrdersNotice="placeTriggerOrdersNotice",e.InsufficientBalance="insufficientBalanceLayer",e.OpenService="openService",e.ChangeOpenOrder="changeOpenOrder",e.CancelOrder="cancelOrderLayer",e.CancelPlan="cancelPlanLayer",e.ChangePlanOrder="changePlanOrderLayer",e.CancelTriggerOrder="cancelTriggerOrderLayer",e.OrderHistoryTradeDetails="orderHistoryTradeDetailsLayer",e.PlanCloseOrder="planCloseOrder",e.PlanTriggered="planTriggeredLayer",e.PlanListLayer="planListLayer",e}({})},51430:(e,r,t)=>{t.d(r,{eh:()=>i,n7:()=>l,qQ:()=>n});var a=t(122);function l(e,r){let t=Number(e);return Number.isNaN(t)?"0":new a.A(t).toFixed(r,a.A.ROUND_UP)}function n(e,r){let t=Number(e);return Number.isNaN(t)?"0":new a.A(t).toFixed(r,a.A.ROUND_DOWN)}function i(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,t=Number(e);return t>0?function(e,r){let t=Number(e);return Number.isNaN(t)?"0":new a.A(t).toFixed(r,a.A.ROUND_FLOOR)}(t,r):function(e,r){let t=Number(e);return Number.isNaN(t)?"0":new a.A(t).toFixed(r,a.A.ROUND_CEIL)}(t,r)}},53951:(e,r,t)=>{t.r(r),t.d(r,{Dialog:()=>w,DialogClose:()=>f,DialogContent:()=>h,DialogDescription:()=>N,DialogFooter:()=>b,DialogHeader:()=>v,DialogOverlay:()=>g,DialogPortal:()=>x,DialogRoot:()=>m,DialogTitle:()=>y,DialogTrigger:()=>p});var a=t(79237),l=t(91405),n=t(90477),i=t(45056),s=t(12407),d=t(61058),o=t(38113),c=t(51924),u=t(70659);let m=i.bL,p=i.l9,x=i.ZL,f=i.bm,g=o.forwardRef((e,r)=>{let{className:t,...l}=e;return(0,a.jsx)(i.hJ,{ref:r,className:(0,n.Q)("bg-p6 fixed inset-0 z-300","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...l})});g.displayName=i.hJ.displayName;let h=o.forwardRef((e,r)=>{let{className:t,children:l,style:s,overlayClassName:d,...o}=e;return(0,a.jsxs)(x,{children:[(0,a.jsx)(g,{className:d}),(0,a.jsx)(i.UC,{ref:r,style:s,className:(0,n.Q)("fixed top-[50%] left-[50%] z-300 translate-x-[-50%] translate-y-[-50%] outline-none","w-[420px] max-md:w-[calc(100vw-var(--spacing-s8)-var(--spacing-s8))] max-md:max-w-[420px]","flex flex-col","border-l1 bg-m1 p-s6 shadow-3 rounded-[12px] border","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",t),...o,children:l})]})});h.displayName=i.UC.displayName;let v=e=>{let{className:r,...t}=e;return(0,a.jsx)("div",{className:(0,n.Q)("gap-s4 flex flex-col",r),...t})};v.displayName="DialogHeader";let b=e=>{let{className:r,layout:t="horizontal",...l}=e;return(0,a.jsx)("div",{className:(0,n.Q)("gap-s2 flex w-full","horizontal"===t?"flex-row":"flex-col",r),...l})};b.displayName="DialogFooter";let y=o.forwardRef((e,r)=>{let{className:t,showClose:l=!0,onClose:s,children:d,...o}=e;return(0,a.jsxs)("div",{className:"gap-s6 flex items-center justify-between",children:[(0,a.jsx)(i.hE,{ref:r,className:(0,n.Q)("text-t1 text-tm18 flex-1",t),...o,children:d}
1),l&&(0,a.jsx)(f,{className:"flex h-[22px] cursor-pointer items-center justify-center px-0 py-[2px] focus:outline-none",onClick:s,children:(0,a.jsx)("div",{className:"flex items-center",children:(0,a.jsx)(c.U,{className:"text-t3 size-5"})})})]})});y.displayName=i.hE.displayName;let N=o.forwardRef((e,r)=>{let{className:t,...l}=e;return(0,a.jsx)(i.VY,{ref:r,className:(0,n.Q)("text-t2 text-b14",t),...l})});N.displayName=i.VY.displayName;let j=(0,s.default)(()=>Promise.all([t.e(2243),t.e(3447)]).then(t.bind(t,33447)),{loadableGenerated:{webpack:()=>[33447]},ssr:!1}),w=e=>{let{trigger:r,defaultOpen:t,open:i,onOpenChange:s,title:c,description:x,showClose:g=!0,okText:w,cancelText:C,onOk:O,onCancel:D,okButtonProps:T,cancelButtonProps:S,footerLayout:P,footer:L=null,children:z,onClose:k,className:q,hideHeader:A=!1,headerClassName:I,bodyClassName:R,footerClassName:F,preventOutsideClose:E=!1,preventEscapeClose:B=!1,variant:M="default",overlayClassName:Q,onOpenAutoFocus:H}=e,U=(0,l.no)(),[G,K]=o.useState(!1);o.useEffect(()=>{K(!0)},[]);let[V,$]=o.useState(null!=t&&t),J=void 0!==i,_=J?i:V,W=J?s:e=>{$(e),null==s||s(e)},X=P||(w&&C?"horizontal":"single"),Y="vertical"===X?"vertical":"horizontal",Z=!A&&(c||x||g),ee=(e,r,t,a,l)=>{let{className:i,onClick:s,variant:d,size:o,...c}=e||{};return{...c,variant:d||r,size:o||t,className:(0,n.Q)(a,i),onClick:((e,r)=>t=>{null==e||e(t),t.defaultPrevented||null==r||r()})(s,l)}};return"drawer"===M&&G&&U?(0,a.jsx)(j,{open:_,onOpenChange:W,trigger:r,title:c,description:x,showClose:g,okText:w,cancelText:C,onOk:O,onCancel:D,okButtonProps:T,cancelButtonProps:S,footerLayout:P,footer:L,onClose:k,className:q,hideHeader:A,headerClassName:I,bodyClassName:R,footerClassName:F,dismissible:!E,overlayClassName:Q,children:z}):(0,a.jsxs)(m,{open:_,onOpenChange:W,children:[r&&(0,a.jsx)(p,{asChild:!0,children:r}),(0,a.jsxs)(h,{"aria-describedby":x?"dialog-description":void 0,className:q,overlayClassName:Q,onOpenAutoFocus:H,onInteractOutside:e=>{E&&e.preventDefault()},onPointerDownOutside:e=>{E&&e.preventDefault()},onEscapeKeyDown:e=>{B&&e.preventDefault()},children:[Z?(0,a.jsxs)(v,{className:I,children:[(0,a.jsx)(y,{showClose:g,onClose:()=>{null==W||W(!1),null==k||k()},children:c}),x&&(0,a.jsx)(N,{children:x})]}):(0,a.jsx)(d.bL,{children:(0,a.jsx)(y,{showClose:g,children:c})}),z&&(0,a.jsx)("div",{className:(0,n.Q)(Z?"mt-s4":"mt-0",R),children:z}),(()=>{if(!1===L)return null;let e=L;return L||(e=(0,a.jsx)(b,{layout:Y,children:"single"===X?(0,a.jsx)(a.Fragment,{children:w?(0,a.jsx)(u.$,{...ee(T,"primary","m","w-full",O),children:w}):C?(0,a.jsx)(f,{asChild:!0,children:(0,a.jsx)(u.$,{...ee(S,"secondary","m","w-full",D),children:C})}):null}):"vertical"===X?(0,a.jsxs)(a.Fragment,{children:[w&&(0,a.jsx)(u.$,{...ee(T,"primary","l","h-11 w-full md:h-12",O),children:w}),C&&(0,a.jsx)(f,{asChild:!0,children:(0,a.jsx)(u.$,{...ee(S,"white","l","text-t3 h-11 w-full border-none md:h-12",D),children:C})})]}):(0,a.jsxs)(a.Fragment,{children:[C&&(0,a.jsx)(f,{asChild:!0,children:(0,a.jsx)(u.$,{...ee(S,"secondary","m","h-10 flex-1",D),children:C})}),w&&(0,a.jsx)(u.$,{...ee(T,"primary","m",C?"h-10 flex-1":"h-10 w-full",O),children:w})]})})),(0,a.jsx)("div",{className:(0,n.Q)("mt-s7",F),children:e})})()]})]})};w.displayName="Dialog"},54327:(e,r,t)=>{t.d(r,{b:()=>a,k:()=>a});var a=function(e){return e.ContractBulkActionDialog="contractBulkActionDialog",e.OrderSettingsDrawer="setOrderSettings",e.TpslEditorDialog="tpslEditorLayer",e.PositionLeverageDialog="positionLeverageLayer",e.PositionAdjustMarginDialog="positionAdjustMarginLayer",e.PositionShareDialog="positionShareLayer",e.PositionCloseDifferenceDialog="placeDifferenceLayer",e.PositionCloseOrderConfirmDialog="placeCloseOrderConfirm",e.PlaceOrderSettings="placeOrderSettings",e.PlaceOrderTpslAdvanced="placeOrderTpslAdvanced",e.PlaceOrderDifference="placeOrderDifference",e.PlaceOrderConfirm="placeOrderConfirm",e.AccountResetConfirm="accountResetLayer",e.PlaceTriggerOrdersNotice="placeTriggerOrdersNotice",e.OpenService="openService",e.ChangeOpenOrder="changeOpenOrder",e.CancelOrder="cancelOrderLayer",e.CancelPlan="cancelPlanLayer",e.ChangePlanOrder="changePlanOrderLayer",e.CancelTriggerOrder="cancelTriggerOrderLayer",e.OrderHistoryTradeDetails="orderHistoryTradeDetailsLayer",e.PlanCloseOrder="planCloseOrder",e.PlanTriggered="planTriggeredLayer",e.PlanListLayer="planListLayer",e}({})},63992:(e,r,t)=>{t.r(r),t.d(r,{default:()=>C});var a=t(79237),l=t(51924),n=t(53951),i=t(30511),s=t(13603),d=t(44031),o=t(56044),c=t(70659),u=t(66960),m=t(31508),p=t(51430),x=t(19490),f=t(3529),g=t(51025),h=t(66850),v=t(4390),b=t(38113),y=t(82352),N=t(50791),j=t(50965);let w=[0,25,50,75,100];function C(){var e,r,t;let{$t:C,locale:O}=(0,u.B)(),D=(0,N.r4)(),{refetch:T}=(0,y.pD)(),S=(0,g.k)(e=>{var r,t;return null!=(t=null==(r=e.user)?void 0:r.userId)?t:0}),P=null==(e=D.params)?void 0:e.item,[L,z]=(0,b.useState)("add"),[k,q]=(0,b.useState)(""),A=Number(k||
10);(0,b.useEffect)(()=>{D.visible&&(z("add"),q(""))},[D.visible]);let I=(0,v.useQuery)({queryKey:["position-adjust-margin-info",O,S,null==P?void 0:P.id],enabled:D.visible&&!!(null==P?void 0:P.id)&&!!S,queryFn:()=>(0,h.R1)({locale:O,params:{positionId:Number(null==P?void 0:P.id),userId:Number(S)}})}),R=null==(r=I.data)?void 0:r.data,F=Number("add"===L?(null==R?void 0:R.maxAdd)||0:(null==R?void 0:R.maxSub)||0),E=(0,b.useMemo)(()=>F||A?!F&&A>0?100:Math.min(Math.floor(100*A/F),100):0,[A,F]),B=(0,v.useQuery)({queryKey:["position-adjust-margin-liq-price",O,S,null==P?void 0:P.id,L,A,null==R?void 0:R.avgPrice,null==R?void 0:R.margin,null==R?void 0:R.quatity,null==R?void 0:R.serviceFee],enabled:D.visible&&!!(null==P?void 0:P.id)&&!!S&&A>0&&!!(null==R?void 0:R.avgPrice)&&!!(null==R?void 0:R.margin)&&!!(null==R?void 0:R.quatity)&&!!(null==R?void 0:R.serviceFee)&&!!(null==P?void 0:P.symbol)&&!!(null==P?void 0:P.side),queryFn:()=>(0,h.K$)({locale:O,params:{adjustType:L,amount:A,avgPrice:Number((null==R?void 0:R.avgPrice)||0),margin:Number((null==R?void 0:R.margin)||0),positionId:Number(null==P?void 0:P.id),quatity:Number((null==R?void 0:R.quatity)||0),serviceFee:Number((null==R?void 0:R.serviceFee)||0),side:String((null==P?void 0:P.side)||""),symbol:String((null==P?void 0:P.symbol)||""),userId:Number(S)}})}),M=!(A>0&&F>0&&A<=F),Q=(0,b.useCallback)(e=>{var r;let t=""===e?e:!/^\d*\.?\d*$/.test(e)||((null==(r=e.split(".")[1])?void 0:r.length)||0)>2?null:e;null!==t&&q(t)},[]),H=(0,b.useCallback)(e=>{z(e),q("")},[]),U=(0,b.useCallback)(e=>{q(String((0,p.n7)(e/100*F,2)))},[F]),G=(0,b.useCallback)(async()=>{if((null==P?void 0:P.id)&&(null==P?void 0:P.symbol)&&(null==P?void 0:P.side)&&!M)try{await (0,h.uD)({locale:O,params:{adjustType:L,amount:A,positionId:Number(P.id),side:String(P.side),symbol:P.symbol,userId:Number(S)}}),D.hideLayer(),T()}catch(r){var e;(0,m.d)(r)&&[10307,10337].includes(Number((null==(e=r.data)?void 0:e.code)||0))&&((0,N.NK)(j.b.InsufficientBalance),D.hideLayer())}},[L,A,null==P?void 0:P.id,null==P?void 0:P.side,null==P?void 0:P.symbol,D,O,T,M,S]);return(0,a.jsx)(n.Dialog,{open:D.visible,onOpenChange:e=>{e||D.hideLayer()},variant:"drawer",title:C("Adjust Margin"),hideHeader:!0,showClose:!1,footer:!1,className:"!border-l1 !bg-m1 shadow-3 !rounded-t-r5 md:!rounded-r4 !w-full !max-w-none !overflow-hidden !rounded-b-none !border-t !p-0 md:!w-[420px] md:!max-w-[calc(100vw-32px)] md:!border",bodyClassName:"!p-0 !pt-0 flex min-h-0 flex-1 flex-col overflow-hidden",children:(0,a.jsxs)("div",{className:"bg-m1 flex max-h-[90dvh] min-h-0 flex-col overflow-hidden px-4 pt-5 pb-[calc(env(safe-area-inset-bottom)+var(--spacing-s4))] md:max-h-none md:p-0",children:[(0,a.jsx)("div",{className:"flex flex-col gap-4 md:px-6 md:pt-6",children:(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,a.jsx)("div",{className:"text-t1 text-tm18",children:C("Adjust Margin")}),(0,a.jsxs)("div",{className:"text-t3 text-mm14 flex items-center gap-2",children:[(0,a.jsx)("span",{children:(0,f.A2)((null==P?void 0:P.symbol)||"","")||"--"}),(0,a.jsx)("span",{className:"bg-t3 h-3 w-px shrink-0"}),(0,a.jsxs)("span",{className:(null==P?void 0:P.side)==="short"?"text-p3":"text-p2",children:[C((null==P?void 0:P.side)==="short"?"Short":"Long")," ",(null==P?void 0:P.leverage)||"--","X"]})]})]}),(0,a.jsx)("button",{type:"button",className:"text-t3 hover:text-t2 flex h-[22px] shrink-0 items-center justify-center py-[2px] transition-colors",onClick:()=>D.hideLayer(),children:(0,a.jsx)(l.U,{className:"size-5"})})]})}),I.isLoading?(0,a.jsx)("div",{className:"flex h-[300px] items-center justify-center md:px-6 md:pb-6",children:(0,a.jsx)(i.t,{size:"m"})}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto pt-4 md:overflow-visible md:px-6",children:[(0,a.jsx)(s.Tabs,{value:L,onValueChange:H,children:(0,a.jsxs)(s.TabsList,{className:"bg-bg05 w-full",children:[(0,a.jsx)(s.TabsTrigger,{value:"add",className:"flex-1",children:C("Increase Margin")}),(0,a.jsx)(s.TabsTrigger,{value:"sub",className:"flex-1",children:C("Decrease Margin")})]})}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(d.Input,{size:"m",inputMode:"decimal",value:k,onChange:e=>Q(e.target.value),placeholder:C("add"===L?"Add margin":"Reduce margin"),wrapperClassName:"!rounded-r3",className:"!text-bm14",rightSlot:(0,a.jsx)("span",{className:"text-mm14 text-t1 shrink-0",children:"USDT"})}),(0,a.jsx)(o.Slider,{value:E,onValueChange:U,showIndicator:!1,marks:w,className:"px-s2 gap-1 md:px-0"})]}),(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between py-2",children:[(0,a.jsx)("span",{className:"text-bm14 text-t3",children:C("add"===L?"Max increase amount":"Max decrease amount")}),(0,a.jsx)("span",{className:"text-bm14 text-t1",children:F?"".concat((0,x.iT)(F)," USDT"):"--"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between py-2",children:[(0,a.jsx)("span",{className:"text-bm14 text-t3",children:C("add"===L?"Liq price after margin addition":"Liq price after margin decrease")}),(0,a.jsx)("span",{className:"text-bm14 text-t1",children:A>0&&(null==(t=B.data)?void 0:t.data)?"".concat((0,x.iT)(Number(B.data.data))," USDT"):"--"})]})]})]}),(0,a.jsx)("div",{className:"pt-6 md:px-6 md:pt-8 md:pb-6",children:(0,a.jsxs)("div",{className:"grid h-10 grid-cols-2 gap-2",children:[(0,a.jsx)(c.$,{variant:"secondary",size:"m",className:"h-10",onClick:()=>D.hideLayer(),children:C("Cancel")}),(0,a.jsx)(c.$,{size:"m",className:"h-10",disabled:M,onClick:G,children:C("Confirm")})]})})]})]})})}},65093:(e,r,t)=>{t.d(r,{BH:()=>g,EF:()=>d,GN:()=>o,I2:()=>n,JH:()=>x,Jr:()=>u,KG:()=>
1f,o7:()=>c,r:()=>p,u8:()=>s,v0:()=>i,wu:()=>m});var a=t(59292),l=t(10935);function n(e){return a.request.get("/api/usdt-bot-api/grid/isExist",e)}function i(e){return a.request.get("/api/usdt-bot-api/public/strategy/recommend",{...e,params:h(e.params)})}function s(e){return a.request.get("/api/usdt-bot-api/public/globalConfigs",e)}function d(e){return a.request.get("/api/usdt-bot-api/grid/compute",e)}function o(e){return a.request.post("/api/usdt-bot-api/grid/place",{...e,body:e.params,params:void 0,requestType:l.Yw.Formdata})}function c(e){return a.request.get("/api/usdt-bot-api/grid/histories",{...e,params:h(e.params)})}function u(e){return a.request.get("/api/usdt-bot-api/grid/opens",{...e,params:h(e.params)})}function m(e){return a.request.get("/api/usdt-bot-api/grid/detail",e)}function p(e){return a.request.get("/api/usdt-bot-api/grid/order/opens",e)}function x(e){return a.request.get("/api/usdt-bot-api/grid/order/matchedItems",{...e,params:h(e.params)})}function f(e){return a.request.post("/api/usdt-bot-api/grid/edit",e)}function g(e){return a.request.post("/api/usdt-bot-api/grid/end",{...e,body:e.params,params:void 0,requestType:l.Yw.JsonString})}function h(e){if(!e)return e;let{current:r,size:t,...a}=e;return{...a,...void 0===a.pageNum&&void 0!==r?{pageNum:r}:{},...void 0===a.pageSize&&void 0!==t?{pageSize:t}:{}}}},66850:(e,r,t)=>{t.d(r,{K$:()=>s,R1:()=>n,lT:()=>i,uD:()=>l});var a=t(59292);let l=e=>a.request.post("/api/usdt-account-api/account/adjustmargin",e),n=e=>a.request.get("/api/usdt-account-api/account/margininfo",e),i=e=>a.request.get("/api/usdt-account-api/account/position/pnl/detail",e),s=e=>a.request.get("/api/usdt-account-api/account/pricecalculate",e)},71591:(e,r,t)=>{t.d(r,{v:()=>i});var a=t(79237),l=t(38113),n=t(65375);let i=l.forwardRef((e,r)=>(0,a.jsx)(n.B,{ref:r,viewBox:"0 0 1024 1024",...e,children:(0,a.jsx)("path",{d:"M85.333333 512c0 235.648 191.018667 426.666667 426.666667 426.666667s426.666667-191.018667 426.666667-426.666667S747.648 85.333333 512 85.333333 85.333333 276.352 85.333333 512z m549.76-183.253333a42.538667 42.538667 0 0 1 60.16 60.16l-111.786666 111.786666a16 16 0 0 0 0 22.613334l111.786666 111.786666a42.538667 42.538667 0 1 1-60.16 60.16l-111.786666-111.786666a16 16 0 0 0-22.613334 0l-111.786666 111.786666a42.538667 42.538667 0 1 1-60.16-60.16l111.786666-111.786666a16 16 0 0 0 0-22.613334l-111.786666-111.786666a42.538667 42.538667 0 0 1 60.16-60.16l111.786666 111.786666a16 16 0 0 0 22.613334 0l111.786666-111.786666z"})}));i.displayName="ClearIcon"},82352:(e,r,t)=>{t.d(r,{Fy:()=>g,Jg:()=>o,Ll:()=>p,O0:()=>m,Sv:()=>u,pD:()=>c,sJ:()=>x,xc:()=>f});var a=t(66960),l=t(75787),n=t(65093),i=t(28824),s=t(51025),d=t(4390);function o(e,r){return["futures-account-complex",e,r]}function c(){let{locale:e}=(0,a.B)(),r=(0,s.k)(e=>{var r,t;return null!=(t=null==(r=e.user)?void 0:r.userId)?t:null});return(0,d.useQuery)({queryKey:o(e,r),queryFn:()=>(0,l.mV)({locale:e}),enabled:!!e&&!!r,staleTime:1/0})}function u(e,r){return["futures-funding-time",e,r]}function m(e){let{locale:r}=(0,a.B)();return(0,d.useQuery)({queryKey:u(r,e),queryFn:()=>
1(0,i.x4)({locale:r,params:{symbol:e}}),enabled:!!r&&!!e,staleTime:1/0})}function p(e,r,t){return["futures-grid-exist",e,r,t]}function x(e,r){return["usdt-trade-api","curleverage",e,r]}function f(e,r){return["usdt-trade-api","risk-quantity",e,r]}function g(e){let r=!(arguments.length>1)||void 0===arguments[1]||arguments[1],{locale:t}=(0,a.B)(),l=(0,s.k)(e=>{var r,t;return null!=(t=null==(r=e.user)?void 0:r.userId)?t:null});return(0,d.useQuery)({queryKey:p(t,e,l),queryFn:()=>(0,n.I2)({locale:t,params:{symbol:e}}),enabled:!!t&&!!e&&!!l&&r,staleTime:0})}},90178:(e,r,t)=>{t.d(r,{Jg:()=>d,O0:()=>u,Sv:()=>c,pD:()=>o,sJ:()=>m,xc:()=>p});var a=t(66960),l=t(28824),n=t(51025),i=t(4390),s=t(16393);function d(e,r){return["futures-account-complex",e,r]}function o(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{locale:r}=(0,a.B)(),t=(0,n.k)(e=>{var r,t;return null!=(t=null==(r=e.user)?void 0:r.userId)?t:null}),l=!!r&&!!t;return(0,i.useQuery)({queryKey:d(r,t),queryFn:()=>(0,s.RS)({locale:r}),enabled:l,refetchInterval:!!l&&!!e.polling&&3e3,staleTime:1/0})}function c(e,r){return["futures-funding-time",e,r]}function u(e){let{locale:r}=(0,a.B)();return(0,i.useQuery)({queryKey:c(r,e),queryFn:()=>
1(0,l.x4)({locale:r,params:{symbol:e}}),enabled:!!r&&!!e,staleTime:1/0})}function m(e,r){return["usdt-trade-api","curleverage",e,r]}function p(e,r){return["usdt-trade-api","risk-quantity",e,r]}},97122:(e,r,t)=>{t.r(r),t.d(r,{default:()=>C});var a=t(79237),l=t(51924),n=t(53951),i=t(30511),s=t(13603),d=t(44031),o=t(56044),c=t(70659),u=t(66960),m=t(31508),p=t(51430),x=t(19490),f=t(51025),g=t(4390),h=t(38113),v=t(21219),b=t(90178),y=t(28598),N=t(16393),j=t(25749);let w=[0,25,50,75,100];function C(){var e,r,t;let{$t:C,locale:O}=(0,u.B)(),D=(0,j.r4)(),{refetch:T}=(0,b.pD)(),S=(0,f.k)(e=>{var r,t;return null!=(t=null==(r=e.user)?void 0:r.userId)?t:0}),P=null==(e=D.params)?void 0:e.item,L=(0,v.T)(),z=(0,y.Hp)((null==P?void 0:P.symbol)||L),[k,q]=(0,h.useState)("add"),[A,I]=(0,h.useState)(""),R=Number(A||0);(0,h.useEffect)(()=>{D.visible&&(q("add"),I(""))},[D.visible]);let F=(0,g.useQuery)({queryKey:["position-adjust-margin-info",O,S,null==P?void 0:P.id],enabled:D.visible&&!!(null==P?void 0:P.id)&&!!S&&!!z,queryFn:()=>(0,N.IY)({locale:O,params:{positionId:P.id,symbol:z}})}),E=null==(r=F.data)?void 0:r.data,B=Number("add"===k?(null==E?void 0:E.maxAdd)||0:(null==E?void 0:E.maxSub)||0),M=(0,h.useMemo)(()=>B||R?!B&&R>0?100:Math.min(Math.floor(100*R/B),100):0,[R,B]),Q=(0,g.useQuery)({queryKey:["position-adjust-margin-liq-price",O,S,null==P?void 0:P.id,k,R,null==E?void 0:E.avgPrice,null==E?void 0:E.margin,null==E?void 0:E.quatity,null==E?void 0:E.serviceFee],enabled:D.visible&&!!(null==P?void 0:P.id)&&!!S&&R>0&&!!(null==E?void 0:E.avgPrice)&&!!(null==E?void 0:E.margin)&&!!(null==E?void 0:E.quatity)&&!!(null==E?void 0:E.serviceFee)&&!!z&&!!(null==P?void 0:P.side),queryFn:()=>{let e={...E};return delete e.maxAdd,delete e.maxSub,(0,N.E9)({locale:O,params:{...e,adjustType:k,amount:R}})}}),H=!(R>0&&B>0&&R<=B),U=(0,h.useCallback)(e=>{var r;let t=""===e?e:!/^\d*\.?\d*$/.test(e)||((null==(r=e.split(".")[1])?void 0:r.length)||0)>2?null:e;null!==t&&I(t)},[]),G=(0,h.useCallback)(e=>{I(String((0,p.n7)(e/100*B,2)))},[B]),K=(0,h.useCallback)(async()=>{if((null==P?void 0:P.id)&&z&&(null==P?void 0:P.side)&&!H)try{await (0,N.XQ)({locale:O,params:{adjustType:k,amount:R,positionId:P.id,side:String(P.side),symbol:z}}),D.hideLayer(),T()}catch(r){var e;(0,m.d)(r)&&[10307,10337].includes(Number((null==(e=r.data)?void 0:e.code)||0))&&D.hideLayer()}},[k,R,null==P?void 0:P.id,null==P?void 0:P.side,D,O,z,T,H]);return(0,a.jsx)(n.Dialog,{open:D.visible,onOpenChange:e=>{e||D.hideLayer()},variant:"drawer",title:C("Adjust Margin"),hideHeader:!0,showClose:!1,footer:!1,className:"!border-l1 !bg-m1 shadow-3 !rounded-t-r5 md:!rounded-r4 !w-full !max-w-none !overflow-hidden !rounded-b-none !border-t !p-0 md:!w-[420px] md:!max-w-[calc(100vw-32px)] md:!border",bodyClassName:"!p-0 !pt-0 flex min-h-0 flex-1 flex-col overflow-hidden",children:(0,a.jsxs)("div",{className:"bg-m1 flex max-h-[90dvh] min-h-0 flex-col overflow-hidden px-4 pt-5 pb-[calc(env(safe-area-inset-bottom)+var(--spacing-s4))] md:max-h-none md:p-0",children:[(0,a.jsx)("div",{className:"flex flex-col gap-4 md:px-6 md:pt-6",children:(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,a.jsx)("div",{className:"text-t1 text-tm18",children:C("Adjust Margin")}),(0,a.jsxs)("div",{className:"text-t3 text-mm14 flex items-center gap-2",children:[(0,a.jsx)("span",{children:z||"--"}),(0,a.jsx)("span",{className:"bg-t3 h-3 w-px shrink-0"}),(0,a.jsxs)("span",{className:(null==P?void 0:P.side)==="short"?"text-p3":"text-p2",children:[C((null==P?void 0:P.side)==="short"?"Short":"Long")," ",(null==P?void 0:P.leverage)||"--","X"]})]})]}),(0,a.jsx)("button",{type:"button",className:"text-t3 hover:text-t2 flex h-[22px] shrink-0 items-center justify-center py-[2px] transition-colors",onClick:()=>D.hideLayer(),children:(0,a.jsx)(l.U,{className:"size-5"})})]})}),F.isLoading?(0,a.jsx)("div",{className:"flex h-[300px] items-center justify-center md:px-6 md:pb-6",children:(0,a.jsx)(i.t,{size:"m"})}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto pt-4 md:overflow-visible md:px-6",children:[(0,a.jsx)(s.Tabs,{value:k,onValueChange:e=>q(e),children:(0,a.jsxs)(s.TabsList,{className:"bg-bg05 w-full",children:[(0,a.jsx)(s.TabsTrigger,{value:"add",className:"flex-1",children:C("Increase Margin")}),(0,a.jsx)(s.TabsTrigger,{value:"sub",className:"flex-1",children:C("Decrease Margin")})]})}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(d.Input,{size:"m",inputMode:"decimal",value:A,onChange:e=>U(e.target.value),placeholder:C("add"===k?"Add margin":"Reduce margin"),wrapperClassName:"!rounded-r3",className:"!text-bm14",rightSlot:(0,a.jsx)("span",{className:"text-mm14 text-t1 shrink-0",children:"USDT"})}),(0,a.jsx)(o.Slider,{value:M,onValueChange:G,showIndicator:!1,marks:w,className:"px-s2 gap-1 md:px-0"})]}),(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between py-2",children:[(0,a.jsx)("span",{className:"text-bm14 text-t3",children:C("add"===k?"Max increase amount":"Max decrease amount")}),(0,a.jsx)("span",{className:"text-bm14 text-t1",children:B?"".concat((0,x.iT)(B)," USDT"):"--"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between py-2",children:[(0,a.jsx)("span",{className:"text-bm14 text-t3",children:C("add"===k?"Liq price after margin addition":"Liq price after margin decrease")}),(0,a.jsx)("span",{className:"text-bm14 text-t1",children:R>0&&(null==(t=Q.data)?void 0:t.data)?"".concat((0,x.iT)(Number(Q.data.data))," USDT"):"--"})]})]})]}),(0,a.jsx)("div",{className:"pt-6 md:px-6 md:pt-8 md:pb-6",children:(0,a.jsxs)("div",{className:"grid h-10 grid-cols-2 gap-2",children:[(0,a.jsx)(c.$,{variant:"secondary",size:"m",className:"h-10",onClick:()=>D.hideLayer(),children:C("Cancel")}),(0,a.jsx)(c.$,{size:"m",className:"h-10",disabled:H,onClick:K,children:C("Confirm")})]})})]})]})})}}}]);

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.