1import{cX as z,dg as q,eD as $,cC as r,cB as Y,ey as te,cO as k,cM as c,cL as s,cA as e,ex as d,f7 as oe,cT as ie,cU as le,cN as W}from"./index-9KhVBA3o.js";import{a as Z,b as K,t as Q}from"./contracts-DcbVhOqj.js";import{u as V}from"./useWriteContract-DfT8mixU.js";import{u as G}from"./useReadContract-BsUCFnFK.js";import{h as de,W as ce}from"./wallet-DcD4y88u.js";import{p as me}from"./parseEther-BR--Wm7B.js";import{S as ue,T as xe}from"./target-CHJIeFg3.js";import{A as ae}from"./activity-C5GSHlhQ.js";import{U as ge}from"./users-HExEu4aq.js";import{g as he}from"./trading-data-api-l1YzUZUd.js";import{T as pe}from"./transaction-table-BOXvR88b.js";import{u as be}from"./useBalance-DxPsP13Y.js";import"./useMutation-BJFw70Ak.js";import"./useChainId-B2YbwM_m.js";import"./index-DNNlT2wF.js";import"./index-tas-ICUJ.js";import"./react-select.esm-CZv0xfa1.js";import"./typeof-QjJsDpFa.js";import"./floating-ui.dom-8Yxafbyv.js";import"./long-arrow-right-DNqb3VIu.js";import"./sparkles-BBxe_HPj.js";import"./chevron-down-esj90GQF.js";import"./trending-up-CQO5yCA7.js";const fe=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],ve=z("ArrowUp",fe);const we=[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M6 12h.01M18 12h.01",key:"113zkx"}]],je=z("Banknote",we);const Ne=[["path",{d:"M18 7V5a1 1 0 0 0-1-1H6.5a.5.5 0 0 0-.4.8l4.5 6a2 2 0 0 1 0 2.4l-4.5 6a.5.5 0 0 0 .4.8H17a1 1 0 0 0 1-1v-2",key:"wuwx1p"}]],ye=z("Sigma",Ne);async function _e(){return await q.get("/transaction/total-fee-mlm-payment-stats")}async function ke(){return await q.get("/transaction/total-innovation-partner")}async function Ae(a){return await q.get("/transaction/get-reward-by-slot",{slotId:a})}function Se(){const a=$("ContributionHubPage.ManageFundsSection"),{data:n}=Z(),{writeContract:p}=V(),{data:x}=K(),[I,m]=r.useState(!1),[N,f]=r.useState(!1),{openModal:A,isOpen:E,closeData:v}=Y(),[L,y]=r.useState(0),[D,O]=r.useState(0),{data:g}=G({...x||{},functionName:"getStats",args:[n?.wallet_address],query:{enabled:!!n?.wallet_address}}),P=async()=>{f(!0),A("INNOVATOR_HUB_MIGRATE_WALLET_DIALOG")};return r.useEffect(()=>{if(!g||!Array.isArray(g[6]))return;const w=[];console.log("innovatorHubDataRead",g),g[6].forEach((u,t)=>{let l={id:t+1,staked:k(u.activeCredits),pending:k(u.pendingCredits),progress:u.pendingCredits==0?100:Number(c(u.activeCredits/u.pendingCredits)*c(100)),claimed:k(u.accumulatedRewards),unlock:te(parseInt(u.unlockTime)*1e3),isUnlocked:new Date().getDate()>u[3]};(l.staked>0||l.pending>0)&&w.push(l)});let R=0,M=0;w.forEach(u=>{R+=u.staked,M+=u.claimed}),y(R),O(M)},[g]),r.useEffect(()=>{if(E||!v){f(!1);return}console.log("closeData",v);try{if(!n?.wallet_address){s.error("Please connect your wallet first");return}p({...x||{},functionName:"migrateWallet",args:[v.address]},{onError:w=>{console.log(w),s.error("Error processing migration"),f(!1)},onSuccess:async w=>{s.dismiss(),f(!1),s.success("Migration successful")}})}catch(w){console.error("Migrate error:",w),s.error("Error processing migration")}},[E]),e.jsx("section",{className:"w-full",children:e.jsxs("div",{className:"relative overflow-hidden rounded-2xl bg-slate-900/70 ring-1 ring-white/10 shadow-xl",children:[e.jsx("div",{className:"pointer-events-none absolute inset-0 -z-10 opacity-40 [mask-image:radial-gradient(60%_60%_at_50%_0%,black,transparent)]",children:e.jsx("div",{className:"absolute -top-28 -right-20 h-64 w-64 rounded-full bg-gradient-to-tr from-fuchsia-500 to-indigo-500 blur-3xl"})}),e.jsxs("div",{className:"flex items-center gap-3 p-6",children:[e.jsx("span",{className:"grid h-10 w-10 place-items-center rounded-xl bg-slate-800 ring-1 ring-white/10",children:e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"h-5 w-5 text-violet-300",children:[e.jsx("path",{d:"M21 7.5H5.25A2.25 2.25 0 013 5.25v-.75A2.25 2.25 0 015.25 2.25h12a2.25 2.25 0 012.25 2.25v3z"}),e.jsx("path",{fillRule:"evenodd",d:"M21 8.25H5.25A2.25 2.25 0 003 10.5v7.5A2.25 2.25 0 005.25 20.25H2
11A2.25 2.25 0 0023.25 18V10.5A2.25 2.25 0 0021 8.25zm-3.75 6a1.5 1.5 0 100-3 1.5 1.5 0 000 3z",clipRule:"evenodd"})]})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"text-lg font-semibold text-slate-100",children:a("title")}),e.jsx("p",{className:"text-sm text-slate-400",children:a("subTitle")})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 px-6 sm:grid-cols-4",children:[e.jsx(ee,{label:a("Staked"),value:`${d(L)} ALPS`}),e.jsx(ee,{label:a("Reward"),value:`${d(D)} ALPS`})]}),e.jsx("div",{className:"flex flex-col items-stretch gap-3 p-6 sm:flex-row sm:items-center",children:e.jsxs("button",{type:"button","aria-label":"Migrate wallet",onClick:P,disabled:N,className:["group inline-flex items-center justify-center gap-2 rounded-xl px-5 py-3 font-semibold transition","focus:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400/70 focus-visible:ring-offset-2 focus-visible:ring-offset-slate-900","ring-1 ring-white/10",N?"cursor-wait bg-slate-800 text-slate-400":"bg-gradient-to-br from-indigo-500 to-fuchsia-600 text-white shadow hover:from-indigo-400 hover:to-fuchsia-500 active:opacity-90"].join(" "),children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"h-5 w-5",children:e.jsx("path",{d:"M12 4a8 8 0 100 16 8 8 0 000-16zm-1 5a1 1 0 112 0v2.586l1.293-1.293a1 1 0 111.414 1.414l-3.004 3.004a1 1 0 01-1.414 0L8.285 11.707a1 1 0 111.414-1.414L11 11.586V9z"})}),e.jsx("span",{children:a("btnMigrateWallet")})]})}),e.jsx("div",{className:"border-t border-white/10 px-6 py-4 text-xs text-slate-400",children:a("note")})]})})}function ee({label:a="",value:n=""}){return e.jsxs("div",{className:"rounded-xl bg-slate-800/60 px-4 py-3 ring-1 ring-white/10",children:[e.jsx("p",{className:"text-[11px] uppercase tracking-wide text-slate-400",children:a}),e.jsx("p",{className:"mt-1 text-base font-semibold text-slate-100",children:n})]})}const Ce=()=>{const a=$("ContributionHubPage.DefiStakingComponent"),{address:n}=oe(),{data:p}=Z(),{data:x}=K(),{writeContract:I}=V(),{writeContract:m}=V(),{writeContract:N}=V(),{data:f}=G({...x||{},functionName:"getStats",args:[p?.wallet_address],query:{enabled:!!p?.wallet_address}}),[A,E]=r.useState(0),[v,L]=r.useState({total_staked_amount:0,total_reward:0,total_pending:0}),[y,D]=r.useState([]);r.useEffect(()=>{if(!f||!Array.isArray(f[6]))return;const t=[],l=[];f[6].forEach((o,B)=>{let S={id:B,staked:k(o.activeCredits),pending:k(o.pendingCredits),progress:o.pendingCredits==0?100:Number(c(o.activeCredits/o.pendingCredits)*c(100)),accumulatedRewards:k(o.accumulatedRewards),claimed:k(o.claimedRewards),stakePreference:o.stakePreference,unlock:te(parseInt(o.unlockTime)*1e3),isUnlocked:new Date().getDate()>o[3]};(S.staked>0||S.pending>0)&&(t.push(S),l.push(Ae(S.id).then(X=>{S.claimed=X})))}),Promise.all(l).then(()=>{D([...t])});let b=0,h=0,F=0;t.forEach(o=>{b+=o.staked,h+=o.claimed,F+=o.pending}),L({total_staked_amount:b,total_reward:h,total_pending:F})},[f]);const O=(t,l)=>{for(let b=0;b<y.length;b++)if(b===t){y[b].stakePreference=l?1:0;break}},g=t=>{N({...x,functionName:"setStakePreference",args:[t.id,t.stakePreference==1?0:1]},{onError:l=>{s.error("Set auto compound transaction failed.")},onSuccess:async l=>{s.dismiss(),s.success("Rewards will automatically compound to your slot"),O(t.id,t.stakePreference!=1)}})},P=t=>{x&&m({...x,functionName:"stake",args:[t]},{onError:()=>{s.error("Transaction canceled or failed.")},onSuccess:()=>{s.success("Your ALPS contribution has been recorded!")}})},w=async()=>{try{if(!n){s.error("Please connect your wallet first");return}if(!x?.address){s.error("Contract configuration is not ready yet.");return}if(A<=0){s.error("Please enter a valid ALPS amount to join the Innovation Smart Contract.");return}const t=me(A.toString());if(await de({tokenAddress:Q.address,ownerAddress:n,spenderAddress:x.address,requiredAmount:t})){P(t);return}I({...Q,functionName:"approve",args:[x.address,t]},{onError:b=>{s.error("Approval transaction failed.")},onSuccess:async b=>{s.dismiss(),s.info("Waiting confirmation...");try{await ie(le,{hash:b})}catch(h){console.error("Error waiting for approval",h),s.error("Approval confirmation failed.");return}P(t)}})}catch(t){console.error(t),s.error("There was an error during the payment process.")}},R=t=>{try{if(!p?.address){s.error("Please connect your wallet first");return}m({...x||{}
1,functionName:"claimReward",args:[t.id]},{onError:l=>{s.error("Transaction canceled or failed.")},onSuccess:l=>{s.success("Your rewards has been claimed!")}})}catch(l){console.error(l),s.error("There was an error during the payment process.")}},M=t=>{try{if(!p?.address){s.error("Please connect your wallet first");return}m({...x||{},functionName:"compoundReward",args:[t.id]},{onError:l=>{s.error("Transaction canceled or failed.")},onSuccess:l=>{s.success("Your rewards has been claimed!")}})}catch(l){console.error(l),s.error("There was an error during the payment process.")}},u=async t=>{try{if(!p?.address){s.error("Please connect your wallet first");return}m({...x||{},functionName:"withdraw",args:[slot.id]},{onError:l=>{s.error("Transaction canceled or failed.")},onSuccess:l=>{s.success("Your slot has been withdrawn!")}})}catch(l){console.error(l),s.error("There was an error during the payment process.")}};return e.jsx(e.Fragment,{children:e.jsx("div",{className:"mb-12 rounded-xl border border-gray-200/50 bg-white/90 p-6 backdrop-blur-md dark:border-gray-700/50 dark:bg-gray-800/90",children:e.jsx("div",{className:"flex flex-col md:flex-row gap-8",children:e.jsx("div",{className:"flex-1",children:e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-semibold text-[#E4EAF6]",children:a("title")}),e.jsx("p",{className:"text-[#8A93A7] mt-1",children:a("subTitle")})]}),e.jsxs("div",{className:"rounded-2xl border border-[#2A3544] bg-[#151B28]/70 p-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-[#00E7B4] mb-4",children:a("Stake.title")}),e.jsxs("div",{className:"flex gap-3 flex-col sm:flex-row",children:[e.jsx("input",{type:"number",placeholder:"Enter amount (ALPS)",value:A,onChange:t=>E(parseFloat(t.target.value)),className:"flex-1 bg-[#1C2232] text-white px-4 py-3 rounded-xl outline-none border border-transparent focus:border-[#00E7B4]/40 transition"}),e.jsx("button",{onClick:w,className:"bg-gradient-to-r from-[#00E7B4] to-[#3E8AFF] text-black font-semibold px-6 py-3 rounded-xl hover:shadow-[0_0_12px_#00E7B4aa] transition",children:a("Stake.btnStakeNow")})]}),e.jsx("p",{className:"text-[#8A93A7] text-sm mt-2",children:a("Stake.desc")})]}),e.jsxs("div",{className:"rounded-2xl border border-[#2A3544] bg-[#151B28]/70 p-4 sm:p-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-[#00E7B4] mb-4",children:a("Slots.title")}),e.jsx("div",{className:"grid gap-3 sm:gap-4",children:y.map(t=>e.jsxs("div",{className:"rounded-xl bg-[#1C2232]/80 border border-[#252E40] p-4 sm:p-5",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:justify-between text-sm text-[#B3BCD0] mb-3 sm:mb-2 gap-1 sm:gap-0",children:[e.jsxs("span",{className:"text-xs sm:text-sm",children:[a("Slot.title")," #",t.id," â ",a("Slots.Active")]}),e.jsxs("span",{className:"text-xs sm:text-sm",children:[a("Slots.Unlocks"),": ",t.unlock]})]}),e.jsx("div",{className:"h-2 w-full rounded-full bg-[#2A3544] overflow-hidden mb-3 sm:mb-2",children:e.jsx("div",{className:"h-2 bg-gradient-to-r from-[#00E7B4] to-[#3E8AFF]",style:{width:`${t.progress}%`}})}),e.jsx("div",{className:"text-[#E4EAF6] text-xs sm:text-sm mb-3 sm:mb-0",children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:flex-wrap gap-1 sm:gap-3",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[a("Slots.Staked"),":",e.jsxs("span",{className:"font-semibold",children:[d(t.staked,2)," ALPS"]})]}),e.jsx("span",{className:"hidden sm:inline",children:"|"}),e.jsxs("span",{className:"flex items-center gap-1",children:[a("Slots.Pending"),":",e.jsxs("span",{className:"font-semibold",children:[d(t.pending,2)," ALPS"]})]}),e.jsx("span",{className:"hidden sm:inline",children:"|"}),e.jsxs("span",{className:"flex items-center gap-1",children:[a("Slots.Rewards"),":",e.jsxs("span",{className:"font-semibold",children:[d(t.accumulatedRewards,2)," ALPS"]})]}),e.jsx("span",{className:"hidden sm:inline",children:"|"}),e.jsxs("span",{className:"flex items-center gap-1",children:[a("Slots.Claimed"),":",e.jsxs("span",{className:"font-semibold",children:[d(t.claimed,2)," ALPS"]})]})]})}),e.jsxs("div",{className:"flex flex-col sm:flex-row flex-wrap gap-2 sm:gap-3 mt-4",children:[e.jsx("button",{className:"bg-[#232D40] hover:bg-[#2F3B53] text-[#00E7B4] px-3 sm:px-4 py-2 rounded-lg text-xs sm:text-sm font-semibold border border-[#2A3544] transition disabled:opacity-50 disabled:cursor-not-allowed",disabled:t.accumulatedRew
1ards==0,onClick:()=>M(t),children:a("Slots.btnCompoundRewards")}),e.jsx("button",{className:"bg-[#232D40] hover:bg-[#2F3B53] text-[#00E7B4] px-3 sm:px-4 py-2 rounded-lg text-xs sm:text-sm font-semibold border border-[#2A3544] transition disabled:opacity-50 disabled:cursor-not-allowed",disabled:t.accumulatedRewards==0,onClick:()=>R(t),children:a("Slots.btnClaimRewards")}),e.jsx("button",{onClick:()=>u(t.id),disabled:!t.isUnlocked,className:`px-3 sm:px-4 py-2 rounded-lg text-xs sm:text-sm font-semibold border transition ${t.isUnlocked?"bg-[#232D40] hover:bg-[#2F3B53] text-[#3E8AFF] border-[#2A3544]":"bg-[#1C2232] text-[#6E7688] border-[#2A3544] cursor-not-allowed"}`,children:a("Slots.btnWithdraw")}),e.jsx("button",{onClick:()=>g(t),className:`px-3 sm:px-4 py-2 rounded-lg text-xs sm:text-sm font-semibold border transition ${t.stakePreference==1?"bg-[#00E7B4]/20 border-[#00E7B4] text-[#00E7B4]":"bg-[#1C2232] border-[#2A3544] text-[#8A93A7] hover:text-[#00E7B4] hover:border-[#00E7B4]/40"}`,children:t.stakePreference==1?"Auto-Merge: ON":"Auto-Merge: OFF"})]})]},t.id))})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"rounded-xl bg-[#1C2232]/80 border border-[#252E40] p-5",children:[e.jsx("h3",{className:"text-sm text-[#8A93A7]",children:a("Stats.TotalStaked")}),e.jsxs("p",{className:"text-2xl font-semibold text-[#00E7B4] mt-1",children:[d(v.total_staked_amount,2)," ALPS"]}),e.jsxs("p",{className:"mt-1 text-sm text-yellow-400 shadow-lg",children:[d(v.total_pending,2)," ALPS pending"]})]}),e.jsxs("div",{className:"rounded-xl bg-[#1C2232]/80 border border-[#252E40] p-5",children:[e.jsx("h3",{className:"text-sm text-[#8A93A7]",children:a("Stats.TotalClaimedRewards")}),e.jsxs("p",{className:"text-2xl font-semibold text-[#00E7B4] mt-1",children:[d(v.total_reward,2)," ALPS"]})]})]})]})})})})})},Te=({poolStats:a})=>{const n=$("ContributionHubPage.SmartContractOverviewSection"),{openModal:p}=Y(),[x,I]=r.useState(0);return r.useEffect(()=>{ke().then(m=>{I(m)})},[]),e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mb-12 rounded-xl border border-gray-200/50 bg-white/90 p-6 backdrop-blur-md dark:border-gray-700/50 dark:bg-gray-800/90",children:e.jsxs("div",{className:"flex flex-col md:flex-row gap-8",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"rounded-lg bg-purple-500/10 p-2",children:e.jsx(ue,{className:"h-6 w-6 text-purple-500"})}),e.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:n("title")})]}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-6 max-w-3xl",children:n("subTitle")}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[e.jsxs("div",{className:"rounded-lg border border-gray-200 p-4 dark:border-gray-700 bg-gradient-to-br from-purple-50 to-white dark:from-gray-800 dark:to-gray-750",children:[e.jsx("div",{className:"text-2xl font-bold text-blue-400 dark:text-blue-300",children:"25%"}),e.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-400",children:n("CompanyEarnings")})]}),e.jsxs("div",{className:"rounded-lg border border-gray-200 p-4 dark:border-gray-700 bg-gradient-to-br from-blue-50 to-white dark:from-gray-800 dark:to-gray-750",children:[e.jsx("div",{className:"text-2xl font-bold text-green-600 dark:text-green-400",children:"200%"}),e.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-400",children:n("ROITarget")})]}),e.jsxs("div",{className:"rounded-lg border border-gray-200 p-4 dark:border-gray-700 bg-gradient-to-br from-emerald-50 to-white dark:from-gray-800 dark:to-gray-750",children:[e.jsx("div",{className:"text-2xl font-bold text-emerald-600 dark:text-emerald-400",children:"5+"}),e.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-400",children:n("RevenueTypes")})]})]})]}),e.jsxs("div",{className:"md:w-72 flex flex-col gap-4",children:[e.jsxs("div",{className:"rounded-xl border border-purple-200/50 bg-purple-50/50 p-4 dark:border-purple-900/50 dark:bg-purple-900/20",children:[e.jsx("h3",{className:"font-semibold text-purple-900 dark:text-purple-100 mb-2",children:n("CTASection.title")}),e.jsxs("ul",{className:"text-sm text-purple-800 dark:text-purple-200 space-y-2",children:[e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-purple-500"}),n("CTASection.AutomaticPayouts")]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-purple-500"}),n("CTASection.TransparentTracking")]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-purple-500"}),n("CTASection.SecureContribution")]})]})]}),e.jsx("button",{onClick:()=>p("SMART_INFO_DIALOG"),className:"w-full rounded-lg bg-gradient-to-r from-purple-500 to-blue-600 px-6 py-3 text-sm font-semibold text-white shadow-lg transition-all duration-300 hover:-translate-y-0.5 hover:shadow-xl hover:shadow-
1purple-500/20",children:n("CTASection.btnViewDetailedInformation")})]})]})}),e.jsx("div",{className:"mb-8 grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-4",children:[{title:n("Stats.TotalValueLocked"),value:W(a.total_active_amount)+" ALPS",icon:e.jsx(ce,{className:"h-5 w-5"}),change:12.5,gradient:"from-blue-500 to-cyan-500",hoverGradient:"group-hover:from-blue-600 group-hover:to-cyan-600"},{title:n("Stats.MyContribution"),value:W(a.user_active_amount)+" ALPS",icon:e.jsx(xe,{className:"h-5 w-5"}),subtitle:`+${W(a.user_pending_amount)} pending`,gradient:"from-purple-500 to-dark",hoverGradient:"group-hover:from-purple-600 group-hover:to-pink-600"},{title:n("Stats.TotalEarned"),value:W(a.user_reward_amount)+" ALPS",icon:e.jsx(ae,{className:"h-5 w-5"}),subtitle:`Last payment: ${a.last_payment>0?new Date(k(a.last_payment)*1e3).toLocaleDateString():"-"}`,gradient:"from-emerald-500 to-teal-500",hoverGradient:"group-hover:from-emerald-600 group-hover:to-teal-600"},{title:n("Stats.InnovationPartners"),value:x,icon:e.jsx(ge,{className:"h-5 w-5"}),subtitle:"Active contributors",gradient:"from-orange-500 to-amber-500",hoverGradient:"group-hover:from-orange-600 group-hover:to-amber-600"}].map((m,N)=>e.jsxs("div",{className:"group relative overflow-hidden rounded-xl bg-white/80 p-6 backdrop-blur-md transition-all duration-500 dark:bg-gray-800/80",children:[e.jsx("div",{className:"absolute inset-0",children:e.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-white/[0.05] to-transparent animate-subtle-shimmer"})}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-white/[0.07] to-transparent"}),e.jsx("div",{className:`relative mb-4 inline-flex rounded-lg p-3 bg-gradient-to-r ${m.gradient} text-white shadow-lg transition-transform duration-300 ease-out group-hover:scale-105`,children:m.icon}),e.jsxs("div",{className:"relative",children:[" ",e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:m.title}),e.jsx("div",{className:"mt-2 text-2xl font-bold text-gray-900 dark:text-white",children:m.value}),m.subtitle&&e.jsx("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:m.subtitle}),m.change&&e.jsxs("div",{className:"mt-2 inline-flex items-center rounded-full bg-green-100 px-2.5 py-0.5 text-sm font-medium text-green-800 dark:bg-green-900/30 dark:text-green-400",children:[e.jsx(ve,{className:"mr-1 h-3 w-3"}),m.change,"%"]})]}),e.jsx("div",{className:"absolute inset-0 rounded-xl border border-white/20 transition-colors duration-500 group-hover:border-white/30"})]},N))})]})},Ee=()=>{const a=$("ContributionHubPage"),[n,p]=r.useState(!0),[x,I]=r.useState(0),{openModal:m}=Y();let N=["Type","Date & Time","Status","Transaction Details","Amount"];const f=[],[A,E]=r.useState(f),[v,L]=r.useState(1),[y]=r.useState(10),[D,O]=r.useState(0),[g,P]=r.useState({status:"",types:[],tx_hash:""}),w=["INNOVATOR_HUB_CONTRIBUTION","INNOVATOR_HUB_CLAIM_REWARD","INNOVATOR_HUB_DISTRIBUTION","INNOVATOR_HUB_WITHDRAWAL","INNOVATOR_HUB_MIGRATION"],[R,M]=r.useState(!0),[u,t]=r.useState({num_contributors:c(0),total_distribution:c(0),total_active_amount:c(0),total_pending_amount:c(0),user_active_amount:c(0),user_pending_amount:c(0),user_reward_amount:c(0),last_payment:c(0)}),[l,b]=r.useState({owner:"",token:"",payableERC20:"",dev_fee:c(0),interest_amount_tiers:[c(0)],interest_percent_tiers:[c(0)]}),{data:h}=Z(),{data:F}=K(),{data:o}=G({...F||{},functionName:"getStats",args:[h?.wallet_address],query:{enabled:!!h?.wallet_address}}),{data:B}=G({...F||{},functionName:"getConfig",query:{enabled:!!h?.wallet_address}}),S="0x5870357Dfa6A11d3Fe45D775C21eD9ae60Ac4BeF",{data:X}=be({address:h?.wallet_address,token:S,query:{enabled:!!h?.wallet_address}});r.useEffect(()=>{(async()=>{const i=g.types&&g.types.length>0?g.types:w,C=await he(i,["AI_TRADE_HUB_COMPOUND","AI_TRADE_HUB_CONTRIBUTION"],v,y,{status:g.status||void 0,txHash:g.tx_hash||void 0});E(C.data),O(C.total),M(!1)})()},[v,g]),r.useEffect(()=>{se()},[o,B]),r.useEffect(()=>{h&&re()},[h]);async function se(){try{if(p(!0),!o||!Array.isArray(o[6]))return;let j=c(0),i=c(0),C=c(0),H=c(0);
1o[6].forEach(T=>{console.log("Slot",T),i+=T.activeCredits,j+=T.pendingCredits,H+=T.claimedRewards,C+=T.accumulatedRewards}),console.log("total_staked_amount",i);const U={num_contributors:o[0],total_distribution:o[1],last_payment:o[2],total_active_amount:o[3],total_pending_amount:o[4],user_active_amount:i,user_pending_amount:j,user_reward_amount:C,user_paid_interest:H};if(!B)return;const _=B,J={owner:_[0],token:_[1],payableERC20:_[2],dev_fee:_[3],interest_amount_tiers:_[4],interest_percent_tiers:_[5]};b(J),t(U),console.log("Stats:",o),console.log("Config:",B),p(!1)}catch(j){console.error("Error fetching contract data:",j),s.error("Error loading dashboard data"),p(!1)}}function re(){const j=h.contracts.INNOVATOR_PARTNER.current.version,i=h.contracts.INNOVATOR_PARTNER.latest.version;j>=i||m("INNOVATOR_HUB_MIGRATE_CONTRACT_DIALOG",{})}const ne=()=>{const j={swap_fee:0,contribution_fee:0,compound_fee:0,claim_profit_fee:0,withdrawal_funds_fee:0,monthly_fee:0,total_mlm_binary:0,total_mlm_level_bonus:0,total_mlm_profit_bonus:0},[i,C]=r.useState(j);r.useEffect(()=>{_e().then(T=>{C(T)})},[]);const H=i.swap_fee+i.contribution_fee+i.compound_fee+i.claim_profit_fee+i.withdrawal_funds_fee,U=i.total_mlm_binary+i.total_mlm_level_bonus+i.total_mlm_profit_bonus,_=H-U;return u.user_active_amount+u.user_pending_amount>0?e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"group relative overflow-hidden rounded-xl bg-white/80 p-6 backdrop-blur-md transition-all duration-500 dark:bg-gray-800/80",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-white/[0.05] to-transparent animate-subtle-shimmer"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-white/[0.07] to-transparent"}),e.jsx("div",{className:"relative mb-4 inline-flex rounded-lg p-3 bg-gradient-to-r from-blue-500 to-cyan-500 text-white shadow-lg",children:e.jsx(ae,{className:"h-5 w-5"})}),e.jsxs("div",{className:"relative",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Total Fee Earned"}),e.jsxs("ul",{className:"mt-2 text-sm text-gray-700 dark:text-gray-300 space-y-1",children:[e.jsxs("li",{className:"flex justify-between",children:[e.jsx("span",{children:"Swap Fee"}),e.jsxs("span",{children:[d(i.swap_fee)," ALPS"]})]}),e.jsxs("li",{className:"flex justify-between",children:[e.jsx("span",{children:"Contribution Fee"}),e.jsxs("span",{children:[d(i.contribution_fee)," ALPS"]})]}),e.jsxs("li",{className:"flex justify-between",children:[e.jsx("span",{children:"Compound Fee"}),e.jsxs("span",{children:[d(i.compound_fee)," ALPS"]})]}),e.jsxs("li",{className:"flex justify-between",children:[e.jsx("span",{children:"Monthly Fee"}),e.jsxs("span",{children:[d(i.monthly_fee)," ALPS"]})]}),e.jsxs("li",{className:"flex justify-between",children:[e.jsx("span",{children:"Claim Profit Fee"}),e.jsxs("span",{children:[d(i.claim_profit_fee)," ALPS"]})]}),e.jsxs("li",{className:"flex justify-between",children:[e.jsx("span",{children:"Withdrawal Fee"}),e.jsxs("span",{children:[d(i.withdrawal_funds_fee)," ALPS"]})]})]})]})]}),e.jsxs("div",{className:"group relative overflow-hidden rounded-xl bg-white/80 p-6 backdrop-blur-md transition-all duration-500 dark:bg-gray-800/80",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-white/[0.05] to-transparent animate-subtle-shimmer"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-white/[0.07] to-transparent"}),e.jsx("div",{className:"relative mb-4 inline-flex rounded-lg p-3 bg-gradient-to-r from-yellow-500 to-amber-500 text-white shadow-lg",children:e.jsx(je,{className:"h-5 w-5"})}),e.jsxs("div",{className:"relative",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Total Payment"}),e.jsxs("ul",{className:"mt-2 text-sm text-gray-700 dark:text-gray-300 space-y-1",children:[e.jsxs("li",{className:"flex justify-between",children:[e.jsx("span",{children:"MLM Binary"}),e.jsxs("span",{children:[d(i.total_mlm_binary)," ALPS"]})]}),e.jsxs("li",{className:"flex justify-between",children:[e.jsx("span",{children:"MLM Level Bonu
1s"}),e.jsxs("span",{children:[d(i.total_mlm_level_bonus)," ALPS"]})]}),e.jsxs("li",{className:"flex justify-between",children:[e.jsx("span",{children:"MLM Profit Bonus"}),e.jsxs("span",{children:[d(i.total_mlm_profit_bonus)," ALPS"]})]})]})]})]}),e.jsxs("div",{className:"group relative overflow-hidden rounded-xl bg-white/80 p-6 backdrop-blur-md transition-all duration-500 dark:bg-gray-800/80",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-white/[0.05] to-transparent animate-subtle-shimmer"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-white/[0.07] to-transparent"}),e.jsx("div",{className:"relative mb-4 inline-flex rounded-lg p-3 bg-gradient-to-r from-green-500 to-emerald-500 text-white shadow-lg",children:e.jsx(ye,{className:"h-5 w-5"})}),e.jsxs("div",{className:"relative",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Total Company Earned"}),e.jsxs("ul",{className:"mt-2 text-sm text-gray-700 dark:text-gray-300 space-y-1",children:[e.jsxs("li",{className:"flex justify-between",children:[e.jsx("span",{children:"Fee Earned"}),e.jsxs("span",{children:[d(H)," ALPS"]})]}),e.jsxs("li",{className:"flex justify-between",children:[e.jsx("span",{children:"MLM Payment"}),e.jsxs("span",{children:[d(U)," ALPS"]})]})]}),e.jsxs("p",{className:"mt-3 text-green-500 font-semibold",children:["Final: ",d(_)," ALPS"]})]})]})]}):null},[Le,Pe]=r.useState(!1);return e.jsx(e.Fragment,{children:e.jsx("div",{className:"min-h-screen bg-gradient-to-b from-gray-50 to-gray-100 dark:from-gray-900 dark:to-gray-800",children:n?e.jsx("div",{className:"flex min-h-screen items-center justify-center",children:e.jsxs("div",{className:"relative h-32 w-32",children:[e.jsx("div",{className:"absolute inset-0 animate-ping rounded-full border-2 border-blue-500 opacity-75"}),e.jsx("div",{className:"absolute inset-0 animate-spin rounded-full border-t-2 border-b-2 border-blue-500"})]})}):e.jsxs("div",{className:"relative mx-auto max-w-7xl p-8",children:[e.jsxs("div",{className:"fixed inset-0 overflow-hidden pointer-events-none",children:[e.jsx("div",{className:"absolute -top-40 -right-40 h-96 w-96 rounded-full bg-purple-500/5 blur-3xl"}),e.jsx("div",{className:"absolute -bottom-40 -left-40 h-96 w-96 rounded-full bg-blue-500/5 blur-3xl"})]}),e.jsx("div",{className:"mb-6 grid grid-cols-1 gap-8 md:grid-cols-1 md:items-start",children:e.jsxs("div",{className:"relative isolate mb-5",children:[e.jsxs("div",{className:"absolute inset-0 -z-10 overflow-hidden h-[300px]",children:[e.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-80",children:e.jsx("svg",{viewBox:"0 0 1200 300",className:"h-full w-full opacity-20 dark:opacity-10",children:e.jsx("path",{d:"M 0,200 L 400,50 L 800,250 L 1200,100 L 1200,300 L 0,300 Z",fill:"currentColor",className:"text-purple-200 dark:text-purple-900"})})}),e.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-80",children:e.jsx("svg",{viewBox:"0 0 1200 300",className:"h-full w-full opacity-30 dark:opacity-20",children:e.jsx("path",{d:"M 0,250 L 300,75 L 600,225 L 900,50 L 1200,175 L 1200,300 L 0,300 Z",fill:"currentColor",className:"text-blue-200 dark:text-blue-900"})})}),e.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-80",children:e.jsx("svg",{viewBox:"0 0 1200 300",className:"h-full w-full opacity-40 dark:opacity-30",children:e.jsx("path",{d:"M 0,225 L 200,100 L 400,200 L 600,75 L 800,175 L 1000,50 L 1200,150 L 1200,300 L 0,300 Z",fill:"currentColor",className:"text-indigo-200 dark:text-indigo-900"})})})]}),e.jsxs("div",{className:"relative group pt-16 pb-32",children:[e.jsx("h1",{className:"bg-gradient-to-r from-purple-500 to-blue-500 bg-clip-text text-3xl font-extrabold leading-tight tracking-tight text-transparent drop-shadow-md sm:text-4xl",children:a("title")}),e.jsxs("p",{className:"mt-4 max-w-2xl text-base leading-relaxed text-gray-600 transition-colors duration-300 group-hover:text-gray-800 dark:text-gray-400 dark:group-hover:text-gray-200 sm:text-lg",children:[a("description.prefix"),e.jsxs("span",{className:"font-semibold text-purple-600 dar
1k:text-purple-400",children:[" ",a("description.roi")]}),a("description.middle"),e.jsxs("span",{className:"font-semibold text-blue-600 dark:text-blue-400",children:[" ",a("description.blockchain")," "]}),a("description.suffix")]})]})]})}),e.jsx(Ce,{}),e.jsx("div",{className:"mb-12",children:e.jsx(Se,{})}),e.jsx(Te,{poolStats:u}),e.jsx("div",{className:"grid grid-cols-1 gap-8",children:e.jsx(ne,{})}),e.jsx("div",{className:"grid grid-cols-1 gap-8 mt-8",children:e.jsx(pe,{filter:!0,downloadCsv:!1,title:"Transaction History",columns:N,data:A,page:v,pageSize:y,total:D,isLoading:R,onPageChange:L,onFilterChange:j=>{L(1),P(j)}})})]})})})};function at(){return e.jsx(Ee,{})}export{at as default};
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.