"use strict";var SyncState=(e=>(e[e.NoChanges=0]="NoChanges",e[e.Normal=1]="Normal",e[e.Full=2]="Full",e))(SyncState||{});function updateSyncColor(t){const n=document.getElementById("sync");switch(t){case 0:n.classList.remove("full-sync","normal-sync");break;case 1:n.classList.add("normal-sync"),n.classList.remove("full-sync");break;case 2:n.classList.add("full-sync"),n.classList.remove("normal-sync");break}}function isAbsolutelyPositioned(t){return t instanceof HTMLElement?getComputedStyle(t).position==="absolute":!1}function isLegacyAddonElement(t){if(isAbsolutelyPositioned(t))return!0;for(const n of t.childNodes)if(isAbsolutelyPositioned(n))return!0;return!1}function getElementDimensions(t){const n=[t.offsetWidth],s=[t.offsetHeight];for(const e of t.childNodes)e instanceof HTMLElement&&(n.push(e.offsetWidth),s.push(e.offsetHeight));return[Math.max(...n),Math.max(...s)]}function moveLegacyAddonsToTray(){const t=document.getElementsByClassName("right-tray")[0],n=document.querySelectorAll(".toolbar > *"),s=Array.from(n).reverse().filter(isLegacyAddonElement);for(const e of s){const o=document.createElement("div"),l=getElementDimensions(e);e.style.right="0px",o.append(e),o.style.cssText=`width: ${l[0]}px; height: ${l[1]}}px;
margin-left: 5px; margin-right: 5px; position: relative;`,o.className="tray-item tray-item-legacy",t.append(o)}}document.addEventListener("DOMContentLoaded",moveLegacyAddonsToTray);
