@drincs/nqtr 0.3.0 → 0.3.2

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.
Files changed (233) hide show
  1. package/dist/{RoomInterface-D7qXKwBI.d.ts → RoomInterface-BglEhkQT.d.ts} +12 -12
  2. package/dist/{RoomInterface-C7Sg80EF.d.mts → RoomInterface-DsZAp6Pv.d.mts} +12 -12
  3. package/dist/{StageInterface-DmLgfrk4.d.mts → StageInterface-DJ7l0ubG.d.mts} +17 -17
  4. package/dist/{StageInterface-DmLgfrk4.d.ts → StageInterface-DJ7l0ubG.d.ts} +17 -17
  5. package/dist/classes/ActivityBaseModel.d.mts +4 -4
  6. package/dist/classes/ActivityBaseModel.d.ts +4 -4
  7. package/dist/classes/ActivityBaseModel.js +1 -1
  8. package/dist/classes/ActivityBaseModel.js.map +1 -1
  9. package/dist/classes/ActivityBaseModel.mjs +1 -1
  10. package/dist/classes/ActivityBaseModel.mjs.map +1 -1
  11. package/dist/classes/ActivityStoredClass.d.mts +4 -4
  12. package/dist/classes/ActivityStoredClass.d.ts +4 -4
  13. package/dist/classes/ActivityStoredClass.js +1 -1
  14. package/dist/classes/ActivityStoredClass.js.map +1 -1
  15. package/dist/classes/ActivityStoredClass.mjs +1 -1
  16. package/dist/classes/ActivityStoredClass.mjs.map +1 -1
  17. package/dist/classes/CommitmentBaseModel.d.mts +3 -3
  18. package/dist/classes/CommitmentBaseModel.d.ts +3 -3
  19. package/dist/classes/CommitmentBaseModel.js +1 -1
  20. package/dist/classes/CommitmentBaseModel.js.map +1 -1
  21. package/dist/classes/CommitmentBaseModel.mjs +1 -1
  22. package/dist/classes/CommitmentBaseModel.mjs.map +1 -1
  23. package/dist/classes/CommitmentStoredClass.d.mts +5 -5
  24. package/dist/classes/CommitmentStoredClass.d.ts +5 -5
  25. package/dist/classes/CommitmentStoredClass.js +1 -1
  26. package/dist/classes/CommitmentStoredClass.js.map +1 -1
  27. package/dist/classes/CommitmentStoredClass.mjs +1 -1
  28. package/dist/classes/CommitmentStoredClass.mjs.map +1 -1
  29. package/dist/classes/index.d.mts +6 -6
  30. package/dist/classes/index.d.ts +6 -6
  31. package/dist/classes/index.js +1 -1
  32. package/dist/classes/index.js.map +1 -1
  33. package/dist/classes/index.mjs +1 -1
  34. package/dist/classes/index.mjs.map +1 -1
  35. package/dist/classes/navigation/LocationBaseModel.d.mts +3 -3
  36. package/dist/classes/navigation/LocationBaseModel.d.ts +3 -3
  37. package/dist/classes/navigation/LocationBaseModel.js +1 -1
  38. package/dist/classes/navigation/LocationBaseModel.mjs +1 -1
  39. package/dist/classes/navigation/LocationStoredClass.d.mts +6 -6
  40. package/dist/classes/navigation/LocationStoredClass.d.ts +6 -6
  41. package/dist/classes/navigation/LocationStoredClass.js +1 -1
  42. package/dist/classes/navigation/LocationStoredClass.mjs +1 -1
  43. package/dist/classes/navigation/MapBaseModel.d.mts +2 -2
  44. package/dist/classes/navigation/MapBaseModel.d.ts +2 -2
  45. package/dist/classes/navigation/MapBaseModel.js +1 -1
  46. package/dist/classes/navigation/MapBaseModel.mjs +1 -1
  47. package/dist/classes/navigation/MapStoredClass.d.mts +5 -5
  48. package/dist/classes/navigation/MapStoredClass.d.ts +5 -5
  49. package/dist/classes/navigation/NavigationAbstractClass.d.mts +6 -6
  50. package/dist/classes/navigation/NavigationAbstractClass.d.ts +6 -6
  51. package/dist/classes/navigation/NavigationAbstractClass.js +1 -1
  52. package/dist/classes/navigation/NavigationAbstractClass.mjs +1 -1
  53. package/dist/classes/navigation/RoomBaseModel.d.mts +4 -4
  54. package/dist/classes/navigation/RoomBaseModel.d.ts +4 -4
  55. package/dist/classes/navigation/RoomBaseModel.js +1 -1
  56. package/dist/classes/navigation/RoomBaseModel.mjs +1 -1
  57. package/dist/classes/navigation/RoomStoredClass.d.mts +6 -6
  58. package/dist/classes/navigation/RoomStoredClass.d.ts +6 -6
  59. package/dist/classes/navigation/RoomStoredClass.js +1 -1
  60. package/dist/classes/navigation/RoomStoredClass.mjs +1 -1
  61. package/dist/classes/quest/QuestBaseModel.d.mts +3 -3
  62. package/dist/classes/quest/QuestBaseModel.d.ts +3 -3
  63. package/dist/classes/quest/QuestBaseModel.js +1 -1
  64. package/dist/classes/quest/QuestBaseModel.js.map +1 -1
  65. package/dist/classes/quest/QuestBaseModel.mjs +1 -1
  66. package/dist/classes/quest/QuestBaseModel.mjs.map +1 -1
  67. package/dist/classes/quest/QuestStoredClass.d.mts +14 -14
  68. package/dist/classes/quest/QuestStoredClass.d.ts +14 -14
  69. package/dist/classes/quest/QuestStoredClass.js +1 -1
  70. package/dist/classes/quest/QuestStoredClass.js.map +1 -1
  71. package/dist/classes/quest/QuestStoredClass.mjs +1 -1
  72. package/dist/classes/quest/QuestStoredClass.mjs.map +1 -1
  73. package/dist/classes/quest/StageBaseModel.d.mts +2 -2
  74. package/dist/classes/quest/StageBaseModel.d.ts +2 -2
  75. package/dist/classes/quest/StageBaseModel.js +1 -1
  76. package/dist/classes/quest/StageBaseModel.js.map +1 -1
  77. package/dist/classes/quest/StageBaseModel.mjs +1 -1
  78. package/dist/classes/quest/StageBaseModel.mjs.map +1 -1
  79. package/dist/classes/quest/StageStoredClass.d.mts +7 -7
  80. package/dist/classes/quest/StageStoredClass.d.ts +7 -7
  81. package/dist/classes/quest/StageStoredClass.js +1 -1
  82. package/dist/classes/quest/StageStoredClass.js.map +1 -1
  83. package/dist/classes/quest/StageStoredClass.mjs +1 -1
  84. package/dist/classes/quest/StageStoredClass.mjs.map +1 -1
  85. package/dist/decorators/ActivityDecorator.d.mts +5 -5
  86. package/dist/decorators/ActivityDecorator.d.ts +5 -5
  87. package/dist/decorators/CommitmentDecorator.d.mts +6 -6
  88. package/dist/decorators/CommitmentDecorator.d.ts +6 -6
  89. package/dist/decorators/QuestDecorator.d.mts +5 -5
  90. package/dist/decorators/QuestDecorator.d.ts +5 -5
  91. package/dist/decorators/RoomDecorator.d.mts +5 -5
  92. package/dist/decorators/RoomDecorator.d.ts +5 -5
  93. package/dist/decorators/index.d.mts +3 -3
  94. package/dist/decorators/index.d.ts +3 -3
  95. package/dist/index.d.mts +11 -8
  96. package/dist/index.d.ts +11 -8
  97. package/dist/index.js +1 -1
  98. package/dist/index.js.map +1 -1
  99. package/dist/index.mjs +1 -1
  100. package/dist/index.mjs.map +1 -1
  101. package/dist/interface/ActivityInterface.d.mts +3 -3
  102. package/dist/interface/ActivityInterface.d.ts +3 -3
  103. package/dist/interface/CommitmentInterface.d.mts +2 -2
  104. package/dist/interface/CommitmentInterface.d.ts +2 -2
  105. package/dist/interface/CommitmentProps.d.mts +3 -3
  106. package/dist/interface/CommitmentProps.d.ts +3 -3
  107. package/dist/interface/index.d.mts +3 -3
  108. package/dist/interface/index.d.ts +3 -3
  109. package/dist/interface/navigation/LocationBaseModelProps.d.mts +3 -3
  110. package/dist/interface/navigation/LocationBaseModelProps.d.ts +3 -3
  111. package/dist/interface/navigation/LocationInterface.d.mts +2 -2
  112. package/dist/interface/navigation/LocationInterface.d.ts +2 -2
  113. package/dist/interface/navigation/MapBaseModelProps.d.mts +3 -3
  114. package/dist/interface/navigation/MapBaseModelProps.d.ts +3 -3
  115. package/dist/interface/navigation/MapInterface.d.mts +2 -2
  116. package/dist/interface/navigation/MapInterface.d.ts +2 -2
  117. package/dist/interface/navigation/NavigationAbstractClass.d.mts +5 -5
  118. package/dist/interface/navigation/NavigationAbstractClass.d.ts +5 -5
  119. package/dist/interface/navigation/RoomBaseModelProps.d.mts +3 -3
  120. package/dist/interface/navigation/RoomBaseModelProps.d.ts +3 -3
  121. package/dist/interface/navigation/RoomInterface.d.mts +2 -2
  122. package/dist/interface/navigation/RoomInterface.d.ts +2 -2
  123. package/dist/interface/quest/QuestInterface.d.mts +2 -2
  124. package/dist/interface/quest/QuestInterface.d.ts +2 -2
  125. package/dist/interface/quest/QuestProps.d.mts +4 -4
  126. package/dist/interface/quest/QuestProps.d.ts +4 -4
  127. package/dist/interface/quest/StageInterface.d.mts +2 -2
  128. package/dist/interface/quest/StageInterface.d.ts +2 -2
  129. package/dist/interface/quest/StageProps.d.mts +4 -4
  130. package/dist/interface/quest/StageProps.d.ts +4 -4
  131. package/dist/managers/NavigatorManager.d.mts +9 -9
  132. package/dist/managers/NavigatorManager.d.ts +9 -9
  133. package/dist/managers/QuestManager.d.mts +9 -9
  134. package/dist/managers/QuestManager.d.ts +9 -9
  135. package/dist/managers/QuestManager.js +1 -1
  136. package/dist/managers/QuestManager.js.map +1 -1
  137. package/dist/managers/QuestManager.mjs +1 -1
  138. package/dist/managers/QuestManager.mjs.map +1 -1
  139. package/dist/managers/RoutineManager.d.mts +12 -12
  140. package/dist/managers/RoutineManager.d.ts +12 -12
  141. package/dist/managers/RoutineManager.js +1 -1
  142. package/dist/managers/RoutineManager.mjs +1 -1
  143. package/dist/managers/index.d.mts +3 -3
  144. package/dist/managers/index.d.ts +3 -3
  145. package/dist/managers/index.js +1 -1
  146. package/dist/managers/index.js.map +1 -1
  147. package/dist/managers/index.mjs +1 -1
  148. package/dist/managers/index.mjs.map +1 -1
  149. package/dist/nqtr.d.d.mts +195 -0
  150. package/dist/nqtr.d.d.ts +195 -0
  151. package/dist/nqtr.d.js +2 -0
  152. package/dist/nqtr.d.js.map +1 -0
  153. package/dist/nqtr.d.mjs +2 -0
  154. package/dist/nqtr.d.mjs.map +1 -0
  155. package/dist/types/OnRunEvent.d.mts +3 -2
  156. package/dist/types/OnRunEvent.d.ts +3 -2
  157. package/dist/types/QuestsRequired.d.mts +2 -2
  158. package/dist/types/QuestsRequired.d.ts +2 -2
  159. package/dist/types/index.d.mts +3 -2
  160. package/dist/types/index.d.ts +3 -2
  161. package/package.json +1 -2
  162. package/dist/override/ActivityInterface.d.mts +0 -28
  163. package/dist/override/ActivityInterface.d.ts +0 -28
  164. package/dist/override/ActivityInterface.js +0 -2
  165. package/dist/override/ActivityInterface.js.map +0 -1
  166. package/dist/override/ActivityInterface.mjs +0 -2
  167. package/dist/override/ActivityInterface.mjs.map +0 -1
  168. package/dist/override/CommitmentInterface.d.mts +0 -24
  169. package/dist/override/CommitmentInterface.d.ts +0 -24
  170. package/dist/override/CommitmentInterface.js +0 -2
  171. package/dist/override/CommitmentInterface.js.map +0 -1
  172. package/dist/override/CommitmentInterface.mjs +0 -2
  173. package/dist/override/CommitmentInterface.mjs.map +0 -1
  174. package/dist/override/GraphicItemInterface.d.mts +0 -19
  175. package/dist/override/GraphicItemInterface.d.ts +0 -19
  176. package/dist/override/GraphicItemInterface.js +0 -2
  177. package/dist/override/GraphicItemInterface.js.map +0 -1
  178. package/dist/override/GraphicItemInterface.mjs +0 -2
  179. package/dist/override/GraphicItemInterface.mjs.map +0 -1
  180. package/dist/override/LocationInterface.d.mts +0 -29
  181. package/dist/override/LocationInterface.d.ts +0 -29
  182. package/dist/override/LocationInterface.js +0 -2
  183. package/dist/override/LocationInterface.js.map +0 -1
  184. package/dist/override/LocationInterface.mjs +0 -2
  185. package/dist/override/LocationInterface.mjs.map +0 -1
  186. package/dist/override/MapInterface.d.mts +0 -12
  187. package/dist/override/MapInterface.d.ts +0 -12
  188. package/dist/override/MapInterface.js +0 -2
  189. package/dist/override/MapInterface.js.map +0 -1
  190. package/dist/override/MapInterface.mjs +0 -2
  191. package/dist/override/MapInterface.mjs.map +0 -1
  192. package/dist/override/OnRenderGraphicItemProps.d.mts +0 -19
  193. package/dist/override/OnRenderGraphicItemProps.d.ts +0 -19
  194. package/dist/override/OnRenderGraphicItemProps.js +0 -2
  195. package/dist/override/OnRenderGraphicItemProps.js.map +0 -1
  196. package/dist/override/OnRenderGraphicItemProps.mjs +0 -2
  197. package/dist/override/OnRenderGraphicItemProps.mjs.map +0 -1
  198. package/dist/override/OnRunProps.d.mts +0 -19
  199. package/dist/override/OnRunProps.d.ts +0 -19
  200. package/dist/override/OnRunProps.js +0 -2
  201. package/dist/override/OnRunProps.js.map +0 -1
  202. package/dist/override/OnRunProps.mjs +0 -2
  203. package/dist/override/OnRunProps.mjs.map +0 -1
  204. package/dist/override/OnStartEndStageQuest.d.mts +0 -19
  205. package/dist/override/OnStartEndStageQuest.d.ts +0 -19
  206. package/dist/override/OnStartEndStageQuest.js +0 -2
  207. package/dist/override/OnStartEndStageQuest.js.map +0 -1
  208. package/dist/override/OnStartEndStageQuest.mjs +0 -2
  209. package/dist/override/OnStartEndStageQuest.mjs.map +0 -1
  210. package/dist/override/QuestInterface.d.mts +0 -24
  211. package/dist/override/QuestInterface.d.ts +0 -24
  212. package/dist/override/QuestInterface.js +0 -2
  213. package/dist/override/QuestInterface.js.map +0 -1
  214. package/dist/override/QuestInterface.mjs +0 -2
  215. package/dist/override/QuestInterface.mjs.map +0 -1
  216. package/dist/override/RoomInterface.d.mts +0 -33
  217. package/dist/override/RoomInterface.d.ts +0 -33
  218. package/dist/override/RoomInterface.js +0 -2
  219. package/dist/override/RoomInterface.js.map +0 -1
  220. package/dist/override/RoomInterface.mjs +0 -2
  221. package/dist/override/RoomInterface.mjs.map +0 -1
  222. package/dist/override/StageInterface.d.mts +0 -34
  223. package/dist/override/StageInterface.d.ts +0 -34
  224. package/dist/override/StageInterface.js +0 -2
  225. package/dist/override/StageInterface.js.map +0 -1
  226. package/dist/override/StageInterface.mjs +0 -2
  227. package/dist/override/StageInterface.mjs.map +0 -1
  228. package/dist/override/index.d.mts +0 -12
  229. package/dist/override/index.d.ts +0 -12
  230. package/dist/override/index.js +0 -2
  231. package/dist/override/index.js.map +0 -1
  232. package/dist/override/index.mjs +0 -2
  233. package/dist/override/index.mjs.map +0 -1
@@ -1,8 +1,8 @@
1
1
  import LocationBaseModelProps from '../../interface/navigation/LocationBaseModelProps.mjs';
2
- import { b as LocationInternalInterface, M as MapBaseInterface } from '../../RoomInterface-C7Sg80EF.mjs';
2
+ import { b as LocationInternalInterface, M as MapInterface } from '../../RoomInterface-DsZAp6Pv.mjs';
3
3
  import LocationStoredClass from './LocationStoredClass.mjs';
4
4
  import '../../interface/ActivityInterface.mjs';
5
- import '@drincs/nqtr/dist/override';
5
+ import '@drincs/nqtr';
6
6
  import '@drincs/pixi-vn';
7
7
  import '../../types/ExecutionType.mjs';
8
8
  import '../../interface/navigation/NavigationAbstractClass.mjs';
@@ -24,7 +24,7 @@ declare class LocationBaseModel extends LocationStoredClass implements LocationI
24
24
  * @param map The map where the location is.
25
25
  * @param props The properties of the location.
26
26
  */
27
- constructor(id: string, map: MapBaseInterface, props?: LocationBaseModelProps);
27
+ constructor(id: string, map: MapInterface, props?: LocationBaseModelProps);
28
28
  private defaultName;
29
29
  /**
30
30
  * The name of the location.
@@ -1,8 +1,8 @@
1
1
  import LocationBaseModelProps from '../../interface/navigation/LocationBaseModelProps.js';
2
- import { b as LocationInternalInterface, M as MapBaseInterface } from '../../RoomInterface-D7qXKwBI.js';
2
+ import { b as LocationInternalInterface, M as MapInterface } from '../../RoomInterface-BglEhkQT.js';
3
3
  import LocationStoredClass from './LocationStoredClass.js';
4
4
  import '../../interface/ActivityInterface.js';
5
- import '@drincs/nqtr/dist/override';
5
+ import '@drincs/nqtr';
6
6
  import '@drincs/pixi-vn';
7
7
  import '../../types/ExecutionType.js';
8
8
  import '../../interface/navigation/NavigationAbstractClass.js';
@@ -24,7 +24,7 @@ declare class LocationBaseModel extends LocationStoredClass implements LocationI
24
24
  * @param map The map where the location is.
25
25
  * @param props The properties of the location.
26
26
  */
27
- constructor(id: string, map: MapBaseInterface, props?: LocationBaseModelProps);
27
+ constructor(id: string, map: MapInterface, props?: LocationBaseModelProps);
28
28
  private defaultName;
