1/*! For license information please see 5649.3dcbabb1c9d6a14d.js.LICENSE.txt */ 2"use strict";(self.webpackChunkweb=self.webpackChunkweb||[]).push([["5649"],{39288:function(e,t,n){n.d(t,{A:()=>l});let l=(0,n(20010).A)("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]])},98710:function(e,t,n){n.d(t,{Xj:()=>i,mr:()=>a,yE:()=>r});var l=n(46332);let s="edgex-position-voucher-pending";function a(e){"undefined"!=typeof window&&sessionStorage.setItem(s,JSON.stringify(e.raw))}function i(e){if("undefined"==typeof window)return null;let t=sessionStorage.getItem(s);if(!t)return null;try{let n=l.Qd1.fromRaw(JSON.parse(t));return n.id===e?n:null}catch{return sessionStorage.removeItem(s),null}}function r(){"undefined"!=typeof window&&sessionStorage.removeItem(s)}},89469:function(e,t,n){n.d(t,{i:()=>d});var l=n(78363),s=n(46332),a=n(75892),i=n(70544),r=n(7068),o=n(81923),c=n(64434),u=n(58521);function d(){let e=(0,a.A)(),t=(0,o.Ay)(e=>e.metadata),n=(0,c._3)(),d=(0,i.Y)(),{tickers:m}=(0,r.tr)(),{currentActiveAccount:x,position:h,order:p,collateral:f,withdraw:v,transferOut:g}=(0,u.d_)(),y=s.WM0.createPositionsFromRaw(h,e);return s=>{var a,i,r,o;let c=e.find(e=>e.contractId===s.contractId);if(!x||!c)return null;let u=c.contractName===n,h=m.get(c.contractName);return l.p4.calculate({context:{contractId:s.contractId,metadata:t,account:x,positions:y,orders:p,collaterals:f,withdraws:v,transfers:g,symbolsList:e,tickers:m,orderBook:{ask1:u?String(null!=(a=d.bestAskPrice)?a:0):null!=(i=null==h?void 0:h.bestAskPriceExact)?i:"0",bid1:u?String(null!=(r=d.bestBidPrice)?r:0):null!=(o=null==h?void 0:h.bestBidPriceExact)?o:"0"}},voucherValue:s.value,voucherLeverage:s.leverage})}}},1501:function(e,t,n){n.d(t,{JK:()=>s,fT:()=>a});let l="NORMAL";function s(e){var t,n;return`${null!=(t=e.contractId)?t:""}:${null!=(n=e.positionSource)?n:l}`}function a(e){var t;return{...e,id:s(e),positionSource:null!=(t=e.positionSource)?t:l}}},67168:function(e,t,n){n.d(t,{x:()=>a});var l=n(26017),s=n(55929);function a(e){if(null==e||!(0,s.Bg)(e))return null;let t=(0,s.m2)(e);return!t.isFinite()||t.isNegative()||t.gt(999.99)?null:(0,l.l9)(t.toFixed(),{input:"percent",precision:2,minPrecision:0,trimZeros:!0})}},18882:function(e,t,n){n.r(t),n.d(t,{default:()=>ed});var l=n(65723),s=n(20305),a=n(22155),i=n(55748),r=n(81020),o=n(99168),c=n(14008),u=n(39288),d=n(26376),m=n(93840),x=n(71794),h=n(40482),p=n(59200),f=n(67903),v=n(24667),g=n(92743),y=n(1398),N=n(55929);let b=n.p+"static/image/bonus-voucher-redeemed-success.ca39a0ae.png";var j=n(37671),w=n.n(j),I=n(4785),E=n.n(I),S=new(w())({id:"bonus-voucher-reclaiming",use:"bonus-voucher-reclaiming-usage",viewBox:"0 0 12 12",content:'<symbol xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 12 12" id="bonus-voucher-reclaiming"><g clip-path="url(#bonus-voucher-reclaiming_a)"><path stroke="#FF8F34" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.33" d="M4 4.5 2.5 3 1 4.5M2.5 3v5a1 1 0 0 0 1 1h3M8 7.5 9.5 9 11 7.5M9.5 9V4a1 1 0 0 0-1-1h-3" /></g><defs><clipPath id="bonus-voucher-reclaiming_a"><path fill="#fff" d="M0 0h12v12H0z" /></clipPath></defs></symbol>'});E().add(S);var V=n(16044);function O(){let[e,t]=(0,a.useState)(""),[n,l]=(0,a.useState)([]);return{offsetData:e,currentPage:n.length+1,isFirstPage:0===n.length,reset:()=>{t(""),l([])},goNext:n=>{n&&(l(t=>[...t,e]),t(n))},goPrevious:()=>{l(e=>{var n;let l=[...e];return t(null!=(n=l.pop())?n:""),l})}}}let _=(e,t)=>{let n=Number(e);return Number.isFinite(n)&&n>0&&t>=n};function T(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),l=Number.isFinite(t=Number(e.redeemedTime))&&t>0||"VOUCHER_STATUS_ACTIVE"===e.status||"VOUCHER_STATUS_PENDING_RECLAIM"===e.status;if("VOUCHER_STATUS_GRANTED"===e.status)return _(e.expireTime,n)?{listStatus:"EXPIRED",canRedeem:!1,canViewDetails:l,isInEffect:!1}:{listStatus:"PENDING",canRedeem:!l&&(!e.effectiveTime||"0"===e.effectiveTime||_(e.effectiveTime,n)),canViewDetails:l,isInEffect:!1};if("VOUCHER_STATUS_ACTIVE"===e.status||"VOUCHER_STATUS_PENDING_RECLAIM"===e.status)return{listStatus:"PENDING",canRedeem:!1,
2canViewDetails:l,isInEffect:!0};if("VOUCHER_STATUS_EXPIRED"===e.status)return{listStatus:"EXPIRED",canRedeem:!1,canViewDetails:l,isInEffect:!1};if("VOUCHER_STATUS_CLOSED"===e.status){let t="INVALID";return"CLOSE_REASON_FULLY_CONSUMED"===e.closeReason?t="USED":"CLOSE_REASON_EXPIRED"===e.closeReason?t="EXPIRED":("CLOSE_REASON_OPERATOR_RECLAIMED"===e.closeReason||"CLOSE_REASON_ACCOUNT_BONUS_CLEARED"===e.closeReason)&&(t="INVALID"),{listStatus:t,canRedeem:!1,canViewDetails:l,isInEffect:!1}}return{listStatus:"INVALID",canRedeem:!1,canViewDetails:l,isInEffect:!1}}var D=n(81923),P=n(65250);function A(e){var t,n,a,r,o;let c,u,d,m,x,h,f,g,y,N,j,w,I,E,S,V,O,_,T,P,A,R,C,U,L,k,H,B,z,$,M,F,G,K,Q,X,Y,q,W=(0,s.c)(96),{voucher:J,symbol:Z,open:ee,onOpenChange:et,onGoToTrade:en}=e,el=(0,p.A)(),es=(0,D.tk)();if(!J)return null;W[0]!==(null==es?void 0:es.coinList)||W[1]!==(null==Z?void 0:Z.quoteCoin)||W[2]!==J?(c=null!=(r=null!=(a=null==es||null==(n=es.coinList)||null==(t=n.find(e=>e.coinId===J.coinId))?void 0:t.coinName)?a:null==Z?void 0:Z.quoteCoin)?r:"",W[0]=null==es?void 0:es.coinList,W[1]=null==Z?void 0:Z.quoteCoin,W[2]=J,W[3]=c):c=W[3];let ea=c;W[4]!==Z||W[5]!==J?(u=null!=(o=null==Z?void 0:Z.formatBonusAmount(J.grantAmount))?o:J.grantAmount,W[4]=Z,W[5]=J,W[6]=u):u=W[6];let ei=u;W[7]!==el?(d=el("bonusVoucher.perpsMainAccount"),W[7]=el,W[8]=d):d=W[8];let er=d;return W[9]===Symbol.for("react.memo_cache_sentinel")?(m=(0,l.jsx)("img",{src:b,alt:"",className:"pointer-events-none absolute top-[-72px] left-1/2 z-10 size-44 max-w-none -translate-x-1/2"}),W[9]=m):m=W[9],W[10]!==el?(x=el("bonusVoucher.redeemedSuccessfully"),W[10]=el,W[11]=x):x=W[11],W[12]!==x?(h=(0,l.jsx)(v.L3,{className:"sr-only",children:x}),W[12]=x,W[13]=h):h=W[13],W[14]!==el?(f=el("bonusVoucher.redeemedSuccessfully"),W[14]=el,W[15]=f):f=W[15],W[16]!==f?(g=(0,l.jsx)(v.rr,{className:"sr-only",children:f}),W[16]=f,W[17]=g):g=W[17],W[18]!==h||W[19]!==g?(y=(0,l.jsxs)(v.c7,{className:"sr-only",children:[h,g]}),W[18]=h,W[19]=g,W[20]=y):y=W[20],W[21]!==el?(N=el("bonusVoucher.redeemedSuccessfully"),W[21]=el,W[22]=N):N=W[22],W[23]!==N?(j=(0,l.jsx)("h2",{className:"text-text-primary text-center text-lg leading-6 font-medium",children:N}),W[23]=N,W[24]=j):j=W[24],W[25]!==ei||W[26]!==ea?(w=(0,l.jsxs)("span",{className:"text-theme-normal text-2xl font-medium",children:["+ ",ei," ",ea]}),W[25]=ei,W[26]=ea,W[27]=w):w=W[27],W[28]!==er?(I=(0,l.jsx)("span",{className:"text-text-tertiary text-[13px]",children:er}),W[28]=er,W[29]=I):I=W[29],W[30]!==w||W[31]!==I?(E=(0,l.jsxs)("div",{className:"flex flex-col items-center gap-2.5 leading-5 whitespace-nowrap",children:[w,I]}),W[30]=w,W[31]=I,W[32]=E):E=W[32],W[33]!==j||W[34]!==E?(S=(0,l.jsxs)("div",{className:"flex h-[118px] shrink-0 flex-col items-center justify-center gap-3 py-4",children:[j,E]}),W[33]=j,W[34]=E,W[35]=S):S=W[35],W[36]!==el?(V=el("bonusVoucher.voucherType"),W[36]=el,W[37]=V):V=W[37],W[38]!==V?(O=(0,l.jsx)("span",{className:"text-text-primary text-sm leading-[22px] font-medium",children:V}),W[38]=V,W[39]=O):O=W[39],W[40]!==el?(_=el("bonusVoucher.type"),W[40]=el,W[41]=_):_=W[41],W[42]!==_?(T=(0,l.jsx)("span",{className:"text-text-primary flex-1 text-right text-sm leading-[22px] font-normal",children:_}),W[42]=_,W[43]=T):T=W[43],W[44]!==O||W[45]!==T?(P=(0,l.jsxs)("div",{className:"flex h-[22px] items-center justify-between",children:[O,T]}),W[44]=O,W[45]=T,W[46]=P):P=W[46],W[47]!==el?(A=el("bonusVoucher.voucherValue"),W[47]=el,W[48]=A):A=W[48],W[49]!==A?(R=(0,l.jsx)("span",{className:"text-text-primary text-sm leading-[22px] font-medium",children:A}),W[49]=A,W[50]=R):R=W[50],W[51]!==ei||W[52]!==ea?(C=(0,l.jsxs)("span",{className:"text-text-primary flex-1 text-right text-sm leading-[22px] font-normal",children:[ei," ",ea]}),W[51]=ei,W[52]=ea,W[53]=C):C=W[53],W[54]!==R||W[55]!==C?(U=(0,l.jsxs)("div",{className:"flex h-[22px] items-center justify-between",children:[R,C]}),W[54]=R,W[55]=C,W[56]=U):U=W[56],W[57]!==el?(L=el("bonusVoucher.redeemTo"),W[57]=el,W[58]=L):L=W[58],W[59]!==L?(k=(0,l.jsx)("span",{className:"text-text-primary text-sm leading-[22px] font-medium",children:L}),W[59]=L,W[60]=k):k=W[60],W[61]!==er?(H=(0,l.jsx)("span",{className:"text-text-primary flex-1 text-right text-sm leading-[22px] font-normal",children:er}),W[61]=er,W[62]=H):H=W[62],W[63]!==k||W[64]!==H?(B=(0,l.jsxs)("div",{className:"flex h-[22px] items-center justify-between",children:[k,H]}),W[63]=k,W[64]=H,W[65]=B):B=W[65],W[66]!==P||W[67]!==U||W[68]!==B?(z=(0,l.jsxs)("div",{className:"flex h-[138px] shrink-0 flex-col gap-5 py-4",children:[P,U,B]}),W[66]=P,W[67]=U,W[68]=B,W[69]=z):z=W[69],W[70]!==S||W[71]!==z?($=(0,l.jsxs)("div",{className:"flex h-[332px] shrink-0 flex-col gap-1.5 overflow-hidden px-5 pt-16 pb-1.5",children:[S,z]}),W[70]=S,W[71]=z,W[72]=$):$=W[72],W[73]!==et?(M=()=>et(!1),W[73]=et,W[74]=M):M=W[74],W[75]!==el?(F=el("bonusVoucher.close"),W[75]=el,W[76]=F):F=W[76],W[77]!==M||W[78]!==F?(G=(0,l.jsx)(i.$,{className:"flex-1",size:"lg",variant:"secondary",onClick:M,children:F}),W[77]=M,W[78]=F,W[79]=G):G=W[79],W[80]!==el?(K=el("bonusVoucher.goToTrade"),W[80]=el,W[81]=K):K=W[81],W[82]!==en||W[83]!==K?(Q=(0,l.jsx)(i.$,{className:"flex-1",size:"lg",variant:"default",onClick:en,children:K}),W[82]=en,W[83]=K,W[84]=Q):Q=W[84],W[85]!==G||W[86]!==Q?(X=(0,l.jsxs)(v.Es,{className:"mt-0 flex h-[52px] w-full shrink-0 flex-row items-center gap-3 px-5 pt-3 pb-0 sm:justify-start sm:space-x-0",children:[G,Q]}
2),W[85]=G,W[86]=Q,W[87]=X):X=W[87],W[88]!==$||W[89]!==X||W[90]!==y?(Y=(0,l.jsxs)(v.Cf,{draggable:!1,showCloseButton:!1,overlayClassName:"bg-black/65",className:"max-w-[calc(100vw-32px)] gap-0 overflow-visible p-0 pb-5 sm:w-[420px] sm:max-w-[420px]",children:[m,y,$,X]}),W[88]=$,W[89]=X,W[90]=y,W[91]=Y):Y=W[91],W[92]!==et||W[93]!==ee||W[94]!==Y?(q=(0,l.jsx)(v.lG,{open:ee,onOpenChange:et,children:Y}),W[92]=et,W[93]=ee,W[94]=Y,W[95]=q):q=W[95],q}function R(e){var t,n,a,o,c,u,d,m,h,b,j,w,I,E,_,T,P,A;let R,U,L,k,H,B,z,$,M,F,G,K,Q,X,Y,q,W,J,Z,ee,et,en,el,es,ea,ei,er,eo,ec,eu,ed,em,ex,eh,ep,ef,ev,eg,ey,eN,eb,ej,ew=(0,s.c)(178),{voucher:eI,accountId:eE,symbol:eS,symbols:eV,open:eO,onOpenChange:e_,onGoToUse:eT}=e,eD=(0,p.A)(),eP=(0,D.tk)(),eA=O(),eR=null!=(o=null==eI?void 0:eI.voucherId)?o:"",eC=eO&&!!eI;ew[0]!==eA.offsetData?(R=eA.offsetData?{offsetData:eA.offsetData}:{},ew[0]=eA.offsetData,ew[1]=R):R=ew[1],ew[2]!==eE||ew[3]!==eR||ew[4]!==eC||ew[5]!==R?(U={accountId:eE,voucherId:eR,enabled:eC,size:7,...R},ew[2]=eE,ew[3]=eR,ew[4]=eC,ew[5]=R,ew[6]=U):U=ew[6];let eU=(0,V.C_)(U);if(!eI)return null;if(ew[7]!==(null==(t=eU.data)?void 0:t.dataList)||ew[8]!==(null==(n=eU.data)?void 0:n.nextPageOffsetData)||ew[9]!==eU.isSuccess||ew[10]!==(null==eP?void 0:eP.coinList)||ew[11]!==e_||ew[12]!==eO||ew[13]!==eA||ew[14]!==eS||ew[15]!==eV||ew[16]!==eD||ew[17]!==eI.coinId||ew[18]!==eI.grantAmount||ew[19]!==eI.pendingReclaimAmount||ew[20]!==eI.remainingAmount){let e,t,n,s,a,i,r,o,x,p,y,V,O,D,A,R,U,eo,ec,eu,ed,em,ex,eh,ep=null!=(w=null!=(j=null==eP||null==(u=eP.coinList)||null==(c=u.find(e=>e.coinId===eI.coinId))?void 0:c.coinName)?j:null==eS?void 0:eS.quoteCoin)?w:"";ew[46]!==eI.pendingReclaimAmount?(e=(0,N.m2)(eI.pendingReclaimAmount).gt(0),ew[46]=eI.pendingReclaimAmount,ew[47]=e):e=ew[47];let ef=(G=e)?eI.pendingReclaimAmount:eI.remainingAmount;ew[48]!==ef||ew[49]!==eS?(t=null!=(I=null==eS?void 0:eS.formatBonusAmount(ef))?I:ef,ew[48]=ef,ew[49]=eS,ew[50]=t):t=ew[50];let ev=t;ew[51]!==eS||ew[52]!==eI.grantAmount?(n=null!=(E=null==eS?void 0:eS.formatBonusAmount(eI.grantAmount))?E:eI.grantAmount,ew[51]=eS,ew[52]=eI.grantAmount,ew[53]=n):n=ew[53];let eg=n;(ew[54]!==eI.remainingAmount?(s=(0,N.m2)(eI.remainingAmount).gt(0),ew[54]=eI.remainingAmount,ew[55]=s):s=ew[55],$=s,ew[56]!==(null==(d=eU.data)?void 0:d.dataList)?(a=null!=(P=null==(_=eU.data)?void 0:_.dataList)?P:[],ew[56]=null==(T=eU.data)?void 0:T.dataList,ew[57]=a):a=ew[57],ew[58]!==a)?(i=a.flatMap(e=>e.bonusDeductions.map((t,n)=>({...t,id:`${e.collateralTransactionId}-${t.deductionType}-${n}`,coinId:e.coinId,positionContractId:e.positionContractId,deductionTime:e.deductionTime}))),ew[58]=a,ew[59]=i):i=ew[59],z=i,ew[60]!==eD?(r=e=>{switch(e){case"FILL_FEE":return eD("orderTradingFee");case"LOSS_PNL":return eD("bonusVoucher.detail.lossPnl");case"FUNDING_FEE":return eD("FundingFee")}},ew[60]=eD,ew[61]=r):r=ew[61];let ey=r;ew[62]!==eD?(o=eD("bonusVoucher.detail.symbol"),ew[62]=eD,ew[63]=o):o=ew[63],ew[64]!==eV?(x=(e,t)=>{var n,s;return(0,l.jsx)("td",{className:"text-text-primary px-4 text-left text-xs leading-[14px] whitespace-nowrap",children:null!=(s=null==(n=eV.find(t=>t.contractId===e.positionContractId))?void 0:n.symbol)?s:e.positionContractId},t)},ew[64]=eV,ew[65]=x):x=ew[65],ew[66]!==o||ew[67]!==x?(p={title:o,render:x},ew[66]=o,ew[67]=x,ew[68]=p):p=ew[68],ew[69]!==eD?(y=eD("bonusVoucher.detail.deductedAmount"),ew[69]=eD,ew[70]=y):y=ew[70];let eN={title:y,render:(e,t)=>{var n,s,a;let i=eV.find(t=>t.contractId===e.positionContractId);return(0,l.jsxs)("td",{className:"text-text-primary px-4 text-left text-xs leading-[14px] whitespace-nowrap",children:[null!=(s=null!=(n=null==i?void 0:i.formatBonusAmount(e.deductionAmount))?n:null==eS?void 0:eS.formatBonusAmount(e.deductionAmount))?s:e.deductionAmount," ",null!=(a=null==i?void 0:i.quoteCoin)?a:ep]},t)}};ew[71]!==eD?(V=eD("bonusVoucher.detail.deductedType"),ew[71]=eD,ew[72]=V):V=ew[72],ew[73]!==ey?(O=(e,t)=>
2(0,l.jsx)("td",{className:"text-text-primary px-4 text-left text-xs leading-[14px] whitespace-nowrap",children:ey(e.deductionType)},t),ew[73]=ey,ew[74]=O):O=ew[74],ew[75]!==V||ew[76]!==O?(D={title:V,render:O},ew[75]=V,ew[76]=O,ew[77]=D):D=ew[77],ew[78]!==eD?(A=eD("time"),ew[78]=eD,ew[79]=A):A=ew[79],ew[80]!==A?(R={title:A,render:C},ew[80]=A,ew[81]=R):R=ew[81],ew[82]!==p||ew[83]!==eN||ew[84]!==D||ew[85]!==R?(U=[p,eN,D,R],ew[82]=p,ew[83]=eN,ew[84]=D,ew[85]=R,ew[86]=U):U=ew[86],B=U,ew[87]!==e_||ew[88]!==eA?(eo=e=>{e||eA.reset(),e_(e)},ew[87]=e_,ew[88]=eA,ew[89]=eo):eo=ew[89];let eb=eo;F=eA.isFirstPage,M=!(null==(m=eU.data)?void 0:m.nextPageOffsetData),H=eA.currentPage,K=!F||eU.isSuccess&&!M,k=v.lG,et=eO,en=eb,L=v.Cf,W=!1,J="bg-black/65",Z="max-w-[calc(100vw-32px)] grid-rows-[auto_minmax(0,1fr)] gap-0 overflow-hidden p-0 pb-5 sm:h-[546px] sm:w-[680px] sm:max-w-[680px]",ew[90]!==eD?(ec=eD("bonusVoucher.detailsTitle"),ew[90]=eD,ew[91]=ec):ec=ew[91],ew[92]!==ec?(eu=(0,l.jsx)(v.L3,{children:ec}),ew[92]=ec,ew[93]=eu):eu=ew[93],ew[94]!==eD?(ed=eD("bonusVoucher.detailsTitle"),ew[94]=eD,ew[95]=ed):ed=ew[95],ew[96]!==ed?(em=(0,l.jsx)(v.rr,{className:"sr-only",children:ed}),ew[96]=ed,ew[97]=em):em=ew[97],ew[98]!==eu||ew[99]!==em?(ee=(0,l.jsxs)(v.c7,{className:"mb-0 px-5 pt-5 pb-3",children:[eu,em]}),ew[98]=eu,ew[99]=em,ew[100]=ee):ee=ew[100],q="flex min-h-0 flex-col gap-1.5 px-5 py-1.5",Y="bg-fill-page-primary relative flex items-center justify-center rounded-xl p-4",er="flex items-center gap-2";let ej=`${G?"text-functional-orange-1":"text-text-primary"} font-['BebasNeue'] text-[40px] leading-10`;ew[101]!==ev||ew[102]!==ej?(ex=(0,l.jsx)("span",{className:ej,children:ev}),ew[101]=ev,ew[102]=ej,ew[103]=ex):ex=ew[103],ew[104]!==G||ew[105]!==eD?(eh=G?(0,l.jsx)(f.E,{color:"orange",rounded:"full",size:"sm",className:"h-[22px] py-0.5",leftIcon:(0,l.jsx)(g.A,{icon:S,className:"size-3","aria-hidden":"true"}),children:eD("bonusVoucher.reclaiming")}):(0,l.jsx)("span",{className:"text-text-tertiary text-sm leading-[22px]",children:eD("bonusVoucher.available")}),ew[104]=G,ew[105]=eD,ew[106]=eh):eh=ew[106],ew[107]!==ex||ew[108]!==eh?(Q=(0,l.jsxs)("div",{className:"flex flex-col items-center",children:[ex,eh]}),ew[107]=ex,ew[108]=eh,ew[109]=Q):Q=ew[109],ew[110]===Symbol.for("react.memo_cache_sentinel")?(X=(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center",children:[(0,l.jsx)("span",{className:"text-line-divider-secondary font-['BebasNeue'] text-[40px] leading-10",children:"/"}),(0,l.jsx)("span",{"aria-hidden":"true",className:"text-sm leading-[22px] text-transparent",children:"â"})]}),ew[110]=X):X=ew[110],ea="flex flex-col items-center",ew[111]!==eg?(ei=(0,l.jsx)("span",{className:"text-text-secondary font-['BebasNeue'] text-[40px] leading-10",children:eg}),ew[111]=eg,ew[112]=ei):ei=ew[112],el="text-text-tertiary text-sm leading-[22px]",es=eD("bonusVoucher.total",{coin:ep}),ew[7]=null==(h=eU.data)?void 0:h.dataList,ew[8]=null==(b=eU.data)?void 0:b.nextPageOffsetData,ew[9]=eU.isSuccess,ew[10]=null==eP?void 0:eP.coinList,ew[11]=e_,ew[12]=eO,ew[13]=eA,ew[14]=eS,ew[15]=eV,ew[16]=eD,ew[17]=eI.coinId,ew[18]=eI.grantAmount,ew[19]=eI.pendingReclaimAmount,ew[20]=eI.remainingAmount,ew[21]=L,ew[22]=k,ew[23]=H,ew[24]=B,ew[25]=z,ew[26]=$,ew[27]=M,ew[28]=F,ew[29]=G,ew[30]=K,ew[31]=Q,ew[32]=X,ew[33]=Y,ew[34]=q,ew[35]=W,ew[36]=J,ew[37]=Z,ew[38]=ee,ew[39]=et,ew[40]=en,ew[41]=el,ew[42]=es,ew[43]=ea,ew[44]=ei,ew[45]=er}else L=ew[21],k=ew[22],H=ew[23],B=ew[24],z=ew[25],$=ew[26],M=ew[27],F=ew[28],G=ew[29],K=ew[30],Q=ew[31],X=ew[32],Y=ew[33],q=ew[34],W=ew[35
2],J=ew[36],Z=ew[37],ee=ew[38],et=ew[39],en=ew[40],el=ew[41],es=ew[42],ea=ew[43],ei=ew[44],er=ew[45];return ew[113]!==el||ew[114]!==es?(eo=(0,l.jsx)("span",{className:el,children:es}),ew[113]=el,ew[114]=es,ew[115]=eo):eo=ew[115],ew[116]!==eo||ew[117]!==ea||ew[118]!==ei?(ec=(0,l.jsxs)("div",{className:ea,children:[ei,eo]}),ew[116]=eo,ew[117]=ea,ew[118]=ei,ew[119]=ec):ec=ew[119],ew[120]!==Q||ew[121]!==X||ew[122]!==ec||ew[123]!==er?(eu=(0,l.jsxs)("div",{className:er,children:[Q,X,ec]}),ew[120]=Q,ew[121]=X,ew[122]=ec,ew[123]=er,ew[124]=eu):eu=ew[124],ew[125]!==$||ew[126]!==G||ew[127]!==eT||ew[128]!==eD?(ed=$&&!G?(0,l.jsx)(i.$,{size:"sm",variant:"primary",radius:"full",className:"absolute right-6 px-2",onClick:eT,children:eD("bonusVoucher.goToUse")}):null,ew[125]=$,ew[126]=G,ew[127]=eT,ew[128]=eD,ew[129]=ed):ed=ew[129],ew[130]!==Y||ew[131]!==eu||ew[132]!==ed?(em=(0,l.jsxs)("div",{className:Y,children:[eu,ed]}),ew[130]=Y,ew[131]=eu,ew[132]=ed,ew[133]=em):em=ew[133],ew[134]!==eU.isSuccess||ew[135]!==z?(ex=eU.isSuccess?z:[],ew[134]=eU.isSuccess,ew[135]=z,ew[136]=ex):ex=ew[136],ew[137]!==B||ew[138]!==ex?(eh=(0,l.jsx)(y.A,{data:ex,columns:B,rowKey:"id",containerClassName:"shrink-0 overflow-hidden",tableClassName:"table-fixed",headerCellClassName:"px-4 text-left text-xs leading-[18px]",headerRowClassName:"bg-transparent [&>*]:h-[34px] [&>*]:py-2 [&>*:not(:first-child)]:text-left",bodyRowClassName:"[@media(hover:hover)]:hover:bg-transparent [&>*]:h-10 [&>*]:py-1 [&>*:not(:first-child)]:text-left",mobileColumnCount:4}),ew[137]=B,ew[138]=ex,ew[139]=eh):eh=ew[139],ew[140]!==eU.isPending?(ep=eU.isPending?(0,l.jsx)(x.A,{className:"min-h-0 flex-1"}):null,ew[140]=eU.isPending,ew[141]=ep):ep=ew[141],ew[142]!==eU||ew[143]!==eD?(ef=eU.isError?(0,l.jsxs)("div",{className:"text-text-tertiary flex min-h-0 flex-1 flex-col items-center justify-center text-center",children:[(0,l.jsx)("p",{children:eD("positionVoucher.loadFailed")}),(0,l.jsx)(i.$,{className:"mt-3",size:"sm",variant:"secondary",onClick:()=>void eU.refetch(),children:eD("bonusVoucher.retry")})]}):null,ew[142]=eU,ew[143]=eD,ew[144]=ef):ef=ew[144],ew[145]!==eU.isSuccess||ew[146]!==z||ew[147]!==eD?(ev=eU.isSuccess&&0===z.length?(0,l.jsx)("div",{className:"text-text-tertiary flex min-h-0 flex-1 items-center justify-center text-center",children:eD("bonusVoucher.detail.empty")}):null,ew[145]=eU.isSuccess,ew[146]=z,ew[147]=eD,ew[148]=ev):ev=ew[148],ew[149]!==eh||ew[150]!==ep||ew[151]!==ef||ew[152]!==ev?(eg=(0,l.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[eh,ep,ef,ev]}),ew[149]=eh,ew[150]=ep,ew[151]=ef,ew[152]=ev,ew[153]=eg):eg=ew[153],ew[154]!==H||ew[155]!==(null==(a=eU.data)?void 0:a.nextPageOffsetData)||ew[156]!==M||ew[157]!==F||ew[158]!==eA||ew[159]!==K?(ey=K?(0,l.jsx)(r.BK,{className:"shrink-0",children:(0,l.jsxs)(r.Iu,{children:[(0,l.jsx)(r.cU,{children:(0,l.jsx)(r.Eb,{"aria-disabled":F,className:F?"pointer-events-none opacity-40":"",onClick:eA.goPrevious})}),(0,l.jsx)(r.cU,{children:(0,l.jsx)(r.n$,{isActive:!0,children:H})}),(0,l.jsx)(r.cU,{children:(0,l.jsx)(r.WA,{"aria-disabled":M,className:M?"pointer-events-none opacity-40":"",onClick:()=>{var e;return eA.goNext(null==(e=eU.data)?void 0:e.nextPageOffsetData)}})})]})}):null,ew[154]=H,ew[155]=null==(A=eU.data)?void 0:A.nextPageOffsetData,ew[156]=M,ew[157]=F,ew[158]=eA,ew[159]=K,ew[160]=ey):ey=ew[160],ew[161]!==q||ew[162]!==em||ew[163]!==eg||ew[164]!==ey?(eN=(0,l.jsxs)("div",{className:q,children:[em,eg,ey]}),ew[161]=q,ew[162]=em,ew[163]=eg,ew[164]=ey,ew[165]=eN):eN=ew[165],ew[166]!==L||ew[167]!==W||ew[168]!==J||ew[169]!==Z||ew[170]!==ee||ew[171]!==eN?(eb=(0,l.jsxs)(L,{draggable:W,overlayClassName:J,className:Z,children:[ee,eN]}),ew[166]=L,ew[167]=W,ew[168]=J,ew[169]=Z,ew[170]=ee,ew[171]=eN,ew[172]=eb):eb=ew[172],ew[173]!==k||ew[174]!==et||ew[175]!==en||ew[176]!==eb?(ej=(0,l.jsx)(k,{open:et,onOpenChange:en,children:eb}),ew[173]=k,ew[174]=et,ew[175]=en,ew[176]=eb,ew[177]=ej):ej=ew[177],ej}function C(e,t){return(0,l.jsx)("td",{className:"text-text-primary px-4 text-left text-xs leading-[14px] whitespace-nowrap",children:"0"===e.deductionTime?"-":(0,P.r6)(Number(e.deductionTime),"YYYY-mm-dd HH:MM:SS")},t)}var U=n(22878);let L=n.p+"static/image/bonus-voucher-illustration.fce8b656.png",k={POSITION_VOUCHER:{type:"POSITION_VOUCHER",getSymbol:(e,t)=>{if("POSITION_VOUCHER"===e.voucherType)return t.find(t=>t.contractId===e.voucherData.contractId)},getCreditAmount:(e,t)=>
2{var n;return"POSITION_VOUCHER"!==e.voucherType?"":null!=(n=null==t?void 0:t.formatPositionVoucherValue(e.voucherData.value))?n:e.voucherData.value},getPairContractId:e=>"POSITION_VOUCHER"===e.voucherType?e.voucherData.contractId:void 0,getLeverage:e=>"POSITION_VOUCHER"===e.voucherType?e.voucherData.leverage:void 0,getMaxHoldingDuration:e=>"POSITION_VOUCHER"===e.voucherType?e.voucherData.maxHoldingDuration:void 0,getPresentation:e=>"POSITION_VOUCHER"!==e.voucherType?{listStatus:"INVALID",canRedeem:!1,canViewDetails:!1,isInEffect:!1,typeLabelKey:"positionVoucher.badgeTooltip"}:{listStatus:e.voucherStatus,canRedeem:"PENDING"===e.voucherData.status,canViewDetails:"USED"===e.voucherData.status,isInEffect:!1,typeLabelKey:"positionVoucher.badgeTooltip"},getAction:e=>"POSITION_VOUCHER"!==e.voucherType?{type:"NONE",labelKey:"bonusVoucher.redeem",disabled:!0,visible:!1}:"PENDING"===e.voucherData.status?{type:"USE_POSITION",voucher:e.voucherData,labelKey:"positionVoucher.use"}:"USED"===e.voucherData.status?{type:"VIEW_POSITION_DETAILS",voucher:e.voucherData,labelKey:"positionVoucher.details"}:{type:"NONE",labelKey:"bonusVoucher.redeem",disabled:!0,visible:!1}},BONUS_VOUCHER:{type:"BONUS_VOUCHER",getSymbol:(e,t)=>{if("BONUS_VOUCHER"===e.voucherType)return t.find(t=>t.quoteCoinId===e.voucherData.coinId)},getCreditAmount:(e,t)=>{var n;return"BONUS_VOUCHER"!==e.voucherType?"":null!=(n=null==t?void 0:t.formatBonusAmount(e.voucherData.grantAmount))?n:e.voucherData.grantAmount},getPairContractId:()=>void 0,getLeverage:()=>void 0,getMaxHoldingDuration:()=>void 0,getPresentation:e=>"BONUS_VOUCHER"!==e.voucherType?{listStatus:"INVALID",canRedeem:!1,canViewDetails:!1,isInEffect:!1,typeLabelKey:"bonusVoucher.type"}:{...T(e.voucherData),listStatus:e.voucherStatus,typeLabelKey:"bonusVoucher.type"},getAction:e=>{if("BONUS_VOUCHER"!==e.voucherType)return{type:"NONE",labelKey:"bonusVoucher.redeem",disabled:!0,visible:!1};let t=T(e.voucherData);return t.canRedeem?{type:"REDEEM_BONUS",voucherId:e.voucherData.voucherId,labelKey:"bonusVoucher.redeem"}:t.canViewDetails?{type:"VIEW_BONUS_DETAILS",voucher:e.voucherData,labelKey:"positionVoucher.details"}:{type:"NONE",labelKey:"bonusVoucher.redeem",disabled:!0,visible:"VOUCHER_STATUS_GRANTED"===e.voucherData.status}}}};function H(e){return k[e.voucherType]}function B(e){return H(e).getAction(e)}var z=n(11664);function $(e){return(0,P.r6)(Number(e),"YYYY-mm-dd HH:MM:SS")}function M(e){return"EXPIRED"===e?"positionVoucher.status.EXPIRED":"positionVoucher.status.INVALID"}function F(e){let t,n,a,r,o,c,u,d=(0,s.c)(57),{voucher:m,voucherStatus:x,symbol:h,isRedeeming:v,isRedeemDisabled:g,onRedeem:y,onViewDetails:N}=e,b=(0,p.A)();if(d[0]!==g||d[1]!==v||d[2]!==y||d[3]!==N||d[4]!==h||d[5]!==b||d[6]!==m||d[7]!==x){var j;let e,s,c,u,p,w,I,E,S,V,O,_,T={voucherType:"BONUS_VOUCHER",voucherStatus:x,voucherData:m},D=H(T).getPresentation(T),P=B(T),A="NONE"!==P.type||P.visible,R="INVALID"===D.listStatus,C=(t="EXPIRED"===D.listStatus||R)?"bg-fill-page-secondary":"bg-fill-page-tertiary";d[13]!==C?(n=(0,z.cn)("relative flex h-[152px] min-w-0 overflow-hidden rounded-2xl p-4",C),d[13]=C,d[14]=n):n=d[14];let L=t&&!A&&"h-full justify-between";d[15]!==L?(e=(0,z.cn)("flex min-w-0 flex-col gap-1",L),d[15]=L,d[16]=e):e=d[16];let k=t?"text-text-tertiary":"text-text-primary";(d[17]!==k?(s=(0,z.cn)("font-['BebasNeue'] text-[32px] leading-9 whitespace-nowrap tabular-nums",k),d[17]=k,d[18]=s):s=d[18],d[19]!==h||d[20]!==m)?(c=null!=(j=null==h?void 0:h.formatBonusAmount(m.grantAmount))?j:m.grantAmount,d[19]=h,d[20]=m,d[21]=c):c=d[21],d[22]!==c||d[23]!==s?(u=(0,l.jsxs)("span",{className:s,children:["$",c]}),d[22]=c,d[23]=s,d[24]=u):u=d[24];let F=t?"text-text-tertiary":"text-text-primary";d[25]!==F?(p=(0,z.cn)("truncate text-[15px] leading-5 font-medium",F),d[25]=F,d[26]=p):p=d[26],d[27]!==b?(w=b("bonusVoucher.type"),d[27]=b,d[28]=w):w=d[28],d[29]!==p||d[30]!==w?(I=(0,l.jsx)("h3",{className:p,children:w}),d[29]=p,d[30]=w,d[31]=I):I=d[31];let G=R?"text-text-tertiary":"text-text-secondary";d[32]!==G?(E=(0,z.cn)("truncate text-xs leading-[18px]",G),d[32]=G,d[33]=E):E=d[33],d[34]!==b?(S=b("bonusVoucher.applicableProducts"),d[34]=b,d[35]=S):S=d[35],d[36]!==E||d[37]!==S?(V=(0,l.jsx)("p",{className:E,
2children:S}),d[36]=E,d[37]=S,d[38]=V):V=d[38],d[39]!==I||d[40]!==V?(O=(0,l.jsxs)("div",{className:"flex min-w-0 flex-col gap-1",children:[I,V]}),d[39]=I,d[40]=V,d[41]=O):O=d[41],d[42]!==u||d[43]!==O||d[44]!==e?(_=(0,l.jsxs)("div",{className:e,children:[u,O]}),d[42]=u,d[43]=O,d[44]=e,d[45]=_):_=d[45];let K=A?(0,l.jsx)("div",{className:"mt-3 flex h-[26px] items-center gap-2",children:(0,l.jsx)(i.$,{className:"min-w-[60px] px-2",size:"sm",variant:"VIEW_BONUS_DETAILS"===P.type?"outline":"primary",radius:"full",loading:v,disabled:"NONE"===P.type?P.disabled:"REDEEM_BONUS"===P.type&&g,onClick:()=>{"REDEEM_BONUS"===P.type&&y(P.voucherId),"VIEW_BONUS_DETAILS"===P.type&&N(P.voucher)},children:b(P.labelKey)})}):null;d[46]!==_||d[47]!==K?(a=(0,l.jsxs)("div",{className:"relative z-10 flex h-full min-w-0 flex-col",children:[_,K]}),d[46]=_,d[47]=K,d[48]=a):a=d[48],r=D.isInEffect?(0,l.jsx)(f.E,{variant:"outline",color:"brand",rounded:"full",size:"sm",className:"absolute top-3 right-2.5 h-[22px] py-0.5",leftIcon:(0,l.jsx)(U.A,{"aria-hidden":"true",className:"animate-spin"}),children:b("bonusVoucher.inEffect")}):null,o=t?(0,l.jsx)("p",{className:"text-text-tertiary absolute top-3 right-2.5 z-10 text-xs leading-[18px] whitespace-nowrap",children:b(M(D.listStatus))}):"PENDING"!==D.listStatus||D.isInEffect?null:(0,l.jsxs)("div",{className:"text-text-tertiary absolute top-3 right-2.5 z-10 flex flex-col items-end text-xs leading-[18px] whitespace-nowrap",children:[(0,l.jsx)("span",{children:$(m.expireTime)}),(0,l.jsx)("span",{children:b("positionVoucher.expirationDate")})]}),d[0]=g,d[1]=v,d[2]=y,d[3]=N,d[4]=h,d[5]=b,d[6]=m,d[7]=x,d[8]=t,d[9]=n,d[10]=a,d[11]=r,d[12]=o}else t=d[8],n=d[9],a=d[10],r=d[11],o=d[12];return d[49]!==t?(c=t?null:(0,l.jsx)("img",{src:L,alt:"",className:"pointer-events-none absolute -right-[15px] -bottom-11 size-[140px] max-w-none object-cover"}),d[49]=t,d[50]=c):c=d[50],d[51]!==n||d[52]!==a||d[53]!==r||d[54]!==o||d[55]!==c?(u=(0,l.jsxs)("article",{className:n,children:[a,r,o,c]}),d[51]=n,d[52]=a,d[53]=r,d[54]=o,d[55]=c,d[56]=u):u=d[56],u}var G=n(41993);let K=n.p+"static/image/position-voucher-illustration.ef1116d2.png";var Q=n(439),X=n(51668),Y=n(67168);function q(e){let t,n,r,o,c,u,d,m,x,h,f=(0,s.c)(114),{voucher:v,symbol:y,isUsing:N,onUse:b,onViewDetails:j}=e,w=void 0!==N&&N,I=(0,p.A)();if(f[0]!==I||f[1]!==v.maxHoldingDuration){let e,l,s;f[4]!==I?(e=e=>I("positionVoucher.durationHours",{value:e}),l=e=>I("positionVoucher.durationDays",{value:e}),f[4]=I,f[5]=e,f[6]=l):(e=f[5],l=f[6]);let a=(0,X.u)(v.maxHoldingDuration,I("positionVoucher.unlimited"),e,l);f[7]!==I?(s=I("positionVoucher.badgeTooltip"),f[7]=I,f[8]=s):s=f[8],n=s,t=I("positionVoucher.maxHoldValue",{duration:a}),f[0]=I,f[1]=v.maxHoldingDuration,f[2]=t,f[3]=n}else t=f[2],n=f[3];let E=t,S=`${n} / ${E}`,{summaryRef:V,isOverflowing:O}=function(e){let t,n,l,i,r=(0,s.c)(6),o=(0,a.useRef)(null);r[0]===Symbol.for("react.memo_cache_sentinel")?(t={summary:"",isOverflowing:!1},r[0]=t):t=r[0];let[c,u]=(0,a.useState)(t);r[1]!==e?(n=()=>{var t,n;let l=o.current;if(!l)return;let s=!0,a=()=>{if(!s)return;let t=l.scrollWidth>l.clientWidth;u(n=>n.summary===e&&n.isOverflowing===t?n:{summary:e,isOverflowing:t})};a();let i=window.requestAnimationFrame(a);null==(t=document.fonts)||t.ready.then(a),null==(n=document.fonts)||n.addEventListener("loadingdone",a),window.addEventListener("resize",a);let r="undefined"==typeof ResizeObserver?void 0:new ResizeObserver(a);return null==r||r.observe(l),()=>{var e;s=!1,window.cancelAnimationFrame(i),null==(e=document.fonts)||e.removeEventListener("loadingdone",a),null==r||r.disconnect(),window.removeEventListener("resize",a)}},l=[e],r[1]=e,r[2]=n,r[3]=l):(n=r[2],l=r[3]),(0,a.useEffect)(n,l);let d=c.summary===e&&c.isOverflowing;return r[4]!==d?(i={summaryRef:o,isOverflowing:d},r[4]=d,r[5]=i):i=r[5],i}(S);if(f[9]!==O||f[10]!==w||f[11]!==E||f[12]!==b||f[13]!==j||f[14]!==S||f[15]!==V||f[16]!==y||f[17]!==I||f[18]!==n||f[19]!==v){var _,T,D;let e,t,s,a,m,x,h,p,N,P,A,R,C,U,L,k,H,$,M,F=B({voucherType:"POSITION_VOUCHER",voucherStatus:v.status,voucherData:v});if(f[25]!==y||f[26]!==I||f[27]!==v.direction||f[28]!==v.maxProfitRate||f[29]!==v.status||f[30]!==v.value){let n,i,c,u=(0,Y.x)(v.maxProfitRate);f[39]!==v.direction?(n="LONG"===(D=v.direction)||"SHORT"===D?D:null,f[39]=v.direction,f[40]=n):n=f[40],e=n;let x=(r="EXPIRED"===v.status||"INVALID"===v.status)?"bg-fill-page-secondary":"bg-fill-page-tertiary";f[41]!==x?(d=(0,z.cn)("relative flex h-[152px] min-w-0 overflow-hidden rounded-2xl p-4",x),f[41]=x,f[42]=d):d=f[42],o="relative z-10 flex h-full w-[260px] min-w-0 flex-col";let h=r&&"h-full justify-between";f[43]!==h?(t=(0,z.cn)("flex min-w-0 flex-col gap-1",h),f[43]=h,f[44]=t):t=f[44],s="flex items-center gap-2";let p=r?"text-text-tertiary":"text-text-primary";f[45]!==p?(i=(0,z.cn)("font-['BebasNeue'] text-[32px] leading-9 whitespace-nowrap tabular-nums",p),f[45]=p,f[46]=i):i=f[46],f[47]!==y||f[48]!==v.value?(c=null!=(_=null==y?void 0:y.formatPositionVoucherValue(v.value))?_:v.value,f[47]=y,f[48]=v.value,f[49]=c):c=f[49],f[50]!==i||f[51]!==c?(a=(0,l.jsxs)("span",{className:i,children:["$",c]}),f[50]=i,f[51]=c,f[52]=a):a=f[52],m=u?(0,l.jsx)("span",{className:"border-text-tertiary text-text-tertiary rounded-full border px-1.5 text-xs leading-[18px] whitespace-nowrap",children:I("positionVoucher.roiLimit",{rate:u})}):null,f[25]=y,f[26]=I,f[27]=v.direction,f[28]=v.maxProfitRate,f[29]=v.status,f[30]=v.value,f[31]=e,f[32]=r,f[33]=t,f[34]=o,f[35]=d,f[36]=s,f[37]=a,f[38]=m}else e=f[31],r=f[32],t=f[33],o=f[34],d=f[35],s=f[36],a=f[37],m=f[38];f[53]!==s||f[54]!==a||f[55]!==m?(x=(0,l.jsxs)("div",{className:s,children:[a,m]}),f[53]=s,f[54]=a,f[55]=m,f[56]=x):x=f[56];let K=!O,X=r?"text-text-tertiary":"text-text-secondary";f[57]!==X?(h=(0,z.cn)("w-full min-w-0 truncate text-[15px] leading-5 font-medium",X),f[57]=X,f[58]=h):h=f[58];let q=!r&&"text-text-primary";f[59]!==q?(p=(0,z.cn)(q),f[59]=q,f[60]=p):p=f[60],f[61]!==p||f[62]!==n?(N=(0,l.jsx)("span",{className:p,children:n}),f[61]=p,f[62]=n,f[63]=N):N=f[63],f[64]!==E?(P=(0,l.jsxs)("span",{className:"text-xs leading-[18px] font-normal",children:[" / ",E]}
2),f[64]=E,f[65]=P):P=f[65],f[66]!==V||f[67]!==h||f[68]!==N||f[69]!==P?(A=(0,l.jsxs)("h3",{ref:V,className:h,children:[N,P]}),f[66]=V,f[67]=h,f[68]=N,f[69]=P,f[70]=A):A=f[70],f[71]!==S||f[72]!==K||f[73]!==A?(R=(0,l.jsx)(G.Ay,{placement:"top",title:S,disabled:K,children:A}),f[71]=S,f[72]=K,f[73]=A,f[74]=R):R=f[74];let W=r?"text-text-tertiary":"text-text-secondary";f[75]!==W?(C=(0,z.cn)("flex min-w-0 gap-1 text-xs leading-[18px]",W),f[75]=W,f[76]=C):C=f[76];let J=null!=(T=null==y?void 0:y.symbol)?T:v.contractId;f[77]!==I||f[78]!==J?(U=I("positionVoucher.perpetualPair",{symbol:J}),f[77]=I,f[78]=J,f[79]=U):U=f[79],f[80]!==U||f[81]!==v.leverage?(L=(0,l.jsxs)("span",{className:"truncate",children:[U," ",v.leverage,"X"]}),f[80]=U,f[81]=v.leverage,f[82]=L):L=f[82],f[83]!==e||f[84]!==r||f[85]!==I?(k=e?(0,l.jsx)("span",{className:(0,z.cn)(r&&"text-text-tertiary",!r&&"LONG"===e&&"text-(--long)",!r&&"SHORT"===e&&"text-(--short)"),children:I("LONG"===e?"long":"short")}):null,f[83]=e,f[84]=r,f[85]=I,f[86]=k):k=f[86],f[87]!==v.accountTradingType?(H="FX_PERP"===v.accountTradingType?(0,l.jsx)(g.A,{icon:Q.A,className:"h-4 w-9 shrink-0","aria-label":"Arc"}):null,f[87]=v.accountTradingType,f[88]=H):H=f[88],f[89]!==C||f[90]!==L||f[91]!==k||f[92]!==H?($=(0,l.jsxs)("p",{className:C,children:[L,k,H]}),f[89]=C,f[90]=L,f[91]=k,f[92]=H,f[93]=$):$=f[93],f[94]!==R||f[95]!==$?(M=(0,l.jsxs)("div",{className:"flex min-w-0 flex-col gap-1",children:[R,$]}),f[94]=R,f[95]=$,f[96]=M):M=f[96],f[97]!==t||f[98]!==x||f[99]!==M?(c=(0,l.jsxs)("div",{className:t,children:[x,M]}),f[97]=t,f[98]=x,f[99]=M,f[100]=c):c=f[100],u="NONE"!==F.type?(0,l.jsx)(i.$,{className:"mt-3 min-w-[60px] self-start px-2",size:"sm",variant:"VIEW_POSITION_DETAILS"===F.type?"outline":"primary",radius:"full",loading:"USE_POSITION"===F.type&&w,onClick:()=>{"USE_POSITION"===F.type&&b(F.voucher),"VIEW_POSITION_DETAILS"===F.type&&j(F.voucher)},children:I(F.labelKey)}):null,f[9]=O,f[10]=w,f[11]=E,f[12]=b,f[13]=j,f[14]=S,f[15]=V,f[16]=y,f[17]=I,f[18]=n,f[19]=v,f[20]=r,f[21]=o,f[22]=c,f[23]=u,f[24]=d}else r=f[20],o=f[21],c=f[22],u=f[23],d=f[24];return f[101]!==o||f[102]!==c||f[103]!==u?(m=(0,l.jsxs)("div",{className:o,children:[c,u]}),f[101]=o,f[102]=c,f[103]=u,f[104]=m):m=f[104],f[105]!==r||f[106]!==I||f[107]!==v.expireTime||f[108]!==v.status?(x=r?(0,l.jsx)("p",{className:"text-text-tertiary absolute top-3 right-2.5 z-10 text-xs leading-[18px] whitespace-nowrap",children:I(M(v.status))}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"text-text-tertiary absolute top-3 right-2.5 z-10 flex flex-col items-end text-xs leading-[18px] whitespace-nowrap",children:[(0,l.jsx)("span",{children:$(v.expireTime)}),(0,l.jsx)("span",{children:I("positionVoucher.expirationDate")})]}),(0,l.jsx)("div",{className:"pointer-events-none absolute -right-[15px] -bottom-11 size-[140px] overflow-hidden",children:(0,l.jsx)("img",{src:K,alt:"",className:"absolute top-[-6.31%] left-[-2.19%] size-full max-w-none"})})]}),f[105]=r,f[106]=I,f[107]=v.expireTime,f[108]=v.status,f[109]=x):x=f[109],f[110]!==d||f[111]!==m||f[112]!==x?(h=(0,l.jsxs)("article",{className:d,children:[m,x]}),f[110]=d,f[111]=m,f[112]=x,f[113]=h):h=f[113],h}function W(e){let t,n,a=(0,s.c)(18),{voucher:i,symbol:r,isRedeeming:o,isRedeemDisabled:c,isUsing:u,actions:d}=e,m=void 0!==c&&c,x=void 0!==u&&u;if("POSITION_VOUCHER"===i.voucherType){let e,t;return a[0]!==r?(e=r?{symbol:r}:{},a[0]=r,a[1]=e):e=a[1],a[2]!==d.onUsePosition||a[3]!==d.onViewPosition||a[4]!==x||a[5]!==e||a[6]!==i.voucherData?(t=(0,l.jsx)(q,{voucher:i.voucherData,...e,isUsing:x,onUse:d.onUsePosition,onViewDetails:d.onViewPosition}),a[2]=d.onUsePosition,a[3]=d.onViewPosition,a[4]=x,a[5]=e,a[6]=i.voucherData,a[7]=t):t=a[7],t}return a[8]!==r?(t=r?{symbol:r}:{},a[8]=r,a[9]=t):t=a[9],a[10]!==d.onRedeemBonus||a[11]!==d.onViewBonus||a[12]!==m||a[13]!==o||a[14]!==t||a[15]!==i.voucherData||a[16]!==i.voucherStatus?(n=(0,l.jsx)(F,{voucher:i.voucherData,voucherStatus:i.voucherStatus,...t,isRedeeming:o,isRedeemDisabled:m,onRedeem:d.onRedeemBonus,onViewDetails:d.onViewBonus}
2),a[10]=d.onRedeemBonus,a[11]=d.onViewBonus,a[12]=m,a[13]=o,a[14]=t,a[15]=i.voucherData,a[16]=i.voucherStatus,a[17]=n):n=a[17],n}function J(e){let t=(0,N.m2)(e);return!t.isFinite()||t.isZero()}function Z(e){let t,n,a,i=(0,s.c)(7),{label:r,children:o}=e;return i[0]!==r?(t=(0,l.jsx)("div",{className:"text-text-tertiary flex h-[34px] items-start px-4 py-2 text-xs leading-[18px] whitespace-nowrap",children:r}),i[0]=r,i[1]=t):t=i[1],i[2]!==o?(n=(0,l.jsx)("div",{className:"text-text-primary flex h-10 items-center px-4 py-1 text-xs leading-[14px]",children:o}),i[2]=o,i[3]=n):n=i[3],i[4]!==t||i[5]!==n?(a=(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[t,n]}),i[4]=t,i[5]=n,i[6]=a):a=i[6],a}function ee(e){let t,n,a,i,r=(0,s.c)(10),{value:o}=e;if(J(o)){let e;return r[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,l.jsx)(l.Fragment,{children:"--"}),r[0]=e):e=r[0],e}r[1]!==o?(t=(0,P.r6)(Number(o),"YYYY-mm-dd HH:MM:SS").split(" "),r[1]=o,r[2]=t):t=r[2];let[c,u]=t;return r[3]!==c?(n=(0,l.jsx)("span",{className:"block",children:c}),r[3]=c,r[4]=n):n=r[4],r[5]!==u?(a=(0,l.jsx)("span",{className:"block",children:u}),r[5]=u,r[6]=a):a=r[6],r[7]!==n||r[8]!==a?(i=(0,l.jsxs)("span",{className:"whitespace-nowrap",children:[n,a]}),r[7]=n,r[8]=a,r[9]=i):i=r[9],i}function et(e){let t,n,a,i,r,o=(0,s.c)(12),{voucher:c,symbol:u}=e;if(J(c.closeTime)){let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,l.jsx)(l.Fragment,{children:"--"}),o[0]=e):e=o[0],e}if(o[1]!==u||o[2]!==c.realizePnl){var d;let e=(0,N.m2)(c.realizePnl);t=null!=(d=null==u?void 0:u.formatPnL(c.realizePnl))?d:c.realizePnl,n=e.gt(0)?"+":"",a=(null==u?void 0:u.quoteCoin)?` ${u.quoteCoin}`:"",i=(0,z.cn)("whitespace-nowrap",e.gt(0)&&"text-functional-green-1",e.lt(0)&&"text-functional-red-1"),o[1]=u,o[2]=c.realizePnl,o[3]=t,o[4]=n,o[5]=a,o[6]=i}else t=o[3],n=o[4],a=o[5],i=o[6];return o[7]!==t||o[8]!==n||o[9]!==a||o[10]!==i?(r=(0,l.jsxs)("span",{className:i,children:[n,t,a]}),o[7]=t,o[8]=n,o[9]=a,o[10]=i,o[11]=r):r=o[11],r}function en(e){var t;let n,a,i,r,o,c,u,d,m,x,h,f,g,y,N,b,j,w,I,E,S,V,O,_,T,D,P,A,R,C=(0,s.c)(77),{voucher:U,symbol:L,open:k,onOpenChange:H}=e,B=(0,p.A)();if(!U)return null;C[0]!==B||C[1]!==U.side?(n=U.side?B(`positionVoucher.side.${U.side}`):"--",C[0]=B,C[1]=U.side,C[2]=n):n=C[2];let $=n;C[3]!==B?(a=B("positionVoucher.detailsTitle"),C[3]=B,C[4]=a):a=C[4],C[5]!==a?(i=(0,l.jsx)(v.c7,{className:"mb-0 px-5 pt-5 pb-3",children:(0,l.jsx)(v.L3,{children:a})}),C[5]=a,C[6]=i):i=C[6],C[7]!==B?(r=B("positionVoucher.symbolSide"),C[7]=B,C[8]=r):r=C[8];let M=null!=(t=null==L?void 0:L.symbol)?t:U.contractId,F="LONG"===U.side&&"text-functional-green-1",K="SHORT"===U.side&&"text-functional-red-1";return C[9]!==F||C[10]!==K?(o=(0,z.cn)(F,K),C[9]=F,C[10]=K,C[11]=o):o=C[11],C[12]!==$||C[13]!==o?(c=(0,l.jsx)("span",{className:o,children:$}),C[12]=$,C[13]=o,C[14]=c):c=C[14],C[15]!==M||C[16]!==c?(u=(0,l.jsxs)("span",{className:"whitespace-nowrap",children:[M," ",c]}),C[15]=M,C[16]=c,C[17]=u):u=C[17],C[18]!==u||C[19]!==r?(d=(0,l.jsx)(Z,{label:r,children:u}),C[18]=u,C[19]=r,C[20]=d):d=C[20],C[21]!==B?(m=B("positionVoucher.leverage"),C[21]=B,C[22]=m):m=C[22],C[23]!==m||C[24]!==U.leverage?(x=(0,l.jsxs)(Z,{label:m,children:[U.leverage,"x"]}),C[23]=m,C[24]=U.leverage,C[25]=x):x=C[25],C[26]!==B?(h=B("positionVoucher.openTime"),C[26]=B,C[27]=h):h=C[27],C[28]!==U.openTime?(f=(0,l.jsx)(ee,{value:U.openTime}),C[28]=U.openTime,C[29]=f):f=C[29],C[30]!==h||C[31]!==f?(g=(0,l.jsx)(Z,{label:h,children:f}),C[30]=h,C[31]=f,C[32]=g):g=C[32],C[33]!==B?(y=B("positionVoucher.closeTime"),C[33]=B,C[34]=y):y=C[34],C[35]!==U.closeTime?(N=(0,l.jsx)(ee,{value:U.closeTime}),C[35]=U.closeTime,C[36]=N):N=C[36],C[37]!==y||C[38]!==N?(b=(0,l.jsx)(Z,{label:y,children:N}),C[37]=y,C[38]=N,C[39]=b):b=C[39],C[40]!==B?(j=B("positionVoucher.realizedPnlTooltipFees"),C[40]=B,C[41]=j):j=C[41],C[42]!==j?(w=(0,l.jsx)("span",{className:"block",children:j}),C[42]=j,C[43]=w):w=C[43],C[44]!==B?(I=B("positionVoucher.realizedPnlTooltipProfit"),C[44]=B,C[45]=I):I=C[45],C[46]!==I?(E=(0,l.jsx)("span",{className:"block",children:I}),C[46]=I,C[47]=E):E=C[47],C[48]!==w||C[49]!==E?(S=(0,l.jsxs)("span",{children:[w,E]}),C[48]=w,C[49]=E,C[50]=S):S=C[50],C[51]!==B?(V=B("positionVoucher.realizedPnl"),C[51]=B,C[52]=V):V=C[52],C[53]!==V?(O=(0,l.jsx)("span",{className:"border-text-tertiary cursor-help border-b border-dashed",children:V}),C[53]=V,C[54]=O):O=C[54],C[55]!==S||C[56]!==O?(_=(0,l.jsx)(G.Ay,{placement:"top",className:"z-[120] w-[322px] !max-w-[322px] px-3 py-2 text-sm leading-[22px] font-medium",title:S,children:O}),C[55]=S,C[56]=O,C[57]=_):_=C[57],C[58]!==L||C[59]!==U?(T=(0,l.jsx)(et,{voucher:U,symbol:L}),C[58]=L,C[59]=U,C[60]=T):T=C[60],C[61]!==_||C[62]!==T?(D=(0,l.jsx)(Z,{label:_,children:T}),C[61]=_,C[62]=T,C[63]=D):D=C[63],C[64]!==d||C[65]!==x||C[66]!==g||C[67]!==b||C[68]!==D?(P=(0,l.jsx)("div",{className:"overflow-x-auto px-5 py-1.5",children:(0,l.jsxs)("div",{className:"flex w-max min-w-[560px]",children:[d,x,g,b,D]})}),C[64]=d,C[65]=x,C[66]=g,C[67]=b,C[68]=D,C[69]=P):P=C[69],C[70]!==i||C[71]!==P?(A=(0,l.jsxs)(v.Cf,{draggable:!1,zIndex:110,overlayClassName:"bg-black/65",className:"max-w-[calc(100vw-32px)] gap-0 overflow-hidden p-0 pb-[18px] sm:w-fit sm:max-w-[calc(100vw-32px)] sm:min-w-[600px]",children:[i,P]}),C[70]=i,C[71]=P,C[72]=A):A=C[72],C[73]!==H||C[74]!==k||C[75]!==A?(R=(0,l.jsx)(v.lG,{open:k,onOpenChange:H,children:A}),C[73]=H,C[74]=k,C[75]=A,C[76]=R):R=C[76],R}var el=n(72100),es=n(98710),ea=n(67130);
2function ei(e,t,n){if(!t)return e("bonusVoucher.error.unknown");let l=e(t,n);return l&&l!==t?l:e("bonusVoucher.error.unknown")}var er=n(4618),eo=n(75892),ec=n(13537),eu=n(58521);function ed(){var e,t,n,f,v,g,y,N,b,j;let w,I,E,S,_,T,D,P,C,U,L,k,z,$,M,F,G,K,Q,X,Y,q,J,Z,ee,et,ed,ey,eN,eb,ej,ew,eI,eE,eS,eV,eO,e_,eT,eD,eP,eA,eR,eC,eU,eL,ek,eH,eB,ez,e$,eM,eF,eG,eK,eQ,eX,eY,eq,eW,eJ,eZ,e1,e0,e2,e3,e4,e5,e6,e7=(0,s.c)(192),e8=(0,p.A)(),e9=(0,m.Zp)(),te=(0,eu.O3)(),tt=(0,h.H7)(),tn=(0,eo.A)(),tl=(0,er.A)(),[ts,ta]=(0,a.useState)("ALL"),[ti,tr]=(0,a.useState)("PENDING"),to=O(),[tc,tu]=(0,a.useState)(null),[td,tm]=(0,a.useState)(null);e7[0]===Symbol.for("react.memo_cache_sentinel")?(w=[],e7[0]=w):w=e7[0];let[tx,th]=(0,a.useState)(w),[tp,tf]=(0,a.useState)(""),[tv,tg]=(0,a.useState)(null),ty=null!=(f=null==te?void 0:te.accountId)?f:"";e7[1]!==(null==te?void 0:te.clientAccountId)||e7[2]!==ty?(I=(0,V.Kl)(ty)&&!!(null==te?void 0:te.clientAccountId),e7[1]=null==te?void 0:te.clientAccountId,e7[2]=ty,e7[3]=I):I=e7[3];let tN=I,tb=tt&&tN;e7[4]!==to.offsetData?(E=to.offsetData?{offsetData:to.offsetData}:{},e7[4]=to.offsetData,e7[5]=E):E=e7[5],e7[6]!==ti?(S="ALL"===ti?{}:{filterVoucherStatus:ti},e7[6]=ti,e7[7]=S):S=e7[7],e7[8]!==ts?(_="ALL"===ts?{}:{filterVoucherType:ts},e7[8]=ts,e7[9]=_):_=e7[9],e7[10]!==ty||e7[11]!==tb||e7[12]!==E||e7[13]!==S||e7[14]!==_?(T={accountId:ty,enabled:tb,size:9,...E,...S,..._},e7[10]=ty,e7[11]=tb,e7[12]=E,e7[13]=S,e7[14]=_,e7[15]=T):T=e7[15];let tj=(0,V.xw)(T);if(e7[16]!==tn||e7[17]!==(null==(e=tj.data)?void 0:e.voucher)){let e,t=(null!=(y=null==(v=tj.data)?void 0:v.voucher)?y:[]).flatMap(eg),n=[...tn.map(ev).filter(ef),...t];e7[19]!==n?(e=new Set(n),e7[19]=n,e7[20]=e):e=e7[20],D=Array.from(e),e7[16]=tn,e7[17]=null==(g=tj.data)?void 0:g.voucher,e7[18]=D}else D=e7[18];let tw=D;e7[21]!==ty||e7[22]!==tw||e7[23]!==tb?(P={accountId:ty,coinIds:tw,enabled:tb,size:100},e7[21]=ty,e7[22]=tw,e7[23]=tb,e7[24]=P):P=e7[24],(0,V.RP)(P);let tI=function(){let e=(0,p.A)(),t=(0,V.nC)(),[n,l]=(0,a.useState)(null);return{redeem:async n=>{try{let s=await t.mutateAsync(n);if("SUCCESS_BONUS_VOUCHER_REDEEMED"===s.result){s.voucher&&l(s.voucher);return}if("SUCCESS_BONUS_VOUCHER_ALREADY_REDEEMED"===s.result)return;if("PENDING_BONUS_VOUCHER_REDEMPTION"===s.result&&s.timedOut)return void ea.oR.show({type:"warning",title:e("bonusVoucher.redeemPending")});ea.oR.show({type:"error",title:ei(e,s.result)})}catch(l){let{code:t,values:n}=function(e){var t;if(!e||"object"!=typeof e)return{};let n="code"in e&&"string"==typeof e.code?e.code:void 0,l="errorParam"in e&&(t=e.errorParam)&&"object"==typeof t&&!Array.isArray(t)&&Object.values(t).every(e=>null==e||"string"==typeof e||"number"==typeof e||"boolean"==typeof e)?e.errorParam:void 0;return{...n?{code:n}:{},...l?{values:l}:{}}}(l);ea.oR.show({type:"error",title:ei(e,t,n)})}},isRedeeming:t.isPending,isRedeemingVoucherId:e=>t.isPending&&t.variables===e,redeemedVoucher:n,clearRedeemedVoucher:()=>l(null)}}();e7[25]!==tI?(C=e=>void tI.redeem(e),e7[25]=tI,e7[26]=C):C=e7[26];let tE=C;if(!tt){let e;return e7[27]===Symbol.for("react.memo_cache_sentinel")?(e=(0,l.jsx)(m.C5,{to:"/perpetuals",replace:!0}),e7[27]=e):e=e7[27],e}if(!tN)return null;e7[28]!==tn?(U=new Map(tn.map(ep)),e7[28]=tn,e7[29]=U):U=e7[29];let tS=U;e7[30]!==tl||e7[31]!==e9||e7[32]!==tn?(L=e=>{let t=tn.find(t=>t.contractId===e.contractId);tg(e.id),tl(e).then(n=>{var l,s;let a;if(!n)return;if(!n.passed){th(n.items),tf((0,ec.vW)({symbol:null==(l=n.cta.symbol)?void 0:l.symbol,accountTradingType:n.cta.accountTradingType}));return}let i=(0,ec.ro)(e.id,{symbol:null==(a=void 0===(s=n.symbol)?t:s)?void 0:a.symbol,accountTradingType:e.accountTradingType});i&&((0,es.mr)(e),e9(i))}).finally(()=>{tg(t=>t===e.id?null:t)})},e7[30]=tl,e7[31]=e9,e7[32]=tn,e7[33]=L):L=e7[33];let tV=L;e7[34]!==(null==(t=tj.data)?void 0:t.voucher)?(k=null!=(j=null==(N=tj.data)?void 0:N.voucher)?j:[],e7[34]=null==(b=tj.data)?void 0:b.voucher,e7[35]=k):k=e7[35];let tO=k;e7[36]!==tI?(z=e=>{let t=B(e);return"REDEEM_BONUS"===t.type&&tI.isRedeemingVoucherId(t.voucherId)},e7[36]=tI,e7[37]=z):z=e7[37];let t_=z,tT=to.isFirstPage,tD=!(null==(n=tj.data)?void 0:n.nextPageOffsetData);e7[38]!==e8?($=e8("positionVoucher.tab.all"),e7[38]=e8,e7[39]=$):$=e7[39],e7[40]!==$?(M={value:"ALL",label:$},e7[40]=$,e7[41]=M):M=e7[41],e7[42]!==e8?(F=e8("bonusVoucher.positionCouponTab"),e7[42]=e8,e7[43]=F):F=e7[43],e7[44]!==F?(G={value:"POSITION_VOUCHER",label:F},e7[44]=F,e7[45]=G):G=e7[45],e7[46]!==e8?(K=e8("bonusVoucher.trialFundTab"),e7[46]=e8,e7[47]=K):K=e7[47],e7[48]!==K?(Q={value:"BONUS_VOUCHER",label:K},e7[48]=K,e7[49]=Q):Q=e7[49],e7[50]!==M||e7[51]!==G||e7[52]!==Q?(X=[M,G,Q],e7[50]=M,e7[51]=G,e7[52]=Q,e7[53]=X):X=e7[53];let tP=X;
2e7[54]!==e8?(Y=e8("positionVoucher.tab.all"),e7[54]=e8,e7[55]=Y):Y=e7[55],e7[56]!==Y?(q={value:"ALL",label:Y},e7[56]=Y,e7[57]=q):q=e7[57],e7[58]!==e8?(J=e8("positionVoucher.status.PENDING"),e7[58]=e8,e7[59]=J):J=e7[59],e7[60]!==J?(Z={value:"PENDING",label:J},e7[60]=J,e7[61]=Z):Z=e7[61],e7[62]!==e8?(ee=e8("positionVoucher.status.USED"),e7[62]=e8,e7[63]=ee):ee=e7[63],e7[64]!==ee?(et={value:"USED",label:ee},e7[64]=ee,e7[65]=et):et=e7[65],e7[66]!==e8?(ed=e8("positionVoucher.status.EXPIRED"),e7[66]=e8,e7[67]=ed):ed=e7[67],e7[68]!==ed?(ey={value:"EXPIRED",label:ed},e7[68]=ed,e7[69]=ey):ey=e7[69],e7[70]!==e8?(eN=e8("positionVoucher.status.INVALID"),e7[70]=e8,e7[71]=eN):eN=e7[71],e7[72]!==eN?(eb={value:"INVALID",label:eN},e7[72]=eN,e7[73]=eb):eb=e7[73],e7[74]!==q||e7[75]!==Z||e7[76]!==et||e7[77]!==ey||e7[78]!==eb?(ej=[q,Z,et,ey,eb],e7[74]=q,e7[75]=Z,e7[76]=et,e7[77]=ey,e7[78]=eb,e7[79]=ej):ej=e7[79];let tA=ej;e7[80]!==tc||e7[81]!==tS?(ew=tc?tS.get(tc.contractId):void 0,e7[80]=tc,e7[81]=tS,e7[82]=ew):ew=e7[82];let tR=ew;e7[83]!==td||e7[84]!==tn?(eI=td?tn.find(e=>e.quoteCoinId===td.coinId):void 0,e7[83]=td,e7[84]=tn,e7[85]=eI):eI=e7[85];let tC=eI;e7[86]!==tI.redeemedVoucher||e7[87]!==tn?(eE=tI.redeemedVoucher?tn.find(e=>{var t;return e.quoteCoinId===(null==(t=tI.redeemedVoucher)?void 0:t.coinId)}):void 0,e7[86]=tI.redeemedVoucher,e7[87]=tn,e7[88]=eE):eE=e7[88];let tU=eE;e7[89]!==e8?(eS=e8("bonusVoucher.center"),e7[89]=e8,e7[90]=eS):eS=e7[90],e7[91]!==eS?(eV=(0,l.jsx)("h1",{className:"text-text-primary text-2xl leading-8 font-medium",children:eS}),e7[91]=eS,e7[92]=eV):eV=e7[92],e7[93]===Symbol.for("react.memo_cache_sentinel")?(eO=(0,l.jsx)(u.A,{className:"size-4"}),e7[93]=eO):eO=e7[93],e7[94]!==e8?(e_=e8("positionVoucher.guide"),e7[94]=e8,e7[95]=e_):e_=e7[95],e7[96]!==e_?(eT=(0,l.jsx)(i.$,{asChild:!0,size:"sm",variant:"ghost",children:(0,l.jsxs)("a",{href:"https://edgexhelp.zendesk.com/hc/en-001/sections/17289865341199-Voucher-Guide",target:"_blank",rel:"noopener noreferrer",className:"gap-1",children:[eO,e_]})}),e7[96]=e_,e7[97]=eT):eT=e7[97],e7[98]!==eV||e7[99]!==eT?(eD=(0,l.jsxs)("div",{className:"flex h-8 items-center justify-between",children:[eV,eT]}),e7[98]=eV,e7[99]=eT,e7[100]=eD):eD=e7[100],e7[101]!==to?(eP=e=>{ta(e),to.reset()},e7[101]=to,e7[102]=eP):eP=e7[102],e7[103]!==tP?(eA=(0,l.jsx)(c.j7,{variant:"secondary",className:"max-w-full whitespace-nowrap",children:tP.map(eh)}),e7[103]=tP,e7[104]=eA):eA=e7[104],e7[105]!==eP||e7[106]!==eA||e7[107]!==ts?(eR=(0,l.jsx)(c.tU,{value:ts,onValueChange:eP,className:"max-w-full min-w-0",children:eA}),e7[105]=eP,e7[106]=eA,e7[107]=ts,e7[108]=eR):eR=e7[108],e7[109]!==to?(eC=e=>{tr(e),to.reset()},e7[109]=to,e7[110]=eC):eC=e7[110],e7[111]!==e8?(eU=e8("status"),e7[111]=e8,e7[112]=eU):eU=e7[112],e7[113]!==eU?(eL=(0,l.jsx)("span",{className:"text-text-tertiary shrink-0",children:eU}),e7[113]=eU,e7[114]=eL):eL=e7[114],e7[115]===Symbol.for("react.memo_cache_sentinel")?(ek=(0,l.jsxs)("span",{className:"text-text-primary flex items-center gap-1",children:[(0,l.jsx)(o.yv,{}),(0,l.jsx)(d.A,{className:"text-text-primary size-4"})]}),e7[115]=ek):ek=e7[115],e7[116]!==eL?(eH=(0,l.jsxs)(o.bq,{variant:"bordered",size:"none",hideIcon:!0,className:"h-[34px] !w-auto !min-w-0 justify-start gap-4 roun
2ded-lg px-3 py-1.5 text-sm leading-[22px] font-medium",children:[eL,ek]}),e7[116]=eL,e7[117]=eH):eH=e7[117],e7[118]!==tA?(eB=(0,l.jsx)(o.gC,{className:"shadow-lg shadow-black/40",viewportClassName:"flex flex-col gap-1",children:tA.map(ex)}),e7[118]=tA,e7[119]=eB):eB=e7[119],e7[120]!==eC||e7[121]!==eH||e7[122]!==eB||e7[123]!==ti?(ez=(0,l.jsxs)(o.l6,{value:ti,onValueChange:eC,children:[eH,eB]}),e7[120]=eC,e7[121]=eH,e7[122]=eB,e7[123]=ti,e7[124]=ez):ez=e7[124],e7[125]!==eR||e7[126]!==ez?(e$=(0,l.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[eR,ez]}),e7[125]=eR,e7[126]=ez,e7[127]=e$):e$=e7[127],e7[128]!==tE||e7[129]!==tV||e7[130]!==tD||e7[131]!==tT||e7[132]!==t_||e7[133]!==to||e7[134]!==tI.isRedeeming||e7[135]!==tn||e7[136]!==e8||e7[137]!==tv||e7[138]!==tj||e7[139]!==tO?(eM=tj.isPending?(0,l.jsx)(x.A,{className:"min-h-40"}):tj.isError?(0,l.jsxs)("div",{className:"text-text-tertiary py-20 text-center",children:[(0,l.jsx)("p",{children:e8("positionVoucher.loadFailed")}),(0,l.jsx)(i.$,{className:"mt-3",size:"sm",variant:"secondary",onClick:()=>void tj.refetch(),children:e8("bonusVoucher.retry")})]}):tO.length>0?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"pc:grid-cols-3 mt-3 grid grid-cols-1 gap-6 md:grid-cols-2",children:tO.map(e=>{let t=H(e).getSymbol(e,tn),n=t_(e),s="POSITION_VOUCHER"===e.voucherType?`position-${e.voucherData.id}`:`bonus-${e.voucherData.voucherId}`,a="POSITION_VOUCHER"===e.voucherType&&tv===e.voucherData.id;return(0,l.jsx)(W,{voucher:e,...t?{symbol:t}:{},isRedeeming:n,isRedeemDisabled:tI.isRedeeming&&!n,isUsing:a,actions:{onUsePosition:tV,onRedeemBonus:tE,onViewPosition:tu,onViewBonus:tm}},s)})}),tT&&tD?null:(0,l.jsx)(r.BK,{className:"mt-6",children:(0,l.jsxs)(r.Iu,{children:[(0,l.jsx)(r.cU,{children:(0,l.jsx)(r.Eb,{"aria-disabled":tT,className:tT?"pointer-events-none opacity-40":"",onClick:to.goPrevious})}),(0,l.jsx)(r.cU,{children:(0,l.jsx)(r.n$,{isActive:!0,children:to.currentPage})}),(0,l.jsx)(r.cU,{children:(0,l.jsx)(r.WA,{"aria-disabled":tD,className:tD?"pointer-events-none opacity-40":"",onClick:()=>{var e;return to.goNext(null==(e=tj.data)?void 0:e.nextPageOffsetData)}})})]})})]}):(0,l.jsx)("div",{className:"text-text-tertiary py-20 text-center",children:e8("positionVoucher.empty")}),e7[128]=tE,e7[129]=tV,e7[130]=tD,e7[131]=tT,e7[132]=t_,e7[133]=to,e7[134]=tI.isRedeeming,e7[135]=tn,e7[136]=e8,e7[137]=tv,e7[138]=tj,e7[139]=tO,e7[140]=eM):eM=e7[140],e7[141]!==e$||e7[142]!==eM?(eF=(0,l.jsxs)("section",{className:"mt-6",children:[e$,eM]}),e7[141]=e$,e7[142]=eM,e7[143]=eF):eF=e7[143],e7[144]!==tR?(eG=tR?{symbol:tR}:{},e7[144]=tR,e7[145]=eG):eG=e7[145];let tL=!!tc;e7[146]===Symbol.for("react.memo_cache_sentinel")?(eK=e=>{e||tu(null)},e7[146]=eK):eK=e7[146],e7[147]!==tc||e7[148]!==eG||e7[149]!==tL?(eQ=(0,l.jsx)(en,{voucher:tc,...eG,open:tL,onOpenChange:eK}),e7[147]=tc,e7[148]=eG,e7[149]=tL,e7[150]=eQ):eQ=e7[150],e7[151]!==tC?(eX=tC?{symbol:tC}:{},e7[151]=tC,e7[152]=eX):eX=e7[152];let tk=!!td;e7[153]===Symbol.for("react.memo_cache_sentinel")?(eY=e=>{e||tm(null)},e7[153]=eY):eY=e7[153],e7[154]!==e9?(eq=()=>e9("/perpetuals"),e7[154]=e9,e7[155]=eq):eq=e7[155],e7[156]!==ty||e7[157]!==td||e7[158]!==tn||e7[159]!==eX||e7[160]!==tk||e7[161]!==eq?(eW=(0,l.jsx)(R,{voucher:td,accountId:ty,symbols:tn,...eX,open:tk,onOpenChange:eY,onGoToUse:eq}),e7[156]=ty,e7[157]=td,e7[158]=tn,e7[159]=eX,e7[160]=tk,e7[161]=eq,e7[162]=eW):eW=e7[162],e7[163]!==tU?(eJ=tU?{symbol:tU}:{},e7[163]=tU,e7[164]=eJ):eJ=e7[164];let tH=!!tI.redeemedVoucher;return e7[165]!==tI?(eZ=e=>{e||tI.clearRedeemedVoucher()},e7[165]=tI,e7[166]=eZ):eZ=e7[166],e7[167]!==e9?(e1=()=>e9("/perpetuals"),e7[167]=e9,e7[168]=e1):e1=e7[168],e7[169]!==tI.redeemedVoucher||e7[170]!==eJ||e7[171]!==tH||e7[172]!==eZ||e7[173]!==e1?(e0=(0,l.jsx)(A,{voucher:tI.redeemedVoucher,...eJ,open:tH,onOpenChange:eZ,onGoToTrade:e1}),e7[169]=tI.redeemedVoucher,e7[170]=eJ,e7[171]=tH,e7[172]=eZ,e7[173]=e1,e7[174]=e0):e0=e7[174],e7[175]!==tx?(e2=tx.some(em),e7[175]=tx,e7[176]=e2):e2=e7[176],e7[177]===Symbol.for("react.memo_cache_sentinel")?(e3=e=>{e||th([])},e7[177]=e3):e3=e7[177],e7[178]!==tp||e7[179]!==e9?(e4=()=>{th([]),e9(tp||"/perpetuals")},e7[178]=tp,e7[179]=e9,e7[180]=e4):e4=e7[180],e7[181]!==tx||e7[182]!==e2||e7[183]!==e4?(e5=(0,l.jsx)(el.y,{items:tx,open:e2,onOpenChange:e3,onGoToContract:e4}),e7[181]=tx,e7[182]=e2,e7[183]=e4,e7[184]=e5):e5=e7[184],e7[185]!==eD||e7[186]!==eF||e7[187]!==eQ||e7[188]!==eW||e7[189]!==e0||e7[190]!==e5?(e6=(0,l.jsxs)("main",{className:"mx-auto min-h-[calc(100vh-58px)] w-full max-w-[1248px] px-6 pt-16 pb-[73px]",children:[eD,eF,eQ,eW,e0,e5]}),e7[185]=eD,e7[186]=eF,e7[187]=eQ,e7[188]=eW,e7[189]=e0,e7[190]=e5,e7[191]=e6):e6=e7[191],e6}function em(e){return!e.passed}function ex(e){return(0,l.jsx)(o.eb,{value:e.value,children:e.label},e.value)}function eh(e){return(0,l.jsx)(c.Xi,{value:e.value,children:e.label},e.value)}function ep(e){return[e.contractId,e]}function ef(e){return!!e}function ev(e){return e.quoteCoinId}function eg(e){return"BONUS_VOUCHER"===e.voucherType?[e.voucherData.coinId]:[]}},1398:function(e,t,n){n.d(t,{A:()=>c});var l=n(65723),s=n(20305),a=n(22155),i=n(22880),r=n(57278);let o=(e,t,n)=>"function"==typeof n?n(e,t):n||"",c=(0,a.memo)(e=>{let t,n,c,h,p,f,v,g,y,N=(0,s.c)(40),{data:b,columns:j,containerClassName:w,containerRef:I,footer:E,tableClassName:S,bodyClassName:V,headerRowClassName:O,headerCellClassName:_,bodyRowClassName:T,bodyRowProps:D,rowKey:P,mobileColumnCount:A,mobileRowFooter:R}=e,C=void 0===D?u:D,U=void 0===A?1:A,L=null!=b?b:[],k=null!=j?j:[];N[0]!==P?(t=(e=>{if("function"==typeof e)return e;if(void 0!==e){let t=String(e);return e=>null==e?void 0:e[t]}return(e,t)=>{var n;return null!=(n=null==e?void 0:e.id)?n:t}})(P),N[0]=P,N[1]=t):t=N[1];let H=t,B=k.some(d),z=k.map((e,t)=>a.createElement(B&&!e.sticky?"td":"th",{key:`t-h-${t}-${e.title}`,className:(0,i.QP)("function"==typeof _?_(e):_||"")},e.title));if((0,r.a)()){let e,t,n=k.filter(m),s=k.filter(x),r={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8",9:"grid-cols-9",10:"grid-cols-10"}[U],c={1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"
2col-span-8",9:"col-span-9",10:"col-span-10"}[U],u=1===U;return N[2]!==w?(e=(0,i.QP)(w),N[2]=w,N[3]=e):e=N[3],N[4]!==S?(t=(0,i.QP)("divide-y divide-line-divider-tertiary empty:hidden text-sm",S),N[4]=S,N[5]=t):t=N[5],(0,l.jsxs)("div",{ref:I,className:e,children:[(0,l.jsx)("div",{className:t,children:L.map((e,t)=>{var d;let m=null!=(d=H(e,t))?d:t,x=C(e,t),h=`mobile-row-${t}-${m}`;return(0,l.jsxs)("dl",{className:(0,i.QP)("grid gap-x-1 py-3",r,o(e,t,T)),...x,children:[n.length>0&&(0,l.jsx)("div",{className:(0,i.QP)("row-header flex justify-between empty:hidden mb-2",c),children:n.map((n,s)=>{let r=n.render(e,`${h}-sticky-${s}`,t),o=a.isValidElement(r)&&"td"===r.type,{className:c,children:u,...d}=o?r.props:{};return(0,l.jsx)("div",{className:0===s?"text-left":"text-right",children:(0,l.jsx)("dd",{className:(0,i.QP)("",c),...d,children:o?u:r})},`${h}-sticky-${s}`)})}),s.map((n,s)=>{let r=n.render(e,`${h}-normal-${s}`,t),o=a.isValidElement(r)&&"td"===r.type,{className:c,children:d,...m}=o?r.props:{};return(0,l.jsxs)("div",{className:(0,i.QP)("row-cell py-1",u&&"row-body flex justify-between items-center"),children:[(0,l.jsx)("dt",{className:"text-text-tertiary text-xs",children:n.title}),(0,l.jsx)("dd",{className:(0,i.QP)("",c),...m,children:o?d:r})]},`${h}-normal-${s}`)}),R&&(0,l.jsx)("div",{className:(0,i.QP)("row-footer empty:hidden",c),children:R(e,`${h}-footer`,t)})]},h)})}),E]})}N[6]!==w?(n=(0,i.QP)("overflow-x-auto max-w-full text-xs no-scrollbar",w),N[6]=w,N[7]=n):n=N[7];let $=(0,i.QP)("relative w-full border-collapse text-sm text-left [&_th]:align-middle [&_td]:align-middle [&_th]:whitespace-nowrap [&_td]:whitespace-nowrap","[&_thead_tr]:sticky [&_thead_tr]:top-0 [&_thead_tr]:z-[2]",B&&"[&_tr_th]:sticky [&_tr_th]:z-[1] [&_tr_th]:bg-inherit [&_tbody_tr_th]:bg-background [&_tr_th:first-child]:left-0 [&_tr_th:last-child]:right-0 [@media(hover:hover)]:hover:[&_tbody_tr:hover_th]:bg-[var(--dialog-tr-hover)]",S);if(N[8]!==O?(c=(0,i.QP)("text-(--text-tertiary) border-b-0 bg-background [&>*]:bg-inherit [&>*]:h-8 [&>*]:py-0 [&>*]:font-normal [&>*:not(:first-child)]:text-center [&>*]:text-text-tertiary",O),N[8]=O,N[9]=c):c=N[9],N[10]!==z||N[11]!==c?(h=(0,l.jsx)("thead",{children:(0,l.jsx)("tr",{className:c,children:z})}),N[10]=z,N[11]=c,N[12]=h):h=N[12],N[13]!==V?(p=(0,i.QP)("text-foreground",V),N[13]=V,N[14]=p):p=N[14],N[15]!==T||N[16]!==C||N[17]!==H||N[18]!==B||N[19]!==k||N[20]!==L){let e;N[22]!==T||N[23]!==C||N[24]!==H||N[25]!==B||N[26]!==k?(e=(e,t)=>{var n;let s=null!=(n=H(e,t))?n:t,r="string"==typeof s||"number"==typeof s?s:t;return(0,l.jsx)("tr",{className:(0,i.QP)("[@media(hover:hover)]:hover:bg-[var(--dialog-tr-hover)]","border-x-0 border-transparent [&>*]:font-normal [&>*]:h-12 [&>*]:leading-1 [&>*]:py-0 [&>*:not(:first-child)]:text-center",o(e,t,T)),...C(e,t),children:k.map((n,l)=>{let s=n.render(e,`t-d-${r}-${l}-${n.title}`,t);return B&&n.sticky&&a.isValidElement(s)&&"td"===s.type?a.createElement("th",{...s.props,key:s.key,className:s.props.className},s.props.children):s})},s)},N[22]=T,N[23]=C,N[24]=H,N[25]=B,N[26]=k,N[27]=e):e=N[27],f=L.map(e),N[15]=T,N[16]=C,N[17]=H,N[18]=B,N[19]=k,N[20]=L,N[21]=f}else f=N[21];return N[28]!==p||N[29]!==f?(v=(0,l.jsx)("tbody",{className:p,children:f}),N[28]=p,N[29]=f,N[30]=v):v=N[30],N[31]!==v||N[32]!==$||N[33]!==h?(g=(0,l.jsxs)("table",{className:$,children:[h,v]}),N[31]=v,N[32]=$,N[33]=h,N[34]=g):g=N[34],N[35]!==I||N[36]!==E||N[37]!==g||N[38]!==n?(y=(0,l.jsxs)("div",{ref:I,className:n,children:[g,E]}),N[35]=I,N[36]=E,N[37]=g,N[38]=n,N[39]=y):y=N[39],y});function u(){return{}}function d(e){return e.sticky}function m(e){return e.sticky}function x(e){return!e.sticky}}}]);
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.