@myclub_se/data-access 1.1.0

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 (521) hide show
  1. package/README.md +22 -0
  2. package/esm2020/index.mjs +10 -0
  3. package/esm2020/lib/api-models/api-activity-extra-member.mjs +2 -0
  4. package/esm2020/lib/api-models/api-activity-invite.mjs +2 -0
  5. package/esm2020/lib/api-models/api-activity-location.mjs +2 -0
  6. package/esm2020/lib/api-models/api-activity-settings.mjs +2 -0
  7. package/esm2020/lib/api-models/api-activity-type.mjs +2 -0
  8. package/esm2020/lib/api-models/api-activity.mjs +2 -0
  9. package/esm2020/lib/api-models/api-auth/api-auth-member.mjs +2 -0
  10. package/esm2020/lib/api-models/api-auth/api-auth-section.mjs +2 -0
  11. package/esm2020/lib/api-models/api-auth/api-auth-team-section.mjs +2 -0
  12. package/esm2020/lib/api-models/api-auth/api-auth-team.mjs +2 -0
  13. package/esm2020/lib/api-models/api-auth/api-auth.mjs +2 -0
  14. package/esm2020/lib/api-models/api-auth/index.mjs +6 -0
  15. package/esm2020/lib/api-models/api-calendar-event.mjs +2 -0
  16. package/esm2020/lib/api-models/api-calendar.mjs +2 -0
  17. package/esm2020/lib/api-models/api-card/api-card-deal.mjs +2 -0
  18. package/esm2020/lib/api-models/api-card/api-card-logo-urls.mjs +2 -0
  19. package/esm2020/lib/api-models/api-card/api-card-logo.mjs +2 -0
  20. package/esm2020/lib/api-models/api-card/api-card-member-ticket.mjs +2 -0
  21. package/esm2020/lib/api-models/api-card/api-card-theme.mjs +2 -0
  22. package/esm2020/lib/api-models/api-card/api-card-ticket-location.mjs +2 -0
  23. package/esm2020/lib/api-models/api-card/api-card-ticket.mjs +2 -0
  24. package/esm2020/lib/api-models/api-card/api-card.mjs +2 -0
  25. package/esm2020/lib/api-models/api-card/api-home-team.mjs +2 -0
  26. package/esm2020/lib/api-models/api-card/api-member-card.mjs +2 -0
  27. package/esm2020/lib/api-models/api-card/api-search-member-card.mjs +2 -0
  28. package/esm2020/lib/api-models/api-card/index.mjs +12 -0
  29. package/esm2020/lib/api-models/api-club-image.mjs +2 -0
  30. package/esm2020/lib/api-models/api-club-section.mjs +2 -0
  31. package/esm2020/lib/api-models/api-club-team.mjs +2 -0
  32. package/esm2020/lib/api-models/api-club.mjs +2 -0
  33. package/esm2020/lib/api-models/api-collection.mjs +2 -0
  34. package/esm2020/lib/api-models/api-directory.mjs +2 -0
  35. package/esm2020/lib/api-models/api-event.mjs +2 -0
  36. package/esm2020/lib/api-models/api-external-link.mjs +2 -0
  37. package/esm2020/lib/api-models/api-file-object.mjs +2 -0
  38. package/esm2020/lib/api-models/api-general-image.mjs +2 -0
  39. package/esm2020/lib/api-models/api-image-urls.mjs +2 -0
  40. package/esm2020/lib/api-models/api-invoice/api-invoice-payments/api-credit-card.mjs +2 -0
  41. package/esm2020/lib/api-models/api-invoice/api-invoice-payments/api-giro.mjs +2 -0
  42. package/esm2020/lib/api-models/api-invoice/api-invoice-payments/api-swish.mjs +2 -0
  43. package/esm2020/lib/api-models/api-invoice/api-invoice-payments/api-zimpler.mjs +2 -0
  44. package/esm2020/lib/api-models/api-invoice/api-invoice-payments/index.mjs +5 -0
  45. package/esm2020/lib/api-models/api-invoice/api-member-fee.mjs +2 -0
  46. package/esm2020/lib/api-models/api-invoice/api-member-invoice-row.mjs +2 -0
  47. package/esm2020/lib/api-models/api-invoice/api-member-invoice.mjs +2 -0
  48. package/esm2020/lib/api-models/api-invoice/api-payment-attempt-create.mjs +7 -0
  49. package/esm2020/lib/api-models/api-invoice/api-payment-attempt.mjs +2 -0
  50. package/esm2020/lib/api-models/api-invoice/api-search-member-invoice.mjs +2 -0
  51. package/esm2020/lib/api-models/api-invoice/api-swish-qr-code.mjs +2 -0
  52. package/esm2020/lib/api-models/api-invoice/api-unpaid-member-invoice.mjs +2 -0
  53. package/esm2020/lib/api-models/api-invoice/index.mjs +11 -0
  54. package/esm2020/lib/api-models/api-invoice/payment-attempt-data-types/api-payment-attempt-credit-card-data-type.mjs +2 -0
  55. package/esm2020/lib/api-models/api-invoice/payment-attempt-data-types/api-payment-attempt-swish-data-type.mjs +2 -0
  56. package/esm2020/lib/api-models/api-invoice/payment-attempt-data-types/api-payment-attempt-zimpler-data-type.mjs +2 -0
  57. package/esm2020/lib/api-models/api-invoice/payment-attempt-data-types/index.mjs +4 -0
  58. package/esm2020/lib/api-models/api-member/api-contact.mjs +2 -0
  59. package/esm2020/lib/api-models/api-member/api-member-attribute.mjs +2 -0
  60. package/esm2020/lib/api-models/api-member/api-member-contact.mjs +2 -0
  61. package/esm2020/lib/api-models/api-member/api-member-function.mjs +2 -0
  62. package/esm2020/lib/api-models/api-member/api-member-validation-settings.mjs +2 -0
  63. package/esm2020/lib/api-models/api-member/api-member.mjs +2 -0
  64. package/esm2020/lib/api-models/api-member/api-search-member.mjs +2 -0
  65. package/esm2020/lib/api-models/api-member/index.mjs +8 -0
  66. package/esm2020/lib/api-models/api-member-activity-invite.mjs +2 -0
  67. package/esm2020/lib/api-models/api-member-public-form.mjs +2 -0
  68. package/esm2020/lib/api-models/api-member-team-through.mjs +2 -0
  69. package/esm2020/lib/api-models/api-member-team.mjs +2 -0
  70. package/esm2020/lib/api-models/api-news.mjs +2 -0
  71. package/esm2020/lib/api-models/api-partner.mjs +2 -0
  72. package/esm2020/lib/api-models/api-search-club.mjs +2 -0
  73. package/esm2020/lib/api-models/api-search-member-team.mjs +2 -0
  74. package/esm2020/lib/api-models/api-section-team.mjs +2 -0
  75. package/esm2020/lib/api-models/api-section.mjs +2 -0
  76. package/esm2020/lib/api-models/api-token.mjs +2 -0
  77. package/esm2020/lib/api-models/api-user-notification.mjs +2 -0
  78. package/esm2020/lib/api-models/api-user.mjs +2 -0
  79. package/esm2020/lib/api-models/index.mjs +36 -0
  80. package/esm2020/lib/authentication/authentication.config.mjs +2 -0
  81. package/esm2020/lib/authentication/authentication.interceptor.mjs +44 -0
  82. package/esm2020/lib/authentication/authentication.service.mjs +73 -0
  83. package/esm2020/lib/authentication/guards/authenticated.guard.mjs +36 -0
  84. package/esm2020/lib/authentication/guards/handle-grant-token.guard.mjs +29 -0
  85. package/esm2020/lib/authentication/index.mjs +5 -0
  86. package/esm2020/lib/data-access.module.mjs +29 -0
  87. package/esm2020/lib/interfaces/index.mjs +3 -0
  88. package/esm2020/lib/interfaces/new-account.interface.mjs +2 -0
  89. package/esm2020/lib/interfaces/option.interface.mjs +2 -0
  90. package/esm2020/lib/models/activity-extra-member.mjs +12 -0
  91. package/esm2020/lib/models/activity-invite.mjs +18 -0
  92. package/esm2020/lib/models/activity-location.mjs +12 -0
  93. package/esm2020/lib/models/activity-settings.mjs +14 -0
  94. package/esm2020/lib/models/activity-type.mjs +11 -0
  95. package/esm2020/lib/models/activity.mjs +87 -0
  96. package/esm2020/lib/models/auth/auth-member.mjs +10 -0
  97. package/esm2020/lib/models/auth/auth-section.mjs +7 -0
  98. package/esm2020/lib/models/auth/auth-team-section.mjs +7 -0
  99. package/esm2020/lib/models/auth/auth-team.mjs +9 -0
  100. package/esm2020/lib/models/auth/auth.mjs +15 -0
  101. package/esm2020/lib/models/auth/index.mjs +6 -0
  102. package/esm2020/lib/models/authentication.mjs +7 -0
  103. package/esm2020/lib/models/calendar-event.mjs +20 -0
  104. package/esm2020/lib/models/calendar.mjs +10 -0
  105. package/esm2020/lib/models/card/card-deal.mjs +10 -0
  106. package/esm2020/lib/models/card/card-logo-urls.mjs +13 -0
  107. package/esm2020/lib/models/card/card-logo.mjs +8 -0
  108. package/esm2020/lib/models/card/card-member-ticket.mjs +11 -0
  109. package/esm2020/lib/models/card/card-theme.mjs +10 -0
  110. package/esm2020/lib/models/card/card-ticket-location.mjs +9 -0
  111. package/esm2020/lib/models/card/card-ticket.mjs +21 -0
  112. package/esm2020/lib/models/card/card.mjs +13 -0
  113. package/esm2020/lib/models/card/home-team.mjs +8 -0
  114. package/esm2020/lib/models/card/index.mjs +12 -0
  115. package/esm2020/lib/models/card/member-card.mjs +12 -0
  116. package/esm2020/lib/models/card/search-member-card.mjs +8 -0
  117. package/esm2020/lib/models/club-image.mjs +18 -0
  118. package/esm2020/lib/models/club-section.mjs +7 -0
  119. package/esm2020/lib/models/club-team.mjs +7 -0
  120. package/esm2020/lib/models/club.mjs +7 -0
  121. package/esm2020/lib/models/collection.mjs +15 -0
  122. package/esm2020/lib/models/contact.mjs +46 -0
  123. package/esm2020/lib/models/directory.mjs +20 -0
  124. package/esm2020/lib/models/email-recipient.mjs +7 -0
  125. package/esm2020/lib/models/email.mjs +8 -0
  126. package/esm2020/lib/models/event.mjs +20 -0
  127. package/esm2020/lib/models/external-link.mjs +7 -0
  128. package/esm2020/lib/models/file-object.mjs +13 -0
  129. package/esm2020/lib/models/general-image.mjs +8 -0
  130. package/esm2020/lib/models/image-urls.mjs +10 -0
  131. package/esm2020/lib/models/index.mjs +42 -0
  132. package/esm2020/lib/models/invoice/index.mjs +10 -0
  133. package/esm2020/lib/models/invoice/member-fee.mjs +9 -0
  134. package/esm2020/lib/models/invoice/member-invoice-row.mjs +17 -0
  135. package/esm2020/lib/models/invoice/member-invoice.mjs +24 -0
  136. package/esm2020/lib/models/invoice/payment-attempt-data-types/index.mjs +4 -0
  137. package/esm2020/lib/models/invoice/payment-attempt-data-types/payment-attempt-credit-card-data-type.mjs +2 -0
  138. package/esm2020/lib/models/invoice/payment-attempt-data-types/payment-attempt-swish-data-type.mjs +2 -0
  139. package/esm2020/lib/models/invoice/payment-attempt-data-types/payment-attempt-zimpler-data-type.mjs +2 -0
  140. package/esm2020/lib/models/invoice/payment-attempt.mjs +13 -0
  141. package/esm2020/lib/models/invoice/payment-types/credit-card.mjs +16 -0
  142. package/esm2020/lib/models/invoice/payment-types/giro.mjs +11 -0
  143. package/esm2020/lib/models/invoice/payment-types/index.mjs +5 -0
  144. package/esm2020/lib/models/invoice/payment-types/swish.mjs +14 -0
  145. package/esm2020/lib/models/invoice/payment-types/zimpler.mjs +12 -0
  146. package/esm2020/lib/models/invoice/search-member-invoice.mjs +17 -0
  147. package/esm2020/lib/models/invoice/swish-qr-code.mjs +6 -0
  148. package/esm2020/lib/models/invoice/unpaid-member-invoice.mjs +9 -0
  149. package/esm2020/lib/models/member/index.mjs +7 -0
  150. package/esm2020/lib/models/member/member-attribute.mjs +24 -0
  151. package/esm2020/lib/models/member/member-contact.mjs +21 -0
  152. package/esm2020/lib/models/member/member-function.mjs +19 -0
  153. package/esm2020/lib/models/member/member-validation-settings.mjs +13 -0
  154. package/esm2020/lib/models/member/member.mjs +75 -0
  155. package/esm2020/lib/models/member/search-member.mjs +20 -0
  156. package/esm2020/lib/models/member-activity-invite.mjs +27 -0
  157. package/esm2020/lib/models/member-public-form.mjs +10 -0
  158. package/esm2020/lib/models/member-team-through.mjs +14 -0
  159. package/esm2020/lib/models/member-team.mjs +11 -0
  160. package/esm2020/lib/models/news.mjs +22 -0
  161. package/esm2020/lib/models/partner.mjs +9 -0
  162. package/esm2020/lib/models/role.mjs +10 -0
  163. package/esm2020/lib/models/search-club.mjs +9 -0
  164. package/esm2020/lib/models/search-member-team.mjs +9 -0
  165. package/esm2020/lib/models/section-team.mjs +7 -0
  166. package/esm2020/lib/models/section.mjs +7 -0
  167. package/esm2020/lib/models/token.mjs +7 -0
  168. package/esm2020/lib/models/user-notification.mjs +13 -0
  169. package/esm2020/lib/models/user.mjs +31 -0
  170. package/esm2020/lib/services/activity.service.mjs +178 -0
  171. package/esm2020/lib/services/api.service.mjs +85 -0
  172. package/esm2020/lib/services/auth.service.mjs +56 -0
  173. package/esm2020/lib/services/club.service.mjs +29 -0
  174. package/esm2020/lib/services/constant.service.mjs +131 -0
  175. package/esm2020/lib/services/email.service.mjs +53 -0
  176. package/esm2020/lib/services/external-link.service.mjs +24 -0
  177. package/esm2020/lib/services/factories/activity-extra-member-factory.mjs +6 -0
  178. package/esm2020/lib/services/factories/activity-factory.mjs +5 -0
  179. package/esm2020/lib/services/factories/activity-invite-factory.mjs +6 -0
  180. package/esm2020/lib/services/factories/activity-location-factory.mjs +3 -0
  181. package/esm2020/lib/services/factories/activity-settings-factory.mjs +3 -0
  182. package/esm2020/lib/services/factories/activity-type-factory.mjs +3 -0
  183. package/esm2020/lib/services/factories/auth-factory.mjs +6 -0
  184. package/esm2020/lib/services/factories/auth-member-factory.mjs +3 -0
  185. package/esm2020/lib/services/factories/auth-section-factory.mjs +3 -0
  186. package/esm2020/lib/services/factories/auth-team-factory.mjs +4 -0
  187. package/esm2020/lib/services/factories/auth-team-section-factory.mjs +3 -0
  188. package/esm2020/lib/services/factories/card-deal-factory.mjs +4 -0
  189. package/esm2020/lib/services/factories/card-factory.mjs +5 -0
  190. package/esm2020/lib/services/factories/card-logo-factory.mjs +4 -0
  191. package/esm2020/lib/services/factories/card-logo-urls-factory.mjs +3 -0
  192. package/esm2020/lib/services/factories/card-member-ticket-factory.mjs +3 -0
  193. package/esm2020/lib/services/factories/card-theme-factory.mjs +4 -0
  194. package/esm2020/lib/services/factories/card-ticket-factory.mjs +7 -0
  195. package/esm2020/lib/services/factories/card-ticket-location-factory.mjs +3 -0
  196. package/esm2020/lib/services/factories/club-factory.mjs +3 -0
  197. package/esm2020/lib/services/factories/club-image-factory.mjs +3 -0
  198. package/esm2020/lib/services/factories/club-section-factory.mjs +3 -0
  199. package/esm2020/lib/services/factories/contact-factory.mjs +3 -0
  200. package/esm2020/lib/services/factories/credit-card-factory.mjs +3 -0
  201. package/esm2020/lib/services/factories/directory-factory.mjs +4 -0
  202. package/esm2020/lib/services/factories/event-factory.mjs +3 -0
  203. package/esm2020/lib/services/factories/external-link-factory.mjs +3 -0
  204. package/esm2020/lib/services/factories/file-factory.mjs +3 -0
  205. package/esm2020/lib/services/factories/general-image-factory.mjs +4 -0
  206. package/esm2020/lib/services/factories/giro-factory.mjs +3 -0
  207. package/esm2020/lib/services/factories/home-team-factory.mjs +4 -0
  208. package/esm2020/lib/services/factories/image-urls-factory.mjs +3 -0
  209. package/esm2020/lib/services/factories/index.mjs +62 -0
  210. package/esm2020/lib/services/factories/member-attribute-factory.mjs +3 -0
  211. package/esm2020/lib/services/factories/member-card-factory.mjs +4 -0
  212. package/esm2020/lib/services/factories/member-contact-factory.mjs +4 -0
  213. package/esm2020/lib/services/factories/member-factory.mjs +8 -0
  214. package/esm2020/lib/services/factories/member-fee-factory.mjs +3 -0
  215. package/esm2020/lib/services/factories/member-function-factory.mjs +3 -0
  216. package/esm2020/lib/services/factories/member-invite-factory.mjs +3 -0
  217. package/esm2020/lib/services/factories/member-invoice-factory.mjs +8 -0
  218. package/esm2020/lib/services/factories/member-invoice-row-factory.mjs +4 -0
  219. package/esm2020/lib/services/factories/member-public-form-factory.mjs +3 -0
  220. package/esm2020/lib/services/factories/member-team-factory.mjs +5 -0
  221. package/esm2020/lib/services/factories/member-team-through-factory.mjs +4 -0
  222. package/esm2020/lib/services/factories/member-validation-settings-factory.mjs +3 -0
  223. package/esm2020/lib/services/factories/news-factory.mjs +3 -0
  224. package/esm2020/lib/services/factories/partner-factory.mjs +4 -0
  225. package/esm2020/lib/services/factories/payment-attempt-factory.mjs +23 -0
  226. package/esm2020/lib/services/factories/search-club-factory.mjs +3 -0
  227. package/esm2020/lib/services/factories/search-member-card-factory.mjs +3 -0
  228. package/esm2020/lib/services/factories/search-member-factory.mjs +3 -0
  229. package/esm2020/lib/services/factories/search-member-invoice-factory.mjs +3 -0
  230. package/esm2020/lib/services/factories/search-member-team-factory.mjs +5 -0
  231. package/esm2020/lib/services/factories/search-member-team-through-factory.mjs +4 -0
  232. package/esm2020/lib/services/factories/section-factory.mjs +3 -0
  233. package/esm2020/lib/services/factories/swish-factory.mjs +3 -0
  234. package/esm2020/lib/services/factories/token-factory.mjs +3 -0
  235. package/esm2020/lib/services/factories/unpaid-invoice-factory.mjs +3 -0
  236. package/esm2020/lib/services/factories/user-factory.mjs +3 -0
  237. package/esm2020/lib/services/factories/user-notification-factory.mjs +3 -0
  238. package/esm2020/lib/services/factories/zimpler-factory.mjs +3 -0
  239. package/esm2020/lib/services/file.service.mjs +29 -0
  240. package/esm2020/lib/services/index.mjs +18 -0
  241. package/esm2020/lib/services/invoice/index.mjs +3 -0
  242. package/esm2020/lib/services/invoice/invoice.service.mjs +41 -0
  243. package/esm2020/lib/services/invoice/payment-attempt.service.mjs +51 -0
  244. package/esm2020/lib/services/member-card.service.mjs +82 -0
  245. package/esm2020/lib/services/member-public-form.service.mjs +24 -0
  246. package/esm2020/lib/services/member.service.mjs +58 -0
  247. package/esm2020/lib/services/news.service.mjs +30 -0
  248. package/esm2020/lib/services/section.service.mjs +23 -0
  249. package/esm2020/lib/services/team.service.mjs +81 -0
  250. package/esm2020/lib/services/token.service.mjs +57 -0
  251. package/esm2020/lib/services/user-notification.service.mjs +23 -0
  252. package/esm2020/lib/services/user.service.mjs +68 -0
  253. package/esm2020/lib/types/attribute-type.mjs +2 -0
  254. package/esm2020/lib/types/contact-type.mjs +2 -0
  255. package/esm2020/lib/types/index.mjs +6 -0
  256. package/esm2020/lib/types/payment-attempt-status-type.mjs +2 -0
  257. package/esm2020/lib/types/payment-attempt-type.mjs +2 -0
  258. package/esm2020/lib/types/sex-type.mjs +2 -0
  259. package/esm2020/myclub_se-data-access.mjs +5 -0
  260. package/fesm2015/myclub_se-data-access.mjs +2425 -0
  261. package/fesm2015/myclub_se-data-access.mjs.map +1 -0
  262. package/fesm2020/myclub_se-data-access.mjs +2423 -0
  263. package/fesm2020/myclub_se-data-access.mjs.map +1 -0
  264. package/index.d.ts +6 -0
  265. package/lib/api-models/api-activity-extra-member.d.ts +10 -0
  266. package/lib/api-models/api-activity-invite.d.ts +18 -0
  267. package/lib/api-models/api-activity-location.d.ts +9 -0
  268. package/lib/api-models/api-activity-settings.d.ts +12 -0
  269. package/lib/api-models/api-activity-type.d.ts +8 -0
  270. package/lib/api-models/api-activity.d.ts +45 -0
  271. package/lib/api-models/api-auth/api-auth-member.d.ts +5 -0
  272. package/lib/api-models/api-auth/api-auth-section.d.ts +4 -0
  273. package/lib/api-models/api-auth/api-auth-team-section.d.ts +4 -0
  274. package/lib/api-models/api-auth/api-auth-team.d.ts +7 -0
  275. package/lib/api-models/api-auth/api-auth.d.ts +15 -0
  276. package/lib/api-models/api-auth/index.d.ts +5 -0
  277. package/lib/api-models/api-calendar-event.d.ts +18 -0
  278. package/lib/api-models/api-calendar.d.ts +7 -0
  279. package/lib/api-models/api-card/api-card-deal.d.ts +8 -0
  280. package/lib/api-models/api-card/api-card-logo-urls.d.ts +11 -0
  281. package/lib/api-models/api-card/api-card-logo.d.ts +6 -0
  282. package/lib/api-models/api-card/api-card-member-ticket.d.ts +8 -0
  283. package/lib/api-models/api-card/api-card-theme.d.ts +8 -0
  284. package/lib/api-models/api-card/api-card-ticket-location.d.ts +6 -0
  285. package/lib/api-models/api-card/api-card-ticket.d.ts +20 -0
  286. package/lib/api-models/api-card/api-card.d.ts +12 -0
  287. package/lib/api-models/api-card/api-home-team.d.ts +6 -0
  288. package/lib/api-models/api-card/api-member-card.d.ts +10 -0
  289. package/lib/api-models/api-card/api-search-member-card.d.ts +5 -0
  290. package/lib/api-models/api-card/index.d.ts +11 -0
  291. package/lib/api-models/api-club-image.d.ts +15 -0
  292. package/lib/api-models/api-club-section.d.ts +4 -0
  293. package/lib/api-models/api-club-team.d.ts +4 -0
  294. package/lib/api-models/api-club.d.ts +4 -0
  295. package/lib/api-models/api-collection.d.ts +6 -0
  296. package/lib/api-models/api-directory.d.ts +12 -0
  297. package/lib/api-models/api-event.d.ts +17 -0
  298. package/lib/api-models/api-external-link.d.ts +4 -0
  299. package/lib/api-models/api-file-object.d.ts +10 -0
  300. package/lib/api-models/api-general-image.d.ts +6 -0
  301. package/lib/api-models/api-image-urls.d.ts +7 -0
  302. package/lib/api-models/api-invoice/api-invoice-payments/api-credit-card.d.ts +13 -0
  303. package/lib/api-models/api-invoice/api-invoice-payments/api-giro.d.ts +8 -0
  304. package/lib/api-models/api-invoice/api-invoice-payments/api-swish.d.ts +11 -0
  305. package/lib/api-models/api-invoice/api-invoice-payments/api-zimpler.d.ts +9 -0
  306. package/lib/api-models/api-invoice/api-invoice-payments/index.d.ts +4 -0
  307. package/lib/api-models/api-invoice/api-member-fee.d.ts +6 -0
  308. package/lib/api-models/api-invoice/api-member-invoice-row.d.ts +15 -0
  309. package/lib/api-models/api-invoice/api-member-invoice.d.ts +23 -0
  310. package/lib/api-models/api-invoice/api-payment-attempt-create.d.ts +6 -0
  311. package/lib/api-models/api-invoice/api-payment-attempt.d.ts +12 -0
  312. package/lib/api-models/api-invoice/api-search-member-invoice.d.ts +11 -0
  313. package/lib/api-models/api-invoice/api-swish-qr-code.d.ts +3 -0
  314. package/lib/api-models/api-invoice/api-unpaid-member-invoice.d.ts +6 -0
  315. package/lib/api-models/api-invoice/index.d.ts +10 -0
  316. package/lib/api-models/api-invoice/payment-attempt-data-types/api-payment-attempt-credit-card-data-type.d.ts +4 -0
  317. package/lib/api-models/api-invoice/payment-attempt-data-types/api-payment-attempt-swish-data-type.d.ts +3 -0
  318. package/lib/api-models/api-invoice/payment-attempt-data-types/api-payment-attempt-zimpler-data-type.d.ts +3 -0
  319. package/lib/api-models/api-invoice/payment-attempt-data-types/index.d.ts +3 -0
  320. package/lib/api-models/api-member/api-contact.d.ts +17 -0
  321. package/lib/api-models/api-member/api-member-attribute.d.ts +15 -0
  322. package/lib/api-models/api-member/api-member-contact.d.ts +9 -0
  323. package/lib/api-models/api-member/api-member-function.d.ts +7 -0
  324. package/lib/api-models/api-member/api-member-validation-settings.d.ts +10 -0
  325. package/lib/api-models/api-member/api-member.d.ts +30 -0
  326. package/lib/api-models/api-member/api-search-member.d.ts +17 -0
  327. package/lib/api-models/api-member/index.d.ts +7 -0
  328. package/lib/api-models/api-member-activity-invite.d.ts +9 -0
  329. package/lib/api-models/api-member-public-form.d.ts +7 -0
  330. package/lib/api-models/api-member-team-through.d.ts +12 -0
  331. package/lib/api-models/api-member-team.d.ts +9 -0
  332. package/lib/api-models/api-news.d.ts +20 -0
  333. package/lib/api-models/api-partner.d.ts +7 -0
  334. package/lib/api-models/api-search-club.d.ts +6 -0
  335. package/lib/api-models/api-search-member-team.d.ts +7 -0
  336. package/lib/api-models/api-section-team.d.ts +4 -0
  337. package/lib/api-models/api-section.d.ts +6 -0
  338. package/lib/api-models/api-token.d.ts +7 -0
  339. package/lib/api-models/api-user-notification.d.ts +10 -0
  340. package/lib/api-models/api-user.d.ts +18 -0
  341. package/lib/api-models/index.d.ts +35 -0
  342. package/lib/authentication/authentication.config.d.ts +1 -0
  343. package/lib/authentication/authentication.interceptor.d.ts +11 -0
  344. package/lib/authentication/authentication.service.d.ts +31 -0
  345. package/lib/authentication/guards/authenticated.guard.d.ts +11 -0
  346. package/lib/authentication/guards/handle-grant-token.guard.d.ts +11 -0
  347. package/lib/authentication/index.d.ts +4 -0
  348. package/lib/data-access.module.d.ts +14 -0
  349. package/lib/interfaces/index.d.ts +2 -0
  350. package/lib/interfaces/new-account.interface.d.ts +7 -0
  351. package/lib/interfaces/option.interface.d.ts +4 -0
  352. package/lib/models/activity-extra-member.d.ts +11 -0
  353. package/lib/models/activity-invite.d.ts +19 -0
  354. package/lib/models/activity-location.d.ts +10 -0
  355. package/lib/models/activity-settings.d.ts +13 -0
  356. package/lib/models/activity-type.d.ts +9 -0
  357. package/lib/models/activity.d.ts +48 -0
  358. package/lib/models/auth/auth-member.d.ts +8 -0
  359. package/lib/models/auth/auth-section.d.ts +5 -0
  360. package/lib/models/auth/auth-team-section.d.ts +5 -0
  361. package/lib/models/auth/auth-team.d.ts +8 -0
  362. package/lib/models/auth/auth.d.ts +16 -0
  363. package/lib/models/auth/index.d.ts +5 -0
  364. package/lib/models/authentication.d.ts +5 -0
  365. package/lib/models/calendar-event.d.ts +19 -0
  366. package/lib/models/calendar.d.ts +8 -0
  367. package/lib/models/card/card-deal.d.ts +9 -0
  368. package/lib/models/card/card-logo-urls.d.ts +11 -0
  369. package/lib/models/card/card-logo.d.ts +7 -0
  370. package/lib/models/card/card-member-ticket.d.ts +9 -0
  371. package/lib/models/card/card-theme.d.ts +9 -0
  372. package/lib/models/card/card-ticket-location.d.ts +7 -0
  373. package/lib/models/card/card-ticket.d.ts +21 -0
  374. package/lib/models/card/card.d.ts +13 -0
  375. package/lib/models/card/home-team.d.ts +7 -0
  376. package/lib/models/card/index.d.ts +11 -0
  377. package/lib/models/card/member-card.d.ts +11 -0
  378. package/lib/models/card/search-member-card.d.ts +6 -0
  379. package/lib/models/club-image.d.ts +16 -0
  380. package/lib/models/club-section.d.ts +5 -0
  381. package/lib/models/club-team.d.ts +5 -0
  382. package/lib/models/club.d.ts +5 -0
  383. package/lib/models/collection.d.ts +9 -0
  384. package/lib/models/contact.d.ts +21 -0
  385. package/lib/models/directory.d.ts +15 -0
  386. package/lib/models/email-recipient.d.ts +5 -0
  387. package/lib/models/email.d.ts +7 -0
  388. package/lib/models/event.d.ts +18 -0
  389. package/lib/models/external-link.d.ts +5 -0
  390. package/lib/models/file-object.d.ts +11 -0
  391. package/lib/models/general-image.d.ts +7 -0
  392. package/lib/models/image-urls.d.ts +8 -0
  393. package/lib/models/index.d.ts +41 -0
  394. package/lib/models/invoice/index.d.ts +9 -0
  395. package/lib/models/invoice/member-fee.d.ts +7 -0
  396. package/lib/models/invoice/member-invoice-row.d.ts +16 -0
  397. package/lib/models/invoice/member-invoice.d.ts +24 -0
  398. package/lib/models/invoice/payment-attempt-data-types/index.d.ts +3 -0
  399. package/lib/models/invoice/payment-attempt-data-types/payment-attempt-credit-card-data-type.d.ts +4 -0
  400. package/lib/models/invoice/payment-attempt-data-types/payment-attempt-swish-data-type.d.ts +3 -0
  401. package/lib/models/invoice/payment-attempt-data-types/payment-attempt-zimpler-data-type.d.ts +3 -0
  402. package/lib/models/invoice/payment-attempt.d.ts +13 -0
  403. package/lib/models/invoice/payment-types/credit-card.d.ts +14 -0
  404. package/lib/models/invoice/payment-types/giro.d.ts +9 -0
  405. package/lib/models/invoice/payment-types/index.d.ts +4 -0
  406. package/lib/models/invoice/payment-types/swish.d.ts +12 -0
  407. package/lib/models/invoice/payment-types/zimpler.d.ts +10 -0
  408. package/lib/models/invoice/search-member-invoice.d.ts +13 -0
  409. package/lib/models/invoice/swish-qr-code.d.ts +4 -0
  410. package/lib/models/invoice/unpaid-member-invoice.d.ts +7 -0
  411. package/lib/models/member/index.d.ts +6 -0
  412. package/lib/models/member/member-attribute.d.ts +22 -0
  413. package/lib/models/member/member-contact.d.ts +12 -0
  414. package/lib/models/member/member-function.d.ts +10 -0
  415. package/lib/models/member/member-validation-settings.d.ts +11 -0
  416. package/lib/models/member/member.d.ts +34 -0
  417. package/lib/models/member/search-member.d.ts +18 -0
  418. package/lib/models/member-activity-invite.d.ts +11 -0
  419. package/lib/models/member-public-form.d.ts +8 -0
  420. package/lib/models/member-team-through.d.ts +13 -0
  421. package/lib/models/member-team.d.ts +10 -0
  422. package/lib/models/news.d.ts +20 -0
  423. package/lib/models/partner.d.ts +8 -0
  424. package/lib/models/role.d.ts +8 -0
  425. package/lib/models/search-club.d.ts +7 -0
  426. package/lib/models/search-member-team.d.ts +8 -0
  427. package/lib/models/section-team.d.ts +5 -0
  428. package/lib/models/section.d.ts +5 -0
  429. package/lib/models/token.d.ts +5 -0
  430. package/lib/models/user-notification.d.ts +11 -0
  431. package/lib/models/user.d.ts +16 -0
  432. package/lib/services/activity.service.d.ts +32 -0
  433. package/lib/services/api.service.d.ts +39 -0
  434. package/lib/services/auth.service.d.ts +15 -0
  435. package/lib/services/club.service.d.ts +10 -0
  436. package/lib/services/constant.service.d.ts +33 -0
  437. package/lib/services/email.service.d.ts +18 -0
  438. package/lib/services/external-link.service.d.ts +9 -0
  439. package/lib/services/factories/activity-extra-member-factory.d.ts +3 -0
  440. package/lib/services/factories/activity-factory.d.ts +3 -0
  441. package/lib/services/factories/activity-invite-factory.d.ts +3 -0
  442. package/lib/services/factories/activity-location-factory.d.ts +3 -0
  443. package/lib/services/factories/activity-settings-factory.d.ts +3 -0
  444. package/lib/services/factories/activity-type-factory.d.ts +3 -0
  445. package/lib/services/factories/auth-factory.d.ts +3 -0
  446. package/lib/services/factories/auth-member-factory.d.ts +3 -0
  447. package/lib/services/factories/auth-section-factory.d.ts +3 -0
  448. package/lib/services/factories/auth-team-factory.d.ts +3 -0
  449. package/lib/services/factories/auth-team-section-factory.d.ts +3 -0
  450. package/lib/services/factories/card-deal-factory.d.ts +3 -0
  451. package/lib/services/factories/card-factory.d.ts +3 -0
  452. package/lib/services/factories/card-logo-factory.d.ts +3 -0
  453. package/lib/services/factories/card-logo-urls-factory.d.ts +3 -0
  454. package/lib/services/factories/card-member-ticket-factory.d.ts +3 -0
  455. package/lib/services/factories/card-theme-factory.d.ts +3 -0
  456. package/lib/services/factories/card-ticket-factory.d.ts +3 -0
  457. package/lib/services/factories/card-ticket-location-factory.d.ts +3 -0
  458. package/lib/services/factories/club-factory.d.ts +3 -0
  459. package/lib/services/factories/club-image-factory.d.ts +3 -0
  460. package/lib/services/factories/club-section-factory.d.ts +3 -0
  461. package/lib/services/factories/contact-factory.d.ts +3 -0
  462. package/lib/services/factories/credit-card-factory.d.ts +3 -0
  463. package/lib/services/factories/directory-factory.d.ts +3 -0
  464. package/lib/services/factories/event-factory.d.ts +3 -0
  465. package/lib/services/factories/external-link-factory.d.ts +3 -0
  466. package/lib/services/factories/file-factory.d.ts +3 -0
  467. package/lib/services/factories/general-image-factory.d.ts +3 -0
  468. package/lib/services/factories/giro-factory.d.ts +3 -0
  469. package/lib/services/factories/home-team-factory.d.ts +3 -0
  470. package/lib/services/factories/image-urls-factory.d.ts +3 -0
  471. package/lib/services/factories/index.d.ts +61 -0
  472. package/lib/services/factories/member-attribute-factory.d.ts +3 -0
  473. package/lib/services/factories/member-card-factory.d.ts +3 -0
  474. package/lib/services/factories/member-contact-factory.d.ts +3 -0
  475. package/lib/services/factories/member-factory.d.ts +3 -0
  476. package/lib/services/factories/member-fee-factory.d.ts +3 -0
  477. package/lib/services/factories/member-function-factory.d.ts +3 -0
  478. package/lib/services/factories/member-invite-factory.d.ts +3 -0
  479. package/lib/services/factories/member-invoice-factory.d.ts +3 -0
  480. package/lib/services/factories/member-invoice-row-factory.d.ts +3 -0
  481. package/lib/services/factories/member-public-form-factory.d.ts +3 -0
  482. package/lib/services/factories/member-team-factory.d.ts +3 -0
  483. package/lib/services/factories/member-team-through-factory.d.ts +3 -0
  484. package/lib/services/factories/member-validation-settings-factory.d.ts +3 -0
  485. package/lib/services/factories/news-factory.d.ts +3 -0
  486. package/lib/services/factories/partner-factory.d.ts +3 -0
  487. package/lib/services/factories/payment-attempt-factory.d.ts +3 -0
  488. package/lib/services/factories/search-club-factory.d.ts +3 -0
  489. package/lib/services/factories/search-member-card-factory.d.ts +3 -0
  490. package/lib/services/factories/search-member-factory.d.ts +3 -0
  491. package/lib/services/factories/search-member-invoice-factory.d.ts +3 -0
  492. package/lib/services/factories/search-member-team-factory.d.ts +3 -0
  493. package/lib/services/factories/search-member-team-through-factory.d.ts +3 -0
  494. package/lib/services/factories/section-factory.d.ts +3 -0
  495. package/lib/services/factories/swish-factory.d.ts +3 -0
  496. package/lib/services/factories/token-factory.d.ts +3 -0
  497. package/lib/services/factories/unpaid-invoice-factory.d.ts +3 -0
  498. package/lib/services/factories/user-factory.d.ts +3 -0
  499. package/lib/services/factories/user-notification-factory.d.ts +3 -0
  500. package/lib/services/factories/zimpler-factory.d.ts +3 -0
  501. package/lib/services/file.service.d.ts +11 -0
  502. package/lib/services/index.d.ts +17 -0
  503. package/lib/services/invoice/index.d.ts +2 -0
  504. package/lib/services/invoice/invoice.service.d.ts +17 -0
  505. package/lib/services/invoice/payment-attempt.service.d.ts +19 -0
  506. package/lib/services/member-card.service.d.ts +27 -0
  507. package/lib/services/member-public-form.service.d.ts +10 -0
  508. package/lib/services/member.service.d.ts +17 -0
  509. package/lib/services/news.service.d.ts +9 -0
  510. package/lib/services/section.service.d.ts +10 -0
  511. package/lib/services/team.service.d.ts +24 -0
  512. package/lib/services/token.service.d.ts +15 -0
  513. package/lib/services/user-notification.service.d.ts +10 -0
  514. package/lib/services/user.service.d.ts +16 -0
  515. package/lib/types/attribute-type.d.ts +1 -0
  516. package/lib/types/contact-type.d.ts +1 -0
  517. package/lib/types/index.d.ts +5 -0
  518. package/lib/types/payment-attempt-status-type.d.ts +1 -0
  519. package/lib/types/payment-attempt-type.d.ts +1 -0
  520. package/lib/types/sex-type.d.ts +1 -0
  521. package/package.json +35 -0
