1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6003],{36003:function(e,a,t){t.r(a);var s=t(57437),l=t(2265),r=t(66507),c=t(95637),n=t(65113),i=t(99376),o=t(65582),m=t(68412),d=t(96440),u=t(47435),h=t(58945),g=t(60010),f=t(27648),v=t(15595),N=t(30963),x=t(25236),j=t(10279),S=t(87796);a.default=e=>{let{isValid:a}=e,t=(0,i.useRouter)(),p=(0,n.TL)(),{error:b,showError:_,clearError:y}=(0,x.Z)(),{amount_balance:I,quantity_balance:T,pre_tax_current_rate:k,quoteId:C,quoteValidityTime:R,quantity:E,pre_tax_amount:O,total_amount:w,tax1_amount:D,tax2_amount:F,tax3_amount:M,validCurrencySymbol:L,selectedOption:Z,amount:G,grams:A,sellCheckoutFormData:V,otpData:q,enteredOTP:B,tax1Perc:U,tax2Perc:P}=(0,g.Z)(),{showCheckoutPopup:Y,checkoutCountdown:z,closeCheckoutPopup:H,clearCheckoutLocalStorage:Q}=(0,S.Z)(Number(R)),{trigger:J,isMutating:K}=(0,o.Z)(C?"payment/".concat(C,"/sell/initialize"):null,c.gK),{data:W}=(0,u.Z)(C?"payment/".concat(C,"/sell/methods"):null);(0,l.useEffect)(()=>{C||t.push("/digi-gold")},[C,t]),(0,l.useEffect)(()=>{((null==q?void 0:q.uuid)||B)&&y()},[null==q?void 0:q.uuid,B]);let X=e=>{_(e)},$=e=>{t.push("/digi-gold/checkout/success?transaction_id=".concat(e)),setTimeout(()=>{p((0,h.eq)()),Q()},1e3)},ee=async()=>{try{if(y(),"error"===W.status){X(W.message||(null==W?void 0:W.error));return}let{id:e}=(null==W?void 0:W.data[0])||{};if(!e){X(N.N.DIGIGOLD_PAYMENT_METHOD_MISSING_ERROR.message);return}let a=await J({payload:{calculation_type:Z,value:"a"===Z?G:A,digigold_payment:{device_type:"w",payment_method:e},account_pay_out:{account_number:V.account_number,ifsc_code:V.ifsc_code,account_name:V.account_name},otp_detail:{uuid:q.uuid,otp:B}}});if((null==a?void 0:a.status)==="success"&&(null==a?void 0:a.data))$(a.data.transaction_id);else{let e=(null==a?void 0:a.error)||(null==a?void 0:a.message)||N.N.COMMON_ERROR.message;(null==a?void 0:a.errorResponse)?X((0,m.Jw)(a.errorResponse)):X(e)}}catch(e){X(N.N.COMMON_ERROR.message)}};return(0,s.jsxs)("div",{className:"digigold-checkout-rightsection mt-3",children:[(0,s.jsxs)("div",{className:"offer-buy-section",children:[(0,s.jsx)("p",{className:"offer-rate-txt fs16-variant6",children:"Offer sell rate"}),(0,s.jsxs)("div",{className:"offer-buy-rate mt-2",children:[(0,s.jsx)("label",{htmlFor:"goldBalance",className:"fs16-variant6",children:"Gold Balance"}),(0,s.jsxs)("span",{id:"goldBalance",className:"fs16-variant18",children:["".concat(L).concat(I),(0,s.jsxs)("i",{children:["(",T," gram)"]})]}),k&&(0,s.jsxs)("p",{children:["@".concat(L).concat(k,"/gram"),(0,s.jsx)(j.default,{className:"ms-2",size:"sm",animation:"grow",variant:"danger"})," ",(0,s.jsx)("b",{children:"Live"})]})]}),(0,s.jsxs)("div",{className:"offer-price-txt fs16-variant6 my-2",children:[(0,s.jsx)("label",{htmlFor:"priceValidity",className:"fs16-variant6",children:"Price valid for"}),(0,s.jsxs)("span",{id:"priceValidity",className:"fs16-variant6 flex-center flex",children:[(0,m.w1)(z)," Sec"]})]}),(0,s.jsx)(f.default,{href:"/digi-gold/order/history",className:"grt-btn btn--white variant-1 btn--medium variant-4",prefetch:!1,children:"View purchase History"})]}),(0,s.jsxs)("div",{className:"buy-goldsection mt-2",children:[(0,s.jsxs)("div",{className:"d-flex align-items-center",children:[(0,s.jsx)("h3",{className:"offer-rate-txt fs16-variant5",children:"Sell Gold"}),(0,s.jsxs)(d.default,{type:"button",className:"fs14-variant1",children:["Gold Rate /gram - ",(0,s.jsx)("span",{className:"fs16-variant5",children:"".concat(L).concat(k)})]})]}),(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsx)("label",{htmlFor:"quantity",className:"fs14-variant1",children:"Quantity (in grams)"}),(0,s.jsxs)("span",{id:"quantity",className:"fs14-variant1",children:[E," g"]})]}),(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsx)("label",{htmlFor:"amount",className:"fs14-variant1",children:"Amount"}),(0,s.jsxs)("span",{id:"amount",className:"fs14-variant1",children:[L,O]})]}),(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsxs)("label",{htmlFor:"cgst",className:"fs14-variant1",children:["CGST (",U,"%)"]}),(0,s.jsx)("span",{id:"cgst",className:"fs14-variant1",children:"".concat(L).concat(D)})]}),(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsxs)("label",{htmlFor:"sgst",className:"fs14-variant1",children:["SGST (",P,"%)"]}),(0,s.jsx)("span",{id:"sgst",className:"fs14-variant1",children:"".concat(L).concat(F)})]}),Number(M)>0&&(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsx)("label",{htmlFor:"sgst",className:"fs14-variant1",children:"TDS"}),(0,s.jsx)("span",{id:"sgst",className:"fs14-variant1",children:"- ".concat(L).concat(M)})]}),(0,s.jsxs)("div",{className:"buy-total-values mt-2",children:[(0,s.jsx)("label",{htmlFor:"total",className:"fs14-variant1",children:"Total"}),(0,s.jsx)("span",{id:"total",className:"fs14-variant1",children:"".concat(L).concat(w)})]})]}),""!==b&&(0,s.jsx)("p",{className:"error-message mb-0 mt-1",children:b}),(0,s.jsx)(d.default,{className:"grt-btn btn--ruby btn--full mt-3 ".concat(!(4===B.length&&a)&&"disabled-btn"),disabled:!(4===B.length&&a),handleClick:ee,children:"Confirm to Sell"}),Y&&(0,s.jsx)(v.Z,{show:Y,quoteValidityTime:R,onRefresh:()=>{H(),t.push("/digi-gold")}}),K&&(0,s.jsx)(r.Z,{})]})}},47435:function(e,a,t){var s=t(95637),l=t(61006);a.Z=e=>{let{data:a,isLoading:t,error:r}=(0,l.u)(null!=e?e:null,s.x5,{revalidateOnFocus:!1,shouldRetryOnError:!1});return{data:a,isLoading:t,error:r}}},87796:function(e,a,t){var s=t(2265);a.Z=e=>
1{let[a,t]=(0,s.useState)(()=>{let a=localStorage.getItem("remainingCheckoutTime"),t=localStorage.getItem("checkoutStartTime");if(a&&t){let e=Date.now()-Number(t),s=Number(a)-Math.floor(e/1e3);return s>0?s:0}return e}),[l,r]=(0,s.useState)(!1);(0,s.useEffect)(()=>{0===a&&r(!0);let e=setInterval(()=>{t(a=>a<=1?(clearInterval(e),0):a-1)},1e3),s=Date.now();return localStorage.setItem("remainingCheckoutTime",a.toString()),localStorage.setItem("checkoutStartTime",s.toString()),()=>{clearInterval(e)}},[a]);let c=()=>{let a=Date.now();t(e),localStorage.setItem("remainingCheckoutTime",e.toString()),localStorage.setItem("checkoutStartTime",a.toString())},n=()=>{localStorage.removeItem("remainingCheckoutTime"),localStorage.removeItem("checkoutStartTime"),o(),c()},i=(0,s.useCallback)(()=>{t(e),localStorage.setItem("remainingCheckoutTime",e.toString());let a=Date.now();localStorage.setItem("checkoutStartTime",a.toString())},[e]),o=()=>{localStorage.removeItem("FORM_VALUES"),localStorage.removeItem("QUOTE_DETAILS"),localStorage.removeItem("CURRENCY_SYMBOL"),localStorage.removeItem("CALCULATED_DETAILS")};return{showCheckoutPopup:l,closeCheckoutPopup:()=>{o(),n(),r(!1),c()},resetCheckoutCountdown:c,checkoutCountdown:a,clearCheckoutLocalStorage:n,ignoreCheckoutLocalStorage:i}}}}]);
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.