1"use strict";(self.webpackChunkokx_nav=self.webpackChunkokx_nav||[]).push([[3759],{57022:(e,t,n)=>{n.d(t,{$r:()=>a,x0:()=>i});var r="/priapi",i=("".concat(r).concat("/v2"),"".concat(r,"/v5")),a="".concat(r,"/v1")},61662:(e,t,n)=>{n.d(t,{t0:()=>i,x7:()=>r});var r=function(){},i={}},29305:(e,t,n)=>{n.d(t,{SC:()=>r,dy:()=>a,v8:()=>i});var r={UP:0,ROUND:1,DOWN:2},i={UTC_8:2,UTC_0:1,H_24:0},a={NONE:0,ASC:1,DESC:-1}},79078:(e,t,n)=>{n.d(t,{$9:()=>o,$L:()=>_,A6:()=>S,Bz:()=>C,Dt:()=>s,FL:()=>h,Ih:()=>A,Nk:()=>v,PF:()=>I,VM:()=>E,WB:()=>T,cr:()=>b,fr:()=>y,fs:()=>m,hm:()=>l,hv:()=>w,iw:()=>f,j_:()=>p,nj:()=>a,vi:()=>g,xW:()=>k});var r=n(64467),i=n(61992),a={TRADE:"1",SINGLE:"2",MULTI:"3",PM:"4"},o={QUESTIONNAIRE:"QUESTIONNAIRE",DISCLAIMER:"DISCLAIMER"},s={FEATURE:"feature",EXIT:"exit"},c="QUESTIONNAIRE_GENERAL_FUTURES",u="QUESTIONNAIRE_XSTOCK",d="QUESTIONNAIRE_OPTIONS",l=(0,r.A)((0,r.A)((0,r.A)((0,r.A)({},i.gy.OPTION,{code:d,feature:"eea-option"}),i.gy.SWAP,{code:c,feature:"eea-x-perp"}),i.gy.FUTURES,{code:c,feature:"eea-x-perp"}),i.gy.SPOT,{code:u,feature:"eea-x-stock"}),f={BASE:"0",CONT:"1",QUOTE:"2",LOT:"3"},v={BOND:"-1",LOCAL:"0"},p={PA:"0",BS:"1"},y={LONG_SHORT_MODE:"long_short_mode",NET_MODE:"net_mode"},h={ISOLATED:"isolated",CROSS:"cross",CASH:"cash"},A={OPEN:"automatic",AUTO:"autonomy",QUICK:"quick_margin",CCY:"auto_transfers_ccy"},g={COIN:"0",INST:"1"},m={N:"0",Y:"1"},b={N:"0",Y:"1"},T={N:"0",Y:"1"},C={UTC_8:2,UTC_0:1,H_24:0},I={TRADE_UNIT:"2",ORDER_CONFIRM:"3",GREEKS_UNIT:"4",DEPTH_SIZE:"5",NAVIGATION_MODE:"6",MARGIN_MODE:"7",LIQ_PX:"16",UPL_PRICES_TYPE:"17",TRADFI_TRADE_UNIT:"32"},_=function(e){var t,n,i=e.acctLv,o=e.instType,s=(0,r.A)((0,r.A)((0,r.A)((0,r.A)({},a.TRADE,{default:h.ISOLATED}),a.SINGLE,{default:h.ISOLATED}),a.MULTI,{default:h.CROSS}),a.PM,{default:h.CROSS});return(null===(t=s[i])||void 0===t?void 0:t[o])||(null===(n=s[i])||void 0===n?void 0:n.default)||h.ISOLATED},E={ACCOUNT_CHANGE:"1",USER_CHANGE:"3"},k={currencyId:0,displayName:"",isDefault:1,isoCode:"USD",precision:2,symbol:"$",usdToThisRate:1,isPremium:!1,usdToThisRatePremium:1},S={NORMAL:"0",TRADER:"1",COPIER:"2"},w="cefi-trading"},58451:(e,t,n)=>{n.d(t,{Ep:()=>d,Kq:()=>o,WS:()=>i,WU:()=>a,YY:()=>s,bF:()=>f,ic:()=>u,j_:()=>l,k3:()=>c,pJ:()=>r});var r="setting_configs",i="cache_config",a="mgn_mode_configs",o="watch_tab",s="favorites",c="global_search_history",u="global_search_dex_hide_modal",d="payWithAlertClosed",l="usd_margined_alert_closed",f="name_pair_display_order"},17650:(e,t,n)=>{n.d(t,{bo:()=>r,ll:()=>i,w2:()=>a,yy:()=>o});var r={LOGIN_SUCCESS:"0",LOGIN_ERROR:"60009",ALREADY_LOGIN:"60010"},i={JWT:"jwt",SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscribe",PING:"ping",PONG:"pong"},a={POSITIONS:"positions",ORDERS:"orders",PRIVATE_SUMMARY:"private-summary"},o={TICKERS_3S:"tickers-3s",MP_TICKERS_3S:"mp-tickers-3s",CUP_TICKERS_3S:"cup-tickers-3s",INSTRUMENTS:"instruments",BOOKS:"optimized-books",BOOKS_GROUP:"books-grouped",TICKERS:"tickers",MARK_PRICE:"mark-price",INDEX_TICKERS:"index-tickers",INDEX_TICKERS_3S:"index-tickers-3s",FUNDING_RATE:"funding-rate",OPT_SUMMARY_INST_ID:"opt-summary-instId",ESTIMATED_PRICE:"estimated-price",OPEN_INTEREST:"open-interest",AGGREGATED_TRADES:"aggregated-trades",NEW_COINS_COUNTDOWN:"new-inst-countdown",DEX_TICKERS:"dex-market-v3",DEX_RANK_TICKERS:"dex-cedefi-rank",EVENT_CONTRACT_MARKETS:"event-contract-markets",EVENT_UP_DOWN:"event-up-down",EVENT_ABOVE_DAILY:"event-above-daily",EVENT_HIT:"event-hit",EVENT_BETWEEN:"event-between",EVENT_CONTRACT_TICKERS:"event-contract-tickers-4s",CANDLE_ALL:"candle-all"}},22716:(e,t,n)=>{n.d(t,{A:()=>v});var r=n(22007),i=n(3453),a=n(10467),o=n(92901),s=n(23029),c=n(91947),u=n(39326),d=n(57022),l=n(31385),f=u.Ws.ALL;const v=new((0,o.A)(function e(){(0,s.A)(this,e),this.getEventConfig=(0,a.A)((0,r.A)().m(function e(){var t,n,a,o,s,u,f=arguments;return(0,r.A)().w(function(e){for(;;)switch(e.n){case 0:return t=(f.length>0&&void 0!==f[0]?f[0]:{}).isAll,n={},void 0!==t&&(n.isAll=t),e.n=1,(0,c.A)((0,l.Jt)("".concat(d.x0,"/rubik/event-contract/config"),n));case 1:if(a=e.v,o=(0,i.A)(a,2),s=o[0],u=o[1],!s){e.n=2;break}return e.a(2,[]);case 2:return e.a(2,(null===u||void 0===u?void 0:u.data)||[])}},e)})),this.getEventList=(0,a.A)((0,r.A)().m(function e(){var t,n,a,o,s,u,v,p,y,h,A=arguments;return(0,r.A)().w(function(e){for(;;)switch(e.n){case 0:return n=(t=A.length>0&&void 0!==A[0]?A[0]:{}).tabId,a=t.pageNum,o=t.pageSize,s={pageNum:a,pageSize:o},n&&n!==f&&(s.tabId=n),e.n=1,(0,c.A)((0,l.Jt)("".concat(d.x0,"/rubik/event-contract/market/list"),s));case 1:return u=e.v,v=(0,i.A)(u,2),p=v[0],y=v[1],h={data:[],pageNum:1,pageSize:o,total:0},e.a(2,p?h:(null===y||void 0===y?void 0:y.data)||h)}},e)})),this.getInstList=(0,a.A)((0,r.A)().m(function e(){var t,n,a,o;return(0,r.A)().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,(0,c.A)((0,l.Jt)("".concat(d.x0,"/rubik/event-contract/market/inst-list")));case 1:return t=e.v,n=(0,i.A)(t,2),a=n[0],o=n[1],e.a(2,a?[]:(null===o||void 0===o?void 0:o.data)||[])}},e)}))}))},31385:(e,t,n)=>{n.d(t,{Jt:()=>c,bE:()=>d,f6:()=>f,fe:()=>l,sS:()=>u});var r=n(47185),i=n.n(r),a=n(58061);function o(e){var t=(e||{}).data;
1return t&&0===Number(t.code)?Promise.resolve(t):Promise.reject(t||{})}var s=function(e){var t=e.data;return t.length?t[0]:Promise.reject(e)};function c(e,t){return i().get(e,{params:t}).then(o)}function u(e,t,n){return i().get(e,{params:t,signal:n,isolate:!0}).then(o)}function d(e,t){return i().post(e,t).then(o)}function l(e,t){return c(e,t).then(s)}function f(e){var t,n,r,i=(null===e||void 0===e||null===(t=e.data)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.sMsg)||(null===e||void 0===e||null===(r=e.data)||void 0===r?void 0:r.msg)||(null===e||void 0===e?void 0:e.msg);return i&&"string"===typeof i&&a.A.error({content:i}),Promise.reject(e)}},99181:(e,t,n)=>{n.d(t,{Ay:()=>V});var r=n(60436),i=n(80045),a=n(89379),o=n(22007),s=n(10467),c=n(23029),u=n(92901),d=n(4473),l=n(68341),f=n(64467),v=n(3453),p=n(917),y=n(74198),h=(n(47113),n(39455)),A=n(48769),g=n(57022),m=n(16901),b=n(61992),T=n(58451),C=n(31385),I=n(99546),_=n(13587),E=["combineFavouriteBean"],k=b.gy.COIN,S=b.gy.FUTURES,w=b.gy.MARGIN,P=b.gy.SPOT,N=b.gy.SWAP,O=b.gy.OPTION,R=b.gy.CEDEFI,U=b.gy.FUTURES_SWAP,D=(b.gy.ALL,{FUTURES:U,OPTIONS:O,CRYPTO:k,DEX:R}),L=Object.fromEntries(Object.entries(D).map(function(e){var t=(0,v.A)(e,2),n=t[0];return[t[1],n]})),M=function(e){return L[e]||e},x=((0,f.A)((0,f.A)((0,f.A)((0,f.A)((0,f.A)((0,f.A)((0,f.A)({},P,P),w,P),N,U),S,U),O,O),k,k),R,R),(0,l.A)("success")),F=(0,l.A)("flattenGroupedResponse"),j=(0,l.A)("getCedefiFavorites"),B=(0,l.A)("mergeDexCoins"),G=(0,l.A)("replaceMarginToSpot"),W=(0,l.A)("formatParams"),q=(0,l.A)("formatInstIds"),K=(0,l.A)("formatFavorites"),z=(0,l.A)("formatDexCoins"),H=(0,l.A)("formatSimpleProduct");const V=new(function(){return(0,u.A)(function e(){var t=this;(0,c.A)(this,e),Object.defineProperty(this,x,{writable:!0,value:!0}),this.getFavorites=(0,s.A)((0,o.A)().m(function e(){var n,r;return(0,o.A)().w(function(e){for(;;)switch(e.n){case 0:return(0,d.A)(t,x)[x]=!0,n=(0,m.W5)()?t.getRemoteFavorites:t.getLocalFavorites,e.n=1,n();case 1:return r=e.v,e.a(2,(0,d.A)(t,K)[K](r))}},e)})),this.getRemoteFavorites=(0,s.A)((0,o.A)().m(function e(){var n,r,i;return(0,o.A)().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,(0,C.Jt)("".concat(g.x0,"/users/favorite/get-product-info-grouped"),{shouldRemoveMargin:!0}).catch(function(e){return p.v.info("getRemoteFavorites error:",e),null});case 1:if((n=e.v)&&Array.isArray(n.data)){e.n=2;break}return(0,d.A)(t,x)[x]=!1,e.a(2,{});case 2:return r=(0,d.A)(t,F)[F](n.data),e.n=3,(0,d.A)(t,j)[j](r);case 3:return i=e.v,e.a(2,(0,a.A)((0,a.A)({},r),{},{dexCoins:i}))}},e)})),Object.defineProperty(this,F,{writable:!0,value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n={},o=[],s=[],c=new Map;e.forEach(function(e){var r,u=e.combineFavouriteBean,d=(0,i.A)(e,E),l=(r=d.groupName,D[r]||r),f=(0,a.A)((0,a.A)({},d),{},{groupName:l});s.push(f),l===b.gy.ALL&&(n=u,o=(null===u||void 0===u?void 0:u.favorites)||[]),((null===u||void 0===u?void 0:u.favorites)||[]).forEach(function(e){if(e){var n=t.setStarKey(e);c.has(n)||c.set(n,(0,a.A)((0,a.A)({},e),{},{favoriteGroupIds:[]})),function(e){return Object.values(b.gy).includes(e)}(l)||c.get(n).favoriteGroupIds.push(l)}})});var u=o.map(function(e){return c.get(t.setStarKey(e))}).filter(Boolean),d=new Set(u.map(function(e){return t.setStarKey(e)})),l=Array.from(c.values()).filter(function(e){return!d.has(t.setStarKey(e))});return(0,a.A)((0,a.A)({},n),{},{favorites:[].concat((0,r.A)(u),(0,r.A)(l)),favoriteGroupIds:s})}}),Object.defineProperty(this,j,{writable:!0,value:function(){var e=(0,s.A)((0,o.A)().m(function e(){var n,r,i,a,s,c,u,l=arguments;return(0,o.A)().w(function(e){for(;;)switch(e.n){case 0:if(r=(n=l.length>0&&void 0!==l[0]?l[0]:{}).favorites,i=void 0===r?[]:r,a=n.dexCoins,s=void 0===a?[]:a,(c=i.filter(function(e){return!(0,A.z)(e)}).map(function(e){return{chainId:e.chainId,tokenContractAddress:e.tokenContractAddress}})).length){e.n=1;break}return e.a(2,s);case 1:return e.n=2,_.A.getCedefiDetails(c);case 2:return u=e.v,e.a(2,(0,d.A)(t,B)[B](s,u))}},e)}));return function(){return e.apply(this,arguments)}}()}),Object.defineProperty(this,B,{writable:!0,value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=new Map;return e.forEach(function(e){var t="".concat(e.chainId,"-").concat(e.tokenContractAddress);n.set(t,e)}),t.forEach(function(e){var t="".concat(e.chainId,"-").concat(e.tokenContractAddress),r=n.get(t);r?n.set(t,(0,a.A)((0,a.A)({},r),e)):n.set(t,e)}),Array.from(n.values())}}),this.getLocalFavorites=(0,s.A)((0,o.A)().m(function e(){var n,r,i,a,s,c,u,l,f,p;return(0,o.A)().w(function(e){for(;;)switch(e.n){case 0:return n=(0,d.A)(t,G)[G]()||[],r=(0,d.A)(t,W)[W](n),i=r.instIds,a=r.coinIds,s=r.cedefiIds,e.n=1,Promise.all([t.getFavoriteCoins(a),t.getFavoriteSimpleProduct(i),_.A.getCedefiDetails(s)]);case 1:return c=e.v,u=(0,v.A)(c,3),l=u[0],f=u[1],p=u[2],e.a(2,{favorites:n,coins:l,simpleProduct:f,dexCoins:p})}},e)})),Object.defineProperty(this,G,{writable:!0,value:function(){var e=h.Jt(T.YY)||[],t=[];return e.forEach(function(n){n.instType===w?e.find(function(e){return e.instId===n.instId&&e.instType===P})||t.push({instType:P,instId:n.instId}):t.push(n)}),h.hZ(T.YY,t),t}}),Object.defineProperty(this,W,{writable:!0,value:function(e){var n=[],r={},i=[];e.forEach(function(e){var a=e.instId,o=e.instType,s=e.chainId,c=e.tokenContractAddress;if(o!==k)if((0,A.z)(e)){var u=(0,d.A)(t,q)[q](e);r[o]?r[o].push(u):r[o]=[u]}else i.push({chainId:s,tokenContractAddress:c});else n.push(a)});var a="";return Object.keys(r).forEach(function(e){a+="".concat(e,":").concat(r[e].join(","),";")}),{coinIds:n.join(),instIds:a,cedefiIds:i}}}),Object.defineProperty(this,q,{writable:!0,value:function(e){var t=e.instId,n=e.instType,r=e.alias;return n===S?"".concat(t,"+").concat(r):t}}),this.getFavoriteCoins=function(){var e=(0,s.A)((0,o.A)().m(function e(t){return(0,o.A)().w(function(e){for(;;)switch(e.n){case 0:if(t){e.n=1;break}return e.a(2,[]);case 1:return e.a(2,(0,C.Jt)("".concat(g.x0,"/public/favorite/coins"),{coinIds:t}).then(function(e){return e.data}).catch(function(){return[]}))}},e)}));return function(t){return e.apply(this,arguments)}}(),this.getFavoriteSimpleProduct=function(){var e=(0,s.A)((0,o.A)().m(function e(t){return(0,o.A)().w(function(e){for(;;)switch(e.n){case 0:if(t){e.n=1;break}return e.a(2,{});case 1:return e.a(2,(0,C.fe)("".concat(g.x0,"/public/favorite/simpleProduct"),{instIds:t}).catch(function(){return{}}))}},e)}));return function(t){return e.apply(this,arguments)}}(),Object.defineProperty(this,K,{writable:!0,value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.favorites,r=e.coins,i=void 0===r?[]:r,a=e.simpleProduct,o=void 0===a?{}:a,s=e.dexCoins,c=void 0===s?[]:s,u=e.favoriteGroupIds,l=void 0===u?[]:u,f={};
1(n||[]).forEach(function(e){var n=t.setStarKey(e);f[n]=e});var v=(0,d.A)(t,H)[H](o);return{favorites:f,simpleProduct:v,coins:I.A.formatCoin(i),dexCoins:(0,d.A)(t,z)[z](c),favoriteGroupIds:l,success:(0,d.A)(t,x)[x]}}}),Object.defineProperty(this,z,{writable:!0,value:function(){var e={};return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach(function(t){var n=_.A.getCedefiTokenKey(t);e[n]=t}),e}}),Object.defineProperty(this,H,{writable:!0,value:function(e){var t={};return Object.keys(e).forEach(function(n){var r=I.A.formatInst(e[n],n);t[n]=Object.values(r)}),t}}),this.addGroupName=function(e){return(0,C.bE)("".concat(g.x0,"/users/favorite/add-group-name"),{groupName:e}).catch(function(e){p.v.info("/add-group-name",e.msg),e.msg&&y.A.warn({title:e.msg})})},this.updateGroupName=function(e,t){return(0,C.bE)("".concat(g.x0,"/users/favorite/update-group-name"),{oldGroupName:e,newGroupName:t}).catch(function(e){p.v.info("/update-group-name",e.msg),e.msg&&y.A.warn({title:e.msg})})},this.addToGroup=function(e){var t=e.groupNameList,n=void 0===t?[]:t,r=e.userFavouriteDTOs,i=void 0===r?[]:r;return n.length&&i.length?(0,C.bE)("".concat(g.x0,"/users/favorite/add-to-group"),{groupNameList:n.map(M),userFavouriteDTOs:i}).catch(function(e){throw p.v.info("/add-to-group",null===e||void 0===e?void 0:e.msg),(null===e||void 0===e?void 0:e.msg)&&y.A.warn({title:e.msg}),e}):Promise.resolve()},this.removeFromGroup=function(e){var t=e.groupName,n=e.userFavouriteDTOs,r=void 0===n?[]:n;return t&&r.length?(0,C.bE)("".concat(g.x0,"/users/favorite/remove-from-group"),{groupName:M(t),userFavouriteDTOs:r}).catch(function(e){throw p.v.info("/remove-from-group",null===e||void 0===e?void 0:e.msg),(null===e||void 0===e?void 0:e.msg)&&y.A.warn({title:e.msg}),e}):Promise.resolve()},this.deleteGroup=function(e){return(0,C.bE)("".concat(g.x0,"/users/favorite/delete-group"),{groupName:e}).catch(function(e){p.v.info("/delete-group",e.msg),e.msg&&y.A.warn({title:e.msg})})},this.setHiddenGroups=function(e,t){return(0,C.bE)("".concat(g.x0,"/users/favorite/set-hidden-groups"),{groupName:M(e),isHidden:t}).catch(function(e){throw p.v.info("/set-hidden-groups",e.msg),e.msg&&y.A.warn({title:e.msg}),e})},this.rearrangeGroups=function(e){return(0,C.bE)("".concat(g.x0,"/users/favorite/rearrange-groups"),e.map(M)).catch(function(e){throw p.v.info("/rearrange-groups",null===e||void 0===e?void 0:e.msg),(null===e||void 0===e?void 0:e.msg)&&y.A.warn({title:e.msg}),e})},this.setStarKey=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.instType,n=e.instId,r=e.instFamily,i=e.alias,a=e.chainId,o=e.tokenContractAddress;if(t===S){var s=r||n;return"".concat(t,"-").concat(s,"-").concat(i)}return a&&o?"".concat(R,"-").concat(a,"-").concat(o):"".concat(t,"-").concat(n)}},[{key:"getRecommends",value:function(){var e=(0,s.A)((0,o.A)().m(function e(){var t,n;return(0,o.A)().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,(0,C.Jt)("".concat(g.x0,"/rubik/private/favorite/recommend")).catch(function(){return{data:[]}});case 1:return t=e.v,n=t.data,e.a(2,n)}},e)}));return function(){return e.apply(this,arguments)}}()},{key:"setFavorites",value:function(e){var t=e.isAll,n=e.params,r=e.favorites;if(!(0,m.W5)())return h.hZ(T.YY,Object.values(r)),Promise.resolve();var i=t?"setting-all":"setting";return(0,C.bE)("".concat(g.x0,"/users/favorite/").concat(i),n)}}])}())},99546:(e,t,n)=>{n.d(t,{A:()=>N});var r=n(64467),i=n(80045),a=n(60436),o=n(89379),s=n(22007),c=n(3453),u=n(10467),d=n(92901),l=n(23029),f=n(4473),v=n(68341),p=n(91947),y=n(92675),h=n(57022),A=n(16901),g=n(61992),m=n(31385),b=["commodityTag","searchKey"],T=g.gy.COIN,C=g.gy.SPOT,I=g.gy.MARGIN,_=g.gy.EVENTS,E=g.mm.PRE_MARKET,k=g.mm.REBASE_CONTRACT,S=(0,v.A)("requestInst"),w=(0,v.A)("requestConfig"),P=(0,v.A)("mergeHttp");const N=new((0,d.A)(function e(){var t=this;(0,l.A)(this,e),this.publicCoinsPromise=null,this.tradfiCoinSupplementPromise=null,this.dexTokensPromise=null,this.dexTokenPromises={},this.getInstGroup=function(){return(0,m.fe)("".concat(h.x0,"/public/inst-group")).catch(function(){return{}})},this.getBlackCcys=function(){return(0,m.Jt)("/v2/asset/accounts/hidden-currency-with-search",{checkBalance:!0}).then(function(e){var t=e.data,n={};return t.forEach(function(e){var t=e.symbol;n[t]=e}),n}).catch(function(){return[]})},this.getCoins=(0,u.A)((0,s.A)().m(function e(){var n,r,i,a;return(0,s.A)().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Promise.all([t.getPublicCoins(),t.getTradfiCoinSupplement()]);case 1:return n=e.v,r=(0,c.A)(n,2),i=r[0],a=r[1],e.a(2,t.mergeTradfiCoinSupplement(i,a))}},e)})),this.getPublicCoins=function(){return A.kU?t.fetchPublicCoins():(t.publicCoinsPromise||(t.publicCoinsPromise=t.fetchPublicCoins()),t.publicCoinsPromise)},this.fetchPublicCoins=(0,u.A)((0,s.A)().m(function e(){var n,r,i,a,o;return(0,s.A)().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,(0,p.A)((0,m.Jt)("".concat(h.x0,"/public/coins")));case 1:if(n=e.v,r=(0,c.A)(n,2),i=r[0],a=r[1],o=void 0===a?{}:a,!i){e.n=2;break}return t.publicCoinsPromise=null,e.a(2,{});case 2:return e.a(2,t.formatCoin(o.data||[]))}},e)})),this.formatCoin=function(){var e={};return(arguments.length>
10&&void 0!==arguments[0]?arguments[0]:[]).forEach(function(t){var n,r=t.symbol,i=t.tradeCoin,a=t.groups,s=void 0===a?[]:a;try{n=A.kU?t.url:(0,A.ox)()+new URL(t.url).pathname}catch(c){n=t.url}e[r]=(0,o.A)((0,o.A)({},t),{},{instType:T,instId:r,displaySymbol:t.displaySymbol||r,isLive:!0,isTrade:!!Number(i),groups:s.map(function(e){return+e}),url:n})}),e},this.getTradfiCoinSupplement=function(){return A.kU?t.fetchTradfiCoinSupplement():(t.tradfiCoinSupplementPromise||(t.tradfiCoinSupplementPromise=t.fetchTradfiCoinSupplement()),t.tradfiCoinSupplementPromise)},this.fetchTradfiCoinSupplement=(0,u.A)((0,s.A)().m(function e(){var n,r,i,a,o,u,d;return(0,s.A)().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,(0,p.A)((0,m.Jt)("".concat(h.x0,"/rubik/public/tradfi/base-info"),{includeEnum:"commodityTag,searchKey,financialReportTag"}));case 1:if(n=e.v,r=(0,c.A)(n,2),i=r[0],a=r[1],o=void 0===a?{}:a,!i){e.n=2;break}return t.tradfiCoinSupplementPromise=null,e.a(2,{});case 2:return u=o.data,d=void 0===u?[]:u,e.a(2,t.formatTradfiCoinSupplement(d))}},e)})),this.formatTradfiCoinSupplement=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t={};return Array.isArray(e)?(e.forEach(function(e){var n=(e||{}).symbol;n&&(t[n]=(0,o.A)({},e))}),t):t},this.formatTradfiSearchKey=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=Array.isArray(e)?(0,a.A)(e):[];return t&&n.push(t),(0,a.A)(new Set(n))},this.mergeTradfiCoinSupplement=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,o.A)({},e);return Object.keys(n).forEach(function(e){var a=r[e],s=n[e];if(a&&s){var c=s.commodityTag,u=s.searchKey,d=(0,i.A)(s,b),l=c||a.commodityTag;r[e]=(0,o.A)((0,o.A)((0,o.A)({},a),d),{},{searchKey:t.formatTradfiSearchKey(u,l)}),l&&(r[e].commodityTag=l)}}),r},this.getDexTokens=(0,u.A)((0,s.A)().m(function e(){return(0,s.A)().w(function(e){for(;;)if(0===e.n)return t.dexTokensPromise||(t.dexTokensPromise=(0,m.Jt)("/priapi/v5/rubik/dex/rank").then(function(e){return e.data}).catch(function(){return t.dexTokensPromise=null,[]})),e.a(2,t.dexTokensPromise)},e)})),this.getDexToken=function(e){var n=e.chainId,r=e.tokenContractAddress,i=e.useCache,a=void 0===i||i,o="".concat(n,"-").concat(r);return t.dexTokenPromises[o]&&a||(t.dexTokenPromises[o]=(0,m.bE)("/priapi/v5/rubik/dex/details?queryWrapped=true",[{chainId:n,tokenContractAddress:r}]).then(function(e){return e.data[0]}).catch(function(){delete t.dexTokenPromises[o]})),t.dexTokenPromises[o]},this.getSimpleProduct=function(e){return(0,m.Jt)("/priapi/v5/public/simpleProduct",{instType:e,includeType:2}).then(function(e){var n=e.data,r=t.formatInst(n);return{simpleInsts:r,simpleTypes:Object.values(r)}}).catch(function(){return{simpleInsts:{},simpleTypes:[],error:!0}})},this.getInsts=function(e){var n=e.instType,r=e.requestIds;return(0,f.A)(t,P)[P]({instType:n,requestIds:r,isInst:!0})},this.getConfigs=function(e){var n=e.instType,r=e.requestIds;return(0,f.A)(t,P)[P]({instType:n,requestIds:r})},this.getNewCoins=function(){return(0,m.Jt)("/priapi/v5/rubik/public/new-inst-countdown").then(function(e){var t=e.data;return void 0===t?[]:t}).catch(function(){return[]})},Object.defineProperty(this,S,{writable:!0,value:function(){var e=(0,u.A)((0,s.A)().m(function e(n){var r,i,a,c,u;return(0,s.A)().w(function(e){for(;;)switch(e.n){case 0:return r=n.instType,i=n.id,e.n=1,(0,m.Jt)("/priapi/v5/public/products",{instType:r,instId:i,includeType:2}).catch(function(){return{data:[],error:!0}});case 1:if(a=e.v,c=a.data,!a.error){e.n=2;break}return e.a(2,{});case 2:return u=t.formatInst(c),i.split(",").forEach(function(e){u[e]||(u[e]=(0,o.A)((0,o.A)((0,o.A)({},g.J8),(0,y.ji)(e)),{},{displayId:e}))}),e.a(2,u)}},e)}));return function(t){return e.apply(this,arguments)}}()}),Object.defineProperty(this,w,{writable:!0,value:function(){var e=(0,u.A)((0,s.A)().m(function e(n){var i,a,o,c,u;return(0,s.A)().w(function(e){for(;;)switch(e.n){case 0:return i=n.instType,a=n.id,o=(0,r.A)((0,r.A)((0,r.A)({},C,"instId"),I,"instId"),_,"seriesId"),c=o[i]||"instFamily",e.n=1,(0,m.fe)("/priapi/v5/public/config",(0,r.A)({instType:i},c,a)).catch(function(){return{}});case 1:return u=e.v,e.a(2,t.formatConfig(u))}},e)}));return function(t){return e.apply(this,arguments)}}()}),Object.defineProperty(this,P,{writable:!0,value:function(){var e=(0,u.A)((0,s.A)().m(function e(n){var r,i,a,o,c,u,d,l,v,p,y,h,A,g,m;return(0,s.A)().w(function(e){for(;;)switch(e.n){case 0:r=n.instType,i=n.requestIds,a=n.isInst,o=n.start,c=void 0===o?0:o,u=n.result,d=void 0===u?{}:u,l=a?(0,f.A)(t,S)[S]:(0,f.A)(t,w)[w],v=[],p=0,y=c,h=i.length;case 1:if(!(y<h)){e.n=3;break}if(A=y+50,g=i.slice(y,A),m=l({instType:r,id:g.join()}),v.push(m),!(v.length>
1=10)){e.n=2;break}return p=A,e.a(3,3);case 2:y+=50,e.n=1;break;case 3:return e.n=4,Promise.all(v);case 4:if(e.v.forEach(function(e){Object.assign(d,e)}),!(p>0)){e.n=5;break}return e.a(2,new Promise(function(e){setTimeout(e,2e3)}).then(function(){return(0,f.A)(t,P)[P]({instType:r,requestIds:i,isInst:a,start:p,result:d})}));case 5:return e.a(2,d)}},e)}));return function(t){return e.apply(this,arguments)}}()}),this.formatInst=function(e){var t={};return e.forEach(function(e){var n=e.instId,r=e.instType,i=e.lever,a=e.status,s=e.ruleType,c=e.coinLever,u=(0,y.ji)(n,r),d=u.baseCcy,l=u.quoteCcy,f=u.familyCcy,v=u.instFamily,p=u.isLinear,h=u.isUm,A=u.isXp,m=u.ctType;t[n]=(0,o.A)((0,o.A)((0,o.A)({},g.J8),e),{},{familyCcy:f,isLinear:p,isUm:h,isXp:A,displayId:e.displayId||n,displayBaseCcy:e.displayId?(0,y.ji)(e.displayId,r).baseCcy:e.baseCcy||d,baseCcy:e.baseCcy||d,quoteCcy:e.quoteCcy||l,instFamily:e.instFamily||v,lever:+i?i:"",coinLever:+c?c:"",isLive:a!==g.O6.ONLINE,ctType:e.ctType||m,isPreMarket:[E,k].includes(s),isPreMarketRebase:s===k})}),t},this.formatConfig=function(e){var t=e.idxCcyConfig,n=void 0===t?[]:t,i=e.idxConfig,a={};return(void 0===i?[]:i).forEach(function(e){var t=e.instType,n=e.referId,i=e.marginDig,s=e.contractDig,c=e.baseDig,u=e.quoteDig,d=(0,y.ji)(n),l=d.baseCcy,f=d.quoteCcy,v=d.isLinear,p=(0,y.Cs)(t),h=p.isFuturesOrSwap,A=p.isOption;h?(c=v?s:i,u=v?i:s):A&&(c=s,u=i);var g=p.isSpotOrMargin?(0,r.A)((0,r.A)({},l,c),f,u):(0,r.A)((0,r.A)({},l,i),f,i);a[n]=(0,o.A)((0,o.A)((0,o.A)({},e),g),{},{baseDig:c,quoteDig:u})}),n.forEach(function(e){var t=e.referId,n=e.ccyName,r=void 0===n?"":n,i=e.ccySign,s=void 0===i?"":i,c=e.displayId,u=e.displayName,d=void 0===u?"":u,l=e.displaySign,f=void 0===l?"":l,v=!!c&&(0,y.ji)(t).quoteCcy!==(0,y.ji)(c).quoteCcy;a["".concat(t,"-").concat(r)]=(0,o.A)((0,o.A)({},e),{},{ccyName:v?d:r,ccySign:v?f:s})}),a}}))},15986:(e,t,n)=>{n.d(t,{A:()=>_});var r=n(80045),i=n(3453),a=n(22007),o=n(10467),s=n(89379),c=n(23029),u=n(92901),d=n(4473),l=n(68341),f=n(91947),v=n(16901),p=n(29305),y=n(31385),h=n(99546),A=["zone"],g=["zone"],m=p.dy.ASC,b="/priapi/v5",T=(0,l.A)("formatRankData"),C=(0,l.A)("getKey"),I=function(){function e(){(0,c.A)(this,e),Object.defineProperty(this,T,{writable:!0,value:function(e){var t,n,r=((null===(t=e.data)||void 0===t?void 0:t.data)||[]).map(function(e){var t=e.instType,n=e.realInstType,r=e.instId,i=e.marketCap,a=e.fundingRate,o=e.fullNameV2;return(0,s.A)((0,s.A)({},e),{},{isTrade:!0,fullName:o,instType:n||t,ticker:{instType:n||t,instId:r,marketCap:i,fundingRate:a}})}),i=h.A.formatInst(r);return{data:Object.values(i),total:(null===(n=e.data)||void 0===n?void 0:n.total)||r.length}}}),Object.defineProperty(this,C,{writable:!0,value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.pageNum,n=e.pageSize,r=e.sortField,i=e.sortType,a=e.typeId;return"".concat(a,"_").concat(r,"_").concat(i,"_").concat(t,"_").concat(n)}})}return(0,u.A)(e,[{key:"getSysTime",value:function(){var e=(0,o.A)((0,a.A)().m(function e(){var t,n,r,i;return(0,a.A)().w(function(e){for(;;)switch(e.n){case 0:return t=Date.now(),e.n=1,(0,y.fe)("".concat(b,"/public/time")).catch(function(){return{ts:Date.now()}});case 1:if(n=e.v,r=n.ts,i=Date.now(),!(i-t>3e3&&t<r&&i>r)){e.n=2;break}return e.a(2,i);case 2:return e.a(2,Number(r))}},e)}));return function(){return e.apply(this,arguments)}}()},{key:"getAllUsdTickers",value:function(){var e=(0,o.A)((0,a.A)().m(function e(){var t,n,r;return(0,a.A)().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,(0,y.Jt)("".concat(b,"/market/all-cup-tickers")).catch(function(){return{data:[]}});case 1:return t=e.v,n=t.data,r=void 0===n?[]:n,e.a(2,r.map(function(e){return(0,s.A)((0,s.A)({},e),{},{instId:e.ccy})}))}},e)}));return function(){return e.apply(this,arguments)}}()},{key:"getUsdTickers",value:function(){var e=(0,o.A)((0,a.A)().m(function e(t){var n,r;return(0,a.A)().w(function(e){for(;;)switch(e.n){case 0:if(t.length){e.n=1;break}return e.a(2,[]);case 1:return e.n=2,(0,y.Jt)("".concat(b,"/market/mult-cup-tickers"),{ccys:t.join()}).catch(function(){return{data:[]}});case 2:return n=e.v,r=n.data,e.a(2,r)}},e)}));return function(t){return e.apply(this,arguments)}}()},{key:"getUsdTicker",value:function(){var e=(0,o.A)((0,a.A)().m(function e(t){return(0,a.A)().w(function(e){for(;;)if(0===e.n)return e.a(2,this.getUsdTickers([t]))},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"getMultTickers",value:function(){var e=(0,o.A)((0,a.A)().m(function e(t){var n,r,i;return(0,a.A)().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t.length){e.n=1;break}return e.a(2,[]);case 1:for(n=[],r=0;r<t.length;r+=50)n.push(t.slice(r,r+50));return e.p=2,e.n=3,Promise.all(n.map(function(){var e=(0,o.A)((0,a.A)().m(function e(t){var n,r,i;return(0,a.A)().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,(0,y.Jt)("".concat(b,"/market/mult-tickers"),{instIds:t.join()}).catch(function(){return{data:[]}});case 1:return n=e.v,r=n.data,i=void 0===r?[]:r,e.a(2,i)}},e)}));return function(t){return e.apply(this,arguments)}}()));case 3:return i=e.v,e.a(2,i.flat());case 4:return e.p=4,e.v,e.a(2,[])}},e,null,[[2,4]])}));return function(t){return e.apply(this,arguments)}}()},{key:"getTicker",value:function(){var e=(0,o.A)((0,a.A)().m(function e(t){return(0,a.A)().w(function(e){for(;;)if(0===e.n)return e.a(2,this.getMultTickers([t]))},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"getTickers",value:function(){var e=(0,o.A)((0,a.A)().m(function e(t){var n,r;return(0,a.A)().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,(0,y.Jt)("".concat(b,"/market/tickers"),t).catch(function(){return{data:[]}});case 1:return n=e.v,r=n.data,e.a(2,r)}},e)}));return function(t){return e.apply(this,arguments)}}()},{key:"getSortMarkTickers",value:function(){var e=(0,o.A)((0,a.A)().m(function e(t){var n,r,i,o,s,c;return(0,a.A)().w(function(e){for(;;)switch(e.n){case 0:return n=t.instType,r=t.sortDir,i=t.sortField,o=r===m?"asc":"desc",e.n=1,(0,y.Jt)("".concat(b,"/market/sort-mp-tickers"),{instType:n,order:o,sortField:i}).catch(function(){return{data:[]}});case 1:return s=e.v,c=s.data,e.a(2,c)}},e)}));return function(t){return e.apply(this,arguments)}}()},{key:"getMarkPrice",value:function(){var e=(0,o.A)((0,a.A)().m(function e(t){var n,r;return(0,a.A)().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,(0,y.Jt)("".concat(b,"/public/mark-price"),t).catch(function(){return{data:[]}});case 1:return n=e.v,r=n.data,e.a(2,r)}},e)}));return function(t){return e.apply(this,arguments)}}()},{key:"getIndexPrice",value:function(){var e=(0,o.A)((0,a.A)().m(function e(){var t,n,r,o,s,c,u,d=arguments;return(0,a.A)().w(function(e){for(;;)switch(e.n){case 0:return n=(t=d.length>0&&void 0!==d[0]?d[0]:"").split("-"),r=(0,i.A)(n,2),o=r[1],s=void 0===o?"all":o,e.n=1,(0,y.Jt)("".concat(b,"/market/index-tickers"),{instId:t,quoteCcy:s}).catch(function(){return{data:[]}});case 1:return c=e.v,u=c.data,e.a(2,u)}},e)}));return function(){return e.apply(this,arguments)}}()},{key:"getFundingRate",value:function(){var e=(0,o.A)((0,a.A)().m(function e(t){var n,r;return(0,a.A)().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,(0,y.Jt)("".concat(b,"/public/funding-rate"),{instId:t}).catch(function(){return{data:[]}});case 1:return n=e.v,r=n.data,e.a(2,r)}},e)}));return function(t){return e.apply(this,arguments)}}()},{key:"getSummary",value:function(){var e=(0,o.A)((0,a.A)().m(function e(t){var n,r;return(0,a.A)().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,(0,y.Jt)("".concat(b,"/public/opt-summary"),t).catch(function(){return{data:[]}});case 1:return n=e.v,r=n.data,e.a(2,r)}},e)}));return function(t){return e.apply(this,arguments)}}()},{key:"getOpenInt",value:function(){var e=(0,o.A)((0,a.A)().m(function e(t){var n,r;return(0,a.A)().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,(0,y.Jt)("".concat(b,"/public/open-interest"),t).catch(function(){return{data:[]}});case 1:return n=e.v,r=n.data,e.a(2,r)}},e)}));return function(t){return e.apply(this,arguments)}}()},{key:"getEstimatedPrice",value:function(){var e=(0,o.A)((0,a.A)().m(function e(t){var n,r;return(0,a.A)().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,(0,y.Jt)("".concat(b,"/public/estimated-price"),{instId:t}).catch(function(){return{data:[]}});case 1:return n=e.v,r=n.data,e.a(2,r)}},e)}));return function(t){return e.apply(this,arguments)}}()},{key:"getMarginRate",value:function(){var e=(0,o.A)((0,a.A)().m(function e(t){var n,r;return(0,a.A)().w(function(e){for(;;)switch(e.n){case 0:if((0,v.W5)()){e.n=1;break}return e.a(2,[]);case 1:return e.n=2,(0,y.Jt)("".concat(b,"/user/base-quote-rate"),{instId:t}).catch(function(){return{data:[]}});case 2:return n=e.v,r=n.data,e.a(2,r)}},e)}));return function(t){return e.apply(this,arguments)}}()},{key:"getTradeHistory",value:function(){var e=(0,o.A)((0,a.A)().m(function e(t){var n;return(0,a.A)().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,(0,y.Jt)("".concat(b,"/market/trades"),{instId:t});case 1:return(n=e.v).instId=t,e.a(2,n)}},e)}));return function(t){return e.apply(this,arguments)}}()},{key:"getPriceKline",value:function(e){return(0,y.Jt)("".concat(b,"/market/candles"),e)}},{key:"getIndexKline",value:function(e){return(0,y.Jt)("".concat(b,"/market/index-candles"),e)}},{key:"getMarkPriceKline",value:function(e){return(0,y.Jt)("".concat(b,"/market/mark-price-candles"),e)}},{key:"getDepth",value:function(e){return(0,y.Jt)("".concat(b,"/market/books"),e)}},{key:"getAuction",value:function(){var e=(0,o.A)((0,a.A)().m(function e(t){return(0,a.A)().w(function(e){for(;;)if(0===e.n)return e.a(2,(0,y.Jt)("".concat(b,"/market/call-auction-info"),t))},e)}));return function(t){return e.apply(this,arguments)}}()},{key:"getPreDeliveryInfo",value:function(e){return(0,y.Jt)("".concat(b,"/public/pre-delivery-info"),{instId:e})}},{key:"getHotRank",value:function(){var t=(0,o.A)((0,a.A)().m(function t(){var n,r,o,c,u,l,v=arguments;return(0,a.A)().w(function(t){for(;;)switch(t.n){case 0:return n=v.length>0&&void 0!==v[0]?v[0]:{},t.n=1,(0,f.A)((0,y.Jt)("".concat(b,"/rubik/web/public/hot-rank"),(0,s.A)({countryFilter:1},n)));case 1:if(r=t.v,o=(0,i.A)(r,2),c=o[0],u=o[1],l=void 0===u?{}:u,!c){t.n=2;break}return t.a(2,e.EMPTY_RANK);case 2:return t.a(2,(0,d.A)(this,T)[T](l))}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"getUpDownRank",value:function(){var t=(0,o.A)((0,a.A)().m(function t(){var n,o,c,u,l,v,p,h,g,m=arguments;return(0,a.A)().w(function(t){for(;;)switch(t.n){case 0:return o=(n=m.length>0&&void 0!==m[0]?m[0]:{}).zone,c=void 0===o?0:o,u=(0,r.A)(n,A),t.n=1,(0,f.A)((0,y.Jt)("".concat(b,"/rubik/web/public/up-down-rank"),(0,s.A)((0,s.A)({countryFilter:1},u),{},{zone:e.UP_DOWN_TIME_ZONE[c]})));case 1:if(l=t.v,v=(0,i.A)(l,2),p=v[0],h=v[1],g=void 0===h?{}:h,!p){t.n=2;break}return t.a(2,e.EMPTY_RANK);case 2:return t.a(2,(0,d.A)(this,T)[T](g))}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"getFuturesRank",value:function(){var t=(0,o.A)((0,a.A)().m(function t(){var n,o,c,u,l,v,p,h,A,m=arguments;return(0,a.A)().w(function(t){for(;;)switch(t.n){case 0:return o=(n=m.length>0&&void 0!==m[0]?m[0]:{}).zone,c=void 0===o?0:o,u=(0,r.A)(n,g),t.n=1,(0,f.A)((0,y.Jt)("".concat(b,"/rubik/web/futures/ranking"),(0,s.A)((0,s.A)({countryFilter:1,peri
1od:"1D"},u),{},{zone:e.UP_DOWN_TIME_ZONE[c]})));case 1:if(l=t.v,v=(0,i.A)(l,2),p=v[0],h=v[1],A=void 0===h?{}:h,!p){t.n=2;break}return t.a(2,e.EMPTY_RANK);case 2:return t.a(2,(0,d.A)(this,T)[T](A))}},t,this)}));return function(){return t.apply(this,arguments)}}()}])}();I.EMPTY_RANK={data:[],total:0},I.UP_DOWN_TIME_ZONE={0:"utc24",1:"utc0",2:"utc8"};const _=new I},32081:(e,t,n)=>{n.d(t,{A:()=>m});var r=n(64467),i=n(22007),a=n(10467),o=n(89379),s=n(23029),c=n(92901),u=n(4473),d=n(68341),l=n(39455),f=n(63039),v=n(16901),p=n(61992),y=n(79078),h=n(58451),A=n(31385),g=(0,d.A)("mgnModePromise");const m=new(function(){return(0,c.A)(function e(){var t=this;(0,s.A)(this,e),Object.defineProperty(this,g,{writable:!0,value:null}),this.getConfigs=function(){var e=l.Jt(h.pJ)||{},t=e.accountConfig,n=void 0===t?{}:t,r=e.tradeConfig,i=void 0===r?{}:r,a=e.collateralCoinConfig,s=void 0===a?{}:a,c=e.extendedExportFeatureConfig,u=void 0===c?{}:c,d=(0,o.A)((0,o.A)({posMode:y.fr.LONG_SHORT_MODE,ctIsoMode:y.Ih.OPEN,opAuth:y.fs.N,autoLoan:!0,exist:!0,opQuote:!1,riskFlag:"0",vipLoan:!1},n),{},{mgnIsoMode:y.Ih.OPEN,acctLv:(0,v.Ql)()?y.nj.TRADE:y.nj.SINGLE,maxLevel:y.nj.SINGLE,liquidationGear:"-1",portfolioSpotRiskOffset:0,roleType:2,traderInsts:[],spotRoleType:2,spotTraderInsts:[],userFreezeInfo:"",firstTradeTime:'{"margin":0,"spot":0,"perpetual":0,"futures":0,"option":0}',spotFeeCoinType:"-1",rateType:"year",enableLinearOptions:!0}),f=(0,o.A)((0,o.A)({invertTradeUnit:y.iw.CONT,inverseFuturesUnit:y.iw.CONT,linearTradeUnit:y.iw.CONT,confirm:y.cr.Y,depthCountConfirm:y.WB.N,greekUnit:y.j_.BS,navigation:y.vi.COIN,mgnMode:y.FL.CROSS,kLineConfig:"1",tradeAuthConfig:"0",hostingStatus:0,uplPriceType:"0"},i),{},{ccy:y.Nk.BOND}),p=(0,o.A)({enabledFeature:"",existConfig:"",enabledCcyList:[],enabledType:""},s),g=(0,o.A)({orderHistoryExtendedEnabled:"",tradingHistoryExtendedEnabled:""},u);return(0,v.W5)()?(0,A.fe)("/priapi/v5/account/config-trade-info",{needFreshPendingRequirements:!0}).then(function(e){var t=e;return t.tradeConfig.ccy=y.Nk.BOND,t}).catch(function(){return{accountConfig:d,tradeConfig:f,collateralCoinConfig:p,extendedExportFeatureConfig:g,pendingRequirements:[],needRetry:!0}}):{accountConfig:d,tradeConfig:f,collateralCoinConfig:p,extendedExportFeatureConfig:g,pendingRequirements:[]}},this.getCacheConfig=function(){var e=l.Jt(h.WS)||{};return(0,o.A)({mgnMode:y.FL.CROSS,opMgnMode:y.FL.ISOLATED},e)},this.updateTradeConfig=function(e){return(0,v.W5)()?(0,A.bE)("/priapi/v5/account/set-trade-unit",e).catch(A.f6):Promise.resolve()},this.getCurrency=function(){if(v.kU){var e,t,n=((null===(e=(0,v.qX)())||void 0===e||null===(t=e.getPreferenceSync)||void 0===t?void 0:t.call(e))||{}).nowCurrencyUnit,r=void 0===n?y.xW:n;return{nowCurrencyUnit:r,allCurrencyUnit:[r]}}return new Promise(function(e){var t,n,r=null===(t=(0,v.qX)())||void 0===t||null===(n=t.preference)||void 0===n?void 0:n.getUnit;r||e(null),r(e)})},this.getPreference=(0,a.A)((0,i.A)().m(function e(){var t,n,r,a,o,s,c,u,d,l;return(0,i.A)().w(function(e){for(;;)switch(e.n){case 0:if(!v.kU){e.n=1;break}return o=(null===(r=(0,v.qX)())||void 0===r||null===(a=r.getPreferenceSync)||void 0===a?void 0:a.call(r))||{},s=o.chgSetInfo,c=void 0===s?{}:s,u=o.upDownTimeZone,e.a(2,{chgSetInfo:c,upDownTimeZone:u});case 1:if(d=null===(t=(0,v.qX)())||void 0===t||null===(n=t.preference)||void 0===n?void 0:n.get){e.n=2;break}return e.a(2,Promise.resolve(null));case 2:return e.n=3,d();case 3:return l=e.v,e.a(2,l)}},e)})),this.setUpDownTimeZone=function(e){var t,n,r=null===(t=(0,v.qX)())||void 0===t||null===(n=t.preference)||void 0===n?void 0:n.set;return r&&r({upDownTimeZone:e}),(0,v.W5)()?(0,A.bE)("/v3/users/local-config/modify-setting",{type:13,status:e}).catch(A.f6):Promise.resolve()},this.setPositionMode=function(e){return(0,v.W5)()?(0,A.bE)("/priapi/v5/account/set-position-mode",e).catch(A.f6):Promise.resolve()},this.setAutoLoan=function(e){return(0,v.W5)()?(0,A.bE)("/priapi/v5/account/set-auto-loan",e).catch(A.f6):Promise.resolve()},this.setIsoMode=function(e){return(0,A.bE)("/priapi/v5/account/set-isolated-mode",e).catch(A.f6)},this.setSpotOffset=function(e){return(0,A.bE)("/priapi/v5/account/set-spotOffset-type",e).catch(A.f6)},this.getAcctLvList=function(){return(0,A.Jt)("/priapi/v5/public/account-level").then(function(e){return e.data.map(function(e){return e.acctLv})})},this.setMaxLevel=function(e){return(0,A.bE)("/priapi/v5/account/set-max-account-level",e)},this.getTreatyZendesk=function(){return(0,v.Ql)()?(0,A.Jt)("/v3/users/broker/open/derivativeInfo").then(function(e){var t=e.data,n=p.gy.FUTURES,i=p.gy.SWAP,a=p.gy.OPTION;return(0,r.A)((0,r.A)((0,r.A)({},n,null===t||void 0===t?void 0:t.futureProtocol),i,null===t||void 0===t?void 0:t.perpetualProtocol),a,null===t||void 0===t?void 0:t.optionProtocol)}):{MARGIN:(0,f.CZ)("/help/okx-margin-trading-user-agreement"),FUTURES:(0,f.CZ)("/help/okx-futures-trading-user-agreement"),SWAP:(0,f.CZ)("/help//okx-perpetual-swap-trading-user-agreement"),OPTION:(0,f.CZ)("/help/okx-options-trading-user-agreement")}},this.getActiveAndCheckEquity=function(e){return(0,A.bE)("/priapi/v5/account/active-and-check-equity",e).then(function(e){return e.data[0]})},this.getBonusCheck=function(){return(0,A.Jt)("/priapi/v5/account/switch-pre-check").then(function(e){var t,n=e.data;return null===n||void 0===n||null===(t=n[0])||void 0===t?void 0:t.checkResult}).catch(A.f6)},this.getMgnModeConfigs=function(){if(v.kU)return Promise.resolve({instMarginModeConfigs:{},spotCopyInstSwitchConfig:{}});var e=l.Jt(h.WU)||{},n=e.instMarginModeConfigs,r=void 0===n?{}:n,i=e.spotCopyInstSwitchConfig,a=void 0===i?{}:i;return(0,v.W5)()?((0,u.A)(t,g)[g]||((0,u.A)(t,g)[g]=(0,A.fe)("/priapi/v5/account/inst-config-info").then(function(e){return e}).catch(function(){return{instMarginModeConfigs:r,spotCopyInstSwitchConfig:a}})),(0,u.A)(t,g)[g]):Promise.resolve({instMarginModeConfigs:r,spotCopyInstSwitchConfig:a})},this.setInstMgnMode=function(e){return(0,A.bE)("/priapi/v5/account/set-inst-mode",e)},this.setCopyInstMgnMode=function(e){return(0,A.bE)("/priapi/v5/account/set-copyInst-mode",e)},this.getAccountSwitchPreCheck=function(e){return(0,A.bE)("/priapi/v5/account/set-account-switch-precheck",e)},this.presetAccountLevel=function(e){return(0,A.bE)("/priapi/v5/account/account-level-switch-preset",e)},this.setAccountLevel=function(e){return(0,A.bE)("/priapi/v5/account/set-account-level",e)},this.getCollateralAssets=function(){return(0,A.fe)("/priapi/v5/account/collateral-assets")},this.setUsdLinearSettleCcy=function(e){return(0,A.bE)("/priapi/v5/account/set-settle-currency",e)},this.setFeeType=function(e){return(0,v.W5)()?(0,A.bE)("/priapi/v5/account/set-fee-type",e).catch(A.f6):Promise.resolve()},this.setEquityPerpDisclosure=function(e){return(0,A.bE)("/priapi/v5/account/set-equity-perp-disclosure",e)}
1,this.setXStockDisclosure=function(e){return(0,A.bE)("/priapi/v5/account/set-xstock-disclosure",e)},this.setDisclaimer=function(e){return(0,A.bE)("/priapi/v5/account/set-disclaimer",e)}},[{key:"getTradeAuth",value:function(e){return(0,A.fe)("/priapi/v5/account/query-trade-auth",e)}},{key:"getNewbieGuideInfo",value:function(){return(0,A.fe)("/priapi/v5/rubik/newbie/guide-info")}},{key:"updateNewbieState",value:function(e){var t=e.type;return(0,A.bE)("/priapi/v5/rubik/newbie/upload-state?type=".concat(t))}},{key:"getAcctKycVerify",value:function(){return(0,A.bE)("/priapi/v5/account/kyc-verify")}}])}())},13587:(e,t,n)=>{n.d(t,{A:()=>m});var r=n(89379),i=n(22007),a=n(10467),o=n(23029),s=n(92901),c=n(4473),u=n(68341),d=n(57022),l=n(16901),f=n(61992),v=n(31385),p=f.gy.CEDEFI,y=(0,u.A)("chainGroupPromise"),h=(0,u.A)("categoriesDetailCache"),A=(0,u.A)("searchDegradeConfigPromise"),g=(0,u.A)("formatCategoriesDetail");const m=new(function(){return(0,s.A)(function e(){var t=this;(0,o.A)(this,e),Object.defineProperty(this,y,{writable:!0,value:null}),Object.defineProperty(this,h,{writable:!0,value:{}}),Object.defineProperty(this,A,{writable:!0,value:null}),this.formatTradeGroup=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map(function(e){var t=e.code,n=e.type,r=e.message,i=e.isNew,a=e.showInMarketNav,o=void 0===a||a,s=e.showInL1,c=e.showInCoinL2,u=void 0===c||c;return{code:t,value:"".concat(String(n||t)).replaceAll(" ","").toUpperCase(),label:r||n,isNew:i,showInMarketNav:o,showInL1:s,showInCoinL2:u}})},this.getCategoriesDetail=function(e){var n=(e||{}).categoryId;if(!l.kU&&(0,c.A)(t,h)[h][n])return(0,c.A)(t,h)[h][n];var r=(0,v.Jt)("/priapi/v5/rubik/discover2/categories-detail",e).then((0,c.A)(t,g)[g]).catch(function(){return{}});return!l.kU&&n&&((0,c.A)(t,h)[h][n]=r),r},Object.defineProperty(this,g,{writable:!0,value:function(e){var t=e.data;if(!l.kU)return t||{};var n=t||{},r=n.categoryName,i=n.categoryDesc,a=n.marketCap||{},o=n.volume24h||{};return{categoryName:r,categoryDesc:i,totalMentions:n.totalMentions,changePercent:n.changePercent,marketCap:{changePercent:a.changePercent,volume:a.volume},volume24h:{changePercent:o.changePercent,volume:o.volume}}}}),this.getChainGroup=(0,a.A)((0,i.A)().m(function e(){var n;return(0,i.A)().w(function(e){for(;;)switch(e.n){case 0:if(!(0,c.A)(t,y)[y]){e.n=1;break}return e.a(2,(0,c.A)(t,y)[y]);case 1:return n=(0,v.Jt)("".concat(d.x0,"/rubik/dex/rank/tab-list")).then(function(e){return e.data}).catch(function(){return[]}),l.kU||((0,c.A)(t,y)[y]=n),e.a(2,n)}},e)})),this.getCedefiList=(0,a.A)((0,i.A)().m(function e(){var n,r=arguments;return(0,i.A)().w(function(e){for(;;)if(0===e.n)return n=r.length>0&&void 0!==r[0]?r[0]:{},e.a(2,(0,v.Jt)("".concat(d.x0,"/rubik/dex/rank"),n).then(function(e){var n=e.data;return t.formatCedefiList(n)||[]}).catch(function(){return[]}))},e)})),this.getCedefiListByKeyword=function(){var e=(0,a.A)((0,i.A)().m(function e(n){return(0,i.A)().w(function(e){for(;;)switch(e.n){case 0:if(n){e.n=1;break}return e.a(2,[]);case 1:return e.a(2,(0,v.Jt)("".concat(d.x0,"/rubik/search/cedefi"),{key:n}).then(function(e){var n=e.data;return t.formatCedefiList(n)||[]}).catch(function(){return[]}))}},e)}));return function(t){return e.apply(this,arguments)}}(),this.getCedefiDetails=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.length?(0,v.bE)("/priapi/v5/rubik/dex/details",e).then(function(e){var n=e.data;return t.formatCedefiList(n)||[]}).catch(function(){return[]}):Promise.resolve([])},this.getCedefiTokenKey=function(e){var t=e||{},n=t.chainId,r=t.tokenContractAddress;return n&&r?"".concat(n,"-").concat(r):""},this.formatCedefiList=function(e){return(e||[]).map(function(e){var n=t.formatCedefiTicker(e),i=t.getCedefiTokenKey(e);return(0,r.A)((0,r.A)({},e),{},{instType:p,bizType:p,instId:i},n)})},this.formatCedefiTicker=function(e){var t=e.price,n=e.marketCap,r=e.liquidity,i=void 0===r?"":r,a=e.change,o=e.changeUtc0,s=e.changeUtc8,c=e.volume,u=e.priceChange,d=e.priceChangeUtc0,l=e.priceChangeUtc8,f=e.turnOver,v=e.last,p=e.turnover;return{last:t||v,marketValue:n,change:u||a,changeUtc0:d||o,changeUtc8:l||s,turnover:f||p||c,liquidity:i}}
1,this.getSearchDegradeConfig=function(){return(0,l.W5)()&&1===(0,l.t_)()?((0,c.A)(t,A)[A]||((0,c.A)(t,A)[A]=(0,v.Jt)("".concat(d.x0,"/rubik/user/base-config/get")).then(function(e){var t=e.data;return Boolean(null===t||void 0===t?void 0:t.searchTryDowngrade)}).catch(function(){return(0,c.A)(t,A)[A]=null,!1})),(0,c.A)(t,A)[A]):Promise.resolve(!1)}},[{key:"getTradeGroup",value:function(){var e=this;return(0,v.Jt)("/v2/asset/currency-classification",{targetId:18}).then(function(t){var n=t.data;return e.formatTradeGroup(n)}).catch(function(){return[]})}}])}())},80460:(e,t,n)=>{n.d(t,{AC:()=>v,Fw:()=>l,Mt:()=>h,O$:()=>y,Oo:()=>f,We:()=>p});var r=n(61992),i=n(79754),a=n(93794),o=n(92675),s=r.gy.SWAP,c=r.gy.FUTURES,u=r.gy.OPTION,d=r.pn.INVERSE;function l(e,t){var n,i,a;return!(null===(n=e.coins)||void 0===n||null===(i=n[t])||void 0===i||null===(a=i.groups)||void 0===a||!a.some(function(e){return String(e)===String(r.k8)}))}function f(e){return e.instStore||i.A}function v(e){return e.settingStore||a.A}function p(e){var t=f(e);return t._existSimple(e)?t.simpleInsts:t.insts}function y(e){var t=e.instType,n=e.instId,r=e.ctVal,i=e.ctMult,a=e.ctType;if([s,c,u].includes(t)){var o=p(e);if(a||(a=o[t][n].ctType),!r&&!i){var d=o[t][n];r=d.ctVal,i=d.ctMult}}return{ctVal:r,ctMult:i,ctType:a}}function h(e){var t=e.instType,n=e.instId,r=void 0===n?"":n,i=e.ctType,a=e.useStableRate,l=v(e);return a||[c,s,u].includes(t)&&(i||(0,o.ji)(r).ctType)===d?l.rate:l.premiumRate}},32719:(e,t,n)=>{n.d(t,{Bg:()=>p,uu:()=>v});var r=n(89379),i=n(61992),a=n(29305),o=n(46431),s=n(49819),c=n(95524),u=n(92675),d=n(80460);a.v8.H_24,a.v8.UTC_0,a.v8.UTC_8,i.gy.COIN,i.e$.USD;function l(e){var t=e.isOption,n=e.isLinear,r=e.baseCcy,i=e.quoteCcy,a=e.isLocal,s=e.usdPrice;if(!a||s)return s;var c=t&&!n?r:i;return o.A.usdPrices[c]}function f(e,t){var n=e.instType,i=e.instId,a=e.price,o=e.isLocal;if(!(0,c.Et)(a))return"--";var s=(0,d.Oo)(e).configs,f=(0,u.ji)(i,n),v=f.baseCcy,p=f.quoteCcy,y=f.ctType,h=f.isLinear,A=s[n][i],g=A.priceDig,m=A.ccyName,b=A.ccySign,T=(0,u.Cs)(n),C=T.isCoin,I=T.isSpotOrMargin,_=T.isOption,E=T.isEvents,k=l({isOption:_,isLinear:h,baseCcy:v,quoteCcy:p,isLocal:o,usdPrice:e.usdPrice}),S=(0,d.AC)(e),w=(0,d.Mt)({settingStore:S,useStableRate:!0});if(C||(I||_||E)&&o){var P=S.currencyUnit;g=P.precision,m=P.isoCode,b=P.symbol,w=(0,d.Mt)({settingStore:S,instType:n,useStableRate:_})}return t((0,r.A)({ctType:y,ccyName:m,ccySign:b,usdPrice:k,rate:w,digit:g},e))}function v(e){return f(e,s.d1)}function p(e){var t=(0,d.AC)(e).upDownTimeZone;return(0,s.zS)(e,t)}},36055:(e,t,n)=>{n.d(t,{CK:()=>p,Mt:()=>A,Xu:()=>v,ks:()=>h,qQ:()=>y});var r=n(93989),i=n(63039),a=n(20615),o=n(16901),s=n(61992),c=n(79078),u=n(92675),d=n(80460),l=(s.gy.FUTURES,s.gy.SPOT),f=(s.gy.MARGIN,"/kyc");function v(e){var t=e.instType,n=e.instId;return(0,u.gk)({instType:t,instId:n})}function p(e){var t=e.instType,n=e.instId;return(0,u.dF)({instType:t,instId:n})}function y(e){var t=e.instId,n=(0,d.Oo)(e),r=(0,u.ji)(t).baseCcy;return(0,d.Fw)(n,r)}function h(e){var t,n=e.instType,r=e.instId,i=e.useBorrowLever,a=void 0!==i&&i,s=(null===(t=(0,d.We)(e)[n])||void 0===t?void 0:t[r])||{},c=s.lever,u=void 0===c?"":c,l=s.coinLever,f=void 0===l?"":l,v=s.groupId2Lever,p=void 0===v?{}:v,y=(0,d.AC)(e),h=y.isSingleAccount,A=y.accountConfig,g=a?u||(h?"":f):u;return(0,o.W5)()&&p[(null===A||void 0===A?void 0:A.groupId)||""]||g}function A(e){var t,n,v,p;if(!(0,o.W5)())return"";var y=e.instType,h=e.instId,A=void 0===h?"":h,g=e.redirect,m=e.checkInst,b=void 0===m||m,T=e.checkPendingQuestionnaire,C=void 0===T||T,I=(0,u.Cs)(y).isDerivative;if(!(0,o.yr)())return I&&(0,o._3)()?(0,r.YW)((0,i.CZ)("/kyc/derivatives/overview?feat=hideDerivativesSurveyEntry")):"";var _=c.hm[y];if(!_)return"";if(b&&y===l&&(null===(t=(0,d.Oo)(e))||void 0===t||null===(n=t.insts)||void 0===n||null===(v=n[y])||void 0===v||null===(p=v[A])||void 0===p?void 0:p.instCategory)!==s.V7.STOCK)return"";if(C){var E=((0,d.AC)(e)||{}).questionnaire;if(!!!(void 0===E?{}:E)[_.code])return""}var k=new a.A;return k.set(c.Dt.FEATURE,_.feature),g&&k.set(c.Dt.EXIT,encodeURIComponent(JSON.stringify({businessExitTarget:g}))),(0,r.YW)((0,i.CZ)("".concat(f,"?").concat(k.stringify())))}}
1,7972:(e,t,n)=>{n.d(t,{A:()=>h});var r=n(89379),i=n(64467),a=n(80045),o=n(19919),s=(n(41594),n(1744)),c=n.n(s),u=n(41140),d=n(61964),l=(n(58704),n(16901)),f=n(79754),v=n(92675);const p="index_logo__OATBi";var y=["ccy","className","pictureClassName","src"];const h=(0,u.observer)(function(e){var t,n,s=e.ccy,u=void 0===s?"":s,h=e.className,A=e.pictureClassName,g=e.src,m=void 0===g?"":g,b=(0,a.A)(e,y),T=(0,v.ji)(u).baseCcy.toLowerCase(),C="".concat((0,l.ox)(),"/cdn/oksupport/asset/currency/icon/").concat(T,".png"),I=m||(null===(t=f.A.coins)||void 0===t||null===(n=t[T.toUpperCase()])||void 0===n?void 0:n.url)||C||"",_=c()(p,"tc-ccy-img-box",h),E=h||p,k=c()(A,(0,i.A)({},E,!I));return(0,o.jsx)(d.A,(0,r.A)({lazyload:!0,alt:T,"aria-hidden":!0,src:I,errorImg:"".concat((0,l.ox)(),"/cdn/assets/imgs/207/2E664E470103C613.png"),className:_,pictureClassName:k,placeholder:(0,o.jsx)("div",{className:_})},b))})},95:(e,t,n)=>{n.d(t,{A:()=>N});var r=n(64467),i=n(19919),a=(n(41594),n(48257)),o=n(1744),s=n.n(o),c=n(41140),u=n(29092),d=n(61964),l=n(97373),f=(n(58704),n(99559),n(81696),n(16901)),v=n(61992),p=n(36055),y=n(79754),h=n(90241),A=n(15586);const g="index_banner__NOf6H",m="index_img__sJQ9X",b="index_content__bAa5L",T="index_title__1wspe",C="index_desc__esWvC",I="index_arrow__rTMY6";var _=v.gy.FUTURES,E=v.gy.FUTURES_SWAP,k=v.gy.OPTION,S=v.gy.SPOT,w=E,P=(0,r.A)((0,r.A)((0,r.A)({},E,{checkBlock:f.uS,instType:_,getRedirect:function(){var e;return null!==(e=y.A.supportType)&&void 0!==e&&e.swap?"/trade-swap":"/trade-futures"},titleKey:"ct_general_btn_unlock_derivatives",descKey:"ct_general_title_50x_leverage_access"}),k,{checkBlock:f.Ji,instType:k,getRedirect:function(){return"/trade-option"},titleKey:"web_general_btn_unlock_options_1",descKey:"web_spreads_title_trade_calls_puts"}),S,{checkBlock:f.yq,instType:S,getRedirect:function(){return"/trade-spot"}
1,titleKey:"web_general_btn_unlock_stocks",descKey:"web_landing_title_top_stocks_etfs"});const N=(0,c.observer)(function(e){var t=e.checkInst,n=e.className,r=e.isDark,o=e.redirect,c=e.tabType,v=void 0===c?w:c,y=(0,f.ox)(),_=(null!==r&&void 0!==r?r:(0,a.j1)()===a.zG.dark)?"/cdn/assets/imgs/729/1F7034F265044A7BA52DE790C6B9E511.png":"/cdn/assets/imgs/414/41BC4822B51548A9B8C6E12297F5F987.png",E=P[v]||P[w],k=E.checkBlock,S=E.instType,N=E.getRedirect,O=E.titleKey,R=E.descKey,U=k(),D=(0,p.Mt)({instType:S,redirect:o||N(),checkInst:null!==t&&void 0!==t?t:!U,checkPendingQuestionnaire:!U});return(0,i.jsx)(A.A,{when:D,children:(0,i.jsxs)(u.A,{className:s()(g,n),href:D,children:[(0,i.jsx)(d.A,{className:m,src:"".concat(y).concat(_),alt:"",width:48,height:48}),(0,i.jsxs)("div",{className:b,children:[(0,i.jsx)("div",{className:T,children:(0,h.s3)(O)}),(0,i.jsx)("div",{className:C,children:(0,h.s3)(R)})]}),(0,i.jsx)(l.A,{className:"okds-arrow-chevron-right-centered-sm ".concat(I)})]})})})},43633:(e,t,n)=>{n.d(t,{E:()=>v,Q3:()=>p});var r=n(64467),i=n(89379),a=n(22007),o=n(10467),s=n(44497),c=n(40401),u=n(21162),d={DOING:1,CACHE:2,DONE:3},l="_api_mark";function f(e,t){var n=e.target,r=e.property,c=t.request,f=t.key,v=t.isProperty,p=t.haveData,y=n,h=u.A.TABLE.LAZY_REQUEST,A="".concat(r).concat(l);if(!(y[A]||p&&p(y[r]))){Object.defineProperty(y,A,{value:d.DOING,writable:!0});var g,m=0;!function(){b.apply(this,arguments)}(),T()}function b(){return(b=(0,o.A)((0,a.A)().m(function e(){var t;return(0,a.A)().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,u.A.getData({table:h,key:f});case 1:return g=e.v,e.n=2,g;case 2:if((t=e.v)&&y[A]!==d.DONE){e.n=3;break}return e.a(2);case 3:(0,s.runInAction)(function(){y[r]=t}),y[A]=d.CACHE;case 4:return e.a(2)}},e)}))).apply(this,arguments)}function T(){return C.apply(this,arguments)}function C(){return(C=(0,o.A)((0,a.A)().m(function e(){var t;return(0,a.A)().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,c({property:r});case 1:return t=e.v,(0,s.runInAction)(function(){y[r]=t}),y[A]=d.DONE,e.n=2,g;case 2:u.A.setData({table:h,key:f,data:v?(0,i.A)({},y):t}),null!==t&&void 0!==t&&t.needRetry&&m<3&&(m++,setTimeout(T,3e3*m));case 3:return e.a(2)}},e)}))).apply(this,arguments)}}function v(e,t){if(!(0,c.f)()){var n=e;Object.keys(t).forEach(function(e){var i=t[e];if(i.isProperty){var a=(0,s.observable)(n[e],{},{deep:!1});n[e]=new Proxy(a,{get:function(t,r,a){return"string"!==typeof r||r.includes(l)||f({target:n[e],property:r},i),Reflect.get(t,r,a)}})}else{(0,s.makeObservable)(n,(0,r.A)({},e,i.observable||s.observable.ref));var o=(0,s.onBecomeObserved)(n,e,function(){f({target:n,property:e},i),o()})}})}}function p(e){return e&&Object.keys(e).length>0}},27727:(e,t,n)=>{n.d(t,{A:()=>i});var r=n(16901);function i(e,t){if(r.kU)return new t;var n=window;return null===n||void 0===n||n.__mobxInstanceCount,new t}},21162:(e,t,n)=>{n.d(t,{A:()=>m});var r=n(22007),i=n(3453),a=n(10467),o=n(92901),s=n(23029),c=n(4473),u=n(68341),d=n(64467),l=n(56511),f=n(91947),v=n(40401),p=n(16901),y={INST_CONFIGS:"inst_configs",INST_PRODUCTS:"inst_products",LAZY_REQUEST:"lazy_request"},h={DESCRIPTION:"description"},A=(0,d.A)((0,d.A)((0,d.A)({},y.INST_CONFIGS,{isLocale:!1}),y.INST_PRODUCTS,{isLocale:!1}),y.LAZY_REQUEST,(0,d.A)({},h.DESCRIPTION,{isLocale:!0})),g=(0,u.A)("disableDB");const m=new((0,o.A)(function e(){var t=this;(0,s.A)(this,e),this.db=new l.Ay("TRADE_COMMON"),this.TABLE=y,this.LAZY_REQUEST_KEY=h,this.getData=function(){var e=(0,a.A)((0,r.A)().m(function e(n){var a,o,s,u,d,l,v,y,h,m,b,T,C,I,_,E;return(0,r.A)().w(function(e){for(;;)switch(e.n){case 0:if(o=n.table,s=n.key,!(0,c.A)(t,g)[g]({table:o,key:s})){e.n=1;break}return e.a(2,void 0);case 1:return u=t.db.openStore(o,{keyPath:"key"}),e.n=2,(0,f.A)(u);case 2:if(d=e.v,l=(0,i.A)(d,2),v=l[0],y=l[1],!v){e.n=3;break}return e.a(2,void 0);case 3:return e.n=4,(0,f.A)(y.get(s));case 4:if(h=e.v,m=(0,i.A)(h,2),b=m[0],T=m[1],C=void 0===T?{}:T,!b){e.n=5;break}return e.a(2,void 0);case 5:if(I=C.expires,_=C.data,E=C.locale,!(Date.now()>I||(A[o].isLocale||null!==(a=A[o][s])&&void 0!==a&&a.isLocale)&&E!==(0,p.JK)())){e.n=6;break}return e.a(2,void 0);case 6:return e.a(2,_)}},e)}));return function(t){return e.apply(this,arguments)}}(),this.setData=function(){var e=(0,a.A)((0,r.A)().m(function e(n){var a,o,s,u,d,l,v,y,h;return(0,r.A)().w(function(e){for(;;)switch(e.n){case 0:if(a=n.table,o=n.key,s=n.data,!(0,c.A)(t,g)[g]({table:a,key:o})){e.n=1;break}return e.a(2);case 1:return u=t.db.openStore(a,{keyPath:"key"}),e.n=2,(0,f.A)(u);case 2:if(d=e.v,l=(0,i.A)(d,2),v=l[0],y=l[1],!v){e.n=3;break}return e.a(2);case 3:h=Date.now()+12096e5,(0,f.A)(y.set({key:o,data:s,expires:h,locale:(0,p.JK)()}));case 4:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),Object.defineProperty(this,g,{writable:!0,value:function(e){var n=e.table,r=e.key;return(0,p.Zp)()||(0,v.f)()||!A[n]||n===t.TABLE.LAZY_REQUEST&&!A[n][r]}})}))},52821:(e,t,n)=>{n.d(t,{A:()=>C});var r=n(89379),i=n(22007),a=n(10467),o=n(92901),s=n(23029),c=n(44497),u=n(61992),d=n(99546),l=n(92675),f=n(55903),v=n(43633),p=n(27727),y=n(93794),h=n(14812),A=n(79754),g=u.gy.SPOT,m=u.e$.USDT;function b(e,t){var n,r=t.instFamily,i=t.isFutures,a=t.alias,o=t.uly,s=t.isFuturesOrSwap,c=t.isEvents,u=t.seriesId;if(c&&u)return(null===(n=e.seriesId)||void 0===n?void 0:n.toUpperCase())===u;if(r){var d=e.instFamily===r;return i&&a?d&&e.alias===a:d}return o?e.uly===o:!!s&&e.quoteCcy===m}var T=(0,o.A)(function e(){var t=this,n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).root,o=void 0===n?{}:n;(0,s.A)(this,e),this.getCoins=(0,a.A)((0,i.A)().m(function e(){var n,r;return(0,i.A)().w(function(e){for(;;)switch(e.n){case 0:if(n=t.root.instStore,!(0,v.Q3)(n.coins)){e.n=1;break}return e.a(2,n.coins);case 1:return e.n=2,d.A.getCoins();case 2:return r=e.v,(0,c.runInAction)(function(){n.coins=r}),e.a(2,n.coins)}},e)})),this.getBlackCcys=(0,a.A)((0,i.A)().m(function e(){var n,r;return(0,i.A)().w(function(e){for(;;)switch(e.n){case 0:if(n=t.root.instStore,!(0,v.Q3)(n.blackCcys)){e.n=1;break}return e.a(2,n.blackCcys);case 1:return e.n=2,d.A.getBlackCcys();case 2:return r=e.v,(0,c.runInAction)(function(){n.blackCcys=r}),e.a(2,n.blackCcys)}},e)})),this.getInstGroup=(0,a.A)((0,i.A)().m(function e(){var n,r;return(0,i.A)().w(function(e){for(;;)switch(e.n){case 0:if(n=t.root.instStore,!(0,v.Q3)(n.instGroup)){e.
1n=1;break}return e.a(2,n.instGroup);case 1:return e.n=2,d.A.getInstGroup();case 2:return r=e.v,(0,c.runInAction)(function(){n.instGroup=r}),e.a(2,n.instGroup)}},e)})),this.getInstTypes=(0,a.A)((0,i.A)().m(function e(){return(0,i.A)().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,t.getInstGroup();case 1:return e.a(2,t.root.instStore.instTypes)}},e)})),this.getQuoteTypes=(0,a.A)((0,i.A)().m(function e(){return(0,i.A)().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,t.getInstGroup();case 1:return e.a(2,t.root.instStore.quoteTypes)}},e)})),this.getMarginTypes=(0,a.A)((0,i.A)().m(function e(){return(0,i.A)().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,t.getInstGroup();case 1:return e.a(2,t.root.instStore.marginTypes)}},e)})),this.getAllSimpleProduct=(0,a.A)((0,i.A)().m(function e(){var n;return(0,i.A)().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,t.getInstTypes();case 1:return n=e.v,e.a(2,t.root.instProxy.getAllSimpleProduct(n))}},e)})),this.getSimpleProduct=function(e){return t.root.instProxy.getSimpleProduct(e)},this.getSimpleProducts=function(){var e=(0,a.A)((0,i.A)().m(function e(n){var a;return(0,i.A)().w(function(e){for(;;)switch(e.n){case 0:if(a=null===n||void 0===n?void 0:n.instTypes){e.n=2;break}return e.n=1,t.getInstTypes();case 1:a=e.v;case 2:return e.a(2,t.root.instProxy.getSimpleProducts((0,r.A)((0,r.A)({},n),{},{instTypes:a})))}},e)}));return function(t){return e.apply(this,arguments)}}(),this.getDexToken=function(){var e=(0,a.A)((0,i.A)().m(function e(t){return(0,i.A)().w(function(e){for(;;)if(0===e.n)return e.a(2,d.A.getDexToken(t))},e)}));return function(t){return e.apply(this,arguments)}}(),this.getInst=function(e){return t.root.instProxy.getInst(e)},this.getInsts=function(e){return t.root.instProxy.getInsts(e)},this.getConfig=function(e){return t.root.instProxy.getConfig(e)},this.getConfigs=function(e){return t.root.instProxy.getConfigs(e)},this.updateInst=function(e){return t.root.instProxy.updateInst(e)},this.setInst=function(){var e=(0,a.A)((0,i.A)().m(function e(n){var r,a,o,s,d,l,f;return(0,i.A)().w(function(e){for(;;)switch(e.n){case 0:if(r=t.root.instStore,n.bizType!==u.gy.CEDEFI){e.n=2;break}return e.n=1,t.getValidDexToken(n);case 1:if(a=e.v,o=a.tokenContractAddress,s=a.chainShortName,!o||!s){e.n=2;break}return(0,c.runInAction)(function(){r.bizType=u.gy.CEDEFI,r.chainShortName=s,r.tokenContractAddress=o}),e.a(2,!0);case 2:return e.n=3,t.getValidInst(n);case 3:if(d=e.v,l=d.instType,f=d.instId,l&&f){e.n=4;break}return e.a(2,!1);case 4:return(0,c.runInAction)(function(){r.bizType=u.gy.CEX,r.instType=l,r.instId=f}),t.getInst({instType:l,instId:f}),t.getConfig({instType:l,instId:f}),e.a(2,!0)}},e)}));return function(t){return e.apply(this,arguments)}}(),this.getValidDexToken=(0,a.A)((0,i.A)().m(function e(){var n,r,a,o,s,c,u,f,v,p,y,h=arguments;return(0,i.A)().w(function(e){for(;;)switch(e.n){case 0:if(s=(o=h.length>0&&void 0!==h[0]?h[0]:{}).chainShortName,c=o.tokenContractAddress,u=o.verifyDex,f=void 0===u||u,v=o.chainId||(0,l.sY)(s),f||!v||!c){e.n=1;break}return e.a(2,{chainId:v,tokenContractAddress:c,chainShortName:s});case 1:return e.n=2,t.getDexToken({chainId:v,tokenContractAddress:c});case 2:if(p=e.v){e.n=4;break}return e.n=3,d.A.getDexTokens();case 3:y=e.v,p=y[0];case 4:return e.a(2,{chainId:(null===(n=p)||void 0===n?void 0:n.chainId)||"",tokenContractAddress:(null===(r=p)||void 0===r?void 0:r.tokenContractAddress)||"",chainShortName:(0,l.KU)(null===(a=p)||void 0===a?void 0:a.chainId)})}},e)})),this.getValidInst=(0,a.A)((0,i.A)().m(function e(){var n,r,a,o,s,c,u,d,v,p,y,h,A,m,T,C,I,_,E,k,S,w,P,N,O,R,U,D,L,M,x,F,j,B,G=arguments;return(0,i.A)().w(function(e){for(;;)switch(e.n){case 0:return r=(n=G.length>0&&void 0!==G[0]?G[0]:{}).instType,a=void 0===r?"":r,o=n.instId,s=void 0===o?"":o,c=n.seriesId,u=void 0===c?"":c,d=n.instFamily,v=void 0===d?"":d,p=n.uly,y=void 0===p?"":p,h=n.alias,A=n.validId,m=n.verifyBlack,T=n.verifyInst,C=n.keepExpiredEvent,I=void 0===C||C,_=a.toUpperCase()||g,E=s.toUpperCase(),k=u.toUpperCase(),S=v.toUpperCase(),w=y.toUpperCase(),e.n=1,t.verifyInstId({instType:_,instId:E,verifyBlack:m,verifyInst:T});case 1:if(!e.v){e.n=2;break}return e.a(2,{instType:_,instId:E,validId:A});case 2:if(P=(0,l.Cs)(_),N=P.isEvents,!(I&&N&&E)){e.n=4;break}return e.n=3,t.getInst({instType:_,instId:E});case 3:if(null===(O=e.v)||void 0===O||!O.instId){e.n=4;break}return e.a(2,{instType:_,instId:O.instId,validId:A});case 4:return e.n=5,Promise.all([t.getSimpleProduct(_),t.getBlackCcys()]);case 5:return R=(0,l.Cs)(_),U=R.isFutures,D=R.isFuturesOrSwap,L=t.root.instStore,M=L.simpleTypes,x=L.blackCcys,F=M[_],j=(0,f.Q)({insts:F,blackCcys:x,isSearch:!0,filterNewCoins:!1,filterPreMarket:!1}),B=j.find(function(e){return b(e,{instFamily:S,isFutures:U,alias:h,uly:w,isFuturesOrSwap:D,isEvents:N,seriesId:k})})||j[0],e.a(2,{instType:_,instId:(null===B||void 0===B?void 0:B.instId)||"",validId:A})}},e)})),this.verifyInstType=function(){var e=(0,a.A)((0,i.A)().m(function e(n){var r,a;return(0,i.A)().w(function(e){for(;;)switch(e.n){case 0:return r=n.instType,e.n=1,t.getInstTypes();case 1:return a=e.v,e.a(2,a.includes(r))}},e)}));return function(t){return e.apply(this,arguments)}}(),this.verifyInstId=function(){var e=(0,a.A)((0,i.A)().m(function e(n){var r,a,o,s,c,d,f,v,p,y,h,A,g;return(0,i.A)().w(function(e){for(;;
1)switch(e.n){case 0:if(a=n.instType,o=n.instId,s=n.verifyBlack,c=void 0===s||s,d=n.verifyInst,f=void 0===d||d,a&&o){e.n=1;break}return e.a(2,!1);case 1:return v=[],(c||f)&&v.push(t.getSimpleProduct(a)),c&&v.push(t.getBlackCcys()),e.n=2,Promise.all(v);case 2:return p=t.root.instStore,y=p.simpleInsts,h=p.blackCcys,A=(0,l.ji)(o,a),g=A.baseCcy,e.a(2,(!f||!!y[a][o].instId)&&(!c||!(null!==(r=h[g])&&void 0!==r&&r.searchLimit)||y[a][o].isoFlag===u.hG.NO))}},e)}));return function(t){return e.apply(this,arguments)}}(),this.root=(0,r.A)({instProxy:h.A,instStore:A.A,settingStore:y.A},o)});const C=(0,p.A)("instAction",T)},14812:(e,t,n)=>{n.d(t,{A:()=>ae});var r=n(3453),i=n(64467),a=n(60436),o=n(89379),s=n(80045),c=n(22007),u=n(10467),d=n(92901),l=n(23029),f=n(4473),v=n(68341),p=n(44497),y=n(61992);const h=new((0,d.A)(function e(){(0,l.A)(this,e),this.setting={initConfig:!1,initCurrency:!1,initPreference:!1},this.inst={initInstTypes:!1,initMarginTypes:!1,initBlackCcys:!1,initQuoteTypes:!1,initCoins:!1,disableDefaultDecimal:!1,config:y.PI},this.i18nKey={all:"",favorite:"",coin:"",spot:"",margin:"",futures:"",swap:"",option:"",unitCont:""}}));var A=n(16901),g=n(79078),m=n(99546),b=n(90241),T=n(52918),C=n(92675),I=n(27727),_=n(21162),E=["instType","instId"],k=_.A.TABLE,S=k.INST_CONFIGS,w=k.INST_PRODUCTS,P=y.gy.SPOT,N=y.gy.MARGIN,O=y.gy.FUTURES,R=y.gy.SWAP,U=y.gy.OPTION,D=y.gy.EVENTS,L=y.e$.USD,M=y.e$.USDC,x=g.iw.BASE,F=g.iw.CONT,j=g.iw.LOT,B="ANY",G=(0,v.A)("requestDelayTime"),W=(0,v.A)("errorDelayTime"),q=(0,v.A)("pendingSettledEvents"),K=(0,v.A)("refreshProduct"),z=(0,v.A)("refreshInstOrConfig"),H=(0,v.A)("asyncSet"),V=(0,v.A)("syncSet"),J=(0,v.A)("setData"),Y=(0,v.A)("setCache"),Z=(0,v.A)("getCache"),Q=(0,v.A)("getTargetParams"),X=(0,v.A)("setRecord"),$=(0,v.A)("deleteRecord"),ee=(0,v.A)("instTypeProxy"),te=(0,v.A)("configDisplayBaseCcy"),ne=(0,v.A)("getConfigKey"),re=(0,v.A)("getSizeUnit"),ie=(0,d.A)(function e(){var t=this;(0,l.A)(this,e),Object.defineProperty(this,G,{writable:!0,value:50}),Object.defineProperty(this,W,{writable:!0,value:15e3}),Object.defineProperty(this,q,{writable:!0,value:new Set}),this.linearTradeUnit=F,this.invertTradeUnit=F,this.inverseFuturesUnit=F,this.tradeFiTradeUnit=x,this.tradFiCoins=p.observable.set(),this.usdLinearSettleCcy=M,this.currencyName=L,this.getAllSimpleProduct=function(){var e=(0,u.A)((0,c.A)().m(function e(n){var r;return(0,c.A)().w(function(e){for(;;)switch(e.n){case 0:return r=n.map(t.getSimpleProduct),e.n=1,Promise.all(r);case 1:return e.a(2,{simpleInsts:t.productParams.data.simpleInsts,simpleTypes:t.productParams.data.simpleTypes})}},e)}));return function(t){return e.apply(this,arguments)}}(),this.getSimpleProduct=function(){var e=(0,u.A)((0,c.A)().m(function e(n){var r,i,a,o,s,u,d,l;return(0,c.A)().w(function(e){for(;;)switch(e.n){case 0:if(r={simpleInsts:{},simpleTypes:[]},y.Z3.includes(n)){e.n=1;break}return e.a(2,r);case 1:if(i=t.productParams,a=i.record,o=i.cache,s=i.data,u=i.timeout,!a[n]){e.n=2;break}return e.a(2,a[n]);case 2:return clearTimeout(u[n]),a[n]=m.A.getSimpleProduct(n),e.n=3,a[n];case 3:if(d=e.v,l=d.simpleInsts,!d.error){e.n=4;break}return u[n]=setTimeout(function(){delete a[n]},(0,f.A)(t,W)[W]),e.a(2,r);case 4:return n===D&&(0,f.A)(t,q)[q].size>0&&(0,f.A)(t,q)[q].forEach(function(e){e in l?delete l[e]:(0,f.A)(t,q)[q].delete(e)}),o.simpleInsts[n]=l,(0,f.A)(t,K)[K]({instTypes:[n]}),e.a(2,{simpleInsts:s.simpleInsts[n],simpleTypes:s.simpleTypes[n]})}},e)}));return function(t){return e.apply(this,arguments)}}(),this.getSimpleProducts=function(){var e=(0,u.A)((0,c.A)().m(function e(n){var r,i,a,o,s,u;return(0,c.A)().w(function(e){for(;;)switch(e.n){case 0:return r=n.instTypes,i=n.useCache,a=void 0===i||i,o=r.map(function(e){return a||delete t.productParams.record[e],t.getSimpleProduct(e)}),e.n=1,Promise.all(o);case 1:return s=t.productParams.data,u={simpleInsts:{},simpleTypes:{}},r.forEach(function(e){u.simpleInsts[e]=s.simpleInsts[e],u.simpleTypes[e]=s.simpleTypes[e]}),e.a(2,u)}},e)}));return function(t){return e.apply(this,arguments)}}(),this.updateSimpleProduct=function(){var e=(0,u.A)((0,c.A)().m(function e(n){var r;return(0,c.A)().w(function(e){for(;;
1)switch(e.n){case 0:if(!(r=t.productParams.record)[n]){e.n=2;break}return delete r[n],e.n=1,t.getSimpleProduct(n);case 1:return e.a(2,!0);case 2:return e.a(2,!1)}},e)}));return function(t){return e.apply(this,arguments)}}(),this.markEventsSettled=function(e){e.forEach(function(e){(0,f.A)(t,q)[q].add(e)})},this.updateInst=function(e){var n,r=e.instType,i=e.instId,a=(0,s.A)(e,E),c=t.instParams.cache,u=null===(n=c[r])||void 0===n?void 0:n[i];u&&(c[r][i]=(0,o.A)((0,o.A)({},u),a),(0,f.A)(t,J)[J]({instType:r,target:t.instParams,newData:c[r]}),(0,f.A)(t,Y)[Y]({instType:r,target:t.instParams,isInst:!0}));var d=t.productParams.cache.simpleInsts[r],l=null===d||void 0===d?void 0:d[i];l&&(d[i]=(0,o.A)((0,o.A)({},l),a),(0,f.A)(t,K)[K]({instTypes:[r]}))},this.getInst=function(){var e=(0,u.A)((0,c.A)().m(function e(n){var r,i,a,o;return(0,c.A)().w(function(e){for(;;)switch(e.n){case 0:return r=n.instType,i=n.instId,a=n.useCache,e.n=1,t.getInsts({instType:r,instIds:[i],useCache:a});case 1:return o=e.v,e.a(2,o[i])}},e)}));return function(t){return e.apply(this,arguments)}}(),this.getInsts=function(){var e=(0,u.A)((0,c.A)().m(function e(n){var r,i,a,o,s,u,d,l,v;return(0,c.A)().w(function(e){for(;;)switch(e.n){case 0:return r=n.instType,i=n.instIds,a=n.useCache,o=void 0===a||a,s=t.instParams,u=s.record,d=s.data,o||i.forEach(function(e){delete u["".concat(r,"-").concat(e)]}),(0,f.A)(t,V)[V]({instType:r,ids:i,isInst:!0}),l=i.map(function(e){return u["".concat(r,"-").concat(e)]}),e.n=1,Promise.all(l);case 1:return v={},i.forEach(function(e){v[e]=d[r][e]}),e.a(2,v)}},e)}));return function(t){return e.apply(this,arguments)}}(),this.getConfig=function(){var e=(0,u.A)((0,c.A)().m(function e(n){var r,i,a;return(0,c.A)().w(function(e){for(;;)switch(e.n){case 0:return r=n.instType,i=n.instId,e.n=1,t.getConfigs({instType:r,instIds:[i]});case 1:return a=e.v,e.a(2,a[i])}},e)}));return function(t){return e.apply(this,arguments)}}(),this.getConfigs=function(){var e=(0,u.A)((0,c.A)().m(function e(n){var r,i,a,o,s,u,d,l;return(0,c.A)().w(function(e){for(;;)switch(e.n){case 0:return r=n.instType,i=n.instIds,a=i.map(function(e){return(0,C.a4)(r,e)}),(0,f.A)(t,V)[V]({instType:r,ids:a}),o=t.configParams,s=o.record,u=o.data,d=a.map(function(e){return s["".concat(r,"-").concat(e)]}),e.n=1,Promise.all(d);case 1:return l={},i.forEach(function(e){l[e]=u[r][e]}),e.a(2,l)}},e)}));return function(t){return e.apply(this,arguments)}}(),this.updateCurrencyConfig=function(e){e&&e!==t.currencyName&&(t.currencyName=e,(0,f.A)(t,z)[z]({target:t.configParams}))},this.updateSizeConfig=function(e){var n=e.linearTradeUnit,r=e.invertTradeUnit,i=e.inverseFuturesUnit,a=e.tradeFiTradeUnit;(n&&n!==t.linearTradeUnit||r&&r!==t.invertTradeUnit||i&&i!==t.inverseFuturesUnit||a&&a!==t.tradeFiTradeUnit)&&(t.linearTradeUnit=n,t.invertTradeUnit=r,t.inverseFuturesUnit=i,t.tradeFiTradeUnit=a,(0,f.A)(t,z)[z]({target:t.configParams}))},this.updateTradFiCoins=function(e){var n=new Set;e&&Object.keys(e).forEach(function(t){var r,i;null!==(r=e[t])&&void 0!==r&&null!==(i=r.groups)&&void 0!==i&&i.some(function(e){return String(e)===String(y.k8)})&&n.add(t)}),n.size===t.tradFiCoins.size&&(0,a.A)(n).every(function(e){return t.tradFiCoins.has(e)})||((0,p.runInAction)(function(){t.tradFiCoins.replace(n)}),(0,f.A)(t,z)[z]({target:t.configParams}))},this.updateUsdLinearSettleCcy=function(e){var n=e.usdLinearSettleCcy;n&&n!==t.usdLinearSettleCcy&&(t.usdLinearSettleCcy=n,(0,f.A)(t,K)[K](),(0,f.A)(t,z)[z]({target:t.instParams}),(0,f.A)(t,z)[z]({target:t.configParams}))},Object.defineProperty(this,K,{writable:!0,value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).instTypes,n=void 0===e?[R,O,U,D]:e;(0,p.runInAction)(function(){var e=t.productParams,r=e.cache,i=e.data,a=e.result;n.forEach(function(e){var n=r.simpleInsts[e];n&&(i.simpleInsts[e]=t.instProxy({instType:e,source:n,isRequest:!1}),i.simpleTypes[e]=Object.values(n),delete a[e])})})}}),Object.defineProperty(this,z,{writable:!0,value:function(e){var n=e.instTypes,r=void 0===n?[R,O,U,D]:n,i=e.target,a=i.cache;r.forEach(function(e){a[e]&&(0,f.A)(t,J)[J]({instType:e,target:i,newData:a[e]})})}}),Object.defineProperty(this,H,{writable:!0,value:function(e){var n=e.instType,r=e.id,i=e.isInst;if(!A.kU){var a=(0,f.A)(t,Q)[Q]({instType:n,ids:[r],isInst:i}).target;if(a){(0,f.A)(t,Z)[Z]({instType:n,isInst:i,target:a});var o=a.waitIds,s=a.timeout,c=o[n]||[];c.push(r),o[n]=c,clearTimeout(s[n]),s[n]=setTimeout(function(){(0,f.A)(t,V)[V]({instType:n,ids:c,isInst:i}),o[n]=[]},(0,f.A)(t,G)[G])}}}}),Object.defineProperty(this,V,{writable:!0,value:function(){var e=(0,u.A)((0,c.A)().m(function e(n){var r,i,a,o,s,u,d,l,v,p;return(0,c.A)().w(function(e){for(;;)switch(e.n){case 0:if(r=n.instType,i=n.ids,a=n.isInst,o=(0,f.A)(t,Q)[Q]({instType:r,ids:i,isInst:a,isSync:!0}
1),s=o.target,u=o.requestIds,s){e.n=1;break}return e.a(2);case 1:return d=s.request,l=s.cache,v=d({instType:r,requestIds:u}),(0,f.A)(t,X)[X]({instType:r,requestIds:u,target:s,promise:v}),e.n=2,v;case 2:p=e.v,(0,f.A)(t,$)[$]({instType:r,requestIds:u,target:s,source:p}),(0,f.A)(t,J)[J]({instType:r,target:s,oldData:l[r],newData:p}),(0,f.A)(t,Y)[Y]({instType:r,isInst:a,target:s});case 3:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}()}),Object.defineProperty(this,J,{writable:!0,value:function(e){var t=e.instType,n=e.target,r=e.oldData,i=void 0===r?{}:r,a=e.newData,s=void 0===a?{}:a,c=n.cache,u=n.data,d=n.proxy,l=n.result;t===D&&Object.keys(s).forEach(function(e){var t;"expired"===(null===(t=i[e])||void 0===t?void 0:t.state)&&delete s[e]}),c[t]=(0,o.A)((0,o.A)({},i),s),(0,p.runInAction)(function(){u[t]=d({instType:t,source:c[t]}),delete l[t]})}}),Object.defineProperty(this,Y,{writable:!0,value:function(){var e=(0,u.A)((0,c.A)().m(function e(t){var n,r,i,a,o;return(0,c.A)().w(function(e){for(;;)switch(e.n){case 0:if(n=t.instType,r=t.isInst,i=t.target,a=i.db,o=i.cache,!(A.kU||r&&[O,U,D].includes(n))){e.n=1;break}return e.a(2);case 1:return e.n=2,a[n];
1case 2:_.A.setData({table:r?w:S,key:n,data:o[n]});case 3:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}()}),Object.defineProperty(this,Z,{writable:!0,value:function(){var e=(0,u.A)((0,c.A)().m(function e(n){var r,i,a,o,s,u;return(0,c.A)().w(function(e){for(;;)switch(e.n){case 0:if(r=n.instType,i=n.isInst,a=n.target,o=a.db,s=a.cache,!(A.kU||o[r]||i&&[O,U,D].includes(r))){e.n=1;break}return e.a(2);case 1:return o[r]=_.A.getData({table:i?w:S,key:r}),e.n=2,o[r];case 2:if(u=e.v){e.n=3;break}return e.a(2);case 3:(0,f.A)(t,J)[J]({instType:r,target:a,oldData:u,newData:s[r]});case 4:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}()}),Object.defineProperty(this,Q,{writable:!0,value:function(e){var n=e.instType,r=e.ids,i=e.isInst,a=e.isSync,o=i?t.instParams:t.configParams;if(!y.Z3.includes(n))return{};var s=o.waitIds,c=o.record,u=s[n]||[],d=r.filter(function(e){return!c["".concat(n,"-").concat(e)]&&(a||!u.includes(e))});return d.length?{target:o,requestIds:d}:{}}}),Object.defineProperty(this,X,{writable:!0,value:function(e){var t=e.instType,n=e.requestIds,r=e.target,i=e.promise,a=r.record;n.forEach(function(e){a["".concat(t,"-").concat(e)]=i})}}),Object.defineProperty(this,$,{writable:!0,value:function(e){var n=e.instType,r=e.requestIds,i=e.target,a=e.source;if(!A.kU){var o=i.record,s=[];r.forEach(function(e){a[e]||s.push("".concat(n,"-").concat(e))}),s.length&&setTimeout(function(){s.forEach(function(e){delete o[e]})},(0,f.A)(t,W)[W])}}}),Object.defineProperty(this,ee,{writable:!0,value:function(e){var t=e.proxy,n=e.request,r=(0,i.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)({},P,t({instType:P})),N,t({instType:N})),O,t({instType:O})),R,t({instType:R})),U,t({instType:U})),D,t({instType:D})),B,t({instType:B})),a=A.kU?r:(0,p.observable)(r,{},{deep:!1});return new Proxy(a,{get:function(e,t,r){return y.Z3.includes(t)?(!A.kU&&n&&n(t),Reflect.get(e,t,r)):e[B]}})}}),Object.defineProperty(this,te,{writable:!0,value:function(e){var t=e.idxResult,n=e.ccyResult,r=e.baseCcy,i=e.instType,a=t.displayId||(null===n||void 0===n?void 0:n.displayId);return a?(0,C.ji)(a,i).baseCcy:r}}),this.instProxy=function(e){var n=e.instType,r=e.source,a=void 0===r?{}:r,s=e.isRequest,c=void 0===s||s;return new Proxy(a,{get:function(e,r,a){var s,u=r.toString(),d=(c?t.instParams:t.productParams).result,l=null===(s=d[n])||void 0===s?void 0:s[u];if(l)return l;c&&/^[^-\s]+-[^-\s]+/.test(u)&&!t.instParams.record["".concat(n,"-").concat(u)]&&(0,f.A)(t,H)[H]({instType:n,id:r,isInst:!0});var v=Reflect.get(e,r,a);return v?(v.isUm&&(v.settleCcy=t.usdLinearSettleCcy),d[n]?d[n][u]=v:d[n]=(0,i.A)({},u,v),v):(0,o.A)((0,o.A)((0,o.A)({},y.J8),(0,C.ji)(u,n)),{},{displayId:u})}})},this.configProxy=function(e){var n=e.instType,r=e.source;return new Proxy(void 0===r?{}:r,{get:function(e,r,a){var s,c=r.toString(),u=t.configParams,d=u.result,l=u.record,v=null===(s=d[n])||void 0===s?void 0:s[c];if(v)return v;var p=h.inst.config,y=(0,f.A)(t,ne)[ne](n,c),A=y.baseCcy,g=y.quoteCcy,m=y.idxKey,b=y.ccyKey,T=y.isCcy,C=y.isLinear,I=y.isUm;m&&!l["".concat(n,"-").concat(m)]&&(0,f.A)(t,H)[H]({instType:n,id:m});var _=Reflect.get(e,m,a);if(_){var E=Reflect.get(e,b,a);!E&&T&&t.currencyName!==L&&(E=Reflect.get(e,"".concat(m,"-").concat(L),a))&&(E.ccyName=t.currencyName,E.ccySign="");var k=(0,f.A)(t,te)[te]({idxResult:_,ccyResult:E,baseCcy:A,instType:n}),S=(0,f.A)(t,re)[re]({instType:n,isLinear:C,isUm:I,baseCcy:A,displayBaseCcy:k,quoteCcy:g,baseDig:_.baseDig,quoteDig:_.quoteDig,sheetDig:_.sheetDig,lotDig:_.lotDig}),w=S.unitName,P=S.sizeDig,N=(0,o.A)((0,o.A)((0,o.A)({},E||p),_),{},{unitName:w,sizeDig:P,displayBaseCcy:k});return w&&(d[n]?d[n][c]=N:d[n]=(0,i.A)({},c,N)),N}return(0,o.A)((0,o.A)({},p),{},(0,i.A)((0,i.A)({},A,"2"),g,"2"))}})}
1,Object.defineProperty(this,ne,{writable:!0,value:function(e,n){var i=n.split("|"),a=(0,r.A)(i,2),o=a[0],s=a[1],c=s||o,u=(0,C.ji)(c,e),d=u.baseCcy,l=u.quoteCcy,f=u.instFamily,v=u.isLinear,p=u.isUm,y=(0,C.a4)(e,c),h={baseCcy:d,quoteCcy:l,isLinear:v,isUm:p,idxKey:y,ccyKey:"",isCcy:!1};if(s)return h.ccyKey="".concat(y,"-").concat(o),h;var A=(0,C.Cs)(e),g=A.isSpotOrMargin,m=A.isDerivative,b=A.isOption;return A.isEvents?(h.ccyKey="".concat(y,"-").concat(l),h):b&&!v?(h.ccyKey="".concat(f,"-").concat(d),h):g||m&&v?(h.ccyKey="".concat(f,"-").concat(l),h):(h.ccyKey="".concat(f,"-").concat(t.currencyName),h.isCcy=!0,h)}}),Object.defineProperty(this,re,{writable:!0,value:function(e){var n=e.instType,r=e.isLinear,i=e.isUm,a=e.baseDig,o=e.quoteDig,s=e.sheetDig,c=e.lotDig,u=e.baseCcy,d=void 0===u?"":u,l=e.displayBaseCcy,f=void 0===l?"":l,v=e.quoteCcy,p=void 0===v?"":v;if(n===D)return{unitName:(0,b.AC)(),sizeDig:s};var y=t.tradFiCoins.has(d),h=(0,T.CL)({isTradFi:y,instType:n}),A=t[(0,T.MB)({instType:n,isLinear:r,isTradFi:y})];return h&&A===j?{unitName:(0,b.s3)("trade_orderform_unit_lot"),sizeDig:null!==c&&void 0!==c?c:s}:[P,N].includes(n)||A===x?{unitName:f||d,sizeDig:a}:A===F?{unitName:(0,b.AC)(),sizeDig:s}:{unitName:i?t.usdLinearSettleCcy:p,sizeDig:o}}}),this.instParams={waitIds:{},record:{},cache:{},data:(0,f.A)(this,ee)[ee]({proxy:this.instProxy}),proxy:this.instProxy,request:m.A.getInsts,timeout:{},db:{},result:{}},this.configParams={waitIds:{},record:{},cache:{},data:(0,f.A)(this,ee)[ee]({proxy:this.configProxy}),proxy:this.configProxy,request:m.A.getConfigs,timeout:{},db:{},result:{}},this.productParams={record:{},timeout:{},result:{},cache:{simpleInsts:{}},data:{simpleInsts:(0,f.A)(this,ee)[ee]({proxy:function(e){var n=e.instType;return t.instProxy({instType:n,isRequest:!1})},request:this.getSimpleProduct}),simpleTypes:(0,f.A)(this,ee)[ee]({proxy:function(){return[]},request:this.getSimpleProduct})}}});const ae=(0,I.A)("instProxy",ie)},79754:(e,t,n)=>{n.d(t,{A:()=>Y});var r=n(89379),i=n(64467),a=n(23029),o=n(92901),s=n(39874),c=n(85501),u=n(44497),d=n(40401),l=n(61992),f=n(99546),v=n(43633),p=n(27727),y=n(77728),h=n(52918),A=n(92675),g=n(14812);const m=function(){return(0,o.A)(function e(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).root,n=void 0===t?{}:t;(0,a.A)(this,e),this.bizType="",this.instType="",this.instId="",this.chainShortName="",this.tokenContractAddress="",this.root=(0,r.A)({instProxy:g.A},n),(0,d.f)()||(0,u.makeObservable)(this,{bizType:u.observable,instType:u.observable,instId:u.observable,chainShortName:u.observable,tokenContractAddress:u.observable,inst:u.computed,config:u.computed,uly:u.computed,chainId:u.computed,isCedefi:u.computed,isTradFi:u.computed,isSupportLot:u.computed})},[{key:"inst",get:function(){return this.root.instProxy.instParams.data[this.instType][this.instId]}},{key:"config",get:function(){return this.root.instProxy.configParams.data[this.instType][this.instId]}},{key:"uly",get:function(){return this.inst.uly||""}},{key:"instFamily",get:function(){return this.inst.instFamily||""}},{key:"chainId",get:function(){return(0,A.sY)(this.chainShortName)}},{key:"isCedefi",get:function(){return this.bizType?this.bizType===l.gy.CEDEFI:y.A.pathname.includes("/trade-cedefi")}},{key:"isTradFi",get:function(){var e,t=null===(e=this.inst)||void 0===e?void 0:e.baseCcy;return this.root.instProxy.tradFiCoins.has(t)}},{key:"isSupportLot",get:function(){return(0,h.CL)({isTradFi:this.isTradFi,instType:this.instType})}},{key:"instStatus",get:function(){return(0,A.Cs)(this.instType)}}])}();var b=n(16901),T=n(61662),C=n(93794);var I=n(22007),_=n(10467),E=n(17650);function k(e){var t=Math.floor(e);return t<10?"0".concat(t):t}var S=n(66589),w=l.O6.LIVE,P=E.yy.NEW_COINS_COUNTDOWN,N=l.dx.ONLINE;var O=n(80045),R=["floorStrike"],U=l.gy.SPOT,D=l.gy.FUTURES,L=l.gy.SWAP,M=l.gy.OPTION,x=l.gy.EVENTS,F=E.yy.INSTRUMENTS,j=E.yy.EVENT_CONTRACT_MARKETS;function B(e){var t=!1,n={};function i(t){var r=t.arg.instType,i=t.data;clearTimeout(n[r]),n[r]=setTimeout((0,_.A)((0,I.A)().m(function t(){return(0,I.A)().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,g.A.updateSimpleProduct(r);case 1:if(t.v){t.n=2;break}return t.a(2);case 2:(0,u.runInAction)(function(){++e.instState,r===M&&++e.optionState,r===x&&++e.eventsState});case 3:return t.a(2)}},t)})),5e3),delete g.A.configParams.result[r],delete g.A.instParams.result[r],null===i||void 0===i||i.forEac
1h(function(e){var t=e.instId,n=(0,A.a4)(r,t);delete g.A.instParams.record["".concat(r,"-").concat(t)],delete g.A.configParams.record["".concat(r,"-").concat(n)]})}function a(t){t.disconnected&&e.instTypes.forEach(function(e){i({arg:{instType:e}})})}function o(){t||(t=!0,S.A.listenerPubConnect(a),S.A.listenerData(F,i),S.A.listenerData(j,function(e){var t=e.data,n=void 0===t?[]:t,a=n.filter(function(e){return"expired"===e.state}).map(function(e){return e.instId});a.length>0&&g.A.markEventsSettled(a),i({arg:{instType:x},data:n}),function(e){e.forEach(function(e){var t=e.floorStrike,n=(0,O.A)(e,R),i=(0,r.A)({instType:x},n);void 0!==t&&(i.stk=t),g.A.updateInst(i)})}(n)}),S.A.subscribePub([{channel:F,instType:U},{channel:F,instType:D},{channel:F,instType:L},{channel:F,instType:M},{channel:j,instType:x}]))}(0,u.onBecomeObserved)(e,"simpleInsts",o),(0,u.onBecomeObserved)(e,"simpleTypes",o),(0,u.onBecomeObserved)(e,"insts",o),(0,u.onBecomeObserved)(e,"configs",o)}var G=n(15986);var W=l.gy.SPOT,q=l.gy.MARGIN,K=l.gy.FUTURES,z=l.gy.SWAP,H=l.gy.OPTION,V=l.gy.EVENTS,J=function(e){function t(e){var n;return(0,a.A)(this,t),(n=(0,s.A)(this,t,[e])).sysTime=Date.now(),n.instState=0,n.optionState=0,n.eventsState=0,n.equallyState=0,n.coins={},n.blackCcys={},n.newCoins={},n.instGroup={},(0,d.f)()||((0,u.makeObservable)(n,{sysTime:u.observable,instState:u.observable,optionState:u.observable,eventsState:u.observable,equallyState:u.observable,newCoins:u.observable.shallow,instTypes:u.computed,quoteTypes:u.computed,marginTypes:u.computed,simpleInsts:u.computed,simpleTypes:u.computed,insts:u.computed,configs:u.computed,supportType:u.computed}),(0,v.E)(n,{coins:{request:f.A.getCoins},blackCcys:{request:f.A.getBlackCcys,haveData:v.Q3},instGroup:{request:f.A.getInstGroup,haveData:v.Q3}})),n}return(0,c.A)(t,e),(0,o.A)(t,[{key:"instTypes",get:function(){var e;return(null===(e=this.instGroup.availableType)||void 0===e?void 0:e.map(function(e){return e.instType}))||[]}},{key:"quoteTypes",get:function(){return this.instGroup.baseGroup||[]}},{key:"marginTypes",get:function(){var e,t=(0,i.A)((0,i.A)((0,i.A)((0,i.A)({},z,[]),K,[]),H,[]),V,[]);return null===(e=this.instGroup.contractGroup)||void 0===e||e.forEach(function(e){var n=e.instType,i=e.list;t[n]=i.map(function(e){var t=e.ccyType,n=e.text;return(0,r.A)((0,r.A)({},e),{},{value:t,label:n})})}),t}},{key:"simpleInsts",get:function(){return this.root.instProxy.productParams.data.simpleInsts}},{key:"simpleTypes",get:function(){return this.root.instProxy.productParams.data.simpleTypes}},{key:"insts",get:function(){return this.root.instProxy.instParams.data}},{key:"configs",get:function(){return this.root.instProxy.configParams.data}},{key:"supportType",get:function(){var e,t={};null===(e=this.instGroup.availableType)||void 0===e||e.forEach(function(e){t[e.instType]=e});var n=t[W],r=t[q],i=t[z],a=t[K],o=t[H],s=t[V];return{spot:!!n,margin:!!r,swap:!!i,futures:!!a,option:!!o,events:!!s,derivatives:!!(i||a||o||s),swapOrFutures:!(!i&&!a),onlySpot:!!n&&1===this.instTypes.length,swapLinear:!(null===i||void 0===i||!i.linear),swapInvert:!(null===i||void 0===i||!i.inverse),futuresLinear:!(null===a||void 0===a||!a.linear),futuresInvert:!(null===a||void 0===a||!a.inverse)}}},{key:"_existSimple",value:function(e){var t=e.instType,n=e.instId;return!!this.root.instProxy.productParams.record[t]&&!!this.simpleInsts[t][n].instId}}])}(m);const Y=function(e){return b.kU||(function(e){var t=null;function n(){var n=Date.now();clearInterval(t),t=setInterval(function(){var t=Date.now(),r=t-n;n=t,(0,u.runInAction)(function(){e.sysTime+=r})},1e3)}function r(){return(r=(0,_.A)((0,I.A)().m(function t(){var r;return(0,I.A)().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,G.A.getSysTime();case 1:r=t.v,(0,u.runInAction)(function(){e.sysTime=r}),n();case 2:return t.a(2)}},t)}))).apply(this,arguments)}(0,u.onBecomeObserved)(e,"sysTime",function(){return r.apply(this,arguments)})}(e),function(e){var t=null,n=!1;function i(e){var t=e/86400,n=e%86400/3600,r=e%3600/60,i=e%60;return{day:Math.floor(t),hour:k(n),minute:k(r),second:k(i)}}function a(n){var a=n.data,o=void 0===a?[]:a;(0,u.runInAction)(function(){var t=e.newCoins;o.forEach(function(e){var n=e.instId,a=e.type,o=e.waitOnlineTime,s=e.noticeUrlCn,c=e.noticeUrlEn,u=(0,b.Q7)()?s:c,d=a===N?i(o):{};t[n]=(0,r.A)((0,r.A)((0,r.A)({},e),d),{},{noticeUrl:u})})});var s=Date.now();clearInterval(t),t=setInterval(function(){var t=Date.now(),n=t-s,a=Math.floor(n/1e3);s=t-n%1e3,(0,u.runInAction)(function(){var t=e.newCoins;Object.values(t).forEach(function(e){var n=e.instId,o=e.type,s=e.instType;if(o===N){var c=e.waitOnlineTime-a;if(c<=0)return g.A.updateInst({instType:s,instId:n,isLive:!0,status:w}),void delete t[n];t[n]=(0,r.A)((0,r.A)((0,r.A)({},e),i(c)),{}
1,{waitOnlineTime:c})}})})},1e3)}function o(){return s.apply(this,arguments)}function s(){return(s=(0,_.A)((0,I.A)().m(function t(){var r;return(0,I.A)().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,f.A.getNewCoins();case 1:return r=t.v,n&&a({data:r}),t.a(2,e.newCoins)}},t)}))).apply(this,arguments)}function c(e){e.disconnected&&o()}(0,u.onBecomeObserved)(e,"newCoins",function(){n=!0,o(),S.A.listenerData(P,a),S.A.subscribePub({channel:P,entityId:(0,b.t_)()}),S.A.listenerPubConnect(c)}),(0,u.onBecomeUnobserved)(e,"newCoins",function(){n=!1,clearInterval(t),S.A.unListenerData(P,a),S.A.unsubscribePub({channel:P,entityId:(0,b.t_)()}),S.A.unListenerPubConnect(c)})}(e),function(e){var t=T.x7,n=T.x7,r=T.x7,i=T.x7;(0,u.onBecomeObserved)(e,"configs",function(){t=(0,u.autorun)(function(){var e=C.A.currencyUnit.isoCode;g.A.updateCurrencyConfig(e)}),n=(0,u.autorun)(function(){var e=C.A.linearTradeUnit,t=C.A.invertTradeUnit,n=C.A.inverseFuturesUnit,r=C.A.tradeFiTradeUnit;g.A.updateSizeConfig({linearTradeUnit:e,invertTradeUnit:t,inverseFuturesUnit:n,tradeFiTradeUnit:r})}),r=(0,u.autorun)(function(){var e=C.A.usdLinearSettleCcy;g.A.updateUsdLinearSettleCcy({usdLinearSettleCcy:e})}),i=(0,u.autorun)(function(){g.A.updateTradFiCoins(e.coins)})}),(0,u.onBecomeUnobserved)(e,"configs",function(){t(),n(),r(),i()})}(e),B(e)),e}((0,p.A)("instStore",J))},46431:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(92901),i=n(23029),a=n(39874),o=n(85501),s=n(44497);const c=function(){return(0,r.A)(function e(){(0,i.A)(this,e),(0,s.makeObservable)(this,{updateByKey:s.action.bound,update:s.action.bound})},[{key:"updateByKey",value:function(e,t){this[e]=t}},{key:"update",value:function(e){var t=this;Object.keys(e).forEach(function(n){t[n]=e[n]})}}])}();var u=n(27727),d=function(e){function t(){var e;return(0,i.A)(this,t),(e=(0,a.A)(this,t)).usdTickers={},e.usdPrices={USD:1},(0,s.makeObservable)(e,{usdTickers:s.observable,usdPrices:s.observable}),e}return(0,o.A)(t,e),(0,r.A)(t)}(c);const l=(0,u.A)("usdStore",d)},93794:(e,t,n)=>{n.d(t,{A:()=>M});var r=n(64467),i=n(89379),a=n(23029),o=n(92901),s=n(44497),c=n(40401),u=n(47185),d=n.n(u),l=n(16901),f=n(61992),v=n(79078),p=n(58451),y={UNSET:0,USDT:1,COIN:2,CLOSE:3,USDC:4},h=n(32081),A=n(39455),g=n(96802),m=n(43633),b=n(27727),T=n(61662),C=n(17650),I=n(66589),_=C.yy.INDEX_TICKERS;var E=n(62077),k=f.pn.LINEAR,S=f.pn.INVERSE,w=v.iw.BASE,P=v.iw.QUOTE,N=f.e$.USD,O=f.e$.USDC,R=f.gy.FUTURES,U=f.gy.SWAP,D=f.gy.OPTION;var L=function(){return(0,o.A)(function e(){(0,a.A)(this,e),this.configs=null,this.cacheConfig={mgnMode:v.FL.CROSS,opMgnMode:v.FL.ISOLATED},this.currency=null,this.preference=null,this.theme=l.kU?"dark":(0,g.O)(),this.namePairDisplayOrder=E.st,this.mgnModeConfigs={instMarginModeConfigs:null,spotCopyInstSwitchConfig:null},(0,c.f)()||((0,s.makeObservable)(this,{theme:s.observable,namePairDisplayOrder:s.observable,accountConfig:s.computed,tradeConfig:s.computed,collateralCoinConfig:s.computed,extendedExportFeatureConfig:s.computed,pendingRequirements:s.computed,questionnaire:s.computed,disclaimer:s.computed,spotFeeCoinType:s.computed,isTradeAccount:s.computed,isSingleAccount:s.computed,isMultiAccount:s.computed,isPmAccount:s.computed,isAutoLoan:s.computed,isCtAutoTra:s.computed,isCtOpenTra:s.computed,isMgnAutoTra:s.computed,isMgnOpenTra:s.computed,isOpAuth:s.computed,isNetPosMode:s.computed,isLsPosMode:s.computed,posMode:s.computed,firstTradeTimeInfo:s.computed,hasTradedFutures:s.computed,usdLinearSettleCcy:s.computed,usdLinearSettleCcyList:s.computed,isOpLocCcy:s.computed,isOpMgnCcy:s.computed,isOrderConfirm:s.computed,isDepthSz:s.computed,isBsGeeks:s.computed,isPaGreeks:s.computed,linearTradeUnit:s.computed,invertTradeUnit:s.computed,inverseFuturesUnit:s.computed,tradeFiTradeUnit:s.computed,tradeUnit:s.computed,isIsoMgn:s.computed,isCroMgn:s.computed,isInstNav:s.computed,isCoinNav:s.computed,currencyUnit:s.computed,rate:s.computed,premiumRate:s.computed,isRedUp:s.computed,upDownTimeZone:s.computed,copyInfo:s.computed,isSpotOffsetOpened:s.computed,isLogin:s.computed}),(0,m.E)(this,{currency:{observable:s.observable,request:h.A.getCurrency},preference:{observable:s.observable,request:h.A.getPreference}
1,configs:{observable:s.observable,request:h.A.getConfigs},cacheConfig:{observable:s.observable,request:h.A.getCacheConfig},mgnModeConfigs:{observable:s.observable,request:h.A.getMgnModeConfigs}}),this.namePairDisplayOrder=function(){var e;try{e=A.Jt(p.bF)}catch(t){return E.st}return"string"===typeof e&&E.o9.has(e)?e:E.st}())},[{key:"accountConfig",get:function(){var e;return null===(e=this.configs)||void 0===e?void 0:e.accountConfig}},{key:"tradeConfig",get:function(){var e;return null===(e=this.configs)||void 0===e?void 0:e.tradeConfig}},{key:"collateralCoinConfig",get:function(){var e;return null===(e=this.configs)||void 0===e?void 0:e.collateralCoinConfig}},{key:"autoEarnConfig",get:function(){var e;return null===(e=this.configs)||void 0===e?void 0:e.autoEarnConfig}},{key:"extendedExportFeatureConfig",get:function(){var e;return null===(e=this.configs)||void 0===e?void 0:e.extendedExportFeatureConfig}},{key:"pendingRequirements",get:function(){var e;return null===(e=this.configs)||void 0===e?void 0:e.pendingRequirements}},{key:"questionnaire",get:function(){var e=this.pendingRequirements;return(void 0===e?[]:e).reduce(function(e,t){var n=t.code;return t.type===v.$9.QUESTIONNAIRE?(0,i.A)((0,i.A)({},e),{},(0,r.A)({},n,!0)):e},{})}},{key:"disclaimer",get:function(){var e=this.pendingRequirements;return(void 0===e?[]:e).reduce(function(e,t){var n=t.code;return t.type===v.$9.DISCLAIMER?(0,i.A)((0,i.A)({},e),{},(0,r.A)({},n,!0)):e},{})}},{key:"spotFeeCoinType",get:function(){var e;return(null===(e=this.accountConfig)||void 0===e?void 0:e.spotFeeCoinType)||"-1"}},{key:"isTradeAccount",get:function(){var e,t;return!(null!==(e=this.accountConfig)&&void 0!==e&&e.acctLv)||(null===(t=this.accountConfig)||void 0===t?void 0:t.acctLv)===v.nj.TRADE}},{key:"isSingleAccount",get:function(){var e;return(null===(e=this.accountConfig)||void 0===e?void 0:e.acctLv)===v.nj.SINGLE}},{key:"isMultiAccount",get:function(){var e;return(null===(e=this.accountConfig)||void 0===e?void 0:e.acctLv)===v.nj.MULTI}},{key:"isPmAccount",get:function(){var e;return(null===(e=this.accountConfig)||void 0===e?void 0:e.acctLv)===v.nj.PM}},{key:"isAutoLoan",get:function(){var e;return!(null===(e=this.accountConfig)||void 0===e||!e.autoLoan)}},{key:"isCtAutoTra",get:function(){var e;return(null===(e=this.accountConfig)||void 0===e?void 0:e.ctIsoMode)===v.Ih.AUTO}},{key:"isCtOpenTra",get:function(){return!this.isCtAutoTra}},{key:"isMgnAutoTra",get:function(){var e;return(null===(e=this.accountConfig)||void 0===e?void 0:e.mgnIsoMode)===v.Ih.AUTO}},{key:"isMgnQuickTra",get:function(){var e;return(null===(e=this.accountConfig)||void 0===e?void 0:e.mgnIsoMode)===v.Ih.QUICK}},{key:"isMgnOpenTra",get:function(){return!this.isMgnAutoTra&&!this.isMgnQuickTra}},{key:"isOpAuth",get:function(){var e;return(null===(e=this.accountConfig)||void 0===e?void 0:e.opAuth)===v.fs.Y}},{key:"isNetPosMode",get:function(){var e;return(null===(e=this.accountConfig)||void 0===e?void 0:e.posMode)===v.fr.NET_MODE}},{key:"isLsPosMode",get:function(){return!this.isNetPosMode}},{key:"posMode",get:function(){var e;return null===(e=this.accountConfig)||void 0===e?void 0:e.posMode}},{key:"firstTradeTimeInfo",get:function(){var e,t=null===(e=this.accountConfig)||void 0===e?void 0:e.firstTradeTime;if(!t)return null;try{var n=JSON.parse(t);return n&&"object"===typeof n?n:null}catch(r){return null}}},{key:"hasTradedFutures",get:function(){var e=this.firstTradeTimeInfo;if(null!==e)return!!e.futures}},{key:"usdLinearSettleCcy",get:function(){var e;return(null===(e=this.accountConfig)||void 0===e?void 0:e.usdLinearSettleCcy)||O}},{key:"usdLinearSettleCcyList",get:function(){var e;return(null===(e=this.accountConfig)||void 0===e?void 0:e.usdLinearSettleCcyList)||[]}},{key:"isOpLocCcy",get:function(){var e;return(null===(e=this.tradeConfig)||void 0===e?void 0:e.ccy)===v.Nk.LOCAL}},{key:"isOpMgnCcy",get:function(){return!this.isOpLocCcy}},{key:"isOrderConfirm",get:function(){var e;return(null===(e=this.tradeConfig)||void 0===e?void 0:e.confirm)===v.cr.Y}},{key:"isDepthSz",get:function(){var e;return(null===(e=this.tradeConfig)||void 0===e?void 0:e.depthCountConfirm)===v.WB.Y}},{key:"isBsGeeks",get:function(){var e;return(null===(e=this.tradeConfig)||void 0===e?void 0:e.greekUnit)===v.j_.BS}},{key:"isPaGreeks",get:function(){return!this.isBsGeeks}},{key:"linearTradeUnit",get:function(){var e;return null===(e=this.tradeConfig)||void 0===e?void 0:e.linearTradeUnit}},{key:"invertTradeUnit",get:function(){var e;return null===(e=this.tradeConfig)||void 0===e?void 0:e.invertTradeUnit}},{key:"inverseFuturesUnit",get:function(){var e;return(null===(e=this.tradeConfig)||void 0===e?void 0:e.inverseFuturesUnit)||this.invertTradeUnit}},{key:"tradeFiTradeUnit",get:function(){var e,t;return null!==(e=null===(t=this.tradeConfig)||void 0===t?void 0:t.tradeFiTradeUnit)&&void 0!==e?e:w}},{key:"tradeUnit",get:function(){var e=this.linearTradeUnit===w,t=this.linearTradeUnit===P,n=this.invertTradeUnit===w,i=this.invertTradeUnit===P;return(0,r.A)((0,r.A)({},k,{isBase:e,isQuote:t,isCont:!e&&!t}),S,{isBase:n,isQuote:i,isCont:!n&&!i})}},{key:"sizeUnit",get:function(){var e={isBase:this.linearTradeUnit===w,isQuote:this.linearTradeUnit===P,isCont:this.linearTradeUnit!==w&&this.linearTradeUnit!==P},t={isBase:this.inverseFuturesUnit===w,isQuote:this.inverseFuturesUnit===P,isCont:this.inverseFuturesUnit!==w&&this.inverseFuturesUnit!==P},n={isBase:this.invertTradeUnit===w,isQuote:!1,isCont:this.invertTradeUnit!==w};return(0,r.A)((0,r.A)((0,r.A)({},R,(0,r.A)((0,r.A)({},k,e),S,t)),U,(0,r.A)((0,r.A)({},k,e),S,t)),D,(0,r.A)((0,r.A)({},k,n),S,n))}},{key:"isIsoMgn",get:function(){return this.cacheConfig.mgnMode===v.FL.ISOLATED}},{key:"isCroMgn",get:function(){return!this.isIsoMgn}},{key:"isOpIsoMgn",get:function(){return this.cacheConfig.opMgnMode===v.FL.ISOLATED}},{key:"isOpCroMgn",get:function(){return!this.isOpIsoMgn}},{key:"isInstNav",get:function(){var e;return(null===(e=this.tradeConfig)||void 0===e?void 0:e.navigation)===v.vi.INST}},{key:"isCoinNav",get:function(){return!this.isInstNav}},{key:"currencyUnit",get:function(){var e;return(null===(e=this.currency)||void 0===e?void 0:e.nowCurrencyUnit)||v.xW}},{key:"usdCurrency",get:function(){var e,t;return(null===(e=this.currency)||void 0===e||null===(t=e.allCurrencyUnit)||void 0===t?void 0:t.find(function(e){return e.isoCode===N}))||v.xW}},{key:"rate",get:function(){var e;return null===(e=this.currencyUnit)||void 0===e?void 0:e.usdToThisRate}},{key:"premiumRate",get:function(){var e;return null===(e=this.currencyUnit)||void 0===e?void 0:e.usdToThisRatePremium}},{key:"isRedUp",get:function(){var e,t;return!(null===(e=this.preference)||void 0===e||null===(t=e.chgSetInfo)||void 0===t||!t.isRedUp)}},{key:"upDownTimeZone",get:function(){var e;return null===(e=this.preference)||void 0===e?void 0:e.upDownTimeZone}},{key:"copyInfo",get:function(){var e=this.accountConfig||{},t=e.roleType,n=e.spotRoleType,r=e.traderInsts,i=e.spotTraderInsts,a=String(t)===v.A6.NORMAL,o=String(t)===v.A6.TRADER,s=String(n)===v.A6.NORMAL,c=String(n)===v.A6.TRADER;return{swapRoleType:t,isSwapNormal:a,isSwapTrader:o,isSwapCopier:!o&&!a,swapTraderInsts:r||[],spotRoleType:n,isSpotNormal:s,isSpotTrader:c,isSpotCopier:!c&&!s,spotTraderInsts:i||[]}}}
1,{key:"isSpotOffsetOpened",get:function(){var e=this.isPmAccount,t=(this.accountConfig||{}).portfolioSpotRiskOffset;return e&&[y.USDT,y.COIN].includes(t)}},{key:"isLogin",get:function(){return d().isLogin()}}])}();const M=function(e){return l.kU||function(e){var t=!1,n=T.x7;function r(t){var n=t.data,r=(void 0===n?[]:n)[0]||{},i=r.idxPx,a=r.instId,o=(e.currency||{}).nowCurrencyUnit,c=void 0===o?{}:o;a==="USD-".concat(c.isoCode)&&(0,s.runInAction)(function(){c.usdToThisRatePremium=Number(i)})}(0,s.onBecomeObserved)(e,"currency",function(){t||(t=!0,I.A.listenerData(_,r),(0,s.reaction)(function(){var t;return(null===(t=e.currency)||void 0===t?void 0:t.nowCurrencyUnit)||{}},function(e){var t=e.isPremium,r=e.isoCode;if(r&&(n(),t)){var i={channel:_,instId:"USD-".concat(r)};n=I.A.subscribePub(i)}},{fireImmediately:!0,compareStructural:!0}))})}(e),e}((0,b.A)("settingStore",L))},62077:(e,t,n)=>{n.d(t,{o9:()=>a,st:()=>i,uT:()=>r});var r={PAIR_FIRST:"pair_first",NAME_FIRST:"name_first"},i=r.PAIR_FIRST,a=new Set([r.PAIR_FIRST,r.NAME_FIRST])},66589:(e,t,n)=>{n.d(t,{A:()=>se});var r=n(92901),i=n(23029),a=n(16901),o=n(27727),s=n(39874),c=n(85501),u=n(75499),d=n(64467),l=n(89379),f=n(60436),v=n(61992),p=n(17650),y=[],h=[],A=[],g=[],m=[],b=[],T=[],C=[],I=[],_={},E={},k=p.yy.FUNDING_RATE,S=p.yy.TICKERS,w=p.yy.INDEX_TICKERS,P=p.yy.TICKERS_3S,N=p.yy.CUP_TICKERS_3S;function O(e){return Array.isArray(e)?e:[e]}function R(e,t){e&&e.forEach(function(e){e(t)})}function U(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=0;n<e.length;n++)if(e[n]===t){e.splice(n,1);break}}function D(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return a.kU||e.push(t),function(){return U(e,t)}}function L(e){return Array.isArray(e)?e.length>0:e instanceof Object&&!!e.channel}function M(e){var t=e.channel,n=e.instId,r=e.ccy;switch(t){case S:case P:case w:case k:return n;case N:return r;default:return""}}function x(e){if(!e)return"";var t={};return Object.keys(e).sort().forEach(function(n){t[n]=e[n]}),JSON.stringify(t)}var F=p.ll.SUBSCRIBE,j=p.ll.UNSUBSCRIBE,B=p.ll.PING,G=function(){return(0,r.A)(function e(){var t=this;(0,i.A)(this,e),this.wsInstance=null,this.cache=new Map,this.initDone=!1,this.authenticated=!0,this.disconnected=!1,this.changeInst=function(e){var n=e.instType,r=e.instId,i=e.whiteList,a=[];(0,f.A)(t.cache.keys()).forEach(function(e){var t=JSON.parse(e);t.instId&&i.includes(t.channel)&&a.push(t)});var o=[],s=[];a.forEach(function(e){var i=(0,l.A)({},e);i.instId=r,v.Z3.includes(e.instType)&&(i.instType=n);var a=x(e);t.cache.delete(a),o.push(e);var c=t.cache.get(a),u=x(i);t.cache.set(u,c),s.push(i)}),t.sendChannel({op:j,args:o}),t.sendChannel({op:F,args:s})}},[{key:"init",value:function(){var e=this;if(!this.initDone&&window.WebSocketCore){this.initDone=!0;var t=this.getWsUrl();this.wsInstance=new window.WebSocketCore({connectUrl:t}),this.wsInstance.onSocketConnected(this.connectedCallback.bind(this)),this.wsInstance.setPushDataResolver(this.dataCallback.bind(this)),this.wsInstance.onSocketError(this.errorCallback.bind(this)),this.wsInstance.onStatusChange(this.statusCallback.bind(this)),this.wsInstance.onPushDiscontinue(function(){e.wsInstance.sendChannel(B)}),this.wsInstance.connect()}}},{key:"connectedCallback",value:function(){var e=(0,f.A)(this.cache.keys()).map(function(e){return JSON.parse(e)});this.sendChannel({op:F,args:e})}},{key:"dataCallback",value:function(e){var t=e.arg,n=e.data,r=null===t||void 0===t?void 0:t.channel;if(r&&n){R(_[r],e);var i=M(t);i&&(E[r]?E[r][i]=e:E[r]=(0,d.A)({},i,e))}}},{key:"errorCallback",value:function(){this.disconnected=!0}},{key:"statusCallback",value:function(){}},{key:"isConnected",value:function(){var e;return!(null===(e=this.wsInstance)||void 0===e||!e.isConnected())}},{key:"getWsUrl",value:function(){return""}},{key:"subscribe",value:function(e){var t=this,n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).forceReSub,r=void 0!==n&&n;if(L(e)){var i=O(e),a=[],o=[];if(i.forEach(function(e){var n=x(e),r=t.cache.get(n);if(r){var i;t.cache.set(n,r+1),o.push(e);var s=e.channel,c=M(e),u=null===(i=E[s])||void 0===i?void 0:i[c];u&&R(_[s],u)}else t.cache.set(n,1),a.push(e)}),this.initDone){if(this.isConnected()&&this.authenticated)return r?(this.sendChannel({op:j,args:o}),void this.sendChannel({op:F,args:i})):void this.sendChannel({op:F,args:a})}else this.init()}}},{key:"unsubscribe",value:function(e){var t=this;if(L(e)){var n=O(e),r=[];
1n.forEach(function(e){var n,i=x(e),a=t.cache.get(i);if(a>1)t.cache.set(i,a-1);else{t.cache.delete(i),r.push(e);var o=M(e);o&&(null===(n=E[e.channel])||void 0===n||delete n[o])}}),this.initDone&&this.isConnected()&&this.authenticated&&this.sendChannel({op:j,args:r})}}},{key:"sendChannel",value:function(e){var t=e.op,n=e.args,r=void 0===n?[]:n;this.isConnected()&&r.length&&this.wsInstance.sendChannel(JSON.stringify({op:t,args:r}))}}])}(),W=n(21259);function q(e){var t;return{priUrl:"".concat(e,"/ws/v5/iprivate"),pubUrl:"".concat(e,"/ws/v5/ipublic"),dexPubUrl:"".concat(null===(t=W.A.socketBaseUrls)||void 0===t?void 0:t.dex,"/ws/v5/ipublic?biz=cedefi")}}var K=function(){return function(){var e,t=(0,a.$E)("dev_ct_wsPress"),n=(null===t||void 0===t||null===(e=t.match(/^(ws|wss):\/\/(\w|-|\.)+/))||void 0===e?void 0:e[0])||"";return["d3NzOi8vb2ZmaWNlLW1ldGVyLm9rZy5jb20=","d3M6Ly8xMjcuMC4wLjE="].includes(btoa(n))?{pubUrl:t,priUrl:t,dexPubUrl:t}:null}()||function(){if(!a.pq&&!(0,a.Cu)()&&!(0,a.wg)())return null;var e=(0,a.$E)("ws_debug_origin")||(0,a.$z)();if(/okx\.com$/.test(e))return q((0,a.Zp)()?atob("d3NzOi8vd3NwcmlwYXAub2t4LmNvbQ=="):atob("d3NzOi8vd3Nwcmkub2t4LmNvbQ=="));if(/cnouyi\.golf$/.test(e))return q((0,a.Zp)()?atob("d3NzOi8vd3NwcmlwYXAuY29pbmFsbC5sdGQ="):atob("d3NzOi8vd3NwcmkuY29pbmFsbC5sdGQ="));if(/\.swim(-dev)?\.(env|local)(:\d+)?$/.test(e)||/\.testokg\.com(:\d+)?$/.test(e))return q(e.replace("http","ws"));var t,n=e.match(/(chaos|test|dev)(.*?).local/);return n?{priUrl:"ws://okcoin-push-inner-private.".concat(n[0],":10443/ws/v5/iprivate"),pubUrl:"ws://okcoin-push-inner-public.".concat(n[0],":10443/ws/v5/ipublic"),dexPubUrl:"".concat(null===(t=W.A.socketBaseUrls)||void 0===t?void 0:t.dex,"/ws/v5/ipublic")}:null}()||q((0,a.pt)())};const z=new(function(e){function t(){var e;(0,i.A)(this,t);for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return(e=(0,s.A)(this,t,[].concat(r))).errorCallback=function(){(0,u.A)(t,"errorCallback",e,3)([]),R(C)},e}
1return(0,c.A)(t,e),(0,r.A)(t,[{key:"connectedCallback",value:function(){(0,u.A)(t,"connectedCallback",this,3)([]),R(T,{disconnected:this.disconnected})}},{key:"statusCallback",value:function(e){R(I,e)}},{key:"getWsUrl",value:function(){return K().dexPubUrl}}])}(G));var H=n(22007),V=n(10467),J=n(47185),Y=n.n(J),Z=n(61662),Q=p.bo.ALREADY_LOGIN,X=p.bo.LOGIN_ERROR,$=p.bo.LOGIN_SUCCESS,ee=p.ll.JWT,te=p.ll.SUBSCRIBE,ne=p.w2.POSITIONS,re=p.w2.ORDERS;const ie=new(function(e){function t(){var e;(0,i.A)(this,t);for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return(e=(0,s.A)(this,t,[].concat(r))).firstMark={},e.authenticated=!1,e.loginResolve=Z.x7,e.loginReject=Z.x7,e}return(0,c.A)(t,e),(0,r.A)(t,[{key:"init",value:function(){(0,a.W5)()&&(0,u.A)(t,"init",this,3)([])}},{key:"connectedCallback",value:function(){var e=this;this.authenticated=!1,this.login().then(function(){e.authenticated=!0,(0,u.A)(t,"connectedCallback",e,3)([]),R(y,{disconnected:e.disconnected})}).catch(function(){})}},{key:"login",value:function(){var e=(0,V.A)((0,H.A)().m(function e(){var t,n=this;return(0,H.A)().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Y().getToken();case 1:if(t=e.v){e.n=2;break}return e.a(2,Promise.reject());case 2:return e.a(2,new Promise(function(e,r){n.sendChannel({op:"jwt",args:[{jwtToken:t}]}),n.loginResolve=e,n.loginReject=r}))}},e)}));return function(){return e.apply(this,arguments)}}()},{key:"dataCallback",value:function(e){var n=e.event,r=e.arg,i=e.code;if(this.authenticated){var a=null===r||void 0===r?void 0:r.channel;if([ne,re].includes(a)){var o=JSON.stringify(r);if(n===te)return void(this.firstMark[o]=!0);e.isFirstData=this.firstMark[o],this.firstMark[o]=!1}(0,u.A)(t,"dataCallback",this,3)([e])}else{n===ee&&i===$||i===Q?this.loginResolve():i===X&&this.loginReject()}}},{key:"errorCallback",value:function(){(0,u.A)(t,"errorCallback",this,3)([]),R(h)}},{key:"statusCallback",value:function(e){R(A,e)}},{key:"getWsUrl",value:function(){return K().priUrl}}])}(G));const ae=new(function(e){function t(){var e;(0,i.A)(this,t);for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return(e=(0,s.A)(this,t,[].concat(r))).errorCallback=function(){(0,u.A)(t,"errorCallback",e,3)([]),R(m)},e}
1return(0,c.A)(t,e),(0,r.A)(t,[{key:"connectedCallback",value:function(){(0,u.A)(t,"connectedCallback",this,3)([]),R(g,{disconnected:this.disconnected})}},{key:"statusCallback",value:function(e){R(b,e)}},{key:"getWsUrl",value:function(){return K().pubUrl}}])}(G));var oe=(0,r.A)(function e(){(0,i.A)(this,e),this.listenerData=function(e,t){return _[e]||(_[e]=[]),E[e]&&Object.values(E[e]).forEach(function(e){t(e)}),D(_[e],t)},this.unListenerData=function(e,t){return U(_[e],t)},this.subscribePri=function(e,t){return(0,a.W5)()?(ie.subscribe(e,t),function(){ie.unsubscribe(e)}):function(){}},this.unsubscribePri=function(e){(0,a.W5)()&&ie.unsubscribe(e)},this.listenerPriConnect=function(e,t){return null!==t&&void 0!==t&&t.fireImmediately&&ie.isConnected()&&e({disconnected:ie.disconnected}),D(y,e)},this.unListenerPriConnect=function(e,t){return U(y[e],t)},this.listenerPriError=function(e,t){return null!==t&&void 0!==t&&t.fireImmediately&&ie.disconnected&&!ie.isConnected()&&e(),D(h,e)},this.listenerPriStatus=function(e){return D(A,e)},this.isPriConnected=function(){return ie.isConnected()},this.subscribePub=function(e,t){return ae.subscribe(e,t),function(){ae.unsubscribe(e)}},this.unsubscribePub=function(e){ae.unsubscribe(e)},this.listenerPubConnect=function(e,t){return null!==t&&void 0!==t&&t.fireImmediately&&ae.isConnected()&&e({disconnected:ae.disconnected}),D(g,e)},this.unListenerPubConnect=function(e,t){return U(g[e],t)},this.listenerPubError=function(e,t){return null!==t&&void 0!==t&&t.fireImmediately&&ae.disconnected&&!ae.isConnected()&&e(),D(m,e)},this.listenerPubStatus=function(e){return D(b,e)},this.isPubConnected=function(){return ae.isConnected()},this.subscribeDexPub=function(e,t){return z.subscribe(e,t),function(){z.unsubscribe(e)}},this.unsubscribeDexPub=function(e){z.unsubscribe(e)},this.listenerDexPubConnect=function(e,t){return null!==t&&void 0!==t&&t.fireImmediately&&z.isConnected()&&e({disconnected:z.disconnected}),D(T,e)},this.unListenerDexPubConnect=function(e,t){return U(T[e],t)},this.listenerDexPubError=function(e,t){return null!==t&&void 0!==t&&t.fireImmediately&&z.disconnected&&!z.isConnected()&&e(),D(C,e)},this.listenerDexPubStatus=function(e){return D(I,e)},this.isDexPubConnected=function(){return z.isConnected()},this.updateInst=function(e){ie.changeInst(e),ae.changeInst(e)},this.subscribeInPri=this.subscribePri,this.unsubscribeInPri=this.unsubscribePri,this.listenerInPriConnect=this.listenerPriConnect,this.listenerInPriError=this.listenerPriError,this.isInPriConnected=this.isPriConnected,this.subscribeInPub=this.subscribePub,this.unsubscribeInPub=this.unsubscribePub,this.listenerInPubConnect=this.listenerPubConnect,this.listenerInPubError=this.listenerPubError,this.isInPubConnected=this.isPubConnected});const se=(0,o.A)("wsAction",oe)},20315:(e,t,n)=>{n.d(t,{I:()=>i});var r=n(95524),i=function(e){return"--"!==e&&e?(0,r._4)(e)?"color-up":"color-down":""}},39455:(e,t,n)=>{n.d(t,{Ht:()=>s,Jt:()=>a,hZ:()=>o});var r=n(13798),i=n(16901);function a(e){var t=r.A.g.get(i.cb)||{};return e?t[e]:t}function o(e,t){var n=a();n[e]=t,r.A.g.set(i.cb,n)}function s(e){var t=r.A.session.get(i.cb)||{};return e?t[e]:t}},52918:(e,t,n)=>{n.d(t,{CL:()=>i,MB:()=>u});var r=n(61992),i=function(e){var t=e.isTradFi,n=e.instType;return!!t&&n!==r.gy.FUTURES&&n!==r.gy.OPTION},a="linearTradeUnit",o="invertTradeUnit",s="inverseFuturesUnit",c="tradeFiTradeUnit",u=function(e){var t=e.instType,n=e.isLinear,u=e.isTradFi;return i({isTradFi:u,instType:t})?c:t===r.gy.OPTION?o:n?a:s}},49819:(e,t,n)=>{n.d(t,{Z5:()=>S,d1:()=>k,d6:()=>P,zS:()=>w});var r=n(64467),i=n(77271),a=n(73321),o=n(90076),s=n(61992),c=n(29305),u=n(95524),d=n(8328),l=s.pn.LINEAR,f=s.gy.COIN,v=s.gy.SPOT,p=s.gy.MARGIN,y=s.gy.FUTURES,h=s.gy.SWAP,A=s.gy.OPTION,g=s.gy.EVENTS,m=c.v8.H_24,b=c.v8.UTC_0,T=c.v8.UTC_8;function C(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.Fz,n=e.price,r=e.rate,i=Number(n)*Number(r),a=e.digit;return t!==u.wi&&(a=Math.max((0,u.a5)(i)+1,Number(a))),t((0,d.r)({value:i,digit:a},e))}function I(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.Fz,n=e.price,r=e.usdPrice,i=e.rate;if(e.isLocal){var a=Number(n)*Number(r)*Number(i),o=e.digit;return t!==u.wi&&(o=Math.max((0,u.a5)(a)+1,Number(o))),t((0,d.r)({value:a,digit:o},e))}return t((0,d.r)({value:n},e))}function _(e){return I(e,e.isLocal?u.wi:u.e5)}function E(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.Fz,n=e.price,r=e.rate,i=e.ctType===l?n:Number(n)*Number(r);return t((0,d.r)({value:i},e))}function k(e){var t=e.instType,n=e.hasSign,r=e.ccySign,a=void 0===r?"":r,o=e.hasName,s=e.ccyName,c=void 0===s?"":s,d=e.lessThan,l="";switch(t){case f:l=function(e){return C(e,u.wi)}(e);break;case v:case p:case g:l=_(e);break;case y:case h:l=function(e){return E(e,u.e5)}(e);break;case A:l=function(e){return _(e)}(e)}if("--"===l)return l;var m="";return d&&0===Number(l)&&(m="<",l="0.01"),n?l=i.Ru.formatCurrency(l,{currencySign:a}):o&&(l=i.Ru.formatCurrency(l,{currency:c})),m&&(l=i.Ru.formatRange({leftNumber:"",sign:m,rightNumber:l})),l}function S(e){var t=Number(e.price);return t>=1e3?a._u.showFloorTruncation(t,0):t>=100?a._u.showFloorTruncation(t,1):t>=10?a._u.showFloorTruncation(t,2):t>=1?a._u.showFloorTruncation(t,3):a._u.showFloorTruncation(t,4)}function w(e,t){var n=(0,r.A)((0,r.A)((0,r.A)({},m,"open24h"),b,"sodUtc0"),T,"sodUtc8")[t]||"open24h",i=Number(e.last),a=Number(e[n]);if(0===i||0===a)return"--";var o=(0,u.aK)(i,a);if(o)return o;var s=(i-a)/a*100;return(0,u.e5)({value:s,digit:2,style:"percent",signDisplay:!0,zeroSign:!1})}function P(e){var t=e.price,n=e.chainId,r=e.tokenContractAddress,i=e.currencySign,a=void 0===i?"":i;if(!(0,u.Et)(t))return"--";var s=(0,o.lJ)(Number(n),r);return(0,o.$g)(t,{currencySign:a,isStableCoin:s,needZero:!0}).value}},95524:(e,t,n)=>{n.d(t,{Et:()=>c,Fz:()=>y,Hb:()=>v,KN:()=>m,LI:()=>p,Yd:()=>b,_4:()=>u,a5:()=>d,aK:()=>l,e5:()=>h,js:()=>g,wi:()=>A,xv:()=>f});var r=n(73321),i=n(77271),a=n(77947),o=n(61992),s=n(29305);function c(e){return"number"===typeof e&&Number.isFinite(e)||"string"===typeof e&&""!==e&&Number.isFinite(Number(e))}function u(e){return String(null!==e&&void 0!==e?e:"").includes("+")}function d(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toString();return e.includes("e-")&&(e=r._u.toPlainString(e)),e.length-e.replace(/^0\.0*/,".").length}function l(e,t){return c(e)&&c(t)?"":"--"}function f(e,t,n){return l(e,t)||r._u.truncate(e,t,n)}
1function v(e,t,n){return l(e,t)||r._u.showCeilTruncation(e,t,n)}function p(e,t,n){return l(e,t)||r._u.showTruncation(e,t,n)}function y(e){var t=e.value,n=e.decimal,i=e.digit,a=e.needZero,o=s.SC.UP,c=s.SC.DOWN;switch(n){case o:return function(e,t,n){return l(e,t)||r._u.ceilTruncate(e,t,n)}(t,i,a);case c:return function(e,t,n){return l(e,t)||r._u.floorTruncate(e,t,n)}(t,i,a);default:return f(t,i,a)}}function h(e){var t=e.value,n=e.decimal,i=e.digit,a=s.SC.UP,o=s.SC.DOWN;switch(n){case a:return v(t,i,e);case o:return function(e,t,n){return l(e,t)||r._u.showFloorTruncation(e,t,n)}(t,i,e);default:return p(t,i,e)}}function A(e){var t=e.value;return c(t)?r._u.abbreviateFiat(t,e):"--"}function g(e){var t=e.value,n=e.decimal,r=e.digit,o=e.needZero,c=s.SC.UP,u=s.SC.DOWN;switch(n){case c:return function(e,t,n){return l(e,t)||i.Ru.shortNumber(e,{digit:Number(t),needZero:n,roundingMode:a.Ic.ceil})}(t,r,o);case u:return function(e,t,n){return l(e,t)||i.Ru.shortNumber(e,{digit:Number(t),needZero:n,roundingMode:a.Ic.floor})}(t,r,o);default:return function(e,t,n){return l(e,t)||i.Ru.shortNumber(e,{digit:Number(t),needZero:n})}(t,r,o)}}function m(e){var t=e.decimal,n=void 0===t?s.SC.DOWN:t,i=e.maxDigit,a=e.signDisplay,o=e.zeroSign,u=e.needZero,d=e.value,l=e.digit,f=void 0===l?2:l;return c(d)?(d=r._u.mul(d,100),Number(i)>=0&&(f=Math.max(Math.min(Number(i),r._u.digitLength(d)),0)),h({value:d,digit:f,decimal:n,signDisplay:a,zeroSign:o,needZero:u,style:"percent"})):"--"}function b(e){return c(e)?i.Ru.formatNumber(String(e),{needZero:!1})+o.uV:""}},8328:(e,t,n)=>{function r(e,t){var n=t.value,r=t.digit,i=t.decimal,a=t.needZero,o=t.style,s=t.signDisplay,c=t.currency,u=t.allowZero,d=e.value,l=void 0===d?n:d,f=e.digit,v=void 0===f?r:f,p=e.decimal;return{value:l,digit:v,decimal:void 0===p?i:p,needZero:a,style:o,signDisplay:s,currency:c,allowZero:u}}n.d(t,{r:()=>r})},81748:(e,t,n)=>{n.d(t,{E3:()=>G,Km:()=>C,Me:()=>b,RY:()=>m,Tp:()=>F,Xz:()=>P,a1:()=>I,cj:()=>S,dU:()=>U,jp:()=>j,lx:()=>B,pu:()=>w,qS:()=>E,qj:()=>T,rf:()=>k,xI:()=>_});var r=n(3453),i=n(63039),a=n(77271),o=n(77947),s=n(61992),c=n(90241),u=s.pn.UM,d=s.pn.CM,l=s.pn.XPERP,f=s.mm.PRE_MARKET,v=s.mm.XPERP,p=s.xc.PRICE_UP_DOWN,y=s.xc.PRICE_ABOVE,h=s.xc.PRICE_HIT,A=s.xc.PRICE_BETWEEN,g={UPDOWN:p,ABOVE:y,HIT:h,BETWEEN:A};function m(e){return e.replace("-","/")}function b(e){var t=e.baseCcy,n=e.quoteCcy,r=e.isUm,i=e.isLinear,a=e.isXp,o=e.hasXp,s="".concat(t).concat(n);return i?a?"".concat(s," ").concat(u).concat(o?" ".concat(l):""):r?"".concat(s," ").concat(u):s:"".concat(s," ").concat(d)}function T(e){return e}function C(e){return e.replace("-","/")}function I(e){var t=e.baseCcy,n=e.quoteCcy,r=e.isUm,i=e.isLinear,a=e.expDate,o=e.stk,s=e.optType,c="";return i?r&&(c=" ".concat(u)):c=" ".concat(d),"".concat(t).concat(n).concat(c,"-20").concat(a,"-").concat(o,"-").concat(s)}function _(e,t){var n=b(e);if(e.isXp)return(0,c.TW)({uly:n});var i=e.expDate.split(""),a=(0,r.A)(i,6),o=a[0],u=void 0===o?"":o,d=a[1],l=void 0===d?"":d,p=a[2],y=void 0===p?"":p,h=a[3],A=void 0===h?"":h,g=a[4],m=void 0===g?"":g,T=a[5],C=void 0===T?"":T;switch(t){case f:return(0,c.tD)({uly:n});case v:return(0,c.TW)({uly:n});default:return"".concat(n,"-").concat(m).concat(C).concat(s.Lp[y+A]||"").concat(u).concat(l)}}function E(e){return(0,c.B1)({uly:b(e)})}function k(e,t){return(0,i.CZ)("/trade-cedefi/".concat(e,"/").concat(t))}function S(e,t){var n=e.instFamily;return"".concat(n,"-").concat(s.nE[t])}function w(e){var t=e.instFamily,n=e.expDate,r=e.stk,i=e.optType;return"".concat(t,"#date=").concat(n,"-").concat(r,"-").concat(i)}function P(e,t){if(!t)return e;var n=e.split("-"),r=t.split("-").length,i=n.slice(0,r).join("-"),a=n.slice(r).join("-");return"".concat(i,"#date=").concat(a)}var N=8;function O(e,t){if(!e||e.length<6)return null;var n=Number(e.slice(0,2)),r=Number(e.slice(2,4)),i=Number(e.slice(4,6)),a=t?Number(t.slice(0,2)):0,o=t?Number(t.slice(2,4)):0;return new Date(Date.UTC(2e3+n,r-1,i,a-N,o))}function R(e){return!e||e.length<10?null:O(e.slice(0,6),e.slice(6,10))}function U(e){return g[e.split("-")[1]]||""}function D(e){var t,n=e.split("-"),r="DAILY"===(t=n[2]||"")?{granularity:"day",size:""}:t.endsWith("HOUR")?{granularity:"hour",size:t.slice(0,-4)}:t.endsWith("MIN")?{granularity:"min",size:t.slice(0,-3)}:{granularity:"",size:""},i=r.granularity,o=r.size,s=null,c=null;if("day"===i)s=R(n[3]||""),c=R(n[4]||"");else{var u=n[3]||"";s=O(u,n[4]||""),c=O(u,n[5]||"")}var d=function(e,t){return e?a.Ru.formatDateTime(e,{format:t}):""};return{ccy:n[0]||"",size:o,granularity:i,month:d(c,"MMM"),day:d(c,"d"),time1:d(s,"HH:mm"),time2:d(c,"HH:mm"),date1:d(s,"MMM d"),date2:d(c,"MMM d")}}function L(e){var t=e.split("-"),n=O(t[3]||"",t[4]||"");return{ccy:t[0]||"",methodStr:(t[1]||"").toLowerCase(),freq:t[2]||"",stk:t[5]||"",month:n?a.Ru.formatDateTime(n,{format:"MMM"}):"",day:n?a.Ru.formatDateTime(n,{format:"d"}):"",monthDay:n?a.Ru.formatDateTime(n,{format:o.Bp.StandardMonthDay}):"",monthDayTime:n?a.Ru.formatDateTime(n,{format:"".concat(o.Bp.StandardMonthDay," HH:mm")}
1):""}}function M(e){var t=e.split("-"),n=t[5]||"",r=t[6]||"",i=O(t[3]||"",t[4]||""),s="none";return"INF"===r?s="cap":"0"===n&&(s="floor"),{ccy:t[0]||"",freq:t[2]||"",floorStk:n,capStk:r,unbounded:s,month:i?a.Ru.formatDateTime(i,{format:"MMM"}):"",day:i?a.Ru.formatDateTime(i,{format:"d"}):"",monthDay:i?a.Ru.formatDateTime(i,{format:o.Bp.StandardMonthDay}):""}}function x(e,t,n){return"cap"===e?"\u2265 ".concat(a.Ru.formatNumber(+t)):"< ".concat(a.Ru.formatNumber(+n))}function F(e){var t=U(e);if(t===p){var n=D(e),r=n.ccy,i=n.size,o=n.granularity,s=n.month,u=n.day,d=n.time1,l=n.time2;if("day"===o)return(0,c.r5)({ccy:r,month:s,date:u});var f={ccy:r,size:i,month:s,date:u,time1:d,time2:l};return"hour"===o?(0,c.B7)(f):(0,c.Te)(f)}if(t===A){var v=M(e),y=v.ccy,g=v.floorStk,m=v.capStk,b=v.unbounded,T=v.month,C=v.day;return"none"!==b?(0,c.cr)({ccy:y,price:x(b,g,m),month:T,date:C}):(0,c.Wu)({ccy:y,priceLow:a.Ru.formatNumber(+g),priceHigh:a.Ru.formatNumber(+m),month:T,date:C})}var I=L(e),_=I.ccy,E=I.stk,k=I.month,S=I.day,w={ccy:_,price:a.Ru.formatNumber(+E),month:k,date:S};return t===h?(0,c.n3)(w):(0,c.lY)(w)}function j(e){var t=U(e);if(t===p){var n=D(e),r=n.ccy,i=n.size,a=n.granularity;return"day"===a?(0,c.mJ)({ccy:r}):"hour"===a?(0,c._J)({ccy:r,time:i}):(0,c.es)({ccy:r,time:i})}if(t===A){var o=M(e),s=o.ccy,u=o.freq;return(0,c.br)({ccy:s,freq:(0,c.p1)(u)})}var d=L(e),l=d.ccy,f=d.freq,v={ccy:l,freq:(0,c.p1)(f)};return t===h?(0,c.uE)(v):(0,c.CA)(v)}function B(e){var t=U(e);if(t===p){var n=D(e),r=n.ccy,i=n.size,o=n.granularity;if("day"===o)return(0,c.mJ)({ccy:r});var s={ccy:r,size:i};return"hour"===o?(0,c.K1)(s):(0,c.K)(s)}if(t===A){var u=M(e),d=u.ccy,l=u.floorStk,f=u.capStk,v=u.unbounded;return"none"!==v?(0,c.Ju)({ccy:d,price:x(v,l,f)}):(0,c.$y)({ccy:d,priceLow:a.Ru.formatNumber(+l),priceHigh:a.Ru.formatNumber(+f)})}var y=L(e),g=y.ccy,m=y.stk,b={ccy:g,price:a.Ru.formatNumber(+m)};return t===h?(0,c.Q1)(b):(0,c.E$)(b)}function G(e){var t=U(e);if(t===p){var n=D(e),r=n.granularity,i=n.month,a=n.day,o=n.time1,s=n.time2,u=n.date1,d=n.date2;return"day"===r?(0,c.Be)({date1:u,time1:o,date2:d,time2:s}):(0,c.FI)({month:i,day:a,time1:o,time2:s})}if(t===A)return M(e).monthDay;var l=L(e),f=l.monthDay,v=l.monthDayTime;return t===h?f:v}},92675:(e,t,n)=>{n.d(t,{Cs:()=>w,KU:()=>_,U7:()=>N,a4:()=>S,cl:()=>O,dF:()=>R,gk:()=>U,ji:()=>k,mS:()=>P,sY:()=>I});var r=n(89379),i=n(3453),a=n(21259),o=n(63039),s=n(61992),c=n(81748),u=s.e$.USD,d=s.gy.FAVORITE,l=s.gy.COIN,f=s.gy.SPOT,v=s.gy.MARGIN,p=s.gy.CONVERT,y=s.gy.FUTURES,h=s.gy.SWAP,A=s.gy.OPTION,g=s.gy.EVENTS,m=s.pn.INVERSE,b=s.pn.LINEAR,T=s.pn.UM,C=s.pn.XPERP;function I(e){var t=a.A.chainInfo,n=void 0===t?{}:t;return Object.keys(n).find(function(t){return e===n[t]})||""}function _(e){var t=a.A.chainInfo;return(void 0===t?{}:t)[e]||""}function E(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split("-").slice(0,3).join("-")}function k(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if((arguments.length>1?arguments[1]:void 0)===g){var t=e.split("-");
1return{baseCcy:t[0]||"",displayBaseCcy:t[0]||"",quoteCcy:"USDT",familyCcy:"",instFamily:"",isUm:!1,isXp:!1,ctType:"",isLinear:!1,expDate:t[3]||"",stk:"",optType:"",seriesId:E(e)}}var n=e.split("-"),r=(0,i.A)(n,5),a=r[0],o=void 0===a?"":a,s=r[1],c=void 0===s?"":s,d=r[2],l=void 0===d?"":d,f=r[3],v=void 0===f?"":f,p=r[4],y=void 0===p?"":p,h=c.split("_"),A=(0,i.A)(h,3),I=A[0],_=void 0===I?"":I,k=A[1],S=void 0===k?"":k,w=A[2],P=void 0===w?"":w,N=c===u,O=N?m:b;return{baseCcy:o,displayBaseCcy:o,quoteCcy:_,familyCcy:c,instFamily:e?"".concat(o,"-").concat(c):"",isUm:S===T,isXp:P===C,ctType:O,isLinear:!N,expDate:l,stk:v,optType:y}}function S(e,t){return e===g?E(t):k(t).instFamily}function w(e){return{isFavorite:d===e,isCoin:l===e,isSpotOrMargin:[f,v].includes(e),isSpot:f===e,isMargin:v===e,isSwap:h===e,isFutures:y===e,isFuturesOrSwap:[y,h].includes(e),isOption:A===e,isEvents:g===e,isDerivative:[y,h,A,g].includes(e),isInst:[f,v,y,h,A,g].includes(e)}}function P(e){var t=e.bizType,n=e.chainId,r=e.tokenContractAddress,i=e.instType,a=e.instId,u=e.seriesId,d=e.alias,l=e.isStrategy;if(t===s.gy.CEDEFI)return n&&r?(0,c.rf)(_(n),r):(0,o.CZ)("/trade-cedefi");if(!i)return(0,o.CZ)("/trade");if(!a||i===y&&!s.nE[d])return(0,o.CZ)("/trade-".concat(i).toLowerCase());var f=a;switch(i){case y:f=(0,c.cj)(k(a),d);break;case A:f=(0,c.pu)(k(a));break;case g:f=(0,c.Xz)(a,u)}var v=l?"-strategy":"";return(0,o.CZ)("/trade-".concat(i).concat(v,"/").concat(f).toLowerCase())}function N(e){var t=e.instType,n=e.ruleType,r=e.displayId||e.instId;if(!t||!r)return"";switch(t){case l:return(0,c.qj)(r);case f:case v:case p:return(0,c.Km)(r);case A:return(0,c.a1)(k(r));case y:return(0,c.xI)(k(r),n);case h:return(0,c.qS)(k(r));case g:return(0,c.Tp)(r);default:return""}}function O(e){var t=e.instType,n=e.displayId||e.instId;if(!t||!n)return"";switch(t){case f:case v:return(0,c.RY)(n);case y:case h:case A:return(0,c.Me)((0,r.A)({hasXp:!0},k(n)));case g:return(0,c.jp)(n);default:return""}}function R(e){var t=e.instType,n=e.instId;return t&&n?(0,c.E3)(n):""}function U(e){var t=e.instType,n=e.instId;return t&&n?(0,c.lx)(n):""}},55903:(e,t,n)=>{n.d(t,{Q:()=>a});var r=n(3453),i=n(61992);function a(e){var t=e.insts,n=void 0===t?[]:t,a=e.blackCcys,o=void 0===a?{}:a,s=e.isSearch,c=void 0!==s&&s,u=e.compareField,d=void 0===u?"baseCcy":u,l=e.filterNewCoins,f=void 0===l||l,v=e.filterPreMarket,p=void 0===v||v,y=e.filterOffline,h=void 0===y||y;return n.filter(function(e){var t=e.isoFlag,n=e.isLive,a=void 0===n||n,s=e.isPreMarket,u=e.status,l=e.ruleType;if(h&&u===i.O6.OFFLINE)return!1;var v=!f||a,y=e[d],A="string"===typeof y?y.split("-"):[""],g=(0,r.A)(A,1)[0],m=o[g.toUpperCase()],b=Boolean(m);c&&(b=m&&(null===m||void 0===m?void 0:m.searchLimit));var T=void 0===s?[i.mm.PRE_MARKET,i.mm.REBASE_CONTRACT].includes(null!==l&&void 0!==l?l:""):s;return(!b&&v||t===i.hG.NO)&&(!p||!T)})}},96802:(e,t,n)=>{n.d(t,{M:()=>c,O:()=>s});var r=n(23352),i=n(48257),a=n(16901),o=n(79078);function s(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).readCookie,t=void 0!==e&&e;return(a.kU||t?(0,i.ki)(o.hv)||r.zG.dark:(0,i.j1)())===r.zG.dark?r.zG.dark:r.zG.light}function c(){return s()===r.zG.dark}},40722:(e,t,n)=>{n.d(t,{S:()=>l,q:()=>f});var r=n(64467),i=n(61992),a=n(79078),o=n(93794),s=n(90241),c=n(39326),u=n(97879),d=(0,r.A)((0,r.A)((0,r.A)({},u.B8.STRATEGY,"marketplace_home_cardtitle_backtested_apy"),u.B8.FINANCE,"trade_subscribe_modal_item_rate"),i.gy.OPTION,"trade_pricelist_colheader_mark_price"),l=function(e){var t=d[e]||"trade_pricelist_colheader_latest_price";return(0,s.s3)(t)},f=function(){var e=o.A.upDownTimeZone,t=c.em[e]||c.em[a.Bz.H_24];return(0,s.s3)(t)}},8709:(e,t,n)=>{n.d(t,{$Z:()=>I,v4:()=>_});var r,i=n(64467),a=n(61992),o=n(79078),s=o.nj.TRADE,c=o.nj.SINGLE,u=o.nj.MULTI,d=o.nj.PM,l=a.gy.ALL,f=a.gy.SPOT,v=a.gy.MARGIN,p=a.gy.SWAP,y=a.gy.FUTURES,h=a.gy.OPTION,A=a.gy.FAVORITE,g=a.gy.COIN,m=a.gy.FUTURES_SWAP,b=a.gy.CEDEFI,T=a.gy.EVENTS,C=a.gy.EVENT_OPTION,I=((0,i.A)((0,i.A)((0,i.A)((0,i.A)({},s,"simple"),c,"single_currency"),u,"cross_currency"),d,"portfolio_margin"),(0,i.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)({},l,l),f,f),v,v),p,"PERPETUAL"),y,y),h,h),T,"EVENTS"),{WATCHLIST:"watchlist",NAV_LIST:"nav_list",GLOBAL_SEARCH:"global_search"}),_=(r={},(0,i.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)(r,g,"coin"),A,"favorites"),l,"all"),f,"spot"),v,"margin"),p,"perpetual"),y,"futures"),h,"option"),m,"futures"),b,"cedefi"),(0,i.A)((0,i.A)(r,T,"events"),C,"event_option"))},39326:(e,t,n)=>{n.d(t,{Bn:()=>
1d,CQ:()=>A,Cl:()=>f,Hc:()=>w,LH:()=>S,TK:()=>h,Ti:()=>m,Wq:()=>v,Ws:()=>y,eT:()=>c,em:()=>l,kd:()=>p,lO:()=>E,v9:()=>k,vV:()=>g,yd:()=>u});var r=n(64467),i=n(29305),a=i.dy.NONE,o=i.dy.ASC,s=i.dy.DESC,c="watch-scroll-box",u="data-type",d="data-id",l=(0,r.A)((0,r.A)((0,r.A)({},i.v8.H_24,"trade_pricelist_colheader_change_24h"),i.v8.UTC_0,"trade_pricelist_colheader_change20"),i.v8.UTC_8,"trade_pricelist_colheader_change8"),f=((0,r.A)((0,r.A)((0,r.A)({},a,s),s,o),o,a),{NAME:"name",CHG:"chg",VOLUME:"volume",TURNOVER:"turnover",VALUE:"value",LAST:"last",FUNDING_RATE:"fundingRate"}),v={HOT:"HOT",GAINERS:"GAINERS",LOSERS:"LOSERS"},p=((0,r.A)((0,r.A)((0,r.A)({},v.HOT,"hot"),v.GAINERS,"gainers"),v.LOSERS,"losers"),{EVENT:"EVENT",OPTION:"OPTION"}),y={ALL:"ALL",PRICE_UP_DOWN:"PRICE_UP_DOWN",PRICE_ABOVE:"PRICE_ABOVE",PRICE_HIT:"HIT",PRICE_BETWEEN:"BETWEEN",BASE_EVENT:"BASE_EVENT"},h=((0,r.A)((0,r.A)({ALL:"trade_event_futures_filter_tab_all_events",MIN:"trade_event_futures_filter_option_size_min_price",HOUR:"trade_event_futures_activity_filter_chips_hour_price",DAILY:"web_biz_combined_trade_charts_option_daily",WEEK:"trade_event_futures_nav_tab_weekly_price",MONTH:"trade_event_futures_tradepair_tab_monthlyprice",PRICE_ABOVE:"trade_event_futures_filter_tab_price_above"},y.PRICE_HIT,"web_biz_combined_trade_activity_chips_price_hit"),y.PRICE_BETWEEN,"web_biz_combined_trade_nav_chips_price_between"),{MIN:"web_biz_combined_trade_activity_dropdown_min_evt",HOUR:"web_biz_combined_trade_dropdown_option_hour_events",DAILY:"web_biz_combined_trade_dropdown_option_daily",WEEK:"webct_activity_filter_option_weekly_events",MONTH:"web_biz_combined_trade_dropdown_option_monthly"}),A=(0,r.A)((0,r.A)({PRICE_UP_DOWN:"web_bct_dropdown_option_updown_events",PRICE_ABOVE:"web_biz_combined_trade_dropdown_option_price_above_1"},y.PRICE_HIT,"web_biz_combined_trade_dropdown_option_price_hit_1"),y.PRICE_BETWEEN,"web_biz_combined_trade_dropdown_option_prc_btwn"),g={ALL:"web_biz_combined_trade_activity_filter_chips_all",SUB_MODE_EVENTS:"web_biz_combined_trade_nav_menu_events",SUB_MODE_OPTIONS:"web_biz_combined_trade_dropdown_menu_options",CCY_EVENTS:"web_biz_ct_activity_filter_option_ccy_events"},m={ALL:"ALL",EVENTS_DROPDOWN:"EVENTS_DROPDOWN",FREQ_DROPDOWN:"FREQ_DROPDOWN",METHOD_DROPDOWN:"METHOD_DROPDOWN",CCY_DROPDOWN:"CCY_DROPDOWN",CCY:"CCY",OPTION_TAB:"OPTION_TAB"},b="MIN",T="HOUR",C="DAILY",I="WEEK",_="MONTH",E=(0,r.A)((0,r.A)((0,r.A)((0,r.A)((0,r.A)({},b,"trade_event_futures_pricelist_title_min_price"),T,"trade_event_futures_pricelist_label_hour_price"),C,"web_biz_combined_trade_event_updown_daily_short_name"),I,"trade_event_futures_pricelist_label_weekly_price"),_,"trade_event_futures_pricelist_label_monthly"),k=(0,r.A)((0,r.A)({PRICE_ABOVE:"trade_event_futures_activity_filter_label_btc_price_above"},y.PRICE_HIT,"web_biz_combined_trade_reminder_pushmsg_price_hit"),y.PRICE_BETWEEN,"web_biz_combined_trade_orderform_input_price_range"),S=((0,r.A)((0,r.A)({PRICE_ABOVE:"trade_marketevents_title_price_above_date"},y.PRICE_HIT,"wt_pricelist_label_price_hit_date"),y.PRICE_BETWEEN,"wt_pricechart_label_price_between_date"),(0,r.A)((0,r.A)((0,r.A)({ALL:"trade_marketevents_tab_all_events",MIN:"trade_event_futures_activity_filter_chips_min_price",HOUR:"trade_event_futures_dropdown_option_hour_price",DAILY:"wt_dropdown_option_daily",WEEK:"trade_event_futures_nav_tab_weekly_price_two",MONTH:"trade_event_futures_activity_filter_tab_monthly_price",PRICE_UP_DOWN:"wt_dropdown_option_up_down_events",PRICE_ABOVE:"wt_reminder_option_price_above_events"},y.PRICE_HIT,"wt_reminder_option_price_hit_events"),y.PRICE_BETWEEN,"wt_reminder_option_price_between_events"),"BASE_EVENT","trade_marketevents_tab_ccy_events"),(0,r.A)((0,r.A)((0,r.A)((0,r.A)((0,r.A)({},b,"trade_event_futures_pricechart_title_min_price"),T,"trade_event_futures_pricechart_title_hour_price"),C,"wt_pricechart_title_daily_price"),I,"trade_event_futures_pricechart_title_weekly_price"),_,"trade_event_futures_pricechart_title_monthly_price"),{IDLE:"IDLE",SUCCESS:"SUCCESS",FAIL:"FAIL"}),w={IDLE:"IDLE",EDIT_ALL:"EDIT_ALL",EDIT_GROUP:"EDIT_GROUP",ADD_TO_GROUPS:"ADD_TO_GROUPS"}},48769:(e,t,n)=>{n.d(t,{z:()=>i});var r=n(61992),i=function(e){var t=e||{},n=t.bizType,i=void 0===n?"":n,a=t.chainId,o=void 0===a?"":a,s=t.tokenContractAddress,c=void 0===s?"":s;return!(i===r.gy.CEDEFI||o&&c)}},13445:(e,t,n)=>{n.d(t,{DK:()=>p,_8:()=>h,an:()=>y,b8:()=>v,eT:()=>f,i4:()=>l,iy:()=>A,ov:()=>g});var r=n(64467),i=n(61992);if(726!=n.j)var a=n(39326);var o=i.gy.SPOT,s=i.gy.FUTURES_SWAP,c=i.gy.PRE_MARKET,u=i.gy.CEDEFI,d=i.gy.EVENT_OPTION,l="common-nav-theme-light",f=726!=n.j?a.eT:null,v="navList
1ChangeInst",p=(0,r.A)((0,r.A)((0,r.A)((0,r.A)((0,r.A)({},o,"spot"),s,"futures"),c,"pre_market"),u,"cedefi"),d,"event_option"),y={TOKEN_CARD:"token card",SEARCH:"search"},h={GROUP:"group",INST:"inst",DATE_TAB:"dateTab",MORE:"more"},A={CEDEFI_SEARCH_DEBOUNCE:300,VISIBLE_MARKETS_REQ:200,SIMPLE_PRODUCTS_REFRESH:1e3},g=4},2169:(e,t,n)=>{n.d(t,{A:()=>a});var r=n(77594),i=n(37864);const a=function(){var e=(0,r.s)();return(0,i.rV)(e)}},29863:(e,t,n)=>{n.d(t,{A:()=>a});var r=n(41594),i=n(57187);const a=function(){var e=(0,r.useCallback)(function(){Promise.resolve().then(function(){(0,i.e)(!0)}).catch(function(){})},[]),t=(0,r.useCallback)(function(){(0,i.e)(!1)},[]);return(0,r.useEffect)(function(){return i.e},[]),{onMouseEnter:e,onMouseLeave:t}}},80895:(e,t,n)=>{n.d(t,{A:()=>i});var r=n(13445);const i=function(e){var t=new CustomEvent(r.b8,{detail:e});document.dispatchEvent(t)}},57187:(e,t,n)=>{n.d(t,{e:()=>i});var r=n(40401),i=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=window.document.body;if(!(0,r.f)()){var n,i,a,o,s=window.innerWidth-((null===(n=window)||void 0===n||null===(i=n.document)||void 0===i||null===(a=i.body)||void 0===a?void 0:a.clientWidth)||0);if(e){var c=Math.max(s,0);o={overflow:"hidden",height:"100vh",paddingRight:"".concat(c,"px")}}else o={overflow:"",height:"",paddingRight:""};Object.assign(t.style||{},o)}}},90024:(e,t,n)=>{n.d(t,{A:()=>A});var r=n(19919),i=n(41594),a=n(41140),o=n(61992),s=n(79754),c=n(95922),u=n(90241);const d="countdown_container__xK+O-",l="countdown_time__Hqs-5",f="countdown_text__oShde";const v=function(e){return(0,i.useMemo)(function(){return e===o.qC.CONTINUOUS?(0,u.s3)("trade_list_text_callauction_countdown"):e===o.qC.PRE_QUOTE?(0,u.s3)("trade_premarket_title_time_to_prequote"):(0,u.s3)("trade_list_text_listing_countdown")},[e])};const p=(0,a.observer)(function(e){var t=e.inst,n=void 0===t?{}:t,a=n.day,o=n.hour,s=n.minute,p=n.second,y=n.openMethod,h=(0,u.s3)("trade_charts_text_day"),A=v(y),g=(0,i.useMemo)(function(){return 0===a?"".concat(o,":").concat(s,":").concat(p):"".concat(a).concat(h).concat(o,":").concat(s,":").concat(p)},[a,h,o,s,p]);return(0,r.jsxs)("div",{className:d,children:[(0,r.jsx)("span",{className:l,children:(0,c.u)(g)}),(0,r.jsx)("span",{className:f,children:A})]})}),y="soon_soon__tDBev";const h=function(){return(0,r.jsx)("span",{className:y,children:(0,u.s3)("trade_list_text_coming_soon")})};const A=(0,a.observer)(function(e){var t=s.A.newCoins[e.instId]||{},n=t.instId,i=t.type;return n&&i===o.dx.ONLINE?(0,r.jsx)(p,{inst:t}):n&&i===o.dx.SOON?(0,r.jsx)(h,{}):"--"})},59724:(e,t,n)=>{n.d(t,{A:()=>f});var r=n(64467),i=n(89379),a=n(80045),o=n(19919),s=n(1744),c=n.n(s),u=n(69132);n(62674);const d="index_commonTag__Kkvoa";var l=["label","className"];const f=function(e){var t=e.label,n=e.className,s=(0,a.A)(e,l);return(0,o.jsx)(u.A,(0,i.A)((0,i.A)({category:u.A.CATEGORY.fill,size:u.A.SIZE.sm,className:c()(n,(0,r.A)({},d,!(null!==s&&void 0!==s&&s.color)))},s||{}),{},{children:t}))}},42308:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(61992),i=r.Al.CALL_AUCTION,a=r.Al.PRE_QUOTE_IND;const o=function(e){var t=e.listStage;return[i,a].includes(t)}},94026:(e,t,n)=>{n.d(t,{A:()=>c});var r=n(64467),i=n(61992),a=n(90241),o=i.Al.CALL_AUCTION,s=i.Al.PRE_QUOTE_IND;const c=function(e){var t=e.listStage;return(0,r.A)((0,r.A)({},o,(0,a.s3)("trade_markets_call_auction_wbct")),s,(0,a.s3)("trade_markets_preopen_wbct"))[t]||"--"}},79320:(e,t,n)=>{n.d(t,{O9:()=>k,Zt:()=>w});var r=n(64467),i=n(89379),a=n(64780),o=n(77271),s=n(61992),c=n(36055),u=n(90241),d=n(49819),l=n(92675),f=n(39326),v=n(30175),p=f.Ws.PRICE_UP_DOWN,y=f.Ws.PRICE_BETWEEN,h=s.gy.COIN,A=s.gy.SPOT,g=s.gy.MARGIN,m=s.gy.FUTURES,b=s.gy.SWAP,T=s.gy.OPTION,C=s.gy.CEDEFI,I=s.gy.EVENTS,_=s.$H.C,E=function(e){var t=e.instType,n=e.instId,r=e.displayId;return(0,i.A)((0,i.A)({},e),{},{name:(0,l.U7)({instType:t,instId:n,displayId:r}),spotLever:(0,v.ge)((0,c.ks)({instType:t,instId:n,useBorrowLever:!0}))})},k=function(e){var t=e.instId,n=e.method,r=e.seriesId,a=e.stk,s=e.periodTime,c=e.periodUnit,d=(0,v.HN)(t),l=d.baseCcy,h=d.capStrike,A=void 0===h?"":h,g=a?o.Ru.formatNumber(a):"",m=g;if(n===y)if(a&&0===Number(a)&&A&&"INF"!==A)m="< ".concat(o.Ru.formatNumber(A));else if("INF"===A&&a)m="\u2265 ".concat(g);else{var b={priceLow:g,priceHigh:A?o.Ru.formatNumber(A):""};m=(0,u.s3)("web_biz_combined_trade_results_num_price_range",b)}var T=f.lO[c],C=T&&(0,u.s3)(T,{ccy:l,time:s}),I=(0,u.s3)(f.v9[n],{ccy:l}),_=n===p,E=_?C:m,k=_?C:I;return(0,i.A)((0,i.A)({},e),{},{isPriceUpDown:_,baseCcy:l,stkValue:g,label:E,groupLabel:k,groupKey:r})},S=(0,r.A)((0,r.A)((0,r.A)((0,r.A)((0,r.A)((0,r.A)((0,r.A)((0,r.A)({},h,function(e){var t=e.symbol,n=e.displaySymbol,r=h,a=t;return(0,i.A)((0,i.A)({},e),{},{instType:r,instId:a,baseCcy:t,name:n||t})}),A,E),g,E),m,function(e){var t=e.instType,n=e.instId,r=e.ruleType,a=e.displayId,o=void 0===a?"":a,c=(0,l.ji)(n),u=c.isXp,d=c.baseCcy,f=c.quoteCcy,v=(0,l.U7)({instType:t,displayId:o,instId:n,ruleType:r});return u&&(v="".concat(d).concat(f," ").concat(s.pn.UM)),(0,i.A)((0,i.A)({},e),{},{name:v})}
1),b,function(e){var t=e.displayId,n=void 0===t?"":t,r=e.instId,a=void 0===r?"":r,o=e.instType;return(0,i.A)((0,i.A)({},e),{},{name:(0,l.cl)({instType:o,displayId:n,instId:a}),nameSuffix:(0,u.s3)("trade_pricelist_label_perpetual")})}),T,function(e){var t=e.instType,n=e.instId,r=e.stk,a=e.optType,o=e.isFavorites,s=a===_?"trade_pricelist_label_call":"trade_pricelist_label_put";return(0,i.A)((0,i.A)({},e),{},{name:o?(0,l.U7)({instType:t,instId:n}):d.Z5({price:r}),optType:o?null:(0,u.s3)(s),className:o?"":"col-4"})}),I,k),C,function(e){var t=e.tokenSymbol,n=e.tokenContractAddress;return(0,i.A)((0,i.A)({},e),{},{bizType:s.gy.CEDEFI,name:t,tokenAddress:(0,a.bc)(n,6,4)})}),w=function(e,t){var n;return(null===(n=S[e.instType])||void 0===n?void 0:n.call(S,e,t))||{}}},57919:(e,t,n)=>{n.d(t,{A:()=>M});var r=n(89379),i=n(64467),a=n(23029),o=n(92901),s=n(39874),c=n(85501),u=n(44497),d=n(40401),l=n(61992),f=n(58451),v=n(39455),p=n(39326),y=n(99181),h=n(13587),A=n(79754),g=n(48769),m=l.gy.COIN,b=l.gy.FUTURES,T=l.gy.CEDEFI,C=function(){return(0,o.A)(function e(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).root,n=void 0===t?{}:t;(0,a.A)(this,e),this.favorites={},this.batchMode=p.Hc.IDLE,this.batchOwnerId="",this.groupBatchTargetGroupName="",this.pendingFavorites={},this.favoritesStatus=p.LH.IDLE,this.coins=[],this.simpleProduct={},this.tradeCoins=[],this.dexCoins={},this.favoriteGroupIds=[],this.root=(0,r.A)({instStore:A.A},n),(0,d.f)()||(0,u.makeObservable)(this,{favorites:u.observable,batchMode:u.observable,batchOwnerId:u.observable,groupBatchTargetGroupName:u.observable,pendingFavorites:u.observable,favoritesStatus:u.observable,coins:u.observable,simpleProduct:u.observable,tradeCoins:u.observable,dexCoins:u.observable,favoriteGroupIds:u.observable,favoriteList:u.computed})},[{key:"favoriteList",get:function(){var e=this,t=[];return Object.values(this.favorites).forEach(function(n){var i,a=n.instType,o=n.instId,s=n.alias,c=n.favoriteGroupIds,u=h.A.getCedefiTokenKey(n),d=e.dexCoins[u];if((0,g.z)(n)||!d){var f=e.coins[o]||e.root.instStore.coins[o];if(a===m&&f){var v,p=null===(v=e.tradeCoins)||void 0===v?void 0:v.find(function(e){var t=e.instId;return o===t});t.push((0,r.A)((0,r.A)({},f),{},{tradeId:(null===p||void 0===p?void 0:p.tradeId)||"",tradeType:(null===p||void 0===p?void 0:p.tradeType)||"",isFavorites:!0,favoriteGroupIds:c,sortKey:y.Ay.setStarKey(f)}))}else{var A=function(e){var t=e.instId,n=e.instFamily,r=e.alias;return e.status!==l.O6.OFFLINE&&(o===t||a===b&&n===o&&r===s)},C=(null===(i=e.simpleProduct[a])||void 0===i?void 0:i.find(A))||e.root.instStore.simpleTypes[a].find(A);C&&t.push((0,r.A)((0,r.A)({},C),{},{isFavorites:!0,favoriteGroupIds:c,sortKey:y.Ay.setStarKey(C)}))}}else t.push((0,r.A)((0,r.A)((0,r.A)({},n),d),{},{isFavorites:!0,bizType:T,favoriteGroupIds:c,sortKey:y.Ay.setStarKey(n)}))}),t}}])}(),I=l.gy.ALL,_=l.gy.FAVORITE,E=l.gy.COIN,k=l.gy.SPOT,S=l.gy.MARGIN,w=l.gy.FUTURES,P=l.gy.FUTURES_SWAP,N=l.gy.SWAP,O=l.gy.OPTION,R=l.gy.EVENTS,U=l.gy.CEDEFI,D=v.Jt(f.Kq)||{},L=v.Ht(f.Kq)||{};const M=new(function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,a.A)(this,t),(e=(0,s.A)(this,t,[n])).recommends=[],e.recommendsLoading=!0,e.selectRecommends={},e.tickers=(0,i.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)({},E,{}),k,{}),w,{}),N,{}),O,{}),R,{}),U,{}),e.openInterests=(0,i.A)((0,i.A)((0,i.A)({},w,{}),N,{}),O,{}),e.trends=(0,i.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)({},E,{}),k,{}),w,{}),N,{}),U,{}),e.ticker={},e.apiTickers=(0,i.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)({},E,{}),k,{}),w,{}),N,{}),R,{}),O,{}),U,{}),e.tradeGroup=[],e.groupIds={},e.tabStorage=(0,r.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)({},_,{}),E,{}),k,{}),S,{}),P,{}),O,{}),U,{}),"marketType",E),D),e.sessionStorage=(0,r.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)((0,i.A)({},_,{}),E,{}),k,{}),S,{}),P,{}),O,{}),L),(0,d.f)()||(0,u.makeObservable)(e,{recommends:u.observable.shallow,recommendsLoading:u.observable,selectRecommends:u.observable.shallow,tickers:u.observable,trends:u.observable,ticker:u.observable.shallow,sessionStorage:u.observable,tradeGroup:u.observable.ref,groupIds:u.observable.shallow,coinGroupIds:u.computed}),e}
1return(0,c.A)(t,e),(0,o.A)(t,[{key:"coinGroupIds",get:function(){var e=(0,i.A)((0,i.A)({},I,-1),p.Wq.HOT,-2);return this.tradeGroup.forEach(function(t){var n=t.value,r=t.code;e[n]=r}),Object.assign(e,this.groupIds),e}}])}(C))},43231:(e,t,n)=>{if(n.d(t,{Li:()=>p,YW:()=>T,iw:()=>b,y1:()=>h}),726!=n.j)var r=n(3453);var i=n(60436),a=n(61992),o=n(93794),s=n(92675),c=n(39326),u=a.gy.COIN,d=a.gy.CEDEFI,l=a.gy.EVENTS,f=a.gy.SPOT,v=(c.Cl.VOLUME,c.Cl.TURNOVER,c.Cl.CHG,c.Cl.VALUE,c.Cl.LAST,a.e$.USD),p=function(e){var t=e.markets,n=e.isOptionMark,i=e.showOpenInterest,a=[],o=[],c=[],u=[],l=[],f=[];return t.forEach(function(e){var t=e.instType,v=e.instId,p=(0,s.Cs)(t),y=p.isCoin,h=p.isOption,A=p.isEvents,g=p.isFuturesOrSwap;if(i&&(g||h)&&u.push(v),y)a.push(v);else if(t!==d)h&&n?c.push(v):(A&&f.push(v),o.push(v));else{var m=(null===v||void 0===v?void 0:v.split("-"))||[],b=(0,r.A)(m,2),T=b[0],C=b[1];l.push({chainId:T,tokenContractAddress:C})}}),{cedefiCoins:l,coins:a,tickers:o,marks:c,opens:u,events:f}},y=function(e){var t=e.sources,n=e.targets,r={};return t.forEach(function(e){var t=e.instType,i=e.instId;if(!n.find(function(e){return e.instId===i})&&(r[i]=e,![d,l].includes(t))){var a=(0,s.Cs)(t),o=a.isOption,c=a.isFuturesOrSwap,f=(0,s.ji)(i),p=f.isLinear,y=f.baseCcy,h=f.quoteCcy;if(!c||p){var A=h===v;if(!n.find(function(e){var t=e.instType,n=e.instId,r=void 0===n?"":n,i=(0,s.Cs)(t),a=i.isOption,o=i.isSpotOrMargin,c=i.isFuturesOrSwap,u=(0,s.ji)(r),d=u.baseCcy,l=u.quoteCcy;return a&&(A&&d===y||!A&&l===h)||o&&l===h||c&&l===h})){var g=o&&A?y:h;r[g]={instType:u,instId:g}}}}}),Object.values(r)},h=function(e){var t=e.dom,n=e.tickers;if(t){var r=t.querySelector(".".concat(c.eT));if(r){var i=r.querySelectorAll("[".concat(c.yd,"]"));if(i){for(var a=[],o=t.getBoundingClientRect(),s=o.height,u=o.width,d=r.getBoundingClientRect(),l=d.top,f=d.bottom,v=d.left,p=d.right,h=0,A=i.length;h<A;h++){var g=i[h],m=g.getBoundingClientRect(),b=m.top,T=m.bottom,C=m.left,I=m.right;if(!(T<l||C<v)){if(b>f+s||I>p+u)break;var _=g.getAttribute(c.yd),E=g.getAttribute(c.Bn);a.push({instType:_,instId:E})}}return{addMarkets:y({sources:a,targets:n}),deleteMarkets:y({sources:n,targets:a}),actMarkets:a}}}}},A=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.instType,n=void 0===t?"":t,r=e.instId,i=void 0===r?"":r,o=e.displayId,c=e.ruleType;return n===a.gy.SWAP?(0,s.cl)({instType:n,instId:i,displayId:o}):(0,s.U7)({instType:n,instId:i,displayId:o,ruleType:c})},g=["TRY"];function m(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",t=String(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toUpperCase(),n=String(e).toUpperCase();if(!t||!n)return{bag:0,ordered:0};for(var r=Math.max(t.length,n.length),i=t.split(""),a=0,o=0;o<n.length;o+=1){var s=i.indexOf(n[o]);s>=0&&(i.splice(s,1),a+=1)}for(var c=0,u=0,d=0;d<n.length;d+=1){var l=t.indexOf(n[d],u);l>=0&&(u=l+1,c+=1)}return{bag:a/r,ordered:c/r}}function b(e){var t=e.keyword,n=void 0===t?"":t,r=e.insts,a=void 0===r?[]:r,c=e.isDegradeSearch,u=void 0!==c&&c,d=n.trim().toUpperCase(),l=[],v=[],p=[],y=[],h=[],b=o.A.usdLinearSettleCcyList,T=void 0===b?[]:b;a.forEach(function(e){var t=e.instType,n=void 0===t?"":t,r=e.instId,a=void 0===r?"":r,o=e.searchName,c=void 0===o?"":o,u=e.searchMultiName,g=void 0===u?"":u,b=e.fullName,C=void 0===b?"":b,I=e.searchKey,_=void 0===I?[]:I,E=e.instFamily,k=void 0===E?"":E,S=e.displayId,w=void 0===S?"":S,P=e.tradeQuoteCcyList,N=A(e),O=(0,s.ji)(w||a),R=O.baseCcy,U=O.quoteCcy,D=O.isUm;if(R!==d){var L=N.toUpperCase();if(L.startsWith(d))v.push(e);else if((k||a).includes(d))v.push(e);else{var M=L.replace("/","");if(M.includes(d))p.push(e);else if([].concat((0,i.A)(P||[]),(0,i.A)(D?T:[])).some(function(e){return M.replace(U,e).includes(d)}))p.push(e);else if([c||C,g].concat((0,i.A)(Array.isArray(_)?_:[])).some(function(e){return"string"===typeof e&&e.toUpperCase().includes(d)}))y.push(e);else{var x=m(R,d),F=x.bag,j=x.ordered;if(F>=.8||j>=.6)h.push(e);else if(n===f){var B=d.replace(/[-/_\s]/g,"");[U].concat((0,i.A)(P||[])).some(function(e){return 1===m(M.replace(U,e),B).bag})&&h.push(e)}}}}else l.push(e)});var C=l.concat(v,p,y,h);return u?function(e){var t=[],n=[];return e.forEach(function(e){var r=(0,s.ji)(e.displayId||e.instId).quoteCcy;(g.includes(r)?n:t).push(e)}),[].concat(t,n)}(C):C}function T(e){var t=e.keyword,n=void 0===t?"":t,r=e.insts,i=void 0===r?[]:r,a=n.toUpperCase();return i.filter(function(e){var t=e.groupLabel;return(void 0===t?"":t).toUpperCase().includes(a)})}},30175:(e,t,n)=>{n.d(t,{CM:()=>E,HN:()=>k,JE:()=>S,L8:()=>w,PH:()=>b,bG:()=>g,er:()=>_,ge:()=>y,pc:()=>h,wP:()=>I,yZ:()=>m,yd:()=>A});var r=n(3453),i=n(89379);
1if(726!=n.j)var a=n(60436);var o=n(16901);if(726!=n.j)var s=n(61662);if(726!=n.j)var c=n(61992);var u=n(36055),d=n(79754);if(726!=n.j)var l=n(90241);var f=n(95524),v=n(92675),p=n(48769);var y=function(e){return(0,o.bS)()?"":(0,f.Yd)(e)},h=function(){return{value:c.gy.ALL,label:(0,l.s3)("spot_pricelist_tab_all")}},A=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.ctVal,n=void 0===t?"":t,r=e.ctMult,i=void 0===r?"":r,a=e.ctType,o=void 0===a?"":a,c=e.instType;return(0,v.Cs)(c).isDerivative?{ctVal:n,ctMult:i,ctType:o}:s.t0},g=function(e){var t=e||{},n=t.isTradable,r=t.instType,i=(0,v.Cs)(r).isDerivative;return!1===n&&((0,o.yr)()||i)},m=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(0,v.mS)(e)||"";return g(e)&&(0,u.Mt)((0,i.A)((0,i.A)({},t),{},{instType:e.instType,instId:e.instId,redirect:n,checkInst:!1,checkPendingQuestionnaire:!1}))||n},b=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.isLive,n=void 0===t||t,r=e.instType,i=void 0===r?"":r;return!n&&[c.gy.SPOT,c.gy.SWAP].includes(i)},T={MIN:"MIN",H:"HOUR",W:"WEEK",M:"MONTH"},C={DAILY:"DAILY",WEEKLY:"WEEK",MONTHLY:"MONTH"},I=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=/^(\d+)([a-zA-Z]+)$/.exec(e);if(t){var n=t[2];return{time:Number(t[1]),unit:T[n]||n}}return{time:void 0,unit:C[e]||e}},_=function(e,t){var n=(0,a.A)(e),r=n.length-1;return t.forEach(function(e){var t=n.findIndex(function(t){return t.value===e.value});t>=0?r=t:(r+=1,n.splice(r,0,e))}),n},E=function(e){var t=function(e){return"number"!==typeof(null===e||void 0===e?void 0:e.weight)||Number.isNaN(e.weight)?Number.POSITIVE_INFINITY:e.weight};return(0,a.A)(e).sort(function(e,n){var r=t(e),i=t(n);return r===i?0:r-i})},k=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split("-"),t=(0,r.A)(e,7),n=t[0],i=void 0===n?"":n,a=t[1],o=void 0===a?"":a,s=t[2],c=void 0===s?"":s,u=t[3],d=void 0===u?"":u,l=t[4],f=void 0===l?"":l,v=t[5],p=void 0===v?"":v,y=t[6];return{baseCcy:i,kind:o,period:c,date:d,time:f,floorStrike:p,capStrike:void 0===y?"":y}},S=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(null===t||void 0===t||!t.length)return e;var n=new Map(e.map(function(e){return[e.instId,e]}));return t.map(function(e){return n.get(e)}).filter(Boolean)},w=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map(function(e){var t;if(!(0,p.z)(e))return e;var n=e.instId,r=e.coinName,a=e.fullName,o=(0,v.ji)(n||"").baseCcy,s=(null===(t=d.A.coins)||void 0===t?void 0:t[o])||{},c=s.commodityTag,u=s.name,l=s.searchKey,f=c||a||r||u||"";return(0,i.A)((0,i.A)({},e),{},{fullName:f,searchMultiName:c,searchName:a||r||u,searchKey:Array.isArray(l)?l:[]})})}},81696:()=>{},23631:()=>{},18279:()=>{},60884:()=>{},58704:()=>{},16136:()=>{},55554:()=>{},40097:()=>{},86847:()=>{},48558:()=>{},62674:()=>{},18621:()=>{}}]); 2//# sourceMappingURL=https://static-daily.okg.com/crash/okfe/okx-nav/common/3759.ade35d98.js.map
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.