"use strict";var o=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var d=(s,r)=>o(s,"name",{value:r,configurable:true});var h=(s,r)=>{for(var e in r)o(s,e,{get:r[e],enumerable:true})};var p=(s,r,e,a)=>{if(r&&typeof r==="object"||typeof r==="function"){for(let t of w(r))if(!l.call(s,t)&&t!==e)o(s,t,{get:()=>r[t],enumerable:!(a=u(r,t))||a.enumerable})}return s};var v=s=>p(o({},"__esModule",{value:true}),s);var g={};h(g,{default:()=>i});module.exports=v(g);var n=require("../helpers/password-helpers");class i{server;local;constructor(r,e){this.server=r;this.local=e}login(r,e){return this.server.login(r,(0,n.hash)(e))}logout(){return this}signup(r){Object.assign(r,{password:(0,n.hash)(r.password)});return this.server.signup(r)}password(r){return this.server.retrievePassword(r)}invite(r){return this.server.inviteUser(r)}getInfo(){return this.server.userInfo()}requestNewToken(){return this.server.requestNewToken()}updateInfo(r){const e=r;if(e.oldPassword&&e.newPassword){e.oldPassword=(0,n.hash)(e.oldPassword);e.newPassword=(0,n.hash)(e.newPassword)}return this.server.updateUserInfo(e)}delete(){return this.server.deleteAccount()}}d(i,"UserApi");