@@ -0,0 +1,2423 @@
1
+ import * as i0 from '@angular/core';
2
+ import { InjectionToken, Injectable, Inject, NgModule } from '@angular/core';
3
+ import * as i1 from '@angular/common/http';
4
+ import { HttpErrorResponse, HttpParams, HttpRequest, HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
5
+ import { map, catchError, tap, mergeMap } from 'rxjs/operators';
6
+ import { of, throwError, BehaviorSubject } from 'rxjs';
7
+ import { FormGroup, FormControl, Validators, FormArray } from '@angular/forms';
8
+ import { format } from 'date-fns';
9
+ import * as i2 from '@angular/router';
10
+
11
+ class Activity {
12
+ constructor(id, activity_group_id, activity_type_id, club_id, location_id, team_id, activity_location, activity_type_name, allow_maybe, calendar_name, created, current_num_attendants, day, description, end_time, file, invitation_text, invite_first_days, invite_groups, invite_hide_before_sent, invite_last_response_date, invite_remind, invite_remind_receivers, invite_second_days, invite_settings, invited_members, last_response_date, max_num_attendants, max_num_attendants_type, meet_up_place, meet_up_time, meet_up_time_display, repeat, repeat_num, repeat_to_day, repeat_type, show_other_invited, start_time, title, updated, use_invite, update_repeating) {
13
+ this.id = id;
14
+ this.activity_group_id = activity_group_id;
15
+ this.activity_type_id = activity_type_id;
16
+ this.club_id = club_id;
17
+ this.location_id = location_id;
18
+ this.team_id = team_id;
19
+ this.activity_location = activity_location;
20
+ this.activity_type_name = activity_type_name;
21
+ this.allow_maybe = allow_maybe;
22
+ this.calendar_name = calendar_name;
23
+ this.created = created;
24
+ this.current_num_attendants = current_num_attendants;
25
+ this.day = day;
26
+ this.description = description;
27
+ this.end_time = end_time;
28
+ this.file = file;
29
+ this.invitation_text = invitation_text;
30
+ this.invite_first_days = invite_first_days;
31
+ this.invite_groups = invite_groups;
32
+ this.invite_hide_before_sent = invite_hide_before_sent;
33
+ this.invite_last_response_date = invite_last_response_date;
34
+ this.invite_remind = invite_remind;
35
+ this.invite_remind_receivers = invite_remind_receivers;
36
+ this.invite_second_days = invite_second_days;
37
+ this.invite_settings = invite_settings;
38
+ this.invited_members = invited_members;
39
+ this.last_response_date = last_response_date;
40
+ this.max_num_attendants = max_num_attendants;
41
+ this.max_num_attendants_type = max_num_attendants_type;
42
+ this.meet_up_place = meet_up_place;
43
+ this.meet_up_time = meet_up_time;
44
+ this.meet_up_time_display = meet_up_time_display;
45
+ this.repeat = repeat;
46
+ this.repeat_num = repeat_num;
47
+ this.repeat_to_day = repeat_to_day;
48
+ this.repeat_type = repeat_type;
49
+ this.show_other_invited = show_other_invited;
50
+ this.start_time = start_time;
51
+ this.title = title;
52
+ this.updated = updated;
53
+ this.use_invite = use_invite;
54
+ this.update_repeating = update_repeating;
55
+ }
56
+ static asFormGroup(activity = null) {
57
+ return new FormGroup({
58
+ id: new FormControl(activity?.id || ''),
59
+ activity_group_id: new FormControl(activity?.activity_group_id || null, { nonNullable: false }),
60
+ activity_type_id: new FormControl(activity?.activity_type_id || '', [Validators.required]),
61
+ club_id: new FormControl(activity?.club_id || ''),
62
+ location_id: new FormControl(activity?.location_id || '', [Validators.required]),
63
+ team_id: new FormControl(activity?.team_id || ''),
64
+ activity_location: new FormControl(activity?.activity_location || '', [Validators.required]),
65
+ activity_type_name: new FormControl(activity?.activity_type_name || ''),
66
+ allow_maybe: new FormControl(typeof activity?.allow_maybe !== 'undefined' ? activity.allow_maybe : false),
67
+ day: new FormControl(activity?.day || '', [Validators.required]),
68
+ description: new FormControl(activity?.description || ''),
69
+ end_time: new FormControl(activity?.end_time || '', [Validators.required]),
70
+ file: new FormControl(''),
71
+ invitation_text: new FormControl(activity?.invitation_text || ''),
72
+ invite_first_days: new FormControl(activity?.invite_first_days || 7),
73
+ invite_groups: new FormControl(activity?.invite_groups || []),
74
+ invite_hide_before_sent: new FormControl(typeof activity?.invite_hide_before_sent !== 'undefined' ? activity?.invite_hide_before_sent : false),
75
+ invite_last_response_date: new FormControl(activity?.invite_last_response_date || ''),
76
+ invite_remind: new FormControl(activity?.invite_remind || 0),
77
+ invite_remind_receivers: new FormControl(activity?.invite_remind_receivers || ''),
78
+ invite_second_days: new FormControl(activity?.invite_second_days || 2),
79
+ invite_settings: new FormControl(activity?.invite_settings || ''),
80
+ last_response_date: new FormControl(activity?.last_response_date || ''),
81
+ max_num_attendants: new FormControl(activity?.max_num_attendants || 0),
82
+ meet_up_place: new FormControl(activity?.meet_up_place || ''),
83
+ meet_up_time: new FormControl(activity?.meet_up_time || 0),
84
+ repeat: new FormControl(activity?.repeat || 'none'),
85
+ repeat_num: new FormControl(activity?.repeat_num || 6),
86
+ repeat_to_day: new FormControl(activity?.repeat_to_day || ''),
87
+ repeat_type: new FormControl(activity?.repeat_type || ''),
88
+ show_other_invited: new FormControl(activity?.show_other_invited || 'all'),
89
+ start_time: new FormControl(activity?.start_time || '', [Validators.required]),
90
+ title: new FormControl(activity?.title || '', [Validators.required]),
91
+ use_invite: new FormControl(typeof activity?.use_invite !== 'undefined' ? activity?.use_invite : false),
92
+ update_repeating: new FormControl(typeof activity?.update_repeating !== 'undefined' ? activity?.update_repeating : false)
93
+ });
94
+ }
95
+ }
96
+
97
+ class ActivityExtraMember {
98
+ constructor(id, member_id, team_id, created, leader, member, member_name) {
99
+ this.id = id;
100
+ this.member_id = member_id;
101
+ this.team_id = team_id;
102
+ this.created = created;
103
+ this.leader = leader;
104
+ this.member = member;
105
+ this.member_name = member_name;
106
+ }
107
+ }
108
+
109
+ class ActivityInvite {
110
+ constructor(id, activity, comment, created, has_unpaid_invoices, last_invite, member, reminded, response_date, status, token, unpaid_invoices, updated) {
111
+ this.id = id;
112
+ this.activity = activity;
113
+ this.comment = comment;
114
+ this.created = created;
115
+ this.has_unpaid_invoices = has_unpaid_invoices;
116
+ this.last_invite = last_invite;
117
+ this.member = member;
118
+ this.reminded = reminded;
119
+ this.response_date = response_date;
120
+ this.status = status;
121
+ this.token = token;
122
+ this.unpaid_invoices = unpaid_invoices;
123
+ this.updated = updated;
124
+ }
125
+ }
126
+
127
+ class ActivityLocation {
128
+ constructor(id, club_id, section_id, active, mun_location_city_area, mun_location_name, name) {
129
+ this.id = id;
130
+ this.club_id = club_id;
131
+ this.section_id = section_id;
132
+ this.active = active;
133
+ this.mun_location_city_area = mun_location_city_area;
134
+ this.mun_location_name = mun_location_name;
135
+ this.name = name;
136
+ }
137
+ }
138
+
139
+ class ActivitySettings {
140
+ constructor(dayOptions, hourOptions, inviteGroupOptions, inviteSettingsOptions, maxAttendanceOptions, meetUpTimeOptions, remindReceiverOptions, repeatOptions, repeatTypeOptions) {
141
+ this.dayOptions = dayOptions;
142
+ this.hourOptions = hourOptions;
143
+ this.inviteGroupOptions = inviteGroupOptions;
144
+ this.inviteSettingsOptions = inviteSettingsOptions;
145
+ this.maxAttendanceOptions = maxAttendanceOptions;
146
+ this.meetUpTimeOptions = meetUpTimeOptions;
147
+ this.remindReceiverOptions = remindReceiverOptions;
148
+ this.repeatOptions = repeatOptions;
149
+ this.repeatTypeOptions = repeatTypeOptions;
150
+ }
151
+ }
152
+
153
+ class ActivityType {
154
+ constructor(id, club_id, section_id, active, base_type, name) {
155
+ this.id = id;
156
+ this.club_id = club_id;
157
+ this.section_id = section_id;
158
+ this.active = active;
159
+ this.base_type = base_type;
160
+ this.name = name;
161
+ }
162
+ }
163
+
164
+ class Auth {
165
+ constructor(id, name, clubAdmin, isSectionClub, members, registrationEnabled, sections, siteEnabled, teams, user_name) {
166
+ this.id = id;
167
+ this.name = name;
168
+ this.clubAdmin = clubAdmin;
169
+ this.isSectionClub = isSectionClub;
170
+ this.members = members;
171
+ this.registrationEnabled = registrationEnabled;
172
+ this.sections = sections;
173
+ this.siteEnabled = siteEnabled;
174
+ this.teams = teams;
175
+ this.user_name = user_name;
176
+ }
177
+ }
178
+
179
+ class AuthMember {
180
+ constructor(id, name, calendar_url) {
181
+ this.id = id;
182
+ this.name = name;
183
+ this.calendar_url = calendar_url;
184
+ this.eventColor = '';
185
+ this.eventBackgroundColor = '';
186
+ }
187
+ }
188
+
189
+ class AuthSection {
190
+ constructor(id, name) {
191
+ this.id = id;
192
+ this.name = name;
193
+ }
194
+ }
195
+
196
+ class AuthTeam {
197
+ constructor(id, calendar_url, name, section) {
198
+ this.id = id;
199
+ this.calendar_url = calendar_url;
200
+ this.name = name;
201
+ this.section = section;
202
+ }
203
+ }
204
+
205
+ class AuthTeamSection {
206
+ constructor(id, name) {
207
+ this.id = id;
208
+ this.name = name;
209
+ }
210
+ }
211
+
212
+ class Authentication {
213
+ constructor(accessToken, refreshToken) {
214
+ this.accessToken = accessToken;
215
+ this.refreshToken = refreshToken;
216
+ }
217
+ }
218
+
219
+ class Calendar {
220
+ constructor(id, club_id, section_id, name, types_to_show) {
221
+ this.id = id;
222
+ this.club_id = club_id;
223
+ this.section_id = section_id;
224
+ this.name = name;
225
+ this.types_to_show = types_to_show;
226
+ }
227
+ }
228
+
229
+ class CalendarEvent {
230
+ constructor(id, calendar, created, day, description, end_time, location, meet_up_place, meet_up_time, meet_up_time_display, push_to_all, sequence, start_time, title, updated) {
231
+ this.id = id;
232
+ this.calendar = calendar;
233
+ this.created = created;
234
+ this.day = day;
235
+ this.description = description;
236
+ this.end_time = end_time;
237
+ this.location = location;
238
+ this.meet_up_place = meet_up_place;
239
+ this.meet_up_time = meet_up_time;
240
+ this.meet_up_time_display = meet_up_time_display;
241
+ this.push_to_all = push_to_all;
242
+ this.sequence = sequence;
243
+ this.start_time = start_time;
244
+ this.title = title;
245
+ this.updated = updated;
246
+ }
247
+ }
248
+
249
+ class Card {
250
+ constructor(id, deals_count, header_1, name, logo, theme, ticket_count, use_pdf_version) {
251
+ this.id = id;
252
+ this.deals_count = deals_count;
253
+ this.header_1 = header_1;
254
+ this.name = name;
255
+ this.logo = logo;
256
+ this.theme = theme;
257
+ this.ticket_count = ticket_count;
258
+ this.use_pdf_version = use_pdf_version;
259
+ }
260
+ }
261
+
262
+ class CardDeal {
263
+ constructor(id, partner, text, title, url) {
264
+ this.id = id;
265
+ this.partner = partner;
266
+ this.text = text;
267
+ this.title = title;
268
+ this.url = url;
269
+ }
270
+ }
271
+
272
+ class CardLogo {
273
+ constructor(id, name, urls) {
274
+ this.id = id;
275
+ this.name = name;
276
+ this.urls = urls;
277
+ }
278
+ }
279
+
280
+ class CardLogoUrls {
281
+ constructor(lg, md, sm, w16, w32, w64, w180, w192) {
282
+ this.lg = lg;
283
+ this.md = md;
284
+ this.sm = sm;
285
+ this.w16 = w16;
286
+ this.w32 = w32;
287
+ this.w64 = w64;
288
+ this.w180 = w180;
289
+ this.w192 = w192;
290
+ }
291
+ }
292
+
293
+ class CardMemberTicket {
294
+ constructor(id, member_id, ticket_id, member_name, ticket_image_url, ticket_number) {
295
+ this.id = id;
296
+ this.member_id = member_id;
297
+ this.ticket_id = ticket_id;
298
+ this.member_name = member_name;
299
+ this.ticket_image_url = ticket_image_url;
300
+ this.ticket_number = ticket_number;
301
+ }
302
+ }
303
+
304
+ class CardTicket {
305
+ constructor(id, activation_end_hours, activation_end_time, activation_start_hours, activation_start_time, away_team, card_member_ticket, description, event_time, home_team, image, location, name, ticket_type, ticket_type_nice, uses_pin) {
306
+ this.id = id;
307
+ this.activation_end_hours = activation_end_hours;
308
+ this.activation_end_time = activation_end_time;
309
+ this.activation_start_hours = activation_start_hours;
310
+ this.activation_start_time = activation_start_time;
311
+ this.away_team = away_team;
312
+ this.card_member_ticket = card_member_ticket;
313
+ this.description = description;
314
+ this.event_time = event_time;
315
+ this.home_team = home_team;
316
+ this.image = image;
317
+ this.location = location;
318
+ this.name = name;
319
+ this.ticket_type = ticket_type;
320
+ this.ticket_type_nice = ticket_type_nice;
321
+ this.uses_pin = uses_pin;
322
+ }
323
+ }
324
+
325
+ class CardTicketLocation {
326
+ constructor(id, club_id, section_id, location) {
327
+ this.id = id;
328
+ this.club_id = club_id;
329
+ this.section_id = section_id;
330
+ this.location = location;
331
+ }
332
+ }
333
+
334
+ class CardTheme {
335
+ constructor(id, background_color, background_image_urls, name, text_color) {
336
+ this.id = id;
337
+ this.background_color = background_color;
338
+ this.background_image_urls = background_image_urls;
339
+ this.name = name;
340
+ this.text_color = text_color;
341
+ }
342
+ }
343
+
344
+ class HomeTeam {
345
+ constructor(id, logo, name) {
346
+ this.id = id;
347
+ this.logo = logo;
348
+ this.name = name;
349
+ }
350
+ }
351
+
352
+ class MemberCard {
353
+ constructor(id, card, header_2, member_name, membership_text, name, pdf_url) {
354
+ this.id = id;
355
+ this.card = card;
356
+ this.header_2 = header_2;
357
+ this.member_name = member_name;
358
+ this.membership_text = membership_text;
359
+ this.name = name;
360
+ this.pdf_url = pdf_url;
361
+ }
362
+ }
363
+
364
+ class SearchMemberCard {
365
+ constructor(id, name, pdf_url) {
366
+ this.id = id;
367
+ this.name = name;
368
+ this.pdf_url = pdf_url;
369
+ }
370
+ }
371
+
372
+ class Club {
373
+ constructor(id, name) {
374
+ this.id = id;
375
+ this.name = name;
376
+ }
377
+ }
378
+
379
+ class ClubImage {
380
+ constructor(clubId, sectionId, comment, created, image, imageSmPath, imageLgPath, inUse, isLogo, originalHeight, originalWidth, title, updated) {
381
+ this.clubId = clubId;
382
+ this.sectionId = sectionId;
383
+ this.comment = comment;
384
+ this.created = created;
385
+ this.image = image;
386
+ this.imageSmPath = imageSmPath;
387
+ this.imageLgPath = imageLgPath;
388
+ this.inUse = inUse;
389
+ this.isLogo = isLogo;
390
+ this.originalHeight = originalHeight;
391
+ this.originalWidth = originalWidth;
392
+ this.title = title;
393
+ this.updated = updated;
394
+ }
395
+ }
396
+
397
+ class ClubSection {
398
+ constructor(id, name) {
399
+ this.id = id;
400
+ this.name = name;
401
+ }
402
+ }
403
+
404
+ class ClubTeam {
405
+ constructor(id, name) {
406
+ this.id = id;
407
+ this.name = name;
408
+ }
409
+ }
410
+
411
+ class Collection {
412
+ constructor(count, next, previous, resources) {
413
+ this.count = count;
414
+ this.next = next;
415
+ this.previous = previous;
416
+ this.resources = resources;
417
+ }
418
+ [Symbol.iterator]() {
419
+ return this.resources.values();
420
+ }
421
+ toArray() {
422
+ return this.resources;
423
+ }
424
+ }
425
+
426
+ class Contact {
427
+ constructor(id, club_id, member_id, address1, address2, address3, country, district, email, first_name, home_phone, last_name, mobile_phone, work_phone, zip) {
428
+ this.id = id;
429
+ this.club_id = club_id;
430
+ this.member_id = member_id;
431
+ this.address1 = address1;
432
+ this.address2 = address2;
433
+ this.address3 = address3;
434
+ this.country = country;
435
+ this.district = district;
436
+ this.email = email;
437
+ this.first_name = first_name;
438
+ this.home_phone = home_phone;
439
+ this.last_name = last_name;
440
+ this.mobile_phone = mobile_phone;
441
+ this.work_phone = work_phone;
442
+ this.zip = zip;
443
+ }
444
+ static asFormGroup(contact) {
445
+ return new FormGroup({
446
+ id: new FormControl(contact?.id || ''),
447
+ club_id: new FormControl(contact?.club_id || ''),
448
+ member_id: new FormControl(contact?.member_id || ''),
449
+ address1: new FormControl(contact?.address1 || ''),
450
+ address2: new FormControl(contact?.address2 || ''),
451
+ address3: new FormControl(contact?.address3 || ''),
452
+ country: new FormControl(contact?.country || ''),
453
+ district: new FormControl(contact?.district || ''),
454
+ email: new FormControl(contact?.email || '', Validators.email),
455
+ first_name: new FormControl(contact?.first_name || '', Validators.required),
456
+ home_phone: new FormControl(contact?.home_phone || ''),
457
+ last_name: new FormControl(contact?.last_name || '', Validators.required),
458
+ mobile_phone: new FormControl(contact?.mobile_phone || ''),
459
+ work_phone: new FormControl(contact?.work_phone || ''),
460
+ zip: new FormControl(contact?.zip || '')
461
+ });
462
+ }
463
+ get name() {
464
+ if (this.first_name) {
465
+ return [this.first_name, this.last_name].join(' ');
466
+ }
467
+ return this.email;
468
+ }
469
+ }
470
+
471
+ class Directory {
472
+ constructor(id, club_id, section_id, team_id, created, files, name, location_name, updated) {
473
+ this.id = id;
474
+ this.club_id = club_id;
475
+ this.section_id = section_id;
476
+ this.team_id = team_id;
477
+ this.created = created;
478
+ this.files = files;
479
+ this.name = name;
480
+ this.location_name = location_name;
481
+ this.updated = updated;
482
+ }
483
+ belongsToTeam() {
484
+ return this.team_id !== null;
485
+ }
486
+ belongsToSection() {
487
+ return this.section_id !== null;
488
+ }
489
+ }
490
+
491
+ class Email {
492
+ constructor(body, subject, recipients = []) {
493
+ this.body = body;
494
+ this.subject = subject;
495
+ this.recipients = recipients;
496
+ }
497
+ }
498
+
499
+ class EmailRecipient {
500
+ constructor(id, name) {
501
+ this.id = id;
502
+ this.name = name;
503
+ }
504
+ }
505
+
506
+ class Event {
507
+ constructor(id, activity_id, activity_type, calendar_name, description, end, invitation_id, invitation_response, location, meet_up_place, meet_up_time, member_id, start, title, type) {
508
+ this.id = id;
509
+ this.activity_id = activity_id;
510
+ this.activity_type = activity_type;
511
+ this.calendar_name = calendar_name;
512
+ this.description = description;
513
+ this.end = end;
514
+ this.invitation_id = invitation_id;
515
+ this.invitation_response = invitation_response;
516
+ this.location = location;
517
+ this.meet_up_place = meet_up_place;
518
+ this.meet_up_time = meet_up_time;
519
+ this.member_id = member_id;
520
+ this.start = start;
521
+ this.title = title;
522
+ this.type = type;
523
+ }
524
+ }
525
+
526
+ class ExternalLink {
527
+ constructor(text, value) {
528
+ this.text = text;
529
+ this.value = value;
530
+ }
531
+ }
532
+
533
+ class FileObject {
534
+ constructor(id, created, member, name, section, team, updated, url) {
535
+ this.id = id;
536
+ this.created = created;
537
+ this.member = member;
538
+ this.name = name;
539
+ this.section = section;
540
+ this.team = team;
541
+ this.updated = updated;
542
+ this.url = url;
543
+ }
544
+ }
545
+
546
+ class GeneralImage {
547
+ constructor(id, name, urls) {
548
+ this.id = id;
549
+ this.name = name;
550
+ this.urls = urls;
551
+ }
552
+ }
553
+
554
+ class ImageUrls {
555
+ constructor(lg, md, raw, sm, xs) {
556
+ this.lg = lg;
557
+ this.md = md;
558
+ this.raw = raw;
559
+ this.sm = sm;
560
+ this.xs = xs;
561
+ }
562
+ }
563
+
564
+ class MemberFee {
565
+ constructor(id, clubId, sectionId, name) {
566
+ this.id = id;
567
+ this.clubId = clubId;
568
+ this.sectionId = sectionId;
569
+ this.name = name;
570
+ }
571
+ }
572
+
573
+ class MemberInvoice {
574
+ constructor(id, amount, amountPaid, balance, clubBillId, clubName, creditCard, datePaid, dueDate, giro, invoiceRows, invoiceText, isPaid, memberId, payee, paymentUrl, reference, swish, zimpler) {
575
+ this.id = id;
576
+ this.amount = amount;
577
+ this.amountPaid = amountPaid;
578
+ this.balance = balance;
579
+ this.clubBillId = clubBillId;
580
+ this.clubName = clubName;
581
+ this.creditCard = creditCard;
582
+ this.datePaid = datePaid;
583
+ this.dueDate = dueDate;
584
+ this.giro = giro;
585
+ this.invoiceRows = invoiceRows;
586
+ this.invoiceText = invoiceText;
587
+ this.isPaid = isPaid;
588
+ this.memberId = memberId;
589
+ this.payee = payee;
590
+ this.paymentUrl = paymentUrl;
591
+ this.reference = reference;
592
+ this.swish = swish;
593
+ this.zimpler = zimpler;
594
+ }
595
+ }
596
+
597
+ class MemberInvoiceRow {
598
+ constructor(id, amount, amountPaid, balance, created, datePaid, fee, hasCreditType, invoice, isCredit, isPaid, updated) {
599
+ this.id = id;
600
+ this.amount = amount;
601
+ this.amountPaid = amountPaid;
602
+ this.balance = balance;
603
+ this.created = created;
604
+ this.datePaid = datePaid;
605
+ this.fee = fee;
606
+ this.hasCreditType = hasCreditType;
607
+ this.invoice = invoice;
608
+ this.isCredit = isCredit;
609
+ this.isPaid = isPaid;
610
+ this.updated = updated;
611
+ }
612
+ }
613
+
614
+ class PaymentAttempt {
615
+ constructor(id, amount, error, invoiceId, paidDate, paymentData, status, type) {
616
+ this.id = id;
617
+ this.amount = amount;
618
+ this.error = error;
619
+ this.invoiceId = invoiceId;
620
+ this.paidDate = paidDate;
621
+ this.paymentData = paymentData;
622
+ this.status = status;
623
+ this.type = type;
624
+ }
625
+ }
626
+
627
+ class CreditCard {
628
+ constructor(clubId, sectionId, defaultActivated, merchantId, name, paymentTermsName, paymentTermsOrganisationId, paymentTermsUrl, rsaKey, status, testAccount) {
629
+ this.clubId = clubId;
630
+ this.sectionId = sectionId;
631
+ this.defaultActivated = defaultActivated;
632
+ this.merchantId = merchantId;
633
+ this.name = name;
634
+ this.paymentTermsName = paymentTermsName;
635
+ this.paymentTermsOrganisationId = paymentTermsOrganisationId;
636
+ this.paymentTermsUrl = paymentTermsUrl;
637
+ this.rsaKey = rsaKey;
638
+ this.status = status;
639
+ this.testAccount = testAccount;
640
+ }
641
+ }
642
+
643
+ class Giro {
644
+ constructor(clubId, sectionId, giroType, name, number, ocr) {
645
+ this.clubId = clubId;
646
+ this.sectionId = sectionId;
647
+ this.giroType = giroType;
648
+ this.name = name;
649
+ this.number = number;
650
+ this.ocr = ocr;
651
+ }
652
+ }
653
+
654
+ class Swish {
655
+ constructor(clubId, sectionId, certificateValidUntil, defaultActivated, name, status, swishPayeeAlias, testAccount, usesMyClubCertificate) {
656
+ this.clubId = clubId;
657
+ this.sectionId = sectionId;
658
+ this.certificateValidUntil = certificateValidUntil;
659
+ this.defaultActivated = defaultActivated;
660
+ this.name = name;
661
+ this.status = status;
662
+ this.swishPayeeAlias = swishPayeeAlias;
663
+ this.testAccount = testAccount;
664
+ this.usesMyClubCertificate = usesMyClubCertificate;
665
+ }
666
+ }
667
+
668
+ class Zimpler {
669
+ constructor(clubId, sectionId, defaultActivated, merchantId, name, status, testAccount) {
670
+ this.clubId = clubId;
671
+ this.sectionId = sectionId;
672
+ this.defaultActivated = defaultActivated;
673
+ this.merchantId = merchantId;
674
+ this.name = name;
675
+ this.status = status;
676
+ this.testAccount = testAccount;
677
+ }
678
+ }
679
+
680
+ class SearchMemberInvoice {
681
+ constructor(id, amount, amountPaid, balance, clubBillId, datePaid, dueDate, isPaid, member) {
682
+ this.id = id;
683
+ this.amount = amount;
684
+ this.amountPaid = amountPaid;
685
+ this.balance = balance;
686
+ this.clubBillId = clubBillId;
687
+ this.datePaid = datePaid;
688
+ this.dueDate = dueDate;
689
+ this.isPaid = isPaid;
690
+ this.member = member;
691
+ }
692
+ is_due() {
693
+ return new Date().toISOString() > this.dueDate;
694
+ }
695
+ }
696
+
697
+ class SwishQrCode {
698
+ constructor(qrCode) {
699
+ this.qrCode = qrCode;
700
+ }
701
+ }
702
+
703
+ class UnpaidMemberInvoice {
704
+ constructor(id, club_bill_id, member_id, token) {
705
+ this.id = id;
706
+ this.club_bill_id = club_bill_id;
707
+ this.member_id = member_id;
708
+ this.token = token;
709
+ }
710
+ }
711
+
712
+ class Member {
713
+ constructor(id, club_id, address1, address2, address_field, attributes, birth_date, calendar_url, comment, contacts, country, created, district, email, first_name, functions, home_phone, image, last_name, mobile_phone, public_member_id, sex, updated, validation_settings, work_phone, zip) {
714
+ this.id = id;
715
+ this.club_id = club_id;
716
+ this.address1 = address1;
717
+ this.address2 = address2;
718
+ this.address_field = address_field;
719
+ this.attributes = attributes;
720
+ this.birth_date = birth_date;
721
+ this.calendar_url = calendar_url;
722
+ this.comment = comment;
723
+ this.contacts = contacts;
724
+ this.country = country;
725
+ this.created = created;
726
+ this.district = district;
727
+ this.email = email;
728
+ this.first_name = first_name;
729
+ this.functions = functions;
730
+ this.home_phone = home_phone;
731
+ this.image = image;
732
+ this.last_name = last_name;
733
+ this.mobile_phone = mobile_phone;
734
+ this.public_member_id = public_member_id;
735
+ this.sex = sex;
736
+ this.updated = updated;
737
+ this.validation_settings = validation_settings;
738
+ this.work_phone = work_phone;
739
+ this.zip = zip;
740
+ }
741
+ static asFormGroup(member = null) {
742
+ const attributes = [];
743
+ const contacts = [];
744
+ const functions = [];
745
+ if (member?.attributes) {
746
+ member.attributes.forEach((attribute) => attributes.push(MemberAttribute.asFormGroup(attribute)));
747
+ }
748
+ if (member?.contacts) {
749
+ member.contacts.forEach((memberContact) => contacts.push(MemberContact.asFormGroup(memberContact)));
750
+ }
751
+ if (member?.functions) {
752
+ member.functions.forEach((memberFunction) => functions.push(MemberFunction.asFormGroup(memberFunction)));
753
+ }
754
+ return new FormGroup({
755
+ id: new FormControl(member?.id || ''),
756
+ club_id: new FormControl(member?.club_id || ''),
757
+ address1: new FormControl(member?.address1 || ''),
758
+ address2: new FormControl(member?.address2 || ''),
759
+ attributes: new FormArray(attributes),
760
+ birth_date: new FormControl(member?.birth_date || ''),
761
+ comment: new FormControl(member?.comment || ''),
762
+ contacts: new FormArray(contacts),
763
+ country: new FormControl(member?.country || ''),
764
+ district: new FormControl(member?.district || ''),
765
+ email: new FormControl(member?.email || '', Validators.email),
766
+ first_name: new FormControl(member?.first_name || '', Validators.required),
767
+ functions: new FormArray(functions),
768
+ home_phone: new FormControl(member?.home_phone || ''),
769
+ last_name: new FormControl(member?.last_name || '', Validators.required),
770
+ mobile_phone: new FormControl(member?.mobile_phone || ''),
771
+ public_member_id: new FormControl(member?.public_member_id || 0),
772
+ sex: new FormControl(member?.sex || ''),
773
+ work_phone: new FormControl(member?.work_phone || ''),
774
+ zip: new FormControl(member?.zip || '')
775
+ });
776
+ }
777
+ get name() {
778
+ if (this.first_name) {
779
+ return [this.first_name, this.last_name].join(' ');
780
+ }
781
+ return this.email;
782
+ }
783
+ }
784
+
785
+ class MemberAttribute {
786
+ constructor(display_value, field_id, leader_editable, member_id, member_editable, name, options, order, section_id, type, value) {
787
+ this.display_value = display_value;
788
+ this.field_id = field_id;
789
+ this.leader_editable = leader_editable;
790
+ this.member_id = member_id;
791
+ this.member_editable = member_editable;
792
+ this.name = name;
793
+ this.options = options;
794
+ this.order = order;
795
+ this.section_id = section_id;
796
+ this.type = type;
797
+ this.value = value;
798
+ }
799
+ static asFormGroup(attribute = null) {
800
+ return new FormGroup({
801
+ field_id: new FormControl(attribute?.field_id || ''),
802
+ member_id: new FormControl(attribute?.member_id || ''),
803
+ value: new FormControl(attribute?.value || '')
804
+ });
805
+ }
806
+ }
807
+
808
+ class MemberContact {
809
+ constructor(id, club_id, member_id, contact, contact_type) {
810
+ this.id = id;
811
+ this.club_id = club_id;
812
+ this.member_id = member_id;
813
+ this.contact = contact;
814
+ this.contact_type = contact_type;
815
+ }
816
+ static asFormGroup(memberContact) {
817
+ return new FormGroup({
818
+ id: new FormControl(memberContact?.id || ''),
819
+ club_id: new FormControl(memberContact?.club_id || ''),
820
+ member_id: new FormControl(memberContact?.member_id || ''),
821
+ contact: Contact.asFormGroup(memberContact?.contact),
822
+ contact_type: new FormControl(memberContact?.contact_type || '')
823
+ });
824
+ }
825
+ }
826
+
827
+ class MemberFunction {
828
+ constructor(id, comment, end_date, name, start_date) {
829
+ this.id = id;
830
+ this.comment = comment;
831
+ this.end_date = end_date;
832
+ this.name = name;
833
+ this.start_date = start_date;
834
+ }
835
+ static asFormGroup(memberFunction = null) {
836
+ return new FormGroup({
837
+ id: new FormControl(memberFunction?.id || ''),
838
+ comment: new FormControl(memberFunction?.comment || ''),
839
+ start_date: new FormControl(memberFunction?.start_date || ''),
840
+ end_date: new FormControl(memberFunction?.end_date || ''),
841
+ });
842
+ }
843
+ }
844
+
845
+ class MemberValidationSettings {
846
+ constructor(address, birth_date, district, email, home_phone, mobile_phone, work_phone, zip) {
847
+ this.address = address;
848
+ this.birth_date = birth_date;
849
+ this.district = district;
850
+ this.email = email;
851
+ this.home_phone = home_phone;
852
+ this.mobile_phone = mobile_phone;
853
+ this.work_phone = work_phone;
854
+ this.zip = zip;
855
+ }
856
+ }
857
+
858
+ class SearchMember {
859
+ constructor(id, club_id, team_id, address1, address2, calendar_url, country, district, email, first_name, image, last_name, mobile_phone, name, zip) {
860
+ this.id = id;
861
+ this.club_id = club_id;
862
+ this.team_id = team_id;
863
+ this.address1 = address1;
864
+ this.address2 = address2;
865
+ this.calendar_url = calendar_url;
866
+ this.country = country;
867
+ this.district = district;
868
+ this.email = email;
869
+ this.first_name = first_name;
870
+ this.image = image;
871
+ this.last_name = last_name;
872
+ this.mobile_phone = mobile_phone;
873
+ this.name = name;
874
+ this.zip = zip;
875
+ }
876
+ }
877
+
878
+ class MemberActivityInvite {
879
+ constructor(id, comment, last_invite, leader, member_id, member_name, status) {
880
+ this.id = id;
881
+ this.comment = comment;
882
+ this.last_invite = last_invite;
883
+ this.leader = leader;
884
+ this.member_id = member_id;
885
+ this.member_name = member_name;
886
+ this.status = status;
887
+ }
888
+ getColorByStatus() {
889
+ let color = 'none';
890
+ switch (this.status) {
891
+ case 'accepted':
892
+ color = 'myclub-accepted';
893
+ break;
894
+ case 'denied':
895
+ color = 'myclub-denied';
896
+ break;
897
+ case 'maybe':
898
+ color = 'myclub-maybe';
899
+ break;
900
+ }
901
+ return color;
902
+ }
903
+ }
904
+
905
+ class MemberPublicForm {
906
+ constructor(id, active_form, active_to, name, url) {
907
+ this.id = id;
908
+ this.active_form = active_form;
909
+ this.active_to = active_to;
910
+ this.name = name;
911
+ this.url = url;
912
+ }
913
+ }
914
+
915
+ class MemberTeam {
916
+ constructor(club, section, id, email, name, phone) {
917
+ this.club = club;
918
+ this.section = section;
919
+ this.id = id;
920
+ this.email = email;
921
+ this.name = name;
922
+ this.phone = phone;
923
+ }
924
+ }
925
+
926
+ class MemberTeamThrough {
927
+ constructor(id, created, dateHidden, image, leader, member, roleId, showOnWeb, updated) {
928
+ this.id = id;
929
+ this.created = created;
930
+ this.dateHidden = dateHidden;
931
+ this.image = image;
932
+ this.leader = leader;
933
+ this.member = member;
934
+ this.roleId = roleId;
935
+ this.showOnWeb = showOnWeb;
936
+ this.updated = updated;
937
+ }
938
+ }
939
+
940
+ class News {
941
+ constructor(id, club_id, created, created_by_id, section_id, team_id, active_to, author, ingress, news_image, news_image_text, original_height, original_width, published_date, text, title, updated) {
942
+ this.id = id;
943
+ this.club_id = club_id;
944
+ this.created = created;
945
+ this.created_by_id = created_by_id;
946
+ this.section_id = section_id;
947
+ this.team_id = team_id;
948
+ this.active_to = active_to;
949
+ this.author = author;
950
+ this.ingress = ingress;
951
+ this.news_image = news_image;
952
+ this.news_image_text = news_image_text;
953
+ this.original_height = original_height;
954
+ this.original_width = original_width;
955
+ this.published_date = published_date;
956
+ this.text = text;
957
+ this.title = title;
958
+ this.updated = updated;
959
+ }
960
+ }
961
+
962
+ class Partner {
963
+ constructor(id, image, name, url) {
964
+ this.id = id;
965
+ this.image = image;
966
+ this.name = name;
967
+ this.url = url;
968
+ }
969
+ }
970
+
971
+ var Role;
972
+ (function (Role) {
973
+ Role[Role["ClubAdmin"] = 0] = "ClubAdmin";
974
+ Role[Role["SectionAdmin"] = 1] = "SectionAdmin";
975
+ Role[Role["TeamAdmin"] = 2] = "TeamAdmin";
976
+ Role[Role["MemberAdmin"] = 3] = "MemberAdmin";
977
+ Role[Role["Public"] = 4] = "Public";
978
+ Role[Role["None"] = 5] = "None";
979
+ })(Role || (Role = {}));
980
+
981
+ class SearchClub {
982
+ constructor(id, leader_member_search, member_search, name) {
983
+ this.id = id;
984
+ this.leader_member_search = leader_member_search;
985
+ this.member_search = member_search;
986
+ this.name = name;
987
+ }
988
+ }
989
+
990
+ class SearchMemberTeam {
991
+ constructor(club, id, name, section) {
992
+ this.club = club;
993
+ this.id = id;
994
+ this.name = name;
995
+ this.section = section;
996
+ }
997
+ }
998
+
999
+ class Section {
1000
+ constructor(id, name) {
1001
+ this.id = id;
1002
+ this.name = name;
1003
+ }
1004
+ }
1005
+
1006
+ class SectionTeam {
1007
+ constructor(id, name) {
1008
+ this.id = id;
1009
+ this.name = name;
1010
+ }
1011
+ }
1012
+
1013
+ class Token {
1014
+ constructor(accessToken, refreshToken) {
1015
+ this.accessToken = accessToken;
1016
+ this.refreshToken = refreshToken;
1017
+ }
1018
+ }
1019
+
1020
+ class User {
1021
+ constructor(deviceToken, email, firstName, isStaff, language, lastName, newEmail, newPassword = '', verifyPassword = '', password = '') {
1022
+ this.deviceToken = deviceToken;
1023
+ this.email = email;
1024
+ this.firstName = firstName;
1025
+ this.isStaff = isStaff;
1026
+ this.language = language;
1027
+ this.lastName = lastName;
1028
+ this.newEmail = newEmail;
1029
+ this.newPassword = newPassword;
1030
+ this.verifyPassword = verifyPassword;
1031
+ this.password = password;
1032
+ }
1033
+ static asFormGroup(user = null) {
1034
+ return new FormGroup({
1035
+ email: new FormControl(user?.email || '', [Validators.required, Validators.email]),
1036
+ firstName: new FormControl(user?.firstName || ''),
1037
+ language: new FormControl(user?.language || 'sv'),
1038
+ lastName: new FormControl(user?.lastName || ''),
1039
+ newEmail: new FormControl(user?.email || ''),
1040
+ newPassword: new FormControl(''),
1041
+ verifyPassword: new FormControl(''),
1042
+ password: new FormControl('')
1043
+ });
1044
+ }
1045
+ name() {
1046
+ return `${this.firstName} ${this.lastName}`;
1047
+ }
1048
+ }
1049
+
1050
+ class UserNotification {
1051
+ constructor(id, club_id, member_id, object_id, created, message, title, type) {
1052
+ this.id = id;
1053
+ this.club_id = club_id;
1054
+ this.member_id = member_id;
1055
+ this.object_id = object_id;
1056
+ this.created = created;
1057
+ this.message = message;
1058
+ this.title = title;
1059
+ this.type = type;
1060
+ }
1061
+ }
1062
+
1063
+ const DOMAIN = new InjectionToken('domain');
1064
+ const API_PATH = 'api/v3/';
1065
+ const ROLE_PATH = {
1066
+ [Role.ClubAdmin]: 'club-admin/',
1067
+ [Role.SectionAdmin]: 'section-admin/',
1068
+ [Role.TeamAdmin]: 'team-admin/',
1069
+ [Role.MemberAdmin]: 'member-admin/',
1070
+ [Role.Public]: 'public/',
1071
+ [Role.None]: ''
1072
+ };
1073
+ class ApiService {
1074
+ constructor(http, domain) {
1075
+ this.http = http;
1076
+ this.domain = domain;
1077
+ }
1078
+ deleteResource(role, path, pathParams = {}, options = {}) {
1079
+ return this.delete(role, path, pathParams, options)
1080
+ .pipe(map((response) => response.status === 204));
1081
+ }
1082
+ getCollection(factory, role, path, pathParams = {}, options = {}) {
1083
+ return this.get(role, path, pathParams, options).pipe(map((apiCollection) => {
1084
+ const resources = apiCollection.results.map((resource) => factory(resource));
1085
+ return new Collection(apiCollection.count, apiCollection.next, apiCollection.previous, resources);
1086
+ }));
1087
+ }
1088
+ getResource(factory, role, path, pathParams = {}, options = {}) {
1089
+ return this.get(role, path, pathParams, options).pipe(map((apiResource) => factory(apiResource)));
1090
+ }
1091
+ postFormData(factory, role, path, pathParams = {}, data) {
1092
+ const body = new FormData();
1093
+ for (const [key, value] of Object.entries(data)) {
1094
+ body.append(key, value);
1095
+ }
1096
+ return this.http.post(this.url(this.path(role, path, pathParams)), body)
1097
+ .pipe(map((apiResource) => factory(apiResource)));
1098
+ }
1099
+ postResource(factory, role, path, pathParams = {}, data, options = {}) {
1100
+ return this.post(role, path, pathParams, data, options).pipe(map((apiResource) => factory(apiResource)));
1101
+ }
1102
+ updateResource(responseFactory, role, path, pathParams = {}, data, options = {}) {
1103
+ return this.patch(role, path, pathParams, data, options).pipe(map((apiResource) => responseFactory(apiResource)));
1104
+ }
1105
+ delete(role, path, pathParams, options) {
1106
+ if (options.body) {
1107
+ return this.http.request('delete', this.url(this.path(role, path, pathParams)), options);
1108
+ }
1109
+ return this.http.delete(this.url(this.path(role, path, pathParams)), { ...options, observe: 'response' });
1110
+ }
1111
+ get(role, path, pathParams, options) {
1112
+ return this.http.get(this.url(this.path(role, path, pathParams)), options);
1113
+ }
1114
+ patch(role, path, pathParams, data, options) {
1115
+ return this.http.patch(this.url(this.path(role, path, pathParams)), data, options);
1116
+ }
1117
+ path(role, path, params) {
1118
+ for (const [key, value] of Object.entries(params)) {
1119
+ const regexp = new RegExp(':' + key, 'g');
1120
+ path = path.replace(regexp, value);
1121
+ }
1122
+ return ROLE_PATH[role] + path;
1123
+ }
1124
+ post(role, path, pathParams, data, options) {
1125
+ return this.http.post(this.url(this.path(role, path, pathParams)), data, options);
1126
+ }
1127
+ url(path) {
1128
+ return this.domain + API_PATH + path;
1129
+ }
1130
+ }
1131
+ ApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ApiService, deps: [{ token: i1.HttpClient }, { token: DOMAIN }], target: i0.ɵɵFactoryTarget.Injectable });
1132
+ ApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ApiService, providedIn: 'root' });
1133
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ApiService, decorators: [{
1134
+ type: Injectable,
1135
+ args: [{
1136
+ providedIn: 'root'
1137
+ }]
1138
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
1139
+ type: Inject,
1140
+ args: [DOMAIN]
1141
+ }] }]; } });
1142
+
1143
+ const searchMemberFactory = (apiSearchMember) => new SearchMember(apiSearchMember.id, apiSearchMember.club_id, apiSearchMember.team_id, apiSearchMember.address1, apiSearchMember.address2, apiSearchMember.calendar_url, apiSearchMember.country, apiSearchMember.district, apiSearchMember.email, apiSearchMember.first_name, apiSearchMember.image, apiSearchMember.last_name, apiSearchMember.mobile_phone, apiSearchMember.name, apiSearchMember.zip);
1144
+
1145
+ const memberAttributeFactory = (attribute) => new MemberAttribute(attribute.display_value, attribute.field, attribute.leader_editable, attribute.member_id, attribute.member_editable, attribute.name, attribute.options, attribute.order, attribute.section_id, attribute.type, attribute.value);
1146
+
1147
+ const contactFactory = (contact) => new Contact(contact.id, contact.club_id, contact.member_id, contact.address1, contact.address2, contact.address3, contact.country, contact.district, contact.email, contact.first_name, contact.home_phone, contact.last_name, contact.mobile_phone, contact.work_phone, contact.zip);
1148
+
1149
+ const memberContactFactory = (memberContact) => new MemberContact(memberContact.id, memberContact.club_id, memberContact.member_id, contactFactory(memberContact.contact), memberContact.contact_type);
1150
+
1151
+ const memberFunctionFactory = (memberFunction) => new MemberFunction(memberFunction.id, memberFunction.comment, memberFunction.end_date, memberFunction.name, memberFunction.start_date);
1152
+
1153
+ const memberValidationSettingsFactory = (apiMemberValidationSettings) => new MemberValidationSettings(apiMemberValidationSettings.address, apiMemberValidationSettings.birth_date, apiMemberValidationSettings.district, apiMemberValidationSettings.email, apiMemberValidationSettings.home_phone, apiMemberValidationSettings.mobile_phone, apiMemberValidationSettings.work_phone, apiMemberValidationSettings.zip);
1154
+
1155
+ const memberFactory = (apiMember) => new Member(apiMember.id, apiMember.club_id, apiMember.address1, apiMember.address2, apiMember.address_field, apiMember.attributes.map((attribute) => memberAttributeFactory(attribute)), apiMember.birth_date, apiMember.calendar_url, apiMember.comment, apiMember.contacts.map((contactMember) => memberContactFactory(contactMember)), apiMember.country, apiMember.created, apiMember.district, apiMember.email, apiMember.first_name, apiMember.functions ?
1156
+ apiMember.functions.map((memberFunction) => memberFunctionFactory(memberFunction)) : [], apiMember.home_phone, apiMember.image, apiMember.last_name, apiMember.mobile_phone, apiMember.public_member_id, apiMember.sex, apiMember.updated, memberValidationSettingsFactory(apiMember.validation_settings), apiMember.work_phone, apiMember.zip);
1157
+
1158
+ const activityExtraMemberFactory = (apiActivityExtraMember) => new ActivityExtraMember(apiActivityExtraMember.id, apiActivityExtraMember.member_id, apiActivityExtraMember.team_id, apiActivityExtraMember.created, apiActivityExtraMember.leader, apiActivityExtraMember.member.birth_date ?
1159
+ memberFactory(apiActivityExtraMember.member) : searchMemberFactory(apiActivityExtraMember.member), apiActivityExtraMember.member_name);
1160
+
1161
+ const memberActivityInviteFactory = (invitedMember) => new MemberActivityInvite(invitedMember.id, invitedMember.comment, invitedMember.last_invite, invitedMember.leader, invitedMember.member_id, invitedMember.member_name, invitedMember.status);
1162
+
1163
+ const activityFactory = (apiActivity) => new Activity(apiActivity.id, apiActivity.activity_group_id, apiActivity.activity_type_id, apiActivity.club_id, apiActivity.location_id, apiActivity.team_id, apiActivity.activity_location, apiActivity.activity_type_name, apiActivity.allow_maybe, apiActivity.calendar_name, apiActivity.created, apiActivity.current_num_attendants, apiActivity.day, apiActivity.description, apiActivity.end_time, apiActivity.file, apiActivity.invitation_text, apiActivity.invite_first_days, [], apiActivity.invite_hide_before_sent, apiActivity.invite_last_response_date, apiActivity.invite_remind, apiActivity.invite_remind_receivers, apiActivity.invite_second_days, 'same_as_last', (apiActivity.invited_members && apiActivity.invited_members.length) ? apiActivity.invited_members.map((invitedMember) => memberActivityInviteFactory(invitedMember)) : [], apiActivity.last_response_date, apiActivity.max_num_attendants, apiActivity.max_num_attendants_type, apiActivity.meet_up_place, apiActivity.meet_up_time, apiActivity.meet_up_time_display, 'none', 6, format(new Date(), 'yyyy-MM-dd'), 'repeat_until', apiActivity.show_other_invited, apiActivity.start_time, apiActivity.title, apiActivity.updated, apiActivity.use_invite, false);
1164
+
1165
+ const unpaidInvoiceFactory = (apiUnpaidInvoice) => new UnpaidMemberInvoice(apiUnpaidInvoice.id, apiUnpaidInvoice.club_bill_id, apiUnpaidInvoice.member_id, apiUnpaidInvoice.token);
1166
+
1167
+ const activityInviteFactory = (apiActivityInvite) => new ActivityInvite(apiActivityInvite.id, activityFactory(apiActivityInvite.activity), apiActivityInvite.comment, apiActivityInvite.created, apiActivityInvite.has_unpaid_invoices, apiActivityInvite.last_invite, searchMemberFactory(apiActivityInvite.member), apiActivityInvite.reminded, apiActivityInvite.response_date, apiActivityInvite.status, apiActivityInvite.token, apiActivityInvite.unpaid_invoices && apiActivityInvite.unpaid_invoices.length ? apiActivityInvite.unpaid_invoices.map((apiUnpaidInvoice) => unpaidInvoiceFactory(apiUnpaidInvoice)) : [], apiActivityInvite.updated);
1168
+
1169
+ const activityLocationFactory = (apiActivityLocation) => new ActivityLocation(apiActivityLocation.id, apiActivityLocation.club_id, apiActivityLocation.section_id, apiActivityLocation.active, apiActivityLocation.mun_location_city_area, apiActivityLocation.mun_location_name, apiActivityLocation.name);
1170
+
1171
+ const activitySettingsFactory = (apiActivitySettings) => new ActivitySettings(apiActivitySettings.day_options, apiActivitySettings.hour_options, apiActivitySettings.invite_group_options, apiActivitySettings.invite_settings_options, apiActivitySettings.max_attendance_options, apiActivitySettings.meet_up_time_options, apiActivitySettings.remind_receiver_options, apiActivitySettings.repeat_options, apiActivitySettings.repeat_type_options);
1172
+
1173
+ const activityTypeFactory = (apiActivityType) => new ActivityType(apiActivityType.id, apiActivityType.club_id, apiActivityType.section_id, apiActivityType.active, apiActivityType.base_type, apiActivityType.name);
1174
+
1175
+ const authSectionFactory = (apiAuthSection) => new AuthSection(apiAuthSection.id, apiAuthSection.name);
1176
+
1177
+ const authMemberFactory = (apiAuthMember) => new AuthMember(apiAuthMember.id, apiAuthMember.name, apiAuthMember.calendar_url);
1178
+
1179
+ const authTeamSectionFactory = (apiAuthTeamSection) => new AuthTeamSection(apiAuthTeamSection.id, apiAuthTeamSection.name);
1180
+
1181
+ const authTeamFactory = (apiAuthTeam) => new AuthTeam(apiAuthTeam.id, apiAuthTeam.calendar_url, apiAuthTeam.name, apiAuthTeam.section ? authTeamSectionFactory(apiAuthTeam.section) : null);
1182
+
1183
+ const authFactory = (apiAuth) => new Auth(apiAuth.id, apiAuth.name, apiAuth.club_admin, apiAuth.is_section_club, apiAuth.members.map((apiAuthMember) => authMemberFactory(apiAuthMember)), apiAuth.registration_enabled, apiAuth.sections.map((apiAuthSection) => authSectionFactory(apiAuthSection)), apiAuth.site_enabled, apiAuth.teams.map((apiAuthTeam) => authTeamFactory(apiAuthTeam)), apiAuth.user_name);
1184
+
1185
+ const imageUrlsFactory = (apiImageUrls) => new ImageUrls(apiImageUrls.lg, apiImageUrls.md, apiImageUrls.raw, apiImageUrls.sm, apiImageUrls.xs);
1186
+
1187
+ const generalImageFactory = (image) => image ? new GeneralImage(image.id, image.name, imageUrlsFactory(image.urls)) : null;
1188
+
1189
+ const partnerFactory = (apiPartner) => new Partner(apiPartner.id, apiPartner.image ? generalImageFactory(apiPartner.image) : null, apiPartner.name, apiPartner.url);
1190
+
1191
+ const cardDealFactory = (apiCardDeal) => new CardDeal(apiCardDeal.id, partnerFactory(apiCardDeal.partner), apiCardDeal.text, apiCardDeal.title, apiCardDeal.url);
1192
+
1193
+ const cardLogoUrlsFactory = (apiCardLogoUrls) => new CardLogoUrls(apiCardLogoUrls.lg, apiCardLogoUrls.md, apiCardLogoUrls.sm, apiCardLogoUrls.w16, apiCardLogoUrls.w32, apiCardLogoUrls.w64, apiCardLogoUrls.w180, apiCardLogoUrls.w192);
1194
+
1195
+ const cardLogoFactory = (apiCardLogo) => new CardLogo(apiCardLogo.id, apiCardLogo.name, cardLogoUrlsFactory(apiCardLogo.urls));
1196
+
1197
+ const cardThemeFactory = (apiCardTheme) => new CardTheme(apiCardTheme.id, apiCardTheme.background_color, imageUrlsFactory(apiCardTheme.background_image_urls), apiCardTheme.name, apiCardTheme.text_color);
1198
+
1199
+ const cardFactory = (apiCard) => new Card(apiCard.id, apiCard.deals_count, apiCard.header_1, apiCard.name, cardLogoFactory(apiCard.logo), cardThemeFactory(apiCard.theme), apiCard.ticket_count, apiCard.use_pdf_version);
1200
+
1201
+ const cardMemberTicketFactory = (apiCardMemberTicket) => new CardMemberTicket(apiCardMemberTicket.id, apiCardMemberTicket.member_id, apiCardMemberTicket.ticket_id, apiCardMemberTicket.member_name, apiCardMemberTicket.ticket_image_url, apiCardMemberTicket.ticket_number);
1202
+
1203
+ const homeTeamFactory = (apiHomeTeam) => new HomeTeam(apiHomeTeam.id, apiHomeTeam.logo ? generalImageFactory(apiHomeTeam.logo) : null, apiHomeTeam.name);
1204
+
1205
+ const cardTicketLocationFactory = (apiCardTicketLocation) => new CardTicketLocation(apiCardTicketLocation.id, apiCardTicketLocation.club_id, apiCardTicketLocation.section_id, apiCardTicketLocation.location);
1206
+
1207
+ const cardTicketFactory = (apiCardTicket) => new CardTicket(apiCardTicket.id, apiCardTicket.activation_end_hours, apiCardTicket.activation_end_time, apiCardTicket.activation_start_hours, apiCardTicket.activation_start_time, apiCardTicket.away_team, apiCardTicket.card_member_ticket ? cardMemberTicketFactory(apiCardTicket.card_member_ticket) : null, apiCardTicket.description, apiCardTicket.event_time, apiCardTicket.home_team ? homeTeamFactory(apiCardTicket.home_team) : null, apiCardTicket.image ? generalImageFactory(apiCardTicket.image) : null, cardTicketLocationFactory(apiCardTicket.location), apiCardTicket.name, apiCardTicket.ticket_type, apiCardTicket.ticket_type_nice, apiCardTicket.uses_pin);
1208
+
1209
+ const clubFactory = (apiClub) => new Club(apiClub.id, apiClub.name);
1210
+
1211
+ const clubImageFactory = (apiClubImage) => new ClubImage(apiClubImage.club_id, apiClubImage.section_id, apiClubImage.comment, apiClubImage.created, apiClubImage.image, apiClubImage.image_sm_path, apiClubImage.image_lg_path, apiClubImage.in_use, apiClubImage.is_logo, apiClubImage.original_height, apiClubImage.original_width, apiClubImage.title, apiClubImage.updated);
1212
+
1213
+ const clubSectionFactory = (apiSection) => new ClubSection(apiSection.id, apiSection.name);
1214
+
1215
+ const creditCardFactory = (apiCreditCard) => new CreditCard(apiCreditCard.club_id, apiCreditCard.section_id, apiCreditCard.default_activated, apiCreditCard.merchant_id, apiCreditCard.name, apiCreditCard.payment_terms_name, apiCreditCard.payment_terms_organisation_id, apiCreditCard.payment_terms_url, apiCreditCard.rsa_key, apiCreditCard.status, apiCreditCard.test_account);
1216
+
1217
+ const fileFactory = (file) => new FileObject(file.id, file.created, typeof file.member === 'undefined' ? null : file.member, file.name, typeof file.section === 'undefined' ? null : file.section, typeof file.team === 'undefined' ? null : file.team, file.updated, file.url);
1218
+
1219
+ const directoryFactory = (directory) => new Directory(directory.id, directory.club_id, directory.section_id, directory.team_id, directory.created, directory.files.map((file) => fileFactory(file)), directory.name, directory.location_name, directory.updated);
1220
+
1221
+ const eventFactory = (apiEvent) => new Event(apiEvent.id, apiEvent.activity_id, apiEvent.activity_type, apiEvent.calendar_name, apiEvent.description, apiEvent.end, apiEvent.invitation_id, apiEvent.invitation_response, apiEvent.location, apiEvent.meet_up_place, apiEvent.meet_up_time, apiEvent.member_id, apiEvent.start, apiEvent.title, apiEvent.type);
1222
+
1223
+ const externalLinkFactory = (apiExternalLink) => new ExternalLink(apiExternalLink.text, apiExternalLink.value);
1224
+
1225
+ const giroFactory = (apiGiro) => new Giro(apiGiro.club_id, apiGiro.section_id, apiGiro.giro_type, apiGiro.name, apiGiro.number, apiGiro.ocr);
1226
+
1227
+ const memberCardFactory = (apiMemberCard) => new MemberCard(apiMemberCard.id, cardFactory(apiMemberCard.card), apiMemberCard.header_2, apiMemberCard.member_name, apiMemberCard.membership_text, apiMemberCard.name, apiMemberCard.pdf_url);
1228
+
1229
+ const memberFeeFactory = (apiMemberFee) => new MemberFee(apiMemberFee.id, apiMemberFee.club_id, apiMemberFee.section_id, apiMemberFee.name);
1230
+
1231
+ const swishFactory = (apiSwish) => new Swish(apiSwish.club_id, apiSwish.section_id, apiSwish.certificate_valid_until, apiSwish.default_activated, apiSwish.name, apiSwish.status, apiSwish.swish_payee_alias, apiSwish.test_account, apiSwish.uses_myclub_certificate);
1232
+
1233
+ const zimplerFactory = (apiZimpler) => new Zimpler(apiZimpler.club_id, apiZimpler.section_id, apiZimpler.default_activated, apiZimpler.merchant_id, apiZimpler.name, apiZimpler.status, apiZimpler.test_account);
1234
+
1235
+ const memberInvoiceRowFactory = (apiMemberInvoiceRow) => new MemberInvoiceRow(apiMemberInvoiceRow.id, apiMemberInvoiceRow.amount, apiMemberInvoiceRow.amount_paid, apiMemberInvoiceRow.balance, apiMemberInvoiceRow.created, apiMemberInvoiceRow.date_paid, memberFeeFactory(apiMemberInvoiceRow.fee), apiMemberInvoiceRow.has_credit_type, apiMemberInvoiceRow.invoice, apiMemberInvoiceRow.is_credit, apiMemberInvoiceRow.is_paid, apiMemberInvoiceRow.updated);
1236
+
1237
+ const memberInvoiceFactory = (apiMemberInvoice) => new MemberInvoice(apiMemberInvoice.id, apiMemberInvoice.amount, apiMemberInvoice.amount_paid, apiMemberInvoice.balance, apiMemberInvoice.club_bill_id, apiMemberInvoice.club_name, apiMemberInvoice.credit_card ? creditCardFactory(apiMemberInvoice.credit_card) : null, apiMemberInvoice.date_paid, apiMemberInvoice.due_date, apiMemberInvoice.giro ? giroFactory(apiMemberInvoice.giro) : null, apiMemberInvoice.invoice_rows.map((row) => memberInvoiceRowFactory(row)), apiMemberInvoice.invoice_text, apiMemberInvoice.is_paid, apiMemberInvoice.member_id, apiMemberInvoice.payee, apiMemberInvoice.payment_url, apiMemberInvoice.reference, apiMemberInvoice.swish ? swishFactory(apiMemberInvoice.swish) : null, apiMemberInvoice.zimpler ? zimplerFactory(apiMemberInvoice.zimpler) : null);
1238
+
1239
+ const memberPublicFormFactory = (apiMemberPublicForm) => new MemberPublicForm(apiMemberPublicForm.id, apiMemberPublicForm.active_from, apiMemberPublicForm.active_to, apiMemberPublicForm.name, apiMemberPublicForm.url);
1240
+
1241
+ const sectionFactory = (apiSection) => new Section(apiSection.id, apiSection.name);
1242
+
1243
+ const memberTeamFactory = (apiMemberTeam) => new MemberTeam(clubFactory(apiMemberTeam.club), apiMemberTeam.section ? sectionFactory(apiMemberTeam.section) : null, apiMemberTeam.id, apiMemberTeam.email, apiMemberTeam.name, apiMemberTeam.phone);
1244
+
1245
+ const memberTeamThroughFactory = (apiMemberTeamThrough) => new MemberTeamThrough(apiMemberTeamThrough.id, apiMemberTeamThrough.created, apiMemberTeamThrough.date_hidden, apiMemberTeamThrough.image, apiMemberTeamThrough.leader, memberFactory(apiMemberTeamThrough.member), apiMemberTeamThrough.role_id, apiMemberTeamThrough.show_on_web, apiMemberTeamThrough.updated);
1246
+
1247
+ const newsFactory = (apiNews) => new News(apiNews.id, apiNews.club_id, apiNews.created, apiNews.created_by_id, apiNews.section_id, apiNews.team_id, apiNews.active_to, apiNews.author, apiNews.ingress, apiNews.news_image, apiNews.news_image_text, apiNews.original_height, apiNews.original_width, apiNews.published_date, apiNews.text, apiNews.title, apiNews.updated);
1248
+
1249
+ const paymentAttemptFactory = (apiPaymentAttempt) => {
1250
+ let paymentAttemptData = null;
1251
+ if (apiPaymentAttempt.type === 'mondido') {
1252
+ const data = apiPaymentAttempt.payment_data;
1253
+ paymentAttemptData = {
1254
+ hash: data.hash,
1255
+ paymentAttemptId: data.payment_attempt_id
1256
+ };
1257
+ }
1258
+ else if (apiPaymentAttempt.type === 'swish') {
1259
+ paymentAttemptData = {
1260
+ paymentRequestToken: apiPaymentAttempt.payment_data.payment_request_token
1261
+ };
1262
+ }
1263
+ else {
1264
+ paymentAttemptData = {
1265
+ userFormUrl: apiPaymentAttempt.payment_data.user_form_url
1266
+ };
1267
+ }
1268
+ return new PaymentAttempt(apiPaymentAttempt.id, apiPaymentAttempt.amount, apiPaymentAttempt.error, apiPaymentAttempt.invoice_id, apiPaymentAttempt.paid_date, paymentAttemptData, apiPaymentAttempt.status, apiPaymentAttempt.type);
1269
+ };
1270
+
1271
+ const searchClubFactory = (apiSearchClub) => new SearchClub(apiSearchClub.id, apiSearchClub.leader_member_search, apiSearchClub.member_search, apiSearchClub.name);
1272
+
1273
+ const searchMemberCardFactory = (apiSearchMemberCard) => new SearchMemberCard(apiSearchMemberCard.id, apiSearchMemberCard.name, apiSearchMemberCard.pdf_url);
1274
+
1275
+ const searchMemberInvoiceFactory = (apiSearchMemberInvoice) => new SearchMemberInvoice(apiSearchMemberInvoice.id, apiSearchMemberInvoice.amount, apiSearchMemberInvoice.amount_paid, apiSearchMemberInvoice.balance, apiSearchMemberInvoice.club_bill_id, apiSearchMemberInvoice.date_paid, apiSearchMemberInvoice.due_date, apiSearchMemberInvoice.is_paid, apiSearchMemberInvoice.member_id);
1276
+
1277
+ const searchMemberTeamFactory = (apiSearchMemberTeam) => new SearchMemberTeam(clubFactory(apiSearchMemberTeam.club), apiSearchMemberTeam.id, apiSearchMemberTeam.name, apiSearchMemberTeam.section ? sectionFactory(apiSearchMemberTeam.section) : null);
1278
+
1279
+ const searchMemberTeamThroughFactory = (apiMemberTeamThrough) => new MemberTeamThrough(apiMemberTeamThrough.id, apiMemberTeamThrough.created, apiMemberTeamThrough.date_hidden, apiMemberTeamThrough.image, apiMemberTeamThrough.leader, searchMemberFactory(apiMemberTeamThrough.member), apiMemberTeamThrough.role_id, apiMemberTeamThrough.show_on_web, apiMemberTeamThrough.updated);
1280
+
1281
+ const tokenFactory = (apiToken) => new Token(apiToken.access_token, apiToken.refresh_token);
1282
+
1283
+ const userFactory = (apiUser) => new User(apiUser.device_token, apiUser.email, apiUser.first_name, apiUser.is_staff, apiUser.language, apiUser.last_name, apiUser.new_email);
1284
+
1285
+ const userNotificationFactory = (apiUserNotification) => new UserNotification(apiUserNotification.id, apiUserNotification.club_id, apiUserNotification.member_id, apiUserNotification.object_id, apiUserNotification.created, apiUserNotification.message, apiUserNotification.title, apiUserNotification.type);
1286
+
1287
+ const AUTHS_PATH = 'every-admin/auths/';
1288
+ const REMOVE_AUTH_PATH = 'accounts/remove-auth/:authId/:authType/:id/';
1289
+ class AuthService {
1290
+ constructor(apiService) {
1291
+ this.apiService = apiService;
1292
+ }
1293
+ getAuth(id) {
1294
+ return this.apiService
1295
+ .getCollection(authFactory, Role.None, AUTHS_PATH, {}, { params: { club_id: id } })
1296
+ .pipe(map((collection) => {
1297
+ if (collection.count === 0) {
1298
+ return null;
1299
+ }
1300
+ return collection.toArray()[0];
1301
+ }));
1302
+ }
1303
+ getAuths(role = null) {
1304
+ return this.apiService.getCollection(authFactory, Role.None, AUTHS_PATH, {}, role ? { params: { role } } : {});
1305
+ }
1306
+ removeClubAuth(authId, clubId) {
1307
+ return this.removeAuth(authId, clubId, 'club');
1308
+ }
1309
+ removeMemberAuth(authId, memberId) {
1310
+ return this.removeAuth(authId, memberId, 'member');
1311
+ }
1312
+ removeSectionAuth(authId, sectionId) {
1313
+ return this.removeAuth(authId, sectionId, 'section');
1314
+ }
1315
+ removeTeamAuth(authId, teamId) {
1316
+ return this.removeAuth(authId, teamId, 'team');
1317
+ }
1318
+ removeAuth(authId, authTypeId, authType) {
1319
+ return this.apiService.postResource(() => { }, Role.None, REMOVE_AUTH_PATH, {
1320
+ authId,
1321
+ authType,
1322
+ id: authTypeId
1323
+ }, {})
1324
+ .pipe(map(() => true), catchError(() => of(false)));
1325
+ }
1326
+ }
1327
+ AuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: AuthService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1328
+ AuthService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: AuthService, providedIn: 'root' });
1329
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: AuthService, decorators: [{
1330
+ type: Injectable,
1331
+ args: [{
1332
+ providedIn: 'root'
1333
+ }]
1334
+ }], ctorParameters: function () { return [{ type: ApiService }]; } });
1335
+
1336
+ const MEMBER_ACTIVITY_INVITE_PATH = ':memberId/activities/:activityInviteId/';
1337
+ const MEMBER_ACTIVITY_INVITES_PATH = ':memberId/activities/';
1338
+ const MEMBER_CALENDAR_PATH = ':memberId/activities/calendar/';
1339
+ const PUBLIC_ACTIVITY_INVITE_PATH = 'activities/:id/:token/';
1340
+ const TEAM_ACTIVITIES_PATH = ':teamId/activities/';
1341
+ const TEAM_ACTIVITY_INVITES_PATH = ':teamId/activities/:activityId/invites/';
1342
+ const TEAM_ACTIVITY_LOCATIONS_PATH = ':teamId/activities/locations/';
1343
+ const TEAM_ACTIVITY_NEW_PATH = ':teamId/activities/new/';
1344
+ const TEAM_ACTIVITY_PARTICIPANTS_PATH = ':teamId/activities/:activityId/participants/';
1345
+ const TEAM_ACTIVITY_PATH = ':teamId/activities/:id/';
1346
+ const TEAM_ACTIVITY_SETTINGS_PATH = ':teamId/activities/settings/';
1347
+ const TEAM_ACTIVITY_TYPES_PATH = ':teamId/activities/types/';
1348
+ const TEAM_CALENDAR_PATH = ':teamId/activities/calendar/';
1349
+ class ActivityService {
1350
+ constructor(apiService) {
1351
+ this.apiService = apiService;
1352
+ }
1353
+ addTeamActivityInvites(teamId, activityId, memberIds) {
1354
+ return this.apiService
1355
+ .postResource(() => true, Role.TeamAdmin, TEAM_ACTIVITY_INVITES_PATH, {
1356
+ teamId,
1357
+ activityId
1358
+ }, {
1359
+ members: memberIds
1360
+ });
1361
+ }
1362
+ createTeamActivity(teamId, data) {
1363
+ return this.apiService
1364
+ .postResource(activityFactory, Role.TeamAdmin, TEAM_ACTIVITIES_PATH, {
1365
+ teamId
1366
+ }, data);
1367
+ }
1368
+ deleteTeamActivity(teamId, id) {
1369
+ return this.apiService
1370
+ .deleteResource(Role.TeamAdmin, TEAM_ACTIVITY_PATH, {
1371
+ teamId,
1372
+ id
1373
+ });
1374
+ }
1375
+ getMemberActivityInvite(memberId, activityInviteId) {
1376
+ return this.apiService
1377
+ .getResource(activityInviteFactory, Role.MemberAdmin, MEMBER_ACTIVITY_INVITE_PATH, {
1378
+ memberId,
1379
+ activityInviteId
1380
+ });
1381
+ }
1382
+ getMemberActivityInvites(memberId) {
1383
+ const params = { limit: 'null' };
1384
+ return this.apiService
1385
+ .getCollection(activityInviteFactory, Role.MemberAdmin, MEMBER_ACTIVITY_INVITES_PATH, { memberId }, {
1386
+ params
1387
+ });
1388
+ }
1389
+ getMemberCalendarEvents(memberId, startDate = null, endDate = null) {
1390
+ const params = { limit: 'null' };
1391
+ if (startDate) {
1392
+ params['search_start_day'] = startDate;
1393
+ }
1394
+ if (endDate) {
1395
+ params['search_end_day'] = endDate;
1396
+ }
1397
+ return this.apiService
1398
+ .getCollection(eventFactory, Role.MemberAdmin, MEMBER_CALENDAR_PATH, { memberId }, {
1399
+ params
1400
+ });
1401
+ }
1402
+ getPublicActivityInvite(id, token) {
1403
+ return this.apiService
1404
+ .getResource(activityInviteFactory, Role.Public, PUBLIC_ACTIVITY_INVITE_PATH, {
1405
+ id,
1406
+ token
1407
+ });
1408
+ }
1409
+ getTeamActivity(teamId, id) {
1410
+ return this.apiService
1411
+ .getResource(activityFactory, Role.TeamAdmin, TEAM_ACTIVITY_PATH, { teamId, id });
1412
+ }
1413
+ getTeamActivityLocations(teamId) {
1414
+ if (this.activityLocationResponseDate && this.activityLocationResponseDate > this.subtractHours(new Date(), 1)) {
1415
+ return of(this.activityLocationCollection);
1416
+ }
1417
+ return this.apiService
1418
+ .getCollection(activityLocationFactory, Role.TeamAdmin, TEAM_ACTIVITY_LOCATIONS_PATH, { teamId }, { params: { limit: 'null' } }).pipe(tap((activityLocationCollection) => {
1419
+ this.activityLocationResponseDate = new Date();
1420
+ this.activityLocationCollection = activityLocationCollection;
1421
+ }));
1422
+ }
1423
+ getTeamActivityNew(teamId) {
1424
+ return this.apiService
1425
+ .getResource(activityFactory, Role.TeamAdmin, TEAM_ACTIVITY_NEW_PATH, { teamId });
1426
+ }
1427
+ getTeamActivityParticipants(teamId, activityId) {
1428
+ return this.apiService
1429
+ .getCollection(searchMemberFactory, Role.TeamAdmin, TEAM_ACTIVITY_PARTICIPANTS_PATH, {
1430
+ teamId,
1431
+ activityId
1432
+ }, { params: { limit: 'null' } });
1433
+ }
1434
+ getTeamActivitySettings(teamId) {
1435
+ return this.apiService
1436
+ .getResource(activitySettingsFactory, Role.TeamAdmin, TEAM_ACTIVITY_SETTINGS_PATH, {
1437
+ teamId
1438
+ });
1439
+ }
1440
+ getTeamActivityTypes(teamId) {
1441
+ if (this.activityTypeResponseDate && this.activityTypeResponseDate > this.subtractHours(new Date(), 1)) {
1442
+ return of(this.activityTypeCollection);
1443
+ }
1444
+ return this.apiService
1445
+ .getCollection(activityTypeFactory, Role.TeamAdmin, TEAM_ACTIVITY_TYPES_PATH, { teamId }, { params: { limit: 'null' } }).pipe(tap((activityTypeCollection) => {
1446
+ this.activityTypeResponseDate = new Date();
1447
+ this.activityTypeCollection = activityTypeCollection;
1448
+ }));
1449
+ }
1450
+ getTeamCalendarEvents(teamId, startDate = null, endDate = null) {
1451
+ const params = { limit: 'null' };
1452
+ if (startDate) {
1453
+ params['search_start_day'] = startDate;
1454
+ }
1455
+ if (endDate) {
1456
+ params['search_end_day'] = endDate;
1457
+ }
1458
+ return this.apiService
1459
+ .getCollection(eventFactory, Role.TeamAdmin, TEAM_CALENDAR_PATH, { teamId }, {
1460
+ params
1461
+ });
1462
+ }
1463
+ updateMemberActivity(memberId, activityInviteId, activityInvite) {
1464
+ return this.apiService
1465
+ .updateResource(activityInviteFactory, Role.MemberAdmin, MEMBER_ACTIVITY_INVITE_PATH, {
1466
+ memberId,
1467
+ activityInviteId
1468
+ }, activityInvite);
1469
+ }
1470
+ updatePublicActivityInvite(id, token, activityInvite) {
1471
+ return this.apiService
1472
+ .updateResource(activityInviteFactory, Role.Public, PUBLIC_ACTIVITY_INVITE_PATH, {
1473
+ id,
1474
+ token
1475
+ }, activityInvite);
1476
+ }
1477
+ updateTeamActivity(teamId, activity) {
1478
+ return this.apiService
1479
+ .updateResource(activityFactory, Role.TeamAdmin, TEAM_ACTIVITY_PATH, {
1480
+ teamId,
1481
+ id: activity.id
1482
+ }, activity);
1483
+ }
1484
+ updateTeamActivityParticipants(teamId, activityId, members) {
1485
+ return this.apiService
1486
+ .postResource(() => { }, Role.TeamAdmin, TEAM_ACTIVITY_PARTICIPANTS_PATH, {
1487
+ teamId,
1488
+ activityId
1489
+ }, {
1490
+ members
1491
+ });
1492
+ }
1493
+ subtractHours(date, hours) {
1494
+ date.setHours(date.getHours() - hours);
1495
+ return date;
1496
+ }
1497
+ }
1498
+ ActivityService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ActivityService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1499
+ ActivityService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ActivityService, providedIn: 'root' });
1500
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ActivityService, decorators: [{
1501
+ type: Injectable,
1502
+ args: [{
1503
+ providedIn: 'root'
1504
+ }]
1505
+ }], ctorParameters: function () { return [{ type: ApiService }]; } });
1506
+
1507
+ const MEMBER_CLUB_INFO = ':memberId/club-info/';
1508
+ const TEAM_CLUB_INFO = ':teamId/club-info/';
1509
+ class ClubService {
1510
+ constructor(apiService) {
1511
+ this.apiService = apiService;
1512
+ }
1513
+ getMemberClubInfo(memberId) {
1514
+ return this.apiService
1515
+ .getResource(searchClubFactory, Role.MemberAdmin, MEMBER_CLUB_INFO, { memberId });
1516
+ }
1517
+ getTeamClubInfo(teamId) {
1518
+ return this.apiService
1519
+ .getResource(searchClubFactory, Role.TeamAdmin, TEAM_CLUB_INFO, { teamId });
1520
+ }
1521
+ }
1522
+ ClubService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ClubService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1523
+ ClubService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ClubService, providedIn: 'root' });
1524
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ClubService, decorators: [{
1525
+ type: Injectable,
1526
+ args: [{
1527
+ providedIn: 'root'
1528
+ }]
1529
+ }], ctorParameters: function () { return [{ type: ApiService }]; } });
1530
+
1531
+ const ACTIVITY_INVITE_SETTINGS_PATH = 'every-admin/constants/activity-invite-settings/';
1532
+ const ACTIVITY_MAX_ATTENDANT_TYPES_PATH = 'every-admin/constants/activity-max-attendant-types/';
1533
+ const ACTIVITY_MEET_UP_TIMES_PATH = 'every-admin/constants/activity-meet-up-times/';
1534
+ const ACTIVITY_REMINDER_DAYS_PATH = 'every-admin/constants/activity-invite-days/';
1535
+ const ACTIVITY_REMINDER_RECEIVERS_PATH = 'every-admin/constants/activity-remind-receivers/';
1536
+ const ACTIVITY_REMINDER_TIMES_PATH = 'every-admin/constants/activity-remind-hours/';
1537
+ const ACTIVITY_REPEAT_OPTIONS_PATH = 'every-admin/constants/activity-repeat-options/';
1538
+ const ACTIVITY_REPEAT_TYPE_OPTIONS_PATH = 'every-admin/constants/activity-repeat-type-options/';
1539
+ const COUNTRIES_PATH = 'every-admin/constants/countries/';
1540
+ const LANGUAGES_PATH = 'every-admin/constants/languages/';
1541
+ const MEMBER_CONTACT_TYPES_PATH = 'every-admin/constants/member-contact-types/';
1542
+ class ConstantService {
1543
+ constructor(apiService) {
1544
+ this.apiService = apiService;
1545
+ this.activityInviteSettings = [];
1546
+ this.activityMaxAttendantTypes = [];
1547
+ this.activityMeetUpTimes = [];
1548
+ this.activityReminderDays = [];
1549
+ this.activityReminderReceivers = [];
1550
+ this.activityReminderTimes = [];
1551
+ this.activityRepeatOptions = [];
1552
+ this.activityRepeatTypeOptions = [];
1553
+ this.countries = [];
1554
+ this.languages = [];
1555
+ this.memberContactTypes = [];
1556
+ }
1557
+ getActivityInviteSettings() {
1558
+ if (this.activityInviteSettings.length) {
1559
+ return of(this.activityInviteSettings);
1560
+ }
1561
+ return this.getConstants(ACTIVITY_INVITE_SETTINGS_PATH)
1562
+ .pipe(tap((activityInviteSettings) => this.activityInviteSettings = activityInviteSettings));
1563
+ }
1564
+ getActivityMaxAttendantsTypes() {
1565
+ if (this.activityMaxAttendantTypes.length) {
1566
+ return of(this.activityMaxAttendantTypes);
1567
+ }
1568
+ return this.getConstants(ACTIVITY_MAX_ATTENDANT_TYPES_PATH)
1569
+ .pipe(tap((activityMaxAttendantTypes) => this.activityMaxAttendantTypes = activityMaxAttendantTypes));
1570
+ }
1571
+ getActivityMeetUpTimes() {
1572
+ if (this.activityMeetUpTimes.length) {
1573
+ return of(this.activityMeetUpTimes);
1574
+ }
1575
+ return this.getConstants(ACTIVITY_MEET_UP_TIMES_PATH)
1576
+ .pipe(tap((activityMeetUpTimes) => this.activityMeetUpTimes = activityMeetUpTimes));
1577
+ }
1578
+ getActivityReminderDays() {
1579
+ if (this.activityReminderDays.length) {
1580
+ return of(this.activityReminderDays);
1581
+ }
1582
+ return this.getConstants(ACTIVITY_REMINDER_DAYS_PATH)
1583
+ .pipe(tap((activityReminderDays) => this.activityReminderDays = activityReminderDays));
1584
+ }
1585
+ getActivityReminderReceivers() {
1586
+ if (this.activityReminderReceivers.length) {
1587
+ return of(this.activityReminderReceivers);
1588
+ }
1589
+ return this.getConstants(ACTIVITY_REMINDER_RECEIVERS_PATH)
1590
+ .pipe(tap((activityReminderReceivers) => this.activityReminderReceivers = activityReminderReceivers));
1591
+ }
1592
+ getActivityReminderTimes() {
1593
+ if (this.activityReminderTimes.length) {
1594
+ return of(this.activityReminderTimes);
1595
+ }
1596
+ return this.getConstants(ACTIVITY_REMINDER_TIMES_PATH)
1597
+ .pipe(tap((activityReminderTimes) => this.activityReminderTimes = activityReminderTimes));
1598
+ }
1599
+ getActivityRepeatOptions() {
1600
+ if (this.activityRepeatOptions.length) {
1601
+ return of(this.activityRepeatOptions);
1602
+ }
1603
+ return this.getConstants(ACTIVITY_REPEAT_OPTIONS_PATH)
1604
+ .pipe(tap((activityRepeatOptions) => this.activityRepeatOptions = activityRepeatOptions));
1605
+ }
1606
+ getActivityRepeatTypeOptions() {
1607
+ if (this.activityRepeatTypeOptions.length) {
1608
+ return of(this.activityRepeatTypeOptions);
1609
+ }
1610
+ return this.getConstants(ACTIVITY_REPEAT_TYPE_OPTIONS_PATH)
1611
+ .pipe(tap((activityRepeatTypeOptions) => this.activityRepeatTypeOptions = activityRepeatTypeOptions));
1612
+ }
1613
+ getCountries() {
1614
+ if (this.countries.length) {
1615
+ return of(this.countries);
1616
+ }
1617
+ return this.getConstants(COUNTRIES_PATH)
1618
+ .pipe(tap((countries) => this.countries = countries));
1619
+ }
1620
+ getLanguages() {
1621
+ if (this.languages.length) {
1622
+ return of(this.languages);
1623
+ }
1624
+ return this.getConstants(LANGUAGES_PATH)
1625
+ .pipe(map((languages) => {
1626
+ // FIXME: For now - remove the french language.
1627
+ const index = languages.findIndex((language) => language.value === 'fr');
1628
+ if (index !== -1) {
1629
+ languages.splice(index, 1);
1630
+ }
1631
+ return languages;
1632
+ }), tap((languages) => this.languages = languages));
1633
+ }
1634
+ getMemberContactTypes() {
1635
+ if (this.memberContactTypes.length) {
1636
+ return of(this.memberContactTypes);
1637
+ }
1638
+ return this.getConstants(MEMBER_CONTACT_TYPES_PATH)
1639
+ .pipe(tap((memberContactTypes) => this.memberContactTypes = memberContactTypes));
1640
+ }
1641
+ getConstants(path) {
1642
+ return this.apiService
1643
+ .getCollection((option) => option, Role.None, path)
1644
+ .pipe(map((response) => response.toArray()));
1645
+ }
1646
+ }
1647
+ ConstantService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ConstantService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1648
+ ConstantService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ConstantService, providedIn: 'root' });
1649
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ConstantService, decorators: [{
1650
+ type: Injectable,
1651
+ args: [{
1652
+ providedIn: 'root'
1653
+ }]
1654
+ }], ctorParameters: function () { return [{ type: ApiService }]; } });
1655
+
1656
+ const TEAM_LEADER_CREATE_EMAIL_PATH = ':teamId/distribution/email/';
1657
+ class EmailService {
1658
+ constructor(apiService) {
1659
+ this.apiService = apiService;
1660
+ this.backHref = '';
1661
+ this.recipients = [];
1662
+ }
1663
+ clear() {
1664
+ this.backHref = '';
1665
+ this.recipients = [];
1666
+ }
1667
+ getBackHref() {
1668
+ return this.backHref;
1669
+ }
1670
+ getRecipients() {
1671
+ return this.recipients;
1672
+ }
1673
+ removeRecipient(id) {
1674
+ const index = this.recipients.findIndex((item) => item.id === id);
1675
+ if (index !== -1) {
1676
+ this.recipients.splice(index, 1);
1677
+ return true;
1678
+ }
1679
+ return false;
1680
+ }
1681
+ sendTeamLeaderEmail(teamId, email) {
1682
+ return this.apiService
1683
+ .postResource((email_count) => email_count.queued_emails, Role.TeamAdmin, TEAM_LEADER_CREATE_EMAIL_PATH, { teamId }, {
1684
+ body: email.body,
1685
+ subject: email.subject,
1686
+ recipients: email.recipients.map((value) => value.id)
1687
+ });
1688
+ }
1689
+ setBackHref(href) {
1690
+ this.backHref = href;
1691
+ }
1692
+ setRecipients(emailRecipients) {
1693
+ this.recipients = [...emailRecipients].sort((a, b) => (a.name < b.name ? -1 : 1));
1694
+ }
1695
+ }
1696
+ EmailService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: EmailService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1697
+ EmailService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: EmailService, providedIn: 'root' });
1698
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: EmailService, decorators: [{
1699
+ type: Injectable,
1700
+ args: [{
1701
+ providedIn: 'root'
1702
+ }]
1703
+ }], ctorParameters: function () { return [{ type: ApiService }]; } });
1704
+
1705
+ const MEMBER_EXTERNAL_LINK_PATH = ':memberId/others/externallinks/';
1706
+ class ExternalLinkService {
1707
+ constructor(apiService) {
1708
+ this.apiService = apiService;
1709
+ }
1710
+ getMemberExternalLinks(memberId) {
1711
+ return this.apiService
1712
+ .getCollection(externalLinkFactory, Role.MemberAdmin, MEMBER_EXTERNAL_LINK_PATH, { memberId });
1713
+ }
1714
+ }
1715
+ ExternalLinkService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ExternalLinkService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1716
+ ExternalLinkService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ExternalLinkService, providedIn: 'root' });
1717
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: ExternalLinkService, decorators: [{
1718
+ type: Injectable,
1719
+ args: [{
1720
+ providedIn: 'root'
1721
+ }]
1722
+ }], ctorParameters: function () { return [{ type: ApiService }]; } });
1723
+
1724
+ const MEMBER_DIRECTORIES_PATH = ':memberId/files/';
1725
+ const TEAM_DIRECTORIES_PATH = ':teamId/files/';
1726
+ class FileService {
1727
+ constructor(apiService) {
1728
+ this.apiService = apiService;
1729
+ }
1730
+ getMemberDirectories(memberId) {
1731
+ return this.apiService
1732
+ .getCollection(directoryFactory, Role.MemberAdmin, MEMBER_DIRECTORIES_PATH, { memberId }, { params: { limit: 'null' } });
1733
+ }
1734
+ getTeamDirectories(teamId) {
1735
+ return this.apiService
1736
+ .getCollection(directoryFactory, Role.TeamAdmin, TEAM_DIRECTORIES_PATH, { teamId }, { params: { limit: 'null' } });
1737
+ }
1738
+ }
1739
+ FileService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: FileService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1740
+ FileService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: FileService, providedIn: 'root' });
1741
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: FileService, decorators: [{
1742
+ type: Injectable,
1743
+ args: [{
1744
+ providedIn: 'root'
1745
+ }]
1746
+ }], ctorParameters: function () { return [{ type: ApiService }]; } });
1747
+
1748
+ const MEMBER_INVOICE_PATH = ':memberId/invoices/:invoiceId/';
1749
+ const MEMBER_INVOICES_PATH = ':memberId/invoices/';
1750
+ const PUBLIC_INVOICE_PATH = 'invoices/:invoiceId/:token/';
1751
+ const PUBLIC_INVOICE_LOGO_PATH = 'invoices/:invoiceId/:token/logo/';
1752
+ class InvoiceService {
1753
+ constructor(apiService) {
1754
+ this.apiService = apiService;
1755
+ }
1756
+ getMemberInvoice(memberId, invoiceId) {
1757
+ return this.getInvoice(Role.MemberAdmin, MEMBER_INVOICE_PATH, { memberId, invoiceId });
1758
+ }
1759
+ getMemberInvoices(memberId, filterParams = {}) {
1760
+ return this.getInvoices(Role.MemberAdmin, MEMBER_INVOICES_PATH, { memberId }, filterParams);
1761
+ }
1762
+ getPublicInvoice(invoiceId, token) {
1763
+ return this.getInvoice(Role.Public, PUBLIC_INVOICE_PATH, { invoiceId, token });
1764
+ }
1765
+ getPublicInvoiceLogo(invoiceId, token) {
1766
+ return this.apiService.getResource(clubImageFactory, Role.Public, PUBLIC_INVOICE_LOGO_PATH, { invoiceId, token });
1767
+ }
1768
+ getInvoice(role, path, pathParams) {
1769
+ return this.apiService.getResource(memberInvoiceFactory, role, path, pathParams);
1770
+ }
1771
+ getInvoices(role, path, pathParams, filterParams = {}) {
1772
+ return this.apiService.getCollection(searchMemberInvoiceFactory, role, path, pathParams, { params: filterParams });
1773
+ }
1774
+ }
1775
+ InvoiceService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: InvoiceService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1776
+ InvoiceService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: InvoiceService, providedIn: 'root' });
1777
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: InvoiceService, decorators: [{
1778
+ type: Injectable,
1779
+ args: [{
1780
+ providedIn: 'root'
1781
+ }]
1782
+ }], ctorParameters: function () { return [{ type: ApiService }]; } });
1783
+
1784
+ class ApiPaymentAttemptCreate {
1785
+ constructor(invoice_id, type) {
1786
+ this.invoice_id = invoice_id;
1787
+ this.type = type;
1788
+ }
1789
+ }
1790
+
1791
+ const MEMBER_PAYMENT_PATH = ':memberId/invoices/:invoiceId/payment-attempts/:id/';
1792
+ const MEMBER_PAYMENTS_PATH = ':memberId/invoices/:invoiceId/payment-attempts/';
1793
+ const PUBLIC_PAYMENT_PATH = 'invoices/:invoiceId/:token/payment-attempts/:id/';
1794
+ const PUBLIC_PAYMENTS_PATH = 'invoices/:invoiceId/:token/payment-attempts/';
1795
+ class PaymentAttemptService {
1796
+ constructor(apiService) {
1797
+ this.apiService = apiService;
1798
+ }
1799
+ createMemberPaymentAttempt(memberId, invoiceId, type) {
1800
+ return this.createPaymentAttempt(Role.MemberAdmin, MEMBER_PAYMENTS_PATH, { memberId, invoiceId }, new ApiPaymentAttemptCreate(invoiceId, type));
1801
+ }
1802
+ createPublicPaymentAttempt(invoiceId, token, type) {
1803
+ return this.createPaymentAttempt(Role.Public, PUBLIC_PAYMENTS_PATH, { invoiceId, token }, new ApiPaymentAttemptCreate(invoiceId, type));
1804
+ }
1805
+ getMemberPaymentAttempt(memberId, invoiceId, id) {
1806
+ return this.getPaymentAttempt(Role.MemberAdmin, MEMBER_PAYMENT_PATH, { memberId, invoiceId, id: id.toString() });
1807
+ }
1808
+ getMemberSwishQRCode(memberId, invoiceId, id) {
1809
+ return this.getSwishQRCode(Role.MemberAdmin, `${MEMBER_PAYMENT_PATH}swish-qr/`, { memberId, invoiceId, id: id.toString() });
1810
+ }
1811
+ getPublicPaymentAttempt(invoiceId, token, id) {
1812
+ return this.getPaymentAttempt(Role.Public, PUBLIC_PAYMENT_PATH, { invoiceId, token, id: id.toString() });
1813
+ }
1814
+ getPublicSwishQRCode(invoiceId, token, id) {
1815
+ return this.getSwishQRCode(Role.Public, `${PUBLIC_PAYMENT_PATH}swish-qr/`, { invoiceId, token, id: id.toString() });
1816
+ }
1817
+ createPaymentAttempt(role, path, pathParams, data) {
1818
+ return this.apiService.postResource(paymentAttemptFactory, role, path, pathParams, data);
1819
+ }
1820
+ getPaymentAttempt(role, path, pathParams) {
1821
+ return this.apiService.getResource(paymentAttemptFactory, role, path, pathParams);
1822
+ }
1823
+ getSwishQRCode(role, path, pathParams) {
1824
+ return this.apiService.getResource((apiSwishQrCode) => new SwishQrCode(apiSwishQrCode.qr_code), role, path, pathParams);
1825
+ }
1826
+ }
1827
+ PaymentAttemptService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: PaymentAttemptService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1828
+ PaymentAttemptService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: PaymentAttemptService, providedIn: 'root' });
1829
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: PaymentAttemptService, decorators: [{
1830
+ type: Injectable,
1831
+ args: [{
1832
+ providedIn: 'root'
1833
+ }]
1834
+ }], ctorParameters: function () { return [{ type: ApiService }]; } });
1835
+
1836
+ const MEMBER_OTHER_MEMBER_PATH = ':memberId/others/clubmembers/:id/';
1837
+ const MEMBER_OTHER_MEMBER_SEARCH_PATH = ':memberId/others/clubmembers/';
1838
+ const MEMBER_PROFILE_CONTACT_PATH = ':memberId/member-detail/contacts/:contactId/';
1839
+ const MEMBER_PROFILE_PATH = ':memberId/member-detail/';
1840
+ const TEAM_MEMBER_CONTACT_PATH = ':teamId/team-members/:memberId/contacts/:contactId/';
1841
+ const TEAM_OTHER_MEMBER_PATH = ':teamId/team-members/others/:id/';
1842
+ const TEAM_OTHER_MEMBER_SEARCH_PATH = ':teamId/team-members/others/';
1843
+ class MemberService {
1844
+ constructor(apiService) {
1845
+ this.apiService = apiService;
1846
+ }
1847
+ getMemberProfile(memberId) {
1848
+ return this.apiService
1849
+ .getResource(memberFactory, Role.MemberAdmin, MEMBER_PROFILE_PATH, { memberId });
1850
+ }
1851
+ getMemberOtherMember(memberId, id) {
1852
+ return this.apiService
1853
+ .getResource(memberFactory, Role.MemberAdmin, MEMBER_OTHER_MEMBER_PATH, { memberId, id });
1854
+ }
1855
+ getTeamOtherMember(teamId, id) {
1856
+ return this.apiService
1857
+ .getResource(memberFactory, Role.MemberAdmin, TEAM_OTHER_MEMBER_PATH, { teamId, id });
1858
+ }
1859
+ removeMemberProfileContact(memberId, contactId) {
1860
+ return this.apiService
1861
+ .deleteResource(Role.MemberAdmin, MEMBER_PROFILE_CONTACT_PATH, { memberId, contactId });
1862
+ }
1863
+ removeTeamMemberContact(teamId, memberId, contactId) {
1864
+ return this.apiService
1865
+ .deleteResource(Role.TeamAdmin, TEAM_MEMBER_CONTACT_PATH, { teamId, memberId, contactId });
1866
+ }
1867
+ searchMemberOtherMembers(memberId, searchTerm) {
1868
+ return this.apiService
1869
+ .getCollection(searchMemberFactory, Role.MemberAdmin, MEMBER_OTHER_MEMBER_SEARCH_PATH, { memberId }, { params: { q: searchTerm } });
1870
+ }
1871
+ searchTeamOtherMembers(teamId, searchTerm) {
1872
+ return this.apiService
1873
+ .getCollection(searchMemberFactory, Role.TeamAdmin, TEAM_OTHER_MEMBER_SEARCH_PATH, { teamId }, { params: { q: searchTerm } });
1874
+ }
1875
+ updateMemberProfile(memberId, memberProfile) {
1876
+ return this.apiService
1877
+ .updateResource(memberFactory, Role.MemberAdmin, MEMBER_PROFILE_PATH, { memberId }, memberProfile);
1878
+ }
1879
+ }
1880
+ MemberService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: MemberService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1881
+ MemberService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: MemberService, providedIn: 'root' });
1882
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: MemberService, decorators: [{
1883
+ type: Injectable,
1884
+ args: [{
1885
+ providedIn: 'root'
1886
+ }]
1887
+ }], ctorParameters: function () { return [{ type: ApiService }]; } });
1888
+
1889
+ const MEMBER_MEMBER_CARD_PATH = ':memberId/member-cards/:id/';
1890
+ const MEMBER_MEMBER_CARD_DEALS_PATH = ':memberId/member-cards/:id/deals/';
1891
+ const MEMBER_MEMBER_CARD_ACTIVATE_TICKET_PATH = ':memberId/member-cards/:cardId/tickets/:id/activate/';
1892
+ const MEMBER_MEMBER_CARD_TICKETS_PATH = ':memberId/member-cards/:id/tickets/';
1893
+ const MEMBER_MEMBER_CARDS_PATH = ':memberId/member-cards/';
1894
+ const PUBLIC_MEMBER_CARD_PATH = 'member-cards/:id/:token/';
1895
+ const PUBLIC_MEMBER_CARD_DEALS_PATH = 'member-cards/:id/:token/deals/';
1896
+ const PUBLIC_MEMBER_CARD_ACTIVATE_TICKET_PATH = 'member-cards/:cardId/:token/tickets/:id/activate/';
1897
+ const PUBLIC_MEMBER_CARD_TICKETS_PATH = 'member-cards/:id/:token/tickets/';
1898
+ const pinCodeFactory = (apiCardMemberTicket) => {
1899
+ return !!apiCardMemberTicket;
1900
+ };
1901
+ class MemberCardService {
1902
+ constructor(apiService) {
1903
+ this.apiService = apiService;
1904
+ }
1905
+ activateMemberCardTicket(memberId, cardId, id, pin_code) {
1906
+ return this.apiService
1907
+ .postResource(pinCodeFactory, Role.MemberAdmin, MEMBER_MEMBER_CARD_ACTIVATE_TICKET_PATH, { memberId, cardId, id }, { pin_code });
1908
+ }
1909
+ activatePublicCardTicket(cardId, token, id, pin_code) {
1910
+ return this.apiService
1911
+ .postResource(pinCodeFactory, Role.Public, PUBLIC_MEMBER_CARD_ACTIVATE_TICKET_PATH, {
1912
+ cardId,
1913
+ token,
1914
+ id
1915
+ }, {
1916
+ pin_code
1917
+ });
1918
+ }
1919
+ getMemberCard(memberId, id) {
1920
+ return this.apiService
1921
+ .getResource(memberCardFactory, Role.MemberAdmin, MEMBER_MEMBER_CARD_PATH, { memberId, id });
1922
+ }
1923
+ getMemberCardDeals(memberId, id, filterParams = {}) {
1924
+ return this.apiService
1925
+ .getCollection(cardDealFactory, Role.MemberAdmin, MEMBER_MEMBER_CARD_DEALS_PATH, { memberId, id }, { params: filterParams });
1926
+ }
1927
+ getMemberCardTickets(memberId, id, filterParams = {}) {
1928
+ return this.apiService
1929
+ .getCollection(cardTicketFactory, Role.MemberAdmin, MEMBER_MEMBER_CARD_TICKETS_PATH, { memberId, id }, { params: filterParams });
1930
+ }
1931
+ getMemberCards(memberId, filterParams = {}) {
1932
+ return this.apiService
1933
+ .getCollection(searchMemberCardFactory, Role.MemberAdmin, MEMBER_MEMBER_CARDS_PATH, { memberId }, { params: filterParams });
1934
+ }
1935
+ getPublicMemberCard(id, token) {
1936
+ return this.apiService
1937
+ .getResource(memberCardFactory, Role.Public, PUBLIC_MEMBER_CARD_PATH, {
1938
+ id,
1939
+ token
1940
+ });
1941
+ }
1942
+ getPublicMemberCardDeals(id, token, filterParams = {}) {
1943
+ return this.apiService
1944
+ .getCollection(cardDealFactory, Role.Public, PUBLIC_MEMBER_CARD_DEALS_PATH, {
1945
+ id,
1946
+ token
1947
+ }, { params: filterParams });
1948
+ }
1949
+ getPublicMemberCardTickets(id, token, filterParams = {}) {
1950
+ return this.apiService
1951
+ .getCollection(cardTicketFactory, Role.Public, PUBLIC_MEMBER_CARD_TICKETS_PATH, {
1952
+ id,
1953
+ token
1954
+ }, { params: filterParams });
1955
+ }
1956
+ }
1957
+ MemberCardService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: MemberCardService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1958
+ MemberCardService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: MemberCardService, providedIn: 'root' });
1959
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: MemberCardService, decorators: [{
1960
+ type: Injectable,
1961
+ args: [{
1962
+ providedIn: 'root'
1963
+ }]
1964
+ }], ctorParameters: function () { return [{ type: ApiService }]; } });
1965
+
1966
+ const MEMBER_MEMBER_PUBLIC_FORMS_PATH = ':memberId/myclub-forms/';
1967
+ class MemberPublicFormService {
1968
+ constructor(apiService) {
1969
+ this.apiService = apiService;
1970
+ }
1971
+ getMemberMemberPublicForms(memberId) {
1972
+ return this.apiService
1973
+ .getCollection(memberPublicFormFactory, Role.MemberAdmin, MEMBER_MEMBER_PUBLIC_FORMS_PATH, { memberId });
1974
+ }
1975
+ }
1976
+ MemberPublicFormService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: MemberPublicFormService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
1977
+ MemberPublicFormService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: MemberPublicFormService, providedIn: 'root' });
1978
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: MemberPublicFormService, decorators: [{
1979
+ type: Injectable,
1980
+ args: [{
1981
+ providedIn: 'root'
1982
+ }]
1983
+ }], ctorParameters: function () { return [{ type: ApiService }]; } });
1984
+
1985
+ const TEAM_NEWS_LIST = ':teamId/news/';
1986
+ class NewsService {
1987
+ constructor(apiService) {
1988
+ this.apiService = apiService;
1989
+ }
1990
+ listTeamNews(teamId, offset) {
1991
+ return this.apiService
1992
+ .getCollection(newsFactory, Role.TeamAdmin, TEAM_NEWS_LIST, {
1993
+ teamId
1994
+ }, {
1995
+ params: {
1996
+ offset: offset.toString(10)
1997
+ }
1998
+ });
1999
+ }
2000
+ }
2001
+ NewsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: NewsService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
2002
+ NewsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: NewsService, providedIn: 'root' });
2003
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: NewsService, decorators: [{
2004
+ type: Injectable,
2005
+ args: [{
2006
+ providedIn: 'root'
2007
+ }]
2008
+ }], ctorParameters: function () { return [{ type: ApiService }]; } });
2009
+
2010
+ const CLUB_SECTIONS_PATH = 'clubs/:clubId/sections/';
2011
+ class SectionService {
2012
+ constructor(apiService) {
2013
+ this.apiService = apiService;
2014
+ }
2015
+ getClubSections(clubId) {
2016
+ return this.apiService.getCollection(clubSectionFactory, Role.ClubAdmin, CLUB_SECTIONS_PATH, { clubId });
2017
+ }
2018
+ }
2019
+ SectionService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: SectionService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
2020
+ SectionService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: SectionService, providedIn: 'root' });
2021
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: SectionService, decorators: [{
2022
+ type: Injectable,
2023
+ args: [{
2024
+ providedIn: 'root'
2025
+ }]
2026
+ }], ctorParameters: function () { return [{ type: ApiService }]; } });
2027
+
2028
+ const CLUB_TEAMS_PATH = 'clubs/:clubId/teams/';
2029
+ const MEMBER_TEAM_MEMBER_PATH = ':memberId/teams/:teamId/team-members/:id/';
2030
+ const MEMBER_TEAM_MEMBERS_PATH = ':memberId/teams/:teamId/team-members/';
2031
+ const MEMBER_TEAM_EXTRA_MEMBER_PATH = ':memberId/teams/:teamId/extra-members/:id/';
2032
+ const MEMBER_TEAM_EXTRA_MEMBERS_PATH = ':memberId/teams/:teamId/extra-members/';
2033
+ const MEMBER_TEAM_PATH = ':memberId/teams/:teamId/';
2034
+ const MEMBER_TEAMS_PATH = ':memberId/teams/';
2035
+ const SECTION_TEAMS_PATH = 'sections/:sectionId/teams/';
2036
+ const TEAM_LEADER_TEAM_MEMBER_PATH = ':teamId/team-members/:id/';
2037
+ const TEAM_LEADER_TEAM_MEMBERS_PATH = ':teamId/team-members/';
2038
+ const TEAM_LEADER_TEAM_PATH = ':teamId/team-detail/';
2039
+ const TEAM_LEADER_TEAM_EXTRA_MEMBER_PATH = ':teamId/team-members/extra-members/:id/';
2040
+ const TEAM_LEADER_TEAM_EXTRA_MEMBERS_PATH = ':teamId/team-members/extra-members/';
2041
+ class TeamService {
2042
+ constructor(apiService) {
2043
+ this.apiService = apiService;
2044
+ }
2045
+ deleteTeamLeaderTeamMember(teamId, id) {
2046
+ return this.apiService.deleteResource(Role.TeamAdmin, TEAM_LEADER_TEAM_MEMBER_PATH, { teamId, id });
2047
+ }
2048
+ getClubTeams(clubId) {
2049
+ return this.apiService.getCollection((apiClubTeam) => new SectionTeam(apiClubTeam.id, apiClubTeam.name), Role.ClubAdmin, CLUB_TEAMS_PATH, { clubId });
2050
+ }
2051
+ getMemberTeam(memberId, teamId) {
2052
+ return this.apiService.getResource(memberTeamFactory, Role.MemberAdmin, MEMBER_TEAM_PATH, { memberId, teamId });
2053
+ }
2054
+ getMemberTeamExtraMember(memberId, teamId, id) {
2055
+ return this.apiService.getResource(activityExtraMemberFactory, Role.MemberAdmin, MEMBER_TEAM_EXTRA_MEMBER_PATH, { memberId, teamId, id });
2056
+ }
2057
+ getMemberTeamExtraMembers(memberId, teamId, q, offset) {
2058
+ return this.apiService.getCollection(activityExtraMemberFactory, Role.MemberAdmin, MEMBER_TEAM_EXTRA_MEMBERS_PATH, { memberId, teamId }, { params: { member_q: q, offset: offset.toString(10) } });
2059
+ }
2060
+ getMemberTeamMember(memberId, teamId, id) {
2061
+ return this.apiService.getResource(memberTeamThroughFactory, Role.MemberAdmin, MEMBER_TEAM_MEMBER_PATH, { memberId, teamId, id });
2062
+ }
2063
+ getMemberTeamMembers(memberId, teamId, q, offset) {
2064
+ return this.apiService.getCollection(searchMemberTeamThroughFactory, Role.MemberAdmin, MEMBER_TEAM_MEMBERS_PATH, { memberId, teamId }, { params: { member_q: q, offset: offset.toString(10) } });
2065
+ }
2066
+ getMemberTeams(memberId) {
2067
+ return this.apiService.getCollection(searchMemberTeamFactory, Role.MemberAdmin, MEMBER_TEAMS_PATH, { memberId });
2068
+ }
2069
+ getSectionTeams(role, sectionId) {
2070
+ return this.apiService.getCollection((apiSectionTeam) => new SectionTeam(apiSectionTeam.id, apiSectionTeam.name), role, SECTION_TEAMS_PATH, { sectionId });
2071
+ }
2072
+ getTeamLeaderTeam(teamId) {
2073
+ return this.apiService.getResource(memberTeamFactory, Role.TeamAdmin, TEAM_LEADER_TEAM_PATH, { teamId });
2074
+ }
2075
+ getTeamLeaderTeamExtraMember(teamId, id) {
2076
+ return this.apiService.getResource(activityExtraMemberFactory, Role.TeamAdmin, TEAM_LEADER_TEAM_EXTRA_MEMBER_PATH, {
2077
+ teamId, id
2078
+ });
2079
+ }
2080
+ getTeamLeaderTeamExtraMembers(teamId, q, offset) {
2081
+ return this.apiService.getCollection(activityExtraMemberFactory, Role.TeamAdmin, TEAM_LEADER_TEAM_EXTRA_MEMBERS_PATH, {
2082
+ teamId
2083
+ }, { params: { member_q: q, offset: offset.toString(10) } });
2084
+ }
2085
+ getTeamLeaderTeamMember(teamId, id) {
2086
+ return this.apiService.getResource(memberTeamThroughFactory, Role.TeamAdmin, TEAM_LEADER_TEAM_MEMBER_PATH, { teamId, id });
2087
+ }
2088
+ getTeamLeaderTeamMembers(teamId, q, offset) {
2089
+ return this.apiService.getCollection(searchMemberTeamThroughFactory, Role.TeamAdmin, TEAM_LEADER_TEAM_MEMBERS_PATH, { teamId }, { params: { member_q: q, offset: offset.toString(10) } });
2090
+ }
2091
+ updateTeamLeaderTeamMember(teamId, id, teamMember) {
2092
+ return this.apiService.updateResource(memberTeamThroughFactory, Role.TeamAdmin, TEAM_LEADER_TEAM_MEMBER_PATH, { teamId, id }, teamMember);
2093
+ }
2094
+ }
2095
+ TeamService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: TeamService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
2096
+ TeamService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: TeamService, providedIn: 'root' });
2097
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: TeamService, decorators: [{
2098
+ type: Injectable,
2099
+ args: [{
2100
+ providedIn: 'root'
2101
+ }]
2102
+ }], ctorParameters: function () { return [{ type: ApiService }]; } });
2103
+
2104
+ const BASE_PATH$1 = 'accounts/token/';
2105
+ const CREDENTIAL_GRANT_TYPE = 'password';
2106
+ const CODE_GRANT_TYPE = 'authorization_code';
2107
+ const LOGOUT_PATH = 'accounts/logout/';
2108
+ const REFRESH_GRANT_TYPE = 'refresh_token';
2109
+ const SESSION_TOKEN_PATH = 'accounts/session-token/';
2110
+ class TokenService {
2111
+ constructor(apiService) {
2112
+ this.apiService = apiService;
2113
+ }
2114
+ getTokenByCredentials(clientId, clientSecret, username, password) {
2115
+ return this.getToken(clientId, clientSecret, CREDENTIAL_GRANT_TYPE, { username, password });
2116
+ }
2117
+ getTokenByCode(clientId, clientSecret, code) {
2118
+ return this.getToken(clientId, clientSecret, CODE_GRANT_TYPE, { code });
2119
+ }
2120
+ getTokenByRefreshToken(clientId, clientSecret, refreshToken) {
2121
+ return this.getToken(clientId, clientSecret, REFRESH_GRANT_TYPE, {
2122
+ refresh_token: refreshToken
2123
+ });
2124
+ }
2125
+ getTokenBySession() {
2126
+ return this.apiService.getResource(tokenFactory, Role.None, SESSION_TOKEN_PATH, {}).pipe(catchError((err) => {
2127
+ if (err.status === 401) {
2128
+ return of(null);
2129
+ }
2130
+ return throwError(err);
2131
+ }));
2132
+ }
2133
+ logout() {
2134
+ return this.apiService.postResource(() => { }, Role.None, LOGOUT_PATH, {}, {});
2135
+ }
2136
+ getToken(clientId, clientSecret, grantType, params) {
2137
+ return this.apiService.postFormData(tokenFactory, Role.None, BASE_PATH$1, {}, {
2138
+ client_id: clientId,
2139
+ client_secret: clientSecret,
2140
+ grant_type: grantType,
2141
+ ...params
2142
+ });
2143
+ }
2144
+ }
2145
+ TokenService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: TokenService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
2146
+ TokenService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: TokenService, providedIn: 'root' });
2147
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: TokenService, decorators: [{
2148
+ type: Injectable,
2149
+ args: [{
2150
+ providedIn: 'root'
2151
+ }]
2152
+ }], ctorParameters: function () { return [{ type: ApiService }]; } });
2153
+
2154
+ const ACTIVATE_USER_PATH = 'accounts/activate/';
2155
+ const BASE_PATH = 'accounts/user/';
2156
+ const CREATE_USER_PATH = 'accounts/create-account/';
2157
+ const RESET_PASSWORD_PATH = 'accounts/reset-password/';
2158
+ const TERMINATE_USER_PATH = 'accounts/terminate/';
2159
+ class UserService {
2160
+ constructor(apiService) {
2161
+ this.apiService = apiService;
2162
+ }
2163
+ activateUser(uidb64, token) {
2164
+ return this.apiService.postResource(() => { }, Role.None, ACTIVATE_USER_PATH, {}, {
2165
+ uidb64,
2166
+ token
2167
+ }).pipe(map(() => true), catchError(() => of(false)));
2168
+ }
2169
+ createUser(newAccount) {
2170
+ return this.apiService.postResource(() => { }, Role.None, CREATE_USER_PATH, {}, newAccount)
2171
+ .pipe(map(() => true), catchError(() => of(false)));
2172
+ }
2173
+ getCurrentUser() {
2174
+ return this.apiService.getResource(userFactory, Role.None, BASE_PATH);
2175
+ }
2176
+ removeCurrentUser() {
2177
+ return this.apiService.postResource(() => { }, Role.None, TERMINATE_USER_PATH, {}, {})
2178
+ .pipe(map(() => true), catchError(() => of(false)));
2179
+ }
2180
+ resetPassword(email) {
2181
+ return this.apiService.postResource(() => { }, Role.None, RESET_PASSWORD_PATH, {}, {
2182
+ email
2183
+ }).pipe(map(() => true), catchError(() => of(false)));
2184
+ }
2185
+ updateCurrentUser(user) {
2186
+ let data = {
2187
+ email: user.email,
2188
+ first_name: user.firstName,
2189
+ last_name: user.lastName,
2190
+ device_token: user.deviceToken
2191
+ };
2192
+ if (user.newPassword) {
2193
+ data['new_password'] = user.newPassword;
2194
+ data['verify_password'] = user.verifyPassword;
2195
+ data['password'] = user.password;
2196
+ }
2197
+ if (user.newEmail) {
2198
+ data['email'] = user.newEmail;
2199
+ }
2200
+ if (user.language) {
2201
+ data['language'] = user.language;
2202
+ }
2203
+ return this.apiService.updateResource(userFactory, Role.None, BASE_PATH, {}, data);
2204
+ }
2205
+ }
2206
+ UserService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: UserService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
2207
+ UserService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: UserService, providedIn: 'root' });
2208
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: UserService, decorators: [{
2209
+ type: Injectable,
2210
+ args: [{
2211
+ providedIn: 'root'
2212
+ }]
2213
+ }], ctorParameters: function () { return [{ type: ApiService }]; } });
2214
+
2215
+ const USER_NOTIFICATIONS_PATH = 'every-admin/user-notifications/clubs/:clubId/';
2216
+ class UserNotificationService {
2217
+ constructor(apiService) {
2218
+ this.apiService = apiService;
2219
+ }
2220
+ getUserNotifications(clubId, offset = 0) {
2221
+ return this.apiService.getCollection(userNotificationFactory, Role.None, USER_NOTIFICATIONS_PATH, { clubId }, { params: { offset: offset.toString(10) } });
2222
+ }
2223
+ }
2224
+ UserNotificationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: UserNotificationService, deps: [{ token: ApiService }], target: i0.ɵɵFactoryTarget.Injectable });
2225
+ UserNotificationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: UserNotificationService, providedIn: 'root' });
2226
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: UserNotificationService, decorators: [{
2227
+ type: Injectable,
2228
+ args: [{
2229
+ providedIn: 'root'
2230
+ }]
2231
+ }], ctorParameters: function () { return [{ type: ApiService }]; } });
2232
+
2233
+ const APP = new InjectionToken('app');
2234
+ class AuthenticationService {
2235
+ constructor(apiService, app, tokenService) {
2236
+ this.apiService = apiService;
2237
+ this.app = app;
2238
+ this.tokenService = tokenService;
2239
+ this.currentTokenSubject = new BehaviorSubject(null);
2240
+ this.authentication = null;
2241
+ this.currentToken$ = this.currentTokenSubject.asObservable();
2242
+ }
2243
+ get isAuthenticated() {
2244
+ return !!this.authentication;
2245
+ }
2246
+ authenticateByCredentials(username, password) {
2247
+ return this.tokenService
2248
+ .getTokenByCredentials(this.app.clientId, this.app.clientSecret, username, password)
2249
+ .pipe(tap((token) => this.setToken(token)));
2250
+ }
2251
+ authenticateByToken(token) {
2252
+ return this.tokenService
2253
+ .getTokenByCode(this.app.clientId, this.app.clientSecret, token)
2254
+ .pipe(tap((token) => this.setToken(token)));
2255
+ }
2256
+ clearAuthentication() {
2257
+ this.authentication = null;
2258
+ this.currentTokenSubject.next(null);
2259
+ }
2260
+ getSessionToken() {
2261
+ return this.tokenService
2262
+ .getTokenBySession()
2263
+ .pipe(tap((token) => {
2264
+ if (token) {
2265
+ this.setToken(token);
2266
+ }
2267
+ }));
2268
+ }
2269
+ logout() {
2270
+ return this.tokenService
2271
+ .logout()
2272
+ .pipe(tap(() => this.clearAuthentication()));
2273
+ }
2274
+ reauthenticate() {
2275
+ return this.tokenService
2276
+ .getTokenByRefreshToken(this.app.clientId, this.app.clientSecret, this.authentication?.refreshToken)
2277
+ .pipe(tap((token) => this.setToken(token)));
2278
+ }
2279
+ setAuthentication(accessToken, refreshToken) {
2280
+ this.authentication = new Authentication(accessToken, refreshToken);
2281
+ }
2282
+ setToken(token) {
2283
+ this.currentTokenSubject.next(token);
2284
+ this.setAuthentication(token.accessToken, token.refreshToken);
2285
+ }
2286
+ }
2287
+ AuthenticationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: AuthenticationService, deps: [{ token: ApiService }, { token: APP }, { token: TokenService }], target: i0.ɵɵFactoryTarget.Injectable });
2288
+ AuthenticationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: AuthenticationService, providedIn: 'root' });
2289
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: AuthenticationService, decorators: [{
2290
+ type: Injectable,
2291
+ args: [{
2292
+ providedIn: 'root'
2293
+ }]
2294
+ }], ctorParameters: function () { return [{ type: ApiService }, { type: undefined, decorators: [{
2295
+ type: Inject,
2296
+ args: [APP]
2297
+ }] }, { type: TokenService }]; } });
2298
+
2299
+ class AuthenticationInterceptor {
2300
+ constructor(authenticationService) {
2301
+ this.authenticationService = authenticationService;
2302
+ }
2303
+ intercept(request, next) {
2304
+ const authentication = this.authenticationService.authentication;
2305
+ if (authentication) {
2306
+ request = this.addAuthorizationHeader(request, authentication.accessToken);
2307
+ }
2308
+ return next.handle(request).pipe(catchError((requestError) => {
2309
+ if (requestError instanceof HttpErrorResponse && requestError.status === 401) {
2310
+ if (authentication && request.url.indexOf('accounts/token/') === -1) {
2311
+ return this.authenticationService.reauthenticate().pipe(mergeMap((token) => {
2312
+ if (token && token.accessToken) {
2313
+ return next.handle(this.addAuthorizationHeader(request, token.accessToken));
2314
+ }
2315
+ return throwError(requestError);
2316
+ }));
2317
+ }
2318
+ }
2319
+ return throwError(requestError);
2320
+ }));
2321
+ }
2322
+ addAuthorizationHeader(request, token) {
2323
+ if (token) {
2324
+ return request.clone({
2325
+ setHeaders: { Authorization: `Bearer ${token}` }
2326
+ });
2327
+ }
2328
+ return request;
2329
+ }
2330
+ }
2331
+ AuthenticationInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: AuthenticationInterceptor, deps: [{ token: AuthenticationService }], target: i0.ɵɵFactoryTarget.Injectable });
2332
+ AuthenticationInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: AuthenticationInterceptor });
2333
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: AuthenticationInterceptor, decorators: [{
2334
+ type: Injectable
2335
+ }], ctorParameters: function () { return [{ type: AuthenticationService }]; } });
2336
+
2337
+ const REDIRECT_PARAM_NAME = 'next';
2338
+
2339
+ const GRANT_TOKEN_PATH = 'api/v3/accounts/user-token/';
2340
+ class AuthenticatedGuard {
2341
+ constructor(domain, authenticationService) {
2342
+ this.domain = domain;
2343
+ this.authenticationService = authenticationService;
2344
+ }
2345
+ canActivate(route, state) {
2346
+ if (!this.authenticationService.isAuthenticated) {
2347
+ const params = new HttpParams().set(REDIRECT_PARAM_NAME, state.url);
2348
+ const request = new HttpRequest('GET', this.domain + GRANT_TOKEN_PATH, {
2349
+ params
2350
+ });
2351
+ window.location.href = request.urlWithParams;
2352
+ return false;
2353
+ }
2354
+ return true;
2355
+ }
2356
+ }
2357
+ AuthenticatedGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: AuthenticatedGuard, deps: [{ token: DOMAIN }, { token: AuthenticationService }], target: i0.ɵɵFactoryTarget.Injectable });
2358
+ AuthenticatedGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: AuthenticatedGuard, providedIn: 'root' });
2359
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: AuthenticatedGuard, decorators: [{
2360
+ type: Injectable,
2361
+ args: [{
2362
+ providedIn: 'root'
2363
+ }]
2364
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
2365
+ type: Inject,
2366
+ args: [DOMAIN]
2367
+ }] }, { type: AuthenticationService }]; } });
2368
+
2369
+ class HandleGrantTokenGuard {
2370
+ constructor(authenticationService, router) {
2371
+ this.authenticationService = authenticationService;
2372
+ this.router = router;
2373
+ }
2374
+ canActivate(route) {
2375
+ return this.authenticationService.authenticateByToken(route.params['code']).pipe(map(() => {
2376
+ const redirectUrl = route.queryParamMap.get(REDIRECT_PARAM_NAME);
2377
+ return this.authenticationService.isAuthenticated && redirectUrl
2378
+ ? this.router.parseUrl(redirectUrl)
2379
+ : false;
2380
+ }));
2381
+ }
2382
+ }
2383
+ HandleGrantTokenGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: HandleGrantTokenGuard, deps: [{ token: AuthenticationService }, { token: i2.Router }], target: i0.ɵɵFactoryTarget.Injectable });
2384
+ HandleGrantTokenGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: HandleGrantTokenGuard, providedIn: 'root' });
2385
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: HandleGrantTokenGuard, decorators: [{
2386
+ type: Injectable,
2387
+ args: [{
2388
+ providedIn: 'root'
2389
+ }]
2390
+ }], ctorParameters: function () { return [{ type: AuthenticationService }, { type: i2.Router }]; } });
2391
+
2392
+ class DataAccessModule {
2393
+ static forRoot(config) {
2394
+ return {
2395
+ ngModule: DataAccessModule,
2396
+ providers: [
2397
+ { provide: APP, useValue: config.app },
2398
+ { provide: DOMAIN, useValue: config.domain },
2399
+ { provide: HTTP_INTERCEPTORS, useClass: AuthenticationInterceptor, multi: true }
2400
+ ]
2401
+ };
2402
+ }
2403
+ }
2404
+ DataAccessModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: DataAccessModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2405
+ DataAccessModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.11", ngImport: i0, type: DataAccessModule, imports: [HttpClientModule] });
2406
+ DataAccessModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: DataAccessModule, imports: [HttpClientModule] });
2407
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.11", ngImport: i0, type: DataAccessModule, decorators: [{
2408
+ type: NgModule,
2409
+ args: [{
2410
+ imports: [HttpClientModule]
2411
+ }]
2412
+ }] });
2413
+
2414
+ /*
2415
+ * Public API Surface of data-access
2416
+ */
2417
+
2418
+ /**
2419
+ * Generated bundle index. Do not edit.
2420
+ */
2421
+
2422
+ export { APP, Activity, ActivityExtraMember, ActivityInvite, ActivityLocation, ActivityService, ActivitySettings, ActivityType, Auth, AuthMember, AuthSection, AuthService, AuthTeam, AuthTeamSection, AuthenticatedGuard, Authentication, AuthenticationInterceptor, AuthenticationService, Calendar, CalendarEvent, Card, CardDeal, CardLogo, CardLogoUrls, CardMemberTicket, CardTheme, CardTicket, CardTicketLocation, Club, ClubImage, ClubSection, ClubService, ClubTeam, Collection, ConstantService, Contact, CreditCard, DataAccessModule, Directory, Email, EmailRecipient, EmailService, Event, ExternalLink, ExternalLinkService, FileObject, FileService, GeneralImage, Giro, HandleGrantTokenGuard, HomeTeam, ImageUrls, InvoiceService, Member, MemberActivityInvite, MemberAttribute, MemberCard, MemberCardService, MemberContact, MemberFee, MemberFunction, MemberInvoice, MemberInvoiceRow, MemberPublicForm, MemberPublicFormService, MemberService, MemberTeam, MemberTeamThrough, MemberValidationSettings, News, NewsService, Partner, PaymentAttempt, PaymentAttemptService, Role, SearchClub, SearchMember, SearchMemberCard, SearchMemberInvoice, SearchMemberTeam, Section, SectionService, SectionTeam, Swish, SwishQrCode, TeamService, Token, TokenService, USER_NOTIFICATIONS_PATH, UnpaidMemberInvoice, User, UserNotification, UserNotificationService, UserService, Zimpler };
2423
+ //# sourceMappingURL=myclub_se-data-access.mjs.map