1let loadCookieRetries=0;const MAX_COOKIE_RETRIES=50;export function loadCookie(){var _a,_b,_c;if(typeof((_a=window.Shopify)===null||_a===void 0?void 0:_a.loadFeatures)!="function"){if(loadCookieRetries++,loadCookieRetries>=MAX_COOKIE_RETRIES){(_c=(_b=window.LOG)===null||_b===void 0?void 0:_b.warn)===null||_c===void 0||_c.call(_b,"[Wishlist] Shopify.loadFeatures non disponibile dopo 5s, cookie consent non impostato");return}setTimeout(loadCookie,100);return}window.Shopify.loadFeatures([{name:"consent-tracking-api",version:"0.1"}],error=>{var _a2,_b2,_c2;if(error){(_b2=(_a2=window.LOG)===null||_a2===void 0?void 0:_a2.error)===null||_b2===void 0||_b2.call(_a2,"[Wishlist] Errore nel caricamento delle funzionalit\xE0 di Shopify:",error);return}(_c2=window.Shopify.customerPrivacy)===null||_c2===void 0||_c2.setTrackingConsent({analytics:!0,marketing:!0,preferences:!0,sale_of_data:!0},()=>{var _a3,_b3;return(_b3=(_a3=window.LOG)===null||_a3===void 0?void 0:_a3.success)===null||_b3===void 0?void 0:_b3.call(_a3,"[Wishlist] Consent captured")})})}export function loadWishlist(){var _a,_b,_c,_d;typeof window._swat>"u"?(window.SwymCallbacks||(window.SwymCallbacks=[]),window.SwymCallbacks.push(checkWishlist),(_b=(_a=window.LOG)===null||_a===void 0?void 0:_a.info)===null||_b===void 0||_b.call(_a,"[Wishlist] Swym non ancora caricato, checkWishlist messo in coda (queue length:",window.SwymCallbacks.length,")")):((_d=(_c=window.LOG)===null||_c===void 0?void 0:_c.info)===null||_d===void 0||_d.call(_c,"[Wishlist] Swym gi\xE0 disponibile, esecuzione immediata"),checkWishlist())}export function checkWishlist(){var _a,_b,_c,_d,_e,_f,_g;try{if(typeof((_a=window._swat)===null||_a===void 0?void 0:_a.fetchLists)!="function"){(_c=(_b=window.LOG)===null||_b===void 0?void 0:_b.warn)===null||_c===void 0||_c.call(_b,"[Wishlist] Swym SDK non disponibile, wishlist disabilitata");return}(_e=(_d=window.LOG)===null||_d===void 0?void 0:_d.debug)===null||_e===void 0||_e.call(_d,"[Wishlist] \u2192 fetchLists chiamato"),window._swat.fetchLists({callbackFn:lists=>{var _a2,_b2,_c2,_d2,_e2,_f2,_g2,_h,_j,_k,_l,_m,_o;if((_b2=(_a2=window.LOG)===null||_a2===void 0?void 0:_a2.debug)===null||_b2===void 0||_b2.call(_a2,"[Wishlist] \u2190 fetchLists risposta raw:",JSON.stringify(lists)),(_d2=(_c2=window.LOG)===null||_c2===void 0?void 0:_c2.debug)===null||_d2===void 0||_d2.call(_c2,"[Wishlist] liste trovate:",(_e2=lists?.length)!==null&&_e2!==void 0?_e2:0),!lists||lists.length===0){(_g2=(_f2=window.LOG)===null||_f2===void 0?void 0:_f2.info)===null||_g2===void 0||_g2.call(_f2,"[Wishlist] nessuna lista trovata \u2192 createList"),createList(
1);return}(_j=(_h=window.LOG)===null||_h===void 0?void 0:_h.debug)===null||_j===void 0||_j.call(_h,"[Wishlist] lista selezionata [0]: lid=",lists[0].lid,"lname=",lists[0].lname,"items=",(_l=(_k=lists[0].listcontents)===null||_k===void 0?void 0:_k.length)!==null&&_l!==void 0?_l:0),window.themeWishlist=lists[0],(_o=(_m=window.LOG)===null||_m===void 0?void 0:_m.success)===null||_o===void 0||_o.call(_m,"[Wishlist] Wishlist caricata:",window.themeWishlist),window.dispatchEvent(new CustomEvent("theme:wishlist:loaded"))},errorFn:err=>{var _a2,_b2;return(_b2=(_a2=window.LOG)===null||_a2===void 0?void 0:_a2.error)===null||_b2===void 0?void 0:_b2.call(_a2,"[Wishlist] \u2190 fetchLists errore:",err)}})}catch(error){(_g=(_f=window.LOG)===null||_f===void 0?void 0:_f.error)===null||_g===void 0||_g.call(_f,"[Wishlist] Errore critico in checkWishlist:",error)}}export function createList(){var _a,_b,_c,_d,_e,_f,_g;try{if(typeof((_a=window._swat)===null||_a===void 0?void 0:_a.createList)!="function"){(_c=(_b=window.LOG)===null||_b===void 0?void 0:_b.warn)===null||_c===void 0||_c.call(_b,"[Wishlist] Swym SDK non disponibile per createList");return}(_e=(_d=window.LOG)===null||_d===void 0?void 0:_d.debug)===null||_e===void 0||_e.call(_d,'[Wishlist] \u2192 createList chiamato (lname: "Wishlist")'),window._swat.createList({lname:"Wishlist"},newList=>{var _a2,_b2,_c2,_d2,_e2,_f2,_g2,_h,_j,_k;(_b2=(_a2=window.LOG)===null||_a2===void 0?void 0:_a2.debug)===null||_b2===void 0||_b2.call(_a2,"[Wishlist] \u2190 createList risposta raw:",JSON.stringify(newList)),(_d2=(_c2=window.LOG)===null||_c2===void 0?void 0:_c2.debug)===null||_d2===void 0||_d2.call(_c2,"[Wishlist] lid:",newList?.lid),(_f2=(_e2=window.LOG)===null||_e2===void 0?void 0:_e2.debug)===null||_f2===void 0||_f2.call(_e2,"[Wishlist] di (device identifier):",newList?.di),(_h=(_g2=window.LOG)===null||_g2===void 0?void 0:_g2.debug)===null||_h===void 0||_h.call(_g2,"[Wishlist] userinfo (loggato?):",newList?.userinfo),window.themeWishlist=newList,(_k=(_j=window.LOG)===null||_j===void 0?void 0:_j.success)===null||_k===void 0||_k.call(_j,"[Wishlist] Wishlist creata e salvata in themeWishlist"),window.dispatchEvent(new CustomEvent("theme:wishlist:loaded"))},err=>{var _a2,_b2;return(_b2=(_a2=window.LOG)===null||_a2===void 0?void 0:_a2.error)===null||_b2===void 0?void 0:_b2.call(_a2,"[Wishlist] \u2190 createList errore:",err)})}catch(error){(_g=(_f=window.LOG)===null||_f===void 0?void 0:_f.error)===null||_g===void 0||_g.call(_f,"[Wishlist] Errore critico in createList:",error)}}export function addToWishlist(product,onSuccess,onError){var _a,_b,_c,_d,_e,_f,_g,_h,_j,_k;try{if(typeof((_a=window._swat)===null||_a===void 0?void 0:_a.addToList)!="function"){const error=new Error("Swym SDK non disponibile");(_c=(_b=window.LOG)===null||_b===void 0?void 0:_b.error)===null||_c===void 0||_c.call(_b,"[Wishlist] addToWishlist fallito:",error),onError(error);return}if(!(!((_d=window.themeWishlist)===null||_d===void 0)&&_d.lid)){const error=new Error("Wishlist non caricata");(_f=(_e=window.LOG)===null||_e===void 0?void 0:_e.error)===null||_f===void 0||_f.call(_e,"[Wishlist] addToWishlist fallito:",error),onError(error);return}(_h=(_g=window.LOG)===null||_g===void 0?void 0:_g.debug)===null||_h===void 0||_h.call(_g,"[Wishlist] \u2192 addToList chiamato: lid=",window.themeWishlist.lid,"product=",JSON.stringify(product)),window._swat.addToList(window.themeWishlist.lid,product,data=>{var _a2,_b2;(_b2=(_a2=window.LOG)===null||_a2===void 0?void 0:_a2.debug)===null||_b2===void 0||_b2.call(_a2,"[Wishlist] \u2190 addToList risposta raw:",JSON.stringify(data)),window.dispatchEvent(new CustomEvent("theme:wishlist:added",{detail:data})),onSuccess(data)},err=>{var _a2,_b2;(_b2=(_a2=window.LOG)===null||_a2===void 0?void 0:_a2.error)===null||_b2===void 0||_b2.call(_a2,"[Wishlist] \u2190 addToList errore:",err),onError(err)})}catch(error){(_k=(_j=window.LOG)===null||_j===void 0?void 0:_j.error)===null||_k===void 0||_k.call(_j,"[Wishlist] Errore critico in addToWishlist:",error),onError(error)}}export function removeFromWishlist(product,onSuccess,onError){var _a,_b,_c,_d,_e,_f,_g,_h,_j,_k;try{if(typeof((_a=window._swat)===null||_a===void 0?void 0:_a.deleteFromList)!="function"){const error=new Error("Swym SDK non disponibile");(_c=(_b=window.LOG)===null||_b===void 0?void 0:_b.error)===null||_c===void 0||_c.call(_b,"[Wishlist] removeFromWishlist fallito:",error),onError(error);return}if(!(!((_d=window.themeWishlist)===null||_d===void 0)&&_d.lid)){const error=new Error("Wishlist non caricata");(_f=(_e=window.LOG)===null||_e===void 0?void 0:_e.error)===null||_f===void 0||_f.call(_e,"[Wishlist] removeFromWishlist fallito:",error),onError(error);return}(_h=(_g=window.LOG)===null||_g===void 0?void 0:_g.debug)===null||_h===void 0||_h.call(_g,"[Wishlist] \u2192 deleteFromList chiamato: lid=",window.themeWishlist.lid,"product=",JSON.stringify(product)),window._swat.deleteFromList(window.themeWishlist.lid,product,data=>{var _a2,_b2;(_b2=(_a2=window.LOG)===null||_a2===void 0?void 0:_a2.debug)===null||_b2===void 0||_b2.call(_a2,"[Wishlist] \u2190 deleteFromList risposta raw:",JSON.stringify(data)),window.dispatchEvent(new CustomEvent("theme:wishlist:removed",{detail:data})),onSuccess(data)},err=>{var _a2,_b2;(_b2=(_a2=window.LOG)===null||_a2===void 0?void 0:_a2.error)===null||_b2===void 0||_b2.call(_a2,"[Wishlist] \u2190 deleteFromList errore:",err),onError(err)})}catch(error){(_k=(_j=window.LOG)===null||_j===void 0?void 0:_j.error)===null||_k===void 0||_k.call(_j,"[Wishlist] Errore critico in removeFromWishlist:",error),onError(error)}}export function isInWishlist(product){return!window.themeWishlist||!window.themeWishlist.listcontents?!1:window.themeWishlist.listcontents.some(item=>item.epi==product.epi)}export function toggleWishlistItem(product,onSuccess,onError){var _a,_b;const action=isInWishlist(product)?"remove":"add";(_b=(_a=window.LOG)===null||_a===void 0?void 0:_a.debug)===null||_b===void 0||_b.call(_a,"[Wishlist] toggleWishlistItem: epi=",product.epi,"azione=",action),action==="remove"?removeFromWishlist(product,onSuccess,onError):addToWishlist(product,onSuccess,onError)}loadCookie(),loadWishlist(); 2//# sourceMappingURL=/cdn/shop/t/3/assets/wishlist.js.map?v=65137970953256557711784021290
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.