PageSourceSearch

https://polymarket.com/_next/static/immutable/chunks/1px4y-lrohwva.js

js polymarket.com collected 2026-09-24 08:34:49 UTC 55,391 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,977117,476180,561662,440772,20427,e=>{"use strict";var t=e.i(303115),s=e.i(846574),r=e.i(728056),n=e.i(981831),a=e.i(119899),o=e.i(545500),i=e.i(90679),l=e.i(632137),c=e.i(970999),d=e.i(703459),u=e.i(45806),p=e.i(871554),m=e.i(875259),x=e.i(355664),h=e.i(146576),f=e.i(410543),y=e.i(985306),w=e.i(7616),k=e.i(275157),b=e.i(160082),j=e.i(566344),g=e.i(910233),v=e.i(479295),N=e.i(234461),S=e.i(521280),C=e.i(489048),D=e.i(384187),T=e.i(519216),R=e.i(791639);let M=e=>{let r,n,a,o,i,l=(0,s.c)(7);return l[0]!==e?({...r}=e,l[0]=e,l[1]=r):r=l[1],l[2]===Symbol.for("react.memo_cache_sentinel")?(n=(0,t.jsx)("circle",{cx:"250",cy:"250",r:"250",fill:"#FF4A4A"}),l[2]=n):n=l[2],l[3]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsxs)("g",{clipPath:"url(#clip0_2961_1052)",children:[(0,t.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M306.591 299.978H289.54C286.337 299.978 283.741 297.388 283.741 294.197V249.263L253.81 267.977C251.299 269.548 248.106 269.548 245.595 267.977L215.665 249.261V294.197C215.665 297.388 213.067 299.978 209.866 299.978H192.815C189.61 299.978 187.016 297.388 187.016 294.197V207.592C187.016 201.391 193.986 197.728 199.116 201.233L246.426 233.548C248.4 234.899 251.006 234.899 252.981 233.548L300.287 201.233C305.42 197.726 312.39 201.389 312.39 207.59V294.197C312.39 297.388 309.794 299.978 306.591 299.978Z",fill:"white"}),(0,t.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M161.337 299.208L55.7068 299.206C51.4572 299.206 48.0117 295.769 48.0117 291.529V204.757C48.0117 201.577 50.5953 199 53.783 199H70.7525C73.9382 199 76.5238 201.577 76.5238 204.757V270.762L140.52 270.764V204.757C140.52 201.577 143.101 199 146.291 199H163.26C166.446 199 169.032 201.577 169.032 204.757V291.531C169.032 295.77 165.586 299.208 161.337 299.208Z",fill:"white"}),(0,t.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M337.832 199L443.462 199.002C447.711 199.002 451.157 202.439 451.157 206.678V293.45C451.157 296.63 448.571 299.208 445.385 299.208H428.416C425.228 299.208 422.645 296.63 422.645 293.45V231.284C422.645 229.165 420.921 227.445 418.797 227.445L362.496 227.443C360.372 227.443 358.649 229.161 358.649 231.282V293.45C358.649 296.63 356.065 299.208 352.877 299.208H335.908C332.72 299.208 330.137 296.63 330.137 293.45V206.677C330.137 202.437 333.582 199 337.832 199Z",fill:"white"}),(0,t.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M376.383 251.74V268.823C376.383 271.982 378.969 274.542 382.159 274.542H399.127C402.318 274.542 404.903 271.982 404.903 268.823V251.74C404.903 248.582 402.318 246.021 399.127 246.021H382.159C378.969 246.021 376.383 248.582 376.383 251.74Z",fill:"white"})]}),l[3]=a):a=l[3],l[4]===Symbol.for("react.memo_cache_sentinel")?(o=(0,t.jsx)("defs",{children:(0,t.jsx)("clipPath",{id:"clip0_2961_1052",children:(0,t.jsx)("rect",{width:"403.143",height:"102.993",fill:"white",transform:"translate(48 199)"})})}),l[4]=o):o=l[4],l[5]!==r?(i=(0,t.jsxs)("svg",{width:"500",height:"500",viewBox:"0 0 500 500",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r,children:[n,a,o]}),l[5]=r,l[6]=i):i=l[6],i},A=e=>{let r,n,a,o,i,c,d,u=(0,s.c)(11);return u[0]!==e?({className:r,...n}=e,u[0]=e,u[1]=r,u[2]=n):(r=u[1],n=u[2]),u[3]!==r?(a=(0,l.cn)("[--usdc-accent:#2775ca]",r),u[3]=r,u[4]=a):a=u[4],u[5]===Symbol.for("react.memo_cache_sentinel")?(o=(0,t.jsx)("path",{d:"M1000 2000c554.17 0 1000-445.83 1000-1000S1554.17 0 1000 0 0 445.83 0 1000s445.83 1000 1000 1000z",fill:"var(--usdc-accent)"}),i=(0,t.jsx)("path",{d:"M1275 1158.33c0-145.83-87.5-195.83-262.5-216.66-125-16.67-150-50-150-108.34s41.67-95.83 125-95.83c75 0 116.67 25 137.5 87.5 4.17 12.5 16.67 20.83 29.17 20.83h66.66c16.67 0 29.17-12.5 29.17-29.16v-4.17c-16.67-91.67-91.67-162.5-187.5-170.83v-100c0-16.67-12.5-29.17-33.33-33.34h-62.5c-16.67 0-29.17 12.5-33.34 33.34v95.83c-125 16.67-204.16 100-204.16 204.17 0 137.5 83.33 191.66 258.33 212.5 116.67 20.83 154.17 45.83 154.17 112.5s-58.34 112.5-137.5 112.5c-108.34 0-145.84-45.84-158.34-108.34-4.16-16.66-16.66-25-29.16-25h-70.84c-16.66 0-29.16 12.5-29.16 29.17v4.17c16.66 104.16 83.33 179.16 220.83 200v100c0 16.66 12.5 29.16 33.33 33.33h62.5c16.67 0 29.17-12.5 33.34-33.33v-100c125-20.84 208.33-108.34 208.33-220.84z",fill:"#fff"}),c=(0,t.jsx)("path",{d:"M787.5 1595.83c-325-116.66-491.67-479.16-370.83-800 62.5-175 200-308.33 370.83-370.83 16.67-8.33 25-20.83 25-41.67V325c0-16.67-8.33-29.17-25-33.33-4.17 0-12.5 0-16.67 4.16-395.83 125-612.5 545.84-487.5 941.67 75 233.33 254.17 412.5 487.5 487.5 16.67 8.33 33.34 0 37.5-16.67 4.17-4.16 4.17-8.33 4.17-16.66v-58.34c0-12.5-12.5-29.16-25-37.5zM1229.17 295.83c-16.67-8.33-33.34 0-37.5 16.67-4.17 4.17-4.17 8.33-4.17 16.67v58.33c0 16.67 12.5 33.33 25 41.67 325 116.66 491.67 479.16 370.83 800-62.5 175-200 308.33-370.83 370.83-16.67 8.33-25 20.83-25 41.67V1700c0 16.67 8.33 29.17 25 33.33 4.17 0 12.5 0 16.67-4.16 395.83-125 612.5-545.84 487.5-941.67-75-237.5-258.34-416.67-487.5-491.67z",fill:"#fff"}),u[5]=o,u[6]=i,u[7]=c):(o=u[5],i=u[6],c=u[7]),u[8]!==n||u[9]!==a?(d=(0,t.jsxs)("svg",{"data-name":"86977684-12db-4850-8f30-233a7c267d11",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2000 2000",className:a,...n,children:[o,i,c]}),u[8]=n,u[9]=a,u[10]=d):d=u[10],d},P=(e,s=20)=>"uma"===e.symbol?(0,t.jsx)(M,{height:`${s}px`,width:`${s}px`}):(0,t.jsx)(A,{height:`${s}px`,width:`${s}px`});e.s(["IconWithAmount",0,function(e){let r,n,a,o=(0,s.c)(8),{rewardToken:i,amount:l,isNotLast:c}=e,d=`flex items-center ${c?"mb-1":"mb-0"}`;return o[0]!==i?(r=P(i,16),o[0]=i,o[1]=r):r=o[1],o[2]!==l?(n=(0,t.jsx)("p",{className:"ml-1 text-sm font-normal",children:l}),o[2]=l,o[3]=n):n=o[3],o[4]!==d||o[5]!==r||o[6]!==n?(a=(0,t.jsxs)("div",{className:d,children:[r,n]}),o[4]=d,o[5]=r,o[6]=n,o[7]=a):a=o[7],a},"renderTokenIcon",0,P],476180);
1var _=e.i(462989),I=e.i(559067),O=e.i(697552),L=e.i(450411),E=e.i(980660),$=e.i(873167),F=e.i(97866),B=e.i(957705),q=e.i(132818),H=e.i(911914),z=e.i(510779);async function V(e,t,s){let r=new URLSearchParams({walletMode:t,conditionId:e,requestPath:$.ACTIVE_SPONSORSHIP_REQUEST_PATH}),n=await fetch(`/api/rewards/activesponsorship?${r}`,{cache:"no-store",headers:(0,z.encodeL2Headers)(s)});if(!n.ok)throw Error(`Failed to fetch active sponsorship: ${n.status}`);return n.json()}function W(e){let t=new Date(e.start_time),s=new Date(e.end_time);if(!(0,H.isValid)(t)||!(0,H.isValid)(s))return{dailyRate:0,endDate:"--",endTime:"--"};let r=e.market_end_time?new Date(Math.min(s.getTime(),new Date(e.market_end_time).getTime())):s;return{dailyRate:86400*e.rate_per_second,endDate:(0,q.format)(r,"MMM d, yyyy"),endTime:(0,q.format)(r,"h:mm a")}}function K(e){let t,n,a,o,i,l,c,d,u,p,m,x,h,f=(0,s.c)(42),{conditionId:y,enabled:w,isSponsorableOverride:k}=e,b=void 0===w||w;f[0]===Symbol.for("react.memo_cache_sentinel")?(t=["proxyAddress","walletMode","authenticated"],f[0]=t):t=f[0];let{proxyAddress:j,walletMode:g,authenticated:v}=(0,S.useAccountContext)(t),{generateL2Headers:N,apiCredential:C,signer:D}=(0,E.useL2Headers)(),R=!!j&&!!C?.key&&!!D;f[1]===Symbol.for("react.memo_cache_sentinel")?(n={threshold:0,triggerOnce:!0},f[1]=n):n=f[1];let{ref:M,inView:A}=(0,I.useInView)(n),P=void 0!==k,_=b&&!!y&&!P;f[2]!==_?(a={enabled:_,gcTime:3e5,staleTime:6e4},f[2]=_,f[3]=a):a=f[3];let q=a;f[4]!==y?(o=[y],f[4]=y,f[5]=o):o=f[5],f[6]!==q||f[7]!==o?(i={address:B.REWARDS_CONTRACT_ADDRESS,abi:L.RewardsAbi,functionName:"markets",args:o,chainId:T.MATIC_CONFIG.chainId,query:q},f[6]=q,f[7]=o,f[8]=i):i=f[8];let{data:H,isLoading:z}=(0,O.useReadContract)(i);f[9]!==y?(l=[y],f[9]=y,f[10]=l):l=f[10],f[11]!==q||f[12]!==l?(c={address:B.OLD_REWARDS_CONTRACT_ADDRESS,abi:L.RewardsAbi,functionName:"markets",args:l,chainId:T.MATIC_CONFIG.chainId,query:q},f[11]=q,f[12]=l,f[13]=c):c=f[13];let{data:W,isLoading:K}=(0,O.useReadContract)(c);e:{if(P){d=k;break e}let e=H?.[1]??0,t=W?.[1]??0;d=e>0||t>0}let Q=d;f[14]!==y||f[15]!==j||f[16]!==g?(u=["activeSponsorship",y,j,g],f[14]=y,f[15]=j,f[16]=g,f[17]=u):u=f[17],f[18]!==y||f[19]!==N||f[20]!==g?(p=async()=>{let e=await N({method:"GET",requestPath:$.ACTIVE_SPONSORSHIP_REQUEST_PATH});if(!e)throw Error("Failed to generate auth headers");return V(y,g,e)},f[18]=y,f[19]=N,f[20]=g,f[21]=p):p=f[21];let G=b&&!!y&&!!j&&R&&v&&A&&Q;f[22]!==u||f[23]!==p||f[24]!==G?(m={queryKey:u,queryFn:p,enabled:G,staleTime:6e4,retry:1},f[22]=u,f[23]=p,f[24]=G,f[25]=m):m=f[25];let{data:Y,isLoading:Z}=(0,r.useQuery)(m),X=Y?.active_sponsorship??null,J=null!==X,ee=Y?.has_past_sponsorship??!1,et=(0,F.usePendingSponsorshipsStore)(U);t:{let e;if(!y||!j){x=!1;break t}if(f[26]!==y||f[27]!==et||f[28]!==j){let t;f[30]!==y||f[31]!==j?(t=e=>e.conditionId===y&&e.proxyAddress.toLowerCase()===j.toLowerCase(),f[30]=y,f[31]=j,f[32]=t):t=f[32],e=et.some(t),f[26]=y,f[27]=et,f[28]=j,f[29]=e}else e=f[29];x=e}let es=x,er=b&&(P||void 0!==H&&void 0!==W)&&(!Q||!Z),en=!P&&(z||K)||Q&&Z;return f[33]!==ee||f[34]!==er||f[35]!==es||f[36]!==Q||f[37]!==J||f[38]!==M||f[39]!==en||f[40]!==X?(h={ref:M,isLoading:en,isUserSponsor:J,isPending:es,hasPastSponsorship:ee,userSponsorship:X,isSponsorable:Q,isInitialLoadComplete:er},f[33]=ee,f[34]=er,f[35]=es,f[36]=Q,f[37]=J,f[38]=M,f[39]=en,f[40]=X,f[41]=h):h=f[41],h}function U(e){return e.pendingSponsorships}e.s(["fetchActiveSponsorship",0,V,"toExistingSponsorship",0,W],561662),e.s(["useMarketSponsorshipStatus",0,K],440772);var Q=e.i(518498),G=e.i(274906),Y=e.i(605138),Z=e.i(676922),X=e.i(820399);function J(e){return Array.isArray(e.queryKey)&&"/api/rewards"===e.queryKey[0]&&"userSponsorships"===e.queryKey[1]}function ee(e){return e.clearExpired}function et(e){return e.removePendingSponsorship}function es(e){return e.pendingSponsorships}let er=["agreement","input","review","success"];var en=e.i(443978),ea=e.i(745696),eo=e.i(167058),ei=e.i(980056),el=e.i(891586),ec=e.i(37760),ed=e.i(681663),eu=e.i(521165),ep=e.i(109223),em=e.i(335630),ex=e.i(369439),eh=e.i(319008);
1let ef=function(e){let r,a,o,i,l,c,d,u,p,m,x,h,f,y,w,k=(0,s.c)(41),{onAccept:b}=e,j=(0,Z.useMessages)().rewards.sponsorshipModal;return k[0]!==j.sponsorRewards?(r=(0,t.jsx)(Q.ModalHeader,{children:(0,t.jsx)(Q.ModalTitle,{children:j.sponsorRewards})}),k[0]=j.sponsorRewards,k[1]=r):r=k[1],k[2]!==j.sponsorDescriptionBold?(a=(0,t.jsx)("strong",{className:"font-bold text-black dark:text-pk-content-accent-brand",children:j.sponsorDescriptionBold}),k[2]=j.sponsorDescriptionBold,k[3]=a):a=k[3],k[4]!==j.sponsorDescriptionPost||k[5]!==j.sponsorDescriptionPre||k[6]!==a?(o=(0,t.jsxs)(Q.ModalDescription,{children:[j.sponsorDescriptionPre,a,j.sponsorDescriptionPost]}),k[4]=j.sponsorDescriptionPost,k[5]=j.sponsorDescriptionPre,k[6]=a,k[7]=o):o=k[7],k[8]===Symbol.for("react.memo_cache_sentinel")?(i=(0,t.jsx)(ex.IconLockOutline18,{size:18,className:"shrink-0 text-pk-content-secondary mt-px"}),k[8]=i):i=k[8],k[9]!==j.rule1Bold?(l=(0,t.jsx)("strong",{children:j.rule1Bold}),k[9]=j.rule1Bold,k[10]=l):l=k[10],k[11]!==j.rule1Post||k[12]!==j.rule1Pre||k[13]!==l?(c=(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[i,(0,t.jsxs)("p",{className:"text-sm text-pk-content-primary",children:[j.rule1Pre,l,j.rule1Post]})]}),k[11]=j.rule1Post,k[12]=j.rule1Pre,k[13]=l,k[14]=c):c=k[14],k[15]===Symbol.for("react.memo_cache_sentinel")?(d=(0,t.jsx)(em.IconClockOutline18,{size:18,className:"shrink-0 text-pk-content-secondary mt-px"}),k[15]=d):d=k[15],k[16]!==j.rule2Bold?(u=(0,t.jsx)("strong",{children:j.rule2Bold}),k[16]=j.rule2Bold,k[17]=u):u=k[17],k[18]!==j.rule2Post||k[19]!==j.rule2Pre||k[20]!==u?(p=(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[d,(0,t.jsxs)("p",{className:"text-sm text-pk-content-primary",children:[j.rule2Pre,u,j.rule2Post]})]}),k[18]=j.rule2Post,k[19]=j.rule2Pre,k[20]=u,k[21]=p):p=k[21],k[22]===Symbol.for("react.memo_cache_sentinel")?(m=(0,t.jsx)(eh.IconRefreshOutline18,{size:18,className:"shrink-0 text-pk-content-secondary mt-px"}),k[22]=m):m=k[22],k[23]!==j.rule3Bold?(x=(0,t.jsx)("strong",{children:j.rule3Bold}),k[23]=j.rule3Bold,k[24]=x):x=k[24],k[25]!==j.rule3Post||k[26]!==j.rule3Pre||k[27]!==x?(h=(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[m,(0,t.jsxs)("p",{className:"text-sm text-pk-content-primary",children:[j.rule3Pre,x,j.rule3Post]})]}),k[25]=j.rule3Post,k[26]=j.rule3Pre,k[27]=x,k[28]=h):h=k[28],k[29]!==h||k[30]!==c||k[31]!==p?(f=(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[c,p,h]}),k[29]=h,k[30]=c,k[31]=p,k[32]=f):f=k[32],k[33]!==b||k[34]!==j.acceptAndContinue?(y=(0,t.jsx)(Q.ModalFooter,{children:(0,t.jsx)(n.Button,{onClick:b,children:j.acceptAndContinue})}),k[33]=b,k[34]=j.acceptAndContinue,k[35]=y):y=k[35],k[36]!==r||k[37]!==f||k[38]!==y||k[39]!==o?(w=(0,t.jsxs)(t.Fragment,{children:[r,o,f,y]}),k[36]=r,k[37]=f,k[38]=y,k[39]=o,k[40]=w):w=k[40],w};function ey(e,s){return(0,t.jsxs)("div",{children:[s>0&&(0,t.jsx)("div",{className:"h-px bg-pk-border"}),(0,t.jsxs)("div",{className:"flex items-center justify-between p-3",children:[(0,t.jsx)("span",{className:"text-[13px] font-medium text-pk-content-secondary",children:e.label}),(0,t.jsx)("span",{className:"text-[13px] font-medium text-pk-content-primary text-right",children:e.value})]})]},e.label)}let ew=function(e){let r,n,a,o,l,c,d,u,p,m,x,h,f,y,w,k,j=(0,s.c)(44),{market:g}=e,v=(0,N.useTranslations)(),S=(0,Z.useMessages)().rewards.sponsorshipModal,{existingSponsorship:C}=g;if(!C)return null;let{dailyRate:D,endDate:T,endTime:R}=C,M=S.dailyRewardRate;j[0]!==D?(r=D.toFixed(2),j[0]=D,j[1]=r):r=j[1],j[2]!==v?(n=v("rewards.sponsor.perDay"),j[2]=v,j[3]=n):n=j[3];let A=`$${r}${n}`;j[4]!==S.dailyRewardRate||j[5]!==A?(a={label:M,value:A},j[4]=S.dailyRewardRate,j[5]=A,j[6]=a):a=j[6];let P=`${T} ${R}`;j[7]!==S.commitmentEnds||j[8]!==P?(o={label:S.commitmentEnds,value:P},j[7]=S.commitmentEnds,j[8]=P,j[9]=o):o=j[9],j[10]!==S.view?(l=(0,t.jsx)(i.Link,{href:`/portfolio?tab=${b.PortfolioTab.MarketRewards}`,className:"text-pk-content-accent-brand hover:underline",children:S.view}),j[10]=S.view,j[11]=l):l=j[11],j[12]!==S.trackSponsorshipProgress||j[13]!==l?(c={label:S.trackSponsorshipProgress,value:l},j[12]=S.trackSponsorshipProgress,j[13]=l,j[14]=c):c=j[14],j[15]!==a||j[16]!==o||j[17]!==c?(d=[a,o,c],j[15]=a,j[16]=o,j[17]=c,j[18]=d):d=j[18];let _=d;return j[19]!==S.sponsorRewards?(u=(0,t.jsx)(Q.ModalHeader,{children:(0,t.jsx)(Q.ModalTitle,{children:S.sponsorRewards})}),j[19]=S.sponsorRewards,j[20]=u):u=j[20],j[21]!==S.sponsorDescriptionBold?(p=(0,t.jsx)("strong",{className:"font-bold text-black dark:text-pk-content-accent-brand",children:S.sponsorDescriptionBold}),j[21]=S.sponsorDescriptionBold,j[22]=p):p=j[22],j[23]!==S.sponsorDescriptionPost||j[24]!==S.sponsorDescriptionPre||j[25]!==p?(m=(0,t.jsxs)(Q.ModalDescription,{children:[S.sponsorDescriptionPre,p,S.sponsorDescriptionPost]}),j[23]=S.sponsorDescriptionPost,j[24]=S.sponsorDescriptionPre,j[25]=p,j[26]=m):m=j[26],j[27]!==S.sponsorshipActive?(x=(0,t.jsx)("p",{className:"text-base font-bold text-pk-content-primary",children:S.sponsorshipActive}),j[27]=S.sponsorshipActive,j[28]=x):x=j[28],j[29]!==S.portfolioSponsorships?(h=(0,t.jsx)(i.Link,{href:`/portfolio?tab=${b.PortfolioTab.MarketRewards}`,className:"text-pk-content-accent-brand hover:underline",children:S.portfolioSponsorships}),j[29]=S.portfolioSponsorships,j[30]=h):h=j[30],j[31]!==S.reviewOrCancel||j[32]!==h?(f=(0,t.jsxs)("p",{className:"text-xs font-medium text-pk-content-primary text-center",children:[S.reviewOrCancel," ",h,"."]}),j[31]=S.reviewOrCancel,j[32]=h,j[33]=f):f=j[33],j[34]!==x||j[35]!==f?(y=(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[x,f]}),j[34]=x,j[35]=f,j[36]=y):y=j[36],j[37]!==_?(w=(0,t.jsx)("div",{className:"rounded-lg border border-pk-border",children:_.map(ey)}),j[37]=_,j[38]=w):w=j[38],j[39]!==u||j[40]!==m||j[41]!==y||j[42]!==w?(k=(0,t.jsxs)(t.Fragment,{children:[u,m,y,w]}),j[39]=u,j[40]=m,j[41]=y,j[42]=w,j[43]=k):k=j[43],k};var ek=e.i(444601),eb=e.i(137313),ej=e.i(680719),eg=e.i(539907),ev=e.i(110452),eN=e.i(602240),eS=e.i(84394),eC=e.i(40494),eD=e.i(218424),eT=e.i(463659),eR=e.i(900579),eM=e.i(643042),eA=e.i(780912);let eP=function({market:e,sponsorshipData:s,onUpdateData:r,onCancel:a,onContinue:i}){let l=(0,eT.useAmplitudeAnalytics)(),c=(0,N.useTranslations)(),m=(0,Z.useLocale)(),h=(0,Z.useMessages)().rewards.sponsorshipModal,{authenticated:f}=(0,S.useAccountContext)(["authenticated"]),{setOpen:y,setConnectorRoute:w}=(0,x.useSiwx)(),k=(0,ev.useUsGeoblockPrompt)("rewards"),{onBeginCheckout:b}=(0,eR.useFunkitContext)(),{proxyUsdcBalanceMetadata:j,trackedProxyUsdcBalance:g}=(0,eS.default)(),v=(0,eA.parseAmount)(s.amount),C=(0,eA.calculateDailyRate)(v,s.durationDays),D=(0,ek.addDays)(new Date,s.durationDays),T=(0,u.useCallback)(e=>{r({amount:(v+e).toString()})},[v,r]),R=(0,u.useCallback)(()=>{s.durationDays>1&&r({durationDays:s.durationDays-1})},[s.durationDays,r]),M=(0,u.useCallback)(()=>{s.durationDays<eM.MAX_DURATION_DAYS&&r({durationDays:s.durationDays+1})},[s.durationDays,r]),A=(0,eA.isAmountViableForDuration)(v,s.durationDays),P=(0,eA.getMinAmountForDuration)(s.durationDays),_=v>g.current,I=v>0&&!A,O=A&&!_,L=0===g.current,[E,$]=(0,u.useState)(!1),F=(0,u.useCallback)(()=>
1{if(k){a(),k();return}let e=Date.now();a(),(0,eD.markSignupPromptOpened)("rewards",{now:e,route:"login"}),l.trackEvent(eC.Events.SignupPromptOpened,(0,eD.getSignupPromptOpenedEventProperties)({source:"rewards",route:"login"})),w(p.ConnectorRoute.LOGIN),y(!0)},[l,a,k,w,y]),B=(0,u.useCallback)(()=>{a(),b()},[a,b]),H=(0,u.useMemo)(()=>f?L?{label:h.deposit,onClick:B,disabled:!1}:{label:h.continue,onClick:i,disabled:!O}:{label:h.logInToContinue,onClick:F,disabled:!1},[f,L,O,F,B,i,h]),z=1===s.durationDays?h.day:h.days;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Q.ModalHeader,{children:(0,t.jsx)(Q.ModalTitle,{children:h.sponsorRewards})}),(0,t.jsxs)(Q.ModalDescription,{children:[h.sponsorDescriptionPre,(0,t.jsx)("strong",{className:"font-bold text-black dark:text-pk-content-accent-brand",children:h.sponsorDescriptionBold}),h.sponsorDescriptionPost]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(eN.default,{src:e.market.image,alt:e.market.question,width:48,height:48,className:"rounded object-cover bg-pk-gray-300 shrink-0",style:{width:48,height:48}}),(0,t.jsx)("p",{className:"text-base font-semibold text-pk-content-primary leading-tight",children:e.market.question})]}),(0,t.jsx)("div",{className:"flex flex-col gap-4",children:(0,t.jsxs)("div",{className:"flex items-start justify-between",children:[(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("span",{className:"text-base font-medium text-pk-content-primary",children:h.amount}),(0,t.jsxs)("span",{className:"text-xs text-pk-content-secondary",children:[h.balance," ",j.currentBalance]})]}),(0,t.jsxs)("div",{className:"flex flex-col items-end gap-4",children:[(0,t.jsx)("input",{type:"text",inputMode:"decimal",value:s.amount?`$${s.amount}`:"",onChange:e=>{let t=e.target.value.replace(/^\$/,"");(""===t||/^\d*\.?\d*$/.test(t))&&r({amount:t})},placeholder:"$0",className:"text-[56px] font-bold leading-none text-pk-content-primary bg-transparent border-none outline-none text-right placeholder:text-pk-content-primary/30 w-full max-w-[220px]"}),(0,t.jsx)("div",{className:"flex items-center gap-1",children:[10,50,100].map(e=>(0,t.jsxs)(n.Button,{variant:"secondary",size:"sm",onClick:()=>T(e),children:["+$",e]},e))}),(0,t.jsx)("p",{className:`text-xs font-medium ${I?"text-pk-content-accent-red":"text-pk-content-tertiary"}`,children:I?h.minimumRequired.replace("{amount}",P.toFixed(2)).replace("{days}",String(s.durationDays)).replace("{daysLabel}",z):h.minimumSponsorship.replace("{amount}",String(eM.MIN_AMOUNT))})]})]})}),(0,t.jsx)("div",{className:"h-px bg-pk-border -mx-6"}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("span",{className:"text-base font-medium text-pk-content-primary",children:h.duration}),(0,t.jsxs)("span",{className:"text-xs text-pk-content-secondary",children:[s.durationDays," ",h.daysUnit]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(n.Button,{variant:"outline",size:"iconSm",onClick:R,disabled:s.durationDays<=1,"aria-label":c("rewards.aria.decreaseDuration"),children:(0,t.jsx)(eg.IconMinusOutline18,{size:18})}),(0,t.jsx)("span",{className:"w-10 text-center text-base font-bold text-pk-content-primary",children:s.durationDays}),(0,t.jsx)(n.Button,{variant:"outline",size:"iconSm",onClick:M,disabled:s.durationDays>=eM.MAX_DURATION_DAYS,"aria-label":c("rewards.aria.increaseDuration"),children:(0,t.jsx)(d.IconPlusOutline18,{size:18})})]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"rounded-lg border border-pk-border",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between p-3",children:[(0,t.jsx)("span",{className:"text-[13px] font-medium text-pk-content-secondary",children:h.dailyRewardRate}),(0,t.jsxs)("span",{className:"text-[13px] font-medium text-pk-content-primary",children:["$",C.toFixed(2),c("rewards.sponsor.perDay")]})]}),(0,t.jsx)("div",{className:"h-px bg-pk-border"}),(0,t.jsxs)("div",{className:"flex items-center justify-between p-3",children:[(0,t.jsx)("span",{className:"text-[13px] font-medium text-pk-content-secondary",children:h.commitmentEnds}),(0,t.jsx)("span",{className:"text-[13px] font-medium text-pk-content-primary",children:(0,q.format)(D,"MMM d, yyyy",{locale:(0,eb.getDateFnsLocale)(m)})})]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-center gap-1 py-1",children:[(0,t.jsx)(ej.IconCircleInfoFill18,{size:16,className:"text-pk-content-secondary shrink-0"}),(0,t.jsx)("span",{className:"text-xs font-medium text-pk-content-secondary",children:h.unusedFundsReturn})]})]}),(0,t.jsx)(Q.ModalFooter,{children:(0,t.jsx)(o.Tooltip,{content:I?h.sponsorshipMinPerDay.replace("{amount}",String(eM.MIN_AMOUNT)):h.insufficientBalance,className:"text-xs font-medium z-[260]",showArrow:!1,sideOffset:4,open:(_||I)&&H.disabled&&E,onOpenChange:$,children:(0,t.jsx)("span",{className:"block w-full",onMouseEnter:()=>$(!0),onMouseLeave:()=>$(!1),children:(0,t.jsx)(n.Button,{onClick:H.onClick,disabled:H.disabled,className:`w-full ${H.disabled?"pointer-events-none":""}`,children:H.label})})})})]})};var e_=e.i(190913),eI=e.i(308959),eO=e.i(340715);function eL(e,s){return(0,t.jsxs)("div",{children:[s>0&&(0,t.jsx)("div",{className:"h-px bg-pk-border"}),(0,t.jsxs)("div",{className:"flex items-center justify-between p-3",children:[(0,t.jsx)("span",{className:"text-[13px] font-medium text-pk-content-secondary",children:e.label}),(0,t.jsx)("span",{className:"text-[13px] font-medium text-pk-content-primary text-right",children:e.value})]})]},e.label)}
1let eE=function(e){let r,i,l,c,d,p,m,x,h,f,y,w,k,b,j,g,v,S,C,D,R,M,A=(0,s.c)(113),{market:P,sponsorshipData:_,onBack:I,onConfirm:O,isLoading:L}=e,E=(0,N.useTranslations)(),$=(0,Z.useLocale)(),F=(0,Z.useMessages)().rewards.sponsorshipModal,[B,H]=(0,u.useState)(!1);if(A[0]!==B||A[1]!==$||A[2]!==P.market.conditionId||A[3]!==P.market.question||A[4]!==F.dailyRate||A[5]!==F.day||A[6]!==F.days||A[7]!==F.duration||A[8]!==F.endDate||A[9]!==F.market||A[10]!==F.marketId||A[11]!==F.startDate||A[12]!==F.totalAmount||A[13]!==_.amount||A[14]!==_.durationDays||A[15]!==E){let e,s,n,a,u,h,f,y,w,k,b,j=(0,eA.parseAmount)(_.amount),g=(0,eA.calculateDailyRate)(j,_.durationDays),v=new Date,N=(0,ek.addDays)(v,_.durationDays),S=P.market.question,C=P.market.conditionId;A[24]!==C?(e=async()=>{try{await navigator.clipboard.writeText(C),H(!0),setTimeout(()=>H(!1),2e3)}catch(e){console.error("Failed to copy market ID:",e)}},A[24]=C,A[25]=e):e=A[25];let D=e,T=1===_.durationDays?F.day:F.days;A[26]!==S?(s=(0,t.jsx)("span",{className:"truncate min-w-0 max-w-[200px] inline-block text-right",children:S}),A[26]=S,A[27]=s):s=A[27],A[28]!==S||A[29]!==s?(n=(0,t.jsx)(o.Tooltip,{content:S,className:"z-[300]",children:s}),A[28]=S,A[29]=s,A[30]=n):n=A[30],A[31]!==F.market||A[32]!==n?(l={label:F.market,value:n},A[31]=F.market,A[32]=n,A[33]=l):l=A[33];let R=F.marketId;A[34]!==C?(a=C.slice(0,6),A[34]=C,A[35]=a):a=A[35],A[36]!==C?(u=C.slice(-4),A[36]=C,A[37]=u):u=A[37];let M=`${a}...${u}`;A[38]!==M?(h=(0,t.jsx)("span",{className:"font-mono",children:M}),A[38]=M,A[39]=h):h=A[39],A[40]!==E?(f=E("rewards.aria.copyMarketId"),A[40]=E,A[41]=f):f=A[41],A[42]!==B?(y=B?(0,t.jsx)(e_.IconCheckOutline18,{size:14,className:"text-pk-content-accent-green"}):(0,t.jsx)(eO.IconCopyOutline18,{size:14}),A[42]=B,A[43]=y):y=A[43],A[44]!==D||A[45]!==f||A[46]!==y?(w=(0,t.jsx)("button",{type:"button",onClick:D,"aria-label":f,className:"p-1 text-pk-content-secondary hover:text-pk-content-primary rounded transition-colors cursor-pointer",children:y}),A[44]=D,A[45]=f,A[46]=y,A[47]=w):w=A[47],A[48]!==h||A[49]!==w?(k=(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[h,w]}),A[48]=h,A[49]=w,A[50]=k):k=A[50],A[51]!==F.marketId||A[52]!==k?(c={label:R,value:k},A[51]=F.marketId,A[52]=k,A[53]=c):c=A[53];let I=`$${j}`;A[54]!==F.totalAmount||A[55]!==I?(d={label:F.totalAmount,value:I},A[54]=F.totalAmount,A[55]=I,A[56]=d):d=A[56];let O=`${_.durationDays} ${T}`;A[57]!==F.duration||A[58]!==O?(p={label:F.duration,value:O},A[57]=F.duration,A[58]=O,A[59]=p):p=A[59];let L=F.dailyRate,z=g.toFixed(2);A[60]!==E?(b=E("rewards.sponsor.perDay"),A[60]=E,A[61]=b):b=A[61];let V=`$${z}${b}`;A[62]!==F.dailyRate||A[63]!==V?(m={label:L,value:V},A[62]=F.dailyRate,A[63]=V,A[64]=m):m=A[64],x={label:F.startDate,value:(0,q.format)(v,"MMM d, yyyy",{locale:(0,eb.getDateFnsLocale)($)})},r=F.endDate,i=(0,q.format)(N,"MMM d, yyyy",{locale:(0,eb.getDateFnsLocale)($)}),A[0]=B,A[1]=$,A[2]=P.market.conditionId,A[3]=P.market.question,A[4]=F.dailyRate,A[5]=F.day,A[6]=F.days,A[7]=F.duration,A[8]=F.endDate,A[9]=F.market,A[10]=F.marketId,A[11]=F.startDate,A[12]=F.totalAmount,A[13]=_.amount,A[14]=_.durationDays,A[15]=E,A[16]=r,A[17]=i,A[18]=l,A[19]=c,A[20]=d,A[21]=p,A[22]=m,A[23]=x}else r=A[16],i=A[17],l=A[18],c=A[19],d=A[20],p=A[21],m=A[22],x=A[23];A[65]!==r||A[66]!==i?(h={label:r,value:i},A[65]=r,A[66]=i,A[67]=h):h=A[67],A[68]!==l||A[69]!==c||A[70]!==d||A[71]!==p||A[72]!==m||A[73]!==x||A[74]!==h?(f=[l,c,d,p,m,x,h],A[68]=l,A[69]=c,A[70]=d,A[71]=p,A[72]=m,A[73]=x,A[74]=h,A[75]=f):f=A[75];let z=f;return A[76]!==F.reviewTitle?(y=(0,t.jsx)(Q.ModalHeader,{children:(0,t.jsx)(Q.ModalTitle,{children:F.reviewTitle})}),A[76]=F.reviewTitle,A[77]=y):y=A[77],A[78]!==F.reviewDescription?(w=(0,t.jsx)(Q.ModalDescription,{children:F.reviewDescription}),A[78]=F.reviewDescription,A[79]=w):w=A[79],A[80]!==z?(k=(0,t.jsx)("div",{className:"rounded-lg border border-pk-border",children:z.map(eL)}),A[80]=z,A[81]=k):k=A[81],A[82]===Symbol.for("react.memo_cache_sentinel")?(b=(0,t.jsx)(eI.IconCircleWarningOutline18,{size:20,className:"text-pk-yellow-strong shrink-0 mt-0.5"}),A[82]=b):b=A[82],A[83]!==F.reviewWarningBold?(j=(0,t.jsx)("strong",{children:F.reviewWarningBold}),A[83]=F.reviewWarningBold,A[84]=j):j=A[84],A[85]!==F.learnMore?(g=(0,t.jsx)("a",{href:`${T.POLYMARKET_HELP_CENTER_LINK}/en/articles/13755867-sponsor-market-rewards`,target:"_blank",rel:"noopener noreferrer",className:"text-pk-yellow-strong underline",children:F.learnMore}),A[85]=F.learnMore,A[86]=g):g=A[86],A[87]!==F.reviewWarningPost||A[88]!==F.reviewWarningPre||A[89]!==j||A[90]!==g?(v=(0,t.jsxs)("div",{className:"flex items-start gap-2.5 p-4 bg-pk-yellow-subtle rounded-xl",children:[b,(0,t.jsxs)("p",{className:"text-sm font-medium text-pk-yellow-strong leading-normal",children:[F.reviewWarningPre,j,F.reviewWarningPost,g]})]}),A[87]=F.reviewWarningPost,A[88]=F.reviewWarningPre,A[89]=j,A[90]=g,A[91]=v):v=A[91],A[92]!==L||A[93]!==I||A[94]!==F.editOrder?(S=(0,t.jsx)(n.Button,{variant:"outline",onClick:I,disabled:L,children:F.editOrder}),A[92]=L,A[93]=I,A[94]=F.editOrder,A[95]=S):S=A[95],A[96]!==L||A[97]!==F.confirmOrder||A[98]!==F.confirming?(C=L?(0,t.jsxs)("span",{className:"flex items-center justify-center gap-2",children:[(0,t.jsx)(a.default,{className:"w-4 h-4 border-white/20 border-t-white/80"}),F.confirming]}):F.confirmOrder,A[96]=L,A[97]=F.confirmOrder,A[98]=F.confirming,A[99]=C):C=A[99],A[100]!==L||A[101]!==O||A[102]!==C?(D=(0,t.jsx)(n.Button,{onClick:O,disabled:L,children:C}),A[100]=L,A[101]=O,A[102]=C,A[103]=D):D=A[103],A[104]!==S||A[105]!==D?(R=(0,t.jsxs)(Q.ModalFooter,{children:[S,D]}),A[104]=S,A[105]=D,A[106]=R):R=A[106],A[107]!==y||A[108]!==w||A[109]!==k||A[110]!==v||A[111]!==R?(M=(0,t.jsxs)(t.Fragment,{children:[y,w,k,v,R]}),A[107]=y,A[108]=w,A[109]=k,A[110]=v,A[111]=R,A[112]=M):M=A[112],M};e.i(81971);var e$=e.i(626651);function eF(e,s){return(0,t.jsxs)("div",{children:[s>0&&(0,t.jsx)("div",{className:"h-px bg-pk-border"}),(0,t.jsxs)("div",{className:"flex items-center justify-between p-3",children:[(0,t.jsx)("span",{className:"text-[13px] font-medium text-pk-content-secondary",children:e.label}),(0,t.jsx)("span",{className:"text-[13px] font-medium text-pk-content-primary text-right",children:e.value})]})]},e.label)}
1let eB=function(e){let r,a,o,l,c,d,u,p,m,x,h,f,y,w,k,j,g=(0,s.c)(79),{market:v,sponsorshipData:S,onClose:C,onTrackProgress:D}=e,T=(0,N.useTranslations)(),R=(0,Z.useLocale)(),M=(0,Z.useMessages)().rewards.sponsorshipModal,A=(0,i.useRouter)().push;g[0]!==A||g[1]!==D?(r=()=>{D(),A(`/portfolio?tab=${b.PortfolioTab.MarketRewards}`)},g[0]=A,g[1]=D,g[2]=r):r=g[2];let P=r;if(g[3]!==R||g[4]!==v.market.question||g[5]!==M.contributionSuccess||g[6]!==M.dailyRate||g[7]!==M.day||g[8]!==M.days||g[9]!==M.duration||g[10]!==M.firstDistribution||g[11]!==M.market||g[12]!==M.sponsorship||g[13]!==M.sponsorshipLive||g[14]!==S.amount||g[15]!==S.durationDays||g[16]!==T){let e,s,r,n,i,m,x,h,f=(0,eA.parseAmount)(S.amount),y=(0,eA.calculateDailyRate)(f,S.durationDays);g[24]!==v.market.question?(e=(0,eA.truncateQuestion)(v.market.question),g[24]=v.market.question,g[25]=e):e=g[25];let w=e,k=(0,ek.addDays)(new Date,1);k.setUTCHours(0,0,0,0);let b=1===S.durationDays?M.day:M.days;g[26]!==M.market||g[27]!==w?(s={label:M.market,value:w},g[26]=M.market,g[27]=w,g[28]=s):s=g[28];let j=M.dailyRate,N=y.toFixed(2);g[29]!==T?(r=T("rewards.sponsor.perDay"),g[29]=T,g[30]=r):r=g[30];let C=`$${N}${r}`;g[31]!==M.dailyRate||g[32]!==C?(n={label:j,value:C},g[31]=M.dailyRate,g[32]=C,g[33]=n):n=g[33];let D=`${S.durationDays} ${b}`;g[34]!==M.duration||g[35]!==D?(i={label:M.duration,value:D},g[34]=M.duration,g[35]=D,g[36]=i):i=g[36];let A=M.firstDistribution,P=(0,q.format)(new e$.TZDate(k,"UTC"),"MMM d, yyyy HH:mm",{locale:(0,eb.getDateFnsLocale)(R)});g[37]!==T?(m=T("rewards.sponsor.utcSuffix"),g[37]=T,g[38]=m):m=g[38];let _=`${P} ${m}`;g[39]!==M.firstDistribution||g[40]!==_?(x={label:A,value:_},g[39]=M.firstDistribution,g[40]=_,g[41]=x):x=g[41],g[42]!==n||g[43]!==i||g[44]!==x||g[45]!==s?(h=[s,n,i,x],g[42]=n,g[43]=i,g[44]=x,g[45]=s,g[46]=h):h=g[46],a=h,g[47]!==M.sponsorship?(p=(0,t.jsx)(Q.ModalHeader,{children:(0,t.jsx)(Q.ModalTitle,{children:M.sponsorship})}),g[47]=M.sponsorship,g[48]=p):p=g[48],c="flex flex-col items-center",g[49]===Symbol.for("react.memo_cache_sentinel")?(d=(0,t.jsx)("div",{className:"flex items-center justify-center w-[30px] h-[30px] rounded-full bg-pk-green-500 mb-3",children:(0,t.jsx)(e_.IconCheckOutline18,{size:16,className:"text-white",strokeWidth:3})}),g[49]=d):d=g[49],g[50]!==M.sponsorshipLive?(u=(0,t.jsx)("h3",{className:"text-base font-semibold text-pk-content-primary",children:M.sponsorshipLive}),g[50]=M.sponsorshipLive,g[51]=u):u=g[51],o="text-xs font-medium text-pk-content-secondary max-w-[256px] text-center mt-1",l=M.contributionSuccess.replace("{amount}",f.toFixed(2)),g[3]=R,g[4]=v.market.question,g[5]=M.contributionSuccess,g[6]=M.dailyRate,g[7]=M.day,g[8]=M.days,g[9]=M.duration,g[10]=M.firstDistribution,g[11]=M.market,g[12]=M.sponsorship,g[13]=M.sponsorshipLive,g[14]=S.amount,g[15]=S.durationDays,g[16]=T,g[17]=a,g[18]=o,g[19]=l,g[20]=c,g[21]=d,g[22]=u,g[23]=p}else a=g[17],o=g[18],l=g[19],c=g[20],d=g[21],u=g[22],p=g[23];return g[52]!==o||g[53]!==l?(m=(0,t.jsx)("p",{className:o,children:l}),g[52]=o,g[53]=l,g[54]=m):m=g[54],g[55]!==c||g[56]!==d||g[57]!==u||g[58]!==m?(x=(0,t.jsxs)("div",{className:c,children:[d,u,m]}),g[55]=c,g[56]=d,g[57]=u,g[58]=m,g[59]=x):x=g[59],g[60]!==a?(h=(0,t.jsx)("div",{className:"rounded-lg border border-pk-border",children:a.map(eF)}),g[60]=a,g[61]=h):h=g[61],g[62]!==M.earlyResolveNote?(f=(0,t.jsx)("p",{className:"text-xs font-medium text-pk-content-secondary text-center",children:M.earlyResolveNote}),g[62]=M.earlyResolveNote,g[63]=f):f=g[63],g[64]!==C||g[65]!==M.returnToMarket?(y=(0,t.jsx)(n.Button,{variant:"outline",onClick:C,children:M.returnToMarket}),g[64]=C,g[65]=M.returnToMarket,g[66]=y):y=g[66],g[67]!==P||g[68]!==M.trackProgress?(w=(0,t.jsx)(n.Button,{onClick:P,children:M.trackProgress}),g[67]=P,g[68]=M.trackProgress,g[69]=w):w=g[69],g[70]!==y||g[71]!==w?(k=(0,t.jsxs)(Q.ModalFooter,{children:[y,w]}),g[70]=y,g[71]=w,g[72]=k):k=g[72],g[73]!==h||g[74]!==f||g[75]!==k||g[76]!==p||g[77]!==x?(j=(0,t.jsxs)(t.Fragment,{children:[p,x,h,f,k]}),g[73]=h,g[74]=f,g[75]=k,g[76]=p,g[77]=x,g[78]=j):j=g[78],j};function eq(e){return e.addPendingSponsorship}let eH=function(e){let r,n,a,o,i,l,c=(0,s.c)(30),{open:d,onOpenChange:p,market:m}=e,x=(0,Z.useMessages)().rewards.sponsorshipModal,h=(0,G.useToast)();c[0]===Symbol.for("react.memo_cache_sentinel")?(r=["proxyAddress"],c[
10]=r):r=c[0];let{proxyAddress:f}=(0,S.useAccountContext)(r),y=(0,F.usePendingSponsorshipsStore)(eq),{currentStep:w,sponsorshipData:b,goNext:j,goBack:g,reset:v,updateSponsorshipData:C}=function(){let e,t,r,n,a,o,i=(0,s.c)(12),[l,c]=(0,u.useState)("agreement");i[0]===Symbol.for("react.memo_cache_sentinel")?(e={amount:"",durationDays:5},i[0]=e):e=i[0];let[d,p]=(0,u.useState)(e),m=er.indexOf(l);i[1]!==m?(t=()=>{let e=m+1;e<er.length&&c(er[e])},i[1]=m,i[2]=t):t=i[2];let x=t;i[3]!==m?(r=()=>{let e=m-1;e>=0&&c(er[e])},i[3]=m,i[4]=r):r=i[4];let h=r;i[5]===Symbol.for("react.memo_cache_sentinel")?(n=()=>{c("agreement"),p({amount:"",durationDays:5})},i[5]=n):n=i[5];let f=n;i[6]===Symbol.for("react.memo_cache_sentinel")?(a=e=>{p(t=>({...t,...e}))},i[6]=a):a=i[6];let y=a;return i[7]!==l||i[8]!==h||i[9]!==x||i[10]!==d?(o={currentStep:l,sponsorshipData:d,goNext:x,goBack:h,reset:f,updateSponsorshipData:y},i[7]=l,i[8]=h,i[9]=x,i[10]=d,i[11]=o):o=i[11],o}(),{sponsor:D,reset:R,isLoading:M}=(()=>{let[e,t]=(0,u.useState)(!1),s=(0,N.useTranslations)(),{proxyAddress:r,walletMode:n}=(0,S.useAccountContext)(["proxyAddress","walletMode"]),{sendTransaction:a}=(0,k.default)(),{nonce:o,incrementNonce:i,refreshNonce:l}=(0,el.useDepositWallet)(),{chainId:c}=T.MATIC_CONFIG;return{sponsor:(0,u.useCallback)(async e=>{let{marketId:d,amount:u,durationDays:p,hasPastSponsorship:m}=e;if(!r)return{success:!1,error:s("rewards.sponsor.noProxyAddress")};if(!d||!u||p<=0)return{success:!1,error:s("rewards.sponsor.invalidParameters")};try{t(!0);let e=B.chainConfig[c]?.collateral;if(!e)throw Error(`No collateral address found for chainId ${c}`);let{adjustedAmountBigInt:l,startTime:x,endTime:h,rawAmountBigInt:f}=function(e,t){let s=(0,ei.parseUnits)(e,T.USDC_DECIMALS),r=60*Math.ceil((Math.floor(Date.now()/1e3)+60)/60),n=BigInt(24*t*60),a=r+60*Number(n),o=s/n;if(0n===o)throw Error(`Amount too low for duration: ${e} USDC over ${t} days results in zero rate per minute`);return{adjustedAmountBigInt:o*n,startTime:r,endTime:a,rawAmountBigInt:s}}(u,p),y=d.startsWith("0x")?d:`0x${d}`,w={to:e,data:(0,ea.encodeFunctionData)({abi:eo.erc20Abi,functionName:"approve",args:[B.REWARDS_CONTRACT_ADDRESS,f]}),value:"0",typeCode:en.CallType.Call},b={to:B.REWARDS_CONTRACT_ADDRESS,data:(0,ea.encodeFunctionData)({abi:L.RewardsAbi,functionName:"sponsor",args:[y,l,x,h]}),value:"0",typeCode:en.CallType.Call},j=[];if(m){let e=await (0,ep.resolveRewardsContract)(d);j.push({to:e.contractAddress,data:(0,ea.encodeFunctionData)({abi:L.RewardsAbi,functionName:"batchWithdraw",args:[[y],[r]]}),value:"0",typeCode:en.CallType.Call})}j.push(w,b);let g=(0,k.getTransactionType)(n),v=await a(g,j,0,T.Network.Matic,0,void 0,g===k.TransactionType.DepositWallet?o:void 0,"sponsor rewards",g===k.TransactionType.DepositWallet?r:void 0);if(g===k.TransactionType.DepositWallet&&await i(),!await Promise.race([(0,eu.waitTillMined)(v),new Promise((e,t)=>setTimeout(()=>t(Error(s("rewards.sponsor.txTimeout"))),12e4))]))throw Error(s("rewards.sponsor.txFailed"));let N=await v.getTransaction(),S=N[0]?.transactionHash||v.transactionHash,C=h-x,D=Number(l)/10**T.USDC_DECIMALS;return t(!1),{success:!0,txHash:S,adjustedAmount:D,ratePerSecond:C>0?D/C:0,startTime:x,endTime:h}}catch(a){if(t(!1),(0,k.getTransactionType)(n)===k.TransactionType.DepositWallet&&l(),(0,ec.isUserRejection)(a))return ed.logger.warn("[useSponsorRewardsCall] User rejected",{proxyAddress:r}),{success:!1,error:s("rewards.sponsor.signatureRejected")};let e=a?.message??s("rewards.sponsor.unknownError");return ed.logger.error("[useSponsorRewardsCall] Error",{error:e,proxyAddress:r}),{success:!1,error:e}}},[r,c,n,a,o,i,l,s]),reset:(0,u.useCallback)(()=>{t(!1)},[]),isLoading:e}})();!function(){let e,t,r,n,a=(0,s.c)(13),o=(0,X.useQueryClient)();a[0]===Symbol.for("react.memo_cache_sentinel")?(e=["proxyAddress","walletMode"],a[0]=e):e=a[0];let{proxyAddress:i,walletMode:l}=(0,S.useAccountContext)(e),{generateL2Headers:c}=(0,E.useL2Headers)(),d=(0,u.useRef)(null),p=(0,F.usePendingSponsorshipsStore)(es),m=(0,F.usePendingSponsorshipsStore)(et),x=(0,F.usePendingSponsorshipsStore)(ee);a[1]!==p||a[2]!==i?(t=i?p.filter(e=>e.proxyAddress.toLowerCase()===i.toLowerCase()):[],a[1]=p,a[2]=i,a[3]=t):t=a[3];let h=t.length>0;a[4]!==x||a[5]!==c||a[6]!==h||a[7]!==i||a[8]!==o||a[9]!==m||a[10]!==l?(r=()=>{if(!h||!i||!l){d.current&&(clearTimeout(d.current),d.current=null);return}let e=!1,t=async()=>{x();let e=await c({method:"GET",requestPath:$.ACTIVE_SPONSORSHIP_REQUEST_PATH});if(e)for(let t of F.usePendingSponsorshipsStore.getState().pendingSponsorships.filter(e=>e.proxyAddress.toLowerCase()===i.toLowerCase()))try{let s=await V(t.conditionId,l,e);null!==s.active_sponsorship&&(m(t.conditionId),o.setQueryData(["activeSponsorship",t.conditionId,i,l],s),o.invalidateQueries({queryKey:["marketSponsorship",t.conditionId]}),o.invalidateQueries({predicate:J}))}catch{}},s=()=>{e||(d.current=setTimeout(async()=>{await t(),s()},5e3))};return t().then(s),()=>{e=!0,d.current&&(clearTimeout(d.current),d.current=null)}},n=[h,i,l,x,m,o,c],a[4]=x,a[5]=c,a[6]=h,a[7]=i,a[8]=o,a[9]=m,a[10]=l,a[11]=r,a[12]=n):(r=a[11],n=a[12]),(0,u.useEffect)(r,n)}(),c[1]!==p||c[2]!==v||c[3]!==R?(n=e=>{e||(v(),R()),p(e)},c[1]=p,c[2]=v,c[3]=R,c[4]=n):n=c[4];let A=n;c[5]!==A?(a=()=>{A(!1)},c[5]=A,c[6]=a):a=c[6];let P=a;c[7]!==y||c[8]!==j||c[9]!==m||c[10]!==f||c[11]!==x||c[12]!==D||c[13]!==b||c[14]!==h?(o=async()=>
1{if(!m?.market?.conditionId)return void h.error(new Y.ToastBuilder().title(x.configError).description(x.noConditionId));let e=await D({marketId:m.market.conditionId,amount:b.amount,durationDays:b.durationDays,hasPastSponsorship:m.hasPastSponsorship});e.success?(y({conditionId:m.market.conditionId,proxyAddress:f||"",question:m.market.question,marketSlug:m.market.slug,image:m.market.image,amount:e.adjustedAmount??parseFloat(b.amount),durationDays:b.durationDays,startTime:e.startTime??0,endTime:e.endTime??0,ratePerSecond:e.ratePerSecond??0,txHash:e.txHash||"",createdAt:Date.now()}),j()):h.error(new Y.ToastBuilder().title(x.sponsorshipFailed).description(e.error||x.unexpectedError))},c[7]=y,c[8]=j,c[9]=m,c[10]=f,c[11]=x,c[12]=D,c[13]=b,c[14]=h,c[15]=o):o=c[15];let _=o;return m?(c[16]!==w||c[17]!==g||c[18]!==j||c[19]!==P||c[20]!==_||c[21]!==M||c[22]!==m||c[23]!==b||c[24]!==C?(i=(0,t.jsx)(Q.ModalContent,{children:m.isAlreadySponsored?(0,t.jsx)(ew,{market:m}):(0,t.jsxs)(t.Fragment,{children:["agreement"===w&&(0,t.jsx)(ef,{onAccept:j}),"input"===w&&(0,t.jsx)(eP,{market:m,sponsorshipData:b,onUpdateData:C,onCancel:P,onContinue:j}),"review"===w&&(0,t.jsx)(eE,{market:m,sponsorshipData:b,onBack:g,onConfirm:_,isLoading:M}),"success"===w&&(0,t.jsx)(eB,{market:m,sponsorshipData:b,onClose:P,onTrackProgress:P})]})}),c[16]=w,c[17]=g,c[18]=j,c[19]=P,c[20]=_,c[21]=M,c[22]=m,c[23]=b,c[24]=C,c[25]=i):i=c[25],c[26]!==A||c[27]!==d||c[28]!==i?(l=(0,t.jsx)(Q.Modal,{open:d,onOpenChange:A,children:i}),c[26]=A,c[27]=d,c[28]=i,c[29]=l):l=c[29],l):null};function ez(e){let r,o,l,c,d,u,p=(0,s.c)(35),{onSponsorClick:m,isUserSponsor:x,isPending:h,isLoading:f,showLoadingState:y,isRestricted:w,needsEnableTrading:k,onEnableTrading:j,isSponsorable:g,rewardMarketOverride:v,containerRef:S}=e,C=(0,N.useTranslations)(),D=(0,_.useRewardMarketContext)(),R=void 0!==v?v:D,M=(0,i.useRouter)().push;p[0]!==h||p[1]!==w||p[2]!==x||p[3]!==k||p[4]!==C?(r=(0,eA.getSponsorButtonConfig)({isRestricted:w,isPending:h,isUserSponsor:x,needsEnableTrading:k,t:C}),p[0]=h,p[1]=w,p[2]=x,p[3]=k,p[4]=C,p[5]=r):r=p[5];let{text:A}=r,P=!!R,I=y&&!R&&!g;p[6]!==h||p[7]!==w||p[8]!==M||p[9]!==k||p[10]!==j||p[11]!==m?(o=()=>{k?j():w||(h?M(`/portfolio?tab=${b.PortfolioTab.MarketRewards}`):m())},p[6]=h,p[7]=w,p[8]=M,p[9]=k,p[10]=j,p[11]=m,p[12]=o):o=p[12];let O=o;return p[13]!==P||p[14]!==R||p[15]!==C?(l=P?(0,t.jsxs)("div",{className:"p-4 pb-3",children:[(0,t.jsxs)("p",{className:"font-medium text-xs mb-2",children:[C("rewards.earnRewardsByPlacingLimitOrders")," ",(0,t.jsx)(i.Link,{href:`${T.POLYMARKET_HELP_CENTER_LINK}/en/articles/13364466-liquidity-rewards`,className:"text-pk-content-accent-brand inline-block",children:C("rewards.learnMore")})]}),(0,t.jsxs)("div",{className:"flex justify-between items-center h-5",children:[(0,t.jsx)("p",{className:"font-medium text-pk-content-secondary text-xs",children:C("rewards.rewards")}),(0,t.jsx)("div",{className:"flex items-center",children:Array.isArray(R?.rewardTokenLiquidities)?R.rewardTokenLiquidities.map(eV):null})]}),(0,t.jsxs)("div",{className:"flex justify-between items-center h-5",children:[(0,t.jsx)("p",{className:"font-medium text-pk-content-secondary text-xs",children:C("rewards.maxSpread")}),(0,t.jsx)("p",{className:"font-medium text-pk-content-secondary text-xs",children:`\xb1${Math.floor(R?.maxSpread??0)}\xa2`})]}),(0,t.jsxs)("div",{className:"flex justify-between items-center h-5",children:[(0,t.jsx)("p",{className:"font-medium text-pk-content-secondary text-xs",children:C("rewards.minShares")}),(0,t.jsx)("p",{className:"font-medium text-pk-content-secondary text-xs",children:R.minSize})]})]}):null,p[13]=P,p[14]=R,p[15]=C,p[16]=l):l=p[16],p[17]!==I||p[18]!==C?(c=I?(0,t.jsxs)("div",{className:"flex items-center gap-2 p-4",children:[(0,t.jsx)(a.default,{className:"w-3 h-3 border-black/10 border-t-black/60 dark:border-white/20 dark:border-t-white/80"}),(0,t.jsx)("p",{className:"text-body-xs font-medium text-pk-content-secondary",children:C("rewards.sponsor.loading")})]}):null,p[17]=I,p[18]=C,p[19]=c):c=p[19],p[20]!==A||p[21]!==O||p[22]!==f||p[23]!==h||p[24]!==w||p[25]!==g||p[26]!==k||p[27]!==R||p[28]!==C?(d=g&&(0,t.jsxs)(t.Fragment,{children:[R&&(0,t.jsx)("div",{className:"h-px bg-pk-grouped-elevated"}),(0,t.jsxs)("div",{className:"flex flex-col gap-3 p-4",children:[(0,t.jsxs)("p",{className:"font-medium text-xs",children:[C("rewards.sponsor.attractLiquidity")," ",(0,t.jsx)("a",{href:`${T.POLYMARKET_HELP_CENTER_LINK}/en/articles/13755867-sponsor-market-rewards`,target:"_blank",rel:"noopener noreferrer",className:"text-pk-content-accent-brand inline-block",children:C("rewards.sponsor.learnMore")})]}),(0,t.jsx)(n.Button,{size:"sm",onClick:O,disabled:!k&&(f||w),className:"w-full",children:f?(0,t.jsxs)("span",{className:"flex items-center justify-center gap-1.5",children:[(0,t.jsx)(a.default,{className:"w-3 h-3 border-white/20 border-t-white/80"}),(0,t.jsx)("span",{children:C("rewards.sponsor.loading")})]}):h?(0,t.jsxs)("span",{className:"flex items-center justify-center gap-1.5",children:[(0,t.jsx)(a.default,{className:"w-3 h-3 border-white/20 border-t-white/80"}),(0,t.jsx)("span",{children:C("rewards.sponsor.trackOrder")})]}):A}),w&&(0,t.jsxs)("p",{className:"text-[11px] text-pk-content-secondary",children:[C("rewards.sponsor.notAvailableInRegion")," ",(0,t.jsx)(i.Link,{href:T.POLYMARKET_TOS_LINK,className:"text-pk-content-accent-brand hover:underline",target:"_blank",rel:"noopener noreferrer",children:C("rewards.sponsor.seeTerms")})]})]})]}),p[20]=A,p[21]=O,p[22]=f,p[23]=h,p[24]=w,p[25]=g,p[26]=k,p[27]=R,p[28]=C,p[29]=d):d=p[29],p[30]!==S||p[31]!==l||p[32]!==c||p[33]!==d?(u=(0,t.jsxs)("div",{ref:S,className:"w-[250px] rounded-lg",children:[l,c,d]}),p[30]=S,p[31]=l,p[32]=c,p[33]=d,p[34]=u):u=p[34],u}function eV(e){let{symbol:s}=e.rewardToken,r=parseFloat(e?.clobTokenSupply??"0");return(0,t.jsxs)("div",{className:"ml-2 flex items-center justify-center",children:[P({symbol:s},12),(0,t.jsx)("p",{className:"ml-0.5 text-xs text-pk-content-secondary",children:(0,R.formatClobTokenSupply)(r.toString())})]},`${e.clobTokenSupply}-${s}`)}e.s(["default",0,eH],20427);
1let eW=(0,u.forwardRef)(function(e,r){let a,o,i,u,p,m,x,h,f,y,w=(0,s.c)(30);w[0]!==e?({asIcon:a,compact:i,className:o,...u}=e,w[0]=e,w[1]=a,w[2]=o,w[3]=i,w[4]=u):(a=w[1],o=w[2],i=w[3],u=w[4]);let k=(0,N.useTranslations)();if(a){let e,s,a;w[5]!==k?(e=k("rewards.rewards"),w[5]=k,w[6]=e):e=w[6];let i=`text-pk-content-secondary w-7 h-7 hover:bg-pk-hover-overlay-darker${o?` ${o}`:""}`;return w[7]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)(c.IconGiftOutline18,{size:16}),w[7]=s):s=w[7],w[8]!==r||w[9]!==e||w[10]!==i||w[11]!==u?(a=(0,t.jsx)(n.Button,{ref:r,"aria-label":e,variant:"ghost",size:"iconSm",className:i,...u,children:s}),w[8]=r,w[9]=e,w[10]=i,w[11]=u,w[12]=a):a=w[12],a}let b=i?"gap-0.5 px-1.5 h-6":"gap-1 px-2 h-7";w[13]!==o||w[14]!==b?(p=(0,l.cn)("relative overflow-hidden flex items-center rounded-md cursor-pointer hover:bg-pk-hover-overlay-darker transition-colors",b,o),w[13]=o,w[14]=b,w[15]=p):p=w[15];let j=i?12:14;w[16]!==j?(m=(0,t.jsx)(d.IconPlusOutline18,{size:j,className:"text-[#1652F0] dark:text-[#6AA4FF]"}),w[16]=j,w[17]=m):m=w[17];let g=`${i?"text-xs":"text-sm"} font-semibold select-none cursor-pointer bg-gradient-to-r from-[#1652F0] to-[#9B51E0] dark:from-[#6AA4FF] dark:to-[#C08BFF] bg-clip-text text-transparent`;return w[18]!==k?(x=k("rewards.rewards"),w[18]=k,w[19]=x):x=w[19],w[20]!==g||w[21]!==x?(h=(0,t.jsx)("span",{className:g,children:x}),w[20]=g,w[21]=x,w[22]=h):h=w[22],w[23]===Symbol.for("react.memo_cache_sentinel")?(f=(0,t.jsx)("span",{className:"pointer-events-none absolute inset-0 bg-gradient-to-r from-transparent via-white/60 dark:via-white/10 to-transparent",style:{animation:"rewards-shimmer 2.5s ease-in-out infinite"}}),w[23]=f):f=w[23],w[24]!==r||w[25]!==p||w[26]!==m||w[27]!==h||w[28]!==u?(y=(0,t.jsxs)("button",{ref:r,type:"button",className:p,...u,children:[m,h,f]}),w[24]=r,w[25]=p,w[26]=m,w[27]=h,w[28]=u,w[29]=y):y=w[29],y});function eK(e){let t,n,a,o,i,l,c,d,u,b=(0,s.c)(52),{activeMarket:v,contextRewardMarket:N}=e,T=v?.conditionId;b[0]!==T?(t=j.queryKeys[g.QueryKey.Rewards].rewardMarket(T??""),b[0]=T,b[1]=t):t=b[1];let M=!!T;b[2]!==t.queryKey||b[3]!==M?(n={queryKey:t.queryKey,queryFn:y.getSingleRewardFetcher,enabled:M,staleTime:3e4,retry:2,retryDelay:5e3},b[2]=t.queryKey,b[3]=M,b[4]=n):n=b[4];let{data:A}=(0,r.useQuery)(n),P=(0,D.useServerReferenceTime)();A?.data,b[5]!==N||b[6]!==A?.data||b[7]!==P?(a=(0,R.fromV4toRewardMarkets)(A?.data,P)?.[0]??N,b[5]=N,b[6]=A?.data,b[7]=P,b[8]=a):a=b[8];let _=a,I=(0,w.usePermissions)();b[9]===Symbol.for("react.memo_cache_sentinel")?(o=["authenticated","authenticationType","walletMode","baseAddress"],b[9]=o):o=b[9];let{authenticated:O,authenticationType:L,walletMode:E,baseAddress:$}=(0,S.useAccountContext)(o),F=O&&!I.canBuy,{isSafeDeployed:B}=(0,m.useSafe)(),{setOnboardingRoute:q,setOpen:H,setRoute:z}=(0,x.useSiwx)(),{setShowApprovalModal:V}=(0,C.useModalStore)(),{keyNeeded:U,hasStoredCredential:Q,clobNull:G,clobCheckSaysNeeded:Y}=(0,h.useEnableTradingKeyState)();b[10]!==O||b[11]!==L||b[12]!==B||b[13]!==E?(i=O&&"magic"!==L&&(0,k.requiresWalletDeployment)(E)&&!B,b[10]=O,b[11]=L,b[12]=B,b[13]=E,b[14]=i):i=b[14];let Z=i,X=O&&U,J=Z||X;b[15]!==L||b[16]!==$||b[17]!==Y||b[18]!==G||b[19]!==Q||b[20]!==Z||b[21]!==q||b[22]!==V||b[23]!==H||b[24]!==z||b[25]!==E?(l=()=>{Z?(z(p.AuthRoute.ONBOARDING),q(p.OnboardingRoute.ENABLEEOATRADING),H(!0)):((0,f.logEnableTradingModalShown)({surface:"rewards_tooltip",baseAddress:$,hasContextApiKey:Q,clobNull:G,walletMode:E,authenticationType:L,keyNeeded:Y,allowanceNeeded:!1,suppressed:!1}),V(!0))},b[15]=L,b[16]=$,b[17]=Y,b[18]=G,b[19]=Q,b[20]=Z,b[21]=q,b[22]=V,b[23]=H,b[24]=z,b[25]=E,b[26]=l):l=b[26];let ee=l;b[27]!==T?(c={conditionId:T},b[27]=T,b[28]=c):c=b[28];let{ref:et,isLoading:es,isUserSponsor:er,isPending:en,hasPastSponsorship:ea,userSponsorship:eo,isSponsorable:ei,isInitialLoadComplete:el}=K(c);e:{let e,t;if(!v){d=null;break e}if(b[29]!==v)e={market:{conditionId:v.conditionId,question:v.question,image:v.image,slug:v.slug}},b[29]=v,b[30]=e;else e=b[30];let s=e;if(er&&eo){let e,t;b[31]!==eo?(e=W(eo),b[31]=eo,b[32]=e):e=b[32],b[33]!==s||b[34]!==ea||b[35]!==e?(t={...s,isAlreadySponsored:!0,hasPastSponsorship:ea,existingSponsorship:e},b[33]=s,b[34]=ea,b[35]=e,b[36]=t):t=b[36],d=t;break e}b[37]!==s||b[38]!==ea?(t={...s,hasPastSponsorship:ea},b[37]=s,b[38]=ea,b[39]=t):t=b[39],d=t}let ec=d,ed=(!T||void 0!==A)&&el;return b[40]!==ei||b[41]!==ee||b[42]!==ed||b[43]!==es||b[44]!==en||b[45]!==F||b[46]!==er||b[47]!==J||b[48]!==et||b[49]!==_||b[50]!==ec?(u={ref:et,rewardMarket:_,isLoading:es,isUserSponsor:er,isPending:en,isRestricted:F,needsEnableTrading:J,handleEnableTrading:ee,canSponsorMarket:ei,sponsorableMarket:ec,isDataReady:ed},b[40]=ei,b[41]=ee,b[42]=ed,b[43]=es,b[44]=en,b[45]=F,b[46]=er,b[47]=J,b[48]=et,b[49]=_,b[50]=ec,b[51]=u):u=b[51],u}function eU(e){let r,n,a,l,c,d,p,m,x,h,f=(0,s.c)(39),{asIcon:y,compact:w,activeMarketProp:k,contextRewardMarket:j,contextActiveMarket:g,setShouldShowRewardOverlay:N}=e,S=void 0!==y&&y,C=void 0!==w&&w,[D,T]=(0,u.useState)(!1),R=k??g;f[0]!==R||f[1]!==j?(r={activeMarket:R,contextRewardMarket:j},f[0]=R,f[1]=j,f[2]=r):r=f[2];let{ref:M,rewardMarket:A,isLoading:P,isUserSponsor:_,isPending:I,isRestricted:O,needsEnableTrading:L,handleEnableTrading:E,canSponsorMarket:$,sponsorableMarket:F}=eK(r),B=(0,i.useRouter)().push;f[3]!==$||f[4]!==E||f[5]!==I||f[6]!==O||f[7]!==B||f[8]!==L?(n=()=>{(0,v.isNarrowViewport)()||!$||(L?E():O||(I?B(`/portfolio?tab=${b.PortfolioTab.MarketRewards}`):T(!0)))},f[3]=$,f[4]=E,f[5]=I,f[6]=O,f[7]=B,f[8]=L,f[9]=n):n=f[9];let q=n;f[10]!==N?(a=e=>{N(e)},f[10]=N,f[11]=a):a=f[11];let H=a,z=!!A||$;return R&&z?(f[12]===Symbol.for("react.memo_cache_sentinel")?(l=()=>T(!0),f[12]=l):l=f[12],f[13]!==$||f[14]!==E||f[15]!==P||f[16]!==I||f[17]!==O||f[18]!==_||f[19]!==L||f[20]!==A?(c=(0,t.jsx)(ez,{onSponsorClick:l,isUserSponsor:_,isPending:I,isLoading:P,showLoadingState:!1,isRestricted:O,needsEnableTrading:L,onEnableTrading:E,isSponsorable:$,rewardMarketOverride:A}),f[13]=$,f[14]=E,f[15]=P,f[16]=I,f[17]=O,f[18]=_,f[19]=L,f[20]=A,f[21]=c):c=f[21],f[22]!==S||f[23]!==C||f[24]!==q?(d=(0,t.jsx)(eW,{asIcon:S,compact:C,onClick:q}),f[22]=S,f[23]=C,f[24]=q,f[25]=d):d=f[25],f[26]!==H||f[27]!==c||f[28]!==d?(p=(0,t.jsx)(o.Tooltip,{onOpenChange:H,mobileSupport:!0,className:"p-0 !border-pk-content-accent-brand !z-[225]",showArrow:!1,content:c,children:d}),f[26]=H,f[27]=c,f[28]=d,f[29]=p):p=f[29],f[30]!==M||f[31]!==p?(m=(0,t.jsx)("div",{ref:M,children:p}),f[30]=M,f[31]=p,f[32]=m):m=f[32],f[33]!==D||f[34]!==F?(x=(0,t.jsx)(eH,{open:D,onOpenChange:T,market:F}),f[33]=D,f[34]=F,f[35]=x):x=f[35],f[36]!==m||f[37]!==x?(h=(0,t.jsxs)(t.Fragment,{children:[m,x]}),f[36]=m,f[37]=x,f[38]=h):h=f[38],h):null}function eQ(e){let r,n,a,o=(0,s.c)(18),{activeMarket:i,contextRewardMarket:l,onSponsorClick:c}=e;o[0]!==i||o[1]!==l?(r={activeMarket:i,contextRewardMarket:l},o[0]=i,o[1]=l,o[2]=r):r=o[2];let{ref:d,rewardMarket:u,isLoading:p,isUserSponsor:m,isPending:x,isRestricted:h,needsEnableTrading:f,handleEnableTrading:y,canSponsorMarket:w,sponsorableMarket:k,isDataReady:b}=eK(r);o[3]!==c||o[4]!==k?(n=()=>{c(k)},o[3]=c,o[4]=k,o[5]=n):n=o[5];let j=n,g=!b;return o[6]!==w||o[7]!==y||o[8]!==j||o[9]!==p||o[10]!==x||o[11]!==h||o[12]!==m||o[13]!==f||o[14]!==d||o[15]!==u||o[16]!==g?(a=(0,t.jsx)(ez,{containerRef:d,onSponsorClick:j,isUserSponsor:m,isPending:x,isLoading:p,showLoadingState:g,isRestricted:h,needsEnableTrading:f,onEnableTrading:y,isSponsorable:w,rewardMarketOverride:u}),o[6]=w,o[7]=y,o[8]=j,o[9]=p,o[10]=x,o[11]=h,o[12]=m,o[13]=f,o[14]=d,o[15]=u,o[16]=g,o[17]=a):a=o[17],a}function eG(e){let r,n,a,i,l,c,d,p,m=(0,s.c)(25),{asIcon:x,compact:h,activeMarketProp:f,contextRewardMarket:y,contextActiveMarket:w,openRewardsTooltipId:k,setOpenRewardsTooltipId:b,setShouldShowRewardOverlay:j}=e,g=void 0!==x&&x,v=void 0!==h&&h,N=f??w,S=N?.conditionId??N?.slug??null,C=!!S&&null!==k&&k===S,[D,T]=(0,u.useState)(!1),[R,M]=(0,u.useState)(null);m[0]!==k||m[1]!==b||m[2]!==j||m[3]!==S?(r=e=>{e?S&&b(S):S&&k===S&&b(null),j(e)},m[0]=k,m[1]=b,m[2]=j,m[3]=S,m[4]=r):r=m[4];let A=r;m[5]===Symbol.for("react.memo_cache_sentinel")?(n=e=>{M(e),T(!0)},m[5]=n):n=m[5];let P=n;m[6]===Symbol.for("react.memo_cache_sentinel")?(a=e=>{T(e),e||M(null)},m[6]=a):a=m[6];let _=a;return N?(m[7]!==N||m[8]!==y||m[9]!==C?(i=C?(0,t.jsx)(eQ,{activeMarket:N,contextRewardMarket:y,onSponsorClick:P}):null,m[7]=N,m[8]=y,m[9]=C,m[10]=i):i=m[10],m[11]!==g||m[12]!==v?(l=(0,t.jsx)(eW,{asIcon:g,compact:v}),m[11]=g,m[12]=v,m[13]=l):l=m[13],m[14]!==A||m[15]!==C||m[16]!==i||m[17]!==l?(c=(0,t.jsx)(o.Tooltip,{open:C,delayDuration:0,onOpenChange:A,mobileSupport:!0,className:"p-0 !border-pk-content-accent-brand !z-[225]",showArrow:!1,content:i,
1children:l}),m[14]=A,m[15]=C,m[16]=i,m[17]=l,m[18]=c):c=m[18],m[19]!==D||m[20]!==R?(d=(0,t.jsx)(eH,{open:D,onOpenChange:_,market:R}),m[19]=D,m[20]=R,m[21]=d):d=m[21],m[22]!==c||m[23]!==d?(p=(0,t.jsxs)(t.Fragment,{children:[c,d]}),m[22]=c,m[23]=d,m[24]=p):p=m[24],p):null}function eY(e){let r,n=(0,s.c)(4);if(e.lazyLoad){let s;return n[0]!==e?(s=(0,t.jsx)(eG,{...e}),n[0]=e,n[1]=s):s=n[1],s}return n[2]!==e?(r=(0,t.jsx)(eU,{...e}),n[2]=e,n[3]=r):r=n[3],r}function eZ(e){let r,n=(0,s.c)(7),a=(0,_.useRewardMarketContext)(),o=(0,_.useRewardActiveMarketContext)(),i=(0,_.useRewardOpenTooltipIdContext)()??null,l=(0,_.useRewardOpenTooltipIdSetterContext)()??eX,c=(0,_.useRewardOverlaySetterContext)(),d=a??null;return n[0]!==o||n[1]!==i||n[2]!==e||n[3]!==l||n[4]!==c||n[5]!==d?(r=(0,t.jsx)(eY,{...e,contextRewardMarket:d,contextActiveMarket:o,openRewardsTooltipId:i,setOpenRewardsTooltipId:l,setShouldShowRewardOverlay:c}),n[0]=o,n[1]=i,n[2]=e,n[3]=l,n[4]=c,n[5]=d,n[6]=r):r=n[6],r}function eX(){}function eJ(e){let r,n=(0,s.c)(5),a=(0,_.useRewardOpenTooltipIdContext)(),o=(0,_.useRewardOpenTooltipIdSetterContext)(),[i,l]=(0,u.useState)(null),c=(0,_.useRewardOverlaySetterContext)(),d=a??i,p=o??l;return n[0]!==d||n[1]!==e||n[2]!==p||n[3]!==c?(r=(0,t.jsx)(eY,{...e,openRewardsTooltipId:d,setOpenRewardsTooltipId:p,setShouldShowRewardOverlay:c}),n[0]=d,n[1]=e,n[2]=p,n[3]=c,n[4]=r):r=n[4],r}let e0=(0,u.memo)(function(e){let r,n=(0,s.c)(4);if(void 0!==e.activeMarketProp){let s;return n[0]!==e?(s=(0,t.jsx)(eJ,{...e}),n[0]=e,n[1]=s):s=n[1],s}return n[2]!==e?(r=(0,t.jsx)(eZ,{...e}),n[2]=e,n[3]=r):r=n[3],r});e.s(["default",0,e0],977117)}]);

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.