@e-techsolutions/e-baas-sdk 1.1.0 → 1.1.1

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(stringArrayFunction,comparisonValue){const stringArray=stringArrayFunction();function _0x3b9f25(_0x57425d,_0x294889){return _0x15c7(_0x294889- -0x1c7,_0x57425d);}while(!![]){try{const _0x1eabc7=-parseInt(_0x3b9f25(-0x97,-0x68))/0x1*(-parseInt(_0x3b9f25(-0xda,-0x9d))/0x2)+parseInt(_0x3b9f25(-0xa4,-0x120))/0x3*(-parseInt(_0x3b9f25(-0x90,-0x8a))/0x4)+-parseInt(_0x3b9f25(-0x93,-0xf4))/0x5*(parseInt(_0x3b9f25(-0xaf,-0x118))/0x6)+-parseInt(_0x3b9f25(-0xcf,-0xd4))/0x7+parseInt(_0x3b9f25(-0xd5,-0xa1))/0x8*(parseInt(_0x3b9f25(-0x109,-0x8d))/0x9)+-parseInt(_0x3b9f25(-0xb9,-0xe0))/0xa+-parseInt(_0x3b9f25(-0xf3,-0x92))/0xb*(-parseInt(_0x3b9f25(-0xb3,-0xe4))/0xc);if(_0x1eabc7===comparisonValue)break;else stringArray['push'](stringArray['shift']());}catch(_0x3329a8){stringArray['push'](stringArray['shift']());}}}(_0x4e83,0x6a09d));import axios from'axios';import{io}from'socket.io-client';import _0x2302e2 from'eventemitter3';class EBaaSError extends Error{constructor(_0x496580,status=0x0,_0x281dd9){function _0x33fa(_0x2266cd,_0x19d21e){return _0x15c7(_0x2266cd-0x282,_0x19d21e);}super(_0x496580),this['name']='EBaaSError',this[_0x33fa(0x327,0x2c6)]=status,this['details']=_0x281dd9,Error['captureStackTrace']&&Error[_0x33fa(0x39b,0x330)](this,EBaaSError);}['toJSON'](){function _0x4e9361(_0x3d79b9,_0x314776){return _0x15c7(_0x314776-0x238,_0x3d79b9);}return{'name':this['name'],'message':this['message'],'status':this['status'],'details':this[_0x4e9361(0x2ea,0x330)],'stack':this[_0x4e9361(0x35a,0x3c2)]};}['toString'](){function _0x4fcd7a(_0x3a6efe,_0x2adc1a){return _0x15c7(_0x2adc1a-0x100,_0x3a6efe);}return this['name']+':\x20'+this['message']+_0x4fcd7a(0x244,0x279)+this[_0x4fcd7a(0x1a7,0x1a5)]+')';}}class HttpClient{constructor(config){this['baseURL']=config['url'];function _0x431816(_0x5bb57c,_0x224f58){return _0x15c7(_0x5bb57c- -0x24a,_0x224f58);}this[_0x431816(-0x129,-0xee)]=config['apiKey'],this[_0x431816(-0xe5,-0xd1)]=axios[_0x431816(-0x17e,-0x126)]({'baseURL':this['baseURL'],'timeout':config['timeout']||0x2710,'headers':{'Content-Type':'application/json','apikey':this['apiKey'],...config['headers']}}),this[_0x431816(-0x12d,-0x193)]();}[_0x3e19e9(-0x183,-0x1a3)](){this['client'][_0x4753fd(-0x28e,-0x2cd)][_0x4753fd(-0x281,-0x269)][_0x4753fd(-0x2b8,-0x27f)](config=>{return config;},_0x139d2c=>{function _0x5dccc8(_0x77492f,_0x49a239){return _0x15c7(_0x49a239- -0x3cc,_0x77492f);}return Promise[_0x5dccc8(-0x22d,-0x278)](new EBaaSError('Request\x20failed',0x0,_0x139d2c));});function _0x4753fd(_0x2a4ef3,_0x369751){return _0x15c7(_0x369751- -0x3b2,_0x2a4ef3);}this['client'][_0x4753fd(-0x31e,-0x2cd)][_0x4753fd(-0x24a,-0x2b6)]['use'](response=>{return response;},_0xc04936=>{const status=_0xc04936[_0x177df8(0x317,0x393)]?.[_0x177df8(0x349,0x33c)]||0x0,_0x3b7ed5=_0xc04936['response']?.[_0x177df8(0x444,0x3c8)]?.['message']||_0xc04936['message']||'Unknown\x20error',_0x471f27=_0xc04936['response']?.['data']||_0xc04936;function _0x177df8(_0x28c5e3,_0x48450b){return _0x15c7(_0x48450b-0x297,_0x28c5e3);}return Promise['reject'](new EBaaSError(_0x3b7ed5,status,_0x471f27));});}async[_0x3e19e9(-0x201,-0x1e2)](_0x1bd50f,config){function _0x3441bb(_0x161a2a,_0x1013df){return _0x15c7(_0x1013df- -0xc2,_0x161a2a);}try{const response=await this[_0x3441bb(0x4b,0xa3)][_0x3441bb(0x38,-0x23)](_0x1bd50f,config);return{'data':response['data'],'status':response['status'],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x4df62f){throw this['handleError'](_0x4df62f);}}async[_0x3e19e9(-0x1c7,-0x1f9)](_0x13e0e6,data,config){function _0x34142b(_0x1526e2,_0x38bd89){return _0x15c7(_0x1526e2- -0x145,_0x38bd89);}try{const response=await this[_0x34142b(0x20,0x36)]['post'](_0x13e0e6,data,config);return{'data':response['data'],'status':response['status'],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x1d5eab){throw this['handleError'](_0x1d5eab);}}async[_0x3e19e9(-0x16a,-0x1c2)](_0x4f2e6a,data,config){function _0x227933(_0x5da9a4,_0x506bb3){return _0x15c7(_0x506bb3-0x1c0,_0x5da9a4);}try{const response=await this['client'][_0x227933(0x372,0x2f6)](_0x4f2e6a,data,config);return{'data':response['data'],'status':response['status'],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x2ebd4f){throw this['handleError'](_0x2ebd4f);}}async['patch'](_0x2e294a,data,config){function _0x570da7(_0x35757a,_0x446fc8){return _0x15c7(_0x35757a-0x1cd,_0x446fc8);}try{const response=await this['client']['patch'](_0x2e294a,data,config);return{'data':response['data'],'status':response['status'],'statusText':response[_0x570da7(0x2f1,0x331)],'headers':response[_0x570da7(0x305,0x2b2)]};}catch(_0x392a33){throw this[_0x570da7(0x356,0x350)](_0x392a33);}}async['delete'](_0x2c7b09,config){function _0x98a14f(_0x51195b,_0x24a2b5){return _0x15c7(_0x24a2b5-0x60,_0x51195b);}try{const response=await this[_0x98a14f(0x1ad,0x1c5)]['delete'](_0x2c7b09,config);return{'data':response['data'],'status':response['status'],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x526fcf){throw this[_0x98a14f(0x1b6,0x1e9)](_0x526fcf);}}[_0x3e19e9(-0x130,-0x171)](_0x3a2045){function _0x290f25(_0x18a3d8,_0x4fc80c){return _0x15c7(_0x4fc80c-0x39,_0x18a3d8);}this['client'][_0x290f25(0xbd,0xeb)][_0x290f25(0x17d,0x171)]['common']['Authorization']=_0x290f25(0x12e,0x179)+_0x3a2045;}['removeAuthToken'](){delete this['client']['defaults']['headers'][_0x5207ef(0x488,0x44f)]['Authorization'];function _0x5207ef(_0x1f18d4,_0x2e9301){return _0x15c7(_0x2e9301-0x35b,_0x1f18d4);}this['client'][_0x5207ef(0x3c0,0x40d)]['headers']['common']['Authorization']=_0x5207ef(0x4ce,0x49b)+this[_0x5207ef(0x432,0x47c)];}[_0x3e19e9(-0x117,-0xae)](_0x18f2a3){if(_0x18f2a3 instanceof EBaaSError)return _0x18f2a3;function _0x4b7a65(_0x2b4cdd,_0x34baed){return _0x15c7(_0x34baed-0x6d,_0x2b4cdd);}return new EBaaSError(_0x18f2a3[_0x4b7a65(0x156,0x183)]||_0x4b7a65(0x14a,0x15b),_0x18f2a3[_0x4b7a65(0x13b,0x112)]||0x0,_0x18f2a3);}}class AuthClient{constructor(_0x4580e9){this['currentSession']=null;function _0x125f2a(_0x51a980,_0x5eb108){return _0x15c7(_0x51a980- -0x24,_0x5eb108);}this[_0x125f2a(0xd9,0xb2)]=_0x4580e9,this['loadSession']();}async[_0x3e19e9(-0x149,-0x194)](data){function _0x566d62(_0x420d48,_0x28a87d){return _0x15c7(_0x28a87d- -0x15f,_0x420d48);}try{const response=await this[_0x566d62(-0x4,-0x62)]['post'](_0x566d62(0x4a,-0x19),data);return response['data']['session']&&this[_0x566d62(-0x1,-0x12)](response['data'][_0x566d62(-0xb9,-0x40)]),response['data'];}catch(_0x3bb3a2){throw this[_0x566d62(-0x17,0x17)](_0x3bb3a2);}}async['signIn'](data){function _0x2d811b(_0x5208a2,_0x1ec63a){return _0x15c7(_0x5208a2- -0x139,_0x1ec63a);}try{const response=await this['httpClient']['post']('/auth/v1/sdk/signin',data);return response['data'][_0x2d811b(-0x1a,0x4)]&&this[_0x2d811b(0x14,0x0)](response['data']['session']),response[_0x2d811b(-0x8,-0x58)];}catch(_0x4df79b){throw this[_0x2d811b(0x3d,-0x26)](_0x4df79b);}}async[_0x3e19e9(-0x139,-0x16b)](){function _0x31603a(_0x343c0a,_0xec041f){return _0x15c7(_0xec041f- -0x15d,_0x343c0a);}try{await this['httpClient'][_0x31603a(-0x8a,-0x84)](_0x31603a(-0xda,-0x68)),this['clearSession']();}catch(_0x16c2ba){this['clearSession']();throw this['handleAuthError'](_0x16c2ba);}}async['getUser'](){function _0x45a53c(_0x3ca950,_0x5972c9){return _0x15c7(_0x5972c9- -0x109,_0x3ca950);}if(!this[_0x45a53c(-0x3c,0xa)]?.[_0x45a53c(0x24,0x53)])return null;try{const response=await this['httpClient'][_0x45a53c(-0x92,-0x6a)](_0x45a53c(0xc,-0x21));return response[_0x45a53c(-0x49,0x28)]['user'];}catch(_0x15673e){if(_0x15673e instanceof EBaaSError&&_0x15673e['status']===0x191)return this['clearSession'](),null;throw this[_0x45a53c(0x53,0x6d)](_0x15673e);}}async[_0x3e19e9(-0x1be,-0x1a7)](){if(!this['currentSession']?.['refresh_token'])return null;function _0x366239(_0x3e0bd7,_0xd93996){return _0x15c7(_0xd93996- -0xd,_0x3e0bd7);}try{const response=await this['httpClient']['post']('/auth/v1/refresh',{'refresh_token':this['currentSession'][_0x366239(0x78,0xb5)]});if(response[_0x366239(0x122,0x124)][_0x366239(0x162,0x112)])return this['setSession'](response['data'][_0x366239(0xd4,0x112)]),response['data']['session'];return null;}catch(_0x164c6e){this['clearSession']();throw this[_0x366239(0x154,0x169)](_0x164c6e);}}async[_0x3e19e9(-0x175,-0x1e2)](_0x4169b7){function _0x2946a(_0x18a0eb,_0x443a18){return _0x15c7(_0x443a18-0x210,_0x18a0eb);}try{await this[_0x2946a(0x2e4,0x30d)][_0x2946a(0x2c5,0x2e9)]('/auth/v1/reset-password',{'email':_0x4169b7});}catch(_0x143698){throw this[_0x2946a(0x3da,0x386)](_0x143698);}}async[_0x3e19e9(-0x162,-0x1c5)](data){function _0x3ef5d9(_0x1c9080,_0x27547b){return _0x15c7(_0x27547b- -0x1e1,_0x1c9080);}try{const response=await this[_0x3ef5d9(-0x159,-0xe4)]['put']('/auth/v1/user',data);return response[_0x3ef5d9(-0x113,-0xb0)][_0x3ef5d9(-0x10f,-0xe1)];}catch(_0x2694ad){throw this['handleAuthError'](_0x2694ad);}}[_0x3e19e9(-0x1e8,-0x1ed)](){function _0x2e3f59(_0xe12d52,_0xa7e752){return _0x15c7(_0xe12d52-0x3c5,_0xa7e752);}return this[_0x2e3f59(0x4d8,0x4fd)];}['setSession'](_0x230e17){this[_0x5b2dc0(-0x9c,-0xcd)]=_0x230e17,this['httpClient']['setAuthToken'](_0x230e17[_0x5b2dc0(-0x8b,-0x84)]);function _0x5b2dc0(_0x120728,_0x3f911d){return _0x15c7(_0x3f911d- -0x1e0,_0x120728);}typeof localStorage!=='undefined'&&localStorage['setItem'](_0x5b2dc0(-0x122,-0x130),JSON[_0x5b2dc0(-0x85,-0x7a)](_0x230e17));}['onAuthStateChange'](_0x1d90ac){return()=>{};}['setSessionInternal'](_0x41c0d0){this['currentSession']=_0x41c0d0,this[_0x2621bd(-0x118,-0x143)][_0x2621bd(-0x108,-0xd0)](_0x41c0d0['access_token']);function _0x2621bd(_0x474f7b,_0x213643){return _0x15c7(_0x213643- -0x240,_0x474f7b);}typeof localStorage!==_0x2621bd(-0x1c3,-0x1a9)&&localStorage['setItem'](_0x2621bd(-0x14c,-0x190),JSON[_0x2621bd(-0xea,-0xda)](_0x41c0d0));}[_0x3e19e9(-0x120,-0x13a)](){this['currentSession']=null,this['httpClient']['removeAuthToken']();function _0x17b6d6(_0x5d08b1,_0x56c393){return _0x15c7(_0x5d08b1-0x241,_0x56c393);}typeof localStorage!=='undefined'&&localStorage[_0x17b6d6(0x396,0x31b)]('ebaas.auth.session');}['loadSession'](){function _0x5a12f5(_0x56475e,_0x5b38d2){return _0x15c7(_0x56475e- -0x146,_0x5b38d2);}if(typeof localStorage!==_0x5a12f5(-0xaf,-0xfe)){const _0x1e05c4=localStorage['getItem'](_0x5a12f5(-0x96,-0x2e));if(_0x1e05c4)try{const _0x4d9093=JSON['parse'](_0x1e05c4);this[_0x5a12f5(0x7,0x44)](_0x4d9093);}catch(_0x21cade){this[_0x5a12f5(0x3a,0xa7)]();}}}[_0x3e19e9(-0x12a,-0xf5)](_0x2b2f14){if(_0x2b2f14 instanceof EBaaSError)return _0x2b2f14;function _0x2f8526(_0x25ee1b,_0xe909c3){return _0x15c7(_0xe909c3-0x6a,_0x25ee1b);}return new EBaaSError(_0x2b2f14[_0x2f8526(0x132,0x180)]||_0x2f8526(0x1c5,0x14b),_0x2b2f14[_0x2f8526(0x175,0x10f)]||0x0,_0x2b2f14);}}class QueryBuilder{constructor(_0x5c9930,_0xc560c,_0x59b3ac,_0x83238e){this[_0x43362b(-0x3,-0x74)]=_0x5c9930,this[_0x43362b(-0x70,-0x8)]=_0xc560c,this[_0x43362b(0xd,-0x21)]=_0x59b3ac,this[_0x43362b(-0x115,-0xa8)]=_0x83238e;function _0x43362b(_0x3c0442,_0x5cd078){return _0x15c7(_0x5cd078- -0x171,_0x3c0442);}this['query']={'filters':[]};}['select'](_0x1ef0b6='*',_0x384e21){function _0x3c3a98(_0x541e90,_0x490c66){return _0x15c7(_0x490c66- -0x216,_0x541e90);}return this[_0x3c3a98(-0x3f,-0xaa)]['select']=_0x1ef0b6,this;}[_0x3e19e9(-0x1a1,-0x1cf)](data,_0x5e7569){function _0x4b273a(_0x1e5909,_0xf67efa){return _0x15c7(_0x1e5909-0x279,_0xf67efa);}return this['executeQuery']('POST',_0x4b273a(0x3d6,0x3bd)+this['table']+_0x4b273a(0x3f6,0x3a3),{'data':data,'options':_0x5e7569});}['update'](data,_0x186e89){function _0x1bde03(_0x2e7a15,_0x2087a5){return _0x15c7(_0x2e7a15-0x86,_0x2087a5);}return this['executeQuery']('PATCH',_0x1bde03(0x1e3,0x1f1)+this['table'],{'data':data,'options':_0x186e89,'filters':this['query'][_0x1bde03(0x13c,0x142)]});}['upsert'](data,_0x2c437e){function _0x2950f0(_0x6292a5,_0x26c35c){return _0x15c7(_0x26c35c-0x65,_0x6292a5);}return this[_0x2950f0(0x14b,0x118)]('POST','/sdk/v1/'+this[_0x2950f0(0x212,0x1ce)]+_0x2950f0(0x163,0x1a0),{'data':data,'options':{..._0x2c437e,'upsert':!![]}});}[_0x3e19e9(-0x121,-0x170)](_0x5f3cfc){function _0x35c95a(_0x294637,_0x9a1611){return _0x15c7(_0x9a1611-0x314,_0x294637);}return this['executeQuery']('DELETE','/sdk/v1/'+this['table'],{'options':_0x5f3cfc,'filters':this['query'][_0x35c95a(0x36d,0x3ca)]});}['eq'](_0x3e24df,_0x455a56){function _0x940fc4(_0x24cd93,_0x299006){return _0x15c7(_0x299006- -0x287,_0x24cd93);}return this[_0x940fc4(-0xca,-0x11b)]['filters']['push']({'column':_0x3e24df,'operator':'eq','value':_0x455a56}),this;}[_0x3e19e9(-0x1c1,-0x157)](_0x4cb1f9,_0x5df960){this['query']['filters']['push']({'column':_0x4cb1f9,'operator':_0x1b8b2d(0x44d,0x469),'value':_0x5df960});function _0x1b8b2d(_0x209f72,_0x369dfa){return _0x15c7(_0x209f72-0x36e,_0x369dfa);}return this;}['gt'](_0x10f117,_0x2a9cb5){this[_0x56961c(-0x17,0x8)][_0x56961c(-0x65,-0xae)]['push']({'column':_0x10f117,'operator':'gt','value':_0x2a9cb5});function _0x56961c(_0x32a7b1,_0x32e236){return _0x15c7(_0x32e236- -0x164,_0x32a7b1);}return this;}['gte'](_0x285cf5,_0xdb9b85){this[_0x5f07c7(0xf1,0x143)][_0x5f07c7(0x53,0x8d)][_0x5f07c7(0xfa,0x144)]({'column':_0x285cf5,'operator':'gte','value':_0xdb9b85});function _0x5f07c7(_0x32e63a,_0x512eaa){return _0x15c7(_0x512eaa- -0x29,_0x32e63a);}return this;}['lt'](_0x2b9660,_0x594003){function _0x13090a(_0x397ef4,_0x4ebd84){return _0x15c7(_0x397ef4- -0x29f,_0x4ebd84);}return this['query'][_0x13090a(-0x1e9,-0x22c)]['push']({'column':_0x2b9660,'operator':'lt','value':_0x594003}),this;}[_0x3e19e9(-0x140,-0x1b2)](_0x2a0e52,_0x54da8d){function _0x1edb2a(_0x56eca4,_0x2838fe){return _0x15c7(_0x56eca4-0xd,_0x2838fe);}return this['query'][_0x1edb2a(0xc3,0xcf)][_0x1edb2a(0x17a,0x18f)]({'column':_0x2a0e52,'operator':'lte','value':_0x54da8d}),this;}['like'](_0x16d249,_0x4ac887){this['query'][_0x1a4c3c(-0x1ce,-0x1f0)][_0x1a4c3c(-0x117,-0x10b)]({'column':_0x16d249,'operator':_0x1a4c3c(-0x120,-0x16a),'value':_0x4ac887});function _0x1a4c3c(_0x3a9c2c,_0x529b89){return _0x15c7(_0x3a9c2c- -0x284,_0x529b89);}return this;}['ilike'](_0x55485c,_0x3d014a){this[_0x5f486c(0x30f,0x2e1)][_0x5f486c(0x1b5,0x22b)]['push']({'column':_0x55485c,'operator':'ilike','value':_0x3d014a});function _0x5f486c(_0x24a6d5,_0x5d2648){return _0x15c7(_0x5d2648-0x175,_0x24a6d5);}return this;}['is'](_0x4d8e8d,_0x42007d){this[_0x2555e5(-0x6c,-0xa8)][_0x2555e5(-0x1d1,-0x15e)]['push']({'column':_0x4d8e8d,'operator':'is','value':_0x42007d});function _0x2555e5(_0x54979a,_0x3243b0){return _0x15c7(_0x3243b0- -0x214,_0x54979a);}return this;}['in'](_0x4dd835,_0x106bcc){function _0x254584(_0x18f14d,_0x4a2e8d){return _0x15c7(_0x4a2e8d-0x31f,_0x18f14d);}return this[_0x254584(0x4d5,0x48b)]['filters'][_0x254584(0x4db,0x48c)]({'column':_0x4dd835,'operator':'in','value':_0x106bcc}),this;}['contains'](_0x5014ab,_0xe1ef72){function _0x605e20(_0x3e7578,_0x17ab05){return _0x15c7(_0x3e7578-0xfd,_0x17ab05);}return this[_0x605e20(0x269,0x218)][_0x605e20(0x1b3,0x138)][_0x605e20(0x26a,0x252)]({'column':_0x5014ab,'operator':'contains','value':_0xe1ef72}),this;}['match'](_0x4be560){function _0x4fcd04(_0x524134,_0x4b80d6){return _0x15c7(_0x4b80d6-0x1c7,_0x524134);}return Object[_0x4fcd04(0x262,0x261)](_0x4be560)[_0x4fcd04(0x2a3,0x2d4)](([_0x3f9a4e,_0x2c1cdf])=>{this['eq'](_0x3f9a4e,_0x2c1cdf);}),this;}['order'](_0x34df2f,_0x121757){!this[_0x52f6ab(-0xe0,-0x155)][_0x52f6ab(-0x1a2,-0x1c7)]&&(this[_0x52f6ab(-0x120,-0x155)][_0x52f6ab(-0x157,-0x1c7)]=[]);this['query'][_0x52f6ab(-0x1b7,-0x1c7)]['push']({'column':_0x34df2f,'ascending':_0x121757?.[_0x52f6ab(-0x22b,-0x1d5)]!==![]});function _0x52f6ab(_0x5f3bc7,_0x5d38c7){return _0x15c7(_0x5d38c7- -0x2c1,_0x5f3bc7);}return this;}['limit'](count){function _0x43d582(_0x3693d2,_0xb4cc1e){return _0x15c7(_0xb4cc1e- -0x2a,_0x3693d2);}return this['query'][_0x43d582(0x135,0x105)]=count,this;}[_0x3e19e9(-0x1f7,-0x249)](from,_0x34a639){function _0xc5b26d(_0x287ffd,_0x56090c){return _0x15c7(_0x56090c- -0x29d,_0x287ffd);}return this[_0xc5b26d(-0xc8,-0x131)]['range']={'from':from,'to':_0x34a639},this;}async[_0x3e19e9(-0x19f,-0x1bc)](){function _0x3446b7(_0x45c1d1,_0x1a723a){return _0x15c7(_0x45c1d1-0xfd,_0x1a723a);}return this[_0x3446b7(0x1b0,0x201)]('GET',_0x3446b7(0x25a,0x2c5)+this['table']+_0x3446b7(0x245,0x226),{'select':this[_0x3446b7(0x269,0x23b)]['select'],'filters':this['query'][_0x3446b7(0x1b3,0x22e)],'order':this[_0x3446b7(0x269,0x1f4)]['order'],'limit':this['query'][_0x3446b7(0x22c,0x243)],'range':this[_0x3446b7(0x269,0x24e)]['range']});}async[_0x3e19e9(-0x1a2,-0x132)](){this['limit'](0x1);function _0xdd71eb(_0x2ad2ec,_0x2dff0a){return _0x15c7(_0x2dff0a-0x2c6,_0x2ad2ec);}const result=await this['execute']();return{'data':result[_0xdd71eb(0x404,0x3f7)]?.[0x0]||null,'error':result['error']};}async[_0x3e19e9(-0x1ed,-0x1a2)](_0x5c29ef,_0x4656d7,_0x17875f){function _0x332adc(_0x310fd6,_0x20456b){return _0x15c7(_0x20456b-0x2fb,_0x310fd6);}try{let response;const headers={};this[_0x332adc(0x35f,0x3c4)]&&(headers['x-workspace-id']=this[_0x332adc(0x376,0x3c4)]);if(_0x5c29ef==='GET'){const _0x45c772=_0x4656d7['split']('?'),_0x32fa15=_0x45c772[0x0],existingParams=new URLSearchParams(_0x45c772[0x1]||'');if(_0x17875f['select'])existingParams[_0x332adc(0x364,0x3ba)](_0x332adc(0x3dc,0x396),_0x17875f[_0x332adc(0x368,0x396)]);_0x17875f['filters']?.[_0x332adc(0x3c3,0x3fd)]&&_0x17875f['filters']['forEach'](filter=>{function _0x35ff63(_0x1f5529,_0x131f70){return _0x15c7(_0x1f5529-0x135,_0x131f70);}existingParams['append'](filter[_0x35ff63(0x20d,0x196)],filter['operator']+'.'+filter['value']);});if(_0x17875f['order']?.[_0x332adc(0x429,0x3fd)]){const orderStr=_0x17875f[_0x332adc(0x3c6,0x3f5)][_0x332adc(0x430,0x47f)](_0x3df9b4=>''+_0x3df9b4[_0x332adc(0x437,0x3d3)]+(_0x3df9b4[_0x332adc(0x43a,0x3e7)]?_0x332adc(0x376,0x39b):'.desc'))['join'](',');existingParams[_0x332adc(0x3f7,0x3ba)]('order',orderStr);}if(_0x17875f[_0x332adc(0x3c5,0x42a)])existingParams['append'](_0x332adc(0x40d,0x42a),_0x17875f[_0x332adc(0x401,0x42a)][_0x332adc(0x3b4,0x3cb)]());_0x17875f[_0x332adc(0x3dc,0x3a4)]&&(existingParams['append'](_0x332adc(0x39d,0x3bc),_0x17875f[_0x332adc(0x3df,0x3a4)][_0x332adc(0x42f,0x404)][_0x332adc(0x425,0x3cb)]()),existingParams[_0x332adc(0x3cf,0x3ba)]('limit',(_0x17875f['range']['to']-_0x17875f['range']['from']+0x1)['toString']())),response=await this['httpClient'][_0x332adc(0x39c,0x39a)](_0x32fa15+'?'+existingParams['toString'](),{'headers':headers});}else{if(_0x5c29ef==='DELETE'){const _0x5c2c01=_0x4656d7['split']('?'),_0x358626=_0x5c2c01[0x0],existingParams=new URLSearchParams(_0x5c2c01[0x1]||'');!existingParams['has']('operation')&&existingParams[_0x332adc(0x40f,0x3ba)]('operation',_0x332adc(0x496,0x47a));_0x17875f['filters']?.['length']&&_0x17875f[_0x332adc(0x3a6,0x3b1)][_0x332adc(0x3c7,0x408)](filter=>{function _0x4a4026(_0x399c65,_0x3dcb47){return _0x15c7(_0x3dcb47- -0x222,_0x399c65);}existingParams['append'](filter[_0x4a4026(-0x1c6,-0x14a)],filter[_0x4a4026(-0x124,-0x171)]+'.'+filter[_0x4a4026(-0x111,-0xd4)]);});const deleteUrl=_0x358626+'?'+existingParams[_0x332adc(0x3ea,0x3cb)]();response=await this['httpClient'][_0x332adc(0x4a7,0x47a)](deleteUrl,{'headers':headers});}else{if(_0x5c29ef==='PATCH'){const _0x1e9bef=_0x4656d7['split']('?'),_0x2bb1ca=_0x1e9bef[0x0],existingParams=new URLSearchParams(_0x1e9bef[0x1]||'');!existingParams[_0x332adc(0x3f1,0x406)]('operation')&&existingParams['append']('operation','update');_0x17875f[_0x332adc(0x3cb,0x3b1)]?.[_0x332adc(0x463,0x3fd)]&&_0x17875f[_0x332adc(0x351,0x3b1)][_0x332adc(0x3bb,0x408)](filter=>{function _0x9c1b44(_0x53e73c,_0x2bdabb){return _0x15c7(_0x53e73c-0x3ba,_0x2bdabb);}existingParams['append'](filter[_0x9c1b44(0x492,0x4c3)],filter['operator']+'.'+filter['value']);});_0x17875f['options']?.['prefer']&&(headers['Prefer']=_0x17875f['options'][_0x332adc(0x3f2,0x442)]);const updateUrl=_0x2bb1ca+'?'+existingParams[_0x332adc(0x438,0x3cb)]();response=await this['httpClient']['patch'](updateUrl,_0x17875f[_0x332adc(0x3f3,0x42c)],{'headers':headers});}else{let _0x1d328f=_0x17875f['data'];!headers['Prefer']&&(headers[_0x332adc(0x3f4,0x3ed)]='return=representation'),_0x17875f['options']?.['upsert']&&(headers[_0x332adc(0x3f5,0x3ed)]='resolution=merge-duplicates,return=representation'),_0x17875f[_0x332adc(0x468,0x424)]&&(_0x1d328f=_0x17875f[_0x332adc(0x411,0x424)]),response=await this[_0x332adc(0x38a,0x3f8)][_0x332adc(0x3de,0x3d4)](_0x4656d7,_0x1d328f,{'headers':headers});}}}return{'data':response[_0x332adc(0x3e0,0x42c)],'error':null,'count':response[_0x332adc(0x473,0x433)]?.['x-total-count']?parseInt(response['headers'][_0x332adc(0x458,0x42b)]):undefined};}catch(_0x181dc0){return{'data':null,'error':_0x181dc0 instanceof EBaaSError?_0x181dc0:new EBaaSError(_0x181dc0 instanceof Error?_0x181dc0[_0x332adc(0x405,0x411)]:'Database\x20operation\x20failed',0x0,_0x181dc0)};}}}class CustomDatabaseManager{constructor(_0x4906e2,_0x1530db){this['httpClient']=_0x4906e2;function _0x329df1(_0x4807cb,_0x321b80){return _0x15c7(_0x321b80- -0x2a5,_0x4807cb);}this[_0x329df1(-0x18d,-0x1dc)]=_0x1530db;}async['detectCustomDatabase'](){function _0x3866c5(_0x3aff7c,_0x4d46fc){return _0x15c7(_0x3aff7c- -0x247,_0x4d46fc);}if(!this[_0x3866c5(-0x17e,-0x1c4)])return{'hasCustomDatabase':![]};try{const response=await this['httpClient']['get']('/admin/v1/workspace/custom-database',{'headers':{'x-workspace-id':this['workspaceId']}});if(response[_0x3866c5(-0x1a2,-0x1df)]===0xc8&&response['data']?.['config']){const config=response[_0x3866c5(-0x116,-0x121)]['config'],_0x26ebb1={'host':config['postgresHost'],'port':config['postgresPort'],'database':config['postgresDatabase'],'username':config[_0x3866c5(-0x127,-0x13b)],'password':'','schema':config['postgresSchema'],'sslEnabled':config['sslEnabled']};return this['detectedConfig']={'hasCustomDatabase':!![],'config':config,'credentials':_0x26ebb1},this[_0x3866c5(-0x157,-0x1a9)];}}catch(_0x4d3b19){if(_0x4d3b19?.['status']===0x194)return this[_0x3866c5(-0x157,-0x1d1)]={'hasCustomDatabase':![]},this['detectedConfig'];console['warn']('Failed to detect custom database configuration:',_0x4d3b19);}return this['detectedConfig']={'hasCustomDatabase':![]},this[_0x3866c5(-0x157,-0x1cd)];}async['testConnection'](_0x57dc66){function _0x433fcd(_0x3cae40,_0x142181){return _0x15c7(_0x3cae40- -0x274,_0x142181);}try{const response=await this[_0x433fcd(-0x177,-0x15d)][_0x433fcd(-0x19b,-0x128)]('/admin/v1/workspace/custom-database/test-connection',_0x57dc66,{'headers':this['workspaceId']?{'X-Workspace-ID':this[_0x433fcd(-0x1ab,-0x149)]}:{}});return response[_0x433fcd(-0x143,-0x1af)];}catch(_0x115739){return{'success':![],'message':_0x115739?.['message']||_0x433fcd(-0x165,-0x185)};}}async[_0x3e19e9(-0x151,-0x134)](_0x5d831f){function _0x2fadb2(_0x1acc1b,_0x3a98c9){return _0x15c7(_0x1acc1b- -0x394,_0x3a98c9);}if(!this[_0x2fadb2(-0x2cb,-0x271)])throw new Error('Workspace ID is required to configure custom database');const response=await this[_0x2fadb2(-0x297,-0x25b)][_0x2fadb2(-0x2bb,-0x278)]('/admin/v1/workspace/custom-database',{'workspaceId':this['workspaceId'],..._0x5d831f},{'headers':{'X-Workspace-ID':this['workspaceId']}}),config=response[_0x2fadb2(-0x263,-0x1ee)]['config'];return this['detectedConfig']={'hasCustomDatabase':!![],'config':config,'credentials':_0x5d831f},config;}async[_0x3e19e9(-0x167,-0x165)](){if(!this['workspaceId'])throw new Error('Workspace ID is required to remove custom database');await this['httpClient']['delete']('/admin/v1/workspace/custom-database',{'headers':{'X-Workspace-ID':this['workspaceId']}}),this['detectedConfig']={'hasCustomDatabase':![]};}['getDetectedConfig'](){return this['detectedConfig'];}[_0x3e19e9(-0x136,-0x12e)](){function _0x32e863(_0x50ba63,_0x180e67){return _0x15c7(_0x50ba63- -0x1cc,_0x180e67);}return this[_0x32e863(-0xdc,-0x123)]?.[_0x32e863(-0x62,-0xcf)]??![];}['getCustomCredentials'](){function _0x33411f(_0x440550,_0x1c30e5){return _0x15c7(_0x440550-0x1f4,_0x1c30e5);}return this[_0x33411f(0x2e4,0x2ee)]?.[_0x33411f(0x29f,0x26a)];}[_0x3e19e9(-0x17b,-0x1ed)](_0x21f0e4){function _0x58b583(_0x24a3a2,_0x5e6e90){return _0x15c7(_0x5e6e90- -0x317,_0x24a3a2);}this[_0x58b583(-0x25e,-0x24e)]=_0x21f0e4,this['detectedConfig']=undefined;}[_0x3e19e9(-0x15f,-0x153)](){return this['workspaceId'];}['getStatus'](){function _0x25814d(_0x1abe8e,_0x2dc063){return _0x15c7(_0x1abe8e-0x70,_0x2dc063);}return{'workspaceId':this['workspaceId'],'hasConfig':this[_0x25814d(0x1da,0x174)](),'configDetails':this['detectedConfig']?.[_0x25814d(0x11b,0x16c)]?{'host':this['detectedConfig'][_0x25814d(0x11b,0x131)][_0x25814d(0x1ec,0x264)],'port':this[_0x25814d(0x160,0x1a8)][_0x25814d(0x11b,0xed)][_0x25814d(0x176,0x1e7)],'database':this['detectedConfig']['credentials'][_0x25814d(0x1e3,0x251)],'schema':this['detectedConfig'][_0x25814d(0x11b,0xd6)][_0x25814d(0x1c0,0x202)]||_0x25814d(0x147,0x178),'sslEnabled':this[_0x25814d(0x160,0x109)]['credentials']['sslEnabled']||![]}:undefined};}}class DatabaseClient{constructor(_0x1ac672,_0x23f2fd){this['httpClient']=_0x1ac672,this['customDatabaseManager']=new CustomDatabaseManager(_0x1ac672,_0x23f2fd);}['from'](_0x1c0c55){function _0x1ceb44(_0x1077d4,_0xd31fe3){return _0x15c7(_0xd31fe3-0x378,_0x1077d4);}return new QueryBuilder(this[_0x1ceb44(0x49d,0x475)],_0x1c0c55,this['currentSchema'],this[_0x1ceb44(0x435,0x44c)]['getWorkspaceId']());}[_0x3e19e9(-0x202,-0x1e2)](_0x2c74d2,_0x17a666){function _0x1989ef(_0x3da2da,_0x1a0e04){return _0x15c7(_0x3da2da-0x38d,_0x1a0e04);}return this[_0x1989ef(0x48a,0x41c)][_0x1989ef(0x466,0x43e)](_0x1989ef(0x4d8,0x48c)+_0x2c74d2,_0x17a666);}[_0x3e19e9(-0x150,-0x168)](_0x2a8f31){const _0x429273=new DatabaseClient(this[_0x125b80(-0x1ef,-0x242)],this['customDatabaseManager'][_0x125b80(-0x20e,-0x1fe)]());_0x429273[_0x125b80(-0x2c2,-0x246)]=_0x2a8f31,_0x429273['customDatabaseManager']=this['customDatabaseManager'];function _0x125b80(_0x2dcb11,_0x1bff62){return _0x15c7(_0x1bff62- -0x33f,_0x2dcb11);}return _0x429273;}async[_0x3e19e9(-0x186,-0x17f)](){function _0xdcfc5(_0x4da204,_0x5484b7){return _0x15c7(_0x4da204- -0x193,_0x5484b7);}return this[_0xdcfc5(-0xbf,-0x4e)][_0xdcfc5(-0x79,-0x8d)]();}async[_0x3e19e9(-0x1ca,-0x1f2)](_0x4b6fc6){function _0x3e3be0(_0x17eb01,_0x1ab71c){return _0x15c7(_0x1ab71c- -0x35b,_0x17eb01);}return this[_0x3e3be0(-0x242,-0x287)]['testConnection'](_0x4b6fc6);}async['configureCustomDatabase'](_0x29cfe6){function _0x37e1af(_0x1e935e,_0x304539){return _0x15c7(_0x1e935e- -0x101,_0x304539);}return this[_0x37e1af(-0x2d,-0x95)][_0x37e1af(0x4e,0xab)](_0x29cfe6);}async['removeCustomDatabase'](){function _0x3bea51(_0x11d3c6,_0x370723){return _0x15c7(_0x11d3c6- -0x3cb,_0x370723);}return this[_0x3bea51(-0x2f7,-0x320)]['removeCustomDatabase']();}[_0x3e19e9(-0x19c,-0x219)](){function _0x4c612c(_0x3a93ed,_0x257630){return _0x15c7(_0x3a93ed-0x19c,_0x257630);}return this['customDatabaseManager'][_0x4c612c(0x306,0x352)]();}['getCustomDatabaseStatus'](){function _0xc56ecb(_0x429ef0,_0x4955c2){return _0x15c7(_0x4955c2- -0x1e4,_0x429ef0);}return this['customDatabaseManager'][_0xc56ecb(-0x106,-0x8e)]();}[_0x3e19e9(-0x17b,-0x166)](_0x2ef1db){function _0x11b6eb(_0x312e3f,_0x2ee70f){return _0x15c7(_0x312e3f-0xb9,_0x2ee70f);}this[_0x11b6eb(0x18d,0x18b)][_0x11b6eb(0x1de,0x19e)](_0x2ef1db);}async[_0x3e19e9(-0x1d6,-0x169)](){function _0x331a03(_0x2793ac,_0x319e1d){return _0x15c7(_0x2793ac-0x1,_0x319e1d);}try{await this[_0x331a03(0xd5,0xad)]['detectCustomDatabase']();}catch(_0x57d9c2){console['warn']('Failed to initialize custom database detection:',_0x57d9c2);}}}class StorageBucket{constructor(_0x2dcb57,bucketId){function _0x5b2177(_0x4ff515,_0xe51ee7){return _0x15c7(_0xe51ee7- -0xf8,_0x4ff515);}this[_0x5b2177(0x15,0x5)]=_0x2dcb57,this['bucketId']=bucketId;}async['upload'](_0x3ad021,_0x2d2e8a,_0x5bef9a){function _0x5f0379(_0x1420d3,_0x5c511b){return _0x15c7(_0x1420d3-0x289,_0x5c511b);}try{const _0xe4daca=new FormData();if(_0x2d2e8a instanceof File)_0xe4daca[_0x5f0379(0x348,0x3bb)](_0x5f0379(0x418,0x3ad),_0x2d2e8a);else{if(_0x2d2e8a instanceof Blob)_0xe4daca[_0x5f0379(0x348,0x391)]('file',_0x2d2e8a,_0x3ad021);else{if(_0x2d2e8a instanceof ArrayBuffer)_0xe4daca[_0x5f0379(0x348,0x333)](_0x5f0379(0x418,0x3f9),new Blob([_0x2d2e8a]),_0x3ad021);else typeof _0x2d2e8a===_0x5f0379(0x3cb,0x409)&&_0xe4daca[_0x5f0379(0x348,0x2f3)](_0x5f0379(0x418,0x3d0),new Blob([_0x2d2e8a],{'type':_0x5f0379(0x3fd,0x3e9)}),_0x3ad021);}}_0xe4daca[_0x5f0379(0x348,0x2dc)](_0x5f0379(0x333,0x37f),_0x3ad021);_0x5bef9a?.[_0x5f0379(0x365,0x2ee)]&&_0xe4daca['append']('cacheControl',_0x5bef9a[_0x5f0379(0x365,0x393)]);_0x5bef9a?.[_0x5f0379(0x32d,0x2d0)]&&_0xe4daca['append'](_0x5f0379(0x32d,0x2d6),_0x5bef9a[_0x5f0379(0x32d,0x2d1)]);_0x5bef9a?.[_0x5f0379(0x38e,0x324)]&&_0xe4daca[_0x5f0379(0x348,0x3aa)]('metadata',JSON['stringify'](_0x5bef9a[_0x5f0379(0x38e,0x367)]));const _0x23b3de=_0x5f0379(0x3c5,0x437)+this['bucketId']+_0x5f0379(0x372,0x3e5)+(_0x5bef9a?.[_0x5f0379(0x3e7,0x442)]?_0x5f0379(0x34d,0x2e0):''),response=await this['httpClient'][_0x5f0379(0x362,0x3d9)](_0x23b3de,_0xe4daca,{'headers':{'Content-Type':'multipart/form-data'}});return{'data':response['data'],'error':null};}catch(_0x16b94d){return{'data':null,'error':_0x16b94d instanceof EBaaSError?_0x16b94d:new EBaaSError(_0x16b94d instanceof Error?_0x16b94d[_0x5f0379(0x39f,0x3e9)]:'Failed\x20to\x20upload\x20file',0x0,_0x16b94d)};}}async[_0x3e19e9(-0x184,-0x1ba)](_0x15fbbd,_0x41acb5){function _0x283f95(_0x6c13ed,_0x7237e7){return _0x15c7(_0x7237e7- -0x2ca,_0x6c13ed);}try{const _0x51d6ee=new URLSearchParams();_0x41acb5?.[_0x283f95(-0x24f,-0x227)]&&Object['entries'](_0x41acb5[_0x283f95(-0x21f,-0x227)])[_0x283f95(-0x1a3,-0x1bd)](([_0x10ceb4,_0xcb2834])=>{_0xcb2834!==undefined&&_0x51d6ee['append'](_0x10ceb4,String(_0xcb2834));});const _0xc8fb1a=_0x283f95(-0x1b3,-0x18e)+this['bucketId']+'/files/'+_0x15fbbd+(_0x51d6ee[_0x283f95(-0x220,-0x1fa)]()?'?'+_0x51d6ee[_0x283f95(-0x22b,-0x1fa)]():''),response=await this['httpClient']['get'](_0xc8fb1a,{'responseType':_0x283f95(-0x1f3,-0x1cf)});return{'data':response['data'],'error':null};}catch(_0x35c934){return{'data':null,'error':_0x35c934 instanceof EBaaSError?_0x35c934:new EBaaSError(_0x35c934 instanceof Error?_0x35c934['message']:'Failed\x20to\x20download\x20file',0x0,_0x35c934)};}}async[_0x3e19e9(-0x179,-0x1a0)](_0x4f3b10,_0x20451f){function _0x1010e1(_0x377a5d,_0x1c2a8f){return _0x15c7(_0x1c2a8f- -0xa9,_0x377a5d);}try{const _0x2a8fb9=new URLSearchParams();_0x4f3b10&&_0x2a8fb9[_0x1010e1(0x46,0x16)]('prefix',_0x4f3b10);_0x20451f?.[_0x1010e1(0x83,0x86)]&&_0x2a8fb9[_0x1010e1(0x75,0x16)]('limit',String(_0x20451f[_0x1010e1(0x35,0x86)]));_0x20451f?.['offset']&&_0x2a8fb9['append'](_0x1010e1(0x90,0x18),String(_0x20451f['offset']));_0x20451f?.['sortBy']&&_0x2a8fb9[_0x1010e1(0x67,0x16)](_0x1010e1(0x117,0xe3),JSON['stringify'](_0x20451f[_0x1010e1(0x101,0xe3)]));_0x20451f?.[_0x1010e1(0xb1,0xc2)]&&_0x2a8fb9['append']('search',_0x20451f[_0x1010e1(0x5a,0xc2)]);const _0x2d274d=_0x1010e1(0x63,0x93)+this['bucketId']+'/files'+(_0x2a8fb9['toString']()?'?'+_0x2a8fb9['toString']():''),response=await this[_0x1010e1(0x86,0x54)]['get'](_0x2d274d);return{'data':response['data'],'error':null};}catch(_0xbb7ec3){return{'data':null,'error':_0xbb7ec3 instanceof EBaaSError?_0xbb7ec3:new EBaaSError(_0xbb7ec3 instanceof Error?_0xbb7ec3['message']:_0x1010e1(0x112,0xda),0x0,_0xbb7ec3)};}}async['remove'](_0x4059b2){function _0x4ea075(_0x52103a,_0xce235a){return _0x15c7(_0x52103a- -0x133,_0xce235a);}try{const response=await this[_0x4ea075(-0x36,-0x1f)]['delete'](_0x4ea075(0x9,0x7f)+this[_0x4ea075(0x42,0x37)]+_0x4ea075(-0x4a,-0x6b),{'data':{'paths':_0x4059b2}});return{'data':response['data'],'error':null};}catch(_0x5d6f42){return{'data':null,'error':_0x5d6f42 instanceof EBaaSError?_0x5d6f42:new EBaaSError(_0x5d6f42 instanceof Error?_0x5d6f42['message']:_0x4ea075(0x26,0x1e),0x0,_0x5d6f42)};}}async['move'](fromPath,_0x6b01a1){function _0x247bc6(_0x1ccd7b,_0x2aa4d4){return _0x15c7(_0x1ccd7b- -0x7d,_0x2aa4d4);}try{const response=await this[_0x247bc6(0x80,0x93)]['post'](_0x247bc6(0xbf,0x4f)+this['bucketId']+_0x247bc6(0x2f,0x55),{'sourceKey':fromPath,'destinationKey':_0x6b01a1});return{'data':response[_0x247bc6(0xb4,0x8e)],'error':null};}catch(_0x1de846){return{'data':null,'error':_0x1de846 instanceof EBaaSError?_0x1de846:new EBaaSError(_0x1de846 instanceof Error?_0x1de846['message']:'Failed\x20to\x20move\x20file',0x0,_0x1de846)};}}async['copy'](fromPath,_0x43ca07){function _0x2e8d17(_0x3f972f,_0x4860b6){return _0x15c7(_0x4860b6-0x28f,_0x3f972f);}try{const response=await this['httpClient'][_0x2e8d17(0x2f1,0x368)]('/storage/buckets/'+this['bucketId']+_0x2e8d17(0x309,0x34b),{'sourceKey':fromPath,'destinationKey':_0x43ca07});return{'data':response[_0x2e8d17(0x35e,0x3c0)],'error':null};}catch(_0x26a676){return{'data':null,'error':_0x26a676 instanceof EBaaSError?_0x26a676:new EBaaSError(_0x26a676 instanceof Error?_0x26a676[_0x2e8d17(0x3c0,0x3a5)]:_0x2e8d17(0x403,0x3f1),0x0,_0x26a676)};}}async[_0x3e19e9(-0x15b,-0x194)](_0x1088ae,_0x14ca2c,_0x1c0b98){function _0x145820(_0x2ee7c1,_0x3cf617){return _0x15c7(_0x3cf617- -0x170,_0x2ee7c1);}try{const response=await this[_0x145820(-0x15,-0x73)]['post'](_0x145820(-0x41,-0x34)+this[_0x145820(-0x75,0x5)]+'/files/'+_0x1088ae+_0x145820(-0xe6,-0x6d),{'expiresIn':_0x14ca2c,..._0x1c0b98});return{'data':response['data'],'error':null};}catch(_0x9b85f0){return{'data':null,'error':_0x9b85f0 instanceof EBaaSError?_0x9b85f0:new EBaaSError(_0x9b85f0 instanceof Error?_0x9b85f0['message']:_0x145820(0x4c,-0x16),0x0,_0x9b85f0)};}}['getPublicUrl'](_0x34fbb0,_0x389445){const _0x4aa17b=new URLSearchParams();function _0x27893d(_0x1a2977,_0x4351ed){return _0x15c7(_0x4351ed- -0x23d,_0x1a2977);}_0x389445?.[_0x27893d(-0x189,-0x19a)]&&Object['entries'](_0x389445['transform'])['forEach'](([_0xe2517b,_0x3e39d0])=>{_0x3e39d0!==undefined&&_0x4aa17b['append'](_0xe2517b,String(_0x3e39d0));});const _0x4ba326=this[_0x27893d(-0x130,-0x140)][_0x27893d(-0xf6,-0x115)]||'',_0x148514=_0x4ba326+_0x27893d(-0x16b,-0x101)+this[_0x27893d(-0x4f,-0xc8)]+_0x27893d(-0x134,-0x150)+_0x34fbb0+(_0x4aa17b[_0x27893d(-0x14f,-0x16d)]()?'?'+_0x4aa17b['toString']():'');return{'data':{'publicUrl':_0x148514}};}async['getFileInfo'](_0x5d4d85){function _0x251799(_0x1a21e4,_0x1aa62d){return _0x15c7(_0x1a21e4-0x97,_0x1aa62d);}try{const response=await this[_0x251799(0x194,0x1b7)]['get'](_0x251799(0x1d3,0x170)+this[_0x251799(0x20c,0x25b)]+_0x251799(0x184,0x128)+_0x5d4d85+_0x251799(0x145,0xda));return{'data':response['data'],'error':null};}catch(_0x245741){return{'data':null,'error':_0x245741 instanceof EBaaSError?_0x245741:new EBaaSError(_0x245741 instanceof Error?_0x245741['message']:_0x251799(0x188,0x147),0x0,_0x245741)};}}async[_0x3e19e9(-0x156,-0x111)](_0x532665,metadata){function _0xa08bef(_0x5397b4,_0x3d77c0){return _0x15c7(_0x5397b4-0x25f,_0x3d77c0);}try{const response=await this[_0xa08bef(0x35c,0x335)][_0xa08bef(0x395,0x32e)]('/storage/buckets/'+this['bucketId']+_0xa08bef(0x34c,0x398)+_0x532665+_0xa08bef(0x38d,0x33d),{'metadata':metadata});return{'data':response[_0xa08bef(0x390,0x3e2)],'error':null};}catch(_0x30096f){return{'data':null,'error':_0x30096f instanceof EBaaSError?_0x30096f:new EBaaSError(_0x30096f instanceof Error?_0x30096f['message']:'Failed\x20to\x20update\x20file\x20metadata',0x0,_0x30096f)};}}}class StorageClient{constructor(_0xfc10a){function _0x4e49cf(_0x33a35c,_0x22f488){return _0x15c7(_0x33a35c-0x4f,_0x22f488);}this[_0x4e49cf(0x14c,0xd4)]=_0xfc10a;}[_0x3e19e9(-0x197,-0x1da)](bucketId){return new StorageBucket(this['httpClient'],bucketId);}async[_0x3e19e9(-0x1e0,-0x1d9)](_0x245121,_0x110d30){function _0x42966e(_0x4ad340,_0x251e8d){return _0x15c7(_0x4ad340- -0x393,_0x251e8d);}try{const response=await this['httpClient']['post']('/storage/buckets',{'id':_0x245121,..._0x110d30});return{'data':response['data'],'error':null};}catch(_0x408d5f){return{'data':null,'error':_0x408d5f instanceof EBaaSError?_0x408d5f:new EBaaSError(_0x408d5f instanceof Error?_0x408d5f['message']:_0x42966e(-0x23b,-0x1d5),0x0,_0x408d5f)};}}async['getBucket'](_0x486598){function _0x5c6c87(_0x5b4075,_0x1f304b){return _0x15c7(_0x5b4075-0x347,_0x1f304b);}try{const response=await this[_0x5c6c87(0x444,0x41d)][_0x5c6c87(0x3e6,0x432)](_0x5c6c87(0x483,0x4a3)+_0x486598);return{'data':response['data'],'error':null};}catch(_0x19126d){return{'data':null,'error':_0x19126d instanceof EBaaSError?_0x19126d:new EBaaSError(_0x19126d instanceof Error?_0x19126d['message']:'Failed\x20to\x20get\x20bucket',0x0,_0x19126d)};}}async[_0x3e19e9(-0x1d8,-0x1f8)](){function _0x5d7679(_0x22c2b8,_0x1b71ef){return _0x15c7(_0x1b71ef-0xd,_0x22c2b8);}try{const response=await this['httpClient']['get'](_0x5d7679(0xdc,0x125));return{'data':response[_0x5d7679(0x13a,0x13e)],'error':null};}catch(_0x470011){return{'data':null,'error':_0x470011 instanceof EBaaSError?_0x470011:new EBaaSError(_0x470011 instanceof Error?_0x470011['message']:_0x5d7679(0x16a,0x19b),0x0,_0x470011)};}}async[_0x3e19e9(-0x1ff,-0x24a)](_0x8e82b3,_0x1a9da4){function _0xbcaef8(_0x4dd015,_0x5a0b16){return _0x15c7(_0x5a0b16- -0x3b9,_0x4dd015);}try{const response=await this[_0xbcaef8(-0x28b,-0x2bc)]['put']('/storage/buckets/'+_0x8e82b3,_0x1a9da4);return{'data':response['data'],'error':null};}catch(_0x1d9f80){return{'data':null,'error':_0x1d9f80 instanceof EBaaSError?_0x1d9f80:new EBaaSError(_0x1d9f80 instanceof Error?_0x1d9f80[_0xbcaef8(-0x2f9,-0x2a3)]:_0xbcaef8(-0x1f0,-0x231),0x0,_0x1d9f80)};}}async['deleteBucket'](_0x3d0641){function _0x1694d1(_0x1f2207,_0x174cf2){return _0x15c7(_0x1f2207- -0x320,_0x174cf2);}try{const response=await this['httpClient']['delete']('/storage/buckets/'+_0x3d0641);return{'data':response[_0x1694d1(-0x1ef,-0x1c4)],'error':null};}catch(_0x57c7dc){return{'data':null,'error':_0x57c7dc instanceof EBaaSError?_0x57c7dc:new EBaaSError(_0x57c7dc instanceof Error?_0x57c7dc['message']:'Failed\x20to\x20delete\x20bucket',0x0,_0x57c7dc)};}}async['getUsage'](){function _0x2e14b4(_0x53df41,_0x52ff03){return _0x15c7(_0x53df41- -0xf6,_0x52ff03);}try{const response=await this['httpClient']['get'](_0x2e14b4(-0x19,-0x10));return{'data':response['data'],'error':null};}catch(_0x282725){return{'data':null,'error':_0x282725 instanceof EBaaSError?_0x282725:new EBaaSError(_0x282725 instanceof Error?_0x282725['message']:_0x2e14b4(0x72,0x32),0x0,_0x282725)};}}}class RealtimeChannel extends _0x2302e2{constructor(_0xf1905b,_0x120273){function _0x2c1a9f(_0x57e21b,_0x980db0){return _0x15c7(_0x57e21b- -0x38a,_0x980db0);}super(),this[_0x2c1a9f(-0x246,-0x2a3)]=![],this[_0x2c1a9f(-0x27c,-0x220)]='closed',this[_0x2c1a9f(-0x209,-0x232)]=new Map(),this[_0x2c1a9f(-0x218,-0x1f5)]=_0xf1905b,this[_0x2c1a9f(-0x29b,-0x24f)]=_0x120273;}['subscribe'](_0x1aaffc){function _0xe7b8dc(_0x5d1075,_0x1155fe){return _0x15c7(_0x1155fe-0x2e,_0x5d1075);}return!this[_0xe7b8dc(0x1c8,0x172)]&&(this[_0xe7b8dc(0x167,0x172)]=!![],this[_0xe7b8dc(0x18d,0x140)]()),_0x1aaffc&&this['on'](_0xe7b8dc(0x77,0xd3),_0x1aaffc),this;}[_0x3e19e9(-0x115,-0x175)](filter,_0x25f07c){const _0x2580d3=_0x37ef25(0x2fa,0x2a9)+JSON['stringify'](filter);super['on'](_0x2580d3,_0x25f07c);const _0x1017b7={'unsubscribe':()=>{function _0x24cf25(_0x15ade9,_0x1e762c){return _0x15c7(_0x1e762c-0x164,_0x15ade9);}super['off'](_0x2580d3,_0x25f07c),this[_0x24cf25(0x2be,0x2e5)]['delete'](_0x2580d3);}};this[_0x37ef25(0x3a4,0x355)]['set'](_0x2580d3,_0x1017b7);function _0x37ef25(_0x188403,_0x2a3ab0){return _0x15c7(_0x2a3ab0-0x1d4,_0x188403);}return this['socket']?.[_0x37ef25(0x2b0,0x313)]&&this[_0x37ef25(0x34e,0x2e2)]==='joined'&&this[_0x37ef25(0x2e1,0x2c3)]['emit'](_0x37ef25(0x20f,0x27c),{'topic':this[_0x37ef25(0x2e5,0x346)],'filter':filter,'ref':this['makeRef']()}),_0x1017b7;}['onBroadcast'](filter,_0x4a97cc){const _0x242c69='broadcast:'+JSON['stringify'](filter);function _0x3aa07c(_0x5d54f6,_0x5ec33a){return _0x15c7(_0x5d54f6- -0x1ce,_0x5ec33a);}super['on'](_0x242c69,_0x4a97cc);const _0x10a77d={'unsubscribe':()=>{super['off'](_0x242c69,_0x4a97cc),this['subscriptions']['delete'](_0x242c69);}};return this[_0x3aa07c(-0x4d,-0xb4)][_0x3aa07c(-0x82,-0x3b)](_0x242c69,_0x10a77d),_0x10a77d;}[_0x3e19e9(-0x14e,-0x190)](filter,_0x144e57){const _0x378b19=_0x52361f(0x35a,0x389)+JSON[_0x52361f(0x348,0x3ab)](filter);super['on'](_0x378b19,_0x144e57);const _0x4ede0a={'unsubscribe':()=>{super[_0x36cbcd(-0x34e,-0x2e8)](_0x378b19,_0x144e57);function _0x36cbcd(_0x8b8835,_0x8355af){return _0x15c7(_0x8355af- -0x3c8,_0x8b8835);}this[_0x36cbcd(-0x1eb,-0x247)][_0x36cbcd(-0x2b6,-0x249)](_0x378b19);}};function _0x52361f(_0x5121cb,_0x476e81){return _0x15c7(_0x5121cb-0x1e2,_0x476e81);}return this[_0x52361f(0x363,0x3cf)]['set'](_0x378b19,_0x4ede0a),_0x4ede0a;}[_0x3e19e9(-0x169,-0x17e)](_0x6d9ab4){return new Promise(_0x2a678f=>{function _0x3fc8d7(_0x438839,_0x127843){return _0x15c7(_0x438839- -0x3ad,_0x127843);}this['socket']?.['connected']&&this['state']===_0x3fc8d7(-0x296,-0x258)?(this[_0x3fc8d7(-0x2be,-0x289)][_0x3fc8d7(-0x2c2,-0x29f)](_0x3fc8d7(-0x307,-0x294),{'topic':this[_0x3fc8d7(-0x23b,-0x27d)],'event':_0x6d9ab4[_0x3fc8d7(-0x310,-0x338)],'payload':_0x6d9ab4,'ref':this[_0x3fc8d7(-0x25a,-0x26a)]()}),_0x2a678f('ok')):_0x2a678f(_0x3fc8d7(-0x2f2,-0x2bb));});}[_0x3e19e9(-0x204,-0x1f3)](_0xd4f2e){return new Promise(_0x3e59ae=>{function _0x5e3abc(_0x461147,_0x1558d0){return _0x15c7(_0x1558d0-0x110,_0x461147);}this[_0x5e3abc(0x216,0x1ff)]?.[_0x5e3abc(0x252,0x24f)]&&this[_0x5e3abc(0x1cb,0x21e)]===_0x5e3abc(0x206,0x227)?(this[_0x5e3abc(0x21f,0x1ff)]['emit'](_0x5e3abc(0x255,0x1f4),{'topic':this['topic'],'event':'track','payload':_0xd4f2e,'ref':this['makeRef']()}),_0x3e59ae('ok')):_0x3e59ae('error');});}['untrack'](){return new Promise(_0x3df764=>{function _0xfd6c61(_0x25f688,_0xf8b641){return _0x15c7(_0xf8b641-0x3c0,_0x25f688);}this['socket']?.['connected']&&this[_0xfd6c61(0x4e4,0x4ce)]==='joined'?(this[_0xfd6c61(0x51e,0x4af)][_0xfd6c61(0x471,0x4ab)](_0xfd6c61(0x470,0x4a4),{'topic':this['topic'],'event':'untrack','ref':this['makeRef']()}),_0x3df764('ok')):_0x3df764('error');});}[_0x3e19e9(-0x113,-0x18d)](){return new Promise(_0xf461be=>{this['state']='leaving',this['subscriptions'][_0x40ea24(0x224,0x264)](_0x551cb7=>{function _0x339682(_0x282719,_0x444a04){return _0x15c7(_0x444a04-0x247,_0x282719);}_0x551cb7[_0x339682(0x3fa,0x3d4)]();}),this[_0x40ea24(0x30b,0x2d8)][_0x40ea24(0x19d,0x215)]();function _0x40ea24(_0x139861,_0x17aa42){return _0x15c7(_0x17aa42-0x157,_0x139861);}this[_0x40ea24(0x1dd,0x246)]?.[_0x40ea24(0x2df,0x296)]&&this['socket']['emit'](_0x40ea24(0x233,0x235),{'topic':this['topic'],'ref':this[_0x40ea24(0x2b2,0x2aa)]()}),this[_0x40ea24(0x2b0,0x265)]='closed',this['removeAllListeners'](),_0xf461be('ok');});}[_0x3e19e9(-0x18e,-0x17c)](){function _0x434990(_0x216d50,_0x3a8d69){return _0x15c7(_0x3a8d69- -0x287,_0x216d50);}if(this[_0x434990(-0x16f,-0x179)]==='leaving')return;this['state']=_0x434990(-0x252,-0x1e5),this[_0x434990(-0x182,-0x198)]?.['connected']&&(this[_0x434990(-0x17e,-0x198)]['emit']('join',{'topic':this[_0x434990(-0x9b,-0x115)],'ref':this[_0x434990(-0x106,-0x134)]()}),setTimeout(()=>{function _0x36d1a6(_0x3c4c6e,_0x5e97d2){return _0x15c7(_0x5e97d2- -0x224,_0x3c4c6e);}this['state']==='joining'&&(this['state']='joined',this['emit'](_0x36d1a6(-0x103,-0x17f),'SUBSCRIBED'));},0x64));}[_0x3e19e9(-0x119,-0xe5)](){function _0x20a72a(_0x34ca8e,_0xeaf858){return _0x15c7(_0xeaf858- -0x203,_0x34ca8e);}this[_0x20a72a(-0xb8,-0xbf)]&&(this['_join'](),this['subscriptions']['forEach']((_0x551b2f,_0x12b03d)=>{function _0x2fdb71(_0x1f131f,_0x4a75ea){return _0x15c7(_0x4a75ea-0x2c0,_0x1f131f);}if(_0x12b03d[_0x2fdb71(0x3f9,0x391)](_0x2fdb71(0x38d,0x395))){const filter=JSON['parse'](_0x12b03d[_0x2fdb71(0x3f3,0x38d)](_0x2fdb71(0x33a,0x395),''));this[_0x2fdb71(0x402,0x3af)]?.[_0x2fdb71(0x3b6,0x3ab)](_0x2fdb71(0x348,0x368),{'topic':this[_0x2fdb71(0x46f,0x432)],'filter':filter,'ref':this[_0x2fdb71(0x3d6,0x413)]()});}}));}['_trigger'](_0x363ba0,_0x1353ce){if(_0x363ba0===_0x265023(0x3d4,0x43e)){const _0x2cd4a3='postgres_changes:'+JSON[_0x265023(0x408,0x3a3)](_0x1353ce[_0x265023(0x38c,0x33e)]||{});this[_0x265023(0x38d,0x3b7)](_0x2cd4a3,_0x1353ce);}else{if(_0x363ba0===_0x265023(0x348,0x2db)){const _0x342d27='broadcast:'+JSON['stringify']({'event':_0x1353ce['event']});this[_0x265023(0x38d,0x324)](_0x342d27,_0x1353ce);}else{if(_0x363ba0==='presence'){const _0x543515=_0x265023(0x41a,0x479)+JSON[_0x265023(0x408,0x42a)]({'event':_0x1353ce['event']});this[_0x265023(0x38d,0x375)](_0x543515,_0x1353ce);}}}function _0x265023(_0x11aec2,_0x20b1ed){return _0x15c7(_0x11aec2-0x2a2,_0x20b1ed);}this['emit'](_0x363ba0,_0x1353ce);}[_0x3e19e9(-0x12f,-0x121)](_0x2e136a){this[_0x5793c0(-0x8f,-0xe6)]=_0x2e136a;let status;switch(_0x2e136a){case'joined':status='SUBSCRIBED';break;case'errored':status='CHANNEL_ERROR';break;case'closed':status=_0x5793c0(-0x22,-0x6e);break;default:return;}function _0x5793c0(_0x471f8c,_0x4597b8){return _0x15c7(_0x4597b8- -0x1f4,_0x471f8c);}this['emit']('status',status);}[_0x3e19e9(-0x14d,-0x147)](){function _0x3e0ea4(_0x512845,_0x44ec0e){return _0x15c7(_0x512845-0x114,_0x44ec0e);}return Math[_0x3e0ea4(0x292,0x2e8)]()[_0x3e0ea4(0x1e4,0x1b7)](0x24)['substring'](0x2,0xf);}['getState'](){function _0x4cff06(_0x104df5,_0x5a8a46){return _0x15c7(_0x104df5-0x180,_0x5a8a46);}return this[_0x4cff06(0x28e,0x2fb)];}}function _0x15c7(_0x564aa9,_0x455a57){const _0x4e83f6=_0x4e83();return _0x15c7=function(_0x15c723,_0x39c60d){_0x15c723=_0x15c723-0x97;let _0x5d735e=_0x4e83f6[_0x15c723];if(_0x15c7['NSmCDf']===undefined){var _0x3bc004=function(_0x2302e2){const _0x496580='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x281dd9='',_0x139d2c='';for(let _0xc04936=0x0,_0x3b7ed5,_0x471f27,_0x1bd50f=0x0;_0x471f27=_0x2302e2['charAt'](_0x1bd50f++);~_0x471f27&&(_0x3b7ed5=_0xc04936%0x4?_0x3b7ed5*0x40+_0x471f27:_0x471f27,_0xc04936++%0x4)?_0x281dd9+=String['fromCharCode'](0xff&_0x3b7ed5>>(-0x2*_0xc04936&0x6)):0x0){_0x471f27=_0x496580['indexOf'](_0x471f27);}for(let _0x4df62f=0x0,_0x13e0e6=_0x281dd9['length'];_0x4df62f<_0x13e0e6;_0x4df62f++){_0x139d2c+='%'+('00'+_0x281dd9['charCodeAt'](_0x4df62f)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x139d2c);};_0x15c7['SFgkAV']=_0x3bc004,_0x564aa9=arguments,_0x15c7['NSmCDf']=!![];}const _0x40a070=_0x4e83f6[0x0],_0x22dcf9=_0x15c723+_0x40a070,_0x5636bb=_0x564aa9[_0x22dcf9];return!_0x5636bb?(_0x5d735e=_0x15c7['SFgkAV'](_0x5d735e),_0x564aa9[_0x22dcf9]=_0x5d735e):_0x5d735e=_0x5636bb,_0x5d735e;},_0x15c7(_0x564aa9,_0x455a57);}class RealtimeClient{constructor(_0x5b7cd6,_0x4dd4f4,_0x117c18={}){function _0xf3b2b(_0xf76ea,_0x5ddaf8){return _0x15c7(_0xf76ea- -0x30,_0x5ddaf8);}this[_0xf3b2b(0xbf,0x4e)]=null,this['channels']=new Map(),this[_0xf3b2b(0x147,0x185)]='disconnected',this[_0xf3b2b(0x8d,0x108)]=0x0,this[_0xf3b2b(0xab,0x47)]=0x5,this['url']=_0x5b7cd6,this[_0xf3b2b(0xf1,0xbc)]=_0x4dd4f4,this[_0xf3b2b(0xc6,0x4d)]={'heartbeatInterval':0x7530,'reconnectInterval':0x1388,'maxReconnectAttempts':0x5,..._0x117c18};}[_0x3e19e9(-0x17d,-0x11a)](){return new Promise((_0x4dc823,_0xebd2bb)=>{function _0xbb54e0(_0x4cf283,_0x38f0c0){return _0x15c7(_0x4cf283-0x55,_0x38f0c0);}if(this['socket']?.[_0xbb54e0(0x194,0x15b)]){_0x4dc823();return;}this['connectionState']='connecting',this['socket']=io(this['url'],{'auth':{'apikey':this[_0xbb54e0(0x176,0x1a4)]},'transports':['websocket'],'reconnection':!![],'reconnectionDelay':this['options'][_0xbb54e0(0x11a,0x136)],'reconnectionAttempts':this[_0xbb54e0(0x14b,0x199)]['maxReconnectAttempts'],...this[_0xbb54e0(0x14b,0x14e)][_0xbb54e0(0x1cf,0x1f5)]}),this['socket']['on'](_0xbb54e0(0x178,0x11f),()=>{this[_0x136fba(0xc4,0x112)]=_0x136fba(0x8c,0xb0);function _0x136fba(_0xa93b73,_0x229461){return _0x15c7(_0xa93b73- -0xb3,_0x229461);}this[_0x136fba(0xa,-0x2b)]=0x0,this[_0x136fba(0x2,-0x2a)](),_0x4dc823();}),this['socket']['on']('disconnect',_0x7ef8c4=>{function _0x5055d3(_0x20a57f,_0x21665f){return _0x15c7(_0x20a57f- -0x26d,_0x21665f);}this['connectionState']='disconnected',this['channels'][_0x5055d3(-0x160,-0x142)](channel=>{function _0x483106(_0xbf7038,_0xbc380a){return _0x15c7(_0xbf7038-0x140,_0xbc380a);}channel[_0x483106(0x2b1,0x264)](_0x483106(0x2c5,0x31d));});}),this['socket']['on'](_0xbb54e0(0x161,0x102),_0x45c123=>{this['connectionState']=_0x28ca6f(-0xc7,-0x9f),this[_0x28ca6f(-0xc5,-0xdb)]++;function _0x28ca6f(_0x4ca345,_0x4d0949){return _0x15c7(_0x4ca345- -0x182,_0x4d0949);}this[_0x28ca6f(-0xc5,-0x7b)]>=this['maxReconnectAttempts']&&_0xebd2bb(new Error('Failed\x20to\x20connect\x20after\x20'+this['maxReconnectAttempts']+_0x28ca6f(-0x6d,-0x56)+_0x45c123['message']));}),this[_0xbb54e0(0x144,0x16c)]['on']('reconnect',()=>{this[_0x27b3ec(0x2c8,0x2c3)]=_0x27b3ec(0x2ff,0x28b),this['reconnectAttempts']=0x0;function _0x27b3ec(_0x3e5d06,_0x5a1898){return _0x15c7(_0x5a1898-0x14c,_0x3e5d06);}this['channels'][_0x27b3ec(0x291,0x259)](channel=>{channel['_rejoin']();});}),this[_0xbb54e0(0x144,0x17e)]['on']('postgres_changes',_0x5b1220=>{function _0x3f3d9b(_0x5a5be3,_0x1f7545){return _0x15c7(_0x1f7545-0x34a,_0x5a5be3);}const channel=this[_0x3f3d9b(0x423,0x415)][_0x3f3d9b(0x3a6,0x3e9)](_0x5b1220['topic']);channel&&channel['_trigger'](_0x3f3d9b(0x42c,0x47c),_0x5b1220);}),this['socket']['on']('broadcast',_0x50215c=>{function _0xdf275a(_0x3bb351,_0x49090f){return _0x15c7(_0x49090f- -0x30d,_0x3bb351);}const channel=this[_0xdf275a(-0x251,-0x242)][_0xdf275a(-0x2a7,-0x26e)](_0x50215c[_0xdf275a(-0x1ba,-0x19b)]);channel&&channel[_0xdf275a(-0x1e2,-0x24a)](_0xdf275a(-0x2ca,-0x267),_0x50215c);}),this['socket']['on'](_0xbb54e0(0x139,0xf1),_0x5405fa=>{const channel=this[_0x5e8ad6(0x331,0x336)]['get'](_0x5405fa['topic']);function _0x5e8ad6(_0x168da3,_0x5ba516){return _0x15c7(_0x168da3-0x266,_0x5ba516);}channel&&channel['_trigger'](_0x5e8ad6(0x34a,0x380),_0x5405fa);});});}['disconnect'](){function _0x432be3(_0x53b556,_0x54af4e){return _0x15c7(_0x53b556- -0x160,_0x54af4e);}this['socket']&&(this[_0x432be3(-0x71,0x0)]['disconnect'](),this[_0x432be3(-0x71,-0x49)]=null),this[_0x432be3(0x17,0xc)]='disconnected',this['channels'][_0x432be3(-0xa2,-0xe1)]();}[_0x3e19e9(-0x182,-0x1d4)](_0x3236ab){if(this['channels'][_0x42c9e5(0x1aa,0x1cc)](_0x3236ab))return this['channels']['get'](_0x3236ab);function _0x42c9e5(_0xc2618e,_0x49e5b6){return _0x15c7(_0x49e5b6-0xc1,_0xc2618e);}const channel=new RealtimeChannel(_0x3236ab,this[_0x42c9e5(0x217,0x1b0)]);return this[_0x42c9e5(0x142,0x18c)][_0x42c9e5(0x19f,0x20d)](_0x3236ab,channel),this[_0x42c9e5(0x278,0x238)]===_0x42c9e5(0x240,0x200)&&channel['_join'](),channel;}['removeChannel'](channel){const _0x18217c=channel[_0x53c55f(0x406,0x3a6)];function _0x53c55f(_0x2334a8,_0x736a8f){return _0x15c7(_0x2334a8-0x294,_0x736a8f);}this[_0x53c55f(0x35f,0x37b)]['has'](_0x18217c)&&(this[_0x53c55f(0x35f,0x305)]['delete'](_0x18217c),channel[_0x53c55f(0x421,0x3df)]());}[_0x3e19e9(-0x18f,-0x1d4)](){this['channels'][_0x140bf8(-0x217,-0x1d4)](channel=>{channel['unsubscribe']();});function _0x140bf8(_0x5e4a68,_0x239d5f){return _0x15c7(_0x5e4a68- -0x324,_0x239d5f);}this['channels']['clear']();}[_0x3e19e9(-0x1ce,-0x193)](){function _0x98ce00(_0x34e8e7,_0xd3aa3b){return _0x15c7(_0xd3aa3b-0x131,_0x34e8e7);}return Array[_0x98ce00(0x1d0,0x23a)](this['channels']['values']());}['isConnected'](){function _0x241e2f(_0x3e2719,_0x269148){return _0x15c7(_0x269148- -0x1d,_0x3e2719);}return this[_0x241e2f(0x19e,0x15a)]==='connected'&&!!this['socket']?.[_0x241e2f(0x145,0x122)];}[_0x3e19e9(-0x145,-0x1ab)](){return this['connectionState'];}[_0x3e19e9(-0x208,-0x219)](_0x42550b){const _0x5de43e=()=>_0x42550b(this['connectionState']);function _0x634454(_0x570546,_0x319bea){return _0x15c7(_0x319bea-0x16f,_0x570546);}return this[_0x634454(0x1fb,0x25e)]&&(this['socket']['on']('connect',()=>{this['connectionState']='connected',_0x5de43e();}),this[_0x634454(0x27e,0x25e)]['on'](_0x634454(0x294,0x29c),()=>{function _0xbb8f0(_0x26db6a,_0x4f0765){return _0x15c7(_0x26db6a- -0x11e,_0x4f0765);}this[_0xbb8f0(0x59,-0x7)]='disconnected',_0x5de43e();}),this['socket']['on']('connect_error',()=>{this[_0x361f46(-0x1ad,-0x149)]=_0x361f46(-0x269,-0x2e5);function _0x361f46(_0x4de74b,_0x1b9f24){return _0x15c7(_0x4de74b- -0x324,_0x1b9f24);}_0x5de43e();})),()=>{function _0x1cefbe(_0x20c8dc,_0x25b173){return _0x15c7(_0x20c8dc-0x17d,_0x25b173);}this['socket']&&(this[_0x1cefbe(0x26c,0x2c9)]['off']('connect',_0x5de43e),this[_0x1cefbe(0x26c,0x1f5)][_0x1cefbe(0x25d,0x2cf)]('disconnect',_0x5de43e),this[_0x1cefbe(0x26c,0x1f6)]['off'](_0x1cefbe(0x289,0x28c),_0x5de43e));};}[_0x3e19e9(-0x1eb,-0x18a)](){function _0x48a54d(_0x538288,_0x3bad8e){return _0x15c7(_0x538288-0x1e5,_0x3bad8e);}if(!this['options']['heartbeatInterval']||!this[_0x48a54d(0x2d4,0x2c4)])return;const interval=setInterval(()=>{function _0x4ac277(_0x41531e,_0x48fa55){return _0x15c7(_0x48fa55-0x378,_0x41531e);}this['socket']?.['connected']?this[_0x4ac277(0x467,0x467)][_0x4ac277(0x4b0,0x463)]('heartbeat',{'timestamp':Date['now']()}):clearInterval(interval);},this['options']['heartbeatInterval']);}[_0x3e19e9(-0x1d1,-0x1da)](){function _0x2f40e7(_0x5c59f,_0x5b79e8){return _0x15c7(_0x5b79e8-0x1a,_0x5c59f);}return this[_0x2f40e7(0x156,0x109)];}}class FunctionsClient{constructor(_0x589e09){this['httpClient']=_0x589e09;}async[_0x3e19e9(-0x17e,-0x12a)](_0x8b653e,_0x2f3aa1){function _0x131895(_0x3820c7,_0x158d9b){return _0x15c7(_0x3820c7-0x2e3,_0x158d9b);}try{const _0x5da9c0=_0x2f3aa1?.['method']||'POST',headers={'Content-Type':'application/json',..._0x2f3aa1?.['headers']};let response;const _0x2eda40='/functions/v1/'+_0x8b653e;switch(_0x5da9c0['toUpperCase']()){case'GET':response=await this['httpClient']['get'](_0x2eda40,{'headers':headers,'params':_0x2f3aa1?.['body']});break;case'POST':response=await this['httpClient'][_0x131895(0x3bc,0x3e1)](_0x2eda40,_0x2f3aa1?.['body'],{'headers':headers});break;case'PUT':response=await this['httpClient']['put'](_0x2eda40,_0x2f3aa1?.[_0x131895(0x3b1,0x42b)],{'headers':headers});break;case'PATCH':response=await this['httpClient'][_0x131895(0x39d,0x3d6)](_0x2eda40,_0x2f3aa1?.['body'],{'headers':headers});break;case'DELETE':response=await this[_0x131895(0x3e0,0x42d)][_0x131895(0x462,0x41f)](_0x2eda40,{'headers':headers,'data':_0x2f3aa1?.[_0x131895(0x3b1,0x40c)]});break;default:throw new EBaaSError(_0x131895(0x3ed,0x446)+_0x5da9c0,0x190);}return{'data':response[_0x131895(0x414,0x3c8)],'error':null};}catch(_0x5c4148){return{'data':null,'error':_0x5c4148 instanceof EBaaSError?_0x5c4148:new EBaaSError(_0x5c4148 instanceof Error?_0x5c4148[_0x131895(0x3f9,0x40a)]:_0x131895(0x39a,0x3e6),0x0,_0x5c4148)};}}async['list'](){function _0x27c2d9(_0x42341c,_0x1cd27f){return _0x15c7(_0x42341c-0x29,_0x1cd27f);}try{const response=await this[_0x27c2d9(0x126,0xfc)]['get']('/functions/v1');return{'data':response['data'],'error':null};}catch(_0x35c096){return{'data':null,'error':_0x35c096 instanceof EBaaSError?_0x35c096:new EBaaSError(_0x35c096 instanceof Error?_0x35c096['message']:_0x27c2d9(0x13d,0x119),0x0,_0x35c096)};}}async['get'](_0x1f6faa){function _0x497dd5(_0x48c7df,_0x393dbd){return _0x15c7(_0x393dbd- -0x36d,_0x48c7df);}try{const response=await this['httpClient']['get'](_0x497dd5(-0x211,-0x241)+_0x1f6faa+'/info');return{'data':response['data'],'error':null};}catch(_0x152f13){return{'data':null,'error':_0x152f13 instanceof EBaaSError?_0x152f13:new EBaaSError(_0x152f13 instanceof Error?_0x152f13[_0x497dd5(-0x280,-0x257)]:_0x497dd5(-0x236,-0x266),0x0,_0x152f13)};}}async['deploy'](_0x310c31,_0x1f198e){function _0x365d77(_0x188709,_0x20ed05){return _0x15c7(_0x188709- -0x2bc,_0x20ed05);}try{const _0x31d7e7=new FormData();if(_0x1f198e[_0x365d77(-0x15b,-0x11f)]instanceof File)_0x31d7e7['append']('code',_0x1f198e['code']);else typeof _0x1f198e[_0x365d77(-0x15b,-0x14f)]===_0x365d77(-0x17a,-0x120)&&_0x31d7e7[_0x365d77(-0x1fd,-0x1ac)](_0x365d77(-0x15b,-0x1ae),new Blob([_0x1f198e[_0x365d77(-0x15b,-0x10c)]],{'type':'text/plain'}),'index.ts');_0x1f198e['entrypoint']&&_0x31d7e7[_0x365d77(-0x1fd,-0x1e2)]('entrypoint',_0x1f198e['entrypoint']);_0x1f198e[_0x365d77(-0x1f6,-0x237)]&&_0x31d7e7['append'](_0x365d77(-0x1f6,-0x1b6),JSON[_0x365d77(-0x156,-0x152)](_0x1f198e[_0x365d77(-0x1f6,-0x22f)]));_0x1f198e[_0x365d77(-0x188,-0x15d)]&&_0x31d7e7[_0x365d77(-0x1fd,-0x258)](_0x365d77(-0x188,-0x12f),JSON['stringify'](_0x1f198e[_0x365d77(-0x188,-0x176)]));_0x1f198e[_0x365d77(-0x1b4,-0x1a8)]!==undefined&&_0x31d7e7['append'](_0x365d77(-0x1b4,-0x1cc),String(_0x1f198e['verify']));const response=await this[_0x365d77(-0x1bf,-0x228)]['post']('/functions/v1/'+_0x310c31+_0x365d77(-0x141,-0x13c),_0x31d7e7,{'headers':{'Content-Type':_0x365d77(-0x14d,-0x1a8)}});return{'data':response[_0x365d77(-0x18b,-0x1db)],'error':null};}catch(_0x583203){return{'data':null,'error':_0x583203 instanceof EBaaSError?_0x583203:new EBaaSError(_0x583203 instanceof Error?_0x583203[_0x365d77(-0x1a6,-0x1d6)]:'Failed\x20to\x20deploy\x20function',0x0,_0x583203)};}}async[_0x3e19e9(-0x121,-0x19a)](_0x56f35a){function _0x405d8f(_0x45ac23,_0x5b9f6c){return _0x15c7(_0x45ac23- -0x399,_0x5b9f6c);}try{const response=await this['httpClient']['delete']('/functions/v1/'+_0x56f35a);return{'data':response['data'],'error':null};}catch(_0x3fa6da){return{'data':null,'error':_0x3fa6da instanceof EBaaSError?_0x3fa6da:new EBaaSError(_0x3fa6da instanceof Error?_0x3fa6da['message']:_0x405d8f(-0x217,-0x19b),0x0,_0x3fa6da)};}}async['updateEnv'](_0x35a9de,_0xd0daf8){function _0x508814(_0x48f517,_0x2acdb7){return _0x15c7(_0x2acdb7-0x351,_0x48f517);}try{const response=await this['httpClient'][_0x508814(0x40b,0x487)](_0x508814(0x45e,0x47d)+_0x35a9de+_0x508814(0x3cc,0x40a),{'env':_0xd0daf8});return{'data':response[_0x508814(0x41d,0x482)],'error':null};}catch(_0x4c638a){return{'data':null,'error':_0x4c638a instanceof EBaaSError?_0x4c638a:new EBaaSError(_0x4c638a instanceof Error?_0x4c638a['message']:_0x508814(0x3c6,0x437),0x0,_0x4c638a)};}}async[_0x3e19e9(-0x1ec,-0x212)](_0x141750,_0x2bc1e3){function _0x143aba(_0x4bfc5a,_0xcaffee){return _0x15c7(_0xcaffee-0x3b3,_0x4bfc5a);}try{const _0x46b3e6=new URLSearchParams();_0x2bc1e3?.[_0x143aba(0x465,0x4e2)]&&_0x46b3e6[_0x143aba(0x41e,0x472)](_0x143aba(0x557,0x4e2),String(_0x2bc1e3['limit']));_0x2bc1e3?.['offset']&&_0x46b3e6['append'](_0x143aba(0x492,0x474),String(_0x2bc1e3['offset']));_0x2bc1e3?.['level']&&_0x46b3e6['append']('level',_0x2bc1e3['level']);const _0x5f0049='/functions/v1/'+_0x141750+_0x143aba(0x511,0x516)+(_0x46b3e6[_0x143aba(0x4d7,0x483)]()?'?'+_0x46b3e6['toString']():''),response=await this['httpClient'][_0x143aba(0x487,0x452)](_0x5f0049);return{'data':response[_0x143aba(0x552,0x4e4)],'error':null};}catch(_0x5dbcf5){return{'data':null,'error':_0x5dbcf5 instanceof EBaaSError?_0x5dbcf5:new EBaaSError(_0x5dbcf5 instanceof Error?_0x5dbcf5['message']:'Failed\x20to\x20get\x20function\x20logs',0x0,_0x5dbcf5)};}}async[_0x3e19e9(-0x1d9,-0x240)](_0x3588ed,_0x226629){function _0x1dce16(_0x1bba74,_0xe7eb2c){return _0x15c7(_0x1bba74- -0x1,_0xe7eb2c);}try{const _0x314efb=new URLSearchParams();_0x226629?.['period']&&_0x314efb[_0x1dce16(0xbe,0x61)]('period',_0x226629['period']);const _0x5a3be2=_0x1dce16(0x12b,0x130)+_0x3588ed+'/metrics'+(_0x314efb['toString']()?'?'+_0x314efb['toString']():''),response=await this['httpClient'][_0x1dce16(0x9e,0x117)](_0x5a3be2);return{'data':response['data'],'error':null};}catch(_0x16c04d){return{'data':null,'error':_0x16c04d instanceof EBaaSError?_0x16c04d:new EBaaSError(_0x16c04d instanceof Error?_0x16c04d[_0x1dce16(0x115,0x110)]:'Failed\x20to\x20get\x20function\x20metrics',0x0,_0x16c04d)};}}}class EBaaSClient{constructor(_0x4ca430,_0x2f3391,_0x484148){this['options']=_0x484148,this['httpClient']=new HttpClient({'url':_0x4ca430,'apiKey':_0x2f3391,'timeout':0x7530,'headers':_0x484148?.[_0x32cd1c(0x3e3,0x406)]?.['headers']}),this[_0x32cd1c(0x42f,0x3cf)]=new AuthClient(this[_0x32cd1c(0x3e9,0x3df)]),this[_0x32cd1c(0x45f,0x4c4)]=new DatabaseClient(this[_0x32cd1c(0x3e9,0x3e4)],_0x484148?.['database']?.['workspaceId']),this['storage']=new StorageClient(this[_0x32cd1c(0x3e9,0x457)]);function _0x32cd1c(_0x10404a,_0x102cf9){return _0x15c7(_0x10404a-0x2ec,_0x102cf9);}this[_0x32cd1c(0x45a,0x4be)]=new RealtimeClient(_0x4ca430,_0x2f3391,_0x484148?.[_0x32cd1c(0x45a,0x413)]),this[_0x32cd1c(0x385,0x333)]=new FunctionsClient(this['httpClient']),this['initializeCustomDatabase']();}['from'](_0x56920c){function _0x4da19b(_0x3fc5a0,_0x3d26c4){return _0x15c7(_0x3fc5a0- -0x280,_0x3d26c4);}return this[_0x4da19b(-0x10d,-0xd7)]['from'](_0x56920c);}[_0x3e19e9(-0x202,-0x1fe)](_0x1642bc,_0x4f501b){function _0xce4c65(_0x30ea44,_0x209ee2){return _0x15c7(_0x209ee2-0x1c1,_0x30ea44);}return this[_0xce4c65(0x39b,0x334)]['rpc'](_0x1642bc,_0x4f501b);}[_0x3e19e9(-0x190,-0x15f)](_0x4dcb7e){function _0x10fe5c(_0x2e3b15,_0x5aabed){return _0x15c7(_0x2e3b15- -0x16f,_0x5aabed);}return this[_0x10fe5c(-0x54,-0x36)]['from'](_0x4dcb7e);}['channel'](_0x93d908){return this['realtime']['channel'](_0x93d908);}['invoke'](_0x1da5dd,_0x2a06ea){function _0x194c01(_0x419a08,_0xeb411f){return _0x15c7(_0xeb411f-0x3e6,_0x419a08);}return this[_0x194c01(0x45b,0x47f)][_0x194c01(0x4a5,0x508)](_0x1da5dd,_0x2a06ea);}async['initializeCustomDatabase'](){function _0x51f609(_0x31c40c,_0x394914){return _0x15c7(_0x394914- -0xaa,_0x31c40c);}if(this[_0x51f609(0x28,0x4c)]?.['database']?.['autoDetectCustomDatabase'])try{await this['database']['initialize']();}catch(_0x4dfc93){console['warn']('Failed to initialize custom database detection:',_0x4dfc93);}}async[_0x3e19e9(-0x17b,-0x137)](_0x4f09ca){function _0x27ed5e(_0x4b692e,_0x373a28){return _0x15c7(_0x373a28-0xb3,_0x4b692e);}this[_0x27ed5e(0x237,0x226)][_0x27ed5e(0x239,0x1d8)](_0x4f09ca),this['options']?.[_0x27ed5e(0x1bf,0x226)]?.[_0x27ed5e(0x1c9,0x18d)]&&await this['database']['initialize']();}async[_0x3e19e9(-0x151,-0xed)](_0x19156b){await this['database']['configureCustomDatabase'](_0x19156b);}['getCustomDatabaseStatus'](){function _0x5d3eca(_0x496684,_0x18f89e){return _0x15c7(_0x18f89e- -0x33b,_0x496684);}return this[_0x5d3eca(-0x1a5,-0x1c8)][_0x5d3eca(-0x29e,-0x28e)]();}}function _0x3e19e9(_0x45b7e6,_0x253e67){return _0x15c7(_0x45b7e6- -0x2a0,_0x253e67);}function createClient(_0x10d326,_0x266309,_0x5d348e){return new EBaaSClient(_0x10d326,_0x266309,_0x5d348e);}const version=_0x3e19e9(-0x14f,-0x170);export{AuthClient,CustomDatabaseManager,DatabaseClient,EBaaSClient,EBaaSError,FunctionsClient,HttpClient,QueryBuilder,RealtimeChannel,RealtimeClient,StorageBucket,StorageClient,createClient,version};function _0x4e83(){const _0x4ba5cf=['zMLSDgvY','zw1PDa','yxnJzw5KAw5N','l2zPBgvZlW','sfruucbYzxf1zxn0igzHAwXLza','C29JA2v0','zgv0zwn0zwrdB25MAwC','rMfPBgvKihrVigDLDcbMAwXLigLUzM8','uhjLzMvY','mZi2mtq2ohjPvgvnAG','y29TBw9U','l2f1DgGVDJeVC2LNBM91Da','B3b0Aw9UCW','z2XVyMfS','zgv0ywLSCW','y3vYCMvUDfnJAgvTyq','B3jKzxi','yMXVyG','CMvZCg9UC2u','Ahr0CenSAwvUDa','C2LUz2XL','Aw5Zzxj0','DxnLCG','zxHLy3v0zq','BgvUz3rO','l3nPz24','AxnvC2LUz0n1C3rVBurHDgfIyxnL','Bwv0ywrHDge','Cg9YDa','rMfPBgvKihrVigDLDcbMDw5JDgLVBG','DMvYAwz5','zNjVBq','vw5ZDxbWB3j0zwqGsfruucbTzxrOB2q6ia','AgfZ','y29UBMvJDf9LCNjVCG','zM9YrwfJAa','C3rHDgu','rMfPBgvKihrVihrLC3qGy29UBMvJDgLVBG','yNvJA2v0','CMvTB3zLqwXSq2HHBM5LBhm','x2PVAw4','y3vYCMvUDfnLC3nPB24','rMfPBgvKihrVigXPC3qGzNvUy3rPB25Z','igf0DgvTChrZoIa','BwvZC2fNzq','AM9PBMvK','l3n0B3jHz2uVyNvJA2v0CW','y2fWDhvYzvn0ywnRvhjHy2u','zgv0zwn0q3vZDg9Trgf0ywjHC2u','C3rVCMfNzq','zg93BMXVywq','C2v0DxbjBNrLCMnLChrVCNm','y2HHBM5LBa','C2vZC2LVBG','Cg9ZDgDYzxnvC2vYBMfTzq','yxbPs2v5','Aw52B2TL','y29UBMvJDa','C3rHDhvZvgv4Da','C2v0v29YA3nWywnLswq','nte3mZzdEe9lr2G','BgLZDa','yMfZzvvsta','zgf0yufYCMf5','ofzQr01ysa','CMvZzxrqyxnZD29Yza','l2z1BMn0Aw9UCY92ms8','zgLZy29UBMvJDa','l21LDgfKyxrH','BgLTAxq','Ec10B3rHBc1JB3vUDa','zgf0yq','Cg9ZDgDYzxnFy2HHBMDLCW','DxnL','Aw1WB3j0twfW','nJaXmJm4tfPIBM1K','Chv0','C2vUza','AgvHzgvYCW','CMvTB3zLq3vZDg9Trgf0ywjHC2u','mZi0rxbwvNnX','p29WzxjHDgLVBJ11ChnLCNq','l3n0B3jHz2uVyNvJA2v0CY8','ofDyyuD0rq','DxbKyxrLvxnLCG','y29UBMvJDgvK','qMvHCMvYia','z2v0v29YA3nWywnLswq','C3rYAw5N','yxv0Aa','AM9PBMvKt25Jzq','y3jLyxrLu2LNBMvKvxjS','l2f1DgGVDJeVC2LNBNvW','ChjLzMvY','p29WzxjHDgLVBJ1ZzwXLy3q','CMvXDwvZDa','DxbKyxrLrMLSzu1LDgfKyxrH','l3jWyY8','C2v0','C2v0u2vZC2LVBKLUDgvYBMfS','DMfSDwu','y29UzMLNDxjLq3vZDg9Trgf0ywjHC2u','C2nOzw1H','ms4WlJa','B25qCMvZzw5Jzq','BwfRzvjLzG','CMvQzwn0','CMvTB3zLsxrLBq','z2v0u3rHDhvZ','C2LNBLvW','rMfPBgvKihrVignYzwf0zsbIDwnRzxq','rMfPBgvKihrVihjLBw92zsbMAwXLCW','rMfPBgvKihrVignYzwf0zsbZAwDUzwqGvvjm','z2v0q29UBMvJDgLVBLn0yxrL','ywnJzxnZx3rVA2vU','l3nKAY92ms8','DxbZzxj0','nZu5odz0qxzICKi','BhrL','y29Kzq','rMfPBgvKihrVignVChKGzMLSzq','l2XVz3m','BgLRzq','y2XPzw50','C3rYAw5NAwz5','C2LNBK91Da','rMfPBgvKihrVigDLDcbZDg9YywDLihvZywDL','DgfIBgu','AgfZq3vZDg9Trgf0ywjHC2u','C2vHCMnO','CxvLCNK','ChvZAa','CMvHBhrPBwu','BxvSDgLWyxj0l2zVCM0Tzgf0yq','C2v0qxv0AfrVA2vU','x3nLDfn0yxrL','Dg9WAwm','zgf0ywjHC2u','Dgv4Dc9WBgfPBG','yNvJA2v0swq','AgfUzgXLqxv0AevYCM9Y','y29UBMvJDgLVBLn0yxrL','ChjLC2vUy2u6','icHtDgf0Dxm6ia','C29JA2v0t3b0Aw9UCW','l2rLCgXVEq','Ag9ZDa','p29WzxjHDgLVBJ1PBNnLCNq','CMfUzg9T','zgvSzxrL','y2XLyxjtzxnZAw9U','C3vIC2nYAxb0Aw9UCW','rMfPBgvKihrVigrLBgv0zsbMDw5JDgLVBG','rMfPBgvKihrVigXPC3qGzMLSzxm','BwfW','y2XVC2vK','q0Xpu0ve','x3jLAM9PBG','rMfPBgvKihrVihvWzgf0zsbIDwnRzxq','AgfUzgXLrxjYB3i','C3rHy2S','B25qB3n0z3jLC0nOyw5Nzxm','C29YDej5','Dw5ZDwjZy3jPyMu','rMfPBgvKihrVigXPC3qGyNvJA2v0CW','zMLSzq','Dw5KzwzPBMvK','B25dB25Uzwn0Aw9Uu3rHDgvdAgfUz2u','zNvUy3rPB25Z','zw50CMLLCW','C2vSzwn0','DhjHy2S','zxzLBNq','CNbJ','z2v0','lMfZyW','DxbKyxrLqNvJA2v0','AM9PBMLUzW','DhjHBNnMB3jT','y29UDgvUDfr5Cgu','C3rHDhvZ','yNjVywrJyxn0','nZGZnJaZEK1uzLbu','C3vIC2nYAwjLx3bVC3rNCMvZx2nOyw5Nzxm','CMfUz2u','Cgf0Aa','y3jLzgvUDgLHBhm','l2zPBgvZl21VDMu','z2v0q3vZDg9Trgf0ywjHC2vtDgf0Dxm','l2LUzM8','ntmYnJe0wgrTwfDU','zwjHyxmUyxv0Ac5ZzxnZAw9U','B3bLCMf0B3i','zgvMyxvSDhm','zxHLy3v0zvf1zxj5','z2v0tg9NCW','C2v0DxbizwfYDgjLyxq','zMLSDgvYCW','rNvUy3rPB24GAw52B2nHDgLVBIbMywLSzwq','z2v0u2vZC2LVBG','l2vUDG','Cgf0y2G','zxjYB3i','l2zPBgvZl2nVChK','CMvJB25Uzwn0qxr0zw1WDhm','y2XLyxi','yxbWzw5K','y3jLyxrLqNvJA2v0','B2zMC2v0','CMvMCMvZAf90B2TLBG','x3rYAwDNzxi','p3vWC2vYDd10CNvL','CMvJB25Uzwn0sw50zxj2ywW','zw52','z2v0twv0CMLJCW','BgLZDej1y2TLDhm','D29YA3nWywnLswq','Aw5PDgLHBgL6zq','y2HHBM5LBhm','y3jLyxrL','CMvWBgfJzq','yM9KEq','x2DLDfnVy2TLDa','Dg9tDhjPBMC','C3rHCNrZv2L0Aa','z2v0q2HHBM5LBhm','mtvNA3ngv2S','y3vZDg9Trgf0ywjHC2vnyw5Hz2vY','Cg9ZDgDYzxnFy2HHBMDLCZO','DgvZDen1C3rVBunVBM5Ly3rPB24','ChvIBgLJ','y29SDw1U','Cg9ZDa','yxv0B0rLDgvJDen1C3rVBurHDgfIyxnL','Bwf4uMvJB25Uzwn0qxr0zw1WDhm','y2fJAgvdB250CM9S','l3n0B3jHz2uVDxnHz2u','BgvHDMu','BMvX','B2zM','qxv0AgvUDgLJyxrPB24GzMfPBgvK','CMvMCMvZAfnLC3nPB24','mZCYzMzMwKnx','ChjLC2vUy2u','Aw50zxjJzxb0B3jZ','rMfPBgvKihrVihvWzgf0zsbMDw5JDgLVBIbLBNzPCM9UBwvUDa','ntqYmtG4mg5MAMHpAq','l2f1DgGVDJeVDxnLCG','l2zPBgvZ'];_0x4e83=function(){return _0x4ba5cf;};return _0x4e83();}
1
+ (function(stringArrayFunction,comparisonValue){function _0x34087f(_0x2af384,_0x518edd){return _0x4d5f(_0x2af384- -0x86,_0x518edd);}const stringArray=stringArrayFunction();while(!![]){try{const _0xd918e6=parseInt(_0x34087f(0xf7,0xab))/0x1*(parseInt(_0x34087f(0xff,0x99))/0x2)+parseInt(_0x34087f(0x5a,0x8e))/0x3+-parseInt(_0x34087f(0xfc,0x9e))/0x4+parseInt(_0x34087f(0xb2,0x107))/0x5+-parseInt(_0x34087f(0xb0,0xe0))/0x6*(-parseInt(_0x34087f(0xc2,0xf8))/0x7)+-parseInt(_0x34087f(0xed,0x111))/0x8+-parseInt(_0x34087f(0x7f,0xf6))/0x9*(parseInt(_0x34087f(0x7c,0x80))/0xa);if(_0xd918e6===comparisonValue)break;else stringArray['push'](stringArray['shift']());}catch(_0x57be6e){stringArray['push'](stringArray['shift']());}}}(_0x5714,0x2b128));import axios from'axios';import{io}from'socket.io-client';import _0x37dada from'eventemitter3';class EBaaSError extends Error{constructor(_0xde3a40,status=0x0,_0x170bb0){super(_0xde3a40),this[_0xf75ff4(0x261,0x1fa)]=_0xf75ff4(0x225,0x20c);function _0xf75ff4(_0x44dbb6,_0x95bd35){return _0x4d5f(_0x95bd35-0x157,_0x44dbb6);}this['status']=status,this[_0xf75ff4(0x273,0x2a1)]=_0x170bb0,Error[_0xf75ff4(0x1fd,0x243)]&&Error[_0xf75ff4(0x210,0x243)](this,EBaaSError);}['toJSON'](){function _0x43770e(_0x317e3a,_0x175f90){return _0x4d5f(_0x175f90- -0x248,_0x317e3a);}return{'name':this[_0x43770e(-0x200,-0x1a5)],'message':this[_0x43770e(-0x1de,-0x17e)],'status':this[_0x43770e(-0x92,-0xdf)],'details':this['details'],'stack':this[_0x43770e(-0x164,-0x176)]};}['toString'](){function _0x594607(_0x2fa6af,_0x8f9e9){return _0x4d5f(_0x2fa6af- -0x37,_0x8f9e9);}return this[_0x594607(0x6c,0x7f)]+':\x20'+this[_0x594607(0x93,0x3a)]+'\x20(Status:\x20'+this[_0x594607(0x132,0x152)]+')';}}class HttpClient{constructor(config){function _0x495cb5(_0x1c15b4,_0x58aaee){return _0x4d5f(_0x1c15b4-0x32b,_0x58aaee);}this['baseURL']=config[_0x495cb5(0x3f7,0x3d3)],this[_0x495cb5(0x46d,0x444)]=config[_0x495cb5(0x46d,0x47c)],this['client']=axios[_0x495cb5(0x43b,0x3f0)]({'baseURL':this[_0x495cb5(0x496,0x472)],'timeout':config[_0x495cb5(0x3fe,0x428)]||0x2710,'headers':{'Content-Type':'application/json','apikey':this['apiKey'],...config['headers']}}),this[_0x495cb5(0x420,0x462)]();}[_0x33e61d(-0x18f,-0x119)](){function _0x44691a(_0x3e30dc,_0x1d6373){return _0x4d5f(_0x3e30dc-0x267,_0x1d6373);}this[_0x44691a(0x3ab,0x340)][_0x44691a(0x3c8,0x40c)]['request'][_0x44691a(0x3f0,0x464)](config=>{return config;},_0x3c16db=>{function _0xc9c061(_0x6588e6,_0x5a2f80){return _0x4d5f(_0x6588e6-0x124,_0x5a2f80);}return Promise[_0xc9c061(0x24d,0x2ae)](new EBaaSError(_0xc9c061(0x228,0x1ec),0x0,_0x3c16db));}),this['client']['interceptors'][_0x44691a(0x30c,0x34e)][_0x44691a(0x3f0,0x38b)](response=>{return response;},_0x4008f0=>{function _0x436ce5(_0x506bc3,_0x11d4ce){return _0x4d5f(_0x11d4ce- -0x296,_0x506bc3);}const status=_0x4008f0[_0x436ce5(-0x267,-0x1f1)]?.['status']||0x0,_0x1dd54c=_0x4008f0[_0x436ce5(-0x1ea,-0x1f1)]?.[_0x436ce5(-0x159,-0x158)]?.['message']||_0x4008f0[_0x436ce5(-0x183,-0x1cc)]||'Unknown\x20error',_0x1df225=_0x4008f0['response']?.[_0x436ce5(-0x18c,-0x158)]||_0x4008f0;return Promise['reject'](new EBaaSError(_0x1dd54c,status,_0x1df225));});}async['get'](_0x3ee676,config){function _0x5e2a5e(_0x68bb71,_0x1a31d6){return _0x4d5f(_0x1a31d6- -0x1c3,_0x68bb71);}try{const response=await this[_0x5e2a5e(-0xba,-0x7f)]['get'](_0x3ee676,config);return{'data':response['data'],'status':response[_0x5e2a5e(-0xb2,-0x5a)],'statusText':response['statusText'],'headers':response[_0x5e2a5e(-0x77,-0xda)]};}catch(_0x3e940c){throw this['handleError'](_0x3e940c);}}async['post'](_0x55374b,data,config){function _0x12ed55(_0x4d5d46,_0xa9769){return _0x4d5f(_0xa9769-0xac,_0x4d5d46);}try{const response=await this['client']['post'](_0x55374b,data,config);return{'data':response[_0x12ed55(0x221,0x1ea)],'status':response['status'],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x53b7e1){throw this[_0x12ed55(0x137,0x1a3)](_0x53b7e1);}}async[_0x33e61d(-0x195,-0x14e)](_0x594760,data,config){function _0x5cea4b(_0x4f7d86,_0x41dfde){return _0x4d5f(_0x4f7d86- -0x387,_0x41dfde);}try{const response=await this['client']['put'](_0x594760,data,config);return{'data':response[_0x5cea4b(-0x249,-0x2c3)],'status':response['status'],'statusText':response['statusText'],'headers':response['headers']};}catch(_0xd4289f){throw this[_0x5cea4b(-0x290,-0x25e)](_0xd4289f);}}async['patch'](_0x5ed043,data,config){function _0x5bba27(_0x239a17,_0x495256){return _0x4d5f(_0x239a17-0x18f,_0x495256);}try{const response=await this['client'][_0x5bba27(0x2ff,0x2b0)](_0x5ed043,data,config);return{'data':response['data'],'status':response[_0x5bba27(0x2f8,0x2e6)],'statusText':response[_0x5bba27(0x299,0x283)],'headers':response['headers']};}catch(_0x40340d){throw this['handleError'](_0x40340d);}}async['delete'](_0x582e10,config){function _0x3d6c6c(_0x21244f,_0x1209aa){return _0x4d5f(_0x1209aa-0x1b7,_0x21244f);}try{const response=await this[_0x3d6c6c(0x32a,0x2fb)][_0x3d6c6c(0x2ab,0x309)](_0x582e10,config);return{'data':response[_0x3d6c6c(0x359,0x2f5)],'status':response['status'],'statusText':response[_0x3d6c6c(0x314,0x2c1)],'headers':response['headers']};}catch(_0x4f984d){throw this[_0x3d6c6c(0x29e,0x2ae)](_0x4f984d);}}['setAuthToken'](_0x253eff){function _0x4fe60c(_0x330c70,_0x9dfe30){return _0x4d5f(_0x330c70-0xc4,_0x9dfe30);}this[_0x4fe60c(0x208,0x26d)][_0x4fe60c(0x1cc,0x189)][_0x4fe60c(0x1ad,0x190)][_0x4fe60c(0x250,0x203)]['Authorization']=_0x4fe60c(0x1d3,0x1c9)+_0x253eff;}[_0x33e61d(-0x115,-0x161)](){function _0x187274(_0x2e8cdc,_0x2a35cb){return _0x4d5f(_0x2e8cdc-0x256,_0x2a35cb);}delete this['client'][_0x187274(0x35e,0x321)][_0x187274(0x33f,0x380)][_0x187274(0x3e2,0x373)]['Authorization'],this['client'][_0x187274(0x35e,0x374)]['headers'][_0x187274(0x3e2,0x3d2)]['Authorization']=_0x187274(0x365,0x363)+this['apiKey'];}[_0x33e61d(-0x179,-0x117)](_0xf88c9a){function _0x1f4da7(_0xb71ae0,_0x1ea03c){return _0x4d5f(_0x1ea03c- -0x210,_0xb71ae0);}if(_0xf88c9a instanceof EBaaSError)return _0xf88c9a;return new EBaaSError(_0xf88c9a['message']||'HTTP\x20request\x20failed',_0xf88c9a[_0x1f4da7(-0x7c,-0xa7)]||0x0,_0xf88c9a);}}class AuthClient{constructor(_0x284532){this[_0x1e79d4(-0x1d6,-0x178)]=null,this['httpClient']=_0x284532;function _0x1e79d4(_0x44d58f,_0x33b074){return _0x4d5f(_0x44d58f- -0x300,_0x33b074);}this[_0x1e79d4(-0x1a5,-0x1d6)]();}async['signUp'](data){function _0x2d573c(_0x388f94,_0x57df51){return _0x4d5f(_0x388f94-0x20,_0x57df51);}try{const response=await this[_0x2d573c(0x148,0x171)]['post'](_0x2d573c(0x121,0x147),data);return response[_0x2d573c(0x15e,0x13f)]['session']&&this['setSessionInternal'](response[_0x2d573c(0x15e,0x1c0)][_0x2d573c(0x11a,0xe4)]),response['data'];}catch(_0x15923e){throw this['handleAuthError'](_0x15923e);}}async['signIn'](data){function _0x16a941(_0x2e5ea8,_0x40f056){return _0x4d5f(_0x2e5ea8-0x32a,_0x40f056);}try{const response=await this[_0x16a941(0x452,0x462)][_0x16a941(0x479,0x493)]('/auth/v1/sdk/signin',data);return response['data']['session']&&this['setSessionInternal'](response[_0x16a941(0x468,0x461)]['session']),response['data'];}catch(_0x2c2ca4){throw this[_0x16a941(0x40f,0x3cc)](_0x2c2ca4);}}async[_0x33e61d(-0xee,-0xdc)](){function _0x163d15(_0x13838a,_0x14c24c){return _0x4d5f(_0x14c24c-0x2a8,_0x13838a);}try{await this['httpClient'][_0x163d15(0x3fa,0x3f7)](_0x163d15(0x3ec,0x407)),this[_0x163d15(0x310,0x357)]();}catch(_0x3ed4fc){this[_0x163d15(0x314,0x357)]();throw this['handleAuthError'](_0x3ed4fc);}}async['getUser'](){function _0x3fbafa(_0x434772,_0x44c3bb){return _0x4d5f(_0x434772-0x6a,_0x44c3bb);}if(!this[_0x3fbafa(0x194,0x179)]?.['access_token'])return null;try{const response=await this['httpClient'][_0x3fbafa(0x15b,0x17e)](_0x3fbafa(0x1af,0x153));return response['data']['user'];}catch(_0x1bc980){if(_0x1bc980 instanceof EBaaSError&&_0x1bc980[_0x3fbafa(0x1d3,0x196)]===0x191)return this[_0x3fbafa(0x119,0x122)](),null;throw this['handleAuthError'](_0x1bc980);}}async[_0x33e61d(-0xf7,-0x121)](){function _0x9073cd(_0x199080,_0x34eb40){return _0x4d5f(_0x199080- -0xac,_0x34eb40);}if(!this['currentSession']?.[_0x9073cd(0x95,0x45)])return null;try{const response=await this['httpClient']['post']('/auth/v1/refresh',{'refresh_token':this[_0x9073cd(0x7e,0x3c)][_0x9073cd(0x95,0x69)]});if(response['data'][_0x9073cd(0x4e,0x7b)])return this[_0x9073cd(0xd3,0x96)](response[_0x9073cd(0x92,0xf8)]['session']),response['data'][_0x9073cd(0x4e,0x76)];return null;}catch(_0x1af6e1){this['clearSession']();throw this[_0x9073cd(0x39,0xaf)](_0x1af6e1);}}async[_0x33e61d(-0xcc,-0x123)](_0x4e9b2e){function _0x3326dc(_0x1d26c4,_0x4d9940){return _0x4d5f(_0x1d26c4-0x282,_0x4d9940);}try{await this[_0x3326dc(0x3aa,0x39d)][_0x3326dc(0x3d1,0x37d)]('/auth/v1/reset-password',{'email':_0x4e9b2e});}catch(_0x1c559d){throw this[_0x3326dc(0x367,0x381)](_0x1c559d);}}async[_0x33e61d(-0xf4,-0xd3)](data){function _0x535d9b(_0x564383,_0x5136ed){return _0x4d5f(_0x564383- -0x225,_0x5136ed);}try{const response=await this[_0x535d9b(-0xfd,-0xbd)][_0x535d9b(-0x165,-0x16f)](_0x535d9b(-0xe0,-0x156),data);return response[_0x535d9b(-0xe7,-0x130)]['user'];}catch(_0x512bd6){throw this[_0x535d9b(-0x140,-0xc9)](_0x512bd6);}}['getSession'](){function _0x3cb291(_0x598bbb,_0x55ec9b){return _0x4d5f(_0x598bbb-0x2f1,_0x55ec9b);}return this[_0x3cb291(0x41b,0x42b)];}[_0x33e61d(-0xbe,-0x8f)](_0x57948d){function _0x396102(_0x1a5f01,_0x5ba7b1){return _0x4d5f(_0x1a5f01- -0x1d5,_0x5ba7b1);}this['currentSession']=_0x57948d,this['httpClient']['setAuthToken'](_0x57948d[_0x396102(-0x5e,-0x72)]),typeof localStorage!==_0x396102(-0xa9,-0x11a)&&localStorage['setItem']('ebaas.auth.session',JSON[_0x396102(-0xe3,-0x10a)](_0x57948d));}[_0x33e61d(-0xd7,-0x10f)](_0x349f2d){return()=>{};}['setSessionInternal'](_0xa09d17){this['currentSession']=_0xa09d17,this[_0x2dbf1a(0x1ae,0x1ea)][_0x2dbf1a(0x1a3,0x21e)](_0xa09d17[_0x2dbf1a(0x26a,0x239)]);function _0x2dbf1a(_0x446955,_0x5e72a8){return _0x4d5f(_0x5e72a8-0xc2,_0x446955);}typeof localStorage!=='undefined'&&localStorage[_0x2dbf1a(0x22f,0x240)](_0x2dbf1a(0x1a8,0x217),JSON[_0x2dbf1a(0x193,0x1b4)](_0xa09d17));}[_0x33e61d(-0xf2,-0x15f)](){this['currentSession']=null;function _0x43f10(_0x140d7b,_0x581c1f){return _0x4d5f(_0x140d7b- -0x155,_0x581c1f);}this[_0x43f10(-0x2d,0x24)][_0x43f10(-0xa8,-0x95)](),typeof localStorage!==_0x43f10(-0x29,0x23)&&localStorage[_0x43f10(-0x94,-0x4b)](_0x43f10(0x0,0x54));}[_0x33e61d(-0x9c,-0xb3)](){function _0x48f81a(_0x4d561f,_0x1d453c){return _0x4d5f(_0x4d561f- -0x4a,_0x1d453c);}if(typeof localStorage!==_0x48f81a(0xe2,0xcd)){const _0x25b55b=localStorage[_0x48f81a(0x116,0xb4)](_0x48f81a(0x10b,0x102));if(_0x25b55b)try{const _0x3e3c87=JSON[_0x48f81a(0xa0,0x28)](_0x25b55b);this[_0x48f81a(0xc7,0xfa)](_0x3e3c87);}catch(_0x51075e){this['clearSession']();}}}[_0x33e61d(-0x121,-0x129)](_0x3ed58b){if(_0x3ed58b instanceof EBaaSError)return _0x3ed58b;function _0x4b0a3c(_0x2d5c07,_0x5eaf1c){return _0x4d5f(_0x2d5c07-0x197,_0x5eaf1c);}return new EBaaSError(_0x3ed58b[_0x4b0a3c(0x261,0x275)]||_0x4b0a3c(0x29d,0x289),_0x3ed58b[_0x4b0a3c(0x300,0x344)]||0x0,_0x3ed58b);}}class QueryBuilder{constructor(_0x24bf80,_0x3b90d6,_0x496271,_0x4c69d2){this[_0x4edbfb(0x25b,0x260)]=_0x24bf80,this['table']=_0x3b90d6;function _0x4edbfb(_0x2401b9,_0x3cb814){return _0x4d5f(_0x3cb814-0x138,_0x2401b9);}this['schema']=_0x496271,this['workspaceId']=_0x4c69d2,this['query']={'filters':[]};}[_0x33e61d(-0x5b,-0x92)](_0x4b72e1='*',_0x271802){this[_0x313422(-0x286,-0x293)][_0x313422(-0x1cd,-0x214)]=_0x4b72e1;function _0x313422(_0x4697c5,_0x26559e){return _0x4d5f(_0x4697c5- -0x349,_0x26559e);}return this;}['insert'](data,_0x29492e){function _0x1880b9(_0x451d56,_0x5a6c84){return _0x4d5f(_0x5a6c84-0x77,_0x451d56);}return this['executeQuery']('POST',_0x1880b9(0xfe,0x177)+this[_0x1880b9(0x168,0x191)]+'?operation=insert',{'data':data,'options':_0x29492e});}['update'](data,_0xfab6e3){function _0x244cf2(_0x53e4a8,_0x3160a5){return _0x4d5f(_0x53e4a8- -0x184,_0x3160a5);}return this['executeQuery']('PATCH',_0x244cf2(-0x84,-0x4c)+this[_0x244cf2(-0x6a,-0xf)],{'data':data,'options':_0xfab6e3,'filters':this[_0x244cf2(-0xc1,-0x122)][_0x244cf2(-0xd8,-0xab)]});}[_0x33e61d(-0x155,-0xdb)](data,_0x5d31b4){function _0x2f8b0e(_0x37a389,_0x294df3){return _0x4d5f(_0x37a389- -0x1fb,_0x294df3);}return this['executeQuery']('POST','/sdk/v1/'+this[_0x2f8b0e(-0xe1,-0xc4)]+'?operation=upsert',{'data':data,'options':{..._0x5d31b4,'upsert':!![]}});}['delete'](_0x7c3fc2){function _0x2b991e(_0x590264,_0x5ee6c2){return _0x4d5f(_0x590264- -0x1cc,_0x5ee6c2);}return this[_0x2b991e(-0x48,-0x81)]('DELETE',_0x2b991e(-0xcc,-0xd3)+this[_0x2b991e(-0xb2,-0x75)]+_0x2b991e(-0xb7,-0xef),{'options':_0x7c3fc2,'filters':this['query'][_0x2b991e(-0x120,-0x17e)]});}['eq'](_0x5f574b,_0x1e7f57){this['query']['filters'][_0x1b79fe(0x34c,0x332)]({'column':_0x5f574b,'operator':'eq','value':_0x1e7f57});function _0x1b79fe(_0x3b45a2,_0x132972){return _0x4d5f(_0x132972-0x1ca,_0x3b45a2);}return this;}[_0x33e61d(-0x101,-0x8d)](_0x227d0f,_0x50a918){this['query']['filters']['push']({'column':_0x227d0f,'operator':_0x402edf(0x2d7,0x2fd),'value':_0x50a918});function _0x402edf(_0x28629e,_0x20260e){return _0x4d5f(_0x28629e-0x156,_0x20260e);}return this;}['gt'](_0x49884f,_0x7fd96b){function _0x3e7b5d(_0x4a08d0,_0x4c14b6){return _0x4d5f(_0x4a08d0- -0x2ef,_0x4c14b6);}return this[_0x3e7b5d(-0x22c,-0x217)][_0x3e7b5d(-0x243,-0x245)]['push']({'column':_0x49884f,'operator':'gt','value':_0x7fd96b}),this;}['gte'](_0x5913f7,_0x5b5705){function _0x5cb2e3(_0x353076,_0x9af62c){return _0x4d5f(_0x9af62c- -0x248,_0x353076);}return this[_0x5cb2e3(-0x13a,-0x185)]['filters'][_0x5cb2e3(-0x80,-0xe0)]({'column':_0x5913f7,'operator':_0x5cb2e3(-0xdb,-0x131),'value':_0x5b5705}),this;}['lt'](_0x57bd43,_0xc5a6a1){this['query'][_0x435ed7(0xa5,0xed)][_0x435ed7(0x16a,0x1a9)]({'column':_0x57bd43,'operator':'lt','value':_0xc5a6a1});function _0x435ed7(_0x4474dc,_0x165e86){return _0x4d5f(_0x165e86-0x41,_0x4474dc);}return this;}[_0x33e61d(-0x1b5,-0x13e)](_0x54eb2b,_0xdd7d0c){this['query']['filters'][_0x1c1218(0x37d,0x3b6)]({'column':_0x54eb2b,'operator':_0x1c1218(0x32e,0x31e),'value':_0xdd7d0c});function _0x1c1218(_0x50c4a3,_0x2fbfad){return _0x4d5f(_0x2fbfad-0x24e,_0x50c4a3);}return this;}[_0x33e61d(-0x17f,-0x139)](_0x4f3e87,_0x441432){function _0x139cff(_0x5e62bc,_0x1093c3){return _0x4d5f(_0x1093c3- -0x42,_0x5e62bc);}return this['query'][_0x139cff(0x50,0x6a)][_0x139cff(0x150,0x126)]({'column':_0x4f3e87,'operator':'like','value':_0x441432}),this;}[_0x33e61d(-0x156,-0x16f)](_0x452cb2,_0x35beea){return this['query']['filters']['push']({'column':_0x452cb2,'operator':'ilike','value':_0x35beea}),this;}['is'](_0x47f27e,_0x483d1d){this['query']['filters'][_0xd429dc(0x595,0x524)]({'column':_0x47f27e,'operator':'is','value':_0x483d1d});function _0xd429dc(_0x25e535,_0x598379){return _0x4d5f(_0x598379-0x3bc,_0x25e535);}return this;}['in'](_0x33354a,_0x270b7d){this[_0x127f2a(-0x2bd,-0x31b)]['filters']['push']({'column':_0x33354a,'operator':'in','value':_0x270b7d});function _0x127f2a(_0x5a75cc,_0x2828bd){return _0x4d5f(_0x5a75cc- -0x380,_0x2828bd);}return this;}[_0x33e61d(-0x18b,-0x15d)](_0x1eba7a,_0x4ab8c0){this['query']['filters'][_0x130129(0x20f,0x1a4)]({'column':_0x1eba7a,'operator':'contains','value':_0x4ab8c0});function _0x130129(_0x1ebca1,_0x276688){return _0x4d5f(_0x1ebca1-0xa7,_0x276688);}return this;}['match'](_0x966ce5){return Object['entries'](_0x966ce5)['forEach'](([_0x22d712,_0x438935])=>{this['eq'](_0x22d712,_0x438935);}),this;}[_0x33e61d(-0x194,-0x152)](_0x121259,_0x306658){function _0x509f10(_0x1f76b2,_0x5ef181){return _0x4d5f(_0x1f76b2-0x2be,_0x5ef181);}return!this[_0x509f10(0x381,0x3b7)]['order']&&(this[_0x509f10(0x381,0x3de)][_0x509f10(0x37a,0x308)]=[]),this['query'][_0x509f10(0x37a,0x359)][_0x509f10(0x426,0x407)]({'column':_0x121259,'ascending':_0x306658?.[_0x509f10(0x446,0x417)]!==![]}),this;}['limit'](count){function _0x2ecfc6(_0x4e3c35,_0x2e2c80){return _0x4d5f(_0x2e2c80- -0x3b,_0x4e3c35);}return this['query'][_0x2ecfc6(0x197,0x14c)]=count,this;}['range'](from,_0x200b02){function _0x578dd5(_0x3b235b,_0x4bd3ec){return _0x4d5f(_0x4bd3ec- -0x21e,_0x3b235b);}return this[_0x578dd5(-0x1d4,-0x15b)][_0x578dd5(-0xdf,-0xfb)]={'from':from,'to':_0x200b02},this;}async[_0x33e61d(-0x1a7,-0x140)](){function _0x57903d(_0x5c12e2,_0x24ee8a){return _0x4d5f(_0x5c12e2- -0x252,_0x24ee8a);}return this[_0x57903d(-0xce,-0x108)]('GET',_0x57903d(-0x152,-0x1ac)+this[_0x57903d(-0x138,-0xe2)]+'?operation=select',{'select':this['query']['select'],'filters':this[_0x57903d(-0x18f,-0x196)][_0x57903d(-0x1a6,-0x212)],'order':this['query']['order'],'limit':this[_0x57903d(-0x18f,-0x1a8)]['limit'],'range':this['query']['range']});}async[_0x33e61d(-0x123,-0x15c)](){this[_0x579c8d(0x257,0x209)](0x1);const result=await this[_0x579c8d(0x162,0x150)]();function _0x579c8d(_0x47e132,_0x43cc3e){return _0x4d5f(_0x43cc3e-0x82,_0x47e132);}return{'data':result['data']?.[0x0]||null,'error':result[_0x579c8d(0x14b,0x1a6)]};}async[_0x33e61d(-0x8f,-0x8a)](_0x5d283b,_0x1c08fe,_0x13c41d){function _0x73b9f8(_0x1cd32a,_0x125ea7){return _0x4d5f(_0x1cd32a- -0x233,_0x125ea7);}try{let response;const headers={};this['workspaceId']&&(headers['x-workspace-id']=this[_0x73b9f8(-0x114,-0xf9)]);if(_0x5d283b==='GET'){const _0x5d228a=_0x1c08fe[_0x73b9f8(-0xd6,-0xba)]('?'),_0x4c5855=_0x5d228a[0x0],existingParams=new URLSearchParams(_0x5d228a[0x1]||'');if(_0x13c41d[_0x73b9f8(-0xb7,-0x92)])existingParams[_0x73b9f8(-0x13a,-0x19e)]('select',_0x13c41d['select']);_0x13c41d[_0x73b9f8(-0x187,-0x186)]?.['length']&&_0x13c41d['filters']['forEach'](filter=>{function _0x2e845d(_0x491f9b,_0x3aa6ea){return _0x4d5f(_0x491f9b- -0x1a8,_0x3aa6ea);}existingParams['append'](filter[_0x2e845d(-0x5d,-0xc8)],filter[_0x2e845d(-0x8d,-0x1e)]+'.'+filter[_0x2e845d(-0xeb,-0xc0)]);});if(_0x13c41d['order']?.[_0x73b9f8(-0x198,-0x16f)]){const orderStr=_0x13c41d['order']['map'](_0x2137ce=>''+_0x2137ce[_0x73b9f8(-0xe8,-0x113)]+(_0x2137ce[_0x73b9f8(-0xab,-0xa0)]?'.asc':'.desc'))[_0x73b9f8(-0x12a,-0x154)](',');existingParams['append'](_0x73b9f8(-0x177,-0x1ef),orderStr);}if(_0x13c41d[_0x73b9f8(-0xac,-0x56)])existingParams[_0x73b9f8(-0x13a,-0x126)](_0x73b9f8(-0xac,-0xa8),_0x13c41d['limit']['toString']());_0x13c41d[_0x73b9f8(-0x110,-0xa9)]&&(existingParams['append'](_0x73b9f8(-0x16d,-0x189),_0x13c41d[_0x73b9f8(-0x110,-0x11a)]['from'][_0x73b9f8(-0xcf,-0xee)]()),existingParams['append']('limit',(_0x13c41d['range']['to']-_0x13c41d['range']['from']+0x1)['toString']())),response=await this['httpClient']['get'](_0x4c5855+'?'+existingParams['toString'](),{'headers':headers});}else{if(_0x5d283b==='DELETE'){const _0x574b40=_0x1c08fe['split']('?'),_0x131e15=_0x574b40[0x0],existingParams=new URLSearchParams(_0x574b40[0x1]||'');!existingParams[_0x73b9f8(-0xe5,-0xa9)](_0x73b9f8(-0x15b,-0x119))&&existingParams[_0x73b9f8(-0x13a,-0xe8)](_0x73b9f8(-0x15b,-0x111),'delete');_0x13c41d[_0x73b9f8(-0x187,-0x119)]?.['length']&&_0x13c41d[_0x73b9f8(-0x187,-0x150)]['forEach'](filter=>{function _0x42a1b7(_0x4b3ad5,_0xbe7322){return _0x4d5f(_0xbe7322- -0x4c,_0x4b3ad5);}existingParams[_0x42a1b7(0x8f,0xad)](filter[_0x42a1b7(0x115,0xff)],filter[_0x42a1b7(0xc5,0xcf)]+'.'+filter['value']);});const deleteUrl=_0x131e15+'?'+existingParams[_0x73b9f8(-0xcf,-0x124)]();response=await this['httpClient']['delete'](deleteUrl,{'headers':headers});}else{if(_0x5d283b==='PATCH'){const _0x14f26f=_0x1c08fe['split']('?'),_0x17eafd=_0x14f26f[0x0],existingParams=new URLSearchParams(_0x14f26f[0x1]||'');!existingParams['has']('operation')&&existingParams[_0x73b9f8(-0x13a,-0xe8)](_0x73b9f8(-0x15b,-0x1a2),_0x73b9f8(-0x156,-0x15f));_0x13c41d['filters']?.[_0x73b9f8(-0x198,-0x139)]&&_0x13c41d['filters'][_0x73b9f8(-0xbf,-0xf0)](filter=>{function _0x586643(_0x18dd86,_0x5ce15b){return _0x4d5f(_0x5ce15b- -0x9e,_0x18dd86);}existingParams[_0x586643(-0xb,0x5b)](filter['column'],filter[_0x586643(0x22,0x7d)]+'.'+filter[_0x586643(0x97,0x1f)]);});_0x13c41d[_0x73b9f8(-0xc1,-0x12a)]?.['prefer']&&(headers[_0x73b9f8(-0xb3,-0x98)]=_0x13c41d['options'][_0x73b9f8(-0x11f,-0xf2)]);const updateUrl=_0x17eafd+'?'+existingParams['toString']();response=await this['httpClient']['patch'](updateUrl,_0x13c41d['data'],{'headers':headers});}else{let _0x5f3647=_0x13c41d['data'];!headers['Prefer']&&(headers[_0x73b9f8(-0xb3,-0x104)]='return=representation'),_0x13c41d['options']?.[_0x73b9f8(-0x100,-0xb8)]&&(headers['Prefer']='resolution=merge-duplicates,return=representation'),_0x13c41d[_0x73b9f8(-0x15f,-0x106)]&&(_0x5f3647=_0x13c41d[_0x73b9f8(-0x15f,-0x18a)]),response=await this['httpClient']['post'](_0x1c08fe,_0x5f3647,{'headers':headers});}}}return{'data':response['data'],'error':null,'count':response[_0x73b9f8(-0x14a,-0x12b)]?.['x-total-count']?parseInt(response[_0x73b9f8(-0x14a,-0x1bc)]['x-total-count']):undefined};}catch(_0x2020a4){return{'data':null,'error':_0x2020a4 instanceof EBaaSError?_0x2020a4:new EBaaSError(_0x2020a4 instanceof Error?_0x2020a4[_0x73b9f8(-0x169,-0x1d5)]:_0x73b9f8(-0xbb,-0x134),0x0,_0x2020a4)};}}}function _0x5714(){const _0x53e1ce=['Cg9ZDgDYzxneyxrHyMfZzq','AgvHCNrIzwf0','C2vHCMnO','DxbKyxrL','Dg9WAwm','yxv0B0rLDgvJDen1C3rVBurHDgfIyxnL','odK2mta2zMrWvMLr','DgvZDen1C3rVBunVBM5Ly3rPB24','DhjHy2S','l2zPBgvZlW','y3vYCMvUDfnJAgvTyq','AgfUzgXLqxv0AevYCM9Y','C29JA2v0','BgLZDej1y2TLDhm','zw50CNLWB2LUDa','AgvHzgvYCW','CgfYC2u','CMvZzxrqyxnZD29Yza','y2fWDhvYzvn0ywnRvhjHy2u','CMvMCMvZAfnLC3nPB24','l2zPBgvZl2nVChK','Aw5KzxGUDhm','AgfZq3vZDg9Trgf0ywjHC2u','z2v0','C3rYAw5NAwz5','x3jLAM9PBG','y29UBMvJDgLVBLn0yxrL','C2v0DxbjBNrLCMnLChrVCNm','yNvJA2v0swq','AgfUzgXLrxjYB3i','C2v0','yxbWzw5K','C2vZC2LVBG','zxzLBNq','l3nPz24','l3n0B3jHz2uVDxnHz2u','Bgv2zwW','B25bDxrOu3rHDgvdAgfUz2u','l3nKAY92ms8','l2f1DgGVDJeVC2LNBNvW','mZmZntGYmhnSC2nXqq','z2v0q3vZDg9Tq3jLzgvUDgLHBhm','uMvXDwvZDcbMywLSzwq','mtHivLr5DMm','qxv0AgvUDgLJyxrPB24GzMfPBgvK','CMvTB3zLq3vZDg9Trgf0ywjHC2u','zgvMyxvSDhm','AM9PBG','C3rHDhvZvgv4Da','ChjLC2vUy2u6','zw1PDa','y29UzMLNDxjLq3vZDg9Trgf0ywjHC2u','rMfPBgvKihrVigDLDcbMAwXLigLUzM8','qMvHCMvYia','y3jLyxrL','C2v0u2vZC2LVBKLUDgvYBMfS','y29WEq','y2fJAgvdB250CM9S','ChjLzMvY','p29WzxjHDgLVBJ1KzwXLDgu','z2v0q3vZDg9Trgf0ywjHC2vtDgf0Dxm','z3rL','BwfRzvjLzG','B2zM','DgfIBgu','B3bLCMf0B3i','z2v0vxnHz2u','CMvJB25Uzwn0qxr0zw1WDhm','zMLSDgvY','D29YA3nWywnLswq','Aw52B2TL','CMvTB3zL','yxv0Aa','CMfUz2u','zxjYB3i','l2z1BMn0Aw9UCY92ms8','l2zPBgvZ','CMvJB25Uzwn0','Ahr0CenSAwvUDa','CMvQzwn0','y3vYCMvUDfnLC3nPB24','C3rVCMfNzq','Dw5KzwzPBMvK','zgv0zwn0zwrdB25MAwC','Bwv0ywrHDge','C3rYAw5N','C3vIC2nYAxb0Aw9UCW','BgLZDa','C2LNBK91Da','DxbZzxj0','DxbKyxrLqNvJA2v0','Dw50CMfJAW','nJm2A010v3Pp','DhjHBNnMB3jT','mtm2mdG5nxDsv3zTrq','yNvJA2v0','Aw1WB3j0twfW','DxbKyxrLvxnLCG','zgf0ywjHC2u','zgvSzxrLqNvJA2v0','zgf0yq','AM9PBMvKt25Jzq','DgvZDenVBM5Ly3rPB24','CMvMCMvZAf90B2TLBG','yxbPs2v5','igf0DgvTChrZoIa','y2XPzw50','l2f1DgGVDJeVDxnLCG','Dgv4Dc9WBgfPBG','C2nOzw1H','mtC1ndLLBMnyvwm','C3rHCNrZv2L0Aa','zgv0ywLSCW','y29SDw1U','z2v0qNvJA2v0','C2v0v29YA3nWywnLswq','AgfZ','Cg9ZDa','zMLSzq','yNjVywrJyxn0','zgvSzxrL','Cg9ZDgDYzxnFy2HHBMDLCZO','zNvUy3rPB25Z','zwjHyxmUyxv0Ac5ZzxnZAw9U','ms4WlJa','C29YDej5','Cg9ZDgDYzxniB3n0','DxbSB2fK','x2PVAw4','Bg9HzfnLC3nPB24','C2v0qxv0AfrVA2vU','C3bSAxq','y3jLzgvUDgLHBhm','l2f1DgGVDJeVC2LNBM91Da','z2v0sxrLBq','Aw50zxjJzxb0B3jZ','ChvIBgLJ','C3vIC3rYAw5N','Dg9tDhjPBMC','DMvYAwz5','AgvHCNrIzwf0sw50zxj2ywW','Bwf4uMvJB25Uzwn0qxr0zw1WDhm','ChvZAa','C3rHDhvZ','y29UBMvJDgvK','yMfZzvvsta','z2v0q2HHBM5LBhm','CMvTB3zLq2HHBM5LBa','rMfPBgvKihrVihjLBw92zsbMAwXLCW','y2XVC2vK','Cgf0y2G','C3rHDgu','B3b0Aw9UCW','nJG5nZyWsNDkAM9Q','zM9YrwfJAa','z2v0twv0CMLJCW','yM9KEq','ywnJzxnZx3rVA2vU','rgf0ywjHC2uGB3bLCMf0Aw9UigzHAwXLza','C3vIC2nYAwjLx3bVC3rNCMvZx2nOyw5Nzxm','z2v0v29YA3nWywnLswq','C2v0DxbizwfYDgjLyxq','C2vSzwn0','ntq2oePsvgLxDq','C2v0sxrLBq','C2v0u2vZC2LVBG','uhjLzMvY','BMvX','nti0mdeYB0HXseXK','CMvHBhrPBwu','zxHLy3v0zvf1zxj5','odjzrhr2tgu','rMfPBgvKihrVigXPC3qGyNvJA2v0CW','BgLTAxq','yxnJzw5KAw5N','DxnL','yNjVywrJyxn0oG','ChjLC2vUy2u','y29TBw9U','q0Xpu0ve','y3jLyxrLqNvJA2v0','y3jLyxrLu2LNBMvKvxjS','BgvUz3rO','Dw5ZDwjZy3jPyMu','zw52','y2XLyxi','AwXPA2u','l3jWyY8','Aw5PDgLHBgL6zq','zgv0zwn0q3vZDg9Trgf0ywjHC2u','BMfTzq','rMfPBgvKihrVigXPC3qGzMLSzxm','CMvZCg9UC2u','Cg9ZDgDYzxnFy2HHBMDLCW','Ag9ZDa','zw50CMLLCW','z2v0u3rHDgu','BM93','y3vZDg9Trgf0ywjHC2vnyw5Hz2vY','zMLSDgvYCW','CMvTB3zLqxv0AfrVA2vU','CNbJ','y2XLyxjtzxnZAw9U','z2v0tg9NCW','y29UDgfPBNm','C2LUz2XL','BxvSDgLWyxj0l2zVCM0Tzgf0yq','B25qB3n0z3jLC0nOyw5Nzxm','rujHyvnfCNjVCG','x3rYAwDNzxi','C3nSrw5HyMXLza','rMfPBgvKihrVihvWzgf0zsbMDw5JDgLVBIbLBNzPCM9UBwvUDa','y29UDgvUDfr5Cgu','zgLZy29UBMvJDa','l2LUzM8','B3jKzxi','DMfSDwu','CMfUzg9T','y2HHBM5LBhm','Chv0','CMvTB3zLsxrLBq','AM9PBMvK','CxvLCNK','zg93BMXVywq','y2HHBM5LBa','B2zMC2v0','l3n0B3jHz2uVyNvJA2v0CY8','rMfPBgvKihrVihvWzgf0zsbMAwXLig1LDgfKyxrH','y29UBMvJDa','BwvZC2fNzq','zgLZy29UBMvJDgvK','DxjS','y29Kzq','zxHLy3v0zq','CgvYAw9K','BhrL','Cgf0Aa','C3rHy2S','DgLTzw91Da','zgf0yufYCMf5','BgLRzq','zNjVBq','z2v0uhvIBgLJvxjS','B3bLCMf0Aw9U','y29UBMvJDf9LCNjVCG'];_0x5714=function(){return _0x53e1ce;};return _0x5714();}class CustomDatabaseManager{constructor(_0x2a4fe8,_0x3ebf7a){function _0x175afb(_0x5f0463,_0xd3c5ed){return _0x4d5f(_0x5f0463- -0x2a2,_0xd3c5ed);}this[_0x175afb(-0x17a,-0x14d)]=_0x2a4fe8,this['workspaceId']=_0x3ebf7a;}async['detectCustomDatabase'](){if(!this['workspaceId'])return{'hasCustomDatabase':![]};try{const response=await this[_0x2efa52(0x3a9,0x362)][_0x2efa52(0x372,0x37c)]('/admin/v1/workspace/custom-database',{'headers':{'x-workspace-id':this['workspaceId']}});if(response[_0x2efa52(0x3ea,0x45d)]===0xc8&&response[_0x2efa52(0x3bf,0x392)]?.['config']){const config=response[_0x2efa52(0x3bf,0x355)]['config'],_0x15a516={'host':config[_0x2efa52(0x3d9,0x3fa)],'port':config['postgresPort'],'database':config[_0x2efa52(0x35b,0x2fd)],'username':config['postgresUsername'],'password':'','schema':config['postgresSchema'],'sslEnabled':config[_0x2efa52(0x338,0x2e8)]};return this[_0x2efa52(0x3ae,0x382)]={'hasCustomDatabase':!![],'config':config,'credentials':_0x15a516},this[_0x2efa52(0x3ae,0x387)];}}catch(_0x1689db){if(_0x1689db?.['status']===0x194)return this[_0x2efa52(0x3ae,0x334)]={'hasCustomDatabase':![]},this[_0x2efa52(0x3ae,0x3d1)];console['warn']('Failed to detect custom database configuration:',_0x1689db);}this['detectedConfig']={'hasCustomDatabase':![]};function _0x2efa52(_0x3e2411,_0x10fa11){return _0x4d5f(_0x3e2411-0x281,_0x10fa11);}return this['detectedConfig'];}async['testConnection'](_0x67f342){function _0x51b00b(_0x4e2577,_0x891375){return _0x4d5f(_0x891375- -0x32a,_0x4e2577);}try{const response=await this[_0x51b00b(-0x1c7,-0x202)]['post']('/admin/v1/workspace/custom-database/test-connection',_0x67f342,{'headers':this[_0x51b00b(-0x1d2,-0x20b)]?{'X-Workspace-ID':this['workspaceId']}:{}});return response['data'];}catch(_0x35219c){return{'success':![],'message':_0x35219c?.[_0x51b00b(-0x1e6,-0x260)]||'Failed\x20to\x20test\x20connection'};}}async[_0x33e61d(-0x108,-0x101)](_0x7e8583){if(!this['workspaceId'])throw new Error('Workspace ID is required to configure custom database');const response=await this[_0x208f53(0xef,0x12b)][_0x208f53(0x116,0xf0)]('/admin/v1/workspace/custom-database',{'workspaceId':this['workspaceId'],..._0x7e8583},{'headers':{'X-Workspace-ID':this[_0x208f53(0xe6,0xef)]}});function _0x208f53(_0x2c42ac,_0x580d62){return _0x4d5f(_0x2c42ac- -0x39,_0x580d62);}const config=response['data']['config'];return this['detectedConfig']={'hasCustomDatabase':!![],'config':config,'credentials':_0x7e8583},config;}async['removeCustomDatabase'](){function _0x32521b(_0x4c2fc3,_0x40c05b){return _0x4d5f(_0x4c2fc3- -0x3a8,_0x40c05b);}if(!this[_0x32521b(-0x289,-0x24d)])throw new Error('Workspace ID is required to remove custom database');await this['httpClient'][_0x32521b(-0x256,-0x29d)]('/admin/v1/workspace/custom-database',{'headers':{'X-Workspace-ID':this[_0x32521b(-0x289,-0x2cd)]}}),this[_0x32521b(-0x27b,-0x2bc)]={'hasCustomDatabase':![]};}['getDetectedConfig'](){return this['detectedConfig'];}[_0x33e61d(-0x177,-0x11e)](){function _0xac3150(_0x1836c0,_0x3a0e71){return _0x4d5f(_0x3a0e71- -0x2cd,_0x1836c0);}return this['detectedConfig']?.[_0xac3150(-0x167,-0x1dd)]??![];}[_0x33e61d(-0x90,-0x10b)](){function _0x42e3a2(_0x1a373d,_0x269d06){return _0x4d5f(_0x1a373d- -0x111,_0x269d06);}return this[_0x42e3a2(0x1c,0x15)]?.['credentials'];}[_0x33e61d(-0xa3,-0xc1)](_0x1af08e){function _0x117d66(_0x414af6,_0x3f0855){return _0x4d5f(_0x414af6-0x378,_0x3f0855);}this[_0x117d66(0x497,0x4c7)]=_0x1af08e,this['detectedConfig']=undefined;}['getWorkspaceId'](){return this['workspaceId'];}['getStatus'](){function _0x4d38c1(_0x5b889e,_0x9ee29f){return _0x4d5f(_0x5b889e- -0x361,_0x9ee29f);}return{'workspaceId':this['workspaceId'],'hasConfig':this[_0x4d38c1(-0x271,-0x215)](),'configDetails':this[_0x4d38c1(-0x234,-0x1e1)]?.[_0x4d38c1(-0x203,-0x213)]?{'host':this[_0x4d38c1(-0x234,-0x241)][_0x4d38c1(-0x203,-0x278)][_0x4d38c1(-0x2ba,-0x2ef)],'port':this['detectedConfig'][_0x4d38c1(-0x203,-0x1a7)]['port'],'database':this['detectedConfig'][_0x4d38c1(-0x203,-0x278)]['database'],'schema':this['detectedConfig']['credentials'][_0x4d38c1(-0x21a,-0x1f2)]||_0x4d38c1(-0x1ff,-0x260),'sslEnabled':this[_0x4d38c1(-0x234,-0x21a)]['credentials']['sslEnabled']||![]}:undefined};}}function _0x4d5f(_0x199879,_0x190b03){const _0x571405=_0x5714();return _0x4d5f=function(_0x4d5f61,_0x4cbc55){_0x4d5f61=_0x4d5f61-0x9b;let _0x1d47a7=_0x571405[_0x4d5f61];if(_0x4d5f['yuiaUl']===undefined){var _0x2000a0=function(_0x37dada){const _0xde3a40='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x170bb0='',_0x3c16db='';for(let _0x4008f0=0x0,_0x1dd54c,_0x1df225,_0x3ee676=0x0;_0x1df225=_0x37dada['charAt'](_0x3ee676++);~_0x1df225&&(_0x1dd54c=_0x4008f0%0x4?_0x1dd54c*0x40+_0x1df225:_0x1df225,_0x4008f0++%0x4)?_0x170bb0+=String['fromCharCode'](0xff&_0x1dd54c>>(-0x2*_0x4008f0&0x6)):0x0){_0x1df225=_0xde3a40['indexOf'](_0x1df225);}for(let _0x3e940c=0x0,_0x55374b=_0x170bb0['length'];_0x3e940c<_0x55374b;_0x3e940c++){_0x3c16db+='%'+('00'+_0x170bb0['charCodeAt'](_0x3e940c)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3c16db);};_0x4d5f['hSyCPD']=_0x2000a0,_0x199879=arguments,_0x4d5f['yuiaUl']=!![];}const _0x5cac62=_0x571405[0x0],_0x44d525=_0x4d5f61+_0x5cac62,_0x462bd9=_0x199879[_0x44d525];return!_0x462bd9?(_0x1d47a7=_0x4d5f['hSyCPD'](_0x1d47a7),_0x199879[_0x44d525]=_0x1d47a7):_0x1d47a7=_0x462bd9,_0x1d47a7;},_0x4d5f(_0x199879,_0x190b03);}function _0x33e61d(_0x496710,_0x1e2a50){return _0x4d5f(_0x1e2a50- -0x20e,_0x496710);}class DatabaseClient{constructor(_0x56957c,_0x35df47){this['httpClient']=_0x56957c,this['customDatabaseManager']=new CustomDatabaseManager(_0x56957c,_0x35df47);}[_0x33e61d(-0x13f,-0x138)](_0x2143a4){function _0x19b574(_0x536034,_0x38e4c5){return _0x4d5f(_0x536034- -0x2c9,_0x38e4c5);}return new QueryBuilder(this['httpClient'],_0x2143a4,this[_0x19b574(-0x1e5,-0x1b5)],this[_0x19b574(-0x21e,-0x27d)][_0x19b574(-0x14f,-0xea)]());}[_0x33e61d(-0xf0,-0x160)](_0x31d2b2,_0x25a3f4){function _0x3becb2(_0xbbf2c8,_0x154f2b){return _0x4d5f(_0xbbf2c8- -0x3e7,_0x154f2b);}return this['httpClient']['post'](_0x3becb2(-0x347,-0x31a)+_0x31d2b2,_0x25a3f4);}['schema'](_0x34afc4){const _0x592d49=new DatabaseClient(this['httpClient'],this[_0x5c00f1(0x3d4,0x3b7)]['getWorkspaceId']());function _0x5c00f1(_0x20e863,_0x115c24){return _0x4d5f(_0x20e863-0x329,_0x115c24);}return _0x592d49['currentSchema']=_0x34afc4,_0x592d49['customDatabaseManager']=this[_0x5c00f1(0x3d4,0x3e0)],_0x592d49;}async[_0x33e61d(-0x12c,-0x16c)](){function _0x4feb4a(_0x3c37d9,_0x3503d0){return _0x4d5f(_0x3503d0- -0x310,_0x3c37d9);}return this[_0x4feb4a(-0x27c,-0x265)]['detectCustomDatabase']();}async[_0x33e61d(-0x137,-0x12d)](_0xa925fb){function _0x4d0c68(_0x2c0d3a,_0x23fb82){return _0x4d5f(_0x23fb82- -0x313,_0x2c0d3a);}return this[_0x4d0c68(-0x2b2,-0x268)][_0x4d0c68(-0x1ef,-0x1d3)](_0xa925fb);}async['configureCustomDatabase'](_0x428720){function _0x46f8ae(_0x1087b7,_0x4f10ee){return _0x4d5f(_0x1087b7-0x206,_0x4f10ee);}return this[_0x46f8ae(0x2b1,0x2cd)]['configureCustomDatabase'](_0x428720);}async[_0x33e61d(-0xe5,-0x107)](){function _0xcb985d(_0x281ccd,_0x73be9e){return _0x4d5f(_0x73be9e-0x211,_0x281ccd);}return this[_0xcb985d(0x251,0x2bc)][_0xcb985d(0x30d,0x318)]();}['isUsingCustomDatabase'](){function _0x46f6d4(_0xa202a1,_0x10b6e6){return _0x4d5f(_0x10b6e6- -0x2b0,_0xa202a1);}return this['customDatabaseManager'][_0x46f6d4(-0x148,-0x1c0)]();}['getCustomDatabaseStatus'](){function _0x35b69f(_0x11a691,_0x3fa23f){return _0x4d5f(_0x3fa23f- -0xc,_0x11a691);}return this[_0x35b69f(0x60,0x9f)]['getStatus']();}[_0x33e61d(-0x7e,-0xc1)](_0x13df7a){function _0x1f0d17(_0x309ae2,_0x166861){return _0x4d5f(_0x166861- -0x250,_0x309ae2);}this['customDatabaseManager'][_0x1f0d17(-0xb1,-0x103)](_0x13df7a);}async[_0x33e61d(-0x15e,-0x16d)](){try{await this['customDatabaseManager']['detectCustomDatabase']();}catch(_0x4d7d51){console['warn']('Failed to initialize custom database detection:',_0x4d7d51);}}}class StorageBucket{constructor(_0x161814,bucketId){this['httpClient']=_0x161814,this['bucketId']=bucketId;}async[_0x33e61d(-0x92,-0xb5)](_0x3021a1,_0x1f8ac7,_0x5379a9){function _0x2feeb9(_0x2da70c,_0x348299){return _0x4d5f(_0x348299-0x3a3,_0x2da70c);}try{const _0x3af037=new FormData();if(_0x1f8ac7 instanceof File)_0x3af037['append'](_0x2feeb9(0x52d,0x4f3),_0x1f8ac7);else{if(_0x1f8ac7 instanceof Blob)_0x3af037[_0x2feeb9(0x4e1,0x49c)]('file',_0x1f8ac7,_0x3021a1);else{if(_0x1f8ac7 instanceof ArrayBuffer)_0x3af037[_0x2feeb9(0x4c8,0x49c)](_0x2feeb9(0x49b,0x4f3),new Blob([_0x1f8ac7]),_0x3021a1);else typeof _0x1f8ac7===_0x2feeb9(0x513,0x4d2)&&_0x3af037['append'](_0x2feeb9(0x519,0x4f3),new Blob([_0x1f8ac7],{'type':'text/plain'}),_0x3021a1);}}_0x3af037['append'](_0x2feeb9(0x4b1,0x474),_0x3021a1);_0x5379a9?.['cacheControl']&&_0x3af037[_0x2feeb9(0x4e9,0x49c)](_0x2feeb9(0x526,0x4b6),_0x5379a9['cacheControl']);_0x5379a9?.[_0x2feeb9(0x41b,0x45c)]&&_0x3af037[_0x2feeb9(0x4e2,0x49c)]('contentType',_0x5379a9['contentType']);_0x5379a9?.[_0x2feeb9(0x471,0x4d1)]&&_0x3af037['append']('metadata',JSON[_0x2feeb9(0x4be,0x495)](_0x5379a9['metadata']));const _0x2f92d1=_0x2feeb9(0x42b,0x46a)+this['bucketId']+_0x2feeb9(0x4cc,0x4c9)+(_0x5379a9?.['upsert']?'?upsert=true':''),response=await this[_0x2feeb9(0x500,0x4cb)][_0x2feeb9(0x514,0x4f2)](_0x2f92d1,_0x3af037,{'headers':{'Content-Type':_0x2feeb9(0x44e,0x456)}});return{'data':response[_0x2feeb9(0x46f,0x4e1)],'error':null};}catch(_0x5e81f6){return{'data':null,'error':_0x5e81f6 instanceof EBaaSError?_0x5e81f6:new EBaaSError(_0x5e81f6 instanceof Error?_0x5e81f6[_0x2feeb9(0x438,0x46d)]:'Failed\x20to\x20upload\x20file',0x0,_0x5e81f6)};}}async[_0x33e61d(-0x171,-0x14a)](_0x388ca9,_0x1670a4){function _0x3cbc7c(_0x34f63a,_0x21e3eb){return _0x4d5f(_0x21e3eb- -0x18d,_0x34f63a);}try{const _0x258c26=new URLSearchParams();_0x1670a4?.[_0x3cbc7c(-0x58,-0x56)]&&Object[_0x3cbc7c(-0x127,-0xe5)](_0x1670a4[_0x3cbc7c(-0x8,-0x56)])['forEach'](([_0x1fccdf,_0x5bee12])=>{_0x5bee12!==undefined&&_0x258c26['append'](_0x1fccdf,String(_0x5bee12));});const _0x20e4c0=_0x3cbc7c(-0xe8,-0xc6)+this['bucketId']+_0x3cbc7c(-0x6f,-0xaa)+_0x388ca9+(_0x258c26['toString']()?'?'+_0x258c26['toString']():''),response=await this[_0x3cbc7c(-0x37,-0x65)]['get'](_0x20e4c0,{'responseType':'blob'});return{'data':response[_0x3cbc7c(-0xc9,-0x4f)],'error':null};}catch(_0x503fd1){return{'data':null,'error':_0x503fd1 instanceof EBaaSError?_0x503fd1:new EBaaSError(_0x503fd1 instanceof Error?_0x503fd1[_0x3cbc7c(-0x118,-0xc3)]:'Failed\x20to\x20download\x20file',0x0,_0x503fd1)};}}async[_0x33e61d(-0xbf,-0xdd)](_0x59464b,_0x244c91){function _0x1f9bcd(_0x179711,_0x120a34){return _0x4d5f(_0x179711- -0x353,_0x120a34);}try{const _0x304616=new URLSearchParams();_0x59464b&&_0x304616['append']('prefix',_0x59464b);_0x244c91?.[_0x1f9bcd(-0x1cc,-0x23a)]&&_0x304616[_0x1f9bcd(-0x25a,-0x269)](_0x1f9bcd(-0x1cc,-0x1fd),String(_0x244c91[_0x1f9bcd(-0x1cc,-0x1bc)]));_0x244c91?.[_0x1f9bcd(-0x28d,-0x2c3)]&&_0x304616[_0x1f9bcd(-0x25a,-0x2cd)]('offset',String(_0x244c91['offset']));_0x244c91?.['sortBy']&&_0x304616[_0x1f9bcd(-0x25a,-0x22b)](_0x1f9bcd(-0x1fc,-0x209),JSON['stringify'](_0x244c91['sortBy']));_0x244c91?.[_0x1f9bcd(-0x277,-0x236)]&&_0x304616[_0x1f9bcd(-0x25a,-0x234)](_0x1f9bcd(-0x277,-0x283),_0x244c91[_0x1f9bcd(-0x277,-0x271)]);const _0x2def02='/storage/buckets/'+this['bucketId']+'/files'+(_0x304616[_0x1f9bcd(-0x1ef,-0x263)]()?'?'+_0x304616[_0x1f9bcd(-0x1ef,-0x1c0)]():''),response=await this[_0x1f9bcd(-0x22b,-0x286)]['get'](_0x2def02);return{'data':response[_0x1f9bcd(-0x215,-0x270)],'error':null};}catch(_0x3a96d0){return{'data':null,'error':_0x3a96d0 instanceof EBaaSError?_0x3a96d0:new EBaaSError(_0x3a96d0 instanceof Error?_0x3a96d0[_0x1f9bcd(-0x289,-0x2e2)]:_0x1f9bcd(-0x2af,-0x27b),0x0,_0x3a96d0)};}}async[_0x33e61d(-0xf8,-0xed)](_0x4d92ec){function _0x35fe3f(_0x3c1b81,_0x324b30){return _0x4d5f(_0x324b30-0x230,_0x3c1b81);}try{const response=await this['httpClient']['delete'](_0x35fe3f(0x33f,0x2f7)+this[_0x35fe3f(0x37d,0x326)]+'/files',{'data':{'paths':_0x4d92ec}});return{'data':response['data'],'error':null};}catch(_0x3167f7){return{'data':null,'error':_0x3167f7 instanceof EBaaSError?_0x3167f7:new EBaaSError(_0x3167f7 instanceof Error?_0x3167f7[_0x35fe3f(0x2ba,0x2fa)]:_0x35fe3f(0x33c,0x39e),0x0,_0x3167f7)};}}async['move'](fromPath,_0x219356){function _0x138571(_0x30d762,_0x5ccf2f){return _0x4d5f(_0x5ccf2f-0x39b,_0x30d762);}try{const response=await this[_0x138571(0x51b,0x4c3)]['post']('/storage/buckets/'+this[_0x138571(0x496,0x491)]+'/files/move',{'sourceKey':fromPath,'destinationKey':_0x219356});return{'data':response['data'],'error':null};}catch(_0x1e5a17){return{'data':null,'error':_0x1e5a17 instanceof EBaaSError?_0x1e5a17:new EBaaSError(_0x1e5a17 instanceof Error?_0x1e5a17['message']:'Failed\x20to\x20move\x20file',0x0,_0x1e5a17)};}}async[_0x33e61d(-0x126,-0xfc)](fromPath,_0x270cce){function _0x431040(_0x41ca94,_0x24d2a5){return _0x4d5f(_0x24d2a5- -0x2d7,_0x41ca94);}try{const response=await this['httpClient'][_0x431040(-0x14f,-0x188)]('/storage/buckets/'+this[_0x431040(-0x1e7,-0x1e1)]+_0x431040(-0x235,-0x1e9),{'sourceKey':fromPath,'destinationKey':_0x270cce});return{'data':response['data'],'error':null};}catch(_0x1aa4cd){return{'data':null,'error':_0x1aa4cd instanceof EBaaSError?_0x1aa4cd:new EBaaSError(_0x1aa4cd instanceof Error?_0x1aa4cd['message']:'Failed\x20to\x20copy\x20file',0x0,_0x1aa4cd)};}}async[_0x33e61d(-0x2a,-0x7f)](_0x167489,_0x5222d5,_0x1422bb){function _0x222413(_0x2aa98f,_0x141761){return _0x4d5f(_0x141761- -0x34f,_0x2aa98f);}try{const response=await this[_0x222413(-0x1b2,-0x227)]['post']('/storage/buckets/'+this[_0x222413(-0x20d,-0x259)]+'/files/'+_0x167489+_0x222413(-0x26c,-0x253),{'expiresIn':_0x5222d5,..._0x1422bb});return{'data':response[_0x222413(-0x1ab,-0x211)],'error':null};}catch(_0x37d77f){return{'data':null,'error':_0x37d77f instanceof EBaaSError?_0x37d77f:new EBaaSError(_0x37d77f instanceof Error?_0x37d77f['message']:'Failed\x20to\x20create\x20signed\x20URL',0x0,_0x37d77f)};}}[_0x33e61d(-0x1a0,-0x137)](_0x281cf3,_0x5caf0f){const _0x2676b4=new URLSearchParams();_0x5caf0f?.[_0x949cbf(0x403,0x3ae)]&&Object['entries'](_0x5caf0f[_0x949cbf(0x403,0x461)])[_0x949cbf(0x440,0x430)](([_0x54542f,_0x3bd79d])=>{function _0x4bc77c(_0x14f5fb,_0x2ed448){return _0x4d5f(_0x14f5fb-0x25a,_0x2ed448);}_0x3bd79d!==undefined&&_0x2676b4[_0x4bc77c(0x353,0x31f)](_0x54542f,String(_0x3bd79d));});const _0x4242ac=this[_0x949cbf(0x3f4,0x38b)]['baseURL']||'',_0x14ccd8=_0x4242ac+_0x949cbf(0x393,0x32b)+this['bucketId']+_0x949cbf(0x3af,0x3f2)+_0x281cf3+(_0x2676b4['toString']()?'?'+_0x2676b4['toString']():'');function _0x949cbf(_0x3e6b8d,_0x1dfee6){return _0x4d5f(_0x3e6b8d-0x2cc,_0x1dfee6);}return{'data':{'publicUrl':_0x14ccd8}};}async['getFileInfo'](_0x2f0a68){function _0x128b32(_0x3a512e,_0x280997){return _0x4d5f(_0x280997-0x31,_0x3a512e);}try{const response=await this[_0x128b32(0x17b,0x159)][_0x128b32(0x180,0x122)](_0x128b32(0xa0,0xf8)+this[_0x128b32(0x112,0x127)]+_0x128b32(0x10c,0x114)+_0x2f0a68+'/info');return{'data':response['data'],'error':null};}catch(_0x35337d){return{'data':null,'error':_0x35337d instanceof EBaaSError?_0x35337d:new EBaaSError(_0x35337d instanceof Error?_0x35337d[_0x128b32(0x88,0xfb)]:_0x128b32(0x10b,0x13f),0x0,_0x35337d)};}}async['updateFileMetadata'](_0x45fbd2,metadata){function _0x31e646(_0x3e578b,_0x440ff5){return _0x4d5f(_0x3e578b-0x363,_0x440ff5);}try{const response=await this['httpClient']['put']('/storage/buckets/'+this['bucketId']+_0x31e646(0x446,0x485)+_0x45fbd2+'/metadata',{'metadata':metadata});return{'data':response[_0x31e646(0x4a1,0x494)],'error':null};}catch(_0x13aaa7){return{'data':null,'error':_0x13aaa7 instanceof EBaaSError?_0x13aaa7:new EBaaSError(_0x13aaa7 instanceof Error?_0x13aaa7['message']:_0x31e646(0x42b,0x469),0x0,_0x13aaa7)};}}}class StorageClient{constructor(_0x1820aa){function _0x2b4b0e(_0x5eb2c5,_0x270256){return _0x4d5f(_0x5eb2c5-0x32f,_0x270256);}this[_0x2b4b0e(0x457,0x3de)]=_0x1820aa;}['from'](bucketId){return new StorageBucket(this['httpClient'],bucketId);}async[_0x33e61d(-0x4d,-0x80)](_0x392290,_0x6f069f){function _0x4af232(_0x24c945,_0xaae031){return _0x4d5f(_0xaae031-0x27,_0x24c945);}try{const response=await this['httpClient'][_0x4af232(0x16f,0x176)]('/storage/buckets',{'id':_0x392290,..._0x6f069f});return{'data':response[_0x4af232(0x127,0x165)],'error':null};}catch(_0x229a60){return{'data':null,'error':_0x229a60 instanceof EBaaSError?_0x229a60:new EBaaSError(_0x229a60 instanceof Error?_0x229a60['message']:'Failed\x20to\x20create\x20bucket',0x0,_0x229a60)};}}async[_0x33e61d(-0x8e,-0xc2)](_0x31fe96){function _0x16cd0f(_0x375c17,_0x5ee53b){return _0x4d5f(_0x5ee53b- -0x39a,_0x375c17);}try{const response=await this['httpClient'][_0x16cd0f(-0x25d,-0x2a9)](_0x16cd0f(-0x262,-0x2d3)+_0x31fe96);return{'data':response['data'],'error':null};}catch(_0xc5d9c6){return{'data':null,'error':_0xc5d9c6 instanceof EBaaSError?_0xc5d9c6:new EBaaSError(_0xc5d9c6 instanceof Error?_0xc5d9c6[_0x16cd0f(-0x295,-0x2d0)]:'Failed\x20to\x20get\x20bucket',0x0,_0xc5d9c6)};}}async[_0x33e61d(-0x154,-0x127)](){function _0x27bef3(_0x55b872,_0x248f9a){return _0x4d5f(_0x55b872- -0x65,_0x248f9a);}try{const response=await this['httpClient'][_0x27bef3(0x8c,0xe3)]('/storage/buckets');return{'data':response[_0x27bef3(0xd9,0xc9)],'error':null};}catch(_0x36caa0){return{'data':null,'error':_0x36caa0 instanceof EBaaSError?_0x36caa0:new EBaaSError(_0x36caa0 instanceof Error?_0x36caa0['message']:_0x27bef3(0x121,0x18f),0x0,_0x36caa0)};}}async[_0x33e61d(-0x79,-0xda)](_0xaeb1ea,_0x36d63e){function _0x3aa1c5(_0x24a57e,_0x311335){return _0x4d5f(_0x24a57e- -0xbf,_0x311335);}try{const response=await this['httpClient'][_0x3aa1c5(0x1,0x29)](_0x3aa1c5(0x8,-0x1b)+_0xaeb1ea,_0x36d63e);return{'data':response['data'],'error':null};}catch(_0x10a8d4){return{'data':null,'error':_0x10a8d4 instanceof EBaaSError?_0x10a8d4:new EBaaSError(_0x10a8d4 instanceof Error?_0x10a8d4['message']:'Failed\x20to\x20update\x20bucket',0x0,_0x10a8d4)};}}async[_0x33e61d(-0x5d,-0xd1)](_0xe02352){function _0x2472ac(_0x382f23,_0x394342){return _0x4d5f(_0x382f23- -0x3ab,_0x394342);}try{const response=await this[_0x2472ac(-0x283,-0x2b3)]['delete'](_0x2472ac(-0x2e4,-0x2be)+_0xe02352);return{'data':response[_0x2472ac(-0x26d,-0x278)],'error':null};}catch(_0x53bdbe){return{'data':null,'error':_0x53bdbe instanceof EBaaSError?_0x53bdbe:new EBaaSError(_0x53bdbe instanceof Error?_0x53bdbe[_0x2472ac(-0x2e1,-0x318)]:'Failed\x20to\x20delete\x20bucket',0x0,_0x53bdbe)};}}async[_0x33e61d(-0x11a,-0xf2)](){function _0x336626(_0x5505f1,_0x9f6e5b){return _0x4d5f(_0x5505f1- -0x18e,_0x9f6e5b);}try{const response=await this[_0x336626(-0x66,-0xa9)]['get'](_0x336626(-0x91,-0x18));return{'data':response[_0x336626(-0x50,-0xaa)],'error':null};}catch(_0x1a4563){return{'data':null,'error':_0x1a4563 instanceof EBaaSError?_0x1a4563:new EBaaSError(_0x1a4563 instanceof Error?_0x1a4563[_0x336626(-0xc4,-0x119)]:'Failed\x20to\x20get\x20storage\x20usage',0x0,_0x1a4563)};}}}class RealtimeChannel extends _0x37dada{constructor(_0x5b35bb,_0x35af49){super();function _0x5b36c8(_0x2c716d,_0x3f616a){return _0x4d5f(_0x2c716d-0x2fd,_0x3f616a);}this[_0x5b36c8(0x43c,0x3d7)]=![],this['state']=_0x5b36c8(0x46c,0x473),this['subscriptions']=new Map(),this['topic']=_0x5b35bb,this['socket']=_0x35af49;}['subscribe'](_0x1ee481){!this[_0x25939d(0x1fe,0x1d1)]&&(this['joinedOnce']=!![],this[_0x25939d(0x219,0x205)]());_0x1ee481&&this['on'](_0x25939d(0x228,0x255),_0x1ee481);function _0x25939d(_0x4e76d7,_0x26cf97){return _0x4d5f(_0x4e76d7-0xbf,_0x26cf97);}return this;}[_0x33e61d(-0x196,-0x15a)](filter,_0x38d75e){const _0x21ceec=_0x934eb0(0x4fe,0x4d6)+JSON['stringify'](filter);function _0x934eb0(_0xe93e87,_0x4408c8){return _0x4d5f(_0x4408c8-0x383,_0xe93e87);}super['on'](_0x21ceec,_0x38d75e);const _0x4d86c5={'unsubscribe':()=>{super[_0x10f379(-0x1ad,-0x227)](_0x21ceec,_0x38d75e);function _0x10f379(_0x15c858,_0xda9065){return _0x4d5f(_0x15c858- -0x2c6,_0xda9065);}this['subscriptions']['delete'](_0x21ceec);}};return this['subscriptions'][_0x934eb0(0x434,0x47b)](_0x21ceec,_0x4d86c5),this['socket']?.[_0x934eb0(0x513,0x4ed)]&&this['state']==='joined'&&this[_0x934eb0(0x46a,0x469)][_0x934eb0(0x4ce,0x48f)]('subscribe_postgres_changes',{'topic':this[_0x934eb0(0x4d6,0x461)],'filter':filter,'ref':this[_0x934eb0(0x49c,0x49b)]()}),_0x4d86c5;}['onBroadcast'](filter,_0x4985cd){const _0x311fd7=_0x3e1766(0x22e,0x201)+JSON[_0x3e1766(0x196,0x13d)](filter);super['on'](_0x311fd7,_0x4985cd);const _0x58256e={'unsubscribe':()=>{function _0x1224ef(_0x5cc8af,_0x2e2e41){return _0x4d5f(_0x5cc8af- -0x8f,_0x2e2e41);}super['off'](_0x311fd7,_0x4985cd),this['subscriptions'][_0x1224ef(0xc3,0x8c)](_0x311fd7);}};this[_0x3e1766(0x1d4,0x1d7)]['set'](_0x311fd7,_0x58256e);function _0x3e1766(_0x52e65d,_0x10bc97){return _0x4d5f(_0x52e65d-0xa4,_0x10bc97);}return _0x58256e;}['onPresence'](filter,_0x45f4da){const _0x1c0969='presence:'+JSON['stringify'](filter);super['on'](_0x1c0969,_0x45f4da);function _0x5d2513(_0x67bfdf,_0x4fb9d5){return _0x4d5f(_0x4fb9d5- -0xb7,_0x67bfdf);}const _0x5b7da4={'unsubscribe':()=>{function _0x3e2c5d(_0x3b57c3,_0x205f9){return _0x4d5f(_0x205f9- -0x38d,_0x3b57c3);}super[_0x3e2c5d(-0x23d,-0x274)](_0x1c0969,_0x45f4da),this['subscriptions'][_0x3e2c5d(-0x1f8,-0x23b)](_0x1c0969);}};return this[_0x5d2513(0x1b,0x79)]['set'](_0x1c0969,_0x5b7da4),_0x5b7da4;}['send'](_0x2daa9d){return new Promise(_0x5bafab=>{function _0x29792a(_0x29152f,_0x3997fd){return _0x4d5f(_0x29152f-0x35d,_0x3997fd);}this[_0x29792a(0x443,0x478)]?.[_0x29792a(0x4c7,0x4b0)]&&this[_0x29792a(0x4ce,0x4de)]===_0x29792a(0x41f,0x3d0)?(this['socket']['emit'](_0x29792a(0x4ae,0x503),{'topic':this['topic'],'event':_0x2daa9d[_0x29792a(0x458,0x424)],'payload':_0x2daa9d,'ref':this[_0x29792a(0x475,0x479)]()}),_0x5bafab('ok')):_0x5bafab(_0x29792a(0x481,0x4a4));});}['track'](_0x164376){return new Promise(_0x500921=>{function _0x1d0f87(_0x28e40d,_0xe5df7e){return _0x4d5f(_0x28e40d-0x32,_0xe5df7e);}this[_0x1d0f87(0x118,0xea)]?.[_0x1d0f87(0x19c,0x1b0)]&&this[_0x1d0f87(0x1a3,0x214)]==='joined'?(this['socket']['emit']('presence',{'topic':this[_0x1d0f87(0x110,0x151)],'event':_0x1d0f87(0x114,0x157),'payload':_0x164376,'ref':this['makeRef']()}),_0x500921('ok')):_0x500921('error');});}[_0x33e61d(-0xfe,-0xd9)](){return new Promise(_0x1b6b13=>{function _0x2e29e8(_0x12f367,_0x21158b){return _0x4d5f(_0x21158b- -0x1f,_0x12f367);}this[_0x2e29e8(0xc8,0xc7)]?.[_0x2e29e8(0xdb,0x14b)]&&this['state']===_0x2e29e8(0x88,0xa3)?(this[_0x2e29e8(0x84,0xc7)]['emit'](_0x2e29e8(0x106,0x16c),{'topic':this['topic'],'event':_0x2e29e8(0x142,0x116),'ref':this[_0x2e29e8(0xf9,0xf9)]()}),_0x1b6b13('ok')):_0x1b6b13('error');});}['unsubscribe'](){return new Promise(_0x22b59b=>{this[_0x8e0620(0x155,0x147)]='leaving';function _0x8e0620(_0x19ce9d,_0x5d26f6){return _0x4d5f(_0x5d26f6- -0x2a,_0x19ce9d);}this[_0x8e0620(0x102,0x106)]['forEach'](_0x4205e2=>{_0x4205e2['unsubscribe']();}),this['subscriptions'][_0x8e0620(0xb6,0x74)](),this['socket']?.['connected']&&this['socket']['emit']('leave',{'topic':this['topic'],'ref':this[_0x8e0620(0x119,0xee)]()}),this['state']=_0x8e0620(0xdc,0x145),this['removeAllListeners'](),_0x22b59b('ok');});}[_0x33e61d(-0x58,-0xb4)](){if(this['state']==='leaving')return;this['state']='joining';function _0x3d3314(_0x29f6eb,_0x19e468){return _0x4d5f(_0x29f6eb-0x286,_0x19e468);}this[_0x3d3314(0x36c,0x393)]?.['connected']&&(this[_0x3d3314(0x36c,0x3bc)]['emit'](_0x3d3314(0x38f,0x3d2),{'topic':this['topic'],'ref':this[_0x3d3314(0x39e,0x3e6)]()}),setTimeout(()=>{function _0x2d8569(_0x2d7604,_0x1bb6c5){return _0x4d5f(_0x2d7604-0x294,_0x1bb6c5);}this[_0x2d8569(0x405,0x452)]==='joining'&&(this[_0x2d8569(0x405,0x416)]='joined',this[_0x2d8569(0x3a0,0x3d4)](_0x2d8569(0x3fd,0x3d6),'SUBSCRIBED'));},0x64));}[_0x33e61d(-0xdf,-0x11b)](){function _0x3ed85d(_0x4ba353,_0x5caa29){return _0x4d5f(_0x5caa29-0x3e,_0x4ba353);}this['joinedOnce']&&(this['_join'](),this[_0x3ed85d(0x1d5,0x16e)]['forEach']((_0x1383ee,_0x582ad8)=>{function _0xc605d6(_0x8c0b7f,_0x40e95c){return _0x4d5f(_0x8c0b7f- -0x36b,_0x40e95c);}if(_0x582ad8[_0xc605d6(-0x222,-0x1f1)](_0xc605d6(-0x218,-0x1f9))){const filter=JSON[_0xc605d6(-0x281,-0x2d6)](_0x582ad8['replace'](_0xc605d6(-0x218,-0x1d5),''));this[_0xc605d6(-0x285,-0x287)]?.[_0xc605d6(-0x25f,-0x244)](_0xc605d6(-0x1f2,-0x20a),{'topic':this[_0xc605d6(-0x28d,-0x27e)],'filter':filter,'ref':this[_0xc605d6(-0x253,-0x253)]()});}}));}[_0x33e61d(-0x172,-0x158)](_0x3ac984,_0x109c50){function _0x2dca4e(_0x291f9d,_0x53d20d){return _0x4d5f(_0x291f9d- -0x68,_0x53d20d);}if(_0x3ac984===_0x2dca4e(0x3e,-0x29)){const _0x2f4917=_0x2dca4e(0xeb,0x97)+JSON['stringify'](_0x109c50[_0x2dca4e(0xb6,0x9d)]||{});this[_0x2dca4e(0xa4,0x5e)](_0x2f4917,_0x109c50);}else{if(_0x3ac984===_0x2dca4e(0xe9,0xb7)){const _0x1c2d56=_0x2dca4e(0x122,0xf9)+JSON['stringify']({'event':_0x109c50['event']});this['emit'](_0x1c2d56,_0x109c50);}else{if(_0x3ac984==='presence'){const _0xcbc7ee=_0x2dca4e(0xa3,0xe8)+JSON[_0x2dca4e(0x8a,0x5f)]({'event':_0x109c50['event']});this['emit'](_0xcbc7ee,_0x109c50);}}}this[_0x2dca4e(0xa4,0x43)](_0x3ac984,_0x109c50);}['_setState'](_0x1dea4){this[_0x193cc6(0x4cc,0x4da)]=_0x1dea4;function _0x193cc6(_0x1aa243,_0x11c063){return _0x4d5f(_0x1aa243-0x35b,_0x11c063);}let status;switch(_0x1dea4){case _0x193cc6(0x41d,0x445):status='SUBSCRIBED';break;case'errored':status='CHANNEL_ERROR';break;case _0x193cc6(0x4ca,0x4db):status=_0x193cc6(0x4e8,0x4b4);break;default:return;}this['emit']('status',status);}[_0x33e61d(-0x119,-0xf6)](){function _0x2cf69d(_0x168ec0,_0x4d40fa){return _0x4d5f(_0x4d40fa-0x199,_0x168ec0);}return Math[_0x2cf69d(0x26f,0x257)]()['toString'](0x24)[_0x2cf69d(0x34a,0x2fc)](0x2,0xf);}[_0x33e61d(-0x1dc,-0x165)](){function _0x10fdf6(_0x5d63d5,_0x308c22){return _0x4d5f(_0x5d63d5-0x23a,_0x308c22);}return this[_0x10fdf6(0x3ab,0x351)];}}class RealtimeClient{constructor(_0x37e39f,_0x712226,_0x4285ca={}){this[_0x48b781(0x329,0x2c4)]=null,this['channels']=new Map(),this['connectionState']='disconnected',this[_0x48b781(0x360,0x32d)]=0x0,this['maxReconnectAttempts']=0x5;function _0x48b781(_0x4cb121,_0xe3e360){return _0x4d5f(_0x4cb121-0x243,_0xe3e360);}this[_0x48b781(0x30f,0x314)]=_0x37e39f,this['apiKey']=_0x712226,this[_0x48b781(0x3b5,0x350)]={'heartbeatInterval':0x7530,'reconnectInterval':0x1388,'maxReconnectAttempts':0x5,..._0x4285ca};}[_0x33e61d(-0x1aa,-0x145)](){return new Promise((_0x154e7b,_0x501877)=>{if(this['socket']?.['connected']){_0x154e7b();return;}this[_0x559299(0x2bc,0x2d2)]='connecting',this[_0x559299(0x33b,0x2c4)]=io(this[_0x559299(0x269,0x2aa)],{'auth':{'apikey':this['apiKey']},'transports':['websocket'],'reconnection':!![],'reconnectionDelay':this['options']['reconnectInterval'],'reconnectionAttempts':this['options']['maxReconnectAttempts'],...this[_0x559299(0x3ae,0x350)]['socketOptions']}),this['socket']['on'](_0x559299(0x2ed,0x2a7),()=>{this['connectionState']=_0xf976d3(0xcb,0x115);function _0xf976d3(_0x54255c,_0x2031f9){return _0x4d5f(_0x54255c- -0x9f,_0x2031f9);}this['reconnectAttempts']=0x0,this[_0xf976d3(0xdc,0x81)](),_0x154e7b();}),this[_0x559299(0x27c,0x2c4)]['on'](_0x559299(0x2da,0x298),_0x52a170=>{this['connectionState']=_0x4fb39f(-0xc4,-0xa5);function _0x4fb39f(_0x4aec8d,_0xc6ad17){return _0x4d5f(_0x4aec8d- -0x18f,_0xc6ad17);}this['channels']['forEach'](channel=>{function _0x4b6636(_0x355ea1,_0x1796aa){return _0x4d5f(_0x355ea1- -0x47,_0x1796aa);}channel['_setState'](_0x4b6636(0x128,0xbf));});});function _0x559299(_0x1b3b09,_0x4e477b){return _0x4d5f(_0x4e477b-0x1de,_0x1b3b09);}this['socket']['on'](_0x559299(0x252,0x2b7),_0x17d1ea=>{function _0x5dea4d(_0x12721f,_0x12c03d){return _0x4d5f(_0x12721f- -0x3ae,_0x12c03d);}this[_0x5dea4d(-0x2ba,-0x242)]=_0x5dea4d(-0x28a,-0x27b),this['reconnectAttempts']++,this[_0x5dea4d(-0x291,-0x272)]>=this[_0x5dea4d(-0x247,-0x224)]&&_0x501877(new Error('Failed\x20to\x20connect\x20after\x20'+this['maxReconnectAttempts']+_0x5dea4d(-0x26b,-0x2a7)+_0x17d1ea['message']));}),this['socket']['on'](_0x559299(0x2c3,0x305),()=>{this[_0x535672(0x3e2,0x3d6)]='connected';function _0x535672(_0x25310d,_0x5036dc){return _0x4d5f(_0x25310d-0x2ee,_0x5036dc);}this[_0x535672(0x40b,0x3e1)]=0x0,this['channels'][_0x535672(0x462,0x4db)](channel=>{function _0xa48489(_0x2bb3be,_0x5d1bab){return _0x4d5f(_0x2bb3be- -0x2c3,_0x5d1bab);}channel[_0xa48489(-0x1d0,-0x165)]();});}),this[_0x559299(0x30e,0x2c4)]['on']('postgres_changes',_0x23d88d=>{function _0xd9b4a3(_0x2d08d3,_0x19189f){return _0x4d5f(_0x2d08d3-0x2f5,_0x19189f);}const channel=this[_0xd9b4a3(0x3b4,0x357)][_0xd9b4a3(0x3e6,0x3fc)](_0x23d88d['topic']);channel&&channel['_trigger'](_0xd9b4a3(0x39b,0x3c5),_0x23d88d);}),this[_0x559299(0x279,0x2c4)]['on']('broadcast',_0x5197f9=>{const channel=this[_0x527f44(0x425,0x449)]['get'](_0x5197f9['topic']);function _0x527f44(_0x2f3b81,_0x4ec529){return _0x4d5f(_0x4ec529-0x38a,_0x2f3b81);}channel&&channel['_trigger']('broadcast',_0x5197f9);}),this['socket']['on']('presence',_0x2f1929=>{const channel=this['channels']['get'](_0x2f1929['topic']);channel&&channel['_trigger']('presence',_0x2f1929);});});}['disconnect'](){function _0x28e210(_0x57d50b,_0x558c33){return _0x4d5f(_0x558c33-0x325,_0x57d50b);}this['socket']&&(this[_0x28e210(0x3bd,0x40b)]['disconnect'](),this['socket']=null),this['connectionState']=_0x28e210(0x377,0x3f0),this['channels'][_0x28e210(0x398,0x3c3)]();}[_0x33e61d(-0x154,-0x149)](_0x45283c){if(this[_0x422a9a(-0xac,-0x88)]['has'](_0x45283c))return this[_0x422a9a(-0xff,-0x88)][_0x422a9a(-0x5a,-0x56)](_0x45283c);function _0x422a9a(_0x36f83a,_0x3dd564){return _0x4d5f(_0x3dd564- -0x147,_0x36f83a);}const channel=new RealtimeChannel(_0x45283c,this[_0x422a9a(-0xdc,-0x61)]);return this['channels']['set'](_0x45283c,channel),this['connectionState']==='connected'&&channel[_0x422a9a(0x4f,0x13)](),channel;}[_0x33e61d(-0x8a,-0xa1)](channel){const _0x357f5e=channel['topic'];function _0x551206(_0x488574,_0x469ead){return _0x4d5f(_0x469ead-0x339,_0x488574);}this['channels']['has'](_0x357f5e)&&(this[_0x551206(0x46a,0x3f8)][_0x551206(0x460,0x48b)](_0x357f5e),channel[_0x551206(0x35a,0x3d5)]());}['removeAllChannels'](){this['channels']['forEach'](channel=>{channel['unsubscribe']();});function _0x1c6c7c(_0x370c6f,_0x24c4e5){return _0x4d5f(_0x370c6f- -0x1b7,_0x24c4e5);}this[_0x1c6c7c(-0xf8,-0x120)][_0x1c6c7c(-0x119,-0xe2)]();}[_0x33e61d(-0xad,-0xa2)](){function _0x2147cf(_0x1418bb,_0x172730){return _0x4d5f(_0x1418bb- -0x2e6,_0x172730);}return Array[_0x2147cf(-0x210,-0x1a0)](this['channels']['values']());}['isConnected'](){function _0x53e432(_0x42737e,_0x396d43){return _0x4d5f(_0x42737e-0x3b,_0x396d43);}return this[_0x53e432(0x12f,0x11e)]==='connected'&&!!this['socket']?.['connected'];}['getConnectionState'](){return this['connectionState'];}['onConnectionStateChange'](_0x26ab83){const _0x41bcb6=()=>_0x26ab83(this['connectionState']);this['socket']&&(this['socket']['on']('connect',()=>{this['connectionState']='connected',_0x41bcb6();}),this[_0x40064b(0x49a,0x443)]['on']('disconnect',()=>{this['connectionState']=_0x5b9eee(-0xec,-0x87);function _0x5b9eee(_0x1cb644,_0x23739e){return _0x4d5f(_0x23739e- -0x152,_0x1cb644);}_0x41bcb6();}),this['socket']['on'](_0x40064b(0x46b,0x436),()=>{function _0x3f33cb(_0x5966ca,_0x238331){return _0x4d5f(_0x5966ca- -0x35d,_0x238331);}this[_0x3f33cb(-0x269,-0x284)]=_0x3f33cb(-0x239,-0x290),_0x41bcb6();}));function _0x40064b(_0x16d784,_0x55430a){return _0x4d5f(_0x55430a-0x35d,_0x16d784);}return()=>{function _0x5e9212(_0x386a91,_0x49107b){return _0x4d5f(_0x49107b-0x13c,_0x386a91);}this['socket']&&(this['socket']['off'](_0x5e9212(0x22c,0x205),_0x41bcb6),this['socket']['off']('disconnect',_0x41bcb6),this[_0x5e9212(0x290,0x222)]['off']('connect_error',_0x41bcb6));};}['setupHeartbeat'](){function _0x7be2a5(_0x2ccfe3,_0x30764a){return _0x4d5f(_0x30764a- -0x149,_0x2ccfe3);}if(!this['options'][_0x7be2a5(0x44,0x1d)]||!this['socket'])return;const interval=setInterval(()=>{function _0x197c7b(_0x39affe,_0x59c03d){return _0x4d5f(_0x39affe- -0x1a1,_0x59c03d);}this[_0x197c7b(-0xbb,-0x93)]?.['connected']?this[_0x197c7b(-0xbb,-0x82)]['emit'](_0x197c7b(-0xc6,-0x9e),{'timestamp':Date[_0x197c7b(-0xf7,-0xdb)]()}):clearInterval(interval);},this[_0x7be2a5(0x2e,0x29)]['heartbeatInterval']);}['_getSocket'](){function _0x1ac4fc(_0x3eadcf,_0x2db392){return _0x4d5f(_0x2db392- -0x28b,_0x3eadcf);}return this[_0x1ac4fc(-0x159,-0x1a5)];}}class FunctionsClient{constructor(_0x2ea593){this['httpClient']=_0x2ea593;}async['invoke'](_0x4ef68f,_0x257c02){function _0x391252(_0xd2eb17,_0x4fbe8d){return _0x4d5f(_0xd2eb17-0xd2,_0x4fbe8d);}try{const _0x5d06fe=_0x257c02?.['method']||'POST',headers={'Content-Type':'application/json',..._0x257c02?.[_0x391252(0x1bb,0x1cb)]};let response;const _0x89a5c5=_0x391252(0x1f7,0x1a5)+_0x4ef68f;switch(_0x5d06fe['toUpperCase']()){case'GET':response=await this[_0x391252(0x1fa,0x1d3)][_0x391252(0x1c3,0x1f5)](_0x89a5c5,{'headers':headers,'params':_0x257c02?.['body']});break;case'POST':response=await this[_0x391252(0x1fa,0x188)]['post'](_0x89a5c5,_0x257c02?.[_0x391252(0x248,0x271)],{'headers':headers});break;case'PUT':response=await this[_0x391252(0x1fa,0x22c)]['put'](_0x89a5c5,_0x257c02?.['body'],{'headers':headers});break;case'PATCH':response=await this[_0x391252(0x1fa,0x1b7)][_0x391252(0x242,0x22b)](_0x89a5c5,_0x257c02?.['body'],{'headers':headers});break;case'DELETE':response=await this['httpClient']['delete'](_0x89a5c5,{'headers':headers,'data':_0x257c02?.[_0x391252(0x248,0x22d)]});break;default:throw new EBaaSError('Unsupported\x20HTTP\x20method:\x20'+_0x5d06fe,0x190);}return{'data':response['data'],'error':null};}catch(_0x45153d){return{'data':null,'error':_0x45153d instanceof EBaaSError?_0x45153d:new EBaaSError(_0x45153d instanceof Error?_0x45153d['message']:'Function\x20invocation\x20failed',0x0,_0x45153d)};}}async['list'](){function _0x4f9dfb(_0x49c745,_0x42f085){return _0x4d5f(_0x42f085-0x300,_0x49c745);}try{const response=await this[_0x4f9dfb(0x43c,0x428)][_0x4f9dfb(0x424,0x3f1)]('/functions/v1');return{'data':response['data'],'error':null};}catch(_0x764ac){return{'data':null,'error':_0x764ac instanceof EBaaSError?_0x764ac:new EBaaSError(_0x764ac instanceof Error?_0x764ac['message']:'Failed\x20to\x20list\x20functions',0x0,_0x764ac)};}}async[_0x33e61d(-0x13a,-0x11d)](_0x1bea79){function _0xabbaca(_0x159de5,_0x5373bd){return _0x4d5f(_0x159de5- -0x196,_0x5373bd);}try{const response=await this['httpClient'][_0xabbaca(-0xa5,-0x5a)](_0xabbaca(-0x71,-0x2f)+_0x1bea79+_0xabbaca(-0xdb,-0x136));return{'data':response[_0xabbaca(-0x58,-0x5e)],'error':null};}catch(_0x3bc8ef){return{'data':null,'error':_0x3bc8ef instanceof EBaaSError?_0x3bc8ef:new EBaaSError(_0x3bc8ef instanceof Error?_0x3bc8ef[_0xabbaca(-0xcc,-0x12a)]:'Failed\x20to\x20get\x20function',0x0,_0x3bc8ef)};}}async['deploy'](_0x18f12e,_0x282eef){function _0x12f125(_0x37d343,_0x4927dc){return _0x4d5f(_0x4927dc-0x303,_0x37d343);}try{const _0x10bbd2=new FormData();if(_0x282eef[_0x12f125(0x3d4,0x3d0)]instanceof File)_0x10bbd2[_0x12f125(0x449,0x3fc)](_0x12f125(0x391,0x3d0),_0x282eef[_0x12f125(0x3e5,0x3d0)]);else typeof _0x282eef['code']===_0x12f125(0x486,0x432)&&_0x10bbd2['append'](_0x12f125(0x422,0x3d0),new Blob([_0x282eef[_0x12f125(0x42e,0x3d0)]],{'type':_0x12f125(0x455,0x449)}),_0x12f125(0x46c,0x3f2));_0x282eef['entrypoint']&&_0x10bbd2[_0x12f125(0x3bb,0x3fc)]('entrypoint',_0x282eef[_0x12f125(0x3c1,0x3eb)]);_0x282eef[_0x12f125(0x35e,0x3a0)]&&_0x10bbd2[_0x12f125(0x39b,0x3fc)]('env',JSON[_0x12f125(0x404,0x3f5)](_0x282eef[_0x12f125(0x418,0x3a0)]));_0x282eef['importMap']&&_0x10bbd2['append']('importMap',JSON[_0x12f125(0x3fd,0x3f5)](_0x282eef[_0x12f125(0x4b7,0x43d)]));_0x282eef[_0x12f125(0x4bd,0x468)]!==undefined&&_0x10bbd2[_0x12f125(0x433,0x3fc)]('verify',String(_0x282eef[_0x12f125(0x3f3,0x468)]));const response=await this['httpClient'][_0x12f125(0x439,0x452)]('/functions/v1/'+_0x18f12e+'/deploy',_0x10bbd2,{'headers':{'Content-Type':_0x12f125(0x37e,0x3b6)}});return{'data':response['data'],'error':null};}catch(_0x2d326d){return{'data':null,'error':_0x2d326d instanceof EBaaSError?_0x2d326d:new EBaaSError(_0x2d326d instanceof Error?_0x2d326d['message']:'Failed\x20to\x20deploy\x20function',0x0,_0x2d326d)};}}async[_0x33e61d(-0x9c,-0xbc)](_0x314d74){function _0x5cfb03(_0x4dac7a,_0x35a319){return _0x4d5f(_0x4dac7a-0x168,_0x35a319);}try{const response=await this[_0x5cfb03(0x290,0x279)]['delete'](_0x5cfb03(0x28d,0x2b9)+_0x314d74);return{'data':response[_0x5cfb03(0x2a6,0x300)],'error':null};}catch(_0x3b7d8f){return{'data':null,'error':_0x3b7d8f instanceof EBaaSError?_0x3b7d8f:new EBaaSError(_0x3b7d8f instanceof Error?_0x3b7d8f['message']:'Failed\x20to\x20delete\x20function',0x0,_0x3b7d8f)};}}async['updateEnv'](_0x516fe9,_0x1c70c3){function _0x46513f(_0x2f1807,_0xf4aa06){return _0x4d5f(_0xf4aa06-0xc7,_0x2f1807);}try{const response=await this[_0x46513f(0x23f,0x1ef)][_0x46513f(0x122,0x187)]('/functions/v1/'+_0x516fe9+'/env',{'env':_0x1c70c3});return{'data':response['data'],'error':null};}catch(_0x563d5f){return{'data':null,'error':_0x563d5f instanceof EBaaSError?_0x563d5f:new EBaaSError(_0x563d5f instanceof Error?_0x563d5f[_0x46513f(0x156,0x191)]:_0x46513f(0x132,0x17f),0x0,_0x563d5f)};}}async[_0x33e61d(-0x133,-0x15e)](_0x5d0f83,_0x5705f6){function _0x3e7436(_0x58fbcf,_0xda4c5){return _0x4d5f(_0xda4c5-0x75,_0x58fbcf);}try{const _0x434af8=new URLSearchParams();_0x5705f6?.['limit']&&_0x434af8['append']('limit',String(_0x5705f6['limit']));_0x5705f6?.['offset']&&_0x434af8[_0x3e7436(0x1e8,0x16e)](_0x3e7436(0x186,0x13b),String(_0x5705f6[_0x3e7436(0x19b,0x13b)]));_0x5705f6?.[_0x3e7436(0x19d,0x173)]&&_0x434af8['append']('level',_0x5705f6['level']);const _0x41a07e='/functions/v1/'+_0x5d0f83+'/logs'+(_0x434af8['toString']()?'?'+_0x434af8['toString']():''),response=await this[_0x3e7436(0x1ba,0x19d)]['get'](_0x41a07e);return{'data':response['data'],'error':null};}catch(_0x18a56a){return{'data':null,'error':_0x18a56a instanceof EBaaSError?_0x18a56a:new EBaaSError(_0x18a56a instanceof Error?_0x18a56a[_0x3e7436(0x178,0x13f)]:'Failed\x20to\x20get\x20function\x20logs',0x0,_0x18a56a)};}}async[_0x33e61d(-0x49,-0x99)](_0x37d079,_0x32262d){function _0x12877a(_0x54f59a,_0x5ee199){return _0x4d5f(_0x54f59a- -0x3e0,_0x5ee199);}try{const _0x34fd30=new URLSearchParams();_0x32262d?.[_0x12877a(-0x311,-0x2af)]&&_0x34fd30['append'](_0x12877a(-0x311,-0x2e4),_0x32262d['period']);const _0x3ddc22='/functions/v1/'+_0x37d079+'/metrics'+(_0x34fd30['toString']()?'?'+_0x34fd30[_0x12877a(-0x27c,-0x2d2)]():''),response=await this['httpClient'][_0x12877a(-0x2ef,-0x333)](_0x3ddc22);return{'data':response[_0x12877a(-0x2a2,-0x26f)],'error':null};}catch(_0x3cc8a4){return{'data':null,'error':_0x3cc8a4 instanceof EBaaSError?_0x3cc8a4:new EBaaSError(_0x3cc8a4 instanceof Error?_0x3cc8a4['message']:'Failed\x20to\x20get\x20function\x20metrics',0x0,_0x3cc8a4)};}}}class EBaaSClient{constructor(_0x1eb47d,_0x14af17,_0x4e8616){this['options']=_0x4e8616,this[_0x5743a0(-0x68,-0x2b)]=new HttpClient({'url':_0x1eb47d,'apiKey':_0x14af17,'timeout':0x7530,'headers':_0x4e8616?.['global']?.[_0x5743a0(-0xdb,-0x6a)]}),this[_0x5743a0(0x11,-0x31)]=new AuthClient(this[_0x5743a0(0x5,-0x2b)]),this[_0x5743a0(-0x8a,-0x17)]=new DatabaseClient(this[_0x5743a0(-0x75,-0x2b)],_0x4e8616?.['database']?.['workspaceId']),this['storage']=new StorageClient(this[_0x5743a0(-0x24,-0x2b)]),this[_0x5743a0(0x33,0x30)]=new RealtimeClient(_0x1eb47d,_0x14af17,_0x4e8616?.[_0x5743a0(0x9b,0x30)]);function _0x5743a0(_0x36a8fa,_0x25050f){return _0x4d5f(_0x25050f- -0x153,_0x36a8fa);}this['functions']=new FunctionsClient(this['httpClient']),this['initializeCustomDatabase']();}['from'](_0x99acd4){function _0xe640b7(_0xe87703,_0x33302e){return _0x4d5f(_0x33302e- -0x4a,_0xe87703);}return this[_0xe640b7(0x10e,0xf2)]['from'](_0x99acd4);}[_0x33e61d(-0x14e,-0x160)](_0x1e415e,_0x155e0f){return this['database']['rpc'](_0x1e415e,_0x155e0f);}[_0x33e61d(-0x119,-0xd5)](_0x625b3c){function _0x1ca1f5(_0x176bae,_0x4f67a7){return _0x4d5f(_0x176bae-0x185,_0x4f67a7);}return this[_0x1ca1f5(0x2b0,0x328)]['from'](_0x625b3c);}['channel'](_0x30a96a){function _0x2a8dc9(_0x2cf07e,_0x98d942){return _0x4d5f(_0x2cf07e- -0x1d3,_0x98d942);}return this[_0x2a8dc9(-0x50,-0xaf)][_0x2a8dc9(-0x10e,-0x111)](_0x30a96a);}[_0x33e61d(-0x9a,-0xee)](_0x5414b3,_0x9a16f2){function _0x2c4727(_0x2bb682,_0x445692){return _0x4d5f(_0x445692-0x159,_0x2bb682);}return this[_0x2c4727(0x264,0x2ad)][_0x2c4727(0x22c,0x279)](_0x5414b3,_0x9a16f2);}async['initializeCustomDatabase'](){function _0x51fc3d(_0x21df57,_0x57f437){return _0x4d5f(_0x57f437- -0xaf,_0x21df57);}if(this['options']?.[_0x51fc3d(0x74,0x8d)]?.['autoDetectCustomDatabase'])try{await this[_0x51fc3d(0x85,0x8d)][_0x51fc3d(-0x58,-0xe)]();}catch(_0x4dfa5b){console['warn']('Failed to initialize custom database detection:',_0x4dfa5b);}}async['setWorkspaceId'](_0x4f4a73){function _0x3dfb28(_0x463482,_0x47a966){return _0x4d5f(_0x463482-0x349,_0x47a966);}this[_0x3dfb28(0x485,0x410)][_0x3dfb28(0x496,0x49d)](_0x4f4a73),this[_0x3dfb28(0x4bb,0x4b4)]?.['database']?.[_0x3dfb28(0x428,0x408)]&&await this['database']['initialize']();}async[_0x33e61d(-0x12a,-0x101)](_0x4a7338){await this['database']['configureCustomDatabase'](_0x4a7338);}[_0x33e61d(-0xd3,-0xf8)](){function _0x41712e(_0xe02a21,_0x55fe23){return _0x4d5f(_0xe02a21-0x220,_0x55fe23);}return this[_0x41712e(0x35c,0x306)]['getCustomDatabaseStatus']();}}function createClient(_0x1248c7,_0x3f83b4,_0x247705){return new EBaaSClient(_0x1248c7,_0x3f83b4,_0x247705);}const version=_0x33e61d(-0x91,-0xb8);export{AuthClient,CustomDatabaseManager,DatabaseClient,EBaaSClient,EBaaSError,FunctionsClient,HttpClient,QueryBuilder,RealtimeChannel,RealtimeClient,StorageBucket,StorageClient,createClient,version};