import{S as ge,b as ke,s as ye,d as m,A as T,B as D,G as q,I as R,e as I,l as M,J as ee,p as B,q as Z,x as Ce,f as k,P as X,g as b,h as $,m as Y,j as S,o as C,n as O,y as F,C as A,D as G,E as L,Q as ce,c as le,k as z,t as Q,r as we,M as fe,N as ue,w as Ie}from"../chunks/wWjeKwgK.js";import"../chunks/IHki7fMi.js";import{B as Ee}from"../chunks/UHdwwnMh.js";import{f as te,p as De,e as de,u as Se,o as Te,a as Ve,d as Ne,b as je}from"../chunks/DJovQM42.js";import{S as Me,u as Be,c as me,F as xe}from"../chunks/DYBED3Qj.js";import{I as Oe}from"../chunks/Ce2SiLcv.js";import"../chunks/CjqRYzcs.js";const Pe=!0,Ze=Object.freeze(Object.defineProperty({__proto__:null,prerender:Pe},Symbol.toStringTag,{value:"Module"}));function _e(u,e,l){const t=u.slice();return t[17]=e[l],t[19]=l,t}function Fe(u){let e,l="loading...";return{c(){e=C("div"),e.textContent=l,this.h()},l(t){e=$(t,"DIV",{class:!0,"data-svelte-h":!0}),Y(e)!=="svelte-eylhc7"&&(e.textContent=l),this.h()},h(){b(e,"class","m-auto text-center")},m(t,o){I(t,e,o)},p:O,i:O,o:O,d(t){t&&m(e)}}}function Ae(u){let e,l="Favorites",t,o,n,d=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" class="w-5 h-5 mr-2"><path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15"></path></svg>
      Add new favorite`,i,a,r,s,_,y,N,w,g,v=u[0].length>0&&ve(u);const x=[Ue,Le],E=[];function h(c,p){return c[0].length===0?0:1}r=h(u),s=E[r]=x[r](u);let f=u[0].length>0&&he(u);return{c(){e=C("h2"),e.textContent=l,t=B(),o=C("div"),n=C("button"),n.innerHTML=d,i=B(),v&&v.c(),a=B(),s.c(),_=B(),f&&f.c(),y=ee(),this.h()},l(c){e=$(c,"H2",{class:!0,"data-svelte-h":!0}),Y(e)!=="svelte-j6uqnm"&&(e.textContent=l),t=M(c),o=$(c,"DIV",{class:!0});var p=S(o);n=$(p,"BUTTON",{class:!0,"data-svelte-h":!0}),Y(n)!=="svelte-n7dd46"&&(n.innerHTML=d),p.forEach(m),i=M(c),v&&v.l(c),a=M(c),s.l(c),_=M(c),f&&f.l(c),y=ee(),this.h()},h(){b(e,"class","my-2 text-2xl text-center underline"),b(n,"class","btn flex items-center"),b(o,"class","flex justify-center mb-4")},m(c,p){I(c,e,p),I(c,t,p),I(c,o,p),k(o,n),I(c,i,p),v&&v.m(c,p),I(c,a,p),E[r].m(c,p),I(c,_,p),f&&f.m(c,p),I(c,y,p),N=!0,w||(g=X(n,"click",u[10]),w=!0)},p(c,p){c[0].length>0?v?v.p(c,p):(v=ve(c),v.c(),v.m(a.parentNode,a)):v&&(v.d(1),v=null);let P=r;r=h(c),r===P?E[r].p(c,p):(q(),T(E[P],1,1,()=>{E[P]=null}),R(),s=E[r],s?s.p(c,p):(s=E[r]=x[r](c),s.c()),D(s,1),s.m(_.parentNode,_)),c[0].length>0?f?(f.p(c,p),p&1&&D(f,1)):(f=he(c),f.c(),D(f,1),f.m(y.parentNode,y)):f&&(q(),T(f,1,1,()=>{f=null}),R())},i(c){N||(D(s),D(f),N=!0)},o(c){T(s),T(f),N=!1},d(c){c&&(m(e),m(t),m(o),m(i),m(a),m(_),m(y)),v&&v.d(c),E[r].d(c),f&&f.d(c),w=!1,g()}}}function ve(u){let e,l=u[0].length+"",t,o;return{c(){e=C("p"),t=Q(l),o=Q(" favorites total"),this.h()},l(n){e=$(n,"P",{class:!0});var d=S(e);t=z(d,l),o=z(d," favorites total"),d.forEach(m),this.h()},h(){b(e,"class","text-center text-colorTextSoft mb-4")},m(n,d){I(n,e,d),k(e,t),k(e,o)},p(n,d){d&1&&l!==(l=n[0].length+"")&&le(t,l)},d(n){n&&m(e)}}}function Le(u){let e,l,t="Sort by Category",o,n,d="Sort Alphabetically",i,a,r,s,_,y,N,w;return s=new Oe({}),{c(){e=C("div"),l=C("button"),l.textContent=t,o=B(),n=C("button"),n.textContent=d,i=B(),a=C("div"),r=C("button"),L(s.$$.fragment),_=Q(" Play random favorite!"),this.h()},l(g){e=$(g,"DIV",{class:!0});var v=S(e);l=$(v,"BUTTON",{class:!0,"data-svelte-h":!0}),Y(l)!=="svelte-1rhvjlq"&&(l.textContent=t),o=M(v),n=$(v,"BUTTON",{class:!0,"data-svelte-h":!0}),Y(n)!=="svelte-epccme"&&(n.textContent=d),v.forEach(m),i=M(g),a=$(g,"DIV",{class:!0});var x=S(a);r=$(x,"BUTTON",{class:!0});var E=S(r);G(s.$$.fragment,E),_=z(E," Play random favorite!"),E.forEach(m),x.forEach(m),this.h()},h(){b(l,"class","btn w-40 !text-sm"),b(n,"class","btn w-40 !text-sm"),b(e,"class","flex justify-center gap-3 mb-6"),b(r,"class","btn-dropdown-menu"),b(a,"class","flex justify-center my-4")},m(g,v){I(g,e,v),k(e,l),k(e,o),k(e,n),I(g,i,v),I(g,a,v),k(a,r),A(s,r,null),k(r,_),y=!0,N||(w=[X(l,"click",u[6]),X(n,"click",u[7]),X(r,"click",u[9])],N=!0)},p:O,i(g){y||(D(s.$$.fragment,g),y=!0)},o(g){T(s.$$.fragment,g),y=!1},d(g){g&&(m(e),m(i),m(a)),F(s),N=!1,we(w)}}}function Ue(u){let e,l="No favorites. Use the search above to add some!";return{c(){e=C("p"),e.textContent=l,this.h()},l(t){e=$(t,"P",{class:!0,"data-svelte-h":!0}),Y(e)!=="svelte-eiuhxi"&&(e.textContent=l),this.h()},h(){b(e,"class","text-center")},m(t,o){I(t,e,o)},p:O,i:O,o:O,d(t){t&&m(e)}}}function he(u){let e,l,t=[],o=new Map,n,d=de(u[0]);const i=a=>a[17].id;for(let a=0;a<d.length;a+=1){let r=_e(u,d,a),s=i(r);o.set(s,t[a]=pe(s,r))}return{c(){e=C("div"),l=C("div");for(let a=0;a<t.length;a+=1)t[a].c();this.h()},l(a){e=$(a,"DIV",{class:!0});var r=S(e);l=$(r,"DIV",{"data-sveltekit-reload":!0,class:!0});var s=S(l);for(let _=0;_<t.length;_+=1)t[_].l(s);s.forEach(m),r.forEach(m),this.h()},h(){b(l,"data-sveltekit-reload",""),b(l,"class","favoritesContainer"),b(e,"class","m-auto columns-sm")},m(a,r){I(a,e,r),k(e,l);for(let s=0;s<t.length;s+=1)t[s]&&t[s].m(l,null);n=!0},p(a,r){r&289&&(d=de(a[0]),q(),t=Se(t,r,i,1,a,d,o,l,Te,pe,null,_e),R())},i(a){if(!n){for(let r=0;r<d.length;r+=1)D(t[r]);n=!0}},o(a){for(let r=0;r<t.length;r+=1)T(t[r]);n=!1},d(a){a&&m(e);for(let r=0;r<t.length;r+=1)t[r].d()}}}function pe(u,e){let l,t,o,n,d,i,a,r,s,_=e[17].name+"",y,N,w,g=e[17].url+"",v,x,E,h,f,c,p,P,re;var U=me[e[17].category];function oe(j,V){return{}}U&&(o=fe(U,oe()));function $e(){return e[13](e[17])}return f=new xe({props:{dle:e[17]}}),{key:u,first:null,c(){l=C("div"),t=C("div"),o&&L(o.$$.fragment),n=B(),d=C("div"),i=C("div"),a=C("div"),r=C("div"),s=C("div"),y=Q(_),N=B(),w=C("a"),v=Q(g),E=B(),h=C("div"),L(f.$$.fragment),c=B(),this.h()},l(j){l=$(j,"DIV",{class:!0});var V=S(l);t=$(V,"DIV",{class:!0,style:!0});var H=S(t);o&&G(o.$$.fragment,H),H.forEach(m),n=M(V),d=$(V,"DIV",{class:!0});var J=S(d);i=$(J,"DIV",{class:!0});var K=S(i);a=$(K,"DIV",{});var se=S(a);r=$(se,"DIV",{});var W=S(r);s=$(W,"DIV",{class:!0});var ae=S(s);y=z(ae,_),ae.forEach(m),N=M(W),w=$(W,"A",{class:!0,target:!0,href:!0});var ne=S(w);v=z(ne,g),ne.forEach(m),W.forEach(m),se.forEach(m),E=M(K),h=$(K,"DIV",{class:!0});var ie=S(h);G(f.$$.fragment,ie),ie.forEach(m),K.forEach(m),J.forEach(m),c=M(V),V.forEach(m),this.h()},h(){b(t,"class","p-2 flex justify-center items-center"),ue(t,"background-color",e[5][e[17].category]),b(s,"class","text-lg font-semibold leading-5"),b(w,"class","text-base"),b(w,"target","_blank"),b(w,"href",x=e[17].url),b(h,"class","p-2 flex justify-center items-center"),b(i,"class","flex justify-between"),b(d,"class","p-3 w-full"),b(l,"class","card flex break-inside-avoid svelte-z53f9q"),this.first=l},m(j,V){I(j,l,V),k(l,t),o&&A(o,t,null),k(l,n),k(l,d),k(d,i),k(i,a),k(a,r),k(r,s),k(s,y),k(r,N),k(r,w),k(w,v),k(i,E),k(i,h),A(f,h,null),k(l,c),p=!0,P||(re=X(w,"click",$e),P=!0)},p(j,V){if(e=j,V&1&&U!==(U=me[e[17].category])){if(o){q();const J=o;T(J.$$.fragment,1,0,()=>{F(J,1)}),R()}U?(o=fe(U,oe()),L(o.$$.fragment),D(o.$$.fragment,1),A(o,t,null)):o=null}(!p||V&33)&&ue(t,"background-color",e[5][e[17].category]),(!p||V&1)&&_!==(_=e[17].name+"")&&le(y,_),(!p||V&1)&&g!==(g=e[17].url+"")&&le(v,g),(!p||V&1&&x!==(x=e[17].url))&&b(w,"href",x);const H={};V&1&&(H.dle=e[17]),f.$set(H)},i(j){p||(o&&D(o.$$.fragment,j),D(f.$$.fragment,j),p=!0)},o(j){o&&T(o.$$.fragment,j),T(f.$$.fragment,j),p=!1},d(j){j&&m(l),o&&F(o),F(f),P=!1,re()}}}function be(u){let e,l;return e=new Me({props:{onClose:u[11],pageX:u[3],pageY:u[4]}}),{c(){L(e.$$.fragment)},l(t){G(e.$$.fragment,t)},m(t,o){A(e,t,o),l=!0},p(t,o){const n={};o&8&&(n.pageX=t[3]),o&16&&(n.pageY=t[4]),e.$set(n)},i(t){l||(D(e.$$.fragment,t),l=!0)},o(t){T(e.$$.fragment,t),l=!1},d(t){F(e,t)}}}function qe(u){let e,l,t,o,n;const d=[Ae,Fe],i=[];function a(s,_){return s[1]?1:0}e=a(u),l=i[e]=d[e](u);let r=u[2]&&be(u);return{c(){l.c(),t=B(),r&&r.c(),o=ee()},l(s){l.l(s),t=M(s),r&&r.l(s),o=ee()},m(s,_){i[e].m(s,_),I(s,t,_),r&&r.m(s,_),I(s,o,_),n=!0},p(s,[_]){let y=e;e=a(s),e===y?i[e].p(s,_):(q(),T(i[y],1,1,()=>{i[y]=null}),R(),l=i[e],l?l.p(s,_):(l=i[e]=d[e](s),l.c()),D(l,1),l.m(t.parentNode,t)),s[2]?r?(r.p(s,_),_&4&&D(r,1)):(r=be(s),r.c(),D(r,1),r.m(o.parentNode,o)):r&&(q(),T(r,1,1,()=>{r=null}),R())},i(s){n||(D(l),D(r),n=!0)},o(s){T(l),T(r),n=!1},d(s){s&&(m(t),m(o)),i[e].d(s),r&&r.d(s)}}}function Re(u,e,l){let t,o,n,d;Z(u,Ve,h=>l(0,t=h)),Z(u,te,h=>l(15,o=h)),Z(u,Ne,h=>l(12,n=h)),Z(u,je,h=>l(5,d=h));let i=!0,a=!1;Ce(()=>{l(1,i=!1)});function r(){const h=t.sort((f,c)=>f.category.toLowerCase().localeCompare(c.category.toLowerCase()));ce(te,o=h.map(f=>f.id),o),localStorage.favorites=JSON.stringify(o)}function s(){const h=t.sort((f,c)=>f.name.toLowerCase().localeCompare(c.name.toLowerCase()));ce(te,o=h.map(f=>f.id),o),localStorage.favorites=JSON.stringify(o)}const{trackGameClick:_}=Be();function y(h){_(h,"url-link","favorites","favorites-dedicated")}function N(){const h={click_type:"random-button-favorites",section:"favorites-dedicated",available_options:t.length};De(t,h)}function w(h){const f=h.target.closest("button").getBoundingClientRect();l(3,g=f.left+f.width/2),l(4,v=f.bottom-10),l(2,a=!0)}let g=400,v=200;function x(){l(2,a=!1)}const E=h=>y(h);return u.$$.update=()=>{u.$$.dirty&4097&&n.filter(h=>!t.find(f=>f.name===h.name))},[t,i,a,g,v,d,r,s,y,N,w,x,n,E]}class Ye extends ge{constructor(e){super(),ke(this,e,Re,qe,ye,{})}}function Ge(u){let e,l,t,o,n,d;return t=new Ee({}),n=new Ye({}),{c(){e=C("meta"),l=B(),L(t.$$.fragment),o=B(),L(n.$$.fragment),this.h()},l(i){const a=Ie("svelte-yygeb9",document.head);e=$(a,"META",{name:!0,content:!0}),a.forEach(m),l=M(i),G(t.$$.fragment,i),o=M(i),G(n.$$.fragment,i),this.h()},h(){document.title="Your favorite dles!",b(e,"name","robots"),b(e,"content","noindex, nofollow")},m(i,a){k(document.head,e),I(i,l,a),A(t,i,a),I(i,o,a),A(n,i,a),d=!0},p:O,i(i){d||(D(t.$$.fragment,i),D(n.$$.fragment,i),d=!0)},o(i){T(t.$$.fragment,i),T(n.$$.fragment,i),d=!1},d(i){i&&(m(l),m(o)),m(e),F(t,i),F(n,i)}}}class et extends ge{constructor(e){super(),ke(this,e,null,Ge,ye,{})}}export{et as component,Ze as universal};
