PageSourceSearch

https://islamicwallartstore.com/cdn/shop/t/98/assets/cst_blog.js?v=20459532417723593251791392567

js islamicwallartstore.com collected 2026-10-07 23:51:11 UTC 5,440 bytes, 2 lines download raw bytes

1class ArticleToc extends HTMLElement{#observer=null;#onOffset=null;connectedCallback(){const body=document.querySelector(this.dataset.body||"");if(!body)return;const headings=[...body.querySelectorAll("h2")];if(headings.length<2)return;const lists=this.querySelectorAll("[data-toc-list]");if(!lists.length)return;const used=new Set,entries=[];for(const heading of headings){const id=heading.id||ArticleToc.#uniqueSlug(heading.textContent,used);used.add(id),heading.id=id,entries.push({id,text:heading.textContent.trim(),heading})}for(const list of lists){const fragment=document.createDocumentFragment();for(const entry of entries){const item=document.createElement("li");item.className="article-toc__item";const link=document.createElement("a");link.className="article-toc__link",link.href=`#${entry.id}`,link.textContent=entry.text,link.dataset.tocFor=entry.id,item.append(link),fragment.append(item)}list.replaceChildren(fragment)}this.hidden=!1,this.#spy(entries),this.#onOffset=()=>this.#spy(entries),document.addEventListener("blog:anchor-offset",this.#onOffset)}disconnectedCallback(){this.#observer?.disconnect(),document.removeEventListener("blog:anchor-offset",this.#onOffset)}#spy(entries){if(!("IntersectionObserver"in window))return;this.#observer?.disconnect();const offset=parseInt(getComputedStyle(document.documentElement).scrollPaddingBlockStart,10),top=Number.isFinite(offset)?offset:96;this.#observer=new IntersectionObserver(records=>{for(const record of records)record.isIntersecting&&this.#setCurrent(record.target.id)},{rootMargin:`-${top}px 0px -70% 0px`,threshold:0});for(const entry of entries)this.#observer.observe(entry.heading)}#setCurrent(id){for(const link of this.querySelectorAll("[data-toc-for]"))link.setAttribute("aria-current",String(link.dataset.tocFor===id))}static#uniqueSlug(text,used){const base=text.trim().toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-z0-9\u0600-\u06ff]+/g,"-").replace(/^-+|-+$/g,"").slice(0,60)||"section";if(!used.has(base))return base;let n=2;for(;used.has(`${base}-${n}`);)n+=1;return`${base}-${n}`}}class BlogLoadMore extends HTMLElement{#controller=null;connectedCallback(){this.button=this.querySelector("[data-loadmore-button]"),this.counter=this.querySelector("[data-loadmore-count]"),this.grid=document.querySelector(this.dataset.grid||""),!(!this.button||!this.grid)&&(this.next=this.dataset.next||"",this.total=Number(this.dataset.total||0),this.button.addEventListener("click",this.#load.bind(this)),this.#updateCount())}disconnectedCallback(){this.#controller?.abort()}async#load(event){if(event.preventDefault(),!!this.next){this.button.disabled=!0,this.button.setAttribute("aria-busy","true"),this.#controller?.abort(),this.#controller=new AbortController;try{const response=await fetch(this.next,{signal:this.#controller.signal});if(!response.ok)throw new Error(`HTTP ${response.status}`);const markup=await response.text(),doc=new DOMParser().parseFromString(markup,"text/html"),incoming=doc.querySelectorAll("[data-blog-card]");if(incoming.length){const firstNew=incoming[0];this.grid.append(...incoming),firstNew.querySelector("a")?.setAttribute("tabindex","-1"),firstNew.querySelector("a")?.focus({preventScroll:!0})}const nextLink=doc.querySelector("[data-loadmore-root]")?.dataset.next||"";this.next=nextLink,this.dataset.next=nextLink,this.#updateCount(),nextLink||(this.hidden=!0)}catch(error){if(error.name==="AbortError")return;window.location.assign(this.next)}finally{this.button.disabled=!1,this.button.removeAttribute("aria-busy")}}}#updateCount(){if(!this.counter)return;const shown=this.grid.querySelectorAll("[data-blog-card]").length,template=this.counter.dataset.template||"Showing [shown] of [total]";this.counter.textContent=template.replace("[shown]",String(shown)).replace("[total]",String(this.total))}}function enhanceArticleTables(){const bodies=document.querySelectorAll(".article-body");if(bodies.length)for(const body of bodies)for(const wrapper of body.querySelectorAll(".table-wrapper")){const sync=()=>{if(wrapper.scrollWidth>wrapper.clientWidth+1){if(wrapper.setAttribute("tabindex","0"),wrapper.setAttribute("role","regi
1on"),!wrapper.hasAttribute("aria-label")){const caption=wrapper.querySelector("caption")?.textContent?.trim();wrapper.setAttribute("aria-label",caption||"Table, scrollable")}}else wrapper.removeAttribute("tabindex"),wrapper.removeAttribute("role")};sync(),"ResizeObserver"in window&&new ResizeObserver(sync).observe(wrapper)}}function syncHeaderOffset(){const header=document.getElementById("SiteHeader");if(!header||header.dataset.sticky!=="true")return;let current=0;const update=()=>{const next=Math.ceil(header.getBoundingClientRect().height)+16;next!==current&&(current=next,document.documentElement.style.setProperty("--blog-anchor-offset",`${next}px`),document.dispatchEvent(new CustomEvent("blog:anchor-offset")))};update(),"ResizeObserver"in window&&new ResizeObserver(update).observe(header,{box:"border-box"})}syncHeaderOffset(),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>requestAnimationFrame(enhanceArticleTables)):requestAnimationFrame(enhanceArticleTables),customElements.get("article-toc")||customElements.define("article-toc",ArticleToc),customElements.get("blog-load-more")||customElements.define("blog-load-more",BlogLoadMore);
2//# sourceMappingURL=/cdn/shop/t/98/assets/cst_blog.js.map?v=20459532417723593251791392567

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.