document.addEventListener("DOMContentLoaded",()=>{(()=>{const t=document.querySelectorAll(".zolo-cloud-list");t.length&&t.forEach(t=>{(t=>{const e=t.querySelector(".zolo-cloud-list-canvas"),o=t.querySelector(".zolo-cloud-list-hidden-wrap");if(!e||!o)return;if(!e.id||!o.id)return;o.querySelectorAll("a").forEach(t=>{const e=t.textContent.replace(/\s+/g," ").trim();t.textContent=e});const r=(t=>{if(!t)return{};try{return JSON.parse(t)}catch(t){return{}}})(e.dataset.tagCanvasSettings);if(r.weight){const t=o.querySelectorAll("a");let e=!1;Array.from(t).map(t=>{const o=t.getAttribute("data-weight");return o&&""!==o&&"0"!==o||(e=!0),parseInt(o,10)||0}),e&&t.forEach((t,e)=>{const o=t.getAttribute("data-weight"),r=parseInt(o,10)||0;o&&0!==r||t.setAttribute("data-weight",e+5)})}"bgcolour"===r.weightMode&&o.querySelectorAll("a").forEach(t=>{t.style.removeProperty("background-color")}),o.querySelector('a[style*="background-color"]')&&"tag"!==r.bgColour&&"bgcolour"!==r.weightMode&&(r.bgColour="tag");const a=o.querySelectorAll("a[data-bg-outline]");if(a.length){r.bgOutline="tag";let t=0;a.forEach(e=>{e.style.color=e.getAttribute("data-bg-outline");const o=parseInt(e.getAttribute("data-bg-outline-thickness"),10)||0;o>t&&(t=o)}),r.bgOutlineThickness=t||r.bgOutlineThickness||2,o.querySelectorAll("a:not([data-bg-outline])").forEach(t=>{t.style.color="transparent"}),r.textColour||(r.textColour="#333333")}if(o.querySelector("a[title]")&&!r.tooltip&&(r.tooltip="native"),!r.weight){const t=r.textHeight||15,e=o.querySelectorAll("a");Array.from(e).filter(t=>t.style.fontSize).length&&(r.weight=!0,r.weightMode="size",r.weightFrom="data-weight",r.weightSize=1,e.forEach(e=>{const o=parseInt(e.style.fontSize,10);e.setAttribute("data-weight",o>0?o:t)}))}try{window.TagCanvas.Start(e.id,o.id,r)||console.warn("[CloudList] TagCanvas could not start for:",e.id)}catch(t){console.error("[CloudList] TagCanvas error:",t)}})(t)})})()});