PageSourceSearch

https://pogocodes.com/assets/RaidLobbyPage-D54M64QE.js

js pogocodes.com collected 2026-09-29 07:15:24 UTC 24,470 bytes, 1 lines download raw bytes

1import{r as m,m as M,j as t,y as ue,g as me,X as ee,B as R,A as q,U as he,S as I,b as fe,a as xe,V as T,h as ge,N as pe}from"./index-D6TocMku.js";import{l as H,p as te,q as be,b as ne,a as ae,r as se,S as re,c as ie,d as ye,C as je,e as we,H as ve,B as P,P as E,t as Ne,R as oe,A as _e,J as Me,u as $}from"./AddHostModal-Bhg1vNO7.js";import{U as le}from"./user-plus-CdyRLkaM.js";import{Z as V}from"./zap-z_dSH67L.js";import{C as Se}from"./crown-DEl_pqiL.js";import{A as Ce}from"./arrow-left-Dtn630wp.js";import{A as Pe}from"./alert-triangle-DT5QEcUI.js";import"./alert-circle-DotFeeKH.js";import"./shield-BBCnYmE3.js";function C(e){const a=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&a==="[object Date]"?new e.constructor(+e):typeof e=="number"||a==="[object Number]"||typeof e=="string"||a==="[object String]"?new Date(e):new Date(NaN)}function ke(e,a){return e instanceof Date?new e.constructor(a):new Date(a)}const B=6e4,K=525600,X=43200,Q=1440;let De={};function Te(){return De}function G(e){const a=C(e),n=new Date(Date.UTC(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds()));return n.setUTCFullYear(a.getFullYear()),+e-+n}function ze(e,a){const n=C(e),s=C(a),r=n.getTime()-s.getTime();return r<0?-1:r>0?1:r}function Ae(e){return ke(e,Date.now())}function Re(e){return a=>{const s=(e?Math[e]:Math.trunc)(a);return s===0?0:s}}const We={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Fe=(e,a,n)=>{let s;const r=We[e];return typeof r=="string"?s=r:a===1?s=r.one:s=r.other.replace("{{count}}",a.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+s:s+" ago":s};function J(e){return(a={})=>{const n=a.width?String(a.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Le={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Oe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ee={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Je={date:J({formats:Le,defaultWidth:"full"}),time:J({formats:Oe,defaultWidth:"full"}),dateTime:J({formats:Ee,defaultWidth:"full"})},Ue={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},He=(e,a,n,s)=>Ue[e];function z(e){return(a,n)=>{const s=n!=null&&n.context?String(n.context):"standalone";let r;if(s==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,d=n!=null&&n.width?String(n.width):o;r=e.formattingValues[d]||e.formattingValues[o]}else{const o=e.defaultWidth,d=n!=null&&n.width?String(n.width):e.defaultWidth;r=e.values[d]||e.values[o]}const i=e.argumentCallback?e.argumentCallback(a):a;return r[i]}}const qe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ve={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ye={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Ie={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
1ay","Saturday"]},$e={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Be={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Ke=(e,a)=>{const n=Number(e),s=n%100;if(s>20||s<10)switch(s%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Xe={ordinalNumber:Ke,era:z({values:qe,defaultWidth:"wide"}),quarter:z({values:Ve,defaultWidth:"wide",argumentCallback:e=>e-1}),month:z({values:Ye,defaultWidth:"wide"}),day:z({values:Ie,defaultWidth:"wide"}),dayPeriod:z({values:$e,defaultWidth:"wide",formattingValues:Be,defaultFormattingWidth:"wide"})};function A(e){return(a,n={})=>{const s=n.width,r=s&&e.matchPatterns[s]||e.matchPatterns[e.defaultMatchWidth],i=a.match(r);if(!i)return null;const o=i[0],d=s&&e.parsePatterns[s]||e.parsePatterns[e.defaultParseWidth],g=Array.isArray(d)?Ge(d,j=>j.test(o)):Qe(d,j=>j.test(o));let u;u=e.valueCallback?e.valueCallback(g):g,u=n.valueCallback?n.valueCallback(u):u;const b=a.slice(o.length);return{value:u,rest:b}}}function Qe(e,a){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&a(e[n]))return n}function Ge(e,a){for(let n=0;n<e.length;n++)if(a(e[n]))return n}function Ze(e){return(a,n={})=>{const s=a.match(e.matchPattern);if(!s)return null;const r=s[0],i=a.match(e.parsePattern);if(!i)return null;let o=e.valueCallback?e.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const d=a.slice(r.length);return{value:o,rest:d}}}const et=/^(\d+)(th|st|nd|rd)?/i,tt=/\d+/i,nt={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},at={any:[/^b/i,/^(a|c)/i]},st={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},rt={any:[/1/i,/2/i,/3/i,/4/i]},it={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},ot={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},lt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},dt={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},ct={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},ut={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},mt={ordinalNumber:Ze({matchPattern:et,parsePattern:tt,valueCallback:e=>parseInt(e,10)}),era:A({matchPatterns:nt,defaultMatchWidth:"wide",parsePatterns:at,defaultParseWidth:"any"}),quarter:A({matchPatterns:st,defaultMatchWidth:"wide",parsePatterns:rt,defaultParseWidth:"any",valueCallback:e=>e+1}),month:A({matchPatterns:it,defaultMatchWidth:"wide",parsePatterns:ot,defaultParseWidth:"any"}),day:A({matchPatterns:lt,defaultMatchWidth:"wide",parsePatterns:dt,defaultParseWidth:"any"}),dayPeriod:A({matchPatterns:ct,defaultMatchWidth:"any",parsePatterns:ut,defaultParseWidth:"any"})},ht={code:"en-US",formatDistance:Fe,formatLong:Je,formatRelative:He,localize:Xe,match:mt,options:{weekStartsOn:0,firstWeekContainsDate:1}};function ft(e,a,n){const s=Te(),r=(n==null?void 0:n.locale)??s.locale??ht,i=ze(e,a);if(isNaN(i))throw new RangeError("Invalid time value");const o=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:i});let d,g;i>0?(d=C(a),g=C(e)):(d=C(e),g=C(a));const u=Re((n==null?void 0:n.roundingMethod)??"round"),b=g.getTime()-d.getTime(),j=b/B,S=G(g)-G(d),w=(b-S)/B,f=n==null?void 0:n.unit;let p;if(f?p=f:j<1?p="second":j<60?p="minute":j<Q?p="hour":w<X?p="day":w<K?p="month":p="year",p==="second"){const y=u(b/1e3);return r.formatDistance("xSeconds",y,o)}else if(p==="minute"){const y=u(j);return r.formatDistance("xMinutes",y,o)}else if(p==="hour"){const y=u(j/60);return r.formatDistance("xHours",y,o)}else if(p==="day"){const y=u(w/Q);return r.formatDistance("xDays",y,o)}else if(p==="month"){const y=u(w/X);return y===12&&f!=="month"?r.formatDistance("xYears",1,o):r.formatDistance("xMonths",y,o)}else{const y=u(w/K);return r.formatDistance("xYears",y,o)}}function xt(e,a){return ft(e,Ae(e),a)}function Z(e){if(!e)return 0;const a=Math.floor((new Date(e).getTime()-Date.now())/1e3);return Math.max(0,a)}function U(e){const a=new Date(e).getTime();return Number.isNaN(a)?"":xt(new Date(a),{addSuffix:!0})}function gt(e){const[a,n]=m.useState(null),[s,r]=m.useState(0),[i,o]=m.useState([]),[d,g]=m.useState(!0),[u,b]=m.useState(!1),[j,S]=m.useState(!1),w=m.useRef(void 0),f=m.useCallback(l=>{n(l),w.current=l==null?void 0:l.starts_at,r(Z(l==null?void 0:l.starts_at))},[]),p=m.useCallback(async()=>{const l=H(),[c,N,_]=await Promise.all([M.rpc("get_raid_for_participant",{p_raid_id:e,p_client_id:l}),M.from("raids").select("*").eq("id",e).maybeSingle(),M.from("raid_participants").select("*").eq("raid_id",e).order("joined_at")]),v=c.data??null,x=N.data??null,h=v??x;if(!h||h.status==="cancelled"){f(null),o([]),b(!0),g(!1);return}b(!1),S(h.status==="started"),f(h),o(_.data??[]),g(!1)},[e,f]);m.useEffect(()=>{let l=!0;g(!0),b(!1),S(!1),p();const c=M.channel(`public:raids:lobby:${e}`).on("postgres_changes",{event:"UPDATE",schema:"public",table:"raids",filter:`id=eq.${e}`},_=>{if(!l)return;const v=_.new;if(v.status==="cancelled"){b(!0);return}v.status==="started"&&S(!0),n(x=>{const h={...x??v,...v};
1return(h.host_code===void 0||h.host_code===null)&&(x!=null&&x.host_code)&&(h.host_code=x.host_code),w.current=h.starts_at,h})}).subscribe(),N=M.channel(`public:raid_participants:lobby:${e}`).on("postgres_changes",{event:"*",schema:"public",table:"raid_participants",filter:`raid_id=eq.${e}`},_=>{if(!l)return;if(_.eventType==="DELETE"){const x=_.old;o(h=>h.filter(Y=>Y.id!==x.id));return}const v=_.new;o(x=>(x.findIndex(D=>D.id===v.id)===-1?[...x,v]:x.map(D=>D.id===v.id?v:D)).sort((D,ce)=>D.joined_at.localeCompare(ce.joined_at)))}).subscribe();return()=>{l=!1,M.removeChannel(c),M.removeChannel(N)}},[e,p]),m.useEffect(()=>{const l=()=>r(Z(w.current));l();const c=window.setInterval(l,1e3);return()=>window.clearInterval(c)},[]);const y=m.useMemo(()=>a?{...a,secondsLeft:s,isFull:a.joined_count>=a.trainers_needed}:null,[a,s]),k=m.useMemo(()=>{if(i.length===0)return null;const l=te(e),c=H();return(l?i.find(N=>N.id===l.participantId):void 0)??i.find(N=>N.client_id===c)??null},[i,e]),W=m.useMemo(()=>k?k.is_host?"host":"participant":be(e),[k,e]),L=m.useMemo(()=>i.filter(l=>!l.is_host).length,[i]),O=m.useMemo(()=>i.filter(l=>!l.is_host&&l.added_host_at).length,[i]),F=m.useMemo(()=>{const l=[];a&&l.push({item:{id:"system:opened",type:"system",text:"Lobby opened — waiting for trainers",at:U(a.created_at)},sortKey:new Date(a.created_at).getTime()});for(const c of i)c.is_host||(l.push({item:{id:`joined:${c.id}`,type:"system",text:`${c.trainer_name} joined the lobby`,at:U(c.joined_at)},sortKey:new Date(c.joined_at).getTime()}),c.added_host_at&&l.push({item:{id:`added:${c.id}`,type:"added",who:c.trainer_name,at:U(c.added_host_at)},sortKey:new Date(c.added_host_at).getTime()}));return l.sort((c,N)=>N.sortKey-c.sortKey).map(c=>c.item)},[a,i]);return{raid:y,participants:i,feed:F,role:W,me:k,loading:d,notFound:u,started:j,joinedCount:L,addedCount:O,refetch:p}}function pt({raid:e,role:a,me:n,joinedCount:s,addedCount:r,hostCode:i,onStart:o,onAddPrompt:d,onCancel:g}){const u=ne(e),b=a==="host",j=!!(n!=null&&n.added_host_at);return t.jsxs("div",{className:"flex flex-col gap-[18px]",children:[t.jsxs("div",{className:"flex flex-col items-center gap-4 roun
1ded-xl bg-white p-6 shadow-lg",children:[t.jsxs("div",{className:"flex w-full items-center gap-[18px]",children:[t.jsx(ae,{spriteUrl:se(e),fallbackUrl:re(e.pokemon_id),tier:e.tier,size:104,alt:u.name}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsxs("div",{className:"mb-1.5 flex items-center gap-2.5",children:[t.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:ie(u)}),t.jsx(ye,{tier:e.tier,size:"sm"})]}),t.jsxs("div",{className:"flex flex-wrap gap-3 text-sm text-gray-500",children:[t.jsxs("span",{className:"inline-flex items-center gap-1.5 font-semibold text-gray-700",children:[t.jsx(ue,{size:15})," ",e.boss_cp.toLocaleString()," CP"]}),t.jsx("span",{className:"inline-flex items-center gap-1.5",children:e.country?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-sm",children:me(e.country)})," ",e.country]}):t.jsx(t.Fragment,{children:"🌍 Remote"})})]})]})]}),t.jsx("div",{className:"h-px w-full bg-gray-100"}),t.jsxs("div",{className:"flex flex-col items-center gap-1",children:[t.jsx("span",{className:"text-xs font-semibold tracking-[0.06em] text-gray-500",children:"RAID STARTS IN"}),t.jsx(je,{secondsLeft:e.secondsLeft,big:!0,urgentAt:60})]}),t.jsxs("div",{className:"flex w-full flex-col gap-[7px]",children:[t.jsx(we,{joined:s,needed:e.trainers_needed}),t.jsxs("div",{className:"flex justify-between text-sm font-medium text-gray-500",children:[t.jsxs("span",{children:[s,"/",e.trainers_needed," joined"]}),t.jsxs("span",{children:[r," added the host"]})]})]})]}),!b&&i&&t.jsx(ve,{hostName:e.host_name,hostCode:i}),b?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center justify-center gap-1.5 text-sm font-medium text-gray-600",children:[t.jsx(le,{size:15})," ",r," of ",s," ",s===1?"trainer":"trainers"," added you"]}),t.jsxs(P,{variant:"primary",full:!0,onClick:o,children:[t.jsx(V,{size:19})," Start Raid"]}),t.jsxs("button",{type:"button",onClick:g,className:"mx-auto mt-0.5 inline-flex items-center gap-1.5 text-sm font-medium text-gray-400 transition-colors hover:text-red-600",children:[t.jsx(ee,{size:14})," Cancel the raid"]})]}):n?j?t.jsxs("div",{className:"flex items-center justify-center gap-2 py-3 text-sm font-semibold text-gray-600",children:[t.jsx(R,{size:17})," You're ready — waiting for the host to start"]}):t.jsxs(P,{variant:"success",full:!0,onClick:d,children:[t.jsx(q,{size:19})," I Added the Host"]}):null]})}function de({name:e,size:a=40,you:n=!1}){const s=(e||"?").split(/\s+/).map(r=>r[0]).join("").slice(0,2).toUpperCase();return t.jsx("div",{className:"inline-flex flex-shrink-0 items-center justify-center rounded-full bg-gray-200 font-bold text-gray-700",style:{width:a,height:a,fontSize:a*.36,boxSh
1adow:n?"0 0 0 3px #93c5fd":"0 1px 2px 0 rgba(0,0,0,0.05)"},children:s})}function bt({participant:e}){return e.is_host?t.jsxs(E,{tone:"info",children:[t.jsx(Se,{size:12})," Host"]}):e.added_host_at?t.jsxs(E,{tone:"success",children:[t.jsx(q,{size:12})," Added host"]}):t.jsxs(E,{tone:"neutral",children:[t.jsx(R,{size:12})," Joining…"]})}function yt({participants:e}){var i,o;const a=H(),n=((i=e[0])==null?void 0:i.raid_id)??"",s=((o=te(n))==null?void 0:o.participantId)??null,r=d=>s!=null&&d.id===s||d.client_id!=null&&d.client_id===a;return t.jsxs("div",{className:"rounded-xl bg-white px-5 shadow-lg",children:[t.jsxs("div",{className:"flex items-center gap-2 py-3 text-gray-700",children:[t.jsx(he,{size:16}),t.jsx("span",{className:"text-base font-bold",children:"Trainers"}),t.jsxs("span",{className:"text-sm text-gray-400",children:["· ",e.length]})]}),e.map((d,g)=>{const u=r(d);return t.jsxs("div",{className:`flex items-center gap-3 py-[11px] ${g===e.length-1?"":"border-b border-gray-100"}`,children:[t.jsx(de,{name:d.trainer_name,size:40,you:u}),t.jsx("div",{className:"min-w-0 flex-1",children:t.jsxs("div",{className:"flex items-center gap-1.5 text-base font-semibold text-gray-900",children:[d.trainer_name,u&&t.jsx("span",{className:"text-xs font-bold text-blue-600",children:"YOU"})]})}),t.jsx(bt,{participant:d})]},d.id)})]})}function jt({feed:e}){return t.jsxs("div",{className:"rounded-xl bg-white px-5 pb-3.5 shadow-lg",children:[t.jsxs("div",{className:"flex items-center gap-2 py-3 text-gray-700",children:[t.jsx(I,{size:16}),t.jsx("span",{className:"text-base font-bold",children:"Activity"})]}),e.map(a=>{const n=a.type==="added";return t.jsxs("div",{className:"flex items-start gap-2.5 py-[7px]",children:[t.jsx("span",{className:`mt-px inline-flex flex-shrink-0 ${n?"text-green-500":"text-gray-400"}`,children:n?t.jsx(Ne,{size:15}):t.jsx(I,{size:15})}),t.jsx("span",{className:`flex-1 text-sm leading-snug ${n?"text-gray-700":"text-gray-500"}`,children:n?t.jsxs(t.Fragment,{children:[t.jsx("strong",{className:"font-semibold text-gray-900",children:a.who})," ","added the host"]}):a.text}),t.jsx("span",{className:"flex-shrink-0 text-xs text-gray-400",children:a.at})]},a.id)}),t.jsx("p",{className:"mt-3 text-xs leading-relaxed text-gray-400",children:"No open chat — just the “Added” button. Keeps lobbies fast, safe, and spam-free."})]})}function wt({raid:e,participants:a,onClose:n}){const s=ne(e),r=a.filter(i=>!i.is_host).length;return t.jsxs("div",{className:"fixed inset-0 z-[70] flex flex-col items-center justify-center p-8 text-center text-white",style:{background:"radial-gradient(120% 90% at 50% 18%, #3b82f6, #2563eb 58%, #1d4ed8)"},children:[t.jsx("div",{className:"pointer-events-none absolute left-1/2 top-[8%] -translate-x-1/2 rounded-full",style:{width:480,height:480,background:"radial-gradient(circle, rgba(255,255,255,0.3), transparent 65%)"}}),t.jsxs("div",{className:"relative flex max-w-[520px] flex-col items-center gap-[18px]",children:[t.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-white/20 px-3.5 py-1.5 text-sm font-semibold text-white",children:[t.jsx(V,{size:14})," Raid started"]}),t.jsxs("div",{className:"animate-floatBoss relative",children:[t.jsx("div",{className:"animate-haloPulse absolute -inset-[22px] rounded-full bg-white/[0.18]"}),t.jsx(ae,{spriteUrl:se(e),fallbackUrl:re(e.pokemon_id),tier:e.tier,size:220,halo:!1,alt:s.name})]}),t.jsx("h1",{className:"text-[46px] font-bold leading-[1.04] tracking-tight",children:"It's go time!"}),t.jsxs("p",{className:"text-lg leading-relaxed text-white/90",children:["The ",t.jsx("strong",{children:ie(s)})," raid just started with"," ",r," ",r===1?"trainer":"trainers","."]}),t.jsx("div",{className:"flex items-center justify-center",children:a.slice(0,6).map((i,o)=>t.jsx("div",{className:"rounded-full",style:{marginLeft:o===0?0:-10,boxShadow:"0 0 0 3px #2563eb"},children:t.jsx(de,{name:i.trainer_name,size:38})},i.id))}),t.jsxs("button",{type:"button",onClick:n,className:"mt-2 inline-flex items-center gap-2 rounded-lg bg-white px-10 py-[15px] text-base font-bold text-blue-600 shadow-lg",children:[t.jsx(q,{size:19})," Got it — let's raid!"]})]})]})}function vt({open:e,joinedCount:a,starting:n,onConfirm:s,onClose:r}){const i=t.jsxs("div",{className:"flex gap-2.5",children:[t.jsx(P,{variant:"secondary",full:!0,onClick:r,children:"Keep waiting"}),t.jsx(P,{variant:"primary",full:!0,onClick:s,disabled:n,children:n?t.jsxs(t.Fragment,{children:[t.jsx(R,{className:"animate-spin",size:18})," Starting…"]}):t.jsxs(t.Fragment,{children:[t.jsx(V,{size:18})," Start Raid"]})})]});return t.jsx(oe,{open:e,onClose:r,title:"Start the raid now?",widthClass:"sm:max-w-[420px]",footer
1:i,children:t.jsxs("p",{className:"text-base leading-relaxed text-gray-600",children:[a," ",a===1?"trainer gets":"trainers get"," notified instantly, and this raid leaves the public list. Make sure everyone has added you."]})})}function Nt({open:e,joinedCount:a,cancelling:n,onConfirm:s,onClose:r}){const i=t.jsxs("div",{className:"flex gap-2.5",children:[t.jsx(P,{variant:"secondary",full:!0,onClick:r,children:"Keep raid"}),t.jsx(P,{variant:"danger",full:!0,onClick:s,disabled:n,children:n?t.jsxs(t.Fragment,{children:[t.jsx(R,{className:"animate-spin",size:18})," Cancelling…"]}):t.jsxs(t.Fragment,{children:[t.jsx(ee,{size:18})," Cancel raid"]})})]});return t.jsx(oe,{open:e,onClose:r,title:"Cancel this raid?",widthClass:"sm:max-w-[420px]",footer:i,children:t.jsxs("p",{className:"text-base leading-relaxed text-gray-600",children:["This removes the raid for everyone",a>0?` — ${a} ${a===1?"trainer is":"trainers are"} waiting`:"",". This can't be undone."]})})}function At(){const{raidId:e=""}=fe(),a=xe(),{raid:n,participants:s,feed:r,role:i,me:o,loading:d,notFound:g,started:u,joinedCount:b,addedCount:j,refetch:S}=gt(e),[w,f]=m.useState(null),[p,y]=m.useState(!1),[k,W]=m.useState(!1),[L,O]=m.useState(null);if(m.useEffect(()=>{g&&T.error("That raid is no longer available.")},[g]),ge({title:"Raid Lobby — Live Pokémon GO Remote Raid | PogoCodes",description:"Join this live Pokémon GO remote raid lobby — add the host and battle together when it starts.",canonical:"https://pogocodes.com/raids",noindex:!0}),g)return t.jsx(pe,{to:"/raids",replace:!0});if(d||!n)return t.jsxs("div",{className:"flex min-h-[60vh] items-center justify-center text-gray-500",children:[t.jsx(R,{className:"mr-2 h-5 w-5 animate-spin"})," Loading raid…"]});if(u)return t.jsx(wt,{raid:n,participants:s,onClose:()=>a("/raids")});const F=n.host_code??null,l=i==="guest",c=n.status==="open"&&!n.isFull&&n.secondsLeft>0,N=async()=>{const x=$(e);if(!x){T.error("You are not the host of this raid.");return}y(!0);try{const{error:h}=await M.rpc("start_raid",{p_raid_id:e,p_host_token:x});if(h)throw h;f(null)}catch{T.error("Could not start the raid. Try again.")}finally{y(!1)}},_=async()=>{const x=$(e);if(!x){T.error("You are not the host of this raid.");return}W(!0);try{const{error:h}=await M.rpc("cancel_raid",{p_raid_id:e,p_host_token:x});if(h)throw h;f(null),T.success("Raid cancelled — it has been removed from the board."),a("/raids")}catch{T.error("Could not cancel the raid. Try again.")}finally{W(!1)}},v=(x,h)=>{O(h),f("addHost")};return t.jsxs("div",{className:"mx-auto w-full max-w-6xl px-0 pt-5 sm:px-6 sm:pt-7",children:[t.jsxs("button",{type:"button",onClick:()=>a("/raids"),className:"mb-[18px] inline-flex items-center gap-[7px] text-sm font-semibold text-gray-600 transition-colors hover:text-gray-900",children:[t.jsx(Ce,{size:17})," All raids"]}),!l&&t.jsxs("div",{className:"mb-[18px] flex items-start gap-2.5 rounded-lg border border-yellow-200 bg-yellow-50 px-4 py-3 text-sm font-semibold text-yellow-800",children:[t.jsx(Pe,{size:18,className:"mt-px flex-shrink-0 text-yellow-600"}),t.jsx("span",{children:"Don't leave this lobby — you won't be able to get back in."})]}),t.jsxs("div",{className:"grid grid-cols-1 items-start gap-6 lg:grid-cols-[1.1fr_1fr]",children:[t.jsxs("div",{className:"flex flex-col gap-[18px] lg:sticky lg:top-20",children:[t.jsx(pt,{raid:n,role:i,me:o,joinedCount:b,addedCount:j,hostCode:F,onStart:()=>f("start"),onAddPrompt:()=>f("addHost"),onCancel:()=>f("cancel")}),l&&!o&&c&&t.jsxs(P,{variant:"primary",full:!0,onClick:()=>f("join"),children:[t.jsx(le,{size:19})," Join this raid"]})]}),t.jsxs("div",{className:"flex flex-col gap-[18px]",children:[t.jsx(yt,{participants:s}),t.jsx(jt,{feed:r})]})]}),t.jsx(vt,{open:w==="start",joinedCount:b,starting:p,onConfirm:N,onClose:()=>f(null)}),t.jsx(Nt,{open:w==="cancel",joinedCount:b,cancelling:k,onConfirm:_,onClose:()=>f(null)}),t.jsx(_e,{open:w==="addHost",raid:n,hostCode:L??F??"",onClose:()=>f(null),onAdded:()=>{f(null),S()}}),t.jsx(Me,{open:w==="join",raid:n,onClose:()=>f(null),onJoined:v})]})}
1export{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.