PageSourceSearch

https://mascolori.eu/cdn/shop/t/62/assets/mascolori-product-reviews-schema.js?v=167238626849163746011791557758

js mascolori.eu collected 2026-10-09 22:40:34 UTC 2,514 bytes, 2 lines download raw bytes

1(()=>{const start=()=>{const schemaElement=document.getElementById("mascolori-product-jsonld");if(!schemaElement)return;let base;try{base=JSON.parse(schemaElement.textContent)}catch{return}if(base["@type"]!=="Product")return;const productId=schemaElement.dataset.productId,root=Array.from(document.querySelectorAll(".yotpo-widget-instance[data-yotpo-prevent-load-rs]")).find(element=>element.dataset.yotpoProductId===productId);if(!root||root.dataset.yotpoPreventLoadRs!=="true")return;const text=(element,selector)=>element.querySelector(selector)?.textContent.trim()||"",number=value=>Number(value.replace(",","."));let scheduled=!1;const update=()=>{scheduled=!1;const widget=root.querySelector("#yotpo-reviews-main-widget");if(!widget)return;const score=number(text(widget,".yotpo-bottom-line-score")),countMatch=text(widget,".yotpo-bottom-line-basic-text").match(/\d[\d.,\s]*/g);if(!countMatch||countMatch.length!==1)return;const count=Number(countMatch[0].replace(/\D/g,""));if(!Number.isFinite(score)||score<1||score>5||!Number.isSafeInteger(count)||count<1)return;const reviews=Array.from(widget.querySelectorAll(".yotpo-reviews-list .yotpo-review")).slice(0,10).flatMap(element=>{const author=text(element,".yotpo-reviewer-name-text"),body=text(element,".yotpo-review-content .yotpo-read-more-text"),title=text(element,".yotpo-review-title"),ratingMatch=(element.querySelector(".yotpo-review-star-rating")?.getAttribute("aria-label")||"").match(/^\s*([1-5](?:[.,]\d+)?)\b/),rating=ratingMatch?number(ratingMatch[1]):NaN;return!author||author.length>=100||!body||!Number.isFinite(rating)||rating<1||rating>5?[]:[{"@type":"Review",author:{"@type":"Person",name:author},...title?{name:title}:{},reviewBody:body,reviewRating:{"@type":"Rating",ratingValue:rating,bestRating:5,worstRating:1}}]}),data={...base,aggregateRating:{"@type":"AggregateRating",ratingValue:score,reviewCount:count,bestRating:5,worstRating:1},...reviews.length?{review:reviews}:{}},serialized=JSON.stringify(data).replace(/</g,"\\u003c");schemaElement.textContent!==serialized&&(schemaElement.textContent=serialized)};new MutationObserver(()=>{scheduled||(scheduled=!0,requestAnimationFrame(update))}).observe(root,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["aria-label"]}),update()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",start,{once:!0}):start()})();
2//# sourceMappingURL=/cdn/shop/t/62/assets/mascolori-product-reviews-schema.js.map?v=167238626849163746011791557758

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.