1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5744],{1465:(t,e,a)=>{"use strict";a.d(e,{Kk:()=>n,WF:()=>d,ad:()=>c,nY:()=>u,pW:()=>s,pp:()=>i});var r=a(95212);function n(t){let e=Object.values(t??{}).map(t=>t.price);return e.length?Math.min(...e):null}function i(t){let e=Object.entries(t??{});if(0===e.length)return null;let[a,r]=e.reduce((t,e)=>e[1].price<t[1].price?e:t);return{price:r.price,platform:a}}let o={pc:"PC",ps5:"PS5",ps4:"PS4",xbox:"Xbox",switch:"Switch",switch2:"Switch 2"};function s(t){return o[t]??t.toUpperCase()}function l(t,e=1,a=7){return`/api/games?q=${encodeURIComponent(t.trim())}&page=${e}&per_page=${a}`}function c(t){return t.trim().length>=2}function u(t){return`/game/${encodeURIComponent(t).replace(/%2F/g,"-")}`}function d(){let[t,e]=(0,r.useState)(""),[a,n]=(0,r.useState)([]),[i,o]=(0,r.useState)(!1),[s,u]=(0,r.useState)(!1),[d,p]=(0,r.useState)(0),[f,m]=(0,r.useState)(1),[g,h]=(0,r.useState)(-1),v=(0,r.useRef)(null),y=(0,r.useRef)(null),b=(0,r.useRef)(null),x=(0,r.useCallback)(t=>{if(e(t),h(-1),b.current&&clearTimeout(b.current),!c(t)){v.current?.abort(),y.current?.abort(),n([]),p(0),m(1),o(!1),u(!1);return}b.current=setTimeout(async()=>{v.current?.abort(),y.current?.abort();let e=new AbortController;v.current=e,o(!0);try{let a=await fetch(l(t,1,7),{signal:e.signal,headers:{"X-Rynko-Client":"web-app"}}),r=await a.json(),i=r.items??[];n(i),p("number"==typeof r.total?r.total:i.length),m(1)}catch{}finally{o(!1)}},220)},[]),w=(0,r.useCallback)(async()=>{if(i||s||!c(t))return;let e=f+1,a=new AbortController;y.current=a,u(!0);try{let r=await fetch(l(t,e,7),{signal:a.signal,headers:{"X-Rynko-Client":"web-app"}}),i=await r.json(),o=i.items??[];o.length>0&&(n(t=>{let e=new Set(t.map(t=>t.id)),a=o.filter(t=>!e.has(t.id));return[...t,...a]}),m(e)),"number"==typeof i.total&&p(i.total)}catch{}finally{u(!1)}},[i,s,f,t]),_=(0,r.useCallback)(t=>h(e=>{var r;return r=a.length,r<=0?-1:"giu"===t?(e+1)%r:(e-1+r)%r}),[a.length]),S=(0,r.useCallback)(()=>{b.current&&clearTimeout(b.current),v.current?.abort(),y.current?.abort(),e(""),n([]),p(0),m(1),h(-1),o(!1),u(!1)},[]);(0,r.useEffect)(()=>()=>{b.current&&clearTimeout(b.current),v.current?.abort(),y.current?.abort()},[]);let E=a.length<d;return{query:t,results:a,loading:i,loadingMore:s,hasMore:E,total:d,highlight:g,cerca:x,caricaAltri:w,muoviEvidenziato:_,azzera:S}}},1497:()=>{},3554:(t,e,a)=>{"use strict";a.d(e,{Ej:()=>i,fM:()=>l,iI:()=>o,lC:()=>s});var r=a(6739);async function n(){return{"Content-Type":"application/json"}}async function i(){if(!(0,r.pN)())return[];let t=await fetch("/api/auth/wishlist",{cache:"no-store"});if(!t.ok)return[];let e=await t.json();return Array.isArray(e)?e:[]}async function o(t,e){let a=await n(),r=await fetch("/api/auth/wishlist",{method:"POST",headers:a,body:JSON.stringify({game_id:t,target_price:e??null})});if(!r.ok)throw Error((await r.json().catch(()=>({}))).detail||"Impossibile aggiungere alla wishlist")}async function s(t){let e=await n(),a=await fetch(`/api/auth/wishlist/${encodeURIComponent(t)}`,{method:"DELETE",headers:e});if(!a.ok)throw Error((await a.json().catch(()=>({}))).detail||"Impossibile rimuovere dalla wishlist")}async function l(t){let e=await n(),a=await fetch("/api/auth/wishlist/import-steam",{method:"POST",headers:e,body:JSON.stringify({steam_id:t.trim()})}),r=await a.json().catch(()=>({}));if(!a.ok){let t=r.detail;throw Error("string"==typeof t?t:"Import Steam fallito")}return r}},6739:(t,e,a)=>{"use strict";a.d(e,{M3:()=>o,S$:()=>s,Tt:()=>l,Ub:()=>d,cm:()=>c,fS:()=>u,lJ:()=>f,pN:()=>i,yH:()=>p});let r="rynko_auth",n="rynko_local_radars";function i(){try{let t=localStorage.getItem(r);if(!t)return null;let e=JSON.parse(t),a=Object.prototype.hasOwnProperty.call(e,"access_token"),{access_token:n,...i}=e;return a&&localStorage.setItem(r,JSON.stringify(i)),"number"==typeof i.user_id&&Number.isFinite(i.user_id)?i:null}catch{return null}}function o(){return!!i()}function s(t,e){return`${t}::${e??"any"}`}function l(){try{let t=localStorage.getItem(n);if(!t)return[];let e=JSON.parse(t);if(!Array.isArray(e))return[];let a=Date.now()-2592e6,r=e.filter(t=>{if(!t.pending)return!0;let e=Date.parse(t.createdAt);return Number.isFinite(e)&&e>a});return r.length!==e.length&&c(r),r}catch{return[]}}function c(t){localStorage.setItem(n,JSON.stringify(t))}function u(t){let e=l().filter(e=>s(e.gameId,e.platform)!==s(t.gameId,t.platform));e.unshift(t),c(e)}function d(t,e){let a=s(t,e);c(l().filter(t=>s(t.gameId,t.platform)!==a))}function p(t,e){let a=s(t,e);return l().some(t=>s(t.gameId,t.platform)===a&&!t.pending)}function f(t,e){let a=s(t,e);return l().some(t=>s(t.gameId,t.platform)===a&&t.pending)}},38291:(t,e,a)=>{"use strict";a.d(e,{l:()=>u,x:()=>c});var r=a(43520),n=a(95212),i=a(52066),o=a(6739);let s=(0,n.createContext)(null);async function l(){let t=(0,o.Tt)().filter(t=>t.pending&&t.token);if(!t.length)return;let e=!1,a=(0,o.Tt)();for(let r of t){if(!r.token)continue;let t=await (0,i.d3)(r.token);if(!t)continue;let n=(0,o.S$)(r.gameId,r.platform),s=a.findIndex(t=>(0,o.S$)(t.gameId,t.platform)===n);!(s<0)&&(t.active?t.confirmed&&(a[s]={...a[s],pending:!1},e=!0):(a.splice(s,1),e=!0))}e&&(0,o.cm)(a)}function c({children:t}
1){let[e,a]=(0,n.useState)([]),[u,d]=(0,n.useState)(!1),[p,f]=(0,n.useState)(null),[m,g]=(0,n.useState)(null),[h,v]=(0,n.useState)(!1),y=(0,n.useCallback)((t,e="ok")=>{f({message:t,tone:e}),window.setTimeout(()=>f(null),4200)},[]),b=(0,n.useCallback)(async()=>{let t=(0,o.pN)();v(!!t),t||await l();let e=t?await (0,i.Yp)():[];a(function(t,e){let a=new Map;for(let t of e){let e=(0,o.S$)(t.game_id,t.platform);a.set(e,{key:e,gameId:t.game_id,gameTitle:t.game_title??t.game_id,coverUrl:t.cover_url??null,targetPrice:t.target_price,platform:t.platform,atlOnly:t.atl_only,source:"remote",remoteId:t.id,currentPrice:t.current_price??null})}for(let e of t){let t=(0,o.S$)(e.gameId,e.platform);a.has(t)||a.set(t,{key:t,gameId:e.gameId,gameTitle:e.gameTitle,coverUrl:e.coverUrl,targetPrice:e.targetPrice,platform:e.platform,source:"local",email:e.email,pending:e.pending??!1,token:e.token})}return[...a.values()]}((0,o.Tt)(),e))},[]);(0,n.useEffect)(()=>{b();let t=t=>{("rynko_auth"===t.key||"rynko_local_radars"===t.key)&&b()};return window.addEventListener("storage",t),window.addEventListener("rynko-auth-change",b),()=>{window.removeEventListener("storage",t),window.removeEventListener("rynko-auth-change",b)}},[b]);let x=(0,n.useCallback)((t,a)=>{let r=(0,o.S$)(t,a??null);return e.some(t=>t.key===r&&!t.pending)||(0,o.yH)(t,a??null)},[e]),w=(0,n.useCallback)((t,a)=>{let r=(0,o.S$)(t,a??null);return e.some(t=>t.key===r&&t.pending)||(0,o.lJ)(t,a??null)},[e]),_=(0,n.useCallback)(async t=>{if((0,o.M3)())await (0,i.zL)(t),y(t.atlOnly?"Radar ATL attivo â ti avvisiamo al minimo storico!":`Obiettivo agganciato a â¬${t.targetPrice.toFixed(2).replace(".",",")}!`);else{if(!t.email)throw Error("Email richiesta");if(!t.consent)throw Error("Devi accettare le notifiche email");let e=await (0,i.G$)({...t,email:t.email,consent:t.consent});e.confirmed?((0,o.fS)({gameId:t.gameId,gameTitle:t.gameTitle,coverUrl:t.coverUrl??null,targetPrice:t.targetPrice,platform:t.platform??null,email:t.email,createdAt:new Date().toISOString(),pending:!1}),y("Radar attivo!")):((0,o.fS)({gameId:t.gameId,gameTitle:t.gameTitle,coverUrl:t.coverUrl??null,targetPrice:t.targetPrice,platform:t.platform??null,email:t.email,createdAt:new Date().toISOString(),pending:!0,token:e.token}),y("Controlla la email e clicca Conferma entro 30 giorni."))}await b(),g(null)},[b,y]),S=(0,n.useCallback)(async t=>{if((0,o.M3)()){await (0,i.zL)(t),y(t.atlOnly?"Radar ATL attivo â ti avvisiamo al minimo storico!":`Radar impostato a â¬${t.targetPrice.toFixed(2).replace(".",",")}`),await b();return}g({gameId:t.gameId,gameTitle:t.gameTitle,coverUrl:t.coverUrl??null,currentPrice:t.currentPrice,histMin:t.histMin??null,platform:t.platform??null})},[b,y]),E=(0,n.useCallback)(async t=>{if(!t.token)throw Error("Token mancante");await (0,i.og)(t.token),y("Email di conferma reinviata")},[y]),k=(0,n.useCallback)(async t=>{"remote"===t.source?await (0,i.Yl)(t.gameId):(0,o.Ub)(t.gameId,t.platform),y("Radar disattivato"),await b()},[b,y]),A=(0,n.useMemo)(()=>({radars:e,drawerOpen:u,toast:p,modal:m,loggedIn:h,openDrawer:()=>d(!0),closeDrawer:()=>d(!1),dismissToast:()=>f(null),openModal:g,closeModal:()=>g(null),refreshRadars:b,isActive:x,isPending:w,resendConfirm:E,activateQuick:S,activateDetailed:_,removeRadar:k}),[e,u,p,m,h,b,x,w,S,_,k,E]);return(0,r.jsx)(s.Provider,{value:A,children:t})}function u(){let t=(0,n.useContext)(s);if(!t)throw Error("usePriceRadar must be used within PriceRadarProvider");return t}},45744:(t,e,a)=>{Promise.resolve().then(a.t.bind(a,85760,23)),Promise.resolve().then(a.t.bind(a,1497,23)),Promise.resolve().then(a.bind(a,50174)),Promise.resolve().then(a.bind(a,65280)),Promise.resolve().then(a.t.bind(a,89196,23)),Promise.resolve().then(a.bind(a,71634))},50174:(t,e,a)=>{"use strict";a.d(e,{default:()=>l});var r=a(43520),n=a(95212),i=a(38291),o=a(1465),s=a(80106);function l(){let{activateDetailed:t,loggedIn:e}=(0,i.l)(),a=(0,o.WF)(),[l,c]=(0,n.useState)(null),[u,d]=(0,n.useState)(""),[p,f]=(0,n.useState)(!1),[m,g]=(0,n.useState)("atl"),[h,v]=(0,n.use
1State)(""),[y,b]=(0,n.useState)(""),[x,w]=(0,n.useState)(!1),[_,S]=(0,n.useState)(!1),[E,k]=(0,n.useState)(null),[A,C]=(0,n.useState)(!1),M=(0,n.useRef)(null),F=(0,n.useId)(),I=p||""!==u.trim(),L=a.results.slice(0,5);async function q(a){if(a.preventDefault(),k(null),!l)return void k({ok:!1,msg:"Scegli il gioco dallâelenco che compare mentre scrivi."});let r=0;if("custom"===m){if(!((r=Number(h.replace(",",".")))>0))return void k({ok:!1,msg:"Scrivi il prezzo che vuoi raggiungere."})}else{let t=(0,s.bT)(l.price,null);r=(0,s.iH)(t,"atl").targetPrice||l.price}if(!e&&!x)return void k({ok:!1,msg:"Serve il consenso a ricevere le email di avviso."});S(!0);try{await t({gameId:l.id,gameTitle:l.title,coverUrl:l.cover,targetPrice:r,platform:l.platform,atlOnly:"atl"===m,email:e?void 0:y.trim(),consent:!!e||x}),k({ok:!0,msg:e?`Fatto: seguiamo ${l.title}. Lo trovi nei tuoi PriceRadar.`:`Quasi fatto: ti abbiamo scritto a ${y.trim()}. Conferma dalla email e lâavviso su ${l.title} parte.`}),c(null),d(""),v(""),w(!1)}catch(t){k({ok:!1,msg:t instanceof Error?t.message:"Non siamo riusciti ad attivare lâavviso. Riprova."})}finally{S(!1)}}return(0,n.useEffect)(()=>{if(!A)return;let t=t=>{"Escape"===t.key&&C(!1)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[A]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("form",{ref:M,className:"vt-news","aria-label":"Attiva un avviso prezzo","data-radar-form":!0,"data-open":I?"":void 0,onFocus:()=>f(!0),onBlur:t=>{M.current?.contains(t.relatedTarget)||f(!1)},onSubmit:q,noValidate:!0,children:[(0,r.jsxs)("span",{className:"vt-news__field vt-news__field--search",children:[(0,r.jsx)("span",{className:"vt-news__sweep","aria-hidden":"true"}),(0,r.jsxs)("svg",{className:"vt-news__icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("path",{d:"m21 21-4.34-4.34"}),(0,r.jsx)("circle",{cx:"11",cy:"11",r:"8"})]}),(0,r.jsx)("input",{type:"search",placeholder:"Cerca il gioco che aspetti","aria-label":"Gioco da tenere d'occhio","data-radar-search":!0,role:"combobox","aria-expanded":A&&L.length>0,"aria-controls":F,"aria-autocomplete":"list",autoComplete:"off",value:u,onChange:t=>{d(t.target.value),c(null),C(!0),a.cerca(t.target.value)}}),A&&L.length>0&&(0,r.jsx)("ul",{className:"vt-news__results",id:F,role:"listbox","aria-label":"Giochi trovati",children:L.map(t=>{let e=(0,o.pp)(t.best);return(0,r.jsx)("li",{role:"option","aria-selected":!1,children:(0,r.jsxs)("button",{type:"button",onClick:()=>{let e;return e=(0,o.pp)(t.best),void(c({id:t.id,title:t.title,cover:t.cover_url,price:e?.price??0,platform:e?.platform??null}),d(t.title),C(!1),a.azzera(),k(null))},children:[t.cover_url&&(0,r.jsx)("img",{src:t.cover_url,alt:"",width:30,height:40}),(0,r.jsx)("span",{children:t.title}),e&&(0,r.jsxs)("em",{children:[(0,o.pW)(e.platform)," \xb7 ","â¬"+e.price.toFixed(2).replace(".",",")]})]})},t.id)})})]}),(0,r.jsx)("div",{className:"vt-news__more","data-radar-more":!0,children:(0,r.jsxs)("div",{className:"vt-news__more-in",children:[(0,r.jsxs)("div",{className:"vt-news__presets",role:"radiogroup","aria-label":"Quando avvisarti",children:[(0,r.jsx)("span",{className:"vt-news__presets-lab",children:"Avvisami quando"}),(0,r.jsxs)("label",{children:[(0,r.jsx)("input",{type:"radio",name:"vt-soglia",value:"atl",checked:"atl"===m,onChange:()=>g("atl"),"data-radar-preset":!0}),(0,r.jsx)("span",{children:"tocca il minimo storico"})]}),(0,r.jsxs)("label",{children:[(0,r.jsx)("input",{type:"radio",name:"vt-soglia",value:"custom",checked:"custom"===m,onChange:()=>g("custom"),"data-radar-preset":!0}),(0,r.jsx)("span",{children:"scende sotto un prezzo mio"})]})]}),(0,r.jsxs)("div",{className:"vt-news__inputs",children:[(0,r.jsxs)("span",{className:"vt-news__field vt-news__field--price","data-radar-price":!0,hidden:"custom"!==m,children:[(0,r.jsx)("span",{className:"vt-news__sweep","aria-hidden":"true"}),(0,r.jsx)("input",{type:"number",step:"0.01",min:"0",inputMode:"decimal",placeholder:l?.price?`Es. ${(.8*l.price).toFixed(2).replace(".",",")}`:"Es. 29,99","aria-label":"Prezzo da raggiungere",value:h,onChange:t=>v(t.target.value)})]}),!e&&(0,r.jsxs)("span",{className:"vt-news__field vt-news__field--mail",children:[(0,r.jsx)("span",{className:"vt-news__sweep","aria-hidden":"true"}),(0,r.jsx)("input",{type:"email",placeholder:"Dove ti scriviamo","aria-label":"La tua email",autoComplete:"email",value:y,onChange:t=>b(t.target.value),required:!0})]}),(0,r.jsx)("button",{type:"submit","data-magnet":!0,disabled:_,children:_?"Attivo lâavvisoâ¦":"Avvisami quando raggiunge quel prezzo"})]}),!e&&(0,r.jsxs)("label",{className:"vt-news__consent",children:[(0,r.jsx)("input",{type:"checkbox",checked:x,onChange:t=>w(t.target.checked)}),(0,r.jsx)("span",{children:"Acconsento a ricevere email di avviso prezzo da rynko.it. Posso revocare il consenso in qualsiasi momento."})]}),(0,r.jsx)("p",{className:"vt-news__note",children:"Una conferma per attivarlo, poi silenzio: ti scriviamo quando scatta, non ogni settimana. Revochi quando vuoi."})]})})]}),E&&(0,r.jsx)("p",{className:`vt-news__status ${E.ok?"is-ok":"is-err"}`,role:"status",children:E.msg})]})}},52066:(t,e,a)=>{"use strict";a.d(e,{G$:()=>l,Yl:()=>s,Yp:()=>i,d3:()=>c,og:()=>u,zL:()=>o});var r=a(6739);async function n(){return{"Content-Type":"application/json"}}async function i(){if(!(0,r.pN)())return[];let t=await fetch("/api/auth/alerts",{cache:"no-store"});if(!t.ok)return[];let e=await t.json();return Array.isArray(e)?e:[]}async function o(t){let e=await n(),a=await fetch("/api/auth/alerts",{method:"POST",headers:e,body:JSON.stringify({game_id:t.gameId,target_price:t.targetPrice,platform:t.platform??null,atl_only:t.atlOnly??!1})}),r=await a.json().catch(()=>({}));if(!a.ok)throw Error(r.detail||"Impossibile attivare il radar");return r}async function s(t){if(!(0,r.pN)())return;let e=await fetch(`/api/auth/alerts/${encodeURIComponent(t)}`,{method:"DELETE"});if(!e.ok)throw Error((await e.json().catch(()=>({}))).detail||"Impossibile rimuovere il radar")}async function l(t){let e=await fetch("/api/alerts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({game_id:t.gameId,email:t.email,target_price:t.targetPrice,platform:t.platform??null,atl_only:t.atlOnly??!1,consent:t.consent})}),a=await e.json().catch(()=>({}));if(!e.ok)throw Error(a.detail||"Impossibile attivare il radar");return a}
1async function c(t){let e=await fetch(`/api/alerts/${encodeURIComponent(t)}/status`,{cache:"no-store"});return e.ok?e.json():null}async function u(t){let e=await fetch(`/api/alerts/${encodeURIComponent(t)}/resend-confirm`,{method:"POST"}),a=await e.json().catch(()=>({}));if(!e.ok)throw Error(a.detail||"Impossibile reinviare la conferma");return a}},65280:(t,e,a)=>{"use strict";a.d(e,{default:()=>l});var r=a(43520),n=a(95212),i=a(38291),o=a(3554),s=a(6739);function l(){let t=(0,n.useRef)(null),{openModal:e}=(0,i.l)(),a=(0,n.useRef)(e);return a.current=e,(0,n.useEffect)(()=>{let e=t.current?.parentElement;if(!e)return;window.matchMedia("(prefers-reduced-motion: reduce)").matches?e.querySelector("#hero")?.setAttribute("data-sc-span","1"):e.classList.add("vt-anim");let r=function(){let t=!1,e=[],a=[],r=new Set,n=new Set;class i extends IntersectionObserver{constructor(e,r){super((a,r)=>{t||e(a,r)},r),a.push(this)}}class o extends MutationObserver{constructor(e){super((a,r)=>{t||e(a,r)}),a.push(this)}}class s extends ResizeObserver{constructor(e){super((a,r)=>{t||e(a,r)}),a.push(this)}}return{get dead(){return t},addEventListener(a,r,n){t||(window.addEventListener(a,r,n),e.push([window,a,r,n]))},removeEventListener(t,a,r){window.removeEventListener(t,a,r);let n=e.findIndex(e=>e[0]===window&&e[1]===t&&e[2]===a);n>=0&&e.splice(n,1)},onDocument(a,r,n){t||(document.addEventListener(a,r,n),e.push([document,a,r,n]))},requestAnimationFrame(e){if(t)return 0;let a=window.requestAnimationFrame(r=>{n.delete(a),t||e(r)});return n.add(a),a},setTimeout(e,a){if(t)return 0;let n=window.setTimeout(()=>{r.delete(n),t||e()},a);return r.add(n),n},IntersectionObserver:i,ResizeObserver:s,MutationObserver:o,dispose(){for(let[a,r,n,i]of(t=!0,e))a.removeEventListener(r,n,i);for(let t of(e.length=0,a))try{t.disconnect()}catch{}for(let t of(a.length=0,r))window.clearTimeout(t);for(let t of(r.clear(),n))window.cancelAnimationFrame(t);n.clear()}}}(),n=!1;try{var i,l,c,u,d,p;(i={},l=r.addEventListener,c=r.removeEventListener,u=r.requestAnimationFrame,d=r.setTimeout,p=r.IntersectionObserver,!function(){var t=matchMedia("(prefers-reduced-motion: reduce)").matches,a=matchMedia("(hover: hover) and (pointer: fine)"),r=matchMedia("(max-width: 860px)"),n=matchMedia("(hover: none) and (pointer: coarse)").matches,o=function(){return n||r.matches},s=function(t,e,a){return t<e?e:t>a?a:t},f=function(t){return s(t,0,1)},m=function(t){return(t=f(t))*t*(3-2*t)},g=function(t,e,a){return t+(e-t)*a};function h(t,e){if(!e)return t;e=f(e);var a=t-.5;return(1-e)*t+e*(4*a*a*a+.5)}function v(t){var e=parseFloat(t&&t.getAttribute&&t.getAttribute("data-sc-lerp"));return isNaN(e)||e<=0?0:s(e,.02,1)}function y(t,e){var a=0,r=e.indexOf(".");r>-1&&(a=e.length-r-1);var n=t.toFixed(a);if(/,/.test(e)||Math.abs(t)>=1e4){var i=n.split(".");i[0]=i[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),n=i.join(".")}return n}i.ScrollCraft={mount:function(r,n){r="string"==typeof r?document.querySelector(r):r||document,n=n||{};var b=[],x=[],w=[],_=[],S=innerHeight,E=innerWidth,k=0,A=r.querySelector("[data-sc-progress]"),C=document.documentElement,M=v(1===r.nodeType?r:null)||v(C)||(n.lerp>0?s(n.lerp,.02,1):0)||.18;function F(t,e){var a={el:t,host:e||t,ready:!1,loading:!1,painted:!1,cur:0,target:0,live:!1,stuckAt:0,lerp:v(t)||M};return t.muted=!0,t.playsInline=!0,t.preload="none",t.setAttribute("muted",""),t.setAttribute("playsinline",""),_.push(a),a}Array.prototype.forEach.call(r.querySelectorAll("[data-sc-act]"),function(t){var e=t.getAttribute("data-sc-act")||"flow",a="scrub"===e||"pin"===e||"pan"===e,r={el:t,device:e,pinned:a,span:parseFloat(t.getAttribute("data-sc-span"))||1.5*!!a,dwell:parseFloat(t.getAttribute("data-sc-dwell"))||0,clipTravel:a&&"travel"===t.getAttribute("data-sc-clip-map"),p:0,raw:0,top:0,height:0,live:!1,cues:[],parallax:[],reveals:[],counts:[],video:null,seq:null,rail:null};a&&(r.stage=t.querySelector("[data-sc-stage]")||t.querySelector(".sc-stage"),r.stage&&r.stage.classList.add("sc-stage"),t.classList.add("sc-act--pinned"));var n=t.querySelector("video[data-sc-scrub]");n&&(r.video=F(n,t));var i=t.querySelector("canvas[data-sc-sequence]");if(i){var o=i.getAttribute("data-sc-sequence").split(":");r.seq={el:i,ctx:i.getContext("2d",{alpha:!1}),tpl:o[0],count:parseInt(o[1],10)||1,start:parseInt(o[2],10)||0,frames:[],loaded:0,drawn:-1}}r.rail=t.querySelector("[data-sc-pan]"),r.rail&&(r.railExtra=parseFloat(r.rail.getAttribute("data-sc-pan"))||0),Array.prototype.forEach.call(t.querySelectorAll("[data-sc-cue]"),function(t){var e=(t.getAttribute("data-sc-cue")||"").trim().split(/\s+/).map(parseFloat),a={el:t,from:isNaN(e[0])?0:e[0],to:e.length>1&&!isNaN(e[1])?e[1]:null,rIn:e.length>2&&!isNaN(e[2])?f(e[2]):.3,rOut:e.length>3&&!isNaN(e[3])?f(e[3]):null,rise:parseFloat(t.getAttribute("data-sc-rise")),kinetic:t.getAttribute("data-sc-kinetic"),units:null,state:-1};null===a.rOut&&(e.length>2&&isNaN(e[2]),a.rOut=.3),isNaN(a.rise)&&(a.rise=1),r.cues.push(a)}),Array.prototype.forEach.call(t.querySelectorAll("[data-sc-parallax]"),function(t){r.parallax.push({el:t,rate:parseFloat(t.getAttribute("data-sc-parallax"))||0})}),Array.prototype.forEach.call(t.querySelectorAll("[data-sc-reveal]"),function(t){var e=(t.getAttribute("data-sc-reveal-at")||"0 0.5").trim().split(/\s+/).map(parseFloat);r.reveals.push({el:t,dir:t.getAttribute("data-sc-reveal")||"up",from:e[0]||0,to:e[1]||.5})}),Array.prototype.forEach.call(t.querySelectorAll("[data-sc-count]"),function(t){var e=(t.getAttribute("data-sc-count")||"").trim().split(/\s+/),a=(t.getAttribute("data-sc-count-at")||"0.1 0.55").trim().split(/\s+/).map(parseFloat),n=function(t){return parseFloat(String(t).replace(/,/g,""))||0};r.counts.push({el:t,a:n(e[0]),b:n(e[1]),tpl:e[1]||"0",from:a[0],to:a[1],last:null})}),b.push(r);var s=t.getAttribute("data-sc-drift");if(s){var l=function(t){var e=(t=(t||"").trim()).match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i);if(e){var a=e[1];return 3===a.length&&(a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),[parseInt(a.slice(0,2),16),parseInt(a.slice(2,4),16),parseInt(a.slice(4,6),16)]}if(e=t.match(/rgba?\(([^)]+)\)/i)){var r=e[1].split(/[,\s/]+/).filter(
1Boolean).map(parseFloat);return[r[0],r[1],r[2]]}return null}(s);l&&w.push({act:r,rgb:l})}}),Array.prototype.forEach.call(r.querySelectorAll('[data-sc-mode="worldflight"]'),function(t){var e={el:t,stage:t.querySelector("[data-sc-world]")||t.querySelector(".sc-world"),copyLayer:t.querySelector("[data-sc-world-copy]")||t.querySelector(".sc-world__copy"),spacer:t.querySelector("[data-sc-spacer]")||t.querySelector(".sc-world__spacer"),seam:0,segs:[],copies:[],total:0,top:0,index:-1,checked:!1},a=parseFloat(t.getAttribute("data-sc-seam"));e.seam=isNaN(a)||a<=0?.12:s(a,.02,.4),e.stage&&e.stage.classList.add("sc-world"),e.copyLayer&&e.copyLayer.classList.add("sc-world__copy"),e.spacer&&e.spacer.classList.add("sc-world__spacer"),Array.prototype.forEach.call(t.querySelectorAll("[data-sc-segment]"),function(t){var a={el:t,w:parseFloat(t.getAttribute("data-sc-w"))||1.3,linger:s(parseFloat(t.getAttribute("data-sc-linger"))||0,0,.6),label:t.getAttribute("data-sc-waypoint")||"",poster:t.querySelector("[data-sc-poster]")||t.querySelector(".sc-world__poster")||t.querySelector("img"),c0:0,c1:0,local:0,op:-1,z:-1,clip:null};t.classList.add("sc-world__seg"),a.poster&&a.poster.classList.add("sc-world__poster");var r=t.querySelector("video");r&&(r.setAttribute("data-sc-scrub",""),a.clip=F(r,t)),e.segs.push(a)});var r=0;e.segs.forEach(function(t){t.c0=r,r+=Math.max(t.w,.1),t.c1=r}),e.total=Math.max(r,.001),Array.prototype.forEach.call(t.querySelectorAll("[data-sc-copy]"),function(t){var a=(t.getAttribute("data-sc-window")||"").trim(),r={el:t,from:0,to:1,rIn:.3,rOut:.3,state:-1},n=e.segs[0],i=e.segs[e.segs.length-1];if("hero"===a)r.from=0,r.to=n?.62*n.w/e.total:.3,r.rIn=0,r.rOut=.65;else if("finale"===a)r.from=i?(i.c0+.4*i.w)/e.total:.7,r.to=1,r.rIn=.55,r.rOut=0;else{var o=a.split(/\s+/).map(parseFloat);r.from=isNaN(o[0])?0:f(o[0]),r.to=o.length>1&&!isNaN(o[1])?f(o[1]):f(r.from+.18),o.length>2&&!isNaN(o[2])&&(r.rIn=f(o[2])),o.length>3&&!isNaN(o[3])&&(r.rOut=f(o[3]))}r.to<=r.from&&(r.to=f(r.from+.05)),e.copies.push(r)}),x.push(e)});var I=null;function L(){S=innerHeight,E=innerWidth,b.forEach(function(t){t.pinned&&(t.el.style.height=100*t.span+"vh")}),x.forEach(function(t){t.spacer&&(t.spacer.style.height=Math.round((t.total+1)*S)+"px")}),b.forEach(function(t){var e=t.el.getBoundingClientRect();t.top=e.top+scrollY,t.height=e.height}),b.length&&b.forEach(function(t){if(t.seq&&t.seq.el){var e=t.seq.el.getBoundingClientRect(),a=Math.min(devicePixelRatio||1,2);t.seq.el.width=Math.round(e.width*a),t.seq.el.height=Math.round(e.height*a),t.seq.drawn=-1}}),b.forEach(function(t){if(t.pinned&&t.stage&&!t.stageChecked){t.stageChecked=!0;var e=getComputedStyle(t.stage).position;"sticky"!==e&&"-webkit-sticky"!==e&&console.warn('[scrollcraft] act "'+(t.el.id||t.device)+'" will not pin: its stage computes position:'+e+", not sticky. Something is overriding .sc-stage.",t.stage)}}),x.forEach(function(t){if(t.top=t.el.getBoundingClientRect().top+scrollY,!t.checked){if(t.checked=!0,!t.stage)return void console.warn("[scrollcraft] worldflight has no [data-sc-world] stage; nothing will fly.",t.el);t.spacer||console.warn("[scrollcraft] worldflight has no [data-sc-spacer]; the page has no scroll track.",t.el);var e=getComputedStyle(t.stage).position;"fixed"!==e&&console.warn("[scrollcraft] worldflight stage computes position:"+e+", not fixed. Something is overriding .sc-world, and the flight will scroll off screen.",t.stage)}}),N()}function q(e){if(!t&&e&&!e.loading){var a=e.el.getAttribute("data-sc-src")||o()&&e.el.getAttribute("data-sc-src-mobile")||e.el.currentSrc||e.el.src;o()&&e.el.getAttribute("data-sc-src-mobile")&&(a=e.el.getAttribute("data-sc-src-mobile")),a&&(e.loading=!0,fetch(a).then(function(t){if(!t.ok)throw Error(t.status);return t.blob()}).then(function(t){e.el.addEventListener("loadedmetadata",function(){e.ready=!0;try{e.el.currentTime=Math.max(e.target*(e.el.duration||1),.001)}catch(t){}N(),O(e)});var a=function(){e.painted||(e.painted=!0,e.host.classList.add("sc-has-clip"),e.el.classList.add("sc-has-clip"))};e.el.addEventListener("seeked",a,{once:!0}
1),d(a,2500),e.el.preload="auto",e.el.muted=!0,e.el.playsInline=!0,e.el.src=URL.createObjectURL(t)}).catch(function(){e.loading=!1}))}}function N(){k=scrollY||pageYOffset;for(var a,r,n,i=null,o=null,l=0,c=Math.max((document.documentElement.scrollHeight||0)-S,1),u=0;u<b.length;u++){var d=b[u];if(d.pinned){var p=Math.max(d.height-S,1);O=f((k-d.top)/p)}else O=f((k+S-d.top)/(d.height+S));if(d.raw=O,d.p=d.dwell?h(O,d.dwell):O,d.vp=d.p,d.pinned&&!d.clipTravel){var v=d.top-Math.min(S,d.top),_=Math.min(d.top+d.height,c),C=f((k-v)/Math.max(_-v,1));d.vp=d.dwell?h(C,d.dwell):C}if(d.live=k>d.top-1.25*S&&k<d.top+d.height+1.25*S,d.el.style.setProperty("--sc-p",d.p.toFixed(4)),k>d.top-3*S&&k<d.top+d.height+1.5*S&&(d.video&&q(d.video),d.seq&&function(t){var e=t.seq;if(e&&!e.frames.length)for(var a=0;a<e.count;a++)!function(t){var a=new Image;a.decoding="async",a.src=e.tpl.replace("{i}",String(e.start+t)).replace("{ii}",String(e.start+t).padStart(2,"0")).replace("{iii}",String(e.start+t).padStart(3,"0")).replace("{iiii}",String(e.start+t).padStart(4,"0")),a.onload=function(){e.loaded++,1===e.loaded&&(e.drawn=-1)},e.frames[t]=a}(a)}(d)),d.live&&d.seq&&function(t){var e=t.seq;if(e&&e.frames.length){var a=s(Math.round(t.p*(e.count-1)),0,e.count-1);if(a!==e.drawn){var r=e.frames[a];if(r&&r.complete&&r.naturalWidth){var n=e.el.width,i=e.el.height,o=Math.max(n/r.naturalWidth,i/r.naturalHeight),l=r.naturalWidth*o,c=r.naturalHeight*o;e.ctx.drawImage(r,(n-l)/2,(i-c)/2,l,c),e.drawn=a}}}}(d),d.video&&(d.video.live=d.live,d.video.ready&&(d.video.target=d.vp)),d.rail){var M=d.rail.scrollWidth-E;if(M>
10){var F=M*(d.railExtra||0);d.rail.style.transform="translate3d("+(-(M+F)*d.p).toFixed(2)+"px,0,0)"}}if(!d.live){if(!0!==d.parked){for(var I=0;I<d.cues.length;I++){var L=d.cues[I];if(L.el.style.opacity="0",L.el.style.pointerEvents="none",L.state=0,L.units)for(var N=0;N<L.units.length;N++)L.units[N].style.opacity="0"}d.parked=!0}continue}d.parked=!1;for(var P=0;P<d.cues.length;P++){var O,j,T=d.cues[P];if(null===T.to)j=m((d.p-T.from)/.18);else{var R=Math.max(T.to-T.from,.001),z=T.from+R*T.rIn,Y=T.to-R*T.rOut;j=d.p<z?m((d.p-T.from)/Math.max(z-T.from,.001)):d.p<=Y?1:m(1-(d.p-Y)/Math.max(T.to-Y,.001))}if(j=f(j),T.kinetic){T.units||(T.units=function(t,e){if(t.__scSplit)return t.__scSplit;var a=t.textContent,r=[];if("chars"===e||"words"===e){var n="chars"===e?Array.from(a):a.split(/(\s+)/);t.textContent="",n.forEach(function(e){if(/^\s+$/.test(e))return void t.appendChild(document.createTextNode(e));var a=document.createElement("span");a.className="sc-split";var n=document.createElement("span");n.className="sc-split__i",n.textContent=e,a.appendChild(n),t.appendChild(a),r.push(n)})}else{var i=a.split(/\s+/).filter(Boolean);t.textContent="";var o=i.map(function(e,a){var r=document.createElement("span");return r.textContent=e,t.appendChild(r),a<i.length-1&&t.appendChild(document.createTextNode(" ")),r}),s=[],l=null,c=null;o.forEach(function(t){var e=t.offsetTop;(null===c||Math.abs(e-c)>1)&&(l=[],s.push(l),c=e),l.push(t.textContent)}),t.textContent="",s.forEach(function(e,a){var n=document.createElement("span");n.className="sc-split sc-split--line";var i=document.createElement("span");i.className="sc-split__i",i.textContent=e.join(" "),n.appendChild(i),t.appendChild(n),a<s.length-1&&t.appendChild(document.createTextNode(" ")),r.push(i)})}return t.classList.add("sc-is-split"),t.__scSplit=r,r}(T.el,T.kinetic));for(var $=T.units.length,U=0;U<$;U++){var W=f((j-U/Math.max($,1)*.62)/.381);W=m(W),T.units[U].style.opacity=W.toFixed(3),T.units[U].style.transform=t?"none":"translate3d(0,"+((1-W)*100).toFixed(2)+"%,0)"}T.el.style.opacity="1"}else T.el.style.opacity=j.toFixed(3),T.el.style.transform=t?"none":"translate3d(0,"+((1-j)*2.4*T.rise).toFixed(2)+"vh,0)";var B=j>.5;B!==(1===T.state)&&(T.state=+!!B,T.el.style.pointerEvents=B?"auto":"none")}if(!t)for(var D=0;D<d.parallax.length;D++){var H=d.parallax[D];H.el.style.transform="translate3d(0,"+(H.rate*(d.p-.5)*100).toFixed(2)+"px,0)"}for(var X=0;X<d.reveals.length;X++){var J=d.reveals[X],G=m((d.p-J.from)/Math.max(J.to-J.from,.001)),V=((1-G)*100).toFixed(2);J.el.style.clipPath="down"===J.dir?"inset("+V+"% 0 0 0)":"left"===J.dir?"inset(0 "+V+"% 0 0)":"right"===J.dir?"inset(0 0 0 "+V+"%)":"iris"===J.dir?"circle("+(78*G).toFixed(2)+"% at 50% 50%)":"inset(0 0 "+V+"% 0)"}for(var Q=0;Q<d.counts.length;Q++){var K=d.counts[Q],Z=m((d.p-K.from)/Math.max(K.to-K.from,.001)),tt=y(g(K.a,K.b,Z),K.tpl);tt!==K.last&&(K.el.textContent=tt,K.last=tt)}}for(var te=0;te<x.length;te++)!function(a){if(a.segs.length){var r=a.seam,n=s((k-a.top)/Math.max(S,1),0,a.total),i=n/a.total,o=0;for(l=0;l<a.segs.length;l++)n>=a.segs[l].c0-r/2&&(o=l);for(l=0;l<a.segs.length;l++){var l,c,u=a.segs[l],d=f((n-u.c0)/Math.max(u.w,.001));u.local=d,u.clip&&n>u.c0-1.6&&n<u.c1+1.6&&q(u.clip),c=l>o?0:l===o?0===l?1:m((n-(u.c0-r/2))/r):+(n<u.c1+r/2);var p=l===o?120:Math.round(100+10*c);c!==u.op&&(u.el.style.opacity=c.toFixed(3),u.el.style.visibility=c>.002?"visible":"hidden",u.op=c),p!==u.z&&(u.el.style.zIndex=String(p),u.z=p),u.clip&&(u.clip.live=c>.002,u.clip.target=function(t,e){if(!e)return t;e=s(e,0,.6);var a=t-.5;return(1-e)*t+e*(4*a*a*a+.5)}(d,u.linger)),u.poster&&!t&&!(u.clip&&u.clip.painted)&&c>.002&&(u.poster.style.transform="scale("+(1.03+.14*d).toFixed(4)+")")}for(var g=0;g<a.copies.length;g++){var h,v=a.copies[g],y=Math.max(v.to-v.from,.001),b=v.from+y*v.rIn,x=v.to-y*v.rOut;h=f(h=i<v.from?0:i<b?m((i-v.from)/Math.max(b-v.from,.001)):i<=x?1:m(1-(i-x)/Math.max(v.to-x,.001)));var w=f((i-v.from)/y);v.el.style.opacity=h.toFixed(3),v.el.style.transform=t?"none":"translate3d(0,"+((.5-w)*4).toFixed(2)+"vh,0)";var _=h>.5;_!==(1===v.state)&&(v.state=+!!_,v.el.style.pointerEvents=_?"auto":"none")}var E=a.segs[o];if(a.el.style.setProperty("--sc-seg",String(o)),a.el.style.setProperty("--sc-segp",E.local.toFixed(4)),e.style.setProperty("--sc-seg",String(o)),e.style.setProperty("--sc-segp",E.local.toFixed(4)),o!==a.index){a.index=o;try{a.el.dispatchEvent(new CustomEvent("sc:waypoint",{bubbles:!0,detail:{index:o,count:a.segs.length,label:E.label,el:E.el,progress:i}}))}catch(t){}}}}(x[te]);for(var ta=0;ta<w.length;ta++){var tr=w[ta];if(tr.act.raw>0&&tr.act.raw<1){i=tr,l=m(tr.act.raw/.35),o=w[ta-1]||tr;break}tr.act.raw>=1&&(i=tr,o=tr,l=1)}if(i&&e.style.setProperty("--sc-canvas",(a=o.rgb,r=i.rgb,n=l,"rgb("+Math.round(g(a[0],r[0],n))+","+Math.round(g(a[1],r[1],n))+","+Math.round(g(a[2],r[2],n))+")")),A){var tn=Math.max(document.body.scrollHeight-S,1);
1A.style.transform="scaleX("+f(k/tn).toFixed(4)+")"}}"IntersectionObserver"in window?(I=new p(function(t){t.forEach(function(t){if(t.isIntersecting){var e=t.target;e.classList.add("sc-in");var a=parseFloat(e.getAttribute("data-sc-stagger"));isNaN(a)||Array.prototype.forEach.call(e.children,function(t,e){t.style.transitionDelay=e*a+"ms",t.classList.add("sc-in")}),I.unobserve(e)}})},{rootMargin:"0px 0px -12% 0px",threshold:.01}),Array.prototype.forEach.call(r.querySelectorAll("[data-sc-in]"),function(t){I.observe(t)})):Array.prototype.forEach.call(r.querySelectorAll("[data-sc-in]"),function(t){t.classList.add("sc-in")}),function(){var e=function(t){return parseFloat(String(t).replace(/,/g,""))||0},a=function(t){return(t.getAttribute("data-sc-count")||"").trim().split(/\s+/)},n=Array.prototype.filter.call(r.querySelectorAll("[data-sc-count]"),function(t){return!t.closest("[data-sc-act]")});if(n.length)if(n.forEach(function(t){var r=a(t);t.textContent=y(e(r[0]),r[1]||"0")}),"IntersectionObserver"in window){var i=new p(function(t){t.forEach(function(t){t.isIntersecting&&(o(t.target),i.unobserve(t.target))})},{rootMargin:"0px 0px -10% 0px",threshold:.5});n.forEach(function(t){i.observe(t)})}else n.forEach(o);function o(r){var n=a(r),i=e(n[0]),o=e(n[1]),s=n[1]||"0",l=parseFloat(r.getAttribute("data-sc-count-ms"))||1400;if(t||l<=0){r.textContent=y(o,s);return}var c=null,d=null;u(function t(e){null===c&&(c=e);var a=Math.min((e-c)/l,1),n=y(i+(o-i)*(1-Math.pow(1-a,3)),s);n!==d&&(r.textContent=n,d=n),a<1&&u(t)})}}();var P=0;function O(t){if(!t.primed&&!t.priming&&t.el.src){t.priming=!0;var e,a=function(){t.priming=!1,!t.primed&&(t.primed=!0,P++);try{t.el.pause()}catch(t){}try{var e=t.el.duration||1;t.cur=s(t.cur,0,.999),t.el.currentTime=s(t.cur*e+.05,0,.999*e)}catch(t){}},r=function(){t.priming=!1};d(function(){t.priming&&r()},2e3);try{e=t.el.play()}catch(t){r();return}e&&e.then?e.then(a,r):a()}}function j(){for(var t=0;t<_.length;t++)O(_[t]);_.length&&P>=_.length&&(c("touchstart",j),c("touchend",j),c("pointerdown",j),c("click",j),c("scroll",j))}l("touchstart",j,{passive:!0}),l("touchend",j,{passive:!0}),l("pointerdown",j,{passive:!0}),l("click",j,{passive:!0}),l("scroll",j,{passive:!0});var T=[],R=[],z=[],Y=!1;l("scroll",function(){Y||(Y=!0,u(function(){N(),Y=!1}))},{passive:!0}),l("focusin",function(t){var e=t.target;if(e&&e.closest){var a=e.closest("[data-sc-act]");if(a&&r.contains(a)){var n=e.closest("[data-sc-cue]");!n||parseFloat(getComputedStyle(n).opacity||"1")>.85||e.scrollIntoView({block:"center",inline:"nearest",behavior:"instant"})}}});var $=innerWidth;l("resize",function(){if(innerWidth===$&&o()){S=innerHeight;return}$=innerWidth,L()},{passive:!0}),document.fonts&&document.fonts.ready&&document.fonts.ready.then(function(){b.forEach(function(t){t.cues.forEach(function(t){t.kinetic&&t.units&&(t.el.__scSplit=null,t.units=null)})}),L()}),L(),t||!a.matches||(Array.prototype.forEach.call(r.querySelectorAll("[data-sc-tilt]"),function(t){T.push({el:t,max:parseFloat(t.getAttribute("data-sc-tilt"))||6,x:0,ty:0,tx:0,y:0})}),Array.prototype.forEach.call(r.querySelectorAll("[data-sc-magnet]"),function(t){R.push({el:t,k:parseFloat(t.getAttribute("data-sc-magnet"))||.3,x:0,y:0,tx:0,ty:0})}),Array.prototype.forEach.call(r.querySelectorAll("[data-sc-spotlight]"),function(t){z.push(t)}),(T.length||R.length||z.length)&&(l("pointermove",function(t){if("mouse"===t.pointerType){for(var e=0;e<T.length;e++){var a=T[e],r=a.el.getBoundingClientRect();if(r.bottom<-200||r.top>S+200){a.tx=0,a.ty=0;continue}var n=(t.clientX-(r.left+r.width/2))/(r.width/2),i=(t.clientY-(r.top+r.height/2))/(r.height/2),o=1.6>Math.abs(n)&&1.6>Math.abs(i);a.tx=o?-(s(i,-1,1)*a.max):0,a.ty=o?s(n,-1,1)*a.max:0}for(var l=0;l<R.length;l++){var c=R[l],u=c.el.getBoundingClientRect(),d=t.clientX-(u.left+u.width/2),p=t.clientY-(u.top+u.height/2),m=Math.abs(d)<u.width&&Math.abs(p)<2.5*u.height;c.tx=m?d*c.k:0,c.ty=m?p*c.k:0}for(var g=0;g<z.length;g++){var h=z[g].getBoundingClientRect();z[g].style.setProperty("--sc-mx",f((t.clientX-h.left)/h.width).toFixed(3)),z[g].style.setProperty("--sc-my",f((t.clientY-h.top)/h.height).toFixed(3))}}},{passive:!0}),function t(){for(var e=0;e<T.length;e++){var a=T[e];a.x+=(a.tx-a.x)*.09,a.y+=(a.ty-a.y)*.09,(Math.abs(a.x)>.001||Math.abs(a.y)>.001)&&(a.el.style.transform="perspective(1100px) rotateX("+a.x.toFixed(3)+"deg) rotateY("+a.y.toFixed(3)+"deg)")}for(var r=0;r<R.length;r++){var n=R[r];n.x+=(n.tx-n.x)*.12,n.y+=(n.ty-n.y)*.12,n.el.style.transform="translate3d("+n.x.toFixed(2)+"px,"+n.y.toFixed(2)+"px,0)"}u(t)}())),u(function e(){for(var a=o()?.02:.008,r=0;r<_.length;r++){var n=_[r];if(n.ready){if(n.el.seeking){var i=performance.now();if(n.stuckAt){if(i-n.stuckAt>700){n.stuckAt=i;try{n.el.currentTime=n.el.currentTime+.001}catch(t){}}}else n.stuckAt=i;continue}if(n.stuckAt=0,!(!n.live&&.002>Math.abs(n.cur-n.target))){n.cur+=(n.target-n.cur)*(t?1:n.lerp);var l=n.el.duration||1,c=s(n.cur,0,.999)*l;if(Math.abs(n.el.currentTime-c)>a)try{n.el.currentTime=c}catch(t){}}}}u(e)}),e.classList.add("sc-ready");var U={layout:L,read:N,acts:b,worlds:x,clips:_,lerp:M};return i.ScrollCraft.instances.push(U),U},reduce:t,instances:[]}}(),i.ScrollCraft).mount(e),function(t,e){var a,r=t.addEventListener,n=t.requestAnimationFrame,i=t.setTimeout,o=t.IntersectionObserver,s=t.ResizeObserver,l=function(t){return e.querySelector(t)},c=function(t){return e.querySelectorAll(t)},u=function(t){return e.querySelector("#"+t)},d=matchMedia("(prefers-reduced-motion: reduce)").matches,p={},f={},m=0;if("IntersectionObserver"in window){var g=new o(function(t){m=scrollY||pageYOffset,t.forEach(function(t){p[t.target.id]=t.isIntersecting,t.target.classList.toggle("is-live",t.isIntersecting)})},{rootMargin:"50% 0px 50% 0px"});[].forEach.call(c("section[id]"),function(t){g.observe(t)})}function h(t){if(!1===p[t]&&t in f&&Math.abs((scrollY||pageYOffset)-m)<.5*innerHeight)return f[t];var e=u(t);if(!e)return 0;var a=parseFloat(getComputedStyle(e).getPropertyValue("--sc-p"));return a=isNaN(a)?0:a,f[t]=a,a}function v(t,e){if(d){t.style.opacity="1",t.style.transform="none";return}var a=t.animate([{transform:"translateY(-42px) scale(1.06)",opacity:0}
1,{transform:"translateY(0) scale(1)",opacity:1}],{duration:360,delay:e||0,easing:"cubic-bezier(0.34, 1.22, 0.64, 1)",fill:"both"});a.onfinish=function(){t.style.opacity="1",t.style.transform="none";try{a.cancel()}catch(t){}t.classList.remove("is-snapped"),t.offsetWidth,t.classList.add("is-snapped")}}var y=l("[data-wipe]"),b=l(".vt-sub__body"),x=!1,w=["switch","ps5","xbox","pc"],_=l(".vt-range__stage"),S=[].slice.call(c(".vt-range__tab")),E=[].slice.call(c("[data-ladder] [data-plat]")),k=null,A=-1;function C(t){return t<.24?0:t<.48?1:t<.72?2:3}var M=[.24,.48,.72],F=matchMedia("(min-width: 901px)");function I(t){var e,a;t!==k&&_&&(k=t,_.setAttribute("data-plat",t),S.forEach(function(e){e.setAttribute("aria-selected",String(e.getAttribute("data-plat")===t))}),E.forEach(function(e){e.getAttribute("data-plat")===t?e.setAttribute("aria-current","true"):e.removeAttribute("aria-current")}),(a=tk[e=t])&&tA&&(tA.setAttribute("data-platform",a.famiglia),tA.setAttribute("data-piattaforma",e),tA.style.setProperty("--cu-dorso-bg",a.dorsoBg),tA.style.setProperty("--cu-dorso-fg",a.dorsoFg),tM&&(tM.style.transform="scale(var(--cu-k)) matrix3d("+a.panel+")"),tF&&(tF.style.width=a.dorsoW+"px",tF.style.transform="scale(var(--cu-k)) matrix3d("+a.dorso+")"),tI&&(tI.src=a.guscio),tL()))}S.forEach(function(t){t.addEventListener("click",function(){A=C(h("piattaforma")),I(t.getAttribute("data-plat"))})});var L=l(".vt-range__plinth"),q=function(t,e,a){return t+(e-t)*a},N=function(t){return t<0?0:t>1?1:t},P=function(t){return 1-Math.pow(1-t,2)},O=function(t){return 1-Math.pow(1-t,3)},j=u("hero"),T=l("[data-hero-film]"),R=l("[data-hero-video]"),z=l("[data-hero-still]"),Y=l("[data-hero-scrim]"),$=l("[data-hero-cta]"),U=$&&$.querySelector("input"),W=[].slice.call(c("[data-hero-at]")).map(function(t){return{el:t,at:parseFloat(t.getAttribute("data-hero-at"))||0,line:t.hasAttribute("data-hero-line")}}),B=-1,D=-1,H=1/0;function X(){j&&(H=j.getBoundingClientRect().bottom+(scrollY||pageYOffset))}var J=l("[data-entry-drop]"),G=l("[data-up-stage]"),V={};[].forEach.call(c("[data-up]"),function(t){V[t.getAttribute("data-up")]=t});var Q=[].slice.call(c(".vt-up__grid [data-cell]")),K=[{x:-60,y:-46,r:-5},{x:0,y:-64,r:3},{x:70,y:-30,r:5},{x:-40,y:60,r:4},{x:0,y:72,r:-3},{x:56,y:54,r:-4}];function Z(t,e,a){return N((t-e)/(a-e))}var tt=matchMedia("(min-width: 901px)"),te=!1,ta=-1,tr=u("entry"),tn=[].slice.call(c("#entry .gc__cover img, #entry .vt-fall__cover img")),ti=scrollY||pageYOffset,to=0,ts=0,tl=!1,tc=0,tu=null;r("resize",function(){tu=null});var td=[].slice.call(c(".vt-free__ch")),tp=[].slice.call(c('[data-free="tile"]')),tf=l("[data-blog-par]"),tm=[].slice.call(c('[data-blog="row"]')),tg=l('[data-stats="rule"]'),th=[].slice.call(c(".vt-stats__w")),tv=l('[data-stats="logos"]'),ty=l("[data-bar]"),tb=!1,tx=[].slice.call(c("[data-ground]"));if(ty&&"IntersectionObserver"in window&&tx.length){var tw=new o(function(t){t.forEach(function(t){if(t.isIntersecting){var e=t.target.getAttribute("data-ground");ty.classList.toggle("on-dark","dark"===e),ty.classList.toggle("on-light","light"===e)}})},{rootMargin:"-2% 0px -94% 0px",threshold:0});tx.forEach(function(t){tw.observe(t)})}var t_=0,tS=-1;function tE(){t_=0}["resize","pointerdown","keydown","focusin","focusout","input"].forEach(function(t){r(t,tE,{passive:!0})}),r("load",tE),document.fonts&&document.fonts.ready&&document.fonts.ready.then(tE),"ResizeObserver"in window&&new s(tE).observe(e);var tk={ps5:{famiglia:"playstation",dorsoBg:"#ffffff",dorsoFg:"#111111",dorsoW:66,panel:"1.5305693,0.084966361,0,0.000220202,0,1.4475741,0,0,0,0,1,0,76.765499,194.61725,0,1",dorso:"0.95250574,0.010971815,0,-7.5287e-05,0,1.241442,0,0,0,0,1,0,11.051213,350.84367,0,1",guscio:"/assets/custodie/ps5-guscio.webp"},xbox:{famiglia:"xbox",dorsoBg:"#54565a",dorsoFg:"#ffffff",dorsoW:35,panel:"1.5561001,0.092714625,0,0.00023369764,0.023268896,1.5225346,0,2.5513341e-05,0,0,1,0,57.197368,155.55921,0,1",dorso:"1.5131737,0.087196774,0,0.000227033,-0.0012995905,1.0861458,0,-0.0003074562,0,0,1,0,4.6907895,153.74342,0,1",guscio:"/assets/custodie/xbox-guscio.webp"},pc:{famiglia:"pc",dorsoBg:"#111827",dorsoFg:"#ffffff",dorsoW:29,panel:"1.5206822,0.23222697,0,0.00028140976,0.020409757,1.5667551,0,2.3340249e-05,0,0,1,0,109.68172,167.50564,0,1",dorso:"1.4789054,0.2050515,0,0.0002622263,-0.021294318,1.1066556,0,-0.00031487643,0,0,1,0,67.62754,162.83296,0,1",guscio:"/assets/custodie/pc-guscio.webp"},switch:{famiglia:"nintendo",dorsoBg:"#e60012",dorsoFg:"#ffffff",dorsoW:30,panel:"1.1968366,0.018109366,0,8.4249084e-05,0,1.6392644,0,0,0,0,1,0,122.51093,43.89662,0,1",dorso:"1.3973993,0.10063469,0,0.00020920502,0,1.6495527,0,0,0,0,1,0,81.357853,41.153082,0,1",guscio:"/assets/custodie/switch-guscio.webp"}},tA=u("bx-case"),tC=u("bx-scena"),tM=tC?tC.querySelector(".rynko-case__stampa"):null,tF=tC?tC.querySelector(".rynko-case__dorso"):null,tI=tC?tC.querySelector(".rynko-case__guscio"):null;
1function tL(){if(tC){var t=tC.offsetHeight||tC.getBoundingClientRect().height;t>0&&tC.style.setProperty("--cu-k",String(t/1400))}}!function(){if(R&&(X(),r("resize",X),r("load",X),U&&innerWidth<480&&(U.placeholder="Cerca un gioco"),!d)){R.muted=!0,R.addEventListener("playing",function(){z&&(z.hidden=!0)});var t=R.querySelector("source:last-of-type");t&&t.addEventListener("error",n),i(),"IntersectionObserver"in window&&j&&new o(function(t){t.forEach(function(t){t.isIntersecting?i():R.pause()})},{threshold:.05}).observe(j);var e=matchMedia("(max-aspect-ratio: 4/5)"),a=e.matches;e.addEventListener?e.addEventListener("change",s):e.addListener&&e.addListener(s),$&&j&&$.addEventListener("focusin",function(){h("hero")>=.62||scrollTo({top:j.getBoundingClientRect().top+(scrollY||pageYOffset)+(j.offsetHeight-innerHeight)*.66,behavior:"instant"})})}function n(){z&&([].forEach.call(z.querySelectorAll("source, img"),function(t){var e="IMG"===t.tagName?"src":"srcset";t.setAttribute(e,t.getAttribute(e).replace("-first.","-last."))}),z.hidden=!1)}function i(){if(!R.ended&&!R.error){var t=R.play();t&&t.catch&&t.catch(function(t){t&&"NotAllowedError"===t.name&&n()})}}function s(){if(e.matches!==a){a=e.matches;var t=R.currentTime,r=R.ended;R.load(),R.addEventListener("loadedmetadata",function e(){R.removeEventListener("loadedmetadata",e),R.currentTime=r?Math.max(R.duration-.05,0):t,r||i()})}}}(),[].forEach.call(c(".gc"),function(t){if(!t.querySelector("[data-field]")){var e=[].slice.call(t.querySelectorAll(".gc__plat"));e.length<2||(e.some(function(t){return t.classList.contains("is-active")})||e[0].classList.add("is-active"),e.forEach(function(a){function r(){if(e.forEach(function(t){t.classList.toggle("is-active",t===a)}),a.hasAttribute("data-now")){var r=t.querySelector(".gc__now"),n=t.querySelector(".gc__was"),o=t.querySelector(".gc__off"),s=t.querySelector(".gc__store"),l=t.querySelector(".gc__for"),c=t.querySelector(".gc__price");c&&(c.style.transition="opacity 140ms ease",c.style.opacity="0.35",i(function(){c.style.opacity="1"},140)),r&&(r.textContent=a.getAttribute("data-now")),n&&(n.textContent=a.hasAttribute("data-was")?a.getAttribute("data-was"):n.textContent),o&&(o.textContent=a.hasAttribute("data-off")?a.getAttribute("data-off"):o.textContent),s&&(s.textContent=a.hasAttribute("data-store")?a.getAttribute("data-store"):s.textContent),l&&(l.textContent="per "+a.textContent);var u=a.getAttribute("data-platform-key");if(u&&"A"===t.tagName)try{var d=new URL(t.getAttribute("href"),location.origin);d.searchParams.set("platform",u),t.setAttribute("href",d.pathname+d.search)}catch(t){}var p=t.querySelector(".gc__kind");p&&a.hasAttribute("data-kind")&&(p.textContent=a.getAttribute("data-kind"))}}a.setAttribute("role","button"),a.setAttribute("tabindex","0"),a.addEventListener("click",function(t){t.preventDefault(),t.stopPropagation(),r()}),a.addEventListener("keydown",function(t){("Enter"===t.key||" "===t.key)&&(t.preventDefault(),t.stopPropagation(),r())})}))}}),function(){d||e.classList.add("vt-anim");var t=[].slice.call(c(".vt-hero, [data-drop-group]"));if(!("IntersectionObserver"in window))return t.forEach(function(t){[].forEach.call(t.querySelectorAll(".vt-drop"),function(t,e){v(t,90*e)})});var a=new o(function(t){t.forEach(function(t){t.isIntersecting&&([].forEach.call(t.target.querySelectorAll(".vt-drop"),function(t,e){v(t,90*e)}),a.unobserve(t.target))})},{rootMargin:"0px 0px -18% 0px",threshold:.2});t.forEach(function(t){a.observe(t)})}(),!d&&matchMedia("(hover: hover) and (pointer: fine)").matches&&[].forEach.call(c("[data-magnet]"),function(t){t.classList.add("vt-magnet"),t.addEventListener("pointermove",function(e){var a=t.getBoundingClientRect(),r=(getComputedStyle(t).translate||"").split(" "),n=parseFloat(r[0])||0,i=parseFloat(r[1])||0,o=Math.max(-1,Math.min(1,(e.clientX-(a.left-n+a.width/2))/(a.width/2))),s=Math.max(-1,Math.min(1,(e.clientY-(a.top-i+a.height/2))/(a.height/2)));t.style.translate=(6*o).toFixed(1)+"px "+(4*s).toFixed(1)+"px"}),t.addEventListener("pointerleave",function(){t.style.translate=""})}),I("switch"),tL(),n(function t(){var e=scrollY||pageYOffset;if(e!==tS?(tS=e,t_=0):t_++,t_>90)return void n(t);if(!function(){if(!(!$||d||(scrollY||pageYOffset)>H)){var t=h("hero"),e=$.contains(document.activeElement)||U&&U.value?Math.max(t,.62):t;if(!(2e-4>Math.abs(t-B)&&2e-4>Math.abs(e-D))){B=t,D=e;var a=O(Z(e,0,.5));$.style.transform="translate3d(0,calc("+(1-a).toFixed(4)+" * (100% + 14vh)),0)",W.forEach(function(t){var a=O(Z(e,t.at,t.at+.36));t.line?t.el.style.transform="translate3d(0,"+((1-a)*120).toFixed(2)+"%,0)":(t.el.style.opacity=a.toFixed(3),t.el.style.transform="translate3d(0,"+((1-a)*6).toFixed(1)+"px,0)")}),Y&&(Y.style.opacity=P(Z(e,0,.45)).toFixed(3)),T&&(T.style.transform="scale("+(1+.06*P
1(Z(t,0,.62))).toFixed(4)+")")}}}(),J&&!d){var a,r=(a=N((h("entry")-.8)/.2))*a;J.style.transform="translate3d(0,"+(22*r).toFixed(2)+"vh,0)",J.style.opacity=(1-.92*r).toFixed(3)}if(!function(){var t=performance.now(),e=scrollY||pageYOffset,a=to?Math.min(100,Math.max(1,t-to)):16.67,r=e-ti;if(ti=e,to=t,tr&&!d&&tn.length){var n=1-Math.pow(.82,a/16.67),i=h("entry"),o=Math.max(-3,Math.min(3,-(.06*(ts+=(16.67*(i>0&&i<1?r:0)/a-ts)*n)))),s=.5*a/16.67,l=tc+=Math.max(-s,Math.min(s,o-tc));if(.04>Math.abs(l)){tl&&(tn.forEach(function(t){t.style.transform=""}),tl=!1),.04>Math.abs(o)&&(tc=0);return}tu||(tu=tn.map(function(t){var e=t.parentElement;return e.offsetWidth?e.offsetHeight/e.offsetWidth:1.5})),tl=!0;var c=Math.tan(Math.abs(l)*Math.PI/180);tn.forEach(function(t,e){var a=1/Math.max(.5,1-c*tu[e])+.002;t.style.transform="skewX("+l.toFixed(2)+"deg) scale("+a.toFixed(4)+")"})}}(),!function(){if(G&&!d){if(!tt.matches){te||([G,V.feat].concat(Q).forEach(function(t){t&&(t.style.transform="",t.style.opacity="",t.inert=!1,t.classList.remove("is-set"))}),te=!0,ta=-1);return}te=!1;var t=h("arrivi");2e-4>Math.abs(t-ta)||(ta=t,G.style.transform="translate3d(0,"+q(40,0,P(N(t/.6))).toFixed(1)+"px,0)",V.feat&&e(V.feat,O(Z(t,.02,.3)),0,48,0),Q.forEach(function(a,r){var n=K[r%K.length];e(a,O(Z(t,.14+.07*r,.46+.07*r)),n.x,n.y,n.r)}))}function e(t,e,a,r,n){var i,o;e>=1?(t.style.transform="",t.style.opacity="1"):(t.style.opacity=e.toFixed(3),t.style.transform="translate3d("+q(a,0,e).toFixed(1)+"px,"+q(r,0,e).toFixed(1)+"px,0)"+(n?" rotate("+q(n,0,e).toFixed(2)+"deg)":"")),i=e<.99,o=e>=1,t.inert!==i&&(t.inert=i),t.classList.contains("is-set")!==o&&t.classList.toggle("is-set",o)}}(),tp.length&&!d){var i=h("free");td.forEach(function(t,e){var a=O(Z(i,.02+.035*e,.3+.035*e));t.style.opacity=a.toFixed(3),t.style.transform="scale("+q(.9,1,a).toFixed(3)+") rotate("+q(-6,0,a).toFixed(2)+"deg)"}),tp.forEach(function(t,e){var a,r=P(Z(i,.18+.12*e,.6+.12*e)),n=t.getAttribute("data-wipe-from");a="right"===n?"inset(0 0 0 "+q(100,0,r).toFixed(1)+"%)":"bottom"===n?"inset(0 0 "+q(100,0,r).toFixed(1)+"% 0)":"inset(0 "+q(100,0,r).toFixed(1)+"% 0 0)",t.style.clipPath=a,t.style.opacity=Math.max(.001,r).toFixed(3)})}if(!d){var o=h("blog");tf&&(tf.style.transform="translateY("+q(-7,0,N(o)).toFixed(2)+"%)"),tm.forEach(function(t,e){var a=P(Z(o,.1+.1*e,.52+.1*e));t.style.opacity=Math.max(.001,a).toFixed(3),t.style.transform="translateY("+q(14,0,a).toFixed(2)+"px)"})}if(tg&&!d){var s=h("stats"),l=P(Z(s,.06,.26));if(tg.style.transform="scaleX("+l.toFixed(3)+")",th.forEach(function(t,e){var a=P(Z(s,.14+.035*e,.34+.035*e));t.style.opacity=N(a).toFixed(3),t.style.transform="rotateX("+q(90,0,N(a)).toFixed(2)+"deg)"}),tv){var c=P(Z(s,.3,.5));tv.style.opacity=N(c).toFixed(3)}}if(y){var u,p=h("come");if(u=d?-101:p<=0?101:p<.1?101-p/.1*101:p<.22?-((p-.1)/.12*101):-101,y.style.transform="translateY("+u.toFixed(2)+"%)",b&&!d){var f=u>-100;f&&!x?(b.style.setProperty("opacity","0","important"),x=!0):!f&&x&&(b.style.removeProperty("opacity"),x=!1)}}if(!function(){var t=h("piattaforma");if(L&&!d&&window.innerWidth>900?L.style.transform="translate3d("+((.5-t)*48).toFixed(1)+"px,0,0) perspective(1400px) rotateY("+((t-.5)*10).toFixed(2)+"deg)":L&&(L.style.transform="none"),!d&&F.matches){var e,a,r=(e=C(t),(a=w.indexOf(k))<0||e===a?e:.02>Math.abs(t-(e>a?M[e-1]:M[e]))?a:e);if(A>=0){if(r===A)return;A=-1}I(w[r])}}(),ty){var m=(scrollY||pageYOffset)>.9*innerHeight;m!==tb&&(ty.classList.toggle("is-solid",m),tb=m)}n(t)}),(a=l(".gc__cover--bx"))&&"ResizeObserver"in window&&new s(tL).observe(a)}(r,e),function(t,e){var a=t.requestAnimationFrame,r=t.MutationObserver,n="/assets/logos/",i="/assets/brand/",o=String.fromCharCode(160),s={kinguin:{f:n+"kinguin.png",t:"kinguin"},k4g:{f:n+"k4g.png",t:"k4g"},steam:{f:n+"steam.svg",t:"steam",mono:1},gmg:{f:n+"gmg.svg",t:"gmg"},"green man gaming":{f:n+"gmg.svg",t:"gmg"},"instant gaming":{f:n+"instant.svg",t:"instant"},instant:{f:n+"instant.svg",t:"instant"},fanatical:{f:n+"fanatical.svg",t:"fanatical"},gamivo:{f:n+"gamivo.ico",t:"gamivo"},cdkeys:{f:n+"cdkeys.png",t:"cdkeys"},"ps store":{f:n+"psstore.svg",t:"psstore"},"playstation store":{f:n+"psstore.svg",t:"psstore"},"xbox store":{f:n+"xbox.svg",t:"xbox",mono:1},xbox:{f:n+"xbox.svg",t:"xbox",mono:1},"nintendo eshop":{f:n+"nintendo.svg",t:"nintendo",mono:1},nintendo:{f:n+"nintendo.svg",t:"nintendo",mono:1},eneba:{f:n+"eneba.png",t:"eneba"},g2a:{f:n+"g2a.svg",t:"g2a",mono:1},gog:{f:n+"gog.svg",t:"gog",mono:1},"epic games store":{f:n+"epicgames.svg",t:"epic",mono:1},yuplay:{f:n+"yuplay.png",t:"yuplay"},gameseal:{f:n+"gameseal.png",t:"gameseal"},gamesplanet:{f:n+"gamesplanet.png",t:"gamesplanet"},indiegala:{f:n+"indiegala.png",t:"indiegala"},hrk:{f:n+"hrk.png",t:"hrk"}},l={pc:{f:i+"pc.svg",t:"plat-pc",mono:1},ps5:{f:n+"playstation.svg",t:"plat-ps",mono:1},ps4:{f:n+"playstation.svg",t:"plat-ps",mono:1},xbox:{f:n+"xbox.svg",t:"plat-xbox",mono:1},switch:{f:i+"nintendo.svg",t:"plat-nintendo",mono:1},"switch 2":{f:i+"nintendo.svg",t:"plat-nintendo",mono:1}},c=getComputedStyle(e);function u(t){return void 0===t.c&&(t.c=(c.getPropertyValue("--brand-"+t.t)||"").trim()),t.c}function d(t){return(t||"").toLowerCase().split(o).join(" ").replace(/[^a-z0-9 ]+/g,"").replace(/\s+/g," ").trim()}function p(t){var e=t.replace("#","");3===e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);var a=parseInt(e,16),r=[a>>16&255,a>>8&255,255&a].map(function(t){return(t/=255)<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}
1);return .2126*r[0]+.7152*r[1]+.0722*r[2]>=.12?t:"rgb("+[a>>16&255,a>>8&255,255&a].map(function(t){return Math.round(t+(245-t)*.8)}).join(" ")+")"}function f(t,e){var a=document.createElement("i");if(a.className="rk-logo",a.setAttribute("aria-hidden","true"),t.c&&(a.style.setProperty("--brand",t.c),a.style.setProperty("--brand-lift",p(t.c))),t.mono)a.setAttribute("data-mono",""),a.style.setProperty("--logo",'url("'+t.f+'")');else{var r=document.createElement("img");r.src=t.f,r.alt="",r.loading="lazy",a.appendChild(r)}return a.title=e,a}function m(t){if(!t.querySelector(".rk-logo")){var e,a=(t.textContent||"").split(o).join(" ").trim(),r=l[d(a)];r&&u(r)&&(t.setAttribute("data-brand",d(a).split(" ").join("")),t.setAttribute("aria-label",a),t.replaceChildren(f(r,a),((e=document.createElement("span")).className="rk-sr",e.textContent=a,e)))}}function g(t){if(!t.querySelector(".rk-logo")){var e=(t.textContent||"").split(o).join(" ").trim();if(e){var a=s[d(e)];if(t.setAttribute("data-store-name",e),!a||a.mono&&!u(a))return void t.setAttribute("data-nologo","");u(a),t.removeAttribute("data-nologo"),a.c&&(t.style.setProperty("--brand",a.c),t.style.setProperty("--brand-lift",p(a.c)));var r=document.createElement("span");r.className="rk-store-name",r.textContent=e,t.replaceChildren(f(a,e),r)}}}function h(t){var e=t||document;[].forEach.call(e.querySelectorAll(".gc__plat, .pdp3-morph__tag, .pdp3-ladder__plat"),m),[].forEach.call(e.querySelectorAll(".gc__store, .pdp3-ladder__store"),g)}if(h(e),e.classList.add("rk-brands"),"MutationObserver"in window){var v=!1;new r(function(t){v||t.some(function(t){var e=1===t.target.nodeType?t.target:t.target.parentElement;return e&&e.closest&&e.closest(".gc__store, .gc__plats, .pdp3-morph__plats")})&&(v=!0,a(function(){v=!1,h(e)}))}).observe(e,{childList:!0,characterData:!0,subtree:!0})}}(r,e)}catch(t){console.error("[home] runtime",t),e.classList.remove("vt-anim")}let f=async t=>{let r=t.target,i=r?.closest?.(".gc__save button");if(!i||!e.contains(i))return;t.preventDefault(),t.stopPropagation();let l=i.closest(".gc"),c=l?.dataset.gameId;if(l&&c){if(i.classList.contains("gc__heart")){if(!(0,s.M3)())return void window.location.assign("/account?next="+encodeURIComponent("/"));if("true"===i.getAttribute("aria-pressed"))return;i.setAttribute("aria-busy","true");try{await (0,o.iI)(c),n||i.setAttribute("aria-pressed","true")}catch(t){console.error("[home] wishlist",t)}finally{i.removeAttribute("aria-busy")}return}if(i.classList.contains("gc__bell")){let t=Number(l.dataset.price);a.current({gameId:c,gameTitle:l.dataset.title??c,coverUrl:l.dataset.cover??null,currentPrice:Number.isFinite(t)&&t>0?t:0,histMin:null,platform:l.dataset.platform??null})}}};return e.addEventListener("click",f,!0),()=>{n=!0,e.removeEventListener("click",f,!0),r.dispose(),e.classList.remove("vt-anim","sc-ready","rk-brands"),e.style.removeProperty("--sc-seg"),e.style.removeProperty("--sc-segp"),e.style.removeProperty("--sc-canvas")}},[]),(0,r.jsx)("span",{ref:t,hidden:!0})}},80106:(t,e,a)=>{"use strict";function r(t){return Math.round(100*t)/100}function n(t,e){let a=Math.max(t,.01);return[{id:"atl",label:"Minimo storico (ATL)",description:"Email solo quando il prezzo tocca il record pi\xf9 basso mai visto",targetPrice:null!=e&&e>0&&e<a?r(e):r(.85*a),atlOnly:!0},{id:"minus10",label:"â10% dal prezzo attuale",description:"Primo calo fisiologico rispetto al prezzo di oggi",targetPrice:r(.9*a)},{id:"psych",label:"Soglia psicologica",description:"Prezzo âtondoâ sotto quello attuale",targetPrice:function(t){if(t<=5)return r(Math.max(.99,t-.5));let e=Math.floor(t)-.01;return r(e>0?e:.95*t)}(a)}]}function i(t,e,a){let r=t.find(t=>"minus10"===t.id),n=t.find(t=>"atl"===t.id);return null!=a&&a>0&&e-a>=.08*e?"atl":r&&r.targetPrice>0?"minus10":n?.targetPrice?"atl":"minus10"}function o(t,e){return t.find(t=>t.id===e)??t[1]??t[0]}a.d(e,{Wx:()=>i,bT:()=>n,iH:()=>o})},85760:()=>{},89196:()=>{}}]);
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.