1import{p as t}from"./bluetti.pubsub.CgmIXzsp.min.js";class e extends window.HTMLElement{get adsProducts(){return this.querySelectorAll("[data-handle]")}get anchorPoints(){return this.querySelectorAll("h2")}get articleId(){return this.getAttribute("article-id")}constructor(){super(),this.isOpen=!1,t("article-content-generated",{anchorPoints:this.anchorPoints}),this.updateContentPoints(),this.updateiframe(),this.updateTable(),this.adsProductsTemplate=this.updateAdsProducts()}async updateAdsProducts(){const t=Array.from(this.adsProducts).map(async t=>{const e=t.dataset.handle,{articleProduct:r,articleProducItemt:a}=await this.getProduct(e);if(!r)return t.remove(),null;const o=t=>t.replaceAll("utm_campaign=",`utm_campaign=${this.articleId}`),i=o(r),c=o(a);return t.innerHTML=i,{productTemplate:i,productItemTemplate:c}});return(await Promise.all(t)).filter(t=>null!==t)}updateContentPoints(){this.anchorPoints.forEach((t,e)=>t.setAttribute("id",`anchor-point-${e}`))}updateiframe(){this.querySelectorAll("iframe").forEach(t=>{t.removeAttribute("width"),t.removeAttribute("height")})}updateTable(){const t=this.querySelectorAll("table");t.forEach(t=>t.outerHTML=`<div class="w-[calc(100vw-2rem)] lg:w-auto border border-neutral-400 overflow-hidden rounded-2xl"><div class="overflow-x-auto">${t.outerHTML}</div></div>`)}async getProduct(t){try{const e=await fetch(`/products/${t}?view=ads`);if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);const r=await e.text(),a=document.createElement("div");a.innerHTML=r;const o=a.querySelector(".b-article-product"),i=a.querySelector(".js-article-item");return{articleProduct:o?o.outerHTML:"",articleProducItemt:i?i.outerHTML:""}}catch(e){return""}}}window.customElements.define("bluetti-article-content",e);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.