var h=e=>{throw TypeError(e)};var m=(e,t,s)=>t.has(e)||h("Cannot "+s);var n=(e,t,s)=>(m(e,t,"read from private field"),s?s.call(e):t.get(e)),o=(e,t,s)=>t.has(e)?h("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s);import{s as c,g as r,e as d,D as x,h as F}from"./c625DOTJ.js";import"./BPHiMHp4.js";import{s as E}from"./zO0CuF4M.js";const f=Symbol();var a,u;class C{constructor(t){o(this,a,c(null));o(this,u,c(null));x(f,this),this.set(t),E("/api/account",5e3,!1,i=>this.set(i.user),i=>{i.status===401?this.set(null):i.status===503&&location.reload()},()=>r(n(this,a))!==null)}get tasks(){return r(n(this,u))}set tasks(t){d(n(this,u),t,!0)}set(t){(!r(n(this,a))||!t||t.date>r(n(this,a)).date)&&d(n(this,a),t??null,!0)}isSignedIn(){return r(n(this,a))!==null}isMature(){var t;return((t=r(n(this,a)))==null?void 0:t.matureEnabled)===!0}canClaimFreeGems(){return this.isSignedIn()?Date.now()>r(n(this,a)).nextFreeGemsAt:!1}data(){return r(n(this,a))}static get(){const t=F(f);return new Proxy(t,{get:(s,i)=>{if(i in s){const l=s[i];return typeof l=="function"?l.bind(s):l}if(s.data()&&i in s.data())return s.data()[i]}})}}a=new WeakMap,u=new WeakMap;export{C as U};