(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([[9807],{734910(__unused_webpack_module,__webpack_exports__,__webpack_require__){(function(){if(!this.ST)return()=>{};with(this.ST)with(this.RH)with(this.G)return function(){"use strict";__webpack_require__.d(__webpack_exports__,{e:()=>w,uY:()=>S});var t=__webpack_require__(860012);var e=__webpack_require__(48084);var r=__webpack_require__(60746);__webpack_require__.n(r);var l=__webpack_require__(619489);var n=__webpack_require__(456895);__webpack_require__.n(n);var u=__webpack_require__(738012);var a=__webpack_require__(768466);var i=__webpack_require__(895175);var s=__webpack_require__(127565);var o=__webpack_require__(79222);var c=__webpack_require__(962331);var d=__webpack_require__(589628);var v=__webpack_require__(950887);var h=__webpack_require__(86111);var f=__webpack_require__(749201);"use no memo";let w=({quote:r,fromAddress:l,fromAddressAccount:u,chainId:a})=>{let s=(0,f.w)();let[d,w]=(0,t.useState)(!1);let[S,m]=(0,t.useState)(null);let[p,I]=(0,t.useState)(!1);let[k,g]=(0,t.useState)(!1);let b=(0,i.Z)(r?.requestId);let[T,y]=(0,t.useState)(null);let A=(0,e.d4)(v.Sc);let $=(0,e.d4)(v.R6);let{accounts:C}=(0,h.G)();let _=(0,t.useRef)(new Map);let[q,E]=(0,t.useState)(null);let G=(0,t.useCallback)((0,n.debounce)(async(t,e)=>{m(null),I(!1),w(!1),g(!1)},750),[s]);let M=(0,t.useCallback)(async t=>{if(!!1||!t||!l||!a||!A){m(null),I(!1),y(null),w(!1),g(!1);return}w(!0),g(!1);let e=null;try{if(!await s((0,o.ggM)(C))){m(null),I(!1),y(null),g(!1),w(!1);return}if(!(e=(0,c.B)(l,a))){m(null),g(!1),I(!1),y(null),w(!1);return}let r=await s((0,o.NSN)(e));y(r);let n=r;if(!r&&u&&(n=await s((0,o.J$j)({account:u}))),I(n),m(null),g(!1),!n||!r){w(!1);return}await G(t,e)}catch{w(!1),I(!1),m(null),y(null),g(!1)}},[l,a,A,s,u,G]);return(0,t.useEffect)(()=>{b!==r?.requestId&&M(r)},[M,r?.requestId,r,b]),(0,t.useEffect)(()=>{l&&$!==null?(_.current.set(l,$),E($)):l?E(_.current.get(l)??null):E(null)},[$,l]),(0,t.useEffect)(()=>{q!==null&&T===!1&&M(r)},[q,T,M,r]),{shouldShowRewardsRow:p,isLoading:d,estimatedPoints:S,hasError:k,accountOptedIn:T,rewardsAccountScope:r&&p?u:null}};let S=({activeQuote:t})=>{let r=(0,e.d4)(u.G8);let n=(0,e.d4)(u.dJ);let i=(0,e.d4)(u.WZ);let o=(0,s.t)(a.aN);let c=o?(0,l.Kr)(o.toString()):null;let v=(0,e.d4)(t=>c?(0,d.zH)(t,c):null);return w({quote:r&&n&&i?.srcTokenAmount&&v?.address?t:null,fromAddress:v?.address,fromAddressAccount:v,chainId:o?.toString()})}}}).call(__webpack_require__._LM_("$root$",{__webpack_require__,__webpack_exports__}))()},837844(__unused_webpack_module,__webpack_exports__,__webpack_require__){(function(){if(!this.ST)return()=>{};with(this.ST)with(this.RH)with(this.G)return function(){"use strict";__webpack_require__.d(__webpack_exports__,{Y5:()=>n,eh:()=>l});var t=__webpack_require__(477322);var e=__webpack_require__(242317);var r=__webpack_require__(280501);let l=l=>{if(!l)return"unknown";let{type:n,metadata:u}=l;let a=u?.keyring?.type;let i=u?.snap?.id;return a&&[r.rI.ledger,r.rI.trezor,r.rI.oneKey,r.rI.lattice,r.rI.qr].includes(a)?"hardware":(0,a===r.rI.simple)?"private-key":(0,a===r.rI.snap&&i==="npm:@metamask/institutional-wallet-snap")?"institutional-evm":(0,(0,e.a)(n))?"evm":(0,n===t.Ux.DataAccount)?"solana":(0,Object.values(t.fi).includes(n))?"bitcoin":(0,n===t.mA.Eoa)?"tron":(0,"unknown")};let n=t=>{return l(t)==="hardware"}}}).call(__webpack_require__._LM_("$root$",{__webpack_require__,__webpack_exports__}))()},962331(__unused_webpack_module,__webpack_exports__,__webpack_require__){(function(){if(!this.ST)return()=>{};with(this.ST)with(this.RH)with(this.G)return function(){"use strict";__webpack_require__.d(__webpack_exports__,{B:()=>a});var t=__webpack_require__(619489);var e=__webpack_require__(142282);var r=__webpack_require__(760184);var l=__webpack_require__(171097);var n=__webpack_require__.n(l);var u=__webpack_require__(776500);let a=(l,a)=>{try{let n=(0,t.Kr)(a);let{namespace:i,reference:s}=(0,e.rW)(n);let o=(0,r.Cv)(l)?(0,u.sX)(l):l;return(0,e.pI)(i,s,o)}catch(t){return n().error("[rewards-utils] Error formatting account to CAIP-10:",t),null}}}}).call(__webpack_require__._LM_("$root$",{__webpack_require__,__webpack_exports__}))()}}]);