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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- 'use strict';(function(stringArrayFunction,comparisonValue){function _0x9b0518(_0x359141,_0x38e2a0){return _0xdb60(_0x38e2a0-0x1bb,_0x359141);}const stringArray=stringArrayFunction();while(!![]){try{const _0x47c6e4=parseInt(_0x9b0518(0x389,0x335))/0x1+parseInt(_0x9b0518(0x27b,0x2c2))/0x2+-parseInt(_0x9b0518(0x2bb,0x302))/0x3*(-parseInt(_0x9b0518(0x292,0x2f5))/0x4)+-parseInt(_0x9b0518(0x323,0x2de))/0x5+parseInt(_0x9b0518(0x260,0x2b9))/0x6+parseInt(_0x9b0518(0x1ed,0x259))/0x7+-parseInt(_0x9b0518(0x349,0x328))/0x8;if(_0x47c6e4===comparisonValue)break;else stringArray['push'](stringArray['shift']());}catch(_0x50e2c6){stringArray['push'](stringArray['shift']());}}}(_0x5056,0x6634f));var axios=require(_0x3381c2(-0x19b,-0x1bb)),socket_ioClient=require('socket.io-client'),EventEmitter=require('eventemitter3');class EBaaSError extends Error{constructor(_0x1bf82d,status=0x0,_0x5384d0){super(_0x1bf82d),this['name']=_0x5d0f7c(0x225,0x1b6),this['status']=status;function _0x5d0f7c(_0x33b89a,_0x9ca9ca){return _0xdb60(_0x9ca9ca-0x59,_0x33b89a);}this['details']=_0x5384d0,Error[_0x5d0f7c(0x119,0x17d)]&&Error[_0x5d0f7c(0x101,0x17d)](this,EBaaSError);}['toJSON'](){function _0x23a8a1(_0x2e9591,_0x3dccfc){return _0xdb60(_0x2e9591- -0xe3,_0x3dccfc);}return{'name':this[_0x23a8a1(0x63,0x6d)],'message':this['message'],'status':this[_0x23a8a1(-0x16,-0x55)],'details':this['details'],'stack':this[_0x23a8a1(0x4,0x5f)]};}[_0x3381c2(-0xc3,-0x11a)](){function _0x5e05eb(_0x33a861,_0x38e8ef){return _0xdb60(_0x33a861- -0x88,_0x38e8ef);}return this[_0x5e05eb(0xbe,0xf4)]+':\x20'+this['message']+_0x5e05eb(0x71,0xcd)+this['status']+')';}}class HttpClient{constructor(config){this[_0x1ace66(-0x9,-0x7c)]=config[_0x1ace66(-0x7d,-0xa5)],this[_0x1ace66(-0x118,-0xc5)]=config[_0x1ace66(-0x13c,-0xc5)];function _0x1ace66(_0x299f50,_0x53a285){return _0xdb60(_0x53a285- -0x1bc,_0x299f50);}this[_0x1ace66(-0xe5,-0x70)]=axios[_0x1ace66(-0x5,-0x3e)]({'baseURL':this['baseURL'],'timeout':config['timeout']||0x2710,'headers':{'Content-Type':'application/json','apikey':this['apiKey'],...config['headers']}}),this[_0x1ace66(-0x37,-0x7e)]();}[_0x3381c2(-0x105,-0xfb)](){this[_0x2aac7f(0x78,0xf2)][_0x2aac7f(-0x9,-0x8)]['request']['use'](config=>{return config;},_0x5a3fe7=>{return Promise['reject'](new EBaaSError('Request\x20failed',0x0,_0x5a3fe7));});function _0x2aac7f(_0x3e3917,_0xaaa51e){return _0xdb60(_0x3e3917- -0xd4,_0xaaa51e);}this['client']['interceptors'][_0x2aac7f(0x94,0x9f)]['use'](response=>{return response;},_0x3abd5b=>{const status=_0x3abd5b[_0x326eb1(0xd4,0xba)]?.['status']||0x0;function _0x326eb1(_0x35a89f,_0x5cf081){return _0xdb60(_0x35a89f- -0x94,_0x5cf081);}const _0x287240=_0x3abd5b['response']?.[_0x326eb1(0x3b,0x30)]?.[_0x326eb1(0xa3,0x4a)]||_0x3abd5b['message']||_0x326eb1(0xc3,0x73),_0x8a597c=_0x3abd5b[_0x326eb1(0xd4,0xf2)]?.['data']||_0x3abd5b;return Promise[_0x326eb1(0x2e,0x36)](new EBaaSError(_0x287240,status,_0x8a597c));});}async[_0x3381c2(-0x143,-0x196)](_0x5e466e,config){function _0x269156(_0x37859a,_0x4c92cc){return _0xdb60(_0x4c92cc-0x1dc,_0x37859a);}try{const response=await this['client']['get'](_0x5e466e,config);return{'data':response['data'],'status':response['status'],'statusText':response['statusText'],'headers':response[_0x269156(0x2f6,0x340)]};}catch(_0x4e8506){throw this[_0x269156(0x2db,0x336)](_0x4e8506);}}async['post'](_0x5dda28,data,config){function _0x176cde(_0x3f90e7,_0x2fbe20){return _0xdb60(_0x2fbe20-0x2b5,_0x3f90e7);}try{const response=await this[_0x176cde(0x3e0,0x401)]['post'](_0x5dda28,data,config);return{'data':response['data'],'status':response[_0x176cde(0x345,0x382)],'statusText':response[_0x176cde(0x3bb,0x394)],'headers':response[_0x176cde(0x420,0x419)]};}catch(_0x1c6fc4){throw this[_0x176cde(0x42b,0x40f)](_0x1c6fc4);}}async['put'](_0x39c20d,data,config){function _0x3d7662(_0x274f3f,_0x4b9ce5){return _0xdb60(_0x274f3f- -0x25f,_0x4b9ce5);}try{const response=await this[_0x3d7662(-0x113,-0x135)]['put'](_0x39c20d,data,config);return{'data':response[_0x3d7662(-0x190,-0x172)],'status':response[_0x3d7662(-0x192,-0x176)],'statusText':response[_0x3d7662(-0x180,-0x18d)],'headers':response[_0x3d7662(-0xfb,-0x140)]};}catch(_0xebdbc7){throw this['handleError'](_0xebdbc7);}}async['patch'](_0x52b978,data,config){function _0x3dd4a(_0x4bca23,_0x163fa7){return _0xdb60(_0x4bca23- -0x1dd,_0x163fa7);}try{const response=await this[_0x3dd4a(-0x91,-0x73)]['patch'](_0x52b978,data,config);return{'data':response[_0x3dd4a(-0x10e,-0xda)],'status':response[_0x3dd4a(-0x110,-0x15c)],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x57fa1b){throw this['handleError'](_0x57fa1b);}}async[_0x3381c2(-0x17b,-0x19a)](_0x4da496,config){function _0x9a2c72(_0x2d76f0,_0x6be83c){return _0xdb60(_0x6be83c- -0x220,_0x2d76f0);}try{const response=await this['client'][_0x9a2c72(-0x190,-0x158)](_0x4da496,config);return{'data':response[_0x9a2c72(-0x11e,-0x151)],'status':response['status'],'statusText':response['statusText'],'headers':response[_0x9a2c72(-0xf5,-0xbc)]};}catch(_0x57ffca){throw this['handleError'](_0x57ffca);}}[_0x3381c2(-0x141,-0x19c)](_0x2a44e8){function _0xea5411(_0x26bc4a,_0x3279e3){return _0xdb60(_0x3279e3- -0x1e9,_0x26bc4a);}this['client']['defaults']['headers'][_0xea5411(-0x150,-0xdf)]['Authorization']=_0xea5411(-0x48,-0x73)+_0x2a44e8;}[_0x3381c2(-0x11c,-0x160)](){delete this[_0x16fad9(-0x60,0x1a)]['defaults']['headers'][_0x16fad9(-0xa2,-0x24)]['Authorization'];function _0x16fad9(_0x194497,_0x57b1ae){return _0xdb60(_0x194497- -0x1ac,_0x57b1ae);}this[_0x16fad9(-0x60,-0x49)]['defaults'][_0x16fad9(-0x48,-0x20)][_0x16fad9(-0xa2,-0x91)]['Authorization']='Bearer\x20'+this['apiKey'];}['handleError'](_0x595389){if(_0x595389 instanceof EBaaSError)return _0x595389;function _0x167c46(_0x5f1d89,_0x5dd441){return _0xdb60(_0x5dd441-0x3c4,_0x5f1d89);}return new EBaaSError(_0x595389['message']||_0x167c46(0x53b,0x4c7),_0x595389[_0x167c46(0x4b4,0x491)]||0x0,_0x595389);}}class AuthClient{constructor(_0x288645,_0x3bd3aa){function _0x2f884e(_0x302433,_0x216fb8){return _0xdb60(_0x216fb8- -0x34c,_0x302433);}this['currentSession']=null,this[_0x2f884e(-0x2c3,-0x2c2)]=_0x288645,this[_0x2f884e(-0x219,-0x204)]=_0x3bd3aa,this['loadSession']();}async['signUp'](data){function _0x19a48c(_0x4e493d,_0x112742){return _0xdb60(_0x4e493d-0x1f6,_0x112742);}try{const response=await this['httpClient']['post'](_0x19a48c(0x347,0x3b4),data);return response[_0x19a48c(0x2c5,0x2f2)]['session']&&this['setSessionInternal'](response['data']['session']),response[_0x19a48c(0x2c5,0x2e7)];}catch(_0x3060b5){throw this['handleAuthError'](_0x3060b5);}}async['signIn'](data){function _0x1aa4f4(_0x457b2e,_0x52a53f){return _0xdb60(_0x457b2e- -0x319,_0x52a53f);}try{const headers={};this['workspaceId']&&(headers[_0x1aa4f4(-0x1d8,-0x168)]=this[_0x1aa4f4(-0x1d1,-0x1b4)]);const response=await this['httpClient'][_0x1aa4f4(-0x20b,-0x1b5)](_0x1aa4f4(-0x20e,-0x1bd),data,{'headers':headers});return response['data']['session']&&this[_0x1aa4f4(-0x1eb,-0x1ed)](response[_0x1aa4f4(-0x24a,-0x215)][_0x1aa4f4(-0x280,-0x246)]),response[_0x1aa4f4(-0x24a,-0x1fd)];}catch(_0x17ce1b){throw this['handleAuthError'](_0x17ce1b);}}async['signOut'](){function _0x2cadc9(_0x44bcc9,_0x47dd98){return _0xdb60(_0x47dd98- -0x8e,_0x44bcc9);}try{await this['httpClient']['post'](_0x2cadc9(0xd1,0xdb)),this[_0x2cadc9(0x172,0xf4)]();}catch(_0x40fcd4){this['clearSession']();throw this['handleAuthError'](_0x40fcd4);}}async['getUser'](){if(!this['currentSession']?.[_0x2c956d(-0x2ee,-0x31b)])return null;function _0x2c956d(_0x37274f,_0x579e47){return _0xdb60(_0x37274f- -0x37e,_0x579e47);}try{const response=await this['httpClient']['get'](_0x2c956d(-0x2cf,-0x315));return response['data']['user'];}catch(_0x5a0fb6){if(_0x5a0fb6 instanceof EBaaSError&&_0x5a0fb6['status']===0x191)return this['clearSession'](),null;throw this[_0x2c956d(-0x286,-0x2f3)](_0x5a0fb6);}}async[_0x3381c2(-0x1a8,-0x187)](){function _0x34d80c(_0x1ddbcc,_0x21c5eb){return _0xdb60(_0x1ddbcc- -0x1a0,_0x21c5eb);}if(!this['currentSession']?.['refresh_token'])return null;try{const response=await this[_0x34d80c(-0x116,-0x143)]['post'](_0x34d80c(-0x109,-0x10f),{'refresh_token':this[_0x34d80c(-0x5d,-0x3)][_0x34d80c(-0xbe,-0x5b)]});if(response['data'][_0x34d80c(-0x107,-0xf9)])return this[_0x34d80c(-0x10d,-0xdd)](response['data']['session']),response['data']['session'];return null;}catch(_0xed683a){this[_0x34d80c(-0x1e,-0x92)]();throw this[_0x34d80c(-0xa8,-0x49)](_0xed683a);}}async[_0x3381c2(-0xf6,-0x111)](_0x31e347){function _0x3d94d3(_0x242f6c,_0x450e93){return _0xdb60(_0x450e93-0x8,_0x242f6c);}try{await this[_0x3d94d3(0x10c,0x92)][_0x3d94d3(0xb0,0x116)](_0x3d94d3(0xcb,0xc3),{'email':_0x31e347});}catch(_0x2e61d7){throw this[_0x3d94d3(0x118,0x100)](_0x2e61d7);}}async[_0x3381c2(-0x108,-0x118)](data){function _0x405da9(_0xe7927a,_0x54be36){return _0xdb60(_0xe7927a- -0x17f,_0x54be36);}try{const response=await this['httpClient'][_0x405da9(-0x57,-0xc7)](_0x405da9(-0xd0,-0xaf),data);return response['data'][_0x405da9(-0xb,-0x7e)];}catch(_0x480797){throw this[_0x405da9(-0x87,-0x102)](_0x480797);}}['getSession'](){function _0x16f80e(_0x1d0c14,_0x276892){return _0xdb60(_0x276892- -0x391,_0x1d0c14);}return this[_0x16f80e(-0x1fa,-0x24e)];}['setSession'](_0x3d3ecd){this['currentSession']=_0x3d3ecd,this[_0x387629(-0x117,-0xe5)][_0x387629(-0x4,-0x6d)](_0x3d3ecd[_0x387629(-0x11b,-0xdf)]);function _0x387629(_0x31a57a,_0x53ff31){return _0xdb60(_0x53ff31- -0x16f,_0x31a57a);}typeof localStorage!==_0x387629(-0x7,-0x70)&&localStorage['setItem'](_0x387629(-0xa4,-0x25),JSON[_0x387629(-0x78,-0xa9)](_0x3d3ecd));}['onAuthStateChange'](_0x424c0e){return()=>{};}['setWorkspaceId'](_0x151f69){function _0x3b94c9(_0x19a97a,_0x4aab21){return _0xdb60(_0x4aab21- -0x22b,_0x19a97a);}this[_0x3b94c9(-0xb3,-0xe3)]=_0x151f69;}[_0x3381c2(-0x115,-0xe9)](_0x28c524){this[_0x397888(-0x115,-0x191)]=_0x28c524;function _0x397888(_0x1b5736,_0x1712ea){return _0xdb60(_0x1712ea- -0x2d4,_0x1b5736);}this['httpClient'][_0x397888(-0x19a,-0x1d2)](_0x28c524[_0x397888(-0x242,-0x244)]),typeof localStorage!==_0x397888(-0x1e9,-0x1d5)&&localStorage['setItem'](_0x397888(-0x1d5,-0x18a),JSON['stringify'](_0x28c524));}[_0x3381c2(-0xc1,-0x129)](){this['currentSession']=null;function _0x537829(_0x54aba0,_0x287a3b){return _0xdb60(_0x54aba0- -0x395,_0x287a3b);}this[_0x537829(-0x30b,-0x28b)][_0x537829(-0x26e,-0x204)](),typeof localStorage!=='undefined'&&localStorage['removeItem'](_0x537829(-0x24b,-0x1dc));}['loadSession'](){function _0xf2f22(_0x3b4caa,_0x5e8068){return _0xdb60(_0x5e8068- -0x17c,_0x3b4caa);}if(typeof localStorage!==_0xf2f22(-0x7a,-0x7d)){const _0x17032e=localStorage[_0xf2f22(-0x8,-0x10)]('ebaas.auth.session');if(_0x17032e)try{const _0x260fa0=JSON['parse'](_0x17032e);this['setSessionInternal'](_0x260fa0);}catch(_0x1a5844){this[_0xf2f22(0x1c,0x6)]();}}}[_0x3381c2(-0x14b,-0x18c)](_0x416571){if(_0x416571 instanceof EBaaSError)return _0x416571;return new EBaaSError(_0x416571['message']||'Authentication\x20failed',_0x416571['status']||0x0,_0x416571);}}function _0x3381c2(_0x57e737,_0x3534c1){return _0xdb60(_0x57e737- -0x243,_0x3534c1);}class QueryBuilder{constructor(_0x8c4c5e,_0x658caf,_0x527f58,_0x538555){this['httpClient']=_0x8c4c5e,this[_0x1ba032(0x544,0x4cb)]=_0x658caf,this[_0x1ba032(0x579,0x525)]=_0x527f58;function _0x1ba032(_0x40f716,_0x19f7b6){return _0xdb60(_0x19f7b6-0x3a1,_0x40f716);}this[_0x1ba032(0x4f0,0x4e9)]=_0x538555,this['query']={'filters':[]};}['select'](_0x1cfde3='*',_0x404c81){return this['query']['select']=_0x1cfde3,this;}['insert'](data,_0x553ac1){function _0x5ab3e7(_0x9ac519,_0x4041cc){return _0xdb60(_0x9ac519-0x326,_0x4041cc);}return this[_0x5ab3e7(0x412,0x48c)]('POST',_0x5ab3e7(0x3c3,0x41b)+this[_0x5ab3e7(0x450,0x4a9)]+_0x5ab3e7(0x487,0x4a0),{'data':data,'options':_0x553ac1});}['update'](data,_0x4d0b75){function _0x560155(_0x1ad59d,_0x19d1b1){return _0xdb60(_0x19d1b1- -0x8e,_0x1ad59d);}return this['query'][_0x560155(0xcf,0x8d)]=data,this[_0x560155(0x120,0xb6)][_0x560155(0x9d,0xd8)]=_0x4d0b75,this;}[_0x3381c2(-0x12a,-0x17a)](data,_0x41616d){function _0x5f3099(_0x48c89b,_0x332423){return _0xdb60(_0x332423- -0xd1,_0x48c89b);}return this['executeQuery']('POST',_0x5f3099(-0x81,-0x34)+this['table']+'?operation=upsert',{'data':data,'options':{..._0x41616d,'upsert':!![]}});}['delete'](_0xd4818f){this[_0x49774d(0x281,0x2c5)]['deleteOptions']=_0xd4818f,this[_0x49774d(0x2ce,0x2c5)][_0x49774d(0x20a,0x24b)]=!![];function _0x49774d(_0x274ea5,_0x32293a){return _0xdb60(_0x32293a-0x181,_0x274ea5);}return this;}['eq'](_0x495d23,_0x38c0b0){return this['query']['filters']['push']({'column':_0x495d23,'operator':'eq','value':_0x38c0b0}),this;}[_0x3381c2(-0x160,-0x116)](_0x3fcb32,_0x1ec3a0){this[_0x47dbc3(-0x75,-0x72)][_0x47dbc3(-0x130,-0x127)]['push']({'column':_0x3fcb32,'operator':'neq','value':_0x1ec3a0});function _0x47dbc3(_0x328abc,_0x5bb2bc){return _0xdb60(_0x5bb2bc- -0x1b6,_0x328abc);}return this;}['gt'](_0x428095,_0x111263){this['query'][_0x4e5e90(-0x226,-0x27c)][_0x4e5e90(-0x1c1,-0x15b)]({'column':_0x428095,'operator':'gt','value':_0x111263});function _0x4e5e90(_0x526c16,_0x1b9e69){return _0xdb60(_0x526c16- -0x2b5,_0x1b9e69);}return this;}[_0x3381c2(-0x107,-0x170)](_0x380661,_0x2d4940){this[_0x2f20b8(-0x1bf,-0x179)][_0x2f20b8(-0x2a1,-0x22e)]['push']({'column':_0x380661,'operator':_0x2f20b8(-0x1b5,-0x181),'value':_0x2d4940});function _0x2f20b8(_0x46b810,_0xb7445b){return _0xdb60(_0xb7445b- -0x2bd,_0x46b810);}return this;}['lt'](_0x4dd71e,_0x37fdfe){function _0x2ac98d(_0x4dc7fd,_0x74a2a1){return _0xdb60(_0x4dc7fd- -0x1b9,_0x74a2a1);}return this['query'][_0x2ac98d(-0x12a,-0xb8)]['push']({'column':_0x4dd71e,'operator':'lt','value':_0x37fdfe}),this;}[_0x3381c2(-0x151,-0x18b)](_0x5cf08c,_0x15e3a7){this[_0x28a8f7(0x513,0x58c)][_0x28a8f7(0x45e,0x45d)][_0x28a8f7(0x4c3,0x4bc)]({'column':_0x5cf08c,'operator':'lte','value':_0x15e3a7});function _0x28a8f7(_0x246108,_0x3f5c81){return _0xdb60(_0x246108-0x3cf,_0x3f5c81);}return this;}['like'](_0x299173,_0x17ec17){this[_0xfa29a7(-0x2bd,-0x265)]['filters'][_0xfa29a7(-0x2f0,-0x2b5)]({'column':_0x299173,'operator':'like','value':_0x17ec17});function _0xfa29a7(_0x56811e,_0x1281c1){return _0xdb60(_0x1281c1- -0x3a9,_0x56811e);}return this;}[_0x3381c2(-0x166,-0x14a)](_0x133b1d,_0x577119){this[_0x3fb381(-0x11d,-0xe6)]['filters']['push']({'column':_0x133b1d,'operator':'ilike','value':_0x577119});function _0x3fb381(_0x54f0bb,_0x3182d0){return _0xdb60(_0x3182d0- -0x22a,_0x54f0bb);}return this;}['is'](_0x15228a,_0x2438ce){function _0x25c1d6(_0x3d57f0,_0xf9a4f4){return _0xdb60(_0x3d57f0-0x29d,_0xf9a4f4);}return this[_0x25c1d6(0x3e1,0x423)][_0x25c1d6(0x32c,0x327)]['push']({'column':_0x15228a,'operator':'is','value':_0x2438ce}),this;}['in'](_0x10d3b6,_0x3bb30c){this['query'][_0x81ed22(0x19a,0x1fe)][_0x81ed22(0x258,0x263)]({'column':_0x10d3b6,'operator':'in','value':_0x3bb30c});function _0x81ed22(_0xfd2066,_0x22a27d){return _0xdb60(_0x22a27d-0x16f,_0xfd2066);}return this;}['contains'](_0x22e050,_0xd28ff){function _0x481350(_0x2f5ff3,_0x37496b){return _0xdb60(_0x37496b-0x282,_0x2f5ff3);}return this['query'][_0x481350(0x2c7,0x311)][_0x481350(0x3a3,0x376)]({'column':_0x22e050,'operator':_0x481350(0x399,0x342),'value':_0xd28ff}),this;}[_0x3381c2(-0x190,-0x145)](_0x107839){Object[_0x2f38d5(0x341,0x2d0)](_0x107839)[_0x2f38d5(0x338,0x328)](([_0x1d2d5c,_0x1b6b8d])=>{this['eq'](_0x1d2d5c,_0x1b6b8d);});function _0x2f38d5(_0x2ababd,_0x468cce){return _0xdb60(_0x2ababd-0x1c0,_0x468cce);}return this;}[_0x3381c2(-0x13a,-0x131)](_0x47567c,_0x5d02c6){function _0x3a8fe2(_0xceec0f,_0x4dc6c1){return _0xdb60(_0x4dc6c1- -0xe3,_0xceec0f);}return!this[_0x3a8fe2(0x1c,0x61)]['order']&&(this[_0x3a8fe2(0x38,0x61)][_0x3a8fe2(0x16,0x26)]=[]),this['query']['order'][_0x3a8fe2(-0x11,0x11)]({'column':_0x47567c,'ascending':_0x5d02c6?.[_0x3a8fe2(0x76,-0x3)]!==![]}),this;}['limit'](count){this['query'][_0x2ddc65(-0x152,-0x132)]=count;function _0x2ddc65(_0xbf7388,_0x2f183d){return _0xdb60(_0xbf7388- -0x274,_0x2f183d);}return this;}['range'](from,_0x31bb21){function _0x11c514(_0x34946b,_0x1be7ec){return _0xdb60(_0x1be7ec-0x25d,_0x34946b);}return this[_0x11c514(0x41a,0x3a1)][_0x11c514(0x40e,0x3ac)]={'from':from,'to':_0x31bb21},this;}async[_0x3381c2(-0x19a,-0x15a)](){function _0x14f4f7(_0x2e9d4c,_0x23bd90){return _0xdb60(_0x23bd90-0x48,_0x2e9d4c);}if(this[_0x14f4f7(0x1de,0x18c)]['updateData'])return this[_0x14f4f7(0x141,0x134)]('PATCH','/sdk/v1/'+this[_0x14f4f7(0x1ce,0x172)],{'data':this['query']['updateData'],'options':this['query']['updateOptions'],'filters':this['query']['filters']});else return this[_0x14f4f7(0x197,0x18c)]['isDelete']?this['executeQuery']('DELETE','/sdk/v1/'+this['table']+'?operation=delete',{'options':this[_0x14f4f7(0x188,0x18c)]['deleteOptions'],'filters':this['query']['filters']}):this[_0x14f4f7(0x193,0x134)]('GET',_0x14f4f7(0x92,0xe5)+this[_0x14f4f7(0x1ac,0x172)]+_0x14f4f7(0x12e,0x165),{'select':this['query'][_0x14f4f7(0x197,0x149)],'filters':this['query']['filters'],'order':this['query']['order'],'limit':this['query'][_0x14f4f7(0xf4,0x16a)],'range':this[_0x14f4f7(0x1e7,0x18c)][_0x14f4f7(0x1ea,0x197)]});}async['single'](){this['limit'](0x1);const result=await this[_0x56a702(0x216,0x1f5)]();function _0x56a702(_0xf0b148,_0x5bb621){return _0xdb60(_0x5bb621-0x14c,_0xf0b148);}return{'data':result['data']?.[0x0]||null,'error':result['error']};}async[_0x3381c2(-0x157,-0x111)](_0x5301a8,_0x112a25,_0x1f0812){function _0x23c71f(_0x44d4f4,_0x50cba3){return _0xdb60(_0x50cba3-0x338,_0x44d4f4);}try{let response;const headers={};this[_0x23c71f(0x443,0x480)]&&(headers['x-workspace-id']=this['workspaceId']);if(_0x5301a8==='GET'){const _0x3a7aaa=_0x112a25['split']('?'),_0x733b25=_0x3a7aaa[0x0],existingParams=new URLSearchParams(_0x3a7aaa[0x1]||'');if(_0x1f0812['select'])existingParams[_0x23c71f(0x386,0x3c9)](_0x23c71f(0x407,0x439),_0x1f0812['select']);_0x1f0812['filters']?.['length']&&_0x1f0812['filters'][_0x23c71f(0x457,0x4b0)](filter=>{function _0x4ff364(_0x9717a8,_0x5871f6){return _0xdb60(_0x9717a8- -0x12c,_0x5871f6);}existingParams['append'](filter['column'],filter[_0x4ff364(-0x88,-0x6a)]+'.'+filter[_0x4ff364(0x50,0x53)]);});if(_0x1f0812['order']?.[_0x23c71f(0x440,0x471)]){const orderStr=_0x1f0812['order']['map'](_0x15533a=>''+_0x15533a[_0x23c71f(0x47e,0x444)]+(_0x15533a[_0x23c71f(0x3fd,0x418)]?_0x23c71f(0x42e,0x408):_0x23c71f(0x42c,0x49d)))['join'](',');existingParams['append'](_0x23c71f(0x45c,0x441),orderStr);}if(_0x1f0812['limit'])existingParams[_0x23c71f(0x3c5,0x3c9)]('limit',_0x1f0812['limit'][_0x23c71f(0x4ea,0x4b8)]());_0x1f0812['range']&&(existingParams[_0x23c71f(0x3b8,0x3c9)]('offset',_0x1f0812[_0x23c71f(0x420,0x487)]['from']['toString']()),existingParams[_0x23c71f(0x398,0x3c9)]('limit',(_0x1f0812['range']['to']-_0x1f0812[_0x23c71f(0x4f9,0x487)]['from']+0x1)['toString']())),response=await this['httpClient'][_0x23c71f(0x435,0x438)](_0x733b25+'?'+existingParams[_0x23c71f(0x50d,0x4b8)](),{'headers':headers});}else{if(_0x5301a8==='DELETE'){const _0x17c872=_0x112a25['split']('?'),_0x27d888=_0x17c872[0x0],existingParams=new URLSearchParams(_0x17c872[0x1]||'');!existingParams['has']('operation')&&existingParams['append'](_0x23c71f(0x473,0x4a9),'delete');_0x1f0812[_0x23c71f(0x441,0x3c7)]?.['length']&&_0x1f0812[_0x23c71f(0x34e,0x3c7)][_0x23c71f(0x528,0x4b0)](filter=>{function _0x39aa9b(_0x243229,_0x283f12){return _0xdb60(_0x243229- -0x178,_0x283f12);}existingParams[_0x39aa9b(-0xe7,-0xd0)](filter['column'],filter[_0x39aa9b(-0xd4,-0x121)]+'.'+filter['value']);});const deleteUrl=_0x27d888+'?'+existingParams['toString']();console['log']('\uD83D\uDD27 DELETE URL construída:',deleteUrl),console[_0x23c71f(0x3ab,0x3da)]('\uD83D\uDD27 DELETE headers:',headers),console['log']('\uD83D\uDD27 DELETE filtros originais:',_0x1f0812['filters']),response=await this[_0x23c71f(0x3f0,0x3c2)][_0x23c71f(0x3e1,0x400)](deleteUrl,{'headers':headers});}else{if(_0x5301a8==='PATCH'){const _0xe8d293=_0x112a25[_0x23c71f(0x41b,0x3fd)]('?'),_0xd5b00a=_0xe8d293[0x0],existingParams=new URLSearchParams(_0xe8d293[0x1]||'');!existingParams[_0x23c71f(0x3e3,0x423)](_0x23c71f(0x458,0x4a9))&&existingParams['append'](_0x23c71f(0x51e,0x4a9),'update');_0x1f0812[_0x23c71f(0x425,0x3c7)]?.[_0x23c71f(0x455,0x471)]&&_0x1f0812[_0x23c71f(0x43d,0x3c7)][_0x23c71f(0x475,0x4b0)](filter=>{function _0x14b1f5(_0x3881bf,_0x4c60a7){return _0xdb60(_0x4c60a7-0x1a6,_0x3881bf);}existingParams[_0x14b1f5(0x1e5,0x237)](filter['column'],filter[_0x14b1f5(0x2a1,0x24a)]+'.'+filter[_0x14b1f5(0x30d,0x322)]);});_0x1f0812[_0x23c71f(0x47e,0x477)]?.['prefer']&&(headers['Prefer']=_0x1f0812['options'][_0x23c71f(0x4a7,0x4a7)]);const updateUrl=_0xd5b00a+'?'+existingParams['toString']();response=await this['httpClient'][_0x23c71f(0x432,0x3e3)](updateUrl,_0x1f0812[_0x23c71f(0x3f0,0x407)],{'headers':headers});}else{let _0x1f724=_0x1f0812['data'];!headers['Prefer']&&(headers['Prefer']='return=representation'),_0x1f0812[_0x23c71f(0x47d,0x477)]?.['upsert']&&(headers['Prefer']=_0x23c71f(0x3cd,0x3c3)),_0x1f0812['dataArray']&&(_0x1f724=_0x1f0812['dataArray']),response=await this['httpClient'][_0x23c71f(0x488,0x446)](_0x112a25,_0x1f724,{'headers':headers});}}}return{'data':response['data'],'error':null,'count':response[_0x23c71f(0x4fe,0x49c)]?.['x-total-count']?parseInt(response[_0x23c71f(0x4d1,0x49c)]['x-total-count']):undefined};}catch(_0x421856){return{'data':null,'error':_0x421856 instanceof EBaaSError?_0x421856:new EBaaSError(_0x421856 instanceof Error?_0x421856['message']:_0x23c71f(0x470,0x3f4),0x0,_0x421856)};}}}function _0xdb60(_0x47cc67,_0x14a17c){const _0x505672=_0x5056();return _0xdb60=function(_0xdb60db,_0x23239f){_0xdb60db=_0xdb60db-0x89;let _0x271b70=_0x505672[_0xdb60db];if(_0xdb60['ftvVpK']===undefined){var _0x1b0c2c=function(_0x1bf82d){const _0x5384d0='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x5a3fe7='',_0x3abd5b='';for(let _0x287240=0x0,_0x8a597c,_0x5e466e,_0x4e8506=0x0;_0x5e466e=_0x1bf82d['charAt'](_0x4e8506++);~_0x5e466e&&(_0x8a597c=_0x287240%0x4?_0x8a597c*0x40+_0x5e466e:_0x5e466e,_0x287240++%0x4)?_0x5a3fe7+=String['fromCharCode'](0xff&_0x8a597c>>(-0x2*_0x287240&0x6)):0x0){_0x5e466e=_0x5384d0['indexOf'](_0x5e466e);}for(let _0x5dda28=0x0,_0x1c6fc4=_0x5a3fe7['length'];_0x5dda28<_0x1c6fc4;_0x5dda28++){_0x3abd5b+='%'+('00'+_0x5a3fe7['charCodeAt'](_0x5dda28)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3abd5b);};_0xdb60['tmnSaL']=_0x1b0c2c,_0x47cc67=arguments,_0xdb60['ftvVpK']=!![];}const _0x4fb29d=_0x505672[0x0],_0x3382c2=_0xdb60db+_0x4fb29d,_0x218932=_0x47cc67[_0x3382c2];return!_0x218932?(_0x271b70=_0xdb60['tmnSaL'](_0x271b70),_0x47cc67[_0x3382c2]=_0x271b70):_0x271b70=_0x218932,_0x271b70;},_0xdb60(_0x47cc67,_0x14a17c);}class CustomDatabaseManager{constructor(_0x2d89fb,_0x271c5f){this['httpClient']=_0x2d89fb,this['workspaceId']=_0x271c5f;}async[_0x3381c2(-0x18e,-0x131)](){function _0x36f44e(_0x65e87f,_0xd828ac){return _0xdb60(_0x65e87f-0x240,_0xd828ac);}if(!this[_0x36f44e(0x388,0x3dd)])return{'hasCustomDatabase':![]};try{const response=await this['httpClient'][_0x36f44e(0x340,0x2f1)]('/admin/v1/workspace/custom-database',{'headers':{'x-workspace-id':this[_0x36f44e(0x388,0x39a)]}});if(response['status']===0xc8&&response[_0x36f44e(0x30f,0x292)]?.['config']){const config=response['data'][_0x36f44e(0x390,0x353)],_0x32eb8c={'host':config['postgresHost'],'port':config[_0x36f44e(0x371,0x31a)],'database':config[_0x36f44e(0x392,0x319)],'username':config[_0x36f44e(0x34f,0x352)],'password':'','schema':config[_0x36f44e(0x316,0x29f)],'sslEnabled':config[_0x36f44e(0x393,0x39b)]};return this[_0x36f44e(0x314,0x316)]={'hasCustomDatabase':!![],'config':config,'credentials':_0x32eb8c},this['detectedConfig'];}}catch(_0x2e4f26){if(_0x2e4f26?.['status']===0x194)return this[_0x36f44e(0x314,0x343)]={'hasCustomDatabase':![]},this[_0x36f44e(0x314,0x315)];console[_0x36f44e(0x3bb,0x3d1)]('Failed to detect custom database configuration:',_0x2e4f26);}return this[_0x36f44e(0x314,0x337)]={'hasCustomDatabase':![]},this['detectedConfig'];}async[_0x3381c2(-0xd5,-0x65)](_0x1f315f){function _0x17298f(_0x32f4af,_0x570cc8){return _0xdb60(_0x32f4af- -0x284,_0x570cc8);}try{const response=await this['httpClient'][_0x17298f(-0x176,-0x10e)]('/admin/v1/workspace/custom-database/test-connection',_0x1f315f,{'headers':this['workspaceId']?{'X-Workspace-ID':this['workspaceId']}:{}});return response[_0x17298f(-0x1b5,-0x1d2)];}catch(_0x36eeb5){return{'success':![],'message':_0x36eeb5?.[_0x17298f(-0x14d,-0x19c)]||'Failed\x20to\x20test\x20connection'};}}async[_0x3381c2(-0x168,-0x15c)](_0x55d65e){if(!this[_0x2470f8(0x3e2,0x372)])throw new Error('Workspace ID is required to configure custom database');const response=await this['httpClient']['post']('/admin/v1/workspace/custom-database',{'workspaceId':this['workspaceId'],..._0x55d65e},{'headers':{'X-Workspace-ID':this['workspaceId']}});function _0x2470f8(_0x2bb583,_0x3ba456){return _0xdb60(_0x3ba456-0x22a,_0x2bb583);}const config=response['data'][_0x2470f8(0x33e,0x37a)];return this['detectedConfig']={'hasCustomDatabase':!![],'config':config,'credentials':_0x55d65e},config;}async['removeCustomDatabase'](){if(!this[_0x34c861(0x2ea,0x290)])throw new Error('Workspace ID is required to remove custom database');await this['httpClient'][_0x34c861(0x26a,0x266)]('/admin/v1/workspace/custom-database',{'headers':{'X-Workspace-ID':this['workspaceId']}});function _0x34c861(_0x4a8238,_0xbc712c){return _0xdb60(_0x4a8238-0x1a2,_0xbc712c);}this[_0x34c861(0x276,0x2b0)]={'hasCustomDatabase':![]};}[_0x3381c2(-0x170,-0x1d6)](){return this['detectedConfig'];}['hasCustomDatabase'](){return this['detectedConfig']?.['hasCustomDatabase']??![];}[_0x3381c2(-0x193,-0x1a9)](){function _0x257bbf(_0x28f655,_0x582408){return _0xdb60(_0x28f655- -0x3a2,_0x582408);}return this[_0x257bbf(-0x2ce,-0x2af)]?.['credentials'];}[_0x3381c2(-0x124,-0xc0)](_0x159d83){this['workspaceId']=_0x159d83,this['detectedConfig']=undefined;}[_0x3381c2(-0x19d,-0x20f)](){return this['workspaceId'];}[_0x3381c2(-0xd0,-0xaa)](){function _0x58c806(_0x47c8b8,_0x30cc61){return _0xdb60(_0x30cc61- -0x1a1,_0x47c8b8);}return{'workspaceId':this['workspaceId'],'hasConfig':this['hasCustomDatabase'](),'configDetails':this['detectedConfig']?.[_0x58c806(-0xb4,-0x53)]?{'host':this['detectedConfig']['credentials'][_0x58c806(-0x116,-0xf0)],'port':this[_0x58c806(-0x142,-0xcd)]['credentials']['port'],'database':this[_0x58c806(-0x5b,-0xcd)][_0x58c806(-0x83,-0x53)]['database'],'schema':this[_0x58c806(-0x132,-0xcd)]['credentials']['schema']||'public','sslEnabled':this['detectedConfig']['credentials'][_0x58c806(-0xc9,-0x4e)]||![]}:undefined};}}class DatabaseClient{constructor(_0x42225d,_0x48c4b9){function _0x465979(_0x252d95,_0x59e4cb){return _0xdb60(_0x252d95-0x80,_0x59e4cb);}this['httpClient']=_0x42225d,this[_0x465979(0x1cb,0x24b)]=new CustomDatabaseManager(_0x42225d,_0x48c4b9);}[_0x3381c2(-0x147,-0x19a)](_0xe54bbd){function _0x21007d(_0x4daa6e,_0x76b9b1){return _0xdb60(_0x76b9b1-0x4,_0x4daa6e);}return new QueryBuilder(this[_0x21007d(0x70,0x8e)],_0xe54bbd,this[_0x21007d(0x9d,0xb6)],this[_0x21007d(0xfd,0x14f)][_0x21007d(0x110,0xaa)]());}['rpc'](_0xfea1bb,_0x5dad57){function _0x5ee98e(_0x3b6ba1,_0x47bc97){return _0xdb60(_0x3b6ba1-0x297,_0x47bc97);}return this['httpClient']['post'](_0x5ee98e(0x41a,0x3fa)+_0xfea1bb,_0x5dad57);}['schema'](_0x3b6bb4){const _0x532e6a=new DatabaseClient(this['httpClient'],this['customDatabaseManager']['getWorkspaceId']());_0x532e6a['currentSchema']=_0x3b6bb4,_0x532e6a[_0x23853e(0x4a2,0x4e8)]=this['customDatabaseManager'];function _0x23853e(_0x5807fe,_0x40636b){return _0xdb60(_0x5807fe-0x357,_0x40636b);}return _0x532e6a;}async[_0x3381c2(-0x18e,-0x14c)](){function _0x9a56e8(_0x24d9e5,_0x460c1c){return _0xdb60(_0x24d9e5- -0xc6,_0x460c1c);}return this[_0x9a56e8(0x85,0x3c)][_0x9a56e8(-0x11,0x6b)]();}async['testCustomConnection'](_0x4e96cc){function _0x572b58(_0x358038,_0x94029a){return _0xdb60(_0x358038-0x18b,_0x94029a);}return this[_0x572b58(0x2d6,0x259)]['testConnection'](_0x4e96cc);}async['configureCustomDatabase'](_0x3532bd){function _0x2ddc85(_0x1f9d9c,_0x479613){return _0xdb60(_0x479613- -0x307,_0x1f9d9c);}return this[_0x2ddc85(-0x22e,-0x1bc)]['configureCustomDatabase'](_0x3532bd);}async[_0x3381c2(-0x1a0,-0x1f7)](){function _0x32f606(_0x42a5b6,_0x49233c){return _0xdb60(_0x49233c-0x340,_0x42a5b6);}return this[_0x32f606(0x502,0x48b)][_0x32f606(0x424,0x3e3)]();}['isUsingCustomDatabase'](){function _0x5a4c7e(_0x213cb9,_0xa41bc4){return _0xdb60(_0xa41bc4-0x235,_0x213cb9);}return this[_0x5a4c7e(0x321,0x380)]['hasCustomDatabase']();}['getCustomDatabaseStatus'](){function _0x47f914(_0x1bb3ba,_0x2b6271){return _0xdb60(_0x1bb3ba- -0x104,_0x2b6271);}return this['customDatabaseManager'][_0x47f914(0x6f,0x9e)]();}[_0x3381c2(-0x124,-0x193)](_0x29ec26){function _0x417b34(_0x241848,_0x37e1a3){return _0xdb60(_0x241848-0x23e,_0x37e1a3);}this['customDatabaseManager'][_0x417b34(0x35d,0x303)](_0x29ec26);}async['initialize'](){function _0x46591f(_0x27a8fa,_0x36151c){return _0xdb60(_0x36151c- -0x3e7,_0x27a8fa);}try{await this['customDatabaseManager'][_0x46591f(-0x324,-0x332)]();}catch(_0x4d89a5){console['warn']('Failed to initialize custom database detection:',_0x4d89a5);}}}class StorageBucket{constructor(_0x477dd4,bucketId){this['httpClient']=_0x477dd4,this['bucketId']=bucketId;}async[_0x3381c2(-0x15b,-0x178)](_0x39684f,_0x3b1fd1,_0x5461e2){function _0x50b5ba(_0x416762,_0x4cff70){return _0xdb60(_0x4cff70-0x156,_0x416762);}try{const _0x4a60ac=new FormData();if(_0x3b1fd1 instanceof File)_0x4a60ac['append'](_0x50b5ba(0x31f,0x2de),_0x3b1fd1);else{if(_0x3b1fd1 instanceof Blob)_0x4a60ac[_0x50b5ba(0x16f,0x1e7)]('file',_0x3b1fd1,_0x39684f);else{if(_0x3b1fd1 instanceof ArrayBuffer)_0x4a60ac[_0x50b5ba(0x264,0x1e7)](_0x50b5ba(0x28f,0x2de),new Blob([_0x3b1fd1]),_0x39684f);else typeof _0x3b1fd1===_0x50b5ba(0x30d,0x2b1)&&_0x4a60ac['append']('file',new Blob([_0x3b1fd1],{'type':'text/plain'}),_0x39684f);}}_0x4a60ac[_0x50b5ba(0x1a6,0x1e7)]('path',_0x39684f);_0x5461e2?.[_0x50b5ba(0x2ef,0x285)]&&_0x4a60ac['append'](_0x50b5ba(0x2d6,0x285),_0x5461e2[_0x50b5ba(0x22c,0x285)]);_0x5461e2?.['contentType']&&_0x4a60ac['append'](_0x50b5ba(0x264,0x237),_0x5461e2['contentType']);_0x5461e2?.['metadata']&&_0x4a60ac[_0x50b5ba(0x176,0x1e7)]('metadata',JSON[_0x50b5ba(0x28c,0x21c)](_0x5461e2['metadata']));const _0x348516=_0x50b5ba(0x277,0x20e)+this[_0x50b5ba(0x1c8,0x1e3)]+'/files'+(_0x5461e2?.[_0x50b5ba(0x2b7,0x26f)]?_0x50b5ba(0x2c5,0x27b):''),response=await this['httpClient'][_0x50b5ba(0x267,0x264)](_0x348516,_0x4a60ac,{'headers':{'Content-Type':_0x50b5ba(0x248,0x1ec)}});return{'data':response['data'],'error':null};}catch(_0x5a8c8e){return{'data':null,'error':_0x5a8c8e instanceof EBaaSError?_0x5a8c8e:new EBaaSError(_0x5a8c8e instanceof Error?_0x5a8c8e['message']:_0x50b5ba(0x1c7,0x1fd),0x0,_0x5a8c8e)};}}async[_0x3381c2(-0x10d,-0xb1)](_0x3e5fa0,_0x1f2121){function _0x4afcbd(_0x10caf2,_0x3788c4){return _0xdb60(_0x3788c4-0x252,_0x10caf2);}try{const _0x2f8dfb=new URLSearchParams();_0x1f2121?.['transform']&&Object[_0x4afcbd(0x368,0x3d3)](_0x1f2121[_0x4afcbd(0x337,0x378)])[_0x4afcbd(0x3c0,0x3ca)](([_0x25e9d1,_0x165502])=>{function _0x30e7d5(_0x405138,_0x46aba6){return _0xdb60(_0x405138- -0x119,_0x46aba6);}_0x165502!==undefined&&_0x2f8dfb[_0x30e7d5(-0x88,-0xfe)](_0x25e9d1,String(_0x165502));});const _0x5e9fed='/storage/buckets/'+this['bucketId']+'/files/'+_0x3e5fa0+(_0x2f8dfb['toString']()?'?'+_0x2f8dfb[_0x4afcbd(0x381,0x3d2)]():''),response=await this[_0x4afcbd(0x26e,0x2dc)]['get'](_0x5e9fed,{'responseType':'blob'});return{'data':response[_0x4afcbd(0x2c4,0x321)],'error':null};}catch(_0x13b9fe){return{'data':null,'error':_0x13b9fe instanceof EBaaSError?_0x13b9fe:new EBaaSError(_0x13b9fe instanceof Error?_0x13b9fe[_0x4afcbd(0x37a,0x389)]:_0x4afcbd(0x36b,0x3b4),0x0,_0x13b9fe)};}}async['list'](_0x117d14,_0x24eb0a){function _0x2d33d2(_0x42041e,_0x1c7e26){return _0xdb60(_0x42041e- -0x30,_0x1c7e26);}try{const _0x12d9ab=new URLSearchParams();_0x117d14&&_0x12d9ab['append'](_0x2d33d2(0x104,0xc4),_0x117d14);_0x24eb0a?.[_0x2d33d2(0xf2,0x141)]&&_0x12d9ab[_0x2d33d2(0x61,-0x10)](_0x2d33d2(0xf2,0x11c),String(_0x24eb0a['limit']));_0x24eb0a?.['offset']&&_0x12d9ab['append']('offset',String(_0x24eb0a[_0x2d33d2(0xd6,0x14c)]));_0x24eb0a?.[_0x2d33d2(0xc0,0x69)]&&_0x12d9ab['append']('sortBy',JSON[_0x2d33d2(0x96,0xff)](_0x24eb0a['sortBy']));_0x24eb0a?.[_0x2d33d2(0x9c,0x53)]&&_0x12d9ab[_0x2d33d2(0x61,0x98)](_0x2d33d2(0x9c,0xc0),_0x24eb0a['search']);const _0x3bcb6d='/storage/buckets/'+this['bucketId']+_0x2d33d2(0xea,0x8e)+(_0x12d9ab['toString']()?'?'+_0x12d9ab[_0x2d33d2(0x150,0x108)]():''),response=await this[_0x2d33d2(0x5a,0xda)]['get'](_0x3bcb6d);return{'data':response[_0x2d33d2(0x9f,0x20)],'error':null};}catch(_0x4fe720){return{'data':null,'error':_0x4fe720 instanceof EBaaSError?_0x4fe720:new EBaaSError(_0x4fe720 instanceof Error?_0x4fe720['message']:'Failed\x20to\x20list\x20files',0x0,_0x4fe720)};}}async['remove'](_0x1ed164){function _0x4962d9(_0x2373c8,_0x59f818){return _0xdb60(_0x2373c8-0x3d4,_0x59f818);}try{const response=await this[_0x4962d9(0x45e,0x45c)][_0x4962d9(0x49c,0x51c)]('/storage/buckets/'+this[_0x4962d9(0x461,0x41c)]+_0x4962d9(0x4ee,0x519),{'data':{'paths':_0x1ed164}});return{'data':response[_0x4962d9(0x4a3,0x4b6)],'error':null};}catch(_0x45741a){return{'data':null,'error':_0x45741a instanceof EBaaSError?_0x45741a:new EBaaSError(_0x45741a instanceof Error?_0x45741a[_0x4962d9(0x50b,0x52b)]:_0x4962d9(0x482,0x4c5),0x0,_0x45741a)};}}async[_0x3381c2(-0x132,-0x181)](fromPath,_0x17db7e){function _0x11f18e(_0x37cdc5,_0x3c1fe1){return _0xdb60(_0x3c1fe1-0x6,_0x37cdc5);}try{const response=await this['httpClient'][_0x11f18e(0x176,0x114)]('/storage/buckets/'+this[_0x11f18e(0x80,0x93)]+'/files/move',{'sourceKey':fromPath,'destinationKey':_0x17db7e});return{'data':response['data'],'error':null};}catch(_0x382334){return{'data':null,'error':_0x382334 instanceof EBaaSError?_0x382334:new EBaaSError(_0x382334 instanceof Error?_0x382334['message']:'Failed\x20to\x20move\x20file',0x0,_0x382334)};}}async[_0x3381c2(-0x113,-0xcf)](fromPath,_0x4fd6fe){function _0x66ecfa(_0x3c43d4,_0x4e3d4a){return _0xdb60(_0x3c43d4- -0x237,_0x4e3d4a);}try{const response=await this[_0x66ecfa(-0x1ad,-0x186)]['post'](_0x66ecfa(-0x17f,-0x1c2)+this[_0x66ecfa(-0x1aa,-0x1c3)]+'/files/copy',{'sourceKey':fromPath,'destinationKey':_0x4fd6fe});return{'data':response[_0x66ecfa(-0x168,-0x1b8)],'error':null};}catch(_0x830b7a){return{'data':null,'error':_0x830b7a instanceof EBaaSError?_0x830b7a:new EBaaSError(_0x830b7a instanceof Error?_0x830b7a[_0x66ecfa(-0x100,-0x12b)]:'Failed\x20to\x20copy\x20file',0x0,_0x830b7a)};}}async[_0x3381c2(-0xbe,-0xa4)](_0x5853bb,_0x513e4b,_0x10ed80){function _0x3703ba(_0x351451,_0x2c8ab9){return _0xdb60(_0x2c8ab9- -0x232,_0x351451);}try{const response=await this[_0x3703ba(-0x157,-0x1a8)][_0x3703ba(-0x1a4,-0x124)](_0x3703ba(-0x162,-0x17a)+this['bucketId']+'/files/'+_0x5853bb+'/sign',{'expiresIn':_0x513e4b,..._0x10ed80});return{'data':response['data'],'error':null};}catch(_0x232fd6){return{'data':null,'error':_0x232fd6 instanceof EBaaSError?_0x232fd6:new EBaaSError(_0x232fd6 instanceof Error?_0x232fd6['message']:_0x3703ba(-0x18e,-0x15b),0x0,_0x232fd6)};}}[_0x3381c2(-0x131,-0x125)](_0x4a3b74,_0x2e1866){function _0x57f554(_0x25771,_0x6b21b0){return _0xdb60(_0x6b21b0-0x282,_0x25771);}const _0x17f5e6=new URLSearchParams();_0x2e1866?.[_0x57f554(0x386,0x3a8)]&&Object['entries'](_0x2e1866['transform'])[_0x57f554(0x3f8,0x3fa)](([_0xb3fdb9,_0x4f2b49])=>{_0x4f2b49!==undefined&&_0x17f5e6['append'](_0xb3fdb9,String(_0x4f2b49));});const _0x520668=this[_0x57f554(0x325,0x30c)][_0x57f554(0x3b0,0x3c2)]||'',_0x100b21=_0x520668+'/storage/buckets/'+this[_0x57f554(0x2bd,0x30f)]+_0x57f554(0x3b2,0x366)+_0x4a3b74+(_0x17f5e6[_0x57f554(0x46b,0x402)]()?'?'+_0x17f5e6[_0x57f554(0x3a5,0x402)]():'');return{'data':{'publicUrl':_0x100b21}};}async[_0x3381c2(-0x1ba,-0x1b6)](_0x4077ea){function _0x29bb8b(_0x1578db,_0xb8fe31){return _0xdb60(_0xb8fe31-0x9,_0x1578db);}try{const response=await this[_0x29bb8b(0x36,0x93)][_0x29bb8b(0x169,0x109)](_0x29bb8b(0x128,0xc1)+this[_0x29bb8b(0x91,0x96)]+_0x29bb8b(0xd0,0xed)+_0x4077ea+_0x29bb8b(0x9b,0xf2));return{'data':response[_0x29bb8b(0x97,0xd8)],'error':null};}catch(_0x122b66){return{'data':null,'error':_0x122b66 instanceof EBaaSError?_0x122b66:new EBaaSError(_0x122b66 instanceof Error?_0x122b66['message']:'Failed\x20to\x20get\x20file\x20info',0x0,_0x122b66)};}}async['updateFileMetadata'](_0x35b109,metadata){function _0x58736f(_0xa98707,_0x337ce7){return _0xdb60(_0xa98707- -0x36a,_0x337ce7);}try{const response=await this['httpClient']['put'](_0x58736f(-0x2b2,-0x2b4)+this['bucketId']+_0x58736f(-0x286,-0x2e6)+_0x35b109+'/metadata',{'metadata':metadata});return{'data':response['data'],'error':null};}catch(_0x4e998c){return{'data':null,'error':_0x4e998c instanceof EBaaSError?_0x4e998c:new EBaaSError(_0x4e998c instanceof Error?_0x4e998c['message']:_0x58736f(-0x225,-0x1f9),0x0,_0x4e998c)};}}}class StorageClient{constructor(_0x1b47cf){this['httpClient']=_0x1b47cf;}['from'](bucketId){return new StorageBucket(this['httpClient'],bucketId);}async['createBucket'](_0x18f542,_0x1056c9){function _0x5ab819(_0x28ed90,_0x38d4bc){return _0xdb60(_0x28ed90- -0x72,_0x38d4bc);}try{const response=await this['httpClient']['post'](_0x5ab819(0x67,0xe),{'id':_0x18f542,..._0x1056c9});return{'data':response[_0x5ab819(0x5d,0xcb)],'error':null};}catch(_0x3143a5){return{'data':null,'error':_0x3143a5 instanceof EBaaSError?_0x3143a5:new EBaaSError(_0x3143a5 instanceof Error?_0x3143a5['message']:'Failed\x20to\x20create\x20bucket',0x0,_0x3143a5)};}}async[_0x3381c2(-0x172,-0x167)](_0x3a66c0){function _0x13eb89(_0x347b84,_0x594314){return _0xdb60(_0x347b84-0x350,_0x594314);}try{const response=await this['httpClient']['get']('/storage/buckets/'+_0x3a66c0);return{'data':response[_0x13eb89(0x41f,0x41a)],'error':null};}catch(_0x3bd2ae){return{'data':null,'error':_0x3bd2ae instanceof EBaaSError?_0x3bd2ae:new EBaaSError(_0x3bd2ae instanceof Error?_0x3bd2ae['message']:_0x13eb89(0x3f1,0x467),0x0,_0x3bd2ae)};}}async['listBuckets'](){function _0x154962(_0x168e61,_0x4e8949){return _0xdb60(_0x4e8949-0x157,_0x168e61);}try{const response=await this[_0x154962(0x252,0x1e1)]['get']('/storage/buckets');return{'data':response[_0x154962(0x1e1,0x226)],'error':null};}catch(_0x1d9924){return{'data':null,'error':_0x1d9924 instanceof EBaaSError?_0x1d9924:new EBaaSError(_0x1d9924 instanceof Error?_0x1d9924[_0x154962(0x2ac,0x28e)]:'Failed\x20to\x20list\x20buckets',0x0,_0x1d9924)};}}async[_0x3381c2(-0x1a7,-0x1db)](_0x5e17ce,_0xae09af){function _0xefd0fd(_0xcf9e78,_0x34ab05){return _0xdb60(_0xcf9e78-0x17b,_0x34ab05);}try{const response=await this[_0xefd0fd(0x205,0x1f3)]['put']('/storage/buckets/'+_0x5e17ce,_0xae09af);return{'data':response[_0xefd0fd(0x24a,0x227)],'error':null};}catch(_0x2955b3){return{'data':null,'error':_0x2955b3 instanceof EBaaSError?_0x2955b3:new EBaaSError(_0x2955b3 instanceof Error?_0x2955b3[_0xefd0fd(0x2b2,0x2ad)]:'Failed\x20to\x20update\x20bucket',0x0,_0x2955b3)};}}async['deleteBucket'](_0x16f3ab){function _0x493365(_0x49ea0f,_0x4475b5){return _0xdb60(_0x49ea0f-0xd9,_0x4475b5);}try{const response=await this[_0x493365(0x163,0x180)]['delete'](_0x493365(0x191,0x1fb)+_0x16f3ab);return{'data':response['data'],'error':null};}catch(_0x4bc387){return{'data':null,'error':_0x4bc387 instanceof EBaaSError?_0x4bc387:new EBaaSError(_0x4bc387 instanceof Error?_0x4bc387['message']:_0x493365(0x1bf,0x1b2),0x0,_0x4bc387)};}}async[_0x3381c2(-0x1b1,-0x15d)](){function _0x1ee837(_0xf9db23,_0x24976a){return _0xdb60(_0xf9db23-0xa3,_0x24976a);}try{const response=await this['httpClient'][_0x1ee837(0x1a3,0x16f)](_0x1ee837(0x1b0,0x1da));return{'data':response['data'],'error':null};}catch(_0x522e87){return{'data':null,'error':_0x522e87 instanceof EBaaSError?_0x522e87:new EBaaSError(_0x522e87 instanceof Error?_0x522e87[_0x1ee837(0x1da,0x1ba)]:'Failed\x20to\x20get\x20storage\x20usage',0x0,_0x522e87)};}}}class RealtimeChannel extends EventEmitter{constructor(_0x31d316,_0x18decc){super(),this['joinedOnce']=![],this['state']=_0x4804ff(0x324,0x36e);function _0x4804ff(_0x3697ac,_0x51d2e2){return _0xdb60(_0x3697ac-0x25b,_0x51d2e2);}this['subscriptions']=new Map(),this[_0x4804ff(0x34e,0x2d4)]=_0x31d316,this[_0x4804ff(0x3a4,0x330)]=_0x18decc;}[_0x3381c2(-0x18d,-0x145)](_0x1025ef){!this['joinedOnce']&&(this[_0x48be78(-0x235,-0x29f)]=!![],this['_join']());_0x1025ef&&this['on']('status',_0x1025ef);function _0x48be78(_0x3fc423,_0x2dfd9a){return _0xdb60(_0x2dfd9a- -0x389,_0x3fc423);}return this;}[_0x3381c2(-0x118,-0x137)](filter,_0x47390a){function _0x4d6c14(_0x119b40,_0x2dc8fe){return _0xdb60(_0x119b40- -0x12a,_0x2dc8fe);}const _0x3452ec='postgres_changes:'+JSON[_0x4d6c14(-0x64,-0x69)](filter);super['on'](_0x3452ec,_0x47390a);const _0x40e86b={'unsubscribe':()=>{super[_0x21b3bf(-0x208,-0x232)](_0x3452ec,_0x47390a);function _0x21b3bf(_0x10b330,_0x586af4){return _0xdb60(_0x10b330- -0x2c2,_0x586af4);}this[_0x21b3bf(-0x1b2,-0x14b)]['delete'](_0x3452ec);}};return this['subscriptions']['set'](_0x3452ec,_0x40e86b),this['socket']?.[_0x4d6c14(0x13,0x8c)]&&this['state']===_0x4d6c14(0x36,0xb)&&this['socket']['emit'](_0x4d6c14(-0x71,-0x5b),{'topic':this[_0x4d6c14(-0x37,-0x6c)],'filter':filter,'ref':this['makeRef']()}),_0x40e86b;}[_0x3381c2(-0xca,-0xf6)](filter,_0x3dbf12){function _0x3f83ba(_0x20ebe7,_0x1384da){return _0xdb60(_0x20ebe7-0x339,_0x1384da);}const _0x36942a='broadcast:'+JSON[_0x3f83ba(0x3ff,0x3f0)](filter);super['on'](_0x36942a,_0x3dbf12);const _0xf09afd={'unsubscribe':()=>{function _0x404592(_0x289aff,_0x1b398f){return _0xdb60(_0x289aff- -0x211,_0x1b398f);}super[_0x404592(-0x157,-0xe9)](_0x36942a,_0x3dbf12),this['subscriptions'][_0x404592(-0x149,-0x177)](_0x36942a);}};return this[_0x3f83ba(0x449,0x45b)][_0x3f83ba(0x46e,0x417)](_0x36942a,_0xf09afd),_0xf09afd;}[_0x3381c2(-0x196,-0x1a2)](filter,_0x7c79e5){const _0x557b25='presence:'+JSON[_0x1e2b90(-0x27,-0x2c)](filter);function _0x1e2b90(_0x151ce0,_0x277b34){return _0xdb60(_0x277b34- -0xf2,_0x151ce0);}super['on'](_0x557b25,_0x7c79e5);const _0x3060fa={'unsubscribe':()=>{function _0x138f96(_0x545814,_0x1ce966){return _0xdb60(_0x545814-0xac,_0x1ce966);}super['off'](_0x557b25,_0x7c79e5),this[_0x138f96(0x1bc,0x1df)]['delete'](_0x557b25);}};return this['subscriptions']['set'](_0x557b25,_0x3060fa),_0x3060fa;}[_0x3381c2(-0x123,-0xb0)](_0x1a2e78){return new Promise(_0x3c66a1=>{function _0x3dbba7(_0xf1ef48,_0x99ecbe){return _0xdb60(_0xf1ef48- -0x111,_0x99ecbe);}this[_0x3dbba7(0x38,-0x4)]?.[_0x3dbba7(0x2c,0x4a)]&&this[_0x3dbba7(0x18,0x16)]==='joined'?(this[_0x3dbba7(0x38,0x49)]['emit']('broadcast',{'topic':this['topic'],'event':_0x1a2e78[_0x3dbba7(0xd,0x25)],'payload':_0x1a2e78,'ref':this[_0x3dbba7(-0x43,0xc)]()}),_0x3c66a1('ok')):_0x3c66a1(_0x3dbba7(-0x85,-0x73));});}[_0x3381c2(-0xbc,-0xc8)](_0x3595db){return new Promise(_0x332ee0=>{function _0x2b2586(_0x476b68,_0x208409){return _0xdb60(_0x476b68- -0x189,_0x208409);}this[_0x2b2586(-0x40,-0xbb)]?.[_0x2b2586(-0x4c,0x11)]&&this[_0x2b2586(-0x60,-0x65)]==='joined'?(this['socket'][_0x2b2586(-0x9b,-0x57)]('presence',{'topic':this[_0x2b2586(-0x96,-0xeb)],'event':_0x2b2586(-0x2,0xa),'payload':_0x3595db,'ref':this[_0x2b2586(-0xbb,-0x7c)]()}),_0x332ee0('ok')):_0x332ee0(_0x2b2586(-0xfd,-0x9c));});}['untrack'](){return new Promise(_0x4c7adb=>{function _0x57b5f4(_0x4c2ed7,_0x1036fe){return _0xdb60(_0x4c2ed7- -0x235,_0x1036fe);}this[_0x57b5f4(-0xec,-0xd4)]?.[_0x57b5f4(-0xf8,-0xbc)]&&this[_0x57b5f4(-0x10c,-0x101)]==='joined'?(this['socket']['emit'](_0x57b5f4(-0xdc,-0x85),{'topic':this[_0x57b5f4(-0x142,-0xda)],'event':'untrack','ref':this['makeRef']()}),_0x4c7adb('ok')):_0x4c7adb('error');});}['unsubscribe'](){return new Promise(_0x3bb1b6=>{this['state']='leaving',this[_0x5cd095(0x38b,0x391)][_0x5cd095(0x3f3,0x37b)](_0x5b3655=>{function _0x138748(_0xa5364d,_0x5a25ad){return _0xdb60(_0x5a25ad-0x3c8,_0xa5364d);}_0x5b3655[_0x138748(0x5af,0x54e)]();}),this[_0x5cd095(0x38b,0x3d8)]['clear']();function _0x5cd095(_0x79cd1f,_0x2b83cc){return _0xdb60(_0x79cd1f-0x27b,_0x2b83cc);}this['socket']?.['connected']&&this[_0x5cd095(0x3c4,0x3d5)][_0x5cd095(0x369,0x30e)](_0x5cd095(0x378,0x35f),{'topic':this['topic'],'ref':this[_0x5cd095(0x349,0x304)]()}),this['state']='closed',this[_0x5cd095(0x320,0x357)](),_0x3bb1b6('ok');});}['_join'](){function _0x1a683f(_0x139fae,_0x536dc){return _0xdb60(_0x536dc- -0xb3,_0x139fae);}if(this['state']==='leaving')return;this['state']='joining',this['socket']?.['connected']&&(this[_0x1a683f(0xd2,0x96)][_0x1a683f(0x2b,0x3b)](_0x1a683f(-0x5d,0xb),{'topic':this['topic'],'ref':this['makeRef']()}),setTimeout(()=>{this['state']==='joining'&&(this['state']='joined',this['emit']('status','SUBSCRIBED'));},0x64));}['_rejoin'](){function _0x432313(_0x294b84,_0x158e16){return _0xdb60(_0x294b84-0x2ba,_0x158e16);}this[_0x432313(0x3a4,0x350)]&&(this[_0x432313(0x41d,0x45a)](),this['subscriptions']['forEach']((_0x15c473,_0x595363)=>{function _0x26a25f(_0x54e379,_0xd83173){return _0xdb60(_0xd83173-0x4d,_0x54e379);}if(_0x595363['startsWith']('postgres_changes:')){const filter=JSON['parse'](_0x595363[_0x26a25f(0x114,0x114)]('postgres_changes:',''));this[_0x26a25f(0x1a7,0x196)]?.[_0x26a25f(0x188,0x13b)]('subscribe_postgres_changes',{'topic':this['topic'],'filter':filter,'ref':this[_0x26a25f(0xdd,0x11b)]()});}}));}['_trigger'](_0x332f63,_0x3b0a07){if(_0x332f63===_0x851ec2(-0x139,-0xda)){const _0x39d880=_0x851ec2(0x12,-0x40)+JSON[_0x851ec2(-0x102,-0xec)](_0x3b0a07[_0x851ec2(-0x112,-0x11a)]||{});this[_0x851ec2(-0x133,-0xc4)](_0x39d880,_0x3b0a07);}else{if(_0x332f63==='broadcast'){const _0x969637='broadcast:'+JSON[_0x851ec2(-0x15e,-0xec)]({'event':_0x3b0a07['event']});this[_0x851ec2(-0x124,-0xc4)](_0x969637,_0x3b0a07);}else{if(_0x332f63===_0x851ec2(-0xb,-0x59)){const _0x962192='presence:'+JSON[_0x851ec2(-0xff,-0xec)]({'event':_0x3b0a07[_0x851ec2(-0xb1,-0x94)]});this['emit'](_0x962192,_0x3b0a07);}}}function _0x851ec2(_0x2c1be1,_0x18dd4b){return _0xdb60(_0x18dd4b- -0x1b2,_0x2c1be1);}this[_0x851ec2(-0x57,-0xc4)](_0x332f63,_0x3b0a07);}[_0x3381c2(-0x197,-0x1c6)](_0x52db7a){function _0x35fef5(_0x5df4f3,_0x11cf6e){return _0xdb60(_0x5df4f3-0x35b,_0x11cf6e);}this['state']=_0x52db7a;let status;switch(_0x52db7a){case'joined':status='SUBSCRIBED';break;case _0x35fef5(0x41e,0x489):status='CHANNEL_ERROR';break;case'closed':status='CLOSED';break;default:return;}this['emit'](_0x35fef5(0x428,0x404),status);}[_0x3381c2(-0x175,-0x1e2)](){function _0x1e6e26(_0x5d5e39,_0x4d89b8){return _0xdb60(_0x5d5e39-0x110,_0x4d89b8);}return Math[_0x1e6e26(0x1f5,0x1a7)]()['toString'](0x24)['substring'](0x2,0xf);}[_0x3381c2(-0x13e,-0xcc)](){function _0x22c3e5(_0x216f96,_0x548adc){return _0xdb60(_0x548adc- -0x8c,_0x216f96);}return this[_0x22c3e5(0xab,0x9d)];}}class RealtimeClient{constructor(_0x12303f,_0x4b89bf,_0x53dd90={}){function _0x699c61(_0x3a29f9,_0x3659c7){return _0xdb60(_0x3a29f9-0x59,_0x3659c7);}this[_0x699c61(0x1a2,0x181)]=null,this[_0x699c61(0x1c3,0x21e)]=new Map(),this[_0x699c61(0x103,0x175)]='disconnected',this['reconnectAttempts']=0x0,this['maxReconnectAttempts']=0x5,this[_0x699c61(0x170,0x117)]=_0x12303f,this[_0x699c61(0x150,0x12e)]=_0x4b89bf,this[_0x699c61(0x198,0x1de)]={'heartbeatInterval':0x7530,'reconnectInterval':0x1388,'maxReconnectAttempts':0x5,..._0x53dd90};}[_0x3381c2(-0xc6,-0x98)](){return new Promise((_0x1aec93,_0x218c63)=>{if(this[_0x41b073(0x2c8,0x318)]?.['connected']){_0x1aec93();return;}this['connectionState']='connecting',this['socket']=socket_ioClient['io'](this['url'],{'auth':{'apikey':this['apiKey']},'transports':[_0x41b073(0x2db,0x2b9)],'reconnection':!![],'reconnectionDelay':this['options']['reconnectInterval'],'reconnectionAttempts':this[_0x41b073(0x2be,0x2d6)]['maxReconnectAttempts'],...this[_0x41b073(0x2be,0x2e5)][_0x41b073(0x275,0x26d)]}),this['socket']['on'](_0x41b073(0x2fc,0x2d9),()=>{function _0x7f2502(_0x53d31b,_0x4c53cc){return _0xdb60(_0x53d31b- -0x178,_0x4c53cc);}this['connectionState']='connected',this[_0x7f2502(-0x8,-0x23)]=0x0,this[_0x7f2502(-0xd8,-0x127)](),_0x1aec93();}),this[_0x41b073(0x2c8,0x2d9)]['on']('disconnect',_0x34ad45=>{this[_0x1b1276(0x307,0x33a)]=_0x1b1276(0x2f2,0x2c5);function _0x1b1276(_0x368b63,_0x841b1b){return _0xdb60(_0x368b63-0x25d,_0x841b1b);}this['channels']['forEach'](channel=>{function _0x13b3a7(_0x10c069,_0x3663d3){return _0xdb60(_0x3663d3- -0x2ec,_0x10c069);}channel[_0x13b3a7(-0x1c8,-0x240)]('closed');});});function _0x41b073(_0xa1ced6,_0x2a5245){return _0xdb60(_0xa1ced6-0x17f,_0x2a5245);}this[_0x41b073(0x2c8,0x31e)]['on']('connect_error',_0x12bd5f=>{this[_0xf5c4ee(0xa1,0x5b)]='error',this[_0xf5c4ee(0x167,0x153)]++;function _0xf5c4ee(_0x262e05,_0x5bfb59){return _0xdb60(_0x262e05- -0x9,_0x5bfb59);}this[_0xf5c4ee(0x167,0x18e)]>=this[_0xf5c4ee(0x139,0x108)]&&_0x218c63(new Error(_0xf5c4ee(0x96,0xd6)+this[_0xf5c4ee(0x139,0x154)]+'\x20attempts:\x20'+_0x12bd5f[_0xf5c4ee(0x12e,0x118)]));}),this['socket']['on'](_0x41b073(0x26c,0x2a9),()=>{this[_0x599228(0x1c,-0x32)]='connected',this['reconnectAttempts']=0x0;function _0x599228(_0x3d5c66,_0x1c1d5c){return _0xdb60(_0x1c1d5c- -0xdc,_0x3d5c66);}this['channels']['forEach'](channel=>{channel['_rejoin']();});}),this[_0x41b073(0x2c8,0x251)]['on']('postgres_changes',_0x28ffd0=>{const channel=this[_0x3059ed(-0x26,-0x50)]['get'](_0x28ffd0[_0x3059ed(-0x74,-0xc7)]);function _0x3059ed(_0x5a16c6,_0xf4725c){return _0xdb60(_0xf4725c- -0x1ba,_0x5a16c6);}channel&&channel['_trigger'](_0x3059ed(-0x95,-0xe2),_0x28ffd0);}),this['socket']['on'](_0x41b073(0x2f6,0x279),_0x52641c=>{const channel=this['channels'][_0x48ee77(0x254,0x2cb)](_0x52641c[_0x48ee77(0x247,0x233)]);function _0x48ee77(_0x4fe376,_0x1ce6d2){return _0xdb60(_0x4fe376-0x154,_0x1ce6d2);}channel&&channel[_0x48ee77(0x243,0x1e7)](_0x48ee77(0x2cb,0x342),_0x52641c);}),this['socket']['on']('presence',_0x115901=>{function _0x45028e(_0x382206,_0x124f8b){return _0xdb60(_0x382206-0x7b,_0x124f8b);}const channel=this['channels'][_0x45028e(0x17b,0x18b)](_0x115901['topic']);channel&&channel[_0x45028e(0x16a,0x19b)](_0x45028e(0x1d4,0x17f),_0x115901);});});}[_0x3381c2(-0xd8,-0x122)](){function _0x4dfc71(_0x268309,_0x1f3b09){return _0xdb60(_0x268309-0x97,_0x1f3b09);}this['socket']&&(this['socket'][_0x4dfc71(0x202,0x1a0)](),this[_0x4dfc71(0x1e0,0x250)]=null),this['connectionState']=_0x4dfc71(0x12c,0x17f),this[_0x4dfc71(0x201,0x234)]['clear']();}['channel'](_0x423066){function _0x42f308(_0x324378,_0x3a119a){return _0xdb60(_0x324378- -0x35e,_0x3a119a);}if(this['channels'][_0x42f308(-0x273,-0x290)](_0x423066))return this['channels']['get'](_0x423066);const channel=new RealtimeChannel(_0x423066,this['socket']);return this['channels'][_0x42f308(-0x229,-0x28a)](_0x423066,channel),this['connectionState']===_0x42f308(-0x221,-0x1ff)&&channel[_0x42f308(-0x1fb,-0x21a)](),channel;}['removeChannel'](channel){const _0x1b1c61=channel[_0x3edfc0(0xf4,0xe9)];function _0x3edfc0(_0x244776,_0x58c12c){return _0xdb60(_0x58c12c- -0xa,_0x244776);}this[_0x3edfc0(0x139,0x160)][_0x3edfc0(0xe0,0xe1)](_0x1b1c61)&&(this[_0x3edfc0(0x121,0x160)]['delete'](_0x1b1c61),channel[_0x3edfc0(0x16e,0x17c)]());}['removeAllChannels'](){function _0x5e1842(_0x145b56,_0x2f9d68){return _0xdb60(_0x145b56- -0x2cc,_0x2f9d68);}this[_0x5e1842(-0x162,-0x177)]['forEach'](channel=>{function _0x1cd3af(_0x1ba3c0,_0x4bfddb){return _0xdb60(_0x1ba3c0- -0x244,_0x4bfddb);}channel[_0x1cd3af(-0xbe,-0x5e)]();}),this[_0x5e1842(-0x162,-0xf3)]['clear']();}[_0x3381c2(-0x12e,-0x17c)](){function _0x15e860(_0x2e14c9,_0x3cf421){return _0xdb60(_0x2e14c9- -0xd1,_0x3cf421);}return Array[_0x15e860(0x2b,0x4f)](this[_0x15e860(0x99,0x53)]['values']());}['isConnected'](){function _0x3933af(_0x3b9284,_0x337840){return _0xdb60(_0x3b9284-0x244,_0x337840);}return this['connectionState']===_0x3933af(0x381,0x3bc)&&!!this['socket']?.[_0x3933af(0x381,0x3ea)];}[_0x3381c2(-0x13b,-0xcd)](){function _0x338ed7(_0x594ac6,_0x158711){return _0xdb60(_0x158711-0x318,_0x594ac6);}return this[_0x338ed7(0x42f,0x3c2)];}[_0x3381c2(-0x18c,-0x183)](_0x123c4f){const _0x598f0f=()=>_0x123c4f(this['connectionState']);this['socket']&&(this[_0x4981b0(0x47d,0x43f)]['on'](_0x4981b0(0x4b1,0x531),()=>{function _0x51d38c(_0x555431,_0x4a7f57){return _0xdb60(_0x555431- -0x1be,_0x4a7f57);}this['connectionState']=_0x51d38c(-0x81,-0x70),_0x598f0f();}),this['socket']['on'](_0x4981b0(0x49f,0x4d2),()=>{this[_0x2c94f6(-0x130,-0x17b)]=_0x2c94f6(-0x145,-0x18f);function _0x2c94f6(_0x2e89ac,_0x5c9ca4){return _0xdb60(_0x2e89ac- -0x1da,_0x5c9ca4);}_0x598f0f();}),this['socket']['on']('connect_error',()=>{function _0x3f6537(_0x3888be,_0xe51121){return _0xdb60(_0x3888be- -0x9,_0xe51121);}this[_0x3f6537(0xa1,0xd3)]='error',_0x598f0f();}));function _0x4981b0(_0x68114b,_0x278d35){return _0xdb60(_0x68114b-0x334,_0x278d35);}return()=>{function _0x50ff1f(_0x138b2b,_0x24d020){return _0xdb60(_0x24d020-0x2c7,_0x138b2b);}this['socket']&&(this[_0x50ff1f(0x443,0x410)][_0x50ff1f(0x3ed,0x381)]('connect',_0x598f0f),this[_0x50ff1f(0x3e7,0x410)][_0x50ff1f(0x388,0x381)](_0x50ff1f(0x3d3,0x432),_0x598f0f),this[_0x50ff1f(0x3de,0x410)]['off'](_0x50ff1f(0x43c,0x3db),_0x598f0f));};}['setupHeartbeat'](){if(!this['options']['heartbeatInterval']||!this['socket'])return;const interval=setInterval(()=>{function _0x10ea00(_0x3a6891,_0x5d86a5){return _0xdb60(_0x5d86a5- -0xdd,_0x3a6891);}this[_0x10ea00(0x63,0x6c)]?.[_0x10ea00(0xc0,0x60)]?this['socket'][_0x10ea00(0x85,0x11)](_0x10ea00(0x45,-0x3),{'timestamp':Date['now']()}):clearInterval(interval);},this['options']['heartbeatInterval']);}['_getSocket'](){function _0x1961dd(_0xbcab3f,_0xf60754){return _0xdb60(_0xf60754-0x1da,_0xbcab3f);}return this[_0x1961dd(0x34a,0x323)];}}class FunctionsClient{constructor(_0x4594bc){this['httpClient']=_0x4594bc;}async[_0x3381c2(-0x10b,-0x146)](_0x1383be,_0x10a558){function _0x50988f(_0x426b28,_0x434bfe){return _0xdb60(_0x434bfe- -0x28c,_0x426b28);}try{const _0x540952=_0x10a558?.['method']||'POST',headers={'Content-Type':'application/json',..._0x10a558?.['headers']};let response;const _0x5a7e6d='/functions/v1/'+_0x1383be;switch(_0x540952['toUpperCase']()){case'GET':response=await this['httpClient'][_0x50988f(-0x184,-0x18c)](_0x5a7e6d,{'headers':headers,'params':_0x10a558?.[_0x50988f(-0x1cc,-0x170)]});break;case'POST':response=await this['httpClient'][_0x50988f(-0x1c4,-0x17e)](_0x5a7e6d,_0x10a558?.[_0x50988f(-0x11b,-0x170)],{'headers':headers});break;case'PUT':response=await this[_0x50988f(-0x196,-0x202)]['put'](_0x5a7e6d,_0x10a558?.[_0x50988f(-0x1ce,-0x170)],{'headers':headers});break;case'PATCH':response=await this[_0x50988f(-0x1f5,-0x202)][_0x50988f(-0x172,-0x1e1)](_0x5a7e6d,_0x10a558?.[_0x50988f(-0x17a,-0x170)],{'headers':headers});break;case'DELETE':response=await this[_0x50988f(-0x248,-0x202)]['delete'](_0x5a7e6d,{'headers':headers,'data':_0x10a558?.['body']});break;default:throw new EBaaSError('Unsupported\x20HTTP\x20method:\x20'+_0x540952,0x190);}return{'data':response[_0x50988f(-0x20e,-0x1bd)],'error':null};}catch(_0x5161a9){return{'data':null,'error':_0x5161a9 instanceof EBaaSError?_0x5161a9:new EBaaSError(_0x5161a9 instanceof Error?_0x5161a9['message']:'Function\x20invocation\x20failed',0x0,_0x5161a9)};}}async[_0x3381c2(-0xed,-0xd4)](){function _0x3943e0(_0x465bd2,_0x184139){return _0xdb60(_0x465bd2-0x393,_0x184139);}try{const response=await this['httpClient']['get'](_0x3943e0(0x4a6,0x436));return{'data':response[_0x3943e0(0x462,0x469)],'error':null};}catch(_0x1fd39f){return{'data':null,'error':_0x1fd39f instanceof EBaaSError?_0x1fd39f:new EBaaSError(_0x1fd39f instanceof Error?_0x1fd39f['message']:'Failed\x20to\x20list\x20functions',0x0,_0x1fd39f)};}}async['get'](_0x434fb0){function _0x4a778b(_0x5d2e27,_0x2e5c9f){return _0xdb60(_0x5d2e27-0xf3,_0x2e5c9f);}try{const response=await this['httpClient'][_0x4a778b(0x1f3,0x1af)]('/functions/v1/'+_0x434fb0+_0x4a778b(0x1dc,0x19f));return{'data':response['data'],'error':null};}catch(_0x2f197c){return{'data':null,'error':_0x2f197c instanceof EBaaSError?_0x2f197c:new EBaaSError(_0x2f197c instanceof Error?_0x2f197c[_0x4a778b(0x22a,0x1e1)]:'Failed\x20to\x20get\x20function',0x0,_0x2f197c)};}}async['deploy'](_0x495fb5,_0x53dded){function _0x551b3c(_0x2c34dc,_0x380448){return _0xdb60(_0x2c34dc-0x385,_0x380448);}try{const _0x62879f=new FormData();if(_0x53dded[_0x551b3c(0x49d,0x4f3)]instanceof File)_0x62879f['append']('code',_0x53dded[_0x551b3c(0x49d,0x493)]);else typeof _0x53dded[_0x551b3c(0x49d,0x4be)]===_0x551b3c(0x4e0,0x4a3)&&_0x62879f[_0x551b3c(0x416,0x3d3)](_0x551b3c(0x49d,0x42f),new Blob([_0x53dded[_0x551b3c(0x49d,0x4e2)]],{'type':'text/plain'}),'index.ts');_0x53dded['entrypoint']&&_0x62879f[_0x551b3c(0x416,0x407)](_0x551b3c(0x476,0x4c8),_0x53dded[_0x551b3c(0x476,0x4ed)]);_0x53dded['env']&&_0x62879f['append'](_0x551b3c(0x4dd,0x535),JSON[_0x551b3c(0x44b,0x45a)](_0x53dded[_0x551b3c(0x4dd,0x54f)]));_0x53dded['importMap']&&_0x62879f['append'](_0x551b3c(0x419,0x3a5),JSON['stringify'](_0x53dded[_0x551b3c(0x419,0x401)]));_0x53dded['verify']!==undefined&&_0x62879f['append'](_0x551b3c(0x480,0x471),String(_0x53dded[_0x551b3c(0x480,0x4a6)]));const response=await this['httpClient']['post'](_0x551b3c(0x457,0x3e9)+_0x495fb5+'/deploy',_0x62879f,{'headers':{'Content-Type':_0x551b3c(0x41b,0x3eb)}});return{'data':response[_0x551b3c(0x454,0x3fb)],'error':null};}catch(_0x505708){return{'data':null,'error':_0x505708 instanceof EBaaSError?_0x505708:new EBaaSError(_0x505708 instanceof Error?_0x505708[_0x551b3c(0x4bc,0x4d1)]:_0x551b3c(0x446,0x3f8),0x0,_0x505708)};}}async[_0x3381c2(-0x17b,-0x13e)](_0x525efa){function _0xc2c5e9(_0x9aa2ec,_0xd21c3c){return _0xdb60(_0x9aa2ec-0x2e7,_0xd21c3c);}try{const response=await this['httpClient'][_0xc2c5e9(0x3af,0x423)]('/functions/v1/'+_0x525efa);return{'data':response['data'],'error':null};}catch(_0x5be403){return{'data':null,'error':_0x5be403 instanceof EBaaSError?_0x5be403:new EBaaSError(_0x5be403 instanceof Error?_0x5be403[_0xc2c5e9(0x41e,0x417)]:'Failed\x20to\x20delete\x20function',0x0,_0x5be403)};}}async[_0x3381c2(-0x116,-0xd4)](_0xdb8a29,_0x27edee){function _0x16364f(_0x4cfa9f,_0x5c8dd9){return _0xdb60(_0x5c8dd9- -0x100,_0x4cfa9f);}try{const response=await this[_0x16364f(-0xec,-0x76)][_0x16364f(-0x53,0x28)]('/functions/v1/'+_0xdb8a29+'/env',{'env':_0x27edee});return{'data':response[_0x16364f(-0x7e,-0x31)],'error':null};}catch(_0x53c1ab){return{'data':null,'error':_0x53c1ab instanceof EBaaSError?_0x53c1ab:new EBaaSError(_0x53c1ab instanceof Error?_0x53c1ab['message']:'Failed\x20to\x20update\x20function\x20environment',0x0,_0x53c1ab)};}}async['getLogs'](_0x1a5d70,_0x1ffbb4){function _0x5f4148(_0x24cfe9,_0x2af99c){return _0xdb60(_0x24cfe9- -0x288,_0x2af99c);}try{const _0x110e3b=new URLSearchParams();_0x1ffbb4?.[_0x5f4148(-0x166,-0x1c9)]&&_0x110e3b['append']('limit',String(_0x1ffbb4['limit']));_0x1ffbb4?.[_0x5f4148(-0x182,-0x18c)]&&_0x110e3b['append']('offset',String(_0x1ffbb4[_0x5f4148(-0x182,-0x169)]));_0x1ffbb4?.[_0x5f4148(-0x129,-0x1a2)]&&_0x110e3b[_0x5f4148(-0x1f7,-0x1e9)](_0x5f4148(-0x129,-0x16d),_0x1ffbb4['level']);const _0x10da49='/functions/v1/'+_0x1a5d70+_0x5f4148(-0x15c,-0x1d9)+(_0x110e3b[_0x5f4148(-0x108,-0x105)]()?'?'+_0x110e3b['toString']():''),response=await this[_0x5f4148(-0x1fe,-0x1cb)]['get'](_0x10da49);return{'data':response['data'],'error':null};}catch(_0x35bf20){return{'data':null,'error':_0x35bf20 instanceof EBaaSError?_0x35bf20:new EBaaSError(_0x35bf20 instanceof Error?_0x35bf20[_0x5f4148(-0x151,-0x18e)]:_0x5f4148(-0x18e,-0x111),0x0,_0x35bf20)};}}async[_0x3381c2(-0x184,-0x145)](_0x2954c9,_0x5d7c7c){function _0x160a6b(_0x53d4e8,_0x5dcffa){return _0xdb60(_0x53d4e8- -0x395,_0x5dcffa);}try{const _0x1d9b01=new URLSearchParams();_0x5d7c7c?.['period']&&_0x1d9b01['append']('period',_0x5d7c7c[_0x160a6b(-0x2fb,-0x295)]);const _0x5cf93=_0x160a6b(-0x2c3,-0x263)+_0x2954c9+'/metrics'+(_0x1d9b01['toString']()?'?'+_0x1d9b01[_0x160a6b(-0x215,-0x254)]():''),response=await this[_0x160a6b(-0x30b,-0x343)][_0x160a6b(-0x295,-0x2f3)](_0x5cf93);return{'data':response[_0x160a6b(-0x2c6,-0x262)],'error':null};}catch(_0x2ab392){return{'data':null,'error':_0x2ab392 instanceof EBaaSError?_0x2ab392:new EBaaSError(_0x2ab392 instanceof Error?_0x2ab392[_0x160a6b(-0x25e,-0x2d5)]:_0x160a6b(-0x241,-0x2b2),0x0,_0x2ab392)};}}}function _0x5056(){const _0x1b45ca=['C2vSzwn0','C2v0qxv0AfrVA2vU','sfruucbYzxf1zxn0igzHAwXLza','q3vZDg9Trgf0ywjHC2vnyw5Hz2vY','z2v0u3rHDgu','B2zMC2v0','mtq4mde2nhvHu3LJyW','z2v0q29UBMvJDgLVBLn0yxrL','B3jKzxi','y29TBw9U','l2f1DgGVDJeVC2rRl3nPz25PBG','y29SDw1U','l3n0B3jHz2uVDxnHz2u','Cg9ZDa','Cg9ZDgDYzxnvC2vYBMfTzq','C3vIC2nYAxb0Aw9UCW','Bw92zq','z2v0uhvIBgLJvxjS','l2z1BMn0Aw9UCY92mq','y29UBMvJDf9LCNjVCG','z2v0q2HHBM5LBhm','z2v0q3vZDg9Trgf0ywjHC2vtDgf0Dxm','DxjS','y29Kzq','DxbZzxj0','l2zPBgvZ','DxbKyxrLrgf0yq','yM9KEq','p29WzxjHDgLVBJ1ZzwXLy3q','zxzLBNq','C2v0v29YA3nWywnLswq','C2vUza','CNbJ','BgLTAxq','mZiYoteWt1fTDxne','y2fWDhvYzvn0ywnRvhjHy2u','p3vWC2vYDd10CNvL','DhjHBNnMB3jT','CMvTB3zLqxv0AfrVA2vU','Chv0','C3rHDgu','DgfIBgu','B25qB3n0z3jLC0nOyw5Nzxm','l2XVz3m','DxbKyxrLrw52','C2v0u2vZC2LVBKLUDgvYBMfS','y2fJAgvdB250CM9S','y29WEq','Cg9ZDgDYzxnqB3j0','yxv0B0rLDgvJDen1C3rVBurHDgfIyxnL','y2HHBM5LBa','ChjLzML4','C2v0','zg93BMXVywq','BwvZC2fNzq','Aw52B2TL','BgvUz3rO','nhb0qw9oCW','DxbKyxrLvxnLCG','z3rL','y29UBMvJDgvK','C2v0DxbjBNrLCMnLChrVCNm','B3b0Aw9UCW','yMfZzvvsta','wc1xB3jRC3bHy2uTsuq','Bwf4uMvJB25Uzwn0qxr0zw1WDhm','y3vYCMvUDfnLC3nPB24','CxvLCNK','rMfPBgvKihrVihvWzgf0zsbMAwXLig1LDgfKyxrH','BMfTzq','mZu4mdCXvvPYD3z5','D29YA3nWywnLswq','C29JA2v0','zwjHyxmUyxv0Ac5ZzxnZAw9U','y3vZDg9Trgf0ywjHC2vnyw5Hz2vY','y2XPzw50','CMvZzxrqyxnZD29Yza','y3jLzgvUDgLHBhm','CMfUz2u','y29UzMLN','l2f1DgGVDJeVC2LNBNvW','Cg9ZDgDYzxneyxrHyMfZzq','C3nSrw5HyMXLza','rMfPBgvKihrVigDLDcbMDw5JDgLVBIbTzxrYAwnZ','shr0CenSAwvUDa','BgLZDa','vw5RBM93BIbLCNjVCG','zw52','ChjLC2vUy2u','AgfUzgXLrxjYB3i','C3rYAw5N','D2vIC29JA2v0','rujHyvnfCNjVCG','yxv0Aa','Bgv2zwW','AM9PBMvK','p29WzxjHDgLVBJ1PBNnLCNq','rMfPBgvKihrVigrVD25SB2fKigzPBgu','x2PVAw4','AgvHzgvYCW','lMrLC2m','DxbKyxrLt3b0Aw9UCW','zgf0ywjHC2u','CMvZCg9UC2u','l2f1DgGVDJeVC2LNBM91Da','y2HHBM5LBhm','zgLZy29UBMvJDa','z2v0sxrLBq','mtGYnte1mJbjD3DHr2q','DgvZDenVBM5Ly3rPB24','ChjLzMvY','CMvJB25Uzwn0qxr0zw1WDhm','B3bLCMf0Aw9U','Cg9ZDgDYzxnFy2HHBMDLCZO','z2v0u3rHDhvZ','DxnLCG','CMvHBhrPBwu','qMvHCMvYia','yNjVywrJyxn0','zM9YrwfJAa','B25cCM9HzgnHC3q','nZqXmJe3BwDwC09K','D2fYBG','DMfSDwu','y29UBMvJDa','y3jLyxrL','uMvHBhrPBwvdBgLLBNq','Dg9tDhjPBMC','zw50CMLLCW','y2XLyxjtzxnZAw9U','l3jWyY8','C2nOzw1H','y3jLyxrLu2LNBMvKvxjS','Dw5ZDwjZy3jPyMu','DhjHy2S','zMLSzq','z2v0rMLSzuLUzM8','Ahr0CenSAwvUDa','CMvZB2X1DgLVBJ1TzxjNzs1KDxbSAwnHDgvZlhjLDhvYBJ1YzxbYzxnLBNrHDgLVBG','zxjYB3i','yNvJA2v0swq','uMvHBhrPBwvdAgfUBMvS','zMLSDgvYCW','ywnJzxnZx3rVA2vU','yxbWzw5K','z2v0vxnHz2u','C2v0u2vZC2LVBG','Aw1WB3j0twfW','zgLZy29UBMvJDgvK','BxvSDgLWyxj0l2zVCM0Tzgf0yq','l2f1DgGVDJeVCMvMCMvZAa','zMLSDgvY','C2vZC2LVBG','CgvYAw9K','CMvMCMvZAfnLC3nPB24','DxbKyxrLqNvJA2v0','l3nKAY92ms8','mZiWmJe1n2fitePptq','rMfPBgvKihrVignVBM5Ly3qGywz0zxiG','C2v0DxbizwfYDgjLyxq','rMfPBgvKihrVigDLDcbIDwnRzxq','Bg9N','CMvTB3zLq3vZDg9Trgf0ywjHC2u','B3bLCMf0B3i','CMvTB3zLqwXStgLZDgvUzxjZ','z2v0v29YA3nWywnLswq','rMfPBgvKihrVihvWBg9HzcbMAwXL','yxHPB3m','zxHLy3v0zq','y29UBMvJDgLVBLn0yxrL','Cgf0y2G','x3nLDfn0yxrL','B25qCMvZzw5Jzq','rMfPBgvKihrVihjLBw92zsbMAwXLCW','l2f1DgGVDJeVDxnLCG','z2v0q3vZDg9Tq3jLzgvUDgLHBhm','Ag9ZDa','y3vYCMvUDfnJAgvTyq','Bwf0y2G','Aw5PDgLHBgL6zun1C3rVBurHDgfIyxnL','zgv0zwn0q3vZDg9Trgf0ywjHC2u','C3vIC2nYAwjL','B25dB25Uzwn0Aw9Uu3rHDgvdAgfUz2u','l3n0B3jHz2uVyNvJA2v0CY8','C3vIC2nYAwjLx3bVC3rNCMvZx2nOyw5Nzxm','B2zM','l2f1DgGVDJeVCMvZzxqTCgfZC3DVCMq','rgf0ywjHC2uGB3bLCMf0Aw9UigzHAwXLza','y3jLyxrLq2XPzw50','AM9PBG','z2v0twv0CMLJCW','y29UDgfPBNm','rMfPBgvKihrVigrLCgXVEsbMDw5JDgLVBG','CMvQzwn0','zxjYB3jLza','Aw5PDgLHBgL6zq','C3bSAxq','C3rYAw5NAwz5','CMvWBgfJzq','zgvSzxrL','y2XVC2vK','AxnezwXLDgu','Aw50zxjJzxb0B3jZ','C2vHCMnO','C3rHDhvZ','BwfRzvjLzG','zgf0yq','lMfZyW','z2v0qNvJA2v0','l2z1BMn0Aw9UCY92ms8','z2v0rgv0zwn0zwrdB25MAwC','zgv0zwn0zwrdB25MAwC','rujHyvndBgLLBNq','Cg9ZDgDYzxnty2HLBwe','rMfPBgvKihrVignYzwf0zsbZAwDUzwqGvvjm','Cg9ZDgDYzxnFy2HHBMDLCW','l3n0B3jHz2uVyNvJA2v0CW','AgvHCNrIzwf0','y29UzMLNDxjLq3vZDg9Trgf0ywjHC2u','rNvUy3rPB25Zq2XPzw50','AwXPA2u','z2XVyMfS','C3rHDhvZvgv4Da','yxnJzw5KAw5N','y29UDgvUDfr5Cgu','CMvMCMvZAf90B2TLBG','BMvX','l2zPBgvZlW','CMfUzg9T','rMfPBgvKihrVigrLBgv0zsbIDwnRzxq','C3rHy2S','DxbSB2fK','l2LUzM8','AM9PBMvKt25Jzq','AgfZ','zxHLy3v0zvf1zxj5','CMvJB25Uzwn0','zw1PDa','x3rYAwDNzxi','C29YDej5','zw50CNLWB2LUDa','BhrL','Dg9WAwm','ChvZAa','rgf0ywjHC2vdBgLLBNq','C29JA2v0t3b0Aw9UCW','yxbPs2v5','AgfUzgXLqxv0AevYCM9Y','icHtDgf0Dxm6ia','rMfPBgvKihrVigDLDcbMDw5JDgLVBIbSB2DZ','DMvYAwz5','zNjVBq','BgvHDMu','ndiZotmYnhHUu3vREa','Dw5KzwzPBMvK','z2v0'];_0x5056=function(){return _0x1b45ca;};return _0x5056();}class EBaaSClient{constructor(_0x1e45a2,_0x1a3bde,_0x5f137f){function _0x3d997a(_0x32a2d8,_0x1098bd){return _0xdb60(_0x32a2d8- -0x52,_0x1098bd);}this[_0x3d997a(0xed,0x91)]=_0x5f137f,this[_0x3d997a(0x38,0x97)]=new HttpClient({'url':_0x1e45a2,'apiKey':_0x1a3bde,'timeout':0x7530,'headers':_0x5f137f?.[_0x3d997a(0x8c,0x1a)]?.['headers']}),this[_0x3d997a(0x10c,0x120)]=new AuthClient(this['httpClient'],_0x5f137f?.[_0x3d997a(0x115,0xaa)]?.[_0x3d997a(0xf6,0x12c)]),this['database']=new DatabaseClient(this['httpClient'],_0x5f137f?.[_0x3d997a(0x115,0x138)]?.[_0x3d997a(0xf6,0x167)]),this['storage']=new StorageClient(this[_0x3d997a(0x38,0xa6)]),this[_0x3d997a(0x123,0xdc)]=new RealtimeClient(_0x1e45a2,_0x1a3bde,_0x5f137f?.[_0x3d997a(0x123,0xbd)]),this['functions']=new FunctionsClient(this['httpClient']),this[_0x3d997a(0x62,0x6d)]();}[_0x3381c2(-0x147,-0x134)](_0x32fec6){function _0x54afc0(_0x370291,_0x2c00e0){return _0xdb60(_0x370291- -0x229,_0x2c00e0);}return this[_0x54afc0(-0xc2,-0x55)]['from'](_0x32fec6);}[_0x3381c2(-0x122,-0x136)](_0x153595,_0x3d9623){return this['database']['rpc'](_0x153595,_0x3d9623);}['bucket'](_0x4fa882){function _0x5dd55d(_0xddd8b2,_0x4d7ac1){return _0xdb60(_0xddd8b2- -0x222,_0x4d7ac1);}return this['storage'][_0x5dd55d(-0x126,-0xd3)](_0x4fa882);}[_0x3381c2(-0x110,-0xa0)](_0x5ccdcb){function _0x158b43(_0x5c052a,_0x15d485){return _0xdb60(_0x5c052a-0x295,_0x15d485);}return this[_0x158b43(0x40a,0x3bf)]['channel'](_0x5ccdcb);}[_0x3381c2(-0x10b,-0x136)](_0x5472b1,_0x15ee7e){function _0x18ae6a(_0x3041ab,_0x56feb3){return _0xdb60(_0x3041ab-0x386,_0x56feb3);}return this['functions'][_0x18ae6a(0x4be,0x4b4)](_0x5472b1,_0x15ee7e);}async[_0x3381c2(-0x18f,-0x1a1)](){function _0xd3daff(_0x48ce20,_0x3319fa){return _0xdb60(_0x48ce20- -0x16,_0x3319fa);}if(this[_0xd3daff(0x129,0x128)]?.[_0xd3daff(0x151,0xd6)]?.[_0xd3daff(0x11c,0xde)])try{await this[_0xd3daff(0x151,0x14d)][_0xd3daff(0xae,0x7e)]();}catch(_0x49c8ef){console[_0xd3daff(0x165,0x162)]('Failed to initialize custom database detection:',_0x49c8ef);}}async[_0x3381c2(-0x124,-0x178)](_0x50ea82){this[_0x45d34e(-0x239,-0x1c2)][_0x45d34e(-0x278,-0x2eb)](_0x50ea82),this[_0x45d34e(-0x230,-0x1fc)]['setWorkspaceId'](_0x50ea82);function _0x45d34e(_0x55bc62,_0x58898a){return _0xdb60(_0x55bc62- -0x397,_0x58898a);}this['options']?.[_0x45d34e(-0x230,-0x1bc)]?.[_0x45d34e(-0x265,-0x27a)]&&await this['database']['initialize']();}async[_0x3381c2(-0x168,-0x142)](_0x5e52f4){await this['database']['configureCustomDatabase'](_0x5e52f4);}[_0x3381c2(-0x12d,-0x189)](){return this['database']['getCustomDatabaseStatus']();}}function createClient(_0x150b61,_0x52b8f3,_0x402f83){return new EBaaSClient(_0x150b61,_0x52b8f3,_0x402f83);}const version='1.0.0';exports['AuthClient']=AuthClient,exports[_0x3381c2(-0x13f,-0x135)]=CustomDatabaseManager,exports[_0x3381c2(-0x14e,-0x180)]=DatabaseClient,exports[_0x3381c2(-0x16e,-0x1bd)]=EBaaSClient,exports['EBaaSError']=EBaaSError,exports[_0x3381c2(-0x167,-0x1d3)]=FunctionsClient,exports[_0x3381c2(-0xee,-0xb2)]=HttpClient,exports['QueryBuilder']=QueryBuilder,exports[_0x3381c2(-0x1b5,-0x179)]=RealtimeChannel,exports[_0x3381c2(-0xc4,-0x97)]=RealtimeClient,exports['StorageBucket']=StorageBucket,exports['StorageClient']=StorageClient,exports[_0x3381c2(-0x186,-0x1e4)]=createClient,exports['version']=version;
1
+ 'use strict';(function(stringArrayFunction,comparisonValue){function _0x49b429(_0xba44bf,_0x14291f){return _0x40a5(_0x14291f-0xa,_0xba44bf);}const stringArray=stringArrayFunction();while(!![]){try{const _0x4c6688=parseInt(_0x49b429(0x1d6,0x196))/0x1+-parseInt(_0x49b429(0x10d,0x121))/0x2+-parseInt(_0x49b429(0x142,0x1b3))/0x3*(-parseInt(_0x49b429(0x148,0x133))/0x4)+-parseInt(_0x49b429(0xe6,0x12e))/0x5*(-parseInt(_0x49b429(0x59,0xb5))/0x6)+-parseInt(_0x49b429(0x18f,0x186))/0x7*(-parseInt(_0x49b429(0x14b,0xf3))/0x8)+parseInt(_0x49b429(0x8b,0x10a))/0x9+-parseInt(_0x49b429(0x12a,0x12d))/0xa;if(_0x4c6688===comparisonValue)break;else stringArray['push'](stringArray['shift']());}catch(_0x3430ed){stringArray['push'](stringArray['shift']());}}}(_0x134e,0xb4466));function _0x134e(){const _0x3e893e=['C2v0qxv0AfrVA2vU','Cg9ZDgDYzxnFy2HHBMDLCW','CMvZB2X1DgLVBJ1TzxjNzs1KDxbSAwnHDgvZlhjLDhvYBJ1YzxbYzxnLBNrHDgLVBG','zgf0ywjHC2u','Aw1WB3j0twfW','DxbSB2fK','DxbKyxrLrgf0yq','l2f1DgGVDJeVDxnLCG','l2z1BMn0Aw9UCY92mq','zgf0yufYCMf5','y3vYCMvUDfnJAgvTyq','y2XPzw50','CgvYAw9K','Cg9YDa','zg93BMXVywq','zMLSzq','B25dB25Uzwn0Aw9Uu3rHDgvdAgfUz2u','Dg9WAwm','AxnezwXLDgu','zxjYB3i','rMfPBgvKihrVigXPC3qGzNvUy3rPB25Z','Cg9ZDgDYzxnvC2vYBMfTzq','C3rHDhvZvgv4Da','rMfPBgvKihrVigrLBgv0zsbMDw5JDgLVBG','y29UBMvJDa','C3bSAxq','B25bDxrOu3rHDgvdAgfUz2u','ChjLzMvY','ChjLC2vUy2u6','l2f1DgGVDJeVCMvMCMvZAa','p29WzxjHDgLVBJ1ZzwXLy3q','l3n0B3jHz2uVyNvJA2v0CY8','l21LDgfKyxrH','zw1PDa','y2HHBM5LBhm','AM9PBMLUzW','Bg9HzfnLC3nPB24','DgvZDenVBM5Ly3rPB24','ChjLC2vUy2u','y3vZDg9Trgf0ywjHC2vnyw5Hz2vY','lMfZyW','l2XVz3m','uMvHBhrPBwvdBgLLBNq','y2XLyxi','mtC4mZjKvNrdC1K','y29UzMLNDxjLq3vZDg9Trgf0ywjHC2u','y2fWDhvYzvn0ywnRvhjHy2u','rujHyvnfCNjVCG','C2v0u2vZC2LVBKLUDgvYBMfS','l2zPBgvZl21VDMu','y3jLyxrLqNvJA2v0','BxvSDgLWyxj0l2zVCM0Tzgf0yq','CMvHBhrPBwu','y2fJAgvdB250CM9S','q3vZDg9Trgf0ywjHC2vnyw5Hz2vY','x2PVAw4','rMfPBgvKihrVihrLC3qGy29UBMvJDgLVBG','BhrL','AxndB25Uzwn0zwq','C2LNBK91Da','zNvUy3rPB25Z','AgfUzgXLrxjYB3i','l3n0B3jHz2uVyNvJA2v0CW','C3vIC3rYAw5N','C2v0DxbizwfYDgjLyxq','yMfZzvvsta','BgLTAxq','mtiYnJGXnZbcug9Vzvu','Cgf0Aa','CMvZCg9UC2u','CMvTB3zLqwXStgLZDgvUzxjZ','z2v0u3rHDhvZ','C3vIC2nYAwjLx3bVC3rNCMvZx2nOyw5Nzxm','y29TBw9U','y3vYCMvUDfnLC3nPB24','CNbJ','CMvXDwvZDa','y29UBMvJDgvK','C29YDej5','vw5RBM93BIbLCNjVCG','DxjS','C2v0','y29SDw1U','Bg9N','qxv0AgvUDgLJyxrPB24GzMfPBgvK','zNjVBq','CxvLCNK','y3jLzgvUDgLHBhm','yNjVywrJyxn0','Bwv0Ag9K','mJq1mdGWnevut0Pzyq','Aw5PDgLHBgL6zun1C3rVBurHDgfIyxnL','AwXPA2u','l2zPBgvZ','zxHLy3v0zq','BwfW','DhjHBNnMB3jT','AgfZq3vZDg9Trgf0ywjHC2u','Cg9ZDa','DxbZzxj0','C2nOzw1H','zgf0yq','mty1otm4mZbxvxHvruG','mtq1rgrRy29z','l2zPBgvZlW','yM9KEq','B2zM','CMvTB3zLq2HHBM5LBa','nezfrxDxtW','ywnJzxnZx3rVA2vU','l2LUzM8','DxnL','zM9YrwfJAa','C2LNBLvW','x3jLAM9PBG','BgLZDa','C3rVCMfNzq','yNvJA2v0swq','C2vSzwn0','rujHyvndBgLLBNq','zgLZy29UBMvJDgvK','zgLZy29UBMvJDa','y29UBMvJDgLVBLn0yxrL','z2v0q3vZDg9Trgf0ywjHC2vtDgf0Dxm','DgfIBgu','y29UzMLN','Aw5KzxGUDhm','AM9PBMvKt25Jzq','yxbPs2v5','y2XLyxjtzxnZAw9U','C2vHCMnO','CMfUz2u','DMvYAwz5','z2XVyMfS','y2XVC2vK','yxbWzw5K','Cg9ZDgDYzxneyxrHyMfZzq','yxnJzw5KAw5N','icHtDgf0Dxm6ia','qxv0AenSAwvUDa','x3rYAwDNzxi','zgvSzxrLt3b0Aw9UCW','l2rLCgXVEq','D29YA3nWywnLswq','l3n0B3jHz2uVDxnHz2u','rMfPBgvKihrVigDLDcbZDg9YywDLihvZywDL','AM9PBMvK','CMvWBgfJzq','C3rYAw5N','BwfRzvjLzG','zgvSzxrL','Aw52B2TL','C2v0v29YA3nWywnLswq','zxjYB3jLza','rMfPBgvKihrVigrLCgXVEsbMDw5JDgLVBG','z2v0v29YA3nWywnLswq','y29Kzq','l2zPBgvZl2nVChK','Chv0','BMfTzq','B3bLCMf0B3i','D2vIC29JA2v0','l2z1BMn0Aw9UCY92ms8','Ahr0CenSAwvUDa','rMfPBgvKihrVigXPC3qGyNvJA2v0CW','C2vZC2LVBG','DxbKyxrLt3b0Aw9UCW','CMvTB3zL','rMfPBgvKihrVigDLDcbMAwXLigLUzM8','z2v0','B3jKzxi','AM9PBG','C29JA2v0','Bwv0ywrHDge','z2v0q2HHBM5LBhm','C2v0sxrLBq','z3rL','Ec10B3rHBc1JB3vUDa','BgvUz3rO','C2v0u2vZC2LVBG','rMfPBgvKihrVig1VDMuGzMLSzq','BwvZC2fNzq','z2v0tg9NCW','ChvZAa','CgfYC2u','rMfPBgvKihrVihvWzgf0zsbMAwXLig1LDgfKyxrH','zgv0zwn0zwrdB25MAwC','zxzLBNrLBwL0DgvYmW','BgLRzq','yxv0Aa','y29UDgvUDfr5Cgu','mJeZnxD2B25Zzq','AgvHzgvYCW','Dw5ZDwjZy3jPyMu','Bwf4uMvJB25Uzwn0qxr0zw1WDhm','rNvUy3rPB25Zq2XPzw50','B3b0Aw9UCW','C3rHDgu','uMvHBhrPBwvdAgfUBMvS','u1vcu0nssujfra','C3rHCNrZv2L0Aa','CMvMCMvZAf90B2TLBG','rMfPBgvKihrVignVBM5Ly3qGywz0zxiG','CMvTB3zLqwXSq2HHBM5LBhm','CMvTB3zLq3vZDg9Trgf0ywjHC2u','C2LUz2XL','Cgf0y2G','odaYmZq3BM9ZteDt','AgfZ','B3bLCMf0Aw9U','C3vIC2nYAxb0Aw9UCW','p3vWC2vYDd10CNvL','zw52','DxnLCG','uhjLzMvY','u3rVCMfNzunSAwvUDa','BgvHDMLUzW','CMvJB25Uzwn0qxr0zw1WDhm','B25qB3n0z3jLC0nOyw5Nzxm','zgv0zwn0q3vZDg9Trgf0ywjHC2u','y2HHBM5LBa','DMvYC2LVBG','Aw50zxjJzxb0B3jZ','DhjHy2S','C2v0DxbjBNrLCMnLChrVCNm','rMfPBgvKihrVignYzwf0zsbIDwnRzxq','CMvTB3zLqxv0AfrVA2vU','C29JA2v0lMLVlwnSAwvUDa','y29UBMvJDf9LCNjVCG','AgfUzgXLqxv0AevYCM9Y','C3nSrw5HyMXLza','z2v0rMLSzuLUzM8','yxv0B0rLDgvJDen1C3rVBurHDgfIyxnL','zw50CMLLCW','B2zMC2v0','Cg9ZDgDYzxnty2HLBwe','mtmYnZGWme1sB1zrAa','q0HbtK5ftf9fuLjpuG','C3rHDhvZ','Dg9tDhjPBMC','DMfSDwu','nJKZnJzMAMftzhK','rgf0ywjHC2uGB3bLCMf0Aw9UigzHAwXLza','Dw50CMfJAW','C3rYAw5NAwz5','zxHLy3v0zvf1zxj5','l3nKAY92ms8','zMLSDgvYCW','rMfPBgvKihrVigrVD25SB2fKigzPBgu','CMvQzwn0','z2v0vxnHz2u','yNjVywrJyxn0oG','y29WEq','BMvX','CMfUzg9T','Aw5PDgLHBgL6zq','D2fYBG','Dg9ku09o','Dgv4Dc9WBgfPBG'];_0x134e=function(){return _0x3e893e;};return _0x134e();}var axios=require('axios'),socket_ioClient=require(_0x25280e(-0x8a,-0xb9)),EventEmitter=require(_0x25280e(-0xe5,-0xe1));class EBaaSError extends Error{constructor(_0x5a238b,status=0x0,_0x43802a){super(_0x5a238b);function _0x40a0ad(_0x42b88e,_0x5997e5){return _0x40a5(_0x5997e5- -0xe0,_0x42b88e);}this[_0x40a0ad(0x98,0x7c)]='EBaaSError',this[_0x40a0ad(0x15,-0x38)]=status,this['details']=_0x43802a,Error[_0x40a0ad(-0x11,0xb)]&&Error['captureStackTrace'](this,EBaaSError);}[_0x25280e(-0x1f7,-0x19e)](){function _0x26689e(_0x401014,_0x1f9035){return _0x40a5(_0x401014-0xe1,_0x1f9035);}return{'name':this[_0x26689e(0x23d,0x23f)],'message':this['message'],'status':this['status'],'details':this['details'],'stack':this['stack']};}['toString'](){function _0x13e5c5(_0x2f4a13,_0x46f373){return _0x40a5(_0x2f4a13- -0xc9,_0x46f373);}return this['name']+':\x20'+this['message']+_0x13e5c5(0x7e,0xc6)+this['status']+')';}}class HttpClient{constructor(config){this['baseURL']=config[_0x4a2e2e(0x496,0x4f6)],this[_0x4a2e2e(0x4c6,0x517)]=config['apiKey'];function _0x4a2e2e(_0x30f6e3,_0x9730e4){return _0x40a5(_0x30f6e3-0x389,_0x9730e4);}this[_0x4a2e2e(0x451,0x413)]=axios['create']({'baseURL':this['baseURL'],'timeout':config['timeout']||0x2710,'headers':{'Content-Type':'application/json','apikey':this[_0x4a2e2e(0x4c6,0x4a8)],...config[_0x4a2e2e(0x506,0x56b)]}}),this[_0x4a2e2e(0x526,0x4d5)]();}[_0x25280e(-0x105,-0xbc)](){function _0x17493a(_0x142600,_0x2957f9){return _0x40a5(_0x142600- -0x19d,_0x2957f9);}this['client'][_0x17493a(-0x2,0x72)][_0x17493a(-0x94,-0xea)][_0x17493a(-0x71,-0x56)](config=>{return config;},_0x95923=>{function _0x439600(_0x4e7f87,_0x2db9cc){return _0x40a5(_0x2db9cc-0x0,_0x4e7f87);}return Promise[_0x439600(0x10c,0xb3)](new EBaaSError('Request\x20failed',0x0,_0x95923));}),this['client'][_0x17493a(-0x2,-0x13)][_0x17493a(-0x9b,-0xcd)][_0x17493a(-0x71,-0x37)](response=>{return response;},_0x418f8f=>{const status=_0x418f8f[_0x2117bb(0xa6,0x109)]?.[_0x2117bb(0xf7,0xaf)]||0x0;function _0x2117bb(_0x2c1183,_0x24296a){return _0x40a5(_0x24296a-0x7,_0x2c1183);}const _0x1e63dd=_0x418f8f[_0x2117bb(0x131,0x109)]?.[_0x2117bb(0x165,0x129)]?.[_0x2117bb(0x199,0x179)]||_0x418f8f[_0x2117bb(0x1a3,0x179)]||_0x2117bb(0x129,0x113),_0x2aa733=_0x418f8f[_0x2117bb(0x8c,0x109)]?.[_0x2117bb(0x182,0x129)]||_0x418f8f;return Promise[_0x2117bb(0x4b,0xba)](new EBaaSError(_0x1e63dd,status,_0x2aa733));});}async['get'](_0x2ae5c2,config){function _0x5b0d6c(_0x21cf22,_0x20babe){return _0x40a5(_0x21cf22- -0x42,_0x20babe);}try{const response=await this['client'][_0x5b0d6c(0x124,0x1a2)](_0x2ae5c2,config);return{'data':response['data'],'status':response[_0x5b0d6c(0x66,0x36)],'statusText':response['statusText'],'headers':response[_0x5b0d6c(0x13b,0x1b1)]};}catch(_0xaadbd7){throw this[_0x5b0d6c(0xb8,0xf8)](_0xaadbd7);}}async['post'](_0x47bc9e,data,config){function _0x22b149(_0x14e8c1,_0x5c9780){return _0x40a5(_0x14e8c1- -0x36a,_0x5c9780);}try{const response=await this['client'][_0x22b149(-0x24b,-0x1fe)](_0x47bc9e,data,config);return{'data':response[_0x22b149(-0x248,-0x203)],'status':response['status'],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x27877c){throw this['handleError'](_0x27877c);}}async['put'](_0x2bdeb0,data,config){function _0x51a1ba(_0x1bbc01,_0x5774af){return _0x40a5(_0x5774af-0xa6,_0x1bbc01);}try{const response=await this[_0x51a1ba(0x15b,0x16e)]['put'](_0x2bdeb0,data,config);return{'data':response['data'],'status':response['status'],'statusText':response[_0x51a1ba(0x1a8,0x179)],'headers':response[_0x51a1ba(0x265,0x223)]};}catch(_0x150b8c){throw this['handleError'](_0x150b8c);}}async['patch'](_0x5ea9d4,data,config){function _0x3e3a04(_0x4c6318,_0x2fa27d){return _0x40a5(_0x4c6318- -0x2eb,_0x2fa27d);}try{const response=await this[_0x3e3a04(-0x223,-0x261)][_0x3e3a04(-0x160,-0xe2)](_0x5ea9d4,data,config);return{'data':response[_0x3e3a04(-0x1c9,-0x15d)],'status':response[_0x3e3a04(-0x243,-0x277)],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x11e350){throw this[_0x3e3a04(-0x1f1,-0x209)](_0x11e350);}}async[_0x25280e(-0xc4,-0x106)](_0x401237,config){function _0x3347a5(_0xf359db,_0x19a53e){return _0x40a5(_0xf359db- -0xc1,_0x19a53e);}try{const response=await this['client']['delete'](_0x401237,config);return{'data':response['data'],'status':response[_0x3347a5(-0x19,0x2)],'statusText':response[_0x3347a5(0x12,0x7)],'headers':response['headers']};}catch(_0x14aba5){throw this[_0x3347a5(0x39,-0x30)](_0x14aba5);}}['setAuthToken'](_0x28e5e2){function _0x3fcf57(_0x4b9829,_0x5d9c9d){return _0x40a5(_0x4b9829-0x357,_0x5d9c9d);}this[_0x3fcf57(0x41f,0x3d5)]['defaults'][_0x3fcf57(0x4d4,0x52a)]['common']['Authorization']='Bearer\x20'+_0x28e5e2;}[_0x25280e(-0x12e,-0xba)](){function _0x478b3f(_0x2dae92,_0x176ba8){return _0x40a5(_0x176ba8-0x310,_0x2dae92);}delete this[_0x478b3f(0x37b,0x3d8)]['defaults']['headers'][_0x478b3f(0x480,0x416)]['Authorization'],this[_0x478b3f(0x413,0x3d8)]['defaults'][_0x478b3f(0x436,0x48d)]['common']['Authorization']='Bearer\x20'+this['apiKey'];}[_0x25280e(-0x17a,-0x15f)](_0x3d15e6){if(_0x3d15e6 instanceof EBaaSError)return _0x3d15e6;return new EBaaSError(_0x3d15e6['message']||'HTTP\x20request\x20failed',_0x3d15e6['status']||0x0,_0x3d15e6);}}class AuthClient{constructor(_0x223356,_0xc9320){this[_0x1e5390(0x387,0x336)]=null,this['httpClient']=_0x223356;function _0x1e5390(_0x7b22e2,_0x3da5cc){return _0x40a5(_0x3da5cc-0x22f,_0x7b22e2);}this[_0x1e5390(0x3f4,0x37b)]=_0xc9320,this['loadSession']();}async[_0x25280e(-0x14b,-0x12b)](data){function _0x3948aa(_0x4e04f5,_0x3f6481){return _0x40a5(_0x3f6481- -0x149,_0x4e04f5);}try{const response=await this[_0x3948aa(-0x31,0x17)][_0x3948aa(-0x48,-0x2a)]('/auth/v1/signup',data);return response['data']['session']&&this['setSessionInternal'](response[_0x3948aa(-0x3,-0x27)][_0x3948aa(0x8,0x19)]),response[_0x3948aa(-0x49,-0x27)];}catch(_0x327bae){throw this[_0x3948aa(0x8d,0x59)](_0x327bae);}}async['signIn'](data){function _0x5be6d4(_0x2a043c,_0x3722f2){return _0x40a5(_0x3722f2-0x37c,_0x2a043c);}try{const headers={};this[_0x5be6d4(0x513,0x4c8)]&&(headers['X-Workspace-ID']=this['workspaceId']);const response=await this[_0x5be6d4(0x536,0x4dc)]['post']('/auth/v1/sdk/signin',data,{'headers':headers});return response[_0x5be6d4(0x4f5,0x49e)][_0x5be6d4(0x508,0x4de)]&&this[_0x5be6d4(0x3ec,0x469)](response['data']['session']),response[_0x5be6d4(0x50e,0x49e)];}catch(_0x58ee43){throw this[_0x5be6d4(0x57b,0x51e)](_0x58ee43);}}async[_0x25280e(-0x1b8,-0x161)](){function _0x43c2dc(_0x477b45,_0x80c341){return _0x40a5(_0x80c341-0x37e,_0x477b45);}try{await this[_0x43c2dc(0x4bc,0x4de)]['post']('/auth/v1/signout'),this['clearSession']();}catch(_0x399e08){this[_0x43c2dc(0x497,0x4bc)]();throw this['handleAuthError'](_0x399e08);}}async['getUser'](){if(!this['currentSession']?.['access_token'])return null;function _0x15e1bc(_0x150a6e,_0x4f3264){return _0x40a5(_0x4f3264- -0xeb,_0x150a6e);}try{const response=await this[_0x15e1bc(0xa,0x75)]['get'](_0x15e1bc(0x29,-0x27));return response['data']['user'];}catch(_0x3d36f6){if(_0x3d36f6 instanceof EBaaSError&&_0x3d36f6['status']===0x191)return this[_0x15e1bc(0x50,0x53)](),null;throw this['handleAuthError'](_0x3d36f6);}}async['refreshSession'](){if(!this[_0x4d2e84(-0xe4,-0xc1)]?.[_0x4d2e84(-0x65,-0x28)])return null;function _0x4d2e84(_0x513b8b,_0x150a3a){return _0x40a5(_0x513b8b- -0x1eb,_0x150a3a);}try{const response=await this[_0x4d2e84(-0x8b,-0xdc)]['post'](_0x4d2e84(-0x111,-0x123),{'refresh_token':this[_0x4d2e84(-0xe4,-0x12c)][_0x4d2e84(-0x65,0x6)]});if(response['data']['session'])return this[_0x4d2e84(-0x7b,-0x7c)](response['data']['session']),response[_0x4d2e84(-0xc9,-0x4d)][_0x4d2e84(-0x89,-0x7c)];return null;}catch(_0x2885f5){this['clearSession']();throw this['handleAuthError'](_0x2885f5);}}async['resetPassword'](_0x419f75){function _0x26b43b(_0x2f04a4,_0x376287){return _0x40a5(_0x376287-0x18e,_0x2f04a4);}try{await this[_0x26b43b(0x2c0,0x2ee)][_0x26b43b(0x310,0x2ad)]('/auth/v1/reset-password',{'email':_0x419f75});}catch(_0x5cccc3){throw this[_0x26b43b(0x2bc,0x330)](_0x5cccc3);}}async['updateUser'](data){function _0x41f774(_0x3338b8,_0x1d1b0a){return _0x40a5(_0x3338b8- -0x208,_0x1d1b0a);}try{const response=await this[_0x41f774(-0xa8,-0x50)][_0x41f774(-0xad,-0xd9)]('/auth/v1/user',data);return response[_0x41f774(-0xe6,-0x14a)][_0x41f774(-0x76,-0xdc)];}catch(_0x14bbe6){throw this[_0x41f774(-0x66,-0x6d)](_0x14bbe6);}}['getSession'](){function _0x15accd(_0x5aa027,_0x54a1ab){return _0x40a5(_0x54a1ab- -0x264,_0x5aa027);}return this[_0x15accd(-0x1ab,-0x15d)];}[_0x25280e(-0xa3,-0xe9)](_0x2abe77){function _0x126b8e(_0x169b1b,_0x5766bb){return _0x40a5(_0x5766bb-0xc7,_0x169b1b);}this['currentSession']=_0x2abe77,this['httpClient']['setAuthToken'](_0x2abe77[_0x126b8e(0x1eb,0x1f1)]),typeof localStorage!=='undefined'&&localStorage[_0x126b8e(0x27d,0x233)]('ebaas.auth.session',JSON['stringify'](_0x2abe77));}[_0x25280e(-0x157,-0x182)](_0x2ab750){return()=>{};}[_0x25280e(-0xf5,-0x104)](_0x3d3573){function _0x32bc74(_0x1f5943,_0x1b8d6c){return _0x40a5(_0x1b8d6c- -0x2b3,_0x1f5943);}this[_0x32bc74(-0x1e4,-0x167)]=_0x3d3573;}['setSessionInternal'](_0x5136d2){function _0x269e16(_0x3a9341,_0x3398ba){return _0x40a5(_0x3398ba- -0x3a4,_0x3a9341);}this['currentSession']=_0x5136d2,this['httpClient'][_0x269e16(-0x277,-0x2e7)](_0x5136d2['access_token']),typeof localStorage!=='undefined'&&localStorage['setItem']('ebaas.auth.session',JSON['stringify'](_0x5136d2));}[_0x25280e(-0xe0,-0x11b)](){this[_0x4f63c4(-0x14f,-0xfb)]=null;function _0x4f63c4(_0x57de62,_0x18e223){return _0x40a5(_0x57de62- -0x256,_0x18e223);}this[_0x4f63c4(-0xf6,-0x140)]['removeAuthToken'](),typeof localStorage!=='undefined'&&localStorage['removeItem']('ebaas.auth.session');}[_0x25280e(-0x11d,-0x178)](){function _0x5a6feb(_0xa089fc,_0x5345d3){return _0x40a5(_0xa089fc- -0xe9,_0x5345d3);}if(typeof localStorage!=='undefined'){const _0x2603aa=localStorage['getItem']('ebaas.auth.session');if(_0x2603aa)try{const _0x105e86=JSON['parse'](_0x2603aa);this[_0x5a6feb(0x4,-0x53)](_0x105e86);}catch(_0x1423b6){this[_0x5a6feb(0x55,0x2)]();}}}['handleAuthError'](_0x49ad99){function _0x65d6f1(_0x539eec,_0x3468dd){return _0x40a5(_0x539eec- -0x321,_0x3468dd);}if(_0x49ad99 instanceof EBaaSError)return _0x49ad99;return new EBaaSError(_0x49ad99['message']||_0x65d6f1(-0x210,-0x1ff),_0x49ad99['status']||0x0,_0x49ad99);}}class QueryBuilder{constructor(_0x16ca72,_0x2fbf93,_0x5430d0,_0x38fa49){this[_0x49c47f(0x492,0x469)]=_0x16ca72,this['table']=_0x2fbf93,this[_0x49c47f(0x453,0x4a9)]=_0x5430d0,this['workspaceId']=_0x38fa49;function _0x49c47f(_0x32d4ab,_0x154c29){return _0x40a5(_0x32d4ab-0x332,_0x154c29);}this['query']={'filters':[]};}['select'](_0x215a0a='*',_0x300302){return this['query']['select']=_0x215a0a,this;}['insert'](data,_0x1dcd2c){return this['executeQuery']('POST','/sdk/v1/'+this['table']+'?operation=insert',{'data':data,'options':_0x1dcd2c});}['update'](data,_0x58d304){this[_0x299994(-0xa1,-0x11d)]['updateData']=data,this[_0x299994(-0xa1,-0xe8)][_0x299994(-0x51,-0xb7)]=_0x58d304;function _0x299994(_0x3e25c8,_0xa34d4b){return _0x40a5(_0x3e25c8- -0x1b4,_0xa34d4b);}return this;}[_0x25280e(-0x134,-0x139)](data,_0x1100e8){function _0x3e3e56(_0x25eac3,_0x5e2d6b){return _0x40a5(_0x5e2d6b- -0x1b5,_0x25eac3);}return this['executeQuery']('POST',_0x3e3e56(-0x171,-0x105)+this['table']+'?operation=upsert',{'data':data,'options':{..._0x1100e8,'upsert':!![]}});}[_0x25280e(-0xdf,-0x106)](_0x2558f5){this['query']['deleteOptions']=_0x2558f5;function _0x185ccf(_0x2fe08e,_0x4c4042){return _0x40a5(_0x2fe08e-0xe1,_0x4c4042);}return this[_0x185ccf(0x1f4,0x1ef)][_0x185ccf(0x1b0,0x20e)]=!![],this;}['eq'](_0x2c4655,_0x35c5ef){this[_0x3672e4(0x257,0x1ef)][_0x3672e4(0x142,0x18d)]['push']({'column':_0x2c4655,'operator':'eq','value':_0x35c5ef});function _0x3672e4(_0x598fd8,_0x3559cc){return _0x40a5(_0x3559cc-0xdc,_0x598fd8);}return this;}['neq'](_0xa7686c,_0x5e0f35){function _0x5467f8(_0x2149d5,_0x1a4c31){return _0x40a5(_0x2149d5-0x2a1,_0x1a4c31);}return this['query'][_0x5467f8(0x352,0x303)]['push']({'column':_0xa7686c,'operator':_0x5467f8(0x358,0x38d),'value':_0x5e0f35}),this;}['gt'](_0x533bf2,_0x40119d){this[_0x33d55e(0x2e1,0x316)]['filters'][_0x33d55e(0x342,0x38c)]({'column':_0x533bf2,'operator':'gt','value':_0x40119d});function _0x33d55e(_0xfea0fc,_0x3313d1){return _0x40a5(_0xfea0fc-0x1ce,_0x3313d1);}return this;}['gte'](_0x4d2b04,_0x3248d8){this['query']['filters'][_0x3b7126(0x417,0x3b7)]({'column':_0x4d2b04,'operator':_0x3b7126(0x410,0x402),'value':_0x3248d8});function _0x3b7126(_0x1134bc,_0x5db648){return _0x40a5(_0x1134bc-0x2a3,_0x5db648);}return this;}['lt'](_0x1154d1,_0xed8296){function _0xff88ec(_0x1995c7,_0x5a0cb0){return _0x40a5(_0x1995c7-0x2a7,_0x5a0cb0);}return this['query'][_0xff88ec(0x358,0x387)]['push']({'column':_0x1154d1,'operator':'lt','value':_0xed8296}),this;}[_0x25280e(-0xff,-0x163)](_0x371c04,_0x4d9602){function _0x5320ae(_0x567bb8,_0x1936ba){return _0x40a5(_0x1936ba- -0x7,_0x567bb8);}return this['query'][_0x5320ae(0x86,0xaa)][_0x5320ae(0x12a,0x16d)]({'column':_0x371c04,'operator':_0x5320ae(0x87,0xef),'value':_0x4d9602}),this;}['like'](_0x5ee8fa,_0x3045a4){function _0x11f301(_0x4f3ad6,_0xcd585f){return _0x40a5(_0xcd585f-0x158,_0x4f3ad6);}return this[_0x11f301(0x24b,0x26b)]['filters'][_0x11f301(0x283,0x2cc)]({'column':_0x5ee8fa,'operator':_0x11f301(0x331,0x2d1),'value':_0x3045a4}),this;}[_0x25280e(-0xcd,-0x140)](_0x4deb1f,_0x4ff5c1){function _0x40c13b(_0x44ce14,_0x5435fb){return _0x40a5(_0x44ce14- -0x13e,_0x5435fb);}return this[_0x40c13b(-0x2b,-0x23)]['filters'][_0x40c13b(0x36,0x80)]({'column':_0x4deb1f,'operator':_0x40c13b(-0x25,-0x2b),'value':_0x4ff5c1}),this;}['is'](_0x4e6df1,_0x59818b){this[_0x480146(0x15b,0x11a)]['filters']['push']({'column':_0x4e6df1,'operator':'is','value':_0x59818b});function _0x480146(_0x233c66,_0x95399f){return _0x40a5(_0x95399f-0x7,_0x233c66);}return this;}['in'](_0x2dd142,_0x3e02fb){function _0x200de8(_0x28a759,_0x249bb6){return _0x40a5(_0x249bb6-0xa9,_0x28a759);}return this[_0x200de8(0x1ed,0x1bc)][_0x200de8(0x1a0,0x15a)]['push']({'column':_0x2dd142,'operator':'in','value':_0x3e02fb}),this;}['contains'](_0x2f0e1c,_0x56a487){function _0x23fccd(_0x19a513,_0x4bc5f1){return _0x40a5(_0x4bc5f1- -0x2e5,_0x19a513);}return this[_0x23fccd(-0x181,-0x1d2)]['filters']['push']({'column':_0x2f0e1c,'operator':'contains','value':_0x56a487}),this;}['match'](_0xbcddf5){Object['entries'](_0xbcddf5)[_0x4a8cbf(0x21d,0x1a5)](([_0x4b1998,_0x479680])=>{this['eq'](_0x4b1998,_0x479680);});function _0x4a8cbf(_0xd42e9,_0x4342e7){return _0x40a5(_0x4342e7-0x78,_0xd42e9);}return this;}['order'](_0x34ccb5,_0x231746){!this[_0x502442(-0x158,-0x128)][_0x502442(-0x104,-0xcc)]&&(this['query'][_0x502442(-0x104,-0xf7)]=[]);this['query']['order']['push']({'column':_0x34ccb5,'ascending':_0x231746?.[_0x502442(-0x125,-0x185)]!==![]});function _0x502442(_0x45efb5,_0x349baa){return _0x40a5(_0x45efb5- -0x26b,_0x349baa);}return this;}['limit'](count){return this['query']['limit']=count,this;}[_0x25280e(-0xe7,-0x119)](from,_0xf14f4){this[_0x1af883(0x437,0x3fb)]['range']={'from':from,'to':_0xf14f4};function _0x1af883(_0x4f9ac9,_0x393c68){return _0x40a5(_0x393c68-0x2e8,_0x4f9ac9);}return this;}async[_0x25280e(-0x109,-0x13e)](){function _0x162e5e(_0x31179f,_0x22b733){return _0x40a5(_0x22b733- -0x3cc,_0x31179f);}if(this['query'][_0x162e5e(-0x289,-0x309)])return this['executeQuery']('PATCH',_0x162e5e(-0x2d0,-0x31c)+this[_0x162e5e(-0x264,-0x293)],{'data':this[_0x162e5e(-0x28f,-0x2b9)]['updateData'],'options':this[_0x162e5e(-0x2cd,-0x2b9)]['updateOptions'],'filters':this['query'][_0x162e5e(-0x373,-0x31b)]});else return this['query'][_0x162e5e(-0x29d,-0x2fd)]?this[_0x162e5e(-0x2a9,-0x31d)]('DELETE',_0x162e5e(-0x29f,-0x31c)+this[_0x162e5e(-0x2d7,-0x293)]+'?operation=delete',{'options':this['query'][_0x162e5e(-0x250,-0x282)],'filters':this['query']['filters']}):this['executeQuery']('GET','/sdk/v1/'+this[_0x162e5e(-0x23a,-0x293)]+_0x162e5e(-0x2b2,-0x2f1),{'select':this[_0x162e5e(-0x2e7,-0x2b9)][_0x162e5e(-0x254,-0x299)],'filters':this['query']['filters'],'order':this[_0x162e5e(-0x2db,-0x2b9)]['order'],'limit':this['query']['limit'],'range':this[_0x162e5e(-0x2b5,-0x2b9)][_0x162e5e(-0x2bf,-0x28c)]});}async[_0x25280e(-0x124,-0xcf)](){this[_0x3e702a(0x499,0x4fe)](0x1);function _0x3e702a(_0x2820e5,_0x3373fc){return _0x40a5(_0x2820e5-0x39a,_0x3373fc);}const result=await this[_0x3e702a(0x4b5,0x4de)]();return{'data':result[_0x3e702a(0x4bc,0x4bf)]?.[0x0]||null,'error':result['error']};}async[_0x25280e(-0x137,-0x1aa)](_0x432a58,_0x3d9ae2,_0x292a73){function _0x3f0beb(_0x4475fd,_0x35fa04){return _0x40a5(_0x4475fd-0x3e4,_0x35fa04);}try{let response;const headers={};this['workspaceId']&&(headers['x-workspace-id']=this['workspaceId']);if(_0x432a58==='GET'){const _0x2e9f7b=_0x3d9ae2['split']('?'),_0x251a01=_0x2e9f7b[0x0],existingParams=new URLSearchParams(_0x2e9f7b[0x1]||'');if(_0x292a73[_0x3f0beb(0x517,0x54c)])existingParams[_0x3f0beb(0x528,0x4c1)]('select',_0x292a73['select']);_0x292a73['filters']?.['length']&&_0x292a73[_0x3f0beb(0x495,0x4ca)]['forEach'](filter=>{function _0x55d1cb(_0x54cff4,_0x56a3e3){return _0x40a5(_0x54cff4-0x3c9,_0x56a3e3);}existingParams[_0x55d1cb(0x50d,0x4af)](filter['column'],filter[_0x55d1cb(0x526,0x4d1)]+'.'+filter['value']);});if(_0x292a73['order']?.[_0x3f0beb(0x553,0x502)]){const orderStr=_0x292a73[_0x3f0beb(0x54b,0x563)][_0x3f0beb(0x500,0x52f)](_0x32481f=>''+_0x32481f['column']+(_0x32481f['ascending']?_0x3f0beb(0x4c9,0x4c2):'.desc'))['join'](',');existingParams['append']('order',orderStr);}if(_0x292a73['limit'])existingParams[_0x3f0beb(0x528,0x589)]('limit',_0x292a73[_0x3f0beb(0x4e3,0x483)]['toString']());_0x292a73[_0x3f0beb(0x524,0x4f5)]&&(existingParams['append'](_0x3f0beb(0x58b,0x524),_0x292a73['range']['from']['toString']()),existingParams[_0x3f0beb(0x528,0x599)]('limit',(_0x292a73['range']['to']-_0x292a73[_0x3f0beb(0x524,0x587)][_0x3f0beb(0x4f6,0x4de)]+0x1)[_0x3f0beb(0x48d,0x4cf)]())),response=await this['httpClient']['get'](_0x251a01+'?'+existingParams['toString'](),{'headers':headers});}else{if(_0x432a58==='DELETE'){const _0x87ea93=_0x3d9ae2[_0x3f0beb(0x4ba,0x51f)]('?'),_0xc67464=_0x87ea93[0x0],existingParams=new URLSearchParams(_0x87ea93[0x1]||'');!existingParams['has'](_0x3f0beb(0x572,0x4fd))&&existingParams[_0x3f0beb(0x528,0x581)]('operation','delete');_0x292a73['filters']?.['length']&&_0x292a73[_0x3f0beb(0x495,0x4b6)]['forEach'](filter=>{function _0x4b7dcd(_0x5dad64,_0x525428){return _0x40a5(_0x5dad64- -0x1a0,_0x525428);}existingParams[_0x4b7dcd(-0x5c,0x21)](filter[_0x4b7dcd(-0x91,-0x7f)],filter[_0x4b7dcd(-0x43,0xe)]+'.'+filter['value']);});const deleteUrl=_0xc67464+'?'+existingParams['toString']();console[_0x3f0beb(0x4f4,0x4d6)]('\uD83D\uDD27 DELETE URL construída:',deleteUrl),console[_0x3f0beb(0x4f4,0x4fc)]('\uD83D\uDD27 DELETE headers:',headers),console[_0x3f0beb(0x4f4,0x514)]('\uD83D\uDD27 DELETE filtros originais:',_0x292a73['filters']),response=await this['httpClient']['delete'](deleteUrl,{'headers':headers});}else{if(_0x432a58==='PATCH'){const _0x1d04ec=_0x3d9ae2[_0x3f0beb(0x4ba,0x4ea)]('?'),_0xd7979a=_0x1d04ec[0x0],existingParams=new URLSearchParams(_0x1d04ec[0x1]||'');!existingParams[_0x3f0beb(0x571,0x565)]('operation')&&existingParams[_0x3f0beb(0x528,0x4ea)]('operation','update');_0x292a73[_0x3f0beb(0x495,0x460)]?.['length']&&_0x292a73['filters']['forEach'](filter=>{function _0x93e997(_0x229dc6,_0x30639f){return _0x40a5(_0x229dc6- -0x38a,_0x30639f);}existingParams[_0x93e997(-0x246,-0x1fa)](filter[_0x93e997(-0x27b,-0x217)],filter['operator']+'.'+filter[_0x93e997(-0x2e0,-0x275)]);});_0x292a73['options']?.[_0x3f0beb(0x4bc,0x473)]&&(headers['Prefer']=_0x292a73['options'][_0x3f0beb(0x4bc,0x479)]);const updateUrl=_0xd7979a+'?'+existingParams[_0x3f0beb(0x48d,0x434)]();response=await this[_0x3f0beb(0x544,0x580)][_0x3f0beb(0x56f,0x53f)](updateUrl,_0x292a73[_0x3f0beb(0x506,0x4cc)],{'headers':headers});}else{let _0x29a1b8=_0x292a73['data'];!headers[_0x3f0beb(0x577,0x591)]&&(headers[_0x3f0beb(0x577,0x564)]='return=representation'),_0x292a73['options']?.[_0x3f0beb(0x504,0x52b)]&&(headers[_0x3f0beb(0x577,0x555)]=_0x3f0beb(0x4a3,0x43f)),_0x292a73[_0x3f0beb(0x4aa,0x4ca)]&&(_0x29a1b8=_0x292a73[_0x3f0beb(0x4aa,0x46f)]),response=await this[_0x3f0beb(0x544,0x50a)][_0x3f0beb(0x503,0x483)](_0x3d9ae2,_0x29a1b8,{'headers':headers});}}}return{'data':response[_0x3f0beb(0x506,0x4a1)],'error':null,'count':response[_0x3f0beb(0x561,0x5ab)]?.[_0x3f0beb(0x552,0x52d)]?parseInt(response[_0x3f0beb(0x561,0x543)]['x-total-count']):undefined};}catch(_0x1618ef){return{'data':null,'error':_0x1618ef instanceof EBaaSError?_0x1618ef:new EBaaSError(_0x1618ef instanceof Error?_0x1618ef['message']:_0x3f0beb(0x490,0x472),0x0,_0x1618ef)};}}}class CustomDatabaseManager{constructor(_0x2d7e2f,_0x2f8f43){this['httpClient']=_0x2d7e2f,this['workspaceId']=_0x2f8f43;}async['detectCustomDatabase'](){if(!this[_0x520909(-0x12,-0x69)])return{'hasCustomDatabase':![]};function _0x520909(_0x1c26d3,_0x4ba08c){return _0x40a5(_0x1c26d3- -0x15e,_0x4ba08c);}try{const response=await this['httpClient']['get']('/admin/v1/workspace/custom-database',{'headers':{'x-workspace-id':this[_0x520909(-0x12,0x6d)]}});if(response['status']===0xc8&&response[_0x520909(-0x3c,-0x72)]?.['config']){const config=response['data']['config'],_0x10c63e={'host':config['postgresHost'],'port':config['postgresPort'],'database':config[_0x520909(-0x19,-0x47)],'username':config[_0x520909(-0x8c,-0x87)],'password':'','schema':config[_0x520909(0x4a,0xb2)],'sslEnabled':config[_0x520909(0x45,0x3d)]};return this['detectedConfig']={'hasCustomDatabase':!![],'config':config,'credentials':_0x10c63e},this['detectedConfig'];}}catch(_0x2a555a){if(_0x2a555a?.['status']===0x194)return this['detectedConfig']={'hasCustomDatabase':![]},this['detectedConfig'];console['warn']('Failed to detect custom database configuration:',_0x2a555a);}return this[_0x520909(0x19,0x3a)]={'hasCustomDatabase':![]},this['detectedConfig'];}async[_0x25280e(-0x133,-0x177)](_0x45239e){function _0x2e98a8(_0x3ebec7,_0x8d6ea5){return _0x40a5(_0x8d6ea5-0xf,_0x3ebec7);}try{const response=await this[_0x2e98a8(0x168,0x16f)][_0x2e98a8(0xeb,0x12e)]('/admin/v1/workspace/custom-database/test-connection',_0x45239e,{'headers':this[_0x2e98a8(0x14e,0x15b)]?{'X-Workspace-ID':this['workspaceId']}:{}});return response['data'];}catch(_0x140f67){return{'success':![],'message':_0x140f67?.['message']||_0x2e98a8(0x115,0x104)};}}async['configureCustomDatabase'](_0x29cc21){if(!this['workspaceId'])throw new Error('Workspace ID is required to configure custom database');const response=await this['httpClient'][_0x1fd23e(0x209,0x1bf)]('/admin/v1/workspace/custom-database',{'workspaceId':this['workspaceId'],..._0x29cc21},{'headers':{'X-Workspace-ID':this['workspaceId']}}),config=response[_0x1fd23e(0x23c,0x1c2)][_0x1fd23e(0x1db,0x1da)];this[_0x1fd23e(0x1bc,0x217)]={'hasCustomDatabase':!![],'config':config,'credentials':_0x29cc21};function _0x1fd23e(_0xec9997,_0x437e5f){return _0x40a5(_0x437e5f-0xa0,_0xec9997);}return config;}async['removeCustomDatabase'](){function _0x47e035(_0x17322a,_0x38fac9){return _0x40a5(_0x38fac9-0x341,_0x17322a);}if(!this[_0x47e035(0x420,0x48d)])throw new Error('Workspace ID is required to remove custom database');await this[_0x47e035(0x42a,0x4a1)][_0x47e035(0x4cc,0x494)]('/admin/v1/workspace/custom-database',{'headers':{'X-Workspace-ID':this['workspaceId']}}),this[_0x47e035(0x4d5,0x4b8)]={'hasCustomDatabase':![]};}['getDetectedConfig'](){function _0x25a37e(_0x83eecf,_0x281250){return _0x40a5(_0x281250-0x3cf,_0x83eecf);}return this[_0x25a37e(0x4f3,0x546)];}[_0x25280e(-0x15d,-0x13b)](){function _0x296c6c(_0x104ec6,_0x5ddf22){return _0x40a5(_0x104ec6-0x258,_0x5ddf22);}return this[_0x296c6c(0x3cf,0x3b3)]?.['hasCustomDatabase']??![];}['getCustomCredentials'](){return this['detectedConfig']?.['credentials'];}['setWorkspaceId'](_0x4c549b){this[_0x3d83dd(-0x2f3,-0x28a)]=_0x4c549b;function _0x3d83dd(_0x5d4d16,_0x516abe){return _0x40a5(_0x516abe- -0x3d6,_0x5d4d16);}this['detectedConfig']=undefined;}[_0x25280e(-0xad,-0x101)](){return this['workspaceId'];}['getStatus'](){function _0x5e3f7c(_0xe696e3,_0x1ad6a1){return _0x40a5(_0xe696e3-0x1c5,_0x1ad6a1);}return{'workspaceId':this[_0x5e3f7c(0x311,0x2b2)],'hasConfig':this[_0x5e3f7c(0x2e3,0x2e8)](),'configDetails':this['detectedConfig']?.[_0x5e3f7c(0x2d9,0x2b0)]?{'host':this[_0x5e3f7c(0x33c,0x354)]['credentials']['host'],'port':this[_0x5e3f7c(0x33c,0x32d)][_0x5e3f7c(0x2d9,0x287)][_0x5e3f7c(0x28f,0x257)],'database':this['detectedConfig']['credentials']['database'],'schema':this['detectedConfig']['credentials']['schema']||'public','sslEnabled':this[_0x5e3f7c(0x33c,0x3a0)]['credentials']['sslEnabled']||![]}:undefined};}}class DatabaseClient{constructor(_0x165e1a,_0x2e8aff){this['httpClient']=_0x165e1a,this['customDatabaseManager']=new CustomDatabaseManager(_0x165e1a,_0x2e8aff);}['from'](_0x44c680){function _0x4d1a98(_0x27e12f,_0x240bc7){return _0x40a5(_0x240bc7-0x36,_0x27e12f);}return new QueryBuilder(this[_0x4d1a98(0x1e8,0x196)],_0x44c680,this[_0x4d1a98(0xce,0xfd)],this['customDatabaseManager'][_0x4d1a98(0x17e,0x18e)]());}['rpc'](_0x360815,_0x475b15){function _0x4751e9(_0x1ed588,_0x2b5999){return _0x40a5(_0x1ed588- -0x114,_0x2b5999);}return this['httpClient'][_0x4751e9(0xb,0x76)]('/rpc/'+_0x360815,_0x475b15);}['schema'](_0x2b8130){const _0xf0a791=new DatabaseClient(this['httpClient'],this[_0x500513(0x33d,0x38e)][_0x500513(0x45d,0x402)]());_0xf0a791[_0x500513(0x320,0x371)]=_0x2b8130;function _0x500513(_0x157032,_0x647599){return _0x40a5(_0x647599-0x2aa,_0x157032);}return _0xf0a791['customDatabaseManager']=this[_0x500513(0x375,0x38e)],_0xf0a791;}async[_0x25280e(-0x50,-0xc1)](){function _0x74744e(_0x1f4db4,_0x2da3a9){return _0x40a5(_0x2da3a9- -0x2d9,_0x1f4db4);}return this['customDatabaseManager'][_0x74744e(-0x105,-0x141)]();}async['testCustomConnection'](_0x5d891){function _0x57c197(_0x1d9cbb,_0x1d33c4){return _0x40a5(_0x1d33c4- -0x32,_0x1d9cbb);}return this[_0x57c197(0x39,0xb2)][_0x57c197(0x81,0xb0)](_0x5d891);}async[_0x25280e(-0x158,-0x16f)](_0x198bf1){return this['customDatabaseManager']['configureCustomDatabase'](_0x198bf1);}async[_0x25280e(-0x137,-0xd0)](){function _0x19e4fd(_0xbbe755,_0x24c6de){return _0x40a5(_0xbbe755-0xa1,_0x24c6de);}return this[_0x19e4fd(0x185,0x1b7)]['removeCustomDatabase']();}['isUsingCustomDatabase'](){function _0x33e922(_0x5c3a8f,_0x55648a){return _0x40a5(_0x5c3a8f- -0x264,_0x55648a);}return this[_0x33e922(-0x180,-0x184)]['hasCustomDatabase']();}[_0x25280e(-0x135,-0x121)](){function _0x140970(_0xcc5c41,_0x501250){return _0x40a5(_0x501250- -0x2f0,_0xcc5c41);}return this[_0x140970(-0x247,-0x20c)][_0x140970(-0x1ac,-0x1ec)]();}['setWorkspaceId'](_0x2f847d){function _0x2da216(_0x4785c2,_0x30653f){return _0x40a5(_0x30653f- -0x1db,_0x4785c2);}this[_0x2da216(-0xa9,-0xf7)]['setWorkspaceId'](_0x2f847d);}async[_0x25280e(-0x1c8,-0x1a0)](){function _0x1b93d2(_0x55e202,_0x590704){return _0x40a5(_0x55e202- -0x86,_0x590704);}try{await this[_0x1b93d2(0x5e,0xa3)][_0x1b93d2(0x112,0xf8)]();}catch(_0x496faf){console[_0x1b93d2(0x34,-0x5)]('Failed to initialize custom database detection:',_0x496faf);}}}class StorageBucket{constructor(_0x17d7f4,bucketId){this[_0x5f353d(0x4fd,0x4a9)]=_0x17d7f4;function _0x5f353d(_0x48f389,_0x828852){return _0x40a5(_0x48f389-0x39d,_0x828852);}this[_0x5f353d(0x4cf,0x525)]=bucketId;}async[_0x25280e(-0x197,-0x197)](_0x5779d8,_0x34803a,_0x31b376){function _0x24e33f(_0x261c0f,_0x3c3873){return _0x40a5(_0x261c0f-0x44,_0x3c3873);}try{const _0x352bf4=new FormData();if(_0x34803a instanceof File)_0x352bf4[_0x24e33f(0x188,0x189)]('file',_0x34803a);else{if(_0x34803a instanceof Blob)_0x352bf4['append'](_0x24e33f(0x110,0x12e),_0x34803a,_0x5779d8);else{if(_0x34803a instanceof ArrayBuffer)_0x352bf4['append']('file',new Blob([_0x34803a]),_0x5779d8);else typeof _0x34803a==='string'&&_0x352bf4[_0x24e33f(0x188,0x10a)](_0x24e33f(0x110,0x14c),new Blob([_0x34803a],{'type':_0x24e33f(0x100,0xe3)}),_0x5779d8);}}_0x352bf4[_0x24e33f(0x188,0x10e)](_0x24e33f(0x145,0x17b),_0x5779d8);_0x31b376?.['cacheControl']&&_0x352bf4['append']('cacheControl',_0x31b376[_0x24e33f(0x136,0x156)]);_0x31b376?.[_0x24e33f(0x1bf,0x20f)]&&_0x352bf4['append'](_0x24e33f(0x1bf,0x16a),_0x31b376[_0x24e33f(0x1bf,0x169)]);_0x31b376?.[_0x24e33f(0x1ae,0x153)]&&_0x352bf4[_0x24e33f(0x188,0x153)]('metadata',JSON['stringify'](_0x31b376[_0x24e33f(0x1ae,0x16c)]));const _0x3c733f='/storage/buckets/'+this['bucketId']+_0x24e33f(0x15e,0x115)+(_0x31b376?.[_0x24e33f(0x164,0x104)]?_0x24e33f(0x1d4,0x1b2):''),response=await this[_0x24e33f(0x1a4,0x21c)][_0x24e33f(0x163,0x12c)](_0x3c733f,_0x352bf4,{'headers':{'Content-Type':_0x24e33f(0x134,0xdd)}});return{'data':response[_0x24e33f(0x166,0x12f)],'error':null};}catch(_0x4f2cd6){return{'data':null,'error':_0x4f2cd6 instanceof EBaaSError?_0x4f2cd6:new EBaaSError(_0x4f2cd6 instanceof Error?_0x4f2cd6['message']:'Failed\x20to\x20upload\x20file',0x0,_0x4f2cd6)};}}async[_0x25280e(-0x1da,-0x18e)](_0x557f7a,_0x239e60){function _0x340e2a(_0x137ea8,_0x33e4da){return _0x40a5(_0x33e4da-0x91,_0x137ea8);}try{const _0x2e7a39=new URLSearchParams();_0x239e60?.[_0x340e2a(0x1ab,0x1ae)]&&Object[_0x340e2a(0x1f0,0x237)](_0x239e60[_0x340e2a(0x1c7,0x1ae)])[_0x340e2a(0x20a,0x1be)](([_0x49be8e,_0x44b6ae])=>{function _0x3ccb6e(_0x4206c7,_0x2581e6){return _0x40a5(_0x4206c7- -0x3d4,_0x2581e6);}_0x44b6ae!==undefined&&_0x2e7a39[_0x3ccb6e(-0x290,-0x296)](_0x49be8e,String(_0x44b6ae));});const _0x18fcbf=_0x340e2a(0x1b8,0x16d)+this['bucketId']+'/files/'+_0x557f7a+(_0x2e7a39[_0x340e2a(0x169,0x13a)]()?'?'+_0x2e7a39['toString']():''),response=await this[_0x340e2a(0x18c,0x1f1)][_0x340e2a(0x24e,0x1f7)](_0x18fcbf,{'responseType':'blob'});return{'data':response['data'],'error':null};}catch(_0x4d5999){return{'data':null,'error':_0x4d5999 instanceof EBaaSError?_0x4d5999:new EBaaSError(_0x4d5999 instanceof Error?_0x4d5999['message']:_0x340e2a(0x112,0x143),0x0,_0x4d5999)};}}async[_0x25280e(-0xcd,-0x129)](_0x3c3064,_0x54c49c){function _0x350caf(_0x587ac5,_0x3ed483){return _0x40a5(_0x587ac5-0x3af,_0x3ed483);}try{const _0x279487=new URLSearchParams();_0x3c3064&&_0x279487[_0x350caf(0x4f3,0x4c4)]('prefix',_0x3c3064);_0x54c49c?.['limit']&&_0x279487[_0x350caf(0x4f3,0x51f)]('limit',String(_0x54c49c[_0x350caf(0x4ae,0x4a1)]));_0x54c49c?.[_0x350caf(0x556,0x5d2)]&&_0x279487[_0x350caf(0x4f3,0x51b)]('offset',String(_0x54c49c[_0x350caf(0x556,0x55f)]));_0x54c49c?.['sortBy']&&_0x279487[_0x350caf(0x4f3,0x493)](_0x350caf(0x4ba,0x4b9),JSON['stringify'](_0x54c49c[_0x350caf(0x4ba,0x51e)]));_0x54c49c?.['search']&&_0x279487[_0x350caf(0x4f3,0x4f2)]('search',_0x54c49c[_0x350caf(0x4ee,0x52d)]);const _0x429b43=_0x350caf(0x48b,0x4cd)+this['bucketId']+_0x350caf(0x4c9,0x525)+(_0x279487[_0x350caf(0x458,0x48d)]()?'?'+_0x279487[_0x350caf(0x458,0x48d)]():''),response=await this[_0x350caf(0x50f,0x4c9)][_0x350caf(0x515,0x543)](_0x429b43);return{'data':response[_0x350caf(0x4d1,0x49b)],'error':null};}catch(_0x3da096){return{'data':null,'error':_0x3da096 instanceof EBaaSError?_0x3da096:new EBaaSError(_0x3da096 instanceof Error?_0x3da096[_0x350caf(0x521,0x520)]:'Failed\x20to\x20list\x20files',0x0,_0x3da096)};}}async[_0x25280e(-0x12d,-0xf5)](_0x5583fb){function _0x2e0e92(_0x3e0531,_0x178a74){return _0x40a5(_0x178a74-0x3be,_0x3e0531);}try{const response=await this['httpClient']['delete']('/storage/buckets/'+this['bucketId']+'/files',{'data':{'paths':_0x5583fb}});return{'data':response[_0x2e0e92(0x561,0x4e0)],'error':null};}catch(_0x390b52){return{'data':null,'error':_0x390b52 instanceof EBaaSError?_0x390b52:new EBaaSError(_0x390b52 instanceof Error?_0x390b52['message']:'Failed\x20to\x20remove\x20files',0x0,_0x390b52)};}}async['move'](fromPath,_0x2770ff){function _0x396462(_0x3078f2,_0x20fa6c){return _0x40a5(_0x20fa6c- -0x273,_0x3078f2);}try{const response=await this[_0x396462(-0x13a,-0x113)][_0x396462(-0x1cf,-0x154)](_0x396462(-0x1e8,-0x197)+this[_0x396462(-0xc3,-0x141)]+_0x396462(-0x15d,-0x185),{'sourceKey':fromPath,'destinationKey':_0x2770ff});return{'data':response['data'],'error':null};}catch(_0x17e722){return{'data':null,'error':_0x17e722 instanceof EBaaSError?_0x17e722:new EBaaSError(_0x17e722 instanceof Error?_0x17e722[_0x396462(-0x96,-0x101)]:_0x396462(-0x166,-0x102),0x0,_0x17e722)};}}async[_0x25280e(-0x12d,-0x1a3)](fromPath,_0x4df646){function _0x16445e(_0x43b9fc,_0x47c580){return _0x40a5(_0x47c580- -0x152,_0x43b9fc);}try{const response=await this['httpClient'][_0x16445e(-0x3c,-0x33)]('/storage/buckets/'+this['bucketId']+_0x16445e(-0x45,0x8),{'sourceKey':fromPath,'destinationKey':_0x4df646});return{'data':response[_0x16445e(0x3,-0x30)],'error':null};}catch(_0xb30df1){return{'data':null,'error':_0xb30df1 instanceof EBaaSError?_0xb30df1:new EBaaSError(_0xb30df1 instanceof Error?_0xb30df1[_0x16445e(0x2d,0x20)]:'Failed\x20to\x20copy\x20file',0x0,_0xb30df1)};}}async['createSignedUrl'](_0x36793e,_0x33d229,_0x56e67){function _0x3f1051(_0x5b5da6,_0xfa220a){return _0x40a5(_0xfa220a-0xbf,_0x5b5da6);}try{const response=await this[_0x3f1051(0x1e4,0x21f)][_0x3f1051(0x237,0x1de)]('/storage/buckets/'+this['bucketId']+'/files/'+_0x36793e+'/sign',{'expiresIn':_0x33d229,..._0x56e67});return{'data':response['data'],'error':null};}catch(_0x25410d){return{'data':null,'error':_0x25410d instanceof EBaaSError?_0x25410d:new EBaaSError(_0x25410d instanceof Error?_0x25410d[_0x3f1051(0x201,0x231)]:'Failed\x20to\x20create\x20signed\x20URL',0x0,_0x25410d)};}}['getPublicUrl'](_0x259861,_0x3ace61){const _0x45dc86=new URLSearchParams();function _0x33bce4(_0x11d1b4,_0x208533){return _0x40a5(_0x11d1b4-0x25b,_0x208533);}_0x3ace61?.[_0x33bce4(0x378,0x3a6)]&&Object['entries'](_0x3ace61[_0x33bce4(0x378,0x3a5)])['forEach'](([_0x3b8c24,_0x1ef929])=>{_0x1ef929!==undefined&&_0x45dc86['append'](_0x3b8c24,String(_0x1ef929));});const _0x4e59ff=this['httpClient'][_0x33bce4(0x359,0x3ce)]||'',_0x954433=_0x4e59ff+_0x33bce4(0x337,0x362)+this[_0x33bce4(0x38d,0x39e)]+'/files/'+_0x259861+(_0x45dc86['toString']()?'?'+_0x45dc86[_0x33bce4(0x304,0x290)]():'');return{'data':{'publicUrl':_0x954433}};}async[_0x25280e(-0xa9,-0xb5)](_0x5e1fcb){function _0x41d6ee(_0x19237e,_0xdbfac8){return _0x40a5(_0x19237e-0x24f,_0xdbfac8);}try{const response=await this[_0x41d6ee(0x3af,0x41c)]['get'](_0x41d6ee(0x32b,0x2c5)+this['bucketId']+'/files/'+_0x5e1fcb+_0x41d6ee(0x37a,0x344));return{'data':response[_0x41d6ee(0x371,0x34b)],'error':null};}catch(_0x1cb0fb){return{'data':null,'error':_0x1cb0fb instanceof EBaaSError?_0x1cb0fb:new EBaaSError(_0x1cb0fb instanceof Error?_0x1cb0fb['message']:_0x41d6ee(0x3b4,0x41b),0x0,_0x1cb0fb)};}}async['updateFileMetadata'](_0x3a8fe4,metadata){function _0x468ac1(_0x59d57f,_0x4ab25f){return _0x40a5(_0x4ab25f- -0x1bb,_0x59d57f);}try{const response=await this['httpClient'][_0x468ac1(-0xb9,-0x60)]('/storage/buckets/'+this[_0x468ac1(-0xb4,-0x89)]+_0x468ac1(-0x20,-0x96)+_0x3a8fe4+_0x468ac1(-0xed,-0xde),{'metadata':metadata});return{'data':response[_0x468ac1(-0x58,-0x99)],'error':null};}catch(_0x75921d){return{'data':null,'error':_0x75921d instanceof EBaaSError?_0x75921d:new EBaaSError(_0x75921d instanceof Error?_0x75921d[_0x468ac1(-0x74,-0x49)]:_0x468ac1(-0xba,-0x45),0x0,_0x75921d)};}}}class StorageClient{constructor(_0x23fb1a){function _0x5b4155(_0x34686d,_0x573d62){return _0x40a5(_0x573d62- -0x167,_0x34686d);}this[_0x5b4155(-0x3d,-0x7)]=_0x23fb1a;}[_0x25280e(-0x132,-0x147)](bucketId){function _0x24a52f(_0x357539,_0x34c0cc){return _0x40a5(_0x357539- -0x1e9,_0x34c0cc);}return new StorageBucket(this[_0x24a52f(-0x89,-0xfa)],bucketId);}async[_0x25280e(-0x164,-0x16a)](_0x9b4dba,_0x1d3117){function _0x56b6eb(_0x5d72f7,_0x542386){return _0x40a5(_0x542386-0x1fe,_0x5d72f7);}try{const response=await this['httpClient']['post']('/storage/buckets',{'id':_0x9b4dba,..._0x1d3117});return{'data':response[_0x56b6eb(0x373,0x320)],'error':null};}catch(_0x2bc7f3){return{'data':null,'error':_0x2bc7f3 instanceof EBaaSError?_0x2bc7f3:new EBaaSError(_0x2bc7f3 instanceof Error?_0x2bc7f3['message']:_0x56b6eb(0x3ab,0x39c),0x0,_0x2bc7f3)};}}async['getBucket'](_0x4425a7){function _0x106312(_0x174939,_0xd96b7){return _0x40a5(_0xd96b7- -0x6a,_0x174939);}try{const response=await this['httpClient'][_0x106312(0x99,0xfc)]('/storage/buckets/'+_0x4425a7);return{'data':response['data'],'error':null};}catch(_0x57f70b){return{'data':null,'error':_0x57f70b instanceof EBaaSError?_0x57f70b:new EBaaSError(_0x57f70b instanceof Error?_0x57f70b['message']:'Failed\x20to\x20get\x20bucket',0x0,_0x57f70b)};}}async['listBuckets'](){function _0x11ac4b(_0x417125,_0x3b9155){return _0x40a5(_0x417125-0x0,_0x3b9155);}try{const response=await this['httpClient']['get'](_0x11ac4b(0xfb,0xc4));return{'data':response[_0x11ac4b(0x122,0xaa)],'error':null};}catch(_0x170448){return{'data':null,'error':_0x170448 instanceof EBaaSError?_0x170448:new EBaaSError(_0x170448 instanceof Error?_0x170448['message']:_0x11ac4b(0x161,0x1a8),0x0,_0x170448)};}}async['updateBucket'](_0xfdc7cf,_0x54bfb4){function _0x1241ff(_0x1d54cc,_0x468b95){return _0x40a5(_0x1d54cc- -0x266,_0x468b95);}try{const response=await this['httpClient']['put']('/storage/buckets/'+_0xfdc7cf,_0x54bfb4);return{'data':response[_0x1241ff(-0x144,-0x121)],'error':null};}catch(_0x2d81d6){return{'data':null,'error':_0x2d81d6 instanceof EBaaSError?_0x2d81d6:new EBaaSError(_0x2d81d6 instanceof Error?_0x2d81d6[_0x1241ff(-0xf4,-0x158)]:'Failed\x20to\x20update\x20bucket',0x0,_0x2d81d6)};}}async['deleteBucket'](_0x4e91af){function _0x33bed6(_0x48fb8e,_0x43ab23){return _0x40a5(_0x48fb8e- -0x186,_0x43ab23);}try{const response=await this[_0x33bed6(-0x26,-0x8b)][_0x33bed6(-0x33,-0x4a)](_0x33bed6(-0xaa,-0x11f)+_0x4e91af);return{'data':response['data'],'error':null};}catch(_0x2f52b1){return{'data':null,'error':_0x2f52b1 instanceof EBaaSError?_0x2f52b1:new EBaaSError(_0x2f52b1 instanceof Error?_0x2f52b1[_0x33bed6(-0x14,-0x5d)]:'Failed\x20to\x20delete\x20bucket',0x0,_0x2f52b1)};}}async[_0x25280e(-0x178,-0x1a5)](){function _0x4d9907(_0x31f7d7,_0x11f97e){return _0x40a5(_0x11f97e-0x2a3,_0x31f7d7);}try{const response=await this['httpClient'][_0x4d9907(0x440,0x409)](_0x4d9907(0x424,0x3f0));return{'data':response['data'],'error':null};}catch(_0x32c73){return{'data':null,'error':_0x32c73 instanceof EBaaSError?_0x32c73:new EBaaSError(_0x32c73 instanceof Error?_0x32c73[_0x4d9907(0x415,0x415)]:_0x4d9907(0x437,0x3f1),0x0,_0x32c73)};}}}class RealtimeChannel extends EventEmitter{constructor(_0x5ba622,_0x4f4c56){super();function _0x23f0a1(_0x4a3383,_0x51ae9d){return _0x40a5(_0x4a3383-0x1b7,_0x51ae9d);}this[_0x23f0a1(0x2f3,0x288)]=![],this['state']=_0x23f0a1(0x2fa,0x29f),this['subscriptions']=new Map(),this[_0x23f0a1(0x285,0x227)]=_0x5ba622,this[_0x23f0a1(0x320,0x2fc)]=_0x4f4c56;}['subscribe'](_0x178472){function _0x212884(_0x56478b,_0xc47780){return _0x40a5(_0x56478b-0x3cf,_0xc47780);}return!this[_0x212884(0x50b,0x543)]&&(this['joinedOnce']=!![],this[_0x212884(0x4c3,0x4eb)]()),_0x178472&&this['on'](_0x212884(0x477,0x453),_0x178472),this;}[_0x25280e(-0x10e,-0xc2)](filter,_0x21460b){const _0x226490='postgres_changes:'+JSON[_0x312031(-0x17d,-0x172)](filter);super['on'](_0x226490,_0x21460b);const _0x5544c9={'unsubscribe':()=>{function _0x5d517f(_0x556e2f,_0x3bfbcf){return _0x40a5(_0x3bfbcf-0x364,_0x556e2f);}super[_0x5d517f(0x47e,0x48b)](_0x226490,_0x21460b),this[_0x5d517f(0x4e3,0x4f3)][_0x5d517f(0x4fc,0x4b7)](_0x226490);}};this[_0x312031(-0x70,-0x91)]['set'](_0x226490,_0x5544c9);this['socket']?.['connected']&&this['state']==='joined'&&this['socket']['emit'](_0x312031(-0xb1,-0x11b),{'topic':this[_0x312031(-0x154,-0x152)],'filter':filter,'ref':this[_0x312031(-0xfe,-0xce)]()});function _0x312031(_0x4319df,_0x4ec8b2){return _0x40a5(_0x4ec8b2- -0x220,_0x4319df);}return _0x5544c9;}['onBroadcast'](filter,_0xffe3b0){const _0x11f619=_0x47631e(-0x15d,-0x18a)+JSON[_0x47631e(-0x161,-0x191)](filter);super['on'](_0x11f619,_0xffe3b0);function _0x47631e(_0x4adaf3,_0xb235fe){return _0x40a5(_0xb235fe- -0x23f,_0x4adaf3);}const _0x2f4874={'unsubscribe':()=>{function _0x5ae1ea(_0x25a66e,_0xd3d91a){return _0x40a5(_0xd3d91a- -0x209,_0x25a66e);}super['off'](_0x11f619,_0xffe3b0),this[_0x5ae1ea(-0x29,-0x7a)]['delete'](_0x11f619);}};return this[_0x47631e(-0x45,-0xb0)][_0x47631e(-0x15a,-0x131)](_0x11f619,_0x2f4874),_0x2f4874;}['onPresence'](filter,_0x2820a4){const _0x3cc348=_0x474dd0(-0x21e,-0x242)+JSON[_0x474dd0(-0x278,-0x26d)](filter);super['on'](_0x3cc348,_0x2820a4);function _0x474dd0(_0x1557cb,_0x218072){return _0x40a5(_0x218072- -0x31b,_0x1557cb);}const _0x30b2fe={'unsubscribe':()=>{super['off'](_0x3cc348,_0x2820a4);function _0x4bd89f(_0x1414a0,_0x25a40c){return _0x40a5(_0x25a40c-0x39,_0x1414a0);}this[_0x4bd89f(0x204,0x1c8)]['delete'](_0x3cc348);}};return this['subscriptions']['set'](_0x3cc348,_0x30b2fe),_0x30b2fe;}['send'](_0x24de9e){return new Promise(_0x2861b8=>{function _0x32f68a(_0x276573,_0x520e9b){return _0x40a5(_0x520e9b- -0x360,_0x276573);}this['socket']?.[_0x32f68a(-0x28f,-0x256)]&&this['state']==='joined'?(this['socket'][_0x32f68a(-0x2ce,-0x282)]('broadcast',{'topic':this['topic'],'event':_0x24de9e['event'],'payload':_0x24de9e,'ref':this['makeRef']()}),_0x2861b8('ok')):_0x2861b8(_0x32f68a(-0x235,-0x290));});}[_0x25280e(-0xde,-0xbd)](_0x9e2ba2){return new Promise(_0x11529f=>{function _0x5eb4e1(_0x14891a,_0x3ca538){return _0x40a5(_0x3ca538- -0x222,_0x14891a);}this[_0x5eb4e1(-0xf2,-0xb9)]?.[_0x5eb4e1(-0xd2,-0x118)]&&this[_0x5eb4e1(-0x87,-0xa0)]===_0x5eb4e1(-0xe3,-0xd3)?(this['socket'][_0x5eb4e1(-0x1b6,-0x144)]('presence',{'topic':this[_0x5eb4e1(-0x10e,-0x154)],'event':'track','payload':_0x9e2ba2,'ref':this[_0x5eb4e1(-0xdc,-0xd0)]()}),_0x11529f('ok')):_0x11529f(_0x5eb4e1(-0x147,-0x152));});}[_0x25280e(-0x1fd,-0x1ac)](){return new Promise(_0x2695f2=>{function _0x351894(_0x4e8357,_0x5863a3){return _0x40a5(_0x4e8357-0x216,_0x5863a3);}this['socket']?.['connected']&&this[_0x351894(0x398,0x36d)]===_0x351894(0x365,0x3c7)?(this[_0x351894(0x37f,0x3fe)]['emit']('presence',{'topic':this[_0x351894(0x2e4,0x349)],'event':_0x351894(0x2c3,0x314),'ref':this['makeRef']()}),_0x2695f2('ok')):_0x2695f2('error');});}['unsubscribe'](){return new Promise(_0x58371e=>{this['state']=_0x31b551(-0x1ca,-0x1a6),this[_0x31b551(-0x13c,-0x1ac)]['forEach'](_0x221f5e=>{function _0x4ffd7c(_0x29536f,_0x2ec9ca){return _0x40a5(_0x29536f- -0x1,_0x2ec9ca);}_0x221f5e[_0x4ffd7c(0x17d,0x199)]();}),this[_0x31b551(-0x1b4,-0x1ac)]['clear']();this['socket']?.['connected']&&this['socket'][_0x31b551(-0x23f,-0x25d)]('leave',{'topic':this['topic'],'ref':this[_0x31b551(-0x1b2,-0x1e9)]()});this['state']='closed';function _0x31b551(_0x32ab04,_0x417267){return _0x40a5(_0x417267- -0x33b,_0x32ab04);}this[_0x31b551(-0x2ba,-0x238)](),_0x58371e('ok');});}['_join'](){function _0x196f2c(_0x5bc4cd,_0x19122b){return _0x40a5(_0x19122b-0xed,_0x5bc4cd);}if(this[_0x196f2c(0x2c0,0x26f)]===_0x196f2c(0x219,0x282))return;this['state']=_0x196f2c(0x1c7,0x1cd),this['socket']?.[_0x196f2c(0x18a,0x1f7)]&&(this[_0x196f2c(0x2bc,0x256)][_0x196f2c(0x15e,0x1cb)](_0x196f2c(0x218,0x255),{'topic':this[_0x196f2c(0x19b,0x1bb)],'ref':this['makeRef']()}),setTimeout(()=>{function _0x308301(_0x107f95,_0x5045b4){return _0x40a5(_0x107f95-0x3a,_0x5045b4);}this[_0x308301(0x1bc,0x20f)]===_0x308301(0x11a,0x12f)&&(this[_0x308301(0x1bc,0x234)]=_0x308301(0x189,0x1a0),this[_0x308301(0x118,0x194)]('status',_0x308301(0x1be,0x1e5)));},0x64));}['_rejoin'](){function _0x5edc0c(_0x1d01b6,_0x317543){return _0x40a5(_0x317543-0x1f,_0x1d01b6);}this[_0x5edc0c(0x1be,0x15b)]&&(this['_join'](),this[_0x5edc0c(0x13b,0x1ae)][_0x5edc0c(0x121,0x14c)]((_0x2e24bd,_0x2ea89c)=>{function _0x35ce89(_0x52b071,_0x4b16a5){return _0x40a5(_0x52b071-0x1fe,_0x4b16a5);}if(_0x2ea89c[_0x35ce89(0x383,0x3ec)]('postgres_changes:')){const filter=JSON[_0x35ce89(0x373,0x345)](_0x2ea89c[_0x35ce89(0x34e,0x2ed)]('postgres_changes:',''));this['socket']?.['emit'](_0x35ce89(0x303,0x2f5),{'topic':this[_0x35ce89(0x2cc,0x31d)],'filter':filter,'ref':this['makeRef']()});}}));}[_0x25280e(-0x126,-0x110)](_0x53faf0,_0xfe1a3c){function _0x4dbd05(_0x196be3,_0xc5d58c){return _0x40a5(_0x196be3-0x18c,_0xc5d58c);}if(_0x53faf0===_0x4dbd05(0x24a,0x26c)){const _0x351e71='postgres_changes:'+JSON['stringify'](_0xfe1a3c['filter']||{});this[_0x4dbd05(0x26a,0x29e)](_0x351e71,_0xfe1a3c);}else{if(_0x53faf0==='broadcast'){const _0x466085='broadcast:'+JSON[_0x4dbd05(0x23a,0x24c)]({'event':_0xfe1a3c['event']});this['emit'](_0x466085,_0xfe1a3c);}else{if(_0x53faf0===_0x4dbd05(0x26f,0x1f6)){const _0x3ff208=_0x4dbd05(0x265,0x209)+JSON[_0x4dbd05(0x23a,0x205)]({'event':_0xfe1a3c['event']});this['emit'](_0x3ff208,_0xfe1a3c);}}}this['emit'](_0x53faf0,_0xfe1a3c);}['_setState'](_0x350a5c){this['state']=_0x350a5c;let status;function _0x3f9e4d(_0x167409,_0x4f6172){return _0x40a5(_0x4f6172- -0x22,_0x167409);}switch(_0x350a5c){case _0x3f9e4d(0x148,0x12d):status=_0x3f9e4d(0x127,0x162);break;case _0x3f9e4d(0xd0,0x134):status=_0x3f9e4d(0xe6,0x85);break;case'closed':status='CLOSED';break;default:return;}this[_0x3f9e4d(0x6e,0xbc)]('status',status);}[_0x25280e(-0xe8,-0x107)](){function _0x1f47e2(_0x53c651,_0x3a8e3d){return _0x40a5(_0x3a8e3d-0xe6,_0x53c651);}return Math[_0x1f47e2(0x1ae,0x19e)]()['toString'](0x24)[_0x1f47e2(0x1ce,0x1e2)](0x2,0xf);}['getState'](){return this['state'];}}class RealtimeClient{constructor(_0x23ced0,_0x19d75f,_0x7df34d={}){this['socket']=null,this['channels']=new Map(),this[_0x26c8d1(0x521,0x4a5)]=_0x26c8d1(0x47e,0x4a3),this['reconnectAttempts']=0x0,this[_0x26c8d1(0x475,0x4ed)]=0x5,this['url']=_0x23ced0,this['apiKey']=_0x19d75f;function _0x26c8d1(_0x2cbbe2,_0x53c93d){return _0x40a5(_0x53c93d-0x36e,_0x2cbbe2);}this[_0x26c8d1(0x477,0x4ef)]={'heartbeatInterval':0x7530,'reconnectInterval':0x1388,'maxReconnectAttempts':0x5,..._0x7df34d};}['connect'](){return new Promise((_0x4149ee,_0xfd2a91)=>{if(this[_0x43f697(-0x1d6,-0x215)]?.[_0x43f697(-0x23d,-0x274)]){_0x4149ee();return;}this['connectionState']='connecting',this['socket']=socket_ioClient['io'](this[_0x43f697(-0x251,-0x271)],{'auth':{'apikey':this['apiKey']},'transports':[_0x43f697(-0x21a,-0x220)],'reconnection':!![],'reconnectionDelay':this['options']['reconnectInterval'],'reconnectionAttempts':this['options'][_0x43f697(-0x258,-0x1ff)],...this['options']['socketOptions']}),this['socket']['on'](_0x43f697(-0x317,-0x2a9),()=>{this[_0x18ed10(0xe9,0x74)]='connected',this['reconnectAttempts']=0x0,this['setupHeartbeat']();function _0x18ed10(_0x432885,_0x20c8ef){return _0x40a5(_0x20c8ef- -0xc3,_0x432885);}_0x4149ee();}),this['socket']['on']('disconnect',_0x3b4ec5=>{this[_0x116fcd(-0x143,-0x157)]='disconnected';function _0x116fcd(_0x21a705,_0x25f81e){return _0x40a5(_0x21a705- -0x27a,_0x25f81e);}this[_0x116fcd(-0x19b,-0x133)][_0x116fcd(-0x14d,-0xf2)](channel=>{function _0x5e1e1d(_0x309ce8,_0xbe2389){return _0x40a5(_0xbe2389-0x264,_0x309ce8);}channel['_setState'](_0x5e1e1d(0x3f8,0x3a7));});}),this[_0x43f697(-0x1cb,-0x215)]['on'](_0x43f697(-0x1b1,-0x1dd),_0x424a40=>{this['connectionState']='error';function _0xd68d7(_0x27ff16,_0x562e38){return _0x40a5(_0x27ff16- -0x398,_0x562e38);}this[_0xd68d7(-0x202,-0x1c9)]++,this[_0xd68d7(-0x202,-0x26e)]>=this['maxReconnectAttempts']&&_0xfd2a91(new Error(_0xd68d7(-0x211,-0x1eb)+this['maxReconnectAttempts']+'\x20attempts:\x20'+_0x424a40[_0xd68d7(-0x226,-0x229)]));}),this['socket']['on']('reconnect',()=>{this['connectionState']='connected',this['reconnectAttempts']=0x0,this['channels']['forEach'](channel=>{function _0x5c04d1(_0x571a14,_0x44b532){return _0x40a5(_0x571a14-0x30f,_0x44b532);}channel[_0x5c04d1(0x43e,0x479)]();});});function _0x43f697(_0x44084b,_0x431fb5){return _0x40a5(_0x431fb5- -0x37e,_0x44084b);}this['socket']['on']('postgres_changes',_0x43b9c8=>{function _0x411553(_0x5ea402,_0x1c7f87){return _0x40a5(_0x5ea402- -0x22e,_0x1c7f87);}const channel=this['channels'][_0x411553(-0xc8,-0x144)](_0x43b9c8[_0x411553(-0x160,-0x105)]);channel&&channel[_0x411553(-0xe5,-0x126)](_0x411553(-0x170,-0x133),_0x43b9c8);}),this['socket']['on']('broadcast',_0x11898f=>{const channel=this[_0x3cecf4(0x7b,0x1f)][_0x3cecf4(0x102,0xf2)](_0x11898f['topic']);function _0x3cecf4(_0x5ed0d3,_0x40bd3b){return _0x40a5(_0x5ed0d3- -0x64,_0x40bd3b);}channel&&channel['_trigger'](_0x3cecf4(0xb1,0x90),_0x11898f);}),this[_0x43f697(-0x1e5,-0x215)]['on']('presence',_0x44ca9b=>{function _0x595e19(_0x2138b4,_0x40d0c0){return _0x40a5(_0x2138b4-0x3ce,_0x40d0c0);}const channel=this[_0x595e19(0x4ad,0x4a5)]['get'](_0x44ca9b['topic']);channel&&channel['_trigger']('presence',_0x44ca9b);});});}[_0x25280e(-0x114,-0x123)](){function _0xce28ac(_0x4c21de,_0x1f568e){return _0x40a5(_0x4c21de-0x31f,_0x1f568e);}this['socket']&&(this['socket'][_0xce28ac(0x455,0x40c)](),this['socket']=null),this[_0xce28ac(0x456,0x3fb)]='disconnected',this[_0xce28ac(0x3fe,0x3ea)][_0xce28ac(0x407,0x423)]();}[_0x25280e(-0xde,-0xc0)](_0x6dc9a6){if(this[_0x135e5b(0xca,0xad)]['has'](_0x6dc9a6))return this[_0x135e5b(0xc1,0xad)][_0x135e5b(0xb6,0x134)](_0x6dc9a6);function _0x135e5b(_0x3b4b10,_0x135b50){return _0x40a5(_0x135b50- -0x32,_0x3b4b10);}const channel=new RealtimeChannel(_0x6dc9a6,this[_0x135e5b(0x154,0x137)]);return this[_0x135e5b(0x84,0xad)]['set'](_0x6dc9a6,channel),this[_0x135e5b(0x121,0x105)]===_0x135e5b(0xf6,0xd8)&&channel[_0x135e5b(0x8e,0xc2)](),channel;}[_0x25280e(-0x10b,-0x131)](channel){function _0x10df4c(_0x14df99,_0x248ee5){return _0x40a5(_0x248ee5-0x2aa,_0x14df99);}const _0x5db5aa=channel['topic'];this['channels']['has'](_0x5db5aa)&&(this[_0x10df4c(0x3d3,0x389)]['delete'](_0x5db5aa),channel['unsubscribe']());}[_0x25280e(-0xf8,-0xd1)](){function _0x2cfbcb(_0x2dd043,_0x20a9c8){return _0x40a5(_0x2dd043-0xbe,_0x20a9c8);}this['channels']['forEach'](channel=>{function _0x109db8(_0x5ea167,_0x376303){return _0x40a5(_0x5ea167- -0x15d,_0x376303);}channel[_0x109db8(0x21,0x5f)]();}),this['channels'][_0x2cfbcb(0x1a6,0x157)]();}[_0x25280e(-0x97,-0xee)](){function _0x86be1c(_0x5ec2b3,_0x3e8f2c){return _0x40a5(_0x3e8f2c-0x5b,_0x5ec2b3);}return Array[_0x86be1c(0x16e,0x16d)](this[_0x86be1c(0x11a,0x13a)]['values']());}[_0x25280e(-0x11f,-0x162)](){function _0x42aa69(_0x5149be,_0x255250){return _0x40a5(_0x5149be-0xc3,_0x255250);}return this[_0x42aa69(0x1fa,0x27b)]===_0x42aa69(0x1cd,0x205)&&!!this[_0x42aa69(0x22c,0x25d)]?.['connected'];}['getConnectionState'](){function _0x285994(_0x12524e,_0x5cecda){return _0x40a5(_0x5cecda- -0x268,_0x12524e);}return this[_0x285994(-0x18b,-0x131)];}[_0x25280e(-0x140,-0x18c)](_0xdcf36d){const _0x29c3e1=()=>_0xdcf36d(this['connectionState']);function _0x1b6c19(_0x248505,_0x1bb7d3){return _0x40a5(_0x1bb7d3- -0xde,_0x248505);}return this[_0x1b6c19(0x3f,0x8b)]&&(this['socket']['on']('connect',()=>{function _0x41452b(_0x46376d,_0x349768){return _0x40a5(_0x349768- -0x248,_0x46376d);}this[_0x41452b(-0x14d,-0x111)]='connected',_0x29c3e1();}),this['socket']['on']('disconnect',()=>{this[_0x35abb2(0x280,0x200)]='disconnected';function _0x35abb2(_0x51f35d,_0x31887f){return _0x40a5(_0x51f35d-0x149,_0x31887f);}_0x29c3e1();}),this[_0x1b6c19(0x1a,0x8b)]['on']('connect_error',()=>{this['connectionState']=_0xed66e9(0x2ad,0x2ad);function _0xed66e9(_0xc02f8a,_0x3338f7){return _0x40a5(_0x3338f7-0x1dd,_0xc02f8a);}_0x29c3e1();})),()=>{function _0x46a3e6(_0x105b60,_0x152d96){return _0x40a5(_0x105b60-0x38b,_0x152d96);}this[_0x46a3e6(0x4f4,0x542)]&&(this[_0x46a3e6(0x4f4,0x55f)]['off'](_0x46a3e6(0x460,0x40e),_0x29c3e1),this['socket'][_0x46a3e6(0x4b2,0x49c)]('disconnect',_0x29c3e1),this['socket']['off'](_0x46a3e6(0x52c,0x549),_0x29c3e1));};}[_0x25280e(-0x14e,-0x15c)](){function _0x1ee7a5(_0x12eabd,_0x1f2f7b){return _0x40a5(_0x1f2f7b- -0x2ef,_0x12eabd);}if(!this[_0x1ee7a5(-0x1b9,-0x16e)]['heartbeatInterval']||!this[_0x1ee7a5(-0x140,-0x186)])return;const interval=setInterval(()=>{function _0x2002bd(_0x15beac,_0x5e2dcb){return _0x40a5(_0x5e2dcb- -0x35,_0x15beac);}this['socket']?.[_0x2002bd(0xea,0xd5)]?this['socket']['emit']('heartbeat',{'timestamp':Date['now']()}):clearInterval(interval);},this[_0x1ee7a5(-0x155,-0x16e)]['heartbeatInterval']);}['_getSocket'](){function _0x3e49f9(_0x51effd,_0x3aa528){return _0x40a5(_0x51effd- -0x235,_0x3aa528);}return this[_0x3e49f9(-0xcc,-0xd2)];}}class FunctionsClient{constructor(_0x30c6db){this['httpClient']=_0x30c6db;}async['invoke'](_0x15fcee,_0x498208){function _0x4a1d52(_0x45ad9a,_0x16a4e3){return _0x40a5(_0x45ad9a-0x377,_0x16a4e3);}try{const _0x470357=_0x498208?.[_0x4a1d52(0x48d,0x480)]||'POST',headers={'Content-Type':'application/json',..._0x498208?.[_0x4a1d52(0x4f4,0x4df)]};let response;const _0x59b373=_0x4a1d52(0x4d6,0x484)+_0x15fcee;switch(_0x470357['toUpperCase']()){case'GET':response=await this[_0x4a1d52(0x4d7,0x553)]['get'](_0x59b373,{'headers':headers,'params':_0x498208?.[_0x4a1d52(0x49d,0x4e8)]});break;case'POST':response=await this[_0x4a1d52(0x4d7,0x4c5)]['post'](_0x59b373,_0x498208?.[_0x4a1d52(0x49d,0x456)],{'headers':headers});break;case'PUT':response=await this[_0x4a1d52(0x4d7,0x499)][_0x4a1d52(0x4d2,0x54d)](_0x59b373,_0x498208?.[_0x4a1d52(0x49d,0x4ae)],{'headers':headers});break;case'PATCH':response=await this['httpClient'][_0x4a1d52(0x502,0x500)](_0x59b373,_0x498208?.['body'],{'headers':headers});break;case'DELETE':response=await this['httpClient']['delete'](_0x59b373,{'headers':headers,'data':_0x498208?.[_0x4a1d52(0x49d,0x434)]});break;default:throw new EBaaSError('Unsupported\x20HTTP\x20method:\x20'+_0x470357,0x190);}return{'data':response['data'],'error':null};}catch(_0x30cbb9){return{'data':null,'error':_0x30cbb9 instanceof EBaaSError?_0x30cbb9:new EBaaSError(_0x30cbb9 instanceof Error?_0x30cbb9[_0x4a1d52(0x4e9,0x4fc)]:'Function\x20invocation\x20failed',0x0,_0x30cbb9)};}}async['list'](){function _0x5ee527(_0x15fd60,_0x15a139){return _0x40a5(_0x15fd60-0x19c,_0x15a139);}try{const response=await this[_0x5ee527(0x2fc,0x28f)][_0x5ee527(0x302,0x2e7)](_0x5ee527(0x261,0x26b));return{'data':response[_0x5ee527(0x2be,0x2fc)],'error':null};}catch(_0xe19948){return{'data':null,'error':_0xe19948 instanceof EBaaSError?_0xe19948:new EBaaSError(_0xe19948 instanceof Error?_0xe19948[_0x5ee527(0x30e,0x362)]:_0x5ee527(0x26d,0x25c),0x0,_0xe19948)};}}async['get'](_0xdb95b9){function _0x5cf205(_0x46d5ef,_0x480888){return _0x40a5(_0x46d5ef- -0xef,_0x480888);}try{const response=await this['httpClient'][_0x5cf205(0x77,0x9)]('/functions/v1/'+_0xdb95b9+'/info');return{'data':response[_0x5cf205(0x33,-0x39)],'error':null};}catch(_0x473bfe){return{'data':null,'error':_0x473bfe instanceof EBaaSError?_0x473bfe:new EBaaSError(_0x473bfe instanceof Error?_0x473bfe['message']:'Failed\x20to\x20get\x20function',0x0,_0x473bfe)};}}async['deploy'](_0x589afd,_0x439b94){function _0x1dfbf8(_0x367aab,_0x43bf82){return _0x40a5(_0x367aab- -0x3ab,_0x43bf82);}try{const _0x148fcb=new FormData();if(_0x439b94['code']instanceof File)_0x148fcb[_0x1dfbf8(-0x267,-0x207)]('code',_0x439b94[_0x1dfbf8(-0x252,-0x1f8)]);else typeof _0x439b94['code']===_0x1dfbf8(-0x25a,-0x27b)&&_0x148fcb['append']('code',new Blob([_0x439b94['code']],{'type':'text/plain'}),_0x1dfbf8(-0x270,-0x28e));_0x439b94['entrypoint']&&_0x148fcb[_0x1dfbf8(-0x267,-0x2c0)]('entrypoint',_0x439b94['entrypoint']);_0x439b94[_0x1dfbf8(-0x21a,-0x26d)]&&_0x148fcb[_0x1dfbf8(-0x267,-0x24c)](_0x1dfbf8(-0x21a,-0x27b),JSON['stringify'](_0x439b94['env']));_0x439b94['importMap']&&_0x148fcb['append']('importMap',JSON['stringify'](_0x439b94[_0x1dfbf8(-0x2ea,-0x322)]));_0x439b94[_0x1dfbf8(-0x26a,-0x248)]!==undefined&&_0x148fcb['append'](_0x1dfbf8(-0x26a,-0x238),String(_0x439b94[_0x1dfbf8(-0x26a,-0x243)]));const response=await this[_0x1dfbf8(-0x24b,-0x25c)][_0x1dfbf8(-0x28c,-0x277)]('/functions/v1/'+_0x589afd+_0x1dfbf8(-0x260,-0x25e),_0x148fcb,{'headers':{'Content-Type':'multipart/form-data'}});return{'data':response[_0x1dfbf8(-0x289,-0x27a)],'error':null};}catch(_0x1ab27b){return{'data':null,'error':_0x1ab27b instanceof EBaaSError?_0x1ab27b:new EBaaSError(_0x1ab27b instanceof Error?_0x1ab27b[_0x1dfbf8(-0x239,-0x2aa)]:_0x1dfbf8(-0x254,-0x1ea),0x0,_0x1ab27b)};}}async['delete'](_0x5f02f0){function _0x5b90c4(_0xd48691,_0x4d3297){return _0x40a5(_0x4d3297-0x35f,_0xd48691);}try{const response=await this['httpClient']['delete'](_0x5b90c4(0x458,0x4be)+_0x5f02f0);return{'data':response[_0x5b90c4(0x412,0x481)],'error':null};}catch(_0x2c46bc){return{'data':null,'error':_0x2c46bc instanceof EBaaSError?_0x2c46bc:new EBaaSError(_0x2c46bc instanceof Error?_0x2c46bc[_0x5b90c4(0x4bf,0x4d1)]:_0x5b90c4(0x4ac,0x433),0x0,_0x2c46bc)};}}async['updateEnv'](_0x137a2e,_0xc21ccb){function _0x4579fe(_0x5e2a30,_0x55d670){return _0x40a5(_0x5e2a30- -0x250,_0x55d670);}try{const response=await this[_0x4579fe(-0xf0,-0x6f)][_0x4579fe(-0xf5,-0x109)](_0x4579fe(-0xf1,-0x9b)+_0x137a2e+'/env',{'env':_0xc21ccb});return{'data':response['data'],'error':null};}catch(_0x2a156a){return{'data':null,'error':_0x2a156a instanceof EBaaSError?_0x2a156a:new EBaaSError(_0x2a156a instanceof Error?_0x2a156a[_0x4579fe(-0xde,-0x132)]:'Failed\x20to\x20update\x20function\x20environment',0x0,_0x2a156a)};}}async[_0x25280e(-0xc7,-0xe6)](_0x38c166,_0x37d918){function _0x395525(_0x4bb1db,_0x52e95b){return _0x40a5(_0x4bb1db-0x2bc,_0x52e95b);}try{const _0x2e27fc=new URLSearchParams();_0x37d918?.['limit']&&_0x2e27fc[_0x395525(0x400,0x442)](_0x395525(0x3bb,0x349),String(_0x37d918[_0x395525(0x3bb,0x3fe)]));_0x37d918?.['offset']&&_0x2e27fc[_0x395525(0x400,0x457)](_0x395525(0x463,0x4d3),String(_0x37d918['offset']));_0x37d918?.['level']&&_0x2e27fc['append']('level',_0x37d918['level']);const _0x11f057='/functions/v1/'+_0x38c166+_0x395525(0x3a2,0x34d)+(_0x2e27fc['toString']()?'?'+_0x2e27fc['toString']():''),response=await this[_0x395525(0x41c,0x474)][_0x395525(0x422,0x3da)](_0x11f057);return{'data':response[_0x395525(0x3de,0x3be)],'error':null};}catch(_0x1d5fe8){return{'data':null,'error':_0x1d5fe8 instanceof EBaaSError?_0x1d5fe8:new EBaaSError(_0x1d5fe8 instanceof Error?_0x1d5fe8['message']:'Failed\x20to\x20get\x20function\x20logs',0x0,_0x1d5fe8)};}}async['getMetrics'](_0x13eef6,_0x5cb22d){function _0x12084b(_0x2c7a08,_0x3de1d8){return _0x40a5(_0x3de1d8-0x38e,_0x2c7a08);}try{const _0x4f76c7=new URLSearchParams();_0x5cb22d?.[_0x12084b(0x433,0x457)]&&_0x4f76c7[_0x12084b(0x4e1,0x4d2)]('period',_0x5cb22d['period']);const _0x5a5c56='/functions/v1/'+_0x13eef6+'/metrics'+(_0x4f76c7[_0x12084b(0x464,0x437)]()?'?'+_0x4f76c7[_0x12084b(0x414,0x437)]():''),response=await this['httpClient']['get'](_0x5a5c56);return{'data':response[_0x12084b(0x4d8,0x4b0)],'error':null};}catch(_0x52de34){return{'data':null,'error':_0x52de34 instanceof EBaaSError?_0x52de34:new EBaaSError(_0x52de34 instanceof Error?_0x52de34[_0x12084b(0x4bd,0x500)]:'Failed\x20to\x20get\x20function\x20metrics',0x0,_0x52de34)};}}}function _0x40a5(_0x2ef2c5,_0x42b490){const _0x134e27=_0x134e();return _0x40a5=function(_0x40a537,_0x2f0a61){_0x40a537=_0x40a537-0xa7;let _0x64e892=_0x134e27[_0x40a537];if(_0x40a5['FCOuZH']===undefined){var _0xf3bb94=function(_0x5a238b){const _0x43802a='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x95923='',_0x418f8f='';for(let _0x1e63dd=0x0,_0x2aa733,_0x2ae5c2,_0xaadbd7=0x0;_0x2ae5c2=_0x5a238b['charAt'](_0xaadbd7++);~_0x2ae5c2&&(_0x2aa733=_0x1e63dd%0x4?_0x2aa733*0x40+_0x2ae5c2:_0x2ae5c2,_0x1e63dd++%0x4)?_0x95923+=String['fromCharCode'](0xff&_0x2aa733>>(-0x2*_0x1e63dd&0x6)):0x0){_0x2ae5c2=_0x43802a['indexOf'](_0x2ae5c2);}for(let _0x47bc9e=0x0,_0x27877c=_0x95923['length'];_0x47bc9e<_0x27877c;_0x47bc9e++){_0x418f8f+='%'+('00'+_0x95923['charCodeAt'](_0x47bc9e)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x418f8f);};_0x40a5['SzAnMz']=_0xf3bb94,_0x2ef2c5=arguments,_0x40a5['FCOuZH']=!![];}const _0x4949a4=_0x134e27[0x0],_0x8bfd4b=_0x40a537+_0x4949a4,_0x2eda80=_0x2ef2c5[_0x8bfd4b];return!_0x2eda80?(_0x64e892=_0x40a5['SzAnMz'](_0x64e892),_0x2ef2c5[_0x8bfd4b]=_0x64e892):_0x64e892=_0x2eda80,_0x64e892;},_0x40a5(_0x2ef2c5,_0x42b490);}class EBaaSClient{constructor(_0x3ba614,_0x3f9b07,_0x4532db){this['options']=_0x4532db,this['httpClient']=new HttpClient({'url':_0x3ba614,'apiKey':_0x3f9b07,'timeout':0x7530,'headers':_0x4532db?.[_0x3ac807(-0x12c,-0x179)]?.[_0x3ac807(-0xf1,-0x131)]}),this['auth']=new AuthClient(this['httpClient'],_0x4532db?.[_0x3ac807(-0x1ae,-0x16b)]?.['workspaceId']),this['database']=new DatabaseClient(this['httpClient'],_0x4532db?.['database']?.['workspaceId']),this[_0x3ac807(-0x13d,-0x108)]=new StorageClient(this['httpClient']),this['realtime']=new RealtimeClient(_0x3ba614,_0x3f9b07,_0x4532db?.[_0x3ac807(-0x17d,-0x171)]);function _0x3ac807(_0x588874,_0x199e53){return _0x40a5(_0x588874- -0x26e,_0x199e53);}this[_0x3ac807(-0x175,-0xf9)]=new FunctionsClient(this['httpClient']),this[_0x3ac807(-0x156,-0x13e)]();}[_0x25280e(-0x16a,-0x147)](_0x5d2ed8){function _0x1b288c(_0x48831e,_0x3154e2){return _0x40a5(_0x48831e- -0x24d,_0x3154e2);}return this[_0x1b288c(-0x18d,-0x1b1)][_0x1b288c(-0x13b,-0x11f)](_0x5d2ed8);}[_0x25280e(-0x144,-0x151)](_0x3a6041,_0xdf0aaf){function _0x32a177(_0x1f7707,_0x269e1f){return _0x40a5(_0x1f7707-0x3c8,_0x269e1f);}return this[_0x32a177(0x488,0x478)]['rpc'](_0x3a6041,_0xdf0aaf);}['bucket'](_0x3e3f4){return this['storage']['from'](_0x3e3f4);}[_0x25280e(-0x89,-0xc0)](_0x5cbe01){function _0x125647(_0x4fb471,_0x1df836){return _0x40a5(_0x4fb471- -0x39f,_0x1df836);}return this['realtime'][_0x125647(-0x206,-0x1f2)](_0x5cbe01);}[_0x25280e(-0x14b,-0x105)](_0x31a4f9,_0x151e2a){return this['functions']['invoke'](_0x31a4f9,_0x151e2a);}async['initializeCustomDatabase'](){function _0x3f7634(_0x2248e8,_0x1cd432){return _0x40a5(_0x2248e8- -0x3d5,_0x1cd432);}if(this['options']?.['database']?.['autoDetectCustomDatabase'])try{await this[_0x3f7634(-0x315,-0x358)]['initialize']();}catch(_0x13b57d){console[_0x3f7634(-0x31b,-0x391)]('Failed to initialize custom database detection:',_0x13b57d);}}async[_0x25280e(-0x155,-0x104)](_0x343dd0){function _0x251c39(_0x6a739c,_0xcebb5f){return _0x40a5(_0xcebb5f- -0x228,_0x6a739c);}this[_0x251c39(-0x8d,-0xae)]['setWorkspaceId'](_0x343dd0),this[_0x251c39(-0x19b,-0x168)][_0x251c39(-0xca,-0xd3)](_0x343dd0),this[_0x251c39(-0xa7,-0xa7)]?.[_0x251c39(-0x133,-0x168)]?.[_0x251c39(-0x71,-0x83)]&&await this[_0x251c39(-0x102,-0x168)]['initialize']();}async[_0x25280e(-0x1cc,-0x16f)](_0x566f7b){function _0x23998c(_0x5c73b1,_0x1611ab){return _0x40a5(_0x1611ab-0x37b,_0x5c73b1);}await this[_0x23998c(0x415,0x43b)][_0x23998c(0x428,0x465)](_0x566f7b);}['getCustomDatabaseStatus'](){return this['database']['getCustomDatabaseStatus']();}}function createClient(_0x2f542d,_0x118377,_0x2f47cc){return new EBaaSClient(_0x2f542d,_0x118377,_0x2f47cc);}const version='1.0.0';exports[_0x25280e(-0x172,-0x111)]=AuthClient,exports[_0x25280e(-0x13d,-0x166)]=CustomDatabaseManager,exports['DatabaseClient']=DatabaseClient,exports[_0x25280e(-0x164,-0x125)]=EBaaSClient,exports[_0x25280e(-0x10f,-0x16d)]=EBaaSError,exports[_0x25280e(-0x67,-0xd9)]=FunctionsClient,exports['HttpClient']=HttpClient,exports['QueryBuilder']=QueryBuilder,exports[_0x25280e(-0x10c,-0xd6)]=RealtimeChannel;function _0x25280e(_0x26c964,_0x11d880){return _0x40a5(_0x11d880- -0x259,_0x26c964);}exports[_0x25280e(-0x168,-0x172)]=RealtimeClient,exports['StorageBucket']=StorageBucket,exports[_0x25280e(-0x84,-0xc5)]=StorageClient,exports['createClient']=createClient,exports[_0x25280e(-0x11b,-0xbf)]=version;