29
29
  /**
30
30
  * The name of the location.
@@ -1,2 +1,2 @@
1
- 'use strict';var pixiVn=require('@drincs/pixi-vn');var m={};function Q(a){try{let e=m[a];if(!e){console.error(`[NQTR] Room ${a} not found`);return}return e}catch(e){console.error(`[NQTR] Error while getting Room ${a}`,e);return}}var C="___nqtr-current_room_memory___",g=class{get rooms(){return Object.values(m)}get locations(){let e={};return Object.values(m).forEach(t=>{e[t.location.id]=t.location;}),Object.values(e)}get maps(){let e={};return Object.values(m).forEach(t=>{e[t.location.map.id]=t.location.map;}),Object.values(e)}get currentRoom(){let e=pixiVn.storage.getVariable(C);if(!e){console.error("[NQTR] The current room has not yet been set");return}let t=Q(e);if(!t){console.error(`[NQTR] Current room ${e} not found`);return}return t}set currentRoom(e){if(!Q(e.id)){console.error(`[NQTR] The room ${e.id} is not registered, so it can't be set as current room`);return}pixiVn.storage.setVariable(C,e.id);}get currentLocation(){return this.currentRoom?.location}get currentMap(){return this.currentRoom?.location.map}clearExpiredActivities(){Object.entries(m).forEach(([e,t])=>{t.clearExpiredActivities();});}};var d="___nqtr-time_manager_data___";var c=class{static minDayHours=0;static maxDayHours=24;static defaultTimeSpent=1;static timeSlots=[];static weekLength=7;static weekendStartDay=this.weekLength-1;static weekDaysNames=[]};var p=class{initialize(e){let{minDayHours:t=0,maxDayHours:r=24,defaultTimeSpent:i=1,timeSlots:o=[],weekLength:n=7,weekendStartDay:s=n-1,weekDaysNames:u=[]}=e;c.minDayHours=t,c.maxDayHours=r,c.defaultTimeSpent=i,c.timeSlots=o,c.weekLength=n,s>=c.weekLength?console.warn(`[NQTR] Weekend start day should be less than week length ${n}, so will be ignored`):c.weekendStartDay=s,u.length!==n?console.warn(`[NQTR] Week days names should be equal to week length ${n}, so will be ignored`):c.weekDaysNames=u;}get minDayHours(){return c.minDayHours}get maxDayHours(){return c.maxDayHours}get defaultTimeSpent(){return c.defaultTimeSpent}get timeSlots(){return c.timeSlots}get weekLength(){return c.weekLength}get weekendStartDay(){return c.weekendStartDay}get weekDaysNames(){return c.weekDaysNames}get currentHour(){let e=pixiVn.storage.getVariable(d)||{};return e.hasOwnProperty("currentHour")&&typeof e.currentHour=="number"?e.currentHour:this.minDayHours}set currentHour(e){let t=pixiVn.storage.getVariable(d)||{};typeof e=="number"?t.currentHour=e:delete t.currentHour,pixiVn.storage.setVariable(d,t);}get currentDay(){let e=pixiVn.storage.getVariable(d)||{};return e.hasOwnProperty("currentDay")&&typeof e.currentDay=="number"?e.currentDay:0}set currentDay(e){let t=pixiVn.storage.getVariable(d)||{};typeof e=="number"?t.currentDay=e:delete t.currentDay,pixiVn.storage.setVariable(d,t);}get isWeekend(){return this.currentWeekDayNumber>=this.weekendStartDay}get currentWeekDayNumber(){return this.currentDay%this.weekLength+1}get currentDayName(){let e=this.currentWeekDayNumber-1;return e>=this.weekDaysNames.length?(console.warn(`[NQTR] Week day name is not defined for day ${e}`,this.weekDaysNames),""):this.weekDaysNames[e]}get currentTimeSlot(){if(this.timeSlots.length===0)return console.warn("[NQTR] Time slots are not defined"),0;for(let e=0;e<this.timeSlots.length;e++){let t=this.timeSlots[e];if(this.timeSlots.length>e+1&&this.nowIsBetween(t.startHour,this.timeSlots[e+1].startHour))return e}return this.timeSlots.length-1}increaseHour(e=this.defaultTimeSpent){let t=this.currentHour+e;return t>=this.maxDayHours&&(this.increaseDay(),t=this.minDayHours+(t-this.maxDayHours)),this.currentHour=t,this.currentHour}increaseDay(e=this.minDayHours,t=1){let r=this.currentDay+t;return this.currentDay=r,this.currentHour=e,this.currentDay}nowIsBetween(e,t){e===undefined&&(e=this.minDayHours),t===undefined&&(t=this.maxDayHours);let r=this.currentHour;return e<t?r>=e&&r<t:r>=e||r<t}};var l=new p,T=new g;var O={};function R(a){try{let e=O[a];if(!e){console.error(`[NQTR] Activity ${a} not found`);return}return e}catch(e){console.error(`[NQTR] Error while getting Activity ${a}`,e);return}}var v=class extends pixiVn.StoredClassModel{constructor(t,r,i=[]){super(t,r);this.defaultActivities=i;}get defaultActivitiesIds(){return this.defaultActivities.map(t=>t.id)}get activeActivityScheduling(){return this.getStorageProperty("activeActivityScheduling")||{}}get excludedActivitiesScheduling(){return this.getStorageProperty("excludedActivitiesScheduling")||{}}removeActivityScheduling(t){let r=this.activeActivityScheduling;delete r[t],this.setStorageProperty("activeActivityScheduling",r);let i=this.excludedActivitiesScheduling;delete i[t],this.setStorageProperty("excludedActivitiesScheduling",i);}editActivityScheduling(t,r){this.removeActivityScheduling(t);let i=this.activeActivityScheduling;i[t]=r,this.setStorageProperty("activeActivityScheduling",i);}editExcludedActivityScheduling(t,r){this.removeActivityScheduling(t);let i=this.excludedActivitiesScheduling;i[t]=r,this.setStorageProperty("excludedActivitiesScheduling",i);}get additionalActivitiesIds(){return this.getStorageProperty("additionalActivitiesIds")||[]}get excludedActivitiesIds(){return this.getStorageProperty("excludedActivitiesIds")||[]}addActivity(t,r={}){let{hours:i,fromDay:o,toDay:n}=r,s={};if(i){if(i.from>=i.to)throw new Error("[NQTR] The from hour must be less than the to hour.");s.fromHour=i.from;}if(o===0&&console.warn("[NQTR] The from day must be greater than 0, so it will be ignored."),n===0&&console.warn("[NQTR] The to day must be greater than 0, so it will be ignored."),o&&n&&o>=n)throw new Error("[NQTR] The from day must be less than the to day.");if(o&&(s.fromDay=o),n&&(s.toDay=n),this.defaultActivitiesIds.includes(t.id)){console.warn(`[NQTR] Activity with id ${t.id} already exists, so it will be ignored.`);return}let u=this.additionalActivitiesIds;if(u.includes(t.id)){if(Object.keys(s).length){this.editActivityScheduling(t.id,s);return}else if(this.excludedActivitiesIds.includes(t.id)){this.removeActivityScheduling(t.id),console.log(`[NQTR] Activity with id ${t.id} was excluded, so it will be associated with this class again.`);return}console.warn(`[NQTR] Activity with id ${t.id} already exists, so it will be ignored.`);return}u.push(t.id),this.setStorageProperty("additionalActivitiesIds",u),Object.keys(s).length&&this.editActivityScheduling(t.id,s);}revoveActivity(t,r={}){let{toDay:i}=r,o={};i===0&&console.warn("[NQTR] The to day must be greater than 0, so it will be ignored."),i&&(o.toDay=i);let n=this.additionalActivitiesIds;if(n.includes(t.id)){if(Object.keys(o).length){this.editExcludedActivityScheduling(t.id,o);return}n=n.filter(s=>s!==t.id),this.setStorageProperty("additionalActivitiesIds",n);}else if(this.defaultActivitiesIds.includes(t.id)){if(Object.keys(o).length){this.editExcludedActivityScheduling(t.id,o);return}let s=this.excludedActivitiesIds;s.push(t.id),this.setStorageProperty("excludedActivitiesIds",s);}else console.warn(`[NQTR] Activity with id ${t.id} not found, so it will be ignored.`);}clearExpiredActivities(){let t=this.activeActivityScheduling,r=this.excludedActivitiesScheduling,i=this.additionalActivitiesIds,o=this.excludedActivitiesIds;i.forEach(n=>{if(n in t){let{toDay:s}=t[n];s&&s<l.currentDay&&(this.removeActivityScheduling(n),i=i.filter(u=>u!==n));}}),o.forEach(n=>{if(n in r){let{toDay:s}=r[n];s&&s<l.currentDay&&(this.removeActivityScheduling(n),o=o.filter(u=>u!==n));}});}get activities(){let t=[];return Object.entries(this.activeActivityScheduling).forEach(([r,i])=>{let o=R(r),{fromDay:n=o?.fromDay,fromHour:s=o?.fromHour,toDay:u=o?.toDay,toHour:E=o?.toHour}=i;o&&!(s&&E&&!l.nowIsBetween(s,E))&&!(n&&n>l.currentDay)&&!(u&&u<l.currentDay)&&t.push(o);}),Object.entries(this.excludedActivitiesScheduling).forEach(([r,i])=>{let o=R(r);o&&o.isActive&&!(i.toDay&&i.toDay>=l.currentDay)&&t.push(o);}),t}};var $="__nqtr-location__",I=class extends v{constructor(t,r,i=[]){super($,t,i);this._map=r;}get map(){return this._map}get rooms(){return T.rooms.filter(t=>t.location.id===this.id)}};var _=class extends I{constructor(e,t,r={}){super(e,t,r.activities||[]),this.defaultName=r.name||"",this.defaultDisabled=r.disabled||false,this.defaultHidden=r.hidden||false,this._icon=r.icon;}defaultName;get name(){return this.getStorageProperty("name")||this.defaultName}set name(e){this.setStorageProperty("name",e);}defaultDisabled;get disabled(){let e=this.getStorageProperty("disabled")||this.defaultDisabled;return typeof e=="string"?pixiVn.getFlag(e):e}set disabled(e){this.setStorageProperty("disabled",e);}defaultHidden;get hidden(){let e=this.getStorageProperty("hidden")||this.defaultHidden;return typeof e=="string"?pixiVn.getFlag(e):e}set hidden(e){this.setStorageProperty("hidden",e);}_icon;get icon(){return this._icon}};module.exports=_;//# sourceMappingURL=LocationBaseModel.js.map
1
+ 'use strict';var pixiVn=require('@drincs/pixi-vn');var m={};function Q(a){try{let e=m[a];if(!e){console.error(`[NQTR] Room ${a} not found`);return}return e}catch(e){console.error(`[NQTR] Error while getting Room ${a}`,e);return}}var C="___nqtr-current_room_memory___",g=class{get rooms(){return Object.values(m)}get locations(){let e={};return Object.values(m).forEach(t=>{e[t.location.id]=t.location;}),Object.values(e)}get maps(){let e={};return Object.values(m).forEach(t=>{e[t.location.map.id]=t.location.map;}),Object.values(e)}get currentRoom(){let e=pixiVn.storage.getVariable(C);if(!e){console.error("[NQTR] The current room has not yet been set");return}let t=Q(e);if(!t){console.error(`[NQTR] Current room ${e} not found`);return}return t}set currentRoom(e){if(!Q(e.id)){console.error(`[NQTR] The room ${e.id} is not registered, so it can't be set as current room`);return}pixiVn.storage.setVariable(C,e.id);}get currentLocation(){return this.currentRoom?.location}get currentMap(){return this.currentRoom?.location.map}clearExpiredActivities(){Object.entries(m).forEach(([e,t])=>{t.clearExpiredActivities();});}};var d="___nqtr-time_manager_data___";var c=class{static minDayHours=0;static maxDayHours=24;static defaultTimeSpent=1;static timeSlots=[];static weekLength=7;static weekendStartDay=this.weekLength-1;static weekDaysNames=[]};var p=class{initialize(e){let{minDayHours:t=0,maxDayHours:r=24,defaultTimeSpent:i=1,timeSlots:o=[],weekLength:n=7,weekendStartDay:s=n-1,weekDaysNames:u=[]}=e;c.minDayHours=t,c.maxDayHours=r,c.defaultTimeSpent=i,c.timeSlots=o,c.weekLength=n,s>=c.weekLength?console.warn(`[NQTR] Weekend start day should be less than week length ${n}, so will be ignored`):c.weekendStartDay=s,u.length!==n?console.warn(`[NQTR] Week days names should be equal to week length ${n}, so will be ignored`):c.weekDaysNames=u;}get minDayHours(){return c.minDayHours}get maxDayHours(){return c.maxDayHours}get defaultTimeSpent(){return c.defaultTimeSpent}get timeSlots(){return c.timeSlots}get weekLength(){return c.weekLength}get weekendStartDay(){return c.weekendStartDay}get weekDaysNames(){return c.weekDaysNames}get currentHour(){let e=pixiVn.storage.getVariable(d)||{};return e.hasOwnProperty("currentHour")&&typeof e.currentHour=="number"?e.currentHour:this.minDayHours}set currentHour(e){let t=pixiVn.storage.getVariable(d)||{};typeof e=="number"?t.currentHour=e:delete t.currentHour,pixiVn.storage.setVariable(d,t);}get currentDay(){let e=pixiVn.storage.getVariable(d)||{};return e.hasOwnProperty("currentDay")&&typeof e.currentDay=="number"?e.currentDay:0}set currentDay(e){let t=pixiVn.storage.getVariable(d)||{};typeof e=="number"?t.currentDay=e:delete t.currentDay,pixiVn.storage.setVariable(d,t);}get isWeekend(){return this.currentWeekDayNumber>=this.weekendStartDay}get currentWeekDayNumber(){return this.currentDay%this.weekLength+1}get currentDayName(){let e=this.currentWeekDayNumber-1;return e>=this.weekDaysNames.length?(console.warn(`[NQTR] Week day name is not defined for day ${e}`,this.weekDaysNames),""):this.weekDaysNames[e]}get currentTimeSlot(){if(this.timeSlots.length===0)return console.warn("[NQTR] Time slots are not defined"),0;for(let e=0;e<this.timeSlots.length;e++){let t=this.timeSlots[e];if(this.timeSlots.length>e+1&&this.nowIsBetween(t.startHour,this.timeSlots[e+1].startHour))return e}return this.timeSlots.length-1}increaseHour(e=this.defaultTimeSpent){let t=this.currentHour+e;return t>=this.maxDayHours&&(this.increaseDay(),t=this.minDayHours+(t-this.maxDayHours)),this.currentHour=t,this.currentHour}increaseDay(e=this.minDayHours,t=1){let r=this.currentDay+t;return this.currentDay=r,this.currentHour=e,this.currentDay}nowIsBetween(e,t){e===undefined&&(e=this.minDayHours),t===undefined&&(t=this.maxDayHours);let r=this.currentHour;return e<t?r>=e&&r<t:r>=e||r<t}};var l=new p,T=new g;var O={};function R(a){try{let e=O[a];if(!e){console.error(`[NQTR] Activity ${a} not found`);return}return e}catch(e){console.error(`[NQTR] Error while getting Activity ${a}`,e);return}}var v=class extends pixiVn.StoredClassModel{constructor(t,r,i=[]){super(t,r);this.defaultActivities=i;}get defaultActivitiesIds(){return this.defaultActivities.map(t=>t.id)}get activeActivityScheduling(){return this.getStorageProperty("activeActivityScheduling")||{}}get excludedActivitiesScheduling(){return this.getStorageProperty("excludedActivitiesScheduling")||{}}removeActivityScheduling(t){let r=this.activeActivityScheduling;delete r[t],this.setStorageProperty("activeActivityScheduling",r);let i=this.excludedActivitiesScheduling;delete i[t],this.setStorageProperty("excludedActivitiesScheduling",i);}editActivityScheduling(t,r){this.removeActivityScheduling(t);let i=this.activeActivityScheduling;i[t]=r,this.setStorageProperty("activeActivityScheduling",i);}editExcludedActivityScheduling(t,r){this.removeActivityScheduling(t);let i=this.excludedActivitiesScheduling;i[t]=r,this.setStorageProperty("excludedActivitiesScheduling",i);}get additionalActivitiesIds(){return this.getStorageProperty("additionalActivitiesIds")||[]}get excludedActivitiesIds(){return this.getStorageProperty("excludedActivitiesIds")||[]}addActivity(t,r={}){let{hours:i,fromDay:o,toDay:n}=r,s={};if(i){if(i.from>=i.to)throw new Error("[NQTR] The from hour must be less than the to hour.");s.fromHour=i.from;}if(o===0&&console.warn("[NQTR] The from day must be greater than 0, so it will be ignored."),n===0&&console.warn("[NQTR] The to day must be greater than 0, so it will be ignored."),o&&n&&o>=n)throw new Error("[NQTR] The from day must be less than the to day.");if(o&&(s.fromDay=o),n&&(s.toDay=n),this.defaultActivitiesIds.includes(t.id)){console.warn(`[NQTR] Activity with id ${t.id} already exists, so it will be ignored.`);return}let u=this.additionalActivitiesIds;if(u.includes(t.id)){if(Object.keys(s).length){this.editActivityScheduling(t.id,s);return}else if(this.excludedActivitiesIds.includes(t.id)){this.removeActivityScheduling(t.id),console.log(`[NQTR] Activity with id ${t.id} was excluded, so it will be associated with this class again.`);return}console.warn(`[NQTR] Activity with id ${t.id} already exists, so it will be ignored.`);return}u.push(t.id),this.setStorageProperty("additionalActivitiesIds",u),Object.keys(s).length&&this.editActivityScheduling(t.id,s);}revoveActivity(t,r={}){let{toDay:i}=r,o={};i===0&&console.warn("[NQTR] The to day must be greater than 0, so it will be ignored."),i&&(o.toDay=i);let n=this.additionalActivitiesIds;if(n.includes(t.id)){if(Object.keys(o).length){this.editExcludedActivityScheduling(t.id,o);return}n=n.filter(s=>s!==t.id),this.setStorageProperty("additionalActivitiesIds",n);}else if(this.defaultActivitiesIds.includes(t.id)){if(Object.keys(o).length){this.editExcludedActivityScheduling(t.id,o);return}let s=this.excludedActivitiesIds;s.push(t.id),this.setStorageProperty("excludedActivitiesIds",s);}else console.warn(`[NQTR] Activity with id ${t.id} not found, so it will be ignored.`);}clearExpiredActivities(){let t=this.activeActivityScheduling,r=this.excludedActivitiesScheduling,i=this.additionalActivitiesIds,o=this.excludedActivitiesIds;i.forEach(n=>{if(n in t){let{toDay:s}=t[n];s&&s<l.currentDay&&(this.removeActivityScheduling(n),i=i.filter(u=>u!==n));}}),o.forEach(n=>{if(n in r){let{toDay:s}=r[n];s&&s<l.currentDay&&(this.removeActivityScheduling(n),o=o.filter(u=>u!==n));}});}get activities(){let t=[];return Object.entries(this.activeActivityScheduling).forEach(([r,i])=>{let o=R(r),{fromDay:n=o?.fromDay,fromHour:s=o?.fromHour,toDay:u=o?.toDay,toHour:N=o?.toHour}=i;o&&!(s&&N&&!l.nowIsBetween(s,N))&&!(n&&n>l.currentDay)&&!(u&&u<l.currentDay)&&t.push(o);}),Object.entries(this.excludedActivitiesScheduling).forEach(([r,i])=>{let o=R(r);o&&o.isActive&&!(i.toDay&&i.toDay>=l.currentDay)&&t.push(o);}),t}};var P="__nqtr-location__",I=class extends v{constructor(t,r,i=[]){super(P,t,i);this._map=r;}get map(){return this._map}get rooms(){return T.rooms.filter(t=>t.location.id===this.id)}};var _=class extends I{constructor(e,t,r={}){super(e,t,r.activities||[]),this.defaultName=r.name||"",this.defaultDisabled=r.disabled||false,this.defaultHidden=r.hidden||false,this._icon=r.icon;}defaultName;get name(){return this.getStorageProperty("name")||this.defaultName}set name(e){this.setStorageProperty("name",e);}defaultDisabled;get disabled(){let e=this.getStorageProperty("disabled")||this.defaultDisabled;return typeof e=="string"?pixiVn.getFlag(e):e}set disabled(e){this.setStorageProperty("disabled",e);}defaultHidden;get hidden(){let e=this.getStorageProperty("hidden")||this.defaultHidden;return typeof e=="string"?pixiVn.getFlag(e):e}set hidden(e){this.setStorageProperty("hidden",e);}_icon;get icon(){return this._icon}};module.exports=_;//# sourceMappingURL=LocationBaseModel.js.map
2
2
  //# sourceMappingURL=LocationBaseModel.js.map
@@ -1,2 +1,2 @@
1
- import {getFlag,StoredClassModel,storage}from'@drincs/pixi-vn';var m={};function Q(a){try{let e=m[a];if(!e){console.error(`[NQTR] Room ${a} not found`);return}return e}catch(e){console.error(`[NQTR] Error while getting Room ${a}`,e);return}}var C="___nqtr-current_room_memory___",g=class{get rooms(){return Object.values(m)}get locations(){let e={};return Object.values(m).forEach(t=>{e[t.location.id]=t.location;}),Object.values(e)}get maps(){let e={};return Object.values(m).forEach(t=>{e[t.location.map.id]=t.location.map;}),Object.values(e)}get currentRoom(){let e=storage.getVariable(C);if(!e){console.error("[NQTR] The current room has not yet been set");return}let t=Q(e);if(!t){console.error(`[NQTR] Current room ${e} not found`);return}return t}set currentRoom(e){if(!Q(e.id)){console.error(`[NQTR] The room ${e.id} is not registered, so it can't be set as current room`);return}storage.setVariable(C,e.id);}get currentLocation(){return this.currentRoom?.location}get currentMap(){return this.currentRoom?.location.map}clearExpiredActivities(){Object.entries(m).forEach(([e,t])=>{t.clearExpiredActivities();});}};var d="___nqtr-time_manager_data___";var c=class{static minDayHours=0;static maxDayHours=24;static defaultTimeSpent=1;static timeSlots=[];static weekLength=7;static weekendStartDay=this.weekLength-1;static weekDaysNames=[]};var p=class{initialize(e){let{minDayHours:t=0,maxDayHours:r=24,defaultTimeSpent:i=1,timeSlots:o=[],weekLength:n=7,weekendStartDay:s=n-1,weekDaysNames:u=[]}=e;c.minDayHours=t,c.maxDayHours=r,c.defaultTimeSpent=i,c.timeSlots=o,c.weekLength=n,s>=c.weekLength?console.warn(`[NQTR] Weekend start day should be less than week length ${n}, so will be ignored`):c.weekendStartDay=s,u.length!==n?console.warn(`[NQTR] Week days names should be equal to week length ${n}, so will be ignored`):c.weekDaysNames=u;}get minDayHours(){return c.minDayHours}get maxDayHours(){return c.maxDayHours}get defaultTimeSpent(){return c.defaultTimeSpent}get timeSlots(){return c.timeSlots}get weekLength(){return c.weekLength}get weekendStartDay(){return c.weekendStartDay}get weekDaysNames(){return c.weekDaysNames}get currentHour(){let e=storage.getVariable(d)||{};return e.hasOwnProperty("currentHour")&&typeof e.currentHour=="number"?e.currentHour:this.minDayHours}set currentHour(e){let t=storage.getVariable(d)||{};typeof e=="number"?t.currentHour=e:delete t.currentHour,storage.setVariable(d,t);}get currentDay(){let e=storage.getVariable(d)||{};return e.hasOwnProperty("currentDay")&&typeof e.currentDay=="number"?e.currentDay:0}set currentDay(e){let t=storage.getVariable(d)||{};typeof e=="number"?t.currentDay=e:delete t.currentDay,storage.setVariable(d,t);}get isWeekend(){return this.currentWeekDayNumber>=this.weekendStartDay}get currentWeekDayNumber(){return this.currentDay%this.weekLength+1}get currentDayName(){let e=this.currentWeekDayNumber-1;return e>=this.weekDaysNames.length?(console.warn(`[NQTR] Week day name is not defined for day ${e}`,this.weekDaysNames),""):this.weekDaysNames[e]}get currentTimeSlot(){if(this.timeSlots.length===0)return console.warn("[NQTR] Time slots are not defined"),0;for(let e=0;e<this.timeSlots.length;e++){let t=this.timeSlots[e];if(this.timeSlots.length>e+1&&this.nowIsBetween(t.startHour,this.timeSlots[e+1].startHour))return e}return this.timeSlots.length-1}increaseHour(e=this.defaultTimeSpent){let t=this.currentHour+e;return t>=this.maxDayHours&&(this.increaseDay(),t=this.minDayHours+(t-this.maxDayHours)),this.currentHour=t,this.currentHour}increaseDay(e=this.minDayHours,t=1){let r=this.currentDay+t;return this.currentDay=r,this.currentHour=e,this.currentDay}nowIsBetween(e,t){e===undefined&&(e=this.minDayHours),t===undefined&&(t=this.maxDayHours);let r=this.currentHour;return e<t?r>=e&&r<t:r>=e||r<t}};var l=new p,T=new g;var O={};function R(a){try{let e=O[a];if(!e){console.error(`[NQTR] Activity ${a} not found`);return}return e}catch(e){console.error(`[NQTR] Error while getting Activity ${a}`,e);return}}var v=class extends StoredClassModel{constructor(t,r,i=[]){super(t,r);this.defaultActivities=i;}get defaultActivitiesIds(){return this.defaultActivities.map(t=>t.id)}get activeActivityScheduling(){return this.getStorageProperty("activeActivityScheduling")||{}}get excludedActivitiesScheduling(){return this.getStorageProperty("excludedActivitiesScheduling")||{}}removeActivityScheduling(t){let r=this.activeActivityScheduling;delete r[t],this.setStorageProperty("activeActivityScheduling",r);let i=this.excludedActivitiesScheduling;delete i[t],this.setStorageProperty("excludedActivitiesScheduling",i);}editActivityScheduling(t,r){this.removeActivityScheduling(t);let i=this.activeActivityScheduling;i[t]=r,this.setStorageProperty("activeActivityScheduling",i);}editExcludedActivityScheduling(t,r){this.removeActivityScheduling(t);let i=this.excludedActivitiesScheduling;i[t]=r,this.setStorageProperty("excludedActivitiesScheduling",i);}get additionalActivitiesIds(){return this.getStorageProperty("additionalActivitiesIds")||[]}get excludedActivitiesIds(){return this.getStorageProperty("excludedActivitiesIds")||[]}addActivity(t,r={}){let{hours:i,fromDay:o,toDay:n}=r,s={};if(i){if(i.from>=i.to)throw new Error("[NQTR] The from hour must be less than the to hour.");s.fromHour=i.from;}if(o===0&&console.warn("[NQTR] The from day must be greater than 0, so it will be ignored."),n===0&&console.warn("[NQTR] The to day must be greater than 0, so it will be ignored."),o&&n&&o>=n)throw new Error("[NQTR] The from day must be less than the to day.");if(o&&(s.fromDay=o),n&&(s.toDay=n),this.defaultActivitiesIds.includes(t.id)){console.warn(`[NQTR] Activity with id ${t.id} already exists, so it will be ignored.`);return}let u=this.additionalActivitiesIds;if(u.includes(t.id)){if(Object.keys(s).length){this.editActivityScheduling(t.id,s);return}else if(this.excludedActivitiesIds.includes(t.id)){this.removeActivityScheduling(t.id),console.log(`[NQTR] Activity with id ${t.id} was excluded, so it will be associated with this class again.`);return}console.warn(`[NQTR] Activity with id ${t.id} already exists, so it will be ignored.`);return}u.push(t.id),this.setStorageProperty("additionalActivitiesIds",u),Object.keys(s).length&&this.editActivityScheduling(t.id,s);}revoveActivity(t,r={}){let{toDay:i}=r,o={};i===0&&console.warn("[NQTR] The to day must be greater than 0, so it will be ignored."),i&&(o.toDay=i);let n=this.additionalActivitiesIds;if(n.includes(t.id)){if(Object.keys(o).length){this.editExcludedActivityScheduling(t.id,o);return}n=n.filter(s=>s!==t.id),this.setStorageProperty("additionalActivitiesIds",n);}else if(this.defaultActivitiesIds.includes(t.id)){if(Object.keys(o).length){this.editExcludedActivityScheduling(t.id,o);return}let s=this.excludedActivitiesIds;s.push(t.id),this.setStorageProperty("excludedActivitiesIds",s);}else console.warn(`[NQTR] Activity with id ${t.id} not found, so it will be ignored.`);}clearExpiredActivities(){let t=this.activeActivityScheduling,r=this.excludedActivitiesScheduling,i=this.additionalActivitiesIds,o=this.excludedActivitiesIds;i.forEach(n=>{if(n in t){let{toDay:s}=t[n];s&&s<l.currentDay&&(this.removeActivityScheduling(n),i=i.filter(u=>u!==n));}}),o.forEach(n=>{if(n in r){let{toDay:s}=r[n];s&&s<l.currentDay&&(this.removeActivityScheduling(n),o=o.filter(u=>u!==n));}});}get activities(){let t=[];return Object.entries(this.activeActivityScheduling).forEach(([r,i])=>{let o=R(r),{fromDay:n=o?.fromDay,fromHour:s=o?.fromHour,toDay:u=o?.toDay,toHour:E=o?.toHour}=i;o&&!(s&&E&&!l.nowIsBetween(s,E))&&!(n&&n>l.currentDay)&&!(u&&u<l.currentDay)&&t.push(o);}),Object.entries(this.excludedActivitiesScheduling).forEach(([r,i])=>{let o=R(r);o&&o.isActive&&!(i.toDay&&i.toDay>=l.currentDay)&&t.push(o);}),t}};var $="__nqtr-location__",I=class extends v{constructor(t,r,i=[]){super($,t,i);this._map=r;}get map(){return this._map}get rooms(){return T.rooms.filter(t=>t.location.id===this.id)}};var _=class extends I{constructor(e,t,r={}){super(e,t,r.activities||[]),this.defaultName=r.name||"",this.defaultDisabled=r.disabled||false,this.defaultHidden=r.hidden||false,this._icon=r.icon;}defaultName;get name(){return this.getStorageProperty("name")||this.defaultName}set name(e){this.setStorageProperty("name",e);}defaultDisabled;get disabled(){let e=this.getStorageProperty("disabled")||this.defaultDisabled;return typeof e=="string"?getFlag(e):e}set disabled(e){this.setStorageProperty("disabled",e);}defaultHidden;get hidden(){let e=this.getStorageProperty("hidden")||this.defaultHidden;return typeof e=="string"?getFlag(e):e}set hidden(e){this.setStorageProperty("hidden",e);}_icon;get icon(){return this._icon}};export{_ as default};//# sourceMappingURL=LocationBaseModel.mjs.map
1
+ import {getFlag,StoredClassModel,storage}from'@drincs/pixi-vn';var m={};function Q(a){try{let e=m[a];if(!e){console.error(`[NQTR] Room ${a} not found`);return}return e}catch(e){console.error(`[NQTR] Error while getting Room ${a}`,e);return}}var C="___nqtr-current_room_memory___",g=class{get rooms(){return Object.values(m)}get locations(){let e={};return Object.values(m).forEach(t=>{e[t.location.id]=t.location;}),Object.values(e)}get maps(){let e={};return Object.values(m).forEach(t=>{e[t.location.map.id]=t.location.map;}),Object.values(e)}get currentRoom(){let e=storage.getVariable(C);if(!e){console.error("[NQTR] The current room has not yet been set");return}let t=Q(e);if(!t){console.error(`[NQTR] Current room ${e} not found`);return}return t}set currentRoom(e){if(!Q(e.id)){console.error(`[NQTR] The room ${e.id} is not registered, so it can't be set as current room`);return}storage.setVariable(C,e.id);}get currentLocation(){return this.currentRoom?.location}get currentMap(){return this.currentRoom?.location.map}clearExpiredActivities(){Object.entries(m).forEach(([e,t])=>{t.clearExpiredActivities();});}};var d="___nqtr-time_manager_data___";var c=class{static minDayHours=0;static maxDayHours=24;static defaultTimeSpent=1;static timeSlots=[];static weekLength=7;static weekendStartDay=this.weekLength-1;static weekDaysNames=[]};var p=class{initialize(e){let{minDayHours:t=0,maxDayHours:r=24,defaultTimeSpent:i=1,timeSlots:o=[],weekLength:n=7,weekendStartDay:s=n-1,weekDaysNames:u=[]}=e;c.minDayHours=t,c.maxDayHours=r,c.defaultTimeSpent=i,c.timeSlots=o,c.weekLength=n,s>=c.weekLength?console.warn(`[NQTR] Weekend start day should be less than week length ${n}, so will be ignored`):c.weekendStartDay=s,u.length!==n?console.warn(`[NQTR] Week days names should be equal to week length ${n}, so will be ignored`):c.weekDaysNames=u;}get minDayHours(){return c.minDayHours}get maxDayHours(){return c.maxDayHours}get defaultTimeSpent(){return c.defaultTimeSpent}get timeSlots(){return c.timeSlots}get weekLength(){return c.weekLength}get weekendStartDay(){return c.weekendStartDay}get weekDaysNames(){return c.weekDaysNames}get currentHour(){let e=storage.getVariable(d)||{};return e.hasOwnProperty("currentHour")&&typeof e.currentHour=="number"?e.currentHour:this.minDayHours}set currentHour(e){let t=storage.getVariable(d)||{};typeof e=="number"?t.currentHour=e:delete t.currentHour,storage.setVariable(d,t);}get currentDay(){let e=storage.getVariable(d)||{};return e.hasOwnProperty("currentDay")&&typeof e.currentDay=="number"?e.currentDay:0}set currentDay(e){let t=storage.getVariable(d)||{};typeof e=="number"?t.currentDay=e:delete t.currentDay,storage.setVariable(d,t);}get isWeekend(){return this.currentWeekDayNumber>=this.weekendStartDay}get currentWeekDayNumber(){return this.currentDay%this.weekLength+1}get currentDayName(){let e=this.currentWeekDayNumber-1;return e>=this.weekDaysNames.length?(console.warn(`[NQTR] Week day name is not defined for day ${e}`,this.weekDaysNames),""):this.weekDaysNames[e]}get currentTimeSlot(){if(this.timeSlots.length===0)return console.warn("[NQTR] Time slots are not defined"),0;for(let e=0;e<this.timeSlots.length;e++){let t=this.timeSlots[e];if(this.timeSlots.length>e+1&&this.nowIsBetween(t.startHour,this.timeSlots[e+1].startHour))return e}return this.timeSlots.length-1}increaseHour(e=this.defaultTimeSpent){let t=this.currentHour+e;return t>=this.maxDayHours&&(this.increaseDay(),t=this.minDayHours+(t-this.maxDayHours)),this.currentHour=t,this.currentHour}increaseDay(e=this.minDayHours,t=1){let r=this.currentDay+t;return this.currentDay=r,this.currentHour=e,this.currentDay}nowIsBetween(e,t){e===undefined&&(e=this.minDayHours),t===undefined&&(t=this.maxDayHours);let r=this.currentHour;return e<t?r>=e&&r<t:r>=e||r<t}};var l=new p,T=new g;var O={};function R(a){try{let e=O[a];if(!e){console.error(`[NQTR] Activity ${a} not found`);return}return e}catch(e){console.error(`[NQTR] Error while getting Activity ${a}`,e);return}}var v=class extends StoredClassModel{constructor(t,r,i=[]){super(t,r);this.defaultActivities=i;}get defaultActivitiesIds(){return this.defaultActivities.map(t=>t.id)}get activeActivityScheduling(){return this.getStorageProperty("activeActivityScheduling")||{}}get excludedActivitiesScheduling(){return this.getStorageProperty("excludedActivitiesScheduling")||{}}removeActivityScheduling(t){let r=this.activeActivityScheduling;delete r[t],this.setStorageProperty("activeActivityScheduling",r);let i=this.excludedActivitiesScheduling;delete i[t],this.setStorageProperty("excludedActivitiesScheduling",i);}editActivityScheduling(t,r){this.removeActivityScheduling(t);let i=this.activeActivityScheduling;i[t]=r,this.setStorageProperty("activeActivityScheduling",i);}editExcludedActivityScheduling(t,r){this.removeActivityScheduling(t);let i=this.excludedActivitiesScheduling;i[t]=r,this.setStorageProperty("excludedActivitiesScheduling",i);}get additionalActivitiesIds(){return this.getStorageProperty("additionalActivitiesIds")||[]}get excludedActivitiesIds(){return this.getStorageProperty("excludedActivitiesIds")||[]}addActivity(t,r={}){let{hours:i,fromDay:o,toDay:n}=r,s={};if(i){if(i.from>=i.to)throw new Error("[NQTR] The from hour must be less than the to hour.");s.fromHour=i.from;}if(o===0&&console.warn("[NQTR] The from day must be greater than 0, so it will be ignored."),n===0&&console.warn("[NQTR] The to day must be greater than 0, so it will be ignored."),o&&n&&o>=n)throw new Error("[NQTR] The from day must be less than the to day.");if(o&&(s.fromDay=o),n&&(s.toDay=n),this.defaultActivitiesIds.includes(t.id)){console.warn(`[NQTR] Activity with id ${t.id} already exists, so it will be ignored.`);return}let u=this.additionalActivitiesIds;if(u.includes(t.id)){if(Object.keys(s).length){this.editActivityScheduling(t.id,s);return}else if(this.excludedActivitiesIds.includes(t.id)){this.removeActivityScheduling(t.id),console.log(`[NQTR] Activity with id ${t.id} was excluded, so it will be associated with this class again.`);return}console.warn(`[NQTR] Activity with id ${t.id} already exists, so it will be ignored.`);return}u.push(t.id),this.setStorageProperty("additionalActivitiesIds",u),Object.keys(s).length&&this.editActivityScheduling(t.id,s);}revoveActivity(t,r={}){let{toDay:i}=r,o={};i===0&&console.warn("[NQTR] The to day must be greater than 0, so it will be ignored."),i&&(o.toDay=i);let n=this.additionalActivitiesIds;if(n.includes(t.id)){if(Object.keys(o).length){this.editExcludedActivityScheduling(t.id,o);return}n=n.filter(s=>s!==t.id),this.setStorageProperty("additionalActivitiesIds",n);}else if(this.defaultActivitiesIds.includes(t.id)){if(Object.keys(o).length){this.editExcludedActivityScheduling(t.id,o);return}let s=this.excludedActivitiesIds;s.push(t.id),this.setStorageProperty("excludedActivitiesIds",s);}else console.warn(`[NQTR] Activity with id ${t.id} not found, so it will be ignored.`);}clearExpiredActivities(){let t=this.activeActivityScheduling,r=this.excludedActivitiesScheduling,i=this.additionalActivitiesIds,o=this.excludedActivitiesIds;i.forEach(n=>{if(n in t){let{toDay:s}=t[n];s&&s<l.currentDay&&(this.removeActivityScheduling(n),i=i.filter(u=>u!==n));}}),o.forEach(n=>{if(n in r){let{toDay:s}=r[n];s&&s<l.currentDay&&(this.removeActivityScheduling(n),o=o.filter(u=>u!==n));}});}get activities(){let t=[];return Object.entries(this.activeActivityScheduling).forEach(([r,i])=>{let o=R(r),{fromDay:n=o?.fromDay,fromHour:s=o?.fromHour,toDay:u=o?.toDay,toHour:N=o?.toHour}=i;o&&!(s&&N&&!l.nowIsBetween(s,N))&&!(n&&n>l.currentDay)&&!(u&&u<l.currentDay)&&t.push(o);}),Object.entries(this.excludedActivitiesScheduling).forEach(([r,i])=>{let o=R(r);o&&o.isActive&&!(i.toDay&&i.toDay>=l.currentDay)&&t.push(o);}),t}};var P="__nqtr-location__",I=class extends v{constructor(t,r,i=[]){super(P,t,i);this._map=r;}get map(){return this._map}get rooms(){return T.rooms.filter(t=>t.location.id===this.id)}};var _=class extends I{constructor(e,t,r={}){super(e,t,r.activities||[]),this.defaultName=r.name||"",this.defaultDisabled=r.disabled||false,this.defaultHidden=r.hidden||false,this._icon=r.icon;}defaultName;get name(){return this.getStorageProperty("name")||this.defaultName}set name(e){this.setStorageProperty("name",e);}defaultDisabled;get disabled(){let e=this.getStorageProperty("disabled")||this.defaultDisabled;return typeof e=="string"?getFlag(e):e}set disabled(e){this.setStorageProperty("disabled",e);}defaultHidden;get hidden(){let e=this.getStorageProperty("hidden")||this.defaultHidden;return typeof e=="string"?getFlag(e):e}set hidden(e){this.setStorageProperty("hidden",e);}_icon;get icon(){return this._icon}};export{_ as default};//# sourceMappingURL=LocationBaseModel.mjs.map
2
2
  //# sourceMappingURL=LocationBaseModel.mjs.map
@@ -1,7 +1,7 @@
1
- import ActivityBaseInterface from '../../interface/ActivityInterface.mjs';
2
- import { b as LocationInternalInterface, M as MapBaseInterface, R as RoomBaseInterface } from '../../RoomInterface-C7Sg80EF.mjs';
1
+ import ActivityInterface from '../../interface/ActivityInterface.mjs';
2
+ import { b as LocationInternalInterface, M as MapInterface, R as RoomInterface } from '../../RoomInterface-DsZAp6Pv.mjs';
3
3
  import NavigationAbstractClass from './NavigationAbstractClass.mjs';
4
- import '@drincs/nqtr/dist/override';
4
+ import '@drincs/nqtr';
5
5
  import '@drincs/pixi-vn';
6
6
  import '../../types/ExecutionType.mjs';
7
7
  import '../../interface/navigation/NavigationAbstractClass.mjs';
@@ -15,9 +15,9 @@ declare class LocationStoredClass extends NavigationAbstractClass implements Loc
15
15
  /**
16
16
  * The map where the location is.
17
17
  */
