PageSourceSearch

https://www.opalseedmix.com/assets/Quests-ClWzKklt.js

js opalseedmix.com collected 2026-10-09 22:06:49 UTC 6,765 bytes, 1 lines download raw bytes

1import{j as e,B as s,T as t,r,z as o,E as n,Z as a,b9 as i,X as l,Y as c,al as d}from"./mui-vendor-BHQHqGRY.js";import{fZ as u,f_ as p,x as m,f$ as x,b0 as f,eS as h,bm as g,a6 as b,g0 as j,g1 as S,b1 as y,a3 as w,u as q,ci as v,cc as k,fm as I,g2 as P,cN as z,g3 as H,P as C,F as O,a9 as M,fP as F,af as $,ab as N,g4 as W}from"./index-Do2h-m4R.js";import{Q as _,S as T,r as Y}from"./questSponsor-k3rCy8r9.js";import{P as E}from"./PageHeader-_tkmZSJR.js";import{I as L}from"./InstallNudge-BrlUjHMs.js";import{c as B}from"./react-vendor-I0668wfI.js";import"./firebase-vendor-Bv7vikGI.js";import"./HeaderRow-B1YY8Toy.js";import"./useEnablePushFlow-DVhyolaC.js";import"./HomeScreenMock-CYKg0vvN.js";import"./notificationPrefs-9gJ4SJYJ.js";function R({status:r,progress:o}){const n=u({status:r,progress:o}),a=p[n],i=a.label;return e.jsxs(s,{sx:{display:"inline-flex",alignItems:"center",gap:.625,px:1.25,py:.5,borderRadius:999,bgcolor:"#1e1e1e",color:a.color,border:`1.5px solid ${a.color}`,flexShrink:0,height:26,...a.pulse&&{animation:"questPillPulse 1.6s ease-in-out infinite","@keyframes questPillPulse":{"0%, 100%":{boxShadow:`0 0 8px 0 ${a.color}80, 0 0 0 0 ${a.color}66`},"50%":{boxShadow:`0 0 22px 4px ${a.color}CC, 0 0 0 4px ${a.color}22`,filter:"brightness(1.2)"}}}},children:[e.jsx(a.Icon,{sx:{fontSize:16,...a.iconTap&&{animation:"questPillIconTap 1.4s ease-in-out infinite","@keyframes questPillIconTap":{"0%, 60%, 100%":{transform:"translateY(0)"},"30%":{transform:"translateY(2px)"}}}}}),e.jsx(t,{sx:{fontFamily:m,letterSpacing:"0.04em",fontSize:"0.825rem",lineHeight:1,color:"inherit",fontWeight:500,whiteSpace:"nowrap"},children:i})]})}function X({quest:i,status:l,progress:c,sponsor:d,onClick:q}){const v="locked"===l,k=c?.target||1,I=c?.current??0,P=p[u({status:l,progress:c})].color,z=r.createElement(x(i.role),{sx:{fontSize:18,color:"inherit"}});return e.jsx(o,{elevation:0,sx:{bgcolor:v?h:g,borderRadius:2,overflow:"hidden",boxShadow:f,filter:v?"saturate(0.5)":"none",transition:"box-shadow 0.2s, transform 0.2s","&:hover":v?{}:{boxShadow:`${f}, 0 0 20px 2px rgba(0,200,83,0.7)`,transform:"translateY(-2px)"}},children:e.jsxs(n,{onClick:()=>q(i),children:[e.jsxs(s,{sx:{bgcolor:S(i.role).bg,color:S(i.role).color,pl:2,pr:1,py:.5,display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,minHeight:36},children:[e.jsxs(s,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[z,e.jsxs(t,{sx:{fontSize:"0.68rem",fontWeight:500,...b,lineHeight:1,color:"inherit",minWidth:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[j(i.role),i.rewards?.xp?` · ${i.rewards.xp} XP`:""]})]}),e.jsx(R,{status:l,progress:c})]}),e.jsxs(s,{sx:{p:2},children:[e.jsx(t,{sx:{color:v?"rgba(255,255,255,0.5)":"#fff",fontFamily:m,letterSpacing:"0.01em",fontSize:"1.22rem",lineHeight:1.1,mb:1},children:i.title}),e.jsx(_,{businessId:i.businessId,sponsor:d,muted:v,sx:{mb:1}}),e.jsx(t,{variant:"body2",sx:{color:v?"rgba(255,255,255,0.42)":y,fontSize:"0.825rem",lineHeight:1.4,mb:1.5,minHeight:"2.8em",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:i.description}),v?e.jsxs(s,{sx:{minHeight:26,display:"flex",alignItems:"center",gap:1,color:w},children:[e.jsx(a,{sx:{fontSize:22}}),e.jsx(t,{sx:{fontFamily:m,fontSize:"1.1rem",letterSpacing:"0.06em",lineHeight:1,color:"inherit"},children:"This quest is currently locked"})]}):e.jsxs(s,{children:[e.jsxs(s,{sx:{display:"flex",alignItems:"baseline",justifyContent:"space-between",mb:.75},children:[e.jsx(t,{variant:"overline",sx:{color:w,letterSpacing:"0.1em",lineHeight:1,fontSize:"0.65rem"},children:"Progress"}),e.jsxs(t,{variant:"body2",sx:{color:P,...b,fontSize:"0.8rem",lineHeight:1,whiteSpace:"nowrap"},children:[I," of ",k]})]}),e.jsx(T,{current:I,target:k,height:10,color:P})]})]})]})})}const A=e=>{const s=W.indexOf(e);return-1===s?-1:s};function Q(e,s){return"claimed"===e?"completed":"claimable"===e||"in_progress"===e&&(s?.current??0)>0?"started":"not_started"}const Z=[{id:"not_started",label:"Not Started"},{id:"started",label:"Started"},{id:"completed",label:"Completed"}];function G(){const{user:o,userProfile:n}=q(),a=o?.uid,u=v(),{data:p=[],isLoading:x}=k(),{data:f=[],isLoading:h}=I(a,{refetchOnMount:"always"}),{data:g,isLoading:b}=P(a,n,p,f,{refetchOnMount:"always"}),j=z(p.map(e=>e.businessId)),[S]=B(),[y,W]=r.useState(()=>{const e=S.get("filter");return Z.some(s=>s.id===e)?e:"started"}),_=r.useMemo(()=>{const e=new Map;for(const s of f)e.set(s.questId,s);return e},[f]),T=r.useMemo(()=>
1{if(!g)return[];const e=p.map(e=>({quest:e,...H(e,g,_)}));return e.sort((e,s)=>(e.quest.sortOrder??100)-(s.quest.sortOrder??100)),e},[p,g,_]),R=r.useMemo(()=>{const e={all:T.length,not_started:0,started:0,completed:0};for(const s of T)e[Q(s.status,s.progress)]+=1;return e},[T]),G=r.useMemo(()=>{const e="all"===y?T:T.filter(e=>Q(e.status,e.progress)===y);return"not_started"===y?[...e].sort((e,s)=>{const t="locked"===e.status?1:0,r="locked"===s.status?1:0;if(t!==r)return t-r;const o=A(e.quest.role)-A(s.quest.role);return 0!==o?o:(e.quest.sortOrder??100)-(s.quest.sortOrder??100)}):"started"===y?[...e].sort((e,s)=>{const t="claimable"===e.status?0:1,r="claimable"===s.status?0:1;return t!==r?t-r:(e.quest.sortOrder??100)-(s.quest.sortOrder??100)}):e},[T,y]),D=x||h||b;return e.jsxs(C,{width:"feed",sx:{animation:"pageFadeIn 0.3s ease-out"},children:[e.jsx(L,{}),e.jsx(E,{back:!0,icon:i,title:"Quests",subtitle:"Complete quests to earn XP and level up."}),e.jsx(s,{"data-tour":"quest-list",children:D?e.jsx(O,{embedded:!0}):0===T.length?e.jsx(t,{variant:"body2",sx:{color:w,textAlign:"center",py:4},children:"No quests available yet — check back soon."}):e.jsxs(e.Fragment,{children:[e.jsx(l,{value:y,exclusive:!0,onChange:(e,s)=>{s&&W(s)},size:"small",fullWidth:!0,sx:{mb:2,...F,"& .MuiToggleButton-root":{fontFamily:m,letterSpacing:"0.06em",fontSize:"0.85rem",py:.5,px:1,whiteSpace:"nowrap",color:w,border:0,"&:hover":{bgcolor:"rgba(255,255,255,0.04)"},"&.Mui-selected":{...N(),"&:hover":{...N(),...M}}}},children:Z.map(t=>e.jsx(c,{value:t.id,children:e.jsxs(s,{component:"span",sx:$,children:[t.label,e.jsxs(s,{component:"span",sx:{ml:.5,opacity:.7,fontSize:"0.75rem",fontFamily:"inherit"},children:["(",R[t.id],")"]})]})},t.id))}),0===G.length?e.jsxs(t,{variant:"body2",sx:{color:w,textAlign:"center",py:4},children:["all"===y&&"No quests yet.","not_started"===y&&"No quests waiting to be started.","started"===y&&"No quests in progress.","completed"===y&&"You haven’t completed any quests yet."]}):e.jsx(d,{spacing:1.25,children:G.map(({quest:s,status:t,progress:r})=>e.jsx(X,{quest:s,status:t,progress:r,sponsor:Y(s.businessId,j),onClick:e=>u(`/quests/${e.id}`)},s.id))})]})})]})}export{G 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.