1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[68],{4639:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(7294);let useInterval=param=>{let{onUpdate,time=1e3}=param,onUpdateRef=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(onUpdate);(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(()=>{let timerId=setInterval(()=>onUpdateRef.current(),time);return()=>clearInterval(timerId)},[])};__webpack_exports__.Z=useInterval},7042:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{Z:function(){return usePurchaseDlg}});var jsx_runtime=__webpack_require__(5893),useRedux=__webpack_require__(8453),lodash=__webpack_require__(6486),loglevel=__webpack_require__(2043),loglevel_default=__webpack_require__.n(loglevel),model=__webpack_require__(6870),CommonDlg=__webpack_require__(3786),react=__webpack_require__(7294),useLocalSettings=__webpack_require__(243),useNav=__webpack_require__(7032),useNavSFLife=__webpack_require__(6480),TextBtn=__webpack_require__(4403),dlgModule=__webpack_require__(5547),R=__webpack_require__(7994),CmnDiv=__webpack_require__(8868),CmnTxt=__webpack_require__(7176),CommonNftInfo=__webpack_require__(7899),tw_merge=__webpack_require__(6180),dist=__webpack_require__(8100);let CompleteDlg=param=>{let{nftDetail,isLuckyBag,luckyBagInfo,showError,onBuyAgain}=param,hRedux=(0,useRedux.S)(),hR=(0,useLocalSettings.$v)(),{rdxDialogAction,rdxDispatch}=hRedux,{goToLincoDetails}=(0,useNav.ZP)(),{isP1Life,isSFLife}=(0,useNavSFLife.Z)(),goToNFTDetail=()=>{hRedux.rdxDispatch(rdxDialogAction.hideDlg({key:dlgModule.Lw.PurchaseCompleteDlg})),nftDetail&&goToLincoDetails({mint_id:nftDetail.mint_id,nft_token_id:nftDetail.nft_token_id,nft_contract_addr:nftDetail.nft_contract_addr}),luckyBagInfo&&goToLincoDetails({mint_id:luckyBagInfo.mtid,nft_token_id:luckyBagInfo.nftTokenId,nft_contract_addr:luckyBagInfo.nftContAddr})},onClickBuyAgain=()=>{if(luckyBagInfo){if((0,dist.JG)([luckyBagInfo.mtid,hR.locale]),!luckyBagInfo.buyAgain)return(0,CommonDlg.Z)({rdxDialogAction,rdxDispatch}).showErrorDlg({emsg:hR.strings.LUCKY_BAG_DETAILS_BUY_NFT_FAIL_ERROR});onBuyAgain&&onBuyAgain(!0)}},CompleteDescForSFLife=(0,react.useMemo)(()=>isSFLife?(0,jsx_runtime.jsx)(CmnDiv.Z,{styleNormal:{display:"block",marginTop:"2rem",textAlign:"center"},stylePc:{display:"none"},children:(0,jsx_runtime.jsx)(CmnTxt.Z,{style:{color:R.Z.colors.purpleNormal},styleMobile:{fontSize:12},children:isP1Life?hR.strings.DLG_P1LIFE_PURCHASE_COMPLETE_DESC:hR.strings.DLG_P2LIFE_PURCHASE_COMPLETE_DESC})}):(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{}),[]);return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(CommonNftInfo.Z,{detailInfoRes:nftDetail,title:isLuckyBag?hR.strings.LUCKY_BAG_DETAILS_OBTAINED_DLG_TITLE:hR.str
1ings.DLG_PURCHASE_COMPLETE_TITLE,luckyBagInfo:luckyBagInfo}),(0,jsx_runtime.jsx)(CmnDiv.Z,{styleNormal:{height:"2rem"},stylePc:{height:"3rem"}}),(0,jsx_runtime.jsxs)("div",{className:isLuckyBag?(0,tw_merge.m)("flex w-full gap-[1.1rem] px-0","lg:gap-[1.4rem] lg:px-[2.1rem]"):(0,tw_merge.m)("flex w-full justify-center"),children:[(0,jsx_runtime.jsx)(TextBtn.Z,{label:isLuckyBag?hR.strings.COMMON_VIEW_DETAIL:hR.strings.DLG_VIEW_YOUT_NFT_BTN,fontSize:[18,18,16],btnHeight:[50,50,44],padding:[[41,41],[41,41],[0,0]],enable:!0,normalColor:isLuckyBag?R.Z.colors.purpleNormal:R.Z.colors.white,normalFillColor:isLuckyBag?R.Z.colors.white:R.Z.colors.purpleNormal,disableFillColor:R.Z.colors.purpleDisabled,btnWidth:["fit-content","fit-content","calc(100% - 36px)"],style:{border:isLuckyBag?"1px solid ".concat(R.Z.colors.purpleNormal):"none",flex:isLuckyBag?"1":"none"},click:goToNFTDetail}),isLuckyBag&&(0,jsx_runtime.jsx)(TextBtn.Z,{label:hR.strings.LUCKY_BAG_DETAILS_OBTAINED_DLG_BUY_AGAIN,fontSize:[18,18,16],btnHeight:[50,50,44],padding:[[41,41],[41,41],[0,0]],enable:!0,normalColor:R.Z.colors.white,normalFillColor:R.Z.colors.purpleNormal,disableFillColor:R.Z.colors.purpleDisabled,btnWidth:["fit-content","fit-content","calc(100% - 36px)"],style:{border:"none",flex:isLuckyBag?"1":"none"},click:onClickBuyAgain})]}),CompleteDescForSFLife]})};var useSaleInfo=__webpack_require__(6102),usePointByPayPal=__webpack_require__(1654),firebase=__webpack_require__(6639),MooiIcon=__webpack_require__(6417),icons_JellyIcon=function(props){return(0,jsx_runtime.jsxs)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...props,children:[(0,jsx_runtime.jsxs)("defs",{children:[(0,jsx_runtime.jsx)("path",{id:"1i8goaz9sa",d:"M0 0h24v24H0z"}),(0,jsx_runtime.jsx)("path",{id:"c3dvbyuvbc",d:"M0 0h13v20H0z"})]}),(0,jsx_runtime.jsx)("g",{fill:"none",fillRule:"evenodd",children:(0,jsx_runtime.jsx)("g",{mask:"url(#sjm1o06fqb)",children:(0,jsx_runtime.jsx)("g",{transform:"translate(5 2)",children:(0,jsx_runtime.jsx)("path",{d:"M7.108 13.993c-.005.028-.01.059-.017.09-.187 1.056-.51 1.941-1.046 2.493-.124.128-.29.273-.528.396a1.913 1.913 0 0 1-.757.274c-1.42.193-1.813-.564-1.92-1.055v-.01a2.032 2.032 0 0 1-.033-.22 1.377 1.377 0 0 1-.004-.056v-.026c-.002-.05 0-.079 0-.079.002-.068.009-.137.02-.206.268-1.84 2.981-1.98 3.975-1.969a.314.314 0 0 1 .31.368m5.742-10.98c.324-.903.114-1.833-.55-2.425-.727-.65-1.85-.772-2.862-.31-1.023.469-1.608 1.309-1.942 2.18-.021.056.029.114.09.104 1.137-.192 2.12-.483 2.7-.92.143-.107.348-.106.473.022a.336.336 0 0 1-.036.504c-1.186.906-3.753 1.253-6.113 1.37a1.383 1.383 0 0 0-1.25 1.496 1.393 1.393 0 0 0 1.522 1.244c.05-.004.92-.085 2.05-.279a.159.159 0 0 1 .187.146c.017.332.037.672.057 1.022.063 1.101.133 2.339.14 3.559a.16.16 0 0 1-.166.158c-3.826-.111-5.568 1.396-6.3 2.397-.976 1.336-1.123 3.06-.383 4.498.708 1.375 2.277 2.204 3.86 2.22.068.001-.063-.001 0 0 1.53.026 2.788-.537 3.742-1.52 1.101-1.135 1.644-2.744 1.885-4.558a.159.159 0 0 1 .156-.137l.79-.007h.021a1.388 1.388 0 0 0 1.375-1.38 1.389 1.389 0 0 0-1.403-1.375l-.61.007a.158.158 0 0 1-.16-.156c-.005-1.286-.08-2.599-.152-3.86-.032-.565-.063-1.103-.086-1.613a.156.156 0 0 1 .107-.153c1.597-.563 2.519-1.29 2.858-2.235",fill:"currentColor",mask:"url(#taj3p3og5d)"})})})})]})};let NotEnoughBalanceDlg=param=>{let{detailInfoRes,selectedCurrency}=param,[sSaleInfo,setSaleInfo]=(0,react.useState)(),hR=(0,useLocalSettings.$v)(),hSaleInfo=(0,useSaleInfo.Z)(hR.locale),{openUrl}=(0,useNav.ZP)(),hPointByPayPal=(0,usePointByPayPal.Z)(),{isSFLife}=(0,useNavSFLife.Z)();(0,react.useEffect)(()=>{let init=async()=>{let saleInfo=await hSaleInfo.getSaleInfo(detailInfoRes);setSaleInfo(saleInfo)};init()},[hR.locale,detailInfoRes,hSaleInfo.sIsReady]),(0,react.useCallback)(()=>{(0,firebase.oj)("".concat(LogEventName,"_").concat(firebase.aP.NFT,"_").concat(firebase.aP.GET_MOOI)),openUrl(R.Z.strings.LINK_MOOI_SWAP_XRP_BRIDGE)},[]),(0,react.useCallback)(()=>{(0,firebase.oj)("".concat(LogEventName,"_").concat(firebase.aP.NFT,"_").concat(firebase.aP.CHARGE_JELLY)),hPointByPayPal.openPointChargeListDlg()},[]);let isMooi=selectedCurrency===model.A.Currency_e.MOOI,LogEventName="".concat(useNav.CW[detailInfoRes.svc.svc_id][model.A.Language_e.EN],"_").concat(isSFLife?firebase.nb.LINCO:firebase.nb.JELLYME);return(0,jsx_runtime.jsxs)("div",{className:"flex w-full flex-col items-center overflow-y-auto",children:[(0,jsx_runtime.jsx)(CommonNftInfo.Z,{detailInfoRes:detailInfoRes,title:hR.strings.DLG_CHECKOUT_TITLE,selectedCurrency:selectedCurrency,showPrice:!0}),(0,jsx_runtime.jsx)("div",{className:"mt-[1.2rem] flex items-center",children:isMooi?(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(MooiIcon.Z,{className:(0,tw_merge.m)("h-[2.2rem] w-[2.2rem] text-purple-100","lg:h-[2.6rem] lg:w-[2.6rem]")}),(0,jsx_runtime.jsx)("p",{className:(0,tw_merge.m)("ml-[0.4rem] text-[1.6rem] font-semibold","lg:text-[2rem]"),children:sSaleInfo&&sSaleInfo.mooiPriceTxt})]}):(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(icons_JellyIcon,{className:(0,tw_merge.m)("h-[2.2rem] w-[2.2rem] text-purple-100","lg:h-[2.6rem] lg:w-[2.6rem]")}),(0,jsx_runtime.jsx)("p",{className:(0,tw_merge.m)("ml-[0.4rem] text-[1.6rem] font-semibold","lg:text-[2rem]"),children:sSaleInfo&&sSaleInfo.jellyPr
1iceTxt})]})}),(0,jsx_runtime.jsx)("div",{className:"my-[2rem] w-full border-t-[0.1rem] border-grey-20"}),(0,jsx_runtime.jsx)("div",{className:(0,tw_merge.m)(),children:(0,jsx_runtime.jsx)("p",{className:(0,tw_merge.m)("text-[1.4rem] text-red","lg:text-[1.8rem]"),children:hR.strings.DLG_CHECKOUT_DESC})})]})};var purchase_NotEnoughBalanceDlg=(0,react.memo)(NotEnoughBalanceDlg),useUserBalance=__webpack_require__(7282),CmnImg=__webpack_require__(1650),CommonButton=__webpack_require__(4974),utils=__webpack_require__(805);let ConfirmPurchaseDlg=param=>{let{detailInfoRes,onClickBuyBtnWithCurrency}=param,[sIsAgreeAll,setIsAgreeAll]=(0,react.useState)(!1),[sIsAgreeTermsOfUse,setIsAgreeTermsOfUse]=(0,react.useState)(!1),[sIsAgreePrivacyPolicy,setIsAgreePrivacyPolicy]=(0,react.useState)(!1),[sSaleInfo,setSaleInfo]=(0,react.useState)(),hR=(0,useLocalSettings.$v)(),hSaleInfo=(0,useSaleInfo.Z)(hR.locale),{goToPrivacyPolicy,goToTermsAndConditions,openUrl}=(0,useNav.ZP)(),{isSFLife}=(0,useNavSFLife.Z)(),{mooiBalance,jellyBalance}=(0,useUserBalance.Z)();(0,react.useEffect)(()=>{sIsAgreeTermsOfUse&&sIsAgreePrivacyPolicy?setIsAgreeAll(!0):sIsAgreeAll&&setIsAgreeAll(!1)},[sIsAgreeTermsOfUse,sIsAgreePrivacyPolicy]),(0,react.useEffect)(()=>{let init=async()=>{let saleInfo=await hSaleInfo.getSaleInfo(detailInfoRes);setSaleInfo(saleInfo)};init()},[hR.locale,detailInfoRes,hSaleInfo.sIsReady]);let onClickAgreeAll=(0,react.useCallback)(()=>{sIsAgreeAll?(setIsAgreeTermsOfUse(!1),setIsAgreePrivacyPolicy(!1)):(setIsAgreeTermsOfUse(!0),setIsAgreePrivacyPolicy(!0))},[sIsAgreeAll]),onClickBuyMooi=(0,react.useCallback)(()=>{(0,firebase.oj)("".concat(LogEventName,"_").concat(firebase.SG.NFT,"_").concat(firebase.aP.BUY_MOOI)),onClickBuyBtnWithCurrency(model.A.Currency_e.MOOI)},[]);(0,react.useCallback)(()=>{(0,firebase.oj)("".concat(LogEventName,"_").concat(firebase.SG.NFT,"_").concat(firebase.aP.BUY_JELLY)),onClickBuyBtnWithCurrency(model.A.Currency_e.JELLY)},[]);let renderAgreeItem=param=>{let{isChecked,text,onClick,onCheck}=param;return(0,jsx_runtime.jsxs)("div",{className:(0,tw_merge.m)("grid grid-cols-[2.6rem_1fr] items-center gap-[0.8rem]","lg:grid-cols-[2.4rem_1fr]"),onClick:onCheck,children:[(0,jsx_runtime.jsx)("div",{className:"cursor-pointer rounded-full border-[0.1rem] border-grey-20",children:(0,jsx_runtime.jsx)(CmnImg.Z,{styleNormal:{width:"100%",height:"100%",transition:"opacity 0.4s",opacity:isChecked?1:0,paddingTop:"100%"},src:R.Z.images.buttons_buy_ic_check_abled3x,alt:"check"})}),onClick?(0,jsx_runtime.jsxs)("div",{className:(0,tw_merge.m)("mt-[0.4rem] flex flex-wrap justify-start"),children:[(0,jsx_runtime.jsx)(CmnTxt.Z,{style:{color:R.Z.colors.brownishGrey,fontWeight:R.Z.fonts.weight.regular,fontSize:"1.2rem"},stylePc:{fontSize:"1.3rem"},children:text[0]+" "}),(0,jsx_runtime.jsx)(CmnTxt.Z,{style:{color:R.Z.colors.purpleNormal,fontWeight:R.Z.fonts.weight.regular,fontSize:"1.2rem",textDecoration:"underline",whiteSpace:"nowrap",cursor:"pointer",lineHeight:1.3},stylePc:{fontSize:"1.3rem"},onClick:onClick,children:text[1]})]}):(0,jsx_runtime.jsx)(CmnTxt.Z,{style:{color:R.Z.colors.blackTxt,fontWeight:R.Z.fonts.weight.medium,fontSize:"1.4rem"},stylePc:{fontSize:"1.6rem"},children:text})]})},LogEventName="".concat(useNav.CW[detailInfoRes.svc.svc_id][model.A.Language_e.EN],"_").concat(isSFLife?firebase.nb.LINCO:firebase.nb.JELLYME),mooiAmount=mooiBalance&&utils.cQ.currency.getPriceForDPEllipsis({price:mooiBalance.balance,decimal:mooiBalance.decimal,count:3}),jellyAmount=jellyBalance&&utils.cQ.currency.getPriceForDPEllipsis({price:jellyBalance.balance,decimal:jellyBalance.decimal,count:3}),isJellyPayable=detailInfoRes.support_jelly||(null==sSaleInfo?void 0:sSaleInfo.jellyPayable);return(0,jsx_runtime.jsxs)("div",{className:(0,tw_merge.m)("relative w-full overflow-hidden pt-[2rem]"),children:[(0,jsx_runtime.jsxs)("div",{className:(0,tw_merge.m)("flex h-full w-full flex-col items-center overflow-scroll px-[2rem] pb-[7rem]","lg:py-[4rem]"),children:[(0,jsx_runtime.jsx)(CommonNftInfo.Z,{detailInfoRes:detailInfoRes,title:hR.strings.DLG_CONFIRM_PURCHASE_TITLE,showPrice:!0}),(0,jsx_runtime.jsxs)("div",{className:(0,tw_merge.m)("mb-[3rem] mt-[3.2rem] flex w-full flex-col gap-[1.6rem]","lg:mb-[4rem] lg:gap-[1.8rem]"),children:[renderAgreeItem({isChecked:sIsAgreeAll,text:[hR.strings.DLG_AGREE_TO_ALL],onCheck:onClickAgreeAll}),(0,jsx_runtime.jsx)("div",{className:"w-full border-t-[0.1rem] border-grey-20"}),(0,jsx_runtime.jsxs)("div",{className:(0,tw_merge.m)("flex flex-col gap-[1.4rem]","lg:gap-[0.8rem]"),children:[renderAgreeItem({isChecked:sIsAgreeTermsOfUse,text:[hR.strings.DLG_AGREE_TERMS_AND_CON
1DITIONS,hR.strings.DLG_VIEW_TERMS_AND_CONDITIONS],onClick:goToTermsAndConditions,onCheck:()=>setIsAgreeTermsOfUse(!sIsAgreeTermsOfUse)}),renderAgreeItem({isChecked:sIsAgreePrivacyPolicy,text:[hR.strings.DLG_AGREE_PRIVACY_POLICY,hR.strings.DLG_VIEW_PRIVACY_POLICY],onClick:goToPrivacyPolicy,onCheck:()=>setIsAgreePrivacyPolicy(!sIsAgreePrivacyPolicy)})]})]}),(0,jsx_runtime.jsx)("div",{className:(0,tw_merge.m)("flex w-full lg:px-[3rem]",isJellyPayable?"justify-between":"justify-center"),children:(0,jsx_runtime.jsx)(CommonButton.Z,{onClick:onClickBuyMooi,className:(0,tw_merge.m)("mr-[1.1rem] w-full","lg:mr-[1.4rem]"),label:null==sSaleInfo?void 0:sSaleInfo.mooiPriceTxt,loading:!Boolean(null==sSaleInfo?void 0:sSaleInfo.mooiPriceTxt),Icon:MooiIcon.Z,disabled:!sIsAgreeAll,disabledClassName:(0,tw_merge.m)("bg-purple-20/50")})})]}),(0,jsx_runtime.jsxs)("div",{className:(0,tw_merge.m)("sticky bottom-0 flex h-[5.6rem] w-full items-center justify-between bg-grey-5 px-[2rem] lg:h-[6rem]"),children:[(0,jsx_runtime.jsx)("p",{className:(0,tw_merge.m)("text-[1.2rem] text-grey-50","lg:text-[1.4rem]"),children:hR.strings.DLG_AVAILABLE_BALANCE}),(0,jsx_runtime.jsxs)("div",{className:"flex h-full items-center",children:[mooiAmount&&(0,jsx_runtime.jsxs)("div",{className:"flex h-full items-center",children:[(0,jsx_runtime.jsx)(MooiIcon.Z,{className:(0,tw_merge.m)("h-[1.6rem] w-[1.6rem] text-purple-100","lg:h-[2rem] lg:w-[2rem]")}),(0,jsx_runtime.jsx)("p",{className:"ml-[0.2rem] text-[1.2rem] font-medium leading-[1.6rem] lg:text-[1.6rem] lg:leading-[2rem]",children:mooiAmount})]}),jellyAmount&&isJellyPayable&&(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{})]})]})]})};var purchase_ConfirmPurchaseDlg=(0,react.memo)(ConfirmPurchaseDlg),useAuth=__webpack_require__(956),useWindowFocus=__webpack_require__(2011),CommonLoading=__webpack_require__(704),RxGlobalBeSubjects=__webpack_require__(5334),timer=__webpack_require__(4235),deeplinkService=__webpack_require__(677),inAppService=__webpack_require__(4261),mooiLibService=__webpack_require__(1424),rpcService=__webpack_require__(3176),stompjsService=__webpack_require__(147),CommonConnectWalletDlg=__webpack_require__(1870),ConnectingDlg=__webpack_require__(3414),ConnectWalletDlg=__webpack_require__(595);let PurchaseConnectWalletDlg=param=>{let{detailInfoRes,selectedCurrency,onClickBack,onComplete,showNotEnough,showError,onPurchaseAnimation,onApprove}=param,isLuckyBag="bag_id"in detailInfoRes,qrAuthTypeList=isLuckyBag?["".concat(model.A.LuckyBagQrAuthType_e.LUCKY_BAG_PURCHASE),"".concat(model.A.LuckyBagQrAuthType_e.LUCKY_BAG_PURCHASE_J)]:["".concat(model.A.NFTQrAuthType_e.NFT_PURCHASE),"".concat(model.A.NFTQrAuthType_e.NFT_PURCHASE_J)],[sWalletLink,setWalletLink]=(0,react.useState)(),subscriptionRef=(0,react.useRef)(null),mooiWalletLinkRef=(0,react.useRef)(),qrAuthIdRef=(0,react.useRef)(),preventDoubleExecutionRef=(0,react.useRef)(!1),hAuth=(0,useAuth.a)(),hR=(0,useLocalSettings.$v)(),hRedux=(0,useRedux.S)(),{mutate}=(0,dist.kY)(),hSaleInfo=(0,useSaleInfo.Z)(),{isSFLife}=(0,useNavSFLife.Z)(),WalletName_e={[model.A.WalletType_e.MOOI_WALLET]:hR.strings.DLG_CONNECT_MOOI_WALLET,[model.A.WalletType_e.LINCO_WALLET]:hR.strings.DLG_CONNECT_LINCO_WALLET};(0,useWindowFocus.v)({async onWinFocus(){var ref;if(loglevel_default().debug("onWinFocus"),loglevel_default().debug("mooiWalletLinkRef.current:",mooiWalletLinkRef.current),loglevel_default().debug("qrAuthIdRef.current:",qrAuthIdRef.current),(0,utils.o8)(mooiWalletLinkRef.current)||(0,utils.o8)(qrAuthIdRef.current)){loglevel_default().warn("mooiWalletLinkRef or qrAuthIdRef is undefined");return}if((null===(ref=hAuth.sLocalAuthInfo_LinkType)||void 0===ref?void 0:ref.linkType)===ConnectWalletDlg.WJ.QR){loglevel_default().warn("is not mobile");return}if(preventDoubleExecutionRef.current){loglevel_default().warn("preventDoubleExecutionRef.current");return}preventDoubleExecutionRef.current=!0;try{let ret=await rpcService.Z.authQrStatus({qr_auth_id:qrAuthIdRef.current});if(!qrAuthTypeList.includes(ret.qr_auth_type))return;switch(showConnectingDlg(),ret.status){case"W":break;case"S":"bag_id"in ret&&ret.mtid?handleApproved({mtid:ret.mtid,nftTokenId:ret.nft_token_id,nftImage:ret.nft_image,nftName:ret.nft_name,nftContAddr:ret.nft_cont_addr,buyAgain:ret.buy_again}):handleApproved();break;case"F":ret.ecode===model.A.ErrorCode_e.NOT_ENOUGH_TOKEN?(hideConnectingDlg(),showNotEnough()):showError({ecode:ret.ecode,emsg:ret.emsg})}}catch(e){console.warn(e),showError({ecode:e.ecode,emsg:e.emsg})}finally{preventDoubleExecutionRef.current=!1}},onWinBlur(){loglevel_default().debug("onWinBlur"),loglevel_default().debug("mooiWalletLinkRef.current:",mooiWalletLinkRef.current),loglevel_default().debug("qrAuthIdRef.current:",qrAuthIdRef.current)}});let rdxDialogAction=hRedux.rdxDialogAction;(0,react.useEffect)(()=>
1{if(hSaleInfo.sIsReady)return initLink(),()=>{stompjsService.Z.disConnect(),subscriptionRef.current&&subscriptionRef.current.unsubscribe()}},[hSaleInfo.sIsReady]),(0,react.useEffect)(()=>{inAppService.Z.isReactNativeWebView()&&mooiWalletLinkRef.current&&!preventDoubleExecutionRef.current&&mooiWalletLinkRef.current&&utils.cQ.openDeeplink({url:mooiWalletLinkRef.current})},[mooiWalletLinkRef.current]);let initLink=async()=>{var ref,ref1;loglevel_default().debug("initLink selectedCurrency:",selectedCurrency);let saleInfo=await hSaleInfo.getSaleInfo(detailInfoRes);loglevel_default().debug("saleInfo",JSON.stringify(saleInfo,void 0,4));try{let priceInfo,isNeedApproveJelly;if(stompjsService.Z.isConnect()&&await stompjsService.Z.disConnect(),await stompjsService.Z.connect(),(0,utils.o8)(selectedCurrency))throw"selectedCurrency is undefined";if(selectedCurrency===model.A.Currency_e.JELLY){if((0,lodash.isNull)(saleInfo.jellyPriceInfo))throw loglevel_default().error("saleInfo.jellyPriceInfo is null"),"saleInfo.jellyPriceInfo is null";priceInfo=saleInfo.jellyPriceInfo}else{if((0,lodash.isNull)(saleInfo.mooiPriceInfo))throw loglevel_default().error("saleInfo.mooiPriceInfo
1is null"),"saleInfo.mooiPriceInfo is null";priceInfo=saleInfo.mooiPriceInfo}let purchaseArgs={currency:selectedCurrency,prc:priceInfo.price,pct10000:saleInfo.discountEventInfo.isDiscountEventPeriod?saleInfo.discountEventInfo.discountPct10000:void 0},qrAuthInfo=isLuckyBag?await stompjsService.Z.getLuckyBagQrPurchaseInfo({...purchaseArgs,bag_id:detailInfoRes.bag_id}):await stompjsService.Z.getQrPurchaseInfo({...purchaseArgs,mtid:detailInfoRes.mint_id});if(loglevel_default().debug("qrAuthInfo:",JSON.stringify(qrAuthInfo,void 0,4)),!qrAuthTypeList.includes(qrAuthInfo.qr_auth_type))throw loglevel_default().warn("res.qr_auth_type !== ".concat(qrAuthTypeList.toString())),"res.qr_auth_type !== ".concat(qrAuthTypeList.toString());if(selectedCurrency===model.A.Currency_e.JELLY){if((0,utils.o8)(detailInfoRes.escrow_contract_addr)||0===detailInfoRes.escrow_contract_addr.length)throw"nftDetail.escrow_contract_addr is undefined";await mooiLibService.O.instance.init({escrow_cont_addr:detailInfoRes.escrow_contract_addr}),loglevel_default().info("nftDetail.escrow_contract_addr:",detailInfoRes.escrow_contract_addr);let userProfile=RxGlobalBeSubjects.ZP.UserProfile.getValue();if(loglevel_default().debug("userAddr:",userProfile),(0,utils.o8)(userProfile))throw loglevel_default().warn("userProfile is undefined"),"userProfile is undefined";isNeedApproveJelly=await mooiLibService.O.instance.isNeedApproveJelly({amount:priceInfo.price,userAddr:userProfile.wallet_address}),loglevel_default().info("isNeedApproveJelly:",isNeedApproveJelly)}let localWalletInfo=RxGlobalBeSubjects.ZP.AuthInfo_WalletInfo.getValue();if(loglevel_default().debug("rx localWalletInfo:",localWalletInfo),(0,utils.o8)(localWalletInfo))throw loglevel_default().warn("localWalletInfo is undefined"),"localWalletInfo is undefined";let mooiWalletDeepLink=deeplinkService._.makeJellymeQrDeeplink({args:{id:qrAuthInfo.qr_auth_id,ty:qrAuthInfo.qr_auth_type,pc:priceInfo.price,approved:!isNeedApproveJelly,bag_id:isLuckyBag?detailInfoRes.bag_id:void 0},walletType:localWalletInfo.type});setWalletLink(mooiWalletDeepLink),mooiWalletLinkRef.current=mooiWalletDeepLink,qrAuthIdRef.current=qrAuthInfo.qr_auth_id,loglevel_default().info("mooiWalletLinkRef.current:",mooiWalletLinkRef.current),loglevel_default().info("qrAuthIdRef.current:",qrAuthIdRef.current),subscriptionRef.current=(0,timer.H)(qrAuthInfo.expire).subscribe(()=>{stompjsService.Z.disConnect(),hideConnectingDlg(),hideCurrentDlg()}),(null===(ref=hAuth.sLocalAuthInfo_LinkType)||void 0===ref?void 0:ref.linkType)!==ConnectWalletDlg.WJ.DEEP_LINK||inAppService.Z.isReactNativeWebView()?(stompjsService.Z.subscribeQrAuthComplete().then(res=>{loglevel_default().debug("SUCCESS",res),qrAuthTypeList.includes(res.qr_auth_type)&&(stompjsService.Z.allUnsubscribe(),"bag_id"in res?handleApproved({mtid:res.mtid,nftTokenId:res.nft_token_id,nftImage:res.nft_image,nftName:res.nft_name,nftContAddr:res.nft_cont_addr,buyAgain:res.buy_again}):handleApproved())}),stompjsService.Z.subscribeQrAuthErrors().then(res=>{loglevel_default().debug("FAILURE",res),stompjsService.Z.allUnsubscribe(),hideConnectingDlg(),showError({ecode:res.ecode,emsg:res.emsg})}),stompjsService.Z.subscribeQrAuthCancel().then(res=>{loglevel_default().debug("CANCEL",res),stompjsService.Z.allUnsubscribe(),hideConnectingDlg(),showError({emsg:hR.strings.DLG_CONFIRM_ERROR.replace(R.Z.strings.REPLACE_WALLET_NAME,WalletName_e[localWalletInfo.type])})}),stompjsService.Z.subscribeQrAuthPrepare().then(res=>{loglevel_default().debug("Prepare",res),showConnectingDlg()})):(stompjsService.Z.allUnsubscribe(),stompjsService.Z.disConnect())}catch(e){hideConnectingDlg(),(null===(ref1=hAuth.sLocalAuthInfo_LinkType)||void 0===ref1?void 0:ref1.linkType)!==ConnectWalletDlg.WJ.DEEP_LINK||inAppService.Z.isReactNativeWebView()||stompjsService.Z.allUnsubscribe(),stompjsService.Z.disConnect(),e.ecode===model.A.ErrorCode_e.NOT_ENOUGH_TOKEN?showNotEnough():showError({ecode:e.ecode,emsg:e.emsg})}},showConnectingDlg=()=>{hRedux.rdxDispatch(rdxDialogAction.showDlg({key:dlgModule.Lw.CommonConnectingDlg,showCloseBtn:!1,onBackdropClick(){},jsx:(0,jsx_runtime.jsx)(ConnectingDlg.Z,{})}))},hideConnectingDlg=()=>
1{hRedux.rdxDispatch(rdxDialogAction.hideDlg({key:dlgModule.Lw.CommonConnectingDlg}))},hideCurrentDlg=()=>{hRedux.rdxDispatch(rdxDialogAction.hideDlg({key:dlgModule.Lw.ConnectWalletDlg}))},fetchData=()=>{"mint_id"in detailInfoRes&&mutate([detailInfoRes.mint_id,hR.locale]),isLuckyBag&&onApprove&&onApprove()},handleApproved=async luckyBagInfo=>{hideConnectingDlg(),hideCurrentDlg(),fetchData(),isLuckyBag&&luckyBagInfo?onPurchaseAnimation({...luckyBagInfo,effectUrl:detailInfoRes.effect}):onComplete()},onOpenWalletHandler=()=>{sWalletLink&&utils.cQ.openDeeplink({url:sWalletLink})};return inAppService.Z.isReactNativeWebView()?(0,jsx_runtime.jsx)(CommonLoading.Z,{show:!0}):(0,jsx_runtime.jsx)(CommonConnectWalletDlg.Z,{onOpenWalletHandler:onOpenWalletHandler,mooiWalletLink:sWalletLink,dlgTitle:hR.strings.DLG_CONFIRM_PURCHASE_TITLE})};var UpdateWalletDlg=__webpack_require__(7351),next_image=__webpack_require__(5675),image_default=__webpack_require__.n(next_image);let PurchaseAnimation=param=>{let{onComplete,effectUrl}=param,[sStartAnimationFlag,setStartAnimationFlag]=(0,react.useState)();(0,react.useEffect)(()=>{if(!sStartAnimationFlag)return;let completeTimer=setTimeout(()=>{onComplete()},2200);return()=>clearTimeout(completeTimer)},[sStartAnimationFlag]);let onStartAnimation=()=>{setStartAnimationFlag(!0)};return(0,jsx_runtime.jsx)("div",{className:(0,tw_merge.m)("fixed top-0 left-0 h-full w-full"),children:(0,jsx_runtime.jsx)("div",{className:(0,tw_merge.m)("absolute left-1/2 top-1/2 h-full w-full -translate-y-1/2 -translate-x-1/2"),children:(0,jsx_runtime.jsx)(image_default(),{fill:!0,unoptimized:!0,onLoadingComplete:onStartAnimation,onClick:onComplete,src:effectUrl,alt:"lucky bag animation",style:{objectFit:"contain"}})})})};var luckyBag_PurchaseAnimation=(0,react.memo)(PurchaseAnimation);function usePurchaseDlg(param){let{detailInfoRes,onApprove}=param,isLuckyBag="bag_id"in detailInfoRes,{rdxDialogAction,rdxDispatch}=(0,useRedux.S)(),selectedCurrencyRef=(0,react.useRef)(),_checkWalletVersionShowDlg=selectedCurrency=>{let localWalletInfo=RxGlobalBeSubjects.ZP.AuthInfo_WalletInfo.getValue(),localLinkType=RxGlobalBeSubjects.ZP.AuthInfo_LinkType.getValue();if(!localLinkType||!localWalletInfo||!localWalletInfo.version)return loglevel_default().warn("localWalletInfo",localWalletInfo),loglevel_default().warn("localLinkType",localLinkType),loglevel_default().warn("localWalletInfo?.version",null==localWalletInfo?void 0:localWalletInfo.version),showPurchaseConnectWalletDlg(selectedCurrency);let typePurchase=isLuckyBag?["".concat(model.A.QrAuthType_e.LUCKY_BAG_PURCHASE),"".concat(model.A.QrAuthType_e.LUCKY_BAG_PURCHASE_J)]:["".concat(model.A.QrAuthType_e.NFT_PURCHASE),"".concat(model.A.QrAuthType_e.NFT_PURCHASE_J)],settings=RxGlobalBeSubjects.ZP.CommonSetting.getValue();if((0,lodash.isUndefined)(settings))return showPurchaseConnectWalletDlg(selectedCurrency);for(let i=0;i<settings.min_ver_list.length;i++){let minVerInfo=settings.min_ver_list[i];if(1===utils.cQ.compareAppVer(minVerInfo.min_ver,localWalletInfo.version)&&minVerInfo.wty===localWalletInfo.type&&typePurchase.includes(minVerInfo.func))return showUpdateWalletDlg({linkType:localLinkType.linkType,walletType:localWalletInfo.type,version:minVerInfo.min_ver||""});if(settings.min_ver_list.length===i+1)return showPurchaseConnectWalletDlg(selectedCurrency)}},showConfirmPurchaseDlg=isBuyAgain=>{isBuyAgain&&rdxDispatch(rdxDialogAction.hideDlg({key:dlgModule.Lw.PurchaseCompleteDlg})),rdxDispatch(rdxDialogAction.showDlg({key:dlgModule.Lw.PurchaseConfirmDlg,showCloseBtn:!0,onBackdropClick(){rdxDispatch(rdxDialogAction.hideDlg({key:dlgModule.Lw.PurchaseConfirmDlg}))},jsx:(0,jsx_runtime.jsx)(purchase_ConfirmPurchaseDlg,{detailInfoRes:detailInfoRes,onClickBuyBtnWithCurrency(selectedCurrency){loglevel_default().debug("onClinkBuyBtn - selectedCurrency : ".concat(selectedCurrency)),selectedCurrencyRef.current=selectedCurrency,_checkWalletVersionShowDlg(selectedCurrency)}}),dlgBoxStyle:{styleNormal:{padding:"0 !important",height:"58rem"},stylePc:{height:"auto"}}}))},showPurchaseConnectWalletDlg=selectedCurrency=>{if((0,lodash.isNull)(detailInfoRes.price_info)){loglevel_default().debug("nftDetail.price_info is null");return}
1rdxDispatch(rdxDialogAction.hideDlg({key:dlgModule.Lw.PurchaseConfirmDlg})),rdxDispatch(rdxDialogAction.showDlg({key:dlgModule.Lw.PurchaseQRDlg,showCloseBtn:!0,onBackdropClick(){rdxDispatch(rdxDialogAction.hideDlg({key:dlgModule.Lw.PurchaseQRDlg}))},jsx:(0,jsx_runtime.jsx)(PurchaseConnectWalletDlg,{detailInfoRes:detailInfoRes,selectedCurrency:selectedCurrency,onClickBack:showConfirmPurchaseDlg,onComplete:showCompleteDlg,showNotEnough:showNotEnoughDlg,onApprove:onApprove,onPurchaseAnimation:args=>showDirectionAnimation(args),showError:props=>showErrorDlg(props)})}))},showDirectionAnimation=luckyBagInfo=>{rdxDispatch(rdxDialogAction.hideDlg({key:dlgModule.Lw.PurchaseQRDlg}));let onComplete=()=>{rdxDispatch(rdxDialogAction.hideDlg({key:dlgModule.Lw.DirectionAnimation})),showCompleteDlg(luckyBagInfo)};rdxDispatch(rdxDialogAction.showDlg({key:dlgModule.Lw.DirectionAnimation,showCloseBtn:!1,onBackdropClick:onComplete,jsx:(0,jsx_runtime.jsx)(luckyBag_PurchaseAnimation,{onComplete:onComplete,effectUrl:luckyBagInfo.effectUrl}),dlgBoxStyle:{styleNormal:{background:R.Z.colors.transparent}}}))},showCompleteDlg=luckyBagInfo=>{rdxDispatch(rdxDialogAction.hideDlg({key:isLuckyBag?dlgModule.Lw.DirectionAnimation:dlgModule.Lw.PurchaseQRDlg})),rdxDispatch(rdxDialogAction.showDlg({key:dlgModule.Lw.PurchaseCompleteDlg,showCloseBtn:!0,onBackdropClick(){rdxDispatch(rdxDialogAction.hideDlg({key:dlgModule.Lw.PurchaseCompleteDlg}))},jsx:(0,jsx_runtime.jsx)(CompleteDlg,{nftDetail:"mint_id"in detailInfoRes?detailInfoRes:void 0,showError:props=>showErrorDlg(props),isLuckyBag:isLuckyBag,luckyBagInfo:luckyBagInfo,onBuyAgain:showConfirmPurchaseDlg})}))},showNotEnoughDlg=()=>{rdxDispatch(rdxDialogAction.hideDlg({key:dlgModule.Lw.PurchaseQRDlg})),rdxDispatch(rdxDialogAction.showDlg({key:dlgModule.Lw.PurchaseNotEnoughBalanceDlg,showCloseBtn:!0,onBackdropClick(){rdxDispatch(rdxDialogAction.hideDlg({key:dlgModule.Lw.PurchaseNotEnoughBalanceDlg}))},jsx:(0,jsx_runtime.jsx)(purchase_NotEnoughBalanceDlg,{detailInfoRes:detailInfoRes,selectedCurrency:selectedCurrencyRef.current})}))},showUpdateWalletDlg=param=>{let{linkType,walletType,version}=param;rdxDispatch(rdxDialogAction.hideDlg({key:dlgModule.Lw.PurchaseConfirmDlg}));let onClose=()=>{rdxDispatch(rdxDialogAction.hideDlg({key:dlgModule.Lw.UpdateWalletDlg}))};rdxDispatch(rdxDialogAction.showDlg({key:dlgModule.Lw.UpdateWalletDlg,showCloseBtn:!0,onBackdropClick:onClose,jsx:(0,jsx_runtime.jsx)(UpdateWalletDlg.Z,{linkType:linkType,walletType:walletType,version:version,isOpen:!0,onClose:onClose,rdxDialogAction:rdxDialogAction,rdxDispatch:rdxDispatch,revalidateWallet:()=>_checkWalletVersionShowDlg(selectedCurrencyRef.current||model.A.Currency_e.JELLY)})}))},showErrorDlg=function(){let{ecode,emsg}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,CommonDlg.Z)({rdxDialogAction,rdxDispatch}).showErrorDlg({emsg})};return{showConfirmPurchaseDlg,showPurchaseConnectWalletDlg,showCompleteDlg,showNotEnoughDlg,showErrorDlg,showDirectionAnimation}}},6417:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(5893);__webpack_exports__.Z=function(props){return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...props,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("defs",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{id:"17psul2kpa",d:"M0 0h24v24H0z"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("g",{fill:"currentColor",fillRule:"evenodd",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("g",{mask:"url(#2a7vtaj9ab)",fill:"currentColor",fillRule:"nonzero",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M21.635 12.332c-1.656-.469-2.651-2.254-2.225-3.895.596-1.972-.896-3.981-2.936-3.972-2.04-.009-3.533 2.002-2.935 3.972.79 2.947-3.032 3.248-3.171.923a3.142 3.142 0 0 1 .094-.923c.596-1.972-.895-3.981-2.936-3.972-2.04-.009-3.533 2.002-2.935 3.972.426 1.641-.57 3.425-2.225 3.895-3.702.978-2.825 6.338 1.005 6.07C5.276 18.21 6.531 16.296 6 14.48L6 14.48c-.816-3.01 3.046-3.244 3.154-.941.013.31-.021.639-.101.941l.002-.001c-.586 1.943.942 3.967 2.946 3.938 2.002.03 3.532-1.996 2.946-3.938l.002.001c-.815-3.01 3.046-3.244 3.155-.941.013.31-.022.639-.101.941l.001-.001c-.532 1.816.723 3.73 2.628 3.922 3.827.268 4.702-5.092 1.002-6.07z"})})})]})}},6323:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(5893),react__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(7294),tailwind_merge__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(6180);let DetailTitle=param=>{let{title}=param;return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div",{className:(0,tailwind_merge__WEBPACK_IMPORTED_MODULE_2__.m)("mb-[3.2rem] border-b-[0.1rem] border-grey-20 text-[2rem] font-semibold","lg:mb-[4rem] lg:text-[2.8rem]"),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div",{className:(0,tailwind_merge__WEBPACK_IMPORTED_MODULE_2__.m)("text-[2.8rem] font-semibold")}),title]})})};__webpack_exports__.Z=(0,react__WEBPACK_IMPORTED_MODULE_1__.memo)(DetailTitle)},7625:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(5893),react__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(7294),model_model__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(6870),p_components_common_base_CommonOfficialBadge__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(269),tailwind_merge__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(6180),p_components_common_base_ImgWithLoadingTw__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(7085);let ImgInfoCard=props=>{let isOfficial=props.badge===model_model__WEBPACK_IMPORTED_MODULE_2__.A.UserBadge_e.OF
1FICIAL;return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button",{className:"text-start",onClick:props.onClick,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div",{className:(0,tailwind_merge__WEBPACK_IMPORTED_MODULE_5__.m)("grid grid-cols-[5rem_1fr]","lg:grid-cols-[7rem_1fr]"),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(p_components_common_base_ImgWithLoadingTw__WEBPACK_IMPORTED_MODULE_4__.Z,{className:(0,tailwind_merge__WEBPACK_IMPORTED_MODULE_5__.m)("mr-[1rem] h-[4rem] w-[4rem]","lg:mr-[2rem] lg:h-[5rem] lg:w-[5rem]",props.isRoundedFull?"rounded-full":"rounded-[1rem]"),imageClassName:(0,tailwind_merge__WEBPACK_IMPORTED_MODULE_5__.m)("object-cover"),alt:props.title,src:props.imgUrl}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div",{className:(0,tailwind_merge__WEBPACK_IMPORTED_MODULE_5__.m)("flex flex-col justify-around overflow-hidden"),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div",{className:(0,tailwind_merge__WEBPACK_IMPORTED_MODULE_5__.m)("whitespace-pre-wrap break-all text-[1.2rem]","lg:text-[1.6rem]"),children:props.title}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div",{className:(0,tailwind_merge__WEBPACK_IMPORTED_MODULE_5__.m)("flex items-center"),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div",{className:(0,tailwind_merge__WEBPACK_IMPORTED_MODULE_5__.m)("truncate text-[2rem] font-semibold","lg:text-[1.6rem]",isOfficial?"mr-[0.5rem]":""),children:props.subTitle}),isOfficial&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(p_components_common_base_CommonOfficialBadge__WEBPACK_IMPORTED_MODULE_3__.Z,{})]})]})]})})};__webpack_exports__.Z=(0,react__WEBPACK_IMPORTED_MODULE_1__.memo)(ImgInfoCard)},5957:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(5893),react__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(7294),res_R__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(7994),utils_utils__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(805),hooks_useLocalSettings__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(243),swr__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(8100),next_router__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(1163),p_components_page_nftDetail_common_SaleEndTimer__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(761),next_image__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(5675),next_image__WEBPACK_IMPORTED_MODULE_8___default=__webpack_require__.n(next_image__WEBPACK_IMPORTED_MODULE_8__),tailwind_merge__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(6180);let SaleEndDate=param=>{let{saleEndDate,timeTitle,onFetchButtonStatus}=param,hR=(0,hooks_useLocalSettings__WEBPACK_IMPORTED_MODULE_4__.$v)(),hRouter=(0,next_router__WEBPACK_IMPORTED_MODULE_6__.useRouter)(),{query,locale}=hRouter,{mutate}=(0,swr__WEBPACK_IMPORTED_MODULE_5__.kY)(),TextTypePrimary=param=>{let{text}=param;return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div",{className:(0,tailwind_merge__WEBPACK_IMPORTED_MODULE_9__.m)("text-[1.6rem] font-medium text-grey-50","lg:text-[2rem]"),children:text})},TextTypeThird=param=>{let{text}=param;return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div",{className:(0,tailwind_merge__WEBPACK_IMPORTED_MODULE_9__.m)("text-[1.6rem] font-medium text-black","lg:text-[2rem]"),children:text})},onEndTime=(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(()=>{onFetchButtonStatus&&(onFetchButtonStatus(!0),mutate([query.mintId,locale]).then(()=>{onFetchButtonStatus(!1)}))},[onFetchButtonStatus]),remainTime=(0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(()=>{if(!saleEndDate)return 0;let now=new Date;return saleEndDate-now.valueOf()},[saleEndDate]);return saleEndDate?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div",{className:(0,tailwind_merge__WEBPACK_IMPORTED_MODULE_9__.m)("my-[1.8rem] h-[0.1rem] bg-grey-20","lg:my-[2.8rem]")}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div",{className:(0,tailwind_merge__WEBPACK_IMPORTED_MODULE_9__.m)("flex flex-col justify-between gap-[1.4rem]","lg:flex-row lg:gap-0"),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div",{className:(0,tailwind_merge__WEBPACK_IMPORTED_MODULE_9__.m)("flex flex-col gap-[0.4rem]","lg:gap-[0.8rem]"),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div",{className:(0,tailwind_merge__WEBPACK_IMPORTED_MODULE_9__.m)("flex items-center"),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(next_image__WEBPACK_IMPORTED_MODULE_8___default(),{src:res_R__WEBPACK_IMPORTED_MODULE_2__.Z.images.icons_nft_details_ic_time3x,alt:"time icon",className:(0,tailwind_merge__WEBPACK_IMPORTED_MODULE_9__.m)("mr-[0.6rem] h-[1.8rem] w-[1.8rem] ","lg:h-[2rem] lg:w-[2rem]")}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(TextTypePrimary,{text:timeTitle||hR.strings.DETAIL_SALE_END_AT})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(TextTypeThird,{text:utils_utils__WEBPACK_IMPORTED_MODULE_3__.cQ.date.brewFormatString(saleEndDate,void 0,hR.locale)})]}),remainTime&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(p_components_page_nftDetail_common_SaleEndTimer__WEBPACK_IMPORTED_MODULE_7__.Z,{remainTime:remainTime,onEndTime:onEndTime})]})]}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment,{})};__webpack_exports__.Z=(0,react__WEBPACK_IMPORTED_MODULE_1__.memo)(SaleEndDate)},761:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(5893),react__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(7294),utils_utils__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(805),hooks_useLocalSettings__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(243),hooks_useInterval__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(4639),tailwind_merge__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(6180);let keyValueFontSize_e={2:"2rem",12:"1.2rem",14:"1.4rem",16:"1.6rem",24:"2.4rem",28:"2.8rem"},SaleEndTimer=param=>{let{remainTime,onEndTime,isTextCenter,valueFontSize,keyFontSize,isDeepPurpleColor,isKeyFontReguler}=param,ELAPSED_TIME_MS=0,[sRemainTime,setRemainTime]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(remainTime),isSaleEnd=(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(!1),hR=(0,hooks_useLocalSettings__WEBPACK_IMPORTED_MODULE_3__.$v)();(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{updateRemainTime()},[remainTime]);let updateRemainTime=()=>{if(!remainTime||isSaleEnd.current)return;let newRemainTime=sRemainTime-ELAPSED_TIME_MS;ELAPSED_TIME_MS+=1e3,newRemainTime<0&&(isSaleEnd.current=!0,onEndTime()),setRemainTime(newRemainTime)};(0,hooks_useInterval__WEBPACK_IMPORTED_MODULE_4__.Z)({onUpdate:updateRemainTime,time:1e3});let formattedRemainTime=(timestamp=>{let durationTime=utils_utils__WEBPACK_IMPORTED_MODULE_2__.cQ.date.diff(0,timestamp);return{["".concat(hR.strings.HOURS)]:(durationTime.hours||0)+24*(durationTime.days||0),["".concat(hR.strings.MINUTES)]:durationTime.minutes,["".concat(hR.strings.SECONDS)]:durationTime.seconds}})(sRemainTime);return sRemainTime<0||sRemainTime>2592e5?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment,{}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div",{className:(0,tailwind_merge__WEBPACK_IMPORTED_MODULE_5__.m)("grid w-fit grid-cols-3 gap-[14px] md:gap-[32px] lg:gap-[22px] ",isTextCenter?"text-center":"text-left"),children:Object.entries(formattedRemainTime).map((param,index)=>{let[key,value]=param;return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div",{className:(0,tailwind_merge__WEBPACK_IMPORTED_MODULE_5__.m)(isDeepPurpleColor?"text-purple-200":"text-black","font-semibold","text-[".concat(keyValueFontSize_e[(null==valueFontSize?void 0:valueFontSize.mb)||2],"]"),"lg:text-[".concat(keyValueFontSize_e[(null==valueFontSize?void 0:valueFontSize.dt)||28],"]")),children:value}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div",{className:(0,tailwind_merge__WEBPACK_IMPORTED_MODULE_5__.m)("text-[".concat(keyValueFontSize_e[(null==keyFontSize?void 0:keyFontSize.mb)||12],"]"),"lg:text-[".concat(keyValueFontSize_e[(null==keyFontSize?void 0:keyFontSize.dt)||16],"]"),isDeepPurpleColor?"text-purple-200":"text-grey-50",isKeyFontReguler?"font-normal":"font-medium"),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div",{className:(0,tailwind_merge__WEBPACK_IMPORTED_MODULE_5__.m)(isDeepPurpleColor?"text-purple-200":"text-grey-50",isKeyFontReguler?"font-normal":"font-medium"),children:key})})]},index)})})};__webpack_exports__.Z=(0,react__WEBPACK_IMPORTED_MODULE_1__.memo)(SaleEndTimer)},1169:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(5893),hooks_useLocalSettings__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(243);__webpack_require__(7294);var tailwind_merge__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(6180);let LuckyBagLogo=param=>{let{className}=param,hR=(0,hooks_useLocalSettings__WEBPACK_IMPORTED_MODULE_1__.$v)();return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span",{className:(0,tailwind_merge__WEBPACK_IMPORTED_MODULE_3__.m)("bg-gradient-to-r from-pink to-purple-100 bg-clip-text text-[2.8rem] font-semibold tracking-[0.1px] text-transparent ".concat(className)),children:hR.strings.LUCKY_BAG_EVERYONE_LUCKY_BAG_TITLE})};__webpack_exports__.Z=LuckyBagLogo}}]);
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.