18
- _map: MapBaseInterface, activities?: ActivityBaseInterface[]);
19
- get map(): MapBaseInterface;
20
- get rooms(): RoomBaseInterface[];
18
+ _map: MapInterface, activities?: ActivityInterface[]);
19
+ get map(): MapInterface;
20
+ get rooms(): RoomInterface[];
21
21
  }
22
22
 
23
23
  export { LocationStoredClass as default };
@@ -1,7 +1,7 @@
1
- import ActivityBaseInterface from '../../interface/ActivityInterface.js';
2
- import { b as LocationInternalInterface, M as MapBaseInterface, R as RoomBaseInterface } from '../../RoomInterface-D7qXKwBI.js';
1
+ import ActivityInterface from '../../interface/ActivityInterface.js';
2
+ import { b as LocationInternalInterface, M as MapInterface, R as RoomInterface } from '../../RoomInterface-BglEhkQT.js';
3
3
  import NavigationAbstractClass from './NavigationAbstractClass.js';
4
- import '@drincs/nqtr/dist/override';
4
+ import '@drincs/nqtr';
5
5
  import '@drincs/pixi-vn';
6
6
  import '../../types/ExecutionType.js';
7
7
  import '../../interface/navigation/NavigationAbstractClass.js';
@@ -15,9 +15,9 @@ declare class LocationStoredClass extends NavigationAbstractClass implements Loc
15
15
  /**
16
16
  * The map where the location is.
17
17
  */
18
- _map: MapBaseInterface, activities?: ActivityBaseInterface[]);
19
- get map(): MapBaseInterface;
20
- get rooms(): RoomBaseInterface[];
18
+ _map: MapInterface, activities?: ActivityInterface[]);
19
+ get map(): MapInterface;
20
+ get rooms(): RoomInterface[];
21
21
  }
22
22
 
23
23
  export { LocationStoredClass as default };
