@magmacomputing/tempo-plugin-astro 1.1.3 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -39,7 +39,7 @@ When resolving the term, the plugin intelligently returns the correct astronomic
39
39
  key: 'Vernal', // Flips to 'Autumnal' if sphere is set to 'south'
40
40
  season: 'Spring', // Flips to 'Autumn' if sphere is set to 'south'
41
41
  sphere: 'north', // Flips to 'south' if sphere is set to 'south'
42
- type: 'Equinox',
42
+ event: 'Equinox',
43
43
  group: 'astronomy',
44
44
  year: 2026,
45
45
  month: 3,
package/dist/index.d.ts CHANGED
@@ -1,4 +1,25 @@
1
1
  import { Tempo } from '@magmacomputing/tempo/core';
2
+ declare module '@magmacomputing/tempo/core' {
3
+ interface TempoTermRegistry {
4
+ astro: 'Vernal' | 'Summer' | 'Autumnal' | 'Winter';
5
+ astronomy: {
6
+ key: 'Vernal' | 'Summer' | 'Autumnal' | 'Winter';
7
+ season: Tempo.SEASON;
8
+ sphere: Tempo.COMPASS;
9
+ event: 'Equinox' | 'Solstice';
10
+ group: 'astronomy';
11
+ year: number;
12
+ month: number;
13
+ day: number;
14
+ hour: number;
15
+ minute: number;
16
+ second: number;
17
+ millisecond: number;
18
+ microsecond: number;
19
+ nanosecond: number;
20
+ };
21
+ }
22
+ }
2
23
  /**
3
24
  * ## AstroTerm
4
25
  * Exposes precise astronomical calculations as a standard Tempo scope.
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- function a0_0x76a1(_0x2fe614,_0x24c14a){_0x2fe614=_0x2fe614-0x140;const _0x58a836=a0_0x58a8();let _0x76a1d4=_0x58a836[_0x2fe614];return _0x76a1d4;}const a0_0x224e2b=a0_0x76a1;(function(_0x4a30f5,_0xc0a83b){const _0x3c949a=a0_0x76a1,_0x212712=_0x4a30f5();while(!![]){try{const _0xa1c8e0=parseInt(_0x3c949a(0x156))/0x1+-parseInt(_0x3c949a(0x15d))/0x2*(parseInt(_0x3c949a(0x14d))/0x3)+parseInt(_0x3c949a(0x146))/0x4*(parseInt(_0x3c949a(0x168))/0x5)+parseInt(_0x3c949a(0x154))/0x6+-parseInt(_0x3c949a(0x15a))/0x7+-parseInt(_0x3c949a(0x142))/0x8+parseInt(_0x3c949a(0x15f))/0x9*(parseInt(_0x3c949a(0x151))/0xa);if(_0xa1c8e0===_0xc0a83b)break;else _0x212712['push'](_0x212712['shift']());}catch(_0x4dea5d){_0x212712['push'](_0x212712['shift']());}}}(a0_0x58a8,0xacd0a));import{Tempo,enums}from'@magmacomputing/tempo/core';import{getTermRange}from'@magmacomputing/tempo/term';import{definePremiumTerm}from'@magmacomputing/tempo/plugin';import{enumify}from'@magmacomputing/tempo/library';var ASTRO=enumify({'Vernal':a0_0x224e2b(0x153),'Summer':a0_0x224e2b(0x149),'Autumnal':a0_0x224e2b(0x148),'Winter':a0_0x224e2b(0x150)}),{COMPASS,SEASON,DURATIONS}=enums,key='astro',scope=a0_0x224e2b(0x169);function calculateAstroMoment(_0xd31cde,_0xe6797f,_0x5aaef0){const _0x48ee99=a0_0x224e2b,_0x308371=(_0xd31cde-0x7d0)/0x3e8;let _0x20a963;switch(_0xe6797f){case ASTRO[_0x48ee99(0x141)]:_0x20a963=2451623.80984+365242.37404*_0x308371+0.05169*_0x308371*_0x308371;break;case ASTRO[_0x48ee99(0x161)]:_0x20a963=2451716.56767+365241.62603*_0x308371+0.00325*_0x308371*_0x308371;break;case ASTRO['Autumnal']:_0x20a963=2451810.21715+365242.01767*_0x308371-0.11575*_0x308371*_0x308371;break;case ASTRO[_0x48ee99(0x163)]:_0x20a963=2451900.05952+365242.74049*_0x308371-0.06223*_0x308371*_0x308371;break;}const _0x4c5dba=Math[_0x48ee99(0x157)]((_0x20a963-2440587.5)*DURATIONS[_0x48ee99(0x158)]);return new Tempo(_0x4c5dba,{'timeZone':_0x5aaef0,'timeStamp':'ms'});}function a0_0x58a8(){const _0x11fb03=['nanosecond','vernal','3785430oTxUjz','map','305870fdJdzx','trunc','days','Autumnal','7304073zHukfs','add','Autumn','10AATPUh','push','25176483CxvDZR','extend','Summer','month','Winter','microsecond','Solstice','day','sphere','2175lIydJY','astronomy','key','UTC','minute','Vernal','7811704CzMfNG','second','hour','South','1396QAuKiW','with','autumnal','summer','timeZoneId','find','Equinox','694935OGEAxS','year','millisecond','winter','10pWNvnz'];a0_0x58a8=function(){return _0x11fb03;};return a0_0x58a8();}function resolve(_0x3a4fd9,_0x5bac12){const _0x362dc0=a0_0x224e2b,_0x3c4466=_0x3a4fd9['config'][_0x362dc0(0x167)];if(!_0x3c4466)return[];const _0x1cf47a=_0x5bac12?.['yy']??_0x5bac12?.[_0x362dc0(0x14e)]??_0x3a4fd9['yy'],_0x2490f5=_0x5bac12?.[_0x362dc0(0x14a)]??_0x3a4fd9['tz']??_0x362dc0(0x16b),_0x293ec8=[],_0x5c6d3f=_0x3c4466===COMPASS[_0x362dc0(0x145)]?{'vernal':_0x362dc0(0x159),'summer':_0x362dc0(0x163),'autumnal':'Vernal','winter':'Summer'}:{'vernal':_0x362dc0(0x141),'summer':'Summer','autumnal':_0x362dc0(0x159),'winter':'Winter'},_0x115a91=_0x3c4466===COMPASS['South']?{'vernal':SEASON[_0x362dc0(0x15c)],'summer':SEASON[_0x362dc0(0x163)],'autumnal':SEASON['Spring'],'winter':SEASON['Summer']}:{'vernal':SEASON['Spring'],'summer':SEASON['Summer'],'autumnal':SEASON[_0x362dc0(0x15c)],'winter':SEASON[_0x362dc0(0x163)]};for(const _0x3a04fd of[_0x1cf47a-0x1,_0x1cf47a,_0x1cf47a+0x1]){const _0x1df356=(_0x3f599b,_0x5842d3)=>{const _0x267add=_0x362dc0,_0x4cb90d=calculateAstroMoment(_0x3f599b,_0x5842d3,_0x2490f5),_0xae4311=_0x4cb90d['toDateTime']();return{'year':_0xae4311[_0x267add(0x14e)],'month':_0xae4311[_0x267add(0x162)],'day':_0xae4311['day'],'hour':_0xae4311['hour'],'minute':_0xae4311['minute'],'second':_0xae4311[_0x267add(0x143)],'millisecond':_0xae4311[_0x267add(0x14f)],'microsecond':_0xae4311[_0x267add(0x164)],'nanosecond':_0xae4311[_0x267add(0x152)]};};_0x293ec8['push']({'key':_0x5c6d3f['vernal'],'season':_0x115a91[_0x362dc0(0x153)],'sphere':_0x3c4466,..._0x1df356(_0x3a04fd,ASTRO[_0x362dc0(0x141)]),'type':_0x362dc0(0x14c),'group':'astronomy'}),_0x293ec8[_0x362dc0(0x15e)]({'key':_0x5c6d3f['summer'],'season':_0x115a91['summer'],'sphere':_0x3c4466,..._0x1df356(_0x3a04fd,ASTRO[_0x362dc0(0x161)]),'type':_0x362dc0(0x165),'group':_0x362dc0(0x169)}),_0x293ec8['push']({'key':_0x5c6d3f[_0x362dc0(0x148)],'season':_0x115a91[_0x362dc0(0x148)],'sphere':_0x3c4466,..._0x1df356(_0x3a04fd,ASTRO[_0x362dc0(0x159)]),'type':'Equinox','group':_0x362dc0(0x169)}),_0x293ec8['push']({'key':_0x5c6d3f[_0x362dc0(0x150)],'season':_0x115a91['winter'],'sphere':_0x3c4466,..._0x1df356(_0x3a04fd,ASTRO[_0x362dc0(0x163)]),'type':'Solstice','group':_0x362dc0(0x169)});}return _0x293ec8;}function resolveDateBoundary(_0xfa0d4,_0x233978){const _0x265c95=a0_0x224e2b,_0x44c2b8=resolve(_0xfa0d4,_0x233978);return _0x44c2b8[_0x265c95(0x155)](_0x13dd35=>({..._0x13dd35,'hour':0x0,'minute':0x0,'second':0x0,'millisecond':0x0,'microsecond':0x0,'nanosecond':0x0}));}var AstroTerm=definePremiumTerm({'key':key,'scope':scope,'resolve'(_0x510e47){return resolve(this,_0x510e47);},'define'(_0x2a0072,_0x50bb0d){const _0x4753f1=a0_0x224e2b,_0x472980=resolve(this,_0x50bb0d),_0x1be25f=resolveDateBoundary(this,_0x50bb0d),_0x7521ab=_0x50bb0d??this['toDateTime']();if(_0x2a0072===!![]||_0x2a0072===void 0x0){const _0x110e02=getTermRange(this,_0x1be25f,!![],_0x50bb0d);return _0x110e02;}const _0x103b6d=getTermRange(this,_0x472980,![],_0x50bb0d);if(!_0x103b6d)return _0x103b6d;const _0x992615=getTermRange(this,_0x1be25f,![],_0x50bb0d);if(!_0x992615)return _0x103b6d;const _0xcd99ea=_0x472980[_0x4753f1(0x14b)](_0xccfb5f=>_0xccfb5f[_0x4753f1(0x16a)]===_0x992615['key']&&_0xccfb5f[_0x4753f1(0x14e)]===_0x992615['year']&&_0xccfb5f['month']===_0x992615['month']&&_0xccfb5f[_0x4753f1(0x166)]===_0x992615['day']);if(!_0xcd99ea)return{..._0x992615,'strict':_0x103b6d[_0x4753f1(0x16a)]};const _0x103719=_0x7521ab[_0x4753f1(0x147)]({'year':_0xcd99ea[_0x4753f1(0x14e)],'month':_0xcd99ea[_0x4753f1(0x162)],'day':_0xcd99ea[_0x4753f1(0x166)],'hour':_0xcd99ea[_0x4753f1(0x144)]??0x0,'minute':_0xcd99ea[_0x4753f1(0x140)]??0x0,'second':_0xcd99ea[_0x4753f1(0x143)]??0x0,'millisecond':_0xcd99ea[_0x4753f1(0x14f)]??0x0,'microsecond':_0xcd99ea[_0x4753f1(0x164)]??0x0,'nanosecond':_0xcd99ea['nanosecond']??0x0})[_0x4753f1(0x15b)]({'minutes':0x1}),_0x3dfb1d=getTermRange(this,_0x472980,![],_0x103719);if(!_0x3dfb1d)return{..._0x992615,'strict':_0x103b6d['key']};return{..._0x3dfb1d,'strict':_0x103b6d[_0x4753f1(0x16a)]};}});Tempo[a0_0x224e2b(0x160)](AstroTerm);export{AstroTerm};
1
+ const a0_0x156bb5=a0_0x5924;(function(_0x44a49f,_0x3525f2){const _0x2ea014=a0_0x5924,_0x149a9f=_0x44a49f();while(!![]){try{const _0x4186e5=parseInt(_0x2ea014(0x1bc))/0x1+-parseInt(_0x2ea014(0x1d3))/0x2*(parseInt(_0x2ea014(0x1cd))/0x3)+parseInt(_0x2ea014(0x1d4))/0x4+parseInt(_0x2ea014(0x1b5))/0x5+parseInt(_0x2ea014(0x1c6))/0x6*(-parseInt(_0x2ea014(0x1b6))/0x7)+parseInt(_0x2ea014(0x1de))/0x8*(parseInt(_0x2ea014(0x1d1))/0x9)+parseInt(_0x2ea014(0x1d7))/0xa*(-parseInt(_0x2ea014(0x1bf))/0xb);if(_0x4186e5===_0x3525f2)break;else _0x149a9f['push'](_0x149a9f['shift']());}catch(_0x326041){_0x149a9f['push'](_0x149a9f['shift']());}}}(a0_0x3888,0x9aca2));import{Tempo,enums}from'@magmacomputing/tempo/core';import{getTermRange}from'@magmacomputing/tempo/term';function a0_0x3888(){const _0x58acde=['vernal','second','South','4762355WLfjAR','11571IXGggh','astronomy','year','winter','Vernal','minute','650647ayaawg','Autumn','hour','919105ARxOLL','Solstice','toDateTime','days','month','Spring','summer','948GOHxtV','Autumnal','millisecond','sphere','extend','config','microsecond','444zdeuVt','key','day','Equinox','117YLJHFs','Winter','4372XuDIeV','3968732HcgAaK','autumnal','timeZoneId','190Xhhwwa','astro','push','Summer','map','UTC','trunc','129824xCYJTV','nanosecond','find'];a0_0x3888=function(){return _0x58acde;};return a0_0x3888();}import{definePremiumTerm}from'@magmacomputing/tempo/plugin';import{enumify}from'@magmacomputing/tempo/library';var ASTRO=enumify({'Vernal':a0_0x156bb5(0x1b2),'Summer':a0_0x156bb5(0x1c5),'Autumnal':a0_0x156bb5(0x1d5),'Winter':a0_0x156bb5(0x1b9)}),{COMPASS,SEASON,DURATIONS}=enums,key=a0_0x156bb5(0x1d8),scope='astronomy';function calculateAstroMoment(_0x4d3666,_0x3622ee,_0x5856f8){const _0x379401=a0_0x156bb5,_0x3196fc=(_0x4d3666-0x7d0)/0x3e8;let _0x2d4eeb;switch(_0x3622ee){case ASTRO[_0x379401(0x1ba)]:_0x2d4eeb=2451623.80984+365242.37404*_0x3196fc+0.05169*_0x3196fc*_0x3196fc;break;case ASTRO[_0x379401(0x1da)]:_0x2d4eeb=2451716.56767+365241.62603*_0x3196fc+0.00325*_0x3196fc*_0x3196fc;break;case ASTRO['Autumnal']:_0x2d4eeb=2451810.21715+365242.01767*_0x3196fc-0.11575*_0x3196fc*_0x3196fc;break;case ASTRO[_0x379401(0x1d2)]:_0x2d4eeb=2451900.05952+365242.74049*_0x3196fc-0.06223*_0x3196fc*_0x3196fc;break;}const _0x5a8425=Math[_0x379401(0x1dd)]((_0x2d4eeb-2440587.5)*DURATIONS[_0x379401(0x1c2)]);return new Tempo(_0x5a8425,{'timeZone':_0x5856f8,'timeStamp':'ms'});}function resolve(_0x4f1347,_0x4531d3){const _0x2da391=a0_0x156bb5,_0x577fb=_0x4f1347[_0x2da391(0x1cb)][_0x2da391(0x1c9)];if(!_0x577fb)return[];const _0xe4bb39=_0x4531d3?.['yy']??_0x4531d3?.[_0x2da391(0x1b8)]??_0x4f1347['yy'],_0x1c9714=_0x4531d3?.[_0x2da391(0x1d6)]??_0x4f1347['tz']??_0x2da391(0x1dc),_0x16c714=[],_0x1d49b2=_0x577fb===COMPASS[_0x2da391(0x1b4)]?{'vernal':_0x2da391(0x1c7),'summer':_0x2da391(0x1d2),'autumnal':_0x2da391(0x1ba),'winter':_0x2da391(0x1da)}:{'vernal':_0x2da391(0x1ba),'summer':_0x2da391(0x1da),'autumnal':_0x2da391(0x1c7),'winter':_0x2da391(0x1d2)},_0x5e9ce4=_0x577fb===COMPASS[_0x2da391(0x1b4)]?{'vernal':SEASON[_0x2da391(0x1bd)],'summer':SEASON['Winter'],'autumnal':SEASON[_0x2da391(0x1c4)],'winter':SEASON['Summer']}:{'vernal':SEASON['Spring'],'summer':SEASON[_0x2da391(0x1da)],'autumnal':SEASON[_0x2da391(0x1bd)],'winter':SEASON[_0x2da391(0x1d2)]};for(const _0x1f1c29 of[_0xe4bb39-0x1,_0xe4bb39,_0xe4bb39+0x1]){const _0x526520=(_0x1333e0,_0x411157)=>{const _0x383baf=_0x2da391,_0x545df8=calculateAstroMoment(_0x1333e0,_0x411157,_0x1c9714),_0x4c8ac6=_0x545df8['toDateTime']();return{'year':_0x4c8ac6[_0x383baf(0x1b8)],'month':_0x4c8ac6['month'],'day':_0x4c8ac6[_0x383baf(0x1cf)],'hour':_0x4c8ac6[_0x383baf(0x1be)],'minute':_0x4c8ac6['minute'],'second':_0x4c8ac6[_0x383baf(0x1b3)],'millisecond':_0x4c8ac6[_0x383baf(0x1c8)],'microsecond':_0x4c8ac6[_0x383baf(0x1cc)],'nanosecond':_0x4c8ac6[_0x383baf(0x1b0)]};};_0x16c714['push']({'key':_0x1d49b2[_0x2da391(0x1b2)],'season':_0x5e9ce4[_0x2da391(0x1b2)],'sphere':_0x577fb,..._0x526520(_0x1f1c29,ASTRO['Vernal']),'event':_0x2da391(0x1d0),'group':_0x2da391(0x1b7)}),_0x16c714[_0x2da391(0x1d9)]({'key':_0x1d49b2['summer'],'season':_0x5e9ce4['summer'],'sphere':_0x577fb,..._0x526520(_0x1f1c29,ASTRO[_0x2da391(0x1da)]),'event':'Solstice','group':'astronomy'}),_0x16c714[_0x2da391(0x1d9)]({'key':_0x1d49b2[_0x2da391(0x1d5)],'season':_0x5e9ce4[_0x2da391(0x1d5)],'sphere':_0x577fb,..._0x526520(_0x1f1c29,ASTRO[_0x2da391(0x1c7)]),'event':'Equinox','group':_0x2da391(0x1b7)}),_0x16c714[_0x2da391(0x1d9)]({'key':_0x1d49b2[_0x2da391(0x1b9)],'season':_0x5e9ce4[_0x2da391(0x1b9)],'sphere':_0x577fb,..._0x526520(_0x1f1c29,ASTRO[_0x2da391(0x1d2)]),'event':_0x2da391(0x1c0),'group':_0x2da391(0x1b7)});}return _0x16c714;}function resolveDateBoundary(_0x27c6ab,_0x5f3cb0){const _0x3f3bfe=a0_0x156bb5,_0x533b69=resolve(_0x27c6ab,_0x5f3cb0);return _0x533b69[_0x3f3bfe(0x1db)](_0x482d46=>({..._0x482d46,'hour':0x0,'minute':0x0,'second':0x0,'millisecond':0x0,'microsecond':0x0,'nanosecond':0x0}));}var AstroTerm=definePremiumTerm({'key':key,'scope':scope,'resolve'(_0x1f5504){return resolve(this,_0x1f5504);},'define'(_0x1f0da3,_0x3d5a10){const _0x58ddba=a0_0x156bb5,_0x59a978=resolve(this,_0x3d5a10),_0x2e7b72=resolveDateBoundary(this,_0x3d5a10),_0x4477f9=_0x3d5a10??this[_0x58ddba(0x1c1)]();if(_0x1f0da3===!![]||_0x1f0da3===void 0x0){const _0x482ccf=getTermRange(this,_0x2e7b72,!![],_0x3d5a10);return _0x482ccf;}const _0x4fe544=getTermRange(this,_0x59a978,![],_0x3d5a10);if(!_0x4fe544)return _0x4fe544;const _0x255220=getTermRange(this,_0x2e7b72,![],_0x3d5a10);if(!_0x255220)return _0x4fe544;const _0x5424e4=_0x59a978[_0x58ddba(0x1b1)](_0x5b5172=>_0x5b5172[_0x58ddba(0x1ce)]===_0x255220[_0x58ddba(0x1ce)]&&_0x5b5172[_0x58ddba(0x1b8)]===_0x255220[_0x58ddba(0x1b8)]&&_0x5b5172[_0x58ddba(0x1c3)]===_0x255220[_0x58ddba(0x1c3)]&&_0x5b5172[_0x58ddba(0x1cf)]===_0x255220['day']);if(!_0x5424e4)return{..._0x255220,'strict':_0x4fe544['key']};const _0x119779=_0x4477f9['with']({'year':_0x5424e4[_0x58ddba(0x1b8)],'month':_0x5424e4[_0x58ddba(0x1c3)],'day':_0x5424e4['day'],'hour':_0x5424e4[_0x58ddba(0x1be)]??0x0,'minute':_0x5424e4[_0x58ddba(0x1bb)]??0x0,'second':_0x5424e4[_0x58ddba(0x1b3)]??0x0,'millisecond':_0x5424e4[_0x58ddba(0x1c8)]??0x0,'microsecond':_0x5424e4[_0x58ddba(0x1cc)]??0x0,'nanosecond':_0x5424e4['nanosecond']??0x0})['add']({'minutes':0x1}),_0x50b299=getTermRange(this,_0x59a978,![],_0x119779);if(!_0x50b299)return{..._0x255220,'strict':_0x4fe544[_0x58ddba(0x1ce)]};return{..._0x50b299,'strict':_0x4fe544['key']};}});Tempo[a0_0x156bb5(0x1ca)](AstroTerm);function a0_0x5924(_0x1ec4c8,_0xf7a27d){_0x1ec4c8=_0x1ec4c8-0x1b0;const _0x388883=a0_0x3888();let _0x5924b7=_0x388883[_0x1ec4c8];return _0x5924b7;}export{AstroTerm};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magmacomputing/tempo-plugin-astro",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "Tempo plugin that calculates precise astronomical seasons (solstices & equinoxes) using the Jean Meeus algorithm — hemisphere-aware, sub-minute accuracy",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",