"),c)&&(q.processed[c][10]=!0,q.processed[c][11]=!0),t}}async function v(t,e){if(!F.fediact_autoaction)return z("Auto-action disabled."),!0;a=e,i=!1,$(a.currentTarget).children("i.fa-retweet").length?i=$(a.currentTarget).children("i.fa-retweet").hasClass("fediactive")?"unboost":"boost":$(a.currentTarget).children("i.fa-star").length?i=$(a.currentTarget).hasClass("fediactive")?"unfavourite":"favourite":$(a.currentTarget).children("i.fa-bookmark").length?i=$(a.currentTarget).hasClass("fediactive")?"unbookmark":"bookmark":$(a.currentTarget).attr("href")&&(~$(a.currentTarget).attr("href").indexOf("type=reblog")?i=$(a.currentTarget).hasClass("fediactive")?"unboost":"boost":~$(a.currentTarget).attr("href").indexOf("type=favourite")&&(i=$(a.currentTarget).hasClass("fediactive")?"unfavourite":"favourite"));var i,a=i;if(a){if(await W(t,a,null))return c&&(q.processed[c][11]=!0),"boost"==a||"unboost"==a?(Q($(e.currentTarget),[["color","!remove","rgb(140, 141, 255)"]],"fediactive"),Q($(e.currentTarget).find("i"),[["transition-duration","!remove","0.9s"],["background-position","!remove","0px 100%"]],"fediactive"),c&&(q.processed[c][3]=!q.processed[c][3])):"favourite"==a||"unfavourite"==a?(Q($(e.currentTarget),[["color","!remove","rgb(202, 143, 4)"]],"fediactive"),Q($(e.currentTarget).find("i"),[["animation","spring-rotate-out 1s linear","spring-rotate-in 1s linear"]],"fediactive"),c&&(q.processed[c][4]=!q.processed[c][4])):(Q($(e.currentTarget),[["color","!remove","rgb(255, 80, 80)"]],"fediactive"),c&&(q.processed[c][5]=!q.processed[c][5])),!0;z("Could not execute action on home instance.")}else z("Could not determine action.")}function b(t){$(e).find(".fediactunresolved").remove(),$(e).find(".fediactprocessing").remove(),t[1]?($(u).removeClass("disabled").removeAttr("disabled"),$(m).removeClass("disabled").removeAttr("disabled"),t[13]&&($(p).click(),$(p).find("span").text("Show less"),h=$(e).find("div.poll button").first(),$(p).on("click",function(t){t.preventDefault(),t.stopImmediatePropagation();t=$(p).find("span");"Show less"==$(t).text()?$(t).text("Show more"):$(t).text("Show less"),Q($(e).find("div.poll").first(),[["display","block","none"]],"fedihideshow"),Q($(e).find("div.status__content__text").first(),[["display","block","none"]],"fedihideshow")}),$(p).click()),$(h).removeAttr("disabled"),t[4]&&!$(d).hasClass("fediactive")&&(Q($(d),[["color","!remove","rgb(202, 143, 4)"]],"fediactive"),Q($(d).find("i"),[["animation","spring-rotate-out 1s linear","spring-rotate-in 1s linear"]],"fediactive")),t[3]&&!$(l).find("i.fediactive").length&&(Q($(l),[["color","!remove","rgb(140, 141, 255)"]],"fediactive"),Q($(l).find("i"),[["transition-duration","!remove","0.9s"],["background-position","!remove","0px 100%"]],"fediactive")),t[5]&&!$(u).hasClass("fediactive")&&Q($(u),[["color","!remove","rgb(255, 80, 80)"]],"fediactive"),t[10]&&($(h).hide(),$(h).closest("div.poll").find("ul").replaceWith("
View the results on your home instance.
"))):$("X").insertAfter($(d))}function _(n){var t=n[1].split("@"),e=t.pop()||t.pop();$(f).on("click",function(t){t.preventDefault(),t.stopImmediatePropagation(),t.originalEvent.isTrusted&&L(n[7]+"?fedireply")}),$(m).on("click",function(t){t.preventDefault(),t.stopImmediatePropagation(),t.originalEvent.isTrusted&&(t=[],J(n[1])?t.push(["unblock",n[6],"Unblock user"]):t.push(["block",n[6],"Block user"]),B(n[1])?t.push(["unmute",n[6],"Unmute user"]):t.push(["mute",n[6],"Mute user"]),G(n[1])?t.push(["domainunblock",e,"Unblock domain"]):t.push(["domainblock",e,"Block domain"]),t.push(["copy",n[12],"Copy URL"]),t.push(["copy",n[7],"Copy home URL"]),H(t))}),$([d,l,u,h]).each(function(){$(h).length&&$(h).get(0).isEqualNode($(this).get(0))&&(e=!0);var e,i,a=0;$(this).on("click",async function(t){t.preventDefault(),t.stopImmediatePropagation(),t.originalEvent.isTrusted&&(1==++a?i=setTimeout(async function(){(e&&!n[10]?g(n[9],n[7],t):await v(n[2],t))||z("Action failed."),a=0},350):(clearTimeout(i),(e?g(n[9],n[7],t):await v(n[2],t))?L(n[7]):z("Action failed."),a=0))}).on("dblclick",function(t){t.preventDefault(),t.stopImmediatePropagation()})})}if(c){var k=q.processed[c];b(k),k[1]&&_(k)}else{if(a&&s.push(n),t){var w,y,x,T=t.match(N),[C,P]=[!1,!1],A=(!T.groups.handledomain||~location.hostname.indexOf(T.groups.handledomain)||(C=!0),[i]);a||A.push(n);for(w of A=A.filter((t,e)=>void 0!==t&&A.indexOf(t)==e))C?P||((y=await Y(location.protocol+"//"+location.hostname+"/"+t+"/"+w))&&(P=!0,s.push(y),M.test(y)?(x=y.match(M)).groups.handle&&x.groups.tootid&&x.groups.domain&&s.push(x.groups.domain+"/@"+x.groups.handle+"/"+x.groups.tootid):N.test(y)&&(x=y.match(N)).groups.handle&&x.groups.tootid&&x.groups.domain&&s.push(x.groups.domain+"/users/"+x.groups.handle+"/statuses/"+x.groups.tootid)),s.push(location.protocol+"//"+location.hostname+"/"+t+"/"+w)):(s.push(location.protocol+"//"+location.hostname+"/users/"+T.groups.handle+"/statuses/"+w),s.push(location.protocol+"//"+location.hostname+"/@"+T.groups.handle+"/"+w))}if(s.length){var O,R,S,D,U,E=!1;for(O of s=s.filter((t,e)=>s.indexOf(t)==e))E||([R,S]=await K(O),R&&(E=!0,D="https://"+F.fediact_homeinstance+"/@"+R[0]+"/"+R[1],U=[o,...R,D,!0,...S,!1,O,r]));E?(c=V(U),b(U),_(U)):(z("Failed to resolve: "+s),c=V([o,!1]),b([o,!1]))}else z("Could not identify a post URI for home resolving."),c=V([o,!1]),b([o,!1])}}else z("Could not get toot data.")}}$(document).DOMNodeAppear(async function(t){q.isProcessing.includes($(t.target).get(0))||(q.isProcessing.push($(t.target).get(0)),e($(t.target)))},"div.status, div.detailed-status"),$(document).find("div.status, div.detailed-status").each(function(){q.isProcessing.includes($(this).get(0))||(q.isProcessing.push($(this).get(0)),e($(this)))})}async function S(){async function e(a){X();var e,n,o,t,i,s,r,c,d="follow",l=$(a).siblings("button:has(i.fa-ellipsis-fw,i.fa-ellipsis-v,i.fa-ellipsis-h)");async function u(t){return F.fediact_autoaction?(t=await W(t,d,null),"follow"==d&&t?($(n).length?($(n).removeClass("fa-user-plus").addClass("fa-user"),$(a).append("-"),$(a).attr("title","Unfollow")):$(a).text("Unfollow"),d="unfollow",!0):"unfollow"==d&&t?($(n).length?($(n).removeClass("fa-user").addClass("fa-user-plus"),$(a).contents().filter((t,e)=>3===e.nodeType).remove(),$(a).attr("title","Follow")):$(a).text("Follow"),d="follow",!0):void 0):(z("Auto-action disabled."),!0)}if($(a).closest("div.account-card").length)e=$(a).closest("div.account-card").find("div.display-name > span").text().trim();else if($(a).closest("div.directory__card").length)e=$(a).closest("div.directory__card").find("div.display-name > span").text().trim(),n=$(a).find("i").first();else for(const f of p)if($(f).length){(e=$(f).text().trim()).split("@").length-1==1&&(e=e+"@"+q.exturi);break}e&&!q.processedFollow.includes(e)&&($("Resolving... ").insertBefore($(a)),(o=await A(e))?(q.processedFollow.push(e),$(l).length&&$(l).removeClass("disabled").removeAttr("disabled"),t=e.split("@"),i=t.pop()||t.pop(),s="https://"+F.fediact_homeinstance+"/@"+o[1],(await P([o[0]]))[0]&&($(n).length?($(n).removeClass("fa-user-plus").addClass("fa-user"),$(a).append("-"),$(a).attr("title","Unfollow")):$(a).text("Unfollow"),d="unfollow"),$(l).on("click",function(t){t.preventDefault(),t.stopImmediatePropagation(),t.originalEvent.isTrusted&&(t=[],J(e)?t.push(["unblock",o[0],"Unblock user"]):t.push(["block",o[0],"Block user"]),B(e)?t.push(["unmute",o[0],"Unmute user"]):t.push(["mute",o[0],"Mute user"]),G(e)?t.push(["domainunblock",i,"Unblock domain"]):t.push(["domainblock",i,"Block domain"]),t.push(["copy",s,"Copy home URL"]),H(t))}),r=0,$(a).on("click",async function(t){var e,i;t.preventDefault(),t.stopImmediatePropagation(),t.originalEvent.isTrusted&&(1==++r?c=setTimeout(async function(){u(o[0]),r=0},350):(clearTimeout(c),await u(o[0])?($(n).length?(e=$(n).attr("class"),$(n).removeClass("fa-user").removeClass("fa-user-plus").addClass("fa-arrow-right")):(i=$(a).text(),$(a).text("Redirecting...")),setTimeout(function(){L(s),$(n).length?$(n).attr("class",e):$(a).text(i)},1e3)):z("Action failed."),r=0))}).on("dblclick",function(t){t.preventDefault(),t.stopImmediatePropagation()})):z("Could not resolve user home ID."),$(a).siblings(".fediactprocessing").remove())}var t=i.join(",");$(document).DOMNodeAppear(async function(t){q.isProcessing.includes($(t.target).get(0))||(q.isProcessing.push($(t.target).get(0)),e($(t.target)))},t),$(document).find(t).each(function(){q.isProcessing.includes($(this).get(0))||(q.isProcessing.push($(this).get(0)),e($(this)))})}function t(t){var e,i=[];for(e of t.split(/\r?\n/))(e=e.trim()).length&&(a.test(e)?i.push(e):z("Removed invalid domain "+e+" from blacklist/whitelist."));return[...new Set(i)]}function D(){if(null==F.fediact_homeinstance||!F.fediact_homeinstance)return z("Mastodon home instance is not set."),!1;if(!F.fediact_token)return z("No API token available. Are you logged in to your home instance? If yes, wait for 1-2 minutes and reload page."),!1;if(q.tokenheader={Authorization:"Bearer "+F.fediact_token},!a.test(F.fediact_homeinstance))return z("Instance setting is not a valid domain name."),!1;if("whitelist"==F.fediact_mode){if(q.whitelist=t(F.fediact_whitelist),q.whitelist.length<1)return z("Whitelist is empty or invalid."),!1}else q.blacklist=t(F.fediact_blacklist);return!0}async function U(){if(location.hostname==F.fediact_homeinstance&&(q.fedireply=x("fedireply"),!q.fedireply))return z("Current site is your home instance."),!1;if("whitelist"==F.fediact_mode){if($.inArray(location.hostname,q.whitelist)<0)return z("Current site is not in whitelist."),!1}else if(-1<$.inArray(location.hostname,q.blacklist))return z("Current site is in blacklist."),!1;var t=await m("GET",location.protocol+"//"+location.hostname+o,null,null);return!!t&&!(!(t=JSON.parse(t).uri)||(t.startsWith("http")?(t=new URL(t),q.exturi=t.hostname):q.exturi=t,E()?!F.fediact_runifloggedin&&!q.fedireply&&await y()&&(z("Already logged in to this external instance."),1):(z("Could not start background process"),1)))}async function E(){chrome.runtime.onMessage.addListener(async function(t,e,i){if(t.urlchanged){q.processed=[],q.processedFollow=[],q.isProcessing=[],$(".fediacticon").remove(),$(".fediactsettings_onsite").remove();try{$("body").off("click",fediSettingsHandler)}catch{$.noop()}await b()||location.reload()}t.updatedfedisettings&&location.reload()});try{return await chrome.runtime.sendMessage({running:!0}),!0}catch(t){z(t)}return!1}function b(){return new Promise(async function(e){try{F=await(browser||chrome).storage.local.get(w)}catch(t){z(t),e(!1)}F&&D()?e(!0):e(!1)})}async function I(){await b()?await U()?(q.fedireply?O:(S(),R))():z("Will not process this site."):z("Could not load settings.")}I();
\ No newline at end of file
+const i=["div.account__header button.logo-button","div.public-account-header a.logo-button","div.account-card a.logo-button","div.directory-card a.icon-button","div.directory__card a.icon-button","div.detailed-status a.logo-button","button.remote-button","div.account__header button.button--follow"],p=["div.account__header__tabs__name small","div.public-account-header__tabs__name small","div.detailed-status span.display-name__account","div.display-name > span","a.user-screen-name","div.profile-info-panel small"],a=/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/,R=/^(? "),c)&&(q.processed[c][10]=!0,q.processed[c][11]=!0),t}}async function v(t,e){if(!F.fediact_autoaction)return z("Auto-action disabled."),!0;a=e,i=!1,$(a.currentTarget).children("i.fa-retweet").length?i=$(a.currentTarget).children("i.fa-retweet").hasClass("fediactive")?"unboost":"boost":$(a.currentTarget).children("i.fa-star").length?i=$(a.currentTarget).hasClass("fediactive")?"unfavourite":"favourite":$(a.currentTarget).children("i.fa-bookmark").length?i=$(a.currentTarget).hasClass("fediactive")?"unbookmark":"bookmark":$(a.currentTarget).attr("href")&&(~$(a.currentTarget).attr("href").indexOf("type=reblog")?i=$(a.currentTarget).hasClass("fediactive")?"unboost":"boost":~$(a.currentTarget).attr("href").indexOf("type=favourite")&&(i=$(a.currentTarget).hasClass("fediactive")?"unfavourite":"favourite"));var i,a=i;if(a){if(await W(t,a,null))return c&&(q.processed[c][11]=!0),"boost"==a||"unboost"==a?(Q($(e.currentTarget),[["color","!remove","rgb(140, 141, 255)"]],"fediactive"),Q($(e.currentTarget).find("i"),[["transition-duration","!remove","0.9s"],["background-position","!remove","0px 100%"]],"fediactive"),c&&(q.processed[c][3]=!q.processed[c][3])):"favourite"==a||"unfavourite"==a?(Q($(e.currentTarget),[["color","!remove","rgb(202, 143, 4)"]],"fediactive"),Q($(e.currentTarget).find("i"),[["animation","spring-rotate-out 1s linear","spring-rotate-in 1s linear"]],"fediactive"),c&&(q.processed[c][4]=!q.processed[c][4])):(Q($(e.currentTarget),[["color","!remove","rgb(255, 80, 80)"]],"fediactive"),c&&(q.processed[c][5]=!q.processed[c][5])),!0;z("Could not execute action on home instance.")}else z("Could not determine action.")}function b(t){$(e).find(".fediactunresolved").remove(),$(e).find(".fediactprocessing").remove(),t[1]?($(u).removeClass("disabled").removeAttr("disabled"),$(m).removeClass("disabled").removeAttr("disabled"),t[13]&&($(p).click(),$(p).find("span").text("Show less"),h=$(e).find("div.poll button").first(),$(p).on("click",function(t){t.preventDefault(),t.stopImmediatePropagation();t=$(p).find("span");"Show less"==$(t).text()?$(t).text("Show more"):$(t).text("Show less"),Q($(e).find("div.poll").first(),[["display","block","none"]],"fedihideshow"),Q($(e).find("div.status__content__text").first(),[["display","block","none"]],"fedihideshow")}),$(p).click()),$(h).removeAttr("disabled"),t[4]&&!$(d).hasClass("fediactive")&&(Q($(d),[["color","!remove","rgb(202, 143, 4)"]],"fediactive"),Q($(d).find("i"),[["animation","spring-rotate-out 1s linear","spring-rotate-in 1s linear"]],"fediactive")),t[3]&&!$(l).find("i.fediactive").length&&(Q($(l),[["color","!remove","rgb(140, 141, 255)"]],"fediactive"),Q($(l).find("i"),[["transition-duration","!remove","0.9s"],["background-position","!remove","0px 100%"]],"fediactive")),t[5]&&!$(u).hasClass("fediactive")&&Q($(u),[["color","!remove","rgb(255, 80, 80)"]],"fediactive"),t[10]&&($(h).hide(),$(h).closest("div.poll").find("ul").replaceWith(" View the results on your home instance. "))):$("X").insertAfter($(d))}function _(n){var t=n[1].split("@"),e=t.pop()||t.pop();$(f).on("click",function(t){t.preventDefault(),t.stopImmediatePropagation(),t.originalEvent.isTrusted&&L(n[7]+"?fedireply")}),$(m).on("click",function(t){t.preventDefault(),t.stopImmediatePropagation(),t.originalEvent.isTrusted&&(t=[],J(n[1])?t.push(["unblock",n[6],"Unblock user"]):t.push(["block",n[6],"Block user"]),B(n[1])?t.push(["unmute",n[6],"Unmute user"]):t.push(["mute",n[6],"Mute user"]),G(n[1])?t.push(["domainunblock",e,"Unblock domain"]):t.push(["domainblock",e,"Block domain"]),t.push(["copy",n[12],"Copy URL"]),t.push(["copy",n[7],"Copy home URL"]),H(t))}),$([d,l,u,h]).each(function(){$(h).length&&$(h).get(0).isEqualNode($(this).get(0))&&(e=!0);var e,i,a=0;$(this).on("click",async function(t){t.preventDefault(),t.stopImmediatePropagation(),t.originalEvent.isTrusted&&(1==++a?i=setTimeout(async function(){(e&&!n[10]?g(n[9],n[7],t):await v(n[2],t))||z("Action failed."),a=0},350):(clearTimeout(i),(e?g(n[9],n[7],t):await v(n[2],t))?L(n[7]):z("Action failed."),a=0))}).on("dblclick",function(t){t.preventDefault(),t.stopImmediatePropagation()})})}if(c){var k=q.processed[c];b(k),k[1]&&_(k)}else{if(a&&s.push(n),t){var w,y,x,T=t.match(R),[C,P]=[!1,!1],A=(!T.groups.handledomain||~location.hostname.indexOf(T.groups.handledomain)||(C=!0),[i]);a||A.push(n);for(w of A=A.filter((t,e)=>void 0!==t&&A.indexOf(t)==e))C?P||((y=await Y(location.protocol+"//"+location.hostname+"/"+t+"/"+w))&&(P=!0,s.push(y),M.test(y)?(x=y.match(M)).groups.handle&&x.groups.tootid&&x.groups.domain&&s.push(x.groups.domain+"/@"+x.groups.handle+"/"+x.groups.tootid):R.test(y)&&(x=y.match(R)).groups.handle&&x.groups.tootid&&x.groups.domain&&s.push(x.groups.domain+"/users/"+x.groups.handle+"/statuses/"+x.groups.tootid)),s.push(location.protocol+"//"+location.hostname+"/"+t+"/"+w)):(s.push(location.protocol+"//"+location.hostname+"/users/"+T.groups.handle+"/statuses/"+w),s.push(location.protocol+"//"+location.hostname+"/@"+T.groups.handle+"/"+w))}if(s.length){var O,S,D,U,E,I=!1;for(O of s=s.filter((t,e)=>s.indexOf(t)==e))I||([S,D]=await K(O),S&&(I=!0,U="https://"+F.fediact_homeinstance+"/@"+S[0]+"/"+S[1],E=[o,...S,U,!0,...D,!1,O,r]));I?(c=V(E),b(E),_(E)):(z("Failed to resolve: "+s),c=V([o,!1]),b([o,!1]))}else z("Could not identify a post URI for home resolving."),c=V([o,!1]),b([o,!1])}}else z("Could not get toot data.")}}$(document).DOMNodeAppear(async function(t){q.isProcessing.includes($(t.target).get(0))||(q.isProcessing.push($(t.target).get(0)),e($(t.target)))},"div.status, div.detailed-status"),$(document).find("div.status, div.detailed-status").each(function(){q.isProcessing.includes($(this).get(0))||(q.isProcessing.push($(this).get(0)),e($(this)))})}async function D(){async function e(a){X();var e,n,o,t,i,s,r,c,d="follow",l=$(a).siblings("button:has(i.fa-ellipsis-fw,i.fa-ellipsis-v,i.fa-ellipsis-h)");async function u(t){return F.fediact_autoaction?(t=await W(t,d,null),"follow"==d&&t?($(n).length?($(n).removeClass("fa-user-plus").addClass("fa-user"),$(a).append("-"),$(a).attr("title","Unfollow")):$(a).text("Unfollow"),d="unfollow",!0):"unfollow"==d&&t?($(n).length?($(n).removeClass("fa-user").addClass("fa-user-plus"),$(a).contents().filter((t,e)=>3===e.nodeType).remove(),$(a).attr("title","Follow")):$(a).text("Follow"),d="follow",!0):void 0):(z("Auto-action disabled."),!0)}if($(a).closest("div.account-card").length)e=$(a).closest("div.account-card").find("div.display-name > span").text().trim();else if($(a).closest("div.directory__card").length)e=$(a).closest("div.directory__card").find("div.display-name > span").text().trim(),n=$(a).find("i").first();else for(const f of p)if($(f).length){(e=$(f).text().trim()).split("@").length-1==1&&(e=e+"@"+q.exturi);break}e&&!q.processedFollow.includes(e)&&($("").insertBefore($(a)),(o=await A(e))?(q.processedFollow.push(e),$(l).length&&$(l).removeClass("disabled").removeAttr("disabled"),t=e.split("@"),i=t.pop()||t.pop(),s="https://"+F.fediact_homeinstance+"/@"+o[1],(await P([o[0]]))[0]&&($(n).length?($(n).removeClass("fa-user-plus").addClass("fa-user"),$(a).append("-"),$(a).attr("title","Unfollow")):$(a).text("Unfollow"),d="unfollow"),$(l).on("click",function(t){t.preventDefault(),t.stopImmediatePropagation(),t.originalEvent.isTrusted&&(t=[],J(e)?t.push(["unblock",o[0],"Unblock user"]):t.push(["block",o[0],"Block user"]),B(e)?t.push(["unmute",o[0],"Unmute user"]):t.push(["mute",o[0],"Mute user"]),G(e)?t.push(["domainunblock",i,"Unblock domain"]):t.push(["domainblock",i,"Block domain"]),t.push(["copy",s,"Copy home URL"]),H(t))}),r=0,$(a).on("click",async function(t){var e,i;t.preventDefault(),t.stopImmediatePropagation(),t.originalEvent.isTrusted&&(1==++r?c=setTimeout(async function(){u(o[0]),r=0},350):(clearTimeout(c),await u(o[0])?($(n).length?(e=$(n).attr("class"),$(n).removeClass("fa-user").removeClass("fa-user-plus").addClass("fa-arrow-right")):(i=$(a).text(),$(a).text("Redirecting...")),setTimeout(function(){L(s),$(n).length?$(n).attr("class",e):$(a).text(i)},1e3)):z("Action failed."),r=0))}).on("dblclick",function(t){t.preventDefault(),t.stopImmediatePropagation()})):z("Could not resolve user home ID."),$(a).siblings(".fediactprocessing").remove())}var t=i.join(",");$(document).DOMNodeAppear(async function(t){q.isProcessing.includes($(t.target).get(0))||(q.isProcessing.push($(t.target).get(0)),e($(t.target)))},t),$(document).find(t).each(function(){q.isProcessing.includes($(this).get(0))||(q.isProcessing.push($(this).get(0)),e($(this)))})}function t(t){var e,i=[];for(e of t.split(/\r?\n/))(e=e.trim()).length&&(a.test(e)?i.push(e):z("Removed invalid domain "+e+" from blacklist/whitelist."));return[...new Set(i)]}function U(){if(null==F.fediact_homeinstance||!F.fediact_homeinstance)return z("Mastodon home instance is not set."),!1;if(!F.fediact_token)return z("No API token available. Are you logged in to your home instance? If yes, wait for 1-2 minutes and reload page."),!1;if(q.tokenheader={Authorization:"Bearer "+F.fediact_token},!a.test(F.fediact_homeinstance))return z("Instance setting is not a valid domain name."),!1;if("whitelist"==F.fediact_mode){if(q.whitelist=t(F.fediact_whitelist),q.whitelist.length<1)return z("Whitelist is empty or invalid."),!1}else q.blacklist=t(F.fediact_blacklist);return!0}async function E(){if(location.hostname==F.fediact_homeinstance&&(q.fedireply=x("fedireply"),!q.fedireply))return z("Current site is your home instance."),!1;if("whitelist"==F.fediact_mode){if($.inArray(location.hostname,q.whitelist)<0)return z("Current site is not in whitelist."),!1}else if(-1<$.inArray(location.hostname,q.blacklist))return z("Current site is in blacklist."),!1;var t=await m("GET",location.protocol+"//"+location.hostname+o,null,null);return!!t&&!(!(t=JSON.parse(t).uri)||(t.startsWith("http")?(t=new URL(t),q.exturi=t.hostname):q.exturi=t,I()?!F.fediact_runifloggedin&&!q.fedireply&&await y()&&(z("Already logged in to this external instance."),1):(z("Could not start background process"),1)))}async function I(){chrome.runtime.onMessage.addListener(async function(t,e,i){if(t.urlchanged){q.processed=[],q.processedFollow=[],q.isProcessing=[],$(".fediacticon").remove(),$(".fediactsettings_onsite").remove();try{$("body").off("click",fediSettingsHandler)}catch{$.noop()}await b()||location.reload()}t.updatedfedisettings&&location.reload()});try{return await chrome.runtime.sendMessage({running:!0}),!0}catch(t){z(t)}return!1}function b(){return new Promise(async function(e){try{F=await(browser||chrome).storage.local.get(w)}catch(t){z(t),e(!1)}F&&U()?e(!0):e(!1)})}async function N(){await b()?await E()?(q.fedireply?O:(D(),S))():z("Will not process this site."):z("Could not load settings.")}N();
\ No newline at end of file