UNPKG

@e-techsolutions/e-baas-sdk

Version:

Official E-BaaS TypeScript SDK - Backend as a Service client library

1 lines 76.8 kB
(function(stringArrayFunction,comparisonValue){function _0x16218b(_0x45ba2f,_0x130808){return _0x1e97(_0x45ba2f-0x55,_0x130808);}const stringArray=stringArrayFunction();while(!![]){try{const _0x19ce91=-parseInt(_0x16218b(0x1d8,0x246))/0x1+-parseInt(_0x16218b(0x159,0x19a))/0x2+-parseInt(_0x16218b(0x20f,0x1e7))/0x3*(-parseInt(_0x16218b(0x148,0x10f))/0x4)+-parseInt(_0x16218b(0x143,0xfb))/0x5*(parseInt(_0x16218b(0x18b,0x19f))/0x6)+-parseInt(_0x16218b(0x152,0x1c5))/0x7*(parseInt(_0x16218b(0x1ec,0x21f))/0x8)+-parseInt(_0x16218b(0x1d4,0x1b2))/0x9*(parseInt(_0x16218b(0x22b,0x1fe))/0xa)+-parseInt(_0x16218b(0x1a3,0x1f8))/0xb*(-parseInt(_0x16218b(0x165,0x113))/0xc);if(_0x19ce91===comparisonValue)break;else stringArray['push'](stringArray['shift']());}catch(_0x3e0ab5){stringArray['push'](stringArray['shift']());}}}(_0x5df5,0xc901c));import axios from'axios';class EBaaSError extends Error{constructor(_0x10db32,status=0x0,_0x1fb62e){super(_0x10db32),this[_0x5c9a48(0x31c,0x2b7)]=_0x5c9a48(0x24c,0x2af),this['status']=status,this['details']=_0x1fb62e;function _0x5c9a48(_0x1889d9,_0x551a7b){return _0x1e97(_0x551a7b-0xce,_0x1889d9);}Error[_0x5c9a48(0x2fc,0x298)]&&Error[_0x5c9a48(0x22b,0x298)](this,EBaaSError);}[_0x4bcf27(-0x2c7,-0x303)](){function _0xf71b9b(_0x3adda8,_0x825c76){return _0x1e97(_0x825c76-0x315,_0x3adda8);}return{'name':this[_0xf71b9b(0x567,0x4fe)],'message':this['message'],'status':this['status'],'details':this[_0xf71b9b(0x49c,0x4d5)],'stack':this[_0xf71b9b(0x4ef,0x4ab)]};}['toString'](){function _0x212a39(_0x31adeb,_0x3144db){return _0x1e97(_0x3144db- -0x193,_0x31adeb);}return this['name']+':\x20'+this[_0x212a39(0xab,0x52)]+'\x20(Status:\x20'+this['status']+')';}}class HttpClient{constructor(config){this[_0x53c16a(0x18e,0x162)]=config[_0x53c16a(0x147,0xc6)];function _0x53c16a(_0x4f695c,_0x5bb283){return _0x1e97(_0x4f695c-0x3a,_0x5bb283);}this[_0x53c16a(0x156,0x14b)]=config['apiKey'],this[_0x53c16a(0x13c,0xd7)]=axios['create']({'baseURL':this[_0x53c16a(0x18e,0x183)],'timeout':config[_0x53c16a(0x20b,0x183)]||0x2710,'headers':{'Content-Type':'application/json','apikey':this[_0x53c16a(0x156,0x159)],...config[_0x53c16a(0x217,0x1c9)]}}),this[_0x53c16a(0x166,0x12b)]();}[_0x4bcf27(-0x2b8,-0x270)](){this['client']['interceptors']['request'][_0x30a29f(-0x276,-0x205)](config=>{return config;},_0x481f57=>{return Promise['reject'](new EBaaSError('Request\x20failed',0x0,_0x481f57));});function _0x30a29f(_0x4c1fc6,_0x11eae8){return _0x1e97(_0x11eae8- -0x3dc,_0x4c1fc6);}this['client'][_0x30a29f(-0x299,-0x2c6)]['response'][_0x30a29f(-0x198,-0x205)](response=>{return response;},_0xe911a0=>{const status=_0xe911a0['response']?.['status']||0x0;function _0xd47aff(_0x4035c6,_0xe0ed56){return _0x1e97(_0x4035c6- -0x64,_0xe0ed56);}const _0x26cd03=_0xe911a0[_0xd47aff(0xc0,0xb9)]?.['data']?.['message']||_0xe911a0['message']||'Unknown\x20error',_0x12d93d=_0xe911a0[_0xd47aff(0xc0,0xe2)]?.[_0xd47aff(0x120,0xe7)]||_0xe911a0;return Promise[_0xd47aff(0xbc,0xbd)](new EBaaSError(_0x26cd03,status,_0x12d93d));});}async[_0x4bcf27(-0x204,-0x231)](_0x12c9e4,config){try{const response=await this['client']['get'](_0x12c9e4,config);return{'data':response['data'],'status':response['status'],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x52f10c){throw this['handleError'](_0x52f10c);}}async[_0x4bcf27(-0x2cc,-0x309)](_0x4655aa,data,config){function _0x950f45(_0x18aad5,_0x5da8c9){return _0x1e97(_0x18aad5- -0x394,_0x5da8c9);}try{const response=await this[_0x950f45(-0x292,-0x2c9)]['post'](_0x4655aa,data,config);return{'data':response[_0x950f45(-0x210,-0x292)],'status':response[_0x950f45(-0x1ce,-0x225)],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x5c1c4e){throw this[_0x950f45(-0x1cc,-0x21c)](_0x5c1c4e);}}async['put'](_0x549dc2,data,config){function _0x1e1697(_0x358898,_0x29bd43){return _0x1e97(_0x358898- -0x2ec,_0x29bd43);}try{const response=await this[_0x1e1697(-0x1ea,-0x23f)]['put'](_0x549dc2,data,config);return{'data':response[_0x1e1697(-0x168,-0x1c3)],'status':response[_0x1e1697(-0x126,-0xb6)],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x514775){throw this['handleError'](_0x514775);}}async['patch'](_0x59856b,data,config){function _0xdeb0da(_0x6f0673,_0x26419f){return _0x1e97(_0x26419f- -0x22,_0x6f0673);}try{const response=await this['client']['patch'](_0x59856b,data,config);return{'data':response[_0xdeb0da(0x1bf,0x162)],'status':response[_0xdeb0da(0x1e1,0x1a4)],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x5a602e){throw this[_0xdeb0da(0x1c9,0x1a6)](_0x5a602e);}}async['delete'](_0x361c1a,config){function _0x309c24(_0x3db93b,_0x4dd548){return _0x1e97(_0x3db93b-0x38d,_0x4dd548);}try{const response=await this[_0x309c24(0x48f,0x446)][_0x309c24(0x475,0x471)](_0x361c1a,config);return{'data':response['data'],'status':response['status'],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x2731fc){throw this['handleError'](_0x2731fc);}}['setAuthToken'](_0x27ebe5){function _0x2d7cec(_0x4aeac0,_0x42fcc0){return _0x1e97(_0x4aeac0- -0xa5,_0x42fcc0);}this[_0x2d7cec(0x5d,-0x9)][_0x2d7cec(0x4c,0x3a)][_0x2d7cec(0x138,0x111)]['common']['Authorization']='Bearer\x20'+_0x27ebe5;}[_0x4bcf27(-0x2de,-0x331)](){function _0x4f15a8(_0x2874fe,_0x2135c0){return _0x1e97(_0x2135c0- -0x2b3,_0x2874fe);}delete this[_0x4f15a8(-0x1b9,-0x1b1)][_0x4f15a8(-0x142,-0x1c2)]['headers']['common']['Authorization'],this[_0x4f15a8(-0x234,-0x1b1)][_0x4f15a8(-0x1ff,-0x1c2)][_0x4f15a8(-0x108,-0xd6)][_0x4f15a8(-0x103,-0x124)]['Authorization']='Bearer\x20'+this[_0x4f15a8(-0x176,-0x197)];}[_0x4bcf27(-0x21c,-0x283)](_0xffe721){if(_0xffe721 instanceof EBaaSError)return _0xffe721;return new EBaaSError(_0xffe721['message']||'HTTP\x20request\x20failed',_0xffe721['status']||0x0,_0xffe721);}}class AuthClient{constructor(_0x2a936e,_0x5c1a17){this['currentSession']=null;function _0x168d17(_0x3ed356,_0x42d16f){return _0x1e97(_0x3ed356- -0x1df,_0x42d16f);}this['httpClient']=_0x2a936e,this[_0x168d17(-0xe8,-0x155)]=_0x5c1a17,this['loadSession']();}async['signUp'](data){function _0x3cd40e(_0x47c513,_0x575a1d){return _0x1e97(_0x47c513-0x2a9,_0x575a1d);}try{const response=await this[_0x3cd40e(0x443,0x404)][_0x3cd40e(0x3c1,0x3de)]('/auth/v1/signup',data);return response[_0x3cd40e(0x42d,0x3c2)]['session']&&this[_0x3cd40e(0x49b,0x4d5)](response['data']['session']),response[_0x3cd40e(0x42d,0x3ca)];}catch(_0x1c1009){throw this[_0x3cd40e(0x46d,0x400)](_0x1c1009);}}async['signIn'](data){function _0x253c16(_0x33384f,_0x11d0ef){return _0x1e97(_0x33384f-0xa5,_0x11d0ef);}try{const headers={};this[_0x253c16(0x19c,0x195)]&&(headers['X-Workspace-ID']=this['workspaceId']);const response=await this[_0x253c16(0x23f,0x233)][_0x253c16(0x1bd,0x1ba)](_0x253c16(0x232,0x1f7),data,{'headers':headers});return response[_0x253c16(0x229,0x1a2)]['session']&&this[_0x253c16(0x297,0x21d)](response['data'][_0x253c16(0x247,0x2c5)]),response[_0x253c16(0x229,0x27e)];}catch(_0x1ce18f){throw this['handleAuthError'](_0x1ce18f);}}async[_0x4bcf27(-0x216,-0x29b)](){function _0x5118f7(_0x464c54,_0x212176){return _0x1e97(_0x212176- -0x2be,_0x464c54);}try{await this[_0x5118f7(-0xee,-0x124)][_0x5118f7(-0x1c5,-0x1a6)](_0x5118f7(-0xb0,-0x129)),this[_0x5118f7(-0x140,-0x161)]();}catch(_0x5ea821){this[_0x5118f7(-0x1a8,-0x161)]();throw this['handleAuthError'](_0x5ea821);}}async[_0x4bcf27(-0x2a4,-0x296)](){if(!this[_0x4769ec(0x4df,0x479)]?.['access_token'])return null;function _0x4769ec(_0x478132,_0x8b2421){return _0x1e97(_0x478132-0x395,_0x8b2421);}try{const response=await this['httpClient'][_0x4769ec(0x575,0x5de)]('/auth/v1/user');return response[_0x4769ec(0x519,0x4fe)][_0x4769ec(0x551,0x5b4)];}catch(_0x3d88f0){if(_0x3d88f0 instanceof EBaaSError&&_0x3d88f0['status']===0x191)return this[_0x4769ec(0x4f2,0x528)](),null;throw this[_0x4769ec(0x559,0x59e)](_0x3d88f0);}}async['refreshSession'](){if(!this[_0x5a9271(0x1a4,0x192)]?.[_0x5a9271(0x16e,0x1eb)])return null;function _0x5a9271(_0x3bd48c,_0x268986){return _0x1e97(_0x268986-0x48,_0x3bd48c);}try{const response=await this['httpClient'][_0x5a9271(0x193,0x160)](_0x5a9271(0xec,0x170),{'refresh_token':this[_0x5a9271(0x16a,0x192)]['refresh_token']});if(response[_0x5a9271(0x242,0x1cc)]['session'])return this['setSession'](response['data']['session']),response[_0x5a9271(0x181,0x1cc)][_0x5a9271(0x193,0x1ea)];return null;}catch(_0x4eae95){this[_0x5a9271(0x127,0x1a5)]();throw this['handleAuthError'](_0x4eae95);}}async['resetPassword'](_0x44e0b3){function _0x34e16e(_0x249663,_0x11ddc1){return _0x1e97(_0x249663- -0x37,_0x11ddc1);}try{await this['httpClient'][_0x34e16e(0xe1,0x5c)](_0x34e16e(0x111,0xf9),{'email':_0x44e0b3});}catch(_0x436524){throw this['handleAuthError'](_0x436524);}}async[_0x4bcf27(-0x23c,-0x28b)](data){function _0x5dc104(_0x257b2d,_0x46202c){return _0x1e97(_0x257b2d-0x3d5,_0x46202c);}try{const response=await this[_0x5dc104(0x56f,0x58f)][_0x5dc104(0x571,0x56f)]('/auth/v1/user',data);return response[_0x5dc104(0x559,0x581)]['user'];}catch(_0x3f3574){throw this['handleAuthError'](_0x3f3574);}}[_0x4bcf27(-0x263,-0x287)](){return this['currentSession'];}[_0x4bcf27(-0x294,-0x283)](_0x2415a6){function _0xed3616(_0x50b75e,_0x3768fd){return _0x1e97(_0x3768fd- -0x3a1,_0x50b75e);}this[_0xed3616(-0x1cf,-0x257)]=_0x2415a6,this['httpClient'][_0xed3616(-0x197,-0x1f8)](_0x2415a6['access_token']),typeof localStorage!==_0xed3616(-0x22c,-0x280)&&localStorage['setItem']('ebaas.auth.session',JSON[_0xed3616(-0x2f8,-0x2a1)](_0x2415a6));}['onAuthStateChange'](_0x3a3fc0){return()=>{};}['setWorkspaceId'](_0x4fdbda){function _0x113caf(_0x2c97a7,_0x10af1f){return _0x1e97(_0x2c97a7- -0x130,_0x10af1f);}this[_0x113caf(-0x39,-0xa2)]=_0x4fdbda;}[_0x4bcf27(-0x1f2,-0x204)](_0x5282a8){this['currentSession']=_0x5282a8,this[_0x2fc37c(-0x232,-0x217)]['setAuthToken'](_0x5282a8['access_token']);function _0x2fc37c(_0x1d1dc5,_0x1bd58c){return _0x1e97(_0x1d1dc5- -0x3cc,_0x1bd58c);}typeof localStorage!=='undefined'&&localStorage[_0x2fc37c(-0x1dc,-0x1c9)]('ebaas.auth.session',JSON[_0x2fc37c(-0x2cc,-0x28c)](_0x5282a8));}['clearSession'](){this['currentSession']=null,this[_0x3f1c7c(0xa2,0xec)]['removeAuthToken']();function _0x3f1c7c(_0x300fbe,_0x12ac7a){return _0x1e97(_0x12ac7a- -0xae,_0x300fbe);}typeof localStorage!==_0x3f1c7c(0x7b,0x73)&&localStorage['removeItem'](_0x3f1c7c(0x108,0x13e));}[_0x4bcf27(-0x239,-0x262)](){function _0x3348c9(_0x2f5529,_0x1369a6){return _0x1e97(_0x1369a6-0x240,_0x2f5529);}if(typeof localStorage!==_0x3348c9(0x2f3,0x361)){const _0x21ba48=localStorage['getItem'](_0x3348c9(0x48a,0x42c));if(_0x21ba48)try{const _0x22d407=JSON[_0x3348c9(0x378,0x3de)](_0x21ba48);this[_0x3348c9(0x497,0x432)](_0x22d407);}catch(_0x401a89){this[_0x3348c9(0x3d5,0x39d)]();}}}[_0x4bcf27(-0x220,-0x1f1)](_0x5b9352){function _0x20ca90(_0x217f29,_0x3ae3fe){return _0x1e97(_0x3ae3fe-0x20c,_0x217f29);}if(_0x5b9352 instanceof EBaaSError)return _0x5b9352;return new EBaaSError(_0x5b9352[_0x20ca90(0x373,0x3f1)]||'Authentication\x20failed',_0x5b9352[_0x20ca90(0x443,0x3d2)]||0x0,_0x5b9352);}}class QueryBuilder{constructor(_0x8f7549,_0x3d2b86,_0x2133de,_0x4f5ba8){this['httpClient']=_0x8f7549,this[_0x2f86c2(-0xde,-0x126)]=_0x3d2b86;function _0x2f86c2(_0x219cfd,_0x20c296){return _0x1e97(_0x20c296- -0x268,_0x219cfd);}this[_0x2f86c2(-0x36,-0x82)]=_0x2133de,this[_0x2f86c2(-0x1b8,-0x171)]=_0x4f5ba8,this['query']={'filters':[]};}['select'](_0x11cf37='*',_0x271c09){return this['query']['select']=_0x11cf37,this;}['insert'](data,_0x589764){function _0x346e3c(_0x16ad0a,_0x1019d1){return _0x1e97(_0x16ad0a- -0x294,_0x1019d1);}return this[_0x346e3c(-0x12d,-0xc1)]('POST','/sdk/v1/'+this['table']+'?operation=insert',{'data':data,'options':_0x589764});}[_0x4bcf27(-0x249,-0x223)](data,_0x22ee6a){function _0x40b352(_0x5dde20,_0x5e9b62){return _0x1e97(_0x5dde20-0x34c,_0x5e9b62);}return this['query']['updateData']=data,this['query'][_0x40b352(0x4b2,0x44c)]=_0x22ee6a,this;}['upsert'](data,_0xa7cc36){function _0x50566(_0x550eb8,_0x3f1370){return _0x1e97(_0x3f1370-0x1c0,_0x550eb8);}return this[_0x50566(0x39e,0x327)]('POST','/sdk/v1/'+this['table']+_0x50566(0x336,0x36d),{'data':data,'options':{..._0xa7cc36,'upsert':!![]}});}['delete'](_0x3649e3){this[_0x5ef4da(-0x244,-0x2ad)]['deleteOptions']=_0x3649e3,this['query'][_0x5ef4da(-0x25f,-0x2a7)]=!![];function _0x5ef4da(_0x4845ec,_0x6b6d97){return _0x1e97(_0x4845ec- -0x3bf,_0x6b6d97);}return this;}['eq'](_0x27bd89,_0x57ae0e){function _0x15c234(_0x54e5d6,_0x558f10){return _0x1e97(_0x54e5d6- -0x172,_0x558f10);}return this[_0x15c234(0x9,-0x18)][_0x15c234(0x2e,-0x40)][_0x15c234(-0x7,-0x8c)]({'column':_0x27bd89,'operator':'eq','value':_0x57ae0e}),this;}[_0x4bcf27(-0x1f5,-0x23c)](_0x21574b,_0x5bb5b4){function _0xa6988e(_0x516056,_0x3f5cfe){return _0x1e97(_0x516056- -0xac,_0x3f5cfe);}return this[_0xa6988e(0xcf,0x9d)][_0xa6988e(0xf4,0xb9)][_0xa6988e(0xbf,0x121)]({'column':_0x21574b,'operator':_0xa6988e(0x143,0x16f),'value':_0x5bb5b4}),this;}['gt'](_0x28aa64,_0x1a9e25){function _0x1af12f(_0x29e10a,_0x36b417){return _0x1e97(_0x36b417- -0x2d1,_0x29e10a);}return this[_0x1af12f(-0x1ab,-0x156)]['filters'][_0x1af12f(-0x1c4,-0x166)]({'column':_0x28aa64,'operator':'gt','value':_0x1a9e25}),this;}['gte'](_0x28236b,_0x1eedc6){this['query'][_0x556326(0x38,0x25)][_0x556326(0x3,-0x56)]({'column':_0x28236b,'operator':_0x556326(0x24,0x3d),'value':_0x1eedc6});function _0x556326(_0x215545,_0x1e1823){return _0x1e97(_0x215545- -0x168,_0x1e1823);}return this;}['lt'](_0x15c51a,_0xdb3d71){this[_0x491a6c(-0x110,-0x14f)][_0x491a6c(-0xb1,-0x12a)][_0x491a6c(-0x13c,-0x15f)]({'column':_0x15c51a,'operator':'lt','value':_0xdb3d71});function _0x491a6c(_0x5a7d58,_0x4c8aaf){return _0x1e97(_0x4c8aaf- -0x2ca,_0x5a7d58);}return this;}['lte'](_0x12e586,_0x480c85){this[_0x3f733d(0x26f,0x1f6)][_0x3f733d(0x1f2,0x21b)][_0x3f733d(0x19d,0x1e6)]({'column':_0x12e586,'operator':'lte','value':_0x480c85});function _0x3f733d(_0x5c4c7a,_0x334096){return _0x1e97(_0x334096-0x7b,_0x5c4c7a);}return this;}['like'](_0x2e3238,_0x4e217a){this[_0x142000(0x13,0x42)]['filters']['push']({'column':_0x2e3238,'operator':_0x142000(-0x6f,-0x8a),'value':_0x4e217a});function _0x142000(_0x4f7186,_0x46c458){return _0x1e97(_0x4f7186- -0x168,_0x46c458);}return this;}['ilike'](_0x56abd1,_0xa85a7b){function _0x5995cd(_0x266346,_0x4d30e4){return _0x1e97(_0x4d30e4-0x1bb,_0x266346);}return this[_0x5995cd(0x376,0x336)][_0x5995cd(0x32e,0x35b)]['push']({'column':_0x56abd1,'operator':_0x5995cd(0x326,0x36c),'value':_0xa85a7b}),this;}['is'](_0x3b7594,_0x191bd8){function _0x125b24(_0x2b2db6,_0x2aeecb){return _0x1e97(_0x2aeecb- -0x257,_0x2b2db6);}return this['query'][_0x125b24(-0x3f,-0xb7)]['push']({'column':_0x3b7594,'operator':'is','value':_0x191bd8}),this;}['in'](_0x27992e,_0x19a6f2){function _0x11d7b8(_0x387d22,_0x794f27){return _0x1e97(_0x794f27- -0x1c8,_0x387d22);}return this[_0x11d7b8(-0xcc,-0x4d)][_0x11d7b8(0x2a,-0x28)]['push']({'column':_0x27992e,'operator':'in','value':_0x19a6f2}),this;}[_0x4bcf27(-0x1fc,-0x21b)](_0x22bc5d,_0x31640f){this['query'][_0x2b81c0(0x5b4,0x55b)][_0x2b81c0(0x538,0x526)]({'column':_0x22bc5d,'operator':_0x2b81c0(0x5ec,0x5a3),'value':_0x31640f});function _0x2b81c0(_0x46502b,_0x506819){return _0x1e97(_0x506819-0x3bb,_0x46502b);}return this;}['match'](_0x57d472){Object[_0x12e779(0x12,0x8f)](_0x57d472)[_0x12e779(0x1e,0x80)](([_0x3389c7,_0x10d68e])=>{this['eq'](_0x3389c7,_0x10d68e);});function _0x12e779(_0x5d3699,_0x49d787){return _0x1e97(_0x49d787- -0xb2,_0x5d3699);}return this;}['order'](_0x2b58f0,_0x4ad617){!this[_0x3d4019(0x1cf,0x153)]['order']&&(this[_0x3d4019(0x103,0x153)]['order']=[]);function _0x3d4019(_0x33b0be,_0x472706){return _0x1e97(_0x472706- -0x28,_0x33b0be);}return this[_0x3d4019(0x149,0x153)]['order']['push']({'column':_0x2b58f0,'ascending':_0x4ad617?.[_0x3d4019(0x187,0x15f)]!==![]}),this;}['limit'](count){return this['query']['limit']=count,this;}['range'](from,_0x42be16){function _0x4b9151(_0x39cce4,_0x5a1d75){return _0x1e97(_0x39cce4-0x212,_0x5a1d75);}return this[_0x4b9151(0x38d,0x3e8)]['range']={'from':from,'to':_0x42be16},this;}async[_0x4bcf27(-0x25c,-0x296)](){function _0x5b3280(_0xf0aab9,_0x1b2b73){return _0x1e97(_0x1b2b73-0x175,_0xf0aab9);}if(this[_0x5b3280(0x2e8,0x2f0)]['updateData'])return this['executeQuery']('PATCH','/sdk/v1/'+this[_0x5b3280(0x2a6,0x2b7)],{'data':this[_0x5b3280(0x28f,0x2f0)]['updateData'],'options':this['query']['updateOptions'],'filters':this[_0x5b3280(0x369,0x2f0)]['filters']});else return this['query'][_0x5b3280(0x33e,0x2d5)]?this['executeQuery']('DELETE',_0x5b3280(0x2ee,0x28f)+this[_0x5b3280(0x300,0x2b7)]+'?operation=delete',{'options':this[_0x5b3280(0x344,0x2f0)]['deleteOptions'],'filters':this['query'][_0x5b3280(0x29d,0x315)]}):this[_0x5b3280(0x361,0x2dc)]('GET','/sdk/v1/'+this['table']+_0x5b3280(0x290,0x2d1),{'select':this[_0x5b3280(0x2f8,0x2f0)][_0x5b3280(0x308,0x2b8)],'filters':this[_0x5b3280(0x34e,0x2f0)][_0x5b3280(0x2e4,0x315)],'order':this[_0x5b3280(0x343,0x2f0)][_0x5b3280(0x2b0,0x2a2)],'limit':this['query']['limit'],'range':this[_0x5b3280(0x304,0x2f0)]['range']});}async['single'](){this[_0x4dfae1(0x1f5,0x233)](0x1);function _0x4dfae1(_0x4d6fdb,_0x4a6a97){return _0x1e97(_0x4d6fdb-0x19,_0x4a6a97);}const result=await this['execute']();return{'data':result['data']?.[0x0]||null,'error':result[_0x4dfae1(0x17e,0x13f)]};}async['executeQuery'](_0x58c34e,_0x52f568,_0x10c3f8){function _0x2324c4(_0x2c36e4,_0x2afab2){return _0x1e97(_0x2afab2-0x9b,_0x2c36e4);}try{let response;const headers={};this[_0x2324c4(0x119,0x192)]&&(headers['x-workspace-id']=this['workspaceId']);if(_0x58c34e==='GET'){const _0xfc35e8=_0x52f568['split']('?'),_0x3dcd39=_0xfc35e8[0x0],existingParams=new URLSearchParams(_0xfc35e8[0x1]||'');if(_0x10c3f8[_0x2324c4(0x24a,0x1de)])existingParams['append']('select',_0x10c3f8['select']);_0x10c3f8['filters']?.['length']&&_0x10c3f8['filters']['forEach'](filter=>{function _0x2fda8f(_0x4e048d,_0x5469b1){return _0x1e97(_0x5469b1- -0x35c,_0x4e048d);}existingParams['append'](filter[_0x2fda8f(-0x1ba,-0x197)],filter['operator']+'.'+filter['value']);});if(_0x10c3f8[_0x2324c4(0x24f,0x1c8)]?.['length']){const orderStr=_0x10c3f8[_0x2324c4(0x21e,0x1c8)][_0x2324c4(0x142,0x18a)](_0x1dd550=>''+_0x1dd550['column']+(_0x1dd550[_0x2324c4(0x1c1,0x222)]?_0x2324c4(0x2e9,0x264):_0x2324c4(0x1b2,0x1f2)))['join'](',');existingParams['append']('order',orderStr);}if(_0x10c3f8['limit'])existingParams['append'](_0x2324c4(0x2a2,0x277),_0x10c3f8['limit']['toString']());_0x10c3f8['range']&&(existingParams['append']('offset',_0x10c3f8['range'][_0x2324c4(0x297,0x240)][_0x2324c4(0x210,0x1c4)]()),existingParams[_0x2324c4(0x307,0x286)]('limit',(_0x10c3f8[_0x2324c4(0x1a8,0x1e2)]['to']-_0x10c3f8['range'][_0x2324c4(0x246,0x240)]+0x1)[_0x2324c4(0x22c,0x1c4)]())),response=await this[_0x2324c4(0x2b8,0x235)]['get'](_0x3dcd39+'?'+existingParams['toString'](),{'headers':headers});}else{if(_0x58c34e==='DELETE'){const _0x1f4c0a=_0x52f568['split']('?'),_0xc11854=_0x1f4c0a[0x0],existingParams=new URLSearchParams(_0x1f4c0a[0x1]||'');!existingParams[_0x2324c4(0x185,0x187)](_0x2324c4(0x20d,0x275))&&existingParams['append']('operation',_0x2324c4(0x1dd,0x183));_0x10c3f8[_0x2324c4(0x26d,0x23b)]?.[_0x2324c4(0x1ed,0x1a4)]&&_0x10c3f8['filters']['forEach'](filter=>{function _0x225b01(_0x1b4f42,_0x50948d){return _0x1e97(_0x1b4f42-0xf9,_0x50948d);}existingParams[_0x225b01(0x2e4,0x2b1)](filter[_0x225b01(0x2be,0x268)],filter[_0x225b01(0x2ba,0x2ac)]+'.'+filter['value']);});const deleteUrl=_0xc11854+'?'+existingParams[_0x2324c4(0x218,0x1c4)]();console[_0x2324c4(0x27c,0x262)]('\uD83D\uDD27 DELETE URL construída:',deleteUrl),console[_0x2324c4(0x214,0x262)]('\uD83D\uDD27 DELETE headers:',headers),console['log']('\uD83D\uDD27 DELETE filtros originais:',_0x10c3f8['filters']),response=await this['httpClient'][_0x2324c4(0x17d,0x183)](deleteUrl,{'headers':headers});}else{if(_0x58c34e==='PATCH'){const _0x209908=_0x52f568['split']('?'),_0x37c3ad=_0x209908[0x0],existingParams=new URLSearchParams(_0x209908[0x1]||'');!existingParams[_0x2324c4(0x174,0x187)]('operation')&&existingParams[_0x2324c4(0x2b4,0x286)]('operation',_0x2324c4(0x250,0x236));_0x10c3f8['filters']?.['length']&&_0x10c3f8['filters'][_0x2324c4(0x23f,0x1cd)](filter=>{function _0x146568(_0xe92ef4,_0x4e12ed){return _0x1e97(_0x4e12ed-0x2aa,_0xe92ef4);}existingParams[_0x146568(0x509,0x495)](filter['column'],filter[_0x146568(0x4ef,0x46b)]+'.'+filter['value']);});_0x10c3f8['options']?.['prefer']&&(headers['Prefer']=_0x10c3f8[_0x2324c4(0x2b2,0x24f)][_0x2324c4(0x1f7,0x203)]);const updateUrl=_0x37c3ad+'?'+existingParams['toString']();response=await this['httpClient'][_0x2324c4(0x1cb,0x1ed)](updateUrl,_0x10c3f8['data'],{'headers':headers});}else{let _0x53f510=_0x10c3f8['data'];!headers[_0x2324c4(0x225,0x1b0)]&&(headers['Prefer']='return=representation'),_0x10c3f8[_0x2324c4(0x288,0x24f)]?.['upsert']&&(headers[_0x2324c4(0x222,0x1b0)]=_0x2324c4(0x171,0x1e6)),_0x10c3f8['dataArray']&&(_0x53f510=_0x10c3f8[_0x2324c4(0x2c1,0x26f)]),response=await this[_0x2324c4(0x25b,0x235)]['post'](_0x52f568,_0x53f510,{'headers':headers});}}}return{'data':response['data'],'error':null,'count':response[_0x2324c4(0x2a8,0x278)]?.['x-total-count']?parseInt(response[_0x2324c4(0x24b,0x278)][_0x2324c4(0x208,0x221)]):undefined};}catch(_0x5c312c){return{'data':null,'error':_0x5c312c instanceof EBaaSError?_0x5c312c:new EBaaSError(_0x5c312c instanceof Error?_0x5c312c['message']:'Database\x20operation\x20failed',0x0,_0x5c312c)};}}}class CustomDatabaseManager{constructor(_0x2f32fd,_0x4cf8f0){this[_0x3f81c5(0x2d,0x96)]=_0x2f32fd;function _0x3f81c5(_0x30df03,_0x57d5c3){return _0x1e97(_0x57d5c3- -0x104,_0x30df03);}this[_0x3f81c5(-0x2e,-0xd)]=_0x4cf8f0;}async['detectCustomDatabase'](){if(!this[_0x13d976(-0x173,-0x131)])return{'hasCustomDatabase':![]};try{const response=await this['httpClient'][_0x13d976(-0x8a,-0x111)]('/admin/v1/workspace/custom-database',{'headers':{'x-workspace-id':this['workspaceId']}});if(response[_0x13d976(-0xa4,-0xf4)]===0xc8&&response[_0x13d976(-0xe6,-0x126)]?.[_0x13d976(-0x167,-0x1b1)]){const config=response[_0x13d976(-0xe6,-0xb7)]['config'],_0x3dcb2b={'host':config[_0x13d976(-0x157,-0x15e)],'port':config[_0x13d976(-0x124,-0x128)],'database':config[_0x13d976(-0xf7,-0x11f)],'username':config['postgresUsername'],'password':'','schema':config[_0x13d976(-0xb3,-0x43)],'sslEnabled':config[_0x13d976(-0x91,-0x96)]};return this['detectedConfig']={'hasCustomDatabase':!![],'config':config,'credentials':_0x3dcb2b},this['detectedConfig'];}}catch(_0x38820c){if(_0x38820c?.[_0x13d976(-0xa4,-0x7c)]===0x194)return this['detectedConfig']={'hasCustomDatabase':![]},this['detectedConfig'];console['warn']('Failed to detect custom database configuration:',_0x38820c);}this[_0x13d976(-0xb8,-0x13d)]={'hasCustomDatabase':![]};function _0x13d976(_0x1a635d,_0x21e183){return _0x1e97(_0x1a635d- -0x26a,_0x21e183);}return this['detectedConfig'];}async['testConnection'](_0x5afb99){function _0x56c45d(_0x2db072,_0xd25011){return _0x1e97(_0xd25011-0x3b9,_0x2db072);}try{const response=await this[_0x56c45d(0x5ad,0x553)]['post']('/admin/v1/workspace/custom-database/test-connection',_0x5afb99,{'headers':this['workspaceId']?{'X-Workspace-ID':this[_0x56c45d(0x449,0x4b0)]}:{}});return response[_0x56c45d(0x52d,0x53d)];}catch(_0xd4ad51){return{'success':![],'message':_0xd4ad51?.['message']||_0x56c45d(0x5d4,0x58b)};}}async['configureCustomDatabase'](_0x134a49){if(!this[_0x229870(0x389,0x338)])throw new Error('Workspace ID is required to configure custom database');const response=await this['httpClient'][_0x229870(0x3aa,0x3ad)]('/admin/v1/workspace/custom-database',{'workspaceId':this['workspaceId'],..._0x134a49},{'headers':{'X-Workspace-ID':this[_0x229870(0x389,0x35f)]}}),config=response['data']['config'];function _0x229870(_0x157e37,_0x12a750){return _0x1e97(_0x157e37-0x292,_0x12a750);}return this[_0x229870(0x444,0x3f7)]={'hasCustomDatabase':!![],'config':config,'credentials':_0x134a49},config;}async[_0x4bcf27(-0x2e5,-0x2c5)](){function _0x4b1fc1(_0x190779,_0x536579){return _0x1e97(_0x190779-0x81,_0x536579);}if(!this[_0x4b1fc1(0x178,0x1a0)])throw new Error('Workspace ID is required to remove custom database');await this['httpClient']['delete']('/admin/v1/workspace/custom-database',{'headers':{'X-Workspace-ID':this[_0x4b1fc1(0x178,0x10c)]}}),this['detectedConfig']={'hasCustomDatabase':![]};}[_0x4bcf27(-0x2c2,-0x33e)](){return this['detectedConfig'];}[_0x4bcf27(-0x278,-0x203)](){function _0x51e11(_0x26be23,_0x941d61){return _0x1e97(_0x26be23- -0x190,_0x941d61);}return this[_0x51e11(0x22,-0x24)]?.['hasCustomDatabase']??![];}[_0x4bcf27(-0x22c,-0x1c1)](){function _0x44e15(_0x549620,_0x1a8c26){return _0x1e97(_0x549620- -0x37e,_0x1a8c26);}return this['detectedConfig']?.[_0x44e15(-0x1f4,-0x19e)];}[_0x4bcf27(-0x20c,-0x183)](_0xdef9b){this['workspaceId']=_0xdef9b;function _0xc06c89(_0x5f0a9e,_0x5c7573){return _0x1e97(_0x5c7573-0x8,_0x5f0a9e);}this[_0xc06c89(0x203,0x1ba)]=undefined;}[_0x4bcf27(-0x2ac,-0x25e)](){return this['workspaceId'];}[_0x4bcf27(-0x2fd,-0x2b3)](){function _0x115f63(_0x55beef,_0x47cd34){return _0x1e97(_0x47cd34- -0x35e,_0x55beef);}return{'workspaceId':this[_0x115f63(-0x2e1,-0x267)],'hasConfig':this['hasCustomDatabase'](),'configDetails':this[_0x115f63(-0x1de,-0x1ac)]?.['credentials']?{'host':this[_0x115f63(-0x181,-0x1ac)][_0x115f63(-0x243,-0x1d4)][_0x115f63(-0x1f5,-0x230)],'port':this['detectedConfig'][_0x115f63(-0x1f3,-0x1d4)][_0x115f63(-0x16f,-0x1e8)],'database':this['detectedConfig'][_0x115f63(-0x198,-0x1d4)][_0x115f63(-0x241,-0x224)],'schema':this[_0x115f63(-0x156,-0x1ac)][_0x115f63(-0x1fa,-0x1d4)]['schema']||_0x115f63(-0x18e,-0x1de),'sslEnabled':this['detectedConfig'][_0x115f63(-0x1a8,-0x1d4)][_0x115f63(-0x175,-0x185)]||![]}:undefined};}}class DatabaseClient{constructor(_0x17e20a,_0x25af0b){this['httpClient']=_0x17e20a,this['customDatabaseManager']=new CustomDatabaseManager(_0x17e20a,_0x25af0b);}['from'](_0x25b317){function _0x78ae68(_0x60069b,_0x3d1d82){return _0x1e97(_0x3d1d82- -0x1be,_0x60069b);}return new QueryBuilder(this['httpClient'],_0x25b317,this[_0x78ae68(-0x9c,-0x89)],this['customDatabaseManager'][_0x78ae68(-0x38,-0x86)]());}[_0x4bcf27(-0x277,-0x259)](_0x352a38,_0x114a7a){function _0x28cad8(_0x581532,_0x4dfb2a){return _0x1e97(_0x581532- -0x2a,_0x4dfb2a);}return this[_0x28cad8(0x170,0xf8)][_0x28cad8(0xee,0x16a)]('/rpc/'+_0x352a38,_0x114a7a);}['schema'](_0x544784){const _0x20d405=new DatabaseClient(this['httpClient'],this['customDatabaseManager']['getWorkspaceId']());_0x20d405[_0x406a6e(0x376,0x334)]=_0x544784;function _0x406a6e(_0x1e443c,_0x36bb69){return _0x1e97(_0x36bb69-0x1ff,_0x1e443c);}return _0x20d405['customDatabaseManager']=this[_0x406a6e(0x3e2,0x3f3)],_0x20d405;}async['detectCustomDatabase'](){return this['customDatabaseManager']['detectCustomDatabase']();}async['testCustomConnection'](_0x47e350){function _0x369a8b(_0x468f80,_0x1e7302){return _0x1e97(_0x468f80- -0x327,_0x1e7302);}return this[_0x369a8b(-0x133,-0xf6)][_0x369a8b(-0x1ec,-0x1d0)](_0x47e350);}async[_0x4bcf27(-0x252,-0x20e)](_0x29c3bb){function _0x736b39(_0xf304a6,_0x120497){return _0x1e97(_0x120497-0x288,_0xf304a6);}return this[_0x736b39(0x414,0x47c)][_0x736b39(0x39d,0x41a)](_0x29c3bb);}async['removeCustomDatabase'](){function _0x5dfafc(_0x4620b0,_0x370bde){return _0x1e97(_0x4620b0- -0x137,_0x370bde);}return this['customDatabaseManager'][_0x5dfafc(-0x38,-0xa6)]();}[_0x4bcf27(-0x2df,-0x30c)](){function _0x419227(_0x31379c,_0x6581eb){return _0x1e97(_0x6581eb-0xb3,_0x31379c);}return this[_0x419227(0x24b,0x2a7)][_0x419227(0x27c,0x21f)]();}['getCustomDatabaseStatus'](){function _0x353d72(_0x50c55a,_0x960305){return _0x1e97(_0x960305- -0x117,_0x50c55a);}return this[_0x353d72(0xb6,0xdd)]['getStatus']();}[_0x4bcf27(-0x20c,-0x18c)](_0x413635){function _0x52ade4(_0x3d363a,_0x1279d8){return _0x1e97(_0x3d363a-0x16e,_0x1279d8);}this[_0x52ade4(0x362,0x344)]['setWorkspaceId'](_0x413635);}async['initialize'](){function _0xfd5419(_0x1a3158,_0x5b5f99){return _0x1e97(_0x1a3158- -0x347,_0x5b5f99);}try{await this[_0xfd5419(-0x153,-0x16b)]['detectCustomDatabase']();}catch(_0x55cd05){console[_0xfd5419(-0x177,-0x15a)]('Failed to initialize custom database detection:',_0x55cd05);}}}class StorageBucket{constructor(_0x330dcf,bucketId){this[_0x22148a(-0xae,-0xc4)]=_0x330dcf;function _0x22148a(_0x53f90b,_0x5a38bb){return _0x1e97(_0x53f90b- -0x248,_0x5a38bb);}this['bucketId']=bucketId;}async[_0x4bcf27(-0x1f6,-0x248)](_0x523823,_0xd3d5d4,_0x1e4e0a){function _0x2e5353(_0x4516a5,_0x5d8009){return _0x1e97(_0x4516a5- -0x1e4,_0x5d8009);}try{const _0x342624=new FormData();if(_0xd3d5d4 instanceof File)_0x342624['append']('file',_0xd3d5d4);else{if(_0xd3d5d4 instanceof Blob)_0x342624[_0x2e5353(0x7,0x26)](_0x2e5353(-0xad,-0x4a),_0xd3d5d4,_0x523823);else{if(_0xd3d5d4 instanceof ArrayBuffer)_0x342624[_0x2e5353(0x7,0x1e)]('file',new Blob([_0xd3d5d4]),_0x523823);else typeof _0xd3d5d4==='string'&&_0x342624['append'](_0x2e5353(-0xad,-0x31),new Blob([_0xd3d5d4],{'type':'text/plain'}),_0x523823);}}_0x342624[_0x2e5353(0x7,0x4a)]('path',_0x523823);_0x1e4e0a?.['cacheControl']&&_0x342624[_0x2e5353(0x7,-0x3a)](_0x2e5353(-0xe6,-0x14a),_0x1e4e0a['cacheControl']);_0x1e4e0a?.[_0x2e5353(-0x9f,-0x112)]&&_0x342624[_0x2e5353(0x7,-0x70)](_0x2e5353(-0x9f,-0x8b),_0x1e4e0a[_0x2e5353(-0x9f,-0x1f)]);_0x1e4e0a?.['metadata']&&_0x342624['append']('metadata',JSON['stringify'](_0x1e4e0a[_0x2e5353(-0x40,-0x1)]));const _0x36820e='/storage/buckets/'+this[_0x2e5353(-0xc9,-0xc8)]+'/files'+(_0x1e4e0a?.[_0x2e5353(0x6,-0x3b)]?'?upsert=true':''),response=await this['httpClient'][_0x2e5353(-0xcc,-0x83)](_0x36820e,_0x342624,{'headers':{'Content-Type':'multipart/form-data'}});return{'data':response[_0x2e5353(-0x60,-0x6)],'error':null};}catch(_0x38ef23){return{'data':null,'error':_0x38ef23 instanceof EBaaSError?_0x38ef23:new EBaaSError(_0x38ef23 instanceof Error?_0x38ef23['message']:'Failed\x20to\x20upload\x20file',0x0,_0x38ef23)};}}async['download'](_0x33a4cd,_0x2fde01){function _0x2f4974(_0x5d3c6e,_0x2d77c4){return _0x1e97(_0x2d77c4- -0x1a6,_0x5d3c6e);}try{const _0xbc512d=new URLSearchParams();_0x2fde01?.['transform']&&Object['entries'](_0x2fde01[_0x2f4974(-0x9e,-0x34)])['forEach'](([_0x401660,_0x3ba7a8])=>{_0x3ba7a8!==undefined&&_0xbc512d['append'](_0x401660,String(_0x3ba7a8));});const _0xacf894='/storage/buckets/'+this[_0x2f4974(-0xb,-0x8b)]+'/files/'+_0x33a4cd+(_0xbc512d['toString']()?'?'+_0xbc512d['toString']():''),response=await this['httpClient']['get'](_0xacf894,{'responseType':'blob'});return{'data':response[_0x2f4974(0x1e,-0x22)],'error':null};}catch(_0x406b14){return{'data':null,'error':_0x406b14 instanceof EBaaSError?_0x406b14:new EBaaSError(_0x406b14 instanceof Error?_0x406b14[_0x2f4974(0x52,0x3f)]:'Failed\x20to\x20download\x20file',0x0,_0x406b14)};}}async[_0x4bcf27(-0x281,-0x2b2)](_0xb8e78a,_0x4d0e91){function _0x296c84(_0x477465,_0x323364){return _0x1e97(_0x477465- -0x35a,_0x323364);}try{const _0x437983=new URLSearchParams();_0xb8e78a&&_0x437983['append'](_0x296c84(-0x22a,-0x234),_0xb8e78a);_0x4d0e91?.['limit']&&_0x437983[_0x296c84(-0x16f,-0x176)](_0x296c84(-0x17e,-0x1d6),String(_0x4d0e91[_0x296c84(-0x17e,-0x1f5)]));_0x4d0e91?.['offset']&&_0x437983[_0x296c84(-0x16f,-0x174)](_0x296c84(-0x20b,-0x289),String(_0x4d0e91['offset']));_0x4d0e91?.[_0x296c84(-0x270,-0x256)]&&_0x437983['append']('sortBy',JSON[_0x296c84(-0x25a,-0x287)](_0x4d0e91['sortBy']));_0x4d0e91?.['search']&&_0x437983['append'](_0x296c84(-0x17f,-0x1d7),_0x4d0e91['search']);const _0x4a0a4f='/storage/buckets/'+this['bucketId']+'/files'+(_0x437983['toString']()?'?'+_0x437983['toString']():''),response=await this['httpClient']['get'](_0x4a0a4f);return{'data':response[_0x296c84(-0x1d6,-0x249)],'error':null};}catch(_0x464cb1){return{'data':null,'error':_0x464cb1 instanceof EBaaSError?_0x464cb1:new EBaaSError(_0x464cb1 instanceof Error?_0x464cb1['message']:_0x296c84(-0x1ea,-0x25a),0x0,_0x464cb1)};}}async['remove'](_0x354792){function _0x7cc89b(_0x52a249,_0xfccdde){return _0x1e97(_0x52a249- -0x30f,_0xfccdde);}try{const response=await this[_0x7cc89b(-0x175,-0xf6)]['delete']('/storage/buckets/'+this[_0x7cc89b(-0x1f4,-0x1e7)]+'/files',{'data':{'paths':_0x354792}});return{'data':response[_0x7cc89b(-0x18b,-0x125)],'error':null};}catch(_0x212b58){return{'data':null,'error':_0x212b58 instanceof EBaaSError?_0x212b58:new EBaaSError(_0x212b58 instanceof Error?_0x212b58[_0x7cc89b(-0x12a,-0x196)]:'Failed\x20to\x20remove\x20files',0x0,_0x212b58)};}}async[_0x4bcf27(-0x1fd,-0x278)](fromPath,_0x16f21d){function _0x1edd8d(_0x8a2b2c,_0x43557f){return _0x1e97(_0x43557f- -0x1b,_0x8a2b2c);}try{const response=await this['httpClient']['post']('/storage/buckets/'+this['bucketId']+_0x1edd8d(0x210,0x1a4),{'sourceKey':fromPath,'destinationKey':_0x16f21d});return{'data':response['data'],'error':null};}catch(_0x5e2101){return{'data':null,'error':_0x5e2101 instanceof EBaaSError?_0x5e2101:new EBaaSError(_0x5e2101 instanceof Error?_0x5e2101['message']:'Failed\x20to\x20move\x20file',0x0,_0x5e2101)};}}async[_0x4bcf27(-0x2a0,-0x261)](fromPath,_0x19c955){function _0x4dd2c6(_0x152434,_0x23afbb){return _0x1e97(_0x152434-0x318,_0x23afbb);}try{const response=await this['httpClient']['post'](_0x4dd2c6(0x48f,0x462)+this[_0x4dd2c6(0x433,0x47e)]+_0x4dd2c6(0x410,0x3ad),{'sourceKey':fromPath,'destinationKey':_0x19c955});return{'data':response[_0x4dd2c6(0x49c,0x500)],'error':null};}catch(_0x4f5bdb){return{'data':null,'error':_0x4f5bdb instanceof EBaaSError?_0x4f5bdb:new EBaaSError(_0x4f5bdb instanceof Error?_0x4f5bdb[_0x4dd2c6(0x4fd,0x504)]:'Failed\x20to\x20copy\x20file',0x0,_0x4f5bdb)};}}async['createSignedUrl'](_0x17dad9,_0xd25562,_0x1d440c){function _0x34c661(_0x5ab250,_0x20862e){return _0x1e97(_0x20862e- -0x3e4,_0x5ab250);}try{const response=await this['httpClient'][_0x34c661(-0x308,-0x2cc)]('/storage/buckets/'+this[_0x34c661(-0x27f,-0x2c9)]+'/files/'+_0x17dad9+'/sign',{'expiresIn':_0xd25562,..._0x1d440c});return{'data':response['data'],'error':null};}catch(_0x203cc3){return{'data':null,'error':_0x203cc3 instanceof EBaaSError?_0x203cc3:new EBaaSError(_0x203cc3 instanceof Error?_0x203cc3[_0x34c661(-0x1b2,-0x1ff)]:_0x34c661(-0x253,-0x28a),0x0,_0x203cc3)};}}[_0x4bcf27(-0x2d5,-0x293)](_0x28adb0,_0x3d696e){const _0x44d7d2=new URLSearchParams();function _0x1f7074(_0x32207e,_0x3417ea){return _0x1e97(_0x3417ea- -0x3de,_0x32207e);}_0x3d696e?.[_0x1f7074(-0x28c,-0x26c)]&&Object[_0x1f7074(-0x236,-0x29d)](_0x3d696e[_0x1f7074(-0x29c,-0x26c)])['forEach'](([_0x271e49,_0x9c9382])=>{function _0x33afe0(_0x16351a,_0x50dc98){return _0x1e97(_0x16351a- -0x309,_0x50dc98);}_0x9c9382!==undefined&&_0x44d7d2[_0x33afe0(-0x11e,-0xf1)](_0x271e49,String(_0x9c9382));});const _0x11218a=this[_0x1f7074(-0x216,-0x244)]['baseURL']||'',_0x5a66a6=_0x11218a+'/storage/buckets/'+this['bucketId']+'/files/'+_0x28adb0+(_0x44d7d2['toString']()?'?'+_0x44d7d2['toString']():'');return{'data':{'publicUrl':_0x5a66a6}};}async[_0x4bcf27(-0x2ab,-0x2a2)](_0x2bb478){function _0x21f384(_0x15e52f,_0x574386){return _0x1e97(_0x15e52f- -0x29b,_0x574386);}try{const response=await this[_0x21f384(-0x101,-0xce)]['get']('/storage/buckets/'+this['bucketId']+_0x21f384(-0x12d,-0xd6)+_0x2bb478+_0x21f384(-0x1ab,-0x123));return{'data':response['data'],'error':null};}catch(_0x4946aa){return{'data':null,'error':_0x4946aa instanceof EBaaSError?_0x4946aa:new EBaaSError(_0x4946aa instanceof Error?_0x4946aa['message']:_0x21f384(-0xf5,-0x17d),0x0,_0x4946aa)};}}async['updateFileMetadata'](_0x3a4540,metadata){function _0x469047(_0x2316c5,_0x369d1d){return _0x1e97(_0x369d1d- -0x3db,_0x2316c5);}try{const response=await this['httpClient']['put'](_0x469047(-0x25b,-0x264)+this['bucketId']+'/files/'+_0x3a4540+'/metadata',{'metadata':metadata});return{'data':response['data'],'error':null};}catch(_0x142d0f){return{'data':null,'error':_0x142d0f instanceof EBaaSError?_0x142d0f:new EBaaSError(_0x142d0f instanceof Error?_0x142d0f[_0x469047(-0x19b,-0x1f6)]:_0x469047(-0x2bc,-0x2c7),0x0,_0x142d0f)};}}}class StorageClient{constructor(_0x70bc8){function _0x34ecf5(_0x513893,_0x5813cb){return _0x1e97(_0x513893-0x3b4,_0x5813cb);}this[_0x34ecf5(0x54e,0x58a)]=_0x70bc8;}[_0x4bcf27(-0x23f,-0x284)](bucketId){function _0x444113(_0x797eef,_0x1c7e5e){return _0x1e97(_0x1c7e5e- -0x24f,_0x797eef);}return new StorageBucket(this[_0x444113(-0x123,-0xb5)],bucketId);}async['createBucket'](_0x1f7f90,_0xa57d4a){function _0x44d64a(_0x411cdc,_0x3f9b84){return _0x1e97(_0x3f9b84-0x3b5,_0x411cdc);}try{const response=await this[_0x44d64a(0x571,0x54f)][_0x44d64a(0x4ae,0x4cd)]('/storage/buckets',{'id':_0x1f7f90,..._0xa57d4a});return{'data':response['data'],'error':null};}catch(_0x41e3b7){return{'data':null,'error':_0x41e3b7 instanceof EBaaSError?_0x41e3b7:new EBaaSError(_0x41e3b7 instanceof Error?_0x41e3b7['message']:'Failed\x20to\x20create\x20bucket',0x0,_0x41e3b7)};}}async[_0x4bcf27(-0x22b,-0x24c)](_0x3e187b){function _0x3f1f5e(_0x4dd790,_0x5f5840){return _0x1e97(_0x5f5840-0x2f1,_0x4dd790);}try{const response=await this[_0x3f1f5e(0x480,0x48b)]['get'](_0x3f1f5e(0x46b,0x468)+_0x3e187b);return{'data':response[_0x3f1f5e(0x49a,0x475)],'error':null};}catch(_0x2652d4){return{'data':null,'error':_0x2652d4 instanceof EBaaSError?_0x2652d4:new EBaaSError(_0x2652d4 instanceof Error?_0x2652d4[_0x3f1f5e(0x508,0x4d6)]:_0x3f1f5e(0x3e5,0x3e7),0x0,_0x2652d4)};}}async['listBuckets'](){function _0x1f089e(_0x497e73,_0x378fbd){return _0x1e97(_0x497e73-0x33f,_0x378fbd);}try{const response=await this['httpClient'][_0x1f089e(0x51f,0x555)]('/storage/buckets');return{'data':response[_0x1f089e(0x4c3,0x512)],'error':null};}catch(_0x497f8c){return{'data':null,'error':_0x497f8c instanceof EBaaSError?_0x497f8c:new EBaaSError(_0x497f8c instanceof Error?_0x497f8c[_0x1f089e(0x524,0x4c8)]:_0x1f089e(0x530,0x56f),0x0,_0x497f8c)};}}async['updateBucket'](_0x4c2855,_0xa9d043){function _0xb2df81(_0x575e96,_0x21010a){return _0x1e97(_0x21010a-0x206,_0x575e96);}try{const response=await this['httpClient'][_0xb2df81(0x418,0x3a2)]('/storage/buckets/'+_0x4c2855,_0xa9d043);return{'data':response[_0xb2df81(0x3c2,0x38a)],'error':null};}catch(_0x7026c3){return{'data':null,'error':_0x7026c3 instanceof EBaaSError?_0x7026c3:new EBaaSError(_0x7026c3 instanceof Error?_0x7026c3[_0xb2df81(0x46a,0x3eb)]:'Failed\x20to\x20update\x20bucket',0x0,_0x7026c3)};}}async['deleteBucket'](_0x532e34){function _0xc55dae(_0x124c0b,_0x13be33){return _0x1e97(_0x124c0b-0x336,_0x13be33);}try{const response=await this[_0xc55dae(0x4d0,0x517)]['delete'](_0xc55dae(0x4ad,0x446)+_0x532e34);return{'data':response['data'],'error':null};}catch(_0x3deb7e){return{'data':null,'error':_0x3deb7e instanceof EBaaSError?_0x3deb7e:new EBaaSError(_0x3deb7e instanceof Error?_0x3deb7e[_0xc55dae(0x51b,0x4ee)]:'Failed\x20to\x20delete\x20bucket',0x0,_0x3deb7e)};}}async['getUsage'](){function _0x5e5742(_0x3eeaf3,_0x1c9107){return _0x1e97(_0x3eeaf3-0x204,_0x1c9107);}try{const response=await this['httpClient']['get']('/storage/usage');return{'data':response[_0x5e5742(0x388,0x3ac)],'error':null};}catch(_0x1f2905){return{'data':null,'error':_0x1f2905 instanceof EBaaSError?_0x1f2905:new EBaaSError(_0x1f2905 instanceof Error?_0x1f2905[_0x5e5742(0x3e9,0x460)]:'Failed\x20to\x20get\x20storage\x20usage',0x0,_0x1f2905)};}}}function _0x5df5(){const _0x43cb85=['BM9Kzq','zxjYB3i','DxbKyxrLt3b0Aw9UCW','zxHLy3v0zvf1zxj5','ChjLzMvY','yM9KEq','AM9PBMvK','ChvZAa','AgfZq3vZDg9Trgf0ywjHC2u','CNbJ','l2zPBgvZlW','Bwf4uMvJB25Uzwn0qxr0zw1WDhm','rMfPBgvKihrVigXPC3qGzMLSzxm','C2vUza','DhjHBNnMB3jT','Cg9ZDgDYzxneyxrHyMfZzq','z2v0twv0CMLJCW','CMfUzg9T','Cg9YDa','l3n0B3jHz2uVyNvJA2v0CY8','Cg9ZDgDYzxnFy2HHBMDLCW','B25qB3n0z3jLC0nOyw5Nzxm','yxv0B0rLDgvJDen1C3rVBurHDgfIyxnL','CxvLCNK','Aw5PDgLHBgL6zun1C3rVBurHDgfIyxnL','x3jLAM9PBG','CMvTB3zLq2HHBM5LBa','mZa0mta1nwfLDgTiCa','ChvIBgLJ','z2v0u2vZC2LVBG','zxjYB3jLza','ndu3mti1sM10wvjv','zgf0yq','C3vIC2nYAxb0Aw9UCW','Ec10B3rHBc1JB3vUDa','yxnJzw5KAw5N','zxHLy3v0zq','ms4XlJG','y3jLzgvUDgLHBhm','Dw5ZDwjZy3jPyMu','z3rL','l2f1DgGVDJeVC2rRl3nPz25PBG','C3rHDgu','y29TBw9U','y29UBMvJDgLUzW','Cg9ZDgDYzxnFy2HHBMDLCZO','y29UzMLNDxjLq3vZDg9Trgf0ywjHC2u','CMvHBhrPBwu','y2HHBM5LBa','l2f1DgGVDJeVC2LNBM91Da','C3rHy2S','mta3mLPSA2LKvq','y29UBMvJDf9LCNjVCG','rMfPBgvKihrVigrLCgXVEsbMDw5JDgLVBG','Ahr0CenSAwvUDa','DxbKyxrL','Chv0','CMvJB25Uzwn0','CgfYC2u','z2XVyMfS','zMLSDgvYCW','Bgv2zwW','C2vZC2LVBG','CMvMCMvZAf90B2TLBG','Bwv0ywrHDge','zNjVBq','rMfPBgvKihrVigDLDcbMAwXLigLUzM8','zxzLBNrZ','DxbKyxrLvxnLCG','C2v0qxv0AfrVA2vU','x2PVAw4','Bg9HzfnLC3nPB24','CgvYAw9K','p29WzxjHDgLVBJ11ChnLCNq','Aw1WB3j0twfW','AxndB25Uzwn0zwq','AM9PBG','AwXPA2u','zgv0zwn0zwrdB25MAwC','z2v0twf4tgLZDgvUzxjZ','B3b0Aw9UCW','y29Kzq','DMfSDwvZ','Cg9ZDgDYzxnty2HLBwe','z2v0q3vZDg9Tq3jLzgvUDgLHBhm','z2v0qNvJA2v0','mtqWnZntzhHezvi','CMvHy3qTBMf0AxzL','DxnLCG','DMvYAwz5','Aw5PDgLHBgL6zq','l2zPBgvZl21VDMu','zgv0ywLSCW','B3bLCMf0B3i','C3vIC2nYAwjLx3bVC3rNCMvZx2nOyw5Nzxm','zw1PDa','AgfUzgXLqxv0AevYCM9Y','y29SDw1U','C3rHDhvZ','Bg9N','AgfUzgXLrxjYB3i','lMfZyW','y2fWDhvYzvn0ywnRvhjHy2u','rMfPBgvKihrVigDLDcbMDw5JDgLVBIbTzxrYAwnZ','C2v0','igf0DgvTChrZoIa','C2LNBK91Da','rNvUy3rPB24GAw52B2nHDgLVBIbMywLSzwq','D2fYBG','DgLTzw91Da','rMfPBgvKihrVihrLC3qGy29UBMvJDgLVBG','u29JA2v0lMLVlwnSAwvUDcbUW6nVigvZDmoHigrPC3bVBSoTDMvSlIbqyxjHifjLywn0ie5HDgL2zsWGAw5ZDgfSztOGBNbTigLUC3rHBgWGC29JA2v0lMLVlwnSAwvUDa','zgf0yufYCMf5','B2zM','mJbXsvD5wwm','DxnL','C2v0v29YA3nWywnLswq','C3nSrw5HyMXLza','B3bLCMf0Aw9U','C2vHCMnO','BgLTAxq','AgvHzgvYCW','l21LDhjPy3m','z2v0tg9NCW','z2v0','rujHyvnfCNjVCG','y2XVC2vK','CMvWBgfJzq','C2L6zq','BwvZC2fNzq','C2nOzw1H','Bw92zq','y29UDgfPBNm','BMfTzq','DxbZzxj0','yxbWzw5K','zwjHyxmUyxv0Ac5ZzxnZAw9U','BgvHDMLUzW','DxbSB2fK','BMvX','C2v0sxrLBq','rMfPBgvKihrVigXPC3qGyNvJA2v0CW','C2v0u2vZC2LVBKLUDgvYBMfS','BgvHDMu','y3vZDg9Trgf0ywjHC2vnyw5Hz2vY','BgLZDgvUzxjZ','zgLZy29UBMvJDa','DhjHy2S','z2v0u3rHDhvZ','zgvSzxrL','BwfRzvjLzG','C29YDej5','AM9PBMvKt25Jzq','AgfZ','Dw50CMfJAW','mZK1otvVDe11y3O','BwfW','l2LUzM8','zgvMyxvSDhm','yNjVywrJyxn0','mte3mMfXsu5Tta','Aw5KzxGUDhm','vw5ZDxbWB3j0zwqGsfruucbTzxrOB2q6ia','rMfPBgvKihrVigDLDcbIDwnRzxq','D29YA3nWywnLswq','l2zPBgvZl2nVChK','BgLRzq','B25dB25Uzwn0Aw9Uu3rHDgvdAgfUz2u','yNvJA2v0','C3rYAw5N','ntyYoen5q1jAzW','y2fJAgvdB250CM9S','CMvTB3zLq3vZDg9Trgf0ywjHC2u','C3rYAw5NAwz5','C29JA2v0lMLVlwnSAwvUDcbUB3qGyxzHAwXHyMXL','y2XPzw50','y29UzMLN','mJaZnZm1mg5vD0HmDW','AxnvC2LUz0n1C3rVBurHDgfIyxnL','CMvTB3zLqxv0AfrVA2vU','zgvWBg95','AM9PBMLUzW','BgvUz3rO','y29UBMvJDa','u29JA2v0lMLVlwnSAwvUDcbUW6nVigvZDmoHigrPC3bVBSoTDMvSig5LC3rLigfTyMLLBNrLlIbqyxjHihvZyxiGzNvUy2LVBMfSAwrHzgvZigrLihjLywX0Aw1LlcbPBNn0ywXLoIbUCg0GAw5ZDgfSBcbZB2nRzxqUAw8Ty2XPzw50','CMvZB2X2zq','DxjS','Aw52B2TL','z2v0uhvIBgLJvxjS','mJrht3jzu2K','z2v0q2HHBM5LBhm','DMvYC2LVBNm','Cg9ZDgDYzxniB3n0','rMfPBgvKihrVihvWzgf0zsbMAwXLig1LDgfKyxrH','uhjLzMvY','Aw50zxjJzxb0B3jZ','Dgv4Dc9WBgfPBG','Cg9ZDa','BxvSDgLWyxj0l2zVCM0Tzgf0yq','l3nKAY92ms8','yNvJA2v0swq','yxbPs2v5','Dg9ku09o','y29UBMvJDgvK','AgvHCNrIzwf0sw50zxj2ywW','CMvQzwn0','Dw5KzwzPBMvK','z2v0rgv0zwn0zwrdB25MAwC','Dg9WAwm','CMvZCg9UC2u','zw50CNLWB2LUDa','zgLZy29UBMvJDgvK','DxbKyxrLrw52','l2f1DgGVDJeVCMvMCMvZAa','Dg9tDhjPBMC','Bwf4tgLZDgvUzxjZ','l2XVz3m','C2v0DxbjBNrLCMnLChrVCNm','B3jKzxi','Ag9ZDa','y2HHBM5LBhm','ChjLzML4','C3rHCNrZv2L0Aa','zM9YrwfJAa','B25Jzq','l2z1BMn0Aw9UCY92ms8','y3vYCMvUDfnJAgvTyq','mta4nNLfzwHuBW','zMLSzq','z2v0v29YA3nWywnLswq','z2v0rMLSzuLUzM8','zgf0ywjHC2u','DgvZDenVBM5Ly3rPB24','C29JA2v0lMLVlwnSAwvUDa','yNjVywrJyxn0oG','zw52','y2XLyxi','z2v0vxnLCG','zw50CMLLCW','DgfIBgu','C2vSzwn0','y29WEq','y29UDgvUDfr5Cgu','Cg9ZDgDYzxnqB3j0','CMfUz2u','l2f1DgGVDJeVCMvZzxqTCgfZC3DVCMq','y29UBMvJDgLVBLn0yxrL','y3vYCMvUDfnLC3nPB24','CMvZB2X1DgLVBJ1TzxjNzs1KDxbSAwnHDgvZlhjLDhvYBJ1YzxbYzxnLBNrHDgLVBG','z2v0q3vZDg9Trgf0ywjHC2vtDgf0Dxm','C29JA2v0qwrHChrLCG','mtCYnZGZotnlzNbQv3u','B2zMC2v0','C2v0u2vZC2LVBG','ChjLC2vUy2u6','Cgf0y2G','ChjLCgvUzeXPC3rLBMvY','yMfZzvvsta','CMf3tgLZDgvUzxjZ','C29JA2v0','lMrLC2m','x3nLDfn0yxrL','ChjLC2vUy2u','rMfPBgvKihrVignYzwf0zsbZAwDUzwqGvvjm','zxzLBNq','p29WzxjHDgLVBJ1ZzwXLy3q','y2XLyxjtzxnZAw9U','C29JA2v0t3b0Aw9UCW','ChjLCgvUze9Uy2vmAxn0zw5LCG','AxnezwXLDgu','x3rYAwDNzxi','u1vcu0nssujfra','BgLZDa'];_0x5df5=function(){return _0x43cb85;};return _0x5df5();}function _0x1e97(_0x1256b1,_0x3bacd6){const _0x5df500=_0x5df5();return _0x1e97=function(_0x1e9716,_0x4589a7){_0x1e9716=_0x1e9716-0xe5;let _0x177aed=_0x5df500[_0x1e9716];if(_0x1e97['JRHTFw']===undefined){var _0x693b3f=function(_0x10db32){const _0x1fb62e='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x481f57='',_0xe911a0='';for(let _0x26cd03=0x0,_0x12d93d,_0x12c9e4,_0x52f10c=0x0;_0x12c9e4=_0x10db32['charAt'](_0x52f10c++);~_0x12c9e4&&(_0x12d93d=_0x26cd03%0x4?_0x12d93d*0x40+_0x12c9e4:_0x12c9e4,_0x26cd03++%0x4)?_0x481f57+=String['fromCharCode'](0xff&_0x12d93d>>(-0x2*_0x26cd03&0x6)):0x0){_0x12c9e4=_0x1fb62e['indexOf'](_0x12c9e4);}for(let _0x4655aa=0x0,_0x5c1c4e=_0x481f57['length'];_0x4655aa<_0x5c1c4e;_0x4655aa++){_0xe911a0+='%'+('00'+_0x481f57['charCodeAt'](_0x4655aa)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xe911a0);};_0x1e97['edwsyl']=_0x693b3f,_0x1256b1=arguments,_0x1e97['JRHTFw']=!![];}const _0x12bbe6=_0x5df500[0x0],_0x258443=_0x1e9716+_0x12bbe6,_0x507cff=_0x1256b1[_0x258443];return!_0x507cff?(_0x177aed=_0x1e97['edwsyl'](_0x177aed),_0x1256b1[_0x258443]=_0x177aed):_0x177aed=_0x507cff,_0x177aed;},_0x1e97(_0x1256b1,_0x3bacd6);}class EventManager{constructor(){function _0x27ba21(_0x21af30,_0x10b2a2){return _0x1e97(_0x10b2a2- -0x2a2,_0x21af30);}this['events']=new Map(),this[_0x27ba21(-0x1e0,-0x178)]=0xa;}['on'](_0x2614f8,_0x49f56f){!this[_0xe8db23(-0x87,-0xb3)][_0xe8db23(-0x10d,-0x16e)](_0x2614f8)&&this['events'][_0xe8db23(-0x110,-0x8e)](_0x2614f8,new Set());function _0xe8db23(_0x5478d6,_0x1a16db){return _0x1e97(_0x1a16db- -0x25a,_0x5478d6);}this[_0xe8db23(-0x48,-0xb3)][_0xe8db23(-0x60,-0x7a)](_0x2614f8)['add'](_0x49f56f);}[_0x4bcf27(-0x20f,-0x258)](_0x3302a0,_0x3fcdd9){if(!this[_0x641eba(0x2e6,0x28d)][_0x641eba(0x1d7,0x1d2)](_0x3302a0))return;function _0x641eba(_0xd142be,_0x546948){return _0x1e97(_0x546948-0xe6,_0xd142be);}const _0x79106f=this['events']['get'](_0x3302a0);_0x3fcdd9?_0x79106f[_0x641eba(0x181,0x1ce)](_0x3fcdd9):_0x79106f[_0x641eba(0x294,0x225)](),_0x79106f[_0x641eba(0x26a,0x2ca)]===0x0&&this[_0x641eba(0x252,0x28d)][_0x641eba(0x1ac,0x1ce)](_0x3302a0);}['emit'](_0x4c007c,..._0x5bc328){if(!this[_0x5c7383(0x23f,0x2c3)][_0x5c7383(0x18b,0x208)](_0x4c007c))return![];function _0x5c7383(_0x2c051a,_0x45ecd4){return _0x1e97(_0x45ecd4-0x11c,_0x2c051a);}const _0x22e2a8=this['events'][_0x5c7383(0x2d5,0x2fc)](_0x4c007c);for(const _0x533c1b of _0x22e2a8){try{_0x533c1b(..._0x5bc328);}catch(_0x2601c8){console[_0x5c7383(0x22c,0x281)]('Error\x20in\x20event\x20listener\x20for\x20\x22'+_0x4c007c+'\x22:',_0x2601c8);}}return _0x22e2a8['size']>0x0;}['removeAllListeners'](_0x8d5bb3){_0x8d5bb3?this['events']['delete'](_0x8d5bb3):this['events']['clear']();}['listenerCount'](_0x186569){function _0x489464(_0xe6de31,_0x1389b1){return _0x1e97(_0xe6de31- -0x393,_0x1389b1);}return this[_0x489464(-0x1ec,-0x164)]['get'](_0x186569)?.['size']??0x0;}['eventNames'](){function _0x4dfbdb(_0x252b29,_0x34a3cb){return _0x1e97(_0x252b29- -0x21,_0x34a3cb);}return Array['from'](this[_0x4dfbdb(0x186,0x1a6)]['keys']());}[_0x4bcf27(-0x1ef,-0x249)](_0x18f594){function _0x20060a(_0x55c6b8,_0x53d536){return _0x1e97(_0x53d536-0x2af,_0x55c6b8);}return Array['from'](this['events'][_0x20060a(0x406,0x48f)](_0x18f594)??[]);}['addListener'](_0xa10ef2,_0x173863){this['on'](_0xa10ef2,_0x173863);}['removeListener'](_0x59bd16,_0x4fddf8){function _0x1f7f72(_0x5ce929,_0x18ee55){return _0x1e97(_0x18ee55-0x124,_0x5ce929);}this[_0x1f7f72(0x296,0x2f9)](_0x59bd16,_0x4fddf8);}[_0x4bcf27(-0x2b1,-0x321)](_0x5ca79b,_0x10176d){const _0xb39156=(..._0x298c12)=>{this['off'](_0x5ca79b,_0xb39156),_0x10176d(..._0x298c12);};this['on'](_0x5ca79b,_0xb39156);}[_0x4bcf27(-0x291,-0x283)](_0x11344a,_0x2c68a0){this['on'](_0x11344a,_0x2c68a0);}[_0x4bcf27(-0x285,-0x291)](_0x18d7ac,_0x360d16){const _0x2fc9cd=(..._0xbe3615)=>{this[_0x56995f(-0x72,-0xb3)](_0x18d7ac,_0x2fc9cd);function _0x56995f(_0x598a6e,_0x4d4a94){return _0x1e97(_0x4d4a94- -0x288,_0x598a6e);}_0x360d16(..._0xbe3615);};this['on'](_0x18d7ac,_0x2fc9cd);}['setMaxListeners'](_0x4d87e0){return this['maxListeners']=_0x4d87e0,this;}[_0x4bcf27(-0x231,-0x285)](){return this['maxListeners'];}[_0x4bcf27(-0x28f,-0x305)](_0x43f66a){function _0x3799bc(_0x5d690e,_0x3e5e97){return _0x1e97(_0x5d690e-0x173,_0x3e5e97);}return this[_0x3799bc(0x368,0x348)](_0x43f66a);}}class RealtimeChannel extends EventManager{constructor(_0x7adbd2,_0x5b14c9){super(),this['joinedOnce']=![],this['state']=_0x35fc1f(-0xcc,-0xab),this[_0x35fc1f(-0x129,-0x113)]=new Map(),this[_0x35fc1f(-0x18b,-0x1e3)]=_0x7adbd2;function _0x35fc1f(_0x2f1049,_0x123a31){return _0x1e97(_0x2f1049- -0x2ae,_0x123a31);}this['socket']=_0x5b14c9;}['subscribe'](_0x2d1d78){!this[_0x8ed3b6(-0x231,-0x253)]&&(this[_0x8ed3b6(-0x231,-0x296)]=!![],this['_join']());_0x2d1d78&&this['on']('status',_0x2d1d78);function _0x8ed3b6(_0x8dbf7c,_0x5662cc){return _0x1e97(_0x8dbf7c- -0x31c,_0x5662cc);}return this;}[_0x4bcf27(-0x26b,-0x249)](filter,_0x2f09d0){const _0x40dd05=_0x155c6b(0x2e3,0x296)+JSON[_0x155c6b(0x252,0x1e7)](filter);this['on'](_0x40dd05,_0x2f09d0);const _0x553830={'unsubscribe':()=>{function _0x5a01cc(_0x1ffa14,_0x34d8de){return _0x1e97(_0x34d8de- -0x1b0,_0x1ffa14);}this[_0x5a01cc(0x9f,0x25)](_0x40dd05,_0x2f09d0),this[_0x5a01cc(0x26,-0x2b)]['delete'](_0x40dd05);}};function _0x155c6b(_0x27287b,_0xa57598){return _0x1e97(_0x27287b-0x152,_0xa57598);}return this[_0x155c6b(0x2d7,0x339)][_0x155c6b(0x31e,0x36c)](_0x40dd05,_0x553830),this[_0x155c6b(0x2a8,0x28b)]?.[_0x155c6b(0x270,0x2c5)]&&this['state']===_0x155c6b(0x2bc,0x317)&&this['socket'][_0x155c6b(0x315,0x330)]('subscribe_postgres_changes',{'topic':this[_0x155c6b(0x275,0x29b)],'filter':filter,'ref':this['makeRef']()}),_0x553830;}['onBroadcast'](filter,_0x44a58d){const _0x2e7e1a=_0x5b5215(-0x135,-0xcd)+JSON[_0x5b5215(-0x14b,-0x10a)](filter);function _0x5b5215(_0