class UserBrollFootage{static ['DEFAULT_SA'+'VE_FILENAM'+'E']='user_broll'+'_footage.j'+'son';constructor(){this['init'](),this['footages']=[],this['version']=0x19ac+0x15f8+-0x2fa3;}['init'](){const K={'ybDeS':'UserBrollF'+'ootage\x20ini'+'t'};console['log'](K['ybDeS']);}['load'](K){const n={'SmBBN':'utf8'};if(!fs['existsSync'](K)){console['log']('No\x20user\x20br'+'oll\x20footag'+'e\x20data\x20fou'+'nd\x20at\x20'+K);return;}try{const M=JSON['parse'](fs['readFileSy'+'nc'](K,n['SmBBN']));this['footages']=M['footages'],this['version']=M['version'];}catch(Y){console['error']('Error\x20read'+'ing\x20user\x20b'+'roll\x20foota'+'ge\x20data\x20fr'+'om\x20'+K,Y);}}async['analyzeFoo'+'tage'](K){const n=await editai_api['tagVideo'](K['images']);K['tags']=n['tags'],K['descriptio'+'n']=n['descriptio'+'n'];}['renderTabl'+'e'](K=![]){const n={'kksWu':function(M,Y,g){return M(Y,g);},'NGEtT':'#broll-use'+'r-broll-de'+'tect-tags-'+'usage'};n['kksWu'](renderUserBrollFootageTable,this['footages'],K),$(n['NGEtT'])['text']('Monthly\x20au'+'to-detecti'+'on\x20usage:\x20'+g_user_broll_analysis_count+'/'+g_user_broll_analysis_limit+'\x20videos');}async['ingestFoot'+'age'](K,n){const M={'pzXzk':'pending','Whvvp':function(P,w){return P>w;},'FapGC':function(P,w){return P>w;},'swQKa':function(P,w){return P===w;},'OVHCy':'analyzing','SndpL':'Uploading\x20'+'user\x20broll'+'\x20footage\x20d'+'ata\x20after\x20'+'ingestion'},Y=this['footages']['map'](P=>P['path']),g=[];let h=!![];ingestUserBrollFootagePaths(K,Y,n,P=>{n&&(P['analysisSt'+'atus']=M['pzXzk'],g['unshift'](P)),this['footages']['unshift'](P),this['save'](),this['renderTabl'+'e'](!![]);})['then'](()=>{h=![];});while(h||M['Whvvp'](g['length'],0xf99+-0x13df*-0x1+-0x2378)){if(M['FapGC'](g['length'],0x53f+-0x1*-0xb05+0x56c*-0x3)){const P=g['pop']();M['swQKa'](P['analysisSt'+'atus'],M['pzXzk'])&&(P['analysisSt'+'atus']=M['OVHCy'],this['renderTabl'+'e'](!![]),await footageAnalysis(P,![]),this['save']());}else await new Promise(w=>setTimeout(w,-0x246a+0xb8b+-0x35*-0x8b));}this['renderTabl'+'e'](![]),this['save']();try{editai_api['uploadFile'+'_v2'](path['join'](DIR_app_data_base,UserBrollFootage['DEFAULT_SA'+'VE_FILENAM'+'E']),M['SndpL']);}catch(w){console['error'](w,M['SndpL']);}}['removeFoot'+'ages'](K){const n=[];for(let M=0x249f+0x19f3+0x3e92*-0x1;M<this['footages']['length'];M++){if(K['includes'](M))continue;n['push'](this['footages'][M]);}this['footages']=n,this['save'](),this['renderTabl'+'e'](![]);}['save'](){const K={'oNJAn':'utf8'};console['log']('Saving\x20use'+'r\x20broll\x20fo'+'otage');const n=path['join'](DIR_app_data_base,UserBrollFootage['DEFAULT_SA'+'VE_FILENAM'+'E']),M=this['getSaveDat'+'a']();fs['writeFileS'+'ync'](n,M,K['oNJAn']),console['log']('Saved\x20capt'+'ions\x20data\x20'+'as\x20'+n);}['getSaveDat'+'a'](){const K=JSON['parse'](JSON['stringify'](this['footages']))['map'](n=>{return delete n['images'],delete n['analysisSt'+'atus'],n;});return JSON['stringify']({'footages':K,'version':0x1});}['getSearchR'+'esultsFrom'+'PickedFoot'+'age'](K,n){const M={'EdnFe':function(P,w){return P===w;},'qEPBu':function(P,w){return P!==w;},'CzLsL':'broll_id'},Y=K[M['CzLsL']],g=this['footages']['find'](P=>P['id']===Y);if(!g)return console['error']('Footage\x20wi'+'th\x20ID\x20'+Y+'\x20not\x20found'),null;if(!g['tags']||M['EdnFe'](g['tags']['length'],0x9d3*-0x1+-0x1*0x135f+0x2*0xe99))return{'hits':[g]};const h=this['footages']['filter'](P=>{if(M['EdnFe'](P,g)||!P['tags']||P['tags']['length']===-0x9*0x301+0x1445+0x4*0x1b1)return![];if(M['qEPBu'](P['orientatio'+'n'],g['orientatio'+'n'])&&n)return![];const w=P['tags']['map'](R=>R['value']['toLowerCas'+'e']());for(let R=-0x314*0x2+0xb*0x287+-0x1*0x15a5;R<g['tags']['length'];R++){if(w['includes'](g['tags'][R]['value']['toLowerCas'+'e']()))return!![];}return![];});return{'hits':[g,...h]};}['getFootage'+'ForApi'](K=[]){return g_user_broll_footage['footages']['filter'](n=>n['descriptio'+'n']!=undefined)['filter'](n=>!K['includes'](n['id']))['map'](n=>{return{...n,'images':[]};});}['filterExis'+'tingFiles'](K){const n=this['footages']['map'](M=>path['resolve'](M['path']));return K['map'](M=>path['resolve'](M))['filter'](M=>!n['includes'](M));}}var g_user_broll_footage=new UserBrollFootage(),g_user_broll_analysis_count=-0x3f8*-0x1+-0x117d+0xd85,g_user_broll_analysis_limit=-0x2129+-0x1a99*0x1+0x1e13*0x2,g_user_broll_ingest_limit=-0x874+0x8ea+-0x12;new Promise(()=>{g_user_broll_footage['load'](path['join'](DIR_app_data_base,UserBrollFootage['DEFAULT_SA'+'VE_FILENAM'+'E'])),setUserBrollFootageListeners();});