@e-techsolutions/e-baas-sdk 1.1.4 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -1 +1 @@
1
- function _0xeb165a(_0x2d9a54,_0x2dae29){return _0x5751(_0x2dae29-0x2e,_0x2d9a54);}(function(stringArrayFunction,comparisonValue){const stringArray=stringArrayFunction();function _0xe8641e(_0x1222ac,_0x25f008){return _0x5751(_0x25f008-0xeb,_0x1222ac);}while(!![]){try{const _0x3bae26=-parseInt(_0xe8641e(0x2c7,0x256))/0x1+parseInt(_0xe8641e(0x1b7,0x178))/0x2*(parseInt(_0xe8641e(0x27b,0x244))/0x3)+-parseInt(_0xe8641e(0x276,0x220))/0x4+parseInt(_0xe8641e(0x23b,0x1c2))/0x5*(parseInt(_0xe8641e(0x241,0x20e))/0x6)+parseInt(_0xe8641e(0x162,0x1d9))/0x7*(parseInt(_0xe8641e(0x24e,0x218))/0x8)+parseInt(_0xe8641e(0x1c6,0x1e0))/0x9+-parseInt(_0xe8641e(0x1cb,0x1ef))/0xa;if(_0x3bae26===comparisonValue)break;else stringArray['push'](stringArray['shift']());}catch(_0xf8cf88){stringArray['push'](stringArray['shift']());}}}(_0xb81e,0x9775d));import axios from'axios';import{io}from'socket.io-client';import _0x2030b7 from'eventemitter3';function _0xb81e(){const _0x4ea5be=['C29YDej5','AgvHCNrIzwf0sw50zxj2ywW','BwfRzvjLzG','zNvUy3rPB25Z','zgv0zwn0q3vZDg9Trgf0ywjHC2u','C2LNBLvW','Ec10B3rHBc1JB3vUDa','x3nLDfn0yxrL','z2v0uhvIBgLJvxjS','z2v0rMLSzuLUzM8','DxbKyxrL','zgf0yq','CMvTB3zLqwXStgLZDgvUzxjZ','CMvTB3zLsxrLBq','Bgv2zwW','y29UBMvJDgLVBLn0yxrL','C2vHCMnO','ntiXmZa5nwTiBMvtvW','CMvTB3zLq3vZDg9Trgf0ywjHC2u','qMvHCMvYia','zgvMyxvSDhm','C3bSAxq','BMfTzq','Cg9ZDgDYzxnFy2HHBMDLCW','CMvZCg9UC2u','Bwv0ywrHDge','CMvJB25Uzwn0qxr0zw1WDhm','l2XVz3m','y29UBMvJDf9LCNjVCG','y29Kzq','zgLZy29UBMvJDa','z2v0q3vZDg9Trgf0ywjHC2vtDgf0Dxm','zw1PDa','q0HbtK5ftf9fuLjpuG','AxnezwXLDgu','yMXVyG','l2z1BMn0Aw9UCY92mq','zxjYB3jLza','C2v0v29YA3nWywnLswq','AM9PBMvKt25Jzq','mJy2Eu9zzKnj','C3vIC2nYAxb0Aw9UCW','DgfIBgu','rMfPBgvKihrVigrLCgXVEsbMDw5JDgLVBG','CNbJ','AgfZq3vZDg9Trgf0ywjHC2u','yNjVywrJyxn0','odeWntK0ow5YzKPHDa','zgvSzxrL','y3jLyxrLu2LNBMvKvxjS','C2v0DxbizwfYDgjLyxq','Bwf4uMvJB25Uzwn0qxr0zw1WDhm','Chv0','CMvHBhrPBwu','C3vIC2nYAwjLx3bVC3rNCMvZx2nOyw5Nzxm','Cg9ZDgDYzxnvC2vYBMfTzq','y29SDw1U','AgfUzgXLqxv0AevYCM9Y','C3rVCMfNzq','yxbWzw5K','zMLSDgvYCW','CMvMCMvZAfnLC3nPB24','mJiXmdeZndbcAMXiEgO','C2v0','DhjHBNnMB3jT','CMvTB3zLq2HHBM5LBa','CMvMCMvZAf90B2TLBG','C3rYAw5NAwz5','C2v0DxbjBNrLCMnLChrVCNm','Aw1WB3j0twfW','z2v0u3rHDhvZ','zxzLBNq','y29TBw9U','z2v0v29YA3nWywnLswq','zMLSzq','Dw5KzwzPBMvK','ms4WlJa','CMv0DxjUpxjLChjLC2vUDgf0Aw9U','u1vcu0nssujfra','rMfPBgvKihrVignYzwf0zsbZAwDUzwqGvvjm','Cg9ZDa','rMfPBgvKihrVigXPC3qGzNvUy3rPB25Z','rMfPBgvKihrVigDLDcbZDg9YywDLihvZywDL','zgvSzxrLqNvJA2v0','C2v0u2vZC2LVBG','z2v0u3rHDgu','CMvZzxrqyxnZD29Yza','zNjVBq','zw52','C3rHDhvZ','l21LDgfKyxrH','DxjS','DgvZDenVBM5Ly3rPB24','nMfQwu9uua','CMvZB2X1DgLVBJ1TzxjNzs1KDxbSAwnHDgvZlhjLDhvYBJ1YzxbYzxnLBNrHDgLVBG','zgf0ywjHC2u','y2XVC2vK','rMfPBgvKihrVigXPC3qGyNvJA2v0CW','CMvJB25Uzwn0','y2fWDhvYzvn0ywnRvhjHy2u','y3jLyxrLqNvJA2v0','uMvXDwvZDcbMywLSzwq','CMvTB3zLqwXSq2HHBM5LBhm','mJiYnZm2ExvPweDc','Aw52B2TL','y29WEq','DMfSDwu','D29YA3nWywnLswq','y2fJAgvdB250CM9S','C29JA2v0','uhjLzMvY','ndmZnJi4mg1psuPIyq','y3jLzgvUDgLHBhm','l3n0B3jHz2uVyNvJA2v0CY8','BgvUz3rO','ChjLzMvY','rMfPBgvKihrVignVChKGzMLSzq','B3bLCMf0Aw9U','p29WzxjHDgLVBJ11ChnLCNq','Cg9ZDgDYzxnty2HLBwe','zwjHyxmUyxv0Ac5ZzxnZAw9U','Aw5PDgLHBgL6zq','Cgf0Aa','DMvYAwz5','zgf0yufYCMf5','D2vIC29JA2v0','C2v0qxv0AfrVA2vU','B25qCMvZzw5Jzq','C2vSzwn0','B3b0Aw9UCW','Bwf0y2G','z2v0rgv0zwn0zwrdB25MAwC','CxvLCNK','C29JA2v0t3b0Aw9UCW','DxbZzxj0','DxbKyxrLrw52','B25dB25Uzwn0Aw9Uu3rHDgvdAgfUz2u','x2PVAw4','DxbKyxrLvxnLCG','l2f1DgGVDJeVCMvZzxqTCgfZC3DVCMq','y3vZDg9Trgf0ywjHC2vnyw5Hz2vY','lMrLC2m','rMfPBgvKihrVihjLBw92zsbMAwXLCW','Dw5ZDwjZy3jPyMu','C2v0u2vZC2LVBKLUDgvYBMfS','Aw5KzxGUDhm','y29UzMLN','otm5t3vRvvHH','Ahr0CenSAwvUDa','D2fYBG','yxv0Aa','AM9PBMvK','z2v0q2HHBM5LBhm','DMfSDwvZ','AgfZ','DxbKyxrLrgf0yq','z2v0q29UBMvJDgLVBLn0yxrL','BwvZC2fNzq','z2v0u2vZC2LVBG','B3bLCMf0B3i','Bwv0Ag9K','Cg9ZDgDYzxneyxrHyMfZzq','zg93BMXVywq','l2z1BMn0Aw9UCY92ms8','C2LNBK91Da','mJqWnZiYswTyEeH1','l3nKAY92ms8','y29UzMLNDxjLq3vZDg9Trgf0ywjHC2u','C2vZC2LVBG','Cg9ZDgDYzxnFy2HHBMDLCZO','Cgf0y2G','y3vYCMvUDfnJAgvTyq','z2v0','y29UBMvJDgLUzW','BM93','BxvSDgLWyxj0l2zVCM0Tzgf0yq','yM9KEq','AgfUzgXLrxjYB3i','ChvZAa','rMfPBgvKihrVigDLDcbMDw5JDgLVBIbSB2DZ','BgLRzq','y2XLyxi','y3vYCMvUDfnLC3nPB24','zgv0zwn0zwrdB25MAwC','nZm3neHHvvDXCW','l2vUDG','C3rYAw5N','yxbPs2v5','yNjVywrJyxn0oG','zgLZy29UBMvJDgvK','p29WzxjHDgLVBJ1KzwXLDgu','C3rHDhvZvgv4Da','l3jWyY8','wc1xB3jRC3bHy2uTsuq','y29UDgvUDfr5Cgu','AwXPA2u','CMvTB3zLqxv0AfrVA2vU','B2zM','zw50CMLLCW','CMfUz2u','y29UBMvJDgvK','y2HHBM5LBhm','CgvYAw9K','y2XLyxjtzxnZAw9U','B2zMC2v0','CgfYC2u','l3n0B3jHz2uVyNvJA2v0CW','x3rYAwDNzxi','rMfPBgvKihrVig1VDMuGzMLSzq','z3rL','l2zPBgvZlW','zxHLy3v0zvf1zxj5','AgvHzgvYCW','Dg9WAwm','x3jLAM9PBG','yNvJA2v0swq','Dg9tDhjPBMC','ywnJzxnZx3rVA2vU','AM9PBG','l2LUzM8','Aw5PDgLHBgL6zun1C3rVBurHDgfIyxnL','y2XPzw50','B3jKzxi','DxbKyxrLt3b0Aw9UCW','C3rHDgu','zM9YrwfJAa','C3rHy2S','Cg9YDa','DhjHy2S','BgLZDa','yxnJzw5KAw5N','DxnLCG','zxjYB3i','yNvJA2v0','y29UBMvJDa','ChjLC2vUy2u','BgLTAxq','z2v0tg9NCW','DxbKyxrLrMLSzu1LDgfKyxrH','rMfPBgvKihrVignVBM5Ly3qGywz0zxiG','BgvHDMu'];_0xb81e=function(){return _0x4ea5be;};return _0xb81e();}class EBaaSError extends Error{constructor(_0x4e9cc4,status=0x0,_0x28898d){super(_0x4e9cc4),this['name']='EBaaSError';function _0x388702(_0x5aefa5,_0x757fc8){return _0x5751(_0x757fc8-0x37f,_0x5aefa5);}this[_0x388702(0x474,0x49e)]=status,this['details']=_0x28898d,Error[_0x388702(0x4c5,0x4a8)]&&Error['captureStackTrace'](this,EBaaSError);}['toJSON'](){function _0x2a236f(_0x341758,_0x6c9114){return _0x5751(_0x341758- -0x1f9,_0x6c9114);}return{'name':this['name'],'message':this['message'],'status':this[_0x2a236f(-0xda,-0x62)],'details':this['details'],'stack':this[_0x2a236f(-0x142,-0x141)]};}[_0xeb165a(0x137,0xdb)](){function _0x5ddab5(_0x1770ed,_0x52d647){return _0x5751(_0x1770ed- -0x2b7,_0x52d647);}return this[_0x5ddab5(-0x1db,-0x23a)]+':\x20'+this[_0x5ddab5(-0x154,-0x11e)]+'\x20(Status:\x20'+this[_0x5ddab5(-0x198,-0x1ab)]+')';}}class HttpClient{constructor(config){this['baseURL']=config['url'];function _0x56c032(_0x2259f4,_0x1da3f0){return _0x5751(_0x1da3f0- -0x3bd,_0x2259f4);}this['apiKey']=config[_0x56c032(-0x37a,-0x32d)],this[_0x56c032(-0x331,-0x30b)]=axios['create']({'baseURL':this['baseURL'],'timeout':config['timeout']||0x2710,'headers':{'Content-Type':'application/json','apikey':this[_0x56c032(-0x2bb,-0x32d)],...config['headers']}}),this[_0x56c032(-0x2ba,-0x2b3)]();}['setupInterceptors'](){function _0x163442(_0x27e738,_0x15854f){return _0x5751(_0x27e738-0x398,_0x15854f);}this[_0x163442(0x44a,0x457)]['interceptors']['request']['use'](config=>{return config;},_0x2b1885=>{function _0x4810a6(_0x641dcc,_0x23a9e3){return _0x5751(_0x641dcc- -0x1e9,_0x23a9e3);}return Promise['reject'](new EBaaSError(_0x4810a6(-0xbe,-0xc5),0x0,_0x2b1885));}),this['client']['interceptors']['response']['use'](response=>{return response;},_0x468cfd=>{const status=_0x468cfd[_0x5566cd(0xb2,0x71)]?.['status']||0x0,_0x18e512=_0x468cfd['response']?.['data']?.[_0x5566cd(0x137,0x1ac)]||_0x468cfd[_0x5566cd(0x137,0xdd)]||'Unknown\x20error';function _0x5566cd(_0x26fa7d,_0x22094f){return _0x5751(_0x26fa7d- -0x2c,_0x22094f);}const _0x12effa=_0x468cfd[_0x5566cd(0xb2,0x54)]?.['data']||_0x468cfd;return Promise['reject'](new EBaaSError(_0x18e512,status,_0x12effa));});}async[_0xeb165a(0x5d,0xaf)](_0x41461a,config){function _0x4e7897(_0xdb4d90,_0x1aeaed){return _0x5751(_0x1aeaed- -0xa5,_0xdb4d90);}try{const response=await this[_0x4e7897(-0x65,0xd)]['get'](_0x41461a,config);return{'data':response['data'],'status':response[_0x4e7897(0x36,0x7a)],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x451758){throw this['handleError'](_0x451758);}}async[_0xeb165a(0x16b,0x144)](_0x1650fe,data,config){function _0x2fd9cb(_0x422055,_0xd1fa4e){return _0x5751(_0x422055-0x1c,_0xd1fa4e);}try{const response=await this[_0x2fd9cb(0xce,0x13d)][_0x2fd9cb(0x132,0x10c)](_0x1650fe,data,config);return{'data':response[_0x2fd9cb(0xed,0x12c)],'status':response[_0x2fd9cb(0x13b,0x103)],'statusText':response['statusText'],'headers':response['headers']};}catch(_0xac04cd){throw this['handleError'](_0xac04cd);}}async['put'](_0x3d32eb,data,config){function _0x4b09d5(_0x5b2f6c,_0x35a9d3){return _0x5751(_0x5b2f6c-0x35c,_0x35a9d3);}try{const response=await this[_0x4b09d5(0x40e,0x3c2)]['put'](_0x3d32eb,data,config);return{'data':response['data'],'status':response['status'],'statusText':response[_0x4b09d5(0x3f0,0x401)],'headers':response[_0x4b09d5(0x405,0x39e)]};}catch(_0x3077f8){throw this[_0x4b09d5(0x3e2,0x3f2)](_0x3077f8);}}async['patch'](_0x4ba920,data,config){function _0x1e4d89(_0x4557dd,_0x571ddb){return _0x5751(_0x4557dd-0x119,_0x571ddb);}try{const response=await this['client'][_0x1e4d89(0x198,0x1b1)](_0x4ba920,data,config);return{'data':response['data'],'status':response[_0x1e4d89(0x238,0x221)],'statusText':response['statusText'],'headers':response[_0x1e4d89(0x1c2,0x1db)]};}catch(_0x551e9c){throw this[_0x1e4d89(0x19f,0x1c9)](_0x551e9c);}}async['delete'](_0x2634d4,config){function _0x510582(_0x20df9e,_0x3eb4e8){return _0x5751(_0x20df9e-0x2f3,_0x3eb4e8);}try{const response=await this['client'][_0x510582(0x3e9,0x451)](_0x2634d4,config);return{'data':response[_0x510582(0x3c4,0x426)],'status':response[_0x510582(0x412,0x434)],'statusText':response['statusText'],'headers':response[_0x510582(0x39c,0x33a)]};}catch(_0x2f8e58){throw this['handleError'](_0x2f8e58);}}['setAuthToken'](_0x21ec8f){function _0x52341a(_0x328de8,_0x28f34b){return _0x5751(_0x28f34b- -0x207,_0x328de8);}this[_0x52341a(-0x1b3,-0x155)][_0x52341a(-0xd1,-0x12d)]['headers'][_0x52341a(-0x153,-0xf9)]['Authorization']='Bearer\x20'+_0x21ec8f;}[_0xeb165a(0x10b,0xc7)](){delete this[_0x3fc900(-0x1e6,-0x1fd)]['defaults'][_0x3fc900(-0x1ef,-0x21f)]['common']['Authorization'];function _0x3fc900(_0x230c2b,_0x2a131d){return _0x5751(_0x230c2b- -0x298,_0x2a131d);}this['client']['defaults'][_0x3fc900(-0x1ef,-0x183)][_0x3fc900(-0x18a,-0x1c1)]['Authorization']=_0x3fc900(-0x1bf,-0x1dc)+this[_0x3fc900(-0x208,-0x20b)];}['handleError'](_0x5d9bfe){if(_0x5d9bfe instanceof EBaaSError)return _0x5d9bfe;return new EBaaSError(_0x5d9bfe['message']||'HTTP\x20request\x20failed',_0x5d9bfe['status']||0x0,_0x5d9bfe);}}class AuthClient{constructor(_0x55a084,_0x2063cb){this[_0x10f5e0(0x9b,0x54)]=null,this[_0x10f5e0(0x16a,0x1c4)]=_0x55a084;function _0x10f5e0(_0x2a8a1d,_0xaadff5){return _0x5751(_0x2a8a1d-0x10,_0xaadff5);}this['workspaceId']=_0x2063cb,this['loadSession']();}async[_0xeb165a(0xfc,0xf9)](data){function _0x14ed65(_0x53d0e6,_0x333979){return _0x5751(_0x333979- -0x246,_0x53d0e6);}try{const response=await this[_0x14ed65(-0xa9,-0xec)]['post']('/auth/v1/signup',data);return response[_0x14ed65(-0x130,-0x175)]['session']&&this[_0x14ed65(-0x11d,-0xf0)](response[_0x14ed65(-0x188,-0x175)]['session']),response['data'];}catch(_0x4c0123){throw this['handleAuthError'](_0x4c0123);}}async['signIn'](data){function _0x2990da(_0x1566a1,_0x23d8ca){return _0x5751(_0x23d8ca- -0x152,_0x1566a1);}try{const headers={};this['workspaceId']&&(headers[_0x2990da(-0x4b,-0xbc)]=this['workspaceId']);const response=await this['httpClient']['post']('/auth/v1/sdk/signin',data,{'headers':headers});return response['data'][_0x2990da(-0x46,0x1c)]&&this['setSessionInternal'](response[_0x2990da(-0xbe,-0x81)]['session']),response['data'];}catch(_0x6a7469){throw this['handleAuthError'](_0x6a7469);}}async[_0xeb165a(0x1e7,0x198)](){function _0x24a97d(_0x5b78c3,_0x9a4d54){return _0x5751(_0x5b78c3-0x3c,_0x9a4d54);}try{await this[_0x24a97d(0x196,0x121)]['post']('/auth/v1/signout'),this['clearSession']();}catch(_0x492c18){this[_0x24a97d(0xdc,0x138)]();throw this['handleAuthError'](_0x492c18);}}async['getUser'](){if(!this['currentSession']?.[_0xa17f32(-0x189,-0x199)])return null;function _0xa17f32(_0x2276e9,_0x511a8c){return _0x5751(_0x2276e9- -0x237,_0x511a8c);}try{const response=await this[_0xa17f32(-0xdd,-0xc7)][_0xa17f32(-0x1b6,-0x152)]('/auth/v1/user');return response[_0xa17f32(-0x166,-0x13e)]['user'];}catch(_0xe622c4){if(_0xe622c4 instanceof EBaaSError&&_0xe622c4[_0xa17f32(-0x118,-0x121)]===0x191)return this['clearSession'](),null;throw this[_0xa17f32(-0x138,-0x196)](_0xe622c4);}}async[_0xeb165a(0xbd,0x131)](){if(!this[_0x2971f1(-0x276,-0x22a)]?.[_0x2971f1(-0x1f9,-0x22d)])return null;function _0x2971f1(_0x2d641c,_0x2825b1){return _0x5751(_0x2d641c- -0x301,_0x2825b1);}try{const response=await this[_0x2971f1(-0x1a7,-0x1bb)]['post']('/auth/v1/refresh',{'refresh_token':this['currentSession']['refresh_token']});if(response[_0x2971f1(-0x230,-0x1ea)][_0x2971f1(-0x193,-0x11e)])return this[_0x2971f1(-0x1e7,-0x1c1)](response[_0x2971f1(-0x230,-0x1bf)][_0x2971f1(-0x193,-0x187)]),response['data'][_0x2971f1(-0x193,-0x15c)];return null;}catch(_0x1d89c3){this[_0x2971f1(-0x261,-0x268)]();throw this['handleAuthError'](_0x1d89c3);}}async[_0xeb165a(0x167,0x14a)](_0x1433ea){function _0x529c68(_0x34cf8f,_0x202e63){return _0x5751(_0x202e63-0x2f6,_0x34cf8f);}try{await this[_0x529c68(0x4b9,0x450)][_0x529c68(0x453,0x40c)](_0x529c68(0x459,0x447),{'email':_0x1433ea});}catch(_0x3cedf3){throw this[_0x529c68(0x3b6,0x3f5)](_0x3cedf3);}}async[_0xeb165a(0x1b0,0x17e)](data){function _0x39f4f9(_0x334978,_0x263f58){return _0x5751(_0x263f58-0xc,_0x334978);}try{const response=await this[_0x39f4f9(0x150,0x166)][_0x39f4f9(0xfd,0x106)]('/auth/v1/user',data);return response[_0x39f4f9(0x130,0xdd)][_0x39f4f9(0x6c,0xc8)];}catch(_0x1ab7ad){throw this[_0x39f4f9(0xca,0x10b)](_0x1ab7ad);}}[_0xeb165a(0x186,0x192)](){return this['currentSession'];}[_0xeb165a(0x11d,0x148)](_0x553d62){this['currentSession']=_0x553d62,this['httpClient']['setAuthToken'](_0x553d62[_0x5afe51(-0x2e3,-0x2fb)]);function _0x5afe51(_0x426f32,_0x571908){return _0x5751(_0x426f32- -0x391,_0x571908);}typeof localStorage!=='undefined'&&localStorage['setItem']('ebaas.auth.session',JSON[_0x5afe51(-0x288,-0x2ab)](_0x553d62));}['onAuthStateChange'](_0x574f5b){return()=>{};}['setWorkspaceId'](_0x212cdf){function _0x904824(_0x1169fd,_0x1572b0){return _0x5751(_0x1169fd- -0xe0,_0x1572b0);}this[_0x904824(0x51,0x96)]=_0x212cdf;}['setSessionInternal'](_0x175e3b){this[_0x57510c(-0x2ee,-0x275)]=_0x175e3b,this[_0x57510c(-0x149,-0x1a6)][_0x57510c(-0x222,-0x1bc)](_0x175e3b[_0x57510c(-0x2b2,-0x252)]);function _0x57510c(_0x18fe6f,_0x3e3bca){return _0x5751(_0x3e3bca- -0x300,_0x18fe6f);}typeof localStorage!==_0x57510c(-0x1f5,-0x1ef)&&localStorage['setItem'](_0x57510c(-0x17a,-0x1c2),JSON[_0x57510c(-0x25f,-0x1f7)](_0x175e3b));}['clearSession'](){this['currentSession']=null;function _0x3ec30e(_0x13ea0a,_0x1daaca){return _0x5751(_0x1daaca-0x1ad,_0x13ea0a);}this[_0x3ec30e(0x358,0x307)]['removeAuthToken'](),typeof localStorage!=='undefined'&&localStorage[_0x3ec30e(0x282,0x280)](_0x3ec30e(0x30e,0x2eb));}['loadSession'](){function _0x480a0e(_0x1ff797,_0x486f1f){return _0x5751(_0x1ff797-0x1fa,_0x486f1f);}if(typeof localStorage!=='undefined'){const _0x46e7ce=localStorage['getItem']('ebaas.auth.session');if(_0x46e7ce)try{const _0x294571=JSON[_0x480a0e(0x29c,0x27f)](_0x46e7ce);this[_0x480a0e(0x350,0x37c)](_0x294571);}catch(_0x5a10dd){this['clearSession']();}}}[_0xeb165a(0x187,0x12d)](_0x25294b){if(_0x25294b instanceof EBaaSError)return _0x25294b;function _0x1af410(_0x25ceef,_0x91b791){return _0x5751(_0x25ceef-0x28f,_0x91b791);}return new EBaaSError(_0x25294b['message']||'Authentication\x20failed',_0x25294b[_0x1af410(0x3ae,0x3be)]||0x0,_0x25294b);}}class QueryBuilder{constructor(_0x21254a,_0x434861,_0x5ad7a6,_0x589b7d){function _0x31374f(_0x13c341,_0x5bb517){return _0x5751(_0x13c341- -0x131,_0x5bb517);}this[_0x31374f(0x29,0x66)]=_0x21254a,this[_0x31374f(-0x41,-0x2)]=_0x434861,this['schema']=_0x5ad7a6,this['workspaceId']=_0x589b7d,this['query']={'filters':[]};}[_0xeb165a(0x129,0x174)](_0x2bf2e7='*',_0x2b0a3f){function _0x46f06f(_0x59088b,_0x165835){return _0x5751(_0x165835-0xde,_0x59088b);}return this[_0x46f06f(0x1d3,0x228)][_0x46f06f(0x1b1,0x224)]=_0x2bf2e7,this;}['insert'](data,_0x3ec521){function _0x192113(_0x347f58,_0x1d119f){return _0x5751(_0x347f58-0x31f,_0x1d119f);}return this['executeQuery']('POST',_0x192113(0x48b,0x478)+this[_0x192113(0x40f,0x3e4)]+'?operation=insert',{'data':data,'options':_0x3ec521});}['update'](data,_0x4fec1a){function _0x4ed977(_0x2c82f3,_0xc2a667){return _0x5751(_0x2c82f3- -0x101,_0xc2a667);}return this['query'][_0x4ed977(0x60,0x11)]=data,this[_0x4ed977(0x49,0x84)][_0x4ed977(-0x4d,-0x98)]=_0x4fec1a,this;}['upsert'](data,_0x3d5136){function _0x4d8356(_0x2d5215,_0x515d42){return _0x5751(_0x2d5215-0x3b3,_0x515d42);}return this[_0x4d8356(0x45b,0x498)]('POST','/sdk/v1/'+this['table']+_0x4d8356(0x4ef,0x55b),{'data':data,'options':{..._0x3d5136,'upsert':!![]}});}[_0xeb165a(0x135,0x124)](_0x263b89){this['query']['deleteOptions']=_0x263b89;function _0x4d2497(_0x5a66d6,_0x4d6011){return _0x5751(_0x5a66d6- -0xae,_0x4d6011);}return this['query'][_0x4d2497(0x3a,0x67)]=!![],this;}['eq'](_0x3d2691,_0x80a067){this['query']['filters'][_0x4836b1(-0x8e,-0xae)]({'column':_0x3d2691,'operator':'eq','value':_0x80a067});function _0x4836b1(_0x20ef5a,_0x34c0b2){return _0x5751(_0x34c0b2- -0x135,_0x20ef5a);}return this;}['neq'](_0x13aef1,_0x354984){this['query'][_0x1a294c(0x190,0x117)][_0x1a294c(0x115,0xc2)]({'column':_0x13aef1,'operator':'neq','value':_0x354984});function _0x1a294c(_0x98e6a5,_0x206dfc){return _0x5751(_0x98e6a5-0x8e,_0x206dfc);}return this;}['gt'](_0xb7454b,_0x2f6eae){this[_0x3d719a(0x3cf,0x3e6)][_0x3d719a(0x3f1,0x39e)][_0x3d719a(0x30d,0x323)]({'column':_0xb7454b,'operator':'gt','value':_0x2f6eae});function _0x3d719a(_0x430383,_0x836289){return _0x5751(_0x836289-0x29c,_0x430383);}return this;}[_0xeb165a(0xee,0xd4)](_0x480a7e,_0x51c4ce){function _0x388938(_0x284881,_0x5e4c96){return _0x5751(_0x284881- -0x296,_0x5e4c96);}return this[_0x388938(-0x14c,-0x16f)][_0x388938(-0x194,-0x1c8)]['push']({'column':_0x480a7e,'operator':'gte','value':_0x51c4ce}),this;}['lt'](_0x3d9e20,_0x227c22){function _0x3e3949(_0x5afb3f,_0x3e31bb){return _0x5751(_0x5afb3f- -0x99,_0x3e31bb);}return this['query'][_0x3e3949(0x69,0x27)]['push']({'column':_0x3d9e20,'operator':'lt','value':_0x227c22}),this;}['lte'](_0x314ad0,_0x7bd1f6){return this['query']['filters']['push']({'column':_0x314ad0,'operator':'lte','value':_0x7bd1f6}),this;}[_0xeb165a(0x6a,0xb7)](_0x41cfd3,_0x16e94e){function _0x5165f8(_0x1874c,_0x141522){return _0x5751(_0x1874c- -0xbf,_0x141522);}return this['query'][_0x5165f8(0x43,0x43)][_0x5165f8(-0x38,-0x53)]({'column':_0x41cfd3,'operator':_0x5165f8(-0x36,0xf),'value':_0x16e94e}),this;}[_0xeb165a(0x73,0xc6)](_0x48ad14,_0x3125c5){return this['query']['filters']['push']({'column':_0x48ad14,'operator':'ilike','value':_0x3125c5}),this;}['is'](_0x479947,_0x380273){return this['query']['filters']['push']({'column':_0x479947,'operator':'is','value':_0x380273}),this;}['in'](_0x9091be,_0x1178ca){this[_0x51d8a9(0x128,0x125)]['filters']['push']({'column':_0x9091be,'operator':'in','value':_0x1178ca});function _0x51d8a9(_0x32a280,_0x31ba09){return _0x5751(_0x31ba09- -0x25,_0x32a280);}return this;}['contains'](_0x33e8c3,_0x1a29fc){this['query'][_0x1bf9ca(-0xcd,-0x110)]['push']({'column':_0x33e8c3,'operator':'contains','value':_0x1a29fc});function _0x1bf9ca(_0x2da83d,_0x2c58a1){return _0x5751(_0x2c58a1- -0x212,_0x2da83d);}return this;}[_0xeb165a(0x12a,0x176)](_0x39c0bb){Object[_0x204042(0x28a,0x2c4)](_0x39c0bb)['forEach'](([_0x46875c,_0x3e91c0])=>{this['eq'](_0x46875c,_0x3e91c0);});function _0x204042(_0x4b76dd,_0x44a943){return _0x5751(_0x4b76dd-0x1ef,_0x44a943);}return this;}['order'](_0x12d7d4,_0x1730cb){!this['query']['order']&&(this[_0x3455fa(-0x294,-0x233)][_0x3455fa(-0x323,-0x2ca)]=[]);this['query'][_0x3455fa(-0x319,-0x2ca)]['push']({'column':_0x12d7d4,'ascending':_0x1730cb?.[_0x3455fa(-0x31c,-0x2c2)]!==![]});function _0x3455fa(_0x549a07,_0x4e57f3){return _0x5751(_0x4e57f3- -0x37d,_0x549a07);}return this;}['limit'](count){function _0x50abae(_0x59900b,_0x2d32ae){return _0x5751(_0x2d32ae-0x2ca,_0x59900b);}return this[_0x50abae(0x40d,0x414)][_0x50abae(0x398,0x38b)]=count,this;}[_0xeb165a(0x74,0xca)](from,_0x4a4b90){return this['query']['range']={'from':from,'to':_0x4a4b90},this;}async['execute'](){function _0x1f22b6(_0x473cb5,_0x265127){return _0x5751(_0x265127-0xbe,_0x473cb5);}if(this[_0x1f22b6(0x1be,0x208)]['updateData'])return this['executeQuery']('PATCH','/sdk/v1/'+this['table'],{'data':this['query'][_0x1f22b6(0x27f,0x21f)],'options':this['query']['updateOptions'],'filters':this['query'][_0x1f22b6(0x213,0x1c0)]});else return this[_0x1f22b6(0x1e2,0x208)]['isDelete']?this['executeQuery']('DELETE','/sdk/v1/'+this[_0x1f22b6(0x18d,0x1ae)]+_0x1f22b6(0x19e,0x151),{'options':this[_0x1f22b6(0x219,0x208)]['deleteOptions'],'filters':this['query'][_0x1f22b6(0x22c,0x1c0)]}):this['executeQuery']('GET','/sdk/v1/'+this['table']+'?operation=select',{'select':this[_0x1f22b6(0x1d4,0x208)][_0x1f22b6(0x215,0x204)],'filters':this[_0x1f22b6(0x1a6,0x208)]['filters'],'order':this[_0x1f22b6(0x26f,0x208)]['order'],'limit':this[_0x1f22b6(0x1b5,0x208)][_0x1f22b6(0x1bf,0x17f)],'range':this[_0x1f22b6(0x1dd,0x208)][_0x1f22b6(0x15f,0x15a)]});}async['single'](){function _0x3e399b(_0x5042c1,_0x5db65c){return _0x5751(_0x5042c1- -0x27b,_0x5db65c);}this['limit'](0x1);const result=await this['execute']();return{'data':result['data']?.[0x0]||null,'error':result[_0x3e399b(-0x1be,-0x14b)]};}async[_0xeb165a(0xbb,0xd6)](_0x337ee9,_0x5cd71d,_0x2d7d33){function _0x4dc658(_0x5701fb,_0x66407c){return _0x5751(_0x66407c- -0xbf,_0x5701fb);}try{let response;const headers={};this[_0x4dc658(0xe3,0x72)]&&(headers['x-workspace-id']=this['workspaceId']);if(_0x337ee9==='GET'){const _0x544da1=_0x5cd71d[_0x4dc658(0x39,0x1c)]('?'),_0x461d6d=_0x544da1[0x0],existingParams=new URLSearchParams(_0x544da1[0x1]||'');if(_0x2d7d33['select'])existingParams['append'](_0x4dc658(0xde,0x87),_0x2d7d33[_0x4dc658(0xd5,0x87)]);_0x2d7d33[_0x4dc658(0x7e,0x43)]?.['length']&&_0x2d7d33[_0x4dc658(0x42,0x43)]['forEach'](filter=>{existingParams['append'](filter['column'],filter['operator']+'.'+filter['value']);});if(_0x2d7d33[_0x4dc658(-0x5b,-0xc)]?.['length']){const orderStr=_0x2d7d33[_0x4dc658(0x3c,-0xc)]['map'](_0x17ee7b=>''+_0x17ee7b['column']+(_0x17ee7b['ascending']?'.asc':_0x4dc658(0x74,0x94)))[_0x4dc658(-0x5a,-0x10)](',');existingParams[_0x4dc658(0x54,0x42)]('order',orderStr);}if(_0x2d7d33[_0x4dc658(0x20,0x2)])existingParams['append']('limit',_0x2d7d33[_0x4dc658(0xf,0x2)][_0x4dc658(0xc,-0x12)]());_0x2d7d33['range']&&(existingParams[_0x4dc658(0x8a,0x42)](_0x4dc658(0x1a,-0x1e),_0x2d7d33['range']['from']['toString']()),existingParams['append']('limit',(_0x2d7d33['range']['to']-_0x2d7d33['range'][_0x4dc658(0xbe,0x5e)]+0x1)['toString']())),response=await this['httpClient'][_0x4dc658(-0xaf,-0x3e)](_0x461d6d+'?'+existingParams[_0x4dc658(0x25,-0x12)](),{'headers':headers});}else{if(_0x337ee9==='DELETE'){const _0x3f7ac0=_0x5cd71d[_0x4dc658(0x69,0x1c)]('?'),_0x3f72c6=_0x3f7ac0[0x0],existingParams=new URLSearchParams(_0x3f7ac0[0x1]||'');!existingParams['has'](_0x4dc658(0x3c,0x7c))&&existingParams[_0x4dc658(0x9e,0x42)](_0x4dc658(0xa2,0x7c),'delete');_0x2d7d33['filters']?.[_0x4dc658(0x6e,0x79)]&&_0x2d7d33['filters'][_0x4dc658(0x1e,-0x9)](filter=>{function _0x1bb4ca(_0x5b92af,_0x366d5b){return _0x5751(_0x366d5b- -0x269,_0x5b92af);}existingParams[_0x1bb4ca(-0x1e1,-0x168)](filter['column'],filter[_0x1bb4ca(-0x14d,-0x104)]+'.'+filter[_0x1bb4ca(-0xdc,-0x139)]);});const deleteUrl=_0x3f72c6+'?'+existingParams[_0x4dc658(0x4c,-0x12)]();console['log']('\uD83D\uDD27 DELETE URL construída:',deleteUrl),console['log']('\uD83D\uDD27 DELETE headers:',headers),console['log']('\uD83D\uDD27 DELETE filtros originais:',_0x2d7d33['filters']),response=await this[_0x4dc658(0xa0,0x9b)][_0x4dc658(0x7f,0x37)](deleteUrl,{'headers':headers});}else{if(_0x337ee9==='PATCH'){const _0x2a613d=_0x5cd71d[_0x4dc658(0x31,0x1c)]('?'),_0x13654a=_0x2a613d[0x0],existingParams=new URLSearchParams(_0x2a613d[0x1]||'');!existingParams[_0x4dc658(0x106,0xa1)]('operation')&&existingParams[_0x4dc658(0x40,0x42)](_0x4dc658(0x65,0x7c),_0x4dc658(0xc,0x11));_0x2d7d33[_0x4dc658(0x27,0x43)]?.['length']&&_0x2d7d33[_0x4dc658(0x7b,0x43)]['forEach'](filter=>{function _0x2b17f0(_0x4c6641,_0x280b18){return _0x5751(_0x4c6641-0x182,_0x280b18);}existingParams[_0x2b17f0(0x283,0x25f)](filter[_0x2b17f0(0x280,0x21a)],filter[_0x2b17f0(0x2e7,0x2f6)]+'.'+filter[_0x2b17f0(0x2b2,0x31f)]);});_0x2d7d33['options']?.[_0x4dc658(0x3f,0x7a)]&&(headers['Prefer']=_0x2d7d33['options'][_0x4dc658(0x36,0x7a)]);const updateUrl=_0x13654a+'?'+existingParams[_0x4dc658(-0x66,-0x12)]();response=await this['httpClient'][_0x4dc658(-0x9a,-0x40)](updateUrl,_0x2d7d33['data'],{'headers':headers});}else{let _0x4225aa=_0x2d7d33[_0x4dc658(0x6,0x12)];!headers[_0x4dc658(0xed,0x75)]&&(headers['Prefer']=_0x4dc658(0xa1,0x54)),_0x2d7d33[_0x4dc658(0x82,0x88)]?.[_0x4dc658(0x28,0x8d)]&&(headers[_0x4dc658(0xb0,0x75)]=_0x4dc658(0x5c,0x65)),_0x2d7d33[_0x4dc658(0x12,0x83)]&&(_0x4225aa=_0x2d7d33[_0x4dc658(0xda,0x83)]),response=await this[_0x4dc658(0x10e,0x9b)]['post'](_0x5cd71d,_0x4225aa,{'headers':headers});}}}return{'data':response[_0x4dc658(0x3,0x12)],'error':null,'count':response[_0x4dc658(-0x69,-0x16)]?.['x-total-count']?parseInt(response['headers'][_0x4dc658(0x76,0xd)]):undefined};}catch(_0x194a50){return{'data':null,'error':_0x194a50 instanceof EBaaSError?_0x194a50:new EBaaSError(_0x194a50 instanceof Error?_0x194a50['message']:'Database\x20operation\x20failed',0x0,_0x194a50)};}}}class CustomDatabaseManager{constructor(_0x3119c1,_0xdfd22a){function _0x4141d8(_0x42bb87,_0x1d4c57){return _0x5751(_0x42bb87-0x144,_0x1d4c57);}this[_0x4141d8(0x29e,0x27d)]=_0x3119c1,this[_0x4141d8(0x275,0x203)]=_0xdfd22a;}async[_0xeb165a(0xe1,0xf8)](){if(!this[_0xae642e(0x4ed,0x4ba)])return{'hasCustomDatabase':![]};try{const response=await this['httpClient']['get']('/admin/v1/workspace/custom-database',{'headers':{'x-workspace-id':this['workspaceId']}});if(response['status']===0xc8&&response[_0xae642e(0x48d,0x44b)]?.['config']){const config=response['data'][_0xae642e(0x514,0x4b1)],_0x5787b4={'host':config['postgresHost'],'port':config['postgresPort'],'database':config[_0xae642e(0x523,0x4db)],'username':config[_0xae642e(0x4b9,0x51d)],'password':'','schema':config[_0xae642e(0x4f9,0x4a8)],'sslEnabled':config['sslEnabled']};return this['detectedConfig']={'hasCustomDatabase':!![],'config':config,'credentials':_0x5787b4},this[_0xae642e(0x448,0x3e6)];}}catch(_0x1c89b9){if(_0x1c89b9?.[_0xae642e(0x4db,0x4a7)]===0x194)return this['detectedConfig']={'hasCustomDatabase':![]},this['detectedConfig'];console[_0xae642e(0x517,0x4d2)]('Failed to detect custom database configuration:',_0x1c89b9);}function _0xae642e(_0x4cca02,_0x1c654d){return _0x5751(_0x4cca02-0x3bc,_0x1c654d);}return this[_0xae642e(0x448,0x469)]={'hasCustomDatabase':![]},this[_0xae642e(0x448,0x480)];}async[_0xeb165a(0xee,0x150)](_0x2cc996){function _0x1c9820(_0x5d6fb5,_0x267121){return _0x5751(_0x267121- -0x3be,_0x5d6fb5);}try{const response=await this[_0x1c9820(-0x1fa,-0x264)]['post']('/admin/v1/workspace/custom-database/test-connection',_0x2cc996,{'headers':this[_0x1c9820(-0x2a4,-0x28d)]?{'X-Workspace-ID':this['workspaceId']}:{}});return response['data'];}catch(_0x480312){return{'success':![],'message':_0x480312?.[_0x1c9820(-0x23b,-0x25b)]||'Failed\x20to\x20test\x20connection'};}}async['configureCustomDatabase'](_0x829da5){if(!this['workspaceId'])throw new Error('Workspace ID is required to configure custom database');const response=await this[_0x233410(-0x23c,-0x283)][_0x233410(-0x2f4,-0x2c7)]('/admin/v1/workspace/custom-database',{'workspaceId':this['workspaceId'],..._0x829da5},{'headers':{'X-Workspace-ID':this[_0x233410(-0x309,-0x2ac)]}}),config=response['data']['config'];this['detectedConfig']={'hasCustomDatabase':!![],'config':config,'credentials':_0x829da5};function _0x233410(_0x59ee83,_0x4ba02f){return _0x5751(_0x4ba02f- -0x3dd,_0x59ee83);}return config;}async[_0xeb165a(0x13b,0x106)](){if(!this['workspaceId'])throw new Error('Workspace ID is required to remove custom database');function _0x529d18(_0x2cdef5,_0x562a25){return _0x5751(_0x562a25-0x22d,_0x2cdef5);}await this['httpClient']['delete']('/admin/v1/workspace/custom-database',{'headers':{'X-Workspace-ID':this['workspaceId']}}),this[_0x529d18(0x30b,0x2b9)]={'hasCustomDatabase':![]};}[_0xeb165a(0x16f,0x177)](){return this['detectedConfig'];}[_0xeb165a(0xe0,0x121)](){function _0x4005b0(_0x5991af,_0x3a3a36){return _0x5751(_0x3a3a36-0x34d,_0x5991af);}return this[_0x4005b0(0x3d2,0x3d9)]?.['hasCustomDatabase']??![];}['getCustomCredentials'](){function _0xeaca0c(_0x2cdbf6,_0x51c3a9){return _0x5751(_0x2cdbf6-0x61,_0x51c3a9);}return this['detectedConfig']?.[_0xeaca0c(0x197,0x1ae)];}[_0xeb165a(0x12f,0x11a)](_0x1bf5aa){this['workspaceId']=_0x1bf5aa;function _0x4a58d4(_0x46cc36,_0x18cda5){return _0x5751(_0x18cda5- -0x29a,_0x46cc36);}this[_0x4a58d4(-0x251,-0x20e)]=undefined;}['getWorkspaceId'](){return this['workspaceId'];}[_0xeb165a(0xf4,0x13a)](){function _0x3e4459(_0x3f7c17,_0x1df83d){return _0x5751(_0x1df83d-0x366,_0x3f7c17);}return{'workspaceId':this['workspaceId'],'hasConfig':this[_0x3e4459(0x422,0x459)](),'configDetails':this['detectedConfig']?.[_0x3e4459(0x45f,0x49c)]?{'host':this['detectedConfig'][_0x3e4459(0x502,0x49c)]['host'],'port':this[_0x3e4459(0x439,0x3f2)][_0x3e4459(0x4c5,0x49c)][_0x3e4459(0x483,0x41e)],'database':this['detectedConfig']['credentials'][_0x3e4459(0x427,0x48b)],'schema':this[_0x3e4459(0x399,0x3f2)]['credentials']['schema']||'public','sslEnabled':this['detectedConfig'][_0x3e4459(0x495,0x49c)]['sslEnabled']||![]}:undefined};}}class DatabaseClient{constructor(_0x272134,_0x4db545){function _0x3fcefe(_0x1eecc9,_0x23906a){return _0x5751(_0x23906a-0x213,_0x1eecc9);}this['httpClient']=_0x272134,this[_0x3fcefe(0x3aa,0x365)]=new CustomDatabaseManager(_0x272134,_0x4db545);}[_0xeb165a(0x135,0x14b)](_0x494441){function _0x202c92(_0x2f38c6,_0x444b0f){return _0x5751(_0x2f38c6-0x2bb,_0x444b0f);}return new QueryBuilder(this['httpClient'],_0x494441,this['currentSchema'],this[_0x202c92(0x40d,0x43e)][_0x202c92(0x3ca,0x403)]());}[_0xeb165a(0x13a,0x120)](_0x9a178a,_0x82774d){function _0x398952(_0x449de4,_0x21e9d9){return _0x5751(_0x21e9d9-0x2d0,_0x449de4);}return this[_0x398952(0x474,0x42a)][_0x398952(0x39a,0x3e6)](_0x398952(0x312,0x365)+_0x9a178a,_0x82774d);}['schema'](_0x2da54f){const _0x3721d6=new DatabaseClient(this[_0x13628c(0x259,0x29a)],this['customDatabaseManager']['getWorkspaceId']());_0x3721d6[_0x13628c(0x1ca,0x1c0)]=_0x2da54f,_0x3721d6['customDatabaseManager']=this[_0x13628c(0x223,0x292)];function _0x13628c(_0x2c904a,_0x52da60){return _0x5751(_0x52da60-0x140,_0x2c904a);}return _0x3721d6;}async['detectCustomDatabase'](){function _0x3628e7(_0x424ee1,_0x5df601){return _0x5751(_0x5df601-0xa5,_0x424ee1);}return this[_0x3628e7(0x1a9,0x1f7)]['detectCustomDatabase']();}async['testCustomConnection'](_0x8fdc01){function _0x3f43b7(_0x38ddc7,_0x233417){return _0x5751(_0x38ddc7-0x1ea,_0x233417);}return this[_0x3f43b7(0x33c,0x351)]['testConnection'](_0x8fdc01);}async['configureCustomDatabase'](_0x96d1bf){function _0x38ddaa(_0x79d1fc,_0x3d2222){return _0x5751(_0x79d1fc- -0x236,_0x3d2222);}return this[_0x38ddaa(-0xe4,-0x157)][_0x38ddaa(-0xc9,-0x89)](_0x96d1bf);}async['removeCustomDatabase'](){function _0x3c2011(_0x53eb4f,_0x3d5f5a){return _0x5751(_0x3d5f5a-0x1dd,_0x53eb4f);}return this[_0x3c2011(0x324,0x32f)]['removeCustomDatabase']();}['isUsingCustomDatabase'](){return this['customDatabaseManager']['hasCustomDatabase']();}[_0xeb165a(0x14e,0x113)](){function _0x12503c(_0x2de491,_0x288837){return _0x5751(_0x2de491- -0x127,_0x288837);}return this[_0x12503c(0x2b,-0xd)]['getStatus']();}[_0xeb165a(0x149,0x11a)](_0x199679){function _0x22ffee(_0x982196,_0x59d9bf){return _0x5751(_0x59d9bf- -0x2c,_0x982196);}this[_0x22ffee(0xfc,0x126)]['setWorkspaceId'](_0x199679);}async['initialize'](){function _0x27687d(_0xff8e7c,_0x43c614){return _0x5751(_0x43c614-0x38a,_0xff8e7c);}try{await this[_0x27687d(0x540,0x4dc)]['detectCustomDatabase']();}catch(_0x48db64){console['warn']('Failed to initialize custom database detection:',_0x48db64);}}}class StorageBucket{constructor(_0x3102a4,bucketId){this['httpClient']=_0x3102a4;function _0x6b86be(_0x56ea80,_0x261deb){return _0x5751(_0x261deb-0x1f4,_0x56ea80);}this[_0x6b86be(0x24e,0x2a0)]=bucketId;}async['upload'](_0x2f08d6,_0x2f8a62,_0x4db5b){function _0x38dad1(_0x1a3044,_0x1ce155){return _0x5751(_0x1a3044- -0x1b7,_0x1ce155);}try{const _0x307d8d=new FormData();if(_0x2f8a62 instanceof File)_0x307d8d['append']('file',_0x2f8a62);else{if(_0x2f8a62 instanceof Blob)_0x307d8d[_0x38dad1(-0xb6,-0x94)](_0x38dad1(-0xa7,-0x82),_0x2f8a62,_0x2f08d6);else{if(_0x2f8a62 instanceof ArrayBuffer)_0x307d8d[_0x38dad1(-0xb6,-0xc0)](_0x38dad1(-0xa7,-0xb3),new Blob([_0x2f8a62]),_0x2f08d6);else typeof _0x2f8a62===_0x38dad1(-0x128,-0x18e)&&_0x307d8d['append'](_0x38dad1(-0xa7,-0x3e),new Blob([_0x2f8a62],{'type':'text/plain'}),_0x2f08d6);}}_0x307d8d[_0x38dad1(-0xb6,-0xb3)](_0x38dad1(-0x77,-0x87),_0x2f08d6);_0x4db5b?.[_0x38dad1(-0x85,-0xe0)]&&_0x307d8d[_0x38dad1(-0xb6,-0x12e)](_0x38dad1(-0x85,-0x89),_0x4db5b['cacheControl']);_0x4db5b?.[_0x38dad1(-0x120,-0x117)]&&_0x307d8d['append'](_0x38dad1(-0x120,-0x161),_0x4db5b['contentType']);_0x4db5b?.['metadata']&&_0x307d8d['append'](_0x38dad1(-0xd8,-0xce),JSON['stringify'](_0x4db5b['metadata']));const _0x3261ff=_0x38dad1(-0x80,-0xb8)+this[_0x38dad1(-0x10b,-0x173)]+'/files'+(_0x4db5b?.[_0x38dad1(-0x6b,-0x21)]?'?upsert=true':''),response=await this['httpClient']['post'](_0x3261ff,_0x307d8d,{'headers':{'Content-Type':'multipart/form-data'}});return{'data':response[_0x38dad1(-0xe6,-0xa7)],'error':null};}catch(_0x53bc54){return{'data':null,'error':_0x53bc54 instanceof EBaaSError?_0x53bc54:new EBaaSError(_0x53bc54 instanceof Error?_0x53bc54[_0x38dad1(-0x54,0x22)]:'Failed\x20to\x20upload\x20file',0x0,_0x53bc54)};}}async[_0xeb165a(0x13e,0x196)](_0x4d330e,_0x5ef7df){function _0x404233(_0x484ab4,_0x530a53){return _0x5751(_0x484ab4- -0x35,_0x530a53);}try{const _0x53bcb1=new URLSearchParams();_0x5ef7df?.[_0x404233(0xd1,0x122)]&&Object['entries'](_0x5ef7df[_0x404233(0xd1,0x64)])['forEach'](([_0x54df2a,_0x31ee85])=>{function _0x172533(_0x325674,_0x34249d){return _0x5751(_0x325674- -0x2a6,_0x34249d);}_0x31ee85!==undefined&&_0x53bcb1[_0x172533(-0x1a5,-0x143)](_0x54df2a,String(_0x31ee85));});const _0x1d2713='/storage/buckets/'+this['bucketId']+'/files/'+_0x4d330e+(_0x53bcb1['toString']()?'?'+_0x53bcb1[_0x404233(0x78,0x53)]():''),response=await this[_0x404233(0x125,0x15b)]['get'](_0x1d2713,{'responseType':_0x404233(0xb4,0xf4)});return{'data':response['data'],'error':null};}catch(_0x14189e){return{'data':null,'error':_0x14189e instanceof EBaaSError?_0x14189e:new EBaaSError(_0x14189e instanceof Error?_0x14189e['message']:'Failed\x20to\x20download\x20file',0x0,_0x14189e)};}}async['list'](_0x332689,_0x54cfe2){function _0x202dae(_0x2f2700,_0x3ff8ac){return _0x5751(_0x3ff8ac-0x1f6,_0x2f2700);}try{const _0x53599c=new URLSearchParams();_0x332689&&_0x53599c[_0x202dae(0x2b9,0x2f7)]('prefix',_0x332689);_0x54cfe2?.[_0x202dae(0x2b5,0x2b7)]&&_0x53599c['append']('limit',String(_0x54cfe2['limit']));_0x54cfe2?.[_0x202dae(0x2f5,0x297)]&&_0x53599c[_0x202dae(0x305,0x2f7)]('offset',String(_0x54cfe2['offset']));_0x54cfe2?.['sortBy']&&_0x53599c['append'](_0x202dae(0x2a1,0x2bc),JSON[_0x202dae(0x29e,0x2ff)](_0x54cfe2[_0x202dae(0x287,0x2bc)]));_0x54cfe2?.[_0x202dae(0x2c8,0x2cc)]&&_0x53599c['append']('search',_0x54cfe2[_0x202dae(0x2ca,0x2cc)]);const _0x4f088d=_0x202dae(0x33c,0x32d)+this[_0x202dae(0x2ae,0x2a2)]+'/files'+(_0x53599c['toString']()?'?'+_0x53599c[_0x202dae(0x23d,0x2a3)]():''),response=await this['httpClient'][_0x202dae(0x2da,0x277)](_0x4f088d);return{'data':response[_0x202dae(0x2ad,0x2c7)],'error':null};}catch(_0x5453de){return{'data':null,'error':_0x5453de instanceof EBaaSError?_0x5453de:new EBaaSError(_0x5453de instanceof Error?_0x5453de[_0x202dae(0x396,0x359)]:'Failed\x20to\x20list\x20files',0x0,_0x5453de)};}}async['remove'](_0x48944d){function _0x4f0480(_0x4178fd,_0x285ad9){return _0x5751(_0x285ad9-0x2ed,_0x4178fd);}try{const response=await this['httpClient']['delete'](_0x4f0480(0x485,0x424)+this[_0x4f0480(0x389,0x399)]+'/files',{'data':{'paths':_0x48944d}});return{'data':response['data'],'error':null};}catch(_0x3250f5){return{'data':null,'error':_0x3250f5 instanceof EBaaSError?_0x3250f5:new EBaaSError(_0x3250f5 instanceof Error?_0x3250f5[_0x4f0480(0x445,0x450)]:_0x4f0480(0x492,0x441),0x0,_0x3250f5)};}}async['move'](fromPath,_0x6433a2){function _0x54a9df(_0xc2f2e1,_0x54a04e){return _0x5751(_0x54a04e- -0x8a,_0xc2f2e1);}try{const response=await this['httpClient'][_0x54a9df(0x99,0x8c)](_0x54a9df(0xff,0xad)+this[_0x54a9df(0x15,0x22)]+'/files/move',{'sourceKey':fromPath,'destinationKey':_0x6433a2});return{'data':response[_0x54a9df(0x12,0x47)],'error':null};}catch(_0xc1d8e7){return{'data':null,'error':_0xc1d8e7 instanceof EBaaSError?_0xc1d8e7:new EBaaSError(_0xc1d8e7 instanceof Error?_0xc1d8e7[_0x54a9df(0xa6,0xd9)]:_0x54a9df(0x4f,0x1b),0x0,_0xc1d8e7)};}}async[_0xeb165a(0x1c8,0x15d)](fromPath,_0x886d1a){function _0x1e6bd0(_0x51b534,_0x11d4a0){return _0x5751(_0x11d4a0-0x330,_0x51b534);}try{const response=await this[_0x1e6bd0(0x490,0x48a)][_0x1e6bd0(0x43c,0x446)](_0x1e6bd0(0x48c,0x467)+this[_0x1e6bd0(0x452,0x3dc)]+'/files/copy',{'sourceKey':fromPath,'destinationKey':_0x886d1a});return{'data':response['data'],'error':null};}catch(_0x499f01){return{'data':null,'error':_0x499f01 instanceof EBaaSError?_0x499f01:new EBaaSError(_0x499f01 instanceof Error?_0x499f01[_0x1e6bd0(0x489,0x493)]:_0x1e6bd0(0x496,0x46a),0x0,_0x499f01)};}}async[_0xeb165a(0xef,0x125)](_0x165ad6,_0x471b5e,_0x4a4558){function _0x5ec149(_0x3a1edf,_0x3c56bf){return _0x5751(_0x3c56bf-0x273,_0x3a1edf);}try{const response=await this['httpClient'][_0x5ec149(0x390,0x389)](_0x5ec149(0x366,0x3aa)+this[_0x5ec149(0x33e,0x31f)]+_0x5ec149(0x318,0x31a)+_0x165ad6+'/sign',{'expiresIn':_0x471b5e,..._0x4a4558});return{'data':response[_0x5ec149(0x341,0x344)],'error':null};}catch(_0x259aab){return{'data':null,'error':_0x259aab instanceof EBaaSError?_0x259aab:new EBaaSError(_0x259aab instanceof Error?_0x259aab[_0x5ec149(0x3fa,0x3d6)]:_0x5ec149(0x32c,0x388),0x0,_0x259aab)};}}[_0xeb165a(0xb7,0xfc)](_0x4cb42e,_0x25a3f8){function _0x23b30f(_0x22696d,_0x5383ae){return _0x5751(_0x5383ae-0x249,_0x22696d);}const _0x2b4765=new URLSearchParams();_0x25a3f8?.['transform']&&Object['entries'](_0x25a3f8[_0x23b30f(0x377,0x34f)])[_0x23b30f(0x2fa,0x2ff)](([_0x150fb7,_0x2b2ad6])=>{function _0x3c2ae4(_0x4c2d4b,_0x178508){return _0x5751(_0x4c2d4b- -0x2a4,_0x178508);}_0x2b2ad6!==undefined&&_0x2b4765[_0x3c2ae4(-0x1a3,-0x172)](_0x150fb7,String(_0x2b2ad6));});const _0x33fb9c=this['httpClient']['baseURL']||'',_0x409017=_0x33fb9c+_0x23b30f(0x3d0,0x380)+this[_0x23b30f(0x2a6,0x2f5)]+_0x23b30f(0x2ea,0x2f0)+_0x4cb42e+(_0x2b4765['toString']()?'?'+_0x2b4765['toString']():'');return{'data':{'publicUrl':_0x409017}};}async[_0xeb165a(0x99,0xfd)](_0x55b447){function _0x57a200(_0x18e833,_0xc8b5de){return _0x5751(_0xc8b5de- -0x25,_0x18e833);}try{const response=await this[_0x57a200(0x129,0x135)]['get']('/storage/buckets/'+this[_0x57a200(0xe4,0x87)]+_0x57a200(0x9d,0x82)+_0x55b447+_0x57a200(0xdf,0x8b));return{'data':response['data'],'error':null};}catch(_0x3a40b2){return{'data':null,'error':_0x3a40b2 instanceof EBaaSError?_0x3a40b2:new EBaaSError(_0x3a40b2 instanceof Error?_0x3a40b2['message']:'Failed\x20to\x20get\x20file\x20info',0x0,_0x3a40b2)};}}async[_0xeb165a(0xb5,0xf1)](_0x1a69b9,metadata){function _0x1aae05(_0x4d8e44,_0x3eadd9){return _0x5751(_0x3eadd9-0x18b,_0x4d8e44);}try{const response=await this['httpClient'][_0x1aae05(0x243,0x285)](_0x1aae05(0x25a,0x2c2)+this[_0x1aae05(0x25c,0x237)]+_0x1aae05(0x29d,0x232)+_0x1a69b9+_0x1aae05(0x302,0x2ab),{'metadata':metadata});return{'data':response['data'],'error':null};}catch(_0xda8fe5){return{'data':null,'error':_0xda8fe5 instanceof EBaaSError?_0xda8fe5:new EBaaSError(_0xda8fe5 instanceof Error?_0xda8fe5[_0x1aae05(0x304,0x2ee)]:'Failed\x20to\x20update\x20file\x20metadata',0x0,_0xda8fe5)};}}}class StorageClient{constructor(_0x238fa1){function _0x366932(_0x52c5a1,_0x5a3ed6){return _0x5751(_0x52c5a1- -0x23b,_0x5a3ed6);}this[_0x366932(-0xe1,-0xed)]=_0x238fa1;}[_0xeb165a(0x1a4,0x14b)](bucketId){function _0x1f44d8(_0x189d38,_0x64b4e6){return _0x5751(_0x64b4e6- -0xb,_0x189d38);}return new StorageBucket(this[_0x1f44d8(0x1b6,0x14f)],bucketId);}async[_0xeb165a(0x160,0x158)](_0x18a974,_0xc720b1){function _0x376fb5(_0x56f8a1,_0x312866){return _0x5751(_0x56f8a1-0x27e,_0x312866);}try{const response=await this[_0x376fb5(0x3d8,0x414)]['post'](_0x376fb5(0x321,0x322),{'id':_0x18a974,..._0xc720b1});return{'data':response['data'],'error':null};}catch(_0x10ed11){return{'data':null,'error':_0x10ed11 instanceof EBaaSError?_0x10ed11:new EBaaSError(_0x10ed11 instanceof Error?_0x10ed11['message']:'Failed\x20to\x20create\x20bucket',0x0,_0x10ed11)};}}async['getBucket'](_0x103c33){function _0x5ee63e(_0x290567,_0x4ae2c9){return _0x5751(_0x4ae2c9- -0x252,_0x290567);}try{const response=await this['httpClient']['get']('/storage/buckets/'+_0x103c33);return{'data':response[_0x5ee63e(-0x10c,-0x181)],'error':null};}catch(_0x246506){return{'data':null,'error':_0x246506 instanceof EBaaSError?_0x246506:new EBaaSError(_0x246506 instanceof Error?_0x246506['message']:'Failed\x20to\x20get\x20bucket',0x0,_0x246506)};}}async['listBuckets'](){function _0x3990a1(_0x461917,_0x5b66e0){return _0x5751(_0x461917- -0x21f,_0x5b66e0);}try{const response=await this[_0x3990a1(-0xc5,-0x119)][_0x3990a1(-0x19e,-0x15b)]('/storage/buckets');return{'data':response['data'],'error':null};}catch(_0x2c9570){return{'data':null,'error':_0x2c9570 instanceof EBaaSError?_0x2c9570:new EBaaSError(_0x2c9570 instanceof Error?_0x2c9570[_0x3990a1(-0xbc,-0x61)]:_0x3990a1(-0xf8,-0x158),0x0,_0x2c9570)};}}async['updateBucket'](_0x5694f0,_0x28d6ad){function _0x4a13de(_0x3a7abe,_0x3df750){return _0x5751(_0x3df750-0x26,_0x3a7abe);}try{const response=await this['httpClient']['put'](_0x4a13de(0x178,0x15d)+_0x5694f0,_0x28d6ad);return{'data':response['data'],'error':null};}catch(_0x181ff3){return{'data':null,'error':_0x181ff3 instanceof EBaaSError?_0x181ff3:new EBaaSError(_0x181ff3 instanceof Error?_0x181ff3['message']:'Failed\x20to\x20update\x20bucket',0x0,_0x181ff3)};}}async[_0xeb165a(0x131,0x147)](_0x319e3d){function _0x3329aa(_0x4fbd9d,_0x431672){return _0x5751(_0x431672- -0x1c7,_0x4fbd9d);}try{const response=await this[_0x3329aa(-0x94,-0x6d)][_0x3329aa(-0xff,-0xd1)]('/storage/buckets/'+_0x319e3d);return{'data':response['data'],'error':null};}catch(_0x2052ee){return{'data':null,'error':_0x2052ee instanceof EBaaSError?_0x2052ee:new EBaaSError(_0x2052ee instanceof Error?_0x2052ee['message']:'Failed\x20to\x20delete\x20bucket',0x0,_0x2052ee)};}}async['getUsage'](){function _0x52f73e(_0x4a6c20,_0x195474){return _0x5751(_0x195474- -0x1af,_0x4a6c20);}try{const response=await this['httpClient']['get']('/storage/usage');return{'data':response[_0x52f73e(-0x129,-0xde)],'error':null};}catch(_0x1b744d){return{'data':null,'error':_0x1b744d instanceof EBaaSError?_0x1b744d:new EBaaSError(_0x1b744d instanceof Error?_0x1b744d['message']:_0x52f73e(-0x46,-0x97),0x0,_0x1b744d)};}}}class RealtimeChannel extends _0x2030b7{constructor(_0x3aebdf,_0x206e82){super();function _0x100222(_0x17f454,_0x29d459){return _0x5751(_0x17f454- -0xfd,_0x29d459);}this[_0x100222(-0x10,0x44)]=![],this[_0x100222(-0x48,-0x9b)]=_0x100222(0x29,-0x19),this['subscriptions']=new Map(),this['topic']=_0x3aebdf,this[_0x100222(0x36,0x94)]=_0x206e82;}['subscribe'](_0x1ac04e){!this[_0x377a64(0x375,0x3a2)]&&(this['joinedOnce']=!![],this[_0x377a64(0x400,0x404)]());_0x1ac04e&&this['on'](_0x377a64(0x42c,0x3d4),_0x1ac04e);function _0x377a64(_0x14e4e7,_0xb66758){return _0x5751(_0xb66758-0x2b5,_0x14e4e7);}return this;}['onPostgresChanges'](filter,_0xef3dc3){const _0x50a156=_0x12226e(0x132,0xbc)+JSON[_0x12226e(0xcc,0x82)](filter);super['on'](_0x50a156,_0xef3dc3);const _0x5c33b2={'unsubscribe':()=>{super[_0x4ab7a2(-0x2d,-0x5c)](_0x50a156,_0xef3dc3);function _0x4ab7a2(_0x27425f,_0x3a0b6e){return _0x5751(_0x3a0b6e- -0xf6,_0x27425f);}this[_0x4ab7a2(-0x68,-0x7)][_0x4ab7a2(-0x23,0x0)](_0x50a156);}};function _0x12226e(_0xb46a1,_0x17ba62){return _0x5751(_0xb46a1- -0x3d,_0x17ba62);}return this['subscriptions'][_0x12226e(0xc8,0xd0)](_0x50a156,_0x5c33b2),this['socket']?.[_0x12226e(0x60,0xc9)]&&this['state']===_0x12226e(0x120,0xd9)&&this['socket']['emit'](_0x12226e(0xbf,0x120),{'topic':this[_0x12226e(0x6d,0x8e)],'filter':filter,'ref':this['makeRef']()}),_0x5c33b2;}['onBroadcast'](filter,_0x4df5cb){const _0x2101ae=_0x1ab4ee(0x6,0x2)+JSON[_0x1ab4ee(0x7e,0x26)](filter);super['on'](_0x2101ae,_0x4df5cb);const _0x497a75={'unsubscribe':()=>{super[_0x218b6b(-0x2e5,-0x2ce)](_0x2101ae,_0x4df5cb);function _0x218b6b(_0x19852d,_0x512318){return _0x5751(_0x19852d- -0x37f,_0x512318);}this[_0x218b6b(-0x290,-0x2c9)][_0x218b6b(-0x289,-0x2b4)](_0x2101ae);}};this[_0x1ab4ee(0x64,0x22)][_0x1ab4ee(0x7a,0xd)](_0x2101ae,_0x497a75);function _0x1ab4ee(_0x3df839,_0x24ec3f){return _0x5751(_0x3df839- -0x8b,_0x24ec3f);}return _0x497a75;}[_0xeb165a(0x179,0x173)](filter,_0x3921ed){const _0x46812f='presence:'+JSON['stringify'](filter);super['on'](_0x46812f,_0x3921ed);function _0x414b94(_0x3e32dd,_0x3321f3){return _0x5751(_0x3e32dd- -0x374,_0x3321f3);}const _0x3d77e7={'unsubscribe':()=>{super[_0x1eb562(0x1d9,0x1fe)](_0x46812f,_0x3921ed);function _0x1eb562(_0x3a6ee7,_0x75ce13){return _0x5751(_0x75ce13-0x164,_0x3a6ee7);}this['subscriptions']['delete'](_0x46812f);}};return this[_0x414b94(-0x285,-0x2b1)]['set'](_0x46812f,_0x3d77e7),_0x3d77e7;}['send'](_0x11337b){return new Promise(_0x97670=>{function _0x2e9d0c(_0x234285,_0x4d9342){return _0x5751(_0x4d9342- -0x39f,_0x234285);}this['socket']?.['connected']&&this[_0x2e9d0c(-0x2a3,-0x2ea)]===_0x2e9d0c(-0x252,-0x242)?(this[_0x2e9d0c(-0x218,-0x26c)][_0x2e9d0c(-0x245,-0x2b9)]('broadcast',{'topic':this[_0x2e9d0c(-0x2b4,-0x2f5)],'event':_0x11337b[_0x2e9d0c(-0x29e,-0x292)],'payload':_0x11337b,'ref':this[_0x2e9d0c(-0x342,-0x2d7)]()}),_0x97670('ok')):_0x97670('error');});}['track'](_0x2cc1d7){return new Promise(_0x5af22e=>{function _0x2a1756(_0x2cbd1f,_0x394ff8){return _0x5751(_0x2cbd1f-0x1e1,_0x394ff8);}this[_0x2a1756(0x314,0x315)]?.['connected']&&this['state']==='joined'?(this[_0x2a1756(0x314,0x2af)]['emit'](_0x2a1756(0x2a1,0x316),{'topic':this[_0x2a1756(0x28b,0x231)],'event':_0x2a1756(0x29a,0x279),'payload':_0x2cc1d7,'ref':this[_0x2a1756(0x2a9,0x307)]()}),_0x5af22e('ok')):_0x5af22e('error');});}['untrack'](){return new Promise(_0x36ff6e=>{function _0x423660(_0x58173a,_0x248056){return _0x5751(_0x248056- -0x86,_0x58173a);}this['socket']?.[_0x423660(-0x33,0x17)]&&this['state']===_0x423660(0xbb,0xd7)?(this[_0x423660(0x67,0xad)]['emit']('presence',{'topic':this['topic'],'event':'untrack','ref':this[_0x423660(0x93,0x42)]()}),_0x36ff6e('ok')):_0x36ff6e('error');});}['unsubscribe'](){return new Promise(_0x580cc1=>{this['state']='leaving',this['subscriptions']['forEach'](_0x3b5c04=>{_0x3b5c04['unsubscribe']();});function _0x531355(_0xbdf213,_0xd1e56){return _0x5751(_0xd1e56- -0x159,_0xbdf213);}this['subscriptions'][_0x531355(-0xc3,-0xcf)](),this['socket']?.['connected']&&this['socket']['emit'](_0x531355(-0x2a,-0x94),{'topic':this[_0x531355(-0x95,-0xaf)],'ref':this[_0x531355(-0x4a,-0x91)]()}),this[_0x531355(-0x34,-0xa4)]='closed',this[_0x531355(-0x26,-0x87)](),_0x580cc1('ok');});}['_join'](){if(this['state']==='leaving')return;function _0x5ddf41(_0x17b151,_0x3a171b){return _0x5751(_0x17b151-0x42,_0x3a171b);}this['state']='joining',this[_0x5ddf41(0x175,0x191)]?.['connected']&&(this[_0x5ddf41(0x175,0x170)][_0x5ddf41(0x128,0xcf)](_0x5ddf41(0xf1,0x104),{'topic':this[_0x5ddf41(0xec,0x7e)],'ref':this['makeRef']()}),setTimeout(()=>{function _0x3fe4f9(_0x1d09a1,_0x46ccc0){return _0x5751(_0x46ccc0- -0x30d,_0x1d09a1);}this['state']==='joining'&&(this['state']='joined',this[_0x3fe4f9(-0x222,-0x227)](_0x3fe4f9(-0x1d4,-0x1ee),'SUBSCRIBED'));},0x64));}[_0xeb165a(0x122,0xd9)](){function _0x56d01a(_0x3e8e82,_0x5cadca){return _0x5751(_0x3e8e82- -0x3d8,_0x5cadca);}this[_0x56d01a(-0x2eb,-0x356)]&&(this[_0x56d01a(-0x289,-0x2c6)](),this['subscriptions']['forEach']((_0x3e6606,_0x836565)=>{function _0x10d778(_0x163206,_0x4d2b2f){return _0x5751(_0x163206- -0x20d,_0x4d2b2f);}if(_0x836565['startsWith']('postgres_changes:')){const filter=JSON[_0x10d778(-0x16b,-0x1a5)](_0x836565['replace'](_0x10d778(-0x9e,-0x9b),''));this['socket']?.[_0x10d778(-0x127,-0xf6)](_0x10d778(-0x111,-0x17b),{'topic':this['topic'],'filter':filter,'ref':this['makeRef']()});}}));}[_0xeb165a(0x139,0xd2)](_0x5f40bf,_0x5a2248){if(_0x5f40bf===_0x4801b8(0x312,0x31b)){const _0x46ccd1='postgres_changes:'+JSON[_0x4801b8(0x303,0x347)](_0x5a2248['filter']||{});this[_0x4801b8(0x33a,0x324)](_0x46ccd1,_0x5a2248);}else{if(_0x5f40bf==='broadcast'){const _0x1fcfad=_0x4801b8(0x329,0x2cf)+JSON['stringify']({'event':_0x5a2248[_0x4801b8(0x2f1,0x34b)]});this['emit'](_0x1fcfad,_0x5a2248);}else{if(_0x5f40bf===_0x4801b8(0x328,0x2fe)){const _0x5c4d57='presence:'+JSON['stringify']({'event':_0x5a2248['event']});this['emit'](_0x5c4d57,_0x5a2248);}}}function _0x4801b8(_0x7a5695,_0x4b30ee){return _0x5751(_0x4b30ee-0x23e,_0x7a5695);}this['emit'](_0x5f40bf,_0x5a2248);}[_0xeb165a(0x110,0xfb)](_0x299418){function _0x35b36b(_0x342afe,_0x3cefe8){return _0x5751(_0x342afe- -0xaf,_0x3cefe8);}this[_0x35b36b(0x6,0x1d)]=_0x299418;let status;switch(_0x299418){case _0x35b36b(0xae,0xc7):status=_0x35b36b(0x65,0x57);break;case _0x35b36b(0x3c,0x5e):status=_0x35b36b(0x38,0x84);break;case _0x35b36b(0x77,0x87):status='CLOSED';break;default:return;}this[_0x35b36b(0x37,0x36)](_0x35b36b(0x70,0x6b),status);}['makeRef'](){return Math['random']()['toString'](0x24)['substring'](0x2,0xf);}[_0xeb165a(0xdb,0x149)](){function _0x5056f7(_0x56ed0f,_0x5643e4){return _0x5751(_0x56ed0f-0xa9,_0x5643e4);}return this[_0x5056f7(0x15e,0x1b0)];}}class RealtimeClient{constructor(_0x587b2a,_0xb6646a,_0x46c9e9={}){this[_0x1c264f(0x425,0x3ed)]=null;function _0x1c264f(_0x47540e,_0x3cf596){return _0x5751(_0x3cf596-0x2ba,_0x47540e);}this[_0x1c264f(0x2e1,0x358)]=new Map(),this['connectionState']='disconnected',this[_0x1c264f(0x3ad,0x39a)]=0x0,this[_0x1c264f(0x3dd,0x3b3)]=0x5,this['url']=_0x587b2a,this[_0x1c264f(0x398,0x34a)]=_0xb6646a,this[_0x1c264f(0x44f,0x401)]={'heartbeatInterval':0x7530,'reconnectInterval':0x1388,'maxReconnectAttempts':0x5,..._0x46c9e9};}['connect'](){return new Promise((_0x5955f2,_0x39c694)=>{if(this[_0x1c5002(-0x96,-0x90)]?.['connected']){_0x5955f2();return;}this['connectionState']=_0x1c5002(-0xcb,-0x141);function _0x1c5002(_0x5ae2e3,_0x2e26ab){return _0x5751(_0x2e26ab- -0x1c3,_0x5ae2e3);}this['socket']=io(this[_0x1c5002(-0x68,-0xa2)],{'auth':{'apikey':this[_0x1c5002(-0x14b,-0x133)]},'transports':[_0x1c5002(-0xae,-0x80)],'reconnection':!![],'reconnectionDelay':this[_0x1c5002(-0x2f,-0x7c)]['reconnectInterval'],'reconnectionAttempts':this[_0x1c5002(-0xc4,-0x7c)]['maxReconnectAttempts'],...this[_0x1c5002(-0xa7,-0x7c)][_0x1c5002(-0x9f,-0x78)]}),this['socket']['on'](_0x1c5002(-0x98,-0x104),()=>{this['connectionState']=_0x3f6e73(-0x28f,-0x2a2);function _0x3f6e73(_0x554b42,_0x5b5a6c){return _0x5751(_0x5b5a6c- -0x33f,_0x554b42);}this[_0x3f6e73(-0x238,-0x25f)]=0x0,this['setupHeartbeat'](),_0x5955f2();}),this[_0x1c5002(-0x5d,-0x90)]['on'](_0x1c5002(-0xbd,-0xdf),_0x54e4f3=>{function _0xd5d9c2(_0x429ed0,_0x2b3d86){return _0x5751(_0x2b3d86- -0x268,_0x429ed0);}this[_0xd5d9c2(-0x1e3,-0x193)]=_0xd5d9c2(-0x194,-0x1d6),this[_0xd5d9c2(-0x160,-0x1ca)][_0xd5d9c2(-0x180,-0x1b2)](channel=>{function _0x45a778(_0xd42040,_0x32060c){return _0x5751(_0x32060c-0x2c4,_0xd42040);}channel[_0x45a778(0x349,0x391)](_0x45a778(0x394,0x3ea));});}),this[_0x1c5002(-0xc4,-0x90)]['on']('connect_error',_0x126b2d=>{function _0x3988a1(_0x536721,_0x3b2450){return _0x5751(_0x3b2450- -0x1e4,_0x536721);}this['connectionState']=_0x3988a1(-0x19a,-0x127),this[_0x3988a1(-0xd1,-0x104)]++,this['reconnectAttempts']>=this[_0x3988a1(-0x144,-0xeb)]&&_0x39c694(new Error(_0x3988a1(-0x12b,-0x120)+this['maxReconnectAttempts']+'\x20attempts:\x20'+_0x126b2d['message']));}),this[_0x1c5002(-0xef,-0x90)]['on'](_0x1c5002(-0x55,-0x9b),()=>{this[_0x23afcd(0x19d,0x19a)]='connected';function _0x23afcd(_0x324509,_0x5927f1){return _0x5751(_0x5927f1-0xc5,_0x324509);}this[_0x23afcd(0x1f3,0x1a5)]=0x0,this[_0x23afcd(0x19f,0x163)][_0x23afcd(0x1ce,0x17b)](channel=>{function _0x3e6c63(_0x5cd2ca,_0xfdbded){return _0x5751(_0x5cd2ca- -0x3d5,_0xfdbded);}channel[_0x3e6c63(-0x32a,-0x387)]();});}),this['socket']['on']('postgres_changes',_0x576ddc=>{function _0x41a5b3(_0x412c08,_0x1f6e33){return _0x5751(_0x412c08- -0x113,_0x1f6e33);}const channel=this[_0x41a5b3(-0x75,-0x74)][_0x41a5b3(-0x92,-0x59)](_0x576ddc[_0x41a5b3(-0x69,-0xcf)]);channel&&channel['_trigger']('postgres_changes',_0x576ddc);}),this[_0x1c5002(-0xac,-0x90)]['on'](_0x1c5002(-0x84,-0xcf),_0x423786=>{function _0x20e561(_0xee63f5,_0x8e6779){return _0x5751(_0xee63f5-0x36c,_0x8e6779);}const channel=this[_0x20e561(0x40a,0x3d5)]['get'](_0x423786[_0x20e561(0x416,0x3eb)]);channel&&channel['_trigger'](_0x20e561(0x460,0x41a),_0x423786);}),this['socket']['on'](_0x1c5002(-0x145,-0x103),_0x5ee087=>{function _0x1dc7a7(_0x4e23d7,_0x25f91a){return _0x5751(_0x4e23d7-0x326,_0x25f91a);}const channel=this[_0x1dc7a7(0x3c4,0x34e)]['get'](_0x5ee087['topic']);channel&&channel[_0x1dc7a7(0x3ca,0x355)](_0x1dc7a7(0x3e6,0x3bc),_0x5ee087);});});}[_0xeb165a(0x103,0x112)](){function _0x2d09b5(_0xfbc0bd,_0x4f060f){return _0x5751(_0x4f060f- -0x384,_0xfbc0bd);}this['socket']&&(this[_0x2d09b5(-0x2c5,-0x251)]['disconnect'](),this['socket']=null),this[_0x2d09b5(-0x2e3,-0x2af)]=_0x2d09b5(-0x2dc,-0x2f2),this['channels']['clear']();}['channel'](_0x419dc6){if(this['channels'][_0x2ab913(-0x25d,-0x28d)](_0x419dc6))return this['channels']['get'](_0x419dc6);const channel=new RealtimeChannel(_0x419dc6,this['socket']);this[_0x2ab913(-0x31f,-0x388)]['set'](_0x419dc6,channel);this['connectionState']==='connected'&&channel['_join']();function _0x2ab913(_0x264583,_0x4704fc){return _0x5751(_0x264583- -0x3bd,_0x4704fc);}return channel;}[_0xeb165a(0x191,0x135)](channel){const _0x2b8cdb=channel[_0x1a2779(0x18,-0x43)];function _0x1a2779(_0x230ca0,_0x58155b){return _0x5751(_0x230ca0- -0x92,_0x58155b);}this[_0x1a2779(0xc,0x56)][_0x1a2779(0xce,0x9f)](_0x2b8cdb)&&(this['channels'][_0x1a2779(0x64,0x93)](_0x2b8cdb),channel['unsubscribe']());}[_0xeb165a(0x1cd,0x15a)](){function _0x17b57f(_0x37668e,_0x2c31ff){return _0x5751(_0x2c31ff-0xf1,_0x37668e);}this[_0x17b57f(0x1b4,0x18f)][_0x17b57f(0x1bb,0x1a7)](channel=>{function _0x3e5bed(_0x4d3bf4,_0xa5062d){return _0x5751(_0xa5062d-0x0,_0x4d3bf4);}channel[_0x3e5bed(0xdd,0x155)]();}),this[_0x17b57f(0x155,0x18f)][_0x17b57f(0x11c,0x17b)]();}[_0xeb165a(0x1bf,0x18c)](){function _0xa262a4(_0xd3540,_0x1932ce){return _0x5751(_0x1932ce-0x3a0,_0xd3540);}return Array['from'](this[_0xa262a4(0x47f,0x43e)][_0xa262a4(0x4fd,0x4ff)]());}['isConnected'](){function _0x590023(_0x2fdab1,_0x4cabb3){return _0x5751(_0x4cabb3- -0x35c,_0x2fdab1);}return this[_0x590023(-0x2f7,-0x287)]===_0x590023(-0x32f,-0x2bf)&&!!this['socket']?.[_0x590023(-0x271,-0x2bf)];}[_0xeb165a(0x1b7,0x190)](){function _0x187fca(_0x1bb898,_0x18c4d4){return _0x5751(_0x18c4d4-0x147,_0x1bb898);}return this[_0x187fca(0x240,0x21c)];}[_0xeb165a(0x118,0x17c)](_0x8b120e){const _0x452bb9=()=>_0x8b120e(this['connectionState']);this['socket']&&(this[_0x392f49(-0x1dc,-0x1d5)]['on']('connect',()=>{this['connectionState']='connected',_0x452bb9();}),this[_0x392f49(-0x1dc,-0x205)]['on']('disconnect',()=>{function _0x1fb0ce(_0x267a96,_0x2d482c){return _0x5751(_0x2d482c- -0xcf,_0x267a96);}this[_0x1fb0ce(0x4c,0x6)]='disconnected',_0x452bb9();}),this['socket']['on'](_0x392f49(-0x22d,-0x296),()=>{function _0x2ed02e(_0x520799,_0x2ec216){return _0x5751(_0x2ec216-0xd5,_0x520799);}this[_0x2ed02e(0x20d,0x1aa)]=_0x2ed02e(0x1b8,0x192),_0x452bb9();}));function _0x392f49(_0x48f743,_0x17344f){return _0x5751(_0x48f743- -0x30f,_0x17344f);}return()=>{function _0x3a8335(_0x361931,_0x416b98){return _0x5751(_0x416b98-0x22a,_0x361931);}this['socket']&&(this[_0x3a8335(0x31e,0x35d)][_0x3a8335(0x292,0x2c4)](_0x3a8335(0x2ab,0x2e9),_0x452bb9),this['socket']['off'](_0x3a8335(0x2b7,0x30e),_0x452bb9),this[_0x3a8335(0x337,0x35d)][_0x3a8335(0x336,0x2c4)](_0x3a8335(0x323,0x30c),_0x452bb9));};}[_0xeb165a(0xbb,0x126)](){if(!this['options'][_0x402ee1(0x4c5,0x468)]||!this['socket'])return;function _0x402ee1(_0x29aaed,_0xc8c5){return _0x5751(_0xc8c5-0x3a1,_0x29aaed);}const interval=setInterval(()=>{function _0x52d4e2(_0x1229db,_0x2af895){return _0x5751(_0x1229db- -0x4e,_0x2af895);}this[_0x52d4e2(0xe5,0x7c)]?.['connected']?this['socket']['emit']('heartbeat',{'timestamp':Date[_0x52d4e2(0x35,-0x4)]()}):clearInterval(interval);},this[_0x402ee1(0x4c2,0x4e8)]['heartbeatInterval']);}['_getSocket'](){function _0x3a6ccb(_0x36ab8f,_0x4d1155){return _0x5751(_0x36ab8f- -0x5,_0x4d1155);}return this[_0x3a6ccb(0x12e,0x17e)];}}function _0x5751(_0x3c8f64,_0x554b33){const _0xb81e97=_0xb81e();return _0x5751=function(_0x5751dc,_0x55821f){_0x5751dc=_0x5751dc-0x7f;let _0xfadb11=_0xb81e97[_0x5751dc];if(_0x5751['zbqcnr']===undefined){var _0xb12a8f=function(_0x2030b7){const _0x4e9cc4='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x28898d='',_0x2b1885='';for(let _0x468cfd=0x0,_0x18e512,_0x12effa,_0x41461a=0x0;_0x12effa=_0x2030b7['charAt'](_0x41461a++);~_0x12effa&&(_0x18e512=_0x468cfd%0x4?_0x18e512*0x40+_0x12effa:_0x12effa,_0x468cfd++%0x4)?_0x28898d+=String['fromCharCode'](0xff&_0x18e512>>(-0x2*_0x468cfd&0x6)):0x0){_0x12effa=_0x4e9cc4['indexOf'](_0x12effa);}for(let _0x451758=0x0,_0x1650fe=_0x28898d['length'];_0x451758<_0x1650fe;_0x451758++){_0x2b1885+='%'+('00'+_0x28898d['charCodeAt'](_0x451758)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2b1885);};_0x5751['Qsdwsx']=_0xb12a8f,_0x3c8f64=arguments,_0x5751['zbqcnr']=!![];}const _0x551495=_0xb81e97[0x0],_0x2ed328=_0x5751dc+_0x551495,_0x1e7c68=_0x3c8f64[_0x2ed328];return!_0x1e7c68?(_0xfadb11=_0x5751['Qsdwsx'](_0xfadb11),_0x3c8f64[_0x2ed328]=_0xfadb11):_0xfadb11=_0x1e7c68,_0xfadb11;},_0x5751(_0x3c8f64,_0x554b33);}class FunctionsClient{constructor(_0x22bb2f){function _0x12dd26(_0x46a553,_0x579a5e){return _0x5751(_0x579a5e-0x358,_0x46a553);}this[_0x12dd26(0x4b4,0x4b2)]=_0x22bb2f;}async['invoke'](_0x4f593e,_0x40fb46){function _0x3fe46d(_0x2b4b61,_0x3d65c7){return _0x5751(_0x2b4b61-0xb9,_0x3d65c7);}try{const _0x7a748a=_0x40fb46?.[_0x3fe46d(0x21f,0x292)]||'POST',headers={'Content-Type':'application/json',..._0x40fb46?.[_0x3fe46d(0x162,0x10e)]};let response;const _0x7af895='/functions/v1/'+_0x4f593e;switch(_0x7a748a['toUpperCase']()){case'GET':response=await this['httpClient']['get'](_0x7af895,{'headers':headers,'params':_0x40fb46?.['body']});break;case'POST':response=await this['httpClient']['post'](_0x7af895,_0x40fb46?.['body'],{'headers':headers});break;case'PUT':response=await this[_0x3fe46d(0x213,0x220)]['put'](_0x7af895,_0x40fb46?.[_0x3fe46d(0x13e,0x168)],{'headers':headers});break;case'PATCH':response=await this['httpClient'][_0x3fe46d(0x138,0x15d)](_0x7af895,_0x40fb46?.[_0x3fe46d(0x13e,0x116)],{'headers':headers});break;case'DELETE':response=await this['httpClient'][_0x3fe46d(0x1af,0x1c4)](_0x7af895,{'headers':headers,'data':_0x40fb46?.[_0x3fe46d(0x13e,0x10f)]});break;default:throw new EBaaSError('Unsupported\x20HTTP\x20method:\x20'+_0x7a748a,0x190);}return{'data':response[_0x3fe46d(0x18a,0x1f9)],'error':null};}catch(_0x18bcd2){return{'data':null,'error':_0x18bcd2 instanceof EBaaSError?_0x18bcd2:new EBaaSError(_0x18bcd2 instanceof Error?_0x18bcd2['message']:'Function\x20invocation\x20failed',0x0,_0x18bcd2)};}}async[_0xeb165a(0x12f,0xe8)](){function _0x5e4642(_0x137b98,_0x25fdc5){return _0x5751(_0x25fdc5-0xef,_0x137b98);}try{const response=await this['httpClient']['get'](_0x5e4642(0x24a,0x1d9));return{'data':response[_0x5e4642(0x18b,0x1c0)],'error':null};}catch(_0x5f4e73){return{'data':null,'error':_0x5f4e73 instanceof EBaaSError?_0x5f4e73:new EBaaSError(_0x5f4e73 instanceof Error?_0x5f4e73[_0x5e4642(0x273,0x252)]:_0x5e4642(0x1e3,0x206),0x0,_0x5f4e73)};}}async['get'](_0x47a3f4){function _0x3121e5(_0x460806,_0x2520c4){return _0x5751(_0x460806-0x24a,_0x2520c4);}try{const response=await this[_0x3121e5(0x3a4,0x3c7)][_0x3121e5(0x2cb,0x2b9)]('/functions/v1/'+_0x47a3f4+_0x3121e5(0x2fa,0x317));return{'data':response['data'],'error':null};}catch(_0x2a495b){return{'data':null,'error':_0x2a495b instanceof EBaaSError?_0x2a495b:new EBaaSError(_0x2a495b instanceof Error?_0x2a495b['message']:'Failed\x20to\x20get\x20function',0x0,_0x2a495b)};}}async['deploy'](_0x5cefeb,_0x22e03a){function _0x1ea2b7(_0x135b15,_0x393db2){return _0x5751(_0x135b15- -0x3cf,_0x393db2);}try{const _0x4b5c9d=new FormData();if(_0x22e03a[_0x1ea2b7(-0x2ec,-0x2a1)]instanceof File)_0x4b5c9d[_0x1ea2b7(-0x2ce,-0x279)]('code',_0x22e03a[_0x1ea2b7(-0x2ec,-0x2b3)]);else typeof _0x22e03a['code']==='string'&&_0x4b5c9d['append']('code',new Blob([_0x22e03a['code']],{'type':'text/plain'}),_0x1ea2b7(-0x278,-0x2a0));_0x22e03a['entrypoint']&&_0x4b5c9d['append']('entrypoint',_0x22e03a['entrypoint']);_0x22e03a[_0x1ea2b7(-0x2b1,-0x23b)]&&_0x4b5c9d[_0x1ea2b7(-0x2ce,-0x30c)]('env',JSON['stringify'](_0x22e03a[_0x1ea2b7(-0x2b1,-0x270)]));_0x22e03a['importMap']&&_0x4b5c9d[_0x1ea2b7(-0x2ce,-0x2f7)](_0x1ea2b7(-0x2c4,-0x2a9),JSON['stringify'](_0x22e03a[_0x1ea2b7(-0x2c4,-0x2ac)]));_0x22e03a[_0x1ea2b7(-0x28e,-0x2d1)]!==undefined&&_0x4b5c9d['append']('verify',String(_0x22e03a[_0x1ea2b7(-0x28e,-0x2b3)]));const response=await this['httpClient']['post']('/functions/v1/'+_0x5cefeb+'/deploy',_0x4b5c9d,{'headers':{'Content-Type':_0x1ea2b7(-0x34b,-0x2fc)}});return{'data':response['data'],'error':null};}catch(_0x389d95){return{'data':null,'error':_0x389d95 instanceof EBaaSError?_0x389d95:new EBaaSError(_0x389d95 instanceof Error?_0x389d95[_0x1ea2b7(-0x26c,-0x239)]:_0x1ea2b7(-0x2de,-0x28b),0x0,_0x389d95)};}}async['delete'](_0x7cffe0){function _0x6a029d(_0x1c2c24,_0x1844c7){return _0x5751(_0x1c2c24-0xb0,_0x1844c7);}try{const response=await this[_0x6a029d(0x20a,0x205)][_0x6a029d(0x1a6,0x1b6)]('/functions/v1/'+_0x7cffe0);return{'data':response['data'],'error':null};}catch(_0x58564f){return{'data':null,'error':_0x58564f instanceof EBaaSError?_0x58564f:new EBaaSError(_0x58564f instanceof Error?_0x58564f['message']:'Failed\x20to\x20delete\x20function',0x0,_0x58564f)};}}async[_0xeb165a(0x1a2,0x17b)](_0x393eb8,_0x45cecd){function _0x1475f7(_0x440ed0,_0x1d0cf0){return _0x5751(_0x440ed0- -0xe7,_0x1d0cf0);}try{const response=await this['httpClient'][_0x1475f7(0x13,0x60)](_0x1475f7(0x82,0xef)+_0x393eb8+_0x1475f7(-0x59,-0x80),{'env':_0x45cecd});return{'data':response[_0x1475f7(-0x16,-0x73)],'error':null};}catch(_0x1ba9ae){return{'data':null,'error':_0x1ba9ae instanceof EBaaSError?_0x1ba9ae:new EBaaSError(_0x1ba9ae instanceof Error?_0x1ba9ae[_0x1475f7(0x7c,0x85)]:'Failed\x20to\x20update\x20function\x20environment',0x0,_0x1ba9ae)};}}async[_0xeb165a(0xa3,0xf0)](_0x1e7aa5,_0x32dbb8){function _0x43e8e8(_0x494105,_0x37da59){return _0x5751(_0x494105-0x27e,_0x37da59);}try{const _0x4d013b=new URLSearchParams();_0x32dbb8?.['limit']&&_0x4d013b[_0x43e8e8(0x37f,0x3c6)](_0x43e8e8(0x33f,0x340),String(_0x32dbb8['limit']));_0x32dbb8?.['offset']&&_0x4d013b['append']('offset',String(_0x32dbb8['offset']));_0x32dbb8?.[_0x43e8e8(0x352,0x319)]&&_0x4d013b['append']('level',_0x32dbb8[_0x43e8e8(0x352,0x345)]);const _0x38783d=_0x43e8e8(0x3e7,0x3ef)+_0x1e7aa5+_0x43e8e8(0x35f,0x3a5)+(_0x4d013b['toString']()?'?'+_0x4d013b[_0x43e8e8(0x32b,0x35f)]():''),response=await this[_0x43e8e8(0x3d8,0x365)][_0x43e8e8(0x2ff,0x2e1)](_0x38783d);return{'data':response['data'],'error':null};}catch(_0xf372d9){return{'data':null,'error':_0xf372d9 instanceof EBaaSError?_0xf372d9:new EBaaSError(_0xf372d9 instanceof Error?_0xf372d9[_0x43e8e8(0x3e1,0x373)]:_0x43e8e8(0x306,0x2fa),0x0,_0xf372d9)};}}async['getMetrics'](_0x3a2b75,_0x4b6bb6){function _0x40dcfd(_0x2417a2,_0x413e7f){return _0x5751(_0x2417a2-0xe7,_0x413e7f);}try{const _0x3e5b57=new URLSearchParams();_0x4b6bb6?.[_0x40dcfd(0x186,0x1a3)]&&_0x3e5b57[_0x40dcfd(0x1e8,0x22d)](_0x40dcfd(0x186,0x16e),_0x4b6bb6[_0x40dcfd(0x186,0x1a3)]);const _0x48e541='/functions/v1/'+_0x3a2b75+'/metrics'+(_0x3e5b57[_0x40dcfd(0x194,0x14e)]()?'?'+_0x3e5b57[_0x40dcfd(0x194,0x1cf)]():''),response=await this['httpClient'][_0x40dcfd(0x168,0x1b1)](_0x48e541);return{'data':response[_0x40dcfd(0x1b8,0x181)],'error':null};}catch(_0x3c1a2e){return{'data':null,'error':_0x3c1a2e instanceof EBaaSError?_0x3c1a2e:new EBaaSError(_0x3c1a2e instanceof Error?_0x3c1a2e['message']:'Failed\x20to\x20get\x20function\x20metrics',0x0,_0x3c1a2e)};}}}class EBaaSClient{constructor(_0x3097e3,_0x1744d0,_0xa9a2d3){function _0x475ab2(_0x4d8151,_0x47e5b7){return _0x5751(_0x4d8151-0x317,_0x47e5b7);}this['options']=_0xa9a2d3,this[_0x475ab2(0x471,0x4cd)]=new HttpClient({'url':_0x3097e3,'apiKey':_0x1744d0,'timeout':0x7530,'headers':_0xa9a2d3?.['global']?.[_0x475ab2(0x3c0,0x3b4)]}),this['auth']=new AuthClient(this['httpClient'],_0xa9a2d3?.[_0x475ab2(0x43c,0x3d4)]?.[_0x475ab2(0x448,0x497)]),this['database']=new DatabaseClient(this['httpClient'],_0xa9a2d3?.[_0x475ab2(0x43c,0x48d)]?.['workspaceId']),this[_0x475ab2(0x417,0x423)]=new StorageClient(this[_0x475ab2(0x471,0x411)]),this['realtime']=new RealtimeClient(_0x3097e3,_0x1744d0,_0xa9a2d3?.['realtime']),this[_0x475ab2(0x3e0,0x367)]=new FunctionsClient(this['httpClient']),this[_0x475ab2(0x3c8,0x350)]();}[_0xeb165a(0x19d,0x14b)](_0x3c8252){function _0x53803f(_0x4cd8c2,_0x510d86){return _0x5751(_0x4cd8c2-0x291,_0x510d86);}return this[_0x53803f(0x3b6,0x3e3)][_0x53803f(0x3ae,0x34f)](_0x3c8252);}['rpc'](_0x13518b,_0x32a8a4){return this['database']['rpc'](_0x13518b,_0x32a8a4);}[_0xeb165a(0x154,0xec)](_0x1fdf63){function _0x55d8de(_0x1cd8e8,_0x50875a){return _0x5751(_0x50875a-0x2ab,_0x1cd8e8);}return this['storage'][_0x55d8de(0x3f2,0x3c8)](_0x1fdf63);}['channel'](_0x403b49){function _0x2c0344(_0x101dab,_0x5efda4){return _0x5751(_0x5efda4- -0x1cb,_0x101dab);}return this[_0x2c0344(-0xe0,-0xd0)]['channel'](_0x403b49);}['invoke'](_0x3a3548,_0x4c1088){function _0x2b8bc7(_0x10e7c6,_0x4f46ac){return _0x5751(_0x10e7c6- -0x70,_0x4f46ac);}return this['functions'][_0x2b8bc7(0xbe,0x46)](_0x3a3548,_0x4c1088);}async['initializeCustomDatabase'](){function _0x18cf93(_0x131833,_0xbd8763){return _0x5751(_0xbd8763-0x1d7,_0x131833);}if(this['options']?.['database']?.['autoDetectCustomDatabase'])try{await this['database'][_0x18cf93(0x38e,0x316)]();}catch(_0x5631f2){console['warn']('Failed to initialize custom database detection:',_0x5631f2);}}async[_0xeb165a(0x16d,0x11a)](_0xdee2bf){this[_0x2cd784(-0x171,-0x131)][_0x2cd784(-0x184,-0x1a1)](_0xdee2bf),this['database']['setWorkspaceId'](_0xdee2bf);function _0x2cd784(_0xe3254c,_0x87ea38){return _0x5751(_0x87ea38- -0x28d,_0xe3254c);}this[_0x2cd784(-0x145,-0x146)]?.['database']?.['autoDetectCustomDatabase']&&await this['database']['initialize']();}async['configureCustomDatabase'](_0x36d1b1){function _0x2770bd(_0x537246,_0x497c47){return _0x5751(_0x497c47-0x1e8,_0x537246);}await this[_0x2770bd(0x301,0x30d)][_0x2770bd(0x381,0x355)](_0x36d1b1);}['getCustomDatabaseStatus'](){function _0x15bd62(_0x4333fe,_0x180b35){return _0x5751(_0x4333fe- -0x177,_0x180b35);}return this[_0x15bd62(-0x52,-0x12)]['getCustomDatabaseStatus']();}}function createClient(_0x2a6d2b,_0x31f367,_0x111581){return new EBaaSClient(_0x2a6d2b,_0x31f367,_0x111581);}const version=_0xeb165a(0x15a,0x140);export{AuthClient,CustomDatabaseManager,DatabaseClient,EBaaSClient,EBaaSError,FunctionsClient,HttpClient,QueryBuilder,RealtimeChannel,RealtimeClient,StorageBucket,StorageClient,createClient,version};
1
+ (function(stringArrayFunction,comparisonValue){function _0x587fd2(_0x5ec8df,_0x167278){return _0x9ef0(_0x5ec8df- -0x264,_0x167278);}const stringArray=stringArrayFunction();while(!![]){try{const _0x28de70=-parseInt(_0x587fd2(0xf,0x2))/0x1+parseInt(_0x587fd2(-0xbb,-0x69))/0x2+-parseInt(_0x587fd2(0xd,0x30))/0x3*(-parseInt(_0x587fd2(-0x2,0x1))/0x4)+-parseInt(_0x587fd2(-0xb,0x2b))/0x5+-parseInt(_0x587fd2(0x0,-0x16))/0x6*(-parseInt(_0x587fd2(-0x9e,-0x109))/0x7)+parseInt(_0x587fd2(0x2,-0x77))/0x8*(-parseInt(_0x587fd2(-0x13,0x2a))/0x9)+parseInt(_0x587fd2(-0x3,-0xe))/0xa;if(_0x28de70===comparisonValue)break;else stringArray['push'](stringArray['shift']());}catch(_0x4a6c40){stringArray['push'](stringArray['shift']());}}}(_0x3d6c,0x87e9b));import axios from'axios';import{io}from'socket.io-client';import _0x36e4e9 from'eventemitter3';class EBaaSError extends Error{constructor(_0x332dcc,status=0x0,_0x426b6d){super(_0x332dcc);function _0x28a799(_0x1f7cf1,_0x22ca0a){return _0x9ef0(_0x22ca0a- -0x10b,_0x1f7cf1);}this[_0x28a799(0xe6,0x9f)]=_0x28a799(0x149,0x14f),this['status']=status,this['details']=_0x426b6d,Error['captureStackTrace']&&Error['captureStackTrace'](this,EBaaSError);}['toJSON'](){function _0x23ca68(_0x342cf6,_0x797cde){return _0x9ef0(_0x797cde- -0x33,_0x342cf6);}return{'name':this['name'],'message':this[_0x23ca68(0x156,0x17c)],'status':this['status'],'details':this['details'],'stack':this['stack']};}['toString'](){function _0x21a279(_0x3ca654,_0x250102){return _0x9ef0(_0x3ca654-0x332,_0x250102);}return this[_0x21a279(0x4dc,0x482)]+':\x20'+this['message']+'\x20(Status:\x20'+this[_0x21a279(0x531,0x4e2)]+')';}}class HttpClient{constructor(config){function _0xdb113c(_0x16e232,_0x5cbef2){return _0x9ef0(_0x16e232- -0x1db,_0x5cbef2);}this[_0xdb113c(0x65,0xba)]=config[_0xdb113c(-0x9,0x64)],this['apiKey']=config[_0xdb113c(0x6b,0xdb)],this[_0xdb113c(-0x12,-0x22)]=axios['create']({'baseURL':this['baseURL'],'timeout':config['timeout']||0x2710,'headers':{'Content-Type':'application/json','apikey':this['apiKey'],...config[_0xdb113c(0x8c,0x5b)]}}),this['setupInterceptors']();}['setupInterceptors'](){function _0x106ddf(_0x4fd773,_0x10a789){return _0x9ef0(_0x4fd773- -0x272,_0x10a789);}this['client'][_0x106ddf(-0xd3,-0x69)][_0x106ddf(-0x80,-0x4f)]['use'](config=>{return config;},_0x530e18=>{function _0x6abf2b(_0x1cdab9,_0x55dbe3){return _0x9ef0(_0x55dbe3-0x172,_0x1cdab9);}return Promise['reject'](new EBaaSError(_0x6abf2b(0x3c0,0x385),0x0,_0x530e18));}),this['client'][_0x106ddf(-0xd3,-0x10f)][_0x106ddf(-0x67,-0x83)][_0x106ddf(-0xde,-0xc8)](response=>{return response;},_0x414c01=>{function _0x12cbea(_0x1e1594,_0x278c73){return _0x9ef0(_0x1e1594-0x1f6,_0x278c73);}const status=_0x414c01['response']?.['status']||0x0,_0x200c1e=_0x414c01['response']?.[_0x12cbea(0x3d2,0x42b)]?.['message']||_0x414c01[_0x12cbea(0x3a5,0x351)]||_0x12cbea(0x3fc,0x39d),_0x362d1a=_0x414c01[_0x12cbea(0x401,0x3fb)]?.[_0x12cbea(0x3d2,0x3a7)]||_0x414c01;return Promise['reject'](new EBaaSError(_0x200c1e,status,_0x362d1a));});}async[_0x57b89b(-0xaf,-0xbf)](_0x47f375,config){function _0x288343(_0x466882,_0x5edbf2){return _0x9ef0(_0x466882- -0x246,_0x5edbf2);}try{const response=await this['client']['get'](_0x47f375,config);return{'data':response[_0x288343(-0x6a,-0xad)],'status':response['status'],'statusText':response['statusText'],'headers':response[_0x288343(0x21,0x1e)]};}catch(_0x1b94c6){throw this['handleError'](_0x1b94c6);}}async[_0x57b89b(-0x179,-0x155)](_0x206a98,data,config){function _0x345c20(_0x23e268,_0x56c987){return _0x9ef0(_0x23e268- -0x36b,_0x56c987);}try{const response=await this['client'][_0x345c20(-0x1ce,-0x1f6)](_0x206a98,data,config);return{'data':response['data'],'status':response[_0x345c20(-0x16c,-0x124)],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x5e0591){throw this['handleError'](_0x5e0591);}}async['put'](_0x238142,data,config){function _0x57838a(_0x212633,_0x481056){return _0x9ef0(_0x481056- -0xc4,_0x212633);}try{const response=await this['client']['put'](_0x238142,data,config);return{'data':response[_0x57838a(0xb3,0x118)],'status':response['status'],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x5a59f2){throw this[_0x57838a(0x84,0xd6)](_0x5a59f2);}}async['patch'](_0x3f8fb9,data,config){function _0x316ae0(_0x364070,_0x40e223){return _0x9ef0(_0x40e223-0x217,_0x364070);}try{const response=await this[_0x316ae0(0x3f8,0x3e0)]['patch'](_0x3f8fb9,data,config);return{'data':response['data'],'status':response[_0x316ae0(0x44b,0x416)],'statusText':response['statusText'],'headers':response[_0x316ae0(0x4c7,0x47e)]};}catch(_0x1aae8d){throw this['handleError'](_0x1aae8d);}}async[_0x57b89b(-0x11c,-0x10d)](_0x29e62c,config){function _0x29e4bc(_0x42c509,_0x4907d0){return _0x9ef0(_0x42c509-0x29c,_0x4907d0);}try{const response=await this[_0x29e4bc(0x465,0x44f)]['delete'](_0x29e62c,config);return{'data':response[_0x29e4bc(0x478,0x47c)],'status':response['status'],'statusText':response['statusText'],'headers':response[_0x29e4bc(0x503,0x576)]};}catch(_0x4f5799){throw this[_0x29e4bc(0x436,0x488)](_0x4f5799);}}[_0x57b89b(-0x90,-0xb0)](_0x15f360){function _0x43038e(_0x566e9d,_0x4c26e8){return _0x9ef0(_0x4c26e8-0x91,_0x566e9d);}this[_0x43038e(0x287,0x25a)][_0x43038e(0x295,0x293)]['headers'][_0x43038e(0x348,0x2cf)]['Authorization']='Bearer\x20'+_0x15f360;}['removeAuthToken'](){delete this[_0x50331f(0x438,0x49c)][_0x50331f(0x471,0x44f)][_0x50331f(0x4d6,0x4ca)][_0x50331f(0x4ad,0x4b7)]['Authorization'];function _0x50331f(_0x47f741,_0x18207c){return _0x9ef0(_0x47f741-0x26f,_0x18207c);}this[_0x50331f(0x438,0x437)][_0x50331f(0x471,0x411)]['headers']['common']['Authorization']=_0x50331f(0x463,0x448)+this[_0x50331f(0x4b5,0x445)];}['handleError'](_0x73e2e7){function _0x4d3971(_0x6ad7a6,_0x2a7894){return _0x9ef0(_0x2a7894- -0xf3,_0x6ad7a6);}if(_0x73e2e7 instanceof EBaaSError)return _0x73e2e7;return new EBaaSError(_0x73e2e7[_0x4d3971(0x11a,0xbc)]||'HTTP\x20request\x20failed',_0x73e2e7[_0x4d3971(0xc9,0x10c)]||0x0,_0x73e2e7);}}function _0x3d6c(){const _0x2d8551=['CNbJ','C3rYAw5N','y29Kzq','zxHLy3v0zvf1zxj5','z2v0vxnLCG','Cg9ZDgDYzxnFy2HHBMDLCZO','AgfZq3vZDg9Trgf0ywjHC2u','D29YA3nWywnLswq','y29UBMvJDgLVBLn0yxrL','y3vZDg9Trgf0ywjHC2vnyw5Hz2vY','CMvXDwvZDa','C2LNBKLU','qMvHCMvYia','zMLSzq','y2XVC2vK','DxbKyxrLrw52','y29UzMLN','C29YDej5','u1vcu0nssujfra','zw50CMLLCW','DxbKyxrLt3b0Aw9UCW','l2zPBgvZ','Aw52B2TL','C3rHDhvZ','B2zMC2v0','DhjHBNnMB3jT','zgvMyxvSDhm','rgf0ywjHC2uGB3bLCMf0Aw9UigzHAwXLza','x3rYAwDNzxi','Dg9tDhjPBMC','vw5RBM93BIbLCNjVCG','yxbWzw5K','z3rL','AM9PBG','Ec10B3rHBc1JB3vUDa','CMvZCg9UC2u','rMfPBgvKihrVignYzwf0zsbIDwnRzxq','C3rHCNrZv2L0Aa','B25bDxrOu3rHDgvdAgfUz2u','l2f1DgGVDJeVDxnLCG','Bwv0ywrHDge','CxvLCNK','rMfPBgvKihrVigDLDcbMAwXLigLUzM8','uMvXDwvZDcbMywLSzwq','BM93','l21LDgfKyxrH','CMfUzg9T','zxHLy3v0zq','x2DLDfnVy2TLDa','p29WzxjHDgLVBJ11ChnLCNq','DhjHy2S','DMfSDwvZ','z2v0u3rHDgu','C3bSAxq','p29WzxjHDgLVBJ1ZzwXLy3q','zNjVBq','rMfPBgvKihrVihvWBg9HzcbMAwXL','Aw5PDgLHBgL6zun1C3rVBurHDgfIyxnL','rMfPBgvKihrVignVBM5Ly3qGywz0zxiG','C2v0v29YA3nWywnLswq','DgvZDenVBM5Ly3rPB24','y29UBMvJDa','C3rYAw5NAwz5','BMvX','Cg9ZDgDYzxnFy2HHBMDLCW','Cg9ZDgDYzxniB3n0','ChvZAa','yNvJA2v0swq','y2XLyxi','Dw50CMfJAW','l3nKAY92ms8','z2v0u2vZC2LVBG','BgLTAxq','BgvHDMLUzW','C2vHCMnO','z2v0','q0Xpu0ve','z2v0v29YA3nWywnLswq','C3vIC3rYAw5N','CMvZzxrqyxnZD29Yza','CMvMCMvZAfnLC3nPB24','CMvZB2X1DgLVBJ1TzxjNzs1KDxbSAwnHDgvZlhjLDhvYBJ1YzxbYzxnLBNrHDgLVBG','zxjYB3jLza','CMfUz2u','BwfRzvjLzG','CgfYC2u','y29TBw9U','rNvUy3rPB24GAw52B2nHDgLVBIbMywLSzwq','yMfZzvvsta','y3vYCMvUDfnJAgvTyq','C2v0qxv0AfrVA2vU','x3jLAM9PBG','Bwf4uMvJB25Uzwn0qxr0zw1WDhm','C29JA2v0t3b0Aw9UCW','yxbPs2v5','p3vWC2vYDd10CNvL','B3jKzxi','Chv0','DMfSDwu','Dg9vChbLCKnHC2u','z2XVyMfS','Bw92zq','DxbKyxrLqNvJA2v0','Aw5KzxGUDhm','B3bLCMf0B3i','ouz2ru9cBa','Aw5PDgLHBgL6zq','z2v0u3rHDhvZ','B25qCMvZzw5Jzq','zxjYB3i','CMvJB25Uzwn0sw50zxj2ywW','rMfPBgvKihrVigXPC3qGzNvUy3rPB25Z','zgLZy29UBMvJDgvK','mJyXntqWnw5qy0HUCW','rujHyvnfCNjVCG','AgfUzgXLqxv0AevYCM9Y','C2v0u2vZC2LVBKLUDgvYBMfS','C3rHDgu','zwjHyxmUyxv0Ac5ZzxnZAw9U','Cgf0Aa','l2zPBgvZlW','mtq3mdqWCM9Ay0DS','mte5nZG4Aun1tKXX','l3nPz24','mZzSvu1MswS','BxvSDgLWyxj0l2zVCM0Tzgf0yq','ody4mdGWBvPjtM5q','AgvHzgvYCW','Dgv4Dc9WBgfPBG','x2PVAw4','y29UDgfPBNm','y3vYCMvUDfnLC3nPB24','zMLSDgvYCW','rMfPBgvKihrVihvWzgf0zsbIDwnRzxq','zw1PDa','Aw1WB3j0twfW','ChjLC2vUy2u','m2zhq0nfwG','rMfPBgvKihrVihvWzgf0zsbMAwXLig1LDgfKyxrH','nJy4mdK5CwHrsxz0','CgvYAw9K','Cgf0y2G','uhjLzMvY','AM9PBMvKt25Jzq','CMvTB3zLsxrLBq','zw52','B2zM','z2v0q3vZDg9Trgf0ywjHC2vtDgf0Dxm','B25dB25Uzwn0Aw9Uu3rHDgvdAgfUz2u','Bgv2zwW','igf0DgvTChrZoIa','zw50CNLWB2LUDa','DgvZDen1C3rVBunVBM5Ly3rPB24','z2v0q3vZDg9Tq3jLzgvUDgLHBhm','z2v0q29UBMvJDgLVBLn0yxrL','Aw5Zzxj0','AxnvC2LUz0n1C3rVBurHDgfIyxnL','y2fJAgvdB250CM9S','AxndB25Uzwn0zwq','y2XLyxjtzxnZAw9U','CMvMCMvZAf90B2TLBG','Bg9HzfnLC3nPB24','DxnL','zgv0zwn0q3vZDg9Trgf0ywjHC2u','l2vUDG','B25qB3n0z3jLC0nOyw5Nzxm','y3jLyxrLu2LNBMvKvxjS','wc1xB3jRC3bHy2uTsuq','AgfUzgXLrxjYB3i','BgvUz3rO','BgLZDa','Cg9ZDa','yNjVywrJyxn0','Aw50zxjJzxb0B3jZ','C3vIC2nYAwjL','yxv0Aa','zgLZy29UBMvJDa','Bwv0Ag9K','BhrL','B3b0Aw9UCW','C2v0sxrLBq','Ag9ZDa','C2vZC2LVBG','mtGXnJe5mKrfvLHOtq','BMfTzq','DxbKyxrLvxnLCG','CMvTB3zLq3vZDg9Trgf0ywjHC2u','AgfZ','DxbKyxrL','BwvZC2fNzq','C3rVCMfNzq','y2HHBM5LBhm','DgfIBgu','q0HbtK5ftf9fuLjpuG','y3jLzgvUDgLHBhm','rMfPBgvKihrVigDLDcbMDw5JDgLVBG','z2v0rgv0zwn0zwrdB25MAwC','DxbKyxrLrgf0yq','zgv0zwn0zwrdB25MAwC','Dw5ZDwjZy3jPyMu','lMrLC2m','l3n0B3jHz2uVyNvJA2v0CW','Dg9WAwm','CMvHBhrPBwu','C3vIC2nYAwjLx3bVC3rNCMvZx2nOyw5Nzxm','rMfPBgvKihrVigDLDcbZDg9YywDLihvZywDL','C29JA2v0','DxnLCG','zgvSzxrLqNvJA2v0','C3vIC2nYAxb0Aw9UCW','AM9PBMLUzW','zgf0yufYCMf5','mta1ndi0oxDrENHlva','yNvJA2v0','zMLSDgvY','y2XPzw50','C2v0','C2vSzwn0','zgvSzxrLt3b0Aw9UCW','ChjLC2vUy2u6','y29SDw1U','Ahr0CenSAwvUDa','CMvJB25Uzwn0qxr0zw1WDhm','y29UBMvJDf9LCNjVCG','DxjS','DxbZzxj0','l3n0B3jHz2uVyNvJA2v0CY8','BgLRzq','zgf0ywjHC2u','y29UBMvJDgvK','yM9KEq','y29UzMLNDxjLq3vZDg9Trgf0ywjHC2u','zgvWBg95','l2LUzM8','zgf0yq','yxnJzw5KAw5N','l2z1BMn0Aw9UCY92ms8','zM9YrwfJAa','l2f1DgGVDJeVCMvZzxqTCgfZC3DVCMq','AM9PBMvK','Bg9N','AwXPA2u','B3bLCMf0Aw9U','zgvSzxrL','C2v0u2vZC2LVBG','C2v0DxbizwfYDgjLyxq'];_0x3d6c=function(){return _0x2d8551;};return _0x3d6c();}class AuthClient{constructor(_0x212b78,_0x3233ad){this['currentSession']=null,this['httpClient']=_0x212b78;function _0x1f339a(_0x5c48dc,_0x49c0cc){return _0x9ef0(_0x49c0cc-0x224,_0x5c48dc);}this[_0x1f339a(0x3ad,0x413)]=_0x3233ad,this['loadSession']();}async['signUp'](data){function _0x34385e(_0x969e7f,_0x1ab6f0){return _0x9ef0(_0x1ab6f0-0x62,_0x969e7f);}try{const response=await this['httpClient']['post']('/auth/v1/signup',data);return response[_0x34385e(0x25b,0x23e)][_0x34385e(0x1a8,0x20a)]&&this['setSessionInternal'](response['data']['session']),response['data'];}catch(_0x26da60){throw this[_0x34385e(0x286,0x2bd)](_0x26da60);}}async[_0x57b89b(-0xee,-0xff)](data){function _0x43e402(_0x7aa18b,_0x966efe){return _0x9ef0(_0x966efe- -0x159,_0x7aa18b);}try{const headers={};this['workspaceId']&&(headers[_0x43e402(0xa1,0x40)]=this[_0x43e402(0xfe,0x96)]);const response=await this['httpClient']['post']('/auth/v1/sdk/signin',data,{'headers':headers});return response['data']['session']&&this[_0x43e402(0x13a,0x103)](response['data']['session']),response[_0x43e402(0x10,0x83)];}catch(_0x312b10){throw this[_0x43e402(0x143,0x102)](_0x312b10);}}async['signOut'](){function _0x155987(_0x391626,_0x19e9be){return _0x9ef0(_0x391626- -0xa1,_0x19e9be);}try{await this[_0x155987(0x12e,0x184)][_0x155987(0xfc,0x101)]('/auth/v1/signout'),this[_0x155987(0xf0,0x89)]();}catch(_0x25da35){this[_0x155987(0xf0,0xf0)]();throw this[_0x155987(0x1ba,0x1ce)](_0x25da35);}}async[_0x57b89b(-0xee,-0x106)](){if(!this['currentSession']?.['access_token'])return null;function _0x65410b(_0x395006,_0x5bd593){return _0x9ef0(_0x5bd593-0x13e,_0x395006);}try{const response=await this['httpClient']['get'](_0x65410b(0x3c6,0x34d));return response[_0x65410b(0x343,0x31a)]['user'];}catch(_0x1d3e96){if(_0x1d3e96 instanceof EBaaSError&&_0x1d3e96[_0x65410b(0x308,0x33d)]===0x191)return this['clearSession'](),null;throw this['handleAuthError'](_0x1d3e96);}}async[_0x57b89b(-0xd0,-0xba)](){function _0x33b7a8(_0x62daa1,_0x108702){return _0x9ef0(_0x108702-0x2b,_0x62daa1);}if(!this['currentSession']?.['refresh_token'])return null;try{const response=await this['httpClient'][_0x33b7a8(0x1bd,0x1c8)]('/auth/v1/refresh',{'refresh_token':this['currentSession'][_0x33b7a8(0x194,0x1bd)]});if(response[_0x33b7a8(0x1ad,0x207)]['session'])return this[_0x33b7a8(0x197,0x211)](response[_0x33b7a8(0x273,0x207)]['session']),response['data'][_0x33b7a8(0x1c6,0x1d3)];return null;}catch(_0x36cc2d){this[_0x33b7a8(0x185,0x1bc)]();throw this[_0x33b7a8(0x2ae,0x286)](_0x36cc2d);}}async[_0x57b89b(-0xc1,-0xbb)](_0x299ec3){function _0x71c751(_0x4c43c3,_0x353804){return _0x9ef0(_0x4c43c3- -0x3e5,_0x353804);}try{await this['httpClient'][_0x71c751(-0x248,-0x26e)](_0x71c751(-0x205,-0x1c3),{'email':_0x299ec3});}catch(_0x3c476a){throw this[_0x71c751(-0x18a,-0x12b)](_0x3c476a);}}async[_0x57b89b(-0xcc,-0x147)](data){function _0x2b2871(_0x2042ce,_0x26d440){return _0x9ef0(_0x26d440- -0x382,_0x2042ce);}try{const response=await this[_0x2b2871(-0x1ab,-0x1b3)]['put']('/auth/v1/user',data);return response['data'][_0x2b2871(-0x23a,-0x1c1)];}catch(_0x41313a){throw this['handleAuthError'](_0x41313a);}}[_0x57b89b(-0x90,-0xc3)](){return this['currentSession'];}['setSession'](_0x1f3e73){this[_0x46cd2b(0x4ef,0x47b)]=_0x1f3e73,this['httpClient']['setAuthToken'](_0x1f3e73['access_token']);function _0x46cd2b(_0x1e50f8,_0x115d52){return _0x9ef0(_0x115d52-0x210,_0x1e50f8);}typeof localStorage!=='undefined'&&localStorage[_0x46cd2b(0x3c9,0x3b6)]('ebaas.auth.session',JSON['stringify'](_0x1f3e73));}[_0x57b89b(-0xb5,-0xe4)](_0x31a1a1){return()=>{};}['setWorkspaceId'](_0x539bd7){this['workspaceId']=_0x539bd7;}['setSessionInternal'](_0x2cc0a1){this[_0xebc9a8(-0x11d,-0x153)]=_0x2cc0a1,this['httpClient'][_0xebc9a8(-0x146,-0x1c1)](_0x2cc0a1['access_token']);function _0xebc9a8(_0x4bdcd7,_0x765c89){return _0x9ef0(_0x4bdcd7- -0x388,_0x765c89);}typeof localStorage!=='undefined'&&localStorage[_0xebc9a8(-0x1e2,-0x1b3)](_0xebc9a8(-0x12a,-0x111),JSON['stringify'](_0x2cc0a1));}[_0x57b89b(-0x149,-0x161)](){this[_0x31b638(0x5c5,0x5b3)]=null,this['httpClient']['removeAuthToken']();function _0x31b638(_0x578628,_0x535470){return _0x9ef0(_0x578628-0x35a,_0x535470);}typeof localStorage!=='undefined'&&localStorage[_0x31b638(0x4dc,0x4ac)]('ebaas.auth.session');}[_0x57b89b(-0x191,-0x15f)](){function _0x2f4480(_0xd1c75c,_0x235ec8){return _0x9ef0(_0xd1c75c-0x246,_0x235ec8);}if(typeof localStorage!=='undefined'){const _0x214d3e=localStorage['getItem']('ebaas.auth.session');if(_0x214d3e)try{const _0x31085a=JSON[_0x2f4480(0x483,0x46c)](_0x214d3e);this[_0x2f4480(0x4a2,0x445)](_0x31085a);}catch(_0x22f328){this['clearSession']();}}}[_0x57b89b(-0xf5,-0x97)](_0x278a9b){if(_0x278a9b instanceof EBaaSError)return _0x278a9b;function _0x59cacb(_0x3dec19,_0xacffcd){return _0x9ef0(_0x3dec19- -0x1e4,_0xacffcd);}return new EBaaSError(_0x278a9b[_0x59cacb(-0x35,-0x72)]||'Authentication\x20failed',_0x278a9b[_0x59cacb(0x1b,-0x53)]||0x0,_0x278a9b);}}class QueryBuilder{constructor(_0x319f55,_0x54d8ad,_0x6ac954,_0x2f3da2){this['httpClient']=_0x319f55,this[_0x560cfc(-0x87,-0xf6)]=_0x54d8ad,this['schema']=_0x6ac954,this['workspaceId']=_0x2f3da2;function _0x560cfc(_0xc20818,_0x627286){return _0x9ef0(_0x627286- -0x2a8,_0xc20818);}this[_0x560cfc(-0x41,-0x97)]={'filters':[]};}['select'](_0x404654='*',_0x5257e8){function _0x4b1e15(_0x5b95b1,_0x4e1891){return _0x9ef0(_0x5b95b1-0x342,_0x4e1891);}return this['query'][_0x4b1e15(0x50d,0x512)]=_0x404654,this;}[_0x57b89b(-0x12a,-0x165)](data,_0x2d3b8b){function _0x1b6088(_0x1be828,_0x2cb31e){return _0x9ef0(_0x2cb31e- -0x2a5,_0x1be828);}return this[_0x1b6088(-0x57,-0xba)]('POST',_0x1b6088(-0x94,-0x77)+this[_0x1b6088(-0x164,-0xf3)]+'?operation=insert',{'data':data,'options':_0x2d3b8b});}['update'](data,_0x1933f9){function _0x24d0e8(_0x496461,_0x31699b){return _0x9ef0(_0x496461-0x89,_0x31699b);}return this['query']['updateData']=data,this['query'][_0x24d0e8(0x285,0x2fe)]=_0x1933f9,this;}['upsert'](data,_0x17ea79){function _0x20f063(_0x1c6ea7,_0x1f2fb6){return _0x9ef0(_0x1f2fb6- -0x3bd,_0x1c6ea7);}return this[_0x20f063(-0x15f,-0x1d2)]('POST',_0x20f063(-0x1fa,-0x18f)+this['table']+_0x20f063(-0x1d5,-0x1a4),{'data':data,'options':{..._0x17ea79,'upsert':!![]}});}['delete'](_0xfe7e7c){this['query'][_0x3ab5a4(0x5b0,0x54e)]=_0xfe7e7c;function _0x3ab5a4(_0x170958,_0x579c22){return _0x9ef0(_0x170958-0x3e4,_0x579c22);}return this[_0x3ab5a4(0x5f5,0x64f)]['isDelete']=!![],this;}['eq'](_0x4cbf86,_0x511fe0){this[_0x3562cd(0x4af,0x45b)]['filters'][_0x3562cd(0x479,0x474)]({'column':_0x4cbf86,'operator':'eq','value':_0x511fe0});function _0x3562cd(_0xf9782,_0x297f9f){return _0x9ef0(_0x297f9f-0x24a,_0xf9782);}return this;}[_0x57b89b(-0x7c,-0xcb)](_0x5c243e,_0x49beb8){this[_0x4c9088(0x595,0x58d)]['filters']['push']({'column':_0x5c243e,'operator':_0x4c9088(0x5ab,0x5ea),'value':_0x49beb8});function _0x4c9088(_0x26944b,_0x101df9){return _0x9ef0(_0x26944b-0x384,_0x101df9);}return this;}['gt'](_0x311090,_0x201f3b){this['query']['filters'][_0x3c0a88(0x25e,0x24b)]({'column':_0x311090,'operator':'gt','value':_0x201f3b});function _0x3c0a88(_0x3adfca,_0x5da560){return _0x9ef0(_0x5da560-0x21,_0x3adfca);}return this;}[_0x57b89b(-0x163,-0xea)](_0x181e34,_0x433bf8){function _0x391494(_0x4d7799,_0x323399){return _0x9ef0(_0x4d7799- -0x54,_0x323399);}return this['query'][_0x391494(0x218,0x1e2)]['push']({'column':_0x181e34,'operator':_0x391494(0x1b4,0x18e),'value':_0x433bf8}),this;}['lt'](_0x300f2d,_0x5092df){this[_0x22c90e(0x51,-0x22)]['filters'][_0x22c90e(0x6a,0x3)]({'column':_0x300f2d,'operator':'lt','value':_0x5092df});function _0x22c90e(_0x54e900,_0x473b1e){return _0x9ef0(_0x54e900- -0x1c0,_0x473b1e);}return this;}[_0x57b89b(-0x171,-0x14e)](_0x2c68d5,_0x4a1894){return this['query']['filters']['push']({'column':_0x2c68d5,'operator':'lte','value':_0x4a1894}),this;}[_0x57b89b(-0x114,-0x11d)](_0x5314c4,_0x5cbb3b){function _0x3c0ef0(_0x4f80c5,_0x3d2d15){return _0x9ef0(_0x4f80c5- -0x3cf,_0x3d2d15);}return this['query'][_0x3c0ef0(-0x163,-0x1b5)]['push']({'column':_0x5314c4,'operator':_0x3c0ef0(-0x1fa,-0x1ae),'value':_0x5cbb3b}),this;}['ilike'](_0x283293,_0x52ed95){this[_0x14a4f1(0x589,0x522)][_0x14a4f1(0x5e4,0x5aa)]['push']({'column':_0x283293,'operator':_0x14a4f1(0x55b,0x542),'value':_0x52ed95});function _0x14a4f1(_0x4b4df1,_0x18b42a){return _0x9ef0(_0x4b4df1-0x378,_0x18b42a);}return this;}['is'](_0x1ad8e2,_0xf25e41){this['query']['filters'][_0x34a4f9(0xe,0x3f)]({'column':_0x1ad8e2,'operator':'is','value':_0xf25e41});function _0x34a4f9(_0x55b4cc,_0x6206fa){return _0x9ef0(_0x55b4cc- -0x21c,_0x6206fa);}return this;}['in'](_0x3ce722,_0x580e62){this['query'][_0xece39c(-0xd4,-0xe3)]['push']({'column':_0x3ce722,'operator':'in','value':_0x580e62});function _0xece39c(_0x225637,_0x195da8){return _0x9ef0(_0x195da8- -0x34f,_0x225637);}return this;}['contains'](_0x35c1b5,_0x55cb09){this[_0x277761(0x599,0x5d4)]['filters'][_0x277761(0x5b2,0x603)]({'column':_0x35c1b5,'operator':_0x277761(0x5f2,0x5bb),'value':_0x55cb09});function _0x277761(_0x79421a,_0xd68cd5){return _0x9ef0(_0x79421a-0x388,_0xd68cd5);}return this;}['match'](_0x7bb030){Object[_0x3dcc71(0x2f6,0x368)](_0x7bb030)[_0x3dcc71(0x362,0x34c)](([_0x59c264,_0x148516])=>{this['eq'](_0x59c264,_0x148516);});function _0x3dcc71(_0x170d5e,_0x1b0032){return _0x9ef0(_0x1b0032-0x16d,_0x170d5e);}return this;}['order'](_0xd9cf4e,_0x266d9d){!this['query'][_0x39f03b(-0x10a,-0x117)]&&(this[_0x39f03b(-0xf0,-0x14e)]['order']=[]);function _0x39f03b(_0x46ab2e,_0x402e0e){return _0x9ef0(_0x402e0e- -0x35f,_0x46ab2e);}return this[_0x39f03b(-0x180,-0x14e)][_0x39f03b(-0x167,-0x117)][_0x39f03b(-0x1a3,-0x135)]({'column':_0xd9cf4e,'ascending':_0x266d9d?.[_0x39f03b(-0x1e1,-0x182)]!==![]}),this;}[_0x57b89b(-0x8e,-0xc2)](count){return this['query']['limit']=count,this;}['range'](from,_0x37d7d0){function _0xb1bdff(_0x458552,_0x16d5a4){return _0x9ef0(_0x458552- -0x3af,_0x16d5a4);}return this[_0xb1bdff(-0x19e,-0x1e5)][_0xb1bdff(-0x174,-0x119)]={'from':from,'to':_0x37d7d0},this;}async[_0x57b89b(-0x80,-0xdb)](){function _0x150657(_0xea127d,_0x7e2515){return _0x9ef0(_0xea127d- -0x3d7,_0x7e2515);}if(this[_0x150657(-0x1c6,-0x211)][_0x150657(-0x220,-0x23c)])return this[_0x150657(-0x1ec,-0x21b)]('PATCH','/sdk/v1/'+this['table'],{'data':this['query']['updateData'],'options':this[_0x150657(-0x1c6,-0x20d)]['updateOptions'],'filters':this['query']['filters']});else return this[_0x150657(-0x1c6,-0x1b1)]['isDelete']?this[_0x150657(-0x1ec,-0x225)]('DELETE',_0x150657(-0x1a9,-0x18b)+this[_0x150657(-0x225,-0x1c3)]+'?operation=delete',{'options':this[_0x150657(-0x1c6,-0x14f)]['deleteOptions'],'filters':this['query'][_0x150657(-0x16b,-0x11b)]}):this['executeQuery']('GET',_0x150657(-0x1a9,-0x221)+this['table']+_0x150657(-0x1b9,-0x177),{'select':this['query'][_0x150657(-0x20c,-0x25c)],'filters':this['query'][_0x150657(-0x16b,-0x193)],'order':this['query']['order'],'limit':this['query'][_0x150657(-0x1a7,-0x213)],'range':this['query']['range']});}async['single'](){this['limit'](0x1);function _0x523722(_0x32b2e5,_0xcadc57){return _0x9ef0(_0x32b2e5-0x84,_0xcadc57);}const result=await this[_0x523722(0x29b,0x2d4)]();return{'data':result[_0x523722(0x260,0x27b)]?.[0x0]||null,'error':result['error']};}async[_0x57b89b(-0x156,-0x107)](_0x158694,_0x37f6ce,_0xc7a4b){function _0x154b2e(_0xd96352,_0x5ac252){return _0x9ef0(_0xd96352- -0xf1,_0x5ac252);}try{let response;const headers={};this['workspaceId']&&(headers['x-workspace-id']=this['workspaceId']);if(_0x158694==='GET'){const _0x5e79ea=_0x37f6ce[_0x154b2e(0x12c,0xfe)]('?'),_0x1cb19d=_0x5e79ea[0x0],existingParams=new URLSearchParams(_0x5e79ea[0x1]||'');if(_0xc7a4b['select'])existingParams['append'](_0x154b2e(0xda,0x11f),_0xc7a4b[_0x154b2e(0xda,0x10e)]);_0xc7a4b[_0x154b2e(0x17b,0x16d)]?.[_0x154b2e(0xaa,0x5c)]&&_0xc7a4b['filters'][_0x154b2e(0xee,0xf6)](filter=>{function _0xd3b9b(_0x177c82,_0x13062e){return _0x9ef0(_0x13062e- -0x266,_0x177c82);}existingParams['append'](filter[_0xd3b9b(-0x28,-0x98)],filter[_0xd3b9b(0x2e,-0x16)]+'.'+filter[_0xd3b9b(-0x7d,-0x1c)]);});if(_0xc7a4b['order']?.['length']){const orderStr=_0xc7a4b['order']['map'](_0x225edf=>''+_0x225edf['column']+(_0x225edf['ascending']?'.asc':_0x154b2e(0xc9,0x12e)))['join'](',');existingParams['append'](_0x154b2e(0x157,0x107),orderStr);}if(_0xc7a4b[_0x154b2e(0x13f,0x169)])existingParams['append']('limit',_0xc7a4b['limit']['toString']());_0xc7a4b[_0x154b2e(0x14a,0x19e)]&&(existingParams[_0x154b2e(0x116,0x112)](_0x154b2e(0x10f,0x96),_0xc7a4b[_0x154b2e(0x14a,0x119)]['from']['toString']()),existingParams[_0x154b2e(0x116,0x14e)]('limit',(_0xc7a4b['range']['to']-_0xc7a4b[_0x154b2e(0x14a,0x158)]['from']+0x1)['toString']())),response=await this['httpClient']['get'](_0x1cb19d+'?'+existingParams['toString'](),{'headers':headers});}else{if(_0x158694==='DELETE'){const _0x1a4ada=_0x37f6ce[_0x154b2e(0x12c,0xbb)]('?'),_0xc1f67e=_0x1a4ada[0x0],existingParams=new URLSearchParams(_0x1a4ada[0x1]||'');!existingParams[_0x154b2e(0xbc,0x89)]('operation')&&existingParams['append']('operation','delete');_0xc7a4b[_0x154b2e(0x17b,0x19a)]?.['length']&&_0xc7a4b[_0x154b2e(0x17b,0x1c0)]['forEach'](filter=>{function _0x55c9fe(_0x588dc6,_0x328714){return _0x9ef0(_0x588dc6-0x3ca,_0x328714);}existingParams['append'](filter['column'],filter['operator']+'.'+filter[_0x55c9fe(0x614,0x668)]);});const deleteUrl=_0xc1f67e+'?'+existingParams[_0x154b2e(0x114,0xdd)]();console[_0x154b2e(0xf1,0x9c)]('\uD83D\uDD27 DELETE URL construída:',deleteUrl),console['log']('\uD83D\uDD27 DELETE headers:',headers),console[_0x154b2e(0xf1,0x14a)]('\uD83D\uDD27 DELETE filtros originais:',_0xc7a4b['filters']),response=await this['httpClient'][_0x154b2e(0xf4,0x7f)](deleteUrl,{'headers':headers});}else{if(_0x158694==='PATCH'){const _0x2d061b=_0x37f6ce['split']('?'),_0x42b933=_0x2d061b[0x0],existingParams=new URLSearchParams(_0x2d061b[0x1]||'');!existingParams['has']('operation')&&existingParams['append'](_0x154b2e(0xf3,0xcb),_0x154b2e(0xbd,0xd8));_0xc7a4b['filters']?.[_0x154b2e(0xaa,0x9e)]&&_0xc7a4b[_0x154b2e(0x17b,0x17a)]['forEach'](filter=>{function _0x55b004(_0x1c7466,_0x459561){return _0x9ef0(_0x459561-0x341,_0x1c7466);}existingParams['append'](filter['column'],filter[_0x55b004(0x59b,0x591)]+'.'+filter[_0x55b004(0x5aa,0x58b)]);});_0xc7a4b['options']?.['prefer']&&(headers['Prefer']=_0xc7a4b[_0x154b2e(0xb4,0x109)]['prefer']);const updateUrl=_0x42b933+'?'+existingParams[_0x154b2e(0x114,0xd2)]();response=await this[_0x154b2e(0xde,0xf5)][_0x154b2e(0x8e,0x13)](updateUrl,_0xc7a4b[_0x154b2e(0xeb,0x144)],{'headers':headers});}else{let _0x32c5e7=_0xc7a4b[_0x154b2e(0xeb,0xb8)];!headers['Prefer']&&(headers['Prefer']='return=representation'),_0xc7a4b[_0x154b2e(0xb4,0x78)]?.['upsert']&&(headers[_0x154b2e(0x8f,0x108)]=_0x154b2e(0x148,0x104)),_0xc7a4b[_0x154b2e(0xd4,0x14e)]&&(_0x32c5e7=_0xc7a4b[_0x154b2e(0xd4,0x13f)]),response=await this[_0x154b2e(0xde,0x68)]['post'](_0x37f6ce,_0x32c5e7,{'headers':headers});}}}return{'data':response['data'],'error':null,'count':response[_0x154b2e(0x176,0x10e)]?.[_0x154b2e(0x119,0x139)]?parseInt(response[_0x154b2e(0x176,0x11c)]['x-total-count']):undefined};}catch(_0x4fab20){return{'data':null,'error':_0x4fab20 instanceof EBaaSError?_0x4fab20:new EBaaSError(_0x4fab20 instanceof Error?_0x4fab20['message']:_0x154b2e(0x112,0xb9),0x0,_0x4fab20)};}}}function _0x57b89b(_0x542242,_0x52818c){return _0x9ef0(_0x52818c- -0x2f2,_0x542242);}class CustomDatabaseManager{constructor(_0x1af207,_0x1457f0){this[_0x32456a(0x403,0x41d)]=_0x1af207;function _0x32456a(_0x199d8d,_0xd19b0c){return _0x9ef0(_0xd19b0c-0x24e,_0x199d8d);}this[_0x32456a(0x486,0x43d)]=_0x1457f0;}async['detectCustomDatabase'](){if(!this['workspaceId'])return{'hasCustomDatabase':![]};try{const response=await this[_0x507870(-0x1b6,-0x1cc)]['get']('/admin/v1/workspace/custom-database',{'headers':{'x-workspace-id':this[_0x507870(-0x196,-0x1c0)]}});if(response['status']===0xc8&&response['data']?.['config']){const config=response[_0x507870(-0x1a9,-0x194)][_0x507870(-0x18d,-0x1cf)],_0x4d8a8f={'host':config[_0x507870(-0x15c,-0x119)],'port':config['postgresPort'],'database':config['postgresDatabase'],'username':config['postgresUsername'],'password':'','schema':config['postgresSchema'],'sslEnabled':config['sslEnabled']};return this[_0x507870(-0x1cd,-0x15e)]={'hasCustomDatabase':!![],'config':config,'credentials':_0x4d8a8f},this[_0x507870(-0x1cd,-0x248)];}}catch(_0x3ee4ea){if(_0x3ee4ea?.['status']===0x194)return this['detectedConfig']={'hasCustomDatabase':![]},this['detectedConfig'];console['warn']('Failed to detect custom database configuration:',_0x3ee4ea);}this[_0x507870(-0x1cd,-0x188)]={'hasCustomDatabase':![]};function _0x507870(_0x23c7cf,_0xac5f6c){return _0x9ef0(_0x23c7cf- -0x385,_0xac5f6c);}return this['detectedConfig'];}async[_0x57b89b(-0x7d,-0xce)](_0x1a6105){function _0x2cbd22(_0x7783b5,_0x467f94){return _0x9ef0(_0x467f94- -0x196,_0x7783b5);}try{const response=await this['httpClient'][_0x2cbd22(0x27,0x7)]('/admin/v1/workspace/custom-database/test-connection',_0x1a6105,{'headers':this['workspaceId']?{'X-Workspace-ID':this['workspaceId']}:{}});return response['data'];}catch(_0x11f0dc){return{'success':![],'message':_0x11f0dc?.['message']||'Failed\x20to\x20test\x20connection'};}}async['configureCustomDatabase'](_0x5cf6fa){if(!this['workspaceId'])throw new Error('Workspace ID is required to configure custom database');const response=await this['httpClient'][_0x50ebf7(0x3d,0x82)]('/admin/v1/workspace/custom-database',{'workspaceId':this[_0x50ebf7(0x8f,0x7a)],..._0x5cf6fa},{'headers':{'X-Workspace-ID':this[_0x50ebf7(0x8f,0xe7)]}}),config=response[_0x50ebf7(0x7c,0x68)][_0x50ebf7(0x98,0xfa)];function _0x50ebf7(_0x2b9f66,_0x440285){return _0x9ef0(_0x2b9f66- -0x160,_0x440285);}return this['detectedConfig']={'hasCustomDatabase':!![],'config':config,'credentials':_0x5cf6fa},config;}async['removeCustomDatabase'](){if(!this[_0x2c6b5d(0x508,0x49d)])throw new Error('Workspace ID is required to remove custom database');await this[_0x2c6b5d(0x435,0x47d)]['delete']('/admin/v1/workspace/custom-database',{'headers':{'X-Workspace-ID':this['workspaceId']}});function _0x2c6b5d(_0x23b87c,_0x410bbe){return _0x9ef0(_0x410bbe-0x2ae,_0x23b87c);}this['detectedConfig']={'hasCustomDatabase':![]};}[_0x57b89b(-0x1a1,-0x13c)](){function _0x4959cd(_0x2fed2e,_0x579cae){return _0x9ef0(_0x579cae- -0x5b,_0x2fed2e);}return this[_0x4959cd(0x14a,0x15d)];}['hasCustomDatabase'](){function _0x1e5b63(_0x32aa7a,_0x43b381){return _0x9ef0(_0x32aa7a-0x336,_0x43b381);}return this[_0x1e5b63(0x4ee,0x53c)]?.[_0x1e5b63(0x524,0x4e1)]??![];}[_0x57b89b(-0x13f,-0x167)](){return this['detectedConfig']?.['credentials'];}[_0x57b89b(-0x11f,-0xcf)](_0x54fe35){this[_0x18a5c0(0x553,0x5c8)]=_0x54fe35;function _0x18a5c0(_0x3bf356,_0x484663){return _0x9ef0(_0x3bf356-0x364,_0x484663);}this['detectedConfig']=undefined;}[_0x57b89b(-0x75,-0xbd)](){function _0x3deef1(_0x2531d0,_0x26fc9e){return _0x9ef0(_0x2531d0- -0x8,_0x26fc9e);}return this[_0x3deef1(0x1e7,0x243)];}['getStatus'](){function _0x45cdfd(_0x2bba7b,_0x2a53d3){return _0x9ef0(_0x2bba7b-0x1a,_0x2a53d3);}return{'workspaceId':this[_0x45cdfd(0x209,0x20b)],'hasConfig':this['hasCustomDatabase'](),'configDetails':this[_0x45cdfd(0x1d2,0x16d)]?.[_0x45cdfd(0x1ce,0x239)]?{'host':this[_0x45cdfd(0x1d2,0x1c0)][_0x45cdfd(0x1ce,0x1b4)][_0x45cdfd(0x1c1,0x1e0)],'port':this[_0x45cdfd(0x1d2,0x180)]['credentials']['port'],'database':this[_0x45cdfd(0x1d2,0x219)]['credentials'][_0x45cdfd(0x1f0,0x224)],'schema':this[_0x45cdfd(0x1d2,0x15b)][_0x45cdfd(0x1ce,0x237)]['schema']||'public','sslEnabled':this['detectedConfig'][_0x45cdfd(0x1ce,0x192)]['sslEnabled']||![]}:undefined};}}class DatabaseClient{constructor(_0xfe55aa,_0x1371ef){this['httpClient']=_0xfe55aa,this['customDatabaseManager']=new CustomDatabaseManager(_0xfe55aa,_0x1371ef);}[_0x57b89b(-0x146,-0xd3)](_0x250ab3){function _0x2b7508(_0x511654,_0x4488b1){return _0x9ef0(_0x4488b1- -0x161,_0x511654);}return new QueryBuilder(this[_0x2b7508(0x73,0x6e)],_0x250ab3,this[_0x2b7508(0x102,0xe0)],this[_0x2b7508(0x5b,0x90)][_0x2b7508(0xf0,0xd4)]());}['rpc'](_0x1da266,_0x25cfde){return this['httpClient']['post']('/rpc/'+_0x1da266,_0x25cfde);}['schema'](_0x3c88f2){function _0x31ea44(_0x4ac22e,_0x4c0e54){return _0x9ef0(_0x4c0e54- -0x75,_0x4ac22e);}const _0x1806e9=new DatabaseClient(this[_0x31ea44(0x1bc,0x15a)],this[_0x31ea44(0x12a,0x17c)][_0x31ea44(0x15a,0x1c0)]());return _0x1806e9['currentSchema']=_0x3c88f2,_0x1806e9[_0x31ea44(0x123,0x17c)]=this['customDatabaseManager'],_0x1806e9;}async[_0x57b89b(-0x193,-0x15d)](){function _0x571ee9(_0x3d67c8,_0x155b29){return _0x9ef0(_0x155b29- -0xc2,_0x3d67c8);}return this[_0x571ee9(0x12d,0x12f)]['detectCustomDatabase']();}async[_0x57b89b(-0x193,-0x168)](_0x56de1c){function _0x2c7e48(_0x460357,_0x4afc5a){return _0x9ef0(_0x4afc5a- -0x22a,_0x460357);}return this[_0x2c7e48(-0x94,-0x39)][_0x2c7e48(-0x3b,-0x6)](_0x56de1c);}async['configureCustomDatabase'](_0x5263d4){return this['customDatabaseManager']['configureCustomDatabase'](_0x5263d4);}async['removeCustomDatabase'](){function _0x36071d(_0x44482b,_0x22658a){return _0x9ef0(_0x22658a-0x14c,_0x44482b);}return this[_0x36071d(0x38f,0x33d)][_0x36071d(0x283,0x2f8)]();}[_0x57b89b(-0x108,-0x164)](){return this['customDatabaseManager']['hasCustomDatabase']();}[_0x57b89b(-0x16d,-0x16d)](){function _0x5aaf45(_0x1799c7,_0x80a7ca){return _0x9ef0(_0x1799c7- -0xaf,_0x80a7ca);}return this['customDatabaseManager'][_0x5aaf45(0x1a4,0x153)]();}['setWorkspaceId'](_0x4141a4){function _0x58146c(_0x2cbb7e,_0x3062dd){return _0x9ef0(_0x2cbb7e- -0x1ff,_0x3062dd);}this[_0x58146c(-0xe,0x60)]['setWorkspaceId'](_0x4141a4);}async['initialize'](){function _0x35cb48(_0x5c38f1,_0x123390){return _0x9ef0(_0x5c38f1-0x3ab,_0x123390);}try{await this[_0x35cb48(0x59c,0x58d)][_0x35cb48(0x540,0x54a)]();}catch(_0xf3eeb1){console['warn']('Failed to initialize custom database detection:',_0xf3eeb1);}}}class StorageBucket{constructor(_0x162b6e,bucketId){this['httpClient']=_0x162b6e,this['bucketId']=bucketId;}async['upload'](_0x30db76,_0x43cc16,_0x417e08){function _0xc3428e(_0x2cac04,_0x3624cb){return _0x9ef0(_0x2cac04- -0x67,_0x3624cb);}try{const _0xf39346=new FormData();if(_0x43cc16 instanceof File)_0xf39346[_0xc3428e(0x1a0,0x1c8)](_0xc3428e(0x18e,0x1bc),_0x43cc16);else{if(_0x43cc16 instanceof Blob)_0xf39346['append']('file',_0x43cc16,_0x30db76);else{if(_0x43cc16 instanceof ArrayBuffer)_0xf39346[_0xc3428e(0x1a0,0x163)]('file',new Blob([_0x43cc16]),_0x30db76);else typeof _0x43cc16===_0xc3428e(0x182,0x16c)&&_0xf39346[_0xc3428e(0x1a0,0x1e2)](_0xc3428e(0x18e,0x138),new Blob([_0x43cc16],{'type':_0xc3428e(0x201,0x214)}),_0x30db76);}}_0xf39346['append'](_0xc3428e(0x1f8,0x263),_0x30db76);_0x417e08?.[_0xc3428e(0x128,0x107)]&&_0xf39346[_0xc3428e(0x1a0,0x1a4)](_0xc3428e(0x128,0x19d),_0x417e08[_0xc3428e(0x128,0x198)]);_0x417e08?.['contentType']&&_0xf39346['append']('contentType',_0x417e08['contentType']);_0x417e08?.['metadata']&&_0xf39346[_0xc3428e(0x1a0,0x1bd)](_0xc3428e(0x1a9,0x1a0),JSON[_0xc3428e(0x1bf,0x1cc)](_0x417e08[_0xc3428e(0x1a9,0x20e)]));const _0x36d64e='/storage/buckets/'+this[_0xc3428e(0x1c4,0x222)]+'/files'+(_0x417e08?.[_0xc3428e(0x16c,0x16c)]?_0xc3428e(0x1e0,0x1ae):''),response=await this['httpClient'][_0xc3428e(0x136,0x1a2)](_0x36d64e,_0xf39346,{'headers':{'Content-Type':_0xc3428e(0x1fe,0x1e1)}});return{'data':response[_0xc3428e(0x175,0x184)],'error':null};}catch(_0x557bbc){return{'data':null,'error':_0x557bbc instanceof EBaaSError?_0x557bbc:new EBaaSError(_0x557bbc instanceof Error?_0x557bbc['message']:_0xc3428e(0x1b9,0x1cd),0x0,_0x557bbc)};}}async['download'](_0x52458a,_0x1c51eb){function _0x46d144(_0x25c8ea,_0x8e9cc5){return _0x9ef0(_0x8e9cc5-0x69,_0x25c8ea);}try{const _0x2899f0=new URLSearchParams();_0x1c51eb?.[_0x46d144(0x233,0x26a)]&&Object['entries'](_0x1c51eb[_0x46d144(0x225,0x26a)])[_0x46d144(0x202,0x248)](([_0x5f494c,_0x3b6036])=>{_0x3b6036!==undefined&&_0x2899f0['append'](_0x5f494c,String(_0x3b6036));});const _0x54842b='/storage/buckets/'+this['bucketId']+_0x46d144(0x29b,0x2c9)+_0x52458a+(_0x2899f0['toString']()?'?'+_0x2899f0['toString']():''),response=await this['httpClient']['get'](_0x54842b,{'responseType':'blob'});return{'data':response[_0x46d144(0x1d7,0x245)],'error':null};}catch(_0x470280){return{'data':null,'error':_0x470280 instanceof EBaaSError?_0x470280:new EBaaSError(_0x470280 instanceof Error?_0x470280['message']:'Failed\x20to\x20download\x20file',0x0,_0x470280)};}}async[_0x57b89b(-0x14e,-0x156)](_0x5b9a8c,_0x1e5764){function _0x53a094(_0x244e3c,_0x49c82e){return _0x9ef0(_0x49c82e- -0x22a,_0x244e3c);}try{const _0x56df46=new URLSearchParams();_0x5b9a8c&&_0x56df46['append']('prefix',_0x5b9a8c);_0x1e5764?.['limit']&&_0x56df46[_0x53a094(-0x12,-0x23)](_0x53a094(-0x4c,0x6),String(_0x1e5764[_0x53a094(0x3b,0x6)]));_0x1e5764?.['offset']&&_0x56df46['append']('offset',String(_0x1e5764['offset']));_0x1e5764?.[_0x53a094(0x18,-0x31)]&&_0x56df46['append']('sortBy',JSON[_0x53a094(0x4a,-0x4)](_0x1e5764['sortBy']));_0x1e5764?.['search']&&_0x56df46['append'](_0x53a094(-0x1f,0x8),_0x1e5764['search']);const _0x541b8d=_0x53a094(0x7,-0x56)+this['bucketId']+'/files'+(_0x56df46['toString']()?'?'+_0x56df46[_0x53a094(-0x83,-0x25)]():''),response=await this['httpClient'][_0x53a094(0x15,0x9)](_0x541b8d);return{'data':response['data'],'error':null};}catch(_0x5843e7){return{'data':null,'error':_0x5843e7 instanceof EBaaSError?_0x5843e7:new EBaaSError(_0x5843e7 instanceof Error?_0x5843e7['message']:'Failed\x20to\x20list\x20files',0x0,_0x5843e7)};}}async['remove'](_0x3d65b4){function _0x12d88e(_0x404dc8,_0x295d68){return _0x9ef0(_0x404dc8-0x13d,_0x295d68);}try{const response=await this['httpClient'][_0x12d88e(0x322,0x2b9)]('/storage/buckets/'+this['bucketId']+_0x12d88e(0x33a,0x391),{'data':{'paths':_0x3d65b4}});return{'data':response[_0x12d88e(0x319,0x383)],'error':null};}catch(_0x4307c6){return{'data':null,'error':_0x4307c6 instanceof EBaaSError?_0x4307c6:new EBaaSError(_0x4307c6 instanceof Error?_0x4307c6['message']:'Failed\x20to\x20remove\x20files',0x0,_0x4307c6)};}}async[_0x57b89b(-0x8d,-0xa5)](fromPath,_0x56a6e9){function _0x3d50b5(_0x273d10,_0x50a037){return _0x9ef0(_0x273d10- -0xfe,_0x50a037);}try{const response=await this[_0x3d50b5(0xd1,0x14a)][_0x3d50b5(0x9f,0xae)](_0x3d50b5(0xd6,0x12d)+this[_0x3d50b5(0x12d,0xda)]+'/files/move',{'sourceKey':fromPath,'destinationKey':_0x56a6e9});return{'data':response[_0x3d50b5(0xde,0x154)],'error':null};}catch(_0x3adf06){return{'data':null,'error':_0x3adf06 instanceof EBaaSError?_0x3adf06:new EBaaSError(_0x3adf06 instanceof Error?_0x3adf06[_0x3d50b5(0xb1,0xd1)]:'Failed\x20to\x20move\x20file',0x0,_0x3adf06)};}}async['copy'](fromPath,_0x7408ac){function _0x44273a(_0x51f1d3,_0x55273f){return _0x9ef0(_0x51f1d3-0x232,_0x55273f);}try{const response=await this[_0x44273a(0x401,0x3ee)][_0x44273a(0x3cf,0x3d6)]('/storage/buckets/'+this['bucketId']+'/files/copy',{'sourceKey':fromPath,'destinationKey':_0x7408ac});return{'data':response[_0x44273a(0x40e,0x454)],'error':null};}catch(_0x3917d2){return{'data':null,'error':_0x3917d2 instanceof EBaaSError?_0x3917d2:new EBaaSError(_0x3917d2 instanceof Error?_0x3917d2['message']:'Failed\x20to\x20copy\x20file',0x0,_0x3917d2)};}}async[_0x57b89b(-0x170,-0x15a)](_0x52cefc,_0x23b03d,_0x1287ce){function _0x193c78(_0xe53fd2,_0xe64d9c){return _0x9ef0(_0xe64d9c- -0x385,_0xe53fd2);}try{const response=await this[_0x193c78(-0x15f,-0x1b6)]['post']('/storage/buckets/'+this['bucketId']+_0x193c78(-0xdd,-0x125)+_0x52cefc+_0x193c78(-0x104,-0x122),{'expiresIn':_0x23b03d,..._0x1287ce});return{'data':response['data'],'error':null};}catch(_0x495ae3){return{'data':null,'error':_0x495ae3 instanceof EBaaSError?_0x495ae3:new EBaaSError(_0x495ae3 instanceof Error?_0x495ae3[_0x193c78(-0x17b,-0x1d6)]:'Failed\x20to\x20create\x20signed\x20URL',0x0,_0x495ae3)};}}['getPublicUrl'](_0x6e28ca,_0x1646b3){const _0x462e6b=new URLSearchParams();function _0x5c6f2c(_0x49d500,_0x3297fe){return _0x9ef0(_0x49d500- -0x3aa,_0x3297fe);}_0x1646b3?.['transform']&&Object[_0x5c6f2c(-0x1af,-0x1ac)](_0x1646b3[_0x5c6f2c(-0x1a9,-0x208)])[_0x5c6f2c(-0x1cb,-0x15f)](([_0x2d7c14,_0x5abae4])=>{_0x5abae4!==undefined&&_0x462e6b['append'](_0x2d7c14,String(_0x5abae4));});const _0x5ce007=this['httpClient'][_0x5c6f2c(-0x16a,-0xef)]||'',_0x51dad4=_0x5ce007+_0x5c6f2c(-0x1d6,-0x248)+this[_0x5c6f2c(-0x17f,-0x1e4)]+_0x5c6f2c(-0x14a,-0x127)+_0x6e28ca+(_0x462e6b['toString']()?'?'+_0x462e6b['toString']():'');return{'data':{'publicUrl':_0x51dad4}};}async['getFileInfo'](_0x227b7e){function _0x37631a(_0x1f7edb,_0x352d45){return _0x9ef0(_0x1f7edb-0x196,_0x352d45);}try{const response=await this[_0x37631a(0x365,0x39f)]['get'](_0x37631a(0x36a,0x3ce)+this['bucketId']+'/files/'+_0x227b7e+_0x37631a(0x371,0x311));return{'data':response['data'],'error':null};}catch(_0x42bfd3){return{'data':null,'error':_0x42bfd3 instanceof EBaaSError?_0x42bfd3:new EBaaSError(_0x42bfd3 instanceof Error?_0x42bfd3[_0x37631a(0x345,0x352)]:_0x37631a(0x3a8,0x3c3),0x0,_0x42bfd3)};}}async['updateFileMetadata'](_0x1be0f7,metadata){function _0x4ab366(_0xd71207,_0x4cf96a){return _0x9ef0(_0xd71207-0x248,_0x4cf96a);}try{const response=await this['httpClient']['put'](_0x4ab366(0x41c,0x47e)+this['bucketId']+_0x4ab366(0x4a8,0x48e)+_0x1be0f7+_0x4ab366(0x45d,0x43f),{'metadata':metadata});return{'data':response['data'],'error':null};}catch(_0x2b2775){return{'data':null,'error':_0x2b2775 instanceof EBaaSError?_0x2b2775:new EBaaSError(_0x2b2775 instanceof Error?_0x2b2775['message']:_0x4ab366(0x4ba,0x4e3),0x0,_0x2b2775)};}}}function _0x9ef0(_0x4f87b7,_0x2a8fef){const _0x3d6c41=_0x3d6c();return _0x9ef0=function(_0x9ef05c,_0x249c5d){_0x9ef05c=_0x9ef05c-0x17e;let _0x284309=_0x3d6c41[_0x9ef05c];if(_0x9ef0['xamICu']===undefined){var _0x46e3c3=function(_0x36e4e9){const _0x332dcc='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x426b6d='',_0x530e18='';for(let _0x414c01=0x0,_0x200c1e,_0x362d1a,_0x47f375=0x0;_0x362d1a=_0x36e4e9['charAt'](_0x47f375++);~_0x362d1a&&(_0x200c1e=_0x414c01%0x4?_0x200c1e*0x40+_0x362d1a:_0x362d1a,_0x414c01++%0x4)?_0x426b6d+=String['fromCharCode'](0xff&_0x200c1e>>(-0x2*_0x414c01&0x6)):0x0){_0x362d1a=_0x332dcc['indexOf'](_0x362d1a);}for(let _0x1b94c6=0x0,_0x206a98=_0x426b6d['length'];_0x1b94c6<_0x206a98;_0x1b94c6++){_0x530e18+='%'+('00'+_0x426b6d['charCodeAt'](_0x1b94c6)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x530e18);};_0x9ef0['qnNuse']=_0x46e3c3,_0x4f87b7=arguments,_0x9ef0['xamICu']=!![];}const _0x2f42aa=_0x3d6c41[0x0],_0x303982=_0x9ef05c+_0x2f42aa,_0xdc8f2c=_0x4f87b7[_0x303982];return!_0xdc8f2c?(_0x284309=_0x9ef0['qnNuse'](_0x284309),_0x4f87b7[_0x303982]=_0x284309):_0x284309=_0xdc8f2c,_0x284309;},_0x9ef0(_0x4f87b7,_0x2a8fef);}class StorageClient{constructor(_0x2cc85a){function _0x33b691(_0x48162f,_0x4ea720){return _0x9ef0(_0x4ea720-0x5c,_0x48162f);}this[_0x33b691(0x25e,0x22b)]=_0x2cc85a;}['from'](bucketId){function _0x3cb96f(_0x3ec68e,_0x36e55a){return _0x9ef0(_0x3ec68e- -0x390,_0x36e55a);}return new StorageBucket(this[_0x3cb96f(-0x1c1,-0x18c)],bucketId);}async['createBucket'](_0x44ca5e,_0x1ff60d){function _0x1569da(_0x151b24,_0x9c0ac7){return _0x9ef0(_0x9c0ac7- -0x11d,_0x151b24);}try{const response=await this['httpClient'][_0x1569da(0xc8,0x80)](_0x1569da(0xf9,0x9e),{'id':_0x44ca5e,..._0x1ff60d});return{'data':response[_0x1569da(0xe8,0xbf)],'error':null};}catch(_0x4ddedb){return{'data':null,'error':_0x4ddedb instanceof EBaaSError?_0x4ddedb:new EBaaSError(_0x4ddedb instanceof Error?_0x4ddedb['message']:_0x1569da(0x12c,0xef),0x0,_0x4ddedb)};}}async['getBucket'](_0x5ad249){function _0x694394(_0x1da883,_0xfc48b1){return _0x9ef0(_0xfc48b1-0x59,_0x1da883);}try{const response=await this[_0x694394(0x22a,0x228)][_0x694394(0x2f5,0x28c)](_0x694394(0x210,0x22d)+_0x5ad249);return{'data':response[_0x694394(0x1e8,0x235)],'error':null};}catch(_0x293370){return{'data':null,'error':_0x293370 instanceof EBaaSError?_0x293370:new EBaaSError(_0x293370 instanceof Error?_0x293370['message']:'Failed\x20to\x20get\x20bucket',0x0,_0x293370)};}}async['listBuckets'](){function _0x25b47b(_0xbabc6e,_0x1ad1d2){return _0x9ef0(_0x1ad1d2-0x3a6,_0xbabc6e);}try{const response=await this[_0x25b47b(0x562,0x575)][_0x25b47b(0x627,0x5d9)](_0x25b47b(0x5b3,0x561));return{'data':response['data'],'error':null};}catch(_0xe318b3){return{'data':null,'error':_0xe318b3 instanceof EBaaSError?_0xe318b3:new EBaaSError(_0xe318b3 instanceof Error?_0xe318b3['message']:'Failed\x20to\x20list\x20buckets',0x0,_0xe318b3)};}}async[_0x57b89b(-0xea,-0xa4)](_0xe935,_0x9c8472){function _0x2839a3(_0x49f860,_0x32c168){return _0x9ef0(_0x49f860- -0x103,_0x32c168);}try{const response=await this['httpClient']['put']('/storage/buckets/'+_0xe935,_0x9c8472);return{'data':response['data'],'error':null};}catch(_0x122066){return{'data':null,'error':_0x122066 instanceof EBaaSError?_0x122066:new EBaaSError(_0x122066 instanceof Error?_0x122066['message']:_0x2839a3(0x16a,0xfc),0x0,_0x122066)};}}async[_0x57b89b(-0x14c,-0x130)](_0x3961fc){function _0x4b75af(_0xdcc4a0,_0x1ecf76){return _0x9ef0(_0x1ecf76-0x27c,_0xdcc4a0);}try{const response=await this['httpClient']['delete'](_0x4b75af(0x482,0x450)+_0x3961fc);return{'data':response[_0x4b75af(0x44a,0x458)],'error':null};}catch(_0x4c036a){return{'data':null,'error':_0x4c036a instanceof EBaaSError?_0x4c036a:new EBaaSError(_0x4c036a instanceof Error?_0x4c036a['message']:'Failed\x20to\x20delete\x20bucket',0x0,_0x4c036a)};}}async['getUsage'](){function _0x4f6cd2(_0x13966c,_0x3dab6f){return _0x9ef0(_0x3dab6f- -0x354,_0x13966c);}try{const response=await this['httpClient']['get']('/storage/usage');return{'data':response['data'],'error':null};}catch(_0x127def){return{'data':null,'error':_0x127def instanceof EBaaSError?_0x127def:new EBaaSError(_0x127def instanceof Error?_0x127def['message']:_0x4f6cd2(-0x11d,-0x195),0x0,_0x127def)};}}}class RealtimeChannel extends _0x36e4e9{constructor(_0x24055b,_0x9c9437){super(),this['joinedOnce']=![];function _0xe45303(_0x35b392,_0x1b5e4a){return _0x9ef0(_0x1b5e4a-0x173,_0x35b392);}this[_0xe45303(0x38d,0x3d0)]='closed',this['subscriptions']=new Map(),this[_0xe45303(0x31b,0x32f)]=_0x24055b,this['socket']=_0x9c9437;}[_0x57b89b(-0x19b,-0x152)](_0x3001d4){function _0x43af6b(_0x4ae302,_0x309af6){return _0x9ef0(_0x4ae302-0x235,_0x309af6);}return!this[_0x43af6b(0x3b6,0x421)]&&(this['joinedOnce']=!![],this['_join']()),_0x3001d4&&this['on'](_0x43af6b(0x434,0x4a3),_0x3001d4),this;}[_0x57b89b(-0x17c,-0x15b)](filter,_0x321a39){const _0x15fc6a='postgres_changes:'+JSON[_0x1ebbf7(0x25c,0x2b9)](filter);super['on'](_0x15fc6a,_0x321a39);const _0x36094c={'unsubscribe':()=>{super['off'](_0x15fc6a,_0x321a39);function _0x2d471f(_0x55af6b,_0xb85c07){return _0x9ef0(_0x55af6b- -0x153,_0xb85c07);}this[_0x2d471f(0x70,0x50)][_0x2d471f(0x92,0x95)](_0x15fc6a);}};function _0x1ebbf7(_0x356eef,_0x5b62b4){return _0x9ef0(_0x356eef-0x36,_0x5b62b4);}return this[_0x1ebbf7(0x1f9,0x188)][_0x1ebbf7(0x200,0x1ac)](_0x15fc6a,_0x36094c),this[_0x1ebbf7(0x1f6,0x1ff)]?.[_0x1ebbf7(0x20d,0x1c8)]&&this[_0x1ebbf7(0x293,0x30c)]==='joined'&&this['socket'][_0x1ebbf7(0x2a4,0x240)]('subscribe_postgres_changes',{'topic':this[_0x1ebbf7(0x1f2,0x222)],'filter':filter,'ref':this[_0x1ebbf7(0x272,0x23f)]()}),_0x36094c;}['onBroadcast'](filter,_0x55b388){const _0x4ad42d='broadcast:'+JSON[_0x29bb7d(0x313,0x2d8)](filter);super['on'](_0x4ad42d,_0x55b388);const _0x691fbc={'unsubscribe':()=>{function _0x116f9b(_0x1488a7,_0x4c4ab8){return _0x9ef0(_0x4c4ab8-0x3ad,_0x1488a7);}super[_0x116f9b(0x4d9,0x531)](_0x4ad42d,_0x55b388),this['subscriptions']['delete'](_0x4ad42d);}};this['subscriptions'][_0x29bb7d(0x2b7,0x23d)](_0x4ad42d,_0x691fbc);function _0x29bb7d(_0x152648,_0x3bc00f){return _0x9ef0(_0x152648-0xed,_0x3bc00f);}return _0x691fbc;}[_0x57b89b(-0x58,-0x9e)](filter,_0x598a2c){const _0x360ff6=_0x31effe(0x8,0xe)+JSON[_0x31effe(0x61,0xc)](filter);super['on'](_0x360ff6,_0x598a2c);const _0x56f6d1={'unsubscribe':()=>{super[_0x5d4378(-0x1bd,-0x1d8)](_0x360ff6,_0x598a2c);function _0x5d4378(_0x42b5e8,_0x57d343){return _0x9ef0(_0x42b5e8- -0x341,_0x57d343);}this[_0x5d4378(-0x17e,-0x1be)]['delete'](_0x360ff6);}};this['subscriptions'][_0x31effe(0x5,0x25)](_0x360ff6,_0x56f6d1);function _0x31effe(_0x54c980,_0x457539){return _0x9ef0(_0x54c980- -0x1c5,_0x457539);}return _0x56f6d1;}['send'](_0x24a5cd){return new Promise(_0x1f0edb=>{function _0x3eef00(_0x1f8694,_0x181e36){return _0x9ef0(_0x181e36- -0x15c,_0x1f8694);}this['socket']?.[_0x3eef00(0x8c,0x7b)]&&this['state']==='joined'?(this[_0x3eef00(0xde,0x64)]['emit'](_0x3eef00(-0x2e,0x42),{'topic':this[_0x3eef00(0x40,0x60)],'event':_0x24a5cd['event'],'payload':_0x24a5cd,'ref':this['makeRef']()}),_0x1f0edb('ok')):_0x1f0edb('error');});}[_0x57b89b(-0x108,-0xd8)](_0x5678b7){return new Promise(_0x5753ce=>{function _0x51fd21(_0x302b3d,_0x421a2b){return _0x9ef0(_0x421a2b- -0x3e6,_0x302b3d);}this['socket']?.['connected']&&this['state']===_0x51fd21(-0x1a2,-0x205)?(this[_0x51fd21(-0x1b6,-0x226)][_0x51fd21(-0x148,-0x178)](_0x51fd21(-0x1a6,-0x176),{'topic':this[_0x51fd21(-0x249,-0x22a)],'event':_0x51fd21(-0x216,-0x1cc),'payload':_0x5678b7,'ref':this[_0x51fd21(-0x146,-0x1aa)]()}),_0x5753ce('ok')):_0x5753ce(_0x51fd21(-0x130,-0x191));});}[_0x57b89b(-0x130,-0xc5)](){return new Promise(_0x1bc4b4=>{function _0x58334b(_0x2ab413,_0x1a49a6){return _0x9ef0(_0x1a49a6- -0x96,_0x2ab413);}this[_0x58334b(0x11c,0x12a)]?.['connected']&&this[_0x58334b(0x17e,0x1c7)]==='joined'?(this['socket'][_0x58334b(0x170,0x1d8)](_0x58334b(0x1a9,0x1da),{'topic':this['topic'],'event':'untrack','ref':this[_0x58334b(0x173,0x1a6)]()}),_0x1bc4b4('ok')):_0x1bc4b4('error');});}[_0x57b89b(-0x125,-0x139)](){return new Promise(_0x8ba8df=>{this['state']='leaving',this[_0x213a29(0x45c,0x427)]['forEach'](_0x23d22e=>{function _0x17150a(_0x491a5a,_0x1738cf){return _0x9ef0(_0x1738cf- -0x164,_0x491a5a);}_0x23d22e[_0x17150a(0x97,0x55)]();}),this['subscriptions'][_0x213a29(0x4b7,0x490)]();function _0x213a29(_0x29a740,_0x1df25c){return _0x9ef0(_0x1df25c-0x264,_0x29a740);}this['socket']?.['connected']&&this[_0x213a29(0x3ab,0x424)][_0x213a29(0x4e2,0x4d2)]('leave',{'topic':this[_0x213a29(0x461,0x420)],'ref':this['makeRef']()}),this[_0x213a29(0x4bc,0x4c1)]=_0x213a29(0x3e5,0x45a),this['removeAllListeners'](),_0x8ba8df('ok');});}[_0x57b89b(-0xfa,-0x89)](){if(this[_0x27818e(0x127,0x18c)]===_0x27818e(0xfb,0x169))return;this['state']=_0x27818e(0x8e,0xf6);function _0x27818e(_0x13b694,_0x315b6a){return _0x9ef0(_0x13b694- -0x136,_0x315b6a);}this[_0x27818e(0x8a,0xb7)]?.['connected']&&(this['socket'][_0x27818e(0x138,0x19b)](_0x27818e(0xd3,0x87),{'topic':this['topic'],'ref':this['makeRef']()}),setTimeout(()=>{function _0x22b236(_0x5079bb,_0x4868e1){return _0x9ef0(_0x4868e1-0x272,_0x5079bb);}this['state']==='joining'&&(this['state']='joined',this[_0x22b236(0x470,0x4e0)](_0x22b236(0x4c3,0x471),_0x22b236(0x402,0x46c)));},0x64));}[_0x57b89b(-0x3d,-0xaf)](){function _0xcd58fa(_0x2be0aa,_0x529a47){return _0x9ef0(_0x2be0aa- -0x20b,_0x529a47);}this['joinedOnce']&&(this[_0xcd58fa(0x5e,0x8)](),this['subscriptions'][_0xcd58fa(-0x2c,-0x92)]((_0x46ca31,_0x58b054)=>{function _0x5af7b7(_0x38f2b7,_0x51bb76){return _0x9ef0(_0x38f2b7- -0x248,_0x51bb76);}if(_0x58b054[_0x5af7b7(-0x3b,-0x77)]('postgres_changes:')){const filter=JSON[_0x5af7b7(-0xb,-0x70)](_0x58b054['replace'](_0x5af7b7(-0x5b,-0xc8),''));this['socket']?.['emit'](_0x5af7b7(-0x8a,-0xa0),{'topic':this['topic'],'filter':filter,'ref':this['makeRef']()});}}));}[_0x57b89b(-0xf1,-0xee)](_0x26194c,_0x1113df){if(_0x26194c===_0xfb0832(0x604,0x673)){const _0x36fb16=_0xfb0832(0x5c9,0x600)+JSON[_0xfb0832(0x602,0x678)](_0x1113df[_0xfb0832(0x5a4,0x617)]||{});this[_0xfb0832(0x64a,0x678)](_0x36fb16,_0x1113df);}else{if(_0x26194c===_0xfb0832(0x57a,0x575)){const _0x5a2456='broadcast:'+JSON['stringify']({'event':_0x1113df['event']});this[_0xfb0832(0x64a,0x6b6)](_0x5a2456,_0x1113df);}else{if(_0x26194c===_0xfb0832(0x64c,0x626)){const _0x4080c9=_0xfb0832(0x5a9,0x566)+JSON['stringify']({'event':_0x1113df['event']});this['emit'](_0x4080c9,_0x1113df);}}}function _0xfb0832(_0x3ca1f0,_0x990d73){return _0x9ef0(_0x3ca1f0-0x3dc,_0x990d73);}this[_0xfb0832(0x64a,0x6aa)](_0x26194c,_0x1113df);}['_setState'](_0x592ecb){this['state']=_0x592ecb;function _0x3904e7(_0x1fb8a1,_0x3b1a4d){return _0x9ef0(_0x3b1a4d- -0x3d8,_0x1fb8a1);}let status;switch(_0x592ecb){case _0x3904e7(-0x215,-0x1f7):status='SUBSCRIBED';break;case _0x3904e7(-0x139,-0x19e):status=_0x3904e7(-0x27f,-0x225);break;case _0x3904e7(-0x203,-0x1e2):status=_0x3904e7(-0x1b1,-0x1a4);break;default:return;}this['emit']('status',status);}[_0x57b89b(-0x7d,-0xb6)](){function _0x40d988(_0x454f2e,_0xffcd54){return _0x9ef0(_0xffcd54-0x230,_0x454f2e);}return Math[_0x40d988(0x42a,0x446)]()[_0x40d988(0x471,0x435)](0x24)[_0x40d988(0x435,0x466)](0x2,0xf);}[_0x57b89b(-0xcf,-0xd6)](){return this['state'];}}class RealtimeClient{constructor(_0x1506a4,_0x2008b0,_0x1ee92c={}){this[_0x5e2ffd(0x3a6,0x38f)]=null,this['channels']=new Map(),this['connectionState']=_0x5e2ffd(0x43e,0x3d6),this[_0x5e2ffd(0x3b6,0x3e1)]=0x0,this[_0x5e2ffd(0x42a,0x435)]=0x5,this['url']=_0x1506a4,this['apiKey']=_0x2008b0;function _0x5e2ffd(_0x29e3cc,_0x3a6f3a){return _0x9ef0(_0x29e3cc-0x1e6,_0x3a6f3a);}this['options']={'heartbeatInterval':0x7530,'reconnectInterval':0x1388,'maxReconnectAttempts':0x5,..._0x1ee92c};}[_0x57b89b(-0x147,-0xcd)](){return new Promise((_0x3190ca,_0x50ffeb)=>{if(this['socket']?.['connected']){_0x3190ca();return;}this[_0x413bac(0x3b4,0x33b)]='connecting',this[_0x413bac(0x384,0x398)]=io(this[_0x413bac(0x396,0x36e)],{'auth':{'apikey':this['apiKey']},'transports':['websocket'],'reconnection':!![],'reconnectionDelay':this['options'][_0x413bac(0x41a,0x488)],'reconnectionAttempts':this[_0x413bac(0x369,0x3af)][_0x413bac(0x408,0x41c)],...this['options'][_0x413bac(0x409,0x3c3)]}),this['socket']['on'](_0x413bac(0x3e9,0x459),()=>{this['connectionState']=_0x174c3d(0x1ea,0x1bd);function _0x174c3d(_0x4605d6,_0x5900ed){return _0x9ef0(_0x5900ed- -0x1a,_0x4605d6);}this[_0x174c3d(0x1f3,0x1b6)]=0x0,this[_0x174c3d(0x1b8,0x1cd)](),_0x3190ca();}),this[_0x413bac(0x384,0x38e)]['on']('disconnect',_0x430205=>{this['connectionState']=_0x52da1a(0x133,0x1aa);function _0x52da1a(_0x317e70,_0x56eec0){return _0x9ef0(_0x317e70- -0x125,_0x56eec0);}this[_0x52da1a(0x8c,0xb4)]['forEach'](channel=>{channel['_setState']('closed');});}),this[_0x413bac(0x384,0x377)]['on'](_0x413bac(0x395,0x3ae),_0x408a3f=>{this[_0x26a7bd(0x151,0xe8)]=_0x26a7bd(0x1c7,0x14d),this[_0x26a7bd(0x9d,0xc8)]++;function _0x26a7bd(_0x1ca3b9,_0x1c62de){return _0x9ef0(_0x1c62de- -0x108,_0x1ca3b9);}this[_0x26a7bd(0xb7,0xc8)]>=this[_0x26a7bd(0x17a,0x13c)]&&_0x50ffeb(new Error(_0x26a7bd(0x176,0x11a)+this['maxReconnectAttempts']+_0x26a7bd(0xc6,0x80)+_0x408a3f[_0x26a7bd(0x110,0xa7)]));});function _0x413bac(_0x25b548,_0x3772d4){return _0x9ef0(_0x25b548-0x1c4,_0x3772d4);}this['socket']['on']('reconnect',()=>{this[_0x33c588(0x6e,0x1e)]='connected';function _0x33c588(_0x15d980,_0x20314c){return _0x9ef0(_0x15d980- -0x182,_0x20314c);}this['reconnectAttempts']=0x0,this[_0x33c588(0x2f,0x19)]['forEach'](channel=>{function _0x1ec4c3(_0x357cd7,_0x4ef0c3){return _0x9ef0(_0x357cd7- -0x166,_0x4ef0c3);}channel[_0x1ec4c3(0xdd,0x9a)]();});}),this[_0x413bac(0x384,0x325)]['on']('postgres_changes',_0x83d3b3=>{function _0x15f3f8(_0x3ed867,_0x524dd4){return _0x9ef0(_0x3ed867- -0x1b5,_0x524dd4);}const channel=this['channels']['get'](_0x83d3b3[_0x15f3f8(0x7,-0x56)]);channel&&channel[_0x15f3f8(0x4f,0xc2)]('postgres_changes',_0x83d3b3);}),this[_0x413bac(0x384,0x3cc)]['on'](_0x413bac(0x362,0x394),_0x19cf17=>{function _0x2e2c09(_0x2f7fd5,_0x3bdae4){return _0x9ef0(_0x2f7fd5- -0xe7,_0x3bdae4);}const channel=this[_0x2e2c09(0xca,0x132)]['get'](_0x19cf17['topic']);channel&&channel[_0x2e2c09(0x11d,0xb6)](_0x2e2c09(0xb7,0xfa),_0x19cf17);}),this['socket']['on']('presence',_0x34e953=>{const channel=this[_0x5203e4(-0x145,-0x187)][_0x5203e4(-0xe2,-0x105)](_0x34e953['topic']);function _0x5203e4(_0x22c80b,_0xf66518){return _0x9ef0(_0xf66518- -0x338,_0x22c80b);}channel&&channel['_trigger'](_0x5203e4(-0x103,-0xc8),_0x34e953);});});}['disconnect'](){this[_0x12f244(0x2f4,0x2d9)]&&(this[_0x12f244(0x31a,0x2d9)][_0x12f244(0x252,0x2bb)](),this['socket']=null);function _0x12f244(_0x1cdb9d,_0xa7a856){return _0x9ef0(_0xa7a856-0x119,_0x1cdb9d);}this['connectionState']='disconnected',this['channels']['clear']();}['channel'](_0x337da5){function _0x5567ea(_0x2b36cf,_0x2d7893){return _0x9ef0(_0x2b36cf-0x323,_0x2d7893);}if(this['channels'][_0x5567ea(0x4d0,0x4a2)](_0x337da5))return this[_0x5567ea(0x4d4,0x4ba)]['get'](_0x337da5);const channel=new RealtimeChannel(_0x337da5,this[_0x5567ea(0x4e3,0x4ed)]);return this[_0x5567ea(0x4d4,0x532)]['set'](_0x337da5,channel),this['connectionState']==='connected'&&channel[_0x5567ea(0x58c,0x601)](),channel;}['removeChannel'](channel){function _0x576757(_0x1f715f,_0x52f017){return _0x9ef0(_0x1f715f-0x3d7,_0x52f017);}const _0xc9b1db=channel[_0x576757(0x593,0x559)];this['channels']['has'](_0xc9b1db)&&(this[_0x576757(0x588,0x597)][_0x576757(0x5bc,0x54b)](_0xc9b1db),channel['unsubscribe']());}['removeAllChannels'](){this['channels']['forEach'](channel=>{channel['unsubscribe']();}),this['channels']['clear']();}['getChannels'](){function _0xdf95f7(_0x2d89a3,_0xac3157){return _0x9ef0(_0xac3157-0x253,_0x2d89a3);}return Array[_0xdf95f7(0x49d,0x472)](this[_0xdf95f7(0x3f6,0x404)][_0xdf95f7(0x4c4,0x46e)]());}[_0x57b89b(-0x152,-0x162)](){function _0x127f32(_0x51d2ac,_0xa1c21e){return _0x9ef0(_0xa1c21e- -0x1b1,_0x51d2ac);}return this[_0x127f32(0xb9,0x3f)]===_0x127f32(-0x22,0x26)&&!!this['socket']?.[_0x127f32(0x21,0x26)];}[_0x57b89b(-0x106,-0x166)](){function _0x2b708a(_0x204fd9,_0x2e6433){return _0x9ef0(_0x204fd9- -0x1fd,_0x2e6433);}return this[_0x2b708a(-0xd,-0x4a)];}[_0x57b89b(-0x1bc,-0x16c)](_0x287ca4){const _0x74394a=()=>_0x287ca4(this['connectionState']);this[_0x1a0774(-0x142,-0x183)]&&(this[_0x1a0774(-0x145,-0x183)]['on']('connect',()=>{this[_0x86df60(0x8d,0x9d)]='connected';function _0x86df60(_0x349a24,_0x59a9fa){return _0x9ef0(_0x349a24- -0x163,_0x59a9fa);}_0x74394a();}),this['socket']['on']('disconnect',()=>{function _0x449acc(_0x4b57b6,_0x58cfe2){return _0x9ef0(_0x4b57b6-0x12d,_0x58cfe2);}this[_0x449acc(0x31d,0x34e)]='disconnected',_0x74394a();}),this[_0x1a0774(-0x18d,-0x183)]['on']('connect_error',()=>{function _0x12d268(_0xce0e30,_0x2776b0){return _0x9ef0(_0xce0e30-0x1c8,_0x2776b0);}this[_0x12d268(0x3b8,0x406)]='error',_0x74394a();}));function _0x1a0774(_0x2a8042,_0xfd6a81){return _0x9ef0(_0xfd6a81- -0x343,_0x2a8042);}return()=>{function _0xcff738(_0x2a049b,_0x25bf20){return _0x9ef0(_0x2a049b-0x1b,_0x25bf20);}this['socket']&&(this[_0xcff738(0x1db,0x1ab)][_0xcff738(0x19f,0x177)]('connect',_0x74394a),this[_0xcff738(0x1db,0x222)][_0xcff738(0x19f,0x154)]('disconnect',_0x74394a),this['socket'][_0xcff738(0x19f,0x1be)](_0xcff738(0x1ec,0x229),_0x74394a));};}['setupHeartbeat'](){if(!this[_0x4318dd(0x51c,0x506)]['heartbeatInterval']||!this['socket'])return;function _0x4318dd(_0x28778c,_0x5ce4e3){return _0x9ef0(_0x28778c-0x377,_0x5ce4e3);}const interval=setInterval(()=>{function _0x1ccf88(_0x3bd837,_0x1f7004){return _0x9ef0(_0x3bd837-0x2ee,_0x1f7004);}this['socket']?.['connected']?this[_0x1ccf88(0x4ae,0x4c2)][_0x1ccf88(0x55c,0x546)]('heartbeat',{'timestamp':Date[_0x1ccf88(0x502,0x52a)]()}):clearInterval(interval);},this[_0x4318dd(0x51c,0x522)]['heartbeatInterval']);}[_0x57b89b(-0xc6,-0xda)](){function _0x1be95f(_0x3b327c,_0x166ff1){return _0x9ef0(_0x3b327c-0x26f,_0x166ff1);}return this[_0x1be95f(0x42f,0x40e)];}}class FunctionsClient{constructor(_0x5b7edc){this['httpClient']=_0x5b7edc;}async[_0x57b89b(-0x15f,-0xf4)](_0x3e4c48,_0xb2403f){function _0x23a86e(_0x1b3965,_0x3a1bbc){return _0x9ef0(_0x1b3965-0x10b,_0x3a1bbc);}try{const _0x576ad8=_0xb2403f?.[_0x23a86e(0x2ae,0x2c4)]||'POST',headers={'Content-Type':'application/json',..._0xb2403f?.['headers']};let response;const _0x5134ac='/functions/v1/'+_0x3e4c48;switch(_0x576ad8[_0x23a86e(0x356,0x387)]()){case'GET':response=await this['httpClient']['get'](_0x5134ac,{'headers':headers,'params':_0xb2403f?.[_0x23a86e(0x2e3,0x27d)]});break;case'POST':response=await this[_0x23a86e(0x2da,0x2cb)]['post'](_0x5134ac,_0xb2403f?.[_0x23a86e(0x2e3,0x2ed)],{'headers':headers});break;case'PUT':response=await this['httpClient'][_0x23a86e(0x354,0x3a8)](_0x5134ac,_0xb2403f?.[_0x23a86e(0x2e3,0x2fb)],{'headers':headers});break;case'PATCH':response=await this[_0x23a86e(0x2da,0x27c)][_0x23a86e(0x28a,0x2c3)](_0x5134ac,_0xb2403f?.[_0x23a86e(0x2e3,0x2f8)],{'headers':headers});break;case'DELETE':response=await this['httpClient'][_0x23a86e(0x2f0,0x2a3)](_0x5134ac,{'headers':headers,'data':_0xb2403f?.[_0x23a86e(0x2e3,0x2ac)]});break;default:throw new EBaaSError('Unsupported\x20HTTP\x20method:\x20'+_0x576ad8,0x190);}return{'data':response['data'],'error':null};}catch(_0x13924a){return{'data':null,'error':_0x13924a instanceof EBaaSError?_0x13924a:new EBaaSError(_0x13924a instanceof Error?_0x13924a[_0x23a86e(0x2ba,0x309)]:_0x23a86e(0x34a,0x347),0x0,_0x13924a)};}}async[_0x57b89b(-0x137,-0x156)](){function _0x431c88(_0x409d3d,_0x1fcbc8){return _0x9ef0(_0x1fcbc8-0x193,_0x409d3d);}try{const response=await this[_0x431c88(0x3bf,0x362)]['get']('/functions/v1');return{'data':response[_0x431c88(0x31c,0x36f)],'error':null};}catch(_0x3d1100){return{'data':null,'error':_0x3d1100 instanceof EBaaSError?_0x3d1100:new EBaaSError(_0x3d1100 instanceof Error?_0x3d1100['message']:_0x431c88(0x3ae,0x3ea),0x0,_0x3d1100)};}}async[_0x57b89b(-0x56,-0xbf)](_0x2d0da9){function _0x33499f(_0x4ca0c0,_0x497aa9){return _0x9ef0(_0x497aa9- -0x3d,_0x4ca0c0);}try{const response=await this[_0x33499f(0x159,0x192)][_0x33499f(0x1da,0x1f6)]('/functions/v1/'+_0x2d0da9+'/info');return{'data':response[_0x33499f(0x1ae,0x19f)],'error':null};}catch(_0x4a1e2){return{'data':null,'error':_0x4a1e2 instanceof EBaaSError?_0x4a1e2:new EBaaSError(_0x4a1e2 instanceof Error?_0x4a1e2['message']:_0x33499f(0x10f,0x178),0x0,_0x4a1e2)};}}async[_0x57b89b(-0xa6,-0x118)](_0x5acfd3,_0xf94145){function _0x3d7869(_0x37e3bd,_0x1aceb1){return _0x9ef0(_0x37e3bd- -0x276,_0x1aceb1);}try{const _0x48e3a3=new FormData();if(_0xf94145[_0x3d7869(-0x8c,-0x3a)]instanceof File)_0x48e3a3['append']('code',_0xf94145['code']);else typeof _0xf94145[_0x3d7869(-0x8c,-0x3d)]===_0x3d7869(-0x8d,-0xe0)&&_0x48e3a3[_0x3d7869(-0x6f,0xb)](_0x3d7869(-0x8c,-0xc4),new Blob([_0xf94145['code']],{'type':'text/plain'}),_0x3d7869(-0x27,-0x6e));_0xf94145[_0x3d7869(-0xed,-0xc4)]&&_0x48e3a3[_0x3d7869(-0x6f,-0x80)](_0x3d7869(-0xed,-0x142),_0xf94145['entrypoint']);_0xf94145[_0x3d7869(-0xf3,-0xd6)]&&_0x48e3a3[_0x3d7869(-0x6f,-0x54)](_0x3d7869(-0xf3,-0x89),JSON['stringify'](_0xf94145[_0x3d7869(-0xf3,-0x12c)]));_0xf94145['importMap']&&_0x48e3a3['append'](_0x3d7869(-0x7,0x51),JSON['stringify'](_0xf94145[_0x3d7869(-0x7,0x4a)]));_0xf94145['verify']!==undefined&&_0x48e3a3['append']('verify',String(_0xf94145['verify']));const response=await this['httpClient']['post']('/functions/v1/'+_0x5acfd3+'/deploy',_0x48e3a3,{'headers':{'Content-Type':_0x3d7869(-0x11,-0x78)}});return{'data':response[_0x3d7869(-0x9a,-0xe9)],'error':null};}catch(_0xf5d63f){return{'data':null,'error':_0xf5d63f instanceof EBaaSError?_0xf5d63f:new EBaaSError(_0xf5d63f instanceof Error?_0xf5d63f[_0x3d7869(-0xc7,-0xc2)]:'Failed\x20to\x20deploy\x20function',0x0,_0xf5d63f)};}}async[_0x57b89b(-0x16f,-0x10d)](_0x9945f4){function _0x2061c1(_0x2d0880,_0x2e9d0d){return _0x9ef0(_0x2d0880- -0x3ce,_0x2e9d0d);}try{const response=await this[_0x2061c1(-0x1ff,-0x1cc)][_0x2061c1(-0x1e9,-0x1d1)]('/functions/v1/'+_0x9945f4);return{'data':response[_0x2061c1(-0x1f2,-0x18c)],'error':null};}catch(_0x55eed1){return{'data':null,'error':_0x55eed1 instanceof EBaaSError?_0x55eed1:new EBaaSError(_0x55eed1 instanceof Error?_0x55eed1['message']:'Failed\x20to\x20delete\x20function',0x0,_0x55eed1)};}}async[_0x57b89b(-0x11e,-0xfb)](_0x59e998,_0x3951ee){function _0x354415(_0x506df5,_0x315fe0){return _0x9ef0(_0x315fe0- -0xa1,_0x506df5);}try{const response=await this[_0x354415(0x14d,0x12e)]['put']('/functions/v1/'+_0x59e998+_0x354415(0xb9,0xf5),{'env':_0x3951ee});return{'data':response['data'],'error':null};}catch(_0x268c77){return{'data':null,'error':_0x268c77 instanceof EBaaSError?_0x268c77:new EBaaSError(_0x268c77 instanceof Error?_0x268c77['message']:'Failed\x20to\x20update\x20function\x20environment',0x0,_0x268c77)};}}async['getLogs'](_0x1f0ecd,_0x36c86b){function _0x2d34df(_0x3ebd47,_0x57e669){return _0x9ef0(_0x3ebd47- -0x82,_0x57e669);}try{const _0x30bcca=new URLSearchParams();_0x36c86b?.['limit']&&_0x30bcca['append'](_0x2d34df(0x1ae,0x214),String(_0x36c86b['limit']));_0x36c86b?.[_0x2d34df(0x17e,0x19a)]&&_0x30bcca['append']('offset',String(_0x36c86b[_0x2d34df(0x17e,0x1a6)]));_0x36c86b?.[_0x2d34df(0x105,0xcd)]&&_0x30bcca[_0x2d34df(0x185,0x19d)](_0x2d34df(0x105,0x127),_0x36c86b[_0x2d34df(0x105,0xfe)]);const _0x5432ae='/functions/v1/'+_0x1f0ecd+'/logs'+(_0x30bcca[_0x2d34df(0x183,0x1ae)]()?'?'+_0x30bcca['toString']():''),response=await this[_0x2d34df(0x14d,0x174)][_0x2d34df(0x1b1,0x1e2)](_0x5432ae);return{'data':response['data'],'error':null};}catch(_0x221416){return{'data':null,'error':_0x221416 instanceof EBaaSError?_0x221416:new EBaaSError(_0x221416 instanceof Error?_0x221416['message']:'Failed\x20to\x20get\x20function\x20logs',0x0,_0x221416)};}}async['getMetrics'](_0x3623a,_0x26a81c){function _0x4636d8(_0x4cdeca,_0x33cc6b){return _0x9ef0(_0x33cc6b-0x0,_0x4cdeca);}try{const _0x1fb974=new URLSearchParams();_0x26a81c?.[_0x4636d8(0x157,0x17e)]&&_0x1fb974[_0x4636d8(0x272,0x207)]('period',_0x26a81c[_0x4636d8(0x12a,0x17e)]);const _0x3fd68f=_0x4636d8(0x17a,0x1de)+_0x3623a+'/metrics'+(_0x1fb974[_0x4636d8(0x240,0x205)]()?'?'+_0x1fb974['toString']():''),response=await this[_0x4636d8(0x174,0x1cf)][_0x4636d8(0x224,0x233)](_0x3fd68f);return{'data':response['data'],'error':null};}catch(_0x1758a4){return{'data':null,'error':_0x1758a4 instanceof EBaaSError?_0x1758a4:new EBaaSError(_0x1758a4 instanceof Error?_0x1758a4[_0x4636d8(0x18a,0x1af)]:'Failed\x20to\x20get\x20function\x20metrics',0x0,_0x1758a4)};}}}class EBaaSClient{constructor(_0x53ef59,_0x21b66b,_0x5cd447){this['options']=_0x5cd447,this[_0x480c77(0x58b,0x581)]=new HttpClient({'url':_0x53ef59,'apiKey':_0x21b66b,'timeout':0x7530,'headers':_0x5cd447?.[_0x480c77(0x608,0x64b)]?.[_0x480c77(0x623,0x66a)]}),this[_0x480c77(0x55d,0x539)]=new AuthClient(this[_0x480c77(0x58b,0x558)],_0x5cd447?.['database']?.['workspaceId']),this[_0x480c77(0x592,0x5dc)]=new DatabaseClient(this['httpClient'],_0x5cd447?.[_0x480c77(0x592,0x5db)]?.['workspaceId']);function _0x480c77(_0x1efcde,_0x1374ba){return _0x9ef0(_0x1efcde-0x3bc,_0x1374ba);}this['storage']=new StorageClient(this['httpClient']),this['realtime']=new RealtimeClient(_0x53ef59,_0x21b66b,_0x5cd447?.[_0x480c77(0x579,0x58b)]),this['functions']=new FunctionsClient(this[_0x480c77(0x58b,0x5e9)]),this['initializeCustomDatabase']();}['from'](_0x2c33c6){function _0x2a5a3b(_0x284e4f,_0x1de3d2){return _0x9ef0(_0x284e4f-0x176,_0x1de3d2);}return this[_0x2a5a3b(0x34c,0x3a3)][_0x2a5a3b(0x395,0x3c1)](_0x2c33c6);}['rpc'](_0x336f8e,_0x246733){function _0x4b5191(_0x4d0c29,_0x5b628f){return _0x9ef0(_0x5b628f-0x7b,_0x4d0c29);}return this[_0x4b5191(0x264,0x251)][_0x4b5191(0x27f,0x263)](_0x336f8e,_0x246733);}[_0x57b89b(-0x17d,-0x12b)](_0x3e76aa){function _0x23498f(_0x31ab07,_0x57d7f8){return _0x9ef0(_0x57d7f8- -0x138,_0x31ab07);}return this[_0x23498f(0x67,0x78)][_0x23498f(0x97,0xe7)](_0x3e76aa);}['channel'](_0x4390fe){function _0x266888(_0x2d1f0a,_0x468b9d){return _0x9ef0(_0x2d1f0a- -0x30d,_0x468b9d);}return this[_0x266888(-0x150,-0x161)]['channel'](_0x4390fe);}['invoke'](_0x3a8bbd,_0x3d7e87){function _0x1016bb(_0x1f00bc,_0x265bdb){return _0x9ef0(_0x1f00bc- -0x2b1,_0x265bdb);}return this['functions'][_0x1016bb(-0xb3,-0x83)](_0x3a8bbd,_0x3d7e87);}async[_0x57b89b(-0xfb,-0xd1)](){function _0x2d3319(_0x3642ff,_0x1306a8){return _0x9ef0(_0x3642ff-0x6,_0x1306a8);}if(this['options']?.[_0x2d3319(0x1dc,0x218)]?.['autoDetectCustomDatabase'])try{await this['database'][_0x2d3319(0x258,0x227)]();}catch(_0x2cfa14){console['warn']('Failed to initialize custom database detection:',_0x2cfa14);}}async['setWorkspaceId'](_0x18ed0a){this[_0x2afa6c(0xad,0x91)]['setWorkspaceId'](_0x18ed0a);function _0x2afa6c(_0x338a32,_0x4dee89){return _0x9ef0(_0x4dee89- -0x110,_0x338a32);}this['database'][_0x2afa6c(0xc7,0x113)](_0x18ed0a),this['options']?.['database']?.['autoDetectCustomDatabase']&&await this[_0x2afa6c(0x106,0xc6)]['initialize']();}async['configureCustomDatabase'](_0x467b58){function _0x5ab9a5(_0x1dedda,_0x1de9b2){return _0x9ef0(_0x1dedda-0x6b,_0x1de9b2);}await this['database'][_0x5ab9a5(0x244,0x207)](_0x467b58);}[_0x57b89b(-0x18b,-0x16d)](){function _0x301041(_0x494ef7,_0x5907e3){return _0x9ef0(_0x5907e3- -0x138,_0x494ef7);}return this[_0x301041(0x89,0x9e)]['getCustomDatabaseStatus']();}}function createClient(_0x4dd660,_0xf084b9,_0x1b5606){return new EBaaSClient(_0x4dd660,_0xf084b9,_0x1b5606);}const version='1.0.0';export{AuthClient,CustomDatabaseManager,DatabaseClient,EBaaSClient,EBaaSError,FunctionsClient,HttpClient,QueryBuilder,RealtimeChannel,RealtimeClient,StorageBucket,StorageClient,createClient,version};