PageSourceSearch

https://modrinth.com/_nuxt/CIoXy4Fr.js

js modrinth.com collected 2026-10-01 10:41:28 UTC 3,942 bytes, 1 lines download raw bytes

1import{d as R,e as S,aU as j,aW as q,u as E,b2 as Q,c as U,a as k,v as s,k as e,b as n,j as f,b3 as P,n as b,m as x,F as L,y as D,Q as m,cA as B,b6 as J,o,bx as K,S as W,aJ as X,c1 as Y,q as C,_ as z,U as G,V as H}from"./DUququmF.js";import{_ as O,a as Z}from"./DpDoBDTk.js";import{_ as ee}from"./BwvPIUmG.js";import{A as ae}from"./CQXioT8-.js";import"./DmMQCwmF.js";import"./CnZbn8yl.js";import"./CKXbzKib.js";import"./iLXYiTCR.js";import"./_elIokNk.js";import"./D76aULLx.js";const te={class:"page"},ie={class:"mb-6 flex items-center gap-6"},oe={class:"m-0 grow text-2xl font-extrabold"},le={class:"flex items-center gap-2"},re={key:1,class:"py-8 text-center"},se={class:"text-secondary"},ne={key:2,class:"space-y-3"},fe=R({__name:"affiliate-links",async setup(ce){let c,M;const _=B("createModal"),h=B("revokeModal"),T=([c,M]=S(()=>J()),c=await c,M(),c),v=j(),{handleError:V}=q(),{formatMessage:t}=E(),{data:F,error:A,refetch:w}=Q({queryKey:["affiliate"],queryFn:()=>v.labrinth.affiliate_internal.getAll()}),l=m(""),p=m(!1),y=U(()=>F.value?.filter(a=>a.affiliate===T.value?.user?.id&&(l.value.trim()?a.source_name.trim().toLowerCase().includes(l.value.trim().toLowerCase()):!0))??[]);async function I(a){p.value=!0;try{await v.labrinth.affiliate_internal.create({source_name:a.sourceName}),await w(),_.value?.close()}catch(d){V(d)}finally{p.value=!1}}const g=m(null),r=m(null);function N(a){g.value=a.source_name,r.value=a.id,h.value?.show()}async function $(){if(r.value)try{await v.labrinth.affiliate_internal.delete(r.value),await w(),h.value?.hide(),g.value=null,r.value=null}catch(a){console.error("Failed to revoke affiliate code:",a)}}const i=G({createButton:{id:"dashboard.affiliate-links.create.button",defaultMessage:"Create affiliate link"},yourAffiliateLinks:{id:"dashboard.affiliate-links.header",defaultMessage:"Your affiliate links"},searchAffiliateLinks:{id:"dashboard.affiliate-links.search",defaultMessage:"Search affiliate links..."},errorTitle:{id:"dashboard.affiliate-links.error.title",defaultMessage:"Error loading affiliate links"},noAffiliateCodesFound:{id:"dashboard.affiliate-links.empty.no-codes",defaultMessage:"No affiliate codes found."},revokeConfirmButton:{id:"dashboard.affiliate-links.revoke-confirm.button",defaultMessage:"Revoke"},revokeConfirmTitle:{id:"dashboard.affiliate-links.revoke-confirm.title",defaultMessage:"Are you sure you want to revoke your ''{title}'' affiliate link?"},revokeConfirmBody:{id:"dashboard.affiliate-links.revoke-confirm.body",defaultMessage:"This will permanently revoke the affiliate code `{id}` and any existing links with this code that have been shared will no longer be valid."}});return(a,d)=>(o(),k(L,null,[s(e(O),{ref_key:"createModal",ref:_,"creating-link":e(p),onCreate:I},null,8,["creating-link"]),s(e(ee),{ref_key:"revokeModal",ref:h,title:e(t)(e(i).revokeConfirmTitle,{title:e(g)}),description:e(t)(e(i).revokeConfirmBody,{id:e(r)}),"proceed-icon":e(K),"proceed-label":e(t)(e(i).revokeConfirmButton),onProceed:$},null,8,["title","description","proceed-icon","proceed-label"]),n("div",te,[n("div",ie,[n("h1",oe,f(e(t)(e(i).yourAffiliateLinks)),1),n("div",le,[s(e(X),{modelValue:e(l),"onUpdate:modelValue":d[0]||(d[0]=u=>P(l)?l.value=u:null),icon:e(W),type:"text",autocomplete:"off",placeholder:e(t)(e(i).searchAffiliateLinks),clearable:""},null,8,["modelValue","icon","placeholder"]),s(e(z),{type:"colored",color:"brand",onClick:e(_)?.show},{default:b(()=>[s(e(Y)),C(" "+f(e(t)(e(i).createButton)),1)]),_:1},8,["onClick"])])]),e(A)?(o(),x(e(ae),{key:0,type:"critical"},{header:b(()=>[C(f(e(t)(e(i).errorTitle)),1)]),default:b(()=>[C(" "+f(e(A)),1)]),_:1})):!e(y)||e(y).length===0?(o(),k("div",re,[n("p",se,f(e(t)(e(i).noAffiliateCodesFound)),1)])):(o(),k("div",ne,[(o(!0),k(L,null,D(e(y),u=>(o(),x(e(Z),{key:`affiliate-${u.id}`,affiliate:u,onRevoke:N},null,8,["affiliate"]))),128))]))])],64))}}),be=H(fe,[["__scopeId","data-v-a9a4c904"]]);export{be 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.