@daffodil/cart 0.38.9 → 0.39.3

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 (430) hide show
  1. package/bundles/daffodil-cart-driver-in-memory.umd.js +111 -1202
  2. package/bundles/daffodil-cart-driver-in-memory.umd.js.map +1 -1
  3. package/bundles/daffodil-cart-driver-in-memory.umd.min.js +1 -1
  4. package/bundles/daffodil-cart-driver-in-memory.umd.min.js.map +1 -1
  5. package/bundles/daffodil-cart-driver-magento-testing.umd.js +12 -177
  6. package/bundles/daffodil-cart-driver-magento-testing.umd.js.map +1 -1
  7. package/bundles/daffodil-cart-driver-magento-testing.umd.min.js +1 -1
  8. package/bundles/daffodil-cart-driver-magento-testing.umd.min.js.map +1 -1
  9. package/bundles/daffodil-cart-driver-magento.umd.js +164 -1661
  10. package/bundles/daffodil-cart-driver-magento.umd.js.map +1 -1
  11. package/bundles/daffodil-cart-driver-magento.umd.min.js +1 -1
  12. package/bundles/daffodil-cart-driver-magento.umd.min.js.map +1 -1
  13. package/bundles/daffodil-cart-driver-testing.umd.js +23 -375
  14. package/bundles/daffodil-cart-driver-testing.umd.js.map +1 -1
  15. package/bundles/daffodil-cart-driver-testing.umd.min.js +1 -1
  16. package/bundles/daffodil-cart-driver-testing.umd.min.js.map +1 -1
  17. package/bundles/daffodil-cart-driver.umd.js +29 -466
  18. package/bundles/daffodil-cart-driver.umd.js.map +1 -1
  19. package/bundles/daffodil-cart-driver.umd.min.js +16 -1
  20. package/bundles/daffodil-cart-driver.umd.min.js.map +1 -1
  21. package/bundles/daffodil-cart-routing.umd.js +43 -518
  22. package/bundles/daffodil-cart-routing.umd.js.map +1 -1
  23. package/bundles/daffodil-cart-routing.umd.min.js +1 -1
  24. package/bundles/daffodil-cart-routing.umd.min.js.map +1 -1
  25. package/bundles/daffodil-cart-state-testing.umd.js +6 -241
  26. package/bundles/daffodil-cart-state-testing.umd.js.map +1 -1
  27. package/bundles/daffodil-cart-state-testing.umd.min.js +2 -2
  28. package/bundles/daffodil-cart-state-testing.umd.min.js.map +1 -1
  29. package/bundles/daffodil-cart-state.umd.js +656 -4198
  30. package/bundles/daffodil-cart-state.umd.js.map +1 -1
  31. package/bundles/daffodil-cart-state.umd.min.js +1 -1
  32. package/bundles/daffodil-cart-state.umd.min.js.map +1 -1
  33. package/bundles/daffodil-cart-testing.umd.js +13 -187
  34. package/bundles/daffodil-cart-testing.umd.js.map +1 -1
  35. package/bundles/daffodil-cart-testing.umd.min.js +1 -1
  36. package/bundles/daffodil-cart-testing.umd.min.js.map +1 -1
  37. package/bundles/daffodil-cart.umd.js +43 -271
  38. package/bundles/daffodil-cart.umd.js.map +1 -1
  39. package/bundles/daffodil-cart.umd.min.js +3 -2
  40. package/bundles/daffodil-cart.umd.min.js.map +1 -1
  41. package/driver/in-memory/package.json +1 -1
  42. package/driver/magento/package.json +1 -1
  43. package/driver/magento/testing/package.json +1 -1
  44. package/driver/package.json +1 -1
  45. package/driver/testing/package.json +1 -1
  46. package/esm2015/daffodil-cart.js +2 -7
  47. package/esm2015/driver/daffodil-cart-driver.js +2 -7
  48. package/esm2015/driver/errors/cart-not-found.js +1 -13
  49. package/esm2015/driver/errors/codes.enum.js +12 -18
  50. package/esm2015/driver/errors/expired-payment-token.js +1 -15
  51. package/esm2015/driver/errors/invalid-api-response.js +1 -15
  52. package/esm2015/driver/errors/invalid-country.js +1 -13
  53. package/esm2015/driver/errors/invalid-coupon-code.js +1 -16
  54. package/esm2015/driver/errors/invalid-region.js +1 -13
  55. package/esm2015/driver/errors/map.js +1 -7
  56. package/esm2015/driver/errors/product-not-found.js +1 -13
  57. package/esm2015/driver/errors/product-out-of-stock.js +1 -13
  58. package/esm2015/driver/errors/public_api.js +1 -6
  59. package/esm2015/driver/in-memory/backend/cart/cart.service.js +7 -65
  60. package/esm2015/driver/in-memory/backend/cart-address/cart-address.service.js +5 -39
  61. package/esm2015/driver/in-memory/backend/cart-billing-address/cart-billing-address.service.js +7 -53
  62. package/esm2015/driver/in-memory/backend/cart-coupon/cart-coupon.service.js +10 -85
  63. package/esm2015/driver/in-memory/backend/cart-items/cart-items.service.js +21 -169
  64. package/esm2015/driver/in-memory/backend/cart-order/cart-order.service.js +5 -22
  65. package/esm2015/driver/in-memory/backend/cart-payment/cart-payment.service.js +9 -67
  66. package/esm2015/driver/in-memory/backend/cart-payment-methods/cart-payment-methods.service.js +5 -27
  67. package/esm2015/driver/in-memory/backend/cart-root.service.js +4 -119
  68. package/esm2015/driver/in-memory/backend/cart-shipping-address/cart-shipping-address.service.js +7 -53
  69. package/esm2015/driver/in-memory/backend/cart-shipping-information/cart-shipping-information.service.js +9 -68
  70. package/esm2015/driver/in-memory/backend/cart-shipping-methods/cart-shipping-methods.service.js +5 -38
  71. package/esm2015/driver/in-memory/backend/public_api.js +1 -6
  72. package/esm2015/driver/in-memory/daffodil-cart-driver-in-memory.js +2 -7
  73. package/esm2015/driver/in-memory/drivers/cart/cart.service.js +4 -48
  74. package/esm2015/driver/in-memory/drivers/cart-address/cart-address.service.js +3 -28
  75. package/esm2015/driver/in-memory/drivers/cart-billing-address/cart-billing-address.service.js +3 -32
  76. package/esm2015/driver/in-memory/drivers/cart-coupon/cart-coupon.service.js +3 -41
  77. package/esm2015/driver/in-memory/drivers/cart-driver.module.js +1 -9
  78. package/esm2015/driver/in-memory/drivers/cart-item/cart-item.service.js +3 -48
  79. package/esm2015/driver/in-memory/drivers/cart-order/cart-order.service.js +3 -28
  80. package/esm2015/driver/in-memory/drivers/cart-payment/cart-payment.service.js +3 -42
  81. package/esm2015/driver/in-memory/drivers/cart-payment-methods/cart-payment-methods.service.js +3 -27
  82. package/esm2015/driver/in-memory/drivers/cart-shipping-address/cart-shipping-address.service.js +3 -32
  83. package/esm2015/driver/in-memory/drivers/cart-shipping-information/cart-shipping-information.service.js +3 -36
  84. package/esm2015/driver/in-memory/drivers/cart-shipping-methods/cart-shipping-methods.service.js +3 -27
  85. package/esm2015/driver/in-memory/drivers/public_api.js +1 -6
  86. package/esm2015/driver/in-memory/index.js +2 -7
  87. package/esm2015/driver/in-memory/injection-tokens/extra-attributes-hook.token.js +2 -16
  88. package/esm2015/driver/in-memory/injection-tokens/public_api.js +1 -6
  89. package/esm2015/driver/in-memory/public_api.js +4 -9
  90. package/esm2015/driver/index.js +2 -7
  91. package/esm2015/driver/interfaces/cart-address-service.interface.js +1 -22
  92. package/esm2015/driver/interfaces/cart-billing-address-service.interface.js +1 -28
  93. package/esm2015/driver/interfaces/cart-coupon-service.interface.js +1 -41
  94. package/esm2015/driver/interfaces/cart-item-service.interface.js +1 -50
  95. package/esm2015/driver/interfaces/cart-order-service.interface.js +1 -22
  96. package/esm2015/driver/interfaces/cart-payment-methods-service.interface.js +1 -21
  97. package/esm2015/driver/interfaces/cart-payment-service.interface.js +1 -42
  98. package/esm2015/driver/interfaces/cart-service.interface.js +1 -42
  99. package/esm2015/driver/interfaces/cart-shipping-address-service.interface.js +1 -28
  100. package/esm2015/driver/interfaces/cart-shipping-information-service.interface.js +1 -36
  101. package/esm2015/driver/interfaces/cart-shipping-methods-service.interface.js +1 -21
  102. package/esm2015/driver/interfaces/public_api.js +1 -6
  103. package/esm2015/driver/magento/cart-address.service.js +5 -71
  104. package/esm2015/driver/magento/cart-billing-address.service.js +7 -93
  105. package/esm2015/driver/magento/cart-coupon.service.js +6 -75
  106. package/esm2015/driver/magento/cart-driver.module.js +1 -9
  107. package/esm2015/driver/magento/cart-item.service.js +10 -126
  108. package/esm2015/driver/magento/cart-order.service.js +5 -33
  109. package/esm2015/driver/magento/cart-payment-methods.service.js +4 -43
  110. package/esm2015/driver/magento/cart-payment.service.js +7 -115
  111. package/esm2015/driver/magento/cart-shipping-address.service.js +7 -93
  112. package/esm2015/driver/magento/cart-shipping-information.service.js +8 -87
  113. package/esm2015/driver/magento/cart-shipping-methods.service.js +4 -43
  114. package/esm2015/driver/magento/cart.service.js +6 -84
  115. package/esm2015/driver/magento/daffodil-cart-driver-magento.js +2 -7
  116. package/esm2015/driver/magento/errors/codes.js +6 -12
  117. package/esm2015/driver/magento/errors/map.js +1 -8
  118. package/esm2015/driver/magento/errors/transform.js +2 -19
  119. package/esm2015/driver/magento/index.js +2 -7
  120. package/esm2015/driver/magento/injection-tokens/cart-mutation-queue.token.js +2 -11
  121. package/esm2015/driver/magento/injection-tokens/fragments/cart.js +2 -11
  122. package/esm2015/driver/magento/injection-tokens/public_api.js +1 -6
  123. package/esm2015/driver/magento/models/public_api.js +3 -8
  124. package/esm2015/driver/magento/models/requests/billing-address.js +2 -20
  125. package/esm2015/driver/magento/models/requests/cart-address.js +2 -32
  126. package/esm2015/driver/magento/models/requests/cart-item-update.js +2 -16
  127. package/esm2015/driver/magento/models/requests/cart-item.js +2 -32
  128. package/esm2015/driver/magento/models/requests/payment-method.js +2 -16
  129. package/esm2015/driver/magento/models/requests/public_api.js +2 -7
  130. package/esm2015/driver/magento/models/requests/shipping-address.js +2 -18
  131. package/esm2015/driver/magento/models/requests/shipping-method.js +2 -16
  132. package/esm2015/driver/magento/models/responses/cart-address.js +2 -32
  133. package/esm2015/driver/magento/models/responses/cart-coupon.js +2 -14
  134. package/esm2015/driver/magento/models/responses/cart-item.js +7 -70
  135. package/esm2015/driver/magento/models/responses/cart-payment-method.js +2 -20
  136. package/esm2015/driver/magento/models/responses/cart-shipping-method.js +2 -22
  137. package/esm2015/driver/magento/models/responses/cart.js +2 -31
  138. package/esm2015/driver/magento/models/responses/public_api.js +2 -7
  139. package/esm2015/driver/magento/models/responses/shipping-address.js +2 -16
  140. package/esm2015/driver/magento/public_api.js +5 -10
  141. package/esm2015/driver/magento/queries/add-cart-item.js +3 -13
  142. package/esm2015/driver/magento/queries/apply-coupon.js +3 -13
  143. package/esm2015/driver/magento/queries/create-cart.js +1 -7
  144. package/esm2015/driver/magento/queries/fragments/available-payment-method.js +1 -7
  145. package/esm2015/driver/magento/queries/fragments/available-shipping-method.js +1 -7
  146. package/esm2015/driver/magento/queries/fragments/cart-address.js +1 -7
  147. package/esm2015/driver/magento/queries/fragments/cart-coupon.js +1 -7
  148. package/esm2015/driver/magento/queries/fragments/cart-item.js +1 -8
  149. package/esm2015/driver/magento/queries/fragments/cart-totals.js +1 -7
  150. package/esm2015/driver/magento/queries/fragments/cart.js +1 -7
  151. package/esm2015/driver/magento/queries/fragments/money.js +1 -7
  152. package/esm2015/driver/magento/queries/fragments/prices.js +1 -7
  153. package/esm2015/driver/magento/queries/fragments/public_api.js +1 -6
  154. package/esm2015/driver/magento/queries/fragments/selected-payment-method.js +1 -7
  155. package/esm2015/driver/magento/queries/fragments/selected-shipping-method.js +1 -7
  156. package/esm2015/driver/magento/queries/get-billing-address.js +3 -13
  157. package/esm2015/driver/magento/queries/get-cart.js +3 -13
  158. package/esm2015/driver/magento/queries/get-selected-payment-method.js +3 -13
  159. package/esm2015/driver/magento/queries/get-selected-shipping-method.js +3 -13
  160. package/esm2015/driver/magento/queries/get-shipping-address.js +3 -13
  161. package/esm2015/driver/magento/queries/list-cart-coupons.js +3 -13
  162. package/esm2015/driver/magento/queries/list-cart-items.js +3 -13
  163. package/esm2015/driver/magento/queries/list-payment-methods.js +3 -13
  164. package/esm2015/driver/magento/queries/list-shipping-methods.js +3 -13
  165. package/esm2015/driver/magento/queries/place-order.js +1 -7
  166. package/esm2015/driver/magento/queries/public_api.js +3 -8
  167. package/esm2015/driver/magento/queries/remove-all-coupons.js +3 -13
  168. package/esm2015/driver/magento/queries/remove-cart-item.js +3 -13
  169. package/esm2015/driver/magento/queries/responses/add-cart-item.js +2 -14
  170. package/esm2015/driver/magento/queries/responses/apply-coupon.js +2 -14
  171. package/esm2015/driver/magento/queries/responses/create-cart.js +2 -14
  172. package/esm2015/driver/magento/queries/responses/get-billing-address.js +2 -14
  173. package/esm2015/driver/magento/queries/responses/get-cart.js +2 -16
  174. package/esm2015/driver/magento/queries/responses/get-selected-payment-method.js +2 -14
  175. package/esm2015/driver/magento/queries/responses/get-selected-shipping-method.js +2 -14
  176. package/esm2015/driver/magento/queries/responses/get-shipping-address.js +2 -14
  177. package/esm2015/driver/magento/queries/responses/list-cart-coupons.js +2 -14
  178. package/esm2015/driver/magento/queries/responses/list-cart-items.js +2 -14
  179. package/esm2015/driver/magento/queries/responses/list-payment-methods.js +2 -14
  180. package/esm2015/driver/magento/queries/responses/list-shipping-methods.js +2 -14
  181. package/esm2015/driver/magento/queries/responses/place-order.js +2 -14
  182. package/esm2015/driver/magento/queries/responses/public_api.js +2 -7
  183. package/esm2015/driver/magento/queries/responses/remove-all-coupons.js +2 -14
  184. package/esm2015/driver/magento/queries/responses/remove-cart-item.js +2 -14
  185. package/esm2015/driver/magento/queries/responses/set-guest-email.js +2 -14
  186. package/esm2015/driver/magento/queries/responses/set-selected-payment-method-with-billing-and-email.js +2 -18
  187. package/esm2015/driver/magento/queries/responses/set-selected-payment-method-with-billing.js +2 -16
  188. package/esm2015/driver/magento/queries/responses/set-selected-payment-method.js +2 -14
  189. package/esm2015/driver/magento/queries/responses/set-selected-shipping-method.js +2 -14
  190. package/esm2015/driver/magento/queries/responses/update-address-with-email.js +2 -18
  191. package/esm2015/driver/magento/queries/responses/update-address.js +2 -16
  192. package/esm2015/driver/magento/queries/responses/update-billing-address-with-email.js +2 -16
  193. package/esm2015/driver/magento/queries/responses/update-billing-address.js +2 -14
  194. package/esm2015/driver/magento/queries/responses/update-cart-item.js +2 -14
  195. package/esm2015/driver/magento/queries/responses/update-shipping-address-with-email.js +2 -16
  196. package/esm2015/driver/magento/queries/responses/update-shipping-address.js +2 -14
  197. package/esm2015/driver/magento/queries/set-selected-payment-method-with-billing-and-email.js +3 -13
  198. package/esm2015/driver/magento/queries/set-selected-payment-method-with-billing.js +3 -13
  199. package/esm2015/driver/magento/queries/set-selected-payment-method.js +3 -13
  200. package/esm2015/driver/magento/queries/set-selected-shipping-method.js +3 -13
  201. package/esm2015/driver/magento/queries/update-address-with-email.js +3 -13
  202. package/esm2015/driver/magento/queries/update-address.js +3 -13
  203. package/esm2015/driver/magento/queries/update-billing-address-with-email.js +3 -13
  204. package/esm2015/driver/magento/queries/update-billing-address.js +3 -13
  205. package/esm2015/driver/magento/queries/update-cart-item.js +3 -13
  206. package/esm2015/driver/magento/queries/update-shipping-address-with-email.js +3 -13
  207. package/esm2015/driver/magento/queries/update-shipping-address.js +3 -13
  208. package/esm2015/driver/magento/testing/daffodil-cart-driver-magento-testing.js +2 -7
  209. package/esm2015/driver/magento/testing/factories/cart-address-input.factory.js +2 -29
  210. package/esm2015/driver/magento/testing/factories/cart-address.factory.js +2 -31
  211. package/esm2015/driver/magento/testing/factories/cart-coupon.factory.js +2 -11
  212. package/esm2015/driver/magento/testing/factories/cart-item/bundle-cart-item.factory.js +2 -13
  213. package/esm2015/driver/magento/testing/factories/cart-item/cart-item.factory.js +2 -32
  214. package/esm2015/driver/magento/testing/factories/cart-item/configurable-cart-item.factory.js +2 -13
  215. package/esm2015/driver/magento/testing/factories/cart-payment-method.factory.js +2 -15
  216. package/esm2015/driver/magento/testing/factories/cart-shipping-method.factory.js +2 -23
  217. package/esm2015/driver/magento/testing/factories/cart.factory.js +2 -33
  218. package/esm2015/driver/magento/testing/factories/public_api.js +1 -6
  219. package/esm2015/driver/magento/testing/factories/shipping-address.factory.js +2 -15
  220. package/esm2015/driver/magento/testing/index.js +2 -7
  221. package/esm2015/driver/magento/testing/public_api.js +2 -7
  222. package/esm2015/driver/magento/transforms/inputs/billing-address.service.js +2 -21
  223. package/esm2015/driver/magento/transforms/inputs/cart-address.service.js +2 -11
  224. package/esm2015/driver/magento/transforms/inputs/cart-item-input-transformers.js +2 -23
  225. package/esm2015/driver/magento/transforms/inputs/cart-item-update.service.js +2 -11
  226. package/esm2015/driver/magento/transforms/inputs/payment-method.service.js +2 -11
  227. package/esm2015/driver/magento/transforms/inputs/shipping-address.service.js +2 -21
  228. package/esm2015/driver/magento/transforms/inputs/shipping-method.service.js +2 -11
  229. package/esm2015/driver/magento/transforms/outputs/billing-address.service.js +3 -19
  230. package/esm2015/driver/magento/transforms/outputs/cart-address.service.js +3 -9
  231. package/esm2015/driver/magento/transforms/outputs/cart-coupon-response.service.js +3 -24
  232. package/esm2015/driver/magento/transforms/outputs/cart-coupon.js +1 -10
  233. package/esm2015/driver/magento/transforms/outputs/cart-item/bundle-cart-item-transformer.js +2 -12
  234. package/esm2015/driver/magento/transforms/outputs/cart-item/cart-item-transformer.js +4 -10
  235. package/esm2015/driver/magento/transforms/outputs/cart-item/configurable-cart-item-transformer.js +2 -12
  236. package/esm2015/driver/magento/transforms/outputs/cart-item/simple-cart-item-transformer.js +4 -14
  237. package/esm2015/driver/magento/transforms/outputs/cart-payment.service.js +3 -9
  238. package/esm2015/driver/magento/transforms/outputs/cart-shipping-information.service.js +6 -20
  239. package/esm2015/driver/magento/transforms/outputs/cart-shipping-rate.service.js +3 -9
  240. package/esm2015/driver/magento/transforms/outputs/cart-totals-transformer.js +4 -31
  241. package/esm2015/driver/magento/transforms/outputs/cart.service.js +5 -98
  242. package/esm2015/driver/magento/transforms/outputs/shipping-address.service.js +3 -19
  243. package/esm2015/driver/magento/transforms/public_api.js +1 -6
  244. package/esm2015/driver/public_api.js +3 -8
  245. package/esm2015/driver/testing/daffodil-cart-driver-testing.js +2 -7
  246. package/esm2015/driver/testing/drivers/cart/cart.service.js +3 -34
  247. package/esm2015/driver/testing/drivers/cart-address/cart-address.service.js +3 -29
  248. package/esm2015/driver/testing/drivers/cart-billing-address/cart-billing-address.service.js +3 -33
  249. package/esm2015/driver/testing/drivers/cart-coupon/cart-coupon.service.js +3 -42
  250. package/esm2015/driver/testing/drivers/cart-driver.module.js +1 -9
  251. package/esm2015/driver/testing/drivers/cart-item/cart-item.service.js +3 -49
  252. package/esm2015/driver/testing/drivers/cart-order/cart-order.service.js +3 -13
  253. package/esm2015/driver/testing/drivers/cart-payment/cart-payment.service.js +3 -43
  254. package/esm2015/driver/testing/drivers/cart-payment-methods/cart-payment-methods.service.js +3 -22
  255. package/esm2015/driver/testing/drivers/cart-shipping-address/cart-shipping-address.service.js +3 -33
  256. package/esm2015/driver/testing/drivers/cart-shipping-information/cart-shipping-information.service.js +3 -37
  257. package/esm2015/driver/testing/drivers/cart-shipping-methods/cart-shipping-methods.service.js +3 -22
  258. package/esm2015/driver/testing/drivers/public_api.js +1 -6
  259. package/esm2015/driver/testing/index.js +2 -7
  260. package/esm2015/driver/testing/public_api.js +2 -7
  261. package/esm2015/errors/codes.enum.js +10 -12
  262. package/esm2015/errors/map.js +1 -7
  263. package/esm2015/errors/public_api.js +2 -7
  264. package/esm2015/errors/resolution/cart-not-found-or-created-resolution.js +2 -14
  265. package/esm2015/errors/resolution/cart-resolution.js +2 -14
  266. package/esm2015/errors/resolution/cart-server-side-resolution.js +2 -14
  267. package/esm2015/errors/resolution/cart-storage-resolution.js +2 -14
  268. package/esm2015/errors/resolution/public_api.js +1 -6
  269. package/esm2015/index.js +2 -7
  270. package/esm2015/injection-tokens/error-matcher.token.js +2 -11
  271. package/esm2015/injection-tokens/payment-method-map.js +3 -12
  272. package/esm2015/injection-tokens/public_api.js +1 -6
  273. package/esm2015/models/cart-address.js +2 -23
  274. package/esm2015/models/cart-coupon.js +2 -31
  275. package/esm2015/models/cart-item-input.js +10 -93
  276. package/esm2015/models/cart-item.js +2 -88
  277. package/esm2015/models/cart-order-result.js +2 -29
  278. package/esm2015/models/cart-payment.js +2 -25
  279. package/esm2015/models/cart-shipping-info.js +2 -14
  280. package/esm2015/models/cart-shipping-rate.js +2 -43
  281. package/esm2015/models/cart-total.js +13 -41
  282. package/esm2015/models/cart.js +2 -76
  283. package/esm2015/models/composite-cart-item.js +2 -40
  284. package/esm2015/models/configurable-cart-item.js +2 -35
  285. package/esm2015/models/public_api.js +7 -12
  286. package/esm2015/public_api.js +4 -9
  287. package/esm2015/routing/cart-routing.module.js +2 -11
  288. package/esm2015/routing/config/config.js +4 -23
  289. package/esm2015/routing/config/resolution/config.js +1 -21
  290. package/esm2015/routing/daffodil-cart-routing.js +2 -7
  291. package/esm2015/routing/guards/billing-address/billing-address-guard-redirect.token.js +1 -7
  292. package/esm2015/routing/guards/billing-address/billing-address.guard.js +5 -39
  293. package/esm2015/routing/guards/cart-items/cart-items-guard-redirect.token.js +2 -8
  294. package/esm2015/routing/guards/cart-items/cart-items.guard.js +6 -44
  295. package/esm2015/routing/guards/order-result/order-result-guard-redirect.token.js +1 -7
  296. package/esm2015/routing/guards/order-result/order-result.guard.js +4 -38
  297. package/esm2015/routing/guards/payment-method/payment-method-guard-redirect.token.js +1 -7
  298. package/esm2015/routing/guards/payment-method/payment-method.guard.js +5 -39
  299. package/esm2015/routing/guards/public_api.js +1 -6
  300. package/esm2015/routing/guards/resolved-cart/resolved-cart.guard.js +7 -49
  301. package/esm2015/routing/guards/shipping-address/shipping-address-guard-redirect.token.js +1 -7
  302. package/esm2015/routing/guards/shipping-address/shipping-address.guard.js +5 -39
  303. package/esm2015/routing/guards/shipping-method/shipping-method-guard-redirect.token.js +1 -7
  304. package/esm2015/routing/guards/shipping-method/shipping-method.guard.js +5 -39
  305. package/esm2015/routing/index.js +2 -7
  306. package/esm2015/routing/public_api.js +3 -8
  307. package/esm2015/routing/resolvers/cart-resolver.service.js +5 -49
  308. package/esm2015/routing/resolvers/empty-cart-resolver.service.js +4 -42
  309. package/esm2015/routing/resolvers/public_api.js +1 -6
  310. package/esm2015/routing/resolvers/tokens/cart-resolver-redirect.token.js +1 -7
  311. package/esm2015/routing/resolvers/tokens/empty-cart-resolver-redirect.token.js +1 -7
  312. package/esm2015/state/actions/cart-address.actions.js +8 -40
  313. package/esm2015/state/actions/cart-billing-address.actions.js +11 -66
  314. package/esm2015/state/actions/cart-coupon.actions.js +17 -124
  315. package/esm2015/state/actions/cart-item.actions.js +22 -186
  316. package/esm2015/state/actions/cart-order.actions.js +8 -40
  317. package/esm2015/state/actions/cart-payment-methods.actions.js +8 -34
  318. package/esm2015/state/actions/cart-payment.actions.js +19 -133
  319. package/esm2015/state/actions/cart-shipping-address.actions.js +11 -66
  320. package/esm2015/state/actions/cart-shipping-information.actions.js +14 -100
  321. package/esm2015/state/actions/cart-shipping-methods.actions.js +8 -36
  322. package/esm2015/state/actions/cart.actions.js +22 -162
  323. package/esm2015/state/actions/public_api.js +12 -17
  324. package/esm2015/state/cart-state.module.js +1 -6
  325. package/esm2015/state/daffodil-cart-state.js +2 -7
  326. package/esm2015/state/effects/cart-address.effects.js +3 -60
  327. package/esm2015/state/effects/cart-billing-address.effects.js +3 -67
  328. package/esm2015/state/effects/cart-coupon.effects.js +9 -129
  329. package/esm2015/state/effects/cart-item.effects.js +6 -120
  330. package/esm2015/state/effects/cart-order.effects.js +3 -62
  331. package/esm2015/state/effects/cart-payment-methods.effects.js +2 -52
  332. package/esm2015/state/effects/cart-payment.effects.js +5 -93
  333. package/esm2015/state/effects/cart-resolver.effects.js +4 -80
  334. package/esm2015/state/effects/cart-shipping-address.effects.js +3 -67
  335. package/esm2015/state/effects/cart-shipping-information.effects.js +4 -82
  336. package/esm2015/state/effects/cart-shipping-methods.effects.js +2 -52
  337. package/esm2015/state/effects/cart.effects.js +9 -128
  338. package/esm2015/state/facades/cart/cart-facade.interface.js +2 -355
  339. package/esm2015/state/facades/cart/cart.facade.js +10 -275
  340. package/esm2015/state/index.js +2 -7
  341. package/esm2015/state/injection-tokens/cart-item-state-debounce-time.js +1 -7
  342. package/esm2015/state/injection-tokens/public_api.js +1 -6
  343. package/esm2015/state/models/public_api.js +4 -9
  344. package/esm2015/state/models/stateful-cart-item.js +9 -27
  345. package/esm2015/state/models/stateful-composite-cart-item.js +2 -10
  346. package/esm2015/state/models/stateful-configurable-cart-item.js +2 -10
  347. package/esm2015/state/public_api.js +6 -11
  348. package/esm2015/state/reducers/action-types.type.js +2 -6
  349. package/esm2015/state/reducers/cart/cart.reducer.js +1 -15
  350. package/esm2015/state/reducers/cart-billing-address/cart-billing-address.reducer.js +1 -15
  351. package/esm2015/state/reducers/cart-coupon/cart-coupon.reducer.js +1 -15
  352. package/esm2015/state/reducers/cart-initial-state.js +1 -7
  353. package/esm2015/state/reducers/cart-item/cart-item.reducer.js +3 -21
  354. package/esm2015/state/reducers/cart-item-entities/cart-item-entities-reducer-adapter.js +4 -22
  355. package/esm2015/state/reducers/cart-item-entities/cart-item-entities.reducer.js +12 -58
  356. package/esm2015/state/reducers/cart-operation-type.enum.js +16 -17
  357. package/esm2015/state/reducers/cart-order/cart-order-initial-state.js +1 -7
  358. package/esm2015/state/reducers/cart-order/cart-order-state.interface.js +2 -19
  359. package/esm2015/state/reducers/cart-order/cart-order.reducer.js +1 -12
  360. package/esm2015/state/reducers/cart-payment/cart-payment.reducer.js +1 -15
  361. package/esm2015/state/reducers/cart-payment-methods/cart-payment-methods.reducer.js +1 -15
  362. package/esm2015/state/reducers/cart-reducers-state.interface.js +1 -28
  363. package/esm2015/state/reducers/cart-reducers.js +1 -7
  364. package/esm2015/state/reducers/cart-resolve/cart-resolve-state.enum.js +9 -15
  365. package/esm2015/state/reducers/cart-resolve/cart-resolve.reducer.js +1 -12
  366. package/esm2015/state/reducers/cart-shipping-address/cart-shipping-address.reducer.js +1 -15
  367. package/esm2015/state/reducers/cart-shipping-information/cart-shipping-information.reducer.js +7 -17
  368. package/esm2015/state/reducers/cart-shipping-methods/cart-shipping-methods.reducer.js +1 -15
  369. package/esm2015/state/reducers/cart-state.interface.js +2 -21
  370. package/esm2015/state/reducers/cart-store-feature-key.js +1 -7
  371. package/esm2015/state/reducers/cart.reducer.js +1 -11
  372. package/esm2015/state/reducers/errors/cart-errors.type.js +2 -6
  373. package/esm2015/state/reducers/errors/error-state-helpers.js +5 -29
  374. package/esm2015/state/reducers/loading/cart-loading.type.js +3 -42
  375. package/esm2015/state/reducers/public_api.js +3 -8
  376. package/esm2015/state/reducers/token/extra.token.js +5 -21
  377. package/esm2015/state/reducers/token/public_api.js +1 -6
  378. package/esm2015/state/reducers/token/reducers.token.js +4 -13
  379. package/esm2015/state/selectors/cart/cart.selector.js +98 -811
  380. package/esm2015/state/selectors/cart-feature.selector.js +5 -28
  381. package/esm2015/state/selectors/cart-item-entities/cart-item-entities.selectors.js +29 -229
  382. package/esm2015/state/selectors/cart-order/cart-order.selector.js +15 -104
  383. package/esm2015/state/selectors/cart.selector.js +6 -30
  384. package/esm2015/state/selectors/public_api.js +2 -7
  385. package/esm2015/state/testing/cart-testing.module.js +1 -6
  386. package/esm2015/state/testing/daffodil-cart-state-testing.js +2 -7
  387. package/esm2015/state/testing/factories/stateful-cart-item.factory.js +2 -11
  388. package/esm2015/state/testing/factories/stateful-composite-cart-item.factory.js +2 -11
  389. package/esm2015/state/testing/factories/stateful-configurable-cart-item.factory.js +2 -11
  390. package/esm2015/state/testing/index.js +2 -7
  391. package/esm2015/state/testing/mock-cart-facade.js +2 -206
  392. package/esm2015/state/testing/public_api.js +4 -9
  393. package/esm2015/storage/cart-storage.service.js +2 -36
  394. package/esm2015/testing/daffodil-cart-testing.js +2 -7
  395. package/esm2015/testing/factories/cart-address.factory.js +2 -41
  396. package/esm2015/testing/factories/cart-coupon.factory.js +2 -17
  397. package/esm2015/testing/factories/cart-item/cart-item.factory.js +5 -51
  398. package/esm2015/testing/factories/cart-item/composite-cart-item.factory.js +2 -23
  399. package/esm2015/testing/factories/cart-item/configurable-cart-item.factory.js +2 -13
  400. package/esm2015/testing/factories/cart-payment.factory.js +2 -11
  401. package/esm2015/testing/factories/cart-shipping-rate.factory.js +2 -23
  402. package/esm2015/testing/factories/cart.factory.js +2 -35
  403. package/esm2015/testing/factories/public_api.js +4 -9
  404. package/esm2015/testing/index.js +2 -7
  405. package/esm2015/testing/public_api.js +2 -7
  406. package/fesm2015/daffodil-cart-driver-in-memory.js +108 -1228
  407. package/fesm2015/daffodil-cart-driver-in-memory.js.map +1 -1
  408. package/fesm2015/daffodil-cart-driver-magento-testing.js +12 -227
  409. package/fesm2015/daffodil-cart-driver-magento-testing.js.map +1 -1
  410. package/fesm2015/daffodil-cart-driver-magento.js +161 -1844
  411. package/fesm2015/daffodil-cart-driver-magento.js.map +1 -1
  412. package/fesm2015/daffodil-cart-driver-testing.js +24 -376
  413. package/fesm2015/daffodil-cart-driver-testing.js.map +1 -1
  414. package/fesm2015/daffodil-cart-driver.js +13 -493
  415. package/fesm2015/daffodil-cart-driver.js.map +1 -1
  416. package/fesm2015/daffodil-cart-routing.js +44 -498
  417. package/fesm2015/daffodil-cart-routing.js.map +1 -1
  418. package/fesm2015/daffodil-cart-state-testing.js +6 -256
  419. package/fesm2015/daffodil-cart-state-testing.js.map +1 -1
  420. package/fesm2015/daffodil-cart-state.js +403 -3921
  421. package/fesm2015/daffodil-cart-state.js.map +1 -1
  422. package/fesm2015/daffodil-cart-testing.js +13 -228
  423. package/fesm2015/daffodil-cart-testing.js.map +1 -1
  424. package/fesm2015/daffodil-cart.js +39 -532
  425. package/fesm2015/daffodil-cart.js.map +1 -1
  426. package/package.json +5 -5
  427. package/routing/package.json +1 -1
  428. package/state/package.json +1 -1
  429. package/state/testing/package.json +1 -1
  430. package/testing/package.json +1 -1
