1import{r as m,j as e,m as je,t as ve}from"./react-vendor-Q2BSRknM.js";import{D as Ne,i as ke,B as i,c as q,j as ye,k as _e,m as we,n as Ce,s as K,t as B,h as de,C as _,b as w,d as C,e as P}from"./index-CuraQpvj.js";import{T as ae,P as Pe}from"./PackTiles-CvAgfuqb.js";import{S as Se,C as ze}from"./CardVault-CG7bgH27.js";import{C as Le}from"./CardBoostPicker-Y-WHFYro.js";import{R as S,r as H,b as R,c as V}from"./cardRarity-BngzBEGy.js";import{ay as Re,az as W,Q as Ee,ai as oe,aA as Be,Z as Me,F as me,L as re,b as Oe,X as Ae,z as De,R as te}from"./lucide-DhlFjs1-.js";import{u as Te,b as G,B as Y}from"./useCardBoost-CjNMtGQN.js";import{u as ne}from"./useCardVault-BgcA0iAP.js";import"./capacitor-DSpR9wll.js";import"./ui-radix-DzQ_orwq.js";import"./supabase-DoZmW4Yf.js";import"./query-BLOP9k_M.js";import"./date-utils-DaNoSKVa.js";import"./HandOfCardsIcon-V--rezwD.js";import"./VerifiedBadge-k8370q7H.js";import"./useCardsEnabled-0wAqPl2y.js";const L={packSize:6,maxPacksPerEvent:3,xpPerPack:2500,shardPackPrice:250,shardValues:{common:25,uncommon:25,rare:25,epic:25,legendary:25,mythic:25},boostMultipliers:{common:1,uncommon:1,rare:1.04,epic:1.08,legendary:1.1,mythic:1.12},eventNames:[],allEvents:!1},J=(r,a)=>{if(typeof r!="string")return a;try{return JSON.parse(r)??a}catch{return a}},I=(r,a)=>{const p=Number.parseInt(String(r??""),10);return Number.isFinite(p)&&p>0?p:a},Ie=r=>r.replace(/ Pick '?Em$/i,"");function $e(r){const[a,p]=m.useState(L);return m.useEffect(()=>{if(!r)return;let l=!0;return(async()=>{try{const{data:b}=await K.from("app_settings").select("key, value").in("key",["cards_pack_size","cards_pack_max_per_event","cards_xp_per_pack","cards_shard_pack_price","cards_shard_values","cards_boost_multipliers","cards_eligible_event_ids"]),d=new Map;for(const f of b??[])d.set(f.key,f.value);const n=String(d.get("cards_eligible_event_ids")??"").trim(),h=n==="all",k=h?[]:J(n,[]);let u=[];if(Array.isArray(k)&&k.length>0){const{data:f}=await K.from("pickem_events").select("name").in("id",k);u=(f??[]).map(y=>Ie(String(y.name??""))).filter(Boolean)}if(!l)return;p({packSize:I(d.get("cards_pack_size"),L.packSize),maxPacksPerEvent:I(d.get("cards_pack_max_per_event"),L.maxPacksPerEvent),xpPerPack:I(d.get("cards_xp_per_pack"),L.xpPerPack),shardPackPrice:I(d.get("cards_shard_pack_price"),L.shardPackPrice),shardValues:{...L.shardValues,...J(d.get("cards_shard_values"),{})},boostMultipliers:{...L.boostMultipliers,...J(d.get("cards_boost_multipliers"),{})},eventNames:u,allEvents:h})}catch{}})(),()=>{l=!1}},[r]),a}function M({icon:r,title:a,children:p}){return e.jsxs("section",{className:"space-y-1.5",children:[e.jsxs("h3",{className:"flex items-center gap-1.5 text-[11px] font-bold uppercase tracking-[0.14em] text-muted-foreground",children:[e.jsx(r,{className:"h-3.5 w-3.5 text-primary"}),a]}),e.jsx("div",{className:"space-y-1.5 text-[13px] leading-relaxed text-foreground/90",children:p})]})}const v=({children:r})=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx("span",{"aria-hidden":!0,className:"mt-[7px] h-1 w-1 shrink-0 rounded-full bg-primary"}),e.jsx("p",{className:"min-w-0",children:r})]});function qe({className:r}){const[a,p]=m.useState(!1),l=$e(a),b=l.allEvents?"every completed Pick'em event":l.eventNames.length>0?l.eventNames.join(", "):"select Pick'em events",d=S.filter(n=>(l.boostMultipliers[n]??1)>1);return e.jsxs(Ne,{open:a,onOpenChange:p,children:[e.jsx(ke,{asChild:!0,children:e.jsxs(i,{variant:"ghost",size:"sm",className:q("h-7 px-2 text-[11px] text-muted-foreground",r),children:[e.jsx(Re,{className:"mr-1 h-3.5 w-3.5"}),"Pack rules"]})}),e.jsxs(ye,{className:"max-h-[85vh] overflow-y-auto sm:max-w-md","data-vaul-no-drag":!0,children:[e.jsxs(_e,{children:[e.jsx(we,{className:"text-lg font-black",children:"Pack rules"}),e.jsx(Ce,{className:"text-xs",children:"How packs are earned, ripped, and what duplicates are worth."})]}),e.jsxs("div",{className:"space-y-4 pb-1",children:[e.jsxs(M,{icon:W,title:"Which events drop packs",children:[e.jsxs(v,{children:["Cards are brand new, so only ",e.jsx("strong",{children:b})," mints them. Older events stay card-free on purpose â nothing is backfilled."]}),e.jsxs(v,{children:["A set is minted from the event's ",e.jsx("strong",{children:"final, frozen results"}),". Once scores lock, a card's rarity can never change."]})]}),e.jsxs(M,{icon:Ee,title:"How you earn packs",children:[e.jsxs(v,{children:["Up to ",e.jsxs("strong",{children:[l.maxPacksPerEvent," packs per event"]}),": one for playing the event, one for a top-10 finish, one for a perfect medal sweep."]}),e.jsxs(v,{children:["Want more? Trade ",e.jsxs("strong",{children:[l.xpPerPack.toLocaleStr
1ing()," XP"]})," or"," ",e.jsxs("strong",{children:[l.shardPackPrice.toLocaleString()," shards"]})," for an extra pack."]}),e.jsxs(v,{children:["Packs land when the event is finalized. Tap"," ",e.jsx("strong",{children:"Check rewards"})," in your vault and anything owed appears."]})]}),e.jsxs(M,{icon:oe,title:"Ripping a pack",children:[e.jsxs(v,{children:["Every pack holds ",e.jsxs("strong",{children:[l.packSize," cards"]}),", revealed one at a time â the last slot is the hit slot, where Epic and better live."]}),e.jsx(v,{children:"The server rolls the whole pack before the animation starts, so nothing is decided by how fast you tap. Rip it once and it's yours forever."})]}),e.jsxs(M,{icon:Be,title:"Duplicates become shards",children:[e.jsxs(v,{children:["Pull a card you already own and it doesn't clutter your binder â it melts into ",e.jsx("strong",{children:"shards"}),", and rarer duplicates are worth much more."]}),e.jsxs(v,{children:["Save ",e.jsxs("strong",{children:[l.shardPackPrice.toLocaleString()," shards"]})," to buy another pack, so no duplicate is ever wasted."]}),e.jsx("div",{className:"grid grid-cols-2 gap-1.5 pt-0.5 sm:grid-cols-3",children:S.map(n=>e.jsxs("div",{className:"flex items-center justify-between rounded-lg border px-2 py-1.5",style:{borderColor:H(n,.45)},children:[e.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",style:{color:H(n)},children:R(n).label}),e.jsxs("span",{className:"text-[11px] font-black text-foreground",children:["+",(l.shardValues[n]??0).toLocaleString()]})]},n))})]}),e.jsxs(M,{icon:Me,title:"Using a card",children:[e.jsxs(v,{children:["Equip ",e.jsx("strong",{children:"one card per event"})," before picks lock to multiply the points you score in that event",d.length>0&&e.jsxs(e.Fragment,{children:[" ","(",d.map(n=>`${R(n).label} +${Math.round(((l.boostMultipliers[n]??1)-1)*100)}%`).join(", "),")"]}),"."]}),e.jsxs(v,{children:[e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(me,{className:"h-3.5 w-3.5 text-primary"}),"Each card boosts once"]})," ","â the equipped card spends its single boost when the event settles. It stays in your collection for good, it just can't be equipped again."]})]})]})]})]})}const le=r=>r.replace(/_/g," ");function Fe({rarity:r,basePoints:a,keepRows:p,onParamChange:l}){const[b,d]=m.useState(null),[n,h]=m.useState(null),{event:k,equipped:u,isLocked:f}=Te(),y=m.useCallback(async t=>{d(t),h(null);try{const{data:j,error:x}=await K.rpc("cards_burn_lab",{p_action:t,p_rarity:r,p_base_points:a,p_keep:p});if(x){B.error(x.message),h({error:x.message});return}const z=j??{};h(z),z.error==="forbidden"?B.error("Admin only"):t==="sandbox"&&(z.all_passed?B.success("Burn flow passed all checks"):B.error("Burn flow has a failing step"))}catch(j){const x=j instanceof Error?j.message:"run_failed";B.error(x),h({error:x})}finally{d(null)}},[r,a,p]),E=Math.round(a*((Y[r]??1)-1));return e.jsxs("div",{className:"space-y-3 text-xs",children:[e.jsxs("div",{className:"rounded-lg border border-border/50 p-2.5",children:[e.jsx("div",{className:"mb-1 text-[10px] font-bold uppercase tracking-[0.14em] text-muted-foreground",children:"Your real equip"}),k?e.jsxs("div",{className:"space-y-0.5 text-muted-foreground",children:[e.jsxs("div",{children:["Open event: ",e.jsx("span",{className:"text-foreground",children:k.name})]}),e.jsxs("div",{children:["Equipped:"," ",e.jsx("span",{className:"text-foreground",children:u?`${u.player_name} · ${R(u.rarity).label} · ${G(u.multiplier)}`:"nothing"}),f?" (locked)":""]})]}):e.jsx("div",{className:"text-muted-foreground",children:"No event currently accepting picks."})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:S.map(t=>e.jsx(i,{size:"sm",variant:r===t?"default":"outline",className:"h-7 px-2 text-[11px]",onClick:()=>l("burnRarity",t),children:R(t).label},t))}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[[250,500,1e3,2500].map(t=>e.jsxs(i,{size:"sm",variant:a===t?"default":"outline",className:"h-7 px-2 text-[11px]",onClick:()=>l("burnBase",String(t)),children:[t," pts"]},t)),e.jsx(i,{size:"sm",variant:p?"default":"outline",className:"h-7 px-2 text-[11px]",onClick:()=>l("burnKeep",p?null:"1"),children:"keep rows"})]}),e.jsxs("div",{className:"text-[11px] text-muted-foreground",children:["Expecting ",e.jsx("span",{className:"text-foreground",children:G(Y[r]??1)})," â"," ",e.jsxs("span",{className:"text-foreground",children:[a," + ",E," = ",a+E]})," ","pts, then the card burns when the event settles."]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(i,{size:"sm",className:"h-8 gap-1.5 text-[11px]",disabled:!!b,onClick:()=>y("sandbox"),children:[b==="sandbox"?e.jsx(re,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(me,{className:"h-3.5 w-3.5"}),"Sandbox burn run"]}),e.jsx(i,{size:"sm",variant:"outline",className:"h-8 text-[11px]",disabled:!!b,onClick:()=>y("dry_run"),children:b==="dry_run"?e.jsx(re,{className:"h-3.5 w-3.5 animate-spin"}):"Dry run my equip"})]}),n&&e.jsx("div",{className:"space-y-2",children:n.error?e.jsx("div",{className:"rounded-lg border border-destructive/50 p-2.5 text-destructive",children:n.error}):e.jsxs(e.Fragment,{children:[n.action==="sandbox"&&e.jsx(de,{variant:n.all_passed?"default":"destructive",className:"text-[10px]",children:n.all_passed?"ALL CHECKS PASSED":"FAILING STEP"}),(n.steps??[]).map((t,j)=>e.jsxs("div",{className:q("rounded-lg border p-2.5",t.pass===!1?"border-destructive/60":"border-border/50"),children:[e.jsxs("div",{className:"mb-1 flex items-center gap-1.5 font-bold uppercase tracking-wider",children:[t.pass===!0&&e.jsx(Oe,{className:"h-3.5 w-3.5 text-emerald-500"}),t.pass===!1&&e.jsx(Ae,{className:"h-3.5 w-3.5 text-destructive"}),String(t.step??`step ${j+1}
1`).replace(/_/g," ")]}),e.jsx("div",{className:"grid grid-cols-2 gap-x-3 gap-y-0.5 text-[11px] text-muted-foreground",children:Object.entries(t).filter(([x])=>x!=="step"&&x!=="pass").map(([x,z])=>e.jsxs("div",{className:"flex justify-between gap-2",children:[e.jsx("span",{className:"truncate",children:le(x)}),e.jsx("span",{className:"text-foreground",children:String(z)})]},x))})]},j)),n.action==="dry_run"&&e.jsx("div",{className:"rounded-lg border border-border/50 p-2.5",children:e.jsx("div",{className:"grid grid-cols-2 gap-x-3 gap-y-0.5 text-[11px] text-muted-foreground",children:Object.entries(n).filter(([t])=>t!=="steps"&&t!=="action").map(([t,j])=>e.jsxs("div",{className:"flex justify-between gap-2",children:[e.jsx("span",{className:"truncate",children:le(t)}),e.jsx("span",{className:"text-foreground",children:String(j)})]},t))})})]})})]})}const ce={common:10,uncommon:20,rare:45,epic:100,legendary:250,mythic:600},N=[{name:"Anna Leigh Waters",slug:"anna-leigh-waters",team:"New Jersey 5s",headline:"Ran the table"},{name:"Ben Johns",slug:"ben-johns",team:"LA Mad Drops",headline:"DreamBreaker closer"},{name:"Dylan Frazier",slug:"dylan-frazier",team:"California Black Bears",headline:"Traded and dominant"},{name:"Jorja Johnson",slug:"jorja-johnson",team:"New Jersey 5s",headline:"Zero games dropped"},{name:"Federico Staksrud",slug:"federico-staksrud",team:"New Jersey 5s",headline:"Comeback of the weekend"},{name:"Parris Todd",slug:"parris-todd",team:"Columbus Sliders",headline:"Upset architect"}],$=r=>({wins:5-r%3,games:6,point_diff:14-r*4,dreambreakers:r%2}),ie=r=>(r??"").split(",").map(a=>a.trim()).filter(Boolean),ls=()=>{const r=je(),[a,p]=ve(),l=m.useMemo(()=>{const s=ie(a.get("panel"));return!s.length||s.includes("all")?new Set(["flow","faces","rip","vault","shards","boost","burn","rules"]):new Set(s)},[a]),b=a.get("size")||"md",d=V(a.get("rarity")??"mythic"),n=a.get("showcase")==="1",h=a.get("burned")==="1",k=Math.max(1,Number(a.get("copies")??1)||1),u=a.get("live")==="1",f=a.get("compact")==="1",y=a.get("userId"),E=a.get("source")??"participation",t=Math.max(0,Number(a.get("dupes")??1)||0),j=V(a.get("burnRarity")??"mythic"),x=Math.max(0,Number(a.get("burnBase")??1e3)||0),z=a.get("burnKeep")==="1",F=m.useMemo(()=>{const s=ie(a.get("pull")).map(c=>V(c));return s.length?s.slice(0,8):["common","common","uncommon","rare",d]},[a,d]),[pe,O]=m.useState(a.get("rip")==="1"),[A,ue]=m.useState([]),g=m.useCallback((s,c)=>{const o=new URLSearchParams(a);c===null?o.delete(s):o.set(s,c),p(o,{replace:!0})},[a,p]),xe=m.useMemo(()=>({id:"lab-pack",event_id:"lab-event",source:E,source_detail:null,created_at:new Date().toISOString(),event_name:"MLP Orlando Pick 'Em"}),[E]),U=m.useMemo(()=>F.map((s,c)=>{const o=N[c%N.length],T=c<t;return{card_definition_id:`lab-${c}-${s}`,player_name:o.name,player_slug:o.slug,team_name:o.team,rarity:s,stat_block:$(c),image_url:null,headline:o.headline,tournament_name:"MLP Orlando",season_label:"2026",serial:T?null:100+c,serial_ceiling:s==="mythic"?25:500,is_duplicate:T,is_new:!T,shards:T?ce[s]:0,slot:c+1}}),[F,t]),he=m.useMemo(()=>S.map((s,c)=>{const o=N[c%N.length];return{id:`lab-owned-${s}`,serial:10+c,is_burned:!1,acquired_at:new Date().toISOString(),copies:c===0?3:1,scrappableCopies:c===0?3:1,usedCopies:0,definition:{id:`lab-def-${s}`,event_id:"lab-event",tournament_name:"MLP Orlando Pick 'Em",season_label:"2026",player_name:o.name,player_slug:o.slug,team_name:o.team,rarity:s,stat_block:$(c),serial_ceiling:500,image_url:null,headline:o.headline}}}),[]),D=ne(u?y:"__lab_disabled__"),Z=ne(),[X,Q]=m.useState("idle"),[ee,se]=m.useState(null),ge=m.useCallback(async()=>{Q("running"),se(null);try{const s=await Z.claimPacks();se(s>0?`Granted ${s} pack${s===1?"":"s"} â open the vault panel to rip.`:"No new packs earned (already claimed, or no completed event with a minted set).")}finally{Q("idle")}},[Z]),be=m.useCallback(async s=>(await new Promise(c=>setTimeout(c,400)),ue(U),U),[U]),fe=A.reduce((s,c)=>s+c.shards,0);return e.jsxs("div",{className:"min-h-screen pb-safe pl-safe pr-safe",style:{background:"var(--gradient-header)"},children:[e.jsxs("div",{className:"pb-24 px-4 pt-4 max-w-3xl mx-auto overflow-x-hidden",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx(i,{variant:"ghost",size:"icon",onClick:()=>r("/pickem"),"aria-label":"Back",children:e.jsx(De,{className:"h-5 w-5"})}),e.jsxs("h1",{className:"text-2xl font-bold flex items-center gap-2",children:[e.jsx(oe,{className:"h-6 w-6 text-primary"}),"Cards Lab"]}),e.jsx(de,{variant:u?"default":"secondary",className:"ml-auto text-[10px]",children:u?"LIVE DATA":"MOCK"})]}),e.jsxs(_,{style:{background:"var(--gradient-match-card)"},className:"mb-4 border-border/40",children:[e.jsx(w,{className:"pb-2",children:e.jsx(C,{className:"text-base",children:"Test params"})}),e.jsxs(P,{className:"space-y-3 text-xs",children:[e.jsx("div",{className:"flex flex-wrap gap-1.5",children:["all","flow","faces","rip","vault","shards","boost","burn","rules"].map(s=>e.jsx(i,{size:"sm",variant:a.get("panel")===s||!a.get("panel")&&s==="all"?"default":"outline",className:"h-7 px-2 text-[11px]",onClick:()=>g("panel",s==="all"?null:s),children:s},s))}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:S.map(s=>e.jsx(i,{size:"sm",variant:d===s?"default":"outline",className:"h-7 px-2 text-[11px]",style:d===s?{background:H(s,.35)}:void 0,onClick:()=>g("rarity",s),children:R(s).label},s))}),e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[["sm","md","lg"].map(s=>e.jsx(i,{size:"sm",variant:b===s?"default":"outline",className:"h-7 px-2 text-[11px]",onClick:()=>g("size",s),children:s},s)),e.jsx(i,{size:"sm",variant:n?"default":"outline",className:"h-7 px-2 text-[11px]",onClick:()=>g("showcase",n?null:"1"),children:"showcase"}),e.jsx(i,{size:"sm",variant:h?"default":"outline",className:"h-7 px-2 text-[11px]",onClick:()=>g("burned",h?null:"1"),children:"burned"}),e.jsx(i,{size:"sm",variant:u?"default":"outline",className:"h-7 px-2 text-[11px]",onClick:()=>g("live",u?null:"1"),children:"live data"}),e.jsx(i,{size:"sm",variant:f?"default":"outline",className:"h-7 px-2 text-[11px]",onClick:()=>g("compact",f?null:"1"),children:"compact"})]}),e.jsx("pre",{className:"whitespace-pre-wrap text-[10px] leading-relaxed text-muted-foreground",children:`panel=flow,faces,rip,vault,shards,boost,burn,rules sections to render 2rarity=mythic size=lg showcase=1 burned=1 copies=3 3rip=1 pull=common,rare,epic,legendary,mythic dupes=2 4source=participation|top10|medal_sweep|shard_purchase 5live=1 userId=<uuid> compact=1 6burnRarity=mythic burnBase=1000 burnKeep=1 (panel=burn)`})]})]}),l.has("flow")&&e.jsxs(_,{style:{background:"var(--gradient-match-card)"},className:"mb-4 border-border/40",children:[e.jsx(w,{className:"pb-2",children:e.jsx(C,{className:"text-base",children:"User journey"})}),e.jsxs(P,{className:"space-y-3 text-xs",children:[e.jsx("div",{className:"space-y-2",children:[{t:"1 · Play the event",d:"Submitting Pick'em picks is the only entitlement that matters for a base pack. Nothing shows up while the event is open."},{t:"2 · Event completes â cards get minted",d:"mint-event-cards builds that event's card set from the finalized results. Ru
6ns on cron, and grant-event-packs self-heals it if the cron hasn't fired yet."},{t:"3 · Packs are granted",d:"grant-event-packs awards up to 3: participation, top-10 finish, perfect medal sweep. Idempotent, so it can never double-pay."},{t:"4 · User claims in their profile",d:'Profile â Card Vault. Unopened packs appear as a foil tile row ("N packs ready"). "Check rewards" calls grant-event-packs on demand if nothing is showing.'},{t:"5 · Rip it",d:"Tapping the pack tile opens the rip experience: 5 cards, server-rolled. New cards land in the binder; duplicates convert to shards."},{t:"6 · Use it",d:"One card can be equipped per open event as a Pick'em boost (max +20%) â it burns on use. 300 shards buys another pack."}].map(s=>e.jsxs("div",{className:"rounded-lg border border-border/40 bg-background/30 p-2.5",children:[e.jsx("div",{className:"text-[11px] font-bold uppercase tracking-wider text-foreground",children:s.t}),e.jsx("div",{className:"mt-0.5 text-[11px] leading-relaxed text-muted-foreground",children:s.d})]},s.t))}),e.jsxs("div",{className:"flex flex-wrap gap-1.5 pt-1",children:[e.jsx(i,{size:"sm",className:"h-8 px-2.5 text-[11px]",onClick:()=>r("/account-settings#card-vault"),children:"Open my profile vault"}),e.jsxs(i,{size:"sm",variant:"outline",className:"h-8 px-2.5 text-[11px]",disabled:X==="running",onClick:ge,children:[e.jsx(te,{className:q("mr-1 h-3 w-3",X==="running"&&"animate-spin")}),"Run real claim (grant-event-packs)"]}),e.jsx(i,{size:"sm",variant:"outline",className:"h-8 px-2.5 text-[11px]",onClick:()=>g("panel","vault"),children:"Jump to live vault"})]}),ee&&e.jsx("div",{className:"text-[11px] text-muted-foreground",children:ee}),e.jsxs("div",{className:"text-[11px] text-muted-foreground",children:["Where users find it: ",e.jsx("span",{className:"text-foreground",children:"Profile â Card Vault"})," (own packs, shards, boost picker, binder) and"," ",e.jsx("span",{className:"text-foreground",children:"any user's profile drawer â Card Vault"})," (read-only binder, no packs)."]})]})]}),l.has("faces")&&e.jsxs(_,{style:{background:"var(--gradient-match-card)"},className:"mb-4 border-border/40",children:[e.jsx(w,{className:"pb-2",children:e.jsx(C,{className:"text-base",children:"Card faces"})}),e.jsxs(P,{className:"space-y-4",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("div",{className:"w-48",children:e.jsx(ae,{card:{player_name:N[0].name,player_slug:N[0].slug,team_name:N[0].team,rarity:d,stat_block:$(0),headline:N[0].headline,tournament_name:"MLP Orlando",season_label:"2026",serial:7,serial_ceiling:25},size:"lg",copies:k,showcase:n,burned:h})})}),e.jsx("div",{className:"grid grid-cols-3 gap-2",children:S.map((s,c)=>{const o=N[c%N.length];return e.jsx(ae,{card:{player_name:o.name,player_slug:o.slug,team_name:o.team,rarity:s,stat_block:$(c),headline:o.headline,tournament_name:"MLP Orlando",season_label:"2026",serial:20+c,serial_ceiling:500},size:b,showcase:n,burned:h},s)})}),e.jsxs("div",{className:"text-[11px] text-muted-foreground",children:["Boost value per rarity:"," ",S.map(s=>`${R(s).label} ${G(Y[s])}`).join(" · ")]})]})]}),l.has("rip")&&e.jsxs(_,{style:{background:"var(--gradient-match-card)"},className:"mb-4 border-border/40",children:[e.jsx(w,{className:"pb-2",children:e.jsxs(C,{className:"text-base flex items-center gap-2",children:[e.jsx(W,{className:"h-4 w-4 text-primary"}),"Pack rip"]})}),e.jsxs(P,{className:"space-y-3 text-xs",children:[e.jsx("div",{className:"flex flex-wrap gap-1.5",children:[{label:"All commons",pull:"common,common,common,common,common"},{label:"Standard",pull:"common,common,uncommon,rare,epic"},{label:"Legendary hit",pull:"common,uncommon,rare,epic,legendary"},{label:"Mythic hit",pull:"common,uncommon,rare,legendary,mythic"},{label:"All dupes",pull:"rare,rare,epic,epic,legendary"}].map(s=>e.jsx(i,{size:"sm",variant:a.get("pull")===s.pull?"default":"outline",className:"h-7 px-2 text-[11px]",onClick:()=>g("pull",s.pull),children:s.label},s.label))}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.jsx("span",{className:"text-muted-foreground",children:"Duplicates:"}),[0,1,2,5].map(s=>e.jsx(i,{size:"sm",variant:t===s?"default":"outline",className:"h-7 px-2 text-[11px]",onClick:()=>g("dupes",String(s)),children:s},s))]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.jsx("span",{className:"text-muted-foreground",children:"Source:"}),["participation","top10","medal_sweep","shard_purchase"].map(s=>e.jsx(i,{size:"sm",variant:E===s?"default":"outline",className:"h-7 px-2 text-[11px]",onClick:()=>g("source",s),children:s},s))]}),e.jsxs(i,{onClick:()=>O(!0),className:"w-full gap-2",children:[e.jsx(W,{className:"h-4 w-4"}),"Rip pack (",F.length," cards)"]}),A.length>0&&e.jsxs("div",{className:"text-muted-foreground",children:["Last rip: ",A.filter(s=>s.is_new).length," new ·"," ",A.filter(s=>s.is_duplicate).length," dupes ·"," ",fe," shards"]})]})]}),l.has("shards")&&e.jsxs("div",{className:"mb-4",children:[e.jsx(Se,{userId:u?y:"__lab_disabled__",onBuyPack:async()=>(O(!0),{error:null})}),e.jsxs("p",{className:"mt-2 text-[11px] text-muted-foreground",children:["Shard values: ",S.map(s=>`${R(s).label} ${ce[s]}`).join(" · ")]})]}),l.has("boost")&&e.jsxs(_,{style:{background:"var(--gradient-match-card)"},className:"mb-4 border-border/40",children:[e.jsx(w,{className:"pb-2",children:e.jsx(C,{className:"text-base",children:"Boost picker"})}),e.jsxs(P,{children:[e.jsx(Le,{cards:u?D.cards:he}),e.jsx("p",{className:"mt-2 text-[11px] text-muted-foreground",children:"Equip writes to the real open event â use mock cards only to inspect layout."})]})]}),l.has("burn")&&e.jsxs(_,{style:{background:"var(--gradient-match-card)"},className:"mb-4 border-border/40",children:[e.jsx(w,{className:"pb-2",children:e.jsx(C,{className:"text-base",children:"Burn flow tester"})}),e.jsxs(P,{children:[e.jsx(Fe,{rarity:j,basePoints:x,keepRows:z,onParamChange:g}),e.jsx("p",{className:"mt-2 text-[11px] text-muted-foreground",children:"Admin only. The sandbox run creates a hidden throwaway event, runs the real apply_card_boosts + settle triggers, then deletes every row it made (unless âkeep rowsâ is on). Live events and leaderboards are never touched."})]})]}),l.has("rules")&&e.jsxs(_,{style:{background:"var(--gradient-match-card)"},className:"mb-4 border-border/40",children:[e.jsx(w,{className:"pb-2",children:e.jsx(C,{className:"text-base",children:"Pack rules modal"})}),e.jsx(P,{children:e.jsx(qe,{})})]}),l.has("vault")&&e.jsxs(_,{style:{background:"var(--gradient-match-card)"},className:q("mb-4 border-border/40"),children:[e.jsxs(w,{className:"pb-2 flex-row items-center justify-between space-y-0",children:[e.jsxs(C,{className:"text-base",children:["Card vault ",f?"(compact)":""]}),e.jsx(i,{size:"icon",variant:"ghost",onClick:()=>{var s;return(s=D.refresh)==null?void 0:s.call(D)},"aria-label":"Refresh vault",children:e.jsx(te,{className:"h-4 w-4"})})]}),e.jsx(P,{children:e.jsx(ze,{userId:y??void 0,compact:f})})]})]}),pe&&e.jsx(Pe,{pack:xe,onOpen:be,onClose:()=>O(!1),onFinished:()=>O(!1)})]})};export{ls 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.