@@ -1,2 +1,2 @@
1
- 'use strict';var pixiVn=require('@drincs/pixi-vn');var m={};function R(a){try{let e=m[a];if(!e){console.error(`[NQTR] Room ${a} not found`);return}return e}catch(e){console.error(`[NQTR] Error while getting Room ${a}`,e);return}}var N="___nqtr-current_room_memory___",g=class{get rooms(){return Object.values(m)}get locations(){let e={};return Object.values(m).forEach(t=>{e[t.location.id]=t.location;}),Object.values(e)}get maps(){let e={};return Object.values(m).forEach(t=>{e[t.location.map.id]=t.location.map;}),Object.values(e)}get currentRoom(){let e=pixiVn.storage.getVariable(N);if(!e){console.error("[NQTR] The current room has not yet been set");return}let t=R(e);if(!t){console.error(`[NQTR] Current room ${e} not found`);return}return t}set currentRoom(e){if(!R(e.id)){console.error(`[NQTR] The room ${e.id} is not registered, so it can't be set as current room`);return}pixiVn.storage.setVariable(N,e.id);}get currentLocation(){return this.currentRoom?.location}get currentMap(){return this.currentRoom?.location.map}clearExpiredActivities(){Object.entries(m).forEach(([e,t])=>{t.clearExpiredActivities();});}};var d="___nqtr-time_manager_data___";var c=class{static minDayHours=0;static maxDayHours=24;static defaultTimeSpent=1;static timeSlots=[];static weekLength=7;static weekendStartDay=this.weekLength-1;static weekDaysNames=[]};var p=class{initialize(e){let{minDayHours:t=0,maxDayHours:r=24,defaultTimeSpent:i=1,timeSlots:o=[],weekLength:n=7,weekendStartDay:s=n-1,weekDaysNames:u=[]}=e;c.minDayHours=t,c.maxDayHours=r,c.defaultTimeSpent=i,c.timeSlots=o,c.weekLength=n,s>=c.weekLength?console.warn(`[NQTR] Weekend start day should be less than week length ${n}, so will be ignored`):c.weekendStartDay=s,u.length!==n?console.warn(`[NQTR] Week days names should be equal to week length ${n}, so will be ignored`):c.weekDaysNames=u;}get minDayHours(){return c.minDayHours}get maxDayHours(){return c.maxDayHours}get defaultTimeSpent(){return c.defaultTimeSpent}get timeSlots(){return c.timeSlots}get weekLength(){return c.weekLength}get weekendStartDay(){return c.weekendStartDay}get weekDaysNames(){return c.weekDaysNames}get currentHour(){let e=pixiVn.storage.getVariable(d)||{};return e.hasOwnProperty("currentHour")&&typeof e.currentHour=="number"?e.currentHour:this.minDayHours}set currentHour(e){let t=pixiVn.storage.getVariable(d)||{};typeof e=="number"?t.currentHour=e:delete t.currentHour,pixiVn.storage.setVariable(d,t);}get currentDay(){let e=pixiVn.storage.getVariable(d)||{};return e.hasOwnProperty("currentDay")&&typeof e.currentDay=="number"?e.currentDay:0}set currentDay(e){let t=pixiVn.storage.getVariable(d)||{};typeof e=="number"?t.currentDay=e:delete t.currentDay,pixiVn.storage.setVariable(d,t);}get isWeekend(){return this.currentWeekDayNumber>=this.weekendStartDay}get currentWeekDayNumber(){return this.currentDay%this.weekLength+1}get currentDayName(){let e=this.currentWeekDayNumber-1;return e>=this.weekDaysNames.length?(console.warn(`[NQTR] Week day name is not defined for day ${e}`,this.weekDaysNames),""):this.weekDaysNames[e]}get currentTimeSlot(){if(this.timeSlots.length===0)return console.warn("[NQTR] Time slots are not defined"),0;for(let e=0;e<this.timeSlots.length;e++){let t=this.timeSlots[e];if(this.timeSlots.length>e+1&&this.nowIsBetween(t.startHour,this.timeSlots[e+1].startHour))return e}return this.timeSlots.length-1}increaseHour(e=this.defaultTimeSpent){let t=this.currentHour+e;return t>=this.maxDayHours&&(this.increaseDay(),t=this.minDayHours+(t-this.maxDayHours)),this.currentHour=t,this.currentHour}increaseDay(e=this.minDayHours,t=1){let r=this.currentDay+t;return this.currentDay=r,this.currentHour=e,this.currentDay}nowIsBetween(e,t){e===undefined&&(e=this.minDayHours),t===undefined&&(t=this.maxDayHours);let r=this.currentHour;return e<t?r>=e&&r<t:r>=e||r<t}};var l=new p,D=new g;var k={};function T(a){try{let e=k[a];if(!e){console.error(`[NQTR] Activity ${a} not found`);return}return e}catch(e){console.error(`[NQTR] Error while getting Activity ${a}`,e);return}}var v=class extends pixiVn.StoredClassModel{constructor(t,r,i=[]){super(t,r);this.defaultActivities=i;}get defaultActivitiesIds(){return this.defaultActivities.map(t=>t.id)}get activeActivityScheduling(){return this.getStorageProperty("activeActivityScheduling")||{}}get excludedActivitiesScheduling(){return this.getStorageProperty("excludedActivitiesScheduling")||{}}removeActivityScheduling(t){let r=this.activeActivityScheduling;delete r[t],this.setStorageProperty("activeActivityScheduling",r);let i=this.excludedActivitiesScheduling;delete i[t],this.setStorageProperty("excludedActivitiesScheduling",i);}editActivityScheduling(t,r){this.removeActivityScheduling(t);let i=this.activeActivityScheduling;i[t]=r,this.setStorageProperty("activeActivityScheduling",i);}editExcludedActivityScheduling(t,r){this.removeActivityScheduling(t);let i=this.excludedActivitiesScheduling;i[t]=r,this.setStorageProperty("excludedActivitiesScheduling",i);}get additionalActivitiesIds(){return this.getStorageProperty("additionalActivitiesIds")||[]}get excludedActivitiesIds(){return this.getStorageProperty("excludedActivitiesIds")||[]}addActivity(t,r={}){let{hours:i,fromDay:o,toDay:n}=r,s={};if(i){if(i.from>=i.to)throw new Error("[NQTR] The from hour must be less than the to hour.");s.fromHour=i.from;}if(o===0&&console.warn("[NQTR] The from day must be greater than 0, so it will be ignored."),n===0&&console.warn("[NQTR] The to day must be greater than 0, so it will be ignored."),o&&n&&o>=n)throw new Error("[NQTR] The from day must be less than the to day.");if(o&&(s.fromDay=o),n&&(s.toDay=n),this.defaultActivitiesIds.includes(t.id)){console.warn(`[NQTR] Activity with id ${t.id} already exists, so it will be ignored.`);return}let u=this.additionalActivitiesIds;if(u.includes(t.id)){if(Object.keys(s).length){this.editActivityScheduling(t.id,s);return}else if(this.excludedActivitiesIds.includes(t.id)){this.removeActivityScheduling(t.id),console.log(`[NQTR] Activity with id ${t.id} was excluded, so it will be associated with this class again.`);return}console.warn(`[NQTR] Activity with id ${t.id} already exists, so it will be ignored.`);return}u.push(t.id),this.setStorageProperty("additionalActivitiesIds",u),Object.keys(s).length&&this.editActivityScheduling(t.id,s);}revoveActivity(t,r={}){let{toDay:i}=r,o={};i===0&&console.warn("[NQTR] The to day must be greater than 0, so it will be ignored."),i&&(o.toDay=i);let n=this.additionalActivitiesIds;if(n.includes(t.id)){if(Object.keys(o).length){this.editExcludedActivityScheduling(t.id,o);return}n=n.filter(s=>s!==t.id),this.setStorageProperty("additionalActivitiesIds",n);}else if(this.defaultActivitiesIds.includes(t.id)){if(Object.keys(o).length){this.editExcludedActivityScheduling(t.id,o);return}let s=this.excludedActivitiesIds;s.push(t.id),this.setStorageProperty("excludedActivitiesIds",s);}else console.warn(`[NQTR] Activity with id ${t.id} not found, so it will be ignored.`);}clearExpiredActivities(){let t=this.activeActivityScheduling,r=this.excludedActivitiesScheduling,i=this.additionalActivitiesIds,o=this.excludedActivitiesIds;i.forEach(n=>{if(n in t){let{toDay:s}=t[n];s&&s<l.currentDay&&(this.removeActivityScheduling(n),i=i.filter(u=>u!==n));}}),o.forEach(n=>{if(n in r){let{toDay:s}=r[n];s&&s<l.currentDay&&(this.removeActivityScheduling(n),o=o.filter(u=>u!==n));}});}get activities(){let t=[];return Object.entries(this.activeActivityScheduling).forEach(([r,i])=>{let o=T(r),{fromDay:n=o?.fromDay,fromHour:s=o?.fromHour,toDay:u=o?.toDay,toHour:E=o?.toHour}=i;o&&!(s&&E&&!l.nowIsBetween(s,E))&&!(n&&n>l.currentDay)&&!(u&&u<l.currentDay)&&t.push(o);}),Object.entries(this.excludedActivitiesScheduling).forEach(([r,i])=>{let o=T(r);o&&o.isActive&&!(i.toDay&&i.toDay>=l.currentDay)&&t.push(o);}),t}};var O="__nqtr-location__",Q=class extends v{constructor(t,r,i=[]){super(O,t,i);this._map=r;}get map(){return this._map}get rooms(){return D.rooms.filter(t=>t.location.id===this.id)}};module.exports=Q;//# sourceMappingURL=LocationStoredClass.js.map
1
+ 'use strict';var pixiVn=require('@drincs/pixi-vn');var m={};function R(a){try{let e=m[a];if(!e){console.error(`[NQTR] Room ${a} not found`);return}return e}catch(e){console.error(`[NQTR] Error while getting Room ${a}`,e);return}}var N="___nqtr-current_room_memory___",g=class{get rooms(){return Object.values(m)}get locations(){let e={};return Object.values(m).forEach(t=>{e[t.location.id]=t.location;}),Object.values(e)}get maps(){let e={};return Object.values(m).forEach(t=>{e[t.location.map.id]=t.location.map;}),Object.values(e)}get currentRoom(){let e=pixiVn.storage.getVariable(N);if(!e){console.error("[NQTR] The current room has not yet been set");return}let t=R(e);if(!t){console.error(`[NQTR] Current room ${e} not found`);return}return t}set currentRoom(e){if(!R(e.id)){console.error(`[NQTR] The room ${e.id} is not registered, so it can't be set as current room`);return}pixiVn.storage.setVariable(N,e.id);}get currentLocation(){return this.currentRoom?.location}get currentMap(){return this.currentRoom?.location.map}clearExpiredActivities(){Object.entries(m).forEach(([e,t])=>{t.clearExpiredActivities();});}};var d="___nqtr-time_manager_data___";var c=class{static minDayHours=0;static maxDayHours=24;static defaultTimeSpent=1;static timeSlots=[];static weekLength=7;static weekendStartDay=this.weekLength-1;static weekDaysNames=[]};var p=class{initialize(e){let{minDayHours:t=0,maxDayHours:r=24,defaultTimeSpent:i=1,timeSlots:o=[],weekLength:n=7,weekendStartDay:s=n-1,weekDaysNames:u=[]}=e;c.minDayHours=t,c.maxDayHours=r,c.defaultTimeSpent=i,c.timeSlots=o,c.weekLength=n,s>=c.weekLength?console.warn(`[NQTR] Weekend start day should be less than week length ${n}, so will be ignored`):c.weekendStartDay=s,u.length!==n?console.warn(`[NQTR] Week days names should be equal to week length ${n}, so will be ignored`):c.weekDaysNames=u;}get minDayHours(){return c.minDayHours}get maxDayHours(){return c.maxDayHours}get defaultTimeSpent(){return c.defaultTimeSpent}get timeSlots(){return c.timeSlots}get weekLength(){return c.weekLength}get weekendStartDay(){return c.weekendStartDay}get weekDaysNames(){return c.weekDaysNames}get currentHour(){let e=pixiVn.storage.getVariable(d)||{};return e.hasOwnProperty("currentHour")&&typeof e.currentHour=="number"?e.currentHour:this.minDayHours}set currentHour(e){let t=pixiVn.storage.getVariable(d)||{};typeof e=="number"?t.currentHour=e:delete t.currentHour,pixiVn.storage.setVariable(d,t);}get currentDay(){let e=pixiVn.storage.getVariable(d)||{};return e.hasOwnProperty("currentDay")&&typeof e.currentDay=="number"?e.currentDay:0}set currentDay(e){let t=pixiVn.storage.getVariable(d)||{};typeof e=="number"?t.currentDay=e:delete t.currentDay,pixiVn.storage.setVariable(d,t);}get isWeekend(){return this.currentWeekDayNumber>=this.weekendStartDay}get currentWeekDayNumber(){return this.currentDay%this.weekLength+1}get currentDayName(){let e=this.currentWeekDayNumber-1;return e>=this.weekDaysNames.length?(console.warn(`[NQTR] Week day name is not defined for day ${e}`,this.weekDaysNames),""):this.weekDaysNames[e]}get currentTimeSlot(){if(this.timeSlots.length===0)return console.warn("[NQTR] Time slots are not defined"),0;for(let e=0;e<this.timeSlots.length;e++){let t=this.timeSlots[e];if(this.timeSlots.length>e+1&&this.nowIsBetween(t.startHour,this.timeSlots[e+1].startHour))return e}return this.timeSlots.length-1}increaseHour(e=this.defaultTimeSpent){let t=this.currentHour+e;return t>=this.maxDayHours&&(this.increaseDay(),t=this.minDayHours+(t-this.maxDayHours)),this.currentHour=t,this.currentHour}increaseDay(e=this.minDayHours,t=1){let r=this.currentDay+t;return this.currentDay=r,this.currentHour=e,this.currentDay}nowIsBetween(e,t){e===undefined&&(e=this.minDayHours),t===undefined&&(t=this.maxDayHours);let r=this.currentHour;return e<t?r>=e&&r<t:r>=e||r<t}};var l=new p,D=new g;var k={};function T(a){try{let e=k[a];if(!e){console.error(`[NQTR] Activity ${a} not found`);return}return e}catch(e){console.error(`[NQTR] Error while getting Activity ${a}`,e);return}}var v=class extends pixiVn.StoredClassModel{constructor(t,r,i=[]){super(t,r);this.defaultActivities=i;}get defaultActivitiesIds(){return this.defaultActivities.map(t=>t.id)}get activeActivityScheduling(){return this.getStorageProperty("activeActivityScheduling")||{}}get excludedActivitiesScheduling(){return this.getStorageProperty("excludedActivitiesScheduling")||{}}removeActivityScheduling(t){let r=this.activeActivityScheduling;delete r[t],this.setStorageProperty("activeActivityScheduling",r);let i=this.excludedActivitiesScheduling;delete i[t],this.setStorageProperty("excludedActivitiesScheduling",i);}editActivityScheduling(t,r){this.removeActivityScheduling(t);let i=this.activeActivityScheduling;i[t]=r,this.setStorageProperty("activeActivityScheduling",i);}editExcludedActivityScheduling(t,r){this.removeActivityScheduling(t);let i=this.excludedActivitiesScheduling;i[t]=r,this.setStorageProperty("excludedActivitiesScheduling",i);}get additionalActivitiesIds(){return this.getStorageProperty("additionalActivitiesIds")||[]}get excludedActivitiesIds(){return this.getStorageProperty("excludedActivitiesIds")||[]}addActivity(t,r={}){let{hours:i,fromDay:o,toDay:n}=r,s={};if(i){if(i.from>=i.to)throw new Error("[NQTR] The from hour must be less than the to hour.");s.fromHour=i.from;}if(o===0&&console.warn("[NQTR] The from day must be greater than 0, so it will be ignored."),n===0&&console.warn("[NQTR] The to day must be greater than 0, so it will be ignored."),o&&n&&o>=n)throw new Error("[NQTR] The from day must be less than the to day.");if(o&&(s.fromDay=o),n&&(s.toDay=n),this.defaultActivitiesIds.includes(t.id)){console.warn(`[NQTR] Activity with id ${t.id} already exists, so it will be ignored.`);return}let u=this.additionalActivitiesIds;if(u.includes(t.id)){if(Object.keys(s).length){this.editActivityScheduling(t.id,s);return}else if(this.excludedActivitiesIds.includes(t.id)){this.removeActivityScheduling(t.id),console.log(`[NQTR] Activity with id ${t.id} was excluded, so it will be associated with this class again.`);return}console.warn(`[NQTR] Activity with id ${t.id} already exists, so it will be ignored.`);return}u.push(t.id),this.setStorageProperty("additionalActivitiesIds",u),Object.keys(s).length&&this.editActivityScheduling(t.id,s);}revoveActivity(t,r={}){let{toDay:i}=r,o={};i===0&&console.warn("[NQTR] The to day must be greater than 0, so it will be ignored."),i&&(o.toDay=i);let n=this.additionalActivitiesIds;if(n.includes(t.id)){if(Object.keys(o).length){this.editExcludedActivityScheduling(t.id,o);return}n=n.filter(s=>s!==t.id),this.setStorageProperty("additionalActivitiesIds",n);}else if(this.defaultActivitiesIds.includes(t.id)){if(Object.keys(o).length){this.editExcludedActivityScheduling(t.id,o);return}let s=this.excludedActivitiesIds;s.push(t.id),this.setStorageProperty("excludedActivitiesIds",s);}else console.warn(`[NQTR] Activity with id ${t.id} not found, so it will be ignored.`);}clearExpiredActivities(){let t=this.activeActivityScheduling,r=this.excludedActivitiesScheduling,i=this.additionalActivitiesIds,o=this.excludedActivitiesIds;i.forEach(n=>{if(n in t){let{toDay:s}=t[n];s&&s<l.currentDay&&(this.removeActivityScheduling(n),i=i.filter(u=>u!==n));}}),o.forEach(n=>{if(n in r){let{toDay:s}=r[n];s&&s<l.currentDay&&(this.removeActivityScheduling(n),o=o.filter(u=>u!==n));}});}get activities(){let t=[];return Object.entries(this.activeActivityScheduling).forEach(([r,i])=>{let o=T(r),{fromDay:n=o?.fromDay,fromHour:s=o?.fromHour,toDay:u=o?.toDay,toHour:_=o?.toHour}=i;o&&!(s&&_&&!l.nowIsBetween(s,_))&&!(n&&n>l.currentDay)&&!(u&&u<l.currentDay)&&t.push(o);}),Object.entries(this.excludedActivitiesScheduling).forEach(([r,i])=>{let o=T(r);o&&o.isActive&&!(i.toDay&&i.toDay>=l.currentDay)&&t.push(o);}),t}};var O="__nqtr-location__",Q=class extends v{constructor(t,r,i=[]){super(O,t,i);this._map=r;}get map(){return this._map}get rooms(){return D.rooms.filter(t=>t.location.id===this.id)}};module.exports=Q;//# sourceMappingURL=LocationStoredClass.js.map
2
2
  //# sourceMappingURL=LocationStoredClass.js.map
