import{S as t,i as a,s as e,e as s,a as r,t as n,c,b as o,d as l,f as i,g as h,h as u,j as f,k as d,l as v,n as p,o as m,m as g,p as E,q as w,r as $,u as D,v as y,w as P,x as j,y as b,z as I}from"./client.9199399a.js";function z(t){let a,e,m,g,E,w,$,D,y,P,j,b,I,z,x,C,N,T,M,_,k,A,S,H,J,K,B,O,q,F,Z,G,L,Q,R,U,W,X,Y,tt,at,et,st,rt,nt,ct,ot,lt,it;return{c(){a=s("div"),e=s("div"),m=s("div"),g=s("i"),E=r(),w=s("h1"),$=n(V),D=r(),y=s("div"),P=s("p"),j=n(t[0]),b=r(),I=s("div"),z=s("h2"),x=n("KP "),C=n(t[1]),N=r(),T=s("p"),M=s("span"),_=n("↑ KP "),k=n(t[3]),A=r(),S=s("span"),H=n("↓ KP "),J=n(t[2]),K=r(),B=s("div"),O=s("div"),q=s("p"),F=n("BZ"),Z=r(),G=s("p"),L=n(t[4]),Q=r(),R=s("div"),U=s("p"),W=n("Temp"),X=r(),Y=s("p"),tt=n(t[6]),at=n("°C"),et=r(),st=s("div"),rt=s("p"),nt=n("Clouds"),ct=r(),ot=s("p"),lt=n(t[5]),it=n("%"),this.h()},l(s){a=c(s,"DIV",{class:!0});var r=o(a);e=c(r,"DIV",{class:!0});var n=o(e);m=c(n,"DIV",{class:!0});var u=o(m);g=c(u,"I",{class:!0}),o(g).forEach(l),E=i(u),w=c(u,"H1",{class:!0});var f=o(w);$=h(f,V),f.forEach(l),u.forEach(l),D=i(n),y=c(n,"DIV",{class:!0});var d=o(y);P=c(d,"P",{});var v=o(P);j=h(v,t[0]),v.forEach(l),d.forEach(l),b=i(n),I=c(n,"DIV",{class:!0});var p=o(I);z=c(p,"H2",{class:!0});var ht=o(z);x=h(ht,"KP "),C=h(ht,t[1]),ht.forEach(l),N=i(p),T=c(p,"P",{});var ut=o(T);M=c(ut,"SPAN",{className:!0});var ft=o(M);_=h(ft,"↑ KP "),k=h(ft,t[3]),ft.forEach(l),A=i(ut),S=c(ut,"SPAN",{className:!0});var dt=o(S);H=h(dt,"↓ KP "),J=h(dt,t[2]),dt.forEach(l),ut.forEach(l),p.forEach(l),K=i(n),B=c(n,"DIV",{class:!0});var vt=o(B);O=c(vt,"DIV",{});var pt=o(O);q=c(pt,"P",{class:!0});var mt=o(q);F=h(mt,"BZ"),mt.forEach(l),Z=i(pt),G=c(pt,"P",{class:!0});var gt=o(G);L=h(gt,t[4]),gt.forEach(l),pt.forEach(l),Q=i(vt),R=c(vt,"DIV",{});var Et=o(R);U=c(Et,"P",{class:!0});var wt=o(U);W=h(wt,"Temp"),wt.forEach(l),X=i(Et),Y=c(Et,"P",{class:!0});var $t=o(Y);tt=h($t,t[6]),at=h($t,"°C"),$t.forEach(l),Et.forEach(l),et=i(vt),st=c(vt,"DIV",{});var Dt=o(st);rt=c(Dt,"P",{class:!0});var yt=o(rt);nt=h(yt,"Clouds"),yt.forEach(l),ct=i(Dt),ot=c(Dt,"P",{class:!0});var Pt=o(ot);lt=h(Pt,t[5]),it=h(Pt,"%"),Pt.forEach(l),Dt.forEach(l),vt.forEach(l),n.forEach(l),r.forEach(l),this.h()},h(){u(g,"class","symbol fas fa-map-marker-alt svelte-mz1ju5"),u(w,"class","svelte-mz1ju5"),u(m,"class","weatherCurrent-data-location svelte-mz1ju5"),u(y,"class","weatherCurrent-data-date"),u(z,"class","svelte-mz1ju5"),u(M,"classname","pr-2"),u(S,"classname","pl-2"),u(I,"class","weatherCurrent-data-kp svelte-mz1ju5"),u(q,"class","svelte-mz1ju5"),u(G,"class","svelte-mz1ju5"),u(U,"class","svelte-mz1ju5"),u(Y,"class","svelte-mz1ju5"),u(rt,"class","svelte-mz1ju5"),u(ot,"class","svelte-mz1ju5"),u(B,"class","current-details svelte-mz1ju5"),u(e,"class","weatherCurrent-data svelte-mz1ju5"),u(a,"class","weatherCurrent-wrapper svelte-mz1ju5")},m(t,s){f(t,a,s),d(a,e),d(e,m),d(m,g),d(m,E),d(m,w),d(w,$),d(e,D),d(e,y),d(y,P),d(P,j),d(e,b),d(e,I),d(I,z),d(z,x),d(z,C),d(I,N),d(I,T),d(T,M),d(M,_),d(M,k),d(T,A),d(T,S),d(S,H),d(S,J),d(e,K),d(e,B),d(B,O),d(O,q),d(q,F),d(O,Z),d(O,G),d(G,L),d(B,Q),d(B,R),d(R,U),d(U,W),d(R,X),d(R,Y),d(Y,tt),d(Y,at),d(B,et),d(B,st),d(st,rt),d(rt,nt),d(st,ct),d(st,ot),d(ot,lt),d(ot,it)},p(t,[a]){1&a&&v(j,t[0]),2&a&&v(C,t[1]),8&a&&v(k,t[3]),4&a&&v(J,t[2]),16&a&&v(L,t[4]),64&a&&v(tt,t[6]),32&a&&v(lt,t[5])},i:p,o:p,d(t){t&&l(a)}}}let V="The earth";function x(t,a,e){var s=this&&this.__awaiter||function(t,a,e,s){return new(e||(e=Promise))((function(r,n){function c(t){try{l(s.next(t))}catch(t){n(t)}}function o(t){try{l(s.throw(t))}catch(t){n(t)}}function l(t){var a;t.done?r(t.value):(a=t.value,a instanceof e?a:new e((function(t){t(a)}))).then(c,o)}l((s=s.apply(t,a||[])).next())}))};const r=["January","February","March","April","May","June","July","August","September","October","November","December"];let n,c,o="-",l="-",i="-",h="-",u="-",f="-",d="-";function v(t){n=t.coords.longitude,c=t.coords.latitude,function(t,a){s(this,void 0,void 0,(function*(){let s=yield fetch(`https://api.met.no/weatherapi/locationforecast/2.0/compact?lat=${a}&lon=${t}`).then((t=>t.json()));e(5,f=s.properties.timeseries[0].data.instant.details.cloud_area_fraction),e(6,d=s.properties.timeseries[0].data.instant.details.air_temperature)}))}(n,c)}function p(t){g()}function g(){n=28.283333,c=-15.416667}return m((function(){!function(){s(this,void 0,void 0,(function*(){e(4,u=(yield fetch("https://services.swpc.noaa.gov/products/summary/solar-wind-mag-field.json").then((t=>t.json()))).Bz);let t=yield fetch("https://services.swpc.noaa.gov/products/noaa-planetary-k-index-forecast.json").then((t=>t.json()));t.shift();let a=new Date,s=new Date(0,0,0),n=1e3,c=0;t.forEach(((t,r)=>{t[1]>c&&(c=t[1]),t[1]{"prediction"in t&&e(6,s=t.prediction)},[r,c,o,l,i,h,s]}class M extends t{constructor(t){super(),a(this,t,T,N,e,{prediction:6})}}function _(t,a,e){const s=t.slice();return s[13]=a[e],s[15]=e,s}function k(t){let a,e,v,m,g;return{c(){a=s("div"),e=s("i"),v=r(),m=s("p"),g=n("No prediction data"),this.h()},l(t){a=c(t,"DIV",{class:!0});var s=o(a);e=c(s,"I",{class:!0}),o(e).forEach(l),v=i(s),m=c(s,"P",{});var r=o(m);g=h(r,"No prediction data"),r.forEach(l),s.forEach(l),this.h()},h(){u(e,"class","fas fa-7x fa-exclamation-triangle"),u(a,"class","no-data svelte-l8czgl")},m(t,s){f(t,a,s),d(a,e),d(a,v),d(a,m),d(m,g)},p:p,i:p,o:p,d(t){t&&l(a)}}}function A(t){let a,e,v,p,m,D,y=t[0],P=[];for(let a=0;aE(P[t],1,1,(()=>{P[t]=null}));return{c(){a=s("div"),e=s("h2"),v=n("Predicted"),p=r(),m=s("div");for(let t=0;t{h[n]=null})),w(),r=h[e],r||(r=h[e]=i[e](t),r.c()),$(r,1),r.m(a,null))},i(t){n||($(r),n=!0)},o(t){E(r),n=!1},d(t){t&&l(a),h[e].d()}}}function J(t,a,e){var s=this&&this.__awaiter||function(t,a,e,s){return new(e||(e=Promise))((function(r,n){function c(t){try{l(s.next(t))}catch(t){n(t)}}function o(t){try{l(s.throw(t))}catch(t){n(t)}}function l(t){var a;t.done?r(t.value):(a=t.value,a instanceof e?a:new e((function(t){t(a)}))).then(c,o)}l((s=s.apply(t,a||[])).next())}))};let r,n,c,o=!1;function l(t,a){return s(this,void 0,void 0,(function*(){let s;o&&(s=yield fetch(`https://api.met.no/weatherapi/locationforecast/2.0/compact?lat=${a}&lon=${t}`).then((t=>t.json())));let r=yield fetch("https://services.swpc.noaa.gov/products/noaa-planetary-k-index-forecast.json").then((t=>t.json()));r.shift();let n=[];r.forEach(((t,a)=>{if("observed"!=t[2]){let a,e,r=new Date(t[0]),c=new Date(0,0,0);o&&s.properties.timeseries.forEach(((t,s)=>{let n=new Date(t.time);Math.abs(n.getTime()-r.getTime())