PageSourceSearch

https://minhthuong.id.vn/_next/static/chunks/8193.7f89dc52a4afe174.js

js minhthuong.id.vn collected 2026-09-25 22:50:58 UTC 12,134 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8193],{28193:function(e,t,n){n.r(t),n.d(t,{default:function(){return C}});var i=n(57437),l=n(48245),a=n(8149),s=n(74340),r=n(47840),d=n(47499),o=n(98977),c=n(99240),u=n(93252),h=n(10827),x=n(20552),m=n(2265),g=n(87138),f=n(1990),p=n(11409),b=n(48872);function j(e){let{children:t}=e;return(0,i.jsx)(b.Z,{zoomMargin:80,classDialog:"zoom-image",children:t})}n(22392);var v=n(42321),D=n(39343),y=n(16463),w=n(19131),k=n(12310),N=n(54443),A=n(94962);function T(e){let{nft:t}=e,n=(0,y.useRouter)(),{contract:l}=(0,x.cqn)(f.YJ,"marketplace-v3"),{contract:r}=(0,x.cqn)("0xBA410E8D44f1846a0926E28cA880E096Ba6401Af"),{data:o,isLoading:c}=(0,x.doQ)(r,"isApprovedForAll",[t.owner,f.YJ]),{contract:u}=(0,x.cqn)(f.f2),{mutateAsync:h}=(0,x.gZ8)(l);async function m(){return!o&&await (null==u?void 0:u.call("setApprovalForAll",[f.YJ,!0]))&&console.log("Approval provided"),!0}let{register:g,handleSubmit:p}=(0,D.cI)({defaultValues:{nftContractAddress:f.f2,tokenId:t.metadata.id,price:"0",startDate:new Date,endDate:new Date}});async function b(e){return(await m(),e.price)?e.startDate?e.endDate?e.endDate<e.startDate?A.default.error("Thời gian kết th\xfac phải lớn hơn thời gian bắt đầu"):0>=Number(e.price)?A.default.error("Gi\xe1 b\xe1n phải lớn hơn 0"):(console.log("data.endDate",e.endDate),console.log("new Date()",new Date),new Date(e.endDate)<new Date)?A.default.error("Thời gian kết th\xfac phải lớn hơn thời gian hiện tại"):await h({currencyContractAddress:f.Tv,assetContractAddress:e.nftContractAddress,tokenId:e.tokenId,pricePerToken:e.price,startTimestamp:new Date(e.startDate),endTimestamp:new Date(e.endDate)}):A.default.error("Vui l\xf2ng nhập thời gian kết th\xfac"):A.default.error("Vui l\xf2ng nhập thời gian bắt đầu"):A.default.error("Vui l\xf2ng nhập gi\xe1 b\xe1n")}let{mutateAsync:j}=(0,x.U7J)(l),{register:v,handleSubmit:T}=(0,D.cI)({defaultValues:{nftContractAddress:f.f2,tokenId:t.metadata.id,startDate:new Date,endDate:new Date,floorPrice:"0",buyoutPrice:"0"}});async function C(e){return(await m(),e.buyoutPrice&&e.floorPrice)?e.startDate?e.endDate?e.endDate<e.startDate?A.default.error("Thời gian kết th\xfac phải lớn hơn thời gian bắt đầu"):0>=Number(e.buyoutPrice)||0>=Number(e.floorPrice)?A.default.error("Gi\xe1 b\xe1n phải lớn hơn 0"):(console.log("data.endDate",e.endDate),console.log("new Date()",new Date),new Date(e.endDate)<new Date)?A.default.error("Thời gian kết th\xfac phải lớn hơn thời gian hiện tại"):await j({assetContractAddress:e.nftContractAddress,tokenId:e.tokenId,currencyContractAddress:f.Tv,buyoutBidAmount:e.buyoutPrice,minimumBidAmount:e.floorPrice,startTimestamp:new Date(e.startDate),endTimestamp:new Date(e.endDate)}):A.default.error("Vui l\xf2ng nhập thời gian kết th\xfac"):A.default.error("Vui l\xf2ng nhập thời gian bắt đầu"):A.default.error("Vui l\xf2ng nhập gi\xe1 b\xe1n")}return(0,i.jsxs)(w.n,{"aria-label":"Options",children:[(0,i.jsx)(k.r,{title:"B\xe1n trực tiếp",children:(0,i.jsxs)(a.K,{spacing:8,children:[(0,i.jsxs)(s.xu,{children:[(0,i.jsx)(d.x,{className:"text-black",children:"Thời gian mở b\xe1n:"}),(0,i.jsx)(N.Y,{placeholder:"Select Date and Time",size:"md",type:"datetime-local",...g("startDate")}),(0,i.jsx)(d.x,{className:"text-black",mt:2,children:"Thời gian đ\xf3ng b\xe1n:"}),(0,i.jsx)(N.Y,{placeholder:"Select Date and Time",size:"md",type:"datetime-local",...g("endDate")})]}),(0,i.jsxs)(s.xu,{children:[(0,i.jsx)(d.x,{className:"text-black",fontWeight:"bold",children:"Gi\xe1:"}),(0,i.jsx)(N.Y,{placeholder:"0",size:"md",type:"number",...g("price")})]}),(0,i.jsxs)(x.tnh,{className:"text-black",theme:"light",contractAddress:f.YJ,action:async()=>{await p(b)()},onSuccess:e=>{n.push("/collection/".concat(t.metadata.id))},children:["Mở b\xe1n"," "]})]})},"DirectListing"),(0,i.jsx)(k.r,{title:"Đấu gi\xe1",children:(0,i.jsxs)(a.K,{spacing:8,children:[(0,i.jsxs)(s.xu,{children:[(0,i.jsx)(d.x,{className:"text-black",children:"Thời gian mở đấu gi\xe1: "}),(0,i.jsx)(N.Y,{placeholder:"Select Date and Time",size:"md",type:"datetime-local",...v("startDate")}),(0,i.jsxs)(d.x,{className:"text-black",mt:2,children:["Thời gian đ\xf3ng đấu gi\xe1:"," "]}),(0,i.jsx)(N.Y,{placeholder:"Select Date and Time",size:"md",type:"datetime-local",...v("endDate")})]}),(0,i.jsxs)(s.xu,{children:[(0,i.jsxs)(d.x,{className:"text-black",fontWeight:"bold",children:["Gi\xe1 khởi điểm:"," "]}),(0,i.jsx)(N.Y,{placeholder:"0",size:"md",type:"number",...v("floorPrice")})]}),(0,i.jsxs)(s.xu,{children:[(0,i.jsx)(d.x,{className:"text-black",fontWeight:"bold",children:"Gi\xe1 mua thẳng:"}),(0,i.jsx)(N.Y,{placeholder:"0",size:"md",type:"number",...v("buyoutPrice")})]}),(0,i.jsxs)(x.tnh,{className:"text-light",theme:"light",contractAddress:f.YJ,action:async()=>await T(C)(),onSuccess:e=>{n.push("/collection/".concat(t.metadata.id))},children:["Mở b\xe1n đấu gi\xe1"," "]})]})},"Auction")]})}function C(e){var t,n,b,D,y,w,k,N,C,V,S,z;let{nft:P}=e,I=(0,x.SFn)(),W=(0,x.xxU)(),{contract:Y,isLoading:B}=(0,x.cqn)(f.YJ,"marketplace-v3"),{mutateAsync:E,isLoading:L}=(0,x.GGd)(Y,"cancelListing"),{data:_,isLoading:G}=(0,x.aBe)(Y,{tokenContract:f.f2,tokenId:P.metadata.id});console.log("\uD83D\uDE80 ~ file: NftDetail.tsx:55 ~ TokenPage ~ directListing:",_);
1let[J,M]=(0,m.useState)(),{data:K,isLoading:O}=(0,x.QQ5)(Y,{tokenContract:f.f2,tokenId:P.metadata.id});console.log("\uD83D\uDE80 ~ file: NftDetail.tsx:68 ~ TokenPage ~ auctionListing:",K);let{data:q}=(0,x.doQ)(Y,"getWinningBid",[null==K?void 0:null===(t=K[0])||void 0===t?void 0:t.id]);async function F(){let e;if(null==K?void 0:K[0])e=await (null==Y?void 0:Y.englishAuctions.buyoutAuction(K[0].id));else if(null==_?void 0:_[0])e=await (null==Y?void 0:Y.directListings.buyFromListing(_[0].id,1));else throw Error("No listing found");return e}async function R(){let e;if(J){if(null==K?void 0:K[0])e=await (null==Y?void 0:Y.englishAuctions.makeBid(K[0].id,J));else if(null==_?void 0:_[0])e=await (null==Y?void 0:Y.offers.makeOffer({assetContractAddress:f.f2,tokenId:P.metadata.id,totalPrice:J}));else throw Error("No listing found");return e}}return console.log("\uD83D\uDE80 ~ file: NftDetail.tsx:77 ~ TokenPage ~ winningBid:",(null==q?void 0:null===(n=q._bidAmount)||void 0===n?void 0:n._hex)?Number(null==q?void 0:null===(b=q._bidAmount)||void 0===b?void 0:b._hex)/Number(10)**Number(20):null),(0,i.jsx)(l.W,{maxW:"1200px",p:5,my:5,children:(0,i.jsxs)("div",{className:"flex flex-col lg:flex-row w-full gap-10 ",children:[(0,i.jsxs)(a.K,{className:"w-full lg:w-[60%]",spacing:"20px",children:[(0,i.jsx)(s.xu,{borderRadius:"6px",overflow:"hidden",children:(0,i.jsx)(r.O,{isLoaded:!B&&!G,children:(0,i.jsx)(j,{children:(0,i.jsx)(x.CHu,{metadata:P.metadata,width:"100%",height:"100%"})})})}),(0,i.jsxs)(s.xu,{children:[(0,i.jsxs)(d.x,{className:"text-light",fontWeight:"bold",children:["M\xf4 tả:"," "]}),(0,i.jsx)(d.x,{className:"text-light",children:P.metadata.description})]}),(0,i.jsxs)(s.xu,{children:[(0,i.jsx)(d.x,{className:"text-light",fontWeight:"bold",children:"Thuộc t\xednh:"}),(0,i.jsx)(o.M,{columns:2,spacing:4,children:Object.entries((null==P?void 0:null===(D=P.metadata)||void 0===D?void 0:D.attributes)||{}).map(e=>{let[t,n]=e;return(0,i.jsxs)(c.k,{direction:"column",alignItems:"center",justifyContent:"center",borderWidth:1,p:"8px",borderRadius:"4px",children:[(0,i.jsx)(d.x,{className:"text-light",fontSize:"small",children:n.trait_type}),(0,i.jsx)(d.x,{className:"text-light",fontSize:"small",fontWeight:"bold",children:n.value})]},t)})})]})]}),(0,i.jsxs)(a.K,{className:"w-full lg:w-[40%]",spacing:"20px",children:[P.metadata&&(0,i.jsxs)(c.k,{alignItems:"center",children:[(0,i.jsx)(s.xu,{borderRadius:"4px",overflow:"hidden",mr:"10px",children:(0,i.jsx)(x.W85,{src:"/token.png",height:"32px",width:"32px"})}),(0,i.jsx)(d.x,{className:"text-light",fontWeight:"bold",children:"MinhThuong Collection"})]}),(0,i.jsxs)(s.xu,{mx:2.5,children:[(0,i.jsx)(d.x,{className:"text-light",fontSize:"4xl",fontWeight:"bold",children:P.metadata.name}),(0,i.jsx)(g.default,{href:"/profile/".concat(P.owner),children:(0,i.jsxs)(c.k,{direction:"row",alignItems:"center",children:[(0,i.jsx)(u.q,{src:"https://bit.ly/broken-link",h:"24px",w:"24px",mr:"10px"}),(0,i.jsxs)(d.x,{className:"text-light",fontSize:"small",children:[P.owner.slice(0,6),"...",P.owner.slice(-4),"".concat(P.owner===I?" (Bạn)":"")]})]})})]}),(0,i.jsxs)(a.K,{backgroundColor:"#EEE",p:2.5,borderRadius:"6px",children:[(0,i.jsx)(d.x,{color:"darkgray",children:"Gi\xe1 mua thẳng:"}),(0,i.jsx)(r.O,{isLoaded:!B&&!G,children:_&&_[0]?(0,i.jsx)("div",{children:(0,i.jsxs)(d.x,{fontSize:"3xl",fontWeight:"bold",children:[null===(y=_[0])||void 0===y?void 0:y.currencyValuePerToken.displayValue," "+(null===(w=_[0])||void 0===w?void 0:w.currencyValuePerToken.symbol)]})}):K&&K[0]?(0,i.jsxs)(d.x,{className:"text-black",fontSize:"3xl",fontWeight:"bold",children:[null===(k=K[0])||void 0===k?void 0:k.buyoutCurrencyValue.displayValue," "+(null===(N=K[0])||void 0===N?void 0:N.buyoutCurrencyValue.symbol)]}):(0,i.jsxs)(d.x,{className:"text-black",fontSize:"3xl",fontWeight:"bold",children:["Kh\xf4ng b\xe1n"," "]})}),!I||P.owner!==I||(null==_?void 0:_[0])||(null==K?void 0:K[0])?null:(0,i.jsx)(T,{nft:P}),(0,i.jsx)(r.O,{isLoaded:!O,children:K&&K[0]&&(0,i.jsxs)(c.k,{direction:"column",children:[(0,i.jsxs)(d.x,{className:"text-light",color:"darkgray",children:["Gi\xe1 khởi điểm"," "]}),(0,i.jsxs)(d.x,{className:"text-black",fontSize:"3xl",fontWeight:"bold",children:[null===(C=K[0])||void 0===C?void 0:C.minimumBidCurrencyValue.displayValue," "+(null===(V=K[0])||void 0===V?void 0:V.minimumBidCurrencyValue.symbol)]}),(0,i.jsx)(d.x,{className:"text-light"})]})})]}),(0,i.jsxs)(r.O,{isLoaded:!B||!G||!O,children:[(0,i.jsxs)("div",{className:"flex w-full max-h-15 justify-center gap-4 mb-8",children:[(0,i.jsx)(f.ZP,{}),(0,i.jsx)(p.f,{className:"h-15",variant:"outline"})]}),_&&_[0]&&P.owner===I?(0,i.jsxs)(x.tnh,{theme:(0,x.$_G)({}),className:"text-light bg-white ",contractAddress:f.YJ,action:async()=>{try{var e;let t=await E({args:[null===(e=_[0])||void 0===e?void 0:e.id]});console.info("contract call successs",t)}catch(e){console.error("contract call failure",e)}},isDisabled:(!K||!K[0])&&(!_||!_[0]),children:["Hủy b\xe1n"," "]}):null,I&&W===v.f86.chainId&&I!==P.owner?(0,i.jsxs)(a.K,{spacing:5,children:[(_||(null==_?void 0:_[0]))&&(K||(null==K?void 0:K[0]))?(0,i.jsx)(x.tnh,{theme:(0,x.$_G)({}),className:"text-light bg-white ",contractAddress:f.YJ,action:async()=>F(),isDisabled:(!K||!K[0])&&(!_||!_[0]),children:"Mua ngay"}):null,K&&K[0]?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(d.x,{className:"text-light",textAlign:"center",children:"Hoặc"}),(0,i.jsxs)(c.k,{direction:"column",children:[(0,i.jsx)(h.I,{className:"text-light",mb:5,defaultValue:(null==K?void 0:null===(z=K[0])||void 0===z?void 0:null===(S=z.minimumBidCurrencyValue)||void 0===S?void 0:S.displayValue)||0,type:"number",onChange:e=>M(e.target.value)}),(0,i.jsx)(x.tnh,{theme:(0,x.$_G)({}),contractAddress:f.YJ,action:async()=>{var e,t;if(J&&Number(J)<Number(null==K?void 0:null===(t=K[0])||void 0===t?void 0:null===(e=t.minimumBidCurrencyValue)||void 0===e?void 0:e.displayValue)){A.default.error("Gi\xe1 đặt phải lớn hơn gi\xe1 khởi điểm");return}await R()},isDisabled:!K||!K[0],children:"Đấu gi\xe1"})]})]}):null]}):null]})]})]})})}},11409:function(e,t,n){n.d(t,{f:function(){return o}});var i=n(57437);n(2265);var l=n(89733),a=n(1990),s=n(27079),r=n(20552),d=n(42321);let o=e=>{let{className:t,variant:n}=e,o=(0,r.SFn)(),c=(0,r.xxU)(),u=(0,s.NL)();return o&&c===d.f86.chainId?(0,i.jsx)(l.z,{variant:n||"outline",onClick:()=>{var e;null===(e=window.ethereum)||void 0===e||e.request({method:"wallet_watchAsset",params:{type:"ERC20",options:{address:a.Tv,symbol:"MTH",decimals:18,image:"https://res.cloudinary.com/dci8dhaps/image/upload/v1700155030/logo123_rxylro.png"}}}),u.refetchQueries()},className:t,children:"Th\xeam Token MTH"}):null}}}]);

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.