PageSourceSearch

https://criticdb.com/_nuxt/DgdC5jCg.js

js criticdb.com collected 2026-10-02 19:11:50 UTC 1,988 bytes, 7 lines download raw bytes

1import{D as d,E as v,I as w,q as n,m as l}from"./CVAGsPFZ.js";function g(){const f=d(),s=v(),e=l(null),t=l(!0),i=l(null);async function o(){if(!s.value?.id)return e.value=null,t.value=!1,null;try{const{data:a,error:r}=await f.from("user_subscriptions").select(`
2          *,
3          subscription_plans:plan_id (
4            id,
5            name
6          )
7        `).eq("user_id",s.value.id).eq("status","active").maybeSingle();if(r)throw r;return e.value=a||null,a}catch(a){return i.value=a instanceof Error?a:new Error("Unknown error occurred"),null}finally{t.value=!1}}const u=n(()=>e.value?.subscription_plans?.name?.toLowerCase()||"free");function c(a){if(!e.value?.subscription_plans?.name)return!1;const r=e.value.subscription_plans.name.toLowerCase();switch(a){case"ad-free":return["premium","ad-free"].includes(r);case"premium":return r==="premium";case"user_reviews":return["premium","pro"].includes(r);default:return!1}}w(s,()=>{s.value?o():(e.value=null,t.value=!1)},{immediate:!0});const m={free:{follow_outlets:!0,notifications:"24h",xp_system:!0,list_functionality:"default",add_games:!0,link_games:!0,ad_free:!1,user_reviews:!1},"ad-free":{follow_outlets:!0,notifications:"72h",xp_system:!0,list_functionality:"custom",add_games:!0,link_games:!0,ad_free:!0,user_reviews:!1},premium:{follow_outlets:!0,notifications:"7d",xp_system:!0,list_functionality:"custom",add_games:!0,link_games:!0,ad_free:!0,user_reviews:!0},pro:{follow_outlets:!0,notifications:"7d",xp_system:!0,list_functionality:"custom",add_games:!0,link_games:!0,ad_free:!0,user_reviews:!0}},_=a=>m[u.value]?.[a],p=n(()=>!!(e.value?.status==="active"&&e.value?.subscription_plans?.name&&e.value?.subscription_plans?.name.toLowerCase()!=="free"));return{currentPlan:e,loading:t,error:i,hasAccess:c,fetchCurrentPlan:o,canAccess:c,getFeatureValue:_,hasPaidPlan:p,currentPlanName:u,debug:n(()=>({currentPlan:e.value,user:s.value?.id,planName:u.value,rawPlanData:e.value?.subscription_plans}))}}export{g as u};

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.