@@ -1,2 +1,2 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@ngrx/store"),require("@ngrx/entity"),require("@daffodil/core/state"),require("@angular/core"),require("@daffodil/cart"),require("@daffodil/core"),require("@daffodil/geography"),require("@ngrx/effects"),require("rxjs"),require("rxjs/operators"),require("@daffodil/cart/driver")):"function"==typeof define&&define.amd?define("@daffodil/cart/state",["exports","@ngrx/store","@ngrx/entity","@daffodil/core/state","@angular/core","@daffodil/cart","@daffodil/core","@daffodil/geography","@ngrx/effects","rxjs","rxjs/operators","@daffodil/cart/driver"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).daffodil=t.daffodil||{},t.daffodil.cart=t.daffodil.cart||{},t.daffodil.cart.state={}),t.i1,t.entity,t.state,t.ng.core,t.daffodil.cart,t.core,t.geography,t.effects,t.rxjs,t.rxjs.operators,t.daffodil.cart.driver)}(this,(function(t,e,r,a,i,n,o,s,c,p,d,u){"use strict";var l={CartStorageFailureAction:"[DaffCart] Cart Storage Failure Action",CartLoadAction:"[DaffCart] Cart Load Action",CartLoadSuccessAction:"[DaffCart] Cart Load Success Action",CartLoadFailureAction:"[DaffCart] Cart Load Failure Action",CartCreateAction:"[DaffCart] Cart Create Action",CartCreateSuccessAction:"[DaffCart] Cart Create Success Action",CartCreateFailureAction:"[DaffCart] Cart Create Failure Action",AddToCartAction:"[DaffCart] Cart Add To Cart Action",AddToCartSuccessAction:"[DaffCart] Cart Add to Cart Success Action",AddToCartFailureAction:"[DaffCart] Cart Add to Cart Failure Action",CartClearAction:"[DaffCart] Cart Reset Action",CartClearSuccessAction:"[DaffCart] Cart Reset Success Action",CartClearFailureAction:"[DaffCart] Cart Reset Failure Action",ResolveCartAction:"[DaffCart] Resolve Cart Action",ResolveCartSuccessAction:"[DaffCart] Resolve Cart Success Action",ResolveCartServerSideAction:"[DaffCart] Resolve Cart Server Side Action",ResolveCartFailureAction:"[DaffCart] Resolve Cart Failure Action"},f=function(t){this.payload=t,this.type=l.CartStorageFailureAction};var C=function(){this.type=l.CartLoadAction};var h=function(t){this.payload=t,this.type=l.CartLoadSuccessAction};var g=function(t){this.payload=t,this.type=l.CartLoadFailureAction};var A=function(){this.type=l.CartCreateAction};var m=function(t){this.payload=t,this.type=l.CartCreateSuccessAction};var y=function(t){this.payload=t,this.type=l.CartCreateFailureAction};var S=function(t){this.payload=t,this.type=l.AddToCartAction};var v=function(t){this.payload=t,this.type=l.AddToCartSuccessAction};var I=function(t){this.payload=t,this.type=l.AddToCartFailureAction};var b=function(){this.type=l.CartClearAction};var O=function(t){this.payload=t,this.type=l.CartClearSuccessAction};var D=function(t){this.payload=t,this.type=l.CartClearFailureAction};var j=function(){this.type=l.ResolveCartAction};var M=function(t){this.payload=t,this.type=l.ResolveCartSuccessAction};var R=function(t){this.payload=t,this.type=l.ResolveCartFailureAction};var F=function(t){this.payload=t,this.type=l.ResolveCartServerSideAction};var L={CartItemListAction:"[DaffCart] Cart Items List Action",CartItemListSuccessAction:"[DaffCart] Cart Items List Success Action",CartItemListFailureAction:"[DaffCart] Cart Items List Failure Action",CartItemLoadAction:"[DaffCart] Cart Item Load Action",CartItemLoadSuccessAction:"[DaffCart] Cart Item Load Success Action",CartItemLoadFailureAction:"[DaffCart] Cart Item Load Failure Action",CartItemUpdateAction:"[DaffCart] Cart Item Update Action",CartItemUpdateSuccessAction:"[DaffCart] Cart Item Update Success Action",CartItemUpdateFailureAction:"[DaffCart] Cart Item Update Failure Action",CartItemAddAction:"[DaffCart] Cart Item Add Action",CartItemAddSuccessAction:"[DaffCart] Cart Item Add Success Action",CartItemAddFailureAction:"[DaffCart] Cart Item Add Failure Action",CartItemDeleteAction:"[DaffCart] Cart Item Remove Action",CartItemDeleteSuccessAction:"[DaffCart] Cart Item Remove Success Action",CartItemDeleteFailureAction:"[DaffCart] Cart Item Remove Failure Action",CartItemStateResetAction:"[DaffCart] Cart Item State Reset Action"},$=function(){this.type=L.CartItemListAction};var E=function(t){this.payload=t,this.type=L.CartItemListSuccessAction};var P=function(t){this.payload=t,this.type=L.CartItemListFailureAction};var T=function(t){this.itemId=t,this.type=L.CartItemLoadAction};var w=function(t){this.payload=t,this.type=L.CartItemLoadSuccessAction};var U=function(t,e){this.payload=t,this.itemId=e,this.type=L.CartItemLoadFailureAction};var _=function(t,e){this.itemId=t,this.changes=e,this.type=L.CartItemUpdateAction};var B=function(t,e){this.payload=t,this.itemId=e,this.type=L.CartItemUpdateSuccessAction};var x=function(t,e){this.payload=t,this.itemId=e,this.type=L.CartItemUpdateFailureAction};var W=function(t){this.input=t,this.type=L.CartItemAddAction};var H=function(t){this.payload=t,this.type=L.CartItemAddSuccessAction};var z=function(t){this.payload=t,this.type=L.CartItemAddFailureAction};var q=function(t){this.itemId=t,this.type=L.CartItemDeleteAction};var k=function(t){this.payload=t,this.type=L.CartItemDeleteSuccessAction};var N=function(t,e){this.payload=t,this.itemId=e,this.type=L.CartItemDeleteFailureAction};var V=function(){this.type=L.CartItemStateResetAction};var Q={CartBillingAddressLoadAction:"[DaffCart] Billing Address Load Action",CartBillingAddressLoadSuccessAction:"[DaffCart] Billing Address Load Success Action",CartBillingAddressLoadFailureAction:"[DaffCart] Billing Address Load Failure Action",CartBillingAddressUpdateAction:"[DaffCart] Billing Address Update Action",CartBillingAddressUpdateSuccessAction:"[DaffCart] Billing Address Update Success Action",CartBillingAddressUpdateFailureAction:"[DaffCart] Billing Address Update Failure Action"},G=function(){this.type=Q.CartBillingAddressLoadAction};var X=function(t){this.payload=t,this.type=Q.CartBillingAddressLoadSuccessAction};var Y=function(t){this.payload=t,this.type=Q.CartBillingAddressLoadFailureAction};var K=function(t){this.payload=t,this.type=Q.CartBillingAddressUpdateAction};var J=function(t){this.payload=t,this.type=Q.CartBillingAddressUpdateSuccessAction};var Z=function(t){this.payload=t,this.type=Q.CartBillingAddressUpdateFailureAction};var tt={CartShippingAddressLoadAction:"[DaffCart] Shipping Address Load Action",CartShippingAddressLoadSuccessAction:"[DaffCart] Shipping Address Load Success Action",CartShippingAddressLoadFailureAction:"[DaffCart] Shipping Address Load Failure Action",CartShippingAddressUpdateAction:"[DaffCart] Shipping Address Update Action",CartShippingAddressUpdateSuccessAction:"[DaffCart] Shipping Address Update Success Action",CartShippingAddressUpdateFailureAction:"[DaffCart] Shipping Address Update Failure Action"},et=function(){this.type=tt.CartShippingAddressLoadAction};var rt=function(t){this.payload=t,this.type=tt.CartShippingAddressLoadSuccessAction};var at=function(t){this.payload=t,this.type=tt.CartShippingAddressLoadFailureAction};var it=function(t){this.payload=t,this.type=tt.CartShippingAddressUpdateAction};var nt=function(t){this.payload=t,this.type=tt.CartShippingAddressUpdateSuccessAction};var ot=function(t){this.payload=t,this.type=tt.CartShippingAddressUpdateFailureAction};var st={CartAddressUpdateAction:"[DaffCart] Cart Address Update Action",CartAddressUpdateSuccessAction:"[DaffCart] Cart Address Update Success Action",CartAddressUpdateFailureAction:"[DaffCart] Cart Address Update Failure Action"},ct=function(t){this.payload=t,this.type=st.CartAddressUpdateAction};var pt=function(t){this.payload=t,this.type=st.CartAddressUpdateSuccessAction};var dt=function(t){this.payload=t,this.type=st.CartAddressUpdateFailureAction};var ut={CartShippingInformationLoadAction:"[DaffCart] Shipping Information Load Action",CartShippingInformationLoadSuccessAction:"[DaffCart] Shipping Information Load Success Action",CartShippingInformationLoadFailureAction:"[DaffCart] Shipping Information Load Failure Action",CartShippingInformationUpdateAction:"[DaffCart] Shipping Information Update Action",CartShippingInformationUpdateSuccessAction:"[DaffCart] Shipping Information Update Success Action",CartShippingInformationUpdateFailureAction:"[DaffCart] Shipping Information Update Failure Action",CartShippingInformationDeleteAction:"[DaffCart] Shipping Information Remove Action",CartShippingInformationDeleteSuccessAction:"[DaffCart] Shipping Information Remove Success Action",CartShippingInformationDeleteFailureAction:"[DaffCart] Shipping Information Remove Failure Action"},lt=function(){this.type=ut.CartShippingInformationLoadAction};var ft=function(t){this.payload=t,this.type=ut.CartShippingInformationLoadSuccessAction};var Ct=function(t){this.payload=t,this.type=ut.CartShippingInformationLoadFailureAction};var ht=function(t){this.payload=t,this.type=ut.CartShippingInformationUpdateAction};var gt=function(t){this.payload=t,this.type=ut.CartShippingInformationUpdateSuccessAction};var At=function(t){this.payload=t,this.type=ut.CartShippingInformationUpdateFailureAction};var mt=function(t){this.id=t,this.type=ut.CartShippingInformationDeleteAction};var yt=function(t){this.payload=t,this.type=ut.CartShippingInformationDeleteSuccessAction};var St=function(t){this.payload=t,this.type=ut.CartShippingInformationDeleteFailureAction};var vt={CartShippingMethodsLoadAction:"[DaffCart] Shipping Methods Load Action",CartShippingMethodsLoadSuccessAction:"[DaffCart] Shipping Methods Load Success Action",CartShippingMethodsLoadFailureAction:"[DaffCart] Shipping Methods Load Failure Action"},It=function(){this.type=vt.CartShippingMethodsLoadAction};var bt=function(t){this.payload=t,this.type=vt.CartShippingMethodsLoadSuccessAction};var Ot=function(t){this.payload=t,this.type=vt.CartShippingMethodsLoadFailureAction};var Dt={CartPaymentLoadAction:"[DaffCart] Payment Load Action",CartPaymentLoadSuccessAction:"[DaffCart] Payment Load Success Action",CartPaymentLoadFailureAction:"[DaffCart] Payment Load Failure Action",CartPaymentUpdateAction:"[DaffCart] Payment Update Action",CartPaymentUpdateSuccessAction:"[DaffCart] Payment Update Success Action",CartPaymentUpdateFailureAction:"[DaffCart] Payment Update Failure Action",CartPaymentUpdateWithBillingAction:"[DaffCart] Payment Update With Billing Action",CartPaymentUpdateWithBillingSuccessAction:"[DaffCart] Payment Update With Billing Success Action",CartPaymentUpdateWithBillingFailureAction:"[DaffCart] Payment Update With Billing Failure Action",CartPaymentRemoveAction:"[DaffCart] Payment Remove Action",CartPaymentRemoveSuccessAction:"[DaffCart] Payment Remove Success Action",CartPaymentRemoveFailureAction:"[DaffCart] Payment Remove Failure Action",CartPaymentMethodAddAction:"[DaffCart] Payment Method Add Action"},jt=function(){this.type=Dt.CartPaymentLoadAction};var Mt=function(t){this.payload=t,this.type=Dt.CartPaymentLoadSuccessAction};var Rt=function(t){this.payload=t,this.type=Dt.CartPaymentLoadFailureAction};var Ft=function(t){this.payload=t,this.type=Dt.CartPaymentUpdateAction};var Lt=function(t){this.payload=t,this.type=Dt.CartPaymentUpdateSuccessAction};var $t=function(t){this.payload=t,this.type=Dt.CartPaymentUpdateFailureAction};var Et=function(t,e){this.payment=t,this.address=e,this.type=Dt.CartPaymentUpdateWithBillingAction};var Pt=function(t){this.payload=t,this.type=Dt.CartPaymentUpdateWithBillingSuccessAction};var Tt=function(t){this.payload=t,this.type=Dt.CartPaymentUpdateWithBillingFailureAction};var wt=function(){this.type=Dt.CartPaymentRemoveAction};var Ut=function(){this.type=Dt.CartPaymentRemoveSuccessAction};var _t=function(t){this.payload=t,this.type=Dt.CartPaymentRemoveFailureAction};var Bt=function(t){this.payload=t,this.type=Dt.CartPaymentMethodAddAction};var xt={CartPaymentMethodsLoadAction:"[DaffCart] Payment Methods Load Action",CartPaymentMethodsLoadSuccessAction:"[DaffCart] Payment Methods Load Success Action",CartPaymentMethodsLoadFailureAction:"[DaffCart] Payment Methods Load Failure Action"},Wt=function(){this.type=xt.CartPaymentMethodsLoadAction};var Ht=function(t){this.payload=t,this.type=xt.CartPaymentMethodsLoadSuccessAction};var zt=function(t){this.payload=t,this.type=xt.CartPaymentMethodsLoadFailureAction};var qt={CartPlaceOrderAction:"[DaffCart] Cart Place Order Action",CartPlaceOrderSuccessAction:"[DaffCart] Cart Place Order Success Action",CartPlaceOrderFailureAction:"[DaffCart] Cart Place Order Failure Action"},kt=function(t){this.payload=t,this.type=qt.CartPlaceOrderAction};var Nt=function(t){this.payload=t,this.type=qt.CartPlaceOrderSuccessAction};var Vt=function(t){this.payload=t,this.type=qt.CartPlaceOrderFailureAction};var Qt={CartCouponApplyAction:"[DaffCart] Cart Coupon Apply Action",CartCouponApplySuccessAction:"[DaffCart] Cart Coupon Apply Success Action",CartCouponApplyFailureAction:"[DaffCart] Cart Coupon Apply Failure Action",CartCouponListAction:"[DaffCart] Cart Coupon List Action",CartCouponListSuccessAction:"[DaffCart] Cart Coupon List Success Action",CartCouponListFailureAction:"[DaffCart] Cart Coupon List Failure Action",CartCouponRemoveAction:"[DaffCart] Cart Coupon Remove Action",CartCouponRemoveSuccessAction:"[DaffCart] Cart Coupon Remove Success Action",CartCouponRemoveFailureAction:"[DaffCart] Cart Coupon Remove Failure Action",CartCouponRemoveAllAction:"[DaffCart] Cart Coupon Remove All Action",CartCouponRemoveAllSuccessAction:"[DaffCart] Cart Coupon Remove All Success Action",CartCouponRemoveAllFailureAction:"[DaffCart] Cart Coupon Remove All Failure Action"},Gt=function(t){this.payload=t,this.type=Qt.CartCouponApplyAction};var Xt=function(t){this.payload=t,this.type=Qt.CartCouponApplySuccessAction};var Yt=function(t){this.payload=t,this.type=Qt.CartCouponApplyFailureAction};var Kt=function(){this.type=Qt.CartCouponListAction};var Jt=function(t){this.payload=t,this.type=Qt.CartCouponListSuccessAction};var Zt=function(t){this.payload=t,this.type=Qt.CartCouponListFailureAction};var te=function(t){this.payload=t,this.type=Qt.CartCouponRemoveAction};var ee=function(t){this.payload=t,this.type=Qt.CartCouponRemoveSuccessAction};var re=function(t){this.payload=t,this.type=Qt.CartCouponRemoveFailureAction};var ae=function(){this.type=Qt.CartCouponRemoveAllAction};var ie=function(t){this.payload=t,this.type=Qt.CartCouponRemoveAllSuccessAction};var ne=function(t){this.payload=t,this.type=Qt.CartCouponRemoveAllFailureAction};var oe,se={New:"new",Updated:"updated",Mutating:"mutating",Error:"error",Default:"default"},ce=function(){return oe=oe||r.createEntityAdapter({selectId:function(t){return t.id}})};function pe(t,e){void 0===t&&(t=ce().getInitialState());var r,a,i,n,o=ce();switch(e.type){case L.CartItemListSuccessAction:return o.setAll(e.payload.map((function(e){return Object.assign(Object.assign({},e),{daffState:de(t.entities[e.id])||se.Default})})),t);case L.CartItemLoadSuccessAction:return o.upsertOne(Object.assign(Object.assign({},e.payload),{daffState:de(t.entities[e.payload.id])||se.Default}),t);case L.CartItemAddSuccessAction:return o.setAll((n=t.entities,e.payload.items.map((function(t){var e=n[t.id];switch(!0){case!e:return Object.assign(Object.assign({},t),{daffState:se.New});case(null==e?void 0:e.qty)!==t.qty:return Object.assign(Object.assign({},t),{daffState:se.Updated});default:return t}}))),t);case L.CartItemUpdateSuccessAction:return o.setAll((r=e.payload.items,a=t.entities,i=e.itemId,r.map((function(t){return t.id===i?Object.assign(Object.assign({},t),{daffState:se.Updated}):Object.assign(Object.assign({},t),{daffState:de(a[t.id])||se.Default})}))),t);case L.CartItemDeleteFailureAction:case L.CartItemLoadFailureAction:case L.CartItemUpdateFailureAction:return o.upsertOne(Object.assign(Object.assign({},t.entities[e.itemId]),{daffState:se.Error}),t);case L.CartItemDeleteSuccessAction:case l.CartLoadSuccessAction:case l.ResolveCartSuccessAction:case l.CartClearSuccessAction:return o.setAll(e.payload.items.map((function(e){return Object.assign(Object.assign({},e),{daffState:de(t.entities[e.id])||se.Default})})),t);case L.CartItemStateResetAction:return o.setAll(Object.keys(t.entities).map((function(e){return Object.assign(Object.assign({},t.entities[e]),{daffState:se.Default})})),t);case L.CartItemUpdateAction:case L.CartItemDeleteAction:return o.upsertOne(Object.assign(Object.assign({},t.entities[e.itemId]),{daffState:se.Mutating}),t);default:return t}}function de(t){return null==t?void 0:t.daffState}function ue(t,e,r,a){var i,n=arguments.length,o=n<3?e:null===a?a=Object.getOwnPropertyDescriptor(e,r):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,r,a);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(o=(n<3?i(o):n>3?i(e,r,o):i(e,r))||o);return n>3&&o&&Object.defineProperty(e,r,o),o}function le(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}Object.create;function fe(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var a,i,n=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(a=n.next()).done;)o.push(a.value)}catch(t){i={error:t}}finally{try{a&&!a.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return o}function Ce(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(fe(arguments[e]));return t}Object.create;var he={cartOrderResult:{id:null,orderId:null,cartId:null},loading:"Stable",errors:[]};function ge(t,e){switch(void 0===t&&(t=he),e.type){case qt.CartPlaceOrderAction:return Object.assign(Object.assign({},t),{loading:"Mutating"});case qt.CartPlaceOrderSuccessAction:return Object.assign(Object.assign({},t),{errors:[],loading:"Stable",cartOrderResult:e.payload});case qt.CartPlaceOrderFailureAction:return Object.assign(Object.assign({},t),{loading:"Stable",errors:Ce(t.errors,[e.payload])});default:return t}}var Ae,me,ye={Cart:"Cart",Item:"Item",BillingAddress:"Billing Address",ShippingAddress:"Shipping Address",Payment:"Payment",PaymentMethods:"Payment Methods",ShippingInformation:"Shipping Information",ShippingMethods:"Shipping Methods",Coupon:"Coupon"},Se={Default:"default",Resolving:"resolving",Succeeded:"succeeded",Failed:"failed",ServerSide:"server"},ve=Object.freeze({cart:{id:null,subtotal:null,grand_total:null,coupons:[],items:[],billing_address:null,shipping_address:null,payment:null,totals:[],shipping_information:null,available_shipping_methods:[],available_payment_methods:[]},loading:(Ae={},Ae[ye.Cart]="Stable",Ae[ye.Item]="Stable",Ae[ye.ShippingAddress]="Stable",Ae[ye.BillingAddress]="Stable",Ae[ye.ShippingInformation]="Stable",Ae[ye.ShippingMethods]="Stable",Ae[ye.Payment]="Stable",Ae[ye.PaymentMethods]="Stable",Ae[ye.Coupon]="Stable",Ae),errors:(me={},me[ye.Cart]=[],me[ye.Item]=[],me[ye.ShippingAddress]=[],me[ye.BillingAddress]=[],me[ye.ShippingInformation]=[],me[ye.ShippingMethods]=[],me[ye.Payment]=[],me[ye.PaymentMethods]=[],me[ye.Coupon]=[],me),resolved:Se.Default}),Ie=function(t){return function(e,r){var a;return{errors:Object.assign(Object.assign({},e),(a={},a[t]=e[t].concat(new Array(r)),a))}}},be=function(t){return function(e){var r;return{errors:Object.assign(Object.assign({},e),(r={},r[t]=[],r))}}};var Oe=function(t){return function(e,r){var a;return{loading:Object.assign(Object.assign({},e),(a={},a[t]=r,a))}}},De=Ie(ye.BillingAddress),je=be(ye.BillingAddress),Me=Oe(ye.BillingAddress);function Re(t,e){switch(void 0===t&&(t=ve),e.type){case Q.CartBillingAddressLoadAction:return Object.assign(Object.assign({},t),Me(t.loading,"Resolving"));case Q.CartBillingAddressUpdateAction:case st.CartAddressUpdateAction:return Object.assign(Object.assign({},t),Me(t.loading,"Mutating"));case Q.CartBillingAddressLoadSuccessAction:return Object.assign(Object.assign(Object.assign(Object.assign({},t),je(t.errors)),{cart:Object.assign(Object.assign({},t.cart),{billing_address:e.payload})}),Me(t.loading,"Stable"));case Q.CartBillingAddressUpdateSuccessAction:case st.CartAddressUpdateSuccessAction:return Object.assign(Object.assign(Object.assign(Object.assign({},t),je(t.errors)),{cart:Object.assign(Object.assign({},t.cart),e.payload)}),Me(t.loading,"Stable"));case Q.CartBillingAddressLoadFailureAction:case Q.CartBillingAddressUpdateFailureAction:case st.CartAddressUpdateFailureAction:return Object.assign(Object.assign(Object.assign({},t),De(t.errors,e.payload)),Me(t.loading,"Stable"));default:return t}}var Fe=Ie(ye.Coupon),Le=be(ye.Coupon),$e=Oe(ye.Coupon);function Ee(t,e){switch(void 0===t&&(t=ve),e.type){case Qt.CartCouponListAction:return Object.assign(Object.assign({},t),$e(t.loading,"Resolving"));case Qt.CartCouponApplyAction:case Qt.CartCouponRemoveAction:case Qt.CartCouponRemoveAllAction:return Object.assign(Object.assign({},t),$e(t.loading,"Mutating"));case Qt.CartCouponApplySuccessAction:case Qt.CartCouponRemoveSuccessAction:case Qt.CartCouponRemoveAllSuccessAction:return Object.assign(Object.assign(Object.assign(Object.assign({},t),Le(t.errors)),{cart:Object.assign(Object.assign({},t.cart),e.payload)}),$e(t.loading,"Stable"));case Qt.CartCouponListSuccessAction:return Object.assign(Object.assign(Object.assign(Object.assign({},t),Le(t.errors)),{cart:Object.assign(Object.assign({},t.cart),{coupons:e.payload})}),$e(t.loading,"Stable"));case Qt.CartCouponApplyFailureAction:case Qt.CartCouponListFailureAction:case Qt.CartCouponRemoveAllFailureAction:case Qt.CartCouponRemoveFailureAction:return Object.assign(Object.assign(Object.assign({},t),Fe(t.errors,e.payload)),$e(t.loading,"Stable"));default:return t}}var Pe=Ie(ye.Item),Te=be(ye.Item),we=Oe(ye.Item);function Ue(t,e){switch(void 0===t&&(t=ve),e.type){case L.CartItemListAction:case L.CartItemLoadAction:return Object.assign(Object.assign({},t),we(t.loading,"Resolving"));case L.CartItemAddAction:return Object.assign(Object.assign({},t),we(t.loading,"Adding"));case L.CartItemListSuccessAction:return Object.assign(Object.assign(Object.assign(Object.assign({},t),Te(t.errors)),{cart:Object.assign(Object.assign({},t.cart),{items:e.payload})}),we(t.loading,"Stable"));case L.CartItemLoadSuccessAction:return Object.assign(Object.assign(Object.assign(Object.assign({},t),Te(t.errors)),{cart:Object.assign(Object.assign({},t.cart),{items:t.cart.items.map((function(t){return t.id===e.payload.id?e.payload:t}))})}),we(t.loading,"Stable"));case L.CartItemUpdateSuccessAction:case L.CartItemAddSuccessAction:case L.CartItemDeleteSuccessAction:return Object.assign(Object.assign(Object.assign(Object.assign({},t),Te(t.errors)),{cart:Object.assign(Object.assign({},t.cart),e.payload)}),we(t.loading,"Stable"));case L.CartItemListFailureAction:case L.CartItemLoadFailureAction:case L.CartItemUpdateFailureAction:case L.CartItemAddFailureAction:case L.CartItemDeleteFailureAction:return Object.assign(Object.assign(Object.assign({},t),Pe(t.errors,e.payload)),we(t.loading,"Stable"));default:return t}}var _e=Ie(ye.PaymentMethods),Be=be(ye.PaymentMethods),xe=Oe(ye.PaymentMethods);function We(t,e){switch(void 0===t&&(t=ve),e.type){case xt.CartPaymentMethodsLoadAction:return Object.assign(Object.assign({},t),xe(t.loading,"Resolving"));case xt.CartPaymentMethodsLoadSuccessAction:return Object.assign(Object.assign(Object.assign(Object.assign({},t),Be(t.errors)),{cart:Object.assign(Object.assign({},t.cart),{available_payment_methods:e.payload})}),xe(t.loading,"Stable"));case xt.CartPaymentMethodsLoadFailureAction:return Object.assign(Object.assign(Object.assign({},t),_e(t.errors,e.payload)),xe(t.loading,"Stable"));default:return t}}var He=Ie(ye.Payment),ze=be(ye.Payment),qe=Oe(ye.Payment);function ke(t,e){switch(void 0===t&&(t=ve),e.type){case Dt.CartPaymentLoadAction:return Object.assign(Object.assign({},t),qe(t.loading,"Resolving"));case Dt.CartPaymentUpdateAction:case Dt.CartPaymentUpdateWithBillingAction:case Dt.CartPaymentRemoveAction:return Object.assign(Object.assign({},t),qe(t.loading,"Mutating"));case Dt.CartPaymentLoadSuccessAction:return Object.assign(Object.assign(Object.assign(Object.assign({},t),ze(t.errors)),{cart:Object.assign(Object.assign({},t.cart),{payment:e.payload})}),qe(t.loading,"Stable"));case Dt.CartPaymentRemoveSuccessAction:return Object.assign(Object.assign(Object.assign(Object.assign({},t),ze(t.errors)),{cart:Object.assign(Object.assign({},t.cart),{payment:null})}),qe(t.loading,"Stable"));case Dt.CartPaymentUpdateSuccessAction:case Dt.CartPaymentUpdateWithBillingSuccessAction:return Object.assign(Object.assign(Object.assign(Object.assign({},t),ze(t.errors)),{cart:Object.assign(Object.assign({},t.cart),e.payload)}),qe(t.loading,"Stable"));case Dt.CartPaymentLoadFailureAction:case Dt.CartPaymentUpdateFailureAction:case Dt.CartPaymentUpdateWithBillingFailureAction:case Dt.CartPaymentRemoveFailureAction:return Object.assign(Object.assign(Object.assign({},t),He(t.errors,e.payload)),qe(t.loading,"Stable"));case Dt.CartPaymentMethodAddAction:return Object.assign(Object.assign({},t),{cart:Object.assign(Object.assign({},t.cart),{payment:Object.assign({},e.payload)})});default:return t}}function Ne(t,e){switch(void 0===t&&(t=ve),e.type){case l.ResolveCartAction:return Object.assign(Object.assign({},t),{resolved:Se.Resolving});case l.ResolveCartServerSideAction:return Object.assign(Object.assign({},t),{resolved:Se.ServerSide});case l.ResolveCartSuccessAction:return Object.assign(Object.assign({},t),{resolved:Se.Succeeded});case l.ResolveCartFailureAction:return Object.assign(Object.assign({},t),{resolved:Se.Failed});default:return t}}var Ve=Ie(ye.ShippingAddress),Qe=be(ye.ShippingAddress),Ge=Oe(ye.ShippingAddress);function Xe(t,e){switch(void 0===t&&(t=ve),e.type){case tt.CartShippingAddressLoadAction:return Object.assign(Object.assign({},t),Ge(t.loading,"Resolving"));case tt.CartShippingAddressUpdateAction:case st.CartAddressUpdateAction:return Object.assign(Object.assign({},t),Ge(t.loading,"Mutating"));case tt.CartShippingAddressLoadSuccessAction:return Object.assign(Object.assign(Object.assign(Object.assign({},t),Qe(t.errors)),{cart:Object.assign(Object.assign({},t.cart),{shipping_address:e.payload})}),Ge(t.loading,"Stable"));case tt.CartShippingAddressUpdateSuccessAction:case st.CartAddressUpdateSuccessAction:return Object.assign(Object.assign(Object.assign(Object.assign({},t),Qe(t.errors)),{cart:Object.assign(Object.assign({},t.cart),e.payload)}),Ge(t.loading,"Stable"));case tt.CartShippingAddressLoadFailureAction:case tt.CartShippingAddressUpdateFailureAction:case st.CartAddressUpdateFailureAction:return Object.assign(Object.assign(Object.assign({},t),Ve(t.errors,e.payload)),Ge(t.loading,"Stable"));default:return t}}var Ye=Ie(ye.ShippingInformation),Ke=be(ye.ShippingInformation),Je=Oe(ye.ShippingInformation);function Ze(t,e){switch(void 0===t&&(t=ve),e.type){case ut.CartShippingInformationLoadAction:return Object.assign(Object.assign({},t),Je(t.loading,"Resolving"));case ut.CartShippingInformationUpdateAction:case ut.CartShippingInformationDeleteAction:return Object.assign(Object.assign({},t),Je(t.loading,"Mutating"));case ut.CartShippingInformationLoadSuccessAction:return Object.assign(Object.assign(Object.assign(Object.assign({},t),Ke(t.errors)),{cart:Object.assign(Object.assign({},t.cart),{shipping_information:Object.assign(Object.assign({},e.payload),{address_id:null})})}),Je(t.loading,"Stable"));case ut.CartShippingInformationUpdateSuccessAction:case ut.CartShippingInformationDeleteSuccessAction:return Object.assign(Object.assign(Object.assign(Object.assign({},t),Ke(t.errors)),{cart:Object.assign(Object.assign(Object.assign({},t.cart),{shipping_information:null}),e.payload)}),Je(t.loading,"Stable"));case ut.CartShippingInformationLoadFailureAction:case ut.CartShippingInformationUpdateFailureAction:case ut.CartShippingInformationDeleteFailureAction:return Object.assign(Object.assign(Object.assign({},t),Ye(t.errors,e.payload)),Je(t.loading,"Stable"));default:return t}}var tr=Ie(ye.ShippingMethods),er=be(ye.ShippingMethods),rr=Oe(ye.ShippingMethods);function ar(t,e){switch(void 0===t&&(t=ve),e.type){case vt.CartShippingMethodsLoadAction:return Object.assign(Object.assign({},t),rr(t.loading,"Resolving"));case vt.CartShippingMethodsLoadSuccessAction:return Object.assign(Object.assign(Object.assign(Object.assign({},t),er(t.errors)),{cart:Object.assign(Object.assign({},t.cart),{available_shipping_methods:e.payload})}),rr(t.loading,"Stable"));case vt.CartShippingMethodsLoadFailureAction:return Object.assign(Object.assign(Object.assign({},t),tr(t.errors,e.payload)),rr(t.loading,"Stable"));default:return t}}var ir=Ie(ye.Cart),nr=be(ye.Cart),or=Oe(ye.Cart);function sr(t,e){switch(void 0===t&&(t=ve),e.type){case l.ResolveCartAction:case l.CartLoadAction:return Object.assign(Object.assign({},t),or(t.loading,"Resolving"));case l.CartClearAction:case l.AddToCartAction:case l.CartCreateAction:return Object.assign(Object.assign({},t),or(t.loading,"Mutating"));case l.CartLoadSuccessAction:case l.CartClearSuccessAction:case l.AddToCartSuccessAction:case l.CartCreateSuccessAction:case l.ResolveCartSuccessAction:return Object.assign(Object.assign(Object.assign(Object.assign({},t),nr(t.errors)),{cart:Object.assign(Object.assign({},t.cart),e.payload)}),or(t.loading,"Stable"));case l.CartCreateSuccessAction:return Object.assign(Object.assign(Object.assign(Object.assign({},t),nr(t.errors)),{cart:Object.assign(Object.assign({},ve.cart),e.payload)}),or(t.loading,"Stable"));case l.CartLoadFailureAction:case l.CartClearFailureAction:case l.AddToCartFailureAction:case l.CartCreateFailureAction:case l.CartStorageFailureAction:case l.ResolveCartFailureAction:case l.ResolveCartServerSideAction:return Object.assign(Object.assign(Object.assign({},t),ir(t.errors,e.payload)),or(t.loading,"Stable"));default:return t}}var cr=a.daffComposeReducers([sr,Ue,Re,Xe,ar,Ze,ke,We,Ee,Ne]);function pr(t,e){return void 0===t&&(t=ve),cr(t,e)}var dr={cart:pr,cartItems:pe,order:ge},ur="daffCart",lr=new i.InjectionToken("DAFF_CART_EXTRA_REDUCERS",{factory:function(){return[]}});var fr=function(){var t;return function(){return t=t||{selectCartFeatureState:e.createFeatureSelector(ur)}}}();var Cr=function(){var t=fr().selectCartFeatureState,r=ce().getSelectors(),a=e.createSelector(t,(function(t){return t.cartItems})),i=e.createSelector(a,r.selectIds),s=e.createSelector(a,r.selectEntities),c=e.createSelector(a,r.selectAll),p=e.createSelector(a,r.selectTotal),d=e.defaultMemoize((function(t){return e.createSelector(s,(function(e){return e[t]}))})).memoized,u=e.createSelector(c,(function(t){return t.reduce((function(t,e){return t+e.qty}),0)})),l=e.defaultMemoize((function(t){return e.createSelector(d(t),(function(t){return t.type!==n.DaffCartItemInputType.Configurable?null:t.attributes}))})).memoized,f=e.defaultMemoize((function(t){return e.createSelector(d(t),(function(t){return t.type!==n.DaffCartItemInputType.Composite?null:t.options}))})).memoized,C=e.defaultMemoize((function(t){return e.createSelector(d(t),(function(t){return t?!t.in_stock:null}))})).memoized,h=e.createSelector(c,(function(t){return null==t?void 0:t.reduce((function(t,e){return t||e.daffState===se.Mutating}),!1)})),g=e.defaultMemoize((function(t){return e.createSelector(d(t),(function(t){return(null==t?void 0:t.daffState)||null}))})).memoized,A=e.defaultMemoize((function(t){return e.createSelector(d(t),(function(t){return(null==t?void 0:t.qty)||0}))})).memoized,m=e.defaultMemoize((function(t){return e.createSelector(d(t),(function(t){return(null==t?void 0:t.row_total)||0}))})).memoized,y=e.defaultMemoize((function(t){return e.createSelector(d(t),(function(t){return(null==t?void 0:t.price)||0}))})).memoized,S=e.defaultMemoize((function(t){return e.createSelector(d(t),(function(t){return(null==t?void 0:t.discounts)||[]}))})).memoized,v=e.defaultMemoize((function(t){return e.createSelector(S(t),(function(t){return(null==t?void 0:t.reduce((function(t,e){var r=e.amount;return o.daffAdd(t,r)}),0))||0}))})).memoized;return{selectCartItemEntitiesState:a,selectCartItemIds:i,selectCartItemEntities:s,selectAllCartItems:c,selectCartItemTotal:p,selectCartItem:d,selectTotalNumberOfCartItems:u,selectCartItemConfiguredAttributes:l,selectCartItemCompositeOptions:f,selectIsCartItemOutOfStock:C,selectCartItemMutating:h,selectCartItemState:g,selectCartItemPrice:y,selectCartItemRowTotal:m,selectCartItemQuantity:A,selectCartItemDiscounts:S,selectCartItemTotalDiscount:v}},hr=function(){var t;return function(){return t=t||Cr()}}();var gr=function(){var t=fr().selectCartFeatureState,r=e.createSelector(t,(function(t){return t.order})),a=e.createSelector(r,(function(t){return t.cartOrderResult})),i=e.createSelector(a,(function(t){return t.orderId})),n=e.createSelector(a,(function(t){return t.cartId}));return{selectCartOrderState:r,selectCartOrderLoading:e.createSelector(r,(function(t){return"Stable"!==t.loading})),selectCartOrderMutating:e.createSelector(r,(function(t){return"Mutating"===t.loading})),selectCartOrderErrors:e.createSelector(r,(function(t){return t.errors})),selectCartOrderValue:a,selectCartOrderId:i,selectCartOrderCartId:n,selectHasOrderResult:e.createSelector(a,(function(t){return!!(t&&t.orderId&&t.cartId)}))}},Ar=function(){var t;return function(){return t=t||gr()}}();var mr=function(){var t=fr().selectCartFeatureState,r=hr().selectCartItemMutating,a=e.createSelector(t,(function(t){return t.cart})),i=e.createSelector(a,(function(t){return t.cart})),o=e.createSelector(a,(function(t){return t.resolved})),c=e.createSelector(a,(function(t){return t.loading})),p=e.createSelector(c,(function(t){return"Stable"!==t[ye.Cart]})),d=e.createSelector(c,(function(t){return"Resolving"===t[ye.Cart]})),u=e.createSelector(c,(function(t){return"Mutating"===t[ye.Cart]})),l=e.createSelector(c,(function(t){return"Stable"!==t[ye.BillingAddress]})),f=e.createSelector(c,(function(t){return"Resolving"===t[ye.BillingAddress]})),C=e.createSelector(c,(function(t){return"Mutating"===t[ye.BillingAddress]})),h=e.createSelector(c,(function(t){return"Stable"!==t[ye.ShippingAddress]})),g=e.createSelector(c,(function(t){return"Resolving"===t[ye.ShippingAddress]})),A=e.createSelector(c,(function(t){return"Mutating"===t[ye.ShippingAddress]})),m=e.createSelector(c,(function(t){return"Stable"!==t[ye.ShippingInformation]})),y=e.createSelector(c,(function(t){return"Resolving"===t[ye.ShippingInformation]})),S=e.createSelector(c,(function(t){return"Mutating"===t[ye.ShippingInformation]})),v=e.createSelector(c,(function(t){return"Stable"!==t[ye.ShippingMethods]})),I=e.createSelector(c,(function(t){return"Resolving"===t[ye.ShippingMethods]})),b=e.createSelector(c,(function(t){return"Stable"!==t[ye.Payment]})),O=e.createSelector(c,(function(t){return"Resolving"===t[ye.Payment]})),D=e.createSelector(c,(function(t){return"Mutating"===t[ye.Payment]})),j=e.createSelector(c,(function(t){return"Stable"!==t[ye.PaymentMethods]})),M=e.createSelector(c,(function(t){return"Resolving"===t[ye.PaymentMethods]})),R=e.createSelector(c,(function(t){return"Stable"!==t[ye.Item]})),F=e.createSelector(c,(function(t){return"Adding"===t[ye.Item]})),L=e.createSelector(c,(function(t){return"Resolving"===t[ye.Item]})),$=e.createSelector(c,(function(t){return"Stable"!==t[ye.Coupon]})),E=e.createSelector(c,(function(t){return"Resolving"===t[ye.Coupon]})),P=e.createSelector(c,(function(t){return"Mutating"===t[ye.Coupon]})),T=e.createSelector(c,(function(t){return[p,l,h,m,v,b,j,$,R].map((function(e){return e.projector(t)})).reduce((function(t,e){return t||e}),!1)})),w=e.createSelector(c,(function(t){return[d,f,g,y,I,O,M,E,L].map((function(e){return e.projector(t)})).reduce((function(t,e){return t||e}),!1)})),U=e.createSelector(c,r,(function(t,e){return[u,C,A,S,D,P,F].map((function(e){return e.projector(t)})).reduce((function(t,e){return t||e}),!1)||e})),_=e.createSelector(a,(function(t){return t.errors})),B=e.createSelector(_,(function(t){return t[ye.Cart]})),x=e.createSelector(_,(function(t){return t[ye.BillingAddress]})),W=e.createSelector(_,(function(t){return t[ye.ShippingAddress]})),H=e.createSelector(_,(function(t){return t[ye.ShippingInformation]})),z=e.createSelector(_,(function(t){return t[ye.ShippingMethods]})),q=e.createSelector(_,(function(t){return t[ye.Payment]})),k=e.createSelector(_,(function(t){return t[ye.PaymentMethods]})),N=e.createSelector(_,(function(t){return t[ye.Item]})),V=e.createSelector(_,(function(t){return t[ye.Coupon]})),Q=e.createSelector(i,(function(t){return t.id})),G=e.createSelector(i,(function(t){var e=t.totals.find((function(t){return t.name===n.DaffCartTotalTypeEnum.subtotalExcludingTax}));return e?e.value:null})),X=e.createSelector(i,(function(t){var e=t.totals.find((function(t){return t.name===n.DaffCartTotalTypeEnum.grandTotal}));return e?e.value:null})),Y=e.createSelector(i,(function(t){var e=t.totals.find((function(t){return t.name===n.DaffCartTotalTypeEnum.subtotalExcludingTax}));return e?e.value:null})),K=e.createSelector(i,(function(t){var e=t.totals.find((function(t){return t.name===n.DaffCartTotalTypeEnum.subtotalIncludingTax}));return e?e.value:null})),J=e.createSelector(i,(function(t){var e=t.totals.find((function(t){return t.name===n.DaffCartTotalTypeEnum.subtotalWithDiscountExcludingTax}));return e?e.value:null})),Z=e.createSelector(i,(function(t){var e=t.totals.find((function(t){return t.name===n.DaffCartTotalTypeEnum.subtotalWithDiscountIncludingTax}));return e?e.value:null})),tt=e.createSelector(i,(function(t){var e=t.totals.find((function(t){return t.name===n.DaffCartTotalTypeEnum.tax}));return e?e.value:null})),et=e.createSelector(i,(function(t){var e=t.totals.filter((function(t){return t.name===n.DaffCartTotalTypeEnum.discount}));return e||[]})),rt=e.createSelector(i,(function(t){var e=t.totals.find((function(t){return t.name===n.DaffCartTotalTypeEnum.shipping}));return e?e.value:null})),at=e.createSelector(i,(function(t){return t.coupons})),it=e.createSelector(i,(function(t){return t.items})),nt=e.createSelector(i,(function(t){return t.items.reduce((function(t,e){return t||!e.in_stock}),!1)})),ot=e.createSelector(i,(function(t){return t.billing_address})),st=e.createSelector(i,(function(t){return t.shipping_address})),ct=e.createSelector(i,(function(t){return t.payment})),pt=e.createSelector(i,(function(t){return t.totals})),dt=e.createSelector(i,(function(t){return t.shipping_information})),ut=e.createSelector(i,(function(t){return t.available_shipping_methods})),lt=e.createSelector(i,(function(t){return t.available_payment_methods})),ft=e.createSelector(i,(function(t){return!t||!t.items||0===t.items.length})),Ct=e.createSelector(st,ot,(function(t,e){return s.daffComparePersonalAddresses(t,e)})),ht=e.createSelector(ot,(function(t){return!!t})),gt=e.createSelector(st,(function(t){return!!t})),At=e.createSelector(dt,(function(t){return!!t})),mt=e.createSelector(ct,(function(t){return!!t&&""!==t.method})),yt=e.createSelector(ft,ht,gt,At,mt,(function(t,e,r,a,i){return!t&&e&&r&&a&&i}));return{selectCartState:a,selectCartValue:i,selectCartResolved:o,selectCartLoadingObject:c,selectCartFeatureLoading:T,selectCartFeatureResolving:w,selectCartFeatureMutating:U,selectCartLoading:p,selectCartResolving:d,selectCartMutating:u,selectBillingAddressLoading:l,selectBillingAddressResolving:f,selectBillingAddressMutating:C,selectShippingAddressLoading:h,selectShippingAddressResolving:g,selectShippingAddressMutating:A,selectShippingInformationLoading:m,selectShippingInformationResolving:y,selectShippingInformationMutating:S,selectShippingMethodsLoading:v,selectShippingMethodsResolving:I,selectPaymentLoading:b,selectPaymentResolving:O,selectPaymentMutating:D,selectPaymentMethodsLoading:j,selectPaymentMethodsResolving:M,selectCouponLoading:$,selectCouponResolving:E,selectCouponMutating:P,selectItemLoading:R,selectItemAdding:F,selectItemResolving:L,selectCartErrorsObject:_,selectCartErrors:B,selectBillingAddressErrors:x,selectShippingAddressErrors:W,selectShippingInformationErrors:H,selectShippingMethodsErrors:z,selectPaymentErrors:q,selectPaymentMethodsErrors:k,selectItemErrors:N,selectCouponErrors:V,selectCartId:Q,selectCartSubtotal:G,selectCartGrandTotal:X,selectCartSubtotalExcludingTax:Y,selectCartSubtotalIncludingTax:K,selectCartSubtotalWithDiscountExcludingTax:J,selectCartSubtotalWithDiscountIncludingTax:Z,selectCartDiscountTotals:et,selectCartTotalTax:tt,selectCartShippingTotal:rt,selectCartCoupons:at,selectCartItems:it,selectCartHasOutOfStockItems:nt,selectCartBillingAddress:ot,selectCartShippingAddress:st,selectCartPayment:ct,selectCartTotals:pt,selectCartShippingInformation:dt,selectCartAvailableShippingMethods:ut,selectCartAvailablePaymentMethods:lt,selectIsCartEmpty:ft,selectIsBillingSameAsShipping:Ct,selectHasBillingAddress:ht,selectHasShippingAddress:gt,selectHasShippingMethod:At,selectHasPaymentMethod:mt,selectCanPlaceOrder:yt}},yr=function(){var t;return function(){return t=t||mr()}}();var Sr=function(){return Object.assign(Object.assign(Object.assign(Object.assign({},fr()),Ar()),yr()),hr())},vr=function(){var t;return function(){return t=t||Sr()}}(),Ir=new i.InjectionToken("DaffCartItemStateDebounceTime"),br=function(t,e,r,a){var i=this;this.actions$=t,this.errorMatcher=e,this.driver=r,this.storage=a,this.update$=this.actions$.pipe(c.ofType(st.CartAddressUpdateAction),d.switchMap((function(t){return p.of(null).pipe(d.map((function(){return i.storage.getCartId()})),d.switchMap((function(e){return i.driver.update(e,t.payload)})),d.map((function(t){return new pt(t)})),d.catchError((function(t){return p.of(t instanceof o.DaffStorageServiceError?new f(i.errorMatcher(t)):new dt(i.errorMatcher(t)))})))})))};br.decorators=[{type:i.Injectable}],br.ctorParameters=function(){return[{type:c.Actions},{type:void 0,decorators:[{type:i.Inject,args:[n.DAFF_CART_ERROR_MATCHER]}]},{type:void 0,decorators:[{type:i.Inject,args:[u.DaffCartAddressDriver]}]},{type:n.DaffCartStorageService}]},ue([c.Effect(),le("design:type",Object)],br.prototype,"update$",void 0);var Or=function(t,e,r,a){var i=this;this.actions$=t,this.errorMatcher=e,this.driver=r,this.storage=a,this.get$=this.actions$.pipe(c.ofType(Q.CartBillingAddressLoadAction),d.switchMap((function(t){return i.driver.get(i.storage.getCartId()).pipe(d.map((function(t){return new X(t)})),d.catchError((function(t){return p.of(new Y(i.errorMatcher(t)))})))}))),this.update$=this.actions$.pipe(c.ofType(Q.CartBillingAddressUpdateAction),d.switchMap((function(t){return i.driver.update(i.storage.getCartId(),t.payload).pipe(d.map((function(t){return new J(t)})),d.catchError((function(t){return p.of(new Z(i.errorMatcher(t)))})))})))};Or.decorators=[{type:i.Injectable}],Or.ctorParameters=function(){return[{type:c.Actions},{type:void 0,decorators:[{type:i.Inject,args:[n.DAFF_CART_ERROR_MATCHER]}]},{type:void 0,decorators:[{type:i.Inject,args:[u.DaffCartBillingAddressDriver]}]},{type:n.DaffCartStorageService}]},ue([c.Effect(),le("design:type",Object)],Or.prototype,"get$",void 0),ue([c.Effect(),le("design:type",Object)],Or.prototype,"update$",void 0);var Dr=function(t,e,r,a){var i=this;this.actions$=t,this.errorMatcher=e,this.driver=r,this.storage=a,this.apply$=this.actions$.pipe(c.ofType(Qt.CartCouponApplyAction),d.switchMap((function(t){return p.of(null).pipe(d.map((function(){return i.storage.getCartId()})),d.switchMap((function(e){return i.driver.apply(e,t.payload)})),d.map((function(t){return new Xt(t)})),d.catchError((function(t){return p.of(t instanceof o.DaffStorageServiceError?new f(i.errorMatcher(t)):new Yt(i.errorMatcher(t)))})))}))),this.list$=this.actions$.pipe(c.ofType(Qt.CartCouponListAction),d.switchMap((function(t){return p.of(null).pipe(d.map((function(){return i.storage.getCartId()})),d.switchMap((function(t){return i.driver.list(t)})),d.map((function(t){return new Jt(t)})),d.catchError((function(t){return p.of(t instanceof o.DaffStorageServiceError?new f(i.errorMatcher(t)):new Zt(i.errorMatcher(t)))})))}))),this.remove$=this.actions$.pipe(c.ofType(Qt.CartCouponRemoveAction),d.switchMap((function(t){return p.of(null).pipe(d.map((function(){return i.storage.getCartId()})),d.switchMap((function(e){return i.driver.remove(e,t.payload)})),d.map((function(t){return new ee(t)})),d.catchError((function(t){return p.of(t instanceof o.DaffStorageServiceError?new f(i.errorMatcher(t)):new re(i.errorMatcher(t)))})))}))),this.removeAll$=this.actions$.pipe(c.ofType(Qt.CartCouponRemoveAllAction),d.switchMap((function(t){return p.of(null).pipe(d.map((function(){return i.storage.getCartId()})),d.switchMap((function(t){return i.driver.removeAll(t)})),d.map((function(t){return new ie(t)})),d.catchError((function(t){return p.of(t instanceof o.DaffStorageServiceError?new f(i.errorMatcher(t)):new ne(i.errorMatcher(t)))})))})))};Dr.decorators=[{type:i.Injectable}],Dr.ctorParameters=function(){return[{type:c.Actions},{type:void 0,decorators:[{type:i.Inject,args:[n.DAFF_CART_ERROR_MATCHER]}]},{type:void 0,decorators:[{type:i.Inject,args:[u.DaffCartCouponDriver]}]},{type:n.DaffCartStorageService}]},ue([c.Effect(),le("design:type",Object)],Dr.prototype,"apply$",void 0),ue([c.Effect(),le("design:type",Object)],Dr.prototype,"list$",void 0),ue([c.Effect(),le("design:type",Object)],Dr.prototype,"remove$",void 0),ue([c.Effect(),le("design:type",Object)],Dr.prototype,"removeAll$",void 0);var jr=function(t,e,r,a,i){var n=this;this.actions$=t,this.errorMatcher=e,this.driver=r,this.storage=a,this.cartItemStateDebounceTime=i,this.list$=this.actions$.pipe(c.ofType(L.CartItemListAction),d.switchMap((function(t){return n.driver.list(n.storage.getCartId()).pipe(d.map((function(t){return new E(t)})),d.catchError((function(t){return p.of(new P(n.errorMatcher(t)))})))}))),this.get$=this.actions$.pipe(c.ofType(L.CartItemLoadAction),d.switchMap((function(t){return n.driver.get(n.storage.getCartId(),t.itemId).pipe(d.map((function(t){return new w(t)})),d.catchError((function(e){return p.of(new U(n.errorMatcher(e),t.itemId))})))}))),this.add$=this.actions$.pipe(c.ofType(L.CartItemAddAction),d.switchMap((function(t){return n.driver.add(n.storage.getCartId(),t.input).pipe(d.map((function(t){return new H(t)})),d.catchError((function(t){return p.of(new z(n.errorMatcher(t)))})))}))),this.update$=this.actions$.pipe(c.ofType(L.CartItemUpdateAction),d.mergeMap((function(t){return n.driver.update(n.storage.getCartId(),t.itemId,t.changes).pipe(d.map((function(e){return new B(e,t.itemId)})),d.catchError((function(e){return p.of(new x(n.errorMatcher(e),t.itemId))})))}))),this.resetCartItemStateAfterChange$=this.actions$.pipe(c.ofType(L.CartItemAddSuccessAction,L.CartItemUpdateSuccessAction,L.CartItemUpdateAction),d.debounceTime(this.cartItemStateDebounceTime),c.ofType(L.CartItemAddSuccessAction,L.CartItemUpdateSuccessAction),d.mapTo(new V)),this.delete$=this.actions$.pipe(c.ofType(L.CartItemDeleteAction),d.mergeMap((function(t){return n.driver.delete(n.storage.getCartId(),t.itemId).pipe(d.map((function(t){return new k(t)})),d.catchError((function(e){return p.of(new N(n.errorMatcher(e),t.itemId))})))})))};jr.decorators=[{type:i.Injectable}],jr.ctorParameters=function(){return[{type:c.Actions},{type:void 0,decorators:[{type:i.Inject,args:[n.DAFF_CART_ERROR_MATCHER]}]},{type:void 0,decorators:[{type:i.Inject,args:[u.DaffCartItemDriver]}]},{type:n.DaffCartStorageService},{type:Number,decorators:[{type:i.Inject,args:[Ir]}]}]},ue([c.Effect(),le("design:type",Object)],jr.prototype,"list$",void 0),ue([c.Effect(),le("design:type",Object)],jr.prototype,"get$",void 0),ue([c.Effect(),le("design:type",Object)],jr.prototype,"add$",void 0),ue([c.Effect(),le("design:type",Object)],jr.prototype,"update$",void 0),ue([c.Effect(),le("design:type",Object)],jr.prototype,"resetCartItemStateAfterChange$",void 0),ue([c.Effect(),le("design:type",Object)],jr.prototype,"delete$",void 0);var Mr=function(t,e,r,a){var i=this;this.actions$=t,this.errorMatcher=e,this.driver=r,this.storage=a,this.placeOrder$=this.actions$.pipe(c.ofType(qt.CartPlaceOrderAction),d.switchMap((function(t){return p.of(null).pipe(d.map((function(){return i.storage.getCartId()})),d.switchMap((function(e){return i.driver.placeOrder(e,t.payload)})),d.map((function(t){return new Nt(t)})),d.catchError((function(t){return p.of(t instanceof o.DaffStorageServiceError?new f(i.errorMatcher(t)):new Vt(i.errorMatcher(t)))})))}))),this.resetCart$=this.actions$.pipe(c.ofType(qt.CartPlaceOrderSuccessAction),d.mapTo(new A))};Mr.decorators=[{type:i.Injectable}],Mr.ctorParameters=function(){return[{type:c.Actions},{type:void 0,decorators:[{type:i.Inject,args:[n.DAFF_CART_ERROR_MATCHER]}]},{type:void 0,decorators:[{type:i.Inject,args:[u.DaffCartOrderDriver]}]},{type:n.DaffCartStorageService}]},ue([c.Effect(),le("design:type",Object)],Mr.prototype,"placeOrder$",void 0),ue([c.Effect(),le("design:type",Object)],Mr.prototype,"resetCart$",void 0);var Rr=function(t,e,r,a){var i=this;this.actions$=t,this.errorMatcher=e,this.driver=r,this.storage=a,this.list$=this.actions$.pipe(c.ofType(xt.CartPaymentMethodsLoadAction),d.switchMap((function(t){return i.driver.list(i.storage.getCartId()).pipe(d.map((function(t){return new Ht(t)})),d.catchError((function(t){return p.of(new zt(i.errorMatcher(t)))})))})))};Rr.decorators=[{type:i.Injectable}],Rr.ctorParameters=function(){return[{type:c.Actions},{type:void 0,decorators:[{type:i.Inject,args:[n.DAFF_CART_ERROR_MATCHER]}]},{type:void 0,decorators:[{type:i.Inject,args:[u.DaffCartPaymentMethodsDriver]}]},{type:n.DaffCartStorageService}]},ue([c.Effect(),le("design:type",Object)],Rr.prototype,"list$",void 0);var Fr=function(t,e,r,a){var i=this;this.actions$=t,this.errorMatcher=e,this.driver=r,this.storage=a,this.get$=this.actions$.pipe(c.ofType(Dt.CartPaymentLoadAction),d.switchMap((function(t){return i.driver.get(i.storage.getCartId()).pipe(d.map((function(t){return new Mt(t)})),d.catchError((function(t){return p.of(new Rt(i.errorMatcher(t)))})))}))),this.update$=this.actions$.pipe(c.ofType(Dt.CartPaymentUpdateAction),d.switchMap((function(t){return i.driver.update(i.storage.getCartId(),t.payload).pipe(d.map((function(t){return new Lt(t)})),d.catchError((function(t){return p.of(new $t(i.errorMatcher(t)))})))}))),this.updateWithBilling$=this.actions$.pipe(c.ofType(Dt.CartPaymentUpdateWithBillingAction),d.switchMap((function(t){return i.driver.updateWithBilling(i.storage.getCartId(),t.payment,t.address).pipe(d.map((function(t){return new Pt(t)})),d.catchError((function(t){return p.of(new Tt(i.errorMatcher(t)))})))}))),this.remove$=this.actions$.pipe(c.ofType(Dt.CartPaymentRemoveAction),d.switchMap((function(t){return i.driver.remove(i.storage.getCartId()).pipe(d.mapTo(new Ut),d.catchError((function(t){return p.of(new _t(i.errorMatcher(t)))})))})))};Fr.decorators=[{type:i.Injectable}],Fr.ctorParameters=function(){return[{type:c.Actions},{type:void 0,decorators:[{type:i.Inject,args:[n.DAFF_CART_ERROR_MATCHER]}]},{type:void 0,decorators:[{type:i.Inject,args:[u.DaffCartPaymentDriver]}]},{type:n.DaffCartStorageService}]},ue([c.Effect(),le("design:type",Object)],Fr.prototype,"get$",void 0),ue([c.Effect(),le("design:type",Object)],Fr.prototype,"update$",void 0),ue([c.Effect(),le("design:type",Object)],Fr.prototype,"updateWithBilling$",void 0),ue([c.Effect(),le("design:type",Object)],Fr.prototype,"remove$",void 0);var Lr=function(){function t(t,e,r,a){var i=this;this.actions$=t,this.errorMatcher=e,this.cartStorage=r,this.driver=a,this.onResolveCart=function(){return i.actions$.pipe(c.ofType(l.ResolveCartAction),d.switchMap((function(){return p.of(null).pipe(d.map((function(){return i.cartStorage.getCartId()})),d.switchMap((function(t){return t?p.of({id:t}):i.driver.create()})),d.switchMap((function(t){var e=t.id;return i.driver.get(e)})),d.map((function(t){return new M(t)})),d.catchError((function(t){switch(!0){case t instanceof o.DaffServerSideStorageError:return p.of(new F(i.errorMatcher(new n.DaffCartServerSideResolutionError(t.message))));case t instanceof o.DaffStorageServiceError:return p.of(new R(i.errorMatcher(new n.DaffCartStorageResolutionError(t.message))));case t instanceof u.DaffCartNotFoundError:return i.driver.create().pipe(d.switchMap((function(t){var e=t.id;return i.driver.get(e)})),d.map((function(t){return new M(t)})),d.catchError((function(t){return p.of(new R(i.errorMatcher(new n.DaffCartNotFoundOrCreatedResolutionError(t.message))))})));default:return p.of(new R(i.errorMatcher(new n.DaffCartResolutionError(t.message))))}})))})))}}return t.prototype.ngrxOnInitEffects=function(){return new j},t}();Lr.decorators=[{type:i.Injectable}],Lr.ctorParameters=function(){return[{type:c.Actions},{type:void 0,decorators:[{type:i.Inject,args:[n.DAFF_CART_ERROR_MATCHER]}]},{type:n.DaffCartStorageService},{type:void 0,decorators:[{type:i.Inject,args:[u.DaffCartDriver]}]}]},ue([c.Effect(),le("design:type",Object)],Lr.prototype,"onResolveCart",void 0);var $r=function(t,e,r,a){var i=this;this.actions$=t,this.errorMatcher=e,this.driver=r,this.storage=a,this.get$=this.actions$.pipe(c.ofType(tt.CartShippingAddressLoadAction),d.switchMap((function(t){return i.driver.get(i.storage.getCartId()).pipe(d.map((function(t){return new rt(t)})),d.catchError((function(t){return p.of(new at(i.errorMatcher(t)))})))}))),this.update$=this.actions$.pipe(c.ofType(tt.CartShippingAddressUpdateAction),d.switchMap((function(t){return i.driver.update(i.storage.getCartId(),t.payload).pipe(d.map((function(t){return new nt(t)})),d.catchError((function(t){return p.of(new ot(i.errorMatcher(t)))})))})))};$r.decorators=[{type:i.Injectable}],$r.ctorParameters=function(){return[{type:c.Actions},{type:void 0,decorators:[{type:i.Inject,args:[n.DAFF_CART_ERROR_MATCHER]}]},{type:void 0,decorators:[{type:i.Inject,args:[u.DaffCartShippingAddressDriver]}]},{type:n.DaffCartStorageService}]},ue([c.Effect(),le("design:type",Object)],$r.prototype,"get$",void 0),ue([c.Effect(),le("design:type",Object)],$r.prototype,"update$",void 0);var Er=function(t,e,r,a){var i=this;this.actions$=t,this.errorMatcher=e,this.driver=r,this.storage=a,this.get$=this.actions$.pipe(c.ofType(ut.CartShippingInformationLoadAction),d.switchMap((function(t){return i.driver.get(i.storage.getCartId()).pipe(d.map((function(t){return new ft(t)})),d.catchError((function(t){return p.of(new Ct(i.errorMatcher(t)))})))}))),this.update$=this.actions$.pipe(c.ofType(ut.CartShippingInformationUpdateAction),d.switchMap((function(t){return i.driver.update(i.storage.getCartId(),t.payload).pipe(d.map((function(t){return new gt(t)})),d.catchError((function(t){return p.of(new At(i.errorMatcher(t)))})))}))),this.delete$=this.actions$.pipe(c.ofType(ut.CartShippingInformationDeleteAction),d.switchMap((function(t){return i.driver.delete(i.storage.getCartId()).pipe(d.map((function(t){return new yt(t)})),d.catchError((function(t){return p.of(new St(i.errorMatcher(t)))})))})))};Er.decorators=[{type:i.Injectable}],Er.ctorParameters=function(){return[{type:c.Actions},{type:void 0,decorators:[{type:i.Inject,args:[n.DAFF_CART_ERROR_MATCHER]}]},{type:void 0,decorators:[{type:i.Inject,args:[u.DaffCartShippingInformationDriver]}]},{type:n.DaffCartStorageService}]},ue([c.Effect(),le("design:type",Object)],Er.prototype,"get$",void 0),ue([c.Effect(),le("design:type",Object)],Er.prototype,"update$",void 0),ue([c.Effect(),le("design:type",Object)],Er.prototype,"delete$",void 0);var Pr=function(t,e,r,a){var i=this;this.actions$=t,this.errorMatcher=e,this.driver=r,this.storage=a,this.list$=this.actions$.pipe(c.ofType(vt.CartShippingMethodsLoadAction),d.switchMap((function(t){return i.driver.list(i.storage.getCartId()).pipe(d.map((function(t){return new bt(t)})),d.catchError((function(t){return p.of(new Ot(i.errorMatcher(t)))})))})))};Pr.decorators=[{type:i.Injectable}],Pr.ctorParameters=function(){return[{type:c.Actions},{type:void 0,decorators:[{type:i.Inject,args:[n.DAFF_CART_ERROR_MATCHER]}]},{type:void 0,decorators:[{type:i.Inject,args:[u.DaffCartShippingMethodsDriver]}]},{type:n.DaffCartStorageService}]},ue([c.Effect(),le("design:type",Object)],Pr.prototype,"list$",void 0);var Tr=function(t,e,r,a){var i=this;this.actions$=t,this.errorMatcher=e,this.driver=r,this.storage=a,this.create$=this.actions$.pipe(c.ofType(l.CartCreateAction),d.switchMap((function(t){return i.driver.create().pipe(d.map((function(t){return new m(t)})),d.catchError((function(t){return p.of(new y(i.errorMatcher(t)))})))}))),this.storeId$=this.actions$.pipe(c.ofType(l.CartCreateSuccessAction,l.ResolveCartSuccessAction),d.switchMap((function(t){return p.of(null).pipe(d.tap((function(){i.storage.setCartId(t.payload.id)})),d.switchMapTo(p.EMPTY),d.catchError((function(t){return p.of(new f(i.errorMatcher(t)))})))}))),this.get$=this.actions$.pipe(c.ofType(l.CartLoadAction),d.switchMap((function(t){return p.of(null).pipe(d.map((function(){return i.storage.getCartId()})),d.switchMap((function(t){return i.driver.get(t)})),d.map((function(t){return new h(t)})),d.catchError((function(t){return p.of(t instanceof o.DaffStorageServiceError?new f(i.errorMatcher(t)):new g(i.errorMatcher(t)))})))}))),this.addToCart$=this.actions$.pipe(c.ofType(l.AddToCartAction),d.switchMap((function(t){return i.driver.addToCart(t.payload.productId,t.payload.qty).pipe(d.map((function(t){return new v(t)})),d.catchError((function(t){return p.of(new I(i.errorMatcher(t)))})))}))),this.clear$=this.actions$.pipe(c.ofType(l.CartClearAction),d.switchMap((function(t){return p.of(null).pipe(d.map((function(){return i.storage.getCartId()})),d.switchMap((function(t){return i.driver.clear(t)})),d.map((function(t){return new O(t)})),d.catchError((function(t){return p.of(t instanceof o.DaffStorageServiceError?new f(i.errorMatcher(t)):new D(i.errorMatcher(t)))})))})))};Tr.decorators=[{type:i.Injectable}],Tr.ctorParameters=function(){return[{type:c.Actions},{type:void 0,decorators:[{type:i.Inject,args:[n.DAFF_CART_ERROR_MATCHER]}]},{type:void 0,decorators:[{type:i.Inject,args:[u.DaffCartDriver]}]},{type:n.DaffCartStorageService}]},ue([c.Effect(),le("design:type",Object)],Tr.prototype,"create$",void 0),ue([c.Effect(),le("design:type",Object)],Tr.prototype,"storeId$",void 0),ue([c.Effect(),le("design:type",Object)],Tr.prototype,"get$",void 0),ue([c.Effect(),le("design:type",Object)],Tr.prototype,"addToCart$",void 0),ue([c.Effect(),le("design:type",Object)],Tr.prototype,"clear$",void 0);var wr=new i.InjectionToken("DAFF_CART_REDUCERS",{factory:function(){return a.daffComposeReducers(Ce([e.combineReducers(dr)],i.inject(lr)))}}),Ur=function(){};Ur.decorators=[{type:i.NgModule,args:[{imports:[e.StoreModule.forFeature(ur,wr),c.EffectsModule.forFeature([Tr,jr,Or,$r,br,Er,Pr,Fr,Rr,Mr,Dr,Lr])],providers:[{provide:Ir,useValue:4e3}]}]}];var _r=function(){function t(t,r){var a=this;this.store=t,this.paymentMethodMap=r;var i=vr(),n=i.selectCartValue,o=i.selectCartResolved,s=i.selectCartLoadingObject,c=i.selectCartFeatureLoading,p=i.selectCartFeatureResolving,u=i.selectCartFeatureMutating,l=i.selectCartLoading,f=i.selectCartResolving,C=i.selectCartMutating,h=i.selectBillingAddressLoading,g=i.selectBillingAddressResolving,A=i.selectBillingAddressMutating,m=i.selectShippingAddressLoading,y=i.selectShippingAddressResolving,S=i.selectShippingAddressMutating,v=i.selectShippingInformationLoading,I=i.selectShippingInformationResolving,b=i.selectShippingInformationMutating,O=i.selectShippingMethodsLoading,D=i.selectShippingMethodsResolving,j=i.selectPaymentLoading,M=i.selectPaymentResolving,R=i.selectPaymentMutating,F=i.selectPaymentMethodsLoading,L=i.selectPaymentMethodsResolving,$=i.selectCouponLoading,E=i.selectCouponResolving,P=i.selectCouponMutating,T=i.selectItemLoading,w=i.selectItemAdding,U=i.selectItemResolving,_=i.selectCartItemMutating,B=i.selectCartErrorsObject,x=i.selectCartErrors,W=i.selectItemErrors,H=i.selectBillingAddressErrors,z=i.selectShippingAddressErrors,q=i.selectShippingInformationErrors,k=i.selectShippingMethodsErrors,N=i.selectPaymentErrors,V=i.selectPaymentMethodsErrors,Q=i.selectCouponErrors,G=i.selectCartId,X=i.selectCartSubtotal,Y=i.selectCartGrandTotal,K=i.selectCartSubtotalExcludingTax,J=i.selectCartSubtotalIncludingTax,Z=i.selectCartSubtotalWithDiscountExcludingTax,tt=i.selectCartSubtotalWithDiscountIncludingTax,et=i.selectCartDiscountTotals,rt=i.selectCartTotalTax,at=i.selectCartShippingTotal,it=i.selectCartCoupons,nt=i.selectCartItems,ot=i.selectCartHasOutOfStockItems,st=i.selectCartItemEntities,ct=i.selectTotalNumberOfCartItems,pt=i.selectCartItemConfiguredAttributes,dt=i.selectCartItemCompositeOptions,ut=i.selectCartBillingAddress,lt=i.selectCartShippingAddress,ft=i.selectCartPayment,Ct=i.selectCartTotals,ht=i.selectCartShippingInformation,gt=i.selectCartAvailableShippingMethods,At=i.selectCartAvailablePaymentMethods,mt=i.selectIsCartEmpty,yt=i.selectIsBillingSameAsShipping,St=i.selectCartOrderLoading,vt=i.selectCartOrderErrors,It=i.selectCartOrderValue,bt=i.selectCartOrderId,Ot=i.selectCartOrderCartId,Dt=i.selectHasOrderResult,jt=i.selectIsCartItemOutOfStock,Mt=i.selectCartItemState,Rt=i.selectHasBillingAddress,Ft=i.selectHasShippingAddress,Lt=i.selectHasShippingMethod,$t=i.selectHasPaymentMethod,Et=i.selectCanPlaceOrder,Pt=i.selectCartItemPrice,Tt=i.selectCartItemRowTotal,wt=i.selectCartItemQuantity,Ut=i.selectCartItemDiscounts,_t=i.selectCartItemTotalDiscount;this._selectCartItemConfiguredAttributes=pt,this._selectCartItemCompositeOptions=dt,this._selectIsCartItemOutOfStock=jt,this._selectCartItemState=Mt,this._selectCartItemPrice=Pt,this._selectCartItemQuantity=wt,this._selectCartItemRowTotal=Tt,this._selectCartItemDiscounts=Ut,this._selectCartItemTotalDiscount=_t,this.cart$=this.store.pipe(e.select(n)),this.resolved$=this.store.pipe(e.select(o)),this.loadingObject$=this.store.pipe(e.select(s)),this.featureLoading$=this.store.pipe(e.select(c)),this.featureResolving$=this.store.pipe(e.select(p)),this.featureMutating$=this.store.pipe(e.select(u)),this.loading$=this.store.pipe(e.select(l)),this.resolving$=this.store.pipe(e.select(f)),this.mutating$=this.store.pipe(e.select(C)),this.billingAddressLoading$=this.store.pipe(e.select(h)),this.billingAddressResolving$=this.store.pipe(e.select(g)),this.billingAddressMutating$=this.store.pipe(e.select(A)),this.shippingAddressLoading$=this.store.pipe(e.select(m)),this.shippingAddressResolving$=this.store.pipe(e.select(y)),this.shippingAddressMutating$=this.store.pipe(e.select(S)),this.shippingInformationLoading$=this.store.pipe(e.select(v)),this.shippingInformationResolving$=this.store.pipe(e.select(I)),this.shippingInformationMutating$=this.store.pipe(e.select(b)),this.shippingMethodsLoading$=this.store.pipe(e.select(O)),this.shippingMethodsResolving$=this.store.pipe(e.select(D)),this.paymentLoading$=this.store.pipe(e.select(j)),this.paymentResolving$=this.store.pipe(e.select(M)),this.paymentMutating$=this.store.pipe(e.select(R)),this.paymentMethodsLoading$=this.store.pipe(e.select(F)),this.paymentMethodsResolving$=this.store.pipe(e.select(L)),this.couponLoading$=this.store.pipe(e.select($)),this.couponResolving$=this.store.pipe(e.select(E)),this.couponMutating$=this.store.pipe(e.select(P)),this.itemLoading$=this.store.pipe(e.select(T)),this.itemAdding$=this.store.pipe(e.select(w)),this.itemResolving$=this.store.pipe(e.select(U)),this.itemMutating$=this.store.pipe(e.select(_)),this.errors$=this.store.pipe(e.select(B)),this.cartErrors$=this.store.pipe(e.select(x)),this.itemErrors$=this.store.pipe(e.select(W)),this.billingAddressErrors$=this.store.pipe(e.select(H)),this.shippingAddressErrors$=this.store.pipe(e.select(z)),this.shippingInformationErrors$=this.store.pipe(e.select(q)),this.shippingMethodsErrors$=this.store.pipe(e.select(k)),this.paymentErrors$=this.store.pipe(e.select(N)),this.paymentMethodsErrors$=this.store.pipe(e.select(V)),this.couponErrors$=this.store.pipe(e.select(Q)),this.id$=this.store.pipe(e.select(G)),this.subtotal$=this.store.pipe(e.select(X)),this.grandTotal$=this.store.pipe(e.select(Y)),this.subtotalExcludingTax$=this.store.pipe(e.select(K)),this.subtotalIncludingTax$=this.store.pipe(e.select(J)),this.subtotalWithDiscountExcludingTax$=this.store.pipe(e.select(Z)),this.subtotalWithDiscountIncludingTax$=this.store.pipe(e.select(tt)),this.discountTotals$=this.store.pipe(e.select(et)),this.totalTax$=this.store.pipe(e.select(rt)),this.shippingTotal$=this.store.pipe(e.select(at)),this.coupons$=this.store.pipe(e.select(it)),this.items$=this.store.pipe(e.select(nt)),this.totalItems$=this.store.pipe(e.select(ct)),this.hasOutOfStockItems$=this.store.pipe(e.select(ot)),this.itemDictionary$=this.store.pipe(e.select(st)),this.billingAddress$=this.store.pipe(e.select(ut)),this.shippingAddress$=this.store.pipe(e.select(lt)),this.payment$=this.store.pipe(e.select(ft)),this.totals$=this.store.pipe(e.select(Ct)),this.shippingInformation$=this.store.pipe(e.select(ht)),this.availableShippingMethods$=this.store.pipe(e.select(gt)),this.availablePaymentMethods$=this.store.pipe(e.select(At)),this.paymentId$=this.payment$.pipe(d.map((function(t){return t&&t.method?a.paymentMethodMap[t.method]:null}))),this.isCartEmpty$=this.store.pipe(e.select(mt)),this.isBillingSameAsShipping$=this.store.pipe(e.select(yt)),this.hasBillingAddress$=this.store.pipe(e.select(Rt)),this.hasShippingAddress$=this.store.pipe(e.select(Ft)),this.hasShippingMethod$=this.store.pipe(e.select(Lt)),this.hasPaymentMethod$=this.store.pipe(e.select($t)),this.canPlaceOrder$=this.store.pipe(e.select(Et)),this.orderResultLoading$=this.store.pipe(e.select(St)),this.orderResultErrors$=this.store.pipe(e.select(vt)),this.orderResult$=this.store.pipe(e.select(It)),this.orderResultId$=this.store.pipe(e.select(bt)),this.orderResultCartId$=this.store.pipe(e.select(Ot)),this.hasOrderResult$=this.store.pipe(e.select(Dt))}return t.prototype.getConfiguredCartItemAttributes=function(t){return this.store.pipe(e.select(this._selectCartItemConfiguredAttributes(t)))},t.prototype.getCompositeCartItemOptions=function(t){return this.store.pipe(e.select(this._selectCartItemCompositeOptions(t)))},t.prototype.isCartItemOutOfStock=function(t){return this.store.pipe(e.select(this._selectIsCartItemOutOfStock(t)))},t.prototype.getCartItemState=function(t){return this.store.pipe(e.select(this._selectCartItemState(t)))},t.prototype.getCartItemPrice=function(t){return this.store.pipe(e.select(this._selectCartItemPrice(t)))},t.prototype.getCartItemQuantity=function(t){return this.store.pipe(e.select(this._selectCartItemQuantity(t)))},t.prototype.getCartItemRowTotal=function(t){return this.store.pipe(e.select(this._selectCartItemRowTotal(t)))},t.prototype.getCartItemDiscounts=function(t){return this.store.pipe(e.select(this._selectCartItemDiscounts(t)))},t.prototype.getCartItemTotalDiscount=function(t){return this.store.pipe(e.select(this._selectCartItemTotalDiscount(t)))},t.prototype.dispatch=function(t){this.store.dispatch(t)},t}();_r.decorators=[{type:i.Injectable,args:[{providedIn:"root"}]}],_r.ctorParameters=function(){return[{type:e.Store},{type:Object,decorators:[{type:i.Inject,args:[n.DaffCartPaymentMethodIdMap]}]}]},_r.ɵprov=i.ɵɵdefineInjectable({factory:function(){return new _r(i.ɵɵinject(e.Store),i.ɵɵinject(n.DaffCartPaymentMethodIdMap))},token:_r,providedIn:"root"}),t.DAFF_CART_EXTRA_REDUCERS=lr,t.DAFF_CART_STORE_FEATURE_KEY=ur,t.DaffAddToCart=S,t.DaffAddToCartFailure=I,t.DaffAddToCartSuccess=v,t.DaffCartActionTypes=l,t.DaffCartAddressActionTypes=st,t.DaffCartAddressUpdate=ct,t.DaffCartAddressUpdateFailure=dt,t.DaffCartAddressUpdateSuccess=pt,t.DaffCartBillingAddressActionTypes=Q,t.DaffCartBillingAddressLoad=G,t.DaffCartBillingAddressLoadFailure=Y,t.DaffCartBillingAddressLoadSuccess=X,t.DaffCartBillingAddressUpdate=K,t.DaffCartBillingAddressUpdateFailure=Z,t.DaffCartBillingAddressUpdateSuccess=J,t.DaffCartClear=b,t.DaffCartClearFailure=D,t.DaffCartClearSuccess=O,t.DaffCartCouponActionTypes=Qt,t.DaffCartCouponApply=Gt,t.DaffCartCouponApplyFailure=Yt,t.DaffCartCouponApplySuccess=Xt,t.DaffCartCouponList=Kt,t.DaffCartCouponListFailure=Zt,t.DaffCartCouponListSuccess=Jt,t.DaffCartCouponRemove=te,t.DaffCartCouponRemoveAll=ae,t.DaffCartCouponRemoveAllFailure=ne,t.DaffCartCouponRemoveAllSuccess=ie,t.DaffCartCouponRemoveFailure=re,t.DaffCartCouponRemoveSuccess=ee,t.DaffCartCreate=A,t.DaffCartCreateFailure=y,t.DaffCartCreateSuccess=m,t.DaffCartFacade=_r,t.DaffCartItemActionTypes=L,t.DaffCartItemAdd=W,t.DaffCartItemAddFailure=z,t.DaffCartItemAddSuccess=H,t.DaffCartItemDelete=q,t.DaffCartItemDeleteFailure=N,t.DaffCartItemDeleteSuccess=k,t.DaffCartItemList=$,t.DaffCartItemListFailure=P,t.DaffCartItemListSuccess=E,t.DaffCartItemLoad=T,t.DaffCartItemLoadFailure=U,t.DaffCartItemLoadSuccess=w,t.DaffCartItemStateDebounceTime=Ir,t.DaffCartItemStateEnum=se,t.DaffCartItemStateReset=V,t.DaffCartItemUpdate=_,t.DaffCartItemUpdateFailure=x,t.DaffCartItemUpdateSuccess=B,t.DaffCartLoad=C,t.DaffCartLoadFailure=g,t.DaffCartLoadSuccess=h,t.DaffCartOperationType=ye,t.DaffCartOrderActionTypes=qt,t.DaffCartPaymentActionTypes=Dt,t.DaffCartPaymentLoad=jt,t.DaffCartPaymentLoadFailure=Rt,t.DaffCartPaymentLoadSuccess=Mt,t.DaffCartPaymentMethodAdd=Bt,t.DaffCartPaymentMethodsActionTypes=xt,t.DaffCartPaymentMethodsLoad=Wt,t.DaffCartPaymentMethodsLoadFailure=zt,t.DaffCartPaymentMethodsLoadSuccess=Ht,t.DaffCartPaymentRemove=wt,t.DaffCartPaymentRemoveFailure=_t,t.DaffCartPaymentRemoveSuccess=Ut,t.DaffCartPaymentUpdate=Ft,t.DaffCartPaymentUpdateFailure=$t,t.DaffCartPaymentUpdateSuccess=Lt,t.DaffCartPaymentUpdateWithBilling=Et,t.DaffCartPaymentUpdateWithBillingFailure=Tt,t.DaffCartPaymentUpdateWithBillingSuccess=Pt,t.DaffCartPlaceOrder=kt,t.DaffCartPlaceOrderFailure=Vt,t.DaffCartPlaceOrderSuccess=Nt,t.DaffCartResolveState=Se,t.DaffCartShippingAddressActionTypes=tt,t.DaffCartShippingAddressLoad=et,t.DaffCartShippingAddressLoadFailure=at,t.DaffCartShippingAddressLoadSuccess=rt,t.DaffCartShippingAddressUpdate=it,t.DaffCartShippingAddressUpdateFailure=ot,t.DaffCartShippingAddressUpdateSuccess=nt,t.DaffCartShippingInformationActionTypes=ut,t.DaffCartShippingInformationDelete=mt,t.DaffCartShippingInformationDeleteFailure=St,t.DaffCartShippingInformationDeleteSuccess=yt,t.DaffCartShippingInformationLoad=lt,t.DaffCartShippingInformationLoadFailure=Ct,t.DaffCartShippingInformationLoadSuccess=ft,t.DaffCartShippingInformationUpdate=ht,t.DaffCartShippingInformationUpdateFailure=At,t.DaffCartShippingInformationUpdateSuccess=gt,t.DaffCartShippingMethodsActionTypes=vt,t.DaffCartShippingMethodsLoad=It,t.DaffCartShippingMethodsLoadFailure=Ot,t.DaffCartShippingMethodsLoadSuccess=bt,t.DaffCartStateModule=Ur,t.DaffCartStorageFailure=f,t.DaffResolveCart=j,t.DaffResolveCartFailure=R,t.DaffResolveCartServerSide=F,t.DaffResolveCartSuccess=M,t.daffCartOrderInitialState=he,t.daffCartOrderReducer=ge,t.daffCartProvideExtraReducers=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.map((function(t){return{provide:lr,useValue:t,multi:!0}}))},t.daffCartReducer=pr,t.daffCartReducers=dr,t.getDaffCartSelectors=vr,t.initialState=ve,t.initializeLoadingSetter=Oe,t.ɵa=sr,t.ɵb=Ue,t.ɵc=Re,t.ɵd=Xe,t.ɵe=ar,t.ɵf=Ze,t.ɵg=ke,t.ɵh=We,t.ɵi=Ee,t.ɵj=Ne,t.ɵk=pe,t.ɵl=wr,t.ɵm=Tr,t.ɵn=jr,t.ɵo=Or,t.ɵp=$r,t.ɵq=br,t.ɵr=Er,t.ɵs=Pr,t.ɵt=Fr,t.ɵu=Rr,t.ɵv=Mr,t.ɵw=Dr,t.ɵx=Lr,Object.defineProperty(t,"__esModule",{value:!0})}));
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@ngrx/store"),require("@ngrx/entity"),require("@daffodil/core/state"),require("@angular/core"),require("@daffodil/cart"),require("@daffodil/core"),require("@daffodil/geography"),require("@ngrx/effects"),require("rxjs"),require("rxjs/operators"),require("@daffodil/cart/driver")):"function"==typeof define&&define.amd?define("@daffodil/cart/state",["exports","@ngrx/store","@ngrx/entity","@daffodil/core/state","@angular/core","@daffodil/cart","@daffodil/core","@daffodil/geography","@ngrx/effects","rxjs","rxjs/operators","@daffodil/cart/driver"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).daffodil=t.daffodil||{},t.daffodil.cart=t.daffodil.cart||{},t.daffodil.cart.state={}),t.i1,t.entity,t.state,t.ng.core,t.daffodil.cart,t.core,t.geography,t.effects,t.rxjs,t.rxjs.operators,t.daffodil.cart.driver)}(this,(function(t,e,a,r,i,n,o,s,c,p,f,d){"use strict";var u;(u=t.DaffCartActionTypes||(t.DaffCartActionTypes={})).CartStorageFailureAction="[DaffCart] Cart Storage Failure Action",u.CartLoadAction="[DaffCart] Cart Load Action",u.CartLoadSuccessAction="[DaffCart] Cart Load Success Action",u.CartLoadFailureAction="[DaffCart] Cart Load Failure Action",u.CartCreateAction="[DaffCart] Cart Create Action",u.CartCreateSuccessAction="[DaffCart] Cart Create Success Action",u.CartCreateFailureAction="[DaffCart] Cart Create Failure Action",u.AddToCartAction="[DaffCart] Cart Add To Cart Action",u.AddToCartSuccessAction="[DaffCart] Cart Add to Cart Success Action",u.AddToCartFailureAction="[DaffCart] Cart Add to Cart Failure Action",u.CartClearAction="[DaffCart] Cart Reset Action",u.CartClearSuccessAction="[DaffCart] Cart Reset Success Action",u.CartClearFailureAction="[DaffCart] Cart Reset Failure Action",u.ResolveCartAction="[DaffCart] Resolve Cart Action",u.ResolveCartSuccessAction="[DaffCart] Resolve Cart Success Action",u.ResolveCartServerSideAction="[DaffCart] Resolve Cart Server Side Action",u.ResolveCartFailureAction="[DaffCart] Resolve Cart Failure Action";var l,C=function(e){this.payload=e,this.type=t.DaffCartActionTypes.CartStorageFailureAction},h=function(){this.type=t.DaffCartActionTypes.CartLoadAction},A=function(e){this.payload=e,this.type=t.DaffCartActionTypes.CartLoadSuccessAction},y=function(e){this.payload=e,this.type=t.DaffCartActionTypes.CartLoadFailureAction},g=function(){this.type=t.DaffCartActionTypes.CartCreateAction},m=function(e){this.payload=e,this.type=t.DaffCartActionTypes.CartCreateSuccessAction},D=function(e){this.payload=e,this.type=t.DaffCartActionTypes.CartCreateFailureAction},S=function(e){this.payload=e,this.type=t.DaffCartActionTypes.AddToCartAction},T=function(e){this.payload=e,this.type=t.DaffCartActionTypes.AddToCartSuccessAction},I=function(e){this.payload=e,this.type=t.DaffCartActionTypes.AddToCartFailureAction},v=function(){this.type=t.DaffCartActionTypes.CartClearAction},O=function(e){this.payload=e,this.type=t.DaffCartActionTypes.CartClearSuccessAction},b=function(e){this.payload=e,this.type=t.DaffCartActionTypes.CartClearFailureAction},j=function(){this.type=t.DaffCartActionTypes.ResolveCartAction},M=function(e){this.payload=e,this.type=t.DaffCartActionTypes.ResolveCartSuccessAction},R=function(e){this.payload=e,this.type=t.DaffCartActionTypes.ResolveCartFailureAction},P=function(e){this.payload=e,this.type=t.DaffCartActionTypes.ResolveCartServerSideAction};(l=t.DaffCartItemActionTypes||(t.DaffCartItemActionTypes={})).CartItemListAction="[DaffCart] Cart Items List Action",l.CartItemListSuccessAction="[DaffCart] Cart Items List Success Action",l.CartItemListFailureAction="[DaffCart] Cart Items List Failure Action",l.CartItemLoadAction="[DaffCart] Cart Item Load Action",l.CartItemLoadSuccessAction="[DaffCart] Cart Item Load Success Action",l.CartItemLoadFailureAction="[DaffCart] Cart Item Load Failure Action",l.CartItemUpdateAction="[DaffCart] Cart Item Update Action",l.CartItemUpdateSuccessAction="[DaffCart] Cart Item Update Success Action",l.CartItemUpdateFailureAction="[DaffCart] Cart Item Update Failure Action",l.CartItemAddAction="[DaffCart] Cart Item Add Action",l.CartItemAddSuccessAction="[DaffCart] Cart Item Add Success Action",l.CartItemAddFailureAction="[DaffCart] Cart Item Add Failure Action",l.CartItemDeleteAction="[DaffCart] Cart Item Remove Action",l.CartItemDeleteSuccessAction="[DaffCart] Cart Item Remove Success Action",l.CartItemDeleteFailureAction="[DaffCart] Cart Item Remove Failure Action",l.CartItemStateResetAction="[DaffCart] Cart Item State Reset Action";var F,L=function(){this.type=t.DaffCartItemActionTypes.CartItemListAction},E=function(e){this.payload=e,this.type=t.DaffCartItemActionTypes.CartItemListSuccessAction},$=function(e){this.payload=e,this.type=t.DaffCartItemActionTypes.CartItemListFailureAction},w=function(e){this.itemId=e,this.type=t.DaffCartItemActionTypes.CartItemLoadAction},U=function(e){this.payload=e,this.type=t.DaffCartItemActionTypes.CartItemLoadSuccessAction},B=function(e,a){this.payload=e,this.itemId=a,this.type=t.DaffCartItemActionTypes.CartItemLoadFailureAction},_=function(e,a){this.itemId=e,this.changes=a,this.type=t.DaffCartItemActionTypes.CartItemUpdateAction},x=function(e,a){this.payload=e,this.itemId=a,this.type=t.DaffCartItemActionTypes.CartItemUpdateSuccessAction},W=function(e,a){this.payload=e,this.itemId=a,this.type=t.DaffCartItemActionTypes.CartItemUpdateFailureAction},H=function(e){this.input=e,this.type=t.DaffCartItemActionTypes.CartItemAddAction},z=function(e){this.payload=e,this.type=t.DaffCartItemActionTypes.CartItemAddSuccessAction},q=function(e){this.payload=e,this.type=t.DaffCartItemActionTypes.CartItemAddFailureAction},k=function(e){this.itemId=e,this.type=t.DaffCartItemActionTypes.CartItemDeleteAction},N=function(e){this.payload=e,this.type=t.DaffCartItemActionTypes.CartItemDeleteSuccessAction},V=function(e,a){this.payload=e,this.itemId=a,this.type=t.DaffCartItemActionTypes.CartItemDeleteFailureAction},Q=function(){this.type=t.DaffCartItemActionTypes.CartItemStateResetAction};(F=t.DaffCartBillingAddressActionTypes||(t.DaffCartBillingAddressActionTypes={})).CartBillingAddressLoadAction="[DaffCart] Billing Address Load Action",F.CartBillingAddressLoadSuccessAction="[DaffCart] Billing Address Load Success Action",F.CartBillingAddressLoadFailureAction="[DaffCart] Billing Address Load Failure Action",F.CartBillingAddressUpdateAction="[DaffCart] Billing Address Update Action",F.CartBillingAddressUpdateSuccessAction="[DaffCart] Billing Address Update Success Action",F.CartBillingAddressUpdateFailureAction="[DaffCart] Billing Address Update Failure Action";var G,X=function(){this.type=t.DaffCartBillingAddressActionTypes.CartBillingAddressLoadAction},Y=function(e){this.payload=e,this.type=t.DaffCartBillingAddressActionTypes.CartBillingAddressLoadSuccessAction},K=function(e){this.payload=e,this.type=t.DaffCartBillingAddressActionTypes.CartBillingAddressLoadFailureAction},J=function(e){this.payload=e,this.type=t.DaffCartBillingAddressActionTypes.CartBillingAddressUpdateAction},Z=function(e){this.payload=e,this.type=t.DaffCartBillingAddressActionTypes.CartBillingAddressUpdateSuccessAction},tt=function(e){this.payload=e,this.type=t.DaffCartBillingAddressActionTypes.CartBillingAddressUpdateFailureAction};(G=t.DaffCartShippingAddressActionTypes||(t.DaffCartShippingAddressActionTypes={})).CartShippingAddressLoadAction="[DaffCart] Shipping Address Load Action",G.CartShippingAddressLoadSuccessAction="[DaffCart] Shipping Address Load Success Action",G.CartShippingAddressLoadFailureAction="[DaffCart] Shipping Address Load Failure Action",G.CartShippingAddressUpdateAction="[DaffCart] Shipping Address Update Action",G.CartShippingAddressUpdateSuccessAction="[DaffCart] Shipping Address Update Success Action",G.CartShippingAddressUpdateFailureAction="[DaffCart] Shipping Address Update Failure Action";var et,at=function(){this.type=t.DaffCartShippingAddressActionTypes.CartShippingAddressLoadAction},rt=function(e){this.payload=e,this.type=t.DaffCartShippingAddressActionTypes.CartShippingAddressLoadSuccessAction},it=function(e){this.payload=e,this.type=t.DaffCartShippingAddressActionTypes.CartShippingAddressLoadFailureAction},nt=function(e){this.payload=e,this.type=t.DaffCartShippingAddressActionTypes.CartShippingAddressUpdateAction},ot=function(e){this.payload=e,this.type=t.DaffCartShippingAddressActionTypes.CartShippingAddressUpdateSuccessAction},st=function(e){this.payload=e,this.type=t.DaffCartShippingAddressActionTypes.CartShippingAddressUpdateFailureAction};(et=t.DaffCartAddressActionTypes||(t.DaffCartAddressActionTypes={})).CartAddressUpdateAction="[DaffCart] Cart Address Update Action",et.CartAddressUpdateSuccessAction="[DaffCart] Cart Address Update Success Action",et.CartAddressUpdateFailureAction="[DaffCart] Cart Address Update Failure Action";var ct,pt=function(e){this.payload=e,this.type=t.DaffCartAddressActionTypes.CartAddressUpdateAction},ft=function(e){this.payload=e,this.type=t.DaffCartAddressActionTypes.CartAddressUpdateSuccessAction},dt=function(e){this.payload=e,this.type=t.DaffCartAddressActionTypes.CartAddressUpdateFailureAction};(ct=t.DaffCartShippingInformationActionTypes||(t.DaffCartShippingInformationActionTypes={})).CartShippingInformationLoadAction="[DaffCart] Shipping Information Load Action",ct.CartShippingInformationLoadSuccessAction="[DaffCart] Shipping Information Load Success Action",ct.CartShippingInformationLoadFailureAction="[DaffCart] Shipping Information Load Failure Action",ct.CartShippingInformationUpdateAction="[DaffCart] Shipping Information Update Action",ct.CartShippingInformationUpdateSuccessAction="[DaffCart] Shipping Information Update Success Action",ct.CartShippingInformationUpdateFailureAction="[DaffCart] Shipping Information Update Failure Action",ct.CartShippingInformationDeleteAction="[DaffCart] Shipping Information Remove Action",ct.CartShippingInformationDeleteSuccessAction="[DaffCart] Shipping Information Remove Success Action",ct.CartShippingInformationDeleteFailureAction="[DaffCart] Shipping Information Remove Failure Action";var ut,lt=function(){this.type=t.DaffCartShippingInformationActionTypes.CartShippingInformationLoadAction},Ct=function(e){this.payload=e,this.type=t.DaffCartShippingInformationActionTypes.CartShippingInformationLoadSuccessAction},ht=function(e){this.payload=e,this.type=t.DaffCartShippingInformationActionTypes.CartShippingInformationLoadFailureAction},At=function(e){this.payload=e,this.type=t.DaffCartShippingInformationActionTypes.CartShippingInformationUpdateAction},yt=function(e){this.payload=e,this.type=t.DaffCartShippingInformationActionTypes.CartShippingInformationUpdateSuccessAction},gt=function(e){this.payload=e,this.type=t.DaffCartShippingInformationActionTypes.CartShippingInformationUpdateFailureAction},mt=function(e){this.id=e,this.type=t.DaffCartShippingInformationActionTypes.CartShippingInformationDeleteAction},Dt=function(e){this.payload=e,this.type=t.DaffCartShippingInformationActionTypes.CartShippingInformationDeleteSuccessAction},St=function(e){this.payload=e,this.type=t.DaffCartShippingInformationActionTypes.CartShippingInformationDeleteFailureAction};(ut=t.DaffCartShippingMethodsActionTypes||(t.DaffCartShippingMethodsActionTypes={})).CartShippingMethodsLoadAction="[DaffCart] Shipping Methods Load Action",ut.CartShippingMethodsLoadSuccessAction="[DaffCart] Shipping Methods Load Success Action",ut.CartShippingMethodsLoadFailureAction="[DaffCart] Shipping Methods Load Failure Action";var Tt,It=function(){this.type=t.DaffCartShippingMethodsActionTypes.CartShippingMethodsLoadAction},vt=function(e){this.payload=e,this.type=t.DaffCartShippingMethodsActionTypes.CartShippingMethodsLoadSuccessAction},Ot=function(e){this.payload=e,this.type=t.DaffCartShippingMethodsActionTypes.CartShippingMethodsLoadFailureAction};(Tt=t.DaffCartPaymentActionTypes||(t.DaffCartPaymentActionTypes={})).CartPaymentLoadAction="[DaffCart] Payment Load Action",Tt.CartPaymentLoadSuccessAction="[DaffCart] Payment Load Success Action",Tt.CartPaymentLoadFailureAction="[DaffCart] Payment Load Failure Action",Tt.CartPaymentUpdateAction="[DaffCart] Payment Update Action",Tt.CartPaymentUpdateSuccessAction="[DaffCart] Payment Update Success Action",Tt.CartPaymentUpdateFailureAction="[DaffCart] Payment Update Failure Action",Tt.CartPaymentUpdateWithBillingAction="[DaffCart] Payment Update With Billing Action",Tt.CartPaymentUpdateWithBillingSuccessAction="[DaffCart] Payment Update With Billing Success Action",Tt.CartPaymentUpdateWithBillingFailureAction="[DaffCart] Payment Update With Billing Failure Action",Tt.CartPaymentRemoveAction="[DaffCart] Payment Remove Action",Tt.CartPaymentRemoveSuccessAction="[DaffCart] Payment Remove Success Action",Tt.CartPaymentRemoveFailureAction="[DaffCart] Payment Remove Failure Action",Tt.CartPaymentMethodAddAction="[DaffCart] Payment Method Add Action";var bt,jt=function(){this.type=t.DaffCartPaymentActionTypes.CartPaymentLoadAction},Mt=function(e){this.payload=e,this.type=t.DaffCartPaymentActionTypes.CartPaymentLoadSuccessAction},Rt=function(e){this.payload=e,this.type=t.DaffCartPaymentActionTypes.CartPaymentLoadFailureAction},Pt=function(e){this.payload=e,this.type=t.DaffCartPaymentActionTypes.CartPaymentUpdateAction},Ft=function(e){this.payload=e,this.type=t.DaffCartPaymentActionTypes.CartPaymentUpdateSuccessAction},Lt=function(e){this.payload=e,this.type=t.DaffCartPaymentActionTypes.CartPaymentUpdateFailureAction},Et=function(e,a){this.payment=e,this.address=a,this.type=t.DaffCartPaymentActionTypes.CartPaymentUpdateWithBillingAction},$t=function(e){this.payload=e,this.type=t.DaffCartPaymentActionTypes.CartPaymentUpdateWithBillingSuccessAction},wt=function(e){this.payload=e,this.type=t.DaffCartPaymentActionTypes.CartPaymentUpdateWithBillingFailureAction},Ut=function(){this.type=t.DaffCartPaymentActionTypes.CartPaymentRemoveAction},Bt=function(){this.type=t.DaffCartPaymentActionTypes.CartPaymentRemoveSuccessAction},_t=function(e){this.payload=e,this.type=t.DaffCartPaymentActionTypes.CartPaymentRemoveFailureAction},xt=function(e){this.payload=e,this.type=t.DaffCartPaymentActionTypes.CartPaymentMethodAddAction};(bt=t.DaffCartPaymentMethodsActionTypes||(t.DaffCartPaymentMethodsActionTypes={})).CartPaymentMethodsLoadAction="[DaffCart] Payment Methods Load Action",bt.CartPaymentMethodsLoadSuccessAction="[DaffCart] Payment Methods Load Success Action",bt.CartPaymentMethodsLoadFailureAction="[DaffCart] Payment Methods Load Failure Action";var Wt,Ht=function(){this.type=t.DaffCartPaymentMethodsActionTypes.CartPaymentMethodsLoadAction},zt=function(e){this.payload=e,this.type=t.DaffCartPaymentMethodsActionTypes.CartPaymentMethodsLoadSuccessAction},qt=function(e){this.payload=e,this.type=t.DaffCartPaymentMethodsActionTypes.CartPaymentMethodsLoadFailureAction};(Wt=t.DaffCartOrderActionTypes||(t.DaffCartOrderActionTypes={})).CartPlaceOrderAction="[DaffCart] Cart Place Order Action",Wt.CartPlaceOrderSuccessAction="[DaffCart] Cart Place Order Success Action",Wt.CartPlaceOrderFailureAction="[DaffCart] Cart Place Order Failure Action";var kt,Nt=function(e){this.payload=e,this.type=t.DaffCartOrderActionTypes.CartPlaceOrderAction},Vt=function(e){this.payload=e,this.type=t.DaffCartOrderActionTypes.CartPlaceOrderSuccessAction},Qt=function(e){this.payload=e,this.type=t.DaffCartOrderActionTypes.CartPlaceOrderFailureAction};(kt=t.DaffCartCouponActionTypes||(t.DaffCartCouponActionTypes={})).CartCouponApplyAction="[DaffCart] Cart Coupon Apply Action",kt.CartCouponApplySuccessAction="[DaffCart] Cart Coupon Apply Success Action",kt.CartCouponApplyFailureAction="[DaffCart] Cart Coupon Apply Failure Action",kt.CartCouponListAction="[DaffCart] Cart Coupon List Action",kt.CartCouponListSuccessAction="[DaffCart] Cart Coupon List Success Action",kt.CartCouponListFailureAction="[DaffCart] Cart Coupon List Failure Action",kt.CartCouponRemoveAction="[DaffCart] Cart Coupon Remove Action",kt.CartCouponRemoveSuccessAction="[DaffCart] Cart Coupon Remove Success Action",kt.CartCouponRemoveFailureAction="[DaffCart] Cart Coupon Remove Failure Action",kt.CartCouponRemoveAllAction="[DaffCart] Cart Coupon Remove All Action",kt.CartCouponRemoveAllSuccessAction="[DaffCart] Cart Coupon Remove All Success Action",kt.CartCouponRemoveAllFailureAction="[DaffCart] Cart Coupon Remove All Failure Action";var Gt,Xt=function(e){this.payload=e,this.type=t.DaffCartCouponActionTypes.CartCouponApplyAction},Yt=function(e){this.payload=e,this.type=t.DaffCartCouponActionTypes.CartCouponApplySuccessAction},Kt=function(e){this.payload=e,this.type=t.DaffCartCouponActionTypes.CartCouponApplyFailureAction},Jt=function(){this.type=t.DaffCartCouponActionTypes.CartCouponListAction},Zt=function(e){this.payload=e,this.type=t.DaffCartCouponActionTypes.CartCouponListSuccessAction},te=function(e){this.payload=e,this.type=t.DaffCartCouponActionTypes.CartCouponListFailureAction},ee=function(e){this.payload=e,this.type=t.DaffCartCouponActionTypes.CartCouponRemoveAction},ae=function(e){this.payload=e,this.type=t.DaffCartCouponActionTypes.CartCouponRemoveSuccessAction},re=function(e){this.payload=e,this.type=t.DaffCartCouponActionTypes.CartCouponRemoveFailureAction},ie=function(){this.type=t.DaffCartCouponActionTypes.CartCouponRemoveAllAction},ne=function(e){this.payload=e,this.type=t.DaffCartCouponActionTypes.CartCouponRemoveAllSuccessAction},oe=function(e){this.payload=e,this.type=t.DaffCartCouponActionTypes.CartCouponRemoveAllFailureAction};(Gt=t.DaffCartItemStateEnum||(t.DaffCartItemStateEnum={})).New="new",Gt.Updated="updated",Gt.Mutating="mutating",Gt.Error="error",Gt.Default="default";var se,ce=function(){return se=se||a.createEntityAdapter({selectId:function(t){return t.id}})};function pe(e,a){void 0===e&&(e=ce().getInitialState());var r,i,n,o,s=ce();switch(a.type){case t.DaffCartItemActionTypes.CartItemListSuccessAction:return s.setAll(a.payload.map((function(a){return Object.assign(Object.assign({},a),{daffState:fe(e.entities[a.id])||t.DaffCartItemStateEnum.Default})})),e);case t.DaffCartItemActionTypes.CartItemLoadSuccessAction:return s.upsertOne(Object.assign(Object.assign({},a.payload),{daffState:fe(e.entities[a.payload.id])||t.DaffCartItemStateEnum.Default}),e);case t.DaffCartItemActionTypes.CartItemAddSuccessAction:return s.setAll((o=e.entities,a.payload.items.map((function(e){var a=o[e.id];switch(!0){case!a:return Object.assign(Object.assign({},e),{daffState:t.DaffCartItemStateEnum.New});case(null==a?void 0:a.qty)!==e.qty:return Object.assign(Object.assign({},e),{daffState:t.DaffCartItemStateEnum.Updated});default:return e}}))),e);case t.DaffCartItemActionTypes.CartItemUpdateSuccessAction:return s.setAll((r=a.payload.items,i=e.entities,n=a.itemId,r.map((function(e){return e.id===n?Object.assign(Object.assign({},e),{daffState:t.DaffCartItemStateEnum.Updated}):Object.assign(Object.assign({},e),{daffState:fe(i[e.id])||t.DaffCartItemStateEnum.Default})}))),e);case t.DaffCartItemActionTypes.CartItemDeleteFailureAction:case t.DaffCartItemActionTypes.CartItemLoadFailureAction:case t.DaffCartItemActionTypes.CartItemUpdateFailureAction:return s.upsertOne(Object.assign(Object.assign({},e.entities[a.itemId]),{daffState:t.DaffCartItemStateEnum.Error}),e);case t.DaffCartItemActionTypes.CartItemDeleteSuccessAction:case t.DaffCartActionTypes.CartLoadSuccessAction:case t.DaffCartActionTypes.ResolveCartSuccessAction:case t.DaffCartActionTypes.CartClearSuccessAction:return s.setAll(a.payload.items.map((function(a){return Object.assign(Object.assign({},a),{daffState:fe(e.entities[a.id])||t.DaffCartItemStateEnum.Default})})),e);case t.DaffCartItemActionTypes.CartItemStateResetAction:return s.setAll(Object.keys(e.entities).map((function(a){return Object.assign(Object.assign({},e.entities[a]),{daffState:t.DaffCartItemStateEnum.Default})})),e);case t.DaffCartItemActionTypes.CartItemUpdateAction:case t.DaffCartItemActionTypes.CartItemDeleteAction:return s.upsertOne(Object.assign(Object.assign({},e.entities[a.itemId]),{daffState:t.DaffCartItemStateEnum.Mutating}),e);default:return e}}function fe(t){return null==t?void 0:t.daffState}function de(t,e,a,r){var i,n=arguments.length,o=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,a):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,a,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(o=(n<3?i(o):n>3?i(e,a,o):i(e,a))||o);return n>3&&o&&Object.defineProperty(e,a,o),o}function ue(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}Object.create;function le(t,e){var a="function"==typeof Symbol&&t[Symbol.iterator];if(!a)return t;var r,i,n=a.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=n.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(a=n.return)&&a.call(n)}finally{if(i)throw i.error}}return o}function Ce(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(le(arguments[e]));return t}Object.create;var he,Ae,ye,ge,me={cartOrderResult:{id:null,orderId:null,cartId:null},loading:"Stable",errors:[]};function De(e,a){switch(void 0===e&&(e=me),a.type){case t.DaffCartOrderActionTypes.CartPlaceOrderAction:return Object.assign(Object.assign({},e),{loading:"Mutating"});case t.DaffCartOrderActionTypes.CartPlaceOrderSuccessAction:return Object.assign(Object.assign({},e),{errors:[],loading:"Stable",cartOrderResult:a.payload});case t.DaffCartOrderActionTypes.CartPlaceOrderFailureAction:return Object.assign(Object.assign({},e),{loading:"Stable",errors:Ce(e.errors,[a.payload])});default:return e}}(he=t.DaffCartOperationType||(t.DaffCartOperationType={})).Cart="Cart",he.Item="Item",he.BillingAddress="Billing Address",he.ShippingAddress="Shipping Address",he.Payment="Payment",he.PaymentMethods="Payment Methods",he.ShippingInformation="Shipping Information",he.ShippingMethods="Shipping Methods",he.Coupon="Coupon",(Ae=t.DaffCartResolveState||(t.DaffCartResolveState={})).Default="default",Ae.Resolving="resolving",Ae.Succeeded="succeeded",Ae.Failed="failed",Ae.ServerSide="server";var Se=Object.freeze({cart:{id:null,subtotal:null,grand_total:null,coupons:[],items:[],billing_address:null,shipping_address:null,payment:null,totals:[],shipping_information:null,available_shipping_methods:[],available_payment_methods:[]},loading:(ye={},ye[t.DaffCartOperationType.Cart]="Stable",ye[t.DaffCartOperationType.Item]="Stable",ye[t.DaffCartOperationType.ShippingAddress]="Stable",ye[t.DaffCartOperationType.BillingAddress]="Stable",ye[t.DaffCartOperationType.ShippingInformation]="Stable",ye[t.DaffCartOperationType.ShippingMethods]="Stable",ye[t.DaffCartOperationType.Payment]="Stable",ye[t.DaffCartOperationType.PaymentMethods]="Stable",ye[t.DaffCartOperationType.Coupon]="Stable",ye),errors:(ge={},ge[t.DaffCartOperationType.Cart]=[],ge[t.DaffCartOperationType.Item]=[],ge[t.DaffCartOperationType.ShippingAddress]=[],ge[t.DaffCartOperationType.BillingAddress]=[],ge[t.DaffCartOperationType.ShippingInformation]=[],ge[t.DaffCartOperationType.ShippingMethods]=[],ge[t.DaffCartOperationType.Payment]=[],ge[t.DaffCartOperationType.PaymentMethods]=[],ge[t.DaffCartOperationType.Coupon]=[],ge),resolved:t.DaffCartResolveState.Default}),Te=function(t){return function(e,a){var r;return{errors:Object.assign(Object.assign({},e),(r={},r[t]=e[t].concat(new Array(a)),r))}}},Ie=function(t){return function(e){var a;return{errors:Object.assign(Object.assign({},e),(a={},a[t]=[],a))}}},ve=function(t){return function(e,a){var r;return{loading:Object.assign(Object.assign({},e),(r={},r[t]=a,r))}}},Oe=Te(t.DaffCartOperationType.BillingAddress),be=Ie(t.DaffCartOperationType.BillingAddress),je=ve(t.DaffCartOperationType.BillingAddress);function Me(e,a){switch(void 0===e&&(e=Se),a.type){case t.DaffCartBillingAddressActionTypes.CartBillingAddressLoadAction:return Object.assign(Object.assign({},e),je(e.loading,"Resolving"));case t.DaffCartBillingAddressActionTypes.CartBillingAddressUpdateAction:case t.DaffCartAddressActionTypes.CartAddressUpdateAction:return Object.assign(Object.assign({},e),je(e.loading,"Mutating"));case t.DaffCartBillingAddressActionTypes.CartBillingAddressLoadSuccessAction:return Object.assign(Object.assign(Object.assign(Object.assign({},e),be(e.errors)),{cart:Object.assign(Object.assign({},e.cart),{billing_address:a.payload})}),je(e.loading,"Stable"));case t.DaffCartBillingAddressActionTypes.CartBillingAddressUpdateSuccessAction:case t.DaffCartAddressActionTypes.CartAddressUpdateSuccessAction:return Object.assign(Object.assign(Object.assign(Object.assign({},e),be(e.errors)),{cart:Object.assign(Object.assign({},e.cart),a.payload)}),je(e.loading,"Stable"));case t.DaffCartBillingAddressActionTypes.CartBillingAddressLoadFailureAction:case t.DaffCartBillingAddressActionTypes.CartBillingAddressUpdateFailureAction:case t.DaffCartAddressActionTypes.CartAddressUpdateFailureAction:return Object.assign(Object.assign(Object.assign({},e),Oe(e.errors,a.payload)),je(e.loading,"Stable"));default:return e}}var Re=Te(t.DaffCartOperationType.Coupon),Pe=Ie(t.DaffCartOperationType.Coupon),Fe=ve(t.DaffCartOperationType.Coupon);function Le(e,a){switch(void 0===e&&(e=Se),a.type){case t.DaffCartCouponActionTypes.CartCouponListAction:return Object.assign(Object.assign({},e),Fe(e.loading,"Resolving"));case t.DaffCartCouponActionTypes.CartCouponApplyAction:case t.DaffCartCouponActionTypes.CartCouponRemoveAction:case t.DaffCartCouponActionTypes.CartCouponRemoveAllAction:return Object.assign(Object.assign({},e),Fe(e.loading,"Mutating"));case t.DaffCartCouponActionTypes.CartCouponApplySuccessAction:case t.DaffCartCouponActionTypes.CartCouponRemoveSuccessAction:case t.DaffCartCouponActionTypes.CartCouponRemoveAllSuccessAction:return Object.assign(Object.assign(Object.assign(Object.assign({},e),Pe(e.errors)),{cart:Object.assign(Object.assign({},e.cart),a.payload)}),Fe(e.loading,"Stable"));case t.DaffCartCouponActionTypes.CartCouponListSuccessAction:return Object.assign(Object.assign(Object.assign(Object.assign({},e),Pe(e.errors)),{cart:Object.assign(Object.assign({},e.cart),{coupons:a.payload})}),Fe(e.loading,"Stable"));case t.DaffCartCouponActionTypes.CartCouponApplyFailureAction:case t.DaffCartCouponActionTypes.CartCouponListFailureAction:case t.DaffCartCouponActionTypes.CartCouponRemoveAllFailureAction:case t.DaffCartCouponActionTypes.CartCouponRemoveFailureAction:return Object.assign(Object.assign(Object.assign({},e),Re(e.errors,a.payload)),Fe(e.loading,"Stable"));default:return e}}var Ee=Te(t.DaffCartOperationType.Item),$e=Ie(t.DaffCartOperationType.Item),we=ve(t.DaffCartOperationType.Item);function Ue(e,a){switch(void 0===e&&(e=Se),a.type){case t.DaffCartItemActionTypes.CartItemListAction:case t.DaffCartItemActionTypes.CartItemLoadAction:return Object.assign(Object.assign({},e),we(e.loading,"Resolving"));case t.DaffCartItemActionTypes.CartItemAddAction:return Object.assign(Object.assign({},e),we(e.loading,"Adding"));case t.DaffCartItemActionTypes.CartItemListSuccessAction:return Object.assign(Object.assign(Object.assign(Object.assign({},e),$e(e.errors)),{cart:Object.assign(Object.assign({},e.cart),{items:a.payload})}),we(e.loading,"Stable"));case t.DaffCartItemActionTypes.CartItemLoadSuccessAction:return Object.assign(Object.assign(Object.assign(Object.assign({},e),$e(e.errors)),{cart:Object.assign(Object.assign({},e.cart),{items:e.cart.items.map((function(t){return t.id===a.payload.id?a.payload:t}))})}),we(e.loading,"Stable"));case t.DaffCartItemActionTypes.CartItemUpdateSuccessAction:case t.DaffCartItemActionTypes.CartItemAddSuccessAction:case t.DaffCartItemActionTypes.CartItemDeleteSuccessAction:return Object.assign(Object.assign(Object.assign(Object.assign({},e),$e(e.errors)),{cart:Object.assign(Object.assign({},e.cart),a.payload)}),we(e.loading,"Stable"));case t.DaffCartItemActionTypes.CartItemListFailureAction:case t.DaffCartItemActionTypes.CartItemLoadFailureAction:case t.DaffCartItemActionTypes.CartItemUpdateFailureAction:case t.DaffCartItemActionTypes.CartItemAddFailureAction:case t.DaffCartItemActionTypes.CartItemDeleteFailureAction:return Object.assign(Object.assign(Object.assign({},e),Ee(e.errors,a.payload)),we(e.loading,"Stable"));default:return e}}var Be=Te(t.DaffCartOperationType.PaymentMethods),_e=Ie(t.DaffCartOperationType.PaymentMethods),xe=ve(t.DaffCartOperationType.PaymentMethods);function We(e,a){switch(void 0===e&&(e=Se),a.type){case t.DaffCartPaymentMethodsActionTypes.CartPaymentMethodsLoadAction:return Object.assign(Object.assign({},e),xe(e.loading,"Resolving"));case t.DaffCartPaymentMethodsActionTypes.CartPaymentMethodsLoadSuccessAction:return Object.assign(Object.assign(Object.assign(Object.assign({},e),_e(e.errors)),{cart:Object.assign(Object.assign({},e.cart),{available_payment_methods:a.payload})}),xe(e.loading,"Stable"));case t.DaffCartPaymentMethodsActionTypes.CartPaymentMethodsLoadFailureAction:return Object.assign(Object.assign(Object.assign({},e),Be(e.errors,a.payload)),xe(e.loading,"Stable"));default:return e}}var He=Te(t.DaffCartOperationType.Payment),ze=Ie(t.DaffCartOperationType.Payment),qe=ve(t.DaffCartOperationType.Payment);function ke(e,a){switch(void 0===e&&(e=Se),a.type){case t.DaffCartPaymentActionTypes.CartPaymentLoadAction:return Object.assign(Object.assign({},e),qe(e.loading,"Resolving"));case t.DaffCartPaymentActionTypes.CartPaymentUpdateAction:case t.DaffCartPaymentActionTypes.CartPaymentUpdateWithBillingAction:case t.DaffCartPaymentActionTypes.CartPaymentRemoveAction:return Object.assign(Object.assign({},e),qe(e.loading,"Mutating"));case t.DaffCartPaymentActionTypes.CartPaymentLoadSuccessAction:return Object.assign(Object.assign(Object.assign(Object.assign({},e),ze(e.errors)),{cart:Object.assign(Object.assign({},e.cart),{payment:a.payload})}),qe(e.loading,"Stable"));case t.DaffCartPaymentActionTypes.CartPaymentRemoveSuccessAction:return Object.assign(Object.assign(Object.assign(Object.assign({},e),ze(e.errors)),{cart:Object.assign(Object.assign({},e.cart),{payment:null})}),qe(e.loading,"Stable"));case t.DaffCartPaymentActionTypes.CartPaymentUpdateSuccessAction:case t.DaffCartPaymentActionTypes.CartPaymentUpdateWithBillingSuccessAction:return Object.assign(Object.assign(Object.assign(Object.assign({},e),ze(e.errors)),{cart:Object.assign(Object.assign({},e.cart),a.payload)}),qe(e.loading,"Stable"));case t.DaffCartPaymentActionTypes.CartPaymentLoadFailureAction:case t.DaffCartPaymentActionTypes.CartPaymentUpdateFailureAction:case t.DaffCartPaymentActionTypes.CartPaymentUpdateWithBillingFailureAction:case t.DaffCartPaymentActionTypes.CartPaymentRemoveFailureAction:return Object.assign(Object.assign(Object.assign({},e),He(e.errors,a.payload)),qe(e.loading,"Stable"));case t.DaffCartPaymentActionTypes.CartPaymentMethodAddAction:return Object.assign(Object.assign({},e),{cart:Object.assign(Object.assign({},e.cart),{payment:Object.assign({},a.payload)})});default:return e}}function Ne(e,a){switch(void 0===e&&(e=Se),a.type){case t.DaffCartActionTypes.ResolveCartAction:return Object.assign(Object.assign({},e),{resolved:t.DaffCartResolveState.Resolving});case t.DaffCartActionTypes.ResolveCartServerSideAction:return Object.assign(Object.assign({},e),{resolved:t.DaffCartResolveState.ServerSide});case t.DaffCartActionTypes.ResolveCartSuccessAction:return Object.assign(Object.assign({},e),{resolved:t.DaffCartResolveState.Succeeded});case t.DaffCartActionTypes.ResolveCartFailureAction:return Object.assign(Object.assign({},e),{resolved:t.DaffCartResolveState.Failed});default:return e}}var Ve=Te(t.DaffCartOperationType.ShippingAddress),Qe=Ie(t.DaffCartOperationType.ShippingAddress),Ge=ve(t.DaffCartOperationType.ShippingAddress);function Xe(e,a){switch(void 0===e&&(e=Se),a.type){case t.DaffCartShippingAddressActionTypes.CartShippingAddressLoadAction:return Object.assign(Object.assign({},e),Ge(e.loading,"Resolving"));case t.DaffCartShippingAddressActionTypes.CartShippingAddressUpdateAction:case t.DaffCartAddressActionTypes.CartAddressUpdateAction:return Object.assign(Object.assign({},e),Ge(e.loading,"Mutating"));case t.DaffCartShippingAddressActionTypes.CartShippingAddressLoadSuccessAction:return Object.assign(Object.assign(Object.assign(Object.assign({},e),Qe(e.errors)),{cart:Object.assign(Object.assign({},e.cart),{shipping_address:a.payload})}),Ge(e.loading,"Stable"));case t.DaffCartShippingAddressActionTypes.CartShippingAddressUpdateSuccessAction:case t.DaffCartAddressActionTypes.CartAddressUpdateSuccessAction:return Object.assign(Object.assign(Object.assign(Object.assign({},e),Qe(e.errors)),{cart:Object.assign(Object.assign({},e.cart),a.payload)}),Ge(e.loading,"Stable"));case t.DaffCartShippingAddressActionTypes.CartShippingAddressLoadFailureAction:case t.DaffCartShippingAddressActionTypes.CartShippingAddressUpdateFailureAction:case t.DaffCartAddressActionTypes.CartAddressUpdateFailureAction:return Object.assign(Object.assign(Object.assign({},e),Ve(e.errors,a.payload)),Ge(e.loading,"Stable"));default:return e}}var Ye=Te(t.DaffCartOperationType.ShippingInformation),Ke=Ie(t.DaffCartOperationType.ShippingInformation),Je=ve(t.DaffCartOperationType.ShippingInformation);function Ze(e,a){switch(void 0===e&&(e=Se),a.type){case t.DaffCartShippingInformationActionTypes.CartShippingInformationLoadAction:return Object.assign(Object.assign({},e),Je(e.loading,"Resolving"));case t.DaffCartShippingInformationActionTypes.CartShippingInformationUpdateAction:case t.DaffCartShippingInformationActionTypes.CartShippingInformationDeleteAction:return Object.assign(Object.assign({},e),Je(e.loading,"Mutating"));case t.DaffCartShippingInformationActionTypes.CartShippingInformationLoadSuccessAction:return Object.assign(Object.assign(Object.assign(Object.assign({},e),Ke(e.errors)),{cart:Object.assign(Object.assign({},e.cart),{shipping_information:Object.assign(Object.assign({},a.payload),{address_id:null})})}),Je(e.loading,"Stable"));case t.DaffCartShippingInformationActionTypes.CartShippingInformationUpdateSuccessAction:case t.DaffCartShippingInformationActionTypes.CartShippingInformationDeleteSuccessAction:return Object.assign(Object.assign(Object.assign(Object.assign({},e),Ke(e.errors)),{cart:Object.assign(Object.assign(Object.assign({},e.cart),{shipping_information:null}),a.payload)}),Je(e.loading,"Stable"));case t.DaffCartShippingInformationActionTypes.CartShippingInformationLoadFailureAction:case t.DaffCartShippingInformationActionTypes.CartShippingInformationUpdateFailureAction:case t.DaffCartShippingInformationActionTypes.CartShippingInformationDeleteFailureAction:return Object.assign(Object.assign(Object.assign({},e),Ye(e.errors,a.payload)),Je(e.loading,"Stable"));default:return e}}var ta=Te(t.DaffCartOperationType.ShippingMethods),ea=Ie(t.DaffCartOperationType.ShippingMethods),aa=ve(t.DaffCartOperationType.ShippingMethods);function ra(e,a){switch(void 0===e&&(e=Se),a.type){case t.DaffCartShippingMethodsActionTypes.CartShippingMethodsLoadAction:return Object.assign(Object.assign({},e),aa(e.loading,"Resolving"));case t.DaffCartShippingMethodsActionTypes.CartShippingMethodsLoadSuccessAction:return Object.assign(Object.assign(Object.assign(Object.assign({},e),ea(e.errors)),{cart:Object.assign(Object.assign({},e.cart),{available_shipping_methods:a.payload})}),aa(e.loading,"Stable"));case t.DaffCartShippingMethodsActionTypes.CartShippingMethodsLoadFailureAction:return Object.assign(Object.assign(Object.assign({},e),ta(e.errors,a.payload)),aa(e.loading,"Stable"));default:return e}}var ia=Te(t.DaffCartOperationType.Cart),na=Ie(t.DaffCartOperationType.Cart),oa=ve(t.DaffCartOperationType.Cart);function sa(e,a){switch(void 0===e&&(e=Se),a.type){case t.DaffCartActionTypes.ResolveCartAction:case t.DaffCartActionTypes.CartLoadAction:return Object.assign(Object.assign({},e),oa(e.loading,"Resolving"));case t.DaffCartActionTypes.CartClearAction:case t.DaffCartActionTypes.AddToCartAction:case t.DaffCartActionTypes.CartCreateAction:return Object.assign(Object.assign({},e),oa(e.loading,"Mutating"));case t.DaffCartActionTypes.CartLoadSuccessAction:case t.DaffCartActionTypes.CartClearSuccessAction:case t.DaffCartActionTypes.AddToCartSuccessAction:case t.DaffCartActionTypes.CartCreateSuccessAction:case t.DaffCartActionTypes.ResolveCartSuccessAction:return Object.assign(Object.assign(Object.assign(Object.assign({},e),na(e.errors)),{cart:Object.assign(Object.assign({},e.cart),a.payload)}),oa(e.loading,"Stable"));case t.DaffCartActionTypes.CartCreateSuccessAction:return Object.assign(Object.assign(Object.assign(Object.assign({},e),na(e.errors)),{cart:Object.assign(Object.assign({},Se.cart),a.payload)}),oa(e.loading,"Stable"));case t.DaffCartActionTypes.CartLoadFailureAction:case t.DaffCartActionTypes.CartClearFailureAction:case t.DaffCartActionTypes.AddToCartFailureAction:case t.DaffCartActionTypes.CartCreateFailureAction:case t.DaffCartActionTypes.CartStorageFailureAction:case t.DaffCartActionTypes.ResolveCartFailureAction:case t.DaffCartActionTypes.ResolveCartServerSideAction:return Object.assign(Object.assign(Object.assign({},e),ia(e.errors,a.payload)),oa(e.loading,"Stable"));default:return e}}var ca=r.daffComposeReducers([sa,Ue,Me,Xe,ra,Ze,ke,We,Le,Ne]);function pa(t,e){return void 0===t&&(t=Se),ca(t,e)}var fa={cart:pa,cartItems:pe,order:De},da="daffCart",ua=new i.InjectionToken("DAFF_CART_EXTRA_REDUCERS",{factory:function(){return[]}});var la=function(){var t;return function(){return t=t||{selectCartFeatureState:e.createFeatureSelector(da)}}}(),Ca=function(){var a=la().selectCartFeatureState,r=ce().getSelectors(),i=e.createSelector(a,(function(t){return t.cartItems})),s=e.createSelector(i,r.selectIds),c=e.createSelector(i,r.selectEntities),p=e.createSelector(i,r.selectAll),f=e.createSelector(i,r.selectTotal),d=e.defaultMemoize((function(t){return e.createSelector(c,(function(e){return e[t]}))})).memoized,u=e.createSelector(p,(function(t){return t.reduce((function(t,e){return t+e.qty}),0)})),l=e.defaultMemoize((function(t){return e.createSelector(d(t),(function(t){return t.type!==n.DaffCartItemInputType.Configurable?null:t.attributes}))})).memoized,C=e.defaultMemoize((function(t){return e.createSelector(d(t),(function(t){return t.type!==n.DaffCartItemInputType.Composite?null:t.options}))})).memoized,h=e.defaultMemoize((function(t){return e.createSelector(d(t),(function(t){return t?!t.in_stock:null}))})).memoized,A=e.createSelector(p,(function(e){return null==e?void 0:e.reduce((function(e,a){return e||a.daffState===t.DaffCartItemStateEnum.Mutating}),!1)})),y=e.defaultMemoize((function(t){return e.createSelector(d(t),(function(t){return(null==t?void 0:t.daffState)||null}))})).memoized,g=e.defaultMemoize((function(t){return e.createSelector(d(t),(function(t){return(null==t?void 0:t.qty)||0}))})).memoized,m=e.defaultMemoize((function(t){return e.createSelector(d(t),(function(t){return(null==t?void 0:t.row_total)||0}))})).memoized,D=e.defaultMemoize((function(t){return e.createSelector(d(t),(function(t){return(null==t?void 0:t.price)||0}))})).memoized,S=e.defaultMemoize((function(t){return e.createSelector(d(t),(function(t){return(null==t?void 0:t.discounts)||[]}))})).memoized,T=e.defaultMemoize((function(t){return e.createSelector(S(t),(function(t){return(null==t?void 0:t.reduce((function(t,e){var a=e.amount;return o.daffAdd(t,a)}),0))||0}))})).memoized;return{selectCartItemEntitiesState:i,selectCartItemIds:s,selectCartItemEntities:c,selectAllCartItems:p,selectCartItemTotal:f,selectCartItem:d,selectTotalNumberOfCartItems:u,selectCartItemConfiguredAttributes:l,selectCartItemCompositeOptions:C,selectIsCartItemOutOfStock:h,selectCartItemMutating:A,selectCartItemState:y,selectCartItemPrice:D,selectCartItemRowTotal:m,selectCartItemQuantity:g,selectCartItemDiscounts:S,selectCartItemTotalDiscount:T}},ha=function(){var t;return function(){return t=t||Ca()}}(),Aa=function(){var t=la().selectCartFeatureState,a=e.createSelector(t,(function(t){return t.order})),r=e.createSelector(a,(function(t){return t.cartOrderResult})),i=e.createSelector(r,(function(t){return t.orderId})),n=e.createSelector(r,(function(t){return t.cartId}));return{selectCartOrderState:a,selectCartOrderLoading:e.createSelector(a,(function(t){return"Stable"!==t.loading})),selectCartOrderMutating:e.createSelector(a,(function(t){return"Mutating"===t.loading})),selectCartOrderErrors:e.createSelector(a,(function(t){return t.errors})),selectCartOrderValue:r,selectCartOrderId:i,selectCartOrderCartId:n,selectHasOrderResult:e.createSelector(r,(function(t){return!!(t&&t.orderId&&t.cartId)}))}},ya=function(){var t;return function(){return t=t||Aa()}}(),ga=function(){var a=la().selectCartFeatureState,r=ha().selectCartItemMutating,i=e.createSelector(a,(function(t){return t.cart})),o=e.createSelector(i,(function(t){return t.cart})),c=e.createSelector(i,(function(t){return t.resolved})),p=e.createSelector(i,(function(t){return t.loading})),f=e.createSelector(p,(function(e){return"Stable"!==e[t.DaffCartOperationType.Cart]})),d=e.createSelector(p,(function(e){return"Resolving"===e[t.DaffCartOperationType.Cart]})),u=e.createSelector(p,(function(e){return"Mutating"===e[t.DaffCartOperationType.Cart]})),l=e.createSelector(p,(function(e){return"Stable"!==e[t.DaffCartOperationType.BillingAddress]})),C=e.createSelector(p,(function(e){return"Resolving"===e[t.DaffCartOperationType.BillingAddress]})),h=e.createSelector(p,(function(e){return"Mutating"===e[t.DaffCartOperationType.BillingAddress]})),A=e.createSelector(p,(function(e){return"Stable"!==e[t.DaffCartOperationType.ShippingAddress]})),y=e.createSelector(p,(function(e){return"Resolving"===e[t.DaffCartOperationType.ShippingAddress]})),g=e.createSelector(p,(function(e){return"Mutating"===e[t.DaffCartOperationType.ShippingAddress]})),m=e.createSelector(p,(function(e){return"Stable"!==e[t.DaffCartOperationType.ShippingInformation]})),D=e.createSelector(p,(function(e){return"Resolving"===e[t.DaffCartOperationType.ShippingInformation]})),S=e.createSelector(p,(function(e){return"Mutating"===e[t.DaffCartOperationType.ShippingInformation]})),T=e.createSelector(p,(function(e){return"Stable"!==e[t.DaffCartOperationType.ShippingMethods]})),I=e.createSelector(p,(function(e){return"Resolving"===e[t.DaffCartOperationType.ShippingMethods]})),v=e.createSelector(p,(function(e){return"Stable"!==e[t.DaffCartOperationType.Payment]})),O=e.createSelector(p,(function(e){return"Resolving"===e[t.DaffCartOperationType.Payment]})),b=e.createSelector(p,(function(e){return"Mutating"===e[t.DaffCartOperationType.Payment]})),j=e.createSelector(p,(function(e){return"Stable"!==e[t.DaffCartOperationType.PaymentMethods]})),M=e.createSelector(p,(function(e){return"Resolving"===e[t.DaffCartOperationType.PaymentMethods]})),R=e.createSelector(p,(function(e){return"Stable"!==e[t.DaffCartOperationType.Item]})),P=e.createSelector(p,(function(e){return"Adding"===e[t.DaffCartOperationType.Item]})),F=e.createSelector(p,(function(e){return"Resolving"===e[t.DaffCartOperationType.Item]})),L=e.createSelector(p,(function(e){return"Stable"!==e[t.DaffCartOperationType.Coupon]})),E=e.createSelector(p,(function(e){return"Resolving"===e[t.DaffCartOperationType.Coupon]})),$=e.createSelector(p,(function(e){return"Mutating"===e[t.DaffCartOperationType.Coupon]})),w=e.createSelector(p,(function(t){return[f,l,A,m,T,v,j,L,R].map((function(e){return e.projector(t)})).reduce((function(t,e){return t||e}),!1)})),U=e.createSelector(p,(function(t){return[d,C,y,D,I,O,M,E,F].map((function(e){return e.projector(t)})).reduce((function(t,e){return t||e}),!1)})),B=e.createSelector(p,r,(function(t,e){return[u,h,g,S,b,$,P].map((function(e){return e.projector(t)})).reduce((function(t,e){return t||e}),!1)||e})),_=e.createSelector(i,(function(t){return t.errors})),x=e.createSelector(_,(function(e){return e[t.DaffCartOperationType.Cart]})),W=e.createSelector(_,(function(e){return e[t.DaffCartOperationType.BillingAddress]})),H=e.createSelector(_,(function(e){return e[t.DaffCartOperationType.ShippingAddress]})),z=e.createSelector(_,(function(e){return e[t.DaffCartOperationType.ShippingInformation]})),q=e.createSelector(_,(function(e){return e[t.DaffCartOperationType.ShippingMethods]})),k=e.createSelector(_,(function(e){return e[t.DaffCartOperationType.Payment]})),N=e.createSelector(_,(function(e){return e[t.DaffCartOperationType.PaymentMethods]})),V=e.createSelector(_,(function(e){return e[t.DaffCartOperationType.Item]})),Q=e.createSelector(_,(function(e){return e[t.DaffCartOperationType.Coupon]})),G=e.createSelector(o,(function(t){return t.id})),X=e.createSelector(o,(function(t){var e=t.totals.find((function(t){return t.name===n.DaffCartTotalTypeEnum.subtotalExcludingTax}));return e?e.value:null})),Y=e.createSelector(o,(function(t){var e=t.totals.find((function(t){return t.name===n.DaffCartTotalTypeEnum.grandTotal}));return e?e.value:null})),K=e.createSelector(o,(function(t){var e=t.totals.find((function(t){return t.name===n.DaffCartTotalTypeEnum.subtotalExcludingTax}));return e?e.value:null})),J=e.createSelector(o,(function(t){var e=t.totals.find((function(t){return t.name===n.DaffCartTotalTypeEnum.subtotalIncludingTax}));return e?e.value:null})),Z=e.createSelector(o,(function(t){var e=t.totals.find((function(t){return t.name===n.DaffCartTotalTypeEnum.subtotalWithDiscountExcludingTax}));return e?e.value:null})),tt=e.createSelector(o,(function(t){var e=t.totals.find((function(t){return t.name===n.DaffCartTotalTypeEnum.subtotalWithDiscountIncludingTax}));return e?e.value:null})),et=e.createSelector(o,(function(t){var e=t.totals.find((function(t){return t.name===n.DaffCartTotalTypeEnum.tax}));return e?e.value:null})),at=e.createSelector(o,(function(t){var e=t.totals.filter((function(t){return t.name===n.DaffCartTotalTypeEnum.discount}));return e||[]})),rt=e.createSelector(o,(function(t){var e=t.totals.find((function(t){return t.name===n.DaffCartTotalTypeEnum.shipping}));return e?e.value:null})),it=e.createSelector(o,(function(t){return t.coupons})),nt=e.createSelector(o,(function(t){return t.items})),ot=e.createSelector(o,(function(t){return t.items.reduce((function(t,e){return t||!e.in_stock}),!1)})),st=e.createSelector(o,(function(t){return t.billing_address})),ct=e.createSelector(o,(function(t){return t.shipping_address})),pt=e.createSelector(o,(function(t){return t.payment})),ft=e.createSelector(o,(function(t){return t.totals})),dt=e.createSelector(o,(function(t){return t.shipping_information})),ut=e.createSelector(o,(function(t){return t.available_shipping_methods})),lt=e.createSelector(o,(function(t){return t.available_payment_methods})),Ct=e.createSelector(o,(function(t){return!t||!t.items||0===t.items.length})),ht=e.createSelector(ct,st,(function(t,e){return s.daffComparePersonalAddresses(t,e)})),At=e.createSelector(st,(function(t){return!!t})),yt=e.createSelector(ct,(function(t){return!!t})),gt=e.createSelector(dt,(function(t){return!!t})),mt=e.createSelector(pt,(function(t){return!!t&&""!==t.method})),Dt=e.createSelector(Ct,At,yt,gt,mt,(function(t,e,a,r,i){return!t&&e&&a&&r&&i}));return{selectCartState:i,selectCartValue:o,selectCartResolved:c,selectCartLoadingObject:p,selectCartFeatureLoading:w,selectCartFeatureResolving:U,selectCartFeatureMutating:B,selectCartLoading:f,selectCartResolving:d,selectCartMutating:u,selectBillingAddressLoading:l,selectBillingAddressResolving:C,selectBillingAddressMutating:h,selectShippingAddressLoading:A,selectShippingAddressResolving:y,selectShippingAddressMutating:g,selectShippingInformationLoading:m,selectShippingInformationResolving:D,selectShippingInformationMutating:S,selectShippingMethodsLoading:T,selectShippingMethodsResolving:I,selectPaymentLoading:v,selectPaymentResolving:O,selectPaymentMutating:b,selectPaymentMethodsLoading:j,selectPaymentMethodsResolving:M,selectCouponLoading:L,selectCouponResolving:E,selectCouponMutating:$,selectItemLoading:R,selectItemAdding:P,selectItemResolving:F,selectCartErrorsObject:_,selectCartErrors:x,selectBillingAddressErrors:W,selectShippingAddressErrors:H,selectShippingInformationErrors:z,selectShippingMethodsErrors:q,selectPaymentErrors:k,selectPaymentMethodsErrors:N,selectItemErrors:V,selectCouponErrors:Q,selectCartId:G,selectCartSubtotal:X,selectCartGrandTotal:Y,selectCartSubtotalExcludingTax:K,selectCartSubtotalIncludingTax:J,selectCartSubtotalWithDiscountExcludingTax:Z,selectCartSubtotalWithDiscountIncludingTax:tt,selectCartDiscountTotals:at,selectCartTotalTax:et,selectCartShippingTotal:rt,selectCartCoupons:it,selectCartItems:nt,selectCartHasOutOfStockItems:ot,selectCartBillingAddress:st,selectCartShippingAddress:ct,selectCartPayment:pt,selectCartTotals:ft,selectCartShippingInformation:dt,selectCartAvailableShippingMethods:ut,selectCartAvailablePaymentMethods:lt,selectIsCartEmpty:Ct,selectIsBillingSameAsShipping:ht,selectHasBillingAddress:At,selectHasShippingAddress:yt,selectHasShippingMethod:gt,selectHasPaymentMethod:mt,selectCanPlaceOrder:Dt}},ma=function(){var t;return function(){return t=t||ga()}}(),Da=function(){return Object.assign(Object.assign(Object.assign(Object.assign({},la()),ya()),ma()),ha())},Sa=Da,Ta=function(){var t;return function(){return t=t||Da()}},Ia=Ta(),va=new i.InjectionToken("DaffCartItemStateDebounceTime"),Oa=function(e,a,r,i){var n=this;this.actions$=e,this.errorMatcher=a,this.driver=r,this.storage=i,this.update$=this.actions$.pipe(c.ofType(t.DaffCartAddressActionTypes.CartAddressUpdateAction),f.switchMap((function(t){return p.of(null).pipe(f.map((function(){return n.storage.getCartId()})),f.switchMap((function(e){return n.driver.update(e,t.payload)})),f.map((function(t){return new ft(t)})),f.catchError((function(t){return p.of(t instanceof o.DaffStorageServiceError?new C(n.errorMatcher(t)):new dt(n.errorMatcher(t)))})))})))};Oa.decorators=[{type:i.Injectable}],Oa.ctorParameters=function(){return[{type:c.Actions},{type:void 0,decorators:[{type:i.Inject,args:[n.DAFF_CART_ERROR_MATCHER]}]},{type:void 0,decorators:[{type:i.Inject,args:[d.DaffCartAddressDriver]}]},{type:n.DaffCartStorageService}]},de([c.Effect(),ue("design:type",Object)],Oa.prototype,"update$",void 0);var ba=function(e,a,r,i){var n=this;this.actions$=e,this.errorMatcher=a,this.driver=r,this.storage=i,this.get$=this.actions$.pipe(c.ofType(t.DaffCartBillingAddressActionTypes.CartBillingAddressLoadAction),f.switchMap((function(t){return n.driver.get(n.storage.getCartId()).pipe(f.map((function(t){return new Y(t)})),f.catchError((function(t){return p.of(new K(n.errorMatcher(t)))})))}))),this.update$=this.actions$.pipe(c.ofType(t.DaffCartBillingAddressActionTypes.CartBillingAddressUpdateAction),f.switchMap((function(t){return n.driver.update(n.storage.getCartId(),t.payload).pipe(f.map((function(t){return new Z(t)})),f.catchError((function(t){return p.of(new tt(n.errorMatcher(t)))})))})))};ba.decorators=[{type:i.Injectable}],ba.ctorParameters=function(){return[{type:c.Actions},{type:void 0,decorators:[{type:i.Inject,args:[n.DAFF_CART_ERROR_MATCHER]}]},{type:void 0,decorators:[{type:i.Inject,args:[d.DaffCartBillingAddressDriver]}]},{type:n.DaffCartStorageService}]},de([c.Effect(),ue("design:type",Object)],ba.prototype,"get$",void 0),de([c.Effect(),ue("design:type",Object)],ba.prototype,"update$",void 0);var ja=function(e,a,r,i){var n=this;this.actions$=e,this.errorMatcher=a,this.driver=r,this.storage=i,this.apply$=this.actions$.pipe(c.ofType(t.DaffCartCouponActionTypes.CartCouponApplyAction),f.switchMap((function(t){return p.of(null).pipe(f.map((function(){return n.storage.getCartId()})),f.switchMap((function(e){return n.driver.apply(e,t.payload)})),f.map((function(t){return new Yt(t)})),f.catchError((function(t){return p.of(t instanceof o.DaffStorageServiceError?new C(n.errorMatcher(t)):new Kt(n.errorMatcher(t)))})))}))),this.list$=this.actions$.pipe(c.ofType(t.DaffCartCouponActionTypes.CartCouponListAction),f.switchMap((function(t){return p.of(null).pipe(f.map((function(){return n.storage.getCartId()})),f.switchMap((function(t){return n.driver.list(t)})),f.map((function(t){return new Zt(t)})),f.catchError((function(t){return p.of(t instanceof o.DaffStorageServiceError?new C(n.errorMatcher(t)):new te(n.errorMatcher(t)))})))}))),this.remove$=this.actions$.pipe(c.ofType(t.DaffCartCouponActionTypes.CartCouponRemoveAction),f.switchMap((function(t){return p.of(null).pipe(f.map((function(){return n.storage.getCartId()})),f.switchMap((function(e){return n.driver.remove(e,t.payload)})),f.map((function(t){return new ae(t)})),f.catchError((function(t){return p.of(t instanceof o.DaffStorageServiceError?new C(n.errorMatcher(t)):new re(n.errorMatcher(t)))})))}))),this.removeAll$=this.actions$.pipe(c.ofType(t.DaffCartCouponActionTypes.CartCouponRemoveAllAction),f.switchMap((function(t){return p.of(null).pipe(f.map((function(){return n.storage.getCartId()})),f.switchMap((function(t){return n.driver.removeAll(t)})),f.map((function(t){return new ne(t)})),f.catchError((function(t){return p.of(t instanceof o.DaffStorageServiceError?new C(n.errorMatcher(t)):new oe(n.errorMatcher(t)))})))})))};ja.decorators=[{type:i.Injectable}],ja.ctorParameters=function(){return[{type:c.Actions},{type:void 0,decorators:[{type:i.Inject,args:[n.DAFF_CART_ERROR_MATCHER]}]},{type:void 0,decorators:[{type:i.Inject,args:[d.DaffCartCouponDriver]}]},{type:n.DaffCartStorageService}]},de([c.Effect(),ue("design:type",Object)],ja.prototype,"apply$",void 0),de([c.Effect(),ue("design:type",Object)],ja.prototype,"list$",void 0),de([c.Effect(),ue("design:type",Object)],ja.prototype,"remove$",void 0),de([c.Effect(),ue("design:type",Object)],ja.prototype,"removeAll$",void 0);var Ma=function(e,a,r,i,n){var o=this;this.actions$=e,this.errorMatcher=a,this.driver=r,this.storage=i,this.cartItemStateDebounceTime=n,this.list$=this.actions$.pipe(c.ofType(t.DaffCartItemActionTypes.CartItemListAction),f.switchMap((function(t){return o.driver.list(o.storage.getCartId()).pipe(f.map((function(t){return new E(t)})),f.catchError((function(t){return p.of(new $(o.errorMatcher(t)))})))}))),this.get$=this.actions$.pipe(c.ofType(t.DaffCartItemActionTypes.CartItemLoadAction),f.switchMap((function(t){return o.driver.get(o.storage.getCartId(),t.itemId).pipe(f.map((function(t){return new U(t)})),f.catchError((function(e){return p.of(new B(o.errorMatcher(e),t.itemId))})))}))),this.add$=this.actions$.pipe(c.ofType(t.DaffCartItemActionTypes.CartItemAddAction),f.switchMap((function(t){return o.driver.add(o.storage.getCartId(),t.input).pipe(f.map((function(t){return new z(t)})),f.catchError((function(t){return p.of(new q(o.errorMatcher(t)))})))}))),this.update$=this.actions$.pipe(c.ofType(t.DaffCartItemActionTypes.CartItemUpdateAction),f.mergeMap((function(t){return o.driver.update(o.storage.getCartId(),t.itemId,t.changes).pipe(f.map((function(e){return new x(e,t.itemId)})),f.catchError((function(e){return p.of(new W(o.errorMatcher(e),t.itemId))})))}))),this.resetCartItemStateAfterChange$=this.actions$.pipe(c.ofType(t.DaffCartItemActionTypes.CartItemAddSuccessAction,t.DaffCartItemActionTypes.CartItemUpdateSuccessAction,t.DaffCartItemActionTypes.CartItemUpdateAction),f.debounceTime(this.cartItemStateDebounceTime),c.ofType(t.DaffCartItemActionTypes.CartItemAddSuccessAction,t.DaffCartItemActionTypes.CartItemUpdateSuccessAction),f.mapTo(new Q)),this.delete$=this.actions$.pipe(c.ofType(t.DaffCartItemActionTypes.CartItemDeleteAction),f.mergeMap((function(t){return o.driver.delete(o.storage.getCartId(),t.itemId).pipe(f.map((function(t){return new N(t)})),f.catchError((function(e){return p.of(new V(o.errorMatcher(e),t.itemId))})))})))};Ma.decorators=[{type:i.Injectable}],Ma.ctorParameters=function(){return[{type:c.Actions},{type:void 0,decorators:[{type:i.Inject,args:[n.DAFF_CART_ERROR_MATCHER]}]},{type:void 0,decorators:[{type:i.Inject,args:[d.DaffCartItemDriver]}]},{type:n.DaffCartStorageService},{type:Number,decorators:[{type:i.Inject,args:[va]}]}]},de([c.Effect(),ue("design:type",Object)],Ma.prototype,"list$",void 0),de([c.Effect(),ue("design:type",Object)],Ma.prototype,"get$",void 0),de([c.Effect(),ue("design:type",Object)],Ma.prototype,"add$",void 0),de([c.Effect(),ue("design:type",Object)],Ma.prototype,"update$",void 0),de([c.Effect(),ue("design:type",Object)],Ma.prototype,"resetCartItemStateAfterChange$",void 0),de([c.Effect(),ue("design:type",Object)],Ma.prototype,"delete$",void 0);var Ra=function(e,a,r,i){var n=this;this.actions$=e,this.errorMatcher=a,this.driver=r,this.storage=i,this.placeOrder$=this.actions$.pipe(c.ofType(t.DaffCartOrderActionTypes.CartPlaceOrderAction),f.switchMap((function(t){return p.of(null).pipe(f.map((function(){return n.storage.getCartId()})),f.switchMap((function(e){return n.driver.placeOrder(e,t.payload)})),f.map((function(t){return new Vt(t)})),f.catchError((function(t){return p.of(t instanceof o.DaffStorageServiceError?new C(n.errorMatcher(t)):new Qt(n.errorMatcher(t)))})))}))),this.resetCart$=this.actions$.pipe(c.ofType(t.DaffCartOrderActionTypes.CartPlaceOrderSuccessAction),f.mapTo(new g))};Ra.decorators=[{type:i.Injectable}],Ra.ctorParameters=function(){return[{type:c.Actions},{type:void 0,decorators:[{type:i.Inject,args:[n.DAFF_CART_ERROR_MATCHER]}]},{type:void 0,decorators:[{type:i.Inject,args:[d.DaffCartOrderDriver]}]},{type:n.DaffCartStorageService}]},de([c.Effect(),ue("design:type",Object)],Ra.prototype,"placeOrder$",void 0),de([c.Effect(),ue("design:type",Object)],Ra.prototype,"resetCart$",void 0);var Pa=function(e,a,r,i){var n=this;this.actions$=e,this.errorMatcher=a,this.driver=r,this.storage=i,this.list$=this.actions$.pipe(c.ofType(t.DaffCartPaymentMethodsActionTypes.CartPaymentMethodsLoadAction),f.switchMap((function(t){return n.driver.list(n.storage.getCartId()).pipe(f.map((function(t){return new zt(t)})),f.catchError((function(t){return p.of(new qt(n.errorMatcher(t)))})))})))};Pa.decorators=[{type:i.Injectable}],Pa.ctorParameters=function(){return[{type:c.Actions},{type:void 0,decorators:[{type:i.Inject,args:[n.DAFF_CART_ERROR_MATCHER]}]},{type:void 0,decorators:[{type:i.Inject,args:[d.DaffCartPaymentMethodsDriver]}]},{type:n.DaffCartStorageService}]},de([c.Effect(),ue("design:type",Object)],Pa.prototype,"list$",void 0);var Fa=function(e,a,r,i){var n=this;this.actions$=e,this.errorMatcher=a,this.driver=r,this.storage=i,this.get$=this.actions$.pipe(c.ofType(t.DaffCartPaymentActionTypes.CartPaymentLoadAction),f.switchMap((function(t){return n.driver.get(n.storage.getCartId()).pipe(f.map((function(t){return new Mt(t)})),f.catchError((function(t){return p.of(new Rt(n.errorMatcher(t)))})))}))),this.update$=this.actions$.pipe(c.ofType(t.DaffCartPaymentActionTypes.CartPaymentUpdateAction),f.switchMap((function(t){return n.driver.update(n.storage.getCartId(),t.payload).pipe(f.map((function(t){return new Ft(t)})),f.catchError((function(t){return p.of(new Lt(n.errorMatcher(t)))})))}))),this.updateWithBilling$=this.actions$.pipe(c.ofType(t.DaffCartPaymentActionTypes.CartPaymentUpdateWithBillingAction),f.switchMap((function(t){return n.driver.updateWithBilling(n.storage.getCartId(),t.payment,t.address).pipe(f.map((function(t){return new $t(t)})),f.catchError((function(t){return p.of(new wt(n.errorMatcher(t)))})))}))),this.remove$=this.actions$.pipe(c.ofType(t.DaffCartPaymentActionTypes.CartPaymentRemoveAction),f.switchMap((function(t){return n.driver.remove(n.storage.getCartId()).pipe(f.mapTo(new Bt),f.catchError((function(t){return p.of(new _t(n.errorMatcher(t)))})))})))};Fa.decorators=[{type:i.Injectable}],Fa.ctorParameters=function(){return[{type:c.Actions},{type:void 0,decorators:[{type:i.Inject,args:[n.DAFF_CART_ERROR_MATCHER]}]},{type:void 0,decorators:[{type:i.Inject,args:[d.DaffCartPaymentDriver]}]},{type:n.DaffCartStorageService}]},de([c.Effect(),ue("design:type",Object)],Fa.prototype,"get$",void 0),de([c.Effect(),ue("design:type",Object)],Fa.prototype,"update$",void 0),de([c.Effect(),ue("design:type",Object)],Fa.prototype,"updateWithBilling$",void 0),de([c.Effect(),ue("design:type",Object)],Fa.prototype,"remove$",void 0);var La=function(){function e(e,a,r,i){var s=this;this.actions$=e,this.errorMatcher=a,this.cartStorage=r,this.driver=i,this.onResolveCart=function(){return s.actions$.pipe(c.ofType(t.DaffCartActionTypes.ResolveCartAction),f.switchMap((function(){return p.of(null).pipe(f.map((function(){return s.cartStorage.getCartId()})),f.switchMap((function(t){return t?p.of({id:t}):s.driver.create()})),f.switchMap((function(t){var e=t.id;return s.driver.get(e)})),f.map((function(t){return new M(t)})),f.catchError((function(t){switch(!0){case t instanceof o.DaffServerSideStorageError:return p.of(new P(s.errorMatcher(new n.DaffCartServerSideResolutionError(t.message))));case t instanceof o.DaffStorageServiceError:return p.of(new R(s.errorMatcher(new n.DaffCartStorageResolutionError(t.message))));case t instanceof d.DaffCartNotFoundError:return s.driver.create().pipe(f.switchMap((function(t){var e=t.id;return s.driver.get(e)})),f.map((function(t){return new M(t)})),f.catchError((function(t){return p.of(new R(s.errorMatcher(new n.DaffCartNotFoundOrCreatedResolutionError(t.message))))})));default:return p.of(new R(s.errorMatcher(new n.DaffCartResolutionError(t.message))))}})))})))}}return e.prototype.ngrxOnInitEffects=function(){return new j},e}();La.decorators=[{type:i.Injectable}],La.ctorParameters=function(){return[{type:c.Actions},{type:void 0,decorators:[{type:i.Inject,args:[n.DAFF_CART_ERROR_MATCHER]}]},{type:n.DaffCartStorageService},{type:void 0,decorators:[{type:i.Inject,args:[d.DaffCartDriver]}]}]},de([c.Effect(),ue("design:type",Object)],La.prototype,"onResolveCart",void 0);var Ea=function(e,a,r,i){var n=this;this.actions$=e,this.errorMatcher=a,this.driver=r,this.storage=i,this.get$=this.actions$.pipe(c.ofType(t.DaffCartShippingAddressActionTypes.CartShippingAddressLoadAction),f.switchMap((function(t){return n.driver.get(n.storage.getCartId()).pipe(f.map((function(t){return new rt(t)})),f.catchError((function(t){return p.of(new it(n.errorMatcher(t)))})))}))),this.update$=this.actions$.pipe(c.ofType(t.DaffCartShippingAddressActionTypes.CartShippingAddressUpdateAction),f.switchMap((function(t){return n.driver.update(n.storage.getCartId(),t.payload).pipe(f.map((function(t){return new ot(t)})),f.catchError((function(t){return p.of(new st(n.errorMatcher(t)))})))})))};Ea.decorators=[{type:i.Injectable}],Ea.ctorParameters=function(){return[{type:c.Actions},{type:void 0,decorators:[{type:i.Inject,args:[n.DAFF_CART_ERROR_MATCHER]}]},{type:void 0,decorators:[{type:i.Inject,args:[d.DaffCartShippingAddressDriver]}]},{type:n.DaffCartStorageService}]},de([c.Effect(),ue("design:type",Object)],Ea.prototype,"get$",void 0),de([c.Effect(),ue("design:type",Object)],Ea.prototype,"update$",void 0);var $a=function(e,a,r,i){var n=this;this.actions$=e,this.errorMatcher=a,this.driver=r,this.storage=i,this.get$=this.actions$.pipe(c.ofType(t.DaffCartShippingInformationActionTypes.CartShippingInformationLoadAction),f.switchMap((function(t){return n.driver.get(n.storage.getCartId()).pipe(f.map((function(t){return new Ct(t)})),f.catchError((function(t){return p.of(new ht(n.errorMatcher(t)))})))}))),this.update$=this.actions$.pipe(c.ofType(t.DaffCartShippingInformationActionTypes.CartShippingInformationUpdateAction),f.switchMap((function(t){return n.driver.update(n.storage.getCartId(),t.payload).pipe(f.map((function(t){return new yt(t)})),f.catchError((function(t){return p.of(new gt(n.errorMatcher(t)))})))}))),this.delete$=this.actions$.pipe(c.ofType(t.DaffCartShippingInformationActionTypes.CartShippingInformationDeleteAction),f.switchMap((function(t){return n.driver.delete(n.storage.getCartId()).pipe(f.map((function(t){return new Dt(t)})),f.catchError((function(t){return p.of(new St(n.errorMatcher(t)))})))})))};$a.decorators=[{type:i.Injectable}],$a.ctorParameters=function(){return[{type:c.Actions},{type:void 0,decorators:[{type:i.Inject,args:[n.DAFF_CART_ERROR_MATCHER]}]},{type:void 0,decorators:[{type:i.Inject,args:[d.DaffCartShippingInformationDriver]}]},{type:n.DaffCartStorageService}]},de([c.Effect(),ue("design:type",Object)],$a.prototype,"get$",void 0),de([c.Effect(),ue("design:type",Object)],$a.prototype,"update$",void 0),de([c.Effect(),ue("design:type",Object)],$a.prototype,"delete$",void 0);var wa=function(e,a,r,i){var n=this;this.actions$=e,this.errorMatcher=a,this.driver=r,this.storage=i,this.list$=this.actions$.pipe(c.ofType(t.DaffCartShippingMethodsActionTypes.CartShippingMethodsLoadAction),f.switchMap((function(t){return n.driver.list(n.storage.getCartId()).pipe(f.map((function(t){return new vt(t)})),f.catchError((function(t){return p.of(new Ot(n.errorMatcher(t)))})))})))};wa.decorators=[{type:i.Injectable}],wa.ctorParameters=function(){return[{type:c.Actions},{type:void 0,decorators:[{type:i.Inject,args:[n.DAFF_CART_ERROR_MATCHER]}]},{type:void 0,decorators:[{type:i.Inject,args:[d.DaffCartShippingMethodsDriver]}]},{type:n.DaffCartStorageService}]},de([c.Effect(),ue("design:type",Object)],wa.prototype,"list$",void 0);var Ua=function(e,a,r,i){var n=this;this.actions$=e,this.errorMatcher=a,this.driver=r,this.storage=i,this.create$=this.actions$.pipe(c.ofType(t.DaffCartActionTypes.CartCreateAction),f.switchMap((function(t){return n.driver.create().pipe(f.map((function(t){return new m(t)})),f.catchError((function(t){return p.of(new D(n.errorMatcher(t)))})))}))),this.storeId$=this.actions$.pipe(c.ofType(t.DaffCartActionTypes.CartCreateSuccessAction,t.DaffCartActionTypes.ResolveCartSuccessAction),f.switchMap((function(t){return p.of(null).pipe(f.tap((function(){n.storage.setCartId(t.payload.id)})),f.switchMapTo(p.EMPTY),f.catchError((function(t){return p.of(new C(n.errorMatcher(t)))})))}))),this.get$=this.actions$.pipe(c.ofType(t.DaffCartActionTypes.CartLoadAction),f.switchMap((function(t){return p.of(null).pipe(f.map((function(){return n.storage.getCartId()})),f.switchMap((function(t){return n.driver.get(t)})),f.map((function(t){return new A(t)})),f.catchError((function(t){return p.of(t instanceof o.DaffStorageServiceError?new C(n.errorMatcher(t)):new y(n.errorMatcher(t)))})))}))),this.addToCart$=this.actions$.pipe(c.ofType(t.DaffCartActionTypes.AddToCartAction),f.switchMap((function(t){return n.driver.addToCart(t.payload.productId,t.payload.qty).pipe(f.map((function(t){return new T(t)})),f.catchError((function(t){return p.of(new I(n.errorMatcher(t)))})))}))),this.clear$=this.actions$.pipe(c.ofType(t.DaffCartActionTypes.CartClearAction),f.switchMap((function(t){return p.of(null).pipe(f.map((function(){return n.storage.getCartId()})),f.switchMap((function(t){return n.driver.clear(t)})),f.map((function(t){return new O(t)})),f.catchError((function(t){return p.of(t instanceof o.DaffStorageServiceError?new C(n.errorMatcher(t)):new b(n.errorMatcher(t)))})))})))};Ua.decorators=[{type:i.Injectable}],Ua.ctorParameters=function(){return[{type:c.Actions},{type:void 0,decorators:[{type:i.Inject,args:[n.DAFF_CART_ERROR_MATCHER]}]},{type:void 0,decorators:[{type:i.Inject,args:[d.DaffCartDriver]}]},{type:n.DaffCartStorageService}]},de([c.Effect(),ue("design:type",Object)],Ua.prototype,"create$",void 0),de([c.Effect(),ue("design:type",Object)],Ua.prototype,"storeId$",void 0),de([c.Effect(),ue("design:type",Object)],Ua.prototype,"get$",void 0),de([c.Effect(),ue("design:type",Object)],Ua.prototype,"addToCart$",void 0),de([c.Effect(),ue("design:type",Object)],Ua.prototype,"clear$",void 0);var Ba=new i.InjectionToken("DAFF_CART_REDUCERS",{factory:function(){return r.daffComposeReducers(Ce([e.combineReducers(fa)],i.inject(ua)))}}),_a=function(){};_a.decorators=[{type:i.NgModule,args:[{imports:[e.StoreModule.forFeature(da,Ba),c.EffectsModule.forFeature([Ua,Ma,ba,Ea,Oa,$a,wa,Fa,Pa,Ra,ja,La])],providers:[{provide:va,useValue:4e3}]}]}];var xa=function(){function t(t,a){var r=this;this.store=t,this.paymentMethodMap=a;var i=Ia(),n=i.selectCartValue,o=i.selectCartResolved,s=i.selectCartLoadingObject,c=i.selectCartFeatureLoading,p=i.selectCartFeatureResolving,d=i.selectCartFeatureMutating,u=i.selectCartLoading,l=i.selectCartResolving,C=i.selectCartMutating,h=i.selectBillingAddressLoading,A=i.selectBillingAddressResolving,y=i.selectBillingAddressMutating,g=i.selectShippingAddressLoading,m=i.selectShippingAddressResolving,D=i.selectShippingAddressMutating,S=i.selectShippingInformationLoading,T=i.selectShippingInformationResolving,I=i.selectShippingInformationMutating,v=i.selectShippingMethodsLoading,O=i.selectShippingMethodsResolving,b=i.selectPaymentLoading,j=i.selectPaymentResolving,M=i.selectPaymentMutating,R=i.selectPaymentMethodsLoading,P=i.selectPaymentMethodsResolving,F=i.selectCouponLoading,L=i.selectCouponResolving,E=i.selectCouponMutating,$=i.selectItemLoading,w=i.selectItemAdding,U=i.selectItemResolving,B=i.selectCartItemMutating,_=i.selectCartErrorsObject,x=i.selectCartErrors,W=i.selectItemErrors,H=i.selectBillingAddressErrors,z=i.selectShippingAddressErrors,q=i.selectShippingInformationErrors,k=i.selectShippingMethodsErrors,N=i.selectPaymentErrors,V=i.selectPaymentMethodsErrors,Q=i.selectCouponErrors,G=i.selectCartId,X=i.selectCartSubtotal,Y=i.selectCartGrandTotal,K=i.selectCartSubtotalExcludingTax,J=i.selectCartSubtotalIncludingTax,Z=i.selectCartSubtotalWithDiscountExcludingTax,tt=i.selectCartSubtotalWithDiscountIncludingTax,et=i.selectCartDiscountTotals,at=i.selectCartTotalTax,rt=i.selectCartShippingTotal,it=i.selectCartCoupons,nt=i.selectCartItems,ot=i.selectCartHasOutOfStockItems,st=i.selectCartItemEntities,ct=i.selectTotalNumberOfCartItems,pt=i.selectCartItemConfiguredAttributes,ft=i.selectCartItemCompositeOptions,dt=i.selectCartBillingAddress,ut=i.selectCartShippingAddress,lt=i.selectCartPayment,Ct=i.selectCartTotals,ht=i.selectCartShippingInformation,At=i.selectCartAvailableShippingMethods,yt=i.selectCartAvailablePaymentMethods,gt=i.selectIsCartEmpty,mt=i.selectIsBillingSameAsShipping,Dt=i.selectCartOrderLoading,St=i.selectCartOrderErrors,Tt=i.selectCartOrderValue,It=i.selectCartOrderId,vt=i.selectCartOrderCartId,Ot=i.selectHasOrderResult,bt=i.selectIsCartItemOutOfStock,jt=i.selectCartItemState,Mt=i.selectHasBillingAddress,Rt=i.selectHasShippingAddress,Pt=i.selectHasShippingMethod,Ft=i.selectHasPaymentMethod,Lt=i.selectCanPlaceOrder,Et=i.selectCartItemPrice,$t=i.selectCartItemRowTotal,wt=i.selectCartItemQuantity,Ut=i.selectCartItemDiscounts,Bt=i.selectCartItemTotalDiscount;this._selectCartItemConfiguredAttributes=pt,this._selectCartItemCompositeOptions=ft,this._selectIsCartItemOutOfStock=bt,this._selectCartItemState=jt,this._selectCartItemPrice=Et,this._selectCartItemQuantity=wt,this._selectCartItemRowTotal=$t,this._selectCartItemDiscounts=Ut,this._selectCartItemTotalDiscount=Bt,this.cart$=this.store.pipe(e.select(n)),this.resolved$=this.store.pipe(e.select(o)),this.loadingObject$=this.store.pipe(e.select(s)),this.featureLoading$=this.store.pipe(e.select(c)),this.featureResolving$=this.store.pipe(e.select(p)),this.featureMutating$=this.store.pipe(e.select(d)),this.loading$=this.store.pipe(e.select(u)),this.resolving$=this.store.pipe(e.select(l)),this.mutating$=this.store.pipe(e.select(C)),this.billingAddressLoading$=this.store.pipe(e.select(h)),this.billingAddressResolving$=this.store.pipe(e.select(A)),this.billingAddressMutating$=this.store.pipe(e.select(y)),this.shippingAddressLoading$=this.store.pipe(e.select(g)),this.shippingAddressResolving$=this.store.pipe(e.select(m)),this.shippingAddressMutating$=this.store.pipe(e.select(D)),this.shippingInformationLoading$=this.store.pipe(e.select(S)),this.shippingInformationResolving$=this.store.pipe(e.select(T)),this.shippingInformationMutating$=this.store.pipe(e.select(I)),this.shippingMethodsLoading$=this.store.pipe(e.select(v)),this.shippingMethodsResolving$=this.store.pipe(e.select(O)),this.paymentLoading$=this.store.pipe(e.select(b)),this.paymentResolving$=this.store.pipe(e.select(j)),this.paymentMutating$=this.store.pipe(e.select(M)),this.paymentMethodsLoading$=this.store.pipe(e.select(R)),this.paymentMethodsResolving$=this.store.pipe(e.select(P)),this.couponLoading$=this.store.pipe(e.select(F)),this.couponResolving$=this.store.pipe(e.select(L)),this.couponMutating$=this.store.pipe(e.select(E)),this.itemLoading$=this.store.pipe(e.select($)),this.itemAdding$=this.store.pipe(e.select(w)),this.itemResolving$=this.store.pipe(e.select(U)),this.itemMutating$=this.store.pipe(e.select(B)),this.errors$=this.store.pipe(e.select(_)),this.cartErrors$=this.store.pipe(e.select(x)),this.itemErrors$=this.store.pipe(e.select(W)),this.billingAddressErrors$=this.store.pipe(e.select(H)),this.shippingAddressErrors$=this.store.pipe(e.select(z)),this.shippingInformationErrors$=this.store.pipe(e.select(q)),this.shippingMethodsErrors$=this.store.pipe(e.select(k)),this.paymentErrors$=this.store.pipe(e.select(N)),this.paymentMethodsErrors$=this.store.pipe(e.select(V)),this.couponErrors$=this.store.pipe(e.select(Q)),this.id$=this.store.pipe(e.select(G)),this.subtotal$=this.store.pipe(e.select(X)),this.grandTotal$=this.store.pipe(e.select(Y)),this.subtotalExcludingTax$=this.store.pipe(e.select(K)),this.subtotalIncludingTax$=this.store.pipe(e.select(J)),this.subtotalWithDiscountExcludingTax$=this.store.pipe(e.select(Z)),this.subtotalWithDiscountIncludingTax$=this.store.pipe(e.select(tt)),this.discountTotals$=this.store.pipe(e.select(et)),this.totalTax$=this.store.pipe(e.select(at)),this.shippingTotal$=this.store.pipe(e.select(rt)),this.coupons$=this.store.pipe(e.select(it)),this.items$=this.store.pipe(e.select(nt)),this.totalItems$=this.store.pipe(e.select(ct)),this.hasOutOfStockItems$=this.store.pipe(e.select(ot)),this.itemDictionary$=this.store.pipe(e.select(st)),this.billingAddress$=this.store.pipe(e.select(dt)),this.shippingAddress$=this.store.pipe(e.select(ut)),this.payment$=this.store.pipe(e.select(lt)),this.totals$=this.store.pipe(e.select(Ct)),this.shippingInformation$=this.store.pipe(e.select(ht)),this.availableShippingMethods$=this.store.pipe(e.select(At)),this.availablePaymentMethods$=this.store.pipe(e.select(yt)),this.paymentId$=this.payment$.pipe(f.map((function(t){return t&&t.method?r.paymentMethodMap[t.method]:null}))),this.isCartEmpty$=this.store.pipe(e.select(gt)),this.isBillingSameAsShipping$=this.store.pipe(e.select(mt)),this.hasBillingAddress$=this.store.pipe(e.select(Mt)),this.hasShippingAddress$=this.store.pipe(e.select(Rt)),this.hasShippingMethod$=this.store.pipe(e.select(Pt)),this.hasPaymentMethod$=this.store.pipe(e.select(Ft)),this.canPlaceOrder$=this.store.pipe(e.select(Lt)),this.orderResultLoading$=this.store.pipe(e.select(Dt)),this.orderResultErrors$=this.store.pipe(e.select(St)),this.orderResult$=this.store.pipe(e.select(Tt)),this.orderResultId$=this.store.pipe(e.select(It)),this.orderResultCartId$=this.store.pipe(e.select(vt)),this.hasOrderResult$=this.store.pipe(e.select(Ot))}return t.prototype.getConfiguredCartItemAttributes=function(t){return this.store.pipe(e.select(this._selectCartItemConfiguredAttributes(t)))},t.prototype.getCompositeCartItemOptions=function(t){return this.store.pipe(e.select(this._selectCartItemCompositeOptions(t)))},t.prototype.isCartItemOutOfStock=function(t){return this.store.pipe(e.select(this._selectIsCartItemOutOfStock(t)))},t.prototype.getCartItemState=function(t){return this.store.pipe(e.select(this._selectCartItemState(t)))},t.prototype.getCartItemPrice=function(t){return this.store.pipe(e.select(this._selectCartItemPrice(t)))},t.prototype.getCartItemQuantity=function(t){return this.store.pipe(e.select(this._selectCartItemQuantity(t)))},t.prototype.getCartItemRowTotal=function(t){return this.store.pipe(e.select(this._selectCartItemRowTotal(t)))},t.prototype.getCartItemDiscounts=function(t){return this.store.pipe(e.select(this._selectCartItemDiscounts(t)))},t.prototype.getCartItemTotalDiscount=function(t){return this.store.pipe(e.select(this._selectCartItemTotalDiscount(t)))},t.prototype.dispatch=function(t){this.store.dispatch(t)},t}();xa.ɵprov=i.ɵɵdefineInjectable({factory:function(){return new xa(i.ɵɵinject(e.Store),i.ɵɵinject(n.DaffCartPaymentMethodIdMap))},token:xa,providedIn:"root"}),xa.decorators=[{type:i.Injectable,args:[{providedIn:"root"}]}],xa.ctorParameters=function(){return[{type:e.Store},{type:Object,decorators:[{type:i.Inject,args:[n.DaffCartPaymentMethodIdMap]}]}]},t.DAFF_CART_EXTRA_REDUCERS=ua,t.DAFF_CART_STORE_FEATURE_KEY=da,t.DaffAddToCart=S,t.DaffAddToCartFailure=I,t.DaffAddToCartSuccess=T,t.DaffCartAddressUpdate=pt,t.DaffCartAddressUpdateFailure=dt,t.DaffCartAddressUpdateSuccess=ft,t.DaffCartBillingAddressLoad=X,t.DaffCartBillingAddressLoadFailure=K,t.DaffCartBillingAddressLoadSuccess=Y,t.DaffCartBillingAddressUpdate=J,t.DaffCartBillingAddressUpdateFailure=tt,t.DaffCartBillingAddressUpdateSuccess=Z,t.DaffCartClear=v,t.DaffCartClearFailure=b,t.DaffCartClearSuccess=O,t.DaffCartCouponApply=Xt,t.DaffCartCouponApplyFailure=Kt,t.DaffCartCouponApplySuccess=Yt,t.DaffCartCouponList=Jt,t.DaffCartCouponListFailure=te,t.DaffCartCouponListSuccess=Zt,t.DaffCartCouponRemove=ee,t.DaffCartCouponRemoveAll=ie,t.DaffCartCouponRemoveAllFailure=oe,t.DaffCartCouponRemoveAllSuccess=ne,t.DaffCartCouponRemoveFailure=re,t.DaffCartCouponRemoveSuccess=ae,t.DaffCartCreate=g,t.DaffCartCreateFailure=D,t.DaffCartCreateSuccess=m,t.DaffCartFacade=xa,t.DaffCartItemAdd=H,t.DaffCartItemAddFailure=q,t.DaffCartItemAddSuccess=z,t.DaffCartItemDelete=k,t.DaffCartItemDeleteFailure=V,t.DaffCartItemDeleteSuccess=N,t.DaffCartItemList=L,t.DaffCartItemListFailure=$,t.DaffCartItemListSuccess=E,t.DaffCartItemLoad=w,t.DaffCartItemLoadFailure=B,t.DaffCartItemLoadSuccess=U,t.DaffCartItemStateDebounceTime=va,t.DaffCartItemStateReset=Q,t.DaffCartItemUpdate=_,t.DaffCartItemUpdateFailure=W,t.DaffCartItemUpdateSuccess=x,t.DaffCartLoad=h,t.DaffCartLoadFailure=y,t.DaffCartLoadSuccess=A,t.DaffCartPaymentLoad=jt,t.DaffCartPaymentLoadFailure=Rt,t.DaffCartPaymentLoadSuccess=Mt,t.DaffCartPaymentMethodAdd=xt,t.DaffCartPaymentMethodsLoad=Ht,t.DaffCartPaymentMethodsLoadFailure=qt,t.DaffCartPaymentMethodsLoadSuccess=zt,t.DaffCartPaymentRemove=Ut,t.DaffCartPaymentRemoveFailure=_t,t.DaffCartPaymentRemoveSuccess=Bt,t.DaffCartPaymentUpdate=Pt,t.DaffCartPaymentUpdateFailure=Lt,t.DaffCartPaymentUpdateSuccess=Ft,t.DaffCartPaymentUpdateWithBilling=Et,t.DaffCartPaymentUpdateWithBillingFailure=wt,t.DaffCartPaymentUpdateWithBillingSuccess=$t,t.DaffCartPlaceOrder=Nt,t.DaffCartPlaceOrderFailure=Qt,t.DaffCartPlaceOrderSuccess=Vt,t.DaffCartShippingAddressLoad=at,t.DaffCartShippingAddressLoadFailure=it,t.DaffCartShippingAddressLoadSuccess=rt,t.DaffCartShippingAddressUpdate=nt,t.DaffCartShippingAddressUpdateFailure=st,t.DaffCartShippingAddressUpdateSuccess=ot,t.DaffCartShippingInformationDelete=mt,t.DaffCartShippingInformationDeleteFailure=St,t.DaffCartShippingInformationDeleteSuccess=Dt,t.DaffCartShippingInformationLoad=lt,t.DaffCartShippingInformationLoadFailure=ht,t.DaffCartShippingInformationLoadSuccess=Ct,t.DaffCartShippingInformationUpdate=At,t.DaffCartShippingInformationUpdateFailure=gt,t.DaffCartShippingInformationUpdateSuccess=yt,t.DaffCartShippingMethodsLoad=It,t.DaffCartShippingMethodsLoadFailure=Ot,t.DaffCartShippingMethodsLoadSuccess=vt,t.DaffCartStateModule=_a,t.DaffCartStorageFailure=C,t.DaffResolveCart=j,t.DaffResolveCartFailure=R,t.DaffResolveCartServerSide=P,t.DaffResolveCartSuccess=M,t.daffCartOrderInitialState=me,t.daffCartOrderReducer=De,t.daffCartProvideExtraReducers=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.map((function(t){return{provide:ua,useValue:t,multi:!0}}))},t.daffCartReducer=pa,t.daffCartReducers=fa,t.getDaffCartSelectors=Ia,t.initialState=Se,t.initializeLoadingSetter=ve,t.ɵ0=Sa,t.ɵ1=Ta,t.ɵa=sa,t.ɵb=Ue,t.ɵc=Me,t.ɵd=Xe,t.ɵe=ra,t.ɵf=Ze,t.ɵg=ke,t.ɵh=We,t.ɵi=Le,t.ɵj=Ne,t.ɵk=pe,t.ɵl=Ba,t.ɵm=Ua,t.ɵn=Ma,t.ɵo=ba,t.ɵp=Ea,t.ɵq=Oa,t.ɵr=$a,t.ɵs=wa,t.ɵt=Fa,t.ɵu=Pa,t.ɵv=Ra,t.ɵw=ja,t.ɵx=La,Object.defineProperty(t,"__esModule",{value:!0})}));
2
2
  //# sourceMappingURL=daffodil-cart-state.umd.min.js.map