playlight-sdk 0.1.11 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -19,5 +19,5 @@ var PlaylightSDK=function(){"use strict";var t,n,r,o,i,l,a,s=t=>{throw TypeError
|
|
|
19
19
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
20
20
|
*
|
|
21
21
|
*/
|
|
22
|
-
const ir={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};var lr=He("<svg><!><!></svg>");function ar(t,e){const n=tr(e,["children","$$slots","$$events","$$legacy"]),r=tr(n,["name","color","size","strokeWidth","absoluteStrokeWidth","iconNode"]);G(e,!1);let o=rr(e,"name",8,void 0),i=rr(e,"color",8,"currentColor"),l=rr(e,"size",8,24),a=rr(e,"strokeWidth",8,2),s=rr(e,"absoluteStrokeWidth",8,!1),u=rr(e,"iconNode",24,(()=>[]));Gn();var c=lr();let d;var f=ct(c);on(f,1,u,rn,((t,e)=>{var n,r,o,i,l,a,s,u,c,d=Ke();n=dt(d),r=()=>we(e)[0],o=(t,n)=>{let r;Ct((()=>r=Sn(t,r,{...we(e)[1]})))},s=null,u=n,c=en,St((()=>{const t=r()||null;if(t!==i){var e=en;nn(c),a&&(null===t?Tt(a,(()=>{a=null,l=null})):t===l?At(a):(jt(a),Ze(!1))),t&&t!==l&&(a=Pt((()=>{if(Fe(s=document.createElementNS("http://www.w3.org/2000/svg",t),s),o){var e=s.appendChild(at());o(s,e)}Xt.nodes_end=s,u.before(s)}))),(i=t)&&(l=i),Ze(!0),nn(e)}}),j),Ue(t,d)})),cn(ft(f),e,"default",{},null),Ct(((t,e)=>d=Sn(c,d,{...ir,...r,width:l(),height:l(),stroke:i(),"stroke-width":t,class:e})),[()=>s()?24*Number(a())/Number(l()):a(),()=>((...t)=>t.filter(((t,e,n)=>Boolean(t)&&n.indexOf(t)===e)).join(" "))("lucide-icon","lucide",o()?`lucide-${o()}`:"",n.class)],pt),Ue(t,c),F()}function sr(t,e){const n=tr(e,["children","$$slots","$$events","$$legacy"]);ar(t,nr({name:"loader-circle"},(()=>n),{iconNode:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56"}]],children:(t,n)=>{var r=Ke();cn(dt(r),e,"default",{},null),Ue(t,r)},$$slots:{default:!0}}))}var ur=(t,e)=>{var n;null==(n=e.onClick)||n.call(e)},cr=Re('<button id="floating playlight button" aria-label="Open Playlight Discovery"><p class="z-2 flex items-center overflow-hidden svelte-1j97rta"><!> <span class="mr-0.25 inline-block font-bold svelte-1j97rta">More Games</span></p> <div class="absolute bottom-0 left-0 h-full w-0 bg-background transition-all duration-300 group-hover:w-full svelte-1j97rta"></div></button>');function dr(t){const e=t-1;return e*e*e+1}function fr(t){return t<.5?4*t*t*t:.5*Math.pow(2*t-2,3)+1}function vr(t){const e="string"==typeof t&&t.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[t,"px"]}function pr(t,{delay:e=0,duration:n=400,easing:r=fr,amount:o=5,opacity:i=0}={}){const l=getComputedStyle(t),a=+l.opacity,s="none"===l.filter?"":l.filter,u=a*(1-i),[c,d]=vr(o);return{delay:e,duration:n,easing:r,css:(t,e)=>`opacity: ${a-u*e}; filter: ${s} blur(${e*c}${d});`}}function hr(t,{delay:e=0,duration:n=400,easing:r=dr,x:o=0,y:i=0,opacity:l=0}={}){const a=getComputedStyle(t),s=+a.opacity,u="none"===a.transform?"":a.transform,c=s*(1-l),[d,f]=vr(o),[v,p]=vr(i);return{delay:e,duration:n,easing:r,css:(t,e)=>`\n\t\t\ttransform: ${u} translate(${(1-t)*d}${f}, ${(1-t)*v}${p});\n\t\t\topacity: ${s-c*e}`}}function gr(t,{delay:e=0,duration:n=400,easing:r=dr,axis:o="y"}={}){const i=getComputedStyle(t),l=+i.opacity,a="y"===o?"height":"width",s=parseFloat(i[a]),u="y"===o?["top","bottom"]:["left","right"],c=u.map((t=>`${t[0].toUpperCase()}${t.slice(1)}`)),d=parseFloat(i[`padding${c[0]}`]),f=parseFloat(i[`padding${c[1]}`]),v=parseFloat(i[`margin${c[0]}`]),p=parseFloat(i[`margin${c[1]}`]),h=parseFloat(i[`border${c[0]}Width`]),g=parseFloat(i[`border${c[1]}Width`]);return{delay:e,duration:n,easing:r,css:t=>`overflow: hidden;opacity: ${Math.min(20*t,1)*l};${a}: ${t*s}px;padding-${u[0]}: ${t*d}px;padding-${u[1]}: ${t*f}px;margin-${u[0]}: ${t*v}px;margin-${u[1]}: ${t*p}px;border-${u[0]}-width: ${t*h}px;border-${u[1]}-width: ${t*g}px;min-${a}: 0`}}function mr(t,{delay:e=0,duration:n=400,easing:r=dr,start:o=0,opacity:i=0}={}){const l=getComputedStyle(t),a=+l.opacity,s="none"===l.transform?"":l.transform,u=1-o,c=a*(1-i);return{delay:e,duration:n,easing:r,css:(t,e)=>`\n\t\t\ttransform: ${s} scale(${1-u*e});\n\t\t\topacity: ${a-c*e}\n\t\t`}}Le(["click"]);var yr=He('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd"></path></svg>'),br=He('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>'),wr=He('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z" clip-rule="evenodd"></path></svg>'),xr=He('<svg viewBox="0 0 64 64" fill="currentColor" height="20" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M32.427,7.987c2.183,0.124 4,1.165 5.096,3.281l17.936,36.208c1.739,3.66 -0.954,8.585 -5.373,8.656l-36.119,0c-4.022,-0.064 -7.322,-4.631 -5.352,-8.696l18.271,-36.207c0.342,-0.65 0.498,-0.838 0.793,-1.179c1.186,-1.375 2.483,-2.111 4.748,-2.063Zm-0.295,3.997c-0.687,0.034 -1.316,0.419 -1.659,1.017c-6.312,11.979 -12.397,24.081 -18.301,36.267c-0.546,1.225 0.391,2.797 1.762,2.863c12.06,0.195 24.125,0.195 36.185,0c1.325,-0.064 2.321,-1.584 1.769,-2.85c-5.793,-12.184 -11.765,-24.286 -17.966,-36.267c-0.366,-0.651 -0.903,-1.042 -1.79,-1.03Z"></path><path d="M33.631,40.581l-3.348,0l-0.368,-16.449l4.1,0l-0.384,16.449Zm-3.828,5.03c0,-0.609 0.197,-1.113 0.592,-1.514c0.396,-0.4 0.935,-0.601 1.618,-0.601c0.684,0 1.223,0.201 1.618,0.601c0.395,0.401 0.593,0.905 0.593,1.514c0,0.587 -0.193,1.078 -0.577,1.473c-0.385,0.395 -0.929,0.593 -1.634,0.593c-0.705,0 -1.249,-0.198 -1.634,-0.593c-0.384,-0.395 -0.576,-0.886 -0.576,-1.473Z"></path></svg>');function _r(t,e){let n=rr(e,"type",8,"success");var r=Ke(),o=dt(r),i=t=>{Ue(t,yr())},l=(t,e)=>{var r=t=>{Ue(t,br())},o=(t,e)=>{var r=t=>{Ue(t,wr())},o=(t,e)=>{var r=t=>{Ue(t,xr())},o=t=>{};tn(t,(t=>{"warning"===n()?t(r):t(o,!1)}),e)};tn(t,(t=>{"info"===n()?t(r):t(o,!1)}),e)};tn(t,(t=>{"error"===n()?t(r):t(o,!1)}),e)};tn(o,(t=>{"success"===n()?t(i):t(l,!1)})),Ue(t,r)}var $r=Re('<div class="sonner-loading-bar"></div>'),kr=Re('<div class="sonner-loading-wrapper"><div class="sonner-spinner"></div></div>');function Cr(...t){return t.filter(Boolean).join(" ")}const Sr="undefined"!=typeof document;function Pr(t){const e=Vn(t);return{subscribe:e.subscribe,set:function(t){Sr&&e.set(t)},update:function(t){Sr&&e.update(t)}}}let Mr=0;const Ir=function(){const t=Pr([]),e=Pr([]);function n(e){t.update((t=>[e,...t]))}function r(e){var r;const{message:o,...i}=e,l="number"==typeof(null==e?void 0:e.id)||e.id&&(null==(r=e.id)?void 0:r.length)>0?e.id:Mr++,a=void 0===e.dismissable||e.dismissable,s=void 0===e.type?"default":e.type;return Kn(t).find((t=>t.id===l))?t.update((t=>t.map((t=>t.id===l?{...t,...e,id:l,title:o,dismissable:a,type:s,updated:!0}:{...t,updated:!1})))):n({...i,id:l,title:o,dismissable:a,type:s}),l}function o(e){if(void 0!==e)return t.update((t=>t.map((t=>t.id===e?{...t,dismiss:!0}:t)))),e;t.update((t=>t.map((t=>({...t,dismiss:!0})))))}return{create:r,addToast:n,dismiss:o,remove:function(e){if(void 0!==e)return t.update((t=>t.filter((t=>t.id!==e)))),e;t.set([])},message:function(t,e){return r({...e,type:"default",message:t})},error:function(t,e){return r({...e,type:"error",message:t})},success:function(t,e){return r({...e,type:"success",message:t})},info:function(t,e){return r({...e,type:"info",message:t})},warning:function(t,e){return r({...e,type:"warning",message:t})},loading:function(t,e){return r({...e,type:"loading",message:t})},promise:function(t,e){if(!e)return;let n;void 0!==e.loading&&(n=r({...e,promise:t,type:"loading",message:e.loading}));const i=t instanceof Promise?t:t();let l=void 0!==n;return i.then((t=>{if(t&&"boolean"==typeof t.ok&&!t.ok){l=!1;const o="function"==typeof e.error?e.error(`HTTP error! status: ${t.status}`):e.error;r({id:n,type:"error",message:o})}else if(void 0!==e.success){l=!1;const o="function"==typeof e.success?e.success(t):e.success;r({id:n,type:"success",message:o})}})).catch((t=>{if(void 0!==e.error){l=!1;const o="function"==typeof e.error?e.error(t):e.error;r({id:n,type:"error",message:o})}})).finally((()=>{var t;l&&(o(n),n=void 0),null==(t=e.finally)||t.call(e)})),n},custom:function(t,e){const n=(null==e?void 0:e.id)||Mr++;return r({component:t,id:n,...e}),n},removeHeight:function(t){e.update((e=>e.filter((e=>e.toastId!==t))))},setHeight:function(t){void 0!==Kn(e).find((e=>e.toastId===t.toastId))?e.update((e=>e.map((e=>e.toastId===t.toastId?t:e)))):e.update((e=>[t,...e]))},reset:function(){t.set([]),e.set([])},toasts:t,heights:e}}(),jr=Object.assign((function(t,e){return Ir.create({message:t,...e})}),{success:Ir.success,info:Ir.info,warning:Ir.warning,error:Ir.error,custom:Ir.custom,message:Ir.message,promise:Ir.promise,dismiss:Ir.dismiss,loading:Ir.loading});var Er=Re('<button aria-label="Close toast" data-close-button=""><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></button>'),Tr=Re('<div data-icon=""><!> <!></div>'),Nr=Re('<div data-title=""><!></div>'),Or=Re('<div data-description=""><!></div>'),Ar=Re('<button data-button="" data-cancel=""> </button>'),Br=Re('<button data-button=""> </button>'),zr=Re('<!> <div data-content=""><!> <!></div> <!> <!>',1),Dr=Re('<li aria-atomic="true" role="status" data-sonner-toast=""><!> <!></li>');function qr(t,e){const n=tr(e,["children","$$slots","$$events","$$legacy"]);G(e,!1);const[r,o]=Xn(),i=()=>Zn(_,"$heights",r),l=()=>Zn(we(lt),"$effect",r),a=U(void 0,!0),s=U(void 0,!0),u=U(void 0,!0),c=U(void 0,!0),d=U(void 0,!0),f=U(void 0,!0),v=U(void 0,!0),p=U(void 0,!0),h=U(void 0,!0),g=U(void 0,!0),m=U(void 0,!0),y=U(void 0,!0),b={toast:"",title:"",description:"",loader:"",closeButton:"",cancelButton:"",actionButton:"",action:"",warning:"",error:"",success:"",default:"",info:"",loading:""},{toasts:w,heights:_,removeHeight:$,setHeight:k,remove:C}=Ir;let S=rr(e,"toast",9),P=rr(e,"index",9),M=rr(e,"expanded",9),I=rr(e,"invert",13),j=rr(e,"position",9),E=rr(e,"visibleToasts",9),T=rr(e,"expandByDefault",9),N=rr(e,"closeButton",9),O=rr(e,"interacting",9),A=rr(e,"cancelButtonStyle",9,""),B=rr(e,"actionButtonStyle",9,""),z=rr(e,"duration",9,4e3),D=rr(e,"descriptionClass",9,""),q=rr(e,"classes",29,(()=>({}))),L=rr(e,"unstyled",9,!1),W=U(!1,!0),R=U(!1,!0),H=U(!1,!0),V=U(!1,!0),K=U(0,!0),Y=U(0,!0),J=U(void 0,!0),X=U(0,!0),Q=0,tt=0,et=null;function nt(){Z(R,!0),Z(K,we(X)),$(S().id),setTimeout((()=>{C(S().id)}),200)}let rt=U(void 0,!0),ot=U(S().duration||z()||4e3,!0);function it(){Q=(new Date).getTime(),Z(rt,setTimeout((()=>{var t,e;null==(e=(t=S()).onAutoClose)||e.call(t,S()),nt()}),we(ot)))}let lt=U(void 0,!0);or((()=>{Z(W,!0);const t=we(J).getBoundingClientRect().height;return Z(Y,t),k({toastId:S().id,height:t}),()=>$(S().id)})),_t((()=>ke(q())),(()=>{q({...b,...q()})})),_t((()=>ke(P())),(()=>{Z(a,0===P())})),_t((()=>(ke(P()),ke(E()))),(()=>{Z(s,P()+1<=E())})),_t((()=>ke(S())),(()=>{Z(u,S().title)})),_t((()=>ke(S())),(()=>{Z(c,S().description)})),_t((()=>ke(S())),(()=>{Z(d,S().type)})),_t((()=>ke(S())),(()=>{Z(f,S().class||"")})),_t((()=>ke(S())),(()=>{Z(v,S().descriptionClass||"")})),_t((()=>(i(),ke(S()))),(()=>{Z(p,i().findIndex((t=>t.toastId===S().id))||0)})),_t((()=>ke(j())),(()=>{Z(h,j().split("-"))})),_t((()=>(i(),we(p))),(()=>{Z(g,i().reduce(((t,e,n)=>n>=we(p)?t:t+e.height),0))})),_t((()=>(ke(I()),ke(S()))),(()=>{I(S().invert||I())})),_t((()=>we(d)),(()=>{Z(m,"loading"===we(d))})),_t((()=>(we(p),we(g))),(()=>{Z(X,Math.round(14*we(p)+we(g)))})),_t((()=>(we(u),we(c))),(()=>{we(u),we(c),async function(){if(!we(W))return;let t;await async function(){await Promise.resolve(),function(){for(Wt();Ut.length>0;)Ft=!0,ge(),Wt()}()}(),t=M()||T()?1:1-.05*P(),we(J).style.setProperty("height","auto");const e=we(J).offsetHeight,n=we(J).getBoundingClientRect().height,r=Math.round(100*(n/t+Number.EPSILON))/100;let o;we(J).style.removeProperty("height"),o=Math.abs(r-e)<1?r:e,Z(Y,o),k({toastId:S().id,height:o})}()})),_t((()=>(ke(S()),we(rt),ke(z()))),(()=>{S().updated&&(clearTimeout(we(rt)),Z(ot,S().duration||z()||4e3),it())})),_t((()=>(ke(S()),we(d))),(()=>{Z(y,S().promise&&"loading"===we(d)||S().duration===Number.POSITIVE_INFINITY)})),_t((()=>(we(y),ke(M()),ke(O()),we(rt))),(()=>{var t;!function(t,e,n){let r=n[e];r&&r.store!==t&&(r.unsubscribe(),r.unsubscribe=x)}(Z(lt,(t=()=>(we(y)||(M()||O()?function(){if(tt<Q){const t=(new Date).getTime()-Q;Z(ot,we(ot)-t)}tt=(new Date).getTime()}():it()),()=>clearTimeout(we(rt))),{subscribe:t})),"$effect",r)})),_t((()=>l()),(()=>{l()})),_t((()=>ke(S())),(()=>{S().delete&&nt()})),$t(),Gn(!0);var at=Dr();let st;Cn(at,"tabindex",0);var ut=ct(at),vt=t=>{var e=Er();Ct((t=>{Cn(e,"data-disabled",we(m)),mn(e,1,t)}),[()=>{var t,e,n;return vn(Cr(null==(t=q())?void 0:t.closeButton,null==(n=null==(e=S())?void 0:e.classes)?void 0:n.closeButton))}],pt),qe("click",e,(function(...t){var e;null==(e=we(m)?void 0:()=>{var t,e;nt(),null==(e=(t=S()).onDismiss)||e.call(t,S())})||e.apply(this,t)})),Ue(t,e)};tn(ut,(t=>{N()&&!S().component&&t(vt)}));var ht=ft(ut,2),gt=t=>{var e=Ke();dn(dt(e),(()=>S().component),((t,e)=>{e(t,nr((()=>S().componentProps),{$$events:{closeToast:nt}}))})),Ue(t,e)},mt=t=>{var n=zr(),r=dt(n),o=t=>{var n=Tr(),r=ct(n),o=t=>{var n=Ke();cn(dt(n),e,"loading-icon",{},null),Ue(t,n)};tn(r,(t=>{!S().promise&&"loading"!==we(d)||S().icon||t(o)}));var i=ft(r,2),l=t=>{var e=Ke();dn(dt(e),(()=>S().icon),((t,e)=>{e(t,{})})),Ue(t,e)},a=(t,n)=>{var r=t=>{var n=Ke();cn(dt(n),e,"success-icon",{},null),Ue(t,n)},o=(t,n)=>{var r=t=>{var n=Ke();cn(dt(n),e,"error-icon",{},null),Ue(t,n)},o=(t,n)=>{var r=t=>{var n=Ke();cn(dt(n),e,"warning-icon",{},null),Ue(t,n)},o=(t,n)=>{var r=t=>{var n=Ke();cn(dt(n),e,"info-icon",{},null),Ue(t,n)};tn(t,(t=>{"info"===we(d)&&t(r)}),n)};tn(t,(t=>{"warning"===we(d)?t(r):t(o,!1)}),n)};tn(t,(t=>{"error"===we(d)?t(r):t(o,!1)}),n)};tn(t,(t=>{"success"===we(d)?t(r):t(o,!1)}),n)};tn(i,(t=>{S().icon?t(l):t(a,!1)})),Ue(t,n)};tn(r,(t=>{("default"!==we(d)||S().icon||S().promise)&&t(o)}));var i=ft(r,2),l=ct(i),a=t=>{var e=Nr(),n=ct(e),r=t=>{var e=Ke();dn(dt(e),(()=>S().title),((t,e)=>{e(t,nr((()=>S().componentProps)))})),Ue(t,e)},o=t=>{var e=Ve();Ct((()=>Je(e,S().title))),Ue(t,e)};tn(n,(t=>{"string"!=typeof S().title?t(r):t(o,!1)})),Ct((t=>mn(e,1,t)),[()=>{var t,e,n;return vn(Cr(null==(t=q())?void 0:t.title,null==(n=null==(e=S())?void 0:e.classes)?void 0:n.title))}],pt),Ue(t,e)};tn(l,(t=>{S().title&&t(a)}));var s=ft(l,2),u=t=>{var e=Or(),n=ct(e),r=t=>{var e=Ke();dn(dt(e),(()=>S().description),((t,e)=>{e(t,nr((()=>S().componentProps)))})),Ue(t,e)},o=t=>{var e=Ve();Ct((()=>Je(e,S().description))),Ue(t,e)};tn(n,(t=>{"string"!=typeof S().description?t(r):t(o,!1)})),Ct((t=>mn(e,1,t)),[()=>{var t,e;return vn(Cr(D(),we(v),null==(t=q())?void 0:t.description,null==(e=S().classes)?void 0:e.description))}],pt),Ue(t,e)};tn(s,(t=>{S().description&&t(u)}));var c=ft(i,2),f=t=>{var e=Ar(),n=ct(e);Ct((t=>{bn(e,A()),mn(e,1,t),Je(n,S().cancel.label)}),[()=>{var t,e,n;return vn(Cr(null==(t=q())?void 0:t.cancelButton,null==(n=null==(e=S())?void 0:e.classes)?void 0:n.cancelButton))}],pt),qe("click",e,(()=>{var t;nt(),(null==(t=S().cancel)?void 0:t.onClick)&&S().cancel.onClick()})),Ue(t,e)};tn(c,(t=>{S().cancel&&t(f)}));var p=ft(c,2),h=t=>{var e=Br(),n=ct(e);Ct((t=>{bn(e,B()),mn(e,1,t),Je(n,S().action.label)}),[()=>{var t,e,n;return vn(Cr(null==(t=q())?void 0:t.actionButton,null==(n=null==(e=S())?void 0:e.classes)?void 0:n.actionButton))}],pt),qe("click",e,(t=>{var e;null==(e=S().action)||e.onClick(t),t.defaultPrevented||nt()})),Ue(t,e)};tn(p,(t=>{S().action&&t(h)})),Ue(t,n)};tn(ht,(t=>{S().component?t(gt):t(mt,!1)})),Wn(at,(t=>Z(J,t)),(()=>we(J))),Ct(((t,e,o)=>{var i;Cn(at,"aria-live",S().important?"assertive":"polite"),mn(at,1,t),Cn(at,"data-styled",!(S().component||(null==(i=S())?void 0:i.unstyled)||L())),Cn(at,"data-mounted",we(W)),Cn(at,"data-promise",e),Cn(at,"data-removed",we(R)),Cn(at,"data-visible",we(s)),Cn(at,"data-y-position",we(h)[0]),Cn(at,"data-x-position",we(h)[1]),Cn(at,"data-index",P()),Cn(at,"data-front",we(a)),Cn(at,"data-swiping",we(H)),Cn(at,"data-type",we(d)),Cn(at,"data-invert",I()),Cn(at,"data-swipe-out",we(V)),Cn(at,"data-expanded",o),st=bn(at,`${n.style} ${S().style}`,st,{"--index":P(),"--toasts-before":P(),"--z-index":Zn(w,"$toasts",r).length-P(),"--offset":`${we(R)?we(K):we(X)}px`,"--initial-height":`${we(Y)}px`})}),[()=>{var t,e,r,o,i,l;return vn(Cr(n.class,we(f),null==(t=q())?void 0:t.toast,null==(r=null==(e=S())?void 0:e.classes)?void 0:r.toast,null==(o=q())?void 0:o[we(d)],null==(l=null==(i=S())?void 0:i.classes)?void 0:l[we(d)]))},()=>Boolean(S().promise),()=>Boolean(M()||T()&&we(W))],pt),qe("pointerdown",at,(function(t){if(we(m))return;Z(K,we(X));const e=t.target;e.setPointerCapture(t.pointerId),"BUTTON"!==e.tagName&&(Z(H,!0),et={x:t.clientX,y:t.clientY})})),qe("pointerup",at,(function(){var t,e,n;if(we(V))return;et=null;const r=Number((null==(t=we(J))?void 0:t.style.getPropertyValue("--swipe-amount").replace("px",""))||0);if(Math.abs(r)>=20)return Z(K,we(X)),null==(n=(e=S()).onDismiss)||n.call(e,S()),nt(),void Z(V,!0);we(J).style.setProperty("--swipe-amount","0px"),Z(H,!1)})),qe("pointermove",at,(function(t){if(!et)return;const e=t.clientY-et.y,n=t.clientX-et.x,r=("top"===we(h)[0]?Math.min:Math.max)(0,e),o="touch"===t.pointerType?10:2;Math.abs(r)>o?we(J).style.setProperty("--swipe-amount",`${e}px`):Math.abs(n)>o&&(et=null)})),Ue(t,at),F(),o()}var Lr=Re("<ol></ol>"),Wr=Re('<section class="svelte-1fo5d1m"></section>');function Gr(t,e){const n=tr(e,["children","$$slots","$$events","$$legacy"]),r=tr(n,["invert","theme","position","hotkey","containerAriaLabel","richColors","expand","duration","visibleToasts","closeButton","toastOptions","offset","dir"]);G(e,!1);const[o,i]=Xn(),l=()=>Zn(C,"$toasts",o),a=U(),s=U(),u="dark",c="light";function d(){if("undefined"==typeof window)return"ltr";if("undefined"==typeof document)return"ltr";const t=document.documentElement.getAttribute("dir");return"auto"!==t&&t?t:window.getComputedStyle(document.documentElement).direction}let f=rr(e,"invert",8,!1),v=rr(e,"theme",8,"light"),p=rr(e,"position",8,"bottom-right"),h=rr(e,"hotkey",24,(()=>["altKey","KeyT"])),g=rr(e,"containerAriaLabel",8,"Notifications"),m=rr(e,"richColors",8,!1),y=rr(e,"expand",8,!1),b=rr(e,"duration",8,4e3),w=rr(e,"visibleToasts",8,3),x=rr(e,"closeButton",8,!1),_=rr(e,"toastOptions",24,(()=>({}))),$=rr(e,"offset",8,null),k=rr(e,"dir",24,d);const{toasts:C,heights:S,reset:P}=Ir;let M=U(!1),I=U(!1),j=U("system"!==(O=v())?O:"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?u:c),E=U(),T=null,N=!1;var O;function A(t){N&&!t.currentTarget.contains(t.relatedTarget)&&(N=!1,T&&(T.focus({preventScroll:!0}),T=null))}function B(t){N||(N=!0,T=t.relatedTarget)}!function(t){null===L&&q(),or((()=>()=>xe(t)))}((()=>{we(E)&&T&&(T.focus({preventScroll:!0}),T=null,N=!1)})),or((()=>{P();const t=t=>{var e,n;h().every((e=>t[e]||t.code===e))&&(Z(M,!0),null==(e=we(E))||e.focus()),"Escape"!==t.code||document.activeElement!==we(E)&&!(null==(n=we(E))?void 0:n.contains(document.activeElement))||Z(M,!1)};return document.addEventListener("keydown",t),()=>{document.removeEventListener("keydown",t)}})),_t((()=>(ke(p()),l())),(()=>{Z(a,Array.from(new Set([p(),...l().filter((t=>t.position)).map((t=>t.position))].filter(Boolean))))})),_t((()=>ke(h())),(()=>{Z(s,h().join("+").replace(/Key/g,"").replace(/Digit/g,""))})),_t((()=>l()),(()=>{l().length<=1&&Z(M,!1)})),_t((()=>l()),(()=>{const t=l().filter((t=>t.dismiss&&!t.delete));if(t.length>0){const e=l().map((e=>t.find((t=>t.id===e.id))?{...e,delete:!0}:e));C.set(e)}})),_t((()=>ke(v())),(()=>{if("system"!==v()&&Z(j,v()),"undefined"!=typeof window){"system"===v()&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Z(j,u):Z(j,c));const t=window.matchMedia("(prefers-color-scheme: dark)"),e=({matches:t})=>{Z(j,t?u:c)};"addEventListener"in t?t.addEventListener("change",e):t.addListener(e)}})),$t(),Gn();var z=Ke(),D=dt(z),W=t=>{var i=Wr();Cn(i,"tabindex",-1),on(i,5,(()=>we(a)),rn,((t,i,a,s)=>{var u=Lr();let c;on(u,7,(()=>l().filter((t=>!t.position&&0===a||t.position===we(i)))),(t=>t.id),((t,n,r,o)=>{const l=pt((()=>{var t;return(null==(t=_())?void 0:t.actionButtonStyle)||""})),a=pt((()=>{var t;return(null==(t=_())?void 0:t.cancelButtonStyle)||""})),s=pt((()=>{var t;return(null==(t=_())?void 0:t.class)||""})),u=pt((()=>{var t;return(null==(t=_())?void 0:t.descriptionClass)||""})),c=pt((()=>_().classes||{})),d=pt((()=>{var t;return(null==(t=_())?void 0:t.duration)??b()})),v=pt((()=>_().unstyled||!1));qr(t,{get index(){return we(r)},get toast(){return we(n)},get invert(){return f()},get visibleToasts(){return w()},get closeButton(){return x()},get interacting(){return we(I)},get position(){return we(i)},get expandByDefault(){return y()},get expanded(){return we(M)},get actionButtonStyle(){return we(l)},get cancelButtonStyle(){return we(a)},get class(){return we(s)},get descriptionClass(){return we(u)},get classes(){return we(c)},get duration(){return we(d)},get unstyled(){return we(v)},$$slots:{"loading-icon":(t,r)=>{var o=Ke();cn(dt(o),e,"loading-icon",{},(t=>{const e=pt((()=>"loading"===we(n).type));!function(t,e){G(e,!1);let n=rr(e,"visible",8);const r=Array(12).fill(0);Gn();var o=kr();on(ct(o),5,(()=>r),rn,((t,e)=>{Ue(t,$r())})),Ct((()=>Cn(o,"data-visible",n()))),Ue(t,o),F()}(t,{get visible(){return we(e)}})})),Ue(t,o)},"success-icon":(t,n)=>{var r=Ke();cn(dt(r),e,"success-icon",{},(t=>{_r(t,{type:"success"})})),Ue(t,r)},"error-icon":(t,n)=>{var r=Ke();cn(dt(r),e,"error-icon",{},(t=>{_r(t,{type:"error"})})),Ue(t,r)},"warning-icon":(t,n)=>{var r=Ke();cn(dt(r),e,"warning-icon",{},(t=>{_r(t,{type:"warning"})})),Ue(t,r)},"info-icon":(t,n)=>{var r=Ke();cn(dt(r),e,"info-icon",{},(t=>{_r(t,{type:"info"})})),Ue(t,r)}}})})),Wn(u,(t=>Z(E,t)),(()=>we(E))),Ct(((t,e,i)=>{var l;c=Sn(u,c,{tabIndex:-1,class:n.class,"data-sonner-toaster":!0,"data-theme":we(j),"data-rich-colors":m(),dir:t,"data-y-position":e,"data-x-position":i,style:n.style,...r,[xn]:{"--front-toast-height":`${null==(l=Zn(S,"$heights",o)[0])?void 0:l.height}px`,"--offset":"number"==typeof $()?`${$()}px`:$()||"32px","--width":"356px","--gap":"14px"}},"svelte-1fo5d1m"),u.dir=u.dir}),[()=>"auto"===k()?d():k(),()=>we(i).split("-")[0],()=>we(i).split("-")[1]],pt),qe("blur",u,A),qe("focus",u,B),qe("mouseenter",u,(()=>Z(M,!0))),qe("mousemove",u,(()=>Z(M,!0))),qe("mouseleave",u,(()=>{we(I)||Z(M,!1)})),qe("pointerdown",u,(()=>Z(I,!0))),qe("pointerup",u,(()=>Z(I,!1))),Ue(t,u)})),Ct((()=>Cn(i,"aria-label",`${g()} ${we(s)}`))),Ue(t,i)};tn(D,(t=>{l().length>0&&t(W)})),Ue(t,z),F(),i()}const Fr=Vn(!1),Rr=Vn("https://sdk.playlight.dev");var Hr=(t,e,n,r)=>{var o;we(e)&&!we(n)||(null==(o=r.onClick)||o.call(r,r.game.id),window.open("https://"+r.game.domain,"_blank","noopener"))},Vr=Re('<div><p class="text-primary font-bold uppercase">New</p></div>'),Kr=Re('<video playsinline="" loop preload="auto"></video>',2),Ur=(t,n)=>{var r;e.stopPropagation(),null==(r=n.onClick)||r.call(n,n.game.id),window.open("https://"+n.game.domain,"_blank","noopener")},Yr=Re("<button>Play</button>"),Zr=Re('<div class="bg-background/75 text-foreground absolute right-0 bottom-0 left-0 z-11 flex max-h-1/3 flex-col overflow-hidden backdrop-blur-xl"><div class="hide-scrollbar h-full w-full overflow-y-auto p-3 svelte-rulnq9"><h3 class="mb-2 truncate text-center text-lg font-bold"> </h3> <p class="text-muted-foreground mb-4 text-center text-sm text-balance"> </p></div> <div class="fade-mask bg-background/75 pointer-events-none absolute right-0 bottom-0 left-0 h-8 svelte-rulnq9"></div></div>'),Jr=Re('<div role="button" tabindex="0"><!> <!> <img alt="cover" loading="eager"> <!> <!> <img alt="game logo" loading="eager"></div>');Le(["touchstart","click"]);const Xr=new(o=class{constructor(){u(this,n),this.baseUrl="https://api.playlight.dev/platform",this.cachedCategories=null,this.currentGame=null}async request(t,e={}){try{const n=`${this.baseUrl}${t}`,r=await fetch(n,{...e,headers:{"Content-Type":"application/json",...e.headers}});if(!r.ok){let t;try{t=await r.json()}catch{}finally{if(429!==r.status&&404!==r.status)throw new Error(`API request failed: ${(null==t?void 0:t.error)||(null==t?void 0:t.message)||r.status}`);return 429===r.status?console.warn("Playlight request didn't go through due to rate limiting."):console.warn("Playlight game not found. This is normal in a test / local environment, but should not appear in production.")}}return await r.json()}catch(n){jr.error("Error: "+n),console.error("Playlight API error:",n)}}async getCategories(){if(this.cachedCategories)return this.cachedCategories;const t=await this.request("/categories");return this.cachedCategories=t,t}async getSuggestions(t=null,e=1){let o="/suggestions";return t&&(o+="/"+t),e&&(o+="?page="+e),o+="&without="+c(this,n,r).call(this),await this.request(o)}async getCurrentGameInfo(){if(this.currentGame)return this.currentGame;let t="/game-by-domain/"+c(this,n,r).call(this);return this.currentGame=await this.request(t),this.currentGame?{...this.currentGame}:void 0}async trackOpen(){const t=c(this,n,r).call(this);await this.request("/event/open",{method:"POST",body:JSON.stringify({domain:t})})}async trackClick(t){const e=c(this,n,r).call(this);await this.request("/event/click",{method:"POST",body:JSON.stringify({sourceDomain:e,gameId:t})})}async toggleLike(t,e=!0){const n=e?"like":"unlike",r=await this.request(`/rating/${t}/${n}`,{method:"POST"});return(null==r?void 0:r.success)||!1}},n=new WeakSet,r=function(){const t=window.location.hostname;return t.startsWith("www.")?t.substring(4):t},o);function Qr(t){const e=t-1;return e*e*e+1}function to(t){return Math.sin(-13*(t+1)*Math.PI/2)*Math.pow(2,-10*t)+1}function eo(t,{from:e,to:n},r={}){var{delay:o=0,duration:i=t=>120*Math.sqrt(t),easing:l=Qr}=r,a=getComputedStyle(t),s="none"===a.transform?"":a.transform,[u,c]=a.transformOrigin.split(" ").map(parseFloat);u/=t.clientWidth,c/=t.clientHeight;var d=function(t){if("currentCSSZoom"in t)return t.currentCSSZoom;for(var e=t,n=1;null!==e;)n*=+getComputedStyle(e).zoom,e=e.parentElement;return n}(t),f=t.clientWidth/n.width/d,v=t.clientHeight/n.height/d,p=e.left+e.width*u,h=e.top+e.height*c,g=n.left+n.width*u,m=n.top+n.height*c,y=(p-g)*f,b=(h-m)*v,w=e.width/n.width,x=e.height/n.height;return{delay:o,duration:"function"==typeof i?i(Math.sqrt(y*y+b*b)):i,easing:l,css:(t,e)=>`transform: ${s} translate(${e*y}px, ${e*b}px) scale(${t+e*w}, ${t+e*x});`}}var no=(t,e,n)=>{Z(e,""),Z(n,!we(n))},ro=Re('<div class="text-muted-foreground animate-pulse p-4 text-center">Loading...</div>'),oo=Re('<div class="text-muted-foreground p-4 text-center">No categories found.</div>'),io=(t,e,n,r)=>{e(n),Z(r,!1)},lo=Re("<button> </button>"),ao=Re('<div class="space-y-1 p-1"></div>'),so=Re('<div class="bg-background/85 fixed left-1/2 z-50 mt-24 w-30 w-full max-w-xs -translate-x-1/2 transform border shadow-lg backdrop-blur-xl"><div class="border-b p-3"><div class="relative"><div class="pointer-events-none absolute inset-y-0 left-0 flex items-center pl-1"><!></div> <input type="text" placeholder="Search categories..." class="w-full border-0 p-1 pl-10 text-white focus:ring-0 focus:outline-none"></div></div> <div class="max-h-60 overflow-y-auto"><!></div></div>'),uo=Re('<div class="flex w-full flex-col py-2"><h1 class="mb-0! py-2 text-center text-2xl font-bold text-white drop-shadow-xl lg:text-4xl"><span> </span> <button class="group mx-1 inline-flex cursor-pointer items-center bg-white px-3 py-1 text-background transition hover:rotate-5"><span class="truncate max-w-[40vw] text-2xl font-bold text-background lg:text-4xl"> </span> <!></button> <span>games?</span></h1> <!></div>');function co(t,e){G(e,!0);let n,r=rr(e,"categories",19,(()=>[])),o=rr(e,"selectedCategory",15),i=V(!1),l=vt((()=>o()||(r().length>0?r()[0]:"..."))),a=V(""),s=V(void 0),u=vt((()=>we(a)?r().filter((t=>t.toLowerCase().includes(we(a).toLowerCase()))):r()));const c=["Looking for","Interested in","Searching for","Fancy some","What about these"];let d,f=V(tt(c[0]));or((function(){let t;for(t=Math.floor(Math.random()*(null==c?void 0:c.length));t==d;)t=Math.floor(Math.random()*(null==c?void 0:c.length));Z(f,tt(c[t])),d=t}));var v=uo();qe("click",rt,(function(t){we(s)&&!we(s).contains(t.target)&&n&&!n.contains(t.target)&&Z(i,!1)}));var p=ct(v),h=ct(p),g=ct(h),m=ft(h,2);m.__click=[no,a,i];var y=ct(m),b=ct(y),w=ft(y,2);const x=vt((()=>we(i)?"rotate-180 transform":""));!function(t,e){const n=tr(e,["children","$$slots","$$events","$$legacy"]);ar(t,nr({name:"chevron-down"},(()=>n),{iconNode:[["path",{d:"m6 9 6 6 6-6"}]],children:(t,n)=>{var r=Ke();cn(dt(r),e,"default",{},null),Ue(t,r)},$$slots:{default:!0}}))}(w,{size:25,strokeWidth:3,get class(){return`mt-1 ml-1 text-background ${we(x)??""} transition-transform duration-200`}}),Wn(m,(t=>n=t),(()=>n));var _=ft(p,2),$=t=>{var e=so(),n=ct(e),l=ct(n),c=ct(l);!function(t,e){const n=tr(e,["children","$$slots","$$events","$$legacy"]);ar(t,nr({name:"search"},(()=>n),{iconNode:[["circle",{cx:"11",cy:"11",r:"8"}],["path",{d:"m21 21-4.3-4.3"}]],children:(t,n)=>{var r=Ke();cn(dt(r),e,"default",{},null),Ue(t,r)},$$slots:{default:!0}}))}(ct(c),{size:18,strokeWidth:2.5,class:"text-muted-foreground"});var d=ft(c,2),f=ct(ft(n,2)),v=t=>{Ue(t,ro())},p=(t,e)=>{var n=t=>{Ue(t,oo())},r=t=>{var e=ao();on(e,28,(()=>we(u)),(t=>t),((t,e)=>{var n=lo();n.__click=[io,o,e,i];var r,l,a,s,u,c,d,f,v=ct(n);Ct((()=>{mn(n,1,`w-full cursor-pointer px-4 py-2 text-left transition-colors ${(o()!=e?"hover:bg-muted-foreground/20":"")??""} ${(o()==e?"bg-white text-background":"text-white")??""}`),Je(v,e)})),r=n,l=()=>eo,a=()=>({duration:150}),f=null,(d=en).a??(d.a={element:r,measure(){s=this.element.getBoundingClientRect()},apply(){if(null==c||c.abort(),u=this.element.getBoundingClientRect(),s.left!==u.left||s.right!==u.right||s.top!==u.top||s.bottom!==u.bottom){const t=l()(this.element,{from:s,to:u},null==a?void 0:a());c=zn(this.element,t,void 0,1,(()=>{null==c||c.abort(),c=void 0}))}},fix(){if(!r.getAnimations().length){var{position:t,width:e,height:n}=getComputedStyle(r);if("absolute"!==t&&"fixed"!==t){var o=r.style;f={position:o.position,width:o.width,height:o.height,transform:o.transform},o.position="absolute",o.width=e,o.height=n;var i=r.getBoundingClientRect();if(s.left!==i.left||s.top!==i.top){var l=`translate(${s.left-i.left}px, ${s.top-i.top}px)`;o.transform=o.transform?`${o.transform} ${l}`:l}}}},unfix(){if(f){var t=r.style;t.position=f.position,t.width=f.width,t.height=f.height,t.transform=f.transform}}}),d.a.element=r,Ue(t,n)})),Ue(t,e)};tn(t,(t=>{0===we(u).length?t(n):t(r,!1)}),e)};tn(f,(t=>{0===r().length?t(v):t(p,!1)})),Wn(e,(t=>Z(s,t)),(()=>we(s))),function(t,e,n=e){var r=R();(function(t,e,n,r=n){t.addEventListener(e,(()=>Ae(n)));const o=t.__on_r;t.__on_r=o?()=>{o(),r(!0)}:()=>r(!0),Oe||(Oe=!0,document.addEventListener("reset",(t=>{Promise.resolve().then((()=>{var e;if(!t.defaultPrevented)for(const n of t.target.elements)null==(e=n.__on_r)||e.call(n)}))}),{capture:!0}))})(t,"input",(o=>{var i=o?t.defaultValue:t.value;if(i=Dn(t)?qn(i):i,n(i),r&&i!==(i=e())){var l=t.selectionStart,a=t.selectionEnd;t.value=i??"",null!==a&&(t.selectionStart=l,t.selectionEnd=Math.min(a,t.value.length))}})),null==xe(e)&&t.value&&n(Dn(t)?qn(t.value):t.value),kt((()=>{var n=e();Dn(t)&&n===qn(t.value)||("date"!==t.type||n||t.value)&&n!==t.value&&(t.value=n??"")}))}(d,(()=>we(a)),(t=>Z(a,t))),Bn(3,e,(()=>hr),(()=>({y:-5,duration:250}))),Ue(t,e)};tn(_,(t=>{we(i)&&t($)})),Ct((()=>{Je(g,we(f)),Je(b,we(l))})),Bn(3,v,(()=>mr),(()=>({duration:600,delay:50,easing:to,start:.95}))),Ue(t,v),F()}Le(["click"]);var fo=Re('<div class="-mx-10 mt-5 flex h-1/2 max-h-[75vh] min-h-92 w-10 flex-col lg:h-3/7"><div class="flex h-full items-center justify-center"><div class="flex h-full w-full flex-col items-center justify-between py-6"><div class="bg-muted-foreground min-[1920px]:h-1/4 h-1/5 w-px"></div> <div class="text-muted-foreground origin-center -rotate-90 transform text-sm whitespace-nowrap select-none">From other categories</div> <div class="bg-muted-foreground h-1/5 w-px min-[1920px]:h-1/4"></div></div></div></div>');function vo(t,e,n,r,o,i){Z(e,!1),Z(n,!0),Z(r,250),Z(o,0),i(250,0,250,((t,e,n)=>{Z(r,t*(1-n)),Z(o,tt(n))}))}async function po(t,e,n,r){var o;if(!(null==(o=e.currentGame)?void 0:o.id))return;const i=!we(n);Z(n,!we(n)),Z(r,we(r)+(i?1:-1)),i?localStorage.setItem(`playlight_${e.currentGame.id}_liked`,"true"):localStorage.removeItem(`playlight_${e.currentGame.id}_liked`),await Xr.toggleLike(e.currentGame.id,i)||Z(r,we(r)+(i?-1:1))}var ho=Re('<div class="bg-background/85 fixed bottom-4 left-4 z-2 flex touch-none flex-wrap items-center gap-1 border-1 p-4 text-start shadow-lg backdrop-blur-lg max-sm:right-4 sm:w-72" role="button" tabindex="0"><div class="w-full"><p class="text-muted-foreground text-sm select-none">Currently playing</p></div> <div class="flex w-full items-center gap-2"><img alt="logo"> <p class="text-foreground max-w-2/3 truncate text-lg font-bold"> </p> <div class="mt-0.5 ml-auto flex items-center gap-2"><p class="text-muted-foreground text-sm"> </p> <button class="text-muted-foreground cursor-pointer transition hover:text-white"><!></button></div></div></div>'),go=Re('<div class="fixed bottom-0 z-3 shadow-xl max-sm:right-4 max-sm:left-4 sm:left-4 sm:w-72"><button class="bg-background/85 hover:bg-background/95 w-full rounded-t-md border px-4 py-1.5 backdrop-blur-sm transition" aria-label="Show game display"><div class="bg-muted-foreground mx-auto h-px w-16"></div></button></div>'),mo=Re("<!> <!>",1);function yo(t,e){t.target===t.currentTarget&&Jn(Fr,!1)}Le(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","click"]);var bo=(t,e)=>{localStorage.getItem("playlight_exit_intent_disabled_by_user")?localStorage.removeItem("playlight_exit_intent_disabled_by_user"):localStorage.setItem("playlight_exit_intent_disabled_by_user",!0),Z(e,!we(e))},wo=Re('<button class="cursor-pointer truncate text-sm text-nowrap opacity-50 transition hover:opacity-25 max-md:hidden"><p class="bg-background/50 text-primary p-1 px-2 text-sm"> </p></button>'),xo=(t,e)=>Jn(Fr,!1),_o=Re('<div class="flex h-4/5 items-center justify-center gap-4"><!></div>'),$o=Re('<div class="text-muted-foreground flex h-4/5 items-center justify-center gap-4"><p>No games found that match the filter.</p></div>'),ko=Re("<!> <!>",1),Co=Re('<div class="mx-auto flex h-full flex-wrap content-start justify-center gap-10 lg:max-w-4/5"><!> <div class="flex h-10 w-full justify-center"><!></div></div>'),So=Re('<div class="bg-background/75 fixed inset-0 top-0 right-0 bottom-0 left-0 z-99999 flex flex-col justify-center text-white backdrop-blur-md" id="playlight-discovery"><div class="pointer-events-none ml-2 flex items-center justify-between p-4"><img alt="logo" class="w-50 pointer-events-none"> <div class="mt-4 mr-2 flex items-center justify-evenly gap-8 overflow-hidden md:mr-4"><!> <button class="cursor-pointer text-white transition hover:opacity-50"><!></button></div></div> <div class="mx-auto p-2 px-5"><!></div> <!> <div class="mask-fade no-scrollbar relative h-full w-full overflow-y-auto p-4 svelte-12skmk8"><!></div> <a href="https://playlight.dev" target="_blank" class="text-muted-foreground fixed right-4 bottom-4 flex items-center gap-1 text-sm transition hover:text-white">Join Playlight <!></a></div>');function Po(t,e){G(e,!0);const[n,r]=Xn(),o=()=>Zn(Fr,"$discoveryOpen",n);let i,l=rr(e,"showIntentToggle",3,!0),a=V(!0),s=V(void 0),u=V(!0),c=V(!1),d=V(void 0),f=V(tt([])),v=V(tt([])),p=V(1),h=V(!0),g=V(void 0),m=V(!1);async function y(){if(!(we(u)&&we(p)>1||we(c)))try{1===we(p)?Z(u,!0):Z(c,!0);const t=we(m)?null:we(s),e=await Xr.getSuggestions(t,we(p)),n=(null==e?void 0:e.games)||[],r=n.filter((t=>!we(f).some((e=>e.id===t.id))));Z(f,tt([...we(f),...r])),n.length<10?!we(m)&&we(s)?(Z(m,!0),Z(p,1),setTimeout((()=>y()),100)):Z(h,!1):Z(p,we(p)+1)}catch(t){console.error(t),jr.error("Failed to load games: "+t)}finally{Z(u,!1),Z(c,!1),we(h)&&we(g)&&setTimeout((()=>{const t=we(g).getBoundingClientRect();!(t.top>=-200&&t.left>=0&&t.bottom<=window.innerHeight+200&&t.right<=window.innerWidth)||we(u)||we(c)||y()}),150)}}or((()=>(Z(a,!Boolean(localStorage.getItem("playlight_exit_intent_disabled_by_user"))),i=new IntersectionObserver((t=>{t[0].isIntersecting&&we(h)&&!we(u)&&!we(c)&&y()}),{rootMargin:"200px"}),()=>null==i?void 0:i.disconnect()))),or((async()=>{Z(d,tt(await Xr.getCurrentGameInfo())),await async function(){var t,e,n,r,o,i,l;Z(v,tt(await Xr.getCategories())),!we(s)&&(null==(t=we(v))?void 0:t.length)>0&&Z(s,tt((null==(e=we(d))?void 0:e.category)&&(null==(r=we(v))?void 0:r.includes(null==(n=we(d))?void 0:n.category))?null==(o=we(d))?void 0:o.category:null==(l=we(v))?void 0:l[(null==(i=we(v))?void 0:i.length)-1]))}()})),wt((()=>{we(s)&&(Z(f,tt([])),Z(p,1),Z(h,!0),Z(m,!1),Z(u,!0),setTimeout((async()=>{await y(),we(f).length<10&&await y()}),100))})),wt((()=>{we(g)&&i&&i.observe(we(g))}));var b=So();qe("keydown",rt,(t=>{"Escape"==t.key&&Jn(Fr,!1)})),b.__click=[yo,o];var w=ct(b),x=ct(w),_=ct(ft(x,2)),$=t=>{var e=wo();e.__click=[bo,a];var n=ct(e),r=ct(n);Ct((()=>Je(r,we(a)?"Don't show on exit":"Do show on exit"))),Ue(t,e)};tn(_,(t=>{l()&&t($)}));var k=ft(_,2);k.__click=[xo,o],function(t,e){const n=tr(e,["children","$$slots","$$events","$$legacy"]);ar(t,nr({name:"x"},(()=>n),{iconNode:[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]],children:(t,n)=>{var r=Ke();cn(dt(r),e,"default",{},null),Ue(t,r)},$$slots:{default:!0}}))}(ct(k),{size:24,strokeWidth:2.5});var C=ft(w,2);co(ct(C),{get categories(){return we(v)},get selectedCategory(){return we(s)},set selectedCategory(t){Z(s,tt(t))}});var S=ft(C,2);!function(t,e){var n;G(e,!0);let r=V(!1),o=V(!0),i=V(!1),l=V(0),a=V(1),s=V(!1),u=V(!1),c=V(tt((null==(n=e.currentGame)?void 0:n.likes)||0)),d=0;function f(t){Z(s,!0),d=t.type.includes("touch")?t.touches[0].clientY:t.clientY}function v(t){if(!we(s))return;const e=t.type.includes("touch")?t.touches[0].clientY:t.clientY,n=Math.max(0,e-d);Z(l,tt(n)),Z(a,tt(Math.max(0,1-n/150))),n>40&&(Z(s,!1),h(we(l),250,250,((t,e,n)=>{Z(l,t+(e-t)*n),Z(a,tt(Math.max(0,1-1.5*n))),1===n&&(Z(o,!1),Z(i,!0))})))}function p(){we(s)&&(Z(s,!1),we(l)<40&&h(we(l),0,250,((t,e,n)=>{Z(l,t*(1-n)),Z(a,1)})))}function h(t,e,n,r){const o=Date.now();!function i(){const l=Math.min((Date.now()-o)/n,1);r(t,e,l),l<1&&requestAnimationFrame(i)}()}wt((()=>{var t,n;(null==(t=e.currentGame)?void 0:t.id)&&(Z(u,null!==localStorage.getItem(`playlight_${e.currentGame.id}_liked`)),Z(c,tt((null==(n=e.currentGame)?void 0:n.likes)||0)))}));var g=mo(),m=dt(g),y=t=>{var n=ho();n.__mousedown=f,n.__mousemove=v,n.__mouseup=p,n.__touchstart=f,n.__touchmove=v,n.__touchend=p;var o=ft(ct(n),2),i=ct(o);let s;var d=ft(i,2),h=ct(d),g=ct(ft(d,2)),m=ct(g),y=ft(g,2);y.__click=[po,e,u,c];var b=ct(y);const w=vt((()=>we(u)?"currentColor":"none"));!function(t,e){const n=tr(e,["children","$$slots","$$events","$$legacy"]);ar(t,nr({name:"thumbs-up"},(()=>n),{iconNode:[["path",{d:"M7 10v12"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z"}]],children:(t,n)=>{var r=Ke();cn(dt(r),e,"default",{},null),Ue(t,r)},$$slots:{default:!0}}))}(b,{size:18,strokeWidth:2.5,get fill(){return we(w)},style:"margin-top: -5px;"}),Ct((t=>{var r,o;bn(n,`transform: translateY(${we(l)??""}px); opacity: ${we(a)??""}; cursor: grab;`),Cn(i,"src",null==(r=e.currentGame)?void 0:r.logo_url),s=mn(i,1,"bg-muted h-5 w-5 select-none",null,s,t),Je(h,(null==(o=e.currentGame)?void 0:o.name)||"Default name"),Je(m,we(c)),bn(y,`color: ${(we(u)?"white !important":"")??""};`),Cn(y,"aria-label",we(u)?"Unlike game":"Like game")}),[()=>({"animate-pulse":!we(r)})]),qe("mouseleave",n,p),qe("load",i,(()=>{Z(r,!0)})),Ue(t,n)};tn(m,(t=>{e.currentGame&&we(o)&&t(y)}));var b=ft(m,2),w=t=>{var e=go(),n=ct(e);n.__mousedown=[vo,i,o,l,a,h],n.__touchstart=[vo,i,o,l,a,h],Bn(3,n,(()=>hr),(()=>({delay:150,y:30}))),Ue(t,e)};tn(b,(t=>{e.currentGame&&we(i)&&t(w)})),Ue(t,g),F()}(S,{get currentGame(){return we(d)}});var P=ft(S,2);P.__click=[yo,o];var M=ct(P),I=t=>{var e=_o();sr(ct(e),{class:"animate-spin opacity-75",size:50,strokeWidth:2.5}),Ue(t,e)},j=(t,e)=>{var n=t=>{Ue(t,$o())},r=t=>{var e=Co(),n=ct(e);on(n,17,(()=>we(f)),rn,((e,n,r)=>{var o=ko();const i=vt((()=>we(f).findIndex((t=>t.category!==we(s)))));var l=dt(o),a=t=>{Ue(t,fo())};tn(l,(t=>{r==we(i)&&t(a)})),function(e,n){G(n,!0);const[r,o]=Xn();let i,l=V(!1),a=V(!1),s=V(void 0),u=V(!1),c=V(!1),d=V(!1),f=V(!1),v=V(void 0);function p(){we(l)||we(f)||function(e,n=1){try{const t=new Audio(e);t.volume=n,t.play()}catch(t){console.error("Error playing sound:",t)}}(Zn(Rr,"$projectUrl",r)+"/static/sounds/hover-selection.ogg",.25),Z(l,!0),clearTimeout(i),i=setTimeout((()=>Z(a,!0)),300),we(s)&&n.game.cover_video_url&&we(s).play().catch((t=>console.error("Video play error:",t)))}function h(){we(f)||(g(),we(s)&&we(u)&&we(s).pause())}function g(){Z(l,!1),clearTimeout(i),Z(a,!1)}wt((()=>{Z(f,"ontouchstart"in window)}));var m=Jr();qe("touchstart",nt,(()=>Z(f,!0)),void 0,!0),qe("touchstart",rt,(function(t){we(v)&&!we(v).contains(t.target)&&g()}),void 0,!0),m.__touchstart=p,m.__click=[Hr,f,a,n];var y=ct(m),b=t=>{var e=Vr();let n;Ct((t=>n=mn(e,1,"bg-background absolute top-4 right-4 z-13 px-2 py-0.5 transition-opacity select-none",null,n,t)),[()=>({"opacity-0":we(l)})]),Ue(t,e)};tn(y,(t=>{var e;(function(t){const e=new Date;return e.setDate(e.getDate()-7),new Date(t)>e})(null==(e=n.game)?void 0:e.created_at)&&t(b)}));var w=ft(y,2),x=t=>{var e=Kr();let r;e.muted=!0,Wn(e,(t=>Z(s,t)),(()=>we(s))),Ct((t=>{Cn(e,"src",n.game.cover_video_url),r=mn(e,1,"absolute top-0 left-0 z-5 h-full w-full object-cover opacity-0",null,r,t)}),[()=>({"opacity-100":we(l)&&we(u)&&n.game.cover_video_url})]),qe("loadeddata",e,(()=>{Z(u,!0)})),Ue(t,e)};tn(w,(t=>{n.game.cover_video_url&&t(x)}));var _=ft(w,2);let $;var k=ft(_,2),C=t=>{var e=Yr();let r;e.__click=[Ur,n],Ct((t=>r=mn(e,1,"bg-foreground text-background hover:bg-foreground/90 absolute right-4 bottom-4 z-15 flex items-center justify-center rounded-sm px-3 py-1 font-bold uppercase transition-all",null,r,t)),[()=>({"opacity-0":we(l)})]),Ue(t,e)};tn(k,(t=>{we(f)&&t(C)}));var S=ft(k,2),P=t=>{var e=Zr(),r=ct(e),o=ct(r),i=ct(o),l=ct(ft(o,2));Ct((()=>{Je(i,n.game.name),Je(l,n.game.description||"No description.")})),Bn(3,e,(()=>gr)),Ue(t,e)};tn(S,(t=>{we(l)&&t(P)}));var M=ft(S,2);let I;Wn(m,(t=>Z(v,t)),(()=>we(v))),Ct(((t,e)=>{mn(m,1,`bg-background highlight-border group relative mt-5 mb-[calc(3dvh+1.5vw)] flex aspect-[2/3] h-1/2 max-h-[75vh] min-h-92 cursor-pointer flex-col shadow-xl transition hover:outline-2 lg:h-3/7 ${(we(c)?"":"animate-pulse")??""}`,"svelte-rulnq9"),Cn(_,"src",n.game.cover_image_url),$=mn(_,1,"prevent-image-select absolute top-0 left-0 z-10 h-full w-full object-cover opacity-0 transition svelte-rulnq9",null,$,t),Cn(M,"src",n.game.logo_url),I=mn(M,1,"prevent-image-select absolute right-0 -bottom-[18%] left-0 z-12 mx-auto aspect-square w-1/5 rounded-full object-center opacity-0 transition group-hover:outline-2 svelte-rulnq9",null,I,e)}),[()=>({"opacity-100":we(c)&&(!we(l)||!we(u)||!n.game.cover_video_url)}),()=>({"opacity-100":we(d)})]),qe("mouseenter",m,p),qe("focus",m,p),qe("mouseleave",m,h),qe("blur",m,h),qe("load",_,(()=>{Z(c,!0)})),qe("load",M,(()=>{Z(d,!0)})),Ue(e,m),F(),o()}(ft(l,2),{get game(){return we(n)},onClick:()=>Xr.trackClick(we(n).id)}),Ue(e,o)}));var r=ft(n,2),o=ct(r),i=t=>{sr(t,{class:"animate-spin opacity-75",size:30,strokeWidth:2.5})};tn(o,(t=>{we(c)&&t(i)})),Wn(r,(t=>Z(g,t)),(()=>we(g))),Ue(t,e)};tn(t,(t=>{0!==we(f).length||we(u)?t(r,!1):t(n)}),e)};tn(M,(t=>{we(u)&&0===we(f).length?t(I):t(j,!1)}));var E=ft(P,2);!function(t,e){const n=tr(e,["children","$$slots","$$events","$$legacy"]);ar(t,nr({name:"external-link"},(()=>n),{iconNode:[["path",{d:"M15 3h6v6"}],["path",{d:"M10 14 21 3"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}]],children:(t,n)=>{var r=Ke();cn(dt(r),e,"default",{},null),Ue(t,r)},$$slots:{default:!0}}))}(ft(ct(E)),{size:14}),Ct((()=>Cn(x,"src",Zn(Rr,"$projectUrl",n)+"/static/images/logo-white-small.png"))),Bn(3,b,(()=>pr),(()=>({duration:250}))),Ue(t,b),F(),r()}Le(["click"]);var Mo=Re('<div class="fixed top-0 right-0 left-0 h-4"></div>');Le(["mouseover"]);var Io=Re("<!> <!> <!> <!>",1);function jo(t,e){var n,r,o,i;G(e,!0);const[l,a]=Xn(),s=()=>Zn(Fr,"$discoveryOpen",l);let u,c=tt(null==(r=null==(n=e.config)?void 0:n.button)?void 0:r.position),d=tt(null==(i=null==(o=e.config)?void 0:o.button)?void 0:i.visible);function f(){Jn(Fr,!0),Xr.trackOpen()}Fr.subscribe((t=>{try{t?(u=document.body.style.overflow,document.body.style.overflow="hidden"):document.body.style.overflow=u}catch(e){console.error("Failed to toggle body overflow style:",e)}}));var v=Io(),p=dt(v);!function(t,e){G(e,!0);let n=rr(e,"position",3,"bottom-right"),r=rr(e,"visible",3,!0);var o=Ke(),i=dt(o),l=t=>{var r=cr();r.__click=[ur,e];var o=ct(r);!function(t,e){const n=tr(e,["children","$$slots","$$events","$$legacy"]);ar(t,nr({name:"gamepad"},(()=>n),{iconNode:[["line",{x1:"6",x2:"10",y1:"12",y2:"12"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14"}],["line",{x1:"15",x2:"15.01",y1:"13",y2:"13"}],["line",{x1:"18",x2:"18.01",y1:"11",y2:"11"}],["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2"}]],children:(t,n)=>{var r=Ke();cn(dt(r),e,"default",{},null),Ue(t,r)},$$slots:{default:!0}}))}(ct(o),{size:26,strokeWidth:1.75,class:"z-2 mr-2 transform transition-all duration-300 group-hover:rotate-12"}),Ct((()=>mn(r,1,`fixed ${("bottom-left"==n()?"bottom-4 left-4":"bottom-right"==n()?"right-4 bottom-4":"")??""} group children-text-white z-99990 flex cursor-pointer gap-2 rounded-md bg-white p-3 font-bold text-background uppercase shadow-lg transition-all hover:scale-105`,"svelte-1j97rta"))),Ue(t,r)};tn(i,(t=>{r()&&t(l)})),Ue(t,o),F()}(p,{get position(){return c},get visible(){return d},onClick:f});var h=ft(p,2),g=t=>{const n=vt((()=>{var t,n;return null==(n=null==(t=e.config)?void 0:t.exitIntent)?void 0:n.enabled}));Po(t,{get showIntentToggle(){return we(n)}})};tn(h,(t=>{s()&&t(g)}));var m=ft(h,2);const y=vt((()=>{var t,n;return null==(n=null==(t=e.config)?void 0:t.exitIntent)?void 0:n.enabled}));!function(t,e){G(e,!0);let n=rr(e,"enabled",3,!0),r=!1;var o=Mo();qe("mousemove",nt,(function(){r||setTimeout((()=>r=!0),250)})),o.__mouseover=function(){var t;n()&&!localStorage.getItem("playlight_exit_intent_disabled_by_user")&&r&&(null==(t=e.onIntent)||t.call(e))},Ue(t,o),F()}(m,{get enabled(){return we(y)},onIntent:()=>{s()||f()}}),Gr(ft(m,2),{}),Ue(t,v),F(),a()}const Eo={button:{position:"bottom-right",visible:!0},exitIntent:{enabled:!0}};let To={...Eo};function No(t={}){return To=Oo(Eo,t),To}function Oo(t,e){const n={...t};return Ao(t)&&Ao(e)&&Object.keys(e).forEach((r=>{Ao(e[r])?r in t?n[r]=Oo(t[r],e[r]):Object.assign(n,{[r]:e[r]}):Object.assign(n,{[r]:e[r]})})),n}function Ao(t){return t&&"object"==typeof t&&!Array.isArray(t)}const Bo=new(a=class{constructor(){u(this,i),this.container=null,this.app=null,this.isInitialized=!1,this.config=null,this.api=Xr}async init(t={}){return"undefined"==typeof window?console.error("Playlight cannot run on the server, as it depends on browser APIs."):this.isInitialized?(console.warn("Playlight SDK already initialized!"),void(document.getElementById("playlight-sdk-container")||c(this,i,l).call(this))):(this.config=No(t),c(this,i,l).call(this),await this.api.getCurrentGameInfo(),void(this.isInitialized=!0))}setDiscovery(t=!0){this.isInitialized&&(Fr.set(t),t&&Xr.trackOpen())}},i=new WeakSet,l=function(){try{this.container=document.createElement("div"),this.container.id="playlight-sdk-container",this.container.className="playlight-sdk-container",document.body.appendChild(this.container),this.app=(t=jo,e={target:this.container,props:{config:this.config}},function(t,{target:e,anchor:n,props:r={},events:o,context:i,intro:l=!0}){!function(){if(void 0===nt){nt=window,rt=document,ot=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype;it=h(e,"firstChild").get,lt=h(e,"nextSibling").get,t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0,Text.prototype.__t=void 0}}();var a=new Set,s=t=>{for(var n=0;n<t.length;n++){var r=t[n];if(!a.has(r)){a.add(r);var o=Te(r);e.addEventListener(r,We,{passive:o});var i=Xe.get(r);void 0===i?(document.addEventListener(r,We,{passive:o}),Xe.set(r,1)):Xe.set(r,i+1)}}};s(v(Be)),ze.add(s);var u=void 0,c=function(t){const e=yt(64,t,!0);return(t={})=>new Promise((n=>{t.outro?Tt(e,(()=>{jt(e),n(void 0)})):(jt(e),n(void 0))}))}((()=>{var c=n??e.appendChild(at());return Pt((()=>{i&&(G({}),L.c=i),o&&(r.$$events=o),Ye=l,u=t(c,r)||{},Ye=!0,i&&F()})),()=>{var t;for(var r of a){e.removeEventListener(r,We);var o=Xe.get(r);0==--o?(document.removeEventListener(r,We),Xe.delete(r)):Xe.set(r,o)}ze.delete(s),c!==n&&(null==(t=c.parentNode)||t.removeChild(c))}}));return Qe.set(u,c),u}(t,e))}catch(t){console.error("Playlight error occured during mount:",t)}var t,e},a);return"undefined"!=typeof window&&(window.playlightSDK=Bo),Bo}();
|
|
22
|
+
const ir={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};var lr=He("<svg><!><!></svg>");function ar(t,e){const n=tr(e,["children","$$slots","$$events","$$legacy"]),r=tr(n,["name","color","size","strokeWidth","absoluteStrokeWidth","iconNode"]);G(e,!1);let o=rr(e,"name",8,void 0),i=rr(e,"color",8,"currentColor"),l=rr(e,"size",8,24),a=rr(e,"strokeWidth",8,2),s=rr(e,"absoluteStrokeWidth",8,!1),u=rr(e,"iconNode",24,(()=>[]));Gn();var c=lr();let d;var f=ct(c);on(f,1,u,rn,((t,e)=>{var n,r,o,i,l,a,s,u,c,d=Ke();n=dt(d),r=()=>we(e)[0],o=(t,n)=>{let r;Ct((()=>r=Sn(t,r,{...we(e)[1]})))},s=null,u=n,c=en,St((()=>{const t=r()||null;if(t!==i){var e=en;nn(c),a&&(null===t?Tt(a,(()=>{a=null,l=null})):t===l?At(a):(jt(a),Ze(!1))),t&&t!==l&&(a=Pt((()=>{if(Fe(s=document.createElementNS("http://www.w3.org/2000/svg",t),s),o){var e=s.appendChild(at());o(s,e)}Xt.nodes_end=s,u.before(s)}))),(i=t)&&(l=i),Ze(!0),nn(e)}}),j),Ue(t,d)})),cn(ft(f),e,"default",{},null),Ct(((t,e)=>d=Sn(c,d,{...ir,...r,width:l(),height:l(),stroke:i(),"stroke-width":t,class:e})),[()=>s()?24*Number(a())/Number(l()):a(),()=>((...t)=>t.filter(((t,e,n)=>Boolean(t)&&n.indexOf(t)===e)).join(" "))("lucide-icon","lucide",o()?`lucide-${o()}`:"",n.class)],pt),Ue(t,c),F()}function sr(t,e){const n=tr(e,["children","$$slots","$$events","$$legacy"]);ar(t,nr({name:"loader-circle"},(()=>n),{iconNode:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56"}]],children:(t,n)=>{var r=Ke();cn(dt(r),e,"default",{},null),Ue(t,r)},$$slots:{default:!0}}))}function ur(t){const e=t-1;return e*e*e+1}function cr(t){return t<.5?4*t*t*t:.5*Math.pow(2*t-2,3)+1}function dr(t){const e="string"==typeof t&&t.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[t,"px"]}function fr(t,{delay:e=0,duration:n=400,easing:r=cr,amount:o=5,opacity:i=0}={}){const l=getComputedStyle(t),a=+l.opacity,s="none"===l.filter?"":l.filter,u=a*(1-i),[c,d]=dr(o);return{delay:e,duration:n,easing:r,css:(t,e)=>`opacity: ${a-u*e}; filter: ${s} blur(${e*c}${d});`}}function vr(t,{delay:e=0,duration:n=400,easing:r=ur,x:o=0,y:i=0,opacity:l=0}={}){const a=getComputedStyle(t),s=+a.opacity,u="none"===a.transform?"":a.transform,c=s*(1-l),[d,f]=dr(o),[v,p]=dr(i);return{delay:e,duration:n,easing:r,css:(t,e)=>`\n\t\t\ttransform: ${u} translate(${(1-t)*d}${f}, ${(1-t)*v}${p});\n\t\t\topacity: ${s-c*e}`}}function pr(t,{delay:e=0,duration:n=400,easing:r=ur,axis:o="y"}={}){const i=getComputedStyle(t),l=+i.opacity,a="y"===o?"height":"width",s=parseFloat(i[a]),u="y"===o?["top","bottom"]:["left","right"],c=u.map((t=>`${t[0].toUpperCase()}${t.slice(1)}`)),d=parseFloat(i[`padding${c[0]}`]),f=parseFloat(i[`padding${c[1]}`]),v=parseFloat(i[`margin${c[0]}`]),p=parseFloat(i[`margin${c[1]}`]),h=parseFloat(i[`border${c[0]}Width`]),g=parseFloat(i[`border${c[1]}Width`]);return{delay:e,duration:n,easing:r,css:t=>`overflow: hidden;opacity: ${Math.min(20*t,1)*l};${a}: ${t*s}px;padding-${u[0]}: ${t*d}px;padding-${u[1]}: ${t*f}px;margin-${u[0]}: ${t*v}px;margin-${u[1]}: ${t*p}px;border-${u[0]}-width: ${t*h}px;border-${u[1]}-width: ${t*g}px;min-${a}: 0`}}function hr(t,{delay:e=0,duration:n=400,easing:r=ur,start:o=0,opacity:i=0}={}){const l=getComputedStyle(t),a=+l.opacity,s="none"===l.transform?"":l.transform,u=1-o,c=a*(1-i);return{delay:e,duration:n,easing:r,css:(t,e)=>`\n\t\t\ttransform: ${s} scale(${1-u*e});\n\t\t\topacity: ${a-c*e}\n\t\t`}}var gr=(t,e)=>{var n;null==(n=e.onClick)||n.call(e)},mr=Re('<button id="floating playlight button" aria-label="Open Playlight Discovery"><p class="z-2 flex items-center overflow-hidden svelte-1j97rta"><!> <span class="mr-0.25 inline-block font-bold svelte-1j97rta">More Games</span></p> <div class="bg-background absolute bottom-0 left-0 h-full w-0 transition-all duration-300 group-hover:w-full svelte-1j97rta"></div></button>');Le(["click"]);var yr=He('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd"></path></svg>'),br=He('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>'),wr=He('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z" clip-rule="evenodd"></path></svg>'),xr=He('<svg viewBox="0 0 64 64" fill="currentColor" height="20" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M32.427,7.987c2.183,0.124 4,1.165 5.096,3.281l17.936,36.208c1.739,3.66 -0.954,8.585 -5.373,8.656l-36.119,0c-4.022,-0.064 -7.322,-4.631 -5.352,-8.696l18.271,-36.207c0.342,-0.65 0.498,-0.838 0.793,-1.179c1.186,-1.375 2.483,-2.111 4.748,-2.063Zm-0.295,3.997c-0.687,0.034 -1.316,0.419 -1.659,1.017c-6.312,11.979 -12.397,24.081 -18.301,36.267c-0.546,1.225 0.391,2.797 1.762,2.863c12.06,0.195 24.125,0.195 36.185,0c1.325,-0.064 2.321,-1.584 1.769,-2.85c-5.793,-12.184 -11.765,-24.286 -17.966,-36.267c-0.366,-0.651 -0.903,-1.042 -1.79,-1.03Z"></path><path d="M33.631,40.581l-3.348,0l-0.368,-16.449l4.1,0l-0.384,16.449Zm-3.828,5.03c0,-0.609 0.197,-1.113 0.592,-1.514c0.396,-0.4 0.935,-0.601 1.618,-0.601c0.684,0 1.223,0.201 1.618,0.601c0.395,0.401 0.593,0.905 0.593,1.514c0,0.587 -0.193,1.078 -0.577,1.473c-0.385,0.395 -0.929,0.593 -1.634,0.593c-0.705,0 -1.249,-0.198 -1.634,-0.593c-0.384,-0.395 -0.576,-0.886 -0.576,-1.473Z"></path></svg>');function _r(t,e){let n=rr(e,"type",8,"success");var r=Ke(),o=dt(r),i=t=>{Ue(t,yr())},l=(t,e)=>{var r=t=>{Ue(t,br())},o=(t,e)=>{var r=t=>{Ue(t,wr())},o=(t,e)=>{var r=t=>{Ue(t,xr())},o=t=>{};tn(t,(t=>{"warning"===n()?t(r):t(o,!1)}),e)};tn(t,(t=>{"info"===n()?t(r):t(o,!1)}),e)};tn(t,(t=>{"error"===n()?t(r):t(o,!1)}),e)};tn(o,(t=>{"success"===n()?t(i):t(l,!1)})),Ue(t,r)}var $r=Re('<div class="sonner-loading-bar"></div>'),kr=Re('<div class="sonner-loading-wrapper"><div class="sonner-spinner"></div></div>');function Cr(...t){return t.filter(Boolean).join(" ")}const Sr="undefined"!=typeof document;function Pr(t){const e=Vn(t);return{subscribe:e.subscribe,set:function(t){Sr&&e.set(t)},update:function(t){Sr&&e.update(t)}}}let Mr=0;const Ir=function(){const t=Pr([]),e=Pr([]);function n(e){t.update((t=>[e,...t]))}function r(e){var r;const{message:o,...i}=e,l="number"==typeof(null==e?void 0:e.id)||e.id&&(null==(r=e.id)?void 0:r.length)>0?e.id:Mr++,a=void 0===e.dismissable||e.dismissable,s=void 0===e.type?"default":e.type;return Kn(t).find((t=>t.id===l))?t.update((t=>t.map((t=>t.id===l?{...t,...e,id:l,title:o,dismissable:a,type:s,updated:!0}:{...t,updated:!1})))):n({...i,id:l,title:o,dismissable:a,type:s}),l}function o(e){if(void 0!==e)return t.update((t=>t.map((t=>t.id===e?{...t,dismiss:!0}:t)))),e;t.update((t=>t.map((t=>({...t,dismiss:!0})))))}return{create:r,addToast:n,dismiss:o,remove:function(e){if(void 0!==e)return t.update((t=>t.filter((t=>t.id!==e)))),e;t.set([])},message:function(t,e){return r({...e,type:"default",message:t})},error:function(t,e){return r({...e,type:"error",message:t})},success:function(t,e){return r({...e,type:"success",message:t})},info:function(t,e){return r({...e,type:"info",message:t})},warning:function(t,e){return r({...e,type:"warning",message:t})},loading:function(t,e){return r({...e,type:"loading",message:t})},promise:function(t,e){if(!e)return;let n;void 0!==e.loading&&(n=r({...e,promise:t,type:"loading",message:e.loading}));const i=t instanceof Promise?t:t();let l=void 0!==n;return i.then((t=>{if(t&&"boolean"==typeof t.ok&&!t.ok){l=!1;const o="function"==typeof e.error?e.error(`HTTP error! status: ${t.status}`):e.error;r({id:n,type:"error",message:o})}else if(void 0!==e.success){l=!1;const o="function"==typeof e.success?e.success(t):e.success;r({id:n,type:"success",message:o})}})).catch((t=>{if(void 0!==e.error){l=!1;const o="function"==typeof e.error?e.error(t):e.error;r({id:n,type:"error",message:o})}})).finally((()=>{var t;l&&(o(n),n=void 0),null==(t=e.finally)||t.call(e)})),n},custom:function(t,e){const n=(null==e?void 0:e.id)||Mr++;return r({component:t,id:n,...e}),n},removeHeight:function(t){e.update((e=>e.filter((e=>e.toastId!==t))))},setHeight:function(t){void 0!==Kn(e).find((e=>e.toastId===t.toastId))?e.update((e=>e.map((e=>e.toastId===t.toastId?t:e)))):e.update((e=>[t,...e]))},reset:function(){t.set([]),e.set([])},toasts:t,heights:e}}(),jr=Object.assign((function(t,e){return Ir.create({message:t,...e})}),{success:Ir.success,info:Ir.info,warning:Ir.warning,error:Ir.error,custom:Ir.custom,message:Ir.message,promise:Ir.promise,dismiss:Ir.dismiss,loading:Ir.loading});var Er=Re('<button aria-label="Close toast" data-close-button=""><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></button>'),Tr=Re('<div data-icon=""><!> <!></div>'),Nr=Re('<div data-title=""><!></div>'),Or=Re('<div data-description=""><!></div>'),Ar=Re('<button data-button="" data-cancel=""> </button>'),Br=Re('<button data-button=""> </button>'),zr=Re('<!> <div data-content=""><!> <!></div> <!> <!>',1),Dr=Re('<li aria-atomic="true" role="status" data-sonner-toast=""><!> <!></li>');function qr(t,e){const n=tr(e,["children","$$slots","$$events","$$legacy"]);G(e,!1);const[r,o]=Xn(),i=()=>Zn(_,"$heights",r),l=()=>Zn(we(lt),"$effect",r),a=U(void 0,!0),s=U(void 0,!0),u=U(void 0,!0),c=U(void 0,!0),d=U(void 0,!0),f=U(void 0,!0),v=U(void 0,!0),p=U(void 0,!0),h=U(void 0,!0),g=U(void 0,!0),m=U(void 0,!0),y=U(void 0,!0),b={toast:"",title:"",description:"",loader:"",closeButton:"",cancelButton:"",actionButton:"",action:"",warning:"",error:"",success:"",default:"",info:"",loading:""},{toasts:w,heights:_,removeHeight:$,setHeight:k,remove:C}=Ir;let S=rr(e,"toast",9),P=rr(e,"index",9),M=rr(e,"expanded",9),I=rr(e,"invert",13),j=rr(e,"position",9),E=rr(e,"visibleToasts",9),T=rr(e,"expandByDefault",9),N=rr(e,"closeButton",9),O=rr(e,"interacting",9),A=rr(e,"cancelButtonStyle",9,""),B=rr(e,"actionButtonStyle",9,""),z=rr(e,"duration",9,4e3),D=rr(e,"descriptionClass",9,""),q=rr(e,"classes",29,(()=>({}))),L=rr(e,"unstyled",9,!1),W=U(!1,!0),R=U(!1,!0),H=U(!1,!0),V=U(!1,!0),K=U(0,!0),Y=U(0,!0),J=U(void 0,!0),X=U(0,!0),Q=0,tt=0,et=null;function nt(){Z(R,!0),Z(K,we(X)),$(S().id),setTimeout((()=>{C(S().id)}),200)}let rt=U(void 0,!0),ot=U(S().duration||z()||4e3,!0);function it(){Q=(new Date).getTime(),Z(rt,setTimeout((()=>{var t,e;null==(e=(t=S()).onAutoClose)||e.call(t,S()),nt()}),we(ot)))}let lt=U(void 0,!0);or((()=>{Z(W,!0);const t=we(J).getBoundingClientRect().height;return Z(Y,t),k({toastId:S().id,height:t}),()=>$(S().id)})),_t((()=>ke(q())),(()=>{q({...b,...q()})})),_t((()=>ke(P())),(()=>{Z(a,0===P())})),_t((()=>(ke(P()),ke(E()))),(()=>{Z(s,P()+1<=E())})),_t((()=>ke(S())),(()=>{Z(u,S().title)})),_t((()=>ke(S())),(()=>{Z(c,S().description)})),_t((()=>ke(S())),(()=>{Z(d,S().type)})),_t((()=>ke(S())),(()=>{Z(f,S().class||"")})),_t((()=>ke(S())),(()=>{Z(v,S().descriptionClass||"")})),_t((()=>(i(),ke(S()))),(()=>{Z(p,i().findIndex((t=>t.toastId===S().id))||0)})),_t((()=>ke(j())),(()=>{Z(h,j().split("-"))})),_t((()=>(i(),we(p))),(()=>{Z(g,i().reduce(((t,e,n)=>n>=we(p)?t:t+e.height),0))})),_t((()=>(ke(I()),ke(S()))),(()=>{I(S().invert||I())})),_t((()=>we(d)),(()=>{Z(m,"loading"===we(d))})),_t((()=>(we(p),we(g))),(()=>{Z(X,Math.round(14*we(p)+we(g)))})),_t((()=>(we(u),we(c))),(()=>{we(u),we(c),async function(){if(!we(W))return;let t;await async function(){await Promise.resolve(),function(){for(Wt();Ut.length>0;)Ft=!0,ge(),Wt()}()}(),t=M()||T()?1:1-.05*P(),we(J).style.setProperty("height","auto");const e=we(J).offsetHeight,n=we(J).getBoundingClientRect().height,r=Math.round(100*(n/t+Number.EPSILON))/100;let o;we(J).style.removeProperty("height"),o=Math.abs(r-e)<1?r:e,Z(Y,o),k({toastId:S().id,height:o})}()})),_t((()=>(ke(S()),we(rt),ke(z()))),(()=>{S().updated&&(clearTimeout(we(rt)),Z(ot,S().duration||z()||4e3),it())})),_t((()=>(ke(S()),we(d))),(()=>{Z(y,S().promise&&"loading"===we(d)||S().duration===Number.POSITIVE_INFINITY)})),_t((()=>(we(y),ke(M()),ke(O()),we(rt))),(()=>{var t;!function(t,e,n){let r=n[e];r&&r.store!==t&&(r.unsubscribe(),r.unsubscribe=x)}(Z(lt,(t=()=>(we(y)||(M()||O()?function(){if(tt<Q){const t=(new Date).getTime()-Q;Z(ot,we(ot)-t)}tt=(new Date).getTime()}():it()),()=>clearTimeout(we(rt))),{subscribe:t})),"$effect",r)})),_t((()=>l()),(()=>{l()})),_t((()=>ke(S())),(()=>{S().delete&&nt()})),$t(),Gn(!0);var at=Dr();let st;Cn(at,"tabindex",0);var ut=ct(at),vt=t=>{var e=Er();Ct((t=>{Cn(e,"data-disabled",we(m)),mn(e,1,t)}),[()=>{var t,e,n;return vn(Cr(null==(t=q())?void 0:t.closeButton,null==(n=null==(e=S())?void 0:e.classes)?void 0:n.closeButton))}],pt),qe("click",e,(function(...t){var e;null==(e=we(m)?void 0:()=>{var t,e;nt(),null==(e=(t=S()).onDismiss)||e.call(t,S())})||e.apply(this,t)})),Ue(t,e)};tn(ut,(t=>{N()&&!S().component&&t(vt)}));var ht=ft(ut,2),gt=t=>{var e=Ke();dn(dt(e),(()=>S().component),((t,e)=>{e(t,nr((()=>S().componentProps),{$$events:{closeToast:nt}}))})),Ue(t,e)},mt=t=>{var n=zr(),r=dt(n),o=t=>{var n=Tr(),r=ct(n),o=t=>{var n=Ke();cn(dt(n),e,"loading-icon",{},null),Ue(t,n)};tn(r,(t=>{!S().promise&&"loading"!==we(d)||S().icon||t(o)}));var i=ft(r,2),l=t=>{var e=Ke();dn(dt(e),(()=>S().icon),((t,e)=>{e(t,{})})),Ue(t,e)},a=(t,n)=>{var r=t=>{var n=Ke();cn(dt(n),e,"success-icon",{},null),Ue(t,n)},o=(t,n)=>{var r=t=>{var n=Ke();cn(dt(n),e,"error-icon",{},null),Ue(t,n)},o=(t,n)=>{var r=t=>{var n=Ke();cn(dt(n),e,"warning-icon",{},null),Ue(t,n)},o=(t,n)=>{var r=t=>{var n=Ke();cn(dt(n),e,"info-icon",{},null),Ue(t,n)};tn(t,(t=>{"info"===we(d)&&t(r)}),n)};tn(t,(t=>{"warning"===we(d)?t(r):t(o,!1)}),n)};tn(t,(t=>{"error"===we(d)?t(r):t(o,!1)}),n)};tn(t,(t=>{"success"===we(d)?t(r):t(o,!1)}),n)};tn(i,(t=>{S().icon?t(l):t(a,!1)})),Ue(t,n)};tn(r,(t=>{("default"!==we(d)||S().icon||S().promise)&&t(o)}));var i=ft(r,2),l=ct(i),a=t=>{var e=Nr(),n=ct(e),r=t=>{var e=Ke();dn(dt(e),(()=>S().title),((t,e)=>{e(t,nr((()=>S().componentProps)))})),Ue(t,e)},o=t=>{var e=Ve();Ct((()=>Je(e,S().title))),Ue(t,e)};tn(n,(t=>{"string"!=typeof S().title?t(r):t(o,!1)})),Ct((t=>mn(e,1,t)),[()=>{var t,e,n;return vn(Cr(null==(t=q())?void 0:t.title,null==(n=null==(e=S())?void 0:e.classes)?void 0:n.title))}],pt),Ue(t,e)};tn(l,(t=>{S().title&&t(a)}));var s=ft(l,2),u=t=>{var e=Or(),n=ct(e),r=t=>{var e=Ke();dn(dt(e),(()=>S().description),((t,e)=>{e(t,nr((()=>S().componentProps)))})),Ue(t,e)},o=t=>{var e=Ve();Ct((()=>Je(e,S().description))),Ue(t,e)};tn(n,(t=>{"string"!=typeof S().description?t(r):t(o,!1)})),Ct((t=>mn(e,1,t)),[()=>{var t,e;return vn(Cr(D(),we(v),null==(t=q())?void 0:t.description,null==(e=S().classes)?void 0:e.description))}],pt),Ue(t,e)};tn(s,(t=>{S().description&&t(u)}));var c=ft(i,2),f=t=>{var e=Ar(),n=ct(e);Ct((t=>{bn(e,A()),mn(e,1,t),Je(n,S().cancel.label)}),[()=>{var t,e,n;return vn(Cr(null==(t=q())?void 0:t.cancelButton,null==(n=null==(e=S())?void 0:e.classes)?void 0:n.cancelButton))}],pt),qe("click",e,(()=>{var t;nt(),(null==(t=S().cancel)?void 0:t.onClick)&&S().cancel.onClick()})),Ue(t,e)};tn(c,(t=>{S().cancel&&t(f)}));var p=ft(c,2),h=t=>{var e=Br(),n=ct(e);Ct((t=>{bn(e,B()),mn(e,1,t),Je(n,S().action.label)}),[()=>{var t,e,n;return vn(Cr(null==(t=q())?void 0:t.actionButton,null==(n=null==(e=S())?void 0:e.classes)?void 0:n.actionButton))}],pt),qe("click",e,(t=>{var e;null==(e=S().action)||e.onClick(t),t.defaultPrevented||nt()})),Ue(t,e)};tn(p,(t=>{S().action&&t(h)})),Ue(t,n)};tn(ht,(t=>{S().component?t(gt):t(mt,!1)})),Wn(at,(t=>Z(J,t)),(()=>we(J))),Ct(((t,e,o)=>{var i;Cn(at,"aria-live",S().important?"assertive":"polite"),mn(at,1,t),Cn(at,"data-styled",!(S().component||(null==(i=S())?void 0:i.unstyled)||L())),Cn(at,"data-mounted",we(W)),Cn(at,"data-promise",e),Cn(at,"data-removed",we(R)),Cn(at,"data-visible",we(s)),Cn(at,"data-y-position",we(h)[0]),Cn(at,"data-x-position",we(h)[1]),Cn(at,"data-index",P()),Cn(at,"data-front",we(a)),Cn(at,"data-swiping",we(H)),Cn(at,"data-type",we(d)),Cn(at,"data-invert",I()),Cn(at,"data-swipe-out",we(V)),Cn(at,"data-expanded",o),st=bn(at,`${n.style} ${S().style}`,st,{"--index":P(),"--toasts-before":P(),"--z-index":Zn(w,"$toasts",r).length-P(),"--offset":`${we(R)?we(K):we(X)}px`,"--initial-height":`${we(Y)}px`})}),[()=>{var t,e,r,o,i,l;return vn(Cr(n.class,we(f),null==(t=q())?void 0:t.toast,null==(r=null==(e=S())?void 0:e.classes)?void 0:r.toast,null==(o=q())?void 0:o[we(d)],null==(l=null==(i=S())?void 0:i.classes)?void 0:l[we(d)]))},()=>Boolean(S().promise),()=>Boolean(M()||T()&&we(W))],pt),qe("pointerdown",at,(function(t){if(we(m))return;Z(K,we(X));const e=t.target;e.setPointerCapture(t.pointerId),"BUTTON"!==e.tagName&&(Z(H,!0),et={x:t.clientX,y:t.clientY})})),qe("pointerup",at,(function(){var t,e,n;if(we(V))return;et=null;const r=Number((null==(t=we(J))?void 0:t.style.getPropertyValue("--swipe-amount").replace("px",""))||0);if(Math.abs(r)>=20)return Z(K,we(X)),null==(n=(e=S()).onDismiss)||n.call(e,S()),nt(),void Z(V,!0);we(J).style.setProperty("--swipe-amount","0px"),Z(H,!1)})),qe("pointermove",at,(function(t){if(!et)return;const e=t.clientY-et.y,n=t.clientX-et.x,r=("top"===we(h)[0]?Math.min:Math.max)(0,e),o="touch"===t.pointerType?10:2;Math.abs(r)>o?we(J).style.setProperty("--swipe-amount",`${e}px`):Math.abs(n)>o&&(et=null)})),Ue(t,at),F(),o()}var Lr=Re("<ol></ol>"),Wr=Re('<section class="svelte-1fo5d1m"></section>');function Gr(t,e){const n=tr(e,["children","$$slots","$$events","$$legacy"]),r=tr(n,["invert","theme","position","hotkey","containerAriaLabel","richColors","expand","duration","visibleToasts","closeButton","toastOptions","offset","dir"]);G(e,!1);const[o,i]=Xn(),l=()=>Zn(C,"$toasts",o),a=U(),s=U(),u="dark",c="light";function d(){if("undefined"==typeof window)return"ltr";if("undefined"==typeof document)return"ltr";const t=document.documentElement.getAttribute("dir");return"auto"!==t&&t?t:window.getComputedStyle(document.documentElement).direction}let f=rr(e,"invert",8,!1),v=rr(e,"theme",8,"light"),p=rr(e,"position",8,"bottom-right"),h=rr(e,"hotkey",24,(()=>["altKey","KeyT"])),g=rr(e,"containerAriaLabel",8,"Notifications"),m=rr(e,"richColors",8,!1),y=rr(e,"expand",8,!1),b=rr(e,"duration",8,4e3),w=rr(e,"visibleToasts",8,3),x=rr(e,"closeButton",8,!1),_=rr(e,"toastOptions",24,(()=>({}))),$=rr(e,"offset",8,null),k=rr(e,"dir",24,d);const{toasts:C,heights:S,reset:P}=Ir;let M=U(!1),I=U(!1),j=U("system"!==(O=v())?O:"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?u:c),E=U(),T=null,N=!1;var O;function A(t){N&&!t.currentTarget.contains(t.relatedTarget)&&(N=!1,T&&(T.focus({preventScroll:!0}),T=null))}function B(t){N||(N=!0,T=t.relatedTarget)}!function(t){null===L&&q(),or((()=>()=>xe(t)))}((()=>{we(E)&&T&&(T.focus({preventScroll:!0}),T=null,N=!1)})),or((()=>{P();const t=t=>{var e,n;h().every((e=>t[e]||t.code===e))&&(Z(M,!0),null==(e=we(E))||e.focus()),"Escape"!==t.code||document.activeElement!==we(E)&&!(null==(n=we(E))?void 0:n.contains(document.activeElement))||Z(M,!1)};return document.addEventListener("keydown",t),()=>{document.removeEventListener("keydown",t)}})),_t((()=>(ke(p()),l())),(()=>{Z(a,Array.from(new Set([p(),...l().filter((t=>t.position)).map((t=>t.position))].filter(Boolean))))})),_t((()=>ke(h())),(()=>{Z(s,h().join("+").replace(/Key/g,"").replace(/Digit/g,""))})),_t((()=>l()),(()=>{l().length<=1&&Z(M,!1)})),_t((()=>l()),(()=>{const t=l().filter((t=>t.dismiss&&!t.delete));if(t.length>0){const e=l().map((e=>t.find((t=>t.id===e.id))?{...e,delete:!0}:e));C.set(e)}})),_t((()=>ke(v())),(()=>{if("system"!==v()&&Z(j,v()),"undefined"!=typeof window){"system"===v()&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Z(j,u):Z(j,c));const t=window.matchMedia("(prefers-color-scheme: dark)"),e=({matches:t})=>{Z(j,t?u:c)};"addEventListener"in t?t.addEventListener("change",e):t.addListener(e)}})),$t(),Gn();var z=Ke(),D=dt(z),W=t=>{var i=Wr();Cn(i,"tabindex",-1),on(i,5,(()=>we(a)),rn,((t,i,a,s)=>{var u=Lr();let c;on(u,7,(()=>l().filter((t=>!t.position&&0===a||t.position===we(i)))),(t=>t.id),((t,n,r,o)=>{const l=pt((()=>{var t;return(null==(t=_())?void 0:t.actionButtonStyle)||""})),a=pt((()=>{var t;return(null==(t=_())?void 0:t.cancelButtonStyle)||""})),s=pt((()=>{var t;return(null==(t=_())?void 0:t.class)||""})),u=pt((()=>{var t;return(null==(t=_())?void 0:t.descriptionClass)||""})),c=pt((()=>_().classes||{})),d=pt((()=>{var t;return(null==(t=_())?void 0:t.duration)??b()})),v=pt((()=>_().unstyled||!1));qr(t,{get index(){return we(r)},get toast(){return we(n)},get invert(){return f()},get visibleToasts(){return w()},get closeButton(){return x()},get interacting(){return we(I)},get position(){return we(i)},get expandByDefault(){return y()},get expanded(){return we(M)},get actionButtonStyle(){return we(l)},get cancelButtonStyle(){return we(a)},get class(){return we(s)},get descriptionClass(){return we(u)},get classes(){return we(c)},get duration(){return we(d)},get unstyled(){return we(v)},$$slots:{"loading-icon":(t,r)=>{var o=Ke();cn(dt(o),e,"loading-icon",{},(t=>{const e=pt((()=>"loading"===we(n).type));!function(t,e){G(e,!1);let n=rr(e,"visible",8);const r=Array(12).fill(0);Gn();var o=kr();on(ct(o),5,(()=>r),rn,((t,e)=>{Ue(t,$r())})),Ct((()=>Cn(o,"data-visible",n()))),Ue(t,o),F()}(t,{get visible(){return we(e)}})})),Ue(t,o)},"success-icon":(t,n)=>{var r=Ke();cn(dt(r),e,"success-icon",{},(t=>{_r(t,{type:"success"})})),Ue(t,r)},"error-icon":(t,n)=>{var r=Ke();cn(dt(r),e,"error-icon",{},(t=>{_r(t,{type:"error"})})),Ue(t,r)},"warning-icon":(t,n)=>{var r=Ke();cn(dt(r),e,"warning-icon",{},(t=>{_r(t,{type:"warning"})})),Ue(t,r)},"info-icon":(t,n)=>{var r=Ke();cn(dt(r),e,"info-icon",{},(t=>{_r(t,{type:"info"})})),Ue(t,r)}}})})),Wn(u,(t=>Z(E,t)),(()=>we(E))),Ct(((t,e,i)=>{var l;c=Sn(u,c,{tabIndex:-1,class:n.class,"data-sonner-toaster":!0,"data-theme":we(j),"data-rich-colors":m(),dir:t,"data-y-position":e,"data-x-position":i,style:n.style,...r,[xn]:{"--front-toast-height":`${null==(l=Zn(S,"$heights",o)[0])?void 0:l.height}px`,"--offset":"number"==typeof $()?`${$()}px`:$()||"32px","--width":"356px","--gap":"14px"}},"svelte-1fo5d1m"),u.dir=u.dir}),[()=>"auto"===k()?d():k(),()=>we(i).split("-")[0],()=>we(i).split("-")[1]],pt),qe("blur",u,A),qe("focus",u,B),qe("mouseenter",u,(()=>Z(M,!0))),qe("mousemove",u,(()=>Z(M,!0))),qe("mouseleave",u,(()=>{we(I)||Z(M,!1)})),qe("pointerdown",u,(()=>Z(I,!0))),qe("pointerup",u,(()=>Z(I,!1))),Ue(t,u)})),Ct((()=>Cn(i,"aria-label",`${g()} ${we(s)}`))),Ue(t,i)};tn(D,(t=>{l().length>0&&t(W)})),Ue(t,z),F(),i()}const Fr=Vn(!1),Rr=Vn("https://sdk.playlight.dev");var Hr=(t,e,n,r)=>{var o;we(e)&&!we(n)||(null==(o=r.onClick)||o.call(r,r.game.id),window.open("https://"+r.game.domain,"_blank","noopener"))},Vr=Re('<div><p class="text-primary font-bold uppercase">New</p></div>'),Kr=Re('<video playsinline="" loop preload="auto"></video>',2),Ur=(t,n)=>{var r;e.stopPropagation(),null==(r=n.onClick)||r.call(n,n.game.id),window.open("https://"+n.game.domain,"_blank","noopener")},Yr=Re("<button>Play</button>"),Zr=Re('<div class="bg-background/75 text-foreground absolute right-0 bottom-0 left-0 z-11 flex max-h-1/3 flex-col overflow-hidden backdrop-blur-xl"><div class="hide-scrollbar h-full w-full overflow-y-auto p-3 svelte-rulnq9"><h3 class="mb-2 truncate text-center text-lg font-bold"> </h3> <p class="text-muted-foreground mb-4 text-center text-sm text-balance"> </p></div> <div class="fade-mask bg-background/75 pointer-events-none absolute right-0 bottom-0 left-0 h-8 svelte-rulnq9"></div></div>'),Jr=Re('<div role="button" tabindex="0"><!> <!> <img alt="cover" loading="eager"> <!> <!> <img alt="game logo" loading="eager"></div>');Le(["touchstart","click"]);const Xr=new(o=class{constructor(){u(this,n),this.baseUrl="https://api.playlight.dev/platform",this.cachedCategories=null,this.currentGame=null}async request(t,e={}){try{const n=`${this.baseUrl}${t}`,r=await fetch(n,{...e,headers:{"Content-Type":"application/json",...e.headers}});if(!r.ok){let t;try{t=await r.json()}catch{}finally{if(429!==r.status&&404!==r.status)throw new Error(`API request failed: ${(null==t?void 0:t.error)||(null==t?void 0:t.message)||r.status}`);return 429===r.status?console.warn("Playlight request didn't go through due to rate limiting."):console.warn("Playlight game not found. This is normal in a test / local environment, but should not appear in production.")}}return await r.json()}catch(n){jr.error("Error: "+n),console.error("Playlight API error:",n)}}async getCategories(){if(this.cachedCategories)return this.cachedCategories;const t=await this.request("/categories");return this.cachedCategories=t,t}async getSuggestions(t=null,e=1){let o="/suggestions";return t&&(o+="/"+t),e&&(o+="?page="+e),o+="&without="+c(this,n,r).call(this),await this.request(o)}async getCurrentGameInfo(){if(this.currentGame)return this.currentGame;let t="/game-by-domain/"+c(this,n,r).call(this);return this.currentGame=await this.request(t),this.currentGame?{...this.currentGame}:void 0}async trackOpen(){const t=c(this,n,r).call(this);await this.request("/event/open",{method:"POST",body:JSON.stringify({domain:t})})}async trackClick(t){const e=c(this,n,r).call(this);await this.request("/event/click",{method:"POST",body:JSON.stringify({sourceDomain:e,gameId:t})})}async toggleLike(t,e=!0){const n=e?"like":"unlike",r=await this.request(`/rating/${t}/${n}`,{method:"POST"});return(null==r?void 0:r.success)||!1}},n=new WeakSet,r=function(){const t=window.location.hostname;return t.startsWith("www.")?t.substring(4):t},o);function Qr(t){const e=t-1;return e*e*e+1}function to(t){return Math.sin(-13*(t+1)*Math.PI/2)*Math.pow(2,-10*t)+1}function eo(t,{from:e,to:n},r={}){var{delay:o=0,duration:i=t=>120*Math.sqrt(t),easing:l=Qr}=r,a=getComputedStyle(t),s="none"===a.transform?"":a.transform,[u,c]=a.transformOrigin.split(" ").map(parseFloat);u/=t.clientWidth,c/=t.clientHeight;var d=function(t){if("currentCSSZoom"in t)return t.currentCSSZoom;for(var e=t,n=1;null!==e;)n*=+getComputedStyle(e).zoom,e=e.parentElement;return n}(t),f=t.clientWidth/n.width/d,v=t.clientHeight/n.height/d,p=e.left+e.width*u,h=e.top+e.height*c,g=n.left+n.width*u,m=n.top+n.height*c,y=(p-g)*f,b=(h-m)*v,w=e.width/n.width,x=e.height/n.height;return{delay:o,duration:"function"==typeof i?i(Math.sqrt(y*y+b*b)):i,easing:l,css:(t,e)=>`transform: ${s} translate(${e*y}px, ${e*b}px) scale(${t+e*w}, ${t+e*x});`}}var no=(t,e,n)=>{Z(e,""),Z(n,!we(n))},ro=Re('<div class="text-muted-foreground animate-pulse p-4 text-center">Loading...</div>'),oo=Re('<div class="text-muted-foreground p-4 text-center">No categories found.</div>'),io=(t,e,n,r)=>{e(n),Z(r,!1)},lo=Re("<button> </button>"),ao=Re('<div class="space-y-1 p-1"></div>'),so=Re('<div class="bg-background/85 fixed left-1/2 z-50 mt-24 w-30 w-full max-w-xs -translate-x-1/2 transform border shadow-lg backdrop-blur-xl"><div class="border-b p-3"><div class="relative"><div class="pointer-events-none absolute inset-y-0 left-0 flex items-center pl-1"><!></div> <input type="text" placeholder="Search categories..." class="w-full border-0 p-1 pl-10 text-white focus:ring-0 focus:outline-none"></div></div> <div class="max-h-60 overflow-y-auto"><!></div></div>'),uo=Re('<div class="flex w-full flex-col py-2"><h1 class="mb-0! py-2 text-center text-2xl font-bold text-white drop-shadow-xl lg:text-4xl"><span> </span> <button class="group mx-1 inline-flex cursor-pointer items-center bg-white px-3 py-1 text-background transition hover:rotate-5"><span class="truncate max-w-[40vw] text-2xl font-bold text-background lg:text-4xl"> </span> <!></button> <span>games?</span></h1> <!></div>');function co(t,e){G(e,!0);let n,r=rr(e,"categories",19,(()=>[])),o=rr(e,"selectedCategory",15),i=V(!1),l=vt((()=>o()||(r().length>0?r()[0]:"..."))),a=V(""),s=V(void 0),u=vt((()=>we(a)?r().filter((t=>t.toLowerCase().includes(we(a).toLowerCase()))):r()));const c=["Looking for","Interested in","Searching for","Fancy some","What about these"];let d,f=V(tt(c[0]));or((function(){let t;for(t=Math.floor(Math.random()*(null==c?void 0:c.length));t==d;)t=Math.floor(Math.random()*(null==c?void 0:c.length));Z(f,tt(c[t])),d=t}));var v=uo();qe("click",rt,(function(t){we(s)&&!we(s).contains(t.target)&&n&&!n.contains(t.target)&&Z(i,!1)}));var p=ct(v),h=ct(p),g=ct(h),m=ft(h,2);m.__click=[no,a,i];var y=ct(m),b=ct(y),w=ft(y,2);const x=vt((()=>we(i)?"rotate-180 transform":""));!function(t,e){const n=tr(e,["children","$$slots","$$events","$$legacy"]);ar(t,nr({name:"chevron-down"},(()=>n),{iconNode:[["path",{d:"m6 9 6 6 6-6"}]],children:(t,n)=>{var r=Ke();cn(dt(r),e,"default",{},null),Ue(t,r)},$$slots:{default:!0}}))}(w,{size:25,strokeWidth:3,get class(){return`mt-1 ml-1 text-background ${we(x)??""} transition-transform duration-200`}}),Wn(m,(t=>n=t),(()=>n));var _=ft(p,2),$=t=>{var e=so(),n=ct(e),l=ct(n),c=ct(l);!function(t,e){const n=tr(e,["children","$$slots","$$events","$$legacy"]);ar(t,nr({name:"search"},(()=>n),{iconNode:[["circle",{cx:"11",cy:"11",r:"8"}],["path",{d:"m21 21-4.3-4.3"}]],children:(t,n)=>{var r=Ke();cn(dt(r),e,"default",{},null),Ue(t,r)},$$slots:{default:!0}}))}(ct(c),{size:18,strokeWidth:2.5,class:"text-muted-foreground"});var d=ft(c,2),f=ct(ft(n,2)),v=t=>{Ue(t,ro())},p=(t,e)=>{var n=t=>{Ue(t,oo())},r=t=>{var e=ao();on(e,28,(()=>we(u)),(t=>t),((t,e)=>{var n=lo();n.__click=[io,o,e,i];var r,l,a,s,u,c,d,f,v=ct(n);Ct((()=>{mn(n,1,`w-full cursor-pointer px-4 py-2 text-left transition-colors ${(o()!=e?"hover:bg-muted-foreground/20":"")??""} ${(o()==e?"bg-white text-background":"text-white")??""}`),Je(v,e)})),r=n,l=()=>eo,a=()=>({duration:150}),f=null,(d=en).a??(d.a={element:r,measure(){s=this.element.getBoundingClientRect()},apply(){if(null==c||c.abort(),u=this.element.getBoundingClientRect(),s.left!==u.left||s.right!==u.right||s.top!==u.top||s.bottom!==u.bottom){const t=l()(this.element,{from:s,to:u},null==a?void 0:a());c=zn(this.element,t,void 0,1,(()=>{null==c||c.abort(),c=void 0}))}},fix(){if(!r.getAnimations().length){var{position:t,width:e,height:n}=getComputedStyle(r);if("absolute"!==t&&"fixed"!==t){var o=r.style;f={position:o.position,width:o.width,height:o.height,transform:o.transform},o.position="absolute",o.width=e,o.height=n;var i=r.getBoundingClientRect();if(s.left!==i.left||s.top!==i.top){var l=`translate(${s.left-i.left}px, ${s.top-i.top}px)`;o.transform=o.transform?`${o.transform} ${l}`:l}}}},unfix(){if(f){var t=r.style;t.position=f.position,t.width=f.width,t.height=f.height,t.transform=f.transform}}}),d.a.element=r,Ue(t,n)})),Ue(t,e)};tn(t,(t=>{0===we(u).length?t(n):t(r,!1)}),e)};tn(f,(t=>{0===r().length?t(v):t(p,!1)})),Wn(e,(t=>Z(s,t)),(()=>we(s))),function(t,e,n=e){var r=R();(function(t,e,n,r=n){t.addEventListener(e,(()=>Ae(n)));const o=t.__on_r;t.__on_r=o?()=>{o(),r(!0)}:()=>r(!0),Oe||(Oe=!0,document.addEventListener("reset",(t=>{Promise.resolve().then((()=>{var e;if(!t.defaultPrevented)for(const n of t.target.elements)null==(e=n.__on_r)||e.call(n)}))}),{capture:!0}))})(t,"input",(o=>{var i=o?t.defaultValue:t.value;if(i=Dn(t)?qn(i):i,n(i),r&&i!==(i=e())){var l=t.selectionStart,a=t.selectionEnd;t.value=i??"",null!==a&&(t.selectionStart=l,t.selectionEnd=Math.min(a,t.value.length))}})),null==xe(e)&&t.value&&n(Dn(t)?qn(t.value):t.value),kt((()=>{var n=e();Dn(t)&&n===qn(t.value)||("date"!==t.type||n||t.value)&&n!==t.value&&(t.value=n??"")}))}(d,(()=>we(a)),(t=>Z(a,t))),Bn(3,e,(()=>vr),(()=>({y:-5,duration:250}))),Ue(t,e)};tn(_,(t=>{we(i)&&t($)})),Ct((()=>{Je(g,we(f)),Je(b,we(l))})),Bn(3,v,(()=>hr),(()=>({duration:600,delay:50,easing:to,start:.95}))),Ue(t,v),F()}Le(["click"]);var fo=Re('<div class="-mx-10 mt-5 flex h-1/2 max-h-[75vh] min-h-92 w-10 flex-col lg:h-3/7"><div class="flex h-full items-center justify-center"><div class="flex h-full w-full flex-col items-center justify-between py-6"><div class="bg-muted-foreground min-[1920px]:h-1/4 h-1/5 w-px"></div> <div class="text-muted-foreground origin-center -rotate-90 transform text-sm whitespace-nowrap select-none">From other categories</div> <div class="bg-muted-foreground h-1/5 w-px min-[1920px]:h-1/4"></div></div></div></div>');function vo(t,e,n,r,o,i){Z(e,!1),Z(n,!0),Z(r,250),Z(o,0),i(250,0,250,((t,e,n)=>{Z(r,t*(1-n)),Z(o,tt(n))}))}async function po(t,e,n,r){var o;if(!(null==(o=e.currentGame)?void 0:o.id))return;const i=!we(n);Z(n,!we(n)),Z(r,we(r)+(i?1:-1)),i?localStorage.setItem(`playlight_${e.currentGame.id}_liked`,"true"):localStorage.removeItem(`playlight_${e.currentGame.id}_liked`),await Xr.toggleLike(e.currentGame.id,i)||Z(r,we(r)+(i?-1:1))}var ho=Re('<div class="bg-background/85 fixed bottom-4 left-4 z-2 flex touch-none flex-wrap items-center gap-1 border-1 p-4 text-start shadow-lg backdrop-blur-lg max-sm:right-4 sm:w-72" role="button" tabindex="0"><div class="w-full"><p class="text-muted-foreground text-sm select-none">Currently playing</p></div> <div class="flex w-full items-center gap-2"><img alt="logo"> <p class="text-foreground max-w-2/3 truncate text-lg font-bold"> </p> <div class="mt-0.5 ml-auto flex items-center gap-2"><p class="text-muted-foreground text-sm"> </p> <button class="text-muted-foreground cursor-pointer transition hover:text-white"><!></button></div></div></div>'),go=Re('<div class="fixed bottom-0 z-3 shadow-xl max-sm:right-4 max-sm:left-4 sm:left-4 sm:w-72"><button class="bg-background/85 hover:bg-background/95 w-full rounded-t-md border px-4 py-1.5 backdrop-blur-sm transition" aria-label="Show game display"><div class="bg-muted-foreground mx-auto h-px w-16"></div></button></div>'),mo=Re("<!> <!>",1);function yo(t,e){t.target===t.currentTarget&&Jn(Fr,!1)}Le(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","click"]);var bo=(t,e)=>{localStorage.getItem("playlight_exit_intent_disabled_by_user")?localStorage.removeItem("playlight_exit_intent_disabled_by_user"):localStorage.setItem("playlight_exit_intent_disabled_by_user",!0),Z(e,!we(e))},wo=Re('<button class="cursor-pointer truncate text-sm text-nowrap opacity-50 transition hover:opacity-25 max-md:hidden"><p class="bg-background/50 text-primary p-1 px-2 text-sm"> </p></button>'),xo=(t,e)=>Jn(Fr,!1),_o=Re('<div class="flex h-4/5 items-center justify-center gap-4"><!></div>'),$o=Re('<div class="text-muted-foreground flex h-4/5 items-center justify-center gap-4"><p>No games found that match the filter.</p></div>'),ko=Re("<!> <!>",1),Co=Re('<div class="mx-auto flex h-full flex-wrap content-start justify-center gap-10 lg:max-w-4/5"><!> <div class="flex h-10 w-full justify-center"><!></div></div>'),So=Re('<div class="bg-background/75 fixed inset-0 top-0 right-0 bottom-0 left-0 z-99999 flex flex-col justify-center text-white backdrop-blur-md" id="playlight-discovery"><div class="pointer-events-none ml-2 flex items-center justify-between p-4"><img alt="logo" class="w-50 pointer-events-none"> <div class="mt-4 mr-2 flex items-center justify-evenly gap-8 overflow-hidden md:mr-4"><!> <button class="cursor-pointer text-white transition hover:opacity-50"><!></button></div></div> <div class="mx-auto p-2 px-5"><!></div> <!> <div class="mask-fade no-scrollbar relative h-full w-full overflow-y-auto p-4 svelte-12skmk8"><!></div> <a href="https://playlight.dev" target="_blank" class="text-muted-foreground fixed right-4 bottom-4 flex items-center gap-1 text-sm transition hover:text-white">Join Playlight <!></a></div>');function Po(t,e){G(e,!0);const[n,r]=Xn(),o=()=>Zn(Fr,"$discoveryOpen",n);let i,l=rr(e,"showIntentToggle",3,!0),a=V(!0),s=V(void 0),u=V(!0),c=V(!1),d=V(void 0),f=V(tt([])),v=V(tt([])),p=V(1),h=V(!0),g=V(void 0),m=V(!1);async function y(){if(!(we(u)&&we(p)>1||we(c)))try{1===we(p)?Z(u,!0):Z(c,!0);const t=we(m)?null:we(s),e=await Xr.getSuggestions(t,we(p)),n=(null==e?void 0:e.games)||[],r=n.filter((t=>!we(f).some((e=>e.id===t.id))));Z(f,tt([...we(f),...r])),n.length<10?!we(m)&&we(s)?(Z(m,!0),Z(p,1),setTimeout((()=>y()),100)):Z(h,!1):Z(p,we(p)+1)}catch(t){console.error(t),jr.error("Failed to load games: "+t)}finally{Z(u,!1),Z(c,!1),we(h)&&we(g)&&setTimeout((()=>{const t=we(g).getBoundingClientRect();!(t.top>=-200&&t.left>=0&&t.bottom<=window.innerHeight+200&&t.right<=window.innerWidth)||we(u)||we(c)||y()}),150)}}or((()=>(Z(a,!Boolean(localStorage.getItem("playlight_exit_intent_disabled_by_user"))),i=new IntersectionObserver((t=>{t[0].isIntersecting&&we(h)&&!we(u)&&!we(c)&&y()}),{rootMargin:"200px"}),()=>null==i?void 0:i.disconnect()))),or((async()=>{Z(d,tt(await Xr.getCurrentGameInfo())),await async function(){var t,e,n,r,o,i,l;Z(v,tt(await Xr.getCategories())),!we(s)&&(null==(t=we(v))?void 0:t.length)>0&&Z(s,tt((null==(e=we(d))?void 0:e.category)&&(null==(r=we(v))?void 0:r.includes(null==(n=we(d))?void 0:n.category))?null==(o=we(d))?void 0:o.category:null==(l=we(v))?void 0:l[(null==(i=we(v))?void 0:i.length)-1]))}()})),wt((()=>{we(s)&&(Z(f,tt([])),Z(p,1),Z(h,!0),Z(m,!1),Z(u,!0),setTimeout((async()=>{await y(),we(f).length<10&&await y()}),100))})),wt((()=>{we(g)&&i&&i.observe(we(g))}));var b=So();qe("keydown",rt,(t=>{"Escape"==t.key&&Jn(Fr,!1)})),b.__click=[yo,o];var w=ct(b),x=ct(w),_=ct(ft(x,2)),$=t=>{var e=wo();e.__click=[bo,a];var n=ct(e),r=ct(n);Ct((()=>Je(r,we(a)?"Don't show on exit":"Do show on exit"))),Ue(t,e)};tn(_,(t=>{l()&&t($)}));var k=ft(_,2);k.__click=[xo,o],function(t,e){const n=tr(e,["children","$$slots","$$events","$$legacy"]);ar(t,nr({name:"x"},(()=>n),{iconNode:[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]],children:(t,n)=>{var r=Ke();cn(dt(r),e,"default",{},null),Ue(t,r)},$$slots:{default:!0}}))}(ct(k),{size:24,strokeWidth:2.5});var C=ft(w,2);co(ct(C),{get categories(){return we(v)},get selectedCategory(){return we(s)},set selectedCategory(t){Z(s,tt(t))}});var S=ft(C,2);!function(t,e){var n;G(e,!0);let r=V(!1),o=V(!0),i=V(!1),l=V(0),a=V(1),s=V(!1),u=V(!1),c=V(tt((null==(n=e.currentGame)?void 0:n.likes)||0)),d=0;function f(t){Z(s,!0),d=t.type.includes("touch")?t.touches[0].clientY:t.clientY}function v(t){if(!we(s))return;const e=t.type.includes("touch")?t.touches[0].clientY:t.clientY,n=Math.max(0,e-d);Z(l,tt(n)),Z(a,tt(Math.max(0,1-n/150))),n>40&&(Z(s,!1),h(we(l),250,250,((t,e,n)=>{Z(l,t+(e-t)*n),Z(a,tt(Math.max(0,1-1.5*n))),1===n&&(Z(o,!1),Z(i,!0))})))}function p(){we(s)&&(Z(s,!1),we(l)<40&&h(we(l),0,250,((t,e,n)=>{Z(l,t*(1-n)),Z(a,1)})))}function h(t,e,n,r){const o=Date.now();!function i(){const l=Math.min((Date.now()-o)/n,1);r(t,e,l),l<1&&requestAnimationFrame(i)}()}wt((()=>{var t,n;(null==(t=e.currentGame)?void 0:t.id)&&(Z(u,null!==localStorage.getItem(`playlight_${e.currentGame.id}_liked`)),Z(c,tt((null==(n=e.currentGame)?void 0:n.likes)||0)))}));var g=mo(),m=dt(g),y=t=>{var n=ho();n.__mousedown=f,n.__mousemove=v,n.__mouseup=p,n.__touchstart=f,n.__touchmove=v,n.__touchend=p;var o=ft(ct(n),2),i=ct(o);let s;var d=ft(i,2),h=ct(d),g=ct(ft(d,2)),m=ct(g),y=ft(g,2);y.__click=[po,e,u,c];var b=ct(y);const w=vt((()=>we(u)?"currentColor":"none"));!function(t,e){const n=tr(e,["children","$$slots","$$events","$$legacy"]);ar(t,nr({name:"thumbs-up"},(()=>n),{iconNode:[["path",{d:"M7 10v12"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z"}]],children:(t,n)=>{var r=Ke();cn(dt(r),e,"default",{},null),Ue(t,r)},$$slots:{default:!0}}))}(b,{size:18,strokeWidth:2.5,get fill(){return we(w)},style:"margin-top: -5px;"}),Ct((t=>{var r,o;bn(n,`transform: translateY(${we(l)??""}px); opacity: ${we(a)??""}; cursor: grab;`),Cn(i,"src",null==(r=e.currentGame)?void 0:r.logo_url),s=mn(i,1,"bg-muted h-5 w-5 select-none",null,s,t),Je(h,(null==(o=e.currentGame)?void 0:o.name)||"Default name"),Je(m,we(c)),bn(y,`color: ${(we(u)?"white !important":"")??""};`),Cn(y,"aria-label",we(u)?"Unlike game":"Like game")}),[()=>({"animate-pulse":!we(r)})]),qe("mouseleave",n,p),qe("load",i,(()=>{Z(r,!0)})),Ue(t,n)};tn(m,(t=>{e.currentGame&&we(o)&&t(y)}));var b=ft(m,2),w=t=>{var e=go(),n=ct(e);n.__mousedown=[vo,i,o,l,a,h],n.__touchstart=[vo,i,o,l,a,h],Bn(3,n,(()=>vr),(()=>({delay:150,y:30}))),Ue(t,e)};tn(b,(t=>{e.currentGame&&we(i)&&t(w)})),Ue(t,g),F()}(S,{get currentGame(){return we(d)}});var P=ft(S,2);P.__click=[yo,o];var M=ct(P),I=t=>{var e=_o();sr(ct(e),{class:"animate-spin opacity-75",size:50,strokeWidth:2.5}),Ue(t,e)},j=(t,e)=>{var n=t=>{Ue(t,$o())},r=t=>{var e=Co(),n=ct(e);on(n,17,(()=>we(f)),rn,((e,n,r)=>{var o=ko();const i=vt((()=>we(f).findIndex((t=>t.category!==we(s)))));var l=dt(o),a=t=>{Ue(t,fo())};tn(l,(t=>{r==we(i)&&t(a)})),function(e,n){G(n,!0);const[r,o]=Xn();let i,l=V(!1),a=V(!1),s=V(void 0),u=V(!1),c=V(!1),d=V(!1),f=V(!1),v=V(void 0);function p(){we(l)||we(f)||function(e,n=1){try{const t=new Audio(e);t.volume=n,t.play()}catch(t){console.error("Error playing sound:",t)}}(Zn(Rr,"$projectUrl",r)+"/static/sounds/hover-selection.ogg",.25),Z(l,!0),clearTimeout(i),i=setTimeout((()=>Z(a,!0)),300),we(s)&&n.game.cover_video_url&&we(s).play().catch((t=>console.error("Video play error:",t)))}function h(){we(f)||(g(),we(s)&&we(u)&&we(s).pause())}function g(){Z(l,!1),clearTimeout(i),Z(a,!1)}wt((()=>{Z(f,"ontouchstart"in window)}));var m=Jr();qe("touchstart",nt,(()=>Z(f,!0)),void 0,!0),qe("touchstart",rt,(function(t){we(v)&&!we(v).contains(t.target)&&g()}),void 0,!0),m.__touchstart=p,m.__click=[Hr,f,a,n];var y=ct(m),b=t=>{var e=Vr();let n;Ct((t=>n=mn(e,1,"bg-background absolute top-4 right-4 z-13 px-2 py-0.5 transition-opacity select-none",null,n,t)),[()=>({"opacity-0":we(l)})]),Ue(t,e)};tn(y,(t=>{var e;(function(t){const e=new Date;return e.setDate(e.getDate()-7),new Date(t)>e})(null==(e=n.game)?void 0:e.created_at)&&t(b)}));var w=ft(y,2),x=t=>{var e=Kr();let r;e.muted=!0,Wn(e,(t=>Z(s,t)),(()=>we(s))),Ct((t=>{Cn(e,"src",n.game.cover_video_url),r=mn(e,1,"absolute top-0 left-0 z-5 h-full w-full object-cover opacity-0",null,r,t)}),[()=>({"opacity-100":we(l)&&we(u)&&n.game.cover_video_url})]),qe("loadeddata",e,(()=>{Z(u,!0)})),Ue(t,e)};tn(w,(t=>{n.game.cover_video_url&&t(x)}));var _=ft(w,2);let $;var k=ft(_,2),C=t=>{var e=Yr();let r;e.__click=[Ur,n],Ct((t=>r=mn(e,1,"bg-foreground text-background hover:bg-foreground/90 absolute right-4 bottom-4 z-15 flex items-center justify-center rounded-sm px-3 py-1 font-bold uppercase transition-all",null,r,t)),[()=>({"opacity-0":we(l)})]),Ue(t,e)};tn(k,(t=>{we(f)&&t(C)}));var S=ft(k,2),P=t=>{var e=Zr(),r=ct(e),o=ct(r),i=ct(o),l=ct(ft(o,2));Ct((()=>{Je(i,n.game.name),Je(l,n.game.description||"No description.")})),Bn(3,e,(()=>pr)),Ue(t,e)};tn(S,(t=>{we(l)&&t(P)}));var M=ft(S,2);let I;Wn(m,(t=>Z(v,t)),(()=>we(v))),Ct(((t,e)=>{mn(m,1,`bg-background highlight-border group relative mt-5 mb-[calc(3dvh+1.5vw)] flex aspect-[2/3] h-1/2 max-h-[75vh] min-h-92 cursor-pointer flex-col shadow-xl transition hover:outline-2 lg:h-3/7 ${(we(c)?"":"animate-pulse")??""}`,"svelte-rulnq9"),Cn(_,"src",n.game.cover_image_url),$=mn(_,1,"prevent-image-select absolute top-0 left-0 z-10 h-full w-full object-cover opacity-0 transition svelte-rulnq9",null,$,t),Cn(M,"src",n.game.logo_url),I=mn(M,1,"prevent-image-select absolute right-0 -bottom-[18%] left-0 z-12 mx-auto aspect-square w-1/5 rounded-full object-center opacity-0 transition group-hover:outline-2 svelte-rulnq9",null,I,e)}),[()=>({"opacity-100":we(c)&&(!we(l)||!we(u)||!n.game.cover_video_url)}),()=>({"opacity-100":we(d)})]),qe("mouseenter",m,p),qe("focus",m,p),qe("mouseleave",m,h),qe("blur",m,h),qe("load",_,(()=>{Z(c,!0)})),qe("load",M,(()=>{Z(d,!0)})),Ue(e,m),F(),o()}(ft(l,2),{get game(){return we(n)},onClick:()=>Xr.trackClick(we(n).id)}),Ue(e,o)}));var r=ft(n,2),o=ct(r),i=t=>{sr(t,{class:"animate-spin opacity-75",size:30,strokeWidth:2.5})};tn(o,(t=>{we(c)&&t(i)})),Wn(r,(t=>Z(g,t)),(()=>we(g))),Ue(t,e)};tn(t,(t=>{0!==we(f).length||we(u)?t(r,!1):t(n)}),e)};tn(M,(t=>{we(u)&&0===we(f).length?t(I):t(j,!1)}));var E=ft(P,2);!function(t,e){const n=tr(e,["children","$$slots","$$events","$$legacy"]);ar(t,nr({name:"external-link"},(()=>n),{iconNode:[["path",{d:"M15 3h6v6"}],["path",{d:"M10 14 21 3"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}]],children:(t,n)=>{var r=Ke();cn(dt(r),e,"default",{},null),Ue(t,r)},$$slots:{default:!0}}))}(ft(ct(E)),{size:14}),Ct((()=>Cn(x,"src",Zn(Rr,"$projectUrl",n)+"/static/images/logo-white-small.png"))),Bn(3,b,(()=>fr),(()=>({duration:250}))),Ue(t,b),F(),r()}Le(["click"]);var Mo=Re('<div class="fixed top-0 right-0 left-0 h-4"></div>');Le(["mouseover"]);var Io=Re("<!> <!> <!> <!>",1);function jo(t,e){G(e,!0);const[n,r]=Xn(),o=()=>Zn(Fr,"$discoveryOpen",n),i=()=>Zn(e.config,"$config",n);function l(){Jn(Fr,!0),Xr.trackOpen()}let a;Fr.subscribe((t=>{try{t?(a=document.body.style.overflow,document.body.style.overflow="hidden"):document.body.style.overflow=a}catch(e){console.error("Failed to toggle body overflow style:",e)}}));var s=Io(),u=dt(s);const c=vt((()=>{var t,e;return null==(e=null==(t=i())?void 0:t.button)?void 0:e.position})),d=vt((()=>{var t,e;return null==(e=null==(t=i())?void 0:t.button)?void 0:e.visible}));!function(t,e){G(e,!0);let n=rr(e,"position",3,"bottom-right"),r=rr(e,"visible",3,!0);var o=Ke(),i=dt(o),l=t=>{var r=mr();r.__click=[gr,e];var o=ct(r);!function(t,e){const n=tr(e,["children","$$slots","$$events","$$legacy"]);ar(t,nr({name:"gamepad"},(()=>n),{iconNode:[["line",{x1:"6",x2:"10",y1:"12",y2:"12"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14"}],["line",{x1:"15",x2:"15.01",y1:"13",y2:"13"}],["line",{x1:"18",x2:"18.01",y1:"11",y2:"11"}],["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2"}]],children:(t,n)=>{var r=Ke();cn(dt(r),e,"default",{},null),Ue(t,r)},$$slots:{default:!0}}))}(ct(o),{size:26,strokeWidth:1.75,class:"z-2 mr-2 transform transition-all duration-300 group-hover:rotate-12"}),Ct((()=>mn(r,1,`fixed ${("bottom-left"==n()?"bottom-4 left-4":"bottom-right"==n()?"right-4 bottom-4":"")??""} group children-text-white text-background z-99990 flex cursor-pointer gap-2 rounded-md bg-white p-3 font-bold uppercase shadow-lg transition-all hover:scale-105`,"svelte-1j97rta"))),Bn(3,r,(()=>fr)),Ue(t,r)};tn(i,(t=>{r()&&t(l)})),Ue(t,o),F()}(u,{get position(){return we(c)},get visible(){return we(d)},onClick:l});var f=ft(u,2),v=t=>{const e=vt((()=>{var t,e;return null==(e=null==(t=i())?void 0:t.exitIntent)?void 0:e.enabled}));Po(t,{get showIntentToggle(){return we(e)}})};tn(f,(t=>{o()&&t(v)}));var p=ft(f,2);const h=vt((()=>{var t,e;return null==(e=null==(t=i())?void 0:t.exitIntent)?void 0:e.enabled}));!function(t,e){G(e,!0);let n,r,o=rr(e,"enabled",3,!0),i=!1;var l=Mo();qe("mousemove",nt,(function(t){i||setTimeout((()=>i=!0),250),n.contains(t.target)||(r=Date.now())})),l.__mouseover=function(){o()&&!localStorage.getItem("playlight_exit_intent_disabled_by_user")&&i&&setTimeout((()=>{var t;r<Date.now()-50&&(null==(t=e.onIntent)||t.call(e))}),150)},Wn(l,(t=>n=t),(()=>n)),Ue(t,l),F()}(p,{get enabled(){return we(h)},onIntent:()=>{o()||l()}}),Gr(ft(p,2),{}),Ue(t,s),F(),r()}const Eo={button:{position:"bottom-right",visible:!0},exitIntent:{enabled:!0}};let To={...Eo};function No(t={}){return To=Oo(Eo,t),To}function Oo(t,e){const n={...t};return Ao(t)&&Ao(e)&&Object.keys(e).forEach((r=>{Ao(e[r])?r in t?n[r]=Oo(t[r],e[r]):Object.assign(n,{[r]:e[r]}):Object.assign(n,{[r]:e[r]})})),n}function Ao(t){return t&&"object"==typeof t&&!Array.isArray(t)}const Bo=new(a=class{constructor(){u(this,i),this.container=null,this.app=null,this.isInitialized=!1,this.config=Vn(null),this.api=Xr}async init(t={}){return"undefined"==typeof window?console.error("Playlight cannot run on the server, as it depends on browser APIs."):this.isInitialized?(console.warn("Playlight SDK already initialized!"),void(document.getElementById("playlight-sdk-container")||c(this,i,l).call(this))):(this.setConfig(t),c(this,i,l).call(this),await this.api.getCurrentGameInfo(),void(this.isInitialized=!0))}setDiscovery(t=!0){this.isInitialized&&(Fr.set(t),t&&Xr.trackOpen())}setConfig(t={}){var e;null==(e=this.config)||e.set(No(t))}},i=new WeakSet,l=function(){try{this.container=document.createElement("div"),this.container.id="playlight-sdk-container",this.container.className="playlight-sdk-container",document.body.appendChild(this.container),this.app=(t=jo,e={target:this.container,props:{config:this.config}},function(t,{target:e,anchor:n,props:r={},events:o,context:i,intro:l=!0}){!function(){if(void 0===nt){nt=window,rt=document,ot=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype;it=h(e,"firstChild").get,lt=h(e,"nextSibling").get,t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0,Text.prototype.__t=void 0}}();var a=new Set,s=t=>{for(var n=0;n<t.length;n++){var r=t[n];if(!a.has(r)){a.add(r);var o=Te(r);e.addEventListener(r,We,{passive:o});var i=Xe.get(r);void 0===i?(document.addEventListener(r,We,{passive:o}),Xe.set(r,1)):Xe.set(r,i+1)}}};s(v(Be)),ze.add(s);var u=void 0,c=function(t){const e=yt(64,t,!0);return(t={})=>new Promise((n=>{t.outro?Tt(e,(()=>{jt(e),n(void 0)})):(jt(e),n(void 0))}))}((()=>{var c=n??e.appendChild(at());return Pt((()=>{i&&(G({}),L.c=i),o&&(r.$$events=o),Ye=l,u=t(c,r)||{},Ye=!0,i&&F()})),()=>{var t;for(var r of a){e.removeEventListener(r,We);var o=Xe.get(r);0==--o?(document.removeEventListener(r,We),Xe.delete(r)):Xe.set(r,o)}ze.delete(s),c!==n&&(null==(t=c.parentNode)||t.removeChild(c))}}));return Qe.set(u,c),u}(t,e))}catch(t){console.error("Playlight error occured during mount:",t)}var t,e},a);return"undefined"!=typeof window&&(window.playlightSDK=Bo),Bo}();
|
|
23
23
|
//# sourceMappingURL=playlight-sdk.iife.js.map
|