javascript:!function(){if("www.amazon.it"!==window.location.hostname)return void alert("Questo bookmark funziona solo su amazon.it");async function e(){try{let e=localStorage.getItem("clickedEmail");e?localStorage.removeItem("clickedEmail"):e=await l(),await async function(e){try{const o=await Promise.all(a.map(s)),n=await t();c(e,o,n)}catch(e){}}(e),p()}catch(e){}}async function t(){try{const e=await fetch("https://www.amazon.it/gp/cart/view.html"),t=await e.text(),a=(new DOMParser).parseFromString(t,"text/html"),o=a.getElementById("maple-banner__text")?.innerText.trim().split("\n")?.at(1);return{isEligible:!!o,description:o||"Nessuna offerta del carrello disponibile"}}catch{return{isEligible:!1,description:"Errore nel controllo del banner del carrello"}}}document.body.addEventListener("click",(function(t){const a=t.target.closest('a[data-name="switch_account_request"]');if(a){t.preventDefault(),t.stopPropagation();const n=document.querySelector('input[name="CsrfToken"]').value,i=a.getAttribute("data-value"),r=a.textContent.match(/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b/),l=r?r[0].toLowerCase():null;let s="";(o={CsrfToken:n,switch_account_request:i},fetch("https://www.amazon.it/ap/switchaccount",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(o),credentials:"include",redirect:"manual"}).then((e=>e.json())).catch((()=>{}))).then((e=>(e.redirectUrl&&e.redirectUrl.includes("signin")&&(s=e.redirectUrl),fetch("https://www.amazon.it/ax/account/manage")))).then((e=>e.url.includes("signin")?(window.open(s||e.url,"_blank"),null):e.text())).then((t=>{null!==t&&((new DOMParser).parseFromString(t,"text/html").querySelector("#a-page > div.a-container").innerText.match(/ModificaE-mail\s*(.*?)\s*ModificaNumero/)[1].trim().toLowerCase()===l?(localStorage.setItem("clickedEmail",l),e()):s&&window.open(s,"_blank"))}))}var o}),!0);const a=["c7e3cd4b-6645-4e0f-acf8-9d1e4016e959","e03ab188-5219-48be-8bae-4967ee09df13","d06aa3a3-d2e6-41d5-a1c2-d7c0768ba7c3","cb3eab28-e1b5-46e5-9031-36c79f6a9405"],o=(e,t)=>Object.assign(document.createElement(e),t);let n=!1,i=null;const r=(e,t=!1)=>{const a=document.getElementById("amazon-offers-results")||o("div",{id:"amazon-offers-results",style:"position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);background:white;padding:20px;border-radius:10px;box-shadow:0 0 10px rgba(0,0,0,0.5);z-index:10000;max-width:90%;width:350px;max-height:90vh;font-family:Arial,sans-serif;display:flex;flex-direction:column;"});if(a.innerHTML=`<div style="flex:1;overflow-y:auto;margin-bottom:15px;">${e}</div>`,!t){const e=o("div",{style:"display:flex;flex-wrap:wrap;justify-content:space-between;padding-top:15px;border-top:1px solid #e0e0e0;"}),t=(e,t)=>o("button",{textContent:e,style:"padding:10px;background-color:#f0f0f0;border:none;border-radius:5px;cursor:pointer;font-size:16px;color:#333;flex:1 0 calc(33.33% - 10px);margin:5px;",onclick:t});e.append(t("Chiudi",(()=>{document.body.removeChild(a),n=!1,i&&(window.removeEventListener("focus",i),i=null)})),t("Cambia account",(()=>{n=!1,i&&(window.removeEventListener("focus",i),i=null),window.location.href=`https://www.amazon.it/ap/signin?openid.pape.max_auth_age=0&openid.identity=http://specs.openid.net/auth/2.0/identifier_select&openid.assoc_handle=anywhere_v2_it&openid.mode=checkid_setup&openid.claimed_id=http://specs.openid.net/auth/2.0/identifier_select&openid.ns=http://specs.openid.net/auth/2.0&switch_account=picker&ignoreAuthState=1&_encoding=UTF8&forceReload=${Date.now()}`})),t("Cancella dati",(()=>{localStorage.removeItem("amazonGeneralOfferData"),localStorage.removeItem("amazonEmailOfferData"),alert("Tutti i dati memorizzati sono stati cancellati.")}))),a.appendChild(e)}document.body.appendChild(a)},l=async()=>{try{const e=await fetch("https://www.amazon.it/ax/account/manage");if(e.url.includes("signin"))return window.location.pathname.includes("/ap/signin")||(window.location.href=e.url),null;const t=await e.text();return(new DOMParser).parseFromString(t,"text/html").querySelector("#a-page > div.a-container").innerText.match(/ModificaE-mail\s*(.*?)\s*ModificaNumero/)[1].trim()||"Email non trovata"}catch{return"Errore nel recupero dell'email"}},s=async e=>{const t=await(async e=>{const t=await fetch(e);return(new DOMParser).parseFromString(await t.text(),"text/html")})(`https://www.amazon.it/yourpromotions/${e}`),a=t.querySelector("button#nslp-ajax-button-announce"),o=t.querySelector(".a-box.a-alert.a-alert-success"),n=t.querySelector('[class^="nudge_info_header"]');return{url:e,description:n?.innerText.trim()||"Offerta senza descrizione",isEligible:"Applica promozione"===a?.textContent.trim()&&!a.disabled||o?.innerText.toLowerCase().includes("congratulazioni"),details:o?o.innerText.trim():""}},c=(e,t,a)=>{let o=JSON.parse(localStorage.getItem("amazonGeneralOfferData")||"{}"),n=JSON.parse(localStorage.getItem("amazonEmailOfferData")||"{}");t.forEach(((e,t)=>{o[t+1]={url:e.url,description:e.description}})),n[e]={offerEligibility:t.map((e=>e.isEligible)),offerDetails:t.map((e=>e.details)),cartBanner:a,timestamp:Date.now()},localStorage.setItem("amazonGeneralOfferData",JSON.stringify(o)),localStorage.setItem("amazonEmailOfferData",JSON.stringify(n))},d=e=>{const t=new Date,a=new Date(e),o=t.getDate()-a.getDate(),n=t.getMonth()-a.getMonth(),i=t.getFullYear()-a.getFullYear();return 0===i&&0===n&&0===o?"Oggi":0===i&&0===n&&1===o?"Ieri":o<=7?"Meno di una settimana fa":o<=30?"Più di una settimana fa":"Oltre un mese fa"},p=()=>{document.querySelectorAll("span[data-email-processed]").forEach((e=>{e.outerHTML=e.textContent.split(" ")[0].toLocaleLowerCase()}));const e=/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b/g,t=JSON.parse(localStorage.getItem("amazonGeneralOfferData")||"{}"),a=JSON.parse(localStorage.getItem("amazonEmailOfferData")||"{}"),n=i=>{if(i.nodeType===Node.TEXT_NODE&&e.test(i.textContent)){const n=document.createDocumentFragment();let r=0;i.textContent.replace(e,(function(e,l){n.appendChild(document.createTextNode(i.textContent.slice(r,l)));const s=document.createElement("span");s.textContent=e,s.setAttribute("data-email-processed","true");const c=a[e];if(c){const e=c.offerEligibility.map(((e,a)=>e?t[a+1]?.description:"")).filter(Boolean);if(e.length>0){s.textContent+=" ✓",s.style.color="green";const t=o("ul",{innerHTML:e.map((e=>`<li>${e}</li>`)).join("")+`<li style="list-style-type:none;font-style:italic;margin-top:5px;">(Ultimo controllo: ${d(c.timestamp)})</li>`,style:"font-size:0.9em;color:#333;margin-top:5px;list-style-type:disc;padding-left:20px;word-wrap:break-word;white-space:normal;overflow-wrap:break-word;"});t.querySelectorAll("li").forEach((e=>{e.style.wordWrap="break-word",e.style.whiteSpace="normal",e.style.overflowWrap="break-word"})),s.appendChild(t)}else{s.textContent+=" ✗",s.style.color="red";const e=o("ul",{innerHTML:`<li style="list-style-type:none;font-style:italic;">(Ultimo controllo: ${d(c.timestamp)})</li>`,style:"font-size:0.9em;color:#666;margin-top:5px;list-style-type:disc;padding-left:20px;word-wrap:break-word;white-space:normal;overflow-wrap:break-word;"});s.appendChild(e)}}n.appendChild(s),r=l+e.length})),n.appendChild(document.createTextNode(i.textContent.slice(r))),i.parentNode.replaceChild(n,i)}else i.nodeType===Node.ELEMENT_NODE&&Array.from(i.childNodes).forEach(n)};n(document.body)};(async()=>{try{if(window.location.pathname.includes("/ap/signin"))return n=!0,p(),void(i||(i=()=>{n&&p()},window.addEventListener("focus",i)));const e=await l();if(null===e)return;r('<div style="display:flex;justify-content:center;align-items:center;height:100px;"><div style="width:50px;height:50px;border:5px solid #f3f3f3;border-top:5px solid #3498db;border-radius:50%;animation:spin 1s linear infinite;"></div></div><style>@keyframes spin{0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}}</style>',!0);let o=localStorage.getItem("clickedEmail");o?localStorage.removeItem("clickedEmail"):o=e;const d=await Promise.all(a.map(s)),m=await t();c(o,d,m),r(((e,t,a)=>`<h2 style="margin-top:0;color:#333;">Risultati Offerte Amazon</h2><p style="margin-bottom:15px;word-break:break-word;">Email: ${e}</p>${t.map((e=>(e=>`<a href="https://www.amazon.it/yourpromotions/${e.url}" target="_blank" style="color:${e.isEligible?"green":"red"};text-decoration:none;display:block;margin-bottom:10px;word-break:break-word;">${e.isEligible?"Sei idoneo":"Non sei idoneo"} per l'offerta: ${e.description}${e.details?`<br><span style="font-size:0.9em;color:#666;">${e.details}</span>`:""}</a>`)(e))).join("")}<a href="https://www.amazon.it/gp/cart/view.html" target="_blank" style="color:${a.isEligible?"green":"red"};text-decoration:none;display:block;margin-bottom:10px;word-break:break-word;">${a.isEligible?"Sei idoneo per l'offerta del carrello":"Non sei idoneo per l'offerta del carrello"}${a.isEligible?`: ${a.description}`:""}</a>`)(o,d,m))}catch(e){r(`<h2 style="margin-top:0;color:#333;">Errore</h2><p>Errore generale: ${e.message}</p>`)}})()}(); fix this code by adding in the page signups section the check even for the cart offer.. add this as the other offert at the bullet point list already existing