PageSourceSearch

https://agdex.io/_next/static/chunks/pages/rebate/myReferrerInfoWidget-0d7c129e1b4293c3.js

js agdex.io collected 2026-10-08 07:27:50 UTC 6,063 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4390],{9230:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/rebate/myReferrerInfoWidget",function(){return n(7971)}])},4282:function(e,t,n){"use strict";var l=n(4529);let s=(0,l.Ue)(e=>({actionCount:0,setActionCount:t=>e({actionCount:t})}));t.Z=s},9663:function(e,t,n){"use strict";n.d(t,{d:function(){return u},z:function(){return d}});var l=n(5893),s=n(7294),o=n(8426),i=n(5139),a=n(6616);let u=(0,i.j)("inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none ring-offset-background",{variants:{variant:{default:"bg-agdexMain text-primary-foreground hover:bg-agdexMain-foreground",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"underline-offset-4 hover:underline text-primary",green:"bg-0xgreen text-0xgreen-foreground hover:bg-0xgreen/90",red:"bg-0xred text-0xred-foreground hover:bg-0xred/90",yellow:"bg-agdexMain text-agdexMain-foreground hover:bg-agdexMain/90"},size:{default:"h-10 py-2 px-4",sm:"h-9 px-3 rounded-md",lg:"h-11 px-8 rounded-md",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),d=s.forwardRef((e,t)=>{let{className:n,variant:s,size:i,asChild:d=!1,...c}=e,f=d?o.g7:"button";return(0,l.jsx)(f,{className:(0,a.cn)(u({variant:s,size:i,className:n})),ref:t,...c,style:{borderRadius:"10px",height:"40px",fontSize:"16px"}})});d.displayName="Button"},293:function(e,t,n){"use strict";n.d(t,{I:function(){return i}});var l=n(5893),s=n(7294),o=n(6616);let i=s.forwardRef((e,t)=>{let{className:n,type:s,...i}=e;return(0,l.jsx)("input",{type:s,className:(0,o.cn)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
1ing-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 text-left placeholder:text-[#979797]",n),ref:t,...i})});i.displayName="Input"},7971:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return MyReferrerInfoWidget}});var l=n(5893),s=n(7294),o=n(9522),i=n(4282),a=n(6427),u=n(377),d=n(9663),c=n(1731),f=n(293),x=n(5367),g=n(361);function MyReferrerInfoWidget(){let[e,t]=(0,s.useState)(""),{account:n,wallet:b,signAndSubmitTransaction:v}=(0,a.Os)(),[p,h]=(0,s.useState)(""),{actionCount:m,setActionCount:y}=(0,i.Z)(),checkReferrer=async()=>{try{let t=(null==n?void 0:n.address)||"",l=await g.aptos.view({payload:{function:"".concat(x._,"::market::get_referrer"),typeArguments:[],functionArguments:[t]}});if(l&&l.length>0){var e;h((null===(e=l[0])||void 0===e?void 0:e.toString())||"")}else h("")}catch(e){h("")}};(0,s.useEffect)(()=>{n&&checkReferrer()},[n,m]);let handleAddNewReferral=async()=>{let t=(0,o.Ii)(x._,"market","add_new_referral"),l=await v({sender:null==n?void 0:n.address,data:{function:t,typeArguments:[],functionArguments:[e]}}),s=await g.aptos.waitForTransaction({transactionHash:l.hash});"Executed successfully"===s.vm_status&&((0,u.yv)("Executed successfully",{variant:"success"}),y(m+1))};return(0,l.jsxs)(c.Zb,{className:"flex flex-col justify-between w-full rounded-lg",children:[(0,l.jsx)("span",{className:"mb-6 text-lg font-semibold text-white",children:"Bind a Rebate Code"}),(0,l.jsxs)("div",{className:"flex flex-col justify-between w-full gap-3 mb-3 xl:flex-row",children:[""===p&&(0,l.jsxs)("div",{className:"flex flex-row items-center w-full xl:w-2/5 pl-5 pr-3 py-2 bg-[#ffffff0b] rounded-[10px] justify-between",children:[(0,l.jsx)(f.I,{className:"flex-1 px-0 border-none",placeholder:"".concat(""!==p?"Already Has a Referrer":"Enter Your Rebate Code"),value:e,disabled:""!==p,onChange:e=>{t(e.target.value)}}),(0,l.jsx)("div",{className:"flex flex-row items-center cursor-pointer",children:(0,l.jsx)(d.z,{className:"w-full font-bold bg-agdexMain ",onClick:handleAddNewReferral,children:"Apply"})})]}),(0,l.jsx)("div",{className:"flex w-full ".concat(""!==p?"w-full":"xl:w-3/5"),children:(0,l.jsxs)("div",{className:"border-none px-5 py-2 w-full bg-[#ffffff0b] focus-visible:none focus:border-none focus:ring-0 focus:ring-[#ffffff00] rounded-[10px] flex flex-row items-center justify-between",children:[(0,l.jsx)("span",{className:"text-white",children:"Invited By"}),(0,l.jsx)("div",{className:"flex flex-row items-center gap-2",children:(0,l.jsx)("span",{className:"",children:"".concat(p?p.slice(0,7)+"..."+p.slice(p.length-6,p.length):"-")})})]})})]})]})}},5139:function(e,t,n){"use strict";n.d(t,{j:function(){return cva}});let falsyToString=e=>"boolean"==typeof e?"".concat(e):0===e?"0":e,cx=function(){for(var e,t,n=0,l="";n<arguments.length;)(e=arguments[n++])&&(t=function r(e){var t,n,l="";if("string"==typeof e||"number"==typeof e)l+=e;else if("object"==typeof e){if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=r(e[t]))&&(l&&(l+=" "),l+=n);else for(t in e)e[t]&&(l&&(l+=" "),l+=t)}return l}(e))&&(l&&(l+=" "),l+=t);return l},cva=(e,t)=>n=>{var l;if((null==t?void 0:t.variants)==null)return cx(e,null==n?void 0:n.class,null==n?void 0:n.className);let{variants:s,defaultVariants:o}=t,i=Object.keys(s).map(e=>{let t=null==n?void 0:n[e],l=null==o?void 0:o[e];if(null===t)return null;let i=falsyToString(t)||falsyToString(l);return s[e][i]}),a=n&&Object.entries(n).reduce((e,t)=>{let[n,l]=t;return void 0===l||(e[n]=l),e},{}),u=null==t?void 0:null===(l=t.compoundVariants)||void 0===l?void 0:l.reduce((e,t)=>{let{class:n,className:l,...s}=t;return Object.entries(s).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...o,...a}[t]):({...o,...a})[t]===n})?[...e,n,l]:e},[]);return cx(e,i,u,null==n?void 0:n.class,null==n?void 0:n.className)}}},function(e){e.O(0,[9774,2888,179],function(){return e(e.s=9230)}),_N_E=e.O()}]);

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.