@@ -1,2 +1,2 @@
1
- import {StoredClassModel,storage}from'@drincs/pixi-vn';var m={};function R(a){try{let e=m[a];if(!e){console.error(`[NQTR] Room ${a} not found`);return}return e}catch(e){console.error(`[NQTR] Error while getting Room ${a}`,e);return}}var N="___nqtr-current_room_memory___",g=class{get rooms(){return Object.values(m)}get locations(){let e={};return Object.values(m).forEach(t=>{e[t.location.id]=t.location;}),Object.values(e)}get maps(){let e={};return Object.values(m).forEach(t=>{e[t.location.map.id]=t.location.map;}),Object.values(e)}get currentRoom(){let e=storage.getVariable(N);if(!e){console.error("[NQTR] The current room has not yet been set");return}let t=R(e);if(!t){console.error(`[NQTR] Current room ${e} not found`);return}return t}set currentRoom(e){if(!R(e.id)){console.error(`[NQTR] The room ${e.id} is not registered, so it can't be set as current room`);return}storage.setVariable(N,e.id);}get currentLocation(){return this.currentRoom?.location}get currentMap(){return this.currentRoom?.location.map}clearExpiredActivities(){Object.entries(m).forEach(([e,t])=>{t.clearExpiredActivities();});}};var d="___nqtr-time_manager_data___";var c=class{static minDayHours=0;static maxDayHours=24;static defaultTimeSpent=1;static timeSlots=[];static weekLength=7;static weekendStartDay=this.weekLength-1;static weekDaysNames=[]};var p=class{initialize(e){let{minDayHours:t=0,maxDayHours:r=24,defaultTimeSpent:i=1,timeSlots:o=[],weekLength:n=7,weekendStartDay:s=n-1,weekDaysNames:u=[]}=e;c.minDayHours=t,c.maxDayHours=r,c.defaultTimeSpent=i,c.timeSlots=o,c.weekLength=n,s>=c.weekLength?console.warn(`[NQTR] Weekend start day should be less than week length ${n}, so will be ignored`):c.weekendStartDay=s,u.length!==n?console.warn(`[NQTR] Week days names should be equal to week length ${n}, so will be ignored`):c.weekDaysNames=u;}get minDayHours(){return c.minDayHours}get maxDayHours(){return c.maxDayHours}get defaultTimeSpent(){return c.defaultTimeSpent}get timeSlots(){return c.timeSlots}get weekLength(){return c.weekLength}get weekendStartDay(){return c.weekendStartDay}get weekDaysNames(){return c.weekDaysNames}get currentHour(){let e=storage.getVariable(d)||{};return e.hasOwnProperty("currentHour")&&typeof e.currentHour=="number"?e.currentHour:this.minDayHours}set currentHour(e){let t=storage.getVariable(d)||{};typeof e=="number"?t.currentHour=e:delete t.currentHour,storage.setVariable(d,t);}get currentDay(){let e=storage.getVariable(d)||{};return e.hasOwnProperty("currentDay")&&typeof e.currentDay=="number"?e.currentDay:0}set currentDay(e){let t=storage.getVariable(d)||{};typeof e=="number"?t.currentDay=e:delete t.currentDay,storage.setVariable(d,t);}get isWeekend(){return this.currentWeekDayNumber>=this.weekendStartDay}get currentWeekDayNumber(){return this.currentDay%this.weekLength+1}get currentDayName(){let e=this.currentWeekDayNumber-1;return e>=this.weekDaysNames.length?(console.warn(`[NQTR] Week day name is not defined for day ${e}`,this.weekDaysNames),""):this.weekDaysNames[e]}get currentTimeSlot(){if(this.timeSlots.length===0)return console.warn("[NQTR] Time slots are not defined"),0;for(let e=0;e<this.timeSlots.length;e++){let t=this.timeSlots[e];if(this.timeSlots.length>e+1&&this.nowIsBetween(t.startHour,this.timeSlots[e+1].startHour))return e}return this.timeSlots.length-1}increaseHour(e=this.defaultTimeSpent){let t=this.currentHour+e;return t>=this.maxDayHours&&(this.increaseDay(),t=this.minDayHours+(t-this.maxDayHours)),this.currentHour=t,this.currentHour}increaseDay(e=this.minDayHours,t=1){let r=this.currentDay+t;return this.currentDay=r,this.currentHour=e,this.currentDay}nowIsBetween(e,t){e===undefined&&(e=this.minDayHours),t===undefined&&(t=this.maxDayHours);let r=this.currentHour;return e<t?r>=e&&r<t:r>=e||r<t}};var l=new p,D=new g;var k={};function T(a){try{let e=k[a];if(!e){console.error(`[NQTR] Activity ${a} not found`);return}return e}catch(e){console.error(`[NQTR] Error while getting Activity ${a}`,e);return}}var v=class extends StoredClassModel{constructor(t,r,i=[]){super(t,r);this.defaultActivities=i;}get defaultActivitiesIds(){return this.defaultActivities.map(t=>t.id)}get activeActivityScheduling(){return this.getStorageProperty("activeActivityScheduling")||{}}get excludedActivitiesScheduling(){return this.getStorageProperty("excludedActivitiesScheduling")||{}}removeActivityScheduling(t){let r=this.activeActivityScheduling;delete r[t],this.setStorageProperty("activeActivityScheduling",r);let i=this.excludedActivitiesScheduling;delete i[t],this.setStorageProperty("excludedActivitiesScheduling",i);}editActivityScheduling(t,r){this.removeActivityScheduling(t);let i=this.activeActivityScheduling;i[t]=r,this.setStorageProperty("activeActivityScheduling",i);}editExcludedActivityScheduling(t,r){this.removeActivityScheduling(t);let i=this.excludedActivitiesScheduling;i[t]=r,this.setStorageProperty("excludedActivitiesScheduling",i);}get additionalActivitiesIds(){return this.getStorageProperty("additionalActivitiesIds")||[]}get excludedActivitiesIds(){return this.getStorageProperty("excludedActivitiesIds")||[]}addActivity(t,r={}){let{hours:i,fromDay:o,toDay:n}=r,s={};if(i){if(i.from>=i.to)throw new Error("[NQTR] The from hour must be less than the to hour.");s.fromHour=i.from;}if(o===0&&console.warn("[NQTR] The from day must be greater than 0, so it will be ignored."),n===0&&console.warn("[NQTR] The to day must be greater than 0, so it will be ignored."),o&&n&&o>=n)throw new Error("[NQTR] The from day must be less than the to day.");if(o&&(s.fromDay=o),n&&(s.toDay=n),this.defaultActivitiesIds.includes(t.id)){console.warn(`[NQTR] Activity with id ${t.id} already exists, so it will be ignored.`);return}let u=this.additionalActivitiesIds;if(u.includes(t.id)){if(Object.keys(s).length){this.editActivityScheduling(t.id,s);return}else if(this.excludedActivitiesIds.includes(t.id)){this.removeActivityScheduling(t.id),console.log(`[NQTR] Activity with id ${t.id} was excluded, so it will be associated with this class again.`);return}console.warn(`[NQTR] Activity with id ${t.id} already exists, so it will be ignored.`);return}u.push(t.id),this.setStorageProperty("additionalActivitiesIds",u),Object.keys(s).length&&this.editActivityScheduling(t.id,s);}revoveActivity(t,r={}){let{toDay:i}=r,o={};i===0&&console.warn("[NQTR] The to day must be greater than 0, so it will be ignored."),i&&(o.toDay=i);let n=this.additionalActivitiesIds;if(n.includes(t.id)){if(Object.keys(o).length){this.editExcludedActivityScheduling(t.id,o);return}n=n.filter(s=>s!==t.id),this.setStorageProperty("additionalActivitiesIds",n);}else if(this.defaultActivitiesIds.includes(t.id)){if(Object.keys(o).length){this.editExcludedActivityScheduling(t.id,o);return}let s=this.excludedActivitiesIds;s.push(t.id),this.setStorageProperty("excludedActivitiesIds",s);}else console.warn(`[NQTR] Activity with id ${t.id} not found, so it will be ignored.`);}clearExpiredActivities(){let t=this.activeActivityScheduling,r=this.excludedActivitiesScheduling,i=this.additionalActivitiesIds,o=this.excludedActivitiesIds;i.forEach(n=>{if(n in t){let{toDay:s}=t[n];s&&s<l.currentDay&&(this.removeActivityScheduling(n),i=i.filter(u=>u!==n));}}),o.forEach(n=>{if(n in r){let{toDay:s}=r[n];s&&s<l.currentDay&&(this.removeActivityScheduling(n),o=o.filter(u=>u!==n));}});}get activities(){let t=[];return Object.entries(this.activeActivityScheduling).forEach(([r,i])=>{let o=T(r),{fromDay:n=o?.fromDay,fromHour:s=o?.fromHour,toDay:u=o?.toDay,toHour:E=o?.toHour}=i;o&&!(s&&E&&!l.nowIsBetween(s,E))&&!(n&&n>l.currentDay)&&!(u&&u<l.currentDay)&&t.push(o);}),Object.entries(this.excludedActivitiesScheduling).forEach(([r,i])=>{let o=T(r);o&&o.isActive&&!(i.toDay&&i.toDay>=l.currentDay)&&t.push(o);}),t}};var O="__nqtr-location__",Q=class extends v{constructor(t,r,i=[]){super(O,t,i);this._map=r;}get map(){return this._map}get rooms(){return D.rooms.filter(t=>t.location.id===this.id)}};export{Q as default};//# sourceMappingURL=LocationStoredClass.mjs.map
1
+ import {StoredClassModel,storage}from'@drincs/pixi-vn';var m={};function R(a){try{let e=m[a];if(!e){console.error(`[NQTR] Room ${a} not found`);return}return e}catch(e){console.error(`[NQTR] Error while getting Room ${a}`,e);return}}var N="___nqtr-current_room_memory___",g=class{get rooms(){return Object.values(m)}get locations(){let e={};return Object.values(m).forEach(t=>{e[t.location.id]=t.location;}),Object.values(e)}get maps(){let e={};return Object.values(m).forEach(t=>{e[t.location.map.id]=t.location.map;}),Object.values(e)}get currentRoom(){let e=storage.getVariable(N);if(!e){console.error("[NQTR] The current room has not yet been set");return}let t=R(e);if(!t){console.error(`[NQTR] Current room ${e} not found`);return}return t}set currentRoom(e){if(!R(e.id)){console.error(`[NQTR] The room ${e.id} is not registered, so it can't be set as current room`);return}storage.setVariable(N,e.id);}get currentLocation(){return this.currentRoom?.location}get currentMap(){return this.currentRoom?.location.map}clearExpiredActivities(){Object.entries(m).forEach(([e,t])=>{t.clearExpiredActivities();});}};var d="___nqtr-time_manager_data___";var c=class{static minDayHours=0;static maxDayHours=24;static defaultTimeSpent=1;static timeSlots=[];static weekLength=7;static weekendStartDay=this.weekLength-1;static weekDaysNames=[]};var p=class{initialize(e){let{minDayHours:t=0,maxDayHours:r=24,defaultTimeSpent:i=1,timeSlots:o=[],weekLength:n=7,weekendStartDay:s=n-1,weekDaysNames:u=[]}=e;c.minDayHours=t,c.maxDayHours=r,c.defaultTimeSpent=i,c.timeSlots=o,c.weekLength=n,s>=c.weekLength?console.warn(`[NQTR] Weekend start day should be less than week length ${n}, so will be ignored`):c.weekendStartDay=s,u.length!==n?console.warn(`[NQTR] Week days names should be equal to week length ${n}, so will be ignored`):c.weekDaysNames=u;}get minDayHours(){return c.minDayHours}get maxDayHours(){return c.maxDayHours}get defaultTimeSpent(){return c.defaultTimeSpent}get timeSlots(){return c.timeSlots}get weekLength(){return c.weekLength}get weekendStartDay(){return c.weekendStartDay}get weekDaysNames(){return c.weekDaysNames}get currentHour(){let e=storage.getVariable(d)||{};return e.hasOwnProperty("currentHour")&&typeof e.currentHour=="number"?e.currentHour:this.minDayHours}set currentHour(e){let t=storage.getVariable(d)||{};typeof e=="number"?t.currentHour=e:delete t.currentHour,storage.setVariable(d,t);}get currentDay(){let e=storage.getVariable(d)||{};return e.hasOwnProperty("currentDay")&&typeof e.currentDay=="number"?e.currentDay:0}set currentDay(e){let t=storage.getVariable(d)||{};typeof e=="number"?t.currentDay=e:delete t.currentDay,storage.setVariable(d,t);}get isWeekend(){return this.currentWeekDayNumber>=this.weekendStartDay}get currentWeekDayNumber(){return this.currentDay%this.weekLength+1}get currentDayName(){let e=this.currentWeekDayNumber-1;return e>=this.weekDaysNames.length?(console.warn(`[NQTR] Week day name is not defined for day ${e}`,this.weekDaysNames),""):this.weekDaysNames[e]}get currentTimeSlot(){if(this.timeSlots.length===0)return console.warn("[NQTR] Time slots are not defined"),0;for(let e=0;e<this.timeSlots.length;e++){let t=this.timeSlots[e];if(this.timeSlots.length>e+1&&this.nowIsBetween(t.startHour,this.timeSlots[e+1].startHour))return e}return this.timeSlots.length-1}increaseHour(e=this.defaultTimeSpent){let t=this.currentHour+e;return t>=this.maxDayHours&&(this.increaseDay(),t=this.minDayHours+(t-this.maxDayHours)),this.currentHour=t,this.currentHour}increaseDay(e=this.minDayHours,t=1){let r=this.currentDay+t;return this.currentDay=r,this.currentHour=e,this.currentDay}nowIsBetween(e,t){e===undefined&&(e=this.minDayHours),t===undefined&&(t=this.maxDayHours);let r=this.currentHour;return e<t?r>=e&&r<t:r>=e||r<t}};var l=new p,D=new g;var k={};function T(a){try{let e=k[a];if(!e){console.error(`[NQTR] Activity ${a} not found`);return}return e}catch(e){console.error(`[NQTR] Error while getting Activity ${a}`,e);return}}var v=class extends StoredClassModel{constructor(t,r,i=[]){super(t,r);this.defaultActivities=i;}get defaultActivitiesIds(){return this.defaultActivities.map(t=>t.id)}get activeActivityScheduling(){return this.getStorageProperty("activeActivityScheduling")||{}}get excludedActivitiesScheduling(){return this.getStorageProperty("excludedActivitiesScheduling")||{}}removeActivityScheduling(t){let r=this.activeActivityScheduling;delete r[t],this.setStorageProperty("activeActivityScheduling",r);let i=this.excludedActivitiesScheduling;delete i[t],this.setStorageProperty("excludedActivitiesScheduling",i);}editActivityScheduling(t,r){this.removeActivityScheduling(t);let i=this.activeActivityScheduling;i[t]=r,this.setStorageProperty("activeActivityScheduling",i);}editExcludedActivityScheduling(t,r){this.removeActivityScheduling(t);let i=this.excludedActivitiesScheduling;i[t]=r,this.setStorageProperty("excludedActivitiesScheduling",i);}get additionalActivitiesIds(){return this.getStorageProperty("additionalActivitiesIds")||[]}get excludedActivitiesIds(){return this.getStorageProperty("excludedActivitiesIds")||[]}addActivity(t,r={}){let{hours:i,fromDay:o,toDay:n}=r,s={};if(i){if(i.from>=i.to)throw new Error("[NQTR] The from hour must be less than the to hour.");s.fromHour=i.from;}if(o===0&&console.warn("[NQTR] The from day must be greater than 0, so it will be ignored."),n===0&&console.warn("[NQTR] The to day must be greater than 0, so it will be ignored."),o&&n&&o>=n)throw new Error("[NQTR] The from day must be less than the to day.");if(o&&(s.fromDay=o),n&&(s.toDay=n),this.defaultActivitiesIds.includes(t.id)){console.warn(`[NQTR] Activity with id ${t.id} already exists, so it will be ignored.`);return}let u=this.additionalActivitiesIds;if(u.includes(t.id)){if(Object.keys(s).length){this.editActivityScheduling(t.id,s);return}else if(this.excludedActivitiesIds.includes(t.id)){this.removeActivityScheduling(t.id),console.log(`[NQTR] Activity with id ${t.id} was excluded, so it will be associated with this class again.`);return}console.warn(`[NQTR] Activity with id ${t.id} already exists, so it will be ignored.`);return}u.push(t.id),this.setStorageProperty("additionalActivitiesIds",u),Object.keys(s).length&&this.editActivityScheduling(t.id,s);}revoveActivity(t,r={}){let{toDay:i}=r,o={};i===0&&console.warn("[NQTR] The to day must be greater than 0, so it will be ignored."),i&&(o.toDay=i);let n=this.additionalActivitiesIds;if(n.includes(t.id)){if(Object.keys(o).length){this.editExcludedActivityScheduling(t.id,o);return}n=n.filter(s=>s!==t.id),this.setStorageProperty("additionalActivitiesIds",n);}else if(this.defaultActivitiesIds.includes(t.id)){if(Object.keys(o).length){this.editExcludedActivityScheduling(t.id,o);return}let s=this.excludedActivitiesIds;s.push(t.id),this.setStorageProperty("excludedActivitiesIds",s);}else console.warn(`[NQTR] Activity with id ${t.id} not found, so it will be ignored.`);}clearExpiredActivities(){let t=this.activeActivityScheduling,r=this.excludedActivitiesScheduling,i=this.additionalActivitiesIds,o=this.excludedActivitiesIds;i.forEach(n=>{if(n in t){let{toDay:s}=t[n];s&&s<l.currentDay&&(this.removeActivityScheduling(n),i=i.filter(u=>u!==n));}}),o.forEach(n=>{if(n in r){let{toDay:s}=r[n];s&&s<l.currentDay&&(this.removeActivityScheduling(n),o=o.filter(u=>u!==n));}});}get activities(){let t=[];return Object.entries(this.activeActivityScheduling).forEach(([r,i])=>{let o=T(r),{fromDay:n=o?.fromDay,fromHour:s=o?.fromHour,toDay:u=o?.toDay,toHour:_=o?.toHour}=i;o&&!(s&&_&&!l.nowIsBetween(s,_))&&!(n&&n>l.currentDay)&&!(u&&u<l.currentDay)&&t.push(o);}),Object.entries(this.excludedActivitiesScheduling).forEach(([r,i])=>{let o=T(r);o&&o.isActive&&!(i.toDay&&i.toDay>=l.currentDay)&&t.push(o);}),t}};var O="__nqtr-location__",Q=class extends v{constructor(t,r,i=[]){super(O,t,i);this._map=r;}get map(){return this._map}get rooms(){return D.rooms.filter(t=>t.location.id===this.id)}};export{Q as default};//# sourceMappingURL=LocationStoredClass.mjs.map
2
2
  //# sourceMappingURL=LocationStoredClass.mjs.map
@@ -1,8 +1,8 @@
1
1
  import MapBaseModelProps from '../../interface/navigation/MapBaseModelProps.mjs';
2
- import { c as MapBaseInternalInterface } from '../../RoomInterface-C7Sg80EF.mjs';
2
+ import { c as MapBaseInternalInterface } from '../../RoomInterface-DsZAp6Pv.mjs';
3
3
  import MapStoredClass from './MapStoredClass.mjs';
4
4
  import '../../interface/ActivityInterface.mjs';
5
- import '@drincs/nqtr/dist/override';
5
+ import '@drincs/nqtr';
6
6
  import '@drincs/pixi-vn';
7
7
  import '../../types/ExecutionType.mjs';
8
8
  import '../../interface/navigation/NavigationAbstractClass.mjs';
@@ -1,8 +1,8 @@
1
1
  import MapBaseModelProps from '../../interface/navigation/MapBaseModelProps.js';
2
- import { c as MapBaseInternalInterface } from '../../RoomInterface-D7qXKwBI.js';
2
+ import { c as MapBaseInternalInterface } from '../../RoomInterface-BglEhkQT.js';
3
3
  import MapStoredClass from './MapStoredClass.js';
4
4
  import '../../interface/ActivityInterface.js';
5
- import '@drincs/nqtr/dist/override';
5
+ import '@drincs/nqtr';
6
6
  import '@drincs/pixi-vn';
7
7
  import '../../types/ExecutionType.js';
8
8
  import '../../interface/navigation/NavigationAbstractClass.js';
@@ -1,2 +1,2 @@
1
- 'use strict';var pixiVn=require('@drincs/pixi-vn');var l={};function Q(a){try{let e=l[a];if(!e){console.error(`[NQTR] Room ${a} not found`);return}return e}catch(e){console.error(`[NQTR] Error while getting Room ${a}`,e);return}}var C="___nqtr-current_room_memory___",g=class{get rooms(){return Object.values(l)}get locations(){let e={};return Object.values(l).forEach(t=>{e[t.location.id]=t.location;}),Object.values(e)}get maps(){let e={};return Object.values(l).forEach(t=>{e[t.location.map.id]=t.location.map;}),Object.values(e)}get currentRoom(){let e=pixiVn.storage.getVariable(C);if(!e){console.error("[NQTR] The current room has not yet been set");return}let t=Q(e);if(!t){console.error(`[NQTR] Current room ${e} not found`);return}return t}set currentRoom(e){if(!Q(e.id)){console.error(`[NQTR] The room ${e.id} is not registered, so it can't be set as current room`);return}pixiVn.storage.setVariable(C,e.id);}get currentLocation(){return this.currentRoom?.location}get currentMap(){return this.currentRoom?.location.map}clearExpiredActivities(){Object.entries(l).forEach(([e,t])=>{t.clearExpiredActivities();});}};var d="___nqtr-time_manager_data___";var c=class{static minDayHours=0;static maxDayHours=24;static defaultTimeSpent=1;static timeSlots=[];static weekLength=7;static weekendStartDay=this.weekLength-1;static weekDaysNames=[]};var p=class{initialize(e){let{minDayHours:t=0,maxDayHours:r=24,defaultTimeSpent:i=1,timeSlots:o=[],weekLength:n=7,weekendStartDay:s=n-1,weekDaysNames:u=[]}=e;c.minDayHours=t,c.maxDayHours=r,c.defaultTimeSpent=i,c.timeSlots=o,c.weekLength=n,s>=c.weekLength?console.warn(`[NQTR] Weekend start day should be less than week length ${n}, so will be ignored`):c.weekendStartDay=s,u.length!==n?console.warn(`[NQTR] Week days names should be equal to week length ${n}, so will be ignored`):c.weekDaysNames=u;}get minDayHours(){return c.minDayHours}get maxDayHours(){return c.maxDayHours}get defaultTimeSpent(){return c.defaultTimeSpent}get timeSlots(){return c.timeSlots}get weekLength(){return c.weekLength}get weekendStartDay(){return c.weekendStartDay}get weekDaysNames(){return c.weekDaysNames}get currentHour(){let e=pixiVn.storage.getVariable(d)||{};return e.hasOwnProperty("currentHour")&&typeof e.currentHour=="number"?e.currentHour:this.minDayHours}set currentHour(e){let t=pixiVn.storage.getVariable(d)||{};typeof e=="number"?t.currentHour=e:delete t.currentHour,pixiVn.storage.setVariable(d,t);}get currentDay(){let e=pixiVn.storage.getVariable(d)||{};return e.hasOwnProperty("currentDay")&&typeof e.currentDay=="number"?e.currentDay:0}set currentDay(e){let t=pixiVn.storage.getVariable(d)||{};typeof e=="number"?t.currentDay=e:delete t.currentDay,pixiVn.storage.setVariable(d,t);}get isWeekend(){return this.currentWeekDayNumber>=this.weekendStartDay}get currentWeekDayNumber(){return this.currentDay%this.weekLength+1}get currentDayName(){let e=this.currentWeekDayNumber-1;return e>=this.weekDaysNames.length?(console.warn(`[NQTR] Week day name is not defined for day ${e}`,this.weekDaysNames),""):this.weekDaysNames[e]}get currentTimeSlot(){if(this.timeSlots.length===0)return console.warn("[NQTR] Time slots are not defined"),0;for(let e=0;e<this.timeSlots.length;e++){let t=this.timeSlots[e];if(this.timeSlots.length>e+1&&this.nowIsBetween(t.startHour,this.timeSlots[e+1].startHour))return e}return this.timeSlots.length-1}increaseHour(e=this.defaultTimeSpent){let t=this.currentHour+e;return t>=this.maxDayHours&&(this.increaseDay(),t=this.minDayHours+(t-this.maxDayHours)),this.currentHour=t,this.currentHour}increaseDay(e=this.minDayHours,t=1){let r=this.currentDay+t;return this.currentDay=r,this.currentHour=e,this.currentDay}nowIsBetween(e,t){e===undefined&&(e=this.minDayHours),t===undefined&&(t=this.maxDayHours);let r=this.currentHour;return e<t?r>=e&&r<t:r>=e||r<t}};var m=new p,T=new g;var H={};function R(a){try{let e=H[a];if(!e){console.error(`[NQTR] Activity ${a} not found`);return}return e}catch(e){console.error(`[NQTR] Error while getting Activity ${a}`,e);return}}var v=class extends pixiVn.StoredClassModel{constructor(t,r,i=[]){super(t,r);this.defaultActivities=i;}get defaultActivitiesIds(){return this.defaultActivities.map(t=>t.id)}get activeActivityScheduling(){return this.getStorageProperty("activeActivityScheduling")||{}}get excludedActivitiesScheduling(){return this.getStorageProperty("excludedActivitiesScheduling")||{}}removeActivityScheduling(t){let r=this.activeActivityScheduling;delete r[t],this.setStorageProperty("activeActivityScheduling",r);let i=this.excludedActivitiesScheduling;delete i[t],this.setStorageProperty("excludedActivitiesScheduling",i);}editActivityScheduling(t,r){this.removeActivityScheduling(t);let i=this.activeActivityScheduling;i[t]=r,this.setStorageProperty("activeActivityScheduling",i);}editExcludedActivityScheduling(t,r){this.removeActivityScheduling(t);let i=this.excludedActivitiesScheduling;i[t]=r,this.setStorageProperty("excludedActivitiesScheduling",i);}get additionalActivitiesIds(){return this.getStorageProperty("additionalActivitiesIds")||[]}get excludedActivitiesIds(){return this.getStorageProperty("excludedActivitiesIds")||[]}addActivity(t,r={}){let{hours:i,fromDay:o,toDay:n}=r,s={};if(i){if(i.from>=i.to)throw new Error("[NQTR] The from hour must be less than the to hour.");s.fromHour=i.from;}if(o===0&&console.warn("[NQTR] The from day must be greater than 0, so it will be ignored."),n===0&&console.warn("[NQTR] The to day must be greater than 0, so it will be ignored."),o&&n&&o>=n)throw new Error("[NQTR] The from day must be less than the to day.");if(o&&(s.fromDay=o),n&&(s.toDay=n),this.defaultActivitiesIds.includes(t.id)){console.warn(`[NQTR] Activity with id ${t.id} already exists, so it will be ignored.`);return}let u=this.additionalActivitiesIds;if(u.includes(t.id)){if(Object.keys(s).length){this.editActivityScheduling(t.id,s);return}else if(this.excludedActivitiesIds.includes(t.id)){this.removeActivityScheduling(t.id),console.log(`[NQTR] Activity with id ${t.id} was excluded, so it will be associated with this class again.`);return}console.warn(`[NQTR] Activity with id ${t.id} already exists, so it will be ignored.`);return}u.push(t.id),this.setStorageProperty("additionalActivitiesIds",u),Object.keys(s).length&&this.editActivityScheduling(t.id,s);}revoveActivity(t,r={}){let{toDay:i}=r,o={};i===0&&console.warn("[NQTR] The to day must be greater than 0, so it will be ignored."),i&&(o.toDay=i);let n=this.additionalActivitiesIds;if(n.includes(t.id)){if(Object.keys(o).length){this.editExcludedActivityScheduling(t.id,o);return}n=n.filter(s=>s!==t.id),this.setStorageProperty("additionalActivitiesIds",n);}else if(this.defaultActivitiesIds.includes(t.id)){if(Object.keys(o).length){this.editExcludedActivityScheduling(t.id,o);return}let s=this.excludedActivitiesIds;s.push(t.id),this.setStorageProperty("excludedActivitiesIds",s);}else console.warn(`[NQTR] Activity with id ${t.id} not found, so it will be ignored.`);}clearExpiredActivities(){let t=this.activeActivityScheduling,r=this.excludedActivitiesScheduling,i=this.additionalActivitiesIds,o=this.excludedActivitiesIds;i.forEach(n=>{if(n in t){let{toDay:s}=t[n];s&&s<m.currentDay&&(this.removeActivityScheduling(n),i=i.filter(u=>u!==n));}}),o.forEach(n=>{if(n in r){let{toDay:s}=r[n];s&&s<m.currentDay&&(this.removeActivityScheduling(n),o=o.filter(u=>u!==n));}});}get activities(){let t=[];return Object.entries(this.activeActivityScheduling).forEach(([r,i])=>{let o=R(r),{fromDay:n=o?.fromDay,fromHour:s=o?.fromHour,toDay:u=o?.toDay,toHour:E=o?.toHour}=i;o&&!(s&&E&&!m.nowIsBetween(s,E))&&!(n&&n>m.currentDay)&&!(u&&u<m.currentDay)&&t.push(o);}),Object.entries(this.excludedActivitiesScheduling).forEach(([r,i])=>{let o=R(r);o&&o.isActive&&!(i.toDay&&i.toDay>=m.currentDay)&&t.push(o);}),t}};var M="__nqtr-map__",A=class extends v{constructor(e,t=[]){super(M,e,t);}get locations(){return T.locations.filter(e=>e.map.id===this.id)}};var _=class extends A{constructor(e,t={}){super(e,t.activities||[]),this.defaultName=t.name||"",this._image=t.image;}defaultName;get name(){return this.getStorageProperty("name")||this.defaultName}set name(e){this.setStorageProperty("name",e);}_image;get image(){return this._image}};module.exports=_;//# sourceMappingURL=MapBaseModel.js.map
1
+ 'use strict';var pixiVn=require('@drincs/pixi-vn');var l={};function Q(a){try{let e=l[a];if(!e){console.error(`[NQTR] Room ${a} not found`);return}return e}catch(e){console.error(`[NQTR] Error while getting Room ${a}`,e);return}}var C="___nqtr-current_room_memory___",g=class{get rooms(){return Object.values(l)}get locations(){let e={};return Object.values(l).forEach(t=>{e[t.location.id]=t.location;}),Object.values(e)}get maps(){let e={};return Object.values(l).forEach(t=>{e[t.location.map.id]=t.location.map;}),Object.values(e)}get currentRoom(){let e=pixiVn.storage.getVariable(C);if(!e){console.error("[NQTR] The current room has not yet been set");return}let t=Q(e);if(!t){console.error(`[NQTR] Current room ${e} not found`);return}return t}set currentRoom(e){if(!Q(e.id)){console.error(`[NQTR] The room ${e.id} is not registered, so it can't be set as current room`);return}pixiVn.storage.setVariable(C,e.id);}get currentLocation(){return this.currentRoom?.location}get currentMap(){return this.currentRoom?.location.map}clearExpiredActivities(){Object.entries(l).forEach(([e,t])=>{t.clearExpiredActivities();});}};var d="___nqtr-time_manager_data___";var c=class{static minDayHours=0;static maxDayHours=24;static defaultTimeSpent=1;static timeSlots=[];static weekLength=7;static weekendStartDay=this.weekLength-1;static weekDaysNames=[]};var p=class{initialize(e){let{minDayHours:t=0,maxDayHours:r=24,defaultTimeSpent:i=1,timeSlots:o=[],weekLength:n=7,weekendStartDay:s=n-1,weekDaysNames:u=[]}=e;c.minDayHours=t,c.maxDayHours=r,c.defaultTimeSpent=i,c.timeSlots=o,c.weekLength=n,s>=c.weekLength?console.warn(`[NQTR] Weekend start day should be less than week length ${n}, so will be ignored`):c.weekendStartDay=s,u.length!==n?console.warn(`[NQTR] Week days names should be equal to week length ${n}, so will be ignored`):c.weekDaysNames=u;}get minDayHours(){return c.minDayHours}get maxDayHours(){return c.maxDayHours}get defaultTimeSpent(){return c.defaultTimeSpent}get timeSlots(){return c.timeSlots}get weekLength(){return c.weekLength}get weekendStartDay(){return c.weekendStartDay}get weekDaysNames(){return c.weekDaysNames}get currentHour(){let e=pixiVn.storage.getVariable(d)||{};return e.hasOwnProperty("currentHour")&&typeof e.currentHour=="number"?e.currentHour:this.minDayHours}set currentHour(e){let t=pixiVn.storage.getVariable(d)||{};typeof e=="number"?t.currentHour=e:delete t.currentHour,pixiVn.storage.setVariable(d,t);}get currentDay(){let e=pixiVn.storage.getVariable(d)||{};return e.hasOwnProperty("currentDay")&&typeof e.currentDay=="number"?e.currentDay:0}set currentDay(e){let t=pixiVn.storage.getVariable(d)||{};typeof e=="number"?t.currentDay=e:delete t.currentDay,pixiVn.storage.setVariable(d,t);}get isWeekend(){return this.currentWeekDayNumber>=this.weekendStartDay}get currentWeekDayNumber(){return this.currentDay%this.weekLength+1}get currentDayName(){let e=this.currentWeekDayNumber-1;return e>=this.weekDaysNames.length?(console.warn(`[NQTR] Week day name is not defined for day ${e}`,this.weekDaysNames),""):this.weekDaysNames[e]}get currentTimeSlot(){if(this.timeSlots.length===0)return console.warn("[NQTR] Time slots are not defined"),0;for(let e=0;e<this.timeSlots.length;e++){let t=this.timeSlots[e];if(this.timeSlots.length>e+1&&this.nowIsBetween(t.startHour,this.timeSlots[e+1].startHour))return e}return this.timeSlots.length-1}increaseHour(e=this.defaultTimeSpent){let t=this.currentHour+e;return t>=this.maxDayHours&&(this.increaseDay(),t=this.minDayHours+(t-this.maxDayHours)),this.currentHour=t,this.currentHour}increaseDay(e=this.minDayHours,t=1){let r=this.currentDay+t;return this.currentDay=r,this.currentHour=e,this.currentDay}nowIsBetween(e,t){e===undefined&&(e=this.minDayHours),t===undefined&&(t=this.maxDayHours);let r=this.currentHour;return e<t?r>=e&&r<t:r>=e||r<t}};var m=new p,T=new g;var H={};function R(a){try{let e=H[a];if(!e){console.error(`[NQTR] Activity ${a} not found`);return}return e}catch(e){console.error(`[NQTR] Error while getting Activity ${a}`,e);return}}var v=class extends pixiVn.StoredClassModel{constructor(t,r,i=[]){super(t,r);this.defaultActivities=i;}get defaultActivitiesIds(){return this.defaultActivities.map(t=>t.id)}get activeActivityScheduling(){return this.getStorageProperty("activeActivityScheduling")||{}}get excludedActivitiesScheduling(){return this.getStorageProperty("excludedActivitiesScheduling")||{}}removeActivityScheduling(t){let r=this.activeActivityScheduling;delete r[t],this.setStorageProperty("activeActivityScheduling",r);let i=this.excludedActivitiesScheduling;delete i[t],this.setStorageProperty("excludedActivitiesScheduling",i);}editActivityScheduling(t,r){this.removeActivityScheduling(t);let i=this.activeActivityScheduling;i[t]=r,this.setStorageProperty("activeActivityScheduling",i);}editExcludedActivityScheduling(t,r){this.removeActivityScheduling(t);let i=this.excludedActivitiesScheduling;i[t]=r,this.setStorageProperty("excludedActivitiesScheduling",i);}get additionalActivitiesIds(){return this.getStorageProperty("additionalActivitiesIds")||[]}get excludedActivitiesIds(){return this.getStorageProperty("excludedActivitiesIds")||[]}addActivity(t,r={}){let{hours:i,fromDay:o,toDay:n}=r,s={};if(i){if(i.from>=i.to)throw new Error("[NQTR] The from hour must be less than the to hour.");s.fromHour=i.from;}if(o===0&&console.warn("[NQTR] The from day must be greater than 0, so it will be ignored."),n===0&&console.warn("[NQTR] The to day must be greater than 0, so it will be ignored."),o&&n&&o>=n)throw new Error("[NQTR] The from day must be less than the to day.");if(o&&(s.fromDay=o),n&&(s.toDay=n),this.defaultActivitiesIds.includes(t.id)){console.warn(`[NQTR] Activity with id ${t.id} already exists, so it will be ignored.`);return}let u=this.additionalActivitiesIds;if(u.includes(t.id)){if(Object.keys(s).length){this.editActivityScheduling(t.id,s);return}else if(this.excludedActivitiesIds.includes(t.id)){this.removeActivityScheduling(t.id),console.log(`[NQTR] Activity with id ${t.id} was excluded, so it will be associated with this class again.`);return}console.warn(`[NQTR] Activity with id ${t.id} already exists, so it will be ignored.`);return}u.push(t.id),this.setStorageProperty("additionalActivitiesIds",u),Object.keys(s).length&&this.editActivityScheduling(t.id,s);}revoveActivity(t,r={}){let{toDay:i}=r,o={};i===0&&console.warn("[NQTR] The to day must be greater than 0, so it will be ignored."),i&&(o.toDay=i);let n=this.additionalActivitiesIds;if(n.includes(t.id)){if(Object.keys(o).length){this.editExcludedActivityScheduling(t.id,o);return}n=n.filter(s=>s!==t.id),this.setStorageProperty("additionalActivitiesIds",n);}else if(this.defaultActivitiesIds.includes(t.id)){if(Object.keys(o).length){this.editExcludedActivityScheduling(t.id,o);return}let s=this.excludedActivitiesIds;s.push(t.id),this.setStorageProperty("excludedActivitiesIds",s);}else console.warn(`[NQTR] Activity with id ${t.id} not found, so it will be ignored.`);}clearExpiredActivities(){let t=this.activeActivityScheduling,r=this.excludedActivitiesScheduling,i=this.additionalActivitiesIds,o=this.excludedActivitiesIds;i.forEach(n=>{if(n in t){let{toDay:s}=t[n];s&&s<m.currentDay&&(this.removeActivityScheduling(n),i=i.filter(u=>u!==n));}}),o.forEach(n=>{if(n in r){let{toDay:s}=r[n];s&&s<m.currentDay&&(this.removeActivityScheduling(n),o=o.filter(u=>u!==n));}});}get activities(){let t=[];return Object.entries(this.activeActivityScheduling).forEach(([r,i])=>{let o=R(r),{fromDay:n=o?.fromDay,fromHour:s=o?.fromHour,toDay:u=o?.toDay,toHour:N=o?.toHour}=i;o&&!(s&&N&&!m.nowIsBetween(s,N))&&!(n&&n>m.currentDay)&&!(u&&u<m.currentDay)&&t.push(o);}),Object.entries(this.excludedActivitiesScheduling).forEach(([r,i])=>{let o=R(r);o&&o.isActive&&!(i.toDay&&i.toDay>=m.currentDay)&&t.push(o);}),t}};var M="__nqtr-map__",A=class extends v{constructor(e,t=[]){super(M,e,t);}get locations(){return T.locations.filter(e=>e.map.id===this.id)}};var _=class extends A{constructor(e,t={}){super(e,t.activities||[]),this.defaultName=t.name||"",this._image=t.image;}defaultName;get name(){return this.getStorageProperty("name")||this.defaultName}set name(e){this.setStorageProperty("name",e);}_image;get image(){return this._image}};module.exports=_;//# sourceMappingURL=MapBaseModel.js.map
2
2
  //# sourceMappingURL=MapBaseModel.js.map
