import{s as N,f as $,a as D,g as k,h as w,d as _,c as j,G as R,j as g,E as z,i as A,r as b,w as C,x as P,y as Y,I as H,C as J,z as K,o as Q,p as X}from"../chunks/scheduler.2f9f1739.js";import{S as U,i as L,b as S,d as T,m as V,a as y,t as E,e as x,c as Z,j as ee,g as te,f as re}from"../chunks/index.f9f1dac6.js";import{e as B,u as ae,o as ne}from"../chunks/each.7a84d497.js";import{q as se,r as oe}from"../chunks/index.b11ac8a0.js";import{F}from"../chunks/fa.139e50c6.js";import{w as le}from"../chunks/randomstore.850cca5c.js";import{a as ie,s as ce}from"../chunks/index.63ca82d4.js";import{S as de}from"../chunks/seo.f792d6dc.js";function ue(c){let r,n,e,o,s,l,a,d,f,p,v,t,i,m;return d=new F({props:{icon:se}}),v=new F({props:{icon:oe}}),{c(){r=$("div"),n=$("div"),e=$("img"),s=D(),l=$("div"),a=$("button"),S(d.$$.fragment),f=D(),p=$("button"),S(v.$$.fragment),this.h()},l(u){r=k(u,"DIV",{class:!0});var h=w(r);n=k(h,"DIV",{class:!0});var O=w(n);e=k(O,"IMG",{src:!0,alt:!0,class:!0}),O.forEach(_),s=j(h),l=k(h,"DIV",{class:!0});var I=w(l);a=k(I,"BUTTON",{class:!0});var q=w(a);T(d.$$.fragment,q),q.forEach(_),f=j(I),p=k(I,"BUTTON",{class:!0});var M=w(p);T(v.$$.fragment,M),M.forEach(_),I.forEach(_),h.forEach(_),this.h()},h(){R(e.src,o=c[0])||g(e,"src",o),g(e,"alt","Wallpaper"),g(e,"class","object-cover w-full h-full transition-opacity duration-300"),z(e,"opacity-0",!c[1]),g(n,"class","aspect-w-16 aspect-h-9 rounded-lg overflow-hidden"),g(a,"class","border hover:bg-orang dark:hover:bg-stone-800 px-5 py-2 rounded-lg border-orang dark:border-dark transition-colors duration-200"),g(p,"class","border hover:bg-orang dark:hover:bg-stone-800 px-5 py-2 rounded-lg border-orang dark:border-dark transition-colors duration-200"),g(l,"class","flex space-x-2 items-center justify-end text-xl"),g(r,"class","border space-y-3 border-b-4 bg-orange-200 border-orang dark:border-dark p-2 dark:bg-stone-900 transition-all duration-300 rounded-lg max-w-sm overflow-hidden"),z(r,"opacity-50",!c[1])},m(u,h){A(u,r,h),b(r,n),b(n,e),b(r,s),b(r,l),b(l,a),V(d,a,null),b(l,f),b(l,p),V(v,p,null),t=!0,i||(m=[C(e,"load",c[4]),C(a,"click",c[2]),C(p,"click",c[3])],i=!0)},p(u,[h]){(!t||h&1&&!R(e.src,o=u[0]))&&g(e,"src",o),(!t||h&2)&&z(e,"opacity-0",!u[1]),(!t||h&2)&&z(r,"opacity-50",!u[1])},i(u){t||(y(d.$$.fragment,u),y(v.$$.fragment,u),t=!0)},o(u){E(d.$$.fragment,u),E(v.$$.fragment,u),t=!1},d(u){u&&_(r),x(d),x(v),i=!1,P(m)}}}function fe(c,r,n){let{wall:e}=r;const o=Y();function s(){const f=document.createElement("a");f.href=e,f.download=e.substring(e.lastIndexOf("/")+1),f.click()}function l(){navigator.share?navigator.share({title:"Check out this wallpaper!",text:"I found this amazing wallpaper. Take a look!",url:e}).then(()=>{console.log("Thanks for sharing!")}).catch(console.error):o("shareAttempt",{url:e})}let a=!1;const d=()=>n(1,a=!0);return c.$$set=f=>{"wall"in f&&n(0,e=f.wall)},[e,a,s,l,d]}class he extends U{constructor(r){super(),L(this,r,fe,ue,N,{wall:0})}}function G(c,r,n){const e=c.slice();return e[4]=r[n],e}function W(c,r){let n,e,o,s;return e=new he({props:{wall:r[4]}}),e.$on("shareAttempt",me),e.$on("load",r[2]),{key:c,first:null,c(){n=$("div"),S(e.$$.fragment),o=D(),this.h()},l(l){n=k(l,"DIV",{class:!0});var a=w(n);T(e.$$.fragment,a),o=j(a),a.forEach(_),this.h()},h(){g(n,"class","masonry-item svelte-zl06pz"),this.first=n},m(l,a){A(l,n,a),V(e,n,null),b(n,o),s=!0},p(l,a){r=l;const d={};a&2&&(d.wall=r[4]),e.$set(d)},i(l){s||(y(e.$$.fragment,l),s=!0)},o(l){E(e.$$.fragment,l),s=!1},d(l){l&&_(n),x(e)}}}function pe(c){let r,n,e,o,s=[],l=new Map,a,d,f;r=new de({props:{title:"Wallpapers - Abdulmumin Yaqeen",description:"A collection of some cool wallpaper I created and use"}});let p=B(c[1]);const v=t=>t[4];for(let t=0;t<p.length;t+=1){let i=G(c,p,t),m=v(i);l.set(m,s[t]=W(m,i))}return{c(){S(r.$$.fragment),n=D(),e=$("div"),o=$("div");for(let t=0;t<s.length;t+=1)s[t].c();this.h()},l(t){const i=H("svelte-1p6njbb",document.head);T(r.$$.fragment,i),i.forEach(_),n=j(t),e=k(t,"DIV",{class:!0});var m=w(e);o=k(m,"DIV",{class:!0});var u=w(o);for(let h=0;h<s.length;h+=1)s[h].l(u);u.forEach(_),m.forEach(_),this.h()},h(){g(o,"class","masonry-grid svelte-zl06pz"),g(e,"class","mt-3 mb-2 px-2 flex gap-5 flex-col")},m(t,i){V(r,document.head,null),A(t,n,i),A(t,e,i),b(e,o);for(let m=0;m<s.length;m+=1)s[m]&&s[m].m(o,null);c[3](o),f=!0},p(t,[i]){i&6&&(p=B(t[1]),te(),s=ae(s,i,v,1,t,p,l,o,ne,W,null,G),Z())},i(t){if(!f){y(r.$$.fragment,t);for(let i=0;i<p.length;i+=1)y(s[i]);t&&J(()=>{f&&(d&&d.end(1),a=re(e,ce,{}),a.start())}),f=!0}},o(t){E(r.$$.fragment,t);for(let i=0;i<s.length;i+=1)E(s[i]);a&&a.invalidate(),t&&(d=ee(e,ie,{})),f=!1},d(t){t&&(_(n),_(e)),x(r);for(let i=0;i<s.length;i+=1)s[i].d();c[3](null),t&&d&&d.end()}}}function me(c){c.detail.url}function _e(c,r,n){let e;K(c,le,a=>n(1,e=a));let o;function s(){if(o){const a=o.children;for(let d of a)d.style.gridRowEnd=`span ${Math.ceil(d.getBoundingClientRect().height/10)}`}}Q(()=>{const a=new ResizeObserver(s);return o&&a.observe(o),()=>a.disconnect()});function l(a){X[a?"unshift":"push"](()=>{o=a,n(0,o)})}return[o,e,s,l]}class Ie extends U{constructor(r){super(),L(this,r,_e,pe,N,{})}}export{Ie as component};