-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path9709-9239423c453cb767.js.download
More file actions
1 lines (1 loc) · 11.6 KB
/
Copy path9709-9239423c453cb767.js.download
File metadata and controls
1 lines (1 loc) · 11.6 KB
1
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9709],{10193:function(e,t,n){"use strict";n.d(t,{E:function(){return g}});var l=n(85893),a=n(67294),s=n(59112),i=n(62410),r=n(72261),o=n(77172),c=n(59720),u=n(68995),f=n(21779),d=n(94907),x=n(62036),m=n(91883);function g(e){var t;let{offer:n,isPending:g,isOpen:p=!1,onConfirm:j,onDismiss:h}=e,{isSmall:y}=(0,d.kC)(),v=(0,d.yo)(),b=(0,d.Jp)(),{acceptOffer:N}=(0,f.yY)(),{isValidating:C,data:O}=(0,f.Rd)({nftId:null==n?void 0:n.nftId,currency:b}),{trackUserAction:w}=(0,d.Jh)({pageName:"AE"}),k=(0,f.Rm)({nft_id:[null!==(t=null==n?void 0:n.nftId)&&void 0!==t?t:""],status:"open"}),[K,S]=(0,a.useState)(!1),_=g||K||C,D=(null==O?void 0:O.custody)==="PendingKraken",B=(0,a.useCallback)(()=>{w("Nft Accept Offer"),k.mutate(),null==j||j(n)},[k,n,j,w]),T=(0,a.useCallback)(e=>(S(!0),N({offer_id:n.id,otp:e})),[N,n.id]),I=(0,a.useMemo)(()=>_?null:D?(0,l.jsx)(s.x,{langKey:"nft:offer:AcceptOffer:PendingKrakenCustody:Title"}):(0,l.jsx)(s.x,{langKey:"nft:listings:AcceptOffer"}),[_,D]);return(0,l.jsx)(u.BW,{onDismiss:h,onConfirm:B,onMutate:T,canSubmit:!0,children:e=>{let{onSubmitHandler:t}=e;return(0,l.jsxs)(x.L,{hasCloseButton:!0,onDismiss:h,isOpen:p,title:I,ariaLabel:"nft-approve-offer-dialog",children:[_&&(0,l.jsx)("div",{style:{width:40,height:40},"data-testid":"loading",className:"relative mv10 mh-auto",children:(0,l.jsx)(i.T,{size:"small",skinny:!0})}),!_&&D&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"body-2",children:(0,l.jsx)(s.x,{langKey:"nft:offer:AcceptOffer:PendingKrakenCustody:Body"})}),(0,l.jsx)("div",{className:"mt3 flex",children:(0,l.jsx)(r.zx,{"data-testid":"cancel button",onClick:h,type:"button",className:"ml-auto",size:y?"full-width":"extra-large",children:(0,l.jsx)(s.x,{langKey:"nft:offer:AcceptOffer:PendingKrakenCustody:Cta"})})})]}),!_&&!D&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"caption-3 text-N200 mb1",children:(0,l.jsx)(s.x,{langKey:"nft:listings:AcceptOfferDialog:details"})}),(0,l.jsxs)("div",{children:[(0,l.jsx)(o.c,{className:"pv1/2",label:(0,l.jsx)(s.x,{langKey:"nft:wallet:NftName"}),value:n.name}),(0,l.jsx)(o.c,{className:"pv1/2",label:(0,l.jsx)(s.x,{langKey:"nft:listings:AcceptOfferDialog:totalReceived"}),value:(0,l.jsx)(m.Y,{value:n.price.toString(),asset:n.ticker})}),(0,l.jsx)(o.c,{className:"pv1/2",label:(0,l.jsx)(s.x,{langKey:"nft:listings:AcceptOfferDialog:totalUSD"}),value:(0,l.jsx)(m.Y,{value:v(n.ticker,n.price.toString()),asset:{asset:"USD"}})})]}),(0,l.jsx)(c.T,{buttonSize:"large",cancelButtonText:(0,l.jsx)(s.x,{langKey:"general:Cancel"}),className:"mt6",confirmButtonText:(0,l.jsx)(s.x,{langKey:"nft:listings:AcceptOffer"}),onCancel:h,onConfirm:t})]})]})}})}},41599:function(e,t,n){"use strict";n.d(t,{B:function(){return d}});var l=n(85893),a=n(67294),s=n(59112),i=n(36122),r=n(93552),o=function(e,t){var n={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&0>t.indexOf(l)&&(n[l]=e[l]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,l=Object.getOwnPropertySymbols(e);a<l.length;a++)0>t.indexOf(l[a])&&Object.prototype.propertyIsEnumerable.call(e,l[a])&&(n[l[a]]=e[l[a]]);return n};let c=a.forwardRef((e,t)=>{var{color:n}=e,l=o(e,["color"]);return a.createElement("svg",Object.assign({},(0,r.ti)(l),{ref:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"}),a.createElement("path",{d:"M9.82062 6.57201L8.12763 9.00006H19.0003V11.0001H4.29492L8.18006 5.4281L9.82062 6.57201Z",fill:n}),a.createElement("path",{d:"M14.2 17.4L16 15L5 15L5 13L20 13L15.8 18.6L14.2 17.4Z",fill:n}))});c.displayName="ExchangeHorizontal";let u=e=>{let{type:t}=e;switch(t){case"accept":return(0,l.jsx)(s.x,{langKey:"nft:bids:Accept"});case"counter":return(0,l.jsx)(s.x,{langKey:"nft:bids:Counter"});default:throw Error("Unknown key supplied.")}},f=e=>{let{type:t,className:n}=e;switch(t){case"accept":return(0,l.jsx)(i.p,{className:n});case"counter":return(0,l.jsx)(c,{className:n});default:return null}},d=e=>{let{type:t}=e;return(0,l.jsxs)("span",{className:"flex flow-row mr3/2",children:[(0,l.jsx)(f,{type:t,className:"mr1/2"}),(0,l.jsx)("span",{className:"self-center",children:(0,l.jsx)(u,{type:t})})]})}},41343:function(e,t,n){"use strict";n.d(t,{Bq:function(){return j},QO:function(){return h}});var l=n(85893),a=n(67294),s=n(94184),i=n.n(s),r=n(62410),o=n(59720),c=n(59112),u=n(94907),f=n(62036),d=n(76109),x=n.n(d);let m=e=>{let{title:t,ariaLabel:n,details:s,confirmButtonText:d,eventTracker:m,isPending:g,isOpen:p=!1,className:j,onConfirm:h,onDismiss:y}=e,{isSmall:v}=(0,u.kC)(),{trackUserAction:b}=(0,u.Jh)({pageName:"AE"}),N=(0,a.useCallback)(()=>{m&&b(m),null==h||h()},[m,h,b]);return(0,l.jsx)(f.L,{className:i()(j,{[x().mobile]:v}),hasCloseButton:!0,onDismiss:y,isOpen:p,title:t,ariaLabel:n,children:g?(0,l.jsx)("div",{style:{width:40,height:40},className:"relative mv10 mh-auto",children:(0,l.jsx)(r.T,{"data-testid":"loading",size:"small",skinny:!0})}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"mb1",children:s}),(0,l.jsx)(o.T,{buttonSize:"large",cancelButtonText:(0,l.jsx)(c.x,{langKey:"general:Cancel"}),className:"mt6",confirmButtonText:d,onCancel:y,onConfirm:N})]})})};var g=n(68995),p=n(21779);function j(e){let{onConfirm:t,onDismiss:n,offerId:s,className:i}=e,{deleteOffer:r}=(0,p.yY)(),o=(0,a.useCallback)(e=>r({id:[null!=s?s:""],otp:e}),[r,s]);return(0,l.jsx)(g.BW,{onDismiss:n,onConfirm:t,onMutate:o,canSubmit:!!s,children:e=>{let{onSubmitHandler:t}=e;return(0,l.jsx)(m,{title:(0,l.jsx)(c.x,{langKey:"nft:listings:RetractOffer:title"}),ariaLabel:"nft-cancel-offer-dialog",details:(0,l.jsx)(c.x,{langKey:"nft:listings:RetractOffer:details"}),confirmButtonText:(0,l.jsx)(c.x,{langKey:"nft:listings:RetractOffer:confirm"}),eventTracker:"Nft Cancel Offer",className:i,isOpen:!0,onConfirm:t,onDismiss:n})}})}function h(e){let{onConfirm:t,onDismiss:n,auctionId:s}=e,{deleteAuction:i}=(0,p.vB)(),r=(0,a.useCallback)(e=>i({id:[null!=s?s:""],otp:e}),[s,i]);return(0,l.jsx)(g.BW,{onDismiss:n,onConfirm:t,onMutate:r,canSubmit:!!s,children:e=>{let{onSubmitHandler:t}=e;return(0,l.jsx)(m,{title:(0,l.jsx)(c.x,{langKey:"nft:listings:CancelSale:title"}),ariaLabel:"nft-cancel-sale-dialog",details:(0,l.jsx)(c.x,{langKey:"nft:listings:CancelSale:details"}),confirmButtonText:(0,l.jsx)(c.x,{langKey:"nft:listings:CancelSale:confirm"}),eventTracker:"Nft Cancel Offer",isOpen:!0,onConfirm:t,onDismiss:n})}})}},64318:function(e,t,n){"use strict";n.d(t,{E:function(){return w}});var l=n(85893),a=n(67294),s=n(94184),i=n.n(s),r=n(1922),o=n(59112),c=n(11770),u=n(92299),f=n(59720),d=n(75438),x=n(21779),m=n(94907),g=n(214),p=n(29436),j=n(44203),h=n(24758),y=n(66231),v=n(62036),b=n(68995),N=n(64279),C=n(54500),O=n.n(C);function w(e){var t;let{onDismiss:n,assetTicker:s,onConfirm:C,nftId:w,allowablePayments:k,nftAsset:K,offerId:S}=e,{t:_,i18n:D}=(0,r.$G)(),[B,T]=(0,a.useState)(),[I,L]=(0,a.useState)(null==k?void 0:null===(t=k[s])||void 0===t?void 0:t.asset),[E,A]=(0,a.useState)(6),[M,P]=(0,a.useState)(),[F,R]=(0,a.useState)(!1),z=(0,m.vs)(D.language),{trackUserAction:W}=(0,m.Jh)({pageName:"AE"}),J=(0,a.useCallback)(e=>M?(0,l.jsx)(l.Fragment,{children:(0,l.jsx)(o.x,{className:i()(O().inputText,"flex text-N600 pl2 pr2 body-2"),langKey:"nft:withdraw:ExpiresOn",keys:{date:z.format(e)},interpolation:{escapeValue:!1}})}):(0,l.jsx)(o.x,{className:i()(O().inputText,"dib pr1/2 text-N600 pl2 body-2"),langKey:"nft:withdraw:NoExpiration"}),[z,M]),Y=(0,a.useCallback)(e=>{var t;T((0,j.d)(null==e?void 0:null===(t=e.target)||void 0===t?void 0:t.value))},[]),H=(0,a.useCallback)(e=>{L(null==e?void 0:e.asset),A(null==e?void 0:e.funding_decimals),T(void 0)},[]),{counterOffer:V}=(0,x.yY)(),Z=(0,a.useCallback)(e=>V({ask_price:null!=B?B:"",currency:null!=I?I:"",expire_time:M?Number((M.getTime()/1e3).toFixed()):void 0,offer_id:S,otp:e}),[V,M,B,S,I]),q=(0,a.useCallback)(()=>{W("Nft Counter Offer"),C(),n()},[C,n,W]),U=I&&B&&+B>0&&F;return(0,l.jsx)(b.BW,{onDismiss:n,onConfirm:q,onMutate:Z,canSubmit:!!I&&!!B,children:e=>{let{onSubmitHandler:t}=e;return(0,l.jsx)(v.L,{isOpen:!0,title:(0,l.jsx)(o.x,{langKey:"nft:listings:CounterOfferDialog:title"}),ariaLabel:_("nft:listings:CounterOfferDialog:title"),onDismiss:n,children:(0,l.jsxs)(N.II,{boundaryName:"Nft-Counter-Offer-Dialog",type:"secondary",children:[(0,l.jsxs)("div",{className:"flex flex-column gap2",children:[(0,l.jsx)(h.P,{selectedPayment:I,onPaymentSelect:H,label:(0,l.jsx)(o.x,{langKey:"nft:listings:CounterOfferDialog:paymentIn"}),allowablePayments:k,nftAsset:K}),(0,l.jsxs)(c.gN,{floating:!0,onChange:Y,disabled:!I,value:B,children:[(0,l.jsx)("div",{className:"pl1",children:I?(0,l.jsx)(u.m,{asset:I,circle:!0,color:!0}):null}),(0,l.jsxs)(c.gN.Floating,{children:[(0,l.jsx)(c.gN.FloatingLabel,{children:(0,l.jsx)(o.x,{langKey:"nft:withdraw:SellFor"})}),(0,l.jsx)(c.gN.NumberInput,{inputmode:"decimal",decimalScale:E,skipFormatting:!0,allowedDecimalSeparators:[".",","]})]})]})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"caption-3 text-N200 mb1 mt4",children:(0,l.jsx)(o.x,{langKey:"nft:listings:ConfirmOffer:ExpiresOn"})}),(0,l.jsx)(p.h,{selectedCalendarDate:M,calendarDisplayValue:J,onCalendarChange:P})]}),(0,l.jsx)(y._,{total:B,quoteCurrency:I,nftId:Array.isArray(w)?w[0]:w}),(0,l.jsx)(g.B,{type:d.mr.Sell,onConfirm:R,onSubmit:t}),(0,l.jsx)(f.T,{buttonSize:"large",cancelButtonText:(0,l.jsx)(o.x,{langKey:"general:Cancel"}),className:"mt6",confirmButtonText:(0,l.jsx)(o.x,{langKey:"nft:withdraw:Sell"}),confirmDisabled:!U,onCancel:n,onConfirm:t})]})})}})}},96604:function(e,t,n){"use strict";n.d(t,{P:function(){return g}});var l=n(85893),a=n(56740),s=n(94184),i=n.n(s),r=n(67294),o=n(79154),c=n(45651),u=n(18301),f=n.n(u),d=n(94907),x=n(18399);let m=e=>{let{items:t,togglePopOver:n,triggerRef:a,...s}=e,o=r.useRef(null);return(0,d.dK)(n,o,a),(0,d.qX)(n),(0,l.jsx)("div",{...s,ref:o,className:i()(f().overflowMenu,"bg-pure-white ba text-P500"),children:t.map((e,t)=>e.disabled?(0,l.jsxs)("div",{role:"menuitem",className:i()(f().menuItem,"caption-2 pa1 cursor-disabled flex text-N100 items-center no-tab-highlight"),tabIndex:0,"data-testid":e.testId,children:[(0,l.jsx)("button",{className:i()("mr3/2 no-tab-highlight",e.className),children:e.icon}),e.text]},t):e.href?(0,l.jsxs)(x.O,{role:"menuitem",onClick:()=>{window.scrollTo(0,0),n(),e.onSelect&&e.onSelect()},className:i()(f().menuItem,"caption-2 pa1 pointer flex items-center no-tab-highlight"),href:e.href,as:e.as,target:e.target,"data-testid":e.testId,children:[(0,l.jsx)("div",{className:i()("mr3/2",e.className),children:e.icon}),e.text]},t):(0,l.jsxs)("div",{role:"menuitem",className:i()(f().menuItem,"caption-2 pa1 pointer flex items-center no-tab-highlight"),onClick:e.onSelect,tabIndex:0,onKeyPress:t=>"Enter"===t.key&&e.onSelect&&e.onSelect(),"data-testid":e.testId,children:[(0,l.jsx)("div",{className:i()("mr3/2",e.className),children:e.icon}),e.text]},t))})},g=e=>{let{id:t,className:n,items:s,...u}=e,d=r.useRef(null),[x,g]=(0,r.useState)(!1),p="".concat(t,"-menu"),j=(0,r.useCallback)(()=>{g(!x)},[x]);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.h,{...u,"aria-haspopup":"true","aria-controls":p,onClick:j,onKeyPress:e=>"Enter"===e.key&&j,id:t,ref:d,tabIndex:0,className:i()(f().overflowMenuButton,"pointer flex-column body-1 flex items-center justify-center",n,{[f().active]:x}),icon:o.p}),(0,l.jsx)(a.ZP,{hidden:!x,className:"starboard-root",targetRef:d,position:a.Kp,children:x&&(0,l.jsx)(m,{id:p,role:"menu","aria-labelledby":t,togglePopOver:j,triggerRef:d,items:s})})]})}},76109:function(e){e.exports={mobile:"NftCancelDialog_mobile___HL5Z"}},54500:function(e){e.exports={inputText:"NftCounterOfferDialog_inputText__4W49i"}},18301:function(e){e.exports={overflowMenu:"OverflowMenu_overflowMenu__AfDDu",menuItem:"OverflowMenu_menuItem__0TW_m",overflowMenuButton:"OverflowMenu_overflowMenuButton__ym9yn",active:"OverflowMenu_active__NCiFJ"}}}]);