@@ -1,2 +1,2 @@
1
- import {StoredClassModel,storage}from'@drincs/pixi-vn';var l={};function Q(a){try{let e=l[a];if(!e){console.error(`[NQTR] Room ${a} not found`);return}return e}catch(e){console.error(`[NQTR] Error while getting Room ${a}`,e);return}}var C="___nqtr-current_room_memory___",g=class{get rooms(){return Object.values(l)}get locations(){let e={};return Object.values(l).forEach(t=>{e[t.location.id]=t.location;}),Object.values(e)}get maps(){let e={};return Object.values(l).forEach(t=>{e[t.location.map.id]=t.location.map;}),Object.values(e)}get currentRoom(){let e=storage.getVariable(C);if(!e){console.error("[NQTR] The current room has not yet been set");return}let t=Q(e);if(!t){console.error(`[NQTR] Current room ${e} not found`);return}return t}set currentRoom(e){if(!Q(e.id)){console.error(`[NQTR] The room ${e.id} is not registered, so it can't be set as current room`);return}storage.setVariable(C,e.id);}get currentLocation(){return this.currentRoom?.location}get currentMap(){return this.currentRoom?.location.map}clearExpiredActivities(){Object.entries(l).forEach(([e,t])=>{t.clearExpiredActivities();});}};var d="___nqtr-time_manager_data___";var c=class{static minDayHours=0;static maxDayHours=24;static defaultTimeSpent=1;static timeSlots=[];static weekLength=7;static weekendStartDay=this.weekLength-1;static weekDaysNames=[]};var p=class{initialize(e){let{minDayHours:t=0,maxDayHours:r=24,defaultTimeSpent:i=1,timeSlots:o=[],weekLength:n=7,weekendStartDay:s=n-1,weekDaysNames:u=[]}=e;c.minDayHours=t,c.maxDayHours=r,c.defaultTimeSpent=i,c.timeSlots=o,c.weekLength=n,s>=c.weekLength?console.warn(`[NQTR] Weekend start day should be less than week length ${n}, so will be ignored`):c.weekendStartDay=s,u.length!==n?console.warn(`[NQTR] Week days names should be equal to week length ${n}, so will be ignored`):c.weekDaysNames=u;}get minDayHours(){return c.minDayHours}get maxDayHours(){return c.maxDayHours}get defaultTimeSpent(){return c.defaultTimeSpent}get timeSlots(){return c.timeSlots}get weekLength(){return c.weekLength}get weekendStartDay(){return c.weekendStartDay}get weekDaysNames(){return c.weekDaysNames}get currentHour(){let e=storage.getVariable(d)||{};return e.hasOwnProperty("currentHour")&&typeof e.currentHour=="number"?e.currentHour:this.minDayHours}set currentHour(e){let t=storage.getVariable(d)||{};typeof e=="number"?t.currentHour=e:delete t.currentHour,storage.setVariable(d,t);}get currentDay(){let e=storage.getVariable(d)||{};return e.hasOwnProperty("currentDay")&&typeof e.currentDay=="number"?e.currentDay:0}set currentDay(e){let t=storage.getVariable(d)||{};typeof e=="number"?t.currentDay=e:delete t.currentDay,storage.setVariable(d,t);}get isWeekend(){return this.currentWeekDayNumber>=this.weekendStartDay}get currentWeekDayNumber(){return this.currentDay%this.weekLength+1}get currentDayName(){let e=this.currentWeekDayNumber-1;return e>=this.weekDaysNames.length?(console.warn(`[NQTR] Week day name is not defined for day ${e}`,this.weekDaysNames),""):this.weekDaysNames[e]}get currentTimeSlot(){if(this.timeSlots.length===0)return console.warn("[NQTR] Time slots are not defined"),0;for(let e=0;e<this.timeSlots.length;e++){let t=this.timeSlots[e];if(this.timeSlots.length>e+1&&this.nowIsBetween(t.startHour,this.timeSlots[e+1].startHour))return e}return this.timeSlots.length-1}increaseHour(e=this.defaultTimeSpent){let t=this.currentHour+e;return t>=this.maxDayHours&&(this.increaseDay(),t=this.minDayHours+(t-this.maxDayHours)),this.currentHour=t,this.currentHour}increaseDay(e=this.minDayHours,t=1){let r=this.currentDay+t;return this.currentDay=r,this.currentHour=e,this.currentDay}nowIsBetween(e,t){e===undefined&&(e=this.minDayHours),t===undefined&&(t=this.maxDayHours);let r=this.currentHour;return e<t?r>=e&&r<t:r>=e||r<t}};var m=new p,T=new g;var H={};function R(a){try{let e=H[a];if(!e){console.error(`[NQTR] Activity ${a} not found`);return}return e}catch(e){console.error(`[NQTR] Error while getting Activity ${a}`,e);return}}var v=class extends StoredClassModel{constructor(t,r,i=[]){super(t,r);this.defaultActivities=i;}get defaultActivitiesIds(){return this.defaultActivities.map(t=>t.id)}get activeActivityScheduling(){return this.getStorageProperty("activeActivityScheduling")||{}}get excludedActivitiesScheduling(){return this.getStorageProperty("excludedActivitiesScheduling")||{}}removeActivityScheduling(t){let r=this.activeActivityScheduling;delete r[t],this.setStorageProperty("activeActivityScheduling",r);let i=this.excludedActivitiesScheduling;delete i[t],this.setStorageProperty("excludedActivitiesScheduling",i);}editActivityScheduling(t,r){this.removeActivityScheduling(t);let i=this.activeActivityScheduling;i[t]=r,this.setStorageProperty("activeActivityScheduling",i);}editExcludedActivityScheduling(t,r){this.removeActivityScheduling(t);let i=this.excludedActivitiesScheduling;i[t]=r,this.setStorageProperty("excludedActivitiesScheduling",i);}get additionalActivitiesIds(){return this.getStorageProperty("additionalActivitiesIds")||[]}get excludedActivitiesIds(){return this.getStorageProperty("excludedActivitiesIds")||[]}addActivity(t,r={}){let{hours:i,fromDay:o,toDay:n}=r,s={};if(i){if(i.from>=i.to)throw new Error("[NQTR] The from hour must be less than the to hour.");s.fromHour=i.from;}if(o===0&&console.warn("[NQTR] The from day must be greater than 0, so it will be ignored."),n===0&&console.warn("[NQTR] The to day must be greater than 0, so it will be ignored."),o&&n&&o>=n)throw new Error("[NQTR] The from day must be less than the to day.");if(o&&(s.fromDay=o),n&&(s.toDay=n),this.defaultActivitiesIds.includes(t.id)){console.warn(`[NQTR] Activity with id ${t.id} already exists, so it will be ignored.`);return}let u=this.additionalActivitiesIds;if(u.includes(t.id)){if(Object.keys(s).length){this.editActivityScheduling(t.id,s);return}else if(this.excludedActivitiesIds.includes(t.id)){this.removeActivityScheduling(t.id),console.log(`[NQTR] Activity with id ${t.id} was excluded, so it will be associated with this class again.`);return}console.warn(`[NQTR] Activity with id ${t.id} already exists, so it will be ignored.`);return}u.push(t.id),this.setStorageProperty("additionalActivitiesIds",u),Object.keys(s).length&&this.editActivityScheduling(t.id,s);}revoveActivity(t,r={}){let{toDay:i}=r,o={};i===0&&console.warn("[NQTR] The to day must be greater than 0, so it will be ignored."),i&&(o.toDay=i);let n=this.additionalActivitiesIds;if(n.includes(t.id)){if(Object.keys(o).length){this.editExcludedActivityScheduling(t.id,o);return}n=n.filter(s=>s!==t.id),this.setStorageProperty("additionalActivitiesIds",n);}else if(this.defaultActivitiesIds.includes(t.id)){if(Object.keys(o).length){this.editExcludedActivityScheduling(t.id,o);return}let s=this.excludedActivitiesIds;s.push(t.id),this.setStorageProperty("excludedActivitiesIds",s);}else console.warn(`[NQTR] Activity with id ${t.id} not found, so it will be ignored.`);}clearExpiredActivities(){let t=this.activeActivityScheduling,r=this.excludedActivitiesScheduling,i=this.additionalActivitiesIds,o=this.excludedActivitiesIds;i.forEach(n=>{if(n in t){let{toDay:s}=t[n];s&&s<m.currentDay&&(this.removeActivityScheduling(n),i=i.filter(u=>u!==n));}}),o.forEach(n=>{if(n in r){let{toDay:s}=r[n];s&&s<m.currentDay&&(this.removeActivityScheduling(n),o=o.filter(u=>u!==n));}});}get activities(){let t=[];return Object.entries(this.activeActivityScheduling).forEach(([r,i])=>{let o=R(r),{fromDay:n=o?.fromDay,fromHour:s=o?.fromHour,toDay:u=o?.toDay,toHour:E=o?.toHour}=i;o&&!(s&&E&&!m.nowIsBetween(s,E))&&!(n&&n>m.currentDay)&&!(u&&u<m.currentDay)&&t.push(o);}),Object.entries(this.excludedActivitiesScheduling).forEach(([r,i])=>{let o=R(r);o&&o.isActive&&!(i.toDay&&i.toDay>=m.currentDay)&&t.push(o);}),t}};var M="__nqtr-map__",A=class extends v{constructor(e,t=[]){super(M,e,t);}get locations(){return T.locations.filter(e=>e.map.id===this.id)}};var _=class extends A{constructor(e,t={}){super(e,t.activities||[]),this.defaultName=t.name||"",this._image=t.image;}defaultName;get name(){return this.getStorageProperty("name")||this.defaultName}set name(e){this.setStorageProperty("name",e);}_image;get image(){return this._image}};export{_ as default};//# sourceMappingURL=MapBaseModel.mjs.map
1
+ import {StoredClassModel,storage}from'@drincs/pixi-vn';var l={};function Q(a){try{let e=l[a];if(!e){console.error(`[NQTR] Room ${a} not found`);return}return e}catch(e){console.error(`[NQTR] Error while getting Room ${a}`,e);return}}var C="___nqtr-current_room_memory___",g=class{get rooms(){return Object.values(l)}get locations(){let e={};return Object.values(l).forEach(t=>{e[t.location.id]=t.location;}),Object.values(e)}get maps(){let e={};return Object.values(l).forEach(t=>{e[t.location.map.id]=t.location.map;}),Object.values(e)}get currentRoom(){let e=storage.getVariable(C);if(!e){console.error("[NQTR] The current room has not yet been set");return}let t=Q(e);if(!t){console.error(`[NQTR] Current room ${e} not found`);return}return t}set currentRoom(e){if(!Q(e.id)){console.error(`[NQTR] The room ${e.id} is not registered, so it can't be set as current room`);return}storage.setVariable(C,e.id);}get currentLocation(){return this.currentRoom?.location}get currentMap(){return this.currentRoom?.location.map}clearExpiredActivities(){Object.entries(l).forEach(([e,t])=>{t.clearExpiredActivities();});}};var d="___nqtr-time_manager_data___";var c=class{static minDayHours=0;static maxDayHours=24;static defaultTimeSpent=1;static timeSlots=[];static weekLength=7;static weekendStartDay=this.weekLength-1;static weekDaysNames=[]};var p=class{initialize(e){let{minDayHours:t=0,maxDayHours:r=24,defaultTimeSpent:i=1,timeSlots:o=[],weekLength:n=7,weekendStartDay:s=n-1,weekDaysNames:u=[]}=e;c.minDayHours=t,c.maxDayHours=r,c.defaultTimeSpent=i,c.timeSlots=o,c.weekLength=n,s>=c.weekLength?console.warn(`[NQTR] Weekend start day should be less than week length ${n}, so will be ignored`):c.weekendStartDay=s,u.length!==n?console.warn(`[NQTR] Week days names should be equal to week length ${n}, so will be ignored`):c.weekDaysNames=u;}get minDayHours(){return c.minDayHours}get maxDayHours(){return c.maxDayHours}get defaultTimeSpent(){return c.defaultTimeSpent}get timeSlots(){return c.timeSlots}get weekLength(){return c.weekLength}get weekendStartDay(){return c.weekendStartDay}get weekDaysNames(){return c.weekDaysNames}get currentHour(){let e=storage.getVariable(d)||{};return e.hasOwnProperty("currentHour")&&typeof e.currentHour=="number"?e.currentHour:this.minDayHours}set currentHour(e){let t=storage.getVariable(d)||{};typeof e=="number"?t.currentHour=e:delete t.currentHour,storage.setVariable(d,t);}get currentDay(){let e=storage.getVariable(d)||{};return e.hasOwnProperty("currentDay")&&typeof e.currentDay=="number"?e.currentDay:0}set currentDay(e){let t=storage.getVariable(d)||{};typeof e=="number"?t.currentDay=e:delete t.currentDay,storage.setVariable(d,t);}get isWeekend(){return this.currentWeekDayNumber>=this.weekendStartDay}get currentWeekDayNumber(){return this.currentDay%this.weekLength+1}get currentDayName(){let e=this.currentWeekDayNumber-1;return e>=this.weekDaysNames.length?(console.warn(`[NQTR] Week day name is not defined for day ${e}`,this.weekDaysNames),""):this.weekDaysNames[e]}get currentTimeSlot(){if(this.timeSlots.length===0)return console.warn("[NQTR] Time slots are not defined"),0;for(let e=0;e<this.timeSlots.length;e++){let t=this.timeSlots[e];if(this.timeSlots.length>e+1&&this.nowIsBetween(t.startHour,this.timeSlots[e+1].startHour))return e}return this.timeSlots.length-1}increaseHour(e=this.defaultTimeSpent){let t=this.currentHour+e;return t>=this.maxDayHours&&(this.increaseDay(),t=this.minDayHours+(t-this.maxDayHours)),this.currentHour=t,this.currentHour}increaseDay(e=this.minDayHours,t=1){let r=this.currentDay+t;return this.currentDay=r,this.currentHour=e,this.currentDay}nowIsBetween(e,t){e===undefined&&(e=this.minDayHours),t===undefined&&(t=this.maxDayHours);let r=this.currentHour;return e<t?r>=e&&r<t:r>=e||r<t}};var m=new p,T=new g;var H={};function R(a){try{let e=H[a];if(!e){console.error(`[NQTR] Activity ${a} not found`);return}return e}catch(e){console.error(`[NQTR] Error while getting Activity ${a}`,e);return}}var v=class extends StoredClassModel{constructor(t,r,i=[]){super(t,r);this.defaultActivities=i;}get defaultActivitiesIds(){return this.defaultActivities.map(t=>t.id)}get activeActivityScheduling(){return this.getStorageProperty("activeActivityScheduling")||{}}get excludedActivitiesScheduling(){return this.getStorageProperty("excludedActivitiesScheduling")||{}}removeActivityScheduling(t){let r=this.activeActivityScheduling;delete r[t],this.setStorageProperty("activeActivityScheduling",r);let i=this.excludedActivitiesScheduling;delete i[t],this.setStorageProperty("excludedActivitiesScheduling",i);}editActivityScheduling(t,r){this.removeActivityScheduling(t);let i=this.activeActivityScheduling;i[t]=r,this.setStorageProperty("activeActivityScheduling",i);}editExcludedActivityScheduling(t,r){this.removeActivityScheduling(t);let i=this.excludedActivitiesScheduling;i[t]=r,this.setStorageProperty("excludedActivitiesScheduling",i);}get additionalActivitiesIds(){return this.getStorageProperty("additionalActivitiesIds")||[]}get excludedActivitiesIds(){return this.getStorageProperty("excludedActivitiesIds")||[]}addActivity(t,r={}){let{hours:i,fromDay:o,toDay:n}=r,s={};if(i){if(i.from>=i.to)throw new Error("[NQTR] The from hour must be less than the to hour.");s.fromHour=i.from;}if(o===0&&console.warn("[NQTR] The from day must be greater than 0, so it will be ignored."),n===0&&console.warn("[NQTR] The to day must be greater than 0, so it will be ignored."),o&&n&&o>=n)throw new Error("[NQTR] The from day must be less than the to day.");if(o&&(s.fromDay=o),n&&(s.toDay=n),this.defaultActivitiesIds.includes(t.id)){console.warn(`[NQTR] Activity with id ${t.id} already exists, so it will be ignored.`);return}let u=this.additionalActivitiesIds;if(u.includes(t.id)){if(Object.keys(s).length){this.editActivityScheduling(t.id,s);return}else if(this.excludedActivitiesIds.includes(t.id)){this.removeActivityScheduling(t.id),console.log(`[NQTR] Activity with id ${t.id} was excluded, so it will be associated with this class again.`);return}console.warn(`[NQTR] Activity with id ${t.id} already exists, so it will be ignored.`);return}u.push(t.id),this.setStorageProperty("additionalActivitiesIds",u),Object.keys(s).length&&this.editActivityScheduling(t.id,s);}revoveActivity(t,r={}){let{toDay:i}=r,o={};i===0&&console.warn("[NQTR] The to day must be greater than 0, so it will be ignored."),i&&(o.toDay=i);let n=this.additionalActivitiesIds;if(n.includes(t.id)){if(Object.keys(o).length){this.editExcludedActivityScheduling(t.id,o);return}n=n.filter(s=>s!==t.id),this.setStorageProperty("additionalActivitiesIds",n);}else if(this.defaultActivitiesIds.includes(t.id)){if(Object.keys(o).length){this.editExcludedActivityScheduling(t.id,o);return}let s=this.excludedActivitiesIds;s.push(t.id),this.setStorageProperty("excludedActivitiesIds",s);}else console.warn(`[NQTR] Activity with id ${t.id} not found, so it will be ignored.`);}clearExpiredActivities(){let t=this.activeActivityScheduling,r=this.excludedActivitiesScheduling,i=this.additionalActivitiesIds,o=this.excludedActivitiesIds;i.forEach(n=>{if(n in t){let{toDay:s}=t[n];s&&s<m.currentDay&&(this.removeActivityScheduling(n),i=i.filter(u=>u!==n));}}),o.forEach(n=>{if(n in r){let{toDay:s}=r[n];s&&s<m.currentDay&&(this.removeActivityScheduling(n),o=o.filter(u=>u!==n));}});}get activities(){let t=[];return Object.entries(this.activeActivityScheduling).forEach(([r,i])=>{let o=R(r),{fromDay:n=o?.fromDay,fromHour:s=o?.fromHour,toDay:u=o?.toDay,toHour:N=o?.toHour}=i;o&&!(s&&N&&!m.nowIsBetween(s,N))&&!(n&&n>m.currentDay)&&!(u&&u<m.currentDay)&&t.push(o);}),Object.entries(this.excludedActivitiesScheduling).forEach(([r,i])=>{let o=R(r);o&&o.isActive&&!(i.toDay&&i.toDay>=m.currentDay)&&t.push(o);}),t}};var M="__nqtr-map__",A=class extends v{constructor(e,t=[]){super(M,e,t);}get locations(){return T.locations.filter(e=>e.map.id===this.id)}};var _=class extends A{constructor(e,t={}){super(e,t.activities||[]),this.defaultName=t.name||"",this._image=t.image;}defaultName;get name(){return this.getStorageProperty("name")||this.defaultName}set name(e){this.setStorageProperty("name",e);}_image;get image(){return this._image}};export{_ as default};//# sourceMappingURL=MapBaseModel.mjs.map
2
2
  //# sourceMappingURL=MapBaseModel.mjs.map
