class UserBrollFootage{static ['DEFAULT_SA'+'VE_FILENAM'+'E']='user_broll'+'_footage.j'+'son';constructor(){this['init'](),this['footages']=[],this['version']=0xd50+0x6*-0xdf+-0x815;}['init'](){console['log']('UserBrollF'+'ootage\x20ini'+'t');}['load'](t){const K={'ErKcj':'utf8'};if(!fs['existsSync'](t)){console['log']('No\x20user\x20br'+'oll\x20footag'+'e\x20data\x20fou'+'nd\x20at\x20'+t);return;}try{const e=JSON['parse'](fs['readFileSy'+'nc'](t,K['ErKcj']));this['footages']=e['footages'],this['version']=e['version'];}catch(O){console['error']('Error\x20read'+'ing\x20user\x20b'+'roll\x20foota'+'ge\x20data\x20fr'+'om\x20'+t,O);}}async['analyzeFoo'+'tage'](t){const K=await editai_api['tagVideo'](t['images']);t['tags']=K['tags'],t['descriptio'+'n']=K['descriptio'+'n'];}['renderTabl'+'e'](t=![]){const K={'ZrslW':function(e,O,z){return e(O,z);},'oPTpS':function(e,O){return e(O);}};K['ZrslW'](renderUserBrollFootageTable,this['footages'],t),K['oPTpS']($,'#broll-use'+'r-broll-de'+'tect-tags-'+'usage')['text']('Monthly\x20au'+'to-detecti'+'on\x20usage:\x20'+g_user_broll_analysis_count+'/'+g_user_broll_analysis_limit+'\x20videos');}async['ingestFoot'+'age'](t,K){const O={'UyQvd':'pending','EGMdH':function(V,T,s,Y,J){return V(T,s,Y,J);},'lemhc':function(V,T){return V>T;},'tQoRi':function(V,T){return V>T;},'Pcyzy':function(V,T){return V===T;},'dJsLC':'analyzing','rhXEV':function(V,T,s){return V(T,s);}},z=this['footages']['map'](V=>V['path']),y=[];let h=!![];O['EGMdH'](ingestUserBrollFootagePaths,t,z,K,V=>{K&&(V['analysisSt'+'atus']=O['UyQvd'],y['unshift'](V)),this['footages']['unshift'](V),this['save'](),this['renderTabl'+'e'](!![]);})['then'](()=>{h=![];});while(h||O['lemhc'](y['length'],-0xd6f+0x265b+-0x244*0xb)){if(O['tQoRi'](y['length'],-0xc4+-0x1*-0x14a7+-0x13e3)){const V=y['pop']();O['Pcyzy'](V['analysisSt'+'atus'],O['UyQvd'])&&(V['analysisSt'+'atus']=O['dJsLC'],this['renderTabl'+'e'](!![]),await O['rhXEV'](footageAnalysis,V,![]),this['save']());}else await new Promise(T=>setTimeout(T,-0xe*-0xbf+0x215f+-0x27e9));}this['renderTabl'+'e'](![]),this['save']();try{editai_api['uploadFile'+'_v2'](path['join'](DIR_app_data_base,UserBrollFootage['DEFAULT_SA'+'VE_FILENAM'+'E']),'Uploading\x20'+'user\x20broll'+'\x20footage\x20d'+'ata\x20after\x20'+'ingestion');}catch(T){console['error'](T,'Uploading\x20'+'user\x20broll'+'\x20footage\x20d'+'ata\x20after\x20'+'ingestion');}}['removeFoot'+'ages'](t){const K=[];for(let e=-0x42d+0x5*-0x2c9+-0xe*-0x14b;e<this['footages']['length'];e++){if(t['includes'](e))continue;K['push'](this['footages'][e]);}this['footages']=K,this['save'](),this['renderTabl'+'e'](![]);}['save'](){const t={'wTjnd':'utf8'};console['log']('Saving\x20use'+'r\x20broll\x20fo'+'otage');const K=path['join'](DIR_app_data_base,UserBrollFootage['DEFAULT_SA'+'VE_FILENAM'+'E']),e=this['getSaveDat'+'a']();fs['writeFileS'+'ync'](K,e,t['wTjnd']),console['log']('Saved\x20capt'+'ions\x20data\x20'+'as\x20'+K);}['getSaveDat'+'a'](){const t=JSON['parse'](JSON['stringify'](this['footages']))['map'](K=>{return delete K['images'],delete K['analysisSt'+'atus'],K;});return JSON['stringify']({'footages':t,'version':0x1});}['getSearchR'+'esultsFrom'+'PickedFoot'+'age'](t,K){const e={'JmmaG':function(h,V){return h===V;},'WSwgy':function(h,V){return h===V;},'UrzFP':function(h,V){return h<V;}},O=t['broll_id'],z=this['footages']['find'](h=>h['id']===O);if(!z)return console['error']('Footage\x20wi'+'th\x20ID\x20'+O+'\x20not\x20found'),null;if(!z['tags']||e['WSwgy'](z['tags']['length'],-0x2*-0x9d9+-0xb1f+-0x893))return{'hits':[z]};const y=this['footages']['filter'](h=>{if(e['JmmaG'](h,z)||!h['tags']||e['WSwgy'](h['tags']['length'],-0x1*0xc0e+0x1ae4+-0x12*0xd3))return![];if(h['orientatio'+'n']!==z['orientatio'+'n']&&K)return![];const V=h['tags']['map'](T=>T['value']['toLowerCas'+'e']());for(let T=0x9cc*0x2+-0x2*-0x665+-0x2062;e['UrzFP'](T,z['tags']['length']);T++){if(V['includes'](z['tags'][T]['value']['toLowerCas'+'e']()))return!![];}return![];});return{'hits':[z,...y]};}['getFootage'+'ForApi'](t=[]){return g_user_broll_footage['footages']['filter'](K=>K['descriptio'+'n']!=undefined)['filter'](K=>!t['includes'](K['id']))['map'](K=>{return{...K,'images':[]};});}['filterExis'+'tingFiles'](t){const K=this['footages']['map'](e=>path['resolve'](e['path']));return t['map'](e=>path['resolve'](e))['filter'](e=>!K['includes'](e));}}var g_user_broll_footage=new UserBrollFootage(),g_user_broll_analysis_count=-0x2*-0x91c+0x1363+-0x3*0xc89,g_user_broll_analysis_limit=-0x1bdb+-0x1*0x233b+-0x1fbd*-0x2,g_user_broll_ingest_limit=0x2171+0x1*0x193b+-0x3a48;new Promise(()=>{const t={'fiZmv':function(K){return K();}};g_user_broll_footage['load'](path['join'](DIR_app_data_base,UserBrollFootage['DEFAULT_SA'+'VE_FILENAM'+'E'])),t['fiZmv'](setUserBrollFootageListeners);});