((t,e)=>{"use strict";const _=new Set;t.on("builder_load_module_partial",((r,d)=>{if(!0===d&&!r.classList.contains("module-readtime"))return;let i=[],l=[];for(let t=e.querySelectorAll("[data-rtid]"),r=t.length-1;r>-1;--r){let e=t[r].dataset.rtid;e&&!_.has(e)&&(_.add(e),i.push(e))}if(i.length){i=[...new Set(i)];for(let _=1,r=10,d=Math.ceil(i.length/r);_<=d;++_)l.push(t.fetch({action:"tbp_readtime_calculate",ids:i.slice((_-1)*r,_*r)}).then((t=>{if(t.success)for(let _ in t.data){const r=e.querySelectorAll('[data-rtid="'+_+'"]'),d=t.data[_];for(let t=r.length-1;t>-1;--t){let _=r[t];if(d<=1)_.tfClass("tbp_rd_tm_b")[0]?.remove(),_.tfClass("tbp_rd_tm_a")[0]?.remove();else{let t=e.createElement("span"),r=_.tfClass("tbp_rd_tm_b")[0]||_.tfClass("tbp_rd_tm_a")[0];t.textContent=d,_.tfClass("tbp_rd_tm_less")[0]?.remove(),r?r.classList.contains("tbp_rd_tm_b")?r.after(t):r.before(t):_.appendChild(t)}_.classList.remove("tf_hide"),_.dataset.rtid=""}}})));Promise.all(l).finally((()=>{_.clear()}))}}))})(Themify,document);