@@ -1,14 +1,14 @@
1
- import ActivityBaseInterface from '../../interface/ActivityInterface.mjs';
2
- import { c as MapBaseInternalInterface, L as LocationBaseInterface } from '../../RoomInterface-C7Sg80EF.mjs';
1
+ import ActivityInterface from '../../interface/ActivityInterface.mjs';
2
+ import { c as MapBaseInternalInterface, L as LocationInterface } from '../../RoomInterface-DsZAp6Pv.mjs';
3
3
  import NavigationAbstractClass from './NavigationAbstractClass.mjs';
4
- import '@drincs/nqtr/dist/override';
4
+ import '@drincs/nqtr';
5
5
  import '@drincs/pixi-vn';
6
6
  import '../../types/ExecutionType.mjs';
7
7
  import '../../interface/navigation/NavigationAbstractClass.mjs';
8
8
 
9
9
  declare class MapStoredClass extends NavigationAbstractClass implements MapBaseInternalInterface {
10
- constructor(id: string, activities?: ActivityBaseInterface[]);
11
- get locations(): LocationBaseInterface[];
10
+ constructor(id: string, activities?: ActivityInterface[]);
11
+ get locations(): LocationInterface[];
12
12
  }
13
13
 
14
14
  export { MapStoredClass as default };
@@ -1,14 +1,14 @@
1
- import ActivityBaseInterface from '../../interface/ActivityInterface.js';
2
- import { c as MapBaseInternalInterface, L as LocationBaseInterface } from '../../RoomInterface-D7qXKwBI.js';
1
+ import ActivityInterface from '../../interface/ActivityInterface.js';
2
+ import { c as MapBaseInternalInterface, L as LocationInterface } from '../../RoomInterface-BglEhkQT.js';
3
3
  import NavigationAbstractClass from './NavigationAbstractClass.js';
4
- import '@drincs/nqtr/dist/override';
4
+ import '@drincs/nqtr';
5
5
  import '@drincs/pixi-vn';
6
6
  import '../../types/ExecutionType.js';
7
7
  import '../../interface/navigation/NavigationAbstractClass.js';
8
8
 
9
9
  declare class MapStoredClass extends NavigationAbstractClass implements MapBaseInternalInterface {
10
- constructor(id: string, activities?: ActivityBaseInterface[]);
11
- get locations(): LocationBaseInterface[];
10
+ constructor(id: string, activities?: ActivityInterface[]);
11
+ get locations(): LocationInterface[];
12
12
  }
13
13
 
14
14
  export { MapStoredClass as default };
@@ -1,11 +1,11 @@
1
1
  import { StoredClassModel } from '@drincs/pixi-vn';
2
- import ActivityBaseInterface from '../../interface/ActivityInterface.mjs';
2
+ import ActivityInterface from '../../interface/ActivityInterface.mjs';
3
3
  import NavigationAbstractInterface from '../../interface/navigation/NavigationAbstractClass.mjs';
4
- import '@drincs/nqtr/dist/override';
4
+ import '@drincs/nqtr';
5
5
 
