-
Notifications
You must be signed in to change notification settings - Fork 4
/
sky-tonight-native-card.js
288 lines (288 loc) · 169 KB
/
sky-tonight-native-card.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
/*! For license information please see sky-tonight-native-card.js.LICENSE.txt */
(()=>{"use strict";var t={448:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GeoEmbState=e.GeoMoonState=e.EclipticGeoMoon=e.GeoMoon=e.Ecliptic=e.ObserverGravity=e.VectorObserver=e.ObserverState=e.ObserverVector=e.Equator=e.SunPosition=e.Observer=e.Horizon=e.EclipticCoordinates=e.HorizontalCoordinates=e.MakeRotation=e.RotationMatrix=e.EquatorialCoordinates=e.Spherical=e.StateVector=e.Vector=e.SiderealTime=e.Libration=e.LibrationInfo=e.CalcMoonCount=e.e_tilt=e.MakeTime=e.AstroTime=e.SetDeltaTFunction=e.DeltaT_JplHorizons=e.DeltaT_EspenakMeeus=e.PlanetOrbitalPeriod=e.DefineStar=e.Body=e.AngleBetween=e.MassProduct=e.CALLISTO_RADIUS_KM=e.GANYMEDE_RADIUS_KM=e.EUROPA_RADIUS_KM=e.IO_RADIUS_KM=e.JUPITER_MEAN_RADIUS_KM=e.JUPITER_POLAR_RADIUS_KM=e.JUPITER_EQUATORIAL_RADIUS_KM=e.RAD2HOUR=e.RAD2DEG=e.HOUR2RAD=e.DEG2RAD=e.AU_PER_LY=e.KM_PER_AU=e.C_AUDAY=void 0,e.VectorFromHorizon=e.HorizonFromVector=e.SphereFromVector=e.EquatorFromVector=e.VectorFromSphere=e.Pivot=e.IdentityMatrix=e.CombineRotation=e.InverseRotation=e.NextPlanetApsis=e.SearchPlanetApsis=e.NextLunarApsis=e.SearchLunarApsis=e.Apsis=e.ApsisKind=e.SearchPeakMagnitude=e.SearchMaxElongation=e.Elongation=e.ElongationEvent=e.Seasons=e.SeasonInfo=e.HourAngle=e.SearchHourAngle=e.HourAngleEvent=e.SearchAltitude=e.SearchRiseSet=e.Atmosphere=e.AtmosphereInfo=e.NextMoonQuarter=e.SearchMoonQuarter=e.MoonQuarter=e.SearchMoonPhase=e.MoonPhase=e.SearchRelativeLongitude=e.Illumination=e.IlluminationInfo=e.EclipticLongitude=e.AngleFromSun=e.PairLongitude=e.SearchSunLongitude=e.Search=e.HelioState=e.BaryState=e.GeoVector=e.BackdatePosition=e.CorrectLightTravel=e.HelioDistance=e.HelioVector=e.JupiterMoons=e.JupiterMoonsInfo=void 0,e.GravitySimulator=e.LagrangePointFast=e.LagrangePoint=e.RotationAxis=e.AxisInfo=e.NextMoonNode=e.SearchMoonNode=e.NodeEventInfo=e.NodeEventKind=e.NextTransit=e.SearchTransit=e.TransitInfo=e.NextLocalSolarEclipse=e.SearchLocalSolarEclipse=e.LocalSolarEclipseInfo=e.EclipseEvent=e.NextGlobalSolarEclipse=e.SearchGlobalSolarEclipse=e.NextLunarEclipse=e.GlobalSolarEclipseInfo=e.SearchLunarEclipse=e.LunarEclipseInfo=e.EclipseKind=e.Constellation=e.ConstellationInfo=e.Rotation_EQD_ECT=e.Rotation_ECT_EQD=e.Rotation_GAL_EQJ=e.Rotation_EQJ_GAL=e.Rotation_HOR_ECL=e.Rotation_ECL_HOR=e.Rotation_ECL_EQD=e.Rotation_EQD_ECL=e.Rotation_EQJ_HOR=e.Rotation_HOR_EQJ=e.Rotation_HOR_EQD=e.Rotation_EQD_HOR=e.Rotation_EQD_EQJ=e.Rotation_ECT_EQJ=e.Rotation_EQJ_ECT=e.Rotation_EQJ_EQD=e.Rotation_ECL_EQJ=e.Rotation_EQJ_ECL=e.RotateState=e.RotateVector=e.InverseRefraction=e.Refraction=void 0,e.C_AUDAY=173.1446326846693,e.KM_PER_AU=149597870.69098932,e.AU_PER_LY=63241.07708807546,e.DEG2RAD=.017453292519943295,e.HOUR2RAD=.26179938779914946,e.RAD2DEG=57.29577951308232,e.RAD2HOUR=3.819718634205488,e.JUPITER_EQUATORIAL_RADIUS_KM=71492,e.JUPITER_POLAR_RADIUS_KM=66854,e.JUPITER_MEAN_RADIUS_KM=69911,e.IO_RADIUS_KM=1821.6,e.EUROPA_RADIUS_KM=1560.8,e.GANYMEDE_RADIUS_KM=2631.2,e.CALLISTO_RADIUS_KM=2410.3;const n=365.24217,r=new Date("2000-01-01T12:00:00Z"),i=2*Math.PI,o=180/Math.PI*3600,a=484813681109536e-20,s=1296e3,c=7292115e-11,u=648e3/Math.PI,l=-.17-5*Math.log10(u),h=29.530588,d=86400,f=1e3*d,m=.9972695717592592,p=695700,g=p/e.KM_PER_AU,v=.996647180302104,y=v*v,b=6378.1366,_=b/e.KM_PER_AU,M=b*v,w=6459,A=1738.1/e.KM_PER_AU,E=1737.4,D=1736,S=D/e.KM_PER_AU,x=81.30056,R=.0002959122082855911,$=4912547451450812e-26,k=7.243452486162703e-10,C=8.887692390113509e-10,z=9549535105779258e-26,P=2.825345909524226e-7,O=8.459715185680659e-8,I=1.292024916781969e-8,N=1.524358900784276e-8,T=C/x;function U(t){switch(t){case F.Sun:return R;case F.Mercury:return $;case F.Venus:return k;case F.Earth:return C;case F.Moon:return T;case F.EMB:return C+T;case F.Mars:return z;case F.Jupiter:return P;case F.Saturn:return O;case F.Uranus:return I;case F.Neptune:return N;case F.Pluto:return 218869976542597e-26;default:throw`Do not know mass product for body: ${t}`}}function G(t){if(!0!==t&&!1!==t)throw console.trace(),`Value is not boolean: ${t}`;return t}function L(t){if(!Number.isFinite(t))throw console.trace(),`Value is not a finite number: ${t}`;return t}function j(t){return t-Math.floor(t)}function H(t,n){const r=t.x*t.x+t.y*t.y+t.z*t.z;if(Math.abs(r)<1e-8)throw"AngleBetween: first vector is too short.";const i=n.x*n.x+n.y*n.y+n.z*n.z;if(Math.abs(i)<1e-8)throw"AngleBetween: second vector is too short.";const o=(t.x*n.x+t.y*n.y+t.z*n.z)/Math.sqrt(r*i);return o<=-1?180:o>=1?0:e.RAD2DEG*Math.acos(o)}var F;e.MassProduct=U,e.AngleBetween=H,function(t){t.Sun="Sun",t.Moon="Moon",t.Mercury="Mercury",t.Venus="Venus",t.Earth="Earth",t.Mars="Mars",t.Jupiter="Jupiter",t.Saturn="Saturn",t.Uranus="Uranus",t.Neptune="Neptune",t.Pluto="Pluto",t.SSB="SSB",t.EMB="EMB",t.Star1="Star1",t.Star2="Star2",t.Star3="Star3",t.Star4="Star4",t.Star5="Star5",t.Star6="Star6",t.Star7="Star7",t.Star8="Star8"}(F=e.Body||(e.Body={}));const V=[F.Star1,F.Star2,F.Star3,F.Star4,F.Star5,F.Star6,F.Star7,F.Star8],B=[{ra:0,dec:0,dist:0},{ra:0,dec:0,dist:0},{ra:0,dec:0,dist:0},{ra:0,dec:0,dist:0},{ra:0,dec:0,dist:0},{ra:0,dec:0,dist:0},{ra:0,dec:0,dist:0},{ra:0,dec:0,dist:0}];function J(t){const e=V.indexOf(t);return e>=0?B[e]:null}function q(t){const e=J(t);return e&&e.dist>0?e:null}var K;e.DefineStar=function(t,n,r,i){const o=J(t);if(!o)throw`Invalid star body: ${t}`;if(L(n),L(r),L(i),n<0||n>=24)throw`Invalid right ascension for star: ${n}`;if(r<-90||r>90)throw`Invalid declination for star: ${r}`;if(i<1)throw`Invalid star distance: ${i}`;o.ra=n,o.dec=r,o.dist=i*e.AU_PER_LY},function(t){t[t.From2000=0]="From2000",t[t.Into2000=1]="Into2000"}(K||(K={}));const Q={Mercury:{OrbitalPeriod:87.969},Venus:{OrbitalPeriod:224.701},Earth:{OrbitalPeriod:365.256},Mars:{OrbitalPeriod:686.98},Jupiter:{OrbitalPeriod:4332.589},Saturn:{OrbitalPeriod:10759.22},Uranus:{OrbitalPeriod:30685.4},Neptune:{OrbitalPeriod:60189},Pluto:{OrbitalPeriod:90560}};e.PlanetOrbitalPeriod=function(t){if(t in Q)return Q[t].OrbitalPeriod;throw`Unknown orbital period for: ${t}`};const W={Mercury:[[[[4.40250710144,0,0],[.40989414977,1.48302034195,26087.9031415742],[.050462942,4.47785489551,52175.8062831484],[.00855346844,1.16520322459,78263.70942472259],[.00165590362,4.11969163423,104351.61256629678],[.00034561897,.77930768443,130439.51570787099],[7583476e-11,3.71348404924,156527.41884944518]],[[26087.90313685529,0,0],[.01131199811,6.21874197797,26087.9031415742],[.00292242298,3.04449355541,52175.8062831484],[.00075775081,6.08568821653,78263.70942472259],[.00019676525,2.80965111777,104351.61256629678]]],[[[.11737528961,1.98357498767,26087.9031415742],[.02388076996,5.03738959686,52175.8062831484],[.01222839532,3.14159265359,0],[.0054325181,1.79644363964,78263.70942472259],[.0012977877,4.83232503958,104351.61256629678],[.00031866927,1.58088495658,130439.51570787099],[7963301e-11,4.60972126127,156527.41884944518]],[[.00274646065,3.95008450011,26087.9031415742],[.00099737713,3.14159265359,0]]],[[[.39528271651,0,0],[.07834131818,6.19233722598,26087.9031415742],[.00795525558,2.95989690104,52175.8062831484],[.00121281764,6.01064153797,78263.70942472259],[.00021921969,2.77820093972,104351.61256629678],[4354065e-11,5.82894543774,130439.51570787099]],[[.0021734774,4.65617158665,26087.9031415742],[.00044141826,1.42385544001,52175.8062831484]]]],Venus:[[[[3.17614666774,0,0],[.01353968419,5.59313319619,10213.285546211],[.00089891645,5.30650047764,20426.571092422],[5477194e-11,4.41630661466,7860.4193924392],[3455741e-11,2.6996444782,11790.6290886588],[2372061e-11,2.99377542079,3930.2096962196],[1317168e-11,5.18668228402,26.2983197998],[1664146e-11,4.25018630147,1577.3435424478],[1438387e-11,4.15745084182,9683.5945811164],[1200521e-11,6.15357116043,30639.856638633]],[[10213.28554621638,0,0],[.00095617813,2.4640651111,10213.285546211],[7787201e-11,.6247848222,20426.571092422]]],[[[.05923638472,.26702775812,10213.285546211],[.00040107978,1.14737178112,20426.571092422],[.00032814918,3.14159265359,0]],[[.00287821243,1.88964962838,10213.285546211]]],[[[.72334820891,0,0],[.00489824182,4.02151831717,10213.285546211],[1658058e-11,4.90206728031,20426.571092422],[1378043e-11,1.12846591367,11790.6290886588],[1632096e-11,2.84548795207,7860.4193924392],[498395e-11,2.58682193892,9683.5945811164],[221985e-11,2.01346696541,19367.1891622328],[237454e-11,2.55136053886,15720.8387848784]],[[.00034551041,.89198706276,10213.285546211]]]],Earth:[[[[1.75347045673,0,0],[.03341656453,4.66925680415,6283.0758499914],[.00034894275,4.62610242189,12566.1516999828],[3417572e-11,2.82886579754,3.523118349],[3497056e-11,2.74411783405,5753.3848848968],[3135899e-11,3.62767041756,77713.7714681205],[2676218e-11,4.41808345438,7860.4193924392],[2342691e-11,6.13516214446,3930.2096962196],[1273165e-11,2.03709657878,529.6909650946],[1324294e-11,.74246341673,11506.7697697936],[901854e-11,2.04505446477,26.2983197998],[1199167e-11,1.10962946234,1577.3435424478],[857223e-11,3.50849152283,398.1490034082],[779786e-11,1.17882681962,5223.6939198022],[99025e-10,5.23268072088,5884.9268465832],[753141e-11,2.53339052847,5507.5532386674],[505267e-11,4.58292599973,18849.2275499742],[492392e-11,4.20505711826,775.522611324],[356672e-11,2.91954114478,.0673103028],[284125e-11,1.89869240932,796.2980068164],[242879e-11,.34481445893,5486.777843175],[317087e-11,5.84901948512,11790.6290886588],[271112e-11,.31486255375,10977.078804699],[206217e-11,4.80646631478,2544.3144198834],[205478e-11,1.86953770281,5573.1428014331],[202318e-11,2.45767790232,6069.7767545534],[126225e-11,1.08295459501,20.7753954924],[155516e-11,.83306084617,213.299095438]],[[6283.0758499914,0,0],[.00206058863,2.67823455808,6283.0758499914],[4303419e-11,2.63512233481,12566.1516999828]],[[8721859e-11,1.07253635559,6283.0758499914]]],[[],[[.00227777722,3.4137662053,6283.0758499914],[3805678e-11,3.37063423795,12566.1516999828]]],[[[1.00013988784,0,0],[.01670699632,3.09846350258,6283.0758499914],[.00013956024,3.05524609456,12566.1516999828],[308372e-10,5.19846674381,77713.7714681205],[1628463e-11,1.17387558054,5753.3848848968],[1575572e-11,2.84685214877,7860.4193924392],[924799e-11,5.45292236722,11506.7697697936],[542439e-11,4.56409151453,3930.2096962196],[47211e-10,3.66100022149,5884.9268465832],[8.5831e-7,1.27079125277,161000.6857376741],[5.7056e-7,2.01374292245,83996.84731811189],[5.5736e-7,5.2415979917,71430.69561812909],[174844e-11,3.01193636733,18849.2275499742],[243181e-11,4.2734953079,11790.6290886588]],[[.00103018607,1.10748968172,6283.0758499914],[1721238e-11,1.06442300386,12566.1516999828]],[[4359385e-11,5.78455133808,6283.0758499914]]]],Mars:[[[[6.20347711581,0,0],[.18656368093,5.0503710027,3340.6124266998],[.01108216816,5.40099836344,6681.2248533996],[.00091798406,5.75478744667,10021.8372800994],[.00027744987,5.97049513147,3.523118349],[.00010610235,2.93958560338,2281.2304965106],[.00012315897,.84956094002,2810.9214616052],[8926784e-11,4.15697846427,.0172536522],[8715691e-11,6.11005153139,13362.4497067992],[6797556e-11,.36462229657,398.1490034082],[7774872e-11,3.33968761376,5621.8429232104],[3575078e-11,1.6618650571,2544.3144198834],[4161108e-11,.22814971327,2942.4634232916],[3075252e-11,.85696614132,191.4482661116],[2628117e-11,.64806124465,3337.0893083508],[2937546e-11,6.07893711402,.0673103028],[2389414e-11,5.03896442664,796.2980068164],[2579844e-11,.02996736156,3344.1355450488],[1528141e-11,1.14979301996,6151.533888305],[1798806e-11,.65634057445,529.6909650946],[1264357e-11,3.62275122593,5092.1519581158],[1286228e-11,3.06796065034,2146.1654164752],[1546404e-11,2.91579701718,1751.539531416],[1024902e-11,3.69334099279,8962.4553499102],[891566e-11,.18293837498,16703.062133499],[858759e-11,2.4009381194,2914.0142358238],[832715e-11,2.46418619474,3340.5951730476],[83272e-10,4.49495782139,3340.629680352],[712902e-11,3.66335473479,1059.3819301892],[748723e-11,3.82248614017,155.4203994342],[723861e-11,.67497311481,3738.761430108],[635548e-11,2.92182225127,8432.7643848156],[655162e-11,.48864064125,3127.3133312618],[550474e-11,3.81001042328,.9803210682],[55275e-10,4.47479317037,1748.016413067],[425966e-11,.55364317304,6283.0758499914],[415131e-11,.49662285038,213.299095438],[472167e-11,3.62547124025,1194.4470102246],[306551e-11,.38052848348,6684.7479717486],[312141e-11,.99853944405,6677.7017350506],[293198e-11,4.22131299634,20.7753954924],[302375e-11,4.48618007156,3532.0606928114],[274027e-11,.54222167059,3340.545116397],[281079e-11,5.88163521788,1349.8674096588],[231183e-11,1.28242156993,3870.3033917944],[283602e-11,5.7688543494,3149.1641605882],[236117e-11,5.75503217933,3333.498879699],[274033e-11,.13372524985,3340.6797370026],[299395e-11,2.78323740866,6254.6266625236]],[[3340.61242700512,0,0],[.01457554523,3.60433733236,3340.6124266998],[.00168414711,3.92318567804,6681.2248533996],[.00020622975,4.26108844583,10021.8372800994],[3452392e-11,4.7321039319,3.523118349],[2586332e-11,4.60670058555,13362.4497067992],[841535e-11,4.45864030426,2281.2304965106]],[[.00058152577,2.04961712429,3340.6124266998],[.00013459579,2.45738706163,6681.2248533996]]],[[[.03197134986,3.76832042431,3340.6124266998],[.00298033234,4.10616996305,6681.2248533996],[.00289104742,0,0],[.00031365539,4.4465105309,10021.8372800994],[34841e-9,4.7881254926,13362.4497067992]],[[.00217310991,6.04472194776,3340.6124266998],[.00020976948,3.14159265359,0],[.00012834709,1.60810667915,6681.2248533996]]],[[[1.53033488271,0,0],[.1418495316,3.47971283528,3340.6124266998],[.00660776362,3.81783443019,6681.2248533996],[.00046179117,4.15595316782,10021.8372800994],[8109733e-11,5.55958416318,2810.9214616052],[7485318e-11,1.77239078402,5621.8429232104],[5523191e-11,1.3643630377,2281.2304965106],[382516e-10,4.49407183687,13362.4497067992],[2306537e-11,.09081579001,2544.3144198834],[1999396e-11,5.36059617709,3337.0893083508],[2484394e-11,4.9254563992,2942.4634232916],[1960195e-11,4.74249437639,3344.1355450488],[1167119e-11,2.11260868341,5092.1519581158],[1102816e-11,5.00908403998,398.1490034082],[899066e-11,4.40791133207,529.6909650946],[992252e-11,5.83861961952,6151.533888305],[807354e-11,2.10217065501,1059.3819301892],[797915e-11,3.44839203899,796.2980068164],[740975e-11,1.49906336885,2146.1654164752]],[[.01107433345,2.03250524857,3340.6124266998],[.00103175887,2.37071847807,6681.2248533996],[128772e-9,0,0],[.0001081588,2.70888095665,10021.8372800994]],[[.00044242249,.47930604954,3340.6124266998],[8138042e-11,.86998389204,6681.2248533996]]]],Jupiter:[[[[.59954691494,0,0],[.09695898719,5.06191793158,529.6909650946],[.00573610142,1.44406205629,7.1135470008],[.00306389205,5.41734730184,1059.3819301892],[.00097178296,4.14264726552,632.7837393132],[.00072903078,3.64042916389,522.5774180938],[.00064263975,3.41145165351,103.0927742186],[.00039806064,2.29376740788,419.4846438752],[.00038857767,1.27231755835,316.3918696566],[.00027964629,1.7845459182,536.8045120954],[.0001358973,5.7748104079,1589.0728952838],[8246349e-11,3.5822792584,206.1855484372],[8768704e-11,3.63000308199,949.1756089698],[7368042e-11,5.0810119427,735.8765135318],[626315e-10,.02497628807,213.299095438],[6114062e-11,4.51319998626,1162.4747044078],[4905396e-11,1.32084470588,110.2063212194],[5305285e-11,1.30671216791,14.2270940016],[5305441e-11,4.18625634012,1052.2683831884],[4647248e-11,4.69958103684,3.9321532631],[3045023e-11,4.31676431084,426.598190876],[2609999e-11,1.56667394063,846.0828347512],[2028191e-11,1.06376530715,3.1813937377],[1764763e-11,2.14148655117,1066.49547719],[1722972e-11,3.88036268267,1265.5674786264],[1920945e-11,.97168196472,639.897286314],[1633223e-11,3.58201833555,515.463871093],[1431999e-11,4.29685556046,625.6701923124],[973272e-11,4.09764549134,95.9792272178]],[[529.69096508814,0,0],[.00489503243,4.2208293947,529.6909650946],[.00228917222,6.02646855621,7.1135470008],[.00030099479,4.54540782858,1059.3819301892],[.0002072092,5.45943156902,522.5774180938],[.00012103653,.16994816098,536.8045120954],[6067987e-11,4.42422292017,103.0927742186],[5433968e-11,3.98480737746,419.4846438752],[4237744e-11,5.89008707199,14.2270940016]],[[.00047233601,4.32148536482,7.1135470008],[.00030649436,2.929777887,529.6909650946],[.00014837605,3.14159265359,0]]],[[[.02268615702,3.55852606721,529.6909650946],[.00109971634,3.90809347197,1059.3819301892],[.00110090358,0,0],[8101428e-11,3.60509572885,522.5774180938],[6043996e-11,4.25883108339,1589.0728952838],[6437782e-11,.30627119215,536.8045120954]],[[.00078203446,1.52377859742,529.6909650946]]],[[[5.20887429326,0,0],[.25209327119,3.49108639871,529.6909650946],[.00610599976,3.84115365948,1059.3819301892],[.00282029458,2.57419881293,632.7837393132],[.00187647346,2.07590383214,522.5774180938],[.00086792905,.71001145545,419.4846438752],[.00072062974,.21465724607,536.8045120954],[.00065517248,5.9799588479,316.3918696566],[.00029134542,1.67759379655,103.0927742186],[.00030135335,2.16132003734,949.1756089698],[.00023453271,3.54023522184,735.8765135318],[.00022283743,4.19362594399,1589.0728952838],[.00023947298,.2745803748,7.1135470008],[.00013032614,2.96042965363,1162.4747044078],[970336e-10,1.90669633585,206.1855484372],[.00012749023,2.71550286592,1052.2683831884],[7057931e-11,2.18184839926,1265.5674786264],[6137703e-11,6.26418240033,846.0828347512],[2616976e-11,2.00994012876,1581.959348283]],[[.0127180152,2.64937512894,529.6909650946],[.00061661816,3.00076460387,1059.3819301892],[.00053443713,3.89717383175,522.5774180938],[.00031185171,4.88276958012,536.8045120954],[.00041390269,0,0]]]],Saturn:[[[[.87401354025,0,0],[.11107659762,3.96205090159,213.299095438],[.01414150957,4.58581516874,7.1135470008],[.00398379389,.52112032699,206.1855484372],[.00350769243,3.30329907896,426.598190876],[.00206816305,.24658372002,103.0927742186],[792713e-9,3.84007056878,220.4126424388],[.00023990355,4.66976924553,110.2063212194],[.00016573588,.43719228296,419.4846438752],[.00014906995,5.76903183869,316.3918696566],[.0001582029,.93809155235,632.7837393132],[.00014609559,1.56518472,3.9321532631],[.00013160301,4.44891291899,14.2270940016],[.00015053543,2.71669915667,639.897286314],[.00013005299,5.98119023644,11.0457002639],[.00010725067,3.12939523827,202.2533951741],[5863206e-11,.23656938524,529.6909650946],[5227757e-11,4.20783365759,3.1813937377],[6126317e-11,1.76328667907,277.0349937414],[5019687e-11,3.17787728405,433.7117378768],[459255e-10,.61977744975,199.0720014364],[4005867e-11,2.24479718502,63.7358983034],[2953796e-11,.98280366998,95.9792272178],[387367e-10,3.22283226966,138.5174968707],[2461186e-11,2.03163875071,735.8765135318],[3269484e-11,.77492638211,949.1756089698],[1758145e-11,3.2658010994,522.5774180938],[1640172e-11,5.5050445305,846.0828347512],[1391327e-11,4.02333150505,323.5054166574],[1580648e-11,4.37265307169,309.2783226558],[1123498e-11,2.83726798446,415.5524906121],[1017275e-11,3.71700135395,227.5261894396],[848642e-11,3.1915017083,209.3669421749]],[[213.2990952169,0,0],[.01297370862,1.82834923978,213.299095438],[.00564345393,2.88499717272,7.1135470008],[.00093734369,1.06311793502,426.598190876],[.00107674962,2.27769131009,206.1855484372],[.00040244455,2.04108104671,220.4126424388],[.00019941774,1.2795439047,103.0927742186],[.00010511678,2.7488034213,14.2270940016],[6416106e-11,.38238295041,639.897286314],[4848994e-11,2.43037610229,419.4846438752],[4056892e-11,2.92133209468,110.2063212194],[3768635e-11,3.6496533078,3.9321532631]],[[.0011644133,1.17988132879,7.1135470008],[.00091841837,.0732519584,213.299095438],[.00036661728,0,0],[.00015274496,4.06493179167,206.1855484372]]],[[[.04330678039,3.60284428399,213.299095438],[.00240348302,2.85238489373,426.598190876],[.00084745939,0,0],[.00030863357,3.48441504555,220.4126424388],[.00034116062,.57297307557,206.1855484372],[.0001473407,2.11846596715,639.897286314],[9916667e-11,5.79003188904,419.4846438752],[6993564e-11,4.7360468972,7.1135470008],[4807588e-11,5.43305312061,316.3918696566]],[[.00198927992,4.93901017903,213.299095438],[.00036947916,3.14159265359,0],[.00017966989,.5197943111,426.598190876]]],[[[9.55758135486,0,0],[.52921382865,2.39226219573,213.299095438],[.01873679867,5.2354960466,206.1855484372],[.01464663929,1.64763042902,426.598190876],[.00821891141,5.93520042303,316.3918696566],[.00547506923,5.0153261898,103.0927742186],[.0037168465,2.27114821115,220.4126424388],[.00361778765,3.13904301847,7.1135470008],[.00140617506,5.70406606781,632.7837393132],[.00108974848,3.29313390175,110.2063212194],[.00069006962,5.94099540992,419.4846438752],[.00061053367,.94037691801,639.897286314],[.00048913294,1.55733638681,202.2533951741],[.00034143772,.19519102597,277.0349937414],[.00032401773,5.47084567016,949.1756089698],[.00020936596,.46349251129,735.8765135318],[9796004e-11,5.20477537945,1265.5674786264],[.00011993338,5.98050967385,846.0828347512],[208393e-9,1.52102476129,433.7117378768],[.00015298404,3.0594381494,529.6909650946],[6465823e-11,.17732249942,1052.2683831884],[.00011380257,1.7310542704,522.5774180938],[3419618e-11,4.94550542171,1581.959348283]],[[.0618298134,.2584351148,213.299095438],[.00506577242,.71114625261,206.1855484372],[.00341394029,5.79635741658,426.598190876],[.00188491195,.47215589652,220.4126424388],[.00186261486,3.14159265359,0],[.00143891146,1.40744822888,7.1135470008]],[[.00436902572,4.78671677509,213.299095438]]]],Uranus:[[[[5.48129294297,0,0],[.09260408234,.89106421507,74.7815985673],[.01504247898,3.6271926092,1.4844727083],[.00365981674,1.89962179044,73.297125859],[.00272328168,3.35823706307,149.5631971346],[.00070328461,5.39254450063,63.7358983034],[.00068892678,6.09292483287,76.2660712756],[.00061998615,2.26952066061,2.9689454166],[.00061950719,2.85098872691,11.0457002639],[.0002646877,3.14152083966,71.8126531507],[.00025710476,6.11379840493,454.9093665273],[.0002107885,4.36059339067,148.0787244263],[.00017818647,1.74436930289,36.6485629295],[.00014613507,4.73732166022,3.9321532631],[.00011162509,5.8268179635,224.3447957019],[.0001099791,.48865004018,138.5174968707],[9527478e-11,2.95516862826,35.1640902212],[7545601e-11,5.236265824,109.9456887885],[4220241e-11,3.23328220918,70.8494453042],[40519e-9,2.277550173,151.0476698429],[3354596e-11,1.0654900738,4.4534181249],[2926718e-11,4.62903718891,9.5612275556],[349034e-10,5.48306144511,146.594251718],[3144069e-11,4.75199570434,77.7505439839],[2922333e-11,5.35235361027,85.8272988312],[2272788e-11,4.36600400036,70.3281804424],[2051219e-11,1.51773566586,.1118745846],[2148602e-11,.60745949945,38.1330356378],[1991643e-11,4.92437588682,277.0349937414],[1376226e-11,2.04283539351,65.2203710117],[1666902e-11,3.62744066769,380.12776796],[1284107e-11,3.11347961505,202.2533951741],[1150429e-11,.93343589092,3.1813937377],[1533221e-11,2.58594681212,52.6901980395],[1281604e-11,.54271272721,222.8603229936],[1372139e-11,4.19641530878,111.4301614968],[1221029e-11,.1990065003,108.4612160802],[946181e-11,1.19253165736,127.4717966068],[1150989e-11,4.17898916639,33.6796175129]],[[74.7815986091,0,0],[.00154332863,5.24158770553,74.7815985673],[.00024456474,1.71260334156,1.4844727083],[9258442e-11,.4282973235,11.0457002639],[8265977e-11,1.50218091379,63.7358983034],[915016e-10,1.41213765216,149.5631971346]]],[[[.01346277648,2.61877810547,74.7815985673],[623414e-9,5.08111189648,149.5631971346],[.00061601196,3.14159265359,0],[9963722e-11,1.61603805646,76.2660712756],[992616e-10,.57630380333,73.297125859]],[[.00034101978,.01321929936,74.7815985673]]],[[[19.21264847206,0,0],[.88784984413,5.60377527014,74.7815985673],[.03440836062,.32836099706,73.297125859],[.0205565386,1.7829515933,149.5631971346],[.0064932241,4.52247285911,76.2660712756],[.00602247865,3.86003823674,63.7358983034],[.00496404167,1.40139935333,454.9093665273],[.00338525369,1.58002770318,138.5174968707],[.00243509114,1.57086606044,71.8126531507],[.00190522303,1.99809394714,1.4844727083],[.00161858838,2.79137786799,148.0787244263],[.00143706183,1.38368544947,11.0457002639],[.00093192405,.17437220467,36.6485629295],[.00071424548,4.24509236074,224.3447957019],[.00089806014,3.66105364565,109.9456887885],[.00039009723,1.66971401684,70.8494453042],[.00046677296,1.39976401694,35.1640902212],[.00039025624,3.36234773834,277.0349937414],[.00036755274,3.88649278513,146.594251718],[.00030348723,.70100838798,151.0476698429],[.00029156413,3.180563367,77.7505439839],[.00022637073,.72518687029,529.6909650946],[.00011959076,1.7504339214,984.6003316219],[.00025620756,5.25656086672,380.12776796]],[[.01479896629,3.67205697578,74.7815985673]]]],Neptune:[[[[5.31188633046,0,0],[.0179847553,2.9010127389,38.1330356378],[.01019727652,.48580922867,1.4844727083],[.00124531845,4.83008090676,36.6485629295],[.00042064466,5.41054993053,2.9689454166],[.00037714584,6.09221808686,35.1640902212],[.00033784738,1.24488874087,76.2660712756],[.00016482741,7727998e-11,491.5579294568],[9198584e-11,4.93747051954,39.6175083461],[899425e-10,.27462171806,175.1660598002]],[[38.13303563957,0,0],[.00016604172,4.86323329249,1.4844727083],[.00015744045,2.27887427527,38.1330356378]]],[[[.03088622933,1.44104372644,38.1330356378],[.00027780087,5.91271884599,76.2660712756],[.00027623609,0,0],[.00015355489,2.52123799551,36.6485629295],[.00015448133,3.50877079215,39.6175083461]]],[[[30.07013205828,0,0],[.27062259632,1.32999459377,38.1330356378],[.01691764014,3.25186135653,36.6485629295],[.00807830553,5.18592878704,1.4844727083],[.0053776051,4.52113935896,35.1640902212],[.00495725141,1.5710564165,491.5579294568],[.00274571975,1.84552258866,175.1660598002],[.0001201232,1.92059384991,1021.2488945514],[.00121801746,5.79754470298,76.2660712756],[.00100896068,.3770272493,73.297125859],[.00135134092,3.37220609835,39.6175083461],[7571796e-11,1.07149207335,388.4651552382]]]]};function Y(t){var e,r,i,o;const a=2e3+(t-14)/n;return a<-500?32*(e=(a-1820)/100)*e-20:a<500?10583.6-1014.41*(e=a/100)+33.78311*(r=e*e)-5.952053*(i=e*r)-.1798452*(o=r*r)+r*i*.022174192+i*i*.0090316521:a<1600?1574.2-556.01*(e=(a-1e3)/100)+71.23472*(r=e*e)+.319781*(i=e*r)-.8503463*(o=r*r)-r*i*.005050998+i*i*.0083572073:a<1700?120-.9808*(e=a-1600)-.01532*(r=e*e)+(i=e*r)/7129:a<1800?8.83+.1603*(e=a-1700)-.0059285*(r=e*e)+13336e-8*(i=e*r)-(o=r*r)/1174e3:a<1860?13.72-.332447*(e=a-1800)+.0068612*(r=e*e)+.0041116*(i=e*r)-37436e-8*(o=r*r)+r*i*121272e-10-i*i*1.699e-7+i*o*8.75e-10:a<1900?7.62+.5737*(e=a-1860)-.251754*(r=e*e)+.01680668*(i=e*r)-.0004473624*(o=r*r)+r*i/233174:a<1920?1.494119*(e=a-1900)-2.79-.0598939*(r=e*e)+.0061966*(i=e*r)-197e-6*(o=r*r):a<1941?21.2+.84493*(e=a-1920)-.0761*(r=e*e)+.0020936*(i=e*r):a<1961?29.07+.407*(e=a-1950)-(r=e*e)/233+(i=e*r)/2547:a<1986?45.45+1.067*(e=a-1975)-(r=e*e)/260-(i=e*r)/718:a<2005?63.86+.3345*(e=a-2e3)-.060374*(r=e*e)+.0017275*(i=e*r)+651814e-9*(o=r*r)+r*i*2373599e-11:a<2050?62.92+.32217*(e=a-2e3)+.005589*e*e:a<2150?32*(e=(a-1820)/100)*e-20-.5628*(2150-a):32*(e=(a-1820)/100)*e-20}e.DeltaT_EspenakMeeus=Y,e.DeltaT_JplHorizons=function(t){return Y(Math.min(t,17*n))};let Z=Y;function X(t){return t+Z(t)/86400}e.SetDeltaTFunction=function(t){Z=t};class tt{constructor(t){if(t instanceof tt)return this.date=t.date,this.ut=t.ut,void(this.tt=t.tt);const e=864e5;if(t instanceof Date&&Number.isFinite(t.getTime()))return this.date=t,this.ut=(t.getTime()-r.getTime())/e,void(this.tt=X(this.ut));if(Number.isFinite(t))return this.date=new Date(r.getTime()+t*e),this.ut=t,void(this.tt=X(this.ut));throw"Argument must be a Date object, an AstroTime object, or a numeric UTC Julian date."}static FromTerrestrialTime(t){let e=new tt(t);for(;;){const n=t-e.tt;if(Math.abs(n)<1e-12)return e;e=e.AddDays(n)}}toString(){return this.date.toISOString()}AddDays(t){return new tt(this.ut+t)}}function et(t){return t instanceof tt?t:new tt(t)}function nt(t){var e=t.tt/36525;return(((((-4.34e-8*e-576e-9)*e+.0020034)*e-1831e-7)*e-46.836769)*e+84381.406)/3600}var rt;function it(t){if(!rt||Math.abs(rt.tt-t.tt)>1e-6){const n=function(t){function e(t){return t%s*a}const n=t.tt/36525,r=e(1287104.79305+129596581.0481*n),i=e(335779.526232+1739527262.8478*n),o=e(1072260.70369+1602961601.209*n),c=e(450160.398036-6962890.5431*n);let u=Math.sin(c),l=Math.cos(c),h=(-172064161-174666*n)*u+33386*l,d=(92052331+9086*n)*l+15377*u,f=2*(i-o+c);return u=Math.sin(f),l=Math.cos(f),h+=(-13170906-1675*n)*u-13696*l,d+=(5730336-3015*n)*l-4587*u,f=2*(i+c),u=Math.sin(f),l=Math.cos(f),h+=(-2276413-234*n)*u+2796*l,d+=(978459-485*n)*l+1374*u,f=2*c,u=Math.sin(f),l=Math.cos(f),h+=(2074554+207*n)*u-698*l,d+=(470*n-897492)*l-291*u,u=Math.sin(r),l=Math.cos(r),h+=(1475877-3633*n)*u+11817*l,d+=(73871-184*n)*l-1924*u,{dpsi:1e-7*h-135e-6,deps:388e-6+1e-7*d}}(t),r=nt(t),i=r+n.deps/3600;rt={tt:t.tt,dpsi:n.dpsi,deps:n.deps,ee:n.dpsi*Math.cos(r*e.DEG2RAD)/15,mobl:r,tobl:i}}return rt}function ot(t,n){const r=t*e.DEG2RAD,i=Math.cos(r),o=Math.sin(r);return[n[0],n[1]*i-n[2]*o,n[1]*o+n[2]*i]}function at(t){++e.CalcMoonCount;const n=t.tt/36525;function r(t,e){const n=[];let r;for(r=0;r<=e-t;++r)n.push(0);return{min:t,array:n}}function a(t,e,n,i){const o=[];for(let a=0;a<=e-t;++a)o.push(r(n,i));return{min:t,array:o}}function s(t,e,n){const r=t.array[e-t.min];return r.array[n-r.min]}function c(t,e,n,r){const i=t.array[e-t.min];i.array[n-i.min]=r}let u,l,h,d,f,m,p,g,v,y,b,M,w,A,E,D,S,x,R,$,k,C,z,P=a(-6,6,1,4),O=a(-6,6,1,4);function I(t,e){return s(P,t,e)}function N(t,e){return s(O,t,e)}function T(t,e,n){return c(P,t,e,n)}function U(t,e,n){return c(O,t,e,n)}function G(t,e,n,r,i){i(t*n-e*r,e*n+t*r)}function L(t){return Math.sin(i*t)}p=n*n,v=0,z=0,b=0,M=3422.7;var H=L(.19833+.05611*n),F=L(.27869+.04508*n),V=L(.16827-.36903*n),B=L(.34734-5.37261*n),J=L(.10498-5.37899*n),q=L(.42681-.41855*n);for(x=.84*H+.31*F+14.27*V+7.26*B+.28*J+.24*q,R=2.94*H+.31*F+14.27*V+9.34*B+1.12*J+.83*q,$=-6.4*H-1.89*q,k=.21*H+.31*F+14.27*V-88.7*B-15.3*J+.24*q-1.86*L(.14943-5.37511*n),C=x-$,g=-3332e-9*L(.59734-5.37261*n)-539e-9*L(.35498-5.37899*n)-64e-9*L(.39943-5.37511*n),w=i*j(.60643382+1336.85522467*n-313e-8*p)+x/o,A=i*j(.37489701+1325.55240982*n+2565e-8*p)+R/o,E=i*j(.99312619+99.99735956*n-44e-8*p)+$/o,D=i*j(.25909118+1342.2278298*n-892e-8*p)+k/o,S=i*j(.82736186+1236.85308708*n-397e-8*p)+C/o,f=1;f<=4;++f){switch(f){case 1:h=A,l=4,d=1.000002208;break;case 2:h=E,l=3,d=.997504612-.002495388*n;break;case 3:h=D,l=4,d=1.000002708+139.978*g;break;case 4:h=S,l=6,d=1;break;default:throw`Internal error: I = ${f}`}for(T(0,f,1),T(1,f,Math.cos(h)*d),U(0,f,0),U(1,f,Math.sin(h)*d),m=2;m<=l;++m)G(I(m-1,f),N(m-1,f),I(1,f),N(1,f),((t,e)=>(T(m,f,t),U(m,f,e))));for(m=1;m<=l;++m)T(-m,f,I(m,f)),U(-m,f,-N(m,f))}function K(t,e,n,r){for(var i={x:1,y:0},o=[0,t,e,n,r],a=1;a<=4;++a)0!==o[a]&&G(i.x,i.y,I(o[a],a),N(o[a],a),((t,e)=>(i.x=t,i.y=e)));return i}function Q(t,e,n,r,i,o,a,s){var c=K(i,o,a,s);v+=t*c.y,z+=e*c.y,b+=n*c.x,M+=r*c.x}function W(t,e,n,r,i){return t*K(e,n,r,i).y}Q(13.902,14.06,-.001,.2607,0,0,0,4),Q(.403,-4.01,.394,.0023,0,0,0,3),Q(2369.912,2373.36,.601,28.2333,0,0,0,2),Q(-125.154,-112.79,-.725,-.9781,0,0,0,1),Q(1.979,6.98,-.445,.0433,1,0,0,4),Q(191.953,192.72,.029,3.0861,1,0,0,2),Q(-8.466,-13.51,.455,-.1093,1,0,0,1),Q(22639.5,22609.07,.079,186.5398,1,0,0,0),Q(18.609,3.59,-.094,.0118,1,0,0,-1),Q(-4586.465,-4578.13,-.077,34.3117,1,0,0,-2),Q(3.215,5.44,.192,-.0386,1,0,0,-3),Q(-38.428,-38.64,.001,.6008,1,0,0,-4),Q(-.393,-1.43,-.092,.0086,1,0,0,-6),Q(-.289,-1.59,.123,-.0053,0,1,0,4),Q(-24.42,-25.1,.04,-.3,0,1,0,2),Q(18.023,17.93,.007,.1494,0,1,0,1),Q(-668.146,-126.98,-1.302,-.3997,0,1,0,0),Q(.56,.32,-.001,-.0037,0,1,0,-1),Q(-165.145,-165.06,.054,1.9178,0,1,0,-2),Q(-1.877,-6.46,-.416,.0339,0,1,0,-4),Q(.213,1.02,-.074,.0054,2,0,0,4),Q(14.387,14.78,-.017,.2833,2,0,0,2),Q(-.586,-1.2,.054,-.01,2,0,0,1),Q(769.016,767.96,.107,10.1657,2,0,0,0),Q(1.75,2.01,-.018,.0155,2,0,0,-1),Q(-211.656,-152.53,5.679,-.3039,2,0,0,-2),Q(1.225,.91,-.03,-.0088,2,0,0,-3),Q(-30.773,-34.07,-.308,.3722,2,0,0,-4),Q(-.57,-1.4,-.074,.0109,2,0,0,-6),Q(-2.921,-11.75,.787,-.0484,1,1,0,2),Q(1.267,1.52,-.022,.0164,1,1,0,1),Q(-109.673,-115.18,.461,-.949,1,1,0,0),Q(-205.962,-182.36,2.056,1.4437,1,1,0,-2),Q(.233,.36,.012,-.0025,1,1,0,-3),Q(-4.391,-9.66,-.471,.0673,1,1,0,-4),Q(.283,1.53,-.111,.006,1,-1,0,4),Q(14.577,31.7,-1.54,.2302,1,-1,0,2),Q(147.687,138.76,.679,1.1528,1,-1,0,0),Q(-1.089,.55,.021,0,1,-1,0,-1),Q(28.475,23.59,-.443,-.2257,1,-1,0,-2),Q(-.276,-.38,-.006,-.0036,1,-1,0,-3),Q(.636,2.27,.146,-.0102,1,-1,0,-4),Q(-.189,-1.68,.131,-.0028,0,2,0,2),Q(-7.486,-.66,-.037,-.0086,0,2,0,0),Q(-8.096,-16.35,-.74,.0918,0,2,0,-2),Q(-5.741,-.04,0,-9e-4,0,0,2,2),Q(.255,0,0,0,0,0,2,1),Q(-411.608,-.2,0,-.0124,0,0,2,0),Q(.584,.84,0,.0071,0,0,2,-1),Q(-55.173,-52.14,0,-.1052,0,0,2,-2),Q(.254,.25,0,-.0017,0,0,2,-3),Q(.025,-1.67,0,.0031,0,0,2,-4),Q(1.06,2.96,-.166,.0243,3,0,0,2),Q(36.124,50.64,-1.3,.6215,3,0,0,0),Q(-13.193,-16.4,.258,-.1187,3,0,0,-2),Q(-1.187,-.74,.042,.0074,3,0,0,-4),Q(-.293,-.31,-.002,.0046,3,0,0,-6),Q(-.29,-1.45,.116,-.0051,2,1,0,2),Q(-7.649,-10.56,.259,-.1038,2,1,0,0),Q(-8.627,-7.59,.078,-.0192,2,1,0,-2),Q(-2.74,-2.54,.022,.0324,2,1,0,-4),Q(1.181,3.32,-.212,.0213,2,-1,0,2),Q(9.703,11.67,-.151,.1268,2,-1,0,0),Q(-.352,-.37,.001,-.0028,2,-1,0,-1),Q(-2.494,-1.17,-.003,-.0017,2,-1,0,-2),Q(.36,.2,-.012,-.0043,2,-1,0,-4),Q(-1.167,-1.25,.008,-.0106,1,2,0,0),Q(-7.412,-6.12,.117,.0484,1,2,0,-2),Q(-.311,-.65,-.032,.0044,1,2,0,-4),Q(.757,1.82,-.105,.0112,1,-2,0,2),Q(2.58,2.32,.027,.0196,1,-2,0,0),Q(2.533,2.4,-.014,-.0212,1,-2,0,-2),Q(-.344,-.57,-.025,.0036,0,3,0,-2),Q(-.992,-.02,0,0,1,0,2,2),Q(-45.099,-.02,0,-.001,1,0,2,0),Q(-.179,-9.52,0,-.0833,1,0,2,-2),Q(-.301,-.33,0,.0014,1,0,2,-4),Q(-6.382,-3.37,0,-.0481,1,0,-2,2),Q(39.528,85.13,0,-.7136,1,0,-2,0),Q(9.366,.71,0,-.0112,1,0,-2,-2),Q(.202,.02,0,0,1,0,-2,-4),Q(.415,.1,0,.0013,0,1,2,0),Q(-2.152,-2.26,0,-.0066,0,1,2,-2),Q(-1.44,-1.3,0,.0014,0,1,-2,2),Q(.384,-.04,0,0,0,1,-2,-2),Q(1.938,3.6,-.145,.0401,4,0,0,0),Q(-.952,-1.58,.052,-.013,4,0,0,-2),Q(-.551,-.94,.032,-.0097,3,1,0,0),Q(-.482,-.57,.005,-.0045,3,1,0,-2),Q(.681,.96,-.026,.0115,3,-1,0,0),Q(-.297,-.27,.002,-9e-4,2,2,0,-2),Q(.254,.21,-.003,0,2,-2,0,-2),Q(-.25,-.22,.004,.0014,1,3,0,-2),Q(-3.996,0,0,4e-4,2,0,2,0),Q(.557,-.75,0,-.009,2,0,2,-2),Q(-.459,-.38,0,-.0053,2,0,-2,2),Q(-1.298,.74,0,4e-4,2,0,-2,0),Q(.538,1.14,0,-.0141,2,0,-2,-2),Q(.263,.02,0,0,1,1,2,0),Q(.426,.07,0,-6e-4,1,1,-2,-2),Q(-.304,.03,0,3e-4,1,-1,2,0),Q(-.372,-.19,0,-.0027,1,-1,-2,2),Q(.418,0,0,0,0,0,4,0),Q(-.33,-.04,0,0,3,0,2,0),y=0,y+=W(-526.069,0,0,1,-2),y+=W(-3.352,0,0,1,-4),y+=W(44.297,1,0,1,-2),y+=W(-6,1,0,1,-4),y+=W(20.599,-1,0,1,0),y+=W(-30.598,-1,0,1,-2),y+=W(-24.649,-2,0,1,0),y+=W(-2,-2,0,1,-2),y+=W(-22.571,0,1,1,-2),y+=W(10.985,0,-1,1,-2),v+=.82*L(.7736-62.5512*n)+.31*L(.0466-125.1025*n)+.35*L(.5785-25.1042*n)+.66*L(.4591+1335.8075*n)+.64*L(.313-91.568*n)+1.14*L(.148+1331.2898*n)+.21*L(.5918+1056.5859*n)+.44*L(.5784+1322.8595*n)+.24*L(.2275-5.7374*n)+.28*L(.2965+2.6929*n)+.33*L(.3132+6.3368*n),u=D+z/o;let Y=(1.000002708+139.978*g)*(18518.511+1.189+b)*Math.sin(u)-6.24*Math.sin(3*u)+y;return{geo_eclip_lon:i*j((w+v/o)/i),geo_eclip_lat:Math.PI/648e3*Y,distance_au:o*_/(.999953253*M)}}e.AstroTime=tt,e.MakeTime=et,e.e_tilt=it,e.CalcMoonCount=0;class st{constructor(t,e,n,r,i,o){this.elat=t,this.elon=e,this.mlat=n,this.mlon=r,this.dist_km=i,this.diam_deg=o}}function ct(t,e){return[t.rot[0][0]*e[0]+t.rot[1][0]*e[1]+t.rot[2][0]*e[2],t.rot[0][1]*e[0]+t.rot[1][1]*e[1]+t.rot[2][1]*e[2],t.rot[0][2]*e[0]+t.rot[1][2]*e[1]+t.rot[2][2]*e[2]]}function ut(t,e,n){return ct(ht(e,n),t)}function lt(t,e,n){return vn(ht(e,n),t)}function ht(t,e){const n=t.tt/36525;let r=84381.406,i=((((-9.51e-8*n+132851e-9)*n-.00114045)*n-1.0790069)*n+5038.481507)*n,o=((((3.337e-7*n-467e-9)*n-.00772503)*n+.0512623)*n-.025754)*n+r,s=((((-56e-9*n+170663e-9)*n-.00121197)*n-2.3814292)*n+10.556403)*n;r*=a,i*=a,o*=a,s*=a;const c=Math.sin(r),u=Math.cos(r),l=Math.sin(-i),h=Math.cos(-i),d=Math.sin(-o),f=Math.cos(-o),m=Math.sin(s),p=Math.cos(s),g=p*h-l*m*f,v=p*l*u+m*f*h*u-c*m*d,y=p*l*c+m*f*h*c+u*m*d,b=-m*h-l*p*f,_=-m*l*u+p*f*h*u-c*p*d,M=-m*l*c+p*f*h*c+u*p*d,w=l*d,A=-d*h*u-c*f,E=-d*h*c+f*u;if(e===K.Into2000)return new Dt([[g,v,y],[b,_,M],[w,A,E]]);if(e===K.From2000)return new Dt([[g,b,w],[v,_,A],[y,M,E]]);throw"Invalid precess direction"}let dt;function ft(t){if(!dt||dt.tt!==t.tt){const e=t.tt/36525;let n=15*it(t).ee;const r=function(t){let e=(.779057273264+.00273781191135448*t.ut+t.ut%1)%1*360;return e<0&&(e+=360),e}(t);let i=((n+.014506+((((-3.68e-8*e-29956e-9)*e-44e-8)*e+1.3915817)*e+4612.156534)*e)/3600+r)%360/15;i<0&&(i+=24),dt={tt:t.tt,st:i}}return dt.st}function mt(t){return ft(et(t))}function pt(t,n){const r=t.latitude*e.DEG2RAD,i=Math.sin(r),o=Math.cos(r),a=1/Math.hypot(o,v*i),s=y*a,u=t.height/1e3,l=b*a+u,h=b*s+u,d=(15*n+t.longitude)*e.DEG2RAD,f=Math.sin(d),m=Math.cos(d);return{pos:[l*o*m/e.KM_PER_AU,l*o*f/e.KM_PER_AU,h*i/e.KM_PER_AU],vel:[-c*l*o*f*86400/e.KM_PER_AU,c*l*o*m*86400/e.KM_PER_AU,0]}}function gt(t,e,n){return ct(yt(e,n),t)}function vt(t,e,n){return vn(yt(e,n),t)}function yt(t,n){const r=it(t),i=r.mobl*e.DEG2RAD,o=r.tobl*e.DEG2RAD,s=r.dpsi*a,c=Math.cos(i),u=Math.sin(i),l=Math.cos(o),h=Math.sin(o),d=Math.cos(s),f=Math.sin(s),m=d,p=-f*c,g=-f*u,v=f*l,y=d*c*l+u*h,b=d*u*l-c*h,_=f*h,M=d*c*h-u*l,w=d*u*h+c*l;if(n===K.From2000)return new Dt([[m,v,_],[p,y,M],[g,b,w]]);if(n===K.Into2000)return new Dt([[m,p,g],[v,y,b],[_,M,w]]);throw"Invalid precess direction"}function bt(t,e,n){return n===K.Into2000?ut(gt(t,e,n),e,n):gt(ut(t,e,n),e,n)}function _t(t,e){return bt(pt(e,ft(t)).pos,t,K.Into2000)}e.LibrationInfo=st,e.Libration=function(t){const n=et(t),r=n.tt/36525,i=r*r,o=i*r,a=i*i,s=at(n),c=s.geo_eclip_lon,u=s.geo_eclip_lat,l=s.distance_au*e.KM_PER_AU,h=1.543*e.DEG2RAD,d=e.DEG2RAD*Oe(93.272095+483202.0175233*r-.0036539*i-o/3526e3+a/86331e4),f=e.DEG2RAD*Oe(125.0445479-1934.1362891*r+.0020754*i+o/467441-a/60616e3),m=e.DEG2RAD*Oe(357.5291092+35999.0502909*r-1536e-7*i+o/2449e4),p=e.DEG2RAD*Oe(134.9633964+477198.8675055*r+.0087414*i+o/69699-a/14712e3),g=e.DEG2RAD*Oe(297.8501921+445267.1114034*r-.0018819*i+o/545868-a/113065e3),v=1-.002516*r-74e-7*i,y=c-f,b=Math.atan2(Math.sin(y)*Math.cos(u)*Math.cos(h)-Math.sin(u)*Math.sin(h),Math.cos(y)*Math.cos(u)),_=Pe(e.RAD2DEG*(b-d)),M=Math.asin(-Math.sin(y)*Math.cos(u)*Math.sin(h)-Math.sin(u)*Math.cos(h)),w=e.DEG2RAD*(119.75+131.849*r),A=e.DEG2RAD*(72.56+20.186*r),D=-.02752*Math.cos(p)+-.02245*Math.sin(d)+.00684*Math.cos(p-2*d)+-.00293*Math.cos(2*d)+-85e-5*Math.cos(2*d-2*g)+-54e-5*Math.cos(p-2*g)+-2e-4*Math.sin(p+d)+-2e-4*Math.cos(p+2*d)+-2e-4*Math.cos(p-d)+14e-5*Math.cos(p+2*d-2*g),S=-.02816*Math.sin(p)+.02244*Math.cos(d)+-.00682*Math.sin(p-2*d)+-.00279*Math.sin(2*d)+-83e-5*Math.sin(2*d-2*g)+69e-5*Math.sin(p-2*g)+4e-4*Math.cos(p+d)+-25e-5*Math.sin(2*p)+-23e-5*Math.sin(p+2*d)+2e-4*Math.cos(p-d)+19e-5*Math.sin(p-d)+13e-5*Math.sin(p+2*d-2*g)+-1e-4*Math.cos(p-3*d),x=-(.0252*v*Math.sin(m)+.00473*Math.sin(2*p-2*d)+-.00467*Math.sin(p)+.00396*Math.sin(w)+.00276*Math.sin(2*p-2*g)+.00196*Math.sin(f)+-.00183*Math.cos(p-d)+.00115*Math.sin(p-2*g)+-96e-5*Math.sin(p-g)+46e-5*Math.sin(2*d-2*g)+-39e-5*Math.sin(p-d)+-32e-5*Math.sin(p-m-g)+27e-5*Math.sin(2*p-m-2*g)+23e-5*Math.sin(A)+-14e-5*Math.sin(2*g)+14e-5*Math.cos(2*p-2*d)+-12e-5*Math.sin(p-2*d)+-12e-5*Math.sin(2*p)+11e-5*Math.sin(2*p-2*m-2*g))+(D*Math.cos(b)+S*Math.sin(b))*Math.tan(M),R=S*Math.cos(b)-D*Math.sin(b),$=2*e.RAD2DEG*Math.atan(E/Math.sqrt(l*l-E*E));return new st(e.RAD2DEG*M+R,_+x,e.RAD2DEG*u,e.RAD2DEG*c,l,$)},e.SiderealTime=mt;class Mt{constructor(t,e,n,r){this.x=t,this.y=e,this.z=n,this.t=r}Length(){return Math.hypot(this.x,this.y,this.z)}}e.Vector=Mt;class wt{constructor(t,e,n,r,i,o,a){this.x=t,this.y=e,this.z=n,this.vx=r,this.vy=i,this.vz=o,this.t=a}}e.StateVector=wt;class At{constructor(t,e,n){this.lat=L(t),this.lon=L(e),this.dist=L(n)}}e.Spherical=At;class Et{constructor(t,e,n,r){this.ra=L(t),this.dec=L(e),this.dist=L(n),this.vec=r}}e.EquatorialCoordinates=Et;class Dt{constructor(t){this.rot=t}}e.RotationMatrix=Dt,e.MakeRotation=function(t){if(!function(t){if(!(t instanceof Array)||3!==t.length)return!1;for(let e=0;e<3;++e){if(!(t[e]instanceof Array)||3!==t[e].length)return!1;for(let n=0;n<3;++n)if(!Number.isFinite(t[e][n]))return!1}return!0}(t))throw"Argument must be a [3][3] array of numbers";return new Dt(t)};class St{constructor(t,e,n,r){this.azimuth=L(t),this.altitude=L(e),this.ra=L(n),this.dec=L(r)}}e.HorizontalCoordinates=St;class xt{constructor(t,e,n){this.vec=t,this.elat=L(e),this.elon=L(n)}}function Rt(t,e){return new Mt(t[0],t[1],t[2],e)}function $t(t,n){const r=Rt(t,n),i=r.x*r.x+r.y*r.y,o=Math.sqrt(i+r.z*r.z);if(0===i){if(0===r.z)throw"Indeterminate sky coordinates";return new Et(0,r.z<0?-90:90,o,r)}let a=e.RAD2HOUR*Math.atan2(r.y,r.x);a<0&&(a+=24);const s=e.RAD2DEG*Math.atan2(t[2],Math.sqrt(i));return new Et(a,s,o,r)}function kt(t,n){const r=t*e.DEG2RAD,i=Math.cos(r),o=Math.sin(r);return[i*n[0]+o*n[1],i*n[1]-o*n[0],n[2]]}function Ct(t,n,r,i,o){let a=et(t);zt(n),L(r),L(i);const s=Math.sin(n.latitude*e.DEG2RAD),c=Math.cos(n.latitude*e.DEG2RAD),u=Math.sin(n.longitude*e.DEG2RAD),l=Math.cos(n.longitude*e.DEG2RAD),h=Math.sin(i*e.DEG2RAD),d=Math.cos(i*e.DEG2RAD),f=Math.sin(r*e.HOUR2RAD),m=Math.cos(r*e.HOUR2RAD);let p=[c*l,c*u,s],g=[-s*l,-s*u,c],v=[u,-l,0];const y=-15*ft(a);let b=kt(y,p),_=kt(y,g),M=kt(y,v),w=[d*m,d*f,h];const A=w[0]*b[0]+w[1]*b[1]+w[2]*b[2],E=w[0]*_[0]+w[1]*_[1]+w[2]*_[2],D=w[0]*M[0]+w[1]*M[1]+w[2]*M[2];let S,x=Math.hypot(E,D);x>0?(S=-e.RAD2DEG*Math.atan2(D,E),S<0&&(S+=360)):S=0;let R=e.RAD2DEG*Math.atan2(x,A),$=r,k=i;if(o){let t=R,n=mn(o,90-R);if(R-=n,n>0&&R>3e-4){const n=Math.sin(R*e.DEG2RAD),r=Math.cos(R*e.DEG2RAD),i=Math.sin(t*e.DEG2RAD),o=Math.cos(t*e.DEG2RAD),a=[];for(let t=0;t<3;++t)a.push((w[t]-o*b[t])/i*n+b[t]*r);x=Math.hypot(a[0],a[1]),x>0?($=e.RAD2HOUR*Math.atan2(a[1],a[0]),$<0&&($+=24)):$=0,k=e.RAD2DEG*Math.atan2(a[2],x)}}return new St(S,90-R,$,k)}function zt(t){if(!(t instanceof Pt))throw`Not an instance of the Observer class: ${t}`;if(L(t.latitude),L(t.longitude),L(t.height),t.latitude<-90||t.latitude>90)throw`Latitude ${t.latitude} is out of range. Must be -90..+90.`;return t}e.EclipticCoordinates=xt,e.Horizon=Ct;class Pt{constructor(t,e,n){this.latitude=t,this.longitude=e,this.height=n,zt(this)}}function Ot(t){const n=et(t).AddDays(-1/e.C_AUDAY),r=Wt(W.Earth,n),i=[-r.x,-r.y,-r.z],[o,a,s]=bt(i,n,K.From2000),c=e.DEG2RAD*it(n).tobl,u=Math.cos(c),l=Math.sin(c);return Nt(new Mt(o,a,s,n),u,l)}function It(t,e,n,r,i){zt(n),G(r),G(i);const o=et(e),a=_t(o,n),s=Re(t,o,i),c=[s.x-a[0],s.y-a[1],s.z-a[2]];return $t(r?bt(c,o,K.From2000):c,o)}function Nt(t,n,r){const i=t.x,o=t.y*n+t.z*r,a=-t.y*r+t.z*n,s=Math.hypot(i,o);let c=0;s>0&&(c=e.RAD2DEG*Math.atan2(o,i),c<0&&(c+=360));let u=e.RAD2DEG*Math.atan2(a,s),l=new Mt(i,o,a,t.t);return new xt(l,u,c)}function Tt(t){const n=it(t.t),r=ut([t.x,t.y,t.z],t.t,K.From2000),[i,o,a]=gt(r,t.t,K.From2000),s=new Mt(i,o,a,t.t),c=n.tobl*e.DEG2RAD;return Nt(s,Math.cos(c),Math.sin(c))}function Ut(t){const e=et(t),n=at(e),r=n.distance_au*Math.cos(n.geo_eclip_lat),i=function(t,e){return ot(nt(t),e)}(e,[r*Math.cos(n.geo_eclip_lon),r*Math.sin(n.geo_eclip_lon),n.distance_au*Math.sin(n.geo_eclip_lat)]),o=ut(i,e,K.Into2000);return new Mt(o[0],o[1],o[2],e)}function Gt(t){const n=et(t),r=at(n),i=r.distance_au*Math.cos(r.geo_eclip_lat),o=[i*Math.cos(r.geo_eclip_lon),i*Math.sin(r.geo_eclip_lon),r.distance_au*Math.sin(r.geo_eclip_lat)],a=it(n),s=Rt(gt(ot(a.mobl,o),n,K.From2000),n),c=a.tobl*e.DEG2RAD,u=Nt(s,Math.cos(c),Math.sin(c));return new At(u.elat,u.elon,r.distance_au)}function Lt(t){const e=et(t),n=1e-5,r=e.AddDays(-n),i=e.AddDays(+n),o=Ut(r),a=Ut(i);return new wt((o.x+a.x)/2,(o.y+a.y)/2,(o.z+a.z)/2,(a.x-o.x)/(2*n),(a.y-o.y)/(2*n),(a.z-o.z)/(2*n),e)}function jt(t){const e=et(t),n=Lt(e),r=1+x;return new wt(n.x/r,n.y/r,n.z/r,n.vx/r,n.vy/r,n.vz/r,e)}function Ht(t,e,n){let r=1,o=0;for(let a of t){let t=0;for(let[n,r,i]of a)t+=n*Math.cos(r+e*i);let s=r*t;n&&(s%=i),o+=s,r*=e}return o}function Ft(t,e){let n=1,r=0,i=0,o=0;for(let a of t){let t=0,s=0;for(let[n,r,i]of a){let a=r+e*i;t+=n*i*Math.sin(a),o>0&&(s+=n*Math.cos(a))}i+=o*r*s-n*t,r=n,n*=e,++o}return i}e.Observer=Pt,e.SunPosition=Ot,e.Equator=It,e.ObserverVector=function(t,e,n){const r=et(t);let i=pt(e,ft(r)).pos;return n||(i=bt(i,r,K.Into2000)),Rt(i,r)},e.ObserverState=function(t,e,n){const r=et(t),i=pt(e,ft(r)),o=new wt(i.pos[0],i.pos[1],i.pos[2],i.vel[0],i.vel[1],i.vel[2],r);return n?o:function(t,e,n){return n===K.Into2000?lt(vt(t,e,n),e,n):vt(lt(t,e,n),e,n)}(o,r,K.Into2000)},e.VectorObserver=function(t,n){const r=ft(t.t);let i=[t.x,t.y,t.z];return n||(i=ut(i,t.t,K.From2000),i=gt(i,t.t,K.From2000)),function(t,n){const r=t[0]*e.KM_PER_AU,i=t[1]*e.KM_PER_AU,o=t[2]*e.KM_PER_AU,a=Math.hypot(r,i);let s,c,u;if(a<1e-6)s=0,c=o>0?90:-90,u=Math.abs(o)-M;else{const t=Math.atan2(i,r);for(s=e.RAD2DEG*t-15*n;s<=-180;)s+=360;for(;s>180;)s-=360;let l,h,d,f=Math.atan2(o,a),m=0;for(;;){if(++m>10)throw"inverse_terra failed to converge.";l=Math.cos(f),h=Math.sin(f);const t=(y-1)*b,e=l*l,n=h*h,r=e+y*n;d=Math.sqrt(r);const i=t*h*l/d-o*l+a*h;if(Math.abs(i)<1e-8)break;f-=i/(t*((e-n)/d-n*e*(y-1)/(t*r))+o*h+a*l)}c=e.RAD2DEG*f;const p=b/d;u=Math.abs(h)>Math.abs(l)?o/h-y*p:a/l-p}return new Pt(c,s,1e3*u)}(i,r)},e.ObserverGravity=function(t,n){const r=Math.sin(t*e.DEG2RAD),i=r*r;return 9.7803253359*(1+.00193185265241*i)/Math.sqrt(1-.00669437999013*i)*(1-(3.15704e-7-2.10269e-9*i)*n+737452e-19*n*n)},e.Ecliptic=Tt,e.GeoMoon=Ut,e.EclipticGeoMoon=Gt,e.GeoMoonState=Lt,e.GeoEmbState=jt;const Vt=365250,Bt=0,Jt=1,qt=2;function Kt(t){return new ie(t[0]+4.4036e-7*t[1]-1.90919e-7*t[2],-4.79966e-7*t[0]+.917482137087*t[1]-.397776982902*t[2],.397776982902*t[1]+.917482137087*t[2])}function Qt(t,e,n){const r=n*Math.cos(e);return[r*Math.cos(t),r*Math.sin(t),n*Math.sin(e)]}function Wt(t,e){const n=e.tt/Vt;return Kt(Qt(Ht(t[Bt],n,!0),Ht(t[Jt],n,!1),Ht(t[qt],n,!1))).ToAstroVector(e)}function Yt(t,e){const n=e/Vt,r=Ht(t[Bt],n,!0),i=Ht(t[Jt],n,!1),o=Ht(t[qt],n,!1),a=Ft(t[Bt],n),s=Ft(t[Jt],n),c=Ft(t[qt],n),u=Math.cos(r),l=Math.sin(r),h=Math.cos(i),d=Math.sin(i),f=+c*h*u-o*d*u*s-o*h*l*a,m=+c*h*l-o*d*l*s+o*h*u*a,p=+c*d+o*h*s,g=Qt(r,i,o),v=[f/Vt,m/Vt,p/Vt],y=Kt(g),b=Kt(v);return new oe(e,y,b)}function Zt(t,e,n,r){const i=r/(r+R),o=Wt(W[n],e);t.x+=i*o.x,t.y+=i*o.y,t.z+=i*o.z}const Xt=51,te=29200,ee=146,ne=201,re=[[-73e4,[-26.118207232108,-14.376168177825,3.384402515299],[.0016339372163656,-.0027861699588508,-.0013585880229445]],[-700800,[41.974905202127,-.448502952929,-12.770351505989],[.00073458569351457,.0022785014891658,.00048619778602049]],[-671600,[14.706930780744,44.269110540027,9.353698474772],[-.00210001479998,.00022295915939915,.00070143443551414]],[-642400,[-29.441003929957,-6.43016153057,6.858481011305],[.00084495803960544,-.0030783914758711,-.0012106305981192]],[-613200,[39.444396946234,-6.557989760571,-13.913760296463],[.0011480029005873,.0022400006880665,.00035168075922288]],[-584e3,[20.2303809507,43.266966657189,7.382966091923],[-.0019754081700585,.00053457141292226,.00075929169129793]],[-554800,[-30.65832536462,2.093818874552,9.880531138071],[61010603013347e-18,-.0031326500935382,-.00099346125151067]],[-525600,[35.737703251673,-12.587706024764,-14.677847247563],[.0015802939375649,.0021347678412429,.00019074436384343]],[-496400,[25.466295188546,41.367478338417,5.216476873382],[-.0018054401046468,.0008328308359951,.00080260156912107]],[-467200,[-29.847174904071,10.636426313081,12.297904180106],[-.00063257063052907,-.0029969577578221,-.00074476074151596]],[-438e3,[30.774692107687,-18.236637015304,-14.945535879896],[.0020113162005465,.0019353827024189,-20937793168297e-19]],[-408800,[30.243153324028,38.656267888503,2.938501750218],[-.0016052508674468,.0011183495337525,.00083333973416824]],[-379600,[-27.288984772533,18.643162147874,14.023633623329],[-.0011856388898191,-.0027170609282181,-.00049015526126399]],[-350400,[24.519605196774,-23.245756064727,-14.626862367368],[.0024322321483154,.0016062008146048,-.00023369181613312]],[-321200,[34.505274805875,35.125338586954,.557361475637],[-.0013824391637782,.0013833397561817,.00084823598806262]],[-292e3,[-23.275363915119,25.818514298769,15.055381588598],[-.0016062295460975,-.0023395961498533,-.00024377362639479]],[-262800,[17.050384798092,-27.180376290126,-13.608963321694],[.0028175521080578,.0011358749093955,-.00049548725258825]],[-233600,[38.093671910285,30.880588383337,-1.843688067413],[-.0011317697153459,.0016128814698472,.00084177586176055]],[-204400,[-18.197852930878,31.932869934309,15.438294826279],[-.0019117272501813,-.0019146495909842,-19657304369835e-18]],[-175200,[8.528924039997,-29.618422200048,-11.805400994258],[.0031034370787005,.0005139363329243,-.00077293066202546]],[-146e3,[40.94685725864,25.904973592021,-4.256336240499],[-.00083652705194051,.0018129497136404,.0008156422827306]],[-116800,[-12.326958895325,36.881883446292,15.217158258711],[-.0021166103705038,-.001481442003599,.00017401209844705]],[-87600,[-.633258375909,-30.018759794709,-9.17193287495],[.0032016994581737,-.00025279858672148,-.0010411088271861]],[-58400,[42.936048423883,20.344685584452,-6.588027007912],[-.00050525450073192,.0019910074335507,.00077440196540269]],[-29200,[-5.975910552974,40.61180995846,14.470131723673],[-.0022184202156107,-.0010562361130164,.00033652250216211]],[0,[-9.875369580774,-27.978926224737,-5.753711824704],[.0030287533248818,-.0011276087003636,-.0012651326732361]],[29200,[43.958831986165,14.214147973292,-8.808306227163],[-.00014717608981871,.0021404187242141,.00071486567806614]],[58400,[.67813676352,43.094461639362,13.243238780721],[-.0022358226110718,-.00063233636090933,.00047664798895648]],[87600,[-18.282602096834,-23.30503958666,-1.766620508028],[.0025567245263557,-.0019902940754171,-.0013943491701082]],[116800,[43.873338744526,7.700705617215,-10.814273666425],[.00023174803055677,.0022402163127924,.00062988756452032]],[146e3,[7.392949027906,44.382678951534,11.629500214854],[-.002193281545383,-.00021751799585364,.00059556516201114]],[175200,[-24.981690229261,-16.204012851426,2.466457544298],[.001819398914958,-.0026765419531201,-.0013848283502247]],[204400,[42.530187039511,.845935508021,-12.554907527683],[.00065059779150669,.0022725657282262,.00051133743202822]],[233600,[13.999526486822,44.462363044894,9.669418486465],[-.0021079296569252,.00017533423831993,.00069128485798076]],[262800,[-29.184024803031,-7.371243995762,6.493275957928],[.00093581363109681,-.0030610357109184,-.0012364201089345]],[292e3,[39.831980671753,-6.078405766765,-13.909815358656],[.0011117769689167,.0022362097830152,.00036230548231153]],[321200,[20.294955108476,43.417190420251,7.450091985932],[-.0019742157451535,.00053102050468554,.00075938408813008]],[350400,[-30.66999230216,2.318743558955,9.973480913858],[45605107450676e-18,-.0031308219926928,-.00099066533301924]],[379600,[35.626122155983,-12.897647509224,-14.777586508444],[.0016015684949743,.0021171931182284,.00018002516202204]],[408800,[26.133186148561,41.232139187599,5.00640132622],[-.0017857704419579,.00086046232702817,.00080614690298954]],[438e3,[-29.57674022923,11.863535943587,12.631323039872],[-.00072292830060955,-.0029587820140709,-.000708242964503]],[467200,[29.910805787391,-19.159019294,-15.013363865194],[.0020871080437997,.0018848372554514,-38528655083926e-18]],[496400,[31.375957451819,38.050372720763,2.433138343754],[-.0015546055556611,.0011699815465629,.00083565439266001]],[525600,[-26.360071336928,20.662505904952,14.414696258958],[-.0013142373118349,-.0026236647854842,-.00042542017598193]],[554800,[22.599441488648,-24.508879898306,-14.484045731468],[.0025454108304806,.0014917058755191,-.00030243665086079]],[584e3,[35.877864013014,33.894226366071,-.224524636277],[-.0012941245730845,.0014560427668319,.00084762160640137]],[613200,[-21.538149762417,28.204068269761,15.321973799534],[-.001731211740901,-.0021939631314577,-.0001631691327518]],[642400,[13.971521374415,-28.339941764789,-13.083792871886],[.0029334630526035,.00091860931752944,-.00059939422488627]],[671600,[39.526942044143,28.93989736011,-2.872799527539],[-.0010068481658095,.001702113288809,.00083578230511981]],[700800,[-15.576200701394,34.399412961275,15.466033737854],[-.0020098814612884,-.0017191109825989,70414782780416e-18]],[73e4,[4.24325283709,-30.118201690825,-10.707441231349],[.0031725847067411,.0001609846120227,-.00090672150593868]]];class ie{constructor(t,e,n){this.x=t,this.y=e,this.z=n}clone(){return new ie(this.x,this.y,this.z)}ToAstroVector(t){return new Mt(this.x,this.y,this.z,t)}static zero(){return new ie(0,0,0)}quadrature(){return this.x*this.x+this.y*this.y+this.z*this.z}add(t){return new ie(this.x+t.x,this.y+t.y,this.z+t.z)}sub(t){return new ie(this.x-t.x,this.y-t.y,this.z-t.z)}incr(t){this.x+=t.x,this.y+=t.y,this.z+=t.z}decr(t){this.x-=t.x,this.y-=t.y,this.z-=t.z}mul(t){return new ie(t*this.x,t*this.y,t*this.z)}div(t){return new ie(this.x/t,this.y/t,this.z/t)}mean(t){return new ie((this.x+t.x)/2,(this.y+t.y)/2,(this.z+t.z)/2)}neg(){return new ie(-this.x,-this.y,-this.z)}}class oe{constructor(t,e,n){this.tt=t,this.r=e,this.v=n}clone(){return new oe(this.tt,this.r,this.v)}sub(t){return new oe(this.tt,this.r.sub(t.r),this.v.sub(t.v))}}function ae(t,e,n,r){const i=r/(r+R),o=Yt(W[n],e);return t.r.incr(o.r.mul(i)),t.v.incr(o.v.mul(i)),o}function se(t,e,n){const r=n.sub(t),i=r.quadrature();return r.mul(e/(i*Math.sqrt(i)))}class ce{constructor(t){let e=new oe(t,new ie(0,0,0),new ie(0,0,0));this.Jupiter=ae(e,t,F.Jupiter,P),this.Saturn=ae(e,t,F.Saturn,O),this.Uranus=ae(e,t,F.Uranus,I),this.Neptune=ae(e,t,F.Neptune,N),this.Jupiter.r.decr(e.r),this.Jupiter.v.decr(e.v),this.Saturn.r.decr(e.r),this.Saturn.v.decr(e.v),this.Uranus.r.decr(e.r),this.Uranus.v.decr(e.v),this.Neptune.r.decr(e.r),this.Neptune.v.decr(e.v),this.Sun=new oe(t,e.r.mul(-1),e.v.mul(-1))}Acceleration(t){let e=se(t,R,this.Sun.r);return e.incr(se(t,P,this.Jupiter.r)),e.incr(se(t,O,this.Saturn.r)),e.incr(se(t,I,this.Uranus.r)),e.incr(se(t,N,this.Neptune.r)),e}}class ue{constructor(t,e,n,r){this.tt=t,this.r=e,this.v=n,this.a=r}clone(){return new ue(this.tt,this.r.clone(),this.v.clone(),this.a.clone())}}class le{constructor(t,e){this.bary=t,this.grav=e}}function he(t,e,n,r){return new ie(e.x+t*(n.x+t*r.x/2),e.y+t*(n.y+t*r.y/2),e.z+t*(n.z+t*r.z/2))}function de(t,e,n){return new ie(e.x+t*n.x,e.y+t*n.y,e.z+t*n.z)}function fe(t,e){const n=t-e.tt,r=new ce(t),i=he(n,e.r,e.v,e.a),o=r.Acceleration(i).mean(e.a),a=he(n,e.r,e.v,o),s=e.v.add(o.mul(n)),c=r.Acceleration(a),u=new ue(t,a,s,c);return new le(r,u)}const me=[];function pe(t,e){const n=Math.floor(t);return n<0?0:n>=e?e-1:n}function ge(t){const e=function(t){let[e,[n,r,i],[o,a,s]]=t;return new oe(e,new ie(n,r,i),new ie(o,a,s))}(t),n=new ce(e.tt),r=e.r.add(n.Sun.r),i=e.v.add(n.Sun.v),o=n.Acceleration(r),a=new ue(e.tt,r,i,o);return new le(n,a)}function ve(t,e,n){let r=ge(t);const i=Math.ceil((e-r.grav.tt)/n);for(let t=0;t<i;++t)r=fe(t+1===i?e:r.grav.tt+n,r.grav);return r}function ye(t,e){let n,r,i;const o=function(t,e){const n=re[0][0];if(e<n||e>re[Xt-1][0])return null;const r=pe((e-n)/te,Xt-1);if(!t[r]){const e=t[r]=[];let n;e[0]=ge(re[r]).grav,e[ne-1]=ge(re[r+1]).grav;let o=e[0].tt;for(n=1;n<ne-1;++n)e[n]=fe(o+=ee,e[n-1]).grav;o=e[ne-1].tt;var i=[];for(i[ne-1]=e[ne-1],n=ne-2;n>0;--n)i[n]=fe(o-=ee,i[n+1]).grav;for(n=ne-2;n>0;--n){const t=n/(ne-1);e[n].r=e[n].r.mul(1-t).add(i[n].r.mul(t)),e[n].v=e[n].v.mul(1-t).add(i[n].v.mul(t)),e[n].a=e[n].a.mul(1-t).add(i[n].a.mul(t))}}return t[r]}(me,t.tt);if(o){const e=pe((t.tt-o[0].tt)/ee,ne-1),i=o[e],a=o[e+1],s=i.a.mean(a.a),c=he(t.tt-i.tt,i.r,i.v,s),u=de(t.tt-i.tt,i.v,s),l=he(t.tt-a.tt,a.r,a.v,s),h=de(t.tt-a.tt,a.v,s),d=(t.tt-i.tt)/ee;n=c.mul(1-d).add(l.mul(d)),r=u.mul(1-d).add(h.mul(d))}else{let e;e=t.tt<re[0][0]?ve(re[0],t.tt,-ee):ve(re[Xt-1],t.tt,+ee),n=e.grav.r,r=e.grav.v,i=e.bary}return e&&(i||(i=new ce(t.tt)),n=n.sub(i.Sun.r),r=r.sub(i.Sun.v)),new wt(n.x,n.y,n.z,r.x,r.y,r.z,t)}const be=new Dt([[.999432765338654,-.0336771074697641,0],[.0303959428906285,.902057912352809,.430543388542295],[-.0144994559663353,-.430299169409101,.902569881273754]]),_e=[{mu:2.82489428433814e-7,al:[1.446213296021224,3.5515522861824],a:[[.0028210960212903,0,0]],l:[[-.0001925258348666,4.9369589722645,.01358483658305],[-970803596076e-16,4.3188796477322,.01303413843243],[-8988174165e-14,1.9080016428617,.00305064867158],[-553101050262e-16,1.4936156681569,.01293892891155]],z:[[.0041510849668155,4.089939635545,-.01290686414666],[.0006260521444113,1.446188898627,3.5515522949802],[352747346169e-16,2.1256287034578,.00012727416567]],zeta:[[.0003142172466014,2.7964219722923,-.002315096098],[904169207946e-16,1.0477061879627,-.00056920638196]]},{mu:2.82483274392893e-7,al:[-.3735263437471362,1.76932271112347],a:[[.0044871037804314,0,0],[4.324367498e-7,1.819645606291,1.7822295777568]],l:[[.0008576433172936,4.3188693178264,.01303413830805],[.0004549582875086,1.4936531751079,.01293892881962],[.0003248939825174,1.8196494533458,1.7822295777568],[-.0003074250079334,4.9377037005911,.01358483286724],[.0001982386144784,1.907986905476,.00305101212869],[.0001834063551804,2.1402853388529,.00145009789338],[-.0001434383188452,5.622214036663,.89111478887838],[-771939140944e-16,4.300272437235,2.6733443704266]],z:[[-.0093589104136341,4.0899396509039,-.01290686414666],[.0002988994545555,5.9097265185595,1.7693227079462],[.000213903639035,2.1256289300016,.00012727418407],[.0001980963564781,2.743516829265,.00067797343009],[.0001210388158965,5.5839943711203,320566149e-13],[837042048393e-16,1.6094538368039,-.90402165808846],[823525166369e-16,1.4461887708689,3.5515522949802]],zeta:[[.0040404917832303,1.0477063169425,-.0005692064054],[.0002200421034564,3.3368857864364,-.00012491307307],[.0001662544744719,2.4134862374711,0],[590282470983e-16,5.9719930968366,-3056160225e-14]]},{mu:2.82498184184723e-7,al:[.2874089391143348,.878207923589328],a:[[.0071566594572575,0,0],[1393029911e-15,1.1586745884981,2.6733443704266]],l:[[.0002310797886226,2.1402987195942,.00145009784384],[-.0001828635964118,4.3188672736968,.01303413828263],[.0001512378778204,4.9373102372298,.01358483481252],[-.0001163720969778,4.300265986149,2.6733443704266],[-955478069846e-16,1.4936612842567,.01293892879857],[815246854464e-16,5.6222137132535,.89111478887838],[-801219679602e-16,1.2995922951532,1.0034433456729],[-607017260182e-16,.64978769669238,.50172167043264]],z:[[.0014289811307319,2.1256295942739,.00012727413029],[.000771093122676,5.5836330003496,320643411e-13],[.0005925911780766,4.0899396636448,-.01290686414666],[.0002045597496146,5.2713683670372,-.12523544076106],[.0001785118648258,.28743156721063,.8782079244252],[.0001131999784893,1.4462127277818,3.5515522949802],[-65877816921e-15,2.2702423990985,-1.7951364394537],[497058888328e-16,5.9096792204858,1.7693227129285]],zeta:[[.0015932721570848,3.3368862796665,-.00012491307058],[.0008533093128905,2.4133881688166,0],[.0003513347911037,5.9720789850127,-3056101771e-14],[-.0001441929255483,1.0477061764435,-.00056920632124]]},{mu:2.82492144889909e-7,al:[-.3620341291375704,.376486233433828],a:[[.0125879701715314,0,0],[3595204947e-15,.64965776007116,.50172168165034],[27580210652e-16,1.808423578151,3.1750660413359]],l:[[.0005586040123824,2.1404207189815,.00145009793231],[-.0003805813868176,2.7358844897853,2972965062e-14],[.0002205152863262,.649796525964,.5017216724358],[.0001877895151158,1.8084787604005,3.1750660413359],[766916975242e-16,6.2720114319755,1.3928364636651],[747056855106e-16,1.2995916202344,1.0034433456729]],z:[[.0073755808467977,5.5836071576084,3206509914e-14],[.0002065924169942,5.9209831565786,.37648624194703],[.0001589869764021,.28744006242623,.8782079244252],[-.0001561131605348,2.1257397865089,.00012727441285],[.0001486043380971,1.4462134301023,3.5515522949802],[635073108731e-16,5.9096803285954,1.7693227129285],[599351698525e-16,4.1125517584798,-2.7985797954589],[540660842731e-16,5.5390350845569,.00286834082283],[-489596900866e-16,4.6218149483338,-.62695712529519]],zeta:[[.0038422977898495,2.4133922085557,0],[.0022453891791894,5.9721736773277,-3056125525e-14],[-.0002604479450559,3.3368746306409,-.00012491309972],[33211214323e-15,5.5604137742337,.00290037688507]]}];class Me{constructor(t,e,n,r){this.io=t,this.europa=e,this.ganymede=n,this.callisto=r}}function we(t,e){const n=t.tt+18262.5,r=[0,e.al[0]+n*e.al[1],0,0,0,0];for(let[t,i,o]of e.a)r[0]+=t*Math.cos(i+n*o);for(let[t,i,o]of e.l)r[1]+=t*Math.sin(i+n*o);r[1]%=i,r[1]<0&&(r[1]+=i);for(let[t,i,o]of e.z){const e=i+n*o;r[2]+=t*Math.cos(e),r[3]+=t*Math.sin(e)}for(let[t,i,o]of e.zeta){const e=i+n*o;r[4]+=t*Math.cos(e),r[5]+=t*Math.sin(e)}const o=function(t,e,n){const r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],c=n[5],u=Math.sqrt(e/(r*r*r));let l,h,d,f=i+o*Math.sin(i)-a*Math.cos(i);do{l=Math.cos(f),h=Math.sin(f),d=(i-f+o*h-a*l)/(1-o*l-a*h),f+=d}while(Math.abs(d)>=1e-12);l=Math.cos(f),h=Math.sin(f);const m=a*l-o*h,p=-o*l-a*h,g=1/(1+p),v=1/(1+Math.sqrt(1-o*o-a*a)),y=r*(l-o-v*a*m),b=r*(h-a+v*o*m),_=u*g*r*(-h-v*a*p),M=u*g*r*(+l+v*o*p),w=2*Math.sqrt(1-s*s-c*c),A=1-2*c*c,E=1-2*s*s,D=2*c*s;return new wt(y*A+b*D,y*D+b*E,(s*b-y*c)*w,_*A+M*D,_*D+M*E,(s*M-_*c)*w,t)}(t,e.mu,r);return vn(be,o)}function Ae(t,e){var n=et(e);if(t in W)return Wt(W[t],n);if(t===F.Pluto){const t=ye(n,!0);return new Mt(t.x,t.y,t.z,n)}if(t===F.Sun)return new Mt(0,0,0,n);if(t===F.Moon){var r=Wt(W.Earth,n),i=Ut(n);return new Mt(r.x+i.x,r.y+i.y,r.z+i.z,n)}if(t===F.EMB){const t=Wt(W.Earth,n),e=Ut(n),r=1+x;return new Mt(t.x+e.x/r,t.y+e.y/r,t.z+e.z/r,n)}if(t===F.SSB)return function(t){const e=new Mt(0,0,0,t);return Zt(e,t,F.Jupiter,P),Zt(e,t,F.Saturn,O),Zt(e,t,F.Uranus,I),Zt(e,t,F.Neptune,N),e}(n);const o=q(t);if(o)return ln(new At(o.dec,15*o.ra,o.dist),n);throw`HelioVector: Unknown body "${t}"`}function Ee(t,e){const n=q(t);if(n)return n.dist;const r=et(e);return t in W?Ht(W[t][qt],r.tt/Vt,!1):Ae(t,r).Length()}function De(t,n){let r=n,i=0;for(let o=0;o<10;++o){const o=t(r),a=o.Length()/e.C_AUDAY;if(a>1)throw"Object is too distant for light-travel solver.";const s=n.AddDays(-a);if(i=Math.abs(s.tt-r.tt),i<1e-9)return o;r=s}throw`Light-travel time solver did not converge: dt = ${i}`}e.JupiterMoonsInfo=Me,e.JupiterMoons=function(t){const e=new tt(t);return new Me(we(e,_e[0]),we(e,_e[1]),we(e,_e[2]),we(e,_e[3]))},e.HelioVector=Ae,e.HelioDistance=Ee,e.CorrectLightTravel=De;class Se{constructor(t,e,n,r){this.observerBody=t,this.targetBody=e,this.aberration=n,this.observerPos=r}Position(t){this.aberration&&(this.observerPos=Ae(this.observerBody,t));const e=Ae(this.targetBody,t);return new Mt(e.x-this.observerPos.x,e.y-this.observerPos.y,e.z-this.observerPos.z,t)}}function xe(t,n,r,i){G(i);const o=et(t);if(q(r)){const t=Ae(r,o);if(i){const r=ke(n,o),i=new Mt(t.x-r.x,t.y-r.y,t.z-r.z,o),a=e.C_AUDAY/i.Length();return new Mt(i.x+r.vx/a,i.y+r.vy/a,i.z+r.vz/a,o)}const a=Ae(n,o);return new Mt(t.x-a.x,t.y-a.y,t.z-a.z,o)}let a;a=i?new Mt(0,0,0,o):Ae(n,o);const s=new Se(n,r,i,a);return De((t=>s.Position(t)),o)}function Re(t,e,n){G(n);const r=et(e);switch(t){case F.Earth:return new Mt(0,0,0,r);case F.Moon:return Ut(r);default:const e=xe(r,F.Earth,t,n);return e.t=r,e}}function $e(t,e){return new wt(t.r.x,t.r.y,t.r.z,t.v.x,t.v.y,t.v.z,e)}function ke(t,e){const n=et(e);switch(t){case F.Sun:return new wt(0,0,0,0,0,0,n);case F.SSB:const e=new ce(n.tt);return new wt(-e.Sun.r.x,-e.Sun.r.y,-e.Sun.r.z,-e.Sun.v.x,-e.Sun.v.y,-e.Sun.v.z,n);case F.Mercury:case F.Venus:case F.Earth:case F.Mars:case F.Jupiter:case F.Saturn:case F.Uranus:case F.Neptune:return $e(Yt(W[t],n.tt),n);case F.Pluto:return ye(n,!0);case F.Moon:case F.EMB:const r=Yt(W.Earth,n.tt),i=t==F.Moon?Lt(n):jt(n);return new wt(i.x+r.r.x,i.y+r.r.y,i.z+r.r.z,i.vx+r.v.x,i.vy+r.v.y,i.vz+r.v.z,n);default:if(q(t)){const e=Ae(t,n);return new wt(e.x,e.y,e.z,0,0,0,n)}throw`HelioState: Unsupported body "${t}"`}}function Ce(t,e,n,r,i){let o,a=(i+n)/2-r,s=(i-n)/2;if(0==a){if(0==s)return null;if(o=-r/s,o<-1||o>1)return null}else{let t=s*s-4*a*r;if(t<=0)return null;let e=Math.sqrt(t),n=(-s+e)/(2*a),i=(-s-e)/(2*a);if(-1<=n&&n<=1){if(-1<=i&&i<=1)return null;o=n}else{if(!(-1<=i&&i<=1))return null;o=i}}return{t:t+o*e,df_dt:(2*a*o+s)/e}}function ze(t,e,n,r){const i=L(r&&r.dt_tolerance_seconds||1),o=Math.abs(i/d);let a=r&&r.init_f1||t(e),s=r&&r.init_f2||t(n),c=NaN,u=0,l=r&&r.iter_limit||20,h=!0;for(;;){if(++u>l)throw"Excessive iteration in Search()";let r=(m=n,.5,new tt((f=e).ut+.5*(m.ut-f.ut))),i=r.ut-e.ut;if(Math.abs(i)<o)return r;h?c=t(r):h=!0;let d=Ce(r.ut,n.ut-r.ut,a,c,s);if(d){let r=et(d.t),u=t(r);if(0!==d.df_dt){if(Math.abs(u/d.df_dt)<o)return r;let l=1.2*Math.abs(u/d.df_dt);if(l<i/10){let i=r.AddDays(-l),o=r.AddDays(+l);if((i.ut-e.ut)*(i.ut-n.ut)<0&&(o.ut-e.ut)*(o.ut-n.ut)<0){let r=t(i),l=t(o);if(r<0&&l>=0){a=r,s=l,e=i,n=o,c=u,h=!1;continue}}}}}if(a<0&&c>=0)n=r,s=c;else{if(!(c<0&&s>=0))return null;e=r,a=c}}var f,m}function Pe(t){let e=t;for(;e<=-180;)e+=360;for(;e>180;)e-=360;return e}function Oe(t){for(;t<0;)t+=360;for(;t>=360;)t-=360;return t}function Ie(t,e,n){L(t),L(n);let r=et(e),i=r.AddDays(n);return ze((function(e){return Pe(Ot(e).elon-t)}),r,i,{dt_tolerance_seconds:.01})}function Ne(t,e,n){if(t===F.Earth||e===F.Earth)throw"The Earth does not have a longitude as seen from itself.";const r=et(n),i=Tt(Re(t,r,!1)),o=Tt(Re(e,r,!1));return Oe(i.elon-o.elon)}function Te(t,e){if(t==F.Earth)throw"The Earth does not have an angle as seen from itself.";const n=et(e);return H(Re(F.Sun,n,!0),Re(t,n,!0))}function Ue(t,e){if(t===F.Sun)throw"Cannot calculate heliocentric longitude of the Sun.";return Tt(Ae(t,e)).elon}e.BackdatePosition=xe,e.GeoVector=Re,e.BaryState=function(t,e){const n=et(e);if(t===F.SSB)return new wt(0,0,0,0,0,0,n);if(t===F.Pluto)return ye(n,!1);const r=new ce(n.tt);switch(t){case F.Sun:return $e(r.Sun,n);case F.Jupiter:return $e(r.Jupiter,n);case F.Saturn:return $e(r.Saturn,n);case F.Uranus:return $e(r.Uranus,n);case F.Neptune:return $e(r.Neptune,n);case F.Moon:case F.EMB:const e=Yt(W[F.Earth],n.tt),i=t===F.Moon?Lt(n):jt(n);return new wt(i.x+r.Sun.r.x+e.r.x,i.y+r.Sun.r.y+e.r.y,i.z+r.Sun.r.z+e.r.z,i.vx+r.Sun.v.x+e.v.x,i.vy+r.Sun.v.y+e.v.y,i.vz+r.Sun.v.z+e.v.z,n)}if(t in W){const e=Yt(W[t],n.tt);return new wt(r.Sun.r.x+e.r.x,r.Sun.r.y+e.r.y,r.Sun.r.z+e.r.z,r.Sun.v.x+e.v.x,r.Sun.v.y+e.v.y,r.Sun.v.z+e.v.z,n)}throw`BaryState: Unsupported body "${t}"`},e.HelioState=ke,e.Search=ze,e.SearchSunLongitude=Ie,e.PairLongitude=Ne,e.AngleFromSun=Te,e.EclipticLongitude=Ue;class Ge{constructor(t,n,r,i,o,a,s,c){this.time=t,this.mag=n,this.phase_angle=r,this.helio_dist=i,this.geo_dist=o,this.gc=a,this.hc=s,this.ring_tilt=c,this.phase_fraction=(1+Math.cos(e.DEG2RAD*r))/2}}function Le(t,n){if(t===F.Earth)throw"The illumination of the Earth is not defined.";const r=et(n),i=Wt(W.Earth,r);let o,a,s,c;t===F.Sun?(s=new Mt(-i.x,-i.y,-i.z,r),a=new Mt(0,0,0,r),o=0):(t===F.Moon?(s=Ut(r),a=new Mt(i.x+s.x,i.y+s.y,i.z+s.z,r)):(a=Ae(t,n),s=new Mt(a.x-i.x,a.y-i.y,a.z-i.z,r)),o=H(s,a));let u,h=s.Length(),d=a.Length();if(t===F.Sun)c=l+5*Math.log10(h);else if(t===F.Moon)c=function(t,n,r){let i=t*e.DEG2RAD,o=i*i,a=o*o,s=1.49*Math.abs(i)-12.717+.0431*a,c=r/(385000.6/e.KM_PER_AU);return s+=5*Math.log10(n*c),s}(o,d,h);else if(t===F.Saturn){const t=function(t,n,r,i,o){const a=Tt(i),s=28.06*e.DEG2RAD,c=e.DEG2RAD*(169.51+382e-7*o.tt),u=e.DEG2RAD*a.elat,l=e.DEG2RAD*a.elon,h=Math.asin(Math.sin(u)*Math.cos(s)-Math.cos(u)*Math.sin(s)*Math.sin(l-c)),d=Math.sin(Math.abs(h));let f=.044*t-9;return f+=d*(1.2*d-2.6),f+=5*Math.log10(n*r),{mag:f,ring_tilt:e.RAD2DEG*h}}(o,d,h,s,r);c=t.mag,u=t.ring_tilt}else c=function(t,e,n,r){let i,o=0,a=0,s=0;switch(t){case F.Mercury:i=-.6,o=4.98,a=-4.88,s=3.02;break;case F.Venus:e<163.6?(i=-4.47,o=1.03,a=.57,s=.13):(i=.98,o=-1.02);break;case F.Mars:i=-1.52,o=1.6;break;case F.Jupiter:i=-9.4,o=.5;break;case F.Uranus:i=-7.19,o=.25;break;case F.Neptune:i=-6.87;break;case F.Pluto:i=-1,o=4;break;default:throw`VisualMagnitude: unsupported body ${t}`}const c=e/100;let u=i+c*(o+c*(a+c*s));return u+=5*Math.log10(n*r),u}(t,o,d,h);return new Ge(r,c,o,d,h,s,a,u)}function je(t){if(t===F.Earth)throw"The Earth does not have a synodic period as seen from itself.";if(t===F.Moon)return h;let e=Q[t];if(!e)throw`Not a valid planet name: ${t}`;const n=Q.Earth.OrbitalPeriod,r=e.OrbitalPeriod;return Math.abs(n/(n/r-1))}function He(t,e,n){L(e);const r=Q[t];if(!r)throw`Cannot search relative longitude because body is not a planet: ${t}`;if(t===F.Earth)throw"Cannot search relative longitude for the Earth (it is always 0)";const i=r.OrbitalPeriod>Q.Earth.OrbitalPeriod?1:-1;function o(n){const r=Ue(t,n),o=Ue(F.Earth,n);return Pe(i*(o-r)-e)}let a=je(t),s=et(n),c=o(s);c>0&&(c-=360);for(let t=0;t<100;++t){let t=-c/360*a;if(s=s.AddDays(t),Math.abs(t)*d<1)return s;let e=c;if(c=o(s),Math.abs(e)<30&&e!==c){let t=e/(e-c);t>.5&&t<2&&(a*=t)}}throw`Relative longitude search failed to converge for ${t} near ${s.toString()} (error_angle = ${c}).`}function Fe(t){return Ne(F.Moon,F.Sun,t)}function Ve(t,e,n){function r(e){return Pe(Fe(e)-t)}L(t),L(n);const i=1.5,o=et(e);let a,s,c,u=r(o);if(n<0){if(u<0&&(u+=360),a=-h*u/360,c=a+i,c<n)return null;s=Math.max(n,a-i)}else{if(u>0&&(u-=360),a=-h*u/360,s=a-i,s>n)return null;c=Math.min(n,a+i)}return ze(r,o.AddDays(s),o.AddDays(c),{dt_tolerance_seconds:.1})}e.IlluminationInfo=Ge,e.Illumination=Le,e.SearchRelativeLongitude=He,e.MoonPhase=Fe,e.SearchMoonPhase=Ve;class Be{constructor(t,e){this.quarter=t,this.time=e}}function Je(t){let e=Fe(t),n=(Math.floor(e/90)+1)%4,r=Ve(90*n,t,10);if(!r)throw"Cannot find moon quarter";return new Be(n,r)}e.MoonQuarter=Be,e.SearchMoonQuarter=Je,e.NextMoonQuarter=function(t){return Je(new Date(t.time.date.getTime()+6*f))};class qe{constructor(t,e,n){this.pressure=t,this.temperature=e,this.density=n}}function Ke(t){const e=101325,n=288.15,r=216.65;if(!Number.isFinite(t)||t<-500||t>1e5)throw`Invalid elevation: ${t}`;let i,o;return t<=11e3?(i=n-.0065*t,o=e*Math.pow(n/i,-5.25577)):t<=2e4?(i=r,o=22632*Math.exp(-.00015768832*(t-11e3))):(i=r+.001*(t-2e4),o=5474.87*Math.pow(r/i,34.16319)),new qe(o,i,o/i/(e/n))}e.AtmosphereInfo=qe,e.Atmosphere=Ke,e.SearchRiseSet=function(t,n,r,i,o,a=0){if(!Number.isFinite(a)||a<0)throw`Invalid value for metersAboveGround: ${a}`;const s=function(t){switch(t){case F.Sun:return g;case F.Moon:return A;default:return 0}}(t),c=Ke(n.height-a),u=function(t,n){const r=t.latitude*e.DEG2RAD,i=Math.sin(r),o=Math.cos(r),a=1/Math.hypot(o,i*v),s=a*(v*v),c=(t.height-n)/1e3,u=b*a+c,l=b*s+c,h=1e3*Math.hypot(u*o,l*i),d=.175*Math.pow(1-.0065/283.15*(t.height-2/3*n),3.256);return e.RAD2DEG*(-Math.sqrt(2*(1-d)*n/h)/(1-d))}(n,a);return Ye(t,n,r,i,o,s,u-.5666666666666667*c.density)},e.SearchAltitude=function(t,e,n,r,i,o){if(!Number.isFinite(o)||o<-90||o>90)throw`Invalid altitude angle: ${o}`;return Ye(t,e,n,r,i,0,o)};class Qe{constructor(t,e,n,r){this.tx=t,this.ty=e,this.ax=n,this.ay=r}}function We(t,e,n,r,i,o,a){if(o<0&&a>=0)return new Qe(r,i,o,a);if(o>=0&&a<0)return null;if(t>17)throw"Excessive recursion in rise/set ascent search.";const s=i.ut-r.ut;if(s*d<1)return null;if(Math.min(Math.abs(o),Math.abs(a))>n*(s/2))return null;const c=new tt((r.ut+i.ut)/2),u=e(c);return We(1+t,e,n,r,c,o,u)||We(1+t,e,n,c,i,u,a)}function Ye(t,n,r,i,o,a,s){if(zt(n),L(o),L(a),L(s),s<-90||s>90)throw`Invalid target altitude angle: ${s}`;const c=function(t,n){if(n<-90||n>90)throw`Invalid geographic latitude: ${n}`;let r,i;switch(t){case F.Moon:r=4.5,i=8.2;break;case F.Sun:r=.8,i=.5;break;case F.Mercury:r=-1.6,i=1;break;case F.Venus:r=-.8,i=.6;break;case F.Mars:r=-.5,i=.4;break;case F.Jupiter:case F.Saturn:case F.Uranus:case F.Neptune:case F.Pluto:r=-.2,i=.2;break;case F.Star1:case F.Star2:case F.Star3:case F.Star4:case F.Star5:case F.Star6:case F.Star7:case F.Star8:r=-.008,i=.008;break;default:throw`Body not allowed for altitude search: ${t}`}const o=e.DEG2RAD*n;return Math.abs((360/m-r)*Math.cos(o))+Math.abs(i*Math.sin(o))}(t,n.latitude);function u(i){const o=It(t,i,n,!0,!0),c=Ct(i,n,o.ra,o.dec).altitude+e.RAD2DEG*Math.asin(a/o.dist);return r*(c-s)}const l=et(i);let h=l,d=l,f=u(h),p=f;for(;;){o<0?(h=d.AddDays(-.42),f=u(h)):(d=h.AddDays(.42),p=u(d));const t=We(0,u,c,h,d,f,p);if(t){const e=ze(u,t.tx,t.ty,{dt_tolerance_seconds:.1,init_f1:t.ax,init_f2:t.ay});if(e){if(o<0){if(e.ut<l.ut+o)return null}else if(e.ut>l.ut+o)return null;return e}throw`Rise/set search failed after finding ascent: t1=${h}, t2=${d}, a1=${f}, a2=${p}`}if(o<0){if(h.ut<l.ut+o)return null;d=h,p=f}else{if(d.ut>l.ut+o)return null;h=d,f=p}}}class Ze{constructor(t,e){this.time=t,this.hor=e}}e.HourAngleEvent=Ze,e.SearchHourAngle=function(t,e,n,r,i=1){zt(e);let o=et(r),a=0;if(t===F.Earth)throw"Cannot search for hour angle of the Earth.";if(L(n),n<0||n>=24)throw`Invalid hour angle ${n}`;if(L(i),0===i)throw"Direction must be positive or negative.";for(;;){++a;let r=ft(o),s=It(t,o,e,!0,!0),c=(n+s.ra-e.longitude/15-r)%24;if(1===a?i>0?c<0&&(c+=24):c>0&&(c-=24):c<-12?c+=24:c>12&&(c-=24),3600*Math.abs(c)<.1){const t=Ct(o,e,s.ra,s.dec,"normal");return new Ze(o,t)}let u=c/24*m;o=o.AddDays(u)}},e.HourAngle=function(t,e,n){const r=et(e),i=mt(r),o=It(t,r,n,!0,!0);let a=(n.longitude/15+i-o.ra)%24;return a<0&&(a+=24),a};class Xe{constructor(t,e,n,r){this.mar_equinox=t,this.jun_solstice=e,this.sep_equinox=n,this.dec_solstice=r}}e.SeasonInfo=Xe,e.Seasons=function(t){function e(e,n,r){let i=new Date(Date.UTC(t,n-1,r)),o=Ie(e,i,20);if(!o)throw`Cannot find season change near ${i.toISOString()}`;return o}if(t instanceof Date&&Number.isFinite(t.getTime())&&(t=t.getUTCFullYear()),!Number.isSafeInteger(t))throw`Cannot calculate seasons because year argument ${t} is neither a Date nor a safe integer.`;let n=e(0,3,10),r=e(90,6,10),i=e(180,9,10),o=e(270,12,10);return new Xe(n,r,i,o)};class tn{constructor(t,e,n,r){this.time=t,this.visibility=e,this.elongation=n,this.ecliptic_separation=r}}function en(t,e){let n,r=et(e),i=Ne(t,F.Sun,r);i>180?(n="morning",i=360-i):n="evening";let o=Te(t,r);return new tn(r,n,o,i)}var nn;e.ElongationEvent=tn,e.Elongation=en,e.SearchMaxElongation=function(t,e){function n(e){const n=e.AddDays(-.005),r=e.AddDays(.005);return(Te(t,n)-Te(t,r))/.01}let r=et(e);const i={Mercury:{s1:50,s2:85},Venus:{s1:40,s2:50}}[t];if(!i)throw"SearchMaxElongation works for Mercury and Venus only.";let o=0;for(;++o<=2;){let e,a,s,c=Pe(Ue(t,r)-Ue(F.Earth,r));c>=-i.s1&&c<+i.s1?(s=0,e=+i.s1,a=+i.s2):c>=+i.s2||c<-i.s2?(s=0,e=-i.s2,a=-i.s1):c>=0?(s=-je(t)/4,e=+i.s1,a=+i.s2):(s=-je(t)/4,e=-i.s2,a=-i.s1);let u=r.AddDays(s),l=He(t,e,u),h=He(t,a,l),d=n(l);if(d>=0)throw`SearchMaxElongation: internal error: m1 = ${d}`;let f=n(h);if(f<=0)throw`SearchMaxElongation: internal error: m2 = ${f}`;let m=ze(n,l,h,{init_f1:d,init_f2:f,dt_tolerance_seconds:10});if(!m)throw`SearchMaxElongation: failed search iter ${o} (t1=${l.toString()}, t2=${h.toString()})`;if(m.tt>=r.tt)return en(t,m);r=h.AddDays(1)}throw"SearchMaxElongation: failed to find event after 2 tries."},e.SearchPeakMagnitude=function(t,e){if(t!==F.Venus)throw"SearchPeakMagnitude currently works for Venus only.";function n(e){const n=e.AddDays(-.005),r=e.AddDays(.005),i=Le(t,n).mag;return(Le(t,r).mag-i)/.01}let r=et(e),i=0;for(;++i<=2;){let e,o,a,s=Pe(Ue(t,r)-Ue(F.Earth,r));s>=-10&&s<10?(a=0,e=10,o=30):s>=30||s<-30?(a=0,e=-30,o=-10):s>=0?(a=-je(t)/4,e=10,o=30):(a=-je(t)/4,e=-30,o=-10);let c=r.AddDays(a),u=He(t,e,c),l=He(t,o,u),h=n(u);if(h>=0)throw`SearchPeakMagnitude: internal error: m1 = ${h}`;let d=n(l);if(d<=0)throw`SearchPeakMagnitude: internal error: m2 = ${d}`;let f=ze(n,u,l,{init_f1:h,init_f2:d,dt_tolerance_seconds:10});if(!f)throw`SearchPeakMagnitude: failed search iter ${i} (t1=${u.toString()}, t2=${l.toString()})`;if(f.tt>=r.tt)return Le(t,f);r=l.AddDays(1)}throw"SearchPeakMagnitude: failed to find event after 2 tries."},function(t){t[t.Pericenter=0]="Pericenter",t[t.Apocenter=1]="Apocenter"}(nn=e.ApsisKind||(e.ApsisKind={}));class rn{constructor(t,n,r){this.time=t,this.kind=n,this.dist_au=r,this.dist_km=r*e.KM_PER_AU}}function on(t){const e=.001;function n(t){let n=t.AddDays(-e/2),r=t.AddDays(+e/2),i=at(n).distance_au;return(at(r).distance_au-i)/e}function r(t){return-n(t)}let i=et(t),o=n(i);for(var a=0;5*a<2*h;++a){let t=i.AddDays(5),e=n(t);if(o*e<=0){if(o<0||e>0){let r=ze(n,i,t,{init_f1:o,init_f2:e});if(!r)throw"SearchLunarApsis INTERNAL ERROR: perigee search failed!";let a=at(r).distance_au;return new rn(r,0,a)}if(o>0||e<0){let n=ze(r,i,t,{init_f1:-o,init_f2:-e});if(!n)throw"SearchLunarApsis INTERNAL ERROR: apogee search failed!";let a=at(n).distance_au;return new rn(n,1,a)}throw"SearchLunarApsis INTERNAL ERROR: cannot classify apsis event!"}i=t,o=e}throw"SearchLunarApsis INTERNAL ERROR: could not find apsis within 2 synodic months of start date."}function an(t,e,n,r){const i=e===nn.Apocenter?1:-1;for(;;){const o=r/9;if(o<1/1440){const r=n.AddDays(o/2),i=Ee(t,r);return new rn(r,e,i)}let a=-1,s=0;for(let e=0;e<10;++e){const r=i*Ee(t,n.AddDays(e*o));(0==e||r>s)&&(a=e,s=r)}n=n.AddDays((a-1)*o),r=2*o}}function sn(t,e){if(e=et(e),t===F.Neptune||t===F.Pluto)return function(t,e){const n=e.AddDays(Q[t].OrbitalPeriod*(-30/360));let r=n,i=n,o=-1,a=-1;const s=(e.AddDays(.75*Q[t].OrbitalPeriod).ut-n.ut)/99;for(let e=0;e<100;++e){const c=n.AddDays(e*s),u=Ee(t,c);0===e?a=o=u:(u>a&&(a=u,i=c),u<o&&(o=u,r=c))}const c=an(t,0,r.AddDays(-2*s),4*s),u=an(t,1,i.AddDays(-2*s),4*s);if(c.time.tt>=e.tt)return u.time.tt>=e.tt&&u.time.tt<c.time.tt?u:c;if(u.time.tt>=e.tt)return u;throw"Internal error: failed to find Neptune apsis."}(t,e);function n(e){const n=.001;let r=e.AddDays(-n/2),i=e.AddDays(+n/2),o=Ee(t,r);return(Ee(t,i)-o)/n}function r(t){return-n(t)}const i=Q[t].OrbitalPeriod,o=i/6;let a=e,s=n(a);for(let e=0;e*o<2*i;++e){const e=a.AddDays(o),i=n(e);if(s*i<=0){let o,c;if(s<0||i>0)o=n,c=nn.Pericenter;else{if(!(s>0||i<0))throw"Internal error with slopes in SearchPlanetApsis";o=r,c=nn.Apocenter}const u=ze(o,a,e);if(!u)throw"Failed to find slope transition in planetary apsis search.";const l=Ee(t,u);return new rn(u,c,l)}a=e,s=i}throw"Internal error: should have found planetary apsis within 2 orbital periods."}function cn(t){return new Dt([[t.rot[0][0],t.rot[1][0],t.rot[2][0]],[t.rot[0][1],t.rot[1][1],t.rot[2][1]],[t.rot[0][2],t.rot[1][2],t.rot[2][2]]])}function un(t,e){return new Dt([[e.rot[0][0]*t.rot[0][0]+e.rot[1][0]*t.rot[0][1]+e.rot[2][0]*t.rot[0][2],e.rot[0][1]*t.rot[0][0]+e.rot[1][1]*t.rot[0][1]+e.rot[2][1]*t.rot[0][2],e.rot[0][2]*t.rot[0][0]+e.rot[1][2]*t.rot[0][1]+e.rot[2][2]*t.rot[0][2]],[e.rot[0][0]*t.rot[1][0]+e.rot[1][0]*t.rot[1][1]+e.rot[2][0]*t.rot[1][2],e.rot[0][1]*t.rot[1][0]+e.rot[1][1]*t.rot[1][1]+e.rot[2][1]*t.rot[1][2],e.rot[0][2]*t.rot[1][0]+e.rot[1][2]*t.rot[1][1]+e.rot[2][2]*t.rot[1][2]],[e.rot[0][0]*t.rot[2][0]+e.rot[1][0]*t.rot[2][1]+e.rot[2][0]*t.rot[2][2],e.rot[0][1]*t.rot[2][0]+e.rot[1][1]*t.rot[2][1]+e.rot[2][1]*t.rot[2][2],e.rot[0][2]*t.rot[2][0]+e.rot[1][2]*t.rot[2][1]+e.rot[2][2]*t.rot[2][2]]])}function ln(t,n){n=et(n);const r=t.lat*e.DEG2RAD,i=t.lon*e.DEG2RAD,o=t.dist*Math.cos(r);return new Mt(o*Math.cos(i),o*Math.sin(i),t.dist*Math.sin(r),n)}function hn(t){const e=dn(t);return new Et(e.lon/15,e.lat,e.dist,t)}function dn(t){const n=t.x*t.x+t.y*t.y,r=Math.sqrt(n+t.z*t.z);let i,o;if(0===n){if(0===t.z)throw"Zero-length vector not allowed.";o=0,i=t.z<0?-90:90}else o=e.RAD2DEG*Math.atan2(t.y,t.x),o<0&&(o+=360),i=e.RAD2DEG*Math.atan2(t.z,Math.sqrt(n));return new At(i,o,r)}function fn(t){return(t=360-t)>=360?t-=360:t<0&&(t+=360),t}function mn(t,n){let r;if(L(n),n<-90||n>90)return 0;if("normal"===t||"jplhor"===t){let i=n;i<-1&&(i=-1),r=1.02/Math.tan((i+10.3/(i+5.11))*e.DEG2RAD)/60,"normal"===t&&n<-1&&(r*=(n+90)/89)}else{if(t)throw`Invalid refraction option: ${t}`;r=0}return r}function pn(t,e){if(e<-90||e>90)return 0;let n=e-mn(t,e);for(;;){let r=n+mn(t,n)-e;if(Math.abs(r)<1e-14)return n-e;n-=r}}function gn(t,e){return new Mt(t.rot[0][0]*e.x+t.rot[1][0]*e.y+t.rot[2][0]*e.z,t.rot[0][1]*e.x+t.rot[1][1]*e.y+t.rot[2][1]*e.z,t.rot[0][2]*e.x+t.rot[1][2]*e.y+t.rot[2][2]*e.z,e.t)}function vn(t,e){return new wt(t.rot[0][0]*e.x+t.rot[1][0]*e.y+t.rot[2][0]*e.z,t.rot[0][1]*e.x+t.rot[1][1]*e.y+t.rot[2][1]*e.z,t.rot[0][2]*e.x+t.rot[1][2]*e.y+t.rot[2][2]*e.z,t.rot[0][0]*e.vx+t.rot[1][0]*e.vy+t.rot[2][0]*e.vz,t.rot[0][1]*e.vx+t.rot[1][1]*e.vy+t.rot[2][1]*e.vz,t.rot[0][2]*e.vx+t.rot[1][2]*e.vy+t.rot[2][2]*e.vz,e.t)}function yn(){const t=.9174821430670688,e=.3977769691083922;return new Dt([[1,0,0],[0,+t,-e],[0,+e,+t]])}function bn(t){return un(ht(t=et(t),K.From2000),yt(t,K.From2000))}function _n(t){return un(yt(t=et(t),K.Into2000),ht(t,K.Into2000))}function Mn(t,n){t=et(t);const r=Math.sin(n.latitude*e.DEG2RAD),i=Math.cos(n.latitude*e.DEG2RAD),o=Math.sin(n.longitude*e.DEG2RAD),a=Math.cos(n.longitude*e.DEG2RAD),s=[i*a,i*o,r],c=[-r*a,-r*o,i],u=[o,-a,0],l=-15*ft(t),h=kt(l,s),d=kt(l,c),f=kt(l,u);return new Dt([[d[0],f[0],h[0]],[d[1],f[1],h[1]],[d[2],f[2],h[2]]])}function wn(t,e){return cn(Mn(t,e))}function An(t,e){return un(wn(t=et(t),e),_n(t))}function En(t){return un(_n(t),yn())}function Dn(t){return cn(En(t))}function Sn(t,e){return un(Dn(t=et(t)),Mn(t,e))}function xn(t){const n=it(et(t)).tobl*e.DEG2RAD,r=Math.cos(n),i=Math.sin(n);return new Dt([[1,0,0],[0,+r,+i],[0,-i,+r]])}function Rn(t){const n=it(et(t)).tobl*e.DEG2RAD,r=Math.cos(n),i=Math.sin(n);return new Dt([[1,0,0],[0,+r,-i],[0,+i,+r]])}e.Apsis=rn,e.SearchLunarApsis=on,e.NextLunarApsis=function(t){let e=on(t.time.AddDays(11));if(e.kind+t.kind!==1)throw`NextLunarApsis INTERNAL ERROR: did not find alternating apogee/perigee: prev=${t.kind} @ ${t.time.toString()}, next=${e.kind} @ ${e.time.toString()}`;return e},e.SearchPlanetApsis=sn,e.NextPlanetApsis=function(t,e){if(e.kind!==nn.Pericenter&&e.kind!==nn.Apocenter)throw`Invalid apsis kind: ${e.kind}`;const n=.25*Q[t].OrbitalPeriod,r=sn(t,e.time.AddDays(n));if(r.kind+e.kind!==1)throw`Internal error: previous apsis was ${e.kind}, but found ${r.kind} for next apsis.`;return r},e.InverseRotation=cn,e.CombineRotation=un,e.IdentityMatrix=function(){return new Dt([[1,0,0],[0,1,0],[0,0,1]])},e.Pivot=function(t,n,r){if(0!==n&&1!==n&&2!==n)throw`Invalid axis ${n}. Must be [0, 1, 2].`;const i=L(r)*e.DEG2RAD,o=Math.cos(i),a=Math.sin(i),s=(n+1)%3,c=(n+2)%3,u=n;let l=[[0,0,0],[0,0,0],[0,0,0]];return l[s][s]=o*t.rot[s][s]-a*t.rot[s][c],l[s][c]=a*t.rot[s][s]+o*t.rot[s][c],l[s][u]=t.rot[s][u],l[c][s]=o*t.rot[c][s]-a*t.rot[c][c],l[c][c]=a*t.rot[c][s]+o*t.rot[c][c],l[c][u]=t.rot[c][u],l[u][s]=o*t.rot[u][s]-a*t.rot[u][c],l[u][c]=a*t.rot[u][s]+o*t.rot[u][c],l[u][u]=t.rot[u][u],new Dt(l)},e.VectorFromSphere=ln,e.EquatorFromVector=hn,e.SphereFromVector=dn,e.HorizonFromVector=function(t,e){const n=dn(t);return n.lon=fn(n.lon),n.lat+=mn(e,n.lat),n},e.VectorFromHorizon=function(t,e,n){e=et(e);const r=fn(t.lon),i=t.lat+pn(n,t.lat);return ln(new At(i,r,t.dist),e)},e.Refraction=mn,e.InverseRefraction=pn,e.RotateVector=gn,e.RotateState=vn,e.Rotation_EQJ_ECL=yn,e.Rotation_ECL_EQJ=function(){const t=.9174821430670688,e=.3977769691083922;return new Dt([[1,0,0],[0,+t,+e],[0,-e,+t]])},e.Rotation_EQJ_EQD=bn,e.Rotation_EQJ_ECT=function(t){const e=et(t);return un(bn(e),Rn(e))},e.Rotation_ECT_EQJ=function(t){const e=et(t);return un(xn(e),_n(e))},e.Rotation_EQD_EQJ=_n,e.Rotation_EQD_HOR=Mn,e.Rotation_HOR_EQD=wn,e.Rotation_HOR_EQJ=An,e.Rotation_EQJ_HOR=function(t,e){return cn(An(t,e))},e.Rotation_EQD_ECL=En,e.Rotation_ECL_EQD=Dn,e.Rotation_ECL_HOR=Sn,e.Rotation_HOR_ECL=function(t,e){return cn(Sn(t,e))},e.Rotation_EQJ_GAL=function(){return new Dt([[-.0548624779711344,.4941095946388765,-.8676668813529025],[-.8734572784246782,-.4447938112296831,-.1980677870294097],[-.483800052994852,.7470034631630423,.4559861124470794]])},e.Rotation_GAL_EQJ=function(){return new Dt([[-.0548624779711344,-.8734572784246782,-.483800052994852],[.4941095946388765,-.4447938112296831,.7470034631630423],[-.8676668813529025,-.1980677870294097,.4559861124470794]])},e.Rotation_ECT_EQD=xn,e.Rotation_EQD_ECT=Rn;const $n=[["And","Andromeda"],["Ant","Antila"],["Aps","Apus"],["Aql","Aquila"],["Aqr","Aquarius"],["Ara","Ara"],["Ari","Aries"],["Aur","Auriga"],["Boo","Bootes"],["Cae","Caelum"],["Cam","Camelopardis"],["Cap","Capricornus"],["Car","Carina"],["Cas","Cassiopeia"],["Cen","Centaurus"],["Cep","Cepheus"],["Cet","Cetus"],["Cha","Chamaeleon"],["Cir","Circinus"],["CMa","Canis Major"],["CMi","Canis Minor"],["Cnc","Cancer"],["Col","Columba"],["Com","Coma Berenices"],["CrA","Corona Australis"],["CrB","Corona Borealis"],["Crt","Crater"],["Cru","Crux"],["Crv","Corvus"],["CVn","Canes Venatici"],["Cyg","Cygnus"],["Del","Delphinus"],["Dor","Dorado"],["Dra","Draco"],["Equ","Equuleus"],["Eri","Eridanus"],["For","Fornax"],["Gem","Gemini"],["Gru","Grus"],["Her","Hercules"],["Hor","Horologium"],["Hya","Hydra"],["Hyi","Hydrus"],["Ind","Indus"],["Lac","Lacerta"],["Leo","Leo"],["Lep","Lepus"],["Lib","Libra"],["LMi","Leo Minor"],["Lup","Lupus"],["Lyn","Lynx"],["Lyr","Lyra"],["Men","Mensa"],["Mic","Microscopium"],["Mon","Monoceros"],["Mus","Musca"],["Nor","Norma"],["Oct","Octans"],["Oph","Ophiuchus"],["Ori","Orion"],["Pav","Pavo"],["Peg","Pegasus"],["Per","Perseus"],["Phe","Phoenix"],["Pic","Pictor"],["PsA","Pisces Austrinus"],["Psc","Pisces"],["Pup","Puppis"],["Pyx","Pyxis"],["Ret","Reticulum"],["Scl","Sculptor"],["Sco","Scorpius"],["Sct","Scutum"],["Ser","Serpens"],["Sex","Sextans"],["Sge","Sagitta"],["Sgr","Sagittarius"],["Tau","Taurus"],["Tel","Telescopium"],["TrA","Triangulum Australe"],["Tri","Triangulum"],["Tuc","Tucana"],["UMa","Ursa Major"],["UMi","Ursa Minor"],["Vel","Vela"],["Vir","Virgo"],["Vol","Volans"],["Vul","Vulpecula"]],kn=[[83,0,8640,2112],[83,2880,5220,2076],[83,7560,8280,2068],[83,6480,7560,2064],[15,0,2880,2040],[10,3300,3840,1968],[15,0,1800,1920],[10,3840,5220,1920],[83,6300,6480,1920],[33,7260,7560,1920],[15,0,1263,1848],[10,4140,4890,1848],[83,5952,6300,1800],[15,7260,7440,1800],[10,2868,3300,1764],[33,3300,4080,1764],[83,4680,5952,1680],[13,1116,1230,1632],[33,7350,7440,1608],[33,4080,4320,1596],[15,0,120,1584],[83,5040,5640,1584],[15,8490,8640,1584],[33,4320,4860,1536],[33,4860,5190,1512],[15,8340,8490,1512],[10,2196,2520,1488],[33,7200,7350,1476],[15,7393.2,7416,1462],[10,2520,2868,1440],[82,2868,3030,1440],[33,7116,7200,1428],[15,7200,7393.2,1428],[15,8232,8340,1418],[13,0,876,1404],[33,6990,7116,1392],[13,612,687,1380],[13,876,1116,1368],[10,1116,1140,1368],[15,8034,8232,1350],[10,1800,2196,1344],[82,5052,5190,1332],[33,5190,6990,1332],[10,1140,1200,1320],[15,7968,8034,1320],[15,7416,7908,1316],[13,0,612,1296],[50,2196,2340,1296],[82,4350,4860,1272],[33,5490,5670,1272],[15,7908,7968,1266],[10,1200,1800,1260],[13,8232,8400,1260],[33,5670,6120,1236],[62,735,906,1212],[33,6120,6564,1212],[13,0,492,1200],[62,492,600,1200],[50,2340,2448,1200],[13,8400,8640,1200],[82,4860,5052,1164],[13,0,402,1152],[13,8490,8640,1152],[39,6543,6564,1140],[33,6564,6870,1140],[30,6870,6900,1140],[62,600,735,1128],[82,3030,3300,1128],[13,60,312,1104],[82,4320,4350,1080],[50,2448,2652,1068],[30,7887,7908,1056],[30,7875,7887,1050],[30,6900,6984,1044],[82,3300,3660,1008],[82,3660,3882,960],[8,5556,5670,960],[39,5670,5880,960],[50,3330,3450,954],[0,0,906,882],[62,906,924,882],[51,6969,6984,876],[62,1620,1689,864],[30,7824,7875,864],[44,7875,7920,864],[7,2352,2652,852],[50,2652,2790,852],[0,0,720,840],[44,7920,8214,840],[44,8214,8232,828],[0,8232,8460,828],[62,924,978,816],[82,3882,3960,816],[29,4320,4440,816],[50,2790,3330,804],[48,3330,3558,804],[0,258,507,792],[8,5466,5556,792],[0,8460,8550,770],[29,4440,4770,768],[0,8550,8640,752],[29,5025,5052,738],[80,870,978,736],[62,978,1620,736],[7,1620,1710,720],[51,6543,6969,720],[82,3960,4320,696],[30,7080,7530,696],[7,1710,2118,684],[48,3558,3780,684],[29,4770,5025,684],[0,0,24,672],[80,507,600,672],[7,2118,2352,672],[37,2838,2880,672],[30,7530,7824,672],[30,6933,7080,660],[80,690,870,654],[25,5820,5880,648],[8,5430,5466,624],[25,5466,5820,624],[51,6612,6792,624],[48,3870,3960,612],[51,6792,6933,612],[80,600,690,600],[66,258,306,570],[48,3780,3870,564],[87,7650,7710,564],[77,2052,2118,548],[0,24,51,528],[73,5730,5772,528],[37,2118,2238,516],[87,7140,7290,510],[87,6792,6930,506],[0,51,306,504],[87,7290,7404,492],[37,2811,2838,480],[87,7404,7650,468],[87,6930,7140,460],[6,1182,1212,456],[75,6792,6840,444],[59,2052,2076,432],[37,2238,2271,420],[75,6840,7140,388],[77,1788,1920,384],[39,5730,5790,384],[75,7140,7290,378],[77,1662,1788,372],[77,1920,2016,372],[23,4620,4860,360],[39,6210,6570,344],[23,4272,4620,336],[37,2700,2811,324],[39,6030,6210,308],[61,0,51,300],[77,2016,2076,300],[37,2520,2700,300],[61,7602,7680,300],[37,2271,2496,288],[39,6570,6792,288],[31,7515,7578,284],[61,7578,7602,284],[45,4146,4272,264],[59,2247,2271,240],[37,2496,2520,240],[21,2811,2853,240],[61,8580,8640,240],[6,600,1182,238],[31,7251,7308,204],[8,4860,5430,192],[61,8190,8580,180],[21,2853,3330,168],[45,3330,3870,168],[58,6570,6718.4,150],[3,6718.4,6792,150],[31,7500,7515,144],[20,2520,2526,132],[73,6570,6633,108],[39,5790,6030,96],[58,6570,6633,72],[61,7728,7800,66],[66,0,720,48],[73,6690,6792,48],[31,7308,7500,48],[34,7500,7680,48],[61,7680,7728,48],[61,7920,8190,48],[61,7800,7920,42],[20,2526,2592,36],[77,1290,1662,0],[59,1662,1680,0],[20,2592,2910,0],[85,5280,5430,0],[58,6420,6570,0],[16,954,1182,-42],[77,1182,1290,-42],[73,5430,5856,-78],[59,1680,1830,-96],[59,2100,2247,-96],[73,6420,6468,-96],[73,6570,6690,-96],[3,6690,6792,-96],[66,8190,8580,-96],[45,3870,4146,-144],[85,4146,4260,-144],[66,0,120,-168],[66,8580,8640,-168],[85,5130,5280,-192],[58,5730,5856,-192],[3,7200,7392,-216],[4,7680,7872,-216],[58,6180,6468,-240],[54,2100,2910,-264],[35,1770,1830,-264],[59,1830,2100,-264],[41,2910,3012,-264],[74,3450,3870,-264],[85,4260,4620,-264],[58,6330,6360,-280],[3,6792,7200,-288.8],[35,1740,1770,-348],[4,7392,7680,-360],[73,6180,6570,-384],[72,6570,6792,-384],[41,3012,3090,-408],[58,5856,5895,-438],[41,3090,3270,-456],[26,3870,3900,-456],[71,5856,5895,-462],[47,5640,5730,-480],[28,4530,4620,-528],[85,4620,5130,-528],[41,3270,3510,-576],[16,600,954,-585.2],[35,954,1350,-585.2],[26,3900,4260,-588],[28,4260,4530,-588],[47,5130,5370,-588],[58,5856,6030,-590],[16,0,600,-612],[11,7680,7872,-612],[4,7872,8580,-612],[16,8580,8640,-612],[41,3510,3690,-636],[35,1692,1740,-654],[46,1740,2202,-654],[11,7200,7680,-672],[41,3690,3810,-700],[41,4530,5370,-708],[47,5370,5640,-708],[71,5640,5760,-708],[35,1650,1692,-720],[58,6030,6336,-720],[76,6336,6420,-720],[41,3810,3900,-748],[19,2202,2652,-792],[41,4410,4530,-792],[41,3900,4410,-840],[36,1260,1350,-864],[68,3012,3372,-882],[35,1536,1650,-888],[76,6420,6900,-888],[65,7680,8280,-888],[70,8280,8400,-888],[36,1080,1260,-950],[1,3372,3960,-954],[70,0,600,-960],[36,600,1080,-960],[35,1392,1536,-960],[70,8400,8640,-960],[14,5100,5370,-1008],[49,5640,5760,-1008],[71,5760,5911.5,-1008],[9,1740,1800,-1032],[22,1800,2370,-1032],[67,2880,3012,-1032],[35,1230,1392,-1056],[71,5911.5,6420,-1092],[24,6420,6900,-1092],[76,6900,7320,-1092],[53,7320,7680,-1092],[35,1080,1230,-1104],[9,1620,1740,-1116],[49,5520,5640,-1152],[63,0,840,-1156],[35,960,1080,-1176],[40,1470,1536,-1176],[9,1536,1620,-1176],[38,7680,7920,-1200],[67,2160,2880,-1218],[84,2880,2940,-1218],[35,870,960,-1224],[40,1380,1470,-1224],[63,0,660,-1236],[12,2160,2220,-1260],[84,2940,3042,-1272],[40,1260,1380,-1276],[32,1380,1440,-1276],[63,0,570,-1284],[35,780,870,-1296],[64,1620,1800,-1296],[49,5418,5520,-1296],[84,3042,3180,-1308],[12,2220,2340,-1320],[14,4260,4620,-1320],[49,5100,5418,-1320],[56,5418,5520,-1320],[32,1440,1560,-1356],[84,3180,3960,-1356],[14,3960,4050,-1356],[5,6300,6480,-1368],[78,6480,7320,-1368],[38,7920,8400,-1368],[40,1152,1260,-1380],[64,1800,1980,-1380],[12,2340,2460,-1392],[63,0,480,-1404],[35,480,780,-1404],[63,8400,8640,-1404],[32,1560,1650,-1416],[56,5520,5911.5,-1440],[43,7320,7680,-1440],[64,1980,2160,-1464],[18,5460,5520,-1464],[5,5911.5,5970,-1464],[18,5370,5460,-1526],[5,5970,6030,-1526],[64,2160,2460,-1536],[12,2460,3252,-1536],[14,4050,4260,-1536],[27,4260,4620,-1536],[14,4620,5232,-1536],[18,4860,4920,-1560],[5,6030,6060,-1560],[40,780,1152,-1620],[69,1152,1650,-1620],[18,5310,5370,-1620],[5,6060,6300,-1620],[60,6300,6480,-1620],[81,7920,8400,-1620],[32,1650,2370,-1680],[18,4920,5310,-1680],[79,5310,6120,-1680],[81,0,480,-1800],[42,1260,1650,-1800],[86,2370,3252,-1800],[12,3252,4050,-1800],[55,4050,4920,-1800],[60,6480,7680,-1800],[43,7680,8400,-1800],[81,8400,8640,-1800],[81,270,480,-1824],[42,0,1260,-1980],[17,2760,4920,-1980],[2,4920,6480,-1980],[52,1260,2760,-2040],[57,0,8640,-2160]];let Cn,zn;class Pn{constructor(t,e,n,r){this.symbol=t,this.name=e,this.ra1875=n,this.dec1875=r}}var On,In;e.ConstellationInfo=Pn,e.Constellation=function(t,e){if(L(t),L(e),e<-90||e>90)throw"Invalid declination angle. Must be -90..+90.";(t%=24)<0&&(t+=24),Cn||(Cn=bn(new tt(-45655.74141261017)),zn=new tt(0));const n=ln(new At(e,15*t,1),zn),r=hn(gn(Cn,n)),i=10/240,o=i/15;for(let t of kn){const e=t[3]*i,n=t[1]*o,a=t[2]*o;if(e<=r.dec&&n<=r.ra&&r.ra<a){const e=$n[t[0]];return new Pn(e[0],e[1],r.ra,r.dec)}}throw"Unable to find constellation for given coordinates."},function(t){t.Penumbral="penumbral",t.Partial="partial",t.Annular="annular",t.Total="total"}(On=e.EclipseKind||(e.EclipseKind={}));class Nn{constructor(t,e,n,r,i,o){this.kind=t,this.obscuration=e,this.peak=n,this.sd_penum=r,this.sd_partial=i,this.sd_total=o}}e.LunarEclipseInfo=Nn;class Tn{constructor(t,e,n,r,i,o,a){this.time=t,this.u=e,this.r=n,this.k=r,this.p=i,this.target=o,this.dir=a}}function Un(t,n,r,i){const o=(i.x*r.x+i.y*r.y+i.z*r.z)/(i.x*i.x+i.y*i.y+i.z*i.z),a=o*i.x-r.x,s=o*i.y-r.y,c=o*i.z-r.z,u=e.KM_PER_AU*Math.hypot(a,s,c);return new Tn(n,o,u,+p-(1+o)*(p-t),(1+o)*(p+t)-p,r,i)}function Gn(t){const e=Re(F.Sun,t,!0),n=new Mt(-e.x,-e.y,-e.z,e.t),r=Ut(t);return Un(w,t,r,n)}function Ln(t){const e=Re(F.Sun,t,!0),n=Ut(t),r=new Mt(-n.x,-n.y,-n.z,n.t);return n.x-=e.x,n.y-=e.y,n.z-=e.z,Un(E,t,r,n)}function jn(t,e){const n=_t(t,e),r=Re(F.Sun,t,!0),i=Ut(t),o=new Mt(n[0]-i.x,n[1]-i.y,n[2]-i.z,t);return i.x-=r.x,i.y-=r.y,i.z-=r.z,Un(E,t,o,i)}function Hn(t,e,n){const r=Re(t,n,!0),i=Re(F.Sun,n,!0),o=new Mt(r.x-i.x,r.y-i.y,r.z-i.z,n);return i.x=-r.x,i.y=-r.y,i.z=-r.z,Un(e,n,i,o)}function Fn(t,e){const n=1/86400,r=e.AddDays(-n),i=e.AddDays(+n),o=t(r);return(t(i).r-o.r)/n}function Vn(t){const e=ze((t=>Fn(Gn,t)),t.AddDays(-.03),t.AddDays(.03));if(!e)throw"Failed to find peak Earth shadow time.";return Gn(e)}function Bn(t){const e=ze((t=>Fn(Ln,t)),t.AddDays(-.03),t.AddDays(.03));if(!e)throw"Failed to find peak Moon shadow time.";return Ln(e)}function Jn(t,e,n){const r=ze((n=>function(t,e,n){const r=1/86400,i=Hn(t,e,n.AddDays(-r));return(Hn(t,e,n.AddDays(+r)).r-i.r)/r}(t,e,n)),n.AddDays(-1),n.AddDays(1));if(!r)throw"Failed to find peak planet shadow time.";return Hn(t,e,r)}function qn(t,e){function n(t){return jn(t,e)}const r=ze((t=>Fn(n,t)),t.AddDays(-.2),t.AddDays(.2));if(!r)throw`PeakLocalMoonShadow: search failure for search_center_time = ${t}`;return jn(r,e)}function Kn(t,e,n){const r=n/1440,i=t.AddDays(-r),o=t.AddDays(+r),a=ze((t=>-(Gn(t).r-e)),i,t),s=ze((t=>+(Gn(t).r-e)),t,o);if(!a||!s)throw"Failed to find shadow semiduration";return 720*(s.ut-a.ut)}function Qn(t){const n=at(t);return e.RAD2DEG*n.geo_eclip_lat}function Wn(t,e,n){if(t<=0)throw"Radius of first disc must be positive.";if(e<=0)throw"Radius of second disc must be positive.";if(n<0)throw"Distance between discs is not allowed to be negative.";if(n>=t+e)return 0;if(0==n)return t<=e?1:e*e/(t*t);const r=(t*t-e*e+n*n)/(2*n),i=t*t-r*r;if(i<=0)return t<=e?1:e*e/(t*t);const o=Math.sqrt(i);return(t*t*Math.acos(r/t)-r*o+(e*e*Math.acos((n-r)/e)-(n-r)*o))/(Math.PI*t*t)}function Yn(t,n){const r=new Mt(t.x+n.x,t.y+n.y,t.z+n.z,t.t),i=Wn(Math.asin(g/r.Length()),Math.asin(S/n.Length()),H(n,r)*e.DEG2RAD);return Math.min(.9999,i)}function Zn(t){let e=et(t);for(let t=0;t<12;++t){const t=Ve(180,e,40);if(!t)throw"Cannot find full moon.";const n=Qn(t);if(Math.abs(n)<1.8){const e=Vn(t);if(e.r<e.p+E){let t=On.Penumbral,n=0,r=0,i=0,o=Kn(e.time,e.p+E,200);return e.r<e.k+E&&(t=On.Partial,i=Kn(e.time,e.k+E,o),e.r+E<e.k?(t=On.Total,n=1,r=Kn(e.time,e.k-E,i)):n=Wn(E,e.k,e.r)),new Nn(t,n,e.time,o,i,r)}}e=t.AddDays(10)}throw"Failed to find lunar eclipse within 12 full moons."}e.SearchLunarEclipse=Zn;class Xn{constructor(t,e,n,r,i,o){this.kind=t,this.obscuration=e,this.peak=n,this.distance=r,this.latitude=i,this.longitude=o}}function tr(t){return t>.014?On.Total:On.Annular}function er(t){let n,r,i=On.Partial,o=t.time,a=t.r;const s=bn(t.time),c=gn(s,t.dir),u=gn(s,t.target);c.x*=e.KM_PER_AU,c.y*=e.KM_PER_AU,c.z*=e.KM_PER_AU/v,u.x*=e.KM_PER_AU,u.y*=e.KM_PER_AU,u.z*=e.KM_PER_AU/v;const l=b,h=c.x*c.x+c.y*c.y+c.z*c.z,d=-2*(c.x*u.x+c.y*u.y+c.z*u.z),f=d*d-4*h*(u.x*u.x+u.y*u.y+u.z*u.z-l*l);let m;if(f>0){const a=(-d-Math.sqrt(f))/(2*h),l=a*c.x-u.x,p=a*c.y-u.y,g=(a*c.z-u.z)*v,b=Math.hypot(l,p)*y;n=0==b?g>0?90:-90:e.RAD2DEG*Math.atan(g/b);const _=ft(o);r=(e.RAD2DEG*Math.atan2(p,l)-15*_)%360,r<=-180?r+=360:r>180&&(r-=360);const M=cn(s);let w=new Mt(l/e.KM_PER_AU,p/e.KM_PER_AU,g/e.KM_PER_AU,t.time);w=gn(M,w),w.x+=t.target.x,w.y+=t.target.y,w.z+=t.target.z;const A=Un(D,t.time,w,t.dir);if(A.r>1e-9||A.r<0)throw`Unexpected shadow distance from geoid intersection = ${A.r}`;i=tr(A.k),m=i===On.Total?1:Yn(t.dir,w)}else m=void 0;return new Xn(i,m,o,a,n,r)}function nr(t){let e,n=t=et(t);for(e=0;e<12;++e){const t=Ve(0,n,40);if(!t)throw"Cannot find new moon";const e=Qn(t);if(Math.abs(e)<1.8){const e=Bn(t);if(e.r<e.p+6371)return er(e)}n=t.AddDays(10)}throw"Failed to find solar eclipse within 12 full moons."}e.GlobalSolarEclipseInfo=Xn,e.NextLunarEclipse=function(t){return Zn((t=et(t)).AddDays(10))},e.SearchGlobalSolarEclipse=nr,e.NextGlobalSolarEclipse=function(t){return nr((t=et(t)).AddDays(10))};class rr{constructor(t,e){this.time=t,this.altitude=e}}e.EclipseEvent=rr;class ir{constructor(t,e,n,r,i,o,a){this.kind=t,this.obscuration=e,this.partial_begin=n,this.total_begin=r,this.peak=i,this.total_end=o,this.partial_end=a}}function or(t){return t.p-t.r}function ar(t){return Math.abs(t.k)-t.r}function sr(t,e){const n=ur(e,t.time);let r=t.time.AddDays(-.2),i=t.time.AddDays(.2);const o=cr(e,1,or,r,t.time),a=cr(e,-1,or,t.time,i);let s,c,u;t.r<Math.abs(t.k)?(r=t.time.AddDays(-.01),i=t.time.AddDays(.01),s=cr(e,1,ar,r,t.time),c=cr(e,-1,ar,t.time,i),u=tr(t.k)):u=On.Partial;const l=u===On.Total?1:Yn(t.dir,t.target);return new ir(u,l,o,s,n,c,a)}function cr(t,e,n,r,i){const o=ze((function(r){const i=jn(r,t);return e*n(i)}),r,i);if(!o)throw"Local eclipse transition search failed.";return ur(t,o)}function ur(t,e){const n=function(t,e){const n=It(F.Sun,t,e,!0,!0);return Ct(t,e,n.ra,n.dec,"normal").altitude}(e,t);return new rr(e,n)}function lr(t,e){t=et(t),zt(e);let n=t;for(;;){const t=Ve(0,n,40);if(!t)throw"Cannot find next new moon";const r=Qn(t);if(Math.abs(r)<1.8){const n=qn(t,e);if(n.r<n.p){const t=sr(n,e);if(t.partial_begin.altitude>0||t.partial_end.altitude>0)return t}}n=t.AddDays(10)}}e.LocalSolarEclipseInfo=ir,e.SearchLocalSolarEclipse=lr,e.NextLocalSolarEclipse=function(t,e){return lr((t=et(t)).AddDays(10),e)};class hr{constructor(t,e,n,r){this.start=t,this.peak=e,this.finish=n,this.separation=r}}function dr(t,e,n,r,i){const o=ze((n=>function(t,e,n,r){const i=Hn(e,n,t);return r*(i.r-i.p)}(n,t,e,i)),n,r);if(!o)throw"Planet transit boundary search failed";return o}function fr(t,e){let n;switch(e=et(e),t){case F.Mercury:n=2439.7;break;case F.Venus:n=6051.8;break;default:throw`Invalid body: ${t}`}let r=e;for(;;){const e=He(t,0,r);if(Te(t,e)<.4){const r=Jn(t,n,e);if(r.r<r.p){const e=dr(t,n,r.time.AddDays(-1),r.time,-1),i=r.time.AddDays(1),o=dr(t,n,r.time,i,1),a=60*Te(t,r.time);return new hr(e,r.time,o,a)}}r=e.AddDays(10)}}e.TransitInfo=hr,e.SearchTransit=fr,e.NextTransit=function(t,e){return fr(t,(e=et(e)).AddDays(100))},function(t){t[t.Invalid=0]="Invalid",t[t.Ascending=1]="Ascending",t[t.Descending=-1]="Descending"}(In=e.NodeEventKind||(e.NodeEventKind={}));class mr{constructor(t,e){this.kind=t,this.time=e}}e.NodeEventInfo=mr;const pr=10;function gr(t){let e=et(t),n=Gt(e);for(;;){const t=e.AddDays(pr),r=Gt(t);if(n.lat*r.lat<=0){const i=r.lat>n.lat?In.Ascending:In.Descending,o=ze((t=>i*Gt(t).lat),e,t);if(!o)throw"Could not find moon node.";return new mr(i,o)}e=t,n=r}}e.SearchMoonNode=gr,e.NextMoonNode=function(t){const e=gr(t.time.AddDays(pr));switch(t.kind){case In.Ascending:if(e.kind!==In.Descending)throw`Internal error: previous node was ascending, but this node was: ${e.kind}`;break;case In.Descending:if(e.kind!==In.Ascending)throw`Internal error: previous node was descending, but this node was: ${e.kind}`;break;default:throw`Previous node has an invalid node kind: ${t.kind}`}return e};class vr{constructor(t,e,n,r){this.ra=t,this.dec=e,this.spin=n,this.north=r}}function yr(t,e,n,r,i){const o=.5,a=.8660254037844386;if(t<1||t>5)throw`Invalid lagrange point ${t}`;if(!Number.isFinite(n)||n<=0)throw"Major mass must be a positive number.";if(!Number.isFinite(i)||i<=0)throw"Minor mass must be a negative number.";let s=r.x-e.x,c=r.y-e.y,u=r.z-e.z;const l=s*s+c*c+u*u,h=Math.sqrt(l),d=r.vx-e.vx,f=r.vy-e.vy,m=r.vz-e.vz;let p;if(4===t||5===t){const n=c*m-u*f,r=u*d-s*m,i=s*f-c*d;let l=r*u-i*c,g=i*s-n*u,v=n*c-r*s;const y=Math.sqrt(l*l+g*g+v*v);l/=y,g/=y,v/=y,s/=h,c/=h,u/=h;const b=4==t?+a:-a,_=o*s+b*l,M=o*c+b*g,w=o*u+b*v,A=d*s+f*c+m*u,E=d*l+f*g+m*v;p=new wt(h*_,h*M,h*w,A*_+E*(o*l-b*s),A*M+E*(o*g-b*c),A*w+E*(o*v-b*u),e.t)}else{const r=i/(n+i)*-h,o=n/(n+i)*+h,a=(n+i)/(l*h);let g,v,y;if(1===t||2===t)g=n/(n+i)*Math.cbrt(i/(3*n)),v=-n,1==t?(g=1-g,y=+i):(g=1+g,y=-i);else{if(3!==t)throw`Invalid Langrage point ${t}. Must be an integer 1..5.`;g=(7/12*i-n)/(i+n),v=+n,y=+i}let b,_=h*g-r;do{const t=_-r,e=_-o;b=(a*_+v/(t*t)+y/(e*e))/(a-2*v/(t*t*t)-2*y/(e*e*e)),_-=b}while(Math.abs(b/h)>1e-14);g=(_-r)/h,p=new wt(g*s,g*c,g*u,g*d,g*f,g*m,e.t)}return p}e.AxisInfo=vr,e.RotationAxis=function(t,n){const r=et(n),i=r.tt,o=i/36525;let a,s,c;switch(t){case F.Sun:a=286.13,s=63.87,c=84.176+14.1844*i;break;case F.Mercury:a=281.0103-.0328*o,s=61.4155-.0049*o,c=329.5988+6.1385108*i+.01067257*Math.sin(e.DEG2RAD*(174.7910857+4.092335*i))-.00112309*Math.sin(e.DEG2RAD*(349.5821714+8.18467*i))-1104e-7*Math.sin(e.DEG2RAD*(164.3732571+12.277005*i))-2539e-8*Math.sin(e.DEG2RAD*(339.1643429+16.36934*i))-571e-8*Math.sin(e.DEG2RAD*(153.9554286+20.461675*i));break;case F.Venus:a=272.76,s=67.16,c=160.2-1.4813688*i;break;case F.Earth:return function(t){const e=ut(gt([0,0,1],t,K.Into2000),t,K.Into2000),n=new Mt(e[0],e[1],e[2],t),r=hn(n),i=190.41375788700253+360.9856122880876*t.ut;return new vr(r.ra,r.dec,i,n)}(r);case F.Moon:const n=e.DEG2RAD*(125.045-.0529921*i),u=e.DEG2RAD*(250.089-.1059842*i),l=e.DEG2RAD*(260.008+13.0120009*i),h=e.DEG2RAD*(176.625+13.3407154*i),d=e.DEG2RAD*(357.529+.9856003*i),f=e.DEG2RAD*(311.589+26.4057084*i),m=e.DEG2RAD*(134.963+13.064993*i),p=e.DEG2RAD*(276.617+.3287146*i),g=e.DEG2RAD*(34.226+1.7484877*i),v=e.DEG2RAD*(15.134-.1589763*i),y=e.DEG2RAD*(119.743+.0036096*i),b=e.DEG2RAD*(239.961+.1643573*i),_=e.DEG2RAD*(25.053+12.9590088*i);a=269.9949+.0031*o-3.8787*Math.sin(n)-.1204*Math.sin(u)+.07*Math.sin(l)-.0172*Math.sin(h)+.0072*Math.sin(f)-.0052*Math.sin(v)+.0043*Math.sin(_),s=66.5392+.013*o+1.5419*Math.cos(n)+.0239*Math.cos(u)-.0278*Math.cos(l)+.0068*Math.cos(h)-.0029*Math.cos(f)+9e-4*Math.cos(m)+8e-4*Math.cos(v)-9e-4*Math.cos(_),c=38.3213+(13.17635815-14e-13*i)*i+3.561*Math.sin(n)+.1208*Math.sin(u)-.0642*Math.sin(l)+.0158*Math.sin(h)+.0252*Math.sin(d)-.0066*Math.sin(f)-.0047*Math.sin(m)-.0046*Math.sin(p)+.0028*Math.sin(g)+.0052*Math.sin(v)+.004*Math.sin(y)+.0019*Math.sin(b)-.0044*Math.sin(_);break;case F.Mars:a=317.269202-.10927547*o+68e-6*Math.sin(e.DEG2RAD*(198.991226+19139.4819985*o))+238e-6*Math.sin(e.DEG2RAD*(226.292679+38280.8511281*o))+52e-6*Math.sin(e.DEG2RAD*(249.663391+57420.7251593*o))+9e-6*Math.sin(e.DEG2RAD*(266.18351+76560.636795*o))+.419057*Math.sin(e.DEG2RAD*(79.398797+.5042615*o)),s=54.432516-.05827105*o+51e-6*Math.cos(e.DEG2RAD*(122.433576+19139.9407476*o))+141e-6*Math.cos(e.DEG2RAD*(43.058401+38280.8753272*o))+31e-6*Math.cos(e.DEG2RAD*(57.663379+57420.7517205*o))+5e-6*Math.cos(e.DEG2RAD*(79.476401+76560.6495004*o))+1.591274*Math.cos(e.DEG2RAD*(166.325722+.5042615*o)),c=176.049863+350.891982443297*i+145e-6*Math.sin(e.DEG2RAD*(129.071773+19140.0328244*o))+157e-6*Math.sin(e.DEG2RAD*(36.352167+38281.0473591*o))+4e-5*Math.sin(e.DEG2RAD*(56.668646+57420.929536*o))+1e-6*Math.sin(e.DEG2RAD*(67.364003+76560.2552215*o))+1e-6*Math.sin(e.DEG2RAD*(104.79268+95700.4387578*o))+.584542*Math.sin(e.DEG2RAD*(95.391654+.5042615*o));break;case F.Jupiter:const M=e.DEG2RAD*(99.360714+4850.4046*o),w=e.DEG2RAD*(175.895369+1191.9605*o),A=e.DEG2RAD*(300.323162+262.5475*o),E=e.DEG2RAD*(114.012305+6070.2476*o),D=e.DEG2RAD*(49.511251+64.3*o);a=268.056595-.006499*o+117e-6*Math.sin(M)+938e-6*Math.sin(w)+.001432*Math.sin(A)+3e-5*Math.sin(E)+.00215*Math.sin(D),s=64.495303+.002413*o+5e-5*Math.cos(M)+404e-6*Math.cos(w)+617e-6*Math.cos(A)-13e-6*Math.cos(E)+926e-6*Math.cos(D),c=284.95+870.536*i;break;case F.Saturn:a=40.589-.036*o,s=83.537-.004*o,c=38.9+810.7939024*i;break;case F.Uranus:a=257.311,s=-15.175,c=203.81-501.1600928*i;break;case F.Neptune:const S=e.DEG2RAD*(357.85+52.316*o);a=299.36+.7*Math.sin(S),s=43.46-.51*Math.cos(S),c=249.978+541.1397757*i-.48*Math.sin(S);break;case F.Pluto:a=132.993,s=-6.163,c=302.695+56.3625225*i;break;default:throw`Invalid body: ${t}`}const u=s*e.DEG2RAD,l=a*e.DEG2RAD,h=Math.cos(u),d=new Mt(h*Math.cos(l),h*Math.sin(l),Math.sin(u),r);return new vr(a/15,s,c,d)},e.LagrangePoint=function(t,e,n,r){const i=et(e),o=U(n),a=U(r);let s,c;return n===F.Earth&&r===F.Moon?(s=new wt(0,0,0,0,0,0,i),c=Lt(i)):(s=ke(n,i),c=ke(r,i)),yr(t,s,o,c,a)},e.LagrangePointFast=yr;class br{constructor(t,e,n){const r=et(e);this.originBody=t;for(let t of n)if(t.t.tt!==r.tt)throw"Inconsistent times in bodyStates";const i=[],o=br.CalcSolarSystem(r);this.curr=new _r(r,o,i);const a=this.InternalBodyState(t);for(let t of n){const e=new ie(t.x+a.r.x,t.y+a.r.y,t.z+a.r.z),n=new ie(t.vx+a.v.x,t.vy+a.v.y,t.vz+a.v.z),o=ie.zero();i.push(new ue(r.tt,e,n,o))}this.CalcBodyAccelerations(),this.prev=this.Duplicate()}get OriginBody(){return this.originBody}get Time(){return this.curr.time}Update(t){const e=et(t),n=e.tt-this.curr.time.tt;if(0===n)this.prev=this.Duplicate();else{this.Swap(),this.curr.time=e,this.curr.gravitators=br.CalcSolarSystem(e);for(let t=0;t<this.curr.bodies.length;++t){const e=this.prev.bodies[t];this.curr.bodies[t].r=he(n,e.r,e.v,e.a)}this.CalcBodyAccelerations();for(let t=0;t<this.curr.bodies.length;++t){const r=this.prev.bodies[t],i=this.curr.bodies[t],o=r.a.mean(i.a);i.tt=e.tt,i.r=he(n,r.r,r.v,o),i.v=de(n,r.v,o)}this.CalcBodyAccelerations()}const r=[],i=this.InternalBodyState(this.originBody);for(let t of this.curr.bodies)r.push(new wt(t.r.x-i.r.x,t.r.y-i.r.y,t.r.z-i.r.z,t.v.x-i.v.x,t.v.y-i.v.y,t.v.z-i.v.z,e));return r}Swap(){const t=this.curr;this.curr=this.prev,this.prev=t}SolarSystemBodyState(t){const e=this.InternalBodyState(t),n=this.InternalBodyState(this.originBody);return $e(e.sub(n),this.curr.time)}InternalBodyState(t){if(t===F.SSB)return new oe(this.curr.time.tt,ie.zero(),ie.zero());const e=this.curr.gravitators[t];if(e)return e;throw`Invalid body: ${t}`}static CalcSolarSystem(t){const e={},n=new oe(t.tt,ie.zero(),ie.zero());e[F.Mercury]=ae(n,t.tt,F.Mercury,$),e[F.Venus]=ae(n,t.tt,F.Venus,k),e[F.Earth]=ae(n,t.tt,F.Earth,C+T),e[F.Mars]=ae(n,t.tt,F.Mars,z),e[F.Jupiter]=ae(n,t.tt,F.Jupiter,P),e[F.Saturn]=ae(n,t.tt,F.Saturn,O),e[F.Uranus]=ae(n,t.tt,F.Uranus,I),e[F.Neptune]=ae(n,t.tt,F.Neptune,N);for(let t in e)e[t].r.decr(n.r),e[t].v.decr(n.v);return e[F.Sun]=new oe(t.tt,n.r.neg(),n.v.neg()),e}CalcBodyAccelerations(){for(let t of this.curr.bodies)t.a=ie.zero(),br.AddAcceleration(t.a,t.r,this.curr.gravitators[F.Sun].r,R),br.AddAcceleration(t.a,t.r,this.curr.gravitators[F.Mercury].r,$),br.AddAcceleration(t.a,t.r,this.curr.gravitators[F.Venus].r,k),br.AddAcceleration(t.a,t.r,this.curr.gravitators[F.Earth].r,C+T),br.AddAcceleration(t.a,t.r,this.curr.gravitators[F.Mars].r,z),br.AddAcceleration(t.a,t.r,this.curr.gravitators[F.Jupiter].r,P),br.AddAcceleration(t.a,t.r,this.curr.gravitators[F.Saturn].r,O),br.AddAcceleration(t.a,t.r,this.curr.gravitators[F.Uranus].r,I),br.AddAcceleration(t.a,t.r,this.curr.gravitators[F.Neptune].r,N)}static AddAcceleration(t,e,n,r){const i=n.x-e.x,o=n.y-e.y,a=n.z-e.z,s=i*i+o*o+a*a,c=r/(s*Math.sqrt(s));t.x+=i*c,t.y+=o*c,t.z+=a*c}Duplicate(){const t={};for(let e in this.curr.gravitators)t[e]=this.curr.gravitators[e].clone();const e=[];for(let t of this.curr.bodies)e.push(t.clone());return new _r(this.curr.time,t,e)}}e.GravitySimulator=br;class _r{constructor(t,e,n){this.time=t,this.gravitators=e,this.bodies=n}}},197:(t,e,n)=>{n.r(e),n.d(e,{DEFAULT_DOMAIN_ICON:()=>Y,DEFAULT_PANEL:()=>Z,DEFAULT_VIEW_ENTITY_ID:()=>st,DOMAINS_HIDE_MORE_INFO:()=>et,DOMAINS_MORE_INFO_NO_HISTORY:()=>nt,DOMAINS_TOGGLE:()=>it,DOMAINS_WITH_CARD:()=>X,DOMAINS_WITH_MORE_INFO:()=>tt,NumberFormat:()=>r,STATES_OFF:()=>rt,TimeFormat:()=>i,UNIT_C:()=>ot,UNIT_F:()=>at,applyThemesOnElement:()=>U,computeCardSize:()=>G,computeDomain:()=>L,computeEntity:()=>j,computeRTL:()=>H,computeRTLDirection:()=>F,computeStateDisplay:()=>W,computeStateDomain:()=>V,createThing:()=>ht,debounce:()=>dt,domainIcon:()=>mt,evaluateFilter:()=>pt,fireEvent:()=>ct,fixedIcons:()=>ft,formatDate:()=>l,formatDateMonth:()=>y,formatDateMonthYear:()=>g,formatDateNumeric:()=>d,formatDateShort:()=>m,formatDateTime:()=>A,formatDateTimeNumeric:()=>x,formatDateTimeWithSeconds:()=>D,formatDateWeekday:()=>c,formatDateYear:()=>_,formatNumber:()=>K,formatTime:()=>$,formatTimeWeekday:()=>P,formatTimeWithSeconds:()=>C,forwardHaptic:()=>gt,getLovelace:()=>xt,handleAction:()=>Mt,handleActionConfig:()=>_t,handleClick:()=>wt,hasAction:()=>At,hasConfigOrEntityChanged:()=>Et,hasDoubleClick:()=>Dt,isNumericState:()=>B,navigate:()=>vt,numberFormatToLocale:()=>J,relativeTime:()=>I,round:()=>q,stateIcon:()=>kt,timerTimeRemaining:()=>N,toggleEntity:()=>bt,turnOnOffEntities:()=>St,turnOnOffEntity:()=>yt});var r,i,o,a=function(){return a=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},a.apply(this,arguments)},s={second:45,minute:45,hour:22,day:5},c=function(t,e){return u(e).format(t)},u=function(t){return new Intl.DateTimeFormat(t.language,{weekday:"long",month:"long",day:"numeric"})},l=function(t,e){return h(e).format(t)},h=function(t){return new Intl.DateTimeFormat(t.language,{year:"numeric",month:"long",day:"numeric"})},d=function(t,e){return f(e).format(t)},f=function(t){return new Intl.DateTimeFormat(t.language,{year:"numeric",month:"numeric",day:"numeric"})},m=function(t,e){return p(e).format(t)},p=function(t){return new Intl.DateTimeFormat(t.language,{day:"numeric",month:"short"})},g=function(t,e){return v(e).format(t)},v=function(t){return new Intl.DateTimeFormat(t.language,{month:"long",year:"numeric"})},y=function(t,e){return b(e).format(t)},b=function(t){return new Intl.DateTimeFormat(t.language,{month:"long"})},_=function(t,e){return M(e).format(t)},M=function(t){return new Intl.DateTimeFormat(t.language,{year:"numeric"})};(o=r||(r={})).language="language",o.system="system",o.comma_decimal="comma_decimal",o.decimal_comma="decimal_comma",o.space_comma="space_comma",o.none="none",function(t){t.language="language",t.system="system",t.am_pm="12",t.twenty_four="24"}(i||(i={}));var w=function(t){if(t.time_format===i.language||t.time_format===i.system){var e=t.time_format===i.language?t.language:void 0,n=(new Date).toLocaleString(e);return n.includes("AM")||n.includes("PM")}return t.time_format===i.am_pm},A=function(t,e){return E(e).format(t)},E=function(t){return new Intl.DateTimeFormat(t.language,{year:"numeric",month:"long",day:"numeric",hour:w(t)?"numeric":"2-digit",minute:"2-digit",hour12:w(t)})},D=function(t,e){return S(e).format(t)},S=function(t){return new Intl.DateTimeFormat(t.language,{year:"numeric",month:"long",day:"numeric",hour:w(t)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hour12:w(t)})},x=function(t,e){return R(e).format(t)},R=function(t){return new Intl.DateTimeFormat(t.language,{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit",hour12:w(t)})},$=function(t,e){return k(e).format(t)},k=function(t){return new Intl.DateTimeFormat(t.language,{hour:"numeric",minute:"2-digit",hour12:w(t)})},C=function(t,e){return z(e).format(t)},z=function(t){return new Intl.DateTimeFormat(t.language,{hour:w(t)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hour12:w(t)})},P=function(t,e){return O(e).format(t)},O=function(t){return new Intl.DateTimeFormat(t.language,{hour:w(t)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hour12:w(t)})},I=function(t,e,n,r){void 0===r&&(r=!0);var i=function(t,e,n){void 0===e&&(e=Date.now()),void 0===n&&(n={});var r=a(a({},s),n||{}),i=(+t-+e)/1e3;if(Math.abs(i)<r.second)return{value:Math.round(i),unit:"second"};var o=i/60;if(Math.abs(o)<r.minute)return{value:Math.round(o),unit:"minute"};var c=i/3600;if(Math.abs(c)<r.hour)return{value:Math.round(c),unit:"hour"};var u=i/86400;if(Math.abs(u)<r.day)return{value:Math.round(u),unit:"day"};var l=new Date(t),h=new Date(e),d=l.getFullYear()-h.getFullYear();if(Math.round(Math.abs(d))>0)return{value:Math.round(d),unit:"year"};var f=12*d+l.getMonth()-h.getMonth();if(Math.round(Math.abs(f))>0)return{value:Math.round(f),unit:"month"};var m=i/604800;return{value:Math.round(m),unit:"week"}}(t,n);return r?function(t){return new Intl.RelativeTimeFormat(t.language,{numeric:"auto"})}(e).format(i.value,i.unit):Intl.NumberFormat(e.language,{style:"unit",unit:i.unit,unitDisplay:"long"}).format(Math.abs(i.value))};function N(t){var e,n=3600*(e=t.attributes.remaining.split(":").map(Number))[0]+60*e[1]+e[2];if("active"===t.state){var r=(new Date).getTime(),i=new Date(t.last_changed).getTime();n=Math.max(n-(r-i)/1e3,0)}return n}function T(){return(T=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}var U=function(t,e,n,r){void 0===r&&(r=!1),t._themes||(t._themes={});var i=e.default_theme;("default"===n||n&&e.themes[n])&&(i=n);var o=T({},t._themes);if("default"!==i){var a=e.themes[i];Object.keys(a).forEach((function(e){var n="--"+e;t._themes[n]="",o[n]=a[e]}))}if(t.updateStyles?t.updateStyles(o):window.ShadyCSS&&window.ShadyCSS.styleSubtree(t,o),r){var s=document.querySelector("meta[name=theme-color]");if(s){s.hasAttribute("default-content")||s.setAttribute("default-content",s.getAttribute("content"));var c=o["--primary-color"]||s.getAttribute("default-content");s.setAttribute("content",c)}}},G=function(t){return"function"==typeof t.getCardSize?t.getCardSize():4};function L(t){return t.substr(0,t.indexOf("."))}function j(t){return t.substr(t.indexOf(".")+1)}function H(t){var e,n=(null==t||null==(e=t.locale)?void 0:e.language)||"en";return t.translationMetadata.translations[n]&&t.translationMetadata.translations[n].isRTL||!1}function F(t){return H(t)?"rtl":"ltr"}function V(t){return L(t.entity_id)}var B=function(t){return!!t.attributes.unit_of_measurement||!!t.attributes.state_class},J=function(t){switch(t.number_format){case r.comma_decimal:return["en-US","en"];case r.decimal_comma:return["de","es","it"];case r.space_comma:return["fr","sv","cs"];case r.system:return;default:return t.language}},q=function(t,e){return void 0===e&&(e=2),Math.round(t*Math.pow(10,e))/Math.pow(10,e)},K=function(t,e,n){var i=e?J(e):void 0;if(Number.isNaN=Number.isNaN||function t(e){return"number"==typeof e&&t(e)},(null==e?void 0:e.number_format)!==r.none&&!Number.isNaN(Number(t))&&Intl)try{return new Intl.NumberFormat(i,Q(t,n)).format(Number(t))}catch(e){return console.error(e),new Intl.NumberFormat(void 0,Q(t,n)).format(Number(t))}return"string"==typeof t?t:q(t,null==n?void 0:n.maximumFractionDigits).toString()+("currency"===(null==n?void 0:n.style)?" "+n.currency:"")},Q=function(t,e){var n=T({maximumFractionDigits:2},e);if("string"!=typeof t)return n;if(!e||!e.minimumFractionDigits&&!e.maximumFractionDigits){var r=t.indexOf(".")>-1?t.split(".")[1].length:0;n.minimumFractionDigits=r,n.maximumFractionDigits=r}return n},W=function(t,e,n,r){var i=void 0!==r?r:e.state;if("unknown"===i||"unavailable"===i)return t("state.default."+i);if(B(e)){if("monetary"===e.attributes.device_class)try{return K(i,n,{style:"currency",currency:e.attributes.unit_of_measurement})}catch(t){}return K(i,n)+(e.attributes.unit_of_measurement?" "+e.attributes.unit_of_measurement:"")}var o=V(e);if("input_datetime"===o){var a;if(void 0===r)return e.attributes.has_date&&e.attributes.has_time?(a=new Date(e.attributes.year,e.attributes.month-1,e.attributes.day,e.attributes.hour,e.attributes.minute),A(a,n)):e.attributes.has_date?(a=new Date(e.attributes.year,e.attributes.month-1,e.attributes.day),l(a,n)):e.attributes.has_time?((a=new Date).setHours(e.attributes.hour,e.attributes.minute),$(a,n)):e.state;try{var s=r.split(" ");if(2===s.length)return A(new Date(s.join("T")),n);if(1===s.length){if(r.includes("-"))return l(new Date(r+"T00:00"),n);if(r.includes(":")){var c=new Date;return $(new Date(c.toISOString().split("T")[0]+"T"+r),n)}}return r}catch(t){return r}}return"humidifier"===o&&"on"===i&&e.attributes.humidity?e.attributes.humidity+" %":"counter"===o||"number"===o||"input_number"===o?K(i,n):e.attributes.device_class&&t("component."+o+".state."+e.attributes.device_class+"."+i)||t("component."+o+".state._."+i)||i},Y="mdi:bookmark",Z="lovelace",X=["climate","cover","configurator","input_select","input_number","input_text","lock","media_player","scene","script","timer","vacuum","water_heater","weblink"],tt=["alarm_control_panel","automation","camera","climate","configurator","cover","fan","group","history_graph","input_datetime","light","lock","media_player","script","sun","updater","vacuum","water_heater","weather"],et=["input_number","input_select","input_text","scene","weblink"],nt=["camera","configurator","history_graph","scene"],rt=["closed","locked","off"],it=new Set(["fan","input_boolean","light","switch","group","automation"]),ot="°C",at="°F",st="group.default_view",ct=function(t,e,n,r){r=r||{},n=null==n?{}:n;var i=new Event(e,{bubbles:void 0===r.bubbles||r.bubbles,cancelable:Boolean(r.cancelable),composed:void 0===r.composed||r.composed});return i.detail=n,t.dispatchEvent(i),i},ut=new Set(["call-service","divider","section","weblink","cast","select"]),lt={alert:"toggle",automation:"toggle",climate:"climate",cover:"cover",fan:"toggle",group:"group",input_boolean:"toggle",input_number:"input-number",input_select:"input-select",input_text:"input-text",light:"toggle",lock:"lock",media_player:"media-player",remote:"toggle",scene:"scene",script:"script",sensor:"sensor",timer:"timer",switch:"toggle",vacuum:"toggle",water_heater:"climate",input_datetime:"input-datetime"},ht=function(t,e){void 0===e&&(e=!1);var n=function(t,e){return r("hui-error-card",{type:"error",error:t,config:e})},r=function(t,e){var r=window.document.createElement(t);try{if(!r.setConfig)return;r.setConfig(e)}catch(r){return console.error(t,r),n(r.message,e)}return r};if(!t||"object"!=typeof t||!e&&!t.type)return n("No type defined",t);var i=t.type;if(i&&i.startsWith("custom:"))i=i.substr(7);else if(e)if(ut.has(i))i="hui-"+i+"-row";else{if(!t.entity)return n("Invalid config given.",t);var o=t.entity.split(".",1)[0];i="hui-"+(lt[o]||"text")+"-entity-row"}else i="hui-"+i+"-card";if(customElements.get(i))return r(i,t);var a=n("Custom element doesn't exist: "+t.type+".",t);a.style.display="None";var s=setTimeout((function(){a.style.display=""}),2e3);return customElements.whenDefined(t.type).then((function(){clearTimeout(s),ct(a,"ll-rebuild",{},a)})),a},dt=function(t,e,n){var r;return void 0===n&&(n=!1),function(){var i=[].slice.call(arguments),o=this,a=n&&!r;clearTimeout(r),r=setTimeout((function(){r=null,n||t.apply(o,i)}),e),a&&t.apply(o,i)}},ft={alert:"mdi:alert",automation:"mdi:playlist-play",calendar:"mdi:calendar",camera:"mdi:video",climate:"mdi:thermostat",configurator:"mdi:settings",conversation:"mdi:text-to-speech",device_tracker:"mdi:account",fan:"mdi:fan",group:"mdi:google-circles-communities",history_graph:"mdi:chart-line",homeassistant:"mdi:home-assistant",homekit:"mdi:home-automation",image_processing:"mdi:image-filter-frames",input_boolean:"mdi:drawing",input_datetime:"mdi:calendar-clock",input_number:"mdi:ray-vertex",input_select:"mdi:format-list-bulleted",input_text:"mdi:textbox",light:"mdi:lightbulb",mailbox:"mdi:mailbox",notify:"mdi:comment-alert",person:"mdi:account",plant:"mdi:flower",proximity:"mdi:apple-safari",remote:"mdi:remote",scene:"mdi:google-pages",script:"mdi:file-document",sensor:"mdi:eye",simple_alarm:"mdi:bell",sun:"mdi:white-balance-sunny",switch:"mdi:flash",timer:"mdi:timer",updater:"mdi:cloud-upload",vacuum:"mdi:robot-vacuum",water_heater:"mdi:thermometer",weblink:"mdi:open-in-new"};function mt(t,e){if(t in ft)return ft[t];switch(t){case"alarm_control_panel":switch(e){case"armed_home":return"mdi:bell-plus";case"armed_night":return"mdi:bell-sleep";case"disarmed":return"mdi:bell-outline";case"triggered":return"mdi:bell-ring";default:return"mdi:bell"}case"binary_sensor":return e&&"off"===e?"mdi:radiobox-blank":"mdi:checkbox-marked-circle";case"cover":return"closed"===e?"mdi:window-closed":"mdi:window-open";case"lock":return e&&"unlocked"===e?"mdi:lock-open":"mdi:lock";case"media_player":return e&&"off"!==e&&"idle"!==e?"mdi:cast-connected":"mdi:cast";case"zwave":switch(e){case"dead":return"mdi:emoticon-dead";case"sleeping":return"mdi:sleep";case"initializing":return"mdi:timer-sand";default:return"mdi:z-wave"}default:return console.warn("Unable to find icon for domain "+t+" ("+e+")"),"mdi:bookmark"}}var pt=function(t,e){var n=e.value||e,r=e.attribute?t.attributes[e.attribute]:t.state;switch(e.operator||"=="){case"==":return r===n;case"<=":return r<=n;case"<":return r<n;case">=":return r>=n;case">":return r>n;case"!=":return r!==n;case"regex":return r.match(n);default:return!1}},gt=function(t){ct(window,"haptic",t)},vt=function(t,e,n){void 0===n&&(n=!1),n?history.replaceState(null,"",e):history.pushState(null,"",e),ct(window,"location-changed",{replace:n})},yt=function(t,e,n){void 0===n&&(n=!0);var r,i=L(e),o="group"===i?"homeassistant":i;switch(i){case"lock":r=n?"unlock":"lock";break;case"cover":r=n?"open_cover":"close_cover";break;default:r=n?"turn_on":"turn_off"}return t.callService(o,r,{entity_id:e})},bt=function(t,e){var n=rt.includes(t.states[e].state);return yt(t,e,n)},_t=function(t,e,n,r){if(r||(r={action:"more-info"}),!r.confirmation||r.confirmation.exemptions&&r.confirmation.exemptions.some((function(t){return t.user===e.user.id}))||(gt("warning"),confirm(r.confirmation.text||"Are you sure you want to "+r.action+"?")))switch(r.action){case"more-info":(n.entity||n.camera_image)&&ct(t,"hass-more-info",{entityId:n.entity?n.entity:n.camera_image});break;case"navigate":r.navigation_path&&vt(0,r.navigation_path);break;case"url":r.url_path&&window.open(r.url_path);break;case"toggle":n.entity&&(bt(e,n.entity),gt("success"));break;case"call-service":if(!r.service)return void gt("failure");var i=r.service.split(".",2);e.callService(i[0],i[1],r.service_data,r.target),gt("success");break;case"fire-dom-event":ct(t,"ll-custom",r)}},Mt=function(t,e,n,r){var i;"double_tap"===r&&n.double_tap_action?i=n.double_tap_action:"hold"===r&&n.hold_action?i=n.hold_action:"tap"===r&&n.tap_action&&(i=n.tap_action),_t(t,e,n,i)},wt=function(t,e,n,r,i){var o;if(i&&n.double_tap_action?o=n.double_tap_action:r&&n.hold_action?o=n.hold_action:!r&&n.tap_action&&(o=n.tap_action),o||(o={action:"more-info"}),!o.confirmation||o.confirmation.exemptions&&o.confirmation.exemptions.some((function(t){return t.user===e.user.id}))||confirm(o.confirmation.text||"Are you sure you want to "+o.action+"?"))switch(o.action){case"more-info":(o.entity||n.entity||n.camera_image)&&(ct(t,"hass-more-info",{entityId:o.entity?o.entity:n.entity?n.entity:n.camera_image}),o.haptic&>(o.haptic));break;case"navigate":o.navigation_path&&(vt(0,o.navigation_path),o.haptic&>(o.haptic));break;case"url":o.url_path&&window.open(o.url_path),o.haptic&>(o.haptic);break;case"toggle":n.entity&&(bt(e,n.entity),o.haptic&>(o.haptic));break;case"call-service":if(!o.service)return;var a=o.service.split(".",2),s=a[0],c=a[1],u=T({},o.service_data);"entity"===u.entity_id&&(u.entity_id=n.entity),e.callService(s,c,u,o.target),o.haptic&>(o.haptic);break;case"fire-dom-event":ct(t,"ll-custom",o),o.haptic&>(o.haptic)}};function At(t){return void 0!==t&&"none"!==t.action}function Et(t,e,n){if(e.has("config")||n)return!0;if(t.config.entity){var r=e.get("hass");return!r||r.states[t.config.entity]!==t.hass.states[t.config.entity]}return!1}function Dt(t){return void 0!==t&&"none"!==t.action}var St=function(t,e,n){void 0===n&&(n=!0);var r={};e.forEach((function(e){if(rt.includes(t.states[e].state)===n){var i=L(e),o=["cover","lock"].includes(i)?i:"homeassistant";o in r||(r[o]=[]),r[o].push(e)}})),Object.keys(r).forEach((function(e){var i;switch(e){case"lock":i=n?"unlock":"lock";break;case"cover":i=n?"open_cover":"close_cover";break;default:i=n?"turn_on":"turn_off"}t.callService(e,i,{entity_id:r[e]})}))},xt=function(){var t=document.querySelector("home-assistant");if(t=(t=(t=(t=(t=(t=(t=(t=t&&t.shadowRoot)&&t.querySelector("home-assistant-main"))&&t.shadowRoot)&&t.querySelector("app-drawer-layout partial-panel-resolver"))&&t.shadowRoot||t)&&t.querySelector("ha-panel-lovelace"))&&t.shadowRoot)&&t.querySelector("hui-root")){var e=t.lovelace;return e.current_view=t.___curView,e}return null},Rt={humidity:"mdi:water-percent",illuminance:"mdi:brightness-5",temperature:"mdi:thermometer",pressure:"mdi:gauge",power:"mdi:flash",signal_strength:"mdi:wifi"},$t={binary_sensor:function(t,e){var n="off"===t;switch(null==e?void 0:e.attributes.device_class){case"battery":return n?"mdi:battery":"mdi:battery-outline";case"battery_charging":return n?"mdi:battery":"mdi:battery-charging";case"cold":return n?"mdi:thermometer":"mdi:snowflake";case"connectivity":return n?"mdi:server-network-off":"mdi:server-network";case"door":return n?"mdi:door-closed":"mdi:door-open";case"garage_door":return n?"mdi:garage":"mdi:garage-open";case"power":case"plug":return n?"mdi:power-plug-off":"mdi:power-plug";case"gas":case"problem":case"safety":case"tamper":return n?"mdi:check-circle":"mdi:alert-circle";case"smoke":return n?"mdi:check-circle":"mdi:smoke";case"heat":return n?"mdi:thermometer":"mdi:fire";case"light":return n?"mdi:brightness-5":"mdi:brightness-7";case"lock":return n?"mdi:lock":"mdi:lock-open";case"moisture":return n?"mdi:water-off":"mdi:water";case"motion":return n?"mdi:walk":"mdi:run";case"occupancy":case"presence":return n?"mdi:home-outline":"mdi:home";case"opening":return n?"mdi:square":"mdi:square-outline";case"running":return n?"mdi:stop":"mdi:play";case"sound":return n?"mdi:music-note-off":"mdi:music-note";case"update":return n?"mdi:package":"mdi:package-up";case"vibration":return n?"mdi:crop-portrait":"mdi:vibrate";case"window":return n?"mdi:window-closed":"mdi:window-open";default:return n?"mdi:radiobox-blank":"mdi:checkbox-marked-circle"}},cover:function(t){var e="closed"!==t.state;switch(t.attributes.device_class){case"garage":return e?"mdi:garage-open":"mdi:garage";case"door":return e?"mdi:door-open":"mdi:door-closed";case"shutter":return e?"mdi:window-shutter-open":"mdi:window-shutter";case"blind":return e?"mdi:blinds-open":"mdi:blinds";case"window":return e?"mdi:window-open":"mdi:window-closed";default:return mt("cover",t.state)}},sensor:function(t){var e=t.attributes.device_class;if(e&&e in Rt)return Rt[e];if("battery"===e){var n=Number(t.state);if(isNaN(n))return"mdi:battery-unknown";var r=10*Math.round(n/10);return r>=100?"mdi:battery":r<=0?"mdi:battery-alert":"hass:battery-"+r}var i=t.attributes.unit_of_measurement;return"°C"===i||"°F"===i?"mdi:thermometer":mt("sensor")},input_datetime:function(t){return t.attributes.has_date?t.attributes.has_time?mt("input_datetime"):"mdi:calendar":"mdi:clock"}},kt=function(t){if(!t)return"mdi:bookmark";if(t.attributes.icon)return t.attributes.icon;var e=L(t.entity_id);return e in $t?$t[e](t):mt(e,t.state)}},167:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.defaults=void 0,e.defaults={elevation:0,time:new Date,showCoords:!1,aboveHorizon:!0}},665:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Sky=void 0;const r=n(448),i=n(167),o=[r.Body.Sun,r.Body.Moon,r.Body.Mercury,r.Body.Venus,r.Body.Earth,r.Body.Mars,r.Body.Jupiter,r.Body.Saturn],a=[r.Body.Sun,r.Body.Moon,r.Body.Mercury,r.Body.Venus,r.Body.Mars,r.Body.Jupiter,r.Body.Saturn,r.Body.Uranus,r.Body.Neptune,r.Body.Pluto];e.Sky=class{constructor(t){const e=Object.assign({},i.defaults,...Object.entries(t).map((([t,e])=>void 0===e?{}:{[t]:e})));this.location=new r.Observer(e.latitude,e.longitude,e.elevation),this.time=e.time}getDMS(t){const e={negative:t<0,degrees:Math.floor(t),arcminutes:0,arcseconds:0};return e.negative&&(t=-t),e.arcminutes=Math.floor(60*t)%60,e.arcseconds=Math.round(10*(3600*t-Math.floor(3600*t)))/10,e}getHMS(t){const e={negative:t<0,degrees:Math.floor(t),arcminutes:0,arcseconds:0};return e.negative&&(t=-t),e.degrees=Math.floor(t),e.arcminutes=Math.floor(60*t)%60,e.arcseconds=Math.round(10*(3600*t-Math.floor(3600*t)))/10,e}getStartOfDay(t){const e=new Date(t);return e.setHours(0,0,0,0),e}getMoonPhaseName(t){const e=[{name:"New Moon",range:[0,45]},{name:"Waxing Crescent",range:[45,90]},{name:"First Quarter",range:[90,135]},{name:"Waxing Gibbous",range:[135,180]},{name:"Full Moon",range:[180,225]},{name:"Waning Gibbous",range:[225,270]},{name:"Last Quarter",range:[270,315]},{name:"Waning Crescent",range:[315,360]}],n=(t%360+360)%360;for(const t of e){const[e,r]=t.range;if(n>=e&&n<r)return t.name}return"Unknown"}get(t={}){const e=[];return Object.keys(r.Body).filter((t=>a.includes(t))).forEach((n=>{const i=r.Body[n],a={name:i},s=(0,r.Equator)(i,this.time,this.location,!0,!0),c=(0,r.Horizon)(this.time,this.location,s.ra,s.dec,"normal"),u=(0,r.Constellation)(s.ra,s.dec);let l=(0,r.SearchRiseSet)(i,this.location,1,this.getStartOfDay(this.time),300),h=(0,r.SearchRiseSet)(i,this.location,-1,this.getStartOfDay(this.time),300);if(h.date<this.time){const t=new Date(this.time);t.setDate(t.getDate()+1),l=(0,r.SearchRiseSet)(i,this.location,1,this.getStartOfDay(t),300),h=(0,r.SearchRiseSet)(i,this.location,-1,this.getStartOfDay(t),300)}if(a.rise=l.date,a.set=h.date,a.constellation=u.name,a.rightAscension=this.getHMS(c.ra),a.declination=this.getDMS(c.dec),a.rightAscension.raw=c.ra,a.declination.raw=c.dec,a.altitude=c.altitude,a.azimuth=c.azimuth,a.aboveHorizon=c.altitude>0?"above_horizon":"below_horizon",i===r.Body.Moon){const t=(0,r.MoonPhase)(this.time),e=t/360*100;a.phase=e,a.phaseName=this.getMoonPhaseName(t)}const d=(0,r.Illumination)(i,this.time);a.magnitude=d.mag,a.nakedEyeObject=o.includes(i),(a.aboveHorizon&&t.aboveHorizon||!t.aboveHorizon)&&e.push(a)})),e}}},243:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BaseCard=void 0,e.BaseCard=class{constructor(t){this.config=t.config,this.hass=t._hass,this.parent=t}translation(t){return!this.config.translations||Object.keys(this.config.translations).indexOf(t)<0?this.defaultTranslations[t]:this.config.translations[t]}getProperties(){var t;return null===(t=this.parent.properties)||void 0===t||t.get("cardValues"),{}}getParentCardValues(){var t,e;const n=null!==(t=this.parent.properties)&&void 0!==t?t:new Map;return{properties:null!==(e=n.get("cardValues"))&&void 0!==e?e:{},cardValues:n}}}},650:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0});const r=n(692),i=n(243),o=n(312),a=n(665);class s extends i.BaseCard{constructor(t){super(t),this.defaultTranslations={jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec","above-horizon":"Above Horizon","below-horizon":"Below Horizon",sun:"Sun",mercury:"Mercury",venus:"Venus",moon:"Moon",mars:"Mars",jupiter:"Jupiter",saturn:"Saturn",uranus:"Uranus",neptune:"Neptune",pluto:"Pluto",star:"Star",planet:"Planet","dwarf-planet":"Dwarf Planet","visible-to-the-naked-eye":"Visible to the naked eye","visible-with-binoculars":"Visible with binoculars","visible-with-telescope":"Visible with telescope","nothing-to-see":"Nothing to see","no-stargazing-opportunities":"No stargazing opportunities","enjoy-your-stargazing":"Enjoy your stargazing","first-quarter":"First Quarter",full:"Full Moon","last-quarter":"Last Quarter",new:"New Moon","waning-cresent":"Waning Cresent","waning-gibbous":"Waning Gibbous","waxing-cresent":"Waxing Cresent","waxing-gibbous":"Waxing Gibbous"}}cardSize(){return 1}translate(t){return this.translation(this.transformString(t))}formatDate(t,e=[]){const n=new Date(t),r=this.translate(["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][n.getMonth()]),i=this.padNumber(n.getDate(),2),o=this.padNumber(n.getHours(),2),a=this.padNumber(n.getMinutes(),2),s=[];return e.includes("month")||s.push(r),e.includes("day")||s.push(i),e.includes("time")||s.push(`${o}:${a}`),s.join(" ")}padNumber(t,e){return String(t).padStart(e,"0")}isToday(t){const e=new Date(t),n=new Date;return e.getDate()===n.getDate()&&e.getMonth()===n.getMonth()&&e.getFullYear()===n.getFullYear()}transformString(t){return t.replace(/[^\w\s]/gi,"").replace(/\s+/g,"-").toLowerCase()}render(){const t=this.config.time?new Date(this.config.time):new Date,e=this.config.latitude||this.hass.config.latitude,n=this.config.longitude||this.hass.config.longitude,i=this.config.elevation||this.hass.config.elevation,s=new a.Sky({time:t,latitude:e,longitude:n,elevation:i}).get(),c=Object.values(s).filter((t=>this.config.onlyAboveHorizon?"above_horizon"===t.aboveHorizon:t)).sort(((t,e)=>o.objects.indexOf(t.name.toLowerCase())-o.objects.indexOf(e.name.toLowerCase())));let u,l,h;const d=r.html`${c.map((t=>{const e=t.name,n=o.ObjectTypes[e],i="above_horizon"===t.aboveHorizon?"Above Horizon":"Below Horizon",a="above_horizon"===t.aboveHorizon&&t.nakedEyeObject?"eye.png":"eye_disabled.png",s="above_horizon"===t.aboveHorizon&&o.binocularsObjects.includes(e)?"binoculars.png":"binoculars_disabled.png",c="above_horizon"===t.aboveHorizon?"telescope.png":"telescope_disabled.png";return this.isToday(t.rise)&&(!u||t.rise<u)&&(u=t.rise),this.isToday(t.set)&&(!l||t.set>l)&&(l=t.set),"Moon"===e&&(h=t.phaseName),r.html`
<div class="objects-container" id="sky_tonight_${this.transformString(t.name)}">
<div class="image-container">
<img src="/local/sky-tonight-native-card/images/objects/${this.translate(e)}.png" alt="${this.translate(e)}" />
</div>
<div class="info-container">
<div class="type-container">
<span class="object-type ${this.transformString(n)}">${this.translate(n)}</span>
</div>
<div class="name-container">
<span class="object-name">${this.translate(e)}</span>
</div>
<!-- <div class="position-container">
<span class="object-position">${this.translate(i)}</span>
</div> -->
<div class="position-container">
<span class="object-position">${this.formatDate(t.rise)} to ${this.formatDate(t.set)}</span>
</div>
</div>
<div class="icon-container">
<img src="/local/sky-tonight-native-card/images/${a}" alt="${this.translate("Visible to the naked eye")}" />
<img src="/local/sky-tonight-native-card/images/${s}" alt="${this.translate("Visible with binoculars")}" />
<img src="/local/sky-tonight-native-card/images/${c}" alt="${this.translate("Visible with telescope")}" />
</div>
</div>`}))}`,f=this.config.weatherEntity?this.hass.states[this.config.weatherEntity]:null,m="clear"==(null==f?void 0:f.state);let p;p=u&&l?`${this.formatDate(u,["month","day"])} to ${this.formatDate(l,["month","day"])}`:this.translate("Nothing to see");const g=r.html`
<div class="summary-container">
<div class="text-container">
<span class="${m?"":"error-text"}">${m?this.translate("Enjoy your stargazing"):this.translate("No stargazing opportunities")}</span>
</div>
<div class="icon-container">
<div>
<img src="/local/sky-tonight-native-card/images/clock.png" alt="${this.translate("Visible Times")}" />
<span class="icon-text">${p}</span>
</div>
<div>
<img src="/local/sky-tonight-native-card/images/moon-phases/moon-${this.transformString(h)}.png" alt="${this.translate(h)}" />
<span class="icon-text">${this.translate(h)}</span>
</div>
</div>
</div>`;return r.html`${g}${d}`}}e.default=s},312:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.binocularsObjects=e.ObjectTypes=e.objects=e.CARD_EDITOR_NAME=e.CARD_NAME=void 0,e.CARD_NAME="sky-tonight-native-card",e.CARD_EDITOR_NAME=`${e.CARD_NAME}-editor`,e.objects=["sun","mercury","venus","moon","mars","jupiter","saturn","uranus","neptune","pluto"],e.ObjectTypes={Sun:"Star",Mercury:"Planet",Venus:"Planet",Moon:"Moon",Mars:"Planet",Jupiter:"Planet",Saturn:"Planet",Uranus:"Planet",Neptune:"Planet",Pluto:"Dwarf Planet"},e.binocularsObjects=["Sun","Mercury","Venus","Moon","Mars","Jupiter","Saturn","Uranus","Neptune"]},384:function(t,e,n){var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};Object.defineProperty(e,"__esModule",{value:!0}),e.FormulaOneCardEditor=void 0;const i=n(197),o=n(677),a=n(692),s=n(595),c=n(312);let u=class extends o.LitElement{setConfig(t){this.config=t}get _title(){var t;return null===(t=this.config)||void 0===t?void 0:t.title}get _latitude(){var t;return null===(t=this.config)||void 0===t?void 0:t.latitude}get _longitude(){var t;return null===(t=this.config)||void 0===t?void 0:t.longitude}get _elevation(){var t;return null===(t=this.config)||void 0===t?void 0:t.elevation}get _time(){var t;return null===(t=this.config)||void 0===t?void 0:t.time}get _showSun(){var t,e;return void 0!==(null===(t=this.config)||void 0===t?void 0:t.showSun)&&(null===(e=this.config)||void 0===e?void 0:e.showSun)}get _onlyAboveHorizon(){var t,e;return void 0!==(null===(t=this.config)||void 0===t?void 0:t.onlyAboveHorizon)&&(null===(e=this.config)||void 0===e?void 0:e.onlyAboveHorizon)}get _weatherEntity(){var t;return null===(t=this.config)||void 0===t?void 0:t.weatherEntity}generateCheckbox(t,e,n){return a.html`
<ha-formfield label=${e}>
<ha-switch
.checked=${n}
.configValue=${t}
@change=${this._valueChanged}
></ha-switch>
</ha-formfield>
`}render(){return this.hass&&this.config?a.html`
<div class="card-config">
<div class="tabs">
<div class="tab">
<input type="checkbox" id="entity" class="tab-checkbox">
<label class="tab-label" for="entity">Basic configuration</label>
<div class="tab-content">
<paper-input
label="Title"
.value=${this._title}
.placeholder=${this._title}
.configValue=${"title"}
@value-changed=${this._valueChanged}
></paper-input>
<paper-input
label="Latitude"
.value=${this._latitude}
.placeholder=${this._latitude}
.configValue=${"latitude"}
@value-changed=${this._valueChanged}
></paper-input>
<paper-input
label="Longitude"
.value=${this._longitude}
.placeholder=${this._longitude}
.configValue=${"longitude"}
@value-changed=${this._valueChanged}
></paper-input>
<paper-input
label="Elevation"
.value=${this._elevation}
.placeholder=${this._elevation}
.configValue=${"elevation"}
@value-changed=${this._valueChanged}
></paper-input>
<paper-input
label="Time"
.value=${this._time}
.placeholder=${this._time}
.configValue=${"time"}
@value-changed=${this._valueChanged}
></paper-input>
<paper-input
label="Weather Entity"
.value=${this._weatherEntity}
.placeholder=${this._weatherEntity}
.configValue=${"weatherEntity"}
@value-changed=${this._valueChanged}
></paper-input>
<div class="side-by-side">
${this.generateCheckbox("showSun","Show Sun?",this._showSun)}
${this.generateCheckbox("onlyAboveHorizon","Only Above Horizon?",this._onlyAboveHorizon)}
</div>
</div>
</div>
</div>
</div>
`:a.html``}_valueChangedSelect(t){if(!this.config||!this.hass)return;const e=t.detail.value.itemValue,n=t.detail.value.parentElement.configValue;if(n)if(""===t.detail.value.itemValue){const t=Object.assign({},this.config);delete t[n],this.config=t}else this.config=Object.assign(Object.assign({},this.config),{[n]:e});(0,i.fireEvent)(this,"config-changed",{config:this.config})}_valueChanged(t){if(!this.config||!this.hass)return;const e=t.target;if(e.configValue)if(""===e.value){const t=Object.assign({},this.config);delete t[e.configValue],this.config=t}else this.config=Object.assign(Object.assign({},this.config),{[e.configValue]:void 0!==e.checked?e.checked:e.value});(0,i.fireEvent)(this,"config-changed",{config:this.config})}static get styles(){return o.css`
ha-switch {
padding: 16px 6px;
}
.side-by-side {
display: flex;
flex-flow: row wrap;
}
.side-by-side > * {
padding-right: 8px;
width: 50%;
flex-flow: column wrap;
box-sizing: border-box;
}
.side-by-side > *:last-child {
flex: 1;
padding-right: 0;
}
.suffix {
margin: 0 8px;
}
.group {
padding: 15px;
border: 1px solid var(--primary-text-color)
}
.tabs {
overflow: hidden;
}
.tab {
width: 100%;
color: var(--primary-text-color);
overflow: hidden;
}
.tab-label {
display: flex;
justify-content: space-between;
padding: 1em 1em 1em 0em;
border-bottom: 1px solid var(--secondary-text-color);
font-weight: bold;
cursor: pointer;
}
.tab-label:hover {
/*background: #1a252f;*/
}
.tab-label::after {
content: "❯";
width: 1em;
height: 1em;
text-align: center;
transition: all 0.35s;
}
.tab-content {
max-height: 0;
padding: 0 1em;
background: var(--secondary-background-color);
transition: all 0.35s;
}
input.tab-checkbox {
position: absolute;
opacity: 0;
z-index: -1;
}
input.tab-checkbox:checked + .tab-label {
border-color: var(--accent-color);
}
input.tab-checkbox:checked + .tab-label::after {
transform: rotate(90deg);
}
input.tab-checkbox:checked ~ .tab-content {
max-height: 100vh;
padding: 1em;
}
`}};r([(0,s.property)({attribute:!1})],u.prototype,"hass",void 0),r([(0,s.state)()],u.prototype,"config",void 0),u=r([(0,s.customElement)(c.CARD_EDITOR_NAME)],u),e.FormulaOneCardEditor=u},607:function(t,e,n){var r=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},i=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const o=n(147),a=n(595),s=n(677),c=n(593),u=n(299),l=n(650),h=n(312);console.info(`%c ${h.CARD_NAME.toUpperCase()} %c ${o.version}`,"color: cyan; background: black; font-weight: bold;","color: darkblue; background: white; font-weight: bold;"),window.customCards=window.customCards||[],window.customCards.push({type:"sky-tonight-native-card",name:"Sky Tonight Native Card",preview:!1,description:"Get list of visible planetary bodies in your sky"});let d=class extends s.LitElement{set properties(t){this._cardValues=t,this.update(t)}get properties(){return this._cardValues}constructor(){super()}static getConfigElement(){return i(this,void 0,void 0,(function*(){return yield Promise.resolve().then((()=>n(384))),document.createElement(h.CARD_EDITOR_NAME)}))}setConfig(t){(0,c.checkConfig)(t),this.config=Object.assign({},t)}shouldUpdate(t){return(0,c.hasConfigOrCardValuesChanged)(this.config,this,t)}set hass(t){this._hass=t,this.config.hass=t,this.card=new l.default(this)}static get styles(){return u.styles}render(){if(!this._hass||!this.config)return s.html``;try{return s.html`
<ha-card elevation="2">
${this.warning?s.html`<hui-warning>${this.warning}</hui-warning>`:""}
${this.config.title?s.html`<h1 class="card-header">${this.config.title}</h1>`:""}
${this.card.render()}
</ha-card>
`}catch(t){return s.html`<hui-warning>${t.toString()}</hui-warning>`}}getCardSize(){return this.card.cardSize()}};r([(0,a.property)()],d.prototype,"_hass",void 0),r([(0,a.property)()],d.prototype,"config",void 0),r([(0,a.property)()],d.prototype,"card",void 0),r([(0,a.property)()],d.prototype,"warning",void 0),r([(0,a.property)()],d.prototype,"properties",null),d=r([(0,a.customElement)(h.CARD_NAME)],d),e.default=d},299:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.styles=void 0;const r=n(677);e.styles=r.css`
.sky-tonight {
font-size: 12px;
}
.objects-container {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px;
margin-bottom: 10px;
background-color: #162334;
border-radius: 10px;
}
.objects-container .image-container img {
width: 64px;
height: 64px;
}
.objects-container .info-container {
flex-basis: 70%;
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: flex-start;
height: 100%;
}
.objects-container .info-container .type-container,
.objects-container .info-container .name-container,
.objects-container .info-container .position-container {
align-self: flex-start;
}
.objects-container .info-container .type-container .object-type {
font-size: 16px;
}
.objects-container .info-container .type-container .object-type.planet {
color: #f2896c;
}
.objects-container .info-container .type-container .object-type.dwarf-planet {
color: #f2896c;
}
.objects-container .info-container .type-container .object-type.star {
color: #B1B8FF;
}
.objects-container .info-container .type-container .object-type.moon {
color: #BCD6EF;
}
.objects-container .info-container .name-container .object-name {
font-size: 24px;
}
.objects-container .info-container .position-container .object-position {
color: #b6c3d4;
font-size: 16px;
}
.objects-container .icon-container {
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: flex-end;
padding-right: 10px;
}
.objects-container .icon-container img {
width: 16px;
height: 16px;
margin-bottom: 5px;
}
.summary-container {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
background-color: #162334;
border-radius: 10px;
}
.summary-container .text-container {
flex-basis: 50%;
padding: 10px;
}
.summary-container .text-container span {
color: #ffffff;
font-size: 2rem;
}
.summary-container .text-container span.error-text {
color: #ff0000;
font-size: 16px;
}
.summary-container .icon-container {
display: flex;
flex-direction: column;
justify-content: flex-end;
flex-basis: 50%;
padding: 10px 10px 0 0;
}
.summary-container .icon-container img {
width: 16px;
height: 16px;
}
.summary-container .icon-container div {
display: flex;
align-items: center;
}
.summary-container .icon-container .icon-text {
color: #b6c3d4;
font-size: 16px;
margin-left: 5px;
}
`},593:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.reduceArray=e.checkConfig=e.hasConfigOrCardValuesChanged=void 0,e.hasConfigOrCardValuesChanged=(t,e,n)=>{if(n.has("config"))return!0;const r=n.get("_hass");if(r&&t.entity)return r.states[t.entity]!==t.hass.states[t.entity];const i=n.get("card");if(i&&i.parent)return i.parent.properties!==e.properties;const o=n.get("cardValues");return!!o&&o!=e.properties},e.checkConfig=t=>{},e.reduceArray=(t,e)=>void 0===t?[]:e?t.slice(0,e):t},692:(t,e,n)=>{var r;n.r(e),n.d(e,{_$LH:()=>H,html:()=>D,noChange:()=>x,nothing:()=>R,render:()=>V,svg:()=>S});const i=window,o=i.trustedTypes,a=o?o.createPolicy("lit-html",{createHTML:t=>t}):void 0,s="$lit$",c=`lit$${(Math.random()+"").slice(9)}$`,u="?"+c,l=`<${u}>`,h=document,d=()=>h.createComment(""),f=t=>null===t||"object"!=typeof t&&"function"!=typeof t,m=Array.isArray,p=t=>m(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]),g="[ \t\n\f\r]",v=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,y=/-->/g,b=/>/g,_=RegExp(`>|${g}(?:([^\\s"'>=/]+)(${g}*=${g}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),M=/'/g,w=/"/g,A=/^(?:script|style|textarea|title)$/i,E=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),D=E(1),S=E(2),x=Symbol.for("lit-noChange"),R=Symbol.for("lit-nothing"),$=new WeakMap,k=h.createTreeWalker(h,129,null,!1),C=(t,e)=>{const n=t.length-1,r=[];let i,o=2===e?"<svg>":"",u=v;for(let e=0;e<n;e++){const n=t[e];let a,h,d=-1,f=0;for(;f<n.length&&(u.lastIndex=f,h=u.exec(n),null!==h);)f=u.lastIndex,u===v?"!--"===h[1]?u=y:void 0!==h[1]?u=b:void 0!==h[2]?(A.test(h[2])&&(i=RegExp("</"+h[2],"g")),u=_):void 0!==h[3]&&(u=_):u===_?">"===h[0]?(u=null!=i?i:v,d=-1):void 0===h[1]?d=-2:(d=u.lastIndex-h[2].length,a=h[1],u=void 0===h[3]?_:'"'===h[3]?w:M):u===w||u===M?u=_:u===y||u===b?u=v:(u=_,i=void 0);const m=u===_&&t[e+1].startsWith("/>")?" ":"";o+=u===v?n+l:d>=0?(r.push(a),n.slice(0,d)+s+n.slice(d)+c+m):n+c+(-2===d?(r.push(void 0),e):m)}const h=o+(t[n]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==a?a.createHTML(h):h,r]};class z{constructor({strings:t,_$litType$:e},n){let r;this.parts=[];let i=0,a=0;const l=t.length-1,h=this.parts,[f,m]=C(t,e);if(this.el=z.createElement(f,n),k.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(r=k.nextNode())&&h.length<l;){if(1===r.nodeType){if(r.hasAttributes()){const t=[];for(const e of r.getAttributeNames())if(e.endsWith(s)||e.startsWith(c)){const n=m[a++];if(t.push(e),void 0!==n){const t=r.getAttribute(n.toLowerCase()+s).split(c),e=/([.?@])?(.*)/.exec(n);h.push({type:1,index:i,name:e[2],strings:t,ctor:"."===e[1]?T:"?"===e[1]?G:"@"===e[1]?L:N})}else h.push({type:6,index:i})}for(const e of t)r.removeAttribute(e)}if(A.test(r.tagName)){const t=r.textContent.split(c),e=t.length-1;if(e>0){r.textContent=o?o.emptyScript:"";for(let n=0;n<e;n++)r.append(t[n],d()),k.nextNode(),h.push({type:2,index:++i});r.append(t[e],d())}}}else if(8===r.nodeType)if(r.data===u)h.push({type:2,index:i});else{let t=-1;for(;-1!==(t=r.data.indexOf(c,t+1));)h.push({type:7,index:i}),t+=c.length-1}i++}}static createElement(t,e){const n=h.createElement("template");return n.innerHTML=t,n}}function P(t,e,n=t,r){var i,o,a,s;if(e===x)return e;let c=void 0!==r?null===(i=n._$Co)||void 0===i?void 0:i[r]:n._$Cl;const u=f(e)?void 0:e._$litDirective$;return(null==c?void 0:c.constructor)!==u&&(null===(o=null==c?void 0:c._$AO)||void 0===o||o.call(c,!1),void 0===u?c=void 0:(c=new u(t),c._$AT(t,n,r)),void 0!==r?(null!==(a=(s=n)._$Co)&&void 0!==a?a:s._$Co=[])[r]=c:n._$Cl=c),void 0!==c&&(e=P(t,c._$AS(t,e.values),c,r)),e}class O{constructor(t,e){this.u=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(t){var e;const{el:{content:n},parts:r}=this._$AD,i=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:h).importNode(n,!0);k.currentNode=i;let o=k.nextNode(),a=0,s=0,c=r[0];for(;void 0!==c;){if(a===c.index){let e;2===c.type?e=new I(o,o.nextSibling,this,t):1===c.type?e=new c.ctor(o,c.name,c.strings,this,t):6===c.type&&(e=new j(o,this,t)),this.u.push(e),c=r[++s]}a!==(null==c?void 0:c.index)&&(o=k.nextNode(),a++)}return i}p(t){let e=0;for(const n of this.u)void 0!==n&&(void 0!==n.strings?(n._$AI(t,n,e),e+=n.strings.length-2):n._$AI(t[e])),e++}}class I{constructor(t,e,n,r){var i;this.type=2,this._$AH=R,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=n,this.options=r,this._$Cm=null===(i=null==r?void 0:r.isConnected)||void 0===i||i}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cm}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===(null==t?void 0:t.nodeType)&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=P(this,t,e),f(t)?t===R||null==t||""===t?(this._$AH!==R&&this._$AR(),this._$AH=R):t!==this._$AH&&t!==x&&this.g(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):p(t)?this.k(t):this.g(t)}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t))}g(t){this._$AH!==R&&f(this._$AH)?this._$AA.nextSibling.data=t:this.T(h.createTextNode(t)),this._$AH=t}$(t){var e;const{values:n,_$litType$:r}=t,i="number"==typeof r?this._$AC(t):(void 0===r.el&&(r.el=z.createElement(r.h,this.options)),r);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===i)this._$AH.p(n);else{const t=new O(i,this),e=t.v(this.options);t.p(n),this.T(e),this._$AH=t}}_$AC(t){let e=$.get(t.strings);return void 0===e&&$.set(t.strings,e=new z(t)),e}k(t){m(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let n,r=0;for(const i of t)r===e.length?e.push(n=new I(this.S(d()),this.S(d()),this,this.options)):n=e[r],n._$AI(i),r++;r<e.length&&(this._$AR(n&&n._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){var n;for(null===(n=this._$AP)||void 0===n||n.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cm=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class N{constructor(t,e,n,r,i){this.type=1,this._$AH=R,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=i,n.length>2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=R}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,n,r){const i=this.strings;let o=!1;if(void 0===i)t=P(this,t,e,0),o=!f(t)||t!==this._$AH&&t!==x,o&&(this._$AH=t);else{const r=t;let a,s;for(t=i[0],a=0;a<i.length-1;a++)s=P(this,r[n+a],e,a),s===x&&(s=this._$AH[a]),o||(o=!f(s)||s!==this._$AH[a]),s===R?t=R:t!==R&&(t+=(null!=s?s:"")+i[a+1]),this._$AH[a]=s}o&&!r&&this.j(t)}j(t){t===R?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class T extends N{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===R?void 0:t}}const U=o?o.emptyScript:"";class G extends N{constructor(){super(...arguments),this.type=4}j(t){t&&t!==R?this.element.setAttribute(this.name,U):this.element.removeAttribute(this.name)}}class L extends N{constructor(t,e,n,r,i){super(t,e,n,r,i),this.type=5}_$AI(t,e=this){var n;if((t=null!==(n=P(this,t,e,0))&&void 0!==n?n:R)===x)return;const r=this._$AH,i=t===R&&r!==R||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,o=t!==R&&(r===R||i);i&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,n;"function"==typeof this._$AH?this._$AH.call(null!==(n=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==n?n:this.element,t):this._$AH.handleEvent(t)}}class j{constructor(t,e,n){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(t){P(this,t)}}const H={P:s,A:c,M:u,C:1,L:C,D:O,R:p,V:P,I,H:N,N:G,U:L,F:T,B:j},F=i.litHtmlPolyfillSupport;null==F||F(z,I),(null!==(r=i.litHtmlVersions)&&void 0!==r?r:i.litHtmlVersions=[]).push("2.7.0");const V=(t,e,n)=>{var r,i;const o=null!==(r=null==n?void 0:n.renderBefore)&&void 0!==r?r:e;let a=o._$litPart$;if(void 0===a){const t=null!==(i=null==n?void 0:n.renderBefore)&&void 0!==i?i:null;o._$litPart$=a=new I(e.insertBefore(d(),t),t,void 0,null!=n?n:{})}return a._$AI(t),a}},595:(t,e,n)=>{n.r(e),n.d(e,{customElement:()=>r,eventOptions:()=>c,property:()=>o,query:()=>u,queryAll:()=>l,queryAssignedElements:()=>m,queryAssignedNodes:()=>p,queryAsync:()=>h,state:()=>a});const r=t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:n,elements:r}=e;return{kind:n,elements:r,finisher(e){customElements.define(t,e)}}})(t,e),i=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(n){n.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(n){n.createProperty(e.key,t)}};function o(t){return(e,n)=>void 0!==n?((t,e,n)=>{e.constructor.createProperty(n,t)})(t,e,n):i(t,e)}function a(t){return o({...t,state:!0})}const s=({finisher:t,descriptor:e})=>(n,r)=>{var i;if(void 0===r){const r=null!==(i=n.originalKey)&&void 0!==i?i:n.key,o=null!=e?{kind:"method",placement:"prototype",key:r,descriptor:e(n.key)}:{...n,key:r};return null!=t&&(o.finisher=function(e){t(e,r)}),o}{const i=n.constructor;void 0!==e&&Object.defineProperty(n,r,e(r)),null==t||t(i,r)}};function c(t){return s({finisher:(e,n)=>{Object.assign(e.prototype[n],t)}})}function u(t,e){return s({descriptor:n=>{const r={get(){var e,n;return null!==(n=null===(e=this.renderRoot)||void 0===e?void 0:e.querySelector(t))&&void 0!==n?n:null},enumerable:!0,configurable:!0};if(e){const e="symbol"==typeof n?Symbol():"__"+n;r.get=function(){var n,r;return void 0===this[e]&&(this[e]=null!==(r=null===(n=this.renderRoot)||void 0===n?void 0:n.querySelector(t))&&void 0!==r?r:null),this[e]}}return r}})}function l(t){return s({descriptor:e=>({get(){var e,n;return null!==(n=null===(e=this.renderRoot)||void 0===e?void 0:e.querySelectorAll(t))&&void 0!==n?n:[]},enumerable:!0,configurable:!0})})}function h(t){return s({descriptor:e=>({async get(){var e;return await this.updateComplete,null===(e=this.renderRoot)||void 0===e?void 0:e.querySelector(t)},enumerable:!0,configurable:!0})})}var d;const f=null!=(null===(d=window.HTMLSlotElement)||void 0===d?void 0:d.prototype.assignedElements)?(t,e)=>t.assignedElements(e):(t,e)=>t.assignedNodes(e).filter((t=>t.nodeType===Node.ELEMENT_NODE));function m(t){const{slot:e,selector:n}=null!=t?t:{};return s({descriptor:r=>({get(){var r;const i="slot"+(e?`[name=${e}]`:":not([name])"),o=null===(r=this.renderRoot)||void 0===r?void 0:r.querySelector(i),a=null!=o?f(o,t):[];return n?a.filter((t=>t.matches(n))):a},enumerable:!0,configurable:!0})})}function p(t,e,n){let r,i=t;return"object"==typeof t?(i=t.slot,r=t):r={flatten:e},n?m({slot:i,flatten:e,selector:n}):s({descriptor:t=>({get(){var t,e;const n="slot"+(i?`[name=${i}]`:":not([name])"),o=null===(t=this.renderRoot)||void 0===t?void 0:t.querySelector(n);return null!==(e=null==o?void 0:o.assignedNodes(r))&&void 0!==e?e:[]},enumerable:!0,configurable:!0})})}},677:(t,e,n)=>{n.r(e),n.d(e,{CSSResult:()=>s,LitElement:()=>D,ReactiveElement:()=>_,UpdatingElement:()=>E,_$LE:()=>x,_$LH:()=>A._$LH,adoptStyles:()=>l,css:()=>u,defaultConverter:()=>v,getCompatibleStyle:()=>h,html:()=>A.html,isServer:()=>R,noChange:()=>A.noChange,notEqual:()=>y,nothing:()=>A.nothing,render:()=>A.render,supportsAdoptingStyleSheets:()=>i,svg:()=>A.svg,unsafeCSS:()=>c});const r=window,i=r.ShadowRoot&&(void 0===r.ShadyCSS||r.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol(),a=new WeakMap;class s{constructor(t,e,n){if(this._$cssResult$=!0,n!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(i&&void 0===t){const n=void 0!==e&&1===e.length;n&&(t=a.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),n&&a.set(e,t))}return t}toString(){return this.cssText}}const c=t=>new s("string"==typeof t?t:t+"",void 0,o),u=(t,...e)=>{const n=1===t.length?t[0]:e.reduce(((e,n,r)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[r+1]),t[0]);return new s(n,t,o)},l=(t,e)=>{i?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const n=document.createElement("style"),i=r.litNonce;void 0!==i&&n.setAttribute("nonce",i),n.textContent=e.cssText,t.appendChild(n)}))},h=i?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const n of t.cssRules)e+=n.cssText;return c(e)})(t):t;var d;const f=window,m=f.trustedTypes,p=m?m.emptyScript:"",g=f.reactiveElementPolyfillSupport,v={toAttribute(t,e){switch(e){case Boolean:t=t?p:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=null!==t;break;case Number:n=null===t?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch(t){n=null}}return n}},y=(t,e)=>e!==t&&(e==e||t==t),b={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:y};class _ extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,n)=>{const r=this._$Ep(n,e);void 0!==r&&(this._$Ev.set(r,n),t.push(r))})),t}static createProperty(t,e=b){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const n="symbol"==typeof t?Symbol():"__"+t,r=this.getPropertyDescriptor(t,n,e);void 0!==r&&Object.defineProperty(this.prototype,t,r)}}static getPropertyDescriptor(t,e,n){return{get(){return this[e]},set(r){const i=this[t];this[e]=r,this.requestUpdate(t,i,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||b}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const n of e)this.createProperty(n,t[n])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const n=new Set(t.flat(1/0).reverse());for(const t of n)e.unshift(h(t))}else void 0!==t&&e.push(h(t));return e}static _$Ep(t,e){const n=e.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof t?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,n;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(n=t.hostConnected)||void 0===n||n.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return l(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,n){this._$AK(t,n)}_$EO(t,e,n=b){var r;const i=this.constructor._$Ep(t,n);if(void 0!==i&&!0===n.reflect){const o=(void 0!==(null===(r=n.converter)||void 0===r?void 0:r.toAttribute)?n.converter:v).toAttribute(e,n.type);this._$El=t,null==o?this.removeAttribute(i):this.setAttribute(i,o),this._$El=null}}_$AK(t,e){var n;const r=this.constructor,i=r._$Ev.get(t);if(void 0!==i&&this._$El!==i){const t=r.getPropertyOptions(i),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(n=t.converter)||void 0===n?void 0:n.fromAttribute)?t.converter:v;this._$El=i,this[i]=o.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,n){let r=!0;void 0!==t&&(((n=n||this.constructor.getPropertyOptions(t)).hasChanged||y)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===n.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,n))):r=!1),!this.isUpdatePending&&r&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const n=this._$AL;try{e=this.shouldUpdate(n),e?(this.willUpdate(n),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(n)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(n)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}_.finalized=!0,_.elementProperties=new Map,_.elementStyles=[],_.shadowRootOptions={mode:"open"},null==g||g({ReactiveElement:_}),(null!==(d=f.reactiveElementVersions)&&void 0!==d?d:f.reactiveElementVersions=[]).push("1.6.1");var M,w,A=n(692);const E=_;class D extends _{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const n=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=n.firstChild),n}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=(0,A.render)(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return A.noChange}}D.finalized=!0,D._$litElement$=!0,null===(M=globalThis.litElementHydrateSupport)||void 0===M||M.call(globalThis,{LitElement:D});const S=globalThis.litElementPolyfillSupport;null==S||S({LitElement:D});const x={_$AK:(t,e,n)=>{t._$AK(e,n)},_$AL:t=>t._$AL};(null!==(w=globalThis.litElementVersions)&&void 0!==w?w:globalThis.litElementVersions=[]).push("3.3.0");const R=!1},147:t=>{t.exports=JSON.parse('{"name":"sky-tonight-native-card","version":"0.0.1","description":"Get list of visible planetary bodies in your sky","main":"index.js","scripts":{"lint":"eslint src/**/*.ts","dev":"webpack -c webpack.config.js","build":"yarn lint && webpack -c webpack.config.js","test":"jest","coverage":"jest --coverage","workflow":"jest --coverage --json --outputFile=/home/runner/work/sky-tonight-native-card/sky-tonight-native-card/jest.results.json","prebuild":"cp git-hooks/pre-commit .git/hooks/ && echo \'hook copied\'"},"repository":{"type":"git","url":"git+https://github.com/wwwescape/sky-tonight-native-card.git"},"keywords":[],"author":"","license":"ISC","bugs":{"url":"https://github.com/wwwescape/sky-tonight-native-card/issues"},"homepage":"https://github.com/wwwescape/sky-tonight-native-card#readme","devDependencies":{"@types/jest":"^29.5.2","@typescript-eslint/eslint-plugin":"^5.59.8","@typescript-eslint/parser":"^5.59.1","codecov":"^3.8.3","eslint":"^8.44.0","home-assistant-js-websocket":"^8.1.0","lit":"^2.7.4","typescript":"^4.9.5","webpack":"^5.81.0","webpack-cli":"^5.0.2"},"dependencies":{"@babel/plugin-transform-runtime":"^7.22.5","@babel/preset-env":"^7.22.5","@lit-labs/scoped-registry-mixin":"^1.0.1","astronomy-engine":"^2.1.17","babel-jest":"^29.5.0","compression-webpack-plugin":"^10.0.0","custom-card-helpers":"^1.9.0","isomorphic-fetch":"^3.0.0","jest-environment-jsdom":"^29.5.0","jest-fetch-mock":"^3.0.3","jest-ts-auto-mock":"^2.1.0","ts-auto-mock":"^3.6.4","ts-jest":"^29.1.1","ts-loader":"^9.4.2","ttypescript":"^1.5.15","yarn":"^1.22.19"}}')}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={exports:{}};return t[r].call(o.exports,o,o.exports,n),o.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n(607)})();