6
6
  declare abstract class NavigationAbstractClass extends StoredClassModel implements NavigationAbstractInterface {
7
7
  private defaultActivities;
8
- constructor(categoryId: string, id: string, defaultActivities?: ActivityBaseInterface[]);
8
+ constructor(categoryId: string, id: string, defaultActivities?: ActivityInterface[]);
9
9
  private get defaultActivitiesIds();
10
10
  private get activeActivityScheduling();
11
11
  private get excludedActivitiesScheduling();
@@ -14,7 +14,7 @@ declare abstract class NavigationAbstractClass extends StoredClassModel implemen
14
14
  private editExcludedActivityScheduling;
15
15
  private get additionalActivitiesIds();
16
16
  private get excludedActivitiesIds();
17
- addActivity(activity: ActivityBaseInterface, options?: {
17
+ addActivity(activity: ActivityInterface, options?: {
18
18
  /**
19
19
  * the activity will be associated with this class only for the specified hours.
20
20
  * If you set from 3 and to 5, the activity will be associated with this class only for hours 3, 4 and 5. soSo at 2 or 6 it will not be associated with this class.
@@ -34,7 +34,7 @@ declare abstract class NavigationAbstractClass extends StoredClassModel implemen
34
34
  */
35
35
  toDay?: number;
36
36
  }): void;
37
- revoveActivity(activity: ActivityBaseInterface, options?: {
37
+ revoveActivity(activity: ActivityInterface, options?: {
38
38
  /**
39
39
  * The activity will be excluded from this class only for the specified days.
40
40
  * If to 3, the activity will be excluded from this class only for days 1, 2 and 3. So at day 4 it will be associated with this class.
@@ -42,7 +42,7 @@ declare abstract class NavigationAbstractClass extends StoredClassModel implemen
42
42
  toDay?: number;
43
43
  }): void;
44
44
  clearExpiredActivities(): void;
45
- get activities(): ActivityBaseInterface[];
45
+ get activities(): ActivityInterface[];
46
46
  }
47
47
 
48
48
  export { NavigationAbstractClass as default };
@@ -1,11 +1,11 @@
1
1
  import { StoredClassModel } from '@drincs/pixi-vn';
2
- import ActivityBaseInterface from '../../interface/ActivityInterface.js';
2
+ import ActivityInterface from '../../interface/ActivityInterface.js';
3
3
  import NavigationAbstractInterface from '../../interface/navigation/NavigationAbstractClass.js';
4
- import '@drincs/nqtr/dist/override';
4
+ import '@drincs/nqtr';
5
5
 
6
6
  declare abstract class NavigationAbstractClass extends StoredClassModel implements NavigationAbstractInterface {
7
7
  private defaultActivities;
8
- constructor(categoryId: string, id: string, defaultActivities?: ActivityBaseInterface[]);
8
+ constructor(categoryId: string, id: string, defaultActivities?: ActivityInterface[]);
9
9
  private get defaultActivitiesIds();
10
10
  private get activeActivityScheduling();
11
11
  private get excludedActivitiesScheduling();
@@ -14,7 +14,7 @@ declare abstract class NavigationAbstractClass extends StoredClassModel implemen
14
14
  private editExcludedActivityScheduling;
15
15
  private get additionalActivitiesIds();
16
16
  private get excludedActivitiesIds();
17
- addActivity(activity: ActivityBaseInterface, options?: {
17
+ addActivity(activity: ActivityInterface, options?: {
18
18
  /**
19
19
  * the activity will be associated with this class only for the specified hours.
20
20
  * If you set from 3 and to 5, the activity will be associated with this class only for hours 3, 4 and 5. soSo at 2 or 6 it will not be associated with this class.
@@ -34,7 +34,7 @@ declare abstract class NavigationAbstractClass extends StoredClassModel implemen
34
34
  */
35
35
  toDay?: number;
36
36
  }): void;
37
- revoveActivity(activity: ActivityBaseInterface, options?: {
37
+ revoveActivity(activity: ActivityInterface, options?: {
38
38
  /**
39
39
  * The activity will be excluded from this class only for the specified days.
40
40
  * If to 3, the activity will be excluded from this class only for days 1, 2 and 3. So at day 4 it will be associated with this class.
@@ -42,7 +42,7 @@ declare abstract class NavigationAbstractClass extends StoredClassModel implemen
42
42
  toDay?: number;
43
43
  }): void;
44
44
  clearExpiredActivities(): void;
45
- get activities(): ActivityBaseInterface[];
45
+ get activities(): ActivityInterface[];
46
46
  }
47
47
 
48
48
  export { NavigationAbstractClass as default };
@@ -1,2 +1,2 @@
1
- 'use strict';var pixiVn=require('@drincs/pixi-vn');var C={};function p(a){try{let e=C[a];if(!e){console.error(`[NQTR] Activity ${a} not found`);return}return e}catch(e){console.error(`[NQTR] Error while getting Activity ${a}`,e);return}}var d="___nqtr-time_manager_data___";var c=class{static minDayHours=0;static maxDayHours=24;static defaultTimeSpent=1;static timeSlots=[];static weekLength=7;static weekendStartDay=this.weekLength-1;static weekDaysNames=[]};var v=class{initialize(e){let{minDayHours:t=0,maxDayHours:r=24,defaultTimeSpent:i=1,timeSlots:o=[],weekLength:n=7,weekendStartDay:s=n-1,weekDaysNames:u=[]}=e;c.minDayHours=t,c.maxDayHours=r,c.defaultTimeSpent=i,c.timeSlots=o,c.weekLength=n,s>=c.weekLength?console.warn(`[NQTR] Weekend start day should be less than week length ${n}, so will be ignored`):c.weekendStartDay=s,u.length!==n?console.warn(`[NQTR] Week days names should be equal to week length ${n}, so will be ignored`):c.weekDaysNames=u;}get minDayHours(){return c.minDayHours}get maxDayHours(){return c.maxDayHours}get defaultTimeSpent(){return c.defaultTimeSpent}get timeSlots(){return c.timeSlots}get weekLength(){return c.weekLength}get weekendStartDay(){return c.weekendStartDay}get weekDaysNames(){return c.weekDaysNames}get currentHour(){let e=pixiVn.storage.getVariable(d)||{};return e.hasOwnProperty("currentHour")&&typeof e.currentHour=="number"?e.currentHour:this.minDayHours}set currentHour(e){let t=pixiVn.storage.getVariable(d)||{};typeof e=="number"?t.currentHour=e:delete t.currentHour,pixiVn.storage.setVariable(d,t);}get currentDay(){let e=pixiVn.storage.getVariable(d)||{};return e.hasOwnProperty("currentDay")&&typeof e.currentDay=="number"?e.currentDay:0}set currentDay(e){let t=pixiVn.storage.getVariable(d)||{};typeof e=="number"?t.currentDay=e:delete t.currentDay,pixiVn.storage.setVariable(d,t);}get isWeekend(){return this.currentWeekDayNumber>=this.weekendStartDay}get currentWeekDayNumber(){return this.currentDay%this.weekLength+1}get currentDayName(){let e=this.currentWeekDayNumber-1;return e>=this.weekDaysNames.length?(console.warn(`[NQTR] Week day name is not defined for day ${e}`,this.weekDaysNames),""):this.weekDaysNames[e]}get currentTimeSlot(){if(this.timeSlots.length===0)return console.warn("[NQTR] Time slots are not defined"),0;for(let e=0;e<this.timeSlots.length;e++){let t=this.timeSlots[e];if(this.timeSlots.length>e+1&&this.nowIsBetween(t.startHour,this.timeSlots[e+1].startHour))return e}return this.timeSlots.length-1}increaseHour(e=this.defaultTimeSpent){let t=this.currentHour+e;return t>=this.maxDayHours&&(this.increaseDay(),t=this.minDayHours+(t-this.maxDayHours)),this.currentHour=t,this.currentHour}increaseDay(e=this.minDayHours,t=1){let r=this.currentDay+t;return this.currentDay=r,this.currentHour=e,this.currentDay}nowIsBetween(e,t){e===undefined&&(e=this.minDayHours),t===undefined&&(t=this.maxDayHours);let r=this.currentHour;return e<t?r>=e&&r<t:r>=e||r<t}};var l=new v;var T=class extends pixiVn.StoredClassModel{constructor(t,r,i=[]){super(t,r);this.defaultActivities=i;}get defaultActivitiesIds(){return this.defaultActivities.map(t=>t.id)}get activeActivityScheduling(){return this.getStorageProperty("activeActivityScheduling")||{}}get excludedActivitiesScheduling(){return this.getStorageProperty("excludedActivitiesScheduling")||{}}removeActivityScheduling(t){let r=this.activeActivityScheduling;delete r[t],this.setStorageProperty("activeActivityScheduling",r);let i=this.excludedActivitiesScheduling;delete i[t],this.setStorageProperty("excludedActivitiesScheduling",i);}editActivityScheduling(t,r){this.removeActivityScheduling(t);let i=this.activeActivityScheduling;i[t]=r,this.setStorageProperty("activeActivityScheduling",i);}editExcludedActivityScheduling(t,r){this.removeActivityScheduling(t);let i=this.excludedActivitiesScheduling;i[t]=r,this.setStorageProperty("excludedActivitiesScheduling",i);}get additionalActivitiesIds(){return this.getStorageProperty("additionalActivitiesIds")||[]}get excludedActivitiesIds(){return this.getStorageProperty("excludedActivitiesIds")||[]}addActivity(t,r={}){let{hours:i,fromDay:o,toDay:n}=r,s={};if(i){if(i.from>=i.to)throw new Error("[NQTR] The from hour must be less than the to hour.");s.fromHour=i.from;}if(o===0&&console.warn("[NQTR] The from day must be greater than 0, so it will be ignored."),n===0&&console.warn("[NQTR] The to day must be greater than 0, so it will be ignored."),o&&n&&o>=n)throw new Error("[NQTR] The from day must be less than the to day.");if(o&&(s.fromDay=o),n&&(s.toDay=n),this.defaultActivitiesIds.includes(t.id)){console.warn(`[NQTR] Activity with id ${t.id} already exists, so it will be ignored.`);return}let u=this.additionalActivitiesIds;if(u.includes(t.id)){if(Object.keys(s).length){this.editActivityScheduling(t.id,s);return}else if(this.excludedActivitiesIds.includes(t.id)){this.removeActivityScheduling(t.id),console.log(`[NQTR] Activity with id ${t.id} was excluded, so it will be associated with this class again.`);return}console.warn(`[NQTR] Activity with id ${t.id} already exists, so it will be ignored.`);return}u.push(t.id),this.setStorageProperty("additionalActivitiesIds",u),Object.keys(s).length&&this.editActivityScheduling(t.id,s);}revoveActivity(t,r={}){let{toDay:i}=r,o={};i===0&&console.warn("[NQTR] The to day must be greater than 0, so it will be ignored."),i&&(o.toDay=i);let n=this.additionalActivitiesIds;if(n.includes(t.id)){if(Object.keys(o).length){this.editExcludedActivityScheduling(t.id,o);return}n=n.filter(s=>s!==t.id),this.setStorageProperty("additionalActivitiesIds",n);}else if(this.defaultActivitiesIds.includes(t.id)){if(Object.keys(o).length){this.editExcludedActivityScheduling(t.id,o);return}let s=this.excludedActivitiesIds;s.push(t.id),this.setStorageProperty("excludedActivitiesIds",s);}else console.warn(`[NQTR] Activity with id ${t.id} not found, so it will be ignored.`);}clearExpiredActivities(){let t=this.activeActivityScheduling,r=this.excludedActivitiesScheduling,i=this.additionalActivitiesIds,o=this.excludedActivitiesIds;i.forEach(n=>{if(n in t){let{toDay:s}=t[n];s&&s<l.currentDay&&(this.removeActivityScheduling(n),i=i.filter(u=>u!==n));}}),o.forEach(n=>{if(n in r){let{toDay:s}=r[n];s&&s<l.currentDay&&(this.removeActivityScheduling(n),o=o.filter(u=>u!==n));}});}get activities(){let t=[];return Object.entries(this.activeActivityScheduling).forEach(([r,i])=>{let o=p(r),{fromDay:n=o?.fromDay,fromHour:s=o?.fromHour,toDay:u=o?.toDay,toHour:R=o?.toHour}=i;o&&!(s&&R&&!l.nowIsBetween(s,R))&&!(n&&n>l.currentDay)&&!(u&&u<l.currentDay)&&t.push(o);}),Object.entries(this.excludedActivitiesScheduling).forEach(([r,i])=>{let o=p(r);o&&o.isActive&&!(i.toDay&&i.toDay>=l.currentDay)&&t.push(o);}),t}};module.exports=T;//# sourceMappingURL=NavigationAbstractClass.js.map
1
+ 'use strict';var pixiVn=require('@drincs/pixi-vn');var C={};function v(a){try{let e=C[a];if(!e){console.error(`[NQTR] Activity ${a} not found`);return}return e}catch(e){console.error(`[NQTR] Error while getting Activity ${a}`,e);return}}var d="___nqtr-time_manager_data___";var c=class{static minDayHours=0;static maxDayHours=24;static defaultTimeSpent=1;static timeSlots=[];static weekLength=7;static weekendStartDay=this.weekLength-1;static weekDaysNames=[]};var p=class{initialize(e){let{minDayHours:t=0,maxDayHours:r=24,defaultTimeSpent:i=1,timeSlots:o=[],weekLength:n=7,weekendStartDay:s=n-1,weekDaysNames:u=[]}=e;c.minDayHours=t,c.maxDayHours=r,c.defaultTimeSpent=i,c.timeSlots=o,c.weekLength=n,s>=c.weekLength?console.warn(`[NQTR] Weekend start day should be less than week length ${n}, so will be ignored`):c.weekendStartDay=s,u.length!==n?console.warn(`[NQTR] Week days names should be equal to week length ${n}, so will be ignored`):c.weekDaysNames=u;}get minDayHours(){return c.minDayHours}get maxDayHours(){return c.maxDayHours}get defaultTimeSpent(){return c.defaultTimeSpent}get timeSlots(){return c.timeSlots}get weekLength(){return c.weekLength}get weekendStartDay(){return c.weekendStartDay}get weekDaysNames(){return c.weekDaysNames}get currentHour(){let e=pixiVn.storage.getVariable(d)||{};return e.hasOwnProperty("currentHour")&&typeof e.currentHour=="number"?e.currentHour:this.minDayHours}set currentHour(e){let t=pixiVn.storage.getVariable(d)||{};typeof e=="number"?t.currentHour=e:delete t.currentHour,pixiVn.storage.setVariable(d,t);}get currentDay(){let e=pixiVn.storage.getVariable(d)||{};return e.hasOwnProperty("currentDay")&&typeof e.currentDay=="number"?e.currentDay:0}set currentDay(e){let t=pixiVn.storage.getVariable(d)||{};typeof e=="number"?t.currentDay=e:delete t.currentDay,pixiVn.storage.setVariable(d,t);}get isWeekend(){return this.currentWeekDayNumber>=this.weekendStartDay}get currentWeekDayNumber(){return this.currentDay%this.weekLength+1}get currentDayName(){let e=this.currentWeekDayNumber-1;return e>=this.weekDaysNames.length?(console.warn(`[NQTR] Week day name is not defined for day ${e}`,this.weekDaysNames),""):this.weekDaysNames[e]}get currentTimeSlot(){if(this.timeSlots.length===0)return console.warn("[NQTR] Time slots are not defined"),0;for(let e=0;e<this.timeSlots.length;e++){let t=this.timeSlots[e];if(this.timeSlots.length>e+1&&this.nowIsBetween(t.startHour,this.timeSlots[e+1].startHour))return e}return this.timeSlots.length-1}increaseHour(e=this.defaultTimeSpent){let t=this.currentHour+e;return t>=this.maxDayHours&&(this.increaseDay(),t=this.minDayHours+(t-this.maxDayHours)),this.currentHour=t,this.currentHour}increaseDay(e=this.minDayHours,t=1){let r=this.currentDay+t;return this.currentDay=r,this.currentHour=e,this.currentDay}nowIsBetween(e,t){e===undefined&&(e=this.minDayHours),t===undefined&&(t=this.maxDayHours);let r=this.currentHour;return e<t?r>=e&&r<t:r>=e||r<t}};var l=new p;var T=class extends pixiVn.StoredClassModel{constructor(t,r,i=[]){super(t,r);this.defaultActivities=i;}get defaultActivitiesIds(){return this.defaultActivities.map(t=>t.id)}get activeActivityScheduling(){return this.getStorageProperty("activeActivityScheduling")||{}}get excludedActivitiesScheduling(){return this.getStorageProperty("excludedActivitiesScheduling")||{}}removeActivityScheduling(t){let r=this.activeActivityScheduling;delete r[t],this.setStorageProperty("activeActivityScheduling",r);let i=this.excludedActivitiesScheduling;delete i[t],this.setStorageProperty("excludedActivitiesScheduling",i);}editActivityScheduling(t,r){this.removeActivityScheduling(t);let i=this.activeActivityScheduling;i[t]=r,this.setStorageProperty("activeActivityScheduling",i);}editExcludedActivityScheduling(t,r){this.removeActivityScheduling(t);let i=this.excludedActivitiesScheduling;i[t]=r,this.setStorageProperty("excludedActivitiesScheduling",i);}get additionalActivitiesIds(){return this.getStorageProperty("additionalActivitiesIds")||[]}get excludedActivitiesIds(){return this.getStorageProperty("excludedActivitiesIds")||[]}addActivity(t,r={}){let{hours:i,fromDay:o,toDay:n}=r,s={};if(i){if(i.from>=i.to)throw new Error("[NQTR] The from hour must be less than the to hour.");s.fromHour=i.from;}if(o===0&&console.warn("[NQTR] The from day must be greater than 0, so it will be ignored."),n===0&&console.warn("[NQTR] The to day must be greater than 0, so it will be ignored."),o&&n&&o>=n)throw new Error("[NQTR] The from day must be less than the to day.");if(o&&(s.fromDay=o),n&&(s.toDay=n),this.defaultActivitiesIds.includes(t.id)){console.warn(`[NQTR] Activity with id ${t.id} already exists, so it will be ignored.`);return}let u=this.additionalActivitiesIds;if(u.includes(t.id)){if(Object.keys(s).length){this.editActivityScheduling(t.id,s);return}else if(this.excludedActivitiesIds.includes(t.id)){this.removeActivityScheduling(t.id),console.log(`[NQTR] Activity with id ${t.id} was excluded, so it will be associated with this class again.`);return}console.warn(`[NQTR] Activity with id ${t.id} already exists, so it will be ignored.`);return}u.push(t.id),this.setStorageProperty("additionalActivitiesIds",u),Object.keys(s).length&&this.editActivityScheduling(t.id,s);}revoveActivity(t,r={}){let{toDay:i}=r,o={};i===0&&console.warn("[NQTR] The to day must be greater than 0, so it will be ignored."),i&&(o.toDay=i);let n=this.additionalActivitiesIds;if(n.includes(t.id)){if(Object.keys(o).length){this.editExcludedActivityScheduling(t.id,o);return}n=n.filter(s=>s!==t.id),this.setStorageProperty("additionalActivitiesIds",n);}else if(this.defaultActivitiesIds.includes(t.id)){if(Object.keys(o).length){this.editExcludedActivityScheduling(t.id,o);return}let s=this.excludedActivitiesIds;s.push(t.id),this.setStorageProperty("excludedActivitiesIds",s);}else console.warn(`[NQTR] Activity with id ${t.id} not found, so it will be ignored.`);}clearExpiredActivities(){let t=this.activeActivityScheduling,r=this.excludedActivitiesScheduling,i=this.additionalActivitiesIds,o=this.excludedActivitiesIds;i.forEach(n=>{if(n in t){let{toDay:s}=t[n];s&&s<l.currentDay&&(this.removeActivityScheduling(n),i=i.filter(u=>u!==n));}}),o.forEach(n=>{if(n in r){let{toDay:s}=r[n];s&&s<l.currentDay&&(this.removeActivityScheduling(n),o=o.filter(u=>u!==n));}});}get activities(){let t=[];return Object.entries(this.activeActivityScheduling).forEach(([r,i])=>{let o=v(r),{fromDay:n=o?.fromDay,fromHour:s=o?.fromHour,toDay:u=o?.toDay,toHour:R=o?.toHour}=i;o&&!(s&&R&&!l.nowIsBetween(s,R))&&!(n&&n>l.currentDay)&&!(u&&u<l.currentDay)&&t.push(o);}),Object.entries(this.excludedActivitiesScheduling).forEach(([r,i])=>{let o=v(r);o&&o.isActive&&!(i.toDay&&i.toDay>=l.currentDay)&&t.push(o);}),t}};module.exports=T;//# sourceMappingURL=NavigationAbstractClass.js.map
2
2
  //# sourceMappingURL=NavigationAbstractClass.js.map
@@ -1,2 +1,2 @@
1
- import {StoredClassModel,storage}from'@drincs/pixi-vn';var C={};function p(a){try{let e=C[a];if(!e){console.error(`[NQTR] Activity ${a} not found`);return}return e}catch(e){console.error(`[NQTR] Error while getting Activity ${a}`,e);return}}var d="___nqtr-time_manager_data___";var c=class{static minDayHours=0;static maxDayHours=24;static defaultTimeSpent=1;static timeSlots=[];static weekLength=7;static weekendStartDay=this.weekLength-1;static weekDaysNames=[]};var v=class{initialize(e){let{minDayHours:t=0,maxDayHours:r=24,defaultTimeSpent:i=1,timeSlots:o=[],weekLength:n=7,weekendStartDay:s=n-1,weekDaysNames:u=[]}=e;c.minDayHours=t,c.maxDayHours=r,c.defaultTimeSpent=i,c.timeSlots=o,c.weekLength=n,s>=c.weekLength?console.warn(`[NQTR] Weekend start day should be less than week length ${n}, so will be ignored`):c.weekendStartDay=s,u.length!==n?console.warn(`[NQTR] Week days names should be equal to week length ${n}, so will be ignored`):c.weekDaysNames=u;}get minDayHours(){return c.minDayHours}get maxDayHours(){return c.maxDayHours}get defaultTimeSpent(){return c.defaultTimeSpent}get timeSlots(){return c.timeSlots}get weekLength(){return c.weekLength}get weekendStartDay(){return c.weekendStartDay}get weekDaysNames(){return c.weekDaysNames}get currentHour(){let e=storage.getVariable(d)||{};return e.hasOwnProperty("currentHour")&&typeof e.currentHour=="number"?e.currentHour:this.minDayHours}set currentHour(e){let t=storage.getVariable(d)||{};typeof e=="number"?t.currentHour=e:delete t.currentHour,storage.setVariable(d,t);}get currentDay(){let e=storage.getVariable(d)||{};return e.hasOwnProperty("currentDay")&&typeof e.currentDay=="number"?e.currentDay:0}set currentDay(e){let t=storage.getVariable(d)||{};typeof e=="number"?t.currentDay=e:delete t.currentDay,storage.setVariable(d,t);}get isWeekend(){return this.currentWeekDayNumber>=this.weekendStartDay}get currentWeekDayNumber(){return this.currentDay%this.weekLength+1}get currentDayName(){let e=this.currentWeekDayNumber-1;return e>=this.weekDaysNames.length?(console.warn(`[NQTR] Week day name is not defined for day ${e}`,this.weekDaysNames),""):this.weekDaysNames[e]}get currentTimeSlot(){if(this.timeSlots.length===0)return console.warn("[NQTR] Time slots are not defined"),0;for(let e=0;e<this.timeSlots.length;e++){let t=this.timeSlots[e];if(this.timeSlots.length>e+1&&this.nowIsBetween(t.startHour,this.timeSlots[e+1].startHour))return e}return this.timeSlots.length-1}increaseHour(e=this.defaultTimeSpent){let t=this.currentHour+e;return t>=this.maxDayHours&&(this.increaseDay(),t=this.minDayHours+(t-this.maxDayHours)),this.currentHour=t,this.currentHour}increaseDay(e=this.minDayHours,t=1){let r=this.currentDay+t;return this.currentDay=r,this.currentHour=e,this.currentDay}nowIsBetween(e,t){e===undefined&&(e=this.minDayHours),t===undefined&&(t=this.maxDayHours);let r=this.currentHour;return e<t?r>=e&&r<t:r>=e||r<t}};var l=new v;var T=class extends StoredClassModel{constructor(t,r,i=[]){super(t,r);this.defaultActivities=i;}get defaultActivitiesIds(){return this.defaultActivities.map(t=>t.id)}get activeActivityScheduling(){return this.getStorageProperty("activeActivityScheduling")||{}}get excludedActivitiesScheduling(){return this.getStorageProperty("excludedActivitiesScheduling")||{}}removeActivityScheduling(t){let r=this.activeActivityScheduling;delete r[t],this.setStorageProperty("activeActivityScheduling",r);let i=this.excludedActivitiesScheduling;delete i[t],this.setStorageProperty("excludedActivitiesScheduling",i);}editActivityScheduling(t,r){this.removeActivityScheduling(t);let i=this.activeActivityScheduling;i[t]=r,this.setStorageProperty("activeActivityScheduling",i);}editExcludedActivityScheduling(t,r){this.removeActivityScheduling(t);let i=this.excludedActivitiesScheduling;i[t]=r,this.setStorageProperty("excludedActivitiesScheduling",i);}get additionalActivitiesIds(){return this.getStorageProperty("additionalActivitiesIds")||[]}get excludedActivitiesIds(){return this.getStorageProperty("excludedActivitiesIds")||[]}addActivity(t,r={}){let{hours:i,fromDay:o,toDay:n}=r,s={};if(i){if(i.from>=i.to)throw new Error("[NQTR] The from hour must be less than the to hour.");s.fromHour=i.from;}if(o===0&&console.warn("[NQTR] The from day must be greater than 0, so it will be ignored."),n===0&&console.warn("[NQTR] The to day must be greater than 0, so it will be ignored."),o&&n&&o>=n)throw new Error("[NQTR] The from day must be less than the to day.");if(o&&(s.fromDay=o),n&&(s.toDay=n),this.defaultActivitiesIds.includes(t.id)){console.warn(`[NQTR] Activity with id ${t.id} already exists, so it will be ignored.`);return}let u=this.additionalActivitiesIds;if(u.includes(t.id)){if(Object.keys(s).length){this.editActivityScheduling(t.id,s);return}else if(this.excludedActivitiesIds.includes(t.id)){this.removeActivityScheduling(t.id),console.log(`[NQTR] Activity with id ${t.id} was excluded, so it will be associated with this class again.`);return}console.warn(`[NQTR] Activity with id ${t.id} already exists, so it will be ignored.`);return}u.push(t.id),this.setStorageProperty("additionalActivitiesIds",u),Object.keys(s).length&&this.editActivityScheduling(t.id,s);}revoveActivity(t,r={}){let{toDay:i}=r,o={};i===0&&console.warn("[NQTR] The to day must be greater than 0, so it will be ignored."),i&&(o.toDay=i);let n=this.additionalActivitiesIds;if(n.includes(t.id)){if(Object.keys(o).length){this.editExcludedActivityScheduling(t.id,o);return}n=n.filter(s=>s!==t.id),this.setStorageProperty("additionalActivitiesIds",n);}else if(this.defaultActivitiesIds.includes(t.id)){if(Object.keys(o).length){this.editExcludedActivityScheduling(t.id,o);return}let s=this.excludedActivitiesIds;s.push(t.id),this.setStorageProperty("excludedActivitiesIds",s);}else console.warn(`[NQTR] Activity with id ${t.id} not found, so it will be ignored.`);}clearExpiredActivities(){let t=this.activeActivityScheduling,r=this.excludedActivitiesScheduling,i=this.additionalActivitiesIds,o=this.excludedActivitiesIds;i.forEach(n=>{if(n in t){let{toDay:s}=t[n];s&&s<l.currentDay&&(this.removeActivityScheduling(n),i=i.filter(u=>u!==n));}}),o.forEach(n=>{if(n in r){let{toDay:s}=r[n];s&&s<l.currentDay&&(this.removeActivityScheduling(n),o=o.filter(u=>u!==n));}});}get activities(){let t=[];return Object.entries(this.activeActivityScheduling).forEach(([r,i])=>{let o=p(r),{fromDay:n=o?.fromDay,fromHour:s=o?.fromHour,toDay:u=o?.toDay,toHour:R=o?.toHour}=i;o&&!(s&&R&&!l.nowIsBetween(s,R))&&!(n&&n>l.currentDay)&&!(u&&u<l.currentDay)&&t.push(o);}),Object.entries(this.excludedActivitiesScheduling).forEach(([r,i])=>{let o=p(r);o&&o.isActive&&!(i.toDay&&i.toDay>=l.currentDay)&&t.push(o);}),t}};export{T as default};//# sourceMappingURL=NavigationAbstractClass.mjs.map
1
+ import {StoredClassModel,storage}from'@drincs/pixi-vn';var C={};function v(a){try{let e=C[a];if(!e){console.error(`[NQTR] Activity ${a} not found`);return}return e}catch(e){console.error(`[NQTR] Error while getting Activity ${a}`,e);return}}var d="___nqtr-time_manager_data___";var c=class{static minDayHours=0;static maxDayHours=24;static defaultTimeSpent=1;static timeSlots=[];static weekLength=7;static weekendStartDay=this.weekLength-1;static weekDaysNames=[]};var p=class{initialize(e){let{minDayHours:t=0,maxDayHours:r=24,defaultTimeSpent:i=1,timeSlots:o=[],weekLength:n=7,weekendStartDay:s=n-1,weekDaysNames:u=[]}=e;c.minDayHours=t,c.maxDayHours=r,c.defaultTimeSpent=i,c.timeSlots=o,c.weekLength=n,s>=c.weekLength?console.warn(`[NQTR] Weekend start day should be less than week length ${n}, so will be ignored`):c.weekendStartDay=s,u.length!==n?console.warn(`[NQTR] Week days names should be equal to week length ${n}, so will be ignored`):c.weekDaysNames=u;}get minDayHours(){return c.minDayHours}get maxDayHours(){return c.maxDayHours}get defaultTimeSpent(){return c.defaultTimeSpent}get timeSlots(){return c.timeSlots}get weekLength(){return c.weekLength}get weekendStartDay(){return c.weekendStartDay}get weekDaysNames(){return c.weekDaysNames}get currentHour(){let e=storage.getVariable(d)||{};return e.hasOwnProperty("currentHour")&&typeof e.currentHour=="number"?e.currentHour:this.minDayHours}set currentHour(e){let t=storage.getVariable(d)||{};typeof e=="number"?t.currentHour=e:delete t.currentHour,storage.setVariable(d,t);}get currentDay(){let e=storage.getVariable(d)||{};return e.hasOwnProperty("currentDay")&&typeof e.currentDay=="number"?e.currentDay:0}set currentDay(e){let t=storage.getVariable(d)||{};typeof e=="number"?t.currentDay=e:delete t.currentDay,storage.setVariable(d,t);}get isWeekend(){return this.currentWeekDayNumber>=this.weekendStartDay}get currentWeekDayNumber(){return this.currentDay%this.weekLength+1}get currentDayName(){let e=this.currentWeekDayNumber-1;return e>=this.weekDaysNames.length?(console.warn(`[NQTR] Week day name is not defined for day ${e}`,this.weekDaysNames),""):this.weekDaysNames[e]}get currentTimeSlot(){if(this.timeSlots.length===0)return console.warn("[NQTR] Time slots are not defined"),0;for(let e=0;e<this.timeSlots.length;e++){let t=this.timeSlots[e];if(this.timeSlots.length>e+1&&this.nowIsBetween(t.startHour,this.timeSlots[e+1].startHour))return e}return this.timeSlots.length-1}increaseHour(e=this.defaultTimeSpent){let t=this.currentHour+e;return t>=this.maxDayHours&&(this.increaseDay(),t=this.minDayHours+(t-this.maxDayHours)),this.currentHour=t,this.currentHour}increaseDay(e=this.minDayHours,t=1){let r=this.currentDay+t;return this.currentDay=r,this.currentHour=e,this.currentDay}nowIsBetween(e,t){e===undefined&&(e=this.minDayHours),t===undefined&&(t=this.maxDayHours);let r=this.currentHour;return e<t?r>=e&&r<t:r>=e||r<t}};var l=new p;var T=class extends StoredClassModel{constructor(t,r,i=[]){super(t,r);this.defaultActivities=i;}get defaultActivitiesIds(){return this.defaultActivities.map(t=>t.id)}get activeActivityScheduling(){return this.getStorageProperty("activeActivityScheduling")||{}}get excludedActivitiesScheduling(){return this.getStorageProperty("excludedActivitiesScheduling")||{}}removeActivityScheduling(t){let r=this.activeActivityScheduling;delete r[t],this.setStorageProperty("activeActivityScheduling",r);let i=this.excludedActivitiesScheduling;delete i[t],this.setStorageProperty("excludedActivitiesScheduling",i);}editActivityScheduling(t,r){this.removeActivityScheduling(t);let i=this.activeActivityScheduling;i[t]=r,this.setStorageProperty("activeActivityScheduling",i);}editExcludedActivityScheduling(t,r){this.removeActivityScheduling(t);let i=this.excludedActivitiesScheduling;i[t]=r,this.setStorageProperty("excludedActivitiesScheduling",i);}get additionalActivitiesIds(){return this.getStorageProperty("additionalActivitiesIds")||[]}get excludedActivitiesIds(){return this.getStorageProperty("excludedActivitiesIds")||[]}addActivity(t,r={}){let{hours:i,fromDay:o,toDay:n}=r,s={};if(i){if(i.from>=i.to)throw new Error("[NQTR] The from hour must be less than the to hour.");s.fromHour=i.from;}if(o===0&&console.warn("[NQTR] The from day must be greater than 0, so it will be ignored."),n===0&&console.warn("[NQTR] The to day must be greater than 0, so it will be ignored."),o&&n&&o>=n)throw new Error("[NQTR] The from day must be less than the to day.");if(o&&(s.fromDay=o),n&&(s.toDay=n),this.defaultActivitiesIds.includes(t.id)){console.warn(`[NQTR] Activity with id ${t.id} already exists, so it will be ignored.`);return}let u=this.additionalActivitiesIds;if(u.includes(t.id)){if(Object.keys(s).length){this.editActivityScheduling(t.id,s);return}else if(this.excludedActivitiesIds.includes(t.id)){this.removeActivityScheduling(t.id),console.log(`[NQTR] Activity with id ${t.id} was excluded, so it will be associated with this class again.`);return}console.warn(`[NQTR] Activity with id ${t.id} already exists, so it will be ignored.`);return}u.push(t.id),this.setStorageProperty("additionalActivitiesIds",u),Object.keys(s).length&&this.editActivityScheduling(t.id,s);}revoveActivity(t,r={}){let{toDay:i}=r,o={};i===0&&console.warn("[NQTR] The to day must be greater than 0, so it will be ignored."),i&&(o.toDay=i);let n=this.additionalActivitiesIds;if(n.includes(t.id)){if(Object.keys(o).length){this.editExcludedActivityScheduling(t.id,o);return}n=n.filter(s=>s!==t.id),this.setStorageProperty("additionalActivitiesIds",n);}else if(this.defaultActivitiesIds.includes(t.id)){if(Object.keys(o).length){this.editExcludedActivityScheduling(t.id,o);return}let s=this.excludedActivitiesIds;s.push(t.id),this.setStorageProperty("excludedActivitiesIds",s);}else console.warn(`[NQTR] Activity with id ${t.id} not found, so it will be ignored.`);}clearExpiredActivities(){let t=this.activeActivityScheduling,r=this.excludedActivitiesScheduling,i=this.additionalActivitiesIds,o=this.excludedActivitiesIds;i.forEach(n=>{if(n in t){let{toDay:s}=t[n];s&&s<l.currentDay&&(this.removeActivityScheduling(n),i=i.filter(u=>u!==n));}}),o.forEach(n=>{if(n in r){let{toDay:s}=r[n];s&&s<l.currentDay&&(this.removeActivityScheduling(n),o=o.filter(u=>u!==n));}});}get activities(){let t=[];return Object.entries(this.activeActivityScheduling).forEach(([r,i])=>{let o=v(r),{fromDay:n=o?.fromDay,fromHour:s=o?.fromHour,toDay:u=o?.toDay,toHour:R=o?.toHour}=i;o&&!(s&&R&&!l.nowIsBetween(s,R))&&!(n&&n>l.currentDay)&&!(u&&u<l.currentDay)&&t.push(o);}),Object.entries(this.excludedActivitiesScheduling).forEach(([r,i])=>{let o=v(r);o&&o.isActive&&!(i.toDay&&i.toDay>=l.currentDay)&&t.push(o);}),t}};export{T as default};//# sourceMappingURL=NavigationAbstractClass.mjs.map
2
2
  //# sourceMappingURL=NavigationAbstractClass.mjs.map