@shopgate/engage 7.12.3 → 7.20.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (419) hide show
  1. package/a11y/components/Section/index.js +2 -2
  2. package/a11y/components/VisuallyHidden/index.js +8 -0
  3. package/a11y/components/index.js +1 -0
  4. package/a11y/constants/index.js +1 -0
  5. package/a11y/helpers/index.js +1 -0
  6. package/a11y/index.js +1 -4
  7. package/account/actions/addContacts.js +1 -1
  8. package/account/actions/deleteContact.js +1 -1
  9. package/account/actions/deleteCustomer.js +1 -1
  10. package/account/actions/fetchContacts.js +1 -1
  11. package/account/actions/fetchCustomer.js +1 -1
  12. package/account/actions/updateContact.js +1 -1
  13. package/account/actions/updateCustomer.js +1 -1
  14. package/account/components/Account/Account.style.js +1 -1
  15. package/account/components/Profile/Profile.provider.js +3 -3
  16. package/account/components/ProfileContact/ProfileContact.js +1 -1
  17. package/app-rating/action-creators/appStart.js +3 -3
  18. package/app-rating/action-creators/ordersPlaced.js +3 -3
  19. package/app-rating/action-creators/popup.js +4 -4
  20. package/app-rating/action-creators/timer.js +3 -3
  21. package/app-rating/actions/showModal.js +6 -6
  22. package/app-rating/constants/index.js +2 -2
  23. package/app-rating/reducers/index.js +2 -2
  24. package/app-rating/subscriptions/index.js +4 -4
  25. package/back-in-stock/actions/index.js +14 -0
  26. package/back-in-stock/components/BackInStockButton/connector.js +1 -0
  27. package/back-in-stock/components/BackInStockButton/index.js +14 -0
  28. package/back-in-stock/components/BackInStockButton/style.js +1 -0
  29. package/back-in-stock/components/CharacteristicsButton/connector.js +3 -0
  30. package/back-in-stock/components/CharacteristicsButton/index.js +8 -0
  31. package/back-in-stock/components/ProductInfoBackInStockButton/connector.js +3 -0
  32. package/back-in-stock/components/ProductInfoBackInStockButton/index.js +10 -0
  33. package/back-in-stock/components/Subscriptions/components/List/index.js +4 -0
  34. package/back-in-stock/components/Subscriptions/components/Subscription/index.js +7 -0
  35. package/back-in-stock/components/Subscriptions/index.js +4 -0
  36. package/back-in-stock/components/index.js +1 -0
  37. package/back-in-stock/constants/Actions.js +1 -0
  38. package/back-in-stock/constants/Common.js +1 -0
  39. package/back-in-stock/constants/Pipelines.js +1 -0
  40. package/back-in-stock/constants/Portals.js +9 -0
  41. package/back-in-stock/constants/index.js +1 -0
  42. package/back-in-stock/hooks/index.js +4 -0
  43. package/back-in-stock/providers/BackInStockSubscriptionsProvider.connector.js +7 -0
  44. package/back-in-stock/providers/BackInStockSubscriptionsProvider.context.js +1 -0
  45. package/back-in-stock/providers/BackInStockSubscriptionsProvider.js +5 -0
  46. package/back-in-stock/providers/index.js +1 -0
  47. package/back-in-stock/reducers/index.js +5 -0
  48. package/back-in-stock/selectors/index.js +43 -0
  49. package/back-in-stock/streams/index.js +1 -0
  50. package/back-in-stock/subscriptions/index.js +11 -0
  51. package/cart/cart.helpers.js +2 -2
  52. package/cart/components/CartItem/CartItemCoupon.js +10 -6
  53. package/cart/components/CartItem/CartItemCouponCode.js +2 -2
  54. package/cart/components/CartItem/CartItemCouponDelete.js +1 -1
  55. package/cart/components/CartItem/CartItemCouponFreeShipping.js +1 -1
  56. package/cart/components/CartItem/CartItemCouponIcon.js +2 -2
  57. package/cart/components/CartItem/CartItemCouponLayout.style.js +5 -1
  58. package/cart/components/CartItem/CartItemCouponTitle.js +2 -2
  59. package/cart/components/CartItem/CartItemProductLayout.js +3 -2
  60. package/cart/components/CartItem/CartItemProductLayoutWide.style.js +1 -1
  61. package/cart/components/CartItem/CartItemProductTitle.js +2 -2
  62. package/cart/components/CartItem/CartItemQuantityPicker.js +26 -14
  63. package/cart/components/CartItem/CartItemSubstitution.js +1 -1
  64. package/cart/components/CartItems/CartItemCardReservation.js +1 -1
  65. package/cart/components/CartItems/CartItemGroupReservation.js +1 -1
  66. package/cart/components/CartSummaryWide/CartSummaryWideCheckoutButton.style.js +1 -1
  67. package/cart/components/PaymentBar/PaymentBar.js +1 -1
  68. package/cart/components/PaymentBar/PaymentBarCheckoutButton.style.js +1 -1
  69. package/cart/components/PaymentBar/PaymentBarPromotionCouponMessages.js +1 -1
  70. package/cart/index.js +1 -1
  71. package/category/actions/index.js +1 -0
  72. package/category/components/CategoryList/index.js +7 -0
  73. package/category/components/CategoryList/style.js +1 -0
  74. package/category/components/index.js +1 -1
  75. package/category/constants/index.js +1 -0
  76. package/category/helpers/index.js +1 -0
  77. package/category/index.js +1 -6
  78. package/category/selectors/index.js +2 -0
  79. package/category/streams/index.js +1 -1
  80. package/checkout/actions/errorCheckout.js +1 -1
  81. package/checkout/actions/fetchCheckoutOrder.js +1 -1
  82. package/checkout/actions/fetchPaymentMethods.js +1 -1
  83. package/checkout/actions/initializeCheckout.js +1 -1
  84. package/checkout/actions/prepareCheckout.js +2 -2
  85. package/checkout/actions/submitCheckoutOrder.js +1 -1
  86. package/checkout/actions/updateCheckoutOrder.js +1 -1
  87. package/checkout/components/Checkout/CheckoutSectionMessages.js +1 -1
  88. package/checkout/components/CheckoutConfirmation/CheckoutConfirmation.js +1 -1
  89. package/checkout/components/CheckoutConfirmation/CheckoutConfirmationBilledTo.js +1 -1
  90. package/checkout/components/PaymentMethodButton/PaymentMethodButton.js +1 -1
  91. package/checkout/components/ShippingMethods/ShippingMethods.js +4 -4
  92. package/checkout/paymentMethods/index.js +2 -2
  93. package/checkout/paymentMethods/paypal/PaypalButtonApp.js +1 -1
  94. package/checkout/paymentMethods/paypal/PaypalButtonWeb.js +1 -1
  95. package/checkout/paymentMethods/paypal/PaypalPayButton.js +1 -1
  96. package/checkout/paymentMethods/paypal/PaypalProvider.js +1 -1
  97. package/checkout/paymentMethods/stripe/StripeButton.js +2 -2
  98. package/checkout/paymentMethods/stripe/StripeCreditCard.js +3 -3
  99. package/checkout/paymentMethods/stripe/StripeProvider.js +8 -8
  100. package/checkout/paymentMethods/stripe/sdk.js +1 -1
  101. package/checkout/providers/AddressBookProvider.js +1 -1
  102. package/checkout/providers/CheckoutProvider.js +8 -8
  103. package/components/ChipLayout/index.js +38 -0
  104. package/components/ChipLayout/spec.js +5 -0
  105. package/components/ChipLayout/style.js +5 -0
  106. package/components/Footer/Footer.js +7 -7
  107. package/components/Form/Builder/Builder.js +50 -29
  108. package/components/Form/Builder/ElementCheckbox.js +1 -1
  109. package/components/Form/Builder/ElementMultiSelect.js +1 -1
  110. package/components/Form/Builder/ElementPhoneNumber.js +3 -3
  111. package/components/Form/Builder/ElementRadio.js +1 -1
  112. package/components/Form/Builder/ElementSelect.js +1 -1
  113. package/components/Form/Builder/ElementText.js +3 -3
  114. package/components/Form/Builder/classes/ActionListener.constants.js +2 -2
  115. package/components/Form/Builder/classes/ActionListener.js +73 -16
  116. package/components/Form/Builder/helpers/buildFormElements.js +2 -2
  117. package/components/Form/Form.js +8 -5
  118. package/components/IntersectionVisibility/index.js +14 -7
  119. package/components/Logo/connector.js +4 -0
  120. package/components/Logo/index.js +4 -0
  121. package/components/Logo/spec.js +1 -0
  122. package/components/Logo/style.js +1 -0
  123. package/components/Menu/components/Position/index.js +5 -5
  124. package/components/Menu/index.js +9 -9
  125. package/components/MessageBar/MessageBar.js +1 -1
  126. package/components/MessageBar/index.js +1 -1
  127. package/components/NavigationHandler/index.js +4 -4
  128. package/components/NavigationHandler/spec.js +1 -1
  129. package/components/Picker/components/Button/index.js +1 -1
  130. package/components/Picker/components/List/index.js +2 -2
  131. package/components/Picker/components/Modal/index.js +7 -7
  132. package/components/Picker/index.js +18 -9
  133. package/components/PickerUtilize/components/Button/index.js +5 -0
  134. package/components/PickerUtilize/components/Button/style.js +1 -0
  135. package/components/PickerUtilize/index.js +17 -0
  136. package/components/PickerUtilize/spec.js +1 -0
  137. package/components/PickerUtilize/style.js +1 -0
  138. package/components/QuantityInput/QuantityInput.js +2 -2
  139. package/components/Radio/Radio.js +1 -1
  140. package/components/RadioCard/RadioCard.js +1 -1
  141. package/components/RangeSlider/components/Handle/index.js +1 -1
  142. package/components/RangeSlider/index.js +36 -24
  143. package/components/SheetList/components/Item/index.js +5 -5
  144. package/components/SheetList/index.js +4 -4
  145. package/components/SideNavigation/SideNavigationCategories.connector.js +2 -2
  146. package/components/SnackBarContainer/index.js +5 -0
  147. package/components/Switch/index.js +12 -0
  148. package/components/Switch/style.js +1 -0
  149. package/components/Tabs/components/TabIndicator.js +2 -2
  150. package/components/Tabs/components/Tabs.js +1 -1
  151. package/components/TimeBoundary/index.js +8 -6
  152. package/components/VideoPlayer/index.js +9 -6
  153. package/components/View/components/Above/index.js +1 -1
  154. package/components/View/components/Below/index.js +1 -1
  155. package/components/View/components/Content/index.js +18 -11
  156. package/components/View/index.js +1 -1
  157. package/components/View/provider.js +22 -5
  158. package/components/index.js +2 -2
  159. package/core/action-creators/app.js +5 -0
  160. package/core/action-creators/appPermissions.js +9 -0
  161. package/core/action-creators/index.js +1 -1
  162. package/core/actions/getGeolocation.js +2 -2
  163. package/core/actions/grantAppTrackingTransparencyPermission.js +6 -0
  164. package/core/actions/grantCameraPermissions.js +1 -1
  165. package/core/actions/grantGeolocationPermissions.js +1 -1
  166. package/core/actions/grantPermissions.js +13 -6
  167. package/core/actions/grantPushPermissions.js +22 -0
  168. package/core/actions/index.js +7 -0
  169. package/core/actions/requestAppPermission.js +12 -0
  170. package/core/actions/requestAppPermissionStatus.js +12 -0
  171. package/core/classes/GeolocationRequest.js +2 -3
  172. package/core/classes/GeolocationRequestApp.js +6 -6
  173. package/core/classes/GeolocationRequestBrowser.js +2 -2
  174. package/core/classes/index.js +1 -0
  175. package/core/collections/AppInitialization.js +49 -0
  176. package/core/collections/index.js +1 -0
  177. package/core/commands/analyticsSetConsent.js +11 -0
  178. package/core/commands/index.js +1 -0
  179. package/core/config/ThemeConfigResolver.js +2 -2
  180. package/core/config/config.action-creators.js +1 -1
  181. package/core/config/config.actions.js +1 -1
  182. package/core/config/config.reducers.js +1 -1
  183. package/core/config/config.subscriptions.js +2 -2
  184. package/core/config/index.js +1 -1
  185. package/core/constants/actionTypes.js +1 -0
  186. package/core/constants/appFeatures.js +1 -0
  187. package/core/constants/index.js +6 -1
  188. package/core/contexts/index.js +1 -0
  189. package/core/helpers/appFeatures.js +14 -0
  190. package/core/helpers/appPermissions.js +43 -6
  191. package/core/helpers/baseUrl.js +14 -0
  192. package/core/helpers/environment.js +4 -0
  193. package/core/helpers/getFullImageSource.js +1 -1
  194. package/core/helpers/i18n.js +5 -3
  195. package/core/helpers/index.js +7 -0
  196. package/core/hocs/index.js +1 -0
  197. package/core/hocs/withCurrentProduct.js +6 -6
  198. package/core/hocs/withTheme.js +2 -2
  199. package/core/hooks/index.js +1 -0
  200. package/core/hooks/useAsyncMemo.js +1 -1
  201. package/core/hooks/useFormState.js +1 -1
  202. package/core/hooks/useScrollTo.js +1 -1
  203. package/core/hooks/useTheme.js +2 -2
  204. package/core/index.js +5 -52
  205. package/core/initialization/index.js +4 -2
  206. package/core/providers/AppProvider.js +10 -8
  207. package/core/providers/index.js +1 -0
  208. package/core/reducers/app.js +6 -0
  209. package/core/reducers/index.js +1 -1
  210. package/core/reducers/merchantSettings.js +1 -1
  211. package/core/reducers/shopSettings.js +1 -1
  212. package/core/selectors/app.js +9 -0
  213. package/core/selectors/index.js +6 -1
  214. package/core/streams/app.js +8 -0
  215. package/core/streams/appPermissions.js +19 -0
  216. package/core/streams/index.js +4 -0
  217. package/core/subscriptions/app.js +7 -0
  218. package/favorites/components/Item/Item.js +5 -5
  219. package/favorites/components/List/List.js +1 -1
  220. package/favorites/components/Lists/Lists.js +4 -4
  221. package/filter/components/PriceSlider/index.js +9 -9
  222. package/filter/helpers/buildFilterParamsForFetchFiltersRequest.js +9 -0
  223. package/filter/helpers/buildUpdatedFilters.js +1 -1
  224. package/filter/helpers/index.js +1 -0
  225. package/filter/helpers/translateFilterLabel.js +6 -0
  226. package/filter/index.js +1 -1
  227. package/filter/providers/SortProvider.helpers.js +1 -1
  228. package/locations/actions/fetchFulfillmentSlots.js +5 -3
  229. package/locations/actions/fetchInventories.js +5 -4
  230. package/locations/actions/fetchLocations.js +18 -3
  231. package/locations/actions/fetchProductInventories.js +4 -2
  232. package/locations/actions/fetchProductLocations.js +9 -2
  233. package/locations/actions/index.js +1 -1
  234. package/locations/actions/setUserGeolocation.js +1 -1
  235. package/locations/actions/setUserSearchGeolocation.js +1 -1
  236. package/locations/actions/submitReservation.js +2 -2
  237. package/locations/components/Cart/CartContextMenuChangeFulfillmentContent.js +1 -1
  238. package/locations/components/FulfillmentPath/FulfillmentPath.js +1 -1
  239. package/locations/components/FulfillmentPath/FulfillmentPathItem.js +2 -2
  240. package/locations/components/FulfillmentSelector/FulfillmentSelectorAddToCart.js +2 -2
  241. package/locations/components/FulfillmentSelector/FulfillmentSelectorAlternativeLocation.js +1 -1
  242. package/locations/components/FulfillmentSheet/FulfillmentSheet.js +2 -2
  243. package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotDialog.js +1 -1
  244. package/locations/components/ReserveForm/ReserveForm.js +1 -1
  245. package/locations/components/ReserveForm/ReserveFormPhone.js +1 -1
  246. package/locations/components/StockInfo/StockInfo.defaultSettings.js +1 -1
  247. package/locations/components/StoreFinder/StoreFinderMap.style.js +2 -2
  248. package/locations/components/StoreList/StoreListSearch.js +2 -2
  249. package/locations/locations.streams.js +1 -1
  250. package/locations/providers/FulfillmentProvider.js +4 -4
  251. package/locations/providers/StoreFinderProvider.js +1 -1
  252. package/locations/reducers/storage.js +3 -3
  253. package/locations/selectors/index.js +2 -2
  254. package/locations/subscriptions.js +13 -13
  255. package/login/components/ForgotPassword/ForgotPassword.js +1 -1
  256. package/orders/actions/cancelOrder.js +1 -1
  257. package/orders/actions/fetchOrderDetails.js +1 -1
  258. package/orders/constants/status.js +2 -2
  259. package/orders/providers/OrderDetailsPrivateProvider.js +1 -1
  260. package/orders/providers/OrderDetailsProvider.js +3 -3
  261. package/package.json +8 -8
  262. package/page/actions/index.js +1 -0
  263. package/page/components/index.js +1 -0
  264. package/page/constants/index.js +1 -0
  265. package/page/index.js +2 -4
  266. package/page/selectors/index.js +1 -0
  267. package/product/collections/index.js +1 -0
  268. package/product/components/Availability/Availability.connector.js +4 -5
  269. package/product/components/Availability/Availability.js +3 -3
  270. package/product/components/Characteristics/Characteristic/components/Sheet/index.js +20 -0
  271. package/product/components/Characteristics/Characteristic/components/SheetItem/index.js +10 -0
  272. package/product/components/Characteristics/Characteristic/components/SheetItem/style.js +1 -0
  273. package/product/components/Characteristics/Characteristic/index.js +18 -0
  274. package/product/components/Characteristics/Characteristic/style.js +1 -0
  275. package/product/components/Characteristics/Swatch/index.js +12 -0
  276. package/product/components/Characteristics/Swatch/style.js +1 -0
  277. package/product/components/Characteristics/index.js +12 -0
  278. package/product/components/Characteristics/transition.js +1 -0
  279. package/product/components/Description/index.js +2 -2
  280. package/product/components/EffectivityDates/helpers.js +3 -3
  281. package/product/components/EffectivityDates/index.js +1 -1
  282. package/product/components/Header/PriceStriked/connector.js +9 -0
  283. package/product/components/Header/PriceStriked/index.js +5 -0
  284. package/product/components/Header/PriceStriked/style.js +1 -0
  285. package/product/components/Header/Shipping/components/Label/index.js +6 -0
  286. package/product/components/Header/Shipping/components/Label/style.js +1 -0
  287. package/product/components/Header/Shipping/connector.js +9 -0
  288. package/product/components/Header/Shipping/index.js +5 -0
  289. package/product/components/Header/Shipping/mock.js +1 -0
  290. package/product/components/Header/Shipping/spec.js +5 -0
  291. package/product/components/Header/Shipping/style.js +1 -0
  292. package/product/components/Header/Tiers/components/Tier/index.js +6 -0
  293. package/product/components/Header/Tiers/components/Tier/spec.js +1 -0
  294. package/product/components/Header/Tiers/connector.js +10 -0
  295. package/product/components/Header/Tiers/index.js +5 -0
  296. package/product/components/Header/Tiers/spec.js +1 -0
  297. package/product/components/Header/Tiers/style.js +1 -0
  298. package/product/components/Header/index.js +1 -0
  299. package/product/components/MapPriceHint/index.js +1 -1
  300. package/product/components/Media/FeaturedMedia.js +1 -1
  301. package/product/components/MediaSlider/index.js +1 -1
  302. package/product/components/Options/components/Content/connector.js +10 -0
  303. package/product/components/Options/components/Content/index.js +16 -0
  304. package/product/components/Options/components/Content/spec.js +2 -0
  305. package/product/components/Options/components/Option/index.js +4 -0
  306. package/product/components/Options/components/TextOption/components/OptionInfo/index.js +9 -0
  307. package/product/components/Options/components/TextOption/components/OptionInfo/spec.js +1 -0
  308. package/product/components/Options/components/TextOption/components/OptionInfo/style.js +1 -0
  309. package/product/components/Options/components/TextOption/index.js +22 -0
  310. package/product/components/Options/components/TextOption/style.js +1 -0
  311. package/product/components/Options/index.js +5 -0
  312. package/product/components/OrderQuantityHint/index.js +3 -2
  313. package/product/components/OrderQuantityHint/style.js +1 -1
  314. package/product/components/PriceDifference/index.js +1 -1
  315. package/product/components/ProductCard/index.js +2 -2
  316. package/product/components/ProductCharacteristics/helpers/index.js +1 -1
  317. package/product/components/ProductCharacteristics/index.js +28 -12
  318. package/product/components/ProductDiscountBadge/spec.js +1 -1
  319. package/product/components/ProductGridPrice/index.js +2 -2
  320. package/product/components/ProductImage/index.js +15 -12
  321. package/product/components/ProductList/components/Item/index.js +5 -0
  322. package/product/components/ProductList/components/Item/style.js +2 -0
  323. package/product/components/ProductList/components/Iterator/index.js +5 -0
  324. package/product/components/ProductList/components/Iterator/style.js +1 -0
  325. package/product/components/ProductList/components/Layout/index.js +5 -0
  326. package/product/components/ProductList/components/Layout/style.js +1 -0
  327. package/product/components/ProductList/index.js +5 -0
  328. package/product/components/ProductProperties/Content.js +1 -1
  329. package/product/components/ProductProperties/GroupedProperties.js +1 -1
  330. package/product/components/ProductProperties/ListsHTML.js +1 -1
  331. package/product/components/ProductProperties/ProductProperties.js +1 -1
  332. package/product/components/ProductProperties/RowHTML.js +1 -1
  333. package/product/components/ProductProperties/Wrapper.js +1 -1
  334. package/product/components/ProductProperties/style.js +1 -1
  335. package/product/components/ProductProvider/connector.js +5 -0
  336. package/product/components/ProductProvider/index.js +4 -0
  337. package/product/components/ProductSlider/index.js +4 -0
  338. package/product/components/ProductSlider/spec.js +1 -0
  339. package/product/components/ProductSlider/style.js +1 -0
  340. package/product/components/Rating/connector.js +9 -0
  341. package/product/components/Rating/index.js +7 -0
  342. package/product/components/Rating/mock.js +5 -0
  343. package/product/components/Rating/spec.js +5 -0
  344. package/product/components/Rating/style.js +1 -0
  345. package/product/components/Swatch/SwatchContent.js +1 -1
  346. package/product/components/index.js +1 -0
  347. package/product/constants/index.js +1 -1
  348. package/product/contexts/index.js +1 -0
  349. package/product/helpers/index.js +2 -2
  350. package/product/helpers/redirects.js +1 -1
  351. package/product/hocs/index.js +1 -0
  352. package/product/hocs/withProductListEntryProduct.js +12 -0
  353. package/product/hooks/index.js +1 -0
  354. package/product/index.js +4 -11
  355. package/product/providers/index.js +1 -0
  356. package/product/selectors/product.js +13 -2
  357. package/product/selectors/variants.js +2 -2
  358. package/product/streams/index.js +1 -0
  359. package/push-opt-in/action-creators/index.js +1 -0
  360. package/push-opt-in/action-creators/optInTrigger.js +23 -0
  361. package/push-opt-in/action-creators/pushOptIn.js +7 -0
  362. package/push-opt-in/actions/index.js +1 -0
  363. package/push-opt-in/actions/pushOptInModal.js +8 -0
  364. package/push-opt-in/components/PushOptInModal/connector.js +9 -0
  365. package/push-opt-in/components/PushOptInModal/index.js +10 -0
  366. package/push-opt-in/components/PushOptInModal/push-opt-in.svg +62 -0
  367. package/push-opt-in/components/PushOptInModal/style.js +1 -0
  368. package/push-opt-in/components/index.js +1 -0
  369. package/push-opt-in/constants/index.js +1 -0
  370. package/push-opt-in/constants/optInModal.js +1 -0
  371. package/push-opt-in/constants/optInTrigger.js +1 -0
  372. package/push-opt-in/reducers/index.js +1 -0
  373. package/push-opt-in/reducers/optInModal.js +6 -0
  374. package/push-opt-in/reducers/optInTrigger.js +6 -0
  375. package/push-opt-in/selectors/index.js +1 -0
  376. package/push-opt-in/selectors/optInModal.js +8 -0
  377. package/push-opt-in/selectors/optInTrigger.js +5 -0
  378. package/push-opt-in/subscriptions/index.js +1 -0
  379. package/push-opt-in/subscriptions/optInTrigger.js +14 -0
  380. package/registration/providers/GuestRegistrationProvider.actions.js +2 -2
  381. package/registration/providers/GuestRegistrationProvider.js +3 -3
  382. package/registration/providers/RegistrationProvider.actions.js +3 -3
  383. package/registration/providers/RegistrationProvider.js +2 -2
  384. package/registration/subscriptions/index.js +1 -1
  385. package/reviews/actions/index.js +1 -0
  386. package/reviews/components/Reviews/components/Header/components/ReviewsExcerpt/index.js +1 -1
  387. package/reviews/components/Reviews/components/List/index.js +3 -3
  388. package/reviews/components/Reviews/components/List/spec.js +1 -1
  389. package/reviews/components/Reviews/components/RatingCount/index.js +1 -1
  390. package/reviews/components/Reviews/components/ReviewsInfo/index.js +1 -2
  391. package/reviews/components/Reviews/spec.js +1 -1
  392. package/reviews/components/index.js +1 -0
  393. package/reviews/constants/index.js +1 -0
  394. package/reviews/index.js +3 -7
  395. package/reviews/selectors/index.js +1 -0
  396. package/reviews/streams/index.js +1 -0
  397. package/scanner/action-creators/index.js +1 -0
  398. package/scanner/actions/index.js +1 -0
  399. package/scanner/classes/index.js +1 -0
  400. package/scanner/constants/index.js +1 -0
  401. package/scanner/helpers/index.js +1 -0
  402. package/scanner/index.js +1 -6
  403. package/scanner/streams/index.js +1 -0
  404. package/search/actions/index.js +1 -0
  405. package/search/constants/index.js +1 -0
  406. package/search/helpers/index.js +1 -0
  407. package/search/index.js +1 -6
  408. package/search/selectors/index.js +1 -0
  409. package/search/streams/index.js +1 -0
  410. package/styles/helpers/index.js +1 -0
  411. package/styles/helpers/initCSSCustomProperties.js +3 -3
  412. package/styles/helpers/setPageContentWidth.js +2 -1
  413. package/styles/index.js +1 -1
  414. package/tracking/components/CookieConsent/CookieConsentContent.js +1 -1
  415. package/tracking/constants/index.js +2 -1
  416. package/components/MessageBar/MessageBar.types.js +0 -0
  417. package/components/MessageBar/style.js +0 -1
  418. package/product/components/Availability/Availability.types.js +0 -1
  419. /package/page/{NotFound.js → components/NotFound.js} +0 -0
@@ -0,0 +1,9 @@
1
+ import{APP_PERMISSION_STATUS_RECEIVED}from"../constants/actionTypes";/**
2
+ * Creates the APP_PERMISSION_STATUS_RECEIVED Redux action object that's supposed to be dispatched
3
+ * when a permission status was requested from the app.
4
+ * @param {Object} params Action params
5
+ * @param {string} params.permissionId The updated permission id
6
+ * @param {string} params.status The new status
7
+ * @param {Object} [params.options={}] Extended options for the permission
8
+ * @returns {Object} The Redux action object
9
+ */export var appPermissionStatusReceived=function appPermissionStatusReceived(_ref){var permissionId=_ref.permissionId,status=_ref.status,_ref$options=_ref.options,options=_ref$options===void 0?{}:_ref$options;return{type:APP_PERMISSION_STATUS_RECEIVED,permissionId:permissionId,status:status,options:options};};
@@ -1 +1 @@
1
- export{receiveShopSettings,errorShopSettings}from"./shopSettings";export{receiveMerchantSettings}from"./merchantSettings";
1
+ export{receiveShopSettings,errorShopSettings}from"./shopSettings";export{receiveMerchantSettings}from"./merchantSettings";export*from"./app";export*from"./appPermissions";
@@ -1,4 +1,4 @@
1
- import _regeneratorRuntime from"@babel/runtime/regenerator";function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj;};}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}return _typeof(obj);}function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{hasSGJavaScriptBridge}from'@shopgate/pwa-core/helpers';import{hasWebBridge}from'@shopgate/engage/core';import grantGeolocationPermissions from"./grantGeolocationPermissions";import GeolocationRequest from"../classes/GeolocationRequest";import{GEOLOCATION_ERROR_DENIED}from"../constants/geolocationRequest";/**
1
+ import _regeneratorRuntime from"@babel/runtime/regenerator";function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj;};}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;};}return _typeof(obj);}function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{hasWebBridge,hasSGJavaScriptBridge}from'@shopgate/engage/core/helpers';import{GEOLOCATION_ERROR_DENIED}from'@shopgate/engage/core/constants';import grantGeolocationPermissions from"./grantGeolocationPermissions";import GeolocationRequest from"../classes/GeolocationRequest";/**
2
2
  * Determines the geolocation of the user. When not geolocation permissions are granted yet,
3
3
  * the user will be prompted to grant access.
4
4
  * @param {Object} options Action options.
@@ -11,4 +11,4 @@ import _regeneratorRuntime from"@babel/runtime/regenerator";function _typeof(obj
11
11
  * @param {string} options.modal.dismiss Label for the dismiss button.
12
12
  * @param {Object} options.modal.params Additional parameters for i18n strings.
13
13
  * @return { Function } A redux thunk.
14
- */var getGeolocation=function getGeolocation(){var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){var granted,error;return _regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:_context.next=2;return dispatch(grantGeolocationPermissions(_extends({resolveWithData:true},options)));case 2:granted=_context.sent;if(!(_typeof(granted)==='object')){_context.next=5;break;}return _context.abrupt("return",Promise.resolve(granted));case 5:if(granted){_context.next=9;break;}error=new Error('Geolocation permissions not granted.');error.code=GEOLOCATION_ERROR_DENIED;throw error;case 9:return _context.abrupt("return",new GeolocationRequest(!hasSGJavaScriptBridge()||hasWebBridge()).dispatch());case 10:case"end":return _context.stop();}}},_callee);}));return function(_x){return _ref.apply(this,arguments);};}());};export default getGeolocation;
14
+ */var getGeolocation=function getGeolocation(){var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){var granted,error;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_context.next=2;return dispatch(grantGeolocationPermissions(_extends({resolveWithData:true},options)));case 2:granted=_context.sent;if(!(_typeof(granted)==='object')){_context.next=5;break;}return _context.abrupt("return",Promise.resolve(granted));case 5:if(granted){_context.next=9;break;}error=new Error('Geolocation permissions not granted.');error.code=GEOLOCATION_ERROR_DENIED;throw error;case 9:return _context.abrupt("return",new GeolocationRequest(!hasSGJavaScriptBridge()||hasWebBridge()).dispatch());case 10:case"end":return _context.stop();}},_callee);}));return function(_x){return _ref.apply(this,arguments);};}());};export default getGeolocation;
@@ -0,0 +1,6 @@
1
+ import{PERMISSION_ID_APP_TRACKING_TRANSPARENCY}from'@shopgate/engage/core/constants';import grantPermissions from"./grantPermissions";/**
2
+ * Determines the current state of the app tracking transparency permission.
3
+ * If not already happened, the user will be prompted to grant permissions.
4
+ * The action returns a promise which resolves with a boolean value, that indicates the state.
5
+ * @return { Function } A redux thunk.
6
+ */var grantAppTrackingTransparencyPermission=function grantAppTrackingTransparencyPermission(){return function(dispatch){return dispatch(grantPermissions({permissionId:PERMISSION_ID_APP_TRACKING_TRANSPARENCY}));};};export default grantAppTrackingTransparencyPermission;
@@ -1,4 +1,4 @@
1
- function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import{PERMISSION_ID_CAMERA}from'@shopgate/pwa-core/constants/AppPermissions';import grantPermissions from"./grantPermissions";/**
1
+ function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import{PERMISSION_ID_CAMERA}from'@shopgate/engage/core/constants';import grantPermissions from"./grantPermissions";/**
2
2
  * Determines the current state of the camera permissions.
3
3
  * If not already happened, the user will be prompted to grant permissions.
4
4
  * The action returns a promise which resolves with a boolean value, that indicates the state.
@@ -1,4 +1,4 @@
1
- function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import{PERMISSION_ID_LOCATION}from'@shopgate/pwa-core/constants/AppPermissions';import{hasWebBridge}from'@shopgate/engage/core';import grantPermissions from"./grantPermissions";/**
1
+ function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import{PERMISSION_ID_LOCATION}from'@shopgate/engage/core/constants';import{hasWebBridge}from'@shopgate/engage/core';import grantPermissions from"./grantPermissions";/**
2
2
  * Determines the current state of the geolocation permissions.
3
3
  * If not already happened, the user will be prompted to grant permissions.
4
4
  * The action returns a promise which resolves with a boolean value, that indicates the state.
@@ -1,4 +1,4 @@
1
- import _regeneratorRuntime from"@babel/runtime/regenerator";function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");}function _iterableToArrayLimit(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import event from'@shopgate/pwa-core/classes/Event';import{APP_EVENT_APPLICATION_WILL_ENTER_FOREGROUND}from'@shopgate/pwa-core/constants/AppEvents';import openAppSettings from'@shopgate/pwa-core/commands/openAppSettings';import showModal from'@shopgate/pwa-common/actions/modal/showModal';import{STATUS_DENIED,STATUS_GRANTED,STATUS_NOT_DETERMINED,STATUS_NOT_SUPPORTED,availablePermissionsIds}from'@shopgate/pwa-core/constants/AppPermissions';import{getAppPermissions,requestAppPermissions}from'@shopgate/pwa-core/commands/appPermissions';import{logger,hasSGJavaScriptBridge}from'@shopgate/pwa-core/helpers';import{hasWebBridge}from'@shopgate/engage/core';import{createMockedPermissions}from"../helpers/appPermissions";/**
1
+ import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import event from'@shopgate/pwa-core/classes/Event';import{openAppSettings}from'@shopgate/engage/core/commands';import{showModal}from'@shopgate/engage/core/actions';import{PERMISSION_STATUS_DENIED,PERMISSION_STATUS_GRANTED,PERMISSION_STATUS_NOT_DETERMINED,PERMISSION_STATUS_NOT_SUPPORTED,APP_EVENT_APPLICATION_WILL_ENTER_FOREGROUND,availablePermissionsIds}from'@shopgate/engage/core/constants';import{logger,hasSGJavaScriptBridge,hasWebBridge}from'@shopgate/engage/core/helpers';import requestAppPermission from"./requestAppPermission";import requestAppPermissionStatus from"./requestAppPermissionStatus";import{createMockedPermissions}from"../helpers/appPermissions";/**
2
2
  * Determines the current state of a specific permission for an app feature. If not already
3
3
  * happened, the user will be prompted to grant permissions.
4
4
  * The action returns a promise which resolves with a boolean value, that indicates the state.
@@ -6,6 +6,13 @@ import _regeneratorRuntime from"@babel/runtime/regenerator";function _slicedToAr
6
6
  * @param {string} options.permissionId The id of the permission to request.
7
7
  * @param {boolean} [options.useSettingsModal=false] Whether in case of declined permissions a modal
8
8
  * shall be presented, which redirects to the app settings.
9
+ * @param {boolean} [options.useRationaleModal=false] Whether a rational modal should be shown
10
+ * @param {Object} [options.rationaleModal={}] Options for the rationale modal.
11
+ * @param {string} options.rationaleModal.title Modal title.
12
+ * @param {string} options.rationaleModal.message Modal message.
13
+ * @param {string} options.rationaleModal.confirm Label for the confirm button.
14
+ * @param {string} options.rationaleModal.dismiss Label for the dismiss button.
15
+ * @param {Object} options.rationaleModal.params Additional parameters for i18n strings.
9
16
  * @param {Object} [options.modal={}] Options for the settings modal.
10
17
  * @param {string} options.modal.title Modal title.
11
18
  * @param {string} options.modal.message Modal message.
@@ -14,18 +21,18 @@ import _regeneratorRuntime from"@babel/runtime/regenerator";function _slicedToAr
14
21
  * @param {Object} options.modal.params Additional parameters for i18n strings.
15
22
  * @param {boolean} [options.requestPermissions=true] If set to TRUE no permissions will be
16
23
  * requested if not already granted,
17
- * @param {boolean} [option.resolveWithData=false] If set to TRUE the Promise will resolve with
24
+ * @param {boolean} [options.resolveWithData=false] If set to TRUE the Promise will resolve with
18
25
  * data if available (e.g. geolocation).
19
26
  * @return { Function } A redux thunk.
20
- */var grantPermissions=function grantPermissions(){var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return function(dispatch){return new Promise(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(resolve){var permissionId,_options$useSettingsM,useSettingsModal,_options$modal,modalOptions,_options$requestPermi,requestPermissions,_options$resolveWithD,resolveWithData,dispatchMock,fallbackStatus,status,data,_ref2,_ref3,_ref4,_ref5,_ref5$,openSettings,handler;return _regeneratorRuntime.wrap(function _callee2$(_context2){while(1){switch(_context2.prev=_context2.next){case 0:permissionId=options.permissionId,_options$useSettingsM=options.useSettingsModal,useSettingsModal=_options$useSettingsM===void 0?false:_options$useSettingsM,_options$modal=options.modal,modalOptions=_options$modal===void 0?{}:_options$modal,_options$requestPermi=options.requestPermissions,requestPermissions=_options$requestPermi===void 0?true:_options$requestPermi,_options$resolveWithD=options.resolveWithData,resolveWithData=_options$resolveWithD===void 0?false:_options$resolveWithD;if(!hasSGJavaScriptBridge()||hasWebBridge()){/**
27
+ */var grantPermissions=function grantPermissions(){var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return function(dispatch){return new Promise(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(resolve){var permissionId,_options$useSettingsM,useSettingsModal,_options$useRationale,useRationaleModal,_options$rationaleMod,rationaleModalOptions,_options$modal,modalOptions,_options$requestPermi,requestPermissions,_options$resolveWithD,resolveWithData,dispatchMock,fallbackStatus,status,data,_ref2,requestAllowed,_ref3,openSettings,handler;return _regeneratorRuntime.wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:permissionId=options.permissionId,_options$useSettingsM=options.useSettingsModal,useSettingsModal=_options$useSettingsM===void 0?false:_options$useSettingsM,_options$useRationale=options.useRationaleModal,useRationaleModal=_options$useRationale===void 0?false:_options$useRationale,_options$rationaleMod=options.rationaleModal,rationaleModalOptions=_options$rationaleMod===void 0?{}:_options$rationaleMod,_options$modal=options.modal,modalOptions=_options$modal===void 0?{}:_options$modal,_options$requestPermi=options.requestPermissions,requestPermissions=_options$requestPermi===void 0?true:_options$requestPermi,_options$resolveWithD=options.resolveWithData,resolveWithData=_options$resolveWithD===void 0?false:_options$resolveWithD;if(!hasSGJavaScriptBridge()||hasWebBridge()){/**
21
28
  * The fallbackStatus will be used at browsers that don't support the permissions API. By
22
29
  * default it will always resolve with GRANTED, so that further steps still might trigger a
23
30
  * permissions dialog. When permissions are not supposed to be requested, it will resolve with
24
31
  * the NOT_DETERMINED status, to keep logic between browsers / apps in sync as much as possible.
25
- */fallbackStatus=requestPermissions?STATUS_GRANTED:STATUS_NOT_DETERMINED;dispatchMock=createMockedPermissions(fallbackStatus);}if(availablePermissionsIds.includes(permissionId)){_context2.next=6;break;}logger.error('grandPermissions: %s is no valid permission id',permissionId);resolve(false);return _context2.abrupt("return");case 6:_context2.next=8;return getAppPermissions([permissionId],dispatchMock);case 8:_ref2=_context2.sent;_ref3=_slicedToArray(_ref2,1);status=_ref3[0].status;if(!(status===STATUS_NOT_SUPPORTED)){_context2.next=14;break;}resolve(false);return _context2.abrupt("return");case 14:if(!(status===STATUS_NOT_DETERMINED)){_context2.next=28;break;}if(requestPermissions){_context2.next=18;break;}resolve(false);return _context2.abrupt("return");case 18:_context2.next=20;return requestAppPermissions([{permissionId:permissionId}],dispatchMock);case 20:_ref4=_context2.sent;_ref5=_slicedToArray(_ref4,1);_ref5$=_ref5[0];status=_ref5$.status;data=_ref5$.data;if(![STATUS_DENIED,STATUS_NOT_DETERMINED].includes(status)){_context2.next=28;break;}resolve(false);return _context2.abrupt("return");case 28:if(!(status===STATUS_GRANTED)){_context2.next=31;break;}resolve(resolveWithData&&data?data:true);return _context2.abrupt("return");case 31:if(!(status===STATUS_DENIED)){_context2.next=44;break;}if(useSettingsModal){_context2.next=35;break;}resolve(false);return _context2.abrupt("return");case 35:_context2.next=37;return dispatch(showModal({title:modalOptions.title||null,message:modalOptions.message,confirm:modalOptions.confirm,dismiss:modalOptions.dismiss,params:modalOptions.params}));case 37:openSettings=_context2.sent;if(openSettings){_context2.next=41;break;}resolve(false);return _context2.abrupt("return");case 41:/**
32
+ */fallbackStatus=requestPermissions?PERMISSION_STATUS_GRANTED:PERMISSION_STATUS_NOT_DETERMINED;dispatchMock=createMockedPermissions(fallbackStatus);}if(availablePermissionsIds.includes(permissionId)){_context2.next=6;break;}logger.error('grandPermissions: %s is no valid permission id',permissionId);resolve(false);return _context2.abrupt("return");case 6:_context2.next=8;return dispatch(requestAppPermissionStatus({permissionId:permissionId,dispatchMock:dispatchMock}));case 8:_ref2=_context2.sent;status=_ref2.status;if(!(status===PERMISSION_STATUS_NOT_SUPPORTED)){_context2.next=13;break;}resolve(false);return _context2.abrupt("return");case 13:if(!(status===PERMISSION_STATUS_NOT_DETERMINED)){_context2.next=32;break;}if(requestPermissions){_context2.next=17;break;}resolve(false);return _context2.abrupt("return");case 17:if(!useRationaleModal){_context2.next=24;break;}_context2.next=20;return dispatch(showModal({message:rationaleModalOptions.message||'',confirm:rationaleModalOptions.confirm||'',dismiss:rationaleModalOptions.dismiss||'',params:rationaleModalOptions.params}));case 20:requestAllowed=_context2.sent;if(!(requestAllowed===false)){_context2.next=24;break;}resolve(false);return _context2.abrupt("return");case 24:_context2.next=26;return dispatch(requestAppPermission({permissionId:permissionId,dispatchMock:dispatchMock}));case 26:_ref3=_context2.sent;status=_ref3.status;data=_ref3.data;if(![PERMISSION_STATUS_DENIED,PERMISSION_STATUS_NOT_DETERMINED].includes(status)){_context2.next=32;break;}resolve(false);return _context2.abrupt("return");case 32:if(!(status===PERMISSION_STATUS_GRANTED)){_context2.next=35;break;}resolve(resolveWithData&&data?data:true);return _context2.abrupt("return");case 35:if(!(status===PERMISSION_STATUS_DENIED)){_context2.next=48;break;}if(useSettingsModal){_context2.next=39;break;}resolve(false);return _context2.abrupt("return");case 39:_context2.next=41;return dispatch(showModal({title:modalOptions.title||null,message:modalOptions.message,confirm:modalOptions.confirm,dismiss:modalOptions.dismiss,params:modalOptions.params}));case 41:openSettings=_context2.sent;if(openSettings){_context2.next=45;break;}resolve(false);return _context2.abrupt("return");case 45:/**
26
33
  * Handler for the app event.
27
- */handler=/*#__PURE__*/function(){var _ref6=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(){var _ref7,_ref8;return _regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:event.removeCallback(APP_EVENT_APPLICATION_WILL_ENTER_FOREGROUND,handler);_context.next=3;return getAppPermissions([permissionId]);case 3:_ref7=_context.sent;_ref8=_slicedToArray(_ref7,1);status=_ref8[0].status;resolve(status===STATUS_GRANTED);case 7:case"end":return _context.stop();}}},_callee);}));return function handler(){return _ref6.apply(this,arguments);};}();/**
34
+ */handler=/*#__PURE__*/function(){var _ref4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(){var _ref5;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:event.removeCallback(APP_EVENT_APPLICATION_WILL_ENTER_FOREGROUND,handler);_context.next=3;return dispatch(requestAppPermissionStatus({permissionId:permissionId}));case 3:_ref5=_context.sent;status=_ref5.status;resolve(status===PERMISSION_STATUS_GRANTED);case 6:case"end":return _context.stop();}},_callee);}));return function handler(){return _ref4.apply(this,arguments);};}();/**
28
35
  * Register an event handler, so that we can perform the permissions check again,
29
36
  * when the user comes back from the settings.
30
37
  */event.addCallback(APP_EVENT_APPLICATION_WILL_ENTER_FOREGROUND,handler);// Open the settings (protected by a timeout, so that the modal closes before the app is left).
31
- setTimeout(function(){openAppSettings();},0);case 44:case"end":return _context2.stop();}}},_callee2);}));return function(_x){return _ref.apply(this,arguments);};}());};};export default grantPermissions;
38
+ setTimeout(function(){openAppSettings();},0);case 48:case"end":return _context2.stop();}},_callee2);}));return function(_x){return _ref.apply(this,arguments);};}());};};export default grantPermissions;
@@ -0,0 +1,22 @@
1
+ function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import{PERMISSION_ID_PUSH}from'@shopgate/engage/core/constants';import grantPermissions from"./grantPermissions";/**
2
+ * Determines the current state of the push permissions.
3
+ * If not already happened, the user will be prompted to grant permissions.
4
+ * The action returns a promise which resolves with a boolean value, that indicates the state.
5
+ * @param {Object} options Action options.
6
+ * @param {boolean} [options.useSettingsModal=true] Whether in case of declined permissions a modal
7
+ * shall be presented, which redirects to the app settings.
8
+ * @param {boolean} [options.useRationaleModal=false] Whether a rational modal should be shown
9
+ * @param {Object} [options.rationaleModal={}] Options for the rationale modal.
10
+ * @param {string} options.rationaleModal.title Modal title.
11
+ * @param {string} options.rationaleModal.message Modal message.
12
+ * @param {string} options.rationaleModal.confirm Label for the confirm button.
13
+ * @param {string} options.rationaleModal.dismiss Label for the dismiss button.
14
+ * @param {Object} options.rationaleModal.params Additional parameters for i18n strings.
15
+ * @param {Object} [options.modal={}] Options for the settings modal.
16
+ * @param {string} options.modal.title Modal title.
17
+ * @param {string} options.modal.message Modal message.
18
+ * @param {string} options.modal.confirm Label for the confirm button.
19
+ * @param {string} options.modal.dismiss Label for the dismiss button.
20
+ * @param {Object} options.modal.params Additional parameters for i18n strings.
21
+ * @return { Function } A redux thunk.
22
+ */var grantPushPermissions=function grantPushPermissions(){var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return function(dispatch){var _options$useSettingsM=options.useSettingsModal,useSettingsModal=_options$useSettingsM===void 0?true:_options$useSettingsM,_options$useRationale=options.useRationaleModal,useRationaleModal=_options$useRationale===void 0?false:_options$useRationale,_options$modal=options.modal,modal=_options$modal===void 0?{}:_options$modal,_options$rationaleMod=options.rationaleModal,rationaleModal=_options$rationaleMod===void 0?{}:_options$rationaleMod;return dispatch(grantPermissions({permissionId:PERMISSION_ID_PUSH,useSettingsModal:useSettingsModal,useRationaleModal:useRationaleModal,modal:_extends({title:null,message:'permissions.access_denied.push_message',confirm:'permissions.access_denied.settings_button'},modal),rationaleModal:rationaleModal}));};};export default grantPushPermissions;
@@ -0,0 +1,7 @@
1
+ export{default as getGeolocation}from"./getGeolocation";export{default as grantAppTrackingTransparencyPermission}from"./grantAppTrackingTransparencyPermission";export{default as grantCameraPermissions}from"./grantCameraPermissions";export{default as grantGeolocationPermissions}from"./grantGeolocationPermissions";export{default as grantPermissions}from"./grantPermissions";export{default as grantPushPermissions}from"./grantPushPermissions";export{default as requestAppPermission}from"./requestAppPermission";export{default as requestAppPermissionStatus}from"./requestAppPermissionStatus";export{default as updateStatusBarBackground}from"./updateStatusBarBackground";// --------------- APP --------------- //
2
+ export{default as handleDeepLink}from'@shopgate/pwa-common/actions/app/handleDeepLink';export{default as handleUniversalLink}from'@shopgate/pwa-common/actions/app/handleUniversalLink';export{default as handleLink}from'@shopgate/pwa-common/actions/app/handleLink';export{default as handlePushNotification}from'@shopgate/pwa-common/actions/app/handlePushNotification';export{default as registerLinkEvents}from'@shopgate/pwa-common/actions/app/registerLinkEvents';// --------------- CLIENT --------------- //
3
+ export{default as fetchClientInformation}from'@shopgate/pwa-common/actions/client/fetchClientInformation';// --------------- ROUTER --------------- //
4
+ export{historyPop}from'@shopgate/pwa-common/actions/router/historyPop';export{historyPopToRoute}from'@shopgate/pwa-common/actions/router/historyPopToRoute';export{historyPush}from'@shopgate/pwa-common/actions/router/historyPush';export{historyRedirect}from'@shopgate/pwa-common/actions/router/historyRedirect';export{historyReplace}from'@shopgate/pwa-common/actions/router/historyReplace';export{historyReset}from'@shopgate/pwa-common/actions/router/historyReset';export{historyResetTo}from'@shopgate/pwa-common/actions/router/historyResetTo';// --------------- URL --------------- //
5
+ export{resetApp}from'@shopgate/pwa-common/action-creators/app';export*from'@shopgate/pwa-common/action-creators/url';// --------------- MENU --------------- //
6
+ export{default as fetchMenu}from'@shopgate/pwa-common/actions/menu/fetchMenu';// --------------- MODAL --------------- //
7
+ export{default as closeModal}from'@shopgate/pwa-common/actions/modal/closeModal';export{default as promiseMap}from'@shopgate/pwa-common/actions/modal/promiseMap';export{default as showModal}from'@shopgate/pwa-common/actions/modal/showModal';
@@ -0,0 +1,12 @@
1
+ import _regeneratorRuntime from"@babel/runtime/regenerator";function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");}function _iterableToArrayLimit(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{hasSGJavaScriptBridge,hasWebBridge,createMockedPermissions}from'@shopgate/engage/core/helpers';import{requestAppPermissions}from'@shopgate/pwa-core/commands/appPermissions';import{PERMISSION_STATUS_NOT_SUPPORTED,PERMISSION_STATUS_GRANTED}from'@shopgate/engage/core/constants';import{appPermissionStatusReceived}from"../action-creators";/**
2
+ * Requests an additional app permission from the operating system.
3
+ * Additionally it propagates the received status via the APP_PERMISSION_STATUS_RECEIVED action.
4
+ * @param {Object} params The action params
5
+ * @param {string} params.permissionId The desired app permission id
6
+ * @param {Function} [params.dispatchMock=null] An optional mock for the request dispatch logic.
7
+ * Usually used when PWA is running inside a browser and app command logic can be simulated via
8
+ * browser APIs like for geolocation access.
9
+ * @returns {Function} A Redux thunk
10
+ */var requestAppPermission=function requestAppPermission(_ref){var permissionId=_ref.permissionId,dispatchMockParam=_ref.dispatchMock;return(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){var _ref5;var dispatchMock,_ref3,_ref4,_ref4$,_ref4$2,status,options,data;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:dispatchMock=dispatchMockParam;// In development a mock needs to be injected to enable command testing. Command responses
11
+ // can be mocked via the global MockedAppPermissions object see appPermissions.js
12
+ if(!dispatchMockParam&&(!hasSGJavaScriptBridge()||hasWebBridge())){dispatchMock=createMockedPermissions(PERMISSION_STATUS_GRANTED);}_context.next=4;return requestAppPermissions([{permissionId:permissionId}],dispatchMock);case 4:_context.t1=_ref5=_context.sent;_context.t0=_context.t1!==null;if(!_context.t0){_context.next=8;break;}_context.t0=_ref5!==void 0;case 8:if(!_context.t0){_context.next=12;break;}_context.t2=_ref5;_context.next=13;break;case 12:_context.t2=[];case 13:_ref3=_context.t2;_ref4=_slicedToArray(_ref3,1);_ref4$=_ref4[0];_ref4$2=_ref4$===void 0?{status:PERMISSION_STATUS_NOT_SUPPORTED}:_ref4$;status=_ref4$2.status;options=_ref4$2.options;data=_ref4$2.data;dispatch(appPermissionStatusReceived({permissionId:permissionId,status:status,options:options}));return _context.abrupt("return",{status:status,data:data});case 22:case"end":return _context.stop();}},_callee);}));return function(_x){return _ref2.apply(this,arguments);};}());};export default requestAppPermission;
@@ -0,0 +1,12 @@
1
+ import _regeneratorRuntime from"@babel/runtime/regenerator";function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");}function _iterableToArrayLimit(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{hasSGJavaScriptBridge,hasWebBridge,createMockedPermissions}from'@shopgate/engage/core/helpers';import{getAppPermissions}from'@shopgate/pwa-core/commands/appPermissions';import{PERMISSION_STATUS_NOT_SUPPORTED,PERMISSION_STATUS_GRANTED}from'@shopgate/engage/core/constants';import{appPermissionStatusReceived}from"../action-creators";/**
2
+ * Determines the current status of an app permission from the operating system.
3
+ * Additionally it propagates the received status via the APP_PERMISSION_STATUS_RECEIVED action.
4
+ * @param {Object} params The action params
5
+ * @param {string} params.permissionId The desired app permission id
6
+ * @param {Function} [params.dispatchMock=null] An optional mock for the request dispatch logic.
7
+ * Usually used when PWA is running inside a browser and app command logic can be simulated via
8
+ * browser APIs like for geolocation access.
9
+ * @returns {Function} A Redux thunk
10
+ */var requestAppPermissionStatus=function requestAppPermissionStatus(_ref){var permissionId=_ref.permissionId,dispatchMockParam=_ref.dispatchMock;return(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(dispatch){var _ref5;var dispatchMock,_ref3,_ref4,_ref4$,_ref4$2,status,options;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:dispatchMock=dispatchMockParam;// In development a mock needs to be injected to enable command testing. Command responses
11
+ // can be mocked via the global MockedAppPermissions object see appPermissions.js
12
+ if(!dispatchMockParam&&(!hasSGJavaScriptBridge()||hasWebBridge())){dispatchMock=createMockedPermissions(PERMISSION_STATUS_GRANTED);}_context.next=4;return getAppPermissions([permissionId],dispatchMock);case 4:_context.t1=_ref5=_context.sent;_context.t0=_context.t1!==null;if(!_context.t0){_context.next=8;break;}_context.t0=_ref5!==void 0;case 8:if(!_context.t0){_context.next=12;break;}_context.t2=_ref5;_context.next=13;break;case 12:_context.t2=[];case 13:_ref3=_context.t2;_ref4=_slicedToArray(_ref3,1);_ref4$=_ref4[0];_ref4$2=_ref4$===void 0?{status:PERMISSION_STATUS_NOT_SUPPORTED}:_ref4$;status=_ref4$2.status;options=_ref4$2.options;dispatch(appPermissionStatusReceived({permissionId:permissionId,status:status,options:options}));return _context.abrupt("return",{status:status});case 21:case"end":return _context.stop();}},_callee);}));return function(_x){return _ref2.apply(this,arguments);};}());};export default requestAppPermissionStatus;
@@ -1,6 +1,5 @@
1
1
  function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor;}import geolocationRequestBrowser from"./GeolocationRequestBrowser";import geolocationRequestApp from"./GeolocationRequestApp";import{GEOLOCATION_DEFAULT_TIMEOUT}from"../constants/geolocationRequest";/**
2
2
  * The GeolocationRequest class enables to retrieve the current geolocation of the device.
3
- * @deprecated
4
3
  */var GeolocationRequest=/*#__PURE__*/function(){/**
5
4
  * Constructor
6
5
  * @param {boolean} [useBrowserAPI=true] Wether the browser API or app commands a supposed to
@@ -9,8 +8,8 @@ function _classCallCheck(instance,Constructor){if(!(instance instanceof Construc
9
8
  * Sets a timeout for the location request.
10
9
  * @param {number} [value=10000] The timeout in ms.
11
10
  * @returns {GeolocationRequest}
12
- */_createClass(GeolocationRequest,[{key:"setTimeout",value:function setTimeout(){var value=arguments.length>0&&arguments[0]!==undefined?arguments[0]:GEOLOCATION_DEFAULT_TIMEOUT;this.options.timeout=value;return this;}/**
11
+ */return _createClass(GeolocationRequest,[{key:"setTimeout",value:function setTimeout(){var value=arguments.length>0&&arguments[0]!==undefined?arguments[0]:GEOLOCATION_DEFAULT_TIMEOUT;this.options.timeout=value;return this;}/**
13
12
  * Dispatches the request. If no further provisions are made, it will trigger the geolocation
14
13
  * permission dialog if permissions are not already granted.
15
14
  * @returns {Promise}
16
- */},{key:"dispatch",value:function dispatch(){var instance=this.useBrowserAPI?geolocationRequestBrowser:geolocationRequestApp;return instance.dispatch(this.options.timeout);}}]);return GeolocationRequest;}();export default GeolocationRequest;
15
+ */},{key:"dispatch",value:function dispatch(){var instance=this.useBrowserAPI?geolocationRequestBrowser:geolocationRequestApp;return instance.dispatch(this.options.timeout);}}]);}();export default GeolocationRequest;
@@ -3,14 +3,14 @@ import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGenera
3
3
  * Therefore it utilizes app commands and events.
4
4
  */var GeolocationRequestApp=/*#__PURE__*/function(){/**
5
5
  * Constructor.
6
- */function GeolocationRequestApp(){var _this=this;_classCallCheck(this,GeolocationRequestApp);_defineProperty(this,"handleResponse",function(response){var queueEntry=_this.responseQueue.shift();if(typeof queueEntry==='undefined'){logger.error("".concat(EVENT_NAME," received but the response handler queue is empty."));return;}logGroup('GetLocationResponse ',response,'#9a9800');var resolve=queueEntry.resolve,reject=queueEntry.reject,timestamp=queueEntry.timestamp,timeout=queueEntry.timeout;if(typeof response!=='undefined'){resolve({accuracy:response.accuracy,latitude:response.latitude,longitude:response.longitude});return;}var error;var isTimeout=new Date().getTime()-timestamp>timeout;if(isTimeout){error=new Error('Timeout expired');error.code=GEOLOCATION_ERROR_TIMEOUT;}else{error=new Error('User denied Geolocation');error.code=GEOLOCATION_ERROR_DENIED;}reject(error);});/**
7
- * The getLocation command provide a serial parameter to identify related events. So this class
8
- * maintains a request queue that guarantees one event handler per dispatched command.
9
- */this.responseQueue=[];event.addCallback(EVENT_NAME,this.handleResponse);}/**
6
+ */function GeolocationRequestApp(){var _this=this;_classCallCheck(this,GeolocationRequestApp);/**
10
7
  * Handles responses
11
8
  * @param {Object} response Response.
12
- */_createClass(GeolocationRequestApp,[{key:"dispatch",/**
9
+ */_defineProperty(this,"handleResponse",function(response){var queueEntry=_this.responseQueue.shift();if(typeof queueEntry==='undefined'){logger.error("".concat(EVENT_NAME," received but the response handler queue is empty."));return;}logGroup('GetLocationResponse ',response,'#9a9800');var resolve=queueEntry.resolve,reject=queueEntry.reject,timestamp=queueEntry.timestamp,timeout=queueEntry.timeout;if(typeof response!=='undefined'){resolve({accuracy:response.accuracy,latitude:response.latitude,longitude:response.longitude});return;}var error;var isTimeout=new Date().getTime()-timestamp>timeout;if(isTimeout){error=new Error('Timeout expired');error.code=GEOLOCATION_ERROR_TIMEOUT;}else{error=new Error('User denied Geolocation');error.code=GEOLOCATION_ERROR_DENIED;}reject(error);});/**
10
+ * The getLocation command provide a serial parameter to identify related events. So this class
11
+ * maintains a request queue that guarantees one event handler per dispatched command.
12
+ */this.responseQueue=[];event.addCallback(EVENT_NAME,this.handleResponse);}return _createClass(GeolocationRequestApp,[{key:"dispatch",value:/**
13
13
  * Dispatches the request.
14
14
  * @param {number} [timeout=GEOLOCATION_DEFAULT_TIMEOUT] Timeout in ms for the request.
15
15
  * @returns {Promise}
16
- */value:function dispatch(){var _this2=this;var timeout=arguments.length>0&&arguments[0]!==undefined?arguments[0]:GEOLOCATION_DEFAULT_TIMEOUT;return new Promise(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(resolve,reject){var commandParams;return _regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:_this2.responseQueue.push({resolve:resolve,reject:reject,timeout:timeout,timestamp:new Date().getTime()});commandParams={timeout:timeout/1000};logGroup('GetLocationRequest',commandParams,'#9a9800');_context.next=5;return new AppCommand().setCommandName(COMMAND_NAME).setLibVersion(LIB_VERSION).setCommandParams(commandParams).dispatch();case 5:case"end":return _context.stop();}}},_callee);}));return function(_x,_x2){return _ref.apply(this,arguments);};}());}}]);return GeolocationRequestApp;}();export{GeolocationRequestApp};export default new GeolocationRequestApp();
16
+ */function dispatch(){var _this2=this;var timeout=arguments.length>0&&arguments[0]!==undefined?arguments[0]:GEOLOCATION_DEFAULT_TIMEOUT;return new Promise(/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(resolve,reject){var commandParams;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_this2.responseQueue.push({resolve:resolve,reject:reject,timeout:timeout,timestamp:new Date().getTime()});commandParams={timeout:timeout/1000};logGroup('GetLocationRequest',commandParams,'#9a9800');_context.next=5;return new AppCommand().setCommandName(COMMAND_NAME).setLibVersion(LIB_VERSION).setCommandParams(commandParams).dispatch();case 5:case"end":return _context.stop();}},_callee);}));return function(_x,_x2){return _ref.apply(this,arguments);};}());}}]);}();export{GeolocationRequestApp};export default new GeolocationRequestApp();
@@ -1,8 +1,8 @@
1
1
  function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor;}import{GEOLOCATION_ERROR_UNKNOWN,GEOLOCATION_ERROR_DENIED,GEOLOCATION_ERROR_UNAVAILABLE,GEOLOCATION_ERROR_TIMEOUT,GEOLOCATION_DEFAULT_TIMEOUT}from"../constants/geolocationRequest";var errorMapping=[GEOLOCATION_ERROR_UNKNOWN,GEOLOCATION_ERROR_DENIED,GEOLOCATION_ERROR_UNAVAILABLE,GEOLOCATION_ERROR_TIMEOUT];/* eslint-disable class-methods-use-this */ /**
2
2
  * The GeolocationRequestBrowser class enables to retrieve the current geolocation of the device.
3
- */var GeolocationRequestBrowser=/*#__PURE__*/function(){function GeolocationRequestBrowser(){_classCallCheck(this,GeolocationRequestBrowser);}_createClass(GeolocationRequestBrowser,[{key:"dispatch",/**
3
+ */var GeolocationRequestBrowser=/*#__PURE__*/function(){function GeolocationRequestBrowser(){_classCallCheck(this,GeolocationRequestBrowser);}return _createClass(GeolocationRequestBrowser,[{key:"dispatch",value:/**
4
4
  * Dispatches the request. If no further provisions are made, it will trigger the geolocation
5
5
  * permission dialog if permissions are not already granted.
6
6
  * @param {number} [timeout=GEOLOCATION_DEFAULT_TIMEOUT] Timeout in ms for the request.
7
7
  * @returns {Promise}
8
- */value:function dispatch(){var timeout=arguments.length>0&&arguments[0]!==undefined?arguments[0]:GEOLOCATION_DEFAULT_TIMEOUT;return new Promise(function(resolve,reject){navigator.geolocation.getCurrentPosition(function(position){var coords=position.coords;resolve({accuracy:coords.accuracy,latitude:coords.latitude,longitude:coords.longitude});},function(_ref){var code=_ref.code,message=_ref.message;var error=new Error(message);error.code=errorMapping[code];reject(error);},{timeout:timeout});});}}]);return GeolocationRequestBrowser;}();export{GeolocationRequestBrowser};/* eslint-enable class-methods-use-this */export default new GeolocationRequestBrowser();
8
+ */function dispatch(){var timeout=arguments.length>0&&arguments[0]!==undefined?arguments[0]:GEOLOCATION_DEFAULT_TIMEOUT;return new Promise(function(resolve,reject){navigator.geolocation.getCurrentPosition(function(position){var coords=position.coords;resolve({accuracy:coords.accuracy,latitude:coords.latitude,longitude:coords.longitude});},function(_ref){var code=_ref.code,message=_ref.message;var error=new Error(message);error.code=errorMapping[code];reject(error);},{timeout:timeout});});}}]);}();export{GeolocationRequestBrowser};/* eslint-enable class-methods-use-this */export default new GeolocationRequestBrowser();
@@ -0,0 +1 @@
1
+ export{default as GeolocationRequest}from"./GeolocationRequest";export{default as AppCommand}from'@shopgate/pwa-core/classes/AppCommand';export{default as AppCommandRequest}from'@shopgate/pwa-core/classes/AppCommandRequest';export{default as GetAppPermissionsRequest}from'@shopgate/pwa-core/classes/AppPermissionsRequest/GetAppPermissionsRequest';export{default as RequestAppPermissionsRequest}from'@shopgate/pwa-core/classes/AppPermissionsRequest/RequestAppPermissionsRequest';export{default as BrightnessRequest}from'@shopgate/pwa-core/classes/BrightnessRequest';export{default as Conditioner}from'@shopgate/pwa-core/classes/Conditioner';export{default as DataRequest}from'@shopgate/pwa-core/classes/DataRequest';export{default as DevServerBridge}from'@shopgate/pwa-core/classes/DevServerBridge';export{default as errorManager,emitter}from'@shopgate/pwa-core/classes/ErrorManager';export{default as event}from'@shopgate/pwa-core/classes/Event';export{default as HttpRequest}from'@shopgate/pwa-core/classes/HttpRequest';export{default as PipelineRequest}from'@shopgate/pwa-core/classes/PipelineRequest';export{default as ScannerManager}from'@shopgate/pwa-core/classes/ScannerManager';export{default as WebStorageRequest}from'@shopgate/pwa-core/classes/WebStorageRequest';
@@ -0,0 +1,49 @@
1
+ import _regeneratorRuntime from"@babel/runtime/regenerator";function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor;}/**
2
+ * @callback AppInitializationHandler
3
+ * @param {Object} params
4
+ * @param {Function} params.dispatch Redux dispatch function
5
+ * @param {Function} params.getState Redux dispatch function
6
+ * @returns {Promise}
7
+ */ /**
8
+ * Class to maintain handler functions that are executed before the React app initializes.
9
+ *
10
+ * Handlers are invoked before the React app initializes. They can
11
+ * interact with Redux via "dispatch" and "getState" and e.g. initialize states based on
12
+ * information which is retrieved via app commands.
13
+ *
14
+ * Since the handler execution is blocking and postpones the React app initialization, this
15
+ * system should be handled with care.
16
+ */var AppInitialization=/*#__PURE__*/function(){/**
17
+ * Constructor
18
+ */function AppInitialization(){_classCallCheck(this,AppInitialization);this.store=new Map();}/**
19
+ * Get an initialization handler
20
+ * @param {*} key Identifier for the handler
21
+ * @returns {Promise}
22
+ */return _createClass(AppInitialization,[{key:"get",value:function get(key){return this.store.get(key);}/**
23
+ * Sets an initialization handler.
24
+ *
25
+ * @param {*} key Identifier for the handler
26
+ * @param {AppInitializationHandler} handler The actual handler
27
+ * @returns {AppInitialization}
28
+ *
29
+ * @example
30
+ * const handler = ({ dispatch, getState }) => {
31
+ * return new Promise(async (resolve) => {
32
+ * // Retrieve some data from the app via app command
33
+ * const appCommandResponse = await getAppCommandResponse();
34
+ * // Retrieve some data from Redux (store will be nearly empty at this point)
35
+ * const reduxValue = getValueFromRedux(getState());
36
+ * // Dispatch Redux actions to initialize a Redux state
37
+ * dispatch(reduxAction(reduxValue, appCommandResponse));
38
+ * resolve();
39
+ * });
40
+ *
41
+ * appInitialization.set('handler-key', handler);
42
+ * }
43
+ */},{key:"set",value:function set(key,handler){this.store.set(key,handler);return this;}/**
44
+ * Invokes all registered handlers
45
+ * @returns {Promise<{results: [], errors: []}>}
46
+ */},{key:"initialize",value:function(){var _initialize=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref){var dispatch,getState,promises,results,errors,_iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,promise;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:dispatch=_ref.dispatch,getState=_ref.getState;promises=Array.from(this.store.values()).map(function(handler){var res;// Take care that errors inside handlers don't break the app
47
+ try{res=handler({dispatch:dispatch,getState:getState});}catch(e){// Nothing to see here
48
+ }return res;}).filter(Boolean);results=[];errors=[];// eslint-disable-next-line no-restricted-syntax
49
+ _iteratorNormalCompletion=true;_didIteratorError=false;_iteratorError=undefined;_context.prev=7;_iterator=promises[Symbol.iterator]();case 9:if(_iteratorNormalCompletion=(_step=_iterator.next()).done){_context.next=25;break;}promise=_step.value;_context.prev=11;_context.t0=results;_context.next=15;return promise;case 15:_context.t1=_context.sent;_context.t0.push.call(_context.t0,_context.t1);_context.next=22;break;case 19:_context.prev=19;_context.t2=_context["catch"](11);errors.push(_context.t2);case 22:_iteratorNormalCompletion=true;_context.next=9;break;case 25:_context.next=31;break;case 27:_context.prev=27;_context.t3=_context["catch"](7);_didIteratorError=true;_iteratorError=_context.t3;case 31:_context.prev=31;_context.prev=32;if(!_iteratorNormalCompletion&&_iterator["return"]!=null){_iterator["return"]();}case 34:_context.prev=34;if(!_didIteratorError){_context.next=37;break;}throw _iteratorError;case 37:return _context.finish(34);case 38:return _context.finish(31);case 39:return _context.abrupt("return",{results:results,errors:errors});case 40:case"end":return _context.stop();}},_callee,this,[[7,27,31,39],[11,19],[32,,34,38]]);}));function initialize(_x){return _initialize.apply(this,arguments);}return initialize;}()}]);}();export default new AppInitialization();
@@ -0,0 +1 @@
1
+ export{default as appInitialization}from"./AppInitialization";export*from'@shopgate/pwa-common/collections';export{default as authRoutes}from'@shopgate/pwa-common/collections/AuthRoutes';export{default as redirects}from'@shopgate/pwa-common/collections/Redirects';export{default as configuration}from'@shopgate/pwa-common/collections/Configuration';export{default as embeddedMedia}from'@shopgate/pwa-common/collections/EmbeddedMedia';export{default as persistedReducers}from'@shopgate/pwa-common/collections/PersistedReducers';export{default as Vimeo}from'@shopgate/pwa-common/collections/media-providers/Vimeo';export{default as YouTube}from'@shopgate/pwa-common/collections/media-providers/YouTube';
@@ -0,0 +1,11 @@
1
+ function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import{AppCommandRequest}from'@shopgate/engage/core/classes';/**
2
+ * @typedef {Object} AnalyticsSetConsentResponse
3
+ * @property {string} status Update status
4
+ * @property {string} error Update error message
5
+ */ /**
6
+ * Sends cookie consent settings to the app
7
+ * @param {Object} params Command params
8
+ * @param {boolean} [params.statistics=false] Setting for statistics consent
9
+ * @param {boolean} [params.comfort=false] Setting for comfort consent
10
+ * @returns {Promise<AnalyticsSetConsentResponse>}
11
+ */var analyticsSetConsent=function analyticsSetConsent(){var params=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return new AppCommandRequest('analyticsSetConsent').setCommandParams(_extends({statistics:false,comfort:false},params)).dispatch();};export default analyticsSetConsent;
@@ -0,0 +1 @@
1
+ export{default as analyticsSetConsent}from"./analyticsSetConsent";export{default as analyticsSetCustomValues}from'@shopgate/pwa-core/commands/analyticsSetCustomValues';export*from'@shopgate/pwa-core/commands/appPermissions';export*from'@shopgate/pwa-core/commands/brightness';export{default as broadcastEvent}from'@shopgate/pwa-core/commands/broadcastEvent';export{default as cleanTab,cleanTabCmd}from'@shopgate/pwa-core/commands/cleanTab';export{default as closeInAppBrowser}from'@shopgate/pwa-core/commands/closeInAppBrowser';export{default as flushTab}from'@shopgate/pwa-core/commands/flushTab';export{default as hideMenuBar}from'@shopgate/pwa-core/commands/hideMenuBar';export{default as hideNavigationBar}from'@shopgate/pwa-core/commands/hideNavigationBar';export{default as hideSplashScreen}from'@shopgate/pwa-core/commands/hideSplashScreen';export{default as onload}from'@shopgate/pwa-core/commands/onload';export{default as openAppSettings}from'@shopgate/pwa-core/commands/openAppSettings';export{default as openPage}from'@shopgate/pwa-core/commands/openPage';export{default as openPageExtern}from'@shopgate/pwa-core/commands/openPageExtern';export{default as performCommandsAfterDelay,performCommandsAfterDelayCmd}from'@shopgate/pwa-core/commands/performCommandsAfterDelay';export*from'@shopgate/pwa-core/commands/plotProjects';export{default as popTabToRoot,popTabToRootCmd}from'@shopgate/pwa-core/commands/popTabToRoot';export{default as registerEvents}from'@shopgate/pwa-core/commands/registerEvents';export*from'@shopgate/pwa-core/commands/scanner';export{default as setCookie}from'@shopgate/pwa-core/commands/setCookie';export{default as setDebugLoggingEnabled}from'@shopgate/pwa-core/commands/setDebugLoggingEnabled';export{default as setScrollingEnabled}from'@shopgate/pwa-core/commands/setScrollingEnabled';export{default as showNavigationBar}from'@shopgate/pwa-core/commands/showNavigationBar';export{default as showTab}from'@shopgate/pwa-core/commands/showTab';export*from'@shopgate/pwa-core/commands/unifiedTracking';export{default as getWebStorageEntry}from'@shopgate/pwa-core/commands/getWebStorageEntry';export{default as setWebStorageEntry}from'@shopgate/pwa-core/commands/setWebStorageEntry';
@@ -9,7 +9,7 @@ function _typeof(obj){if(typeof Symbol==="function"&&typeof Symbol.iterator==="s
9
9
  this.endDelimiter=endDelimiter;}/**
10
10
  * Resolves the JSON configuration.
11
11
  * @returns {Object}
12
- */_createClass(ThemeConfigResolver,[{key:"resolve",value:function resolve(){if(!this.configIsFilled()){return this.config;}return this.processObject(this.config);}/**
12
+ */return _createClass(ThemeConfigResolver,[{key:"resolve",value:function resolve(){if(!this.configIsFilled()){return this.config;}return this.processObject(this.config);}/**
13
13
  * Takes the current theme config and resolves all page- and widget-setting refs
14
14
  */},{key:"resolveAll",value:function resolveAll(){this.config=appConfig.theme;writeToConfig({theme:this.resolve()},equalStructureComparator);}/**
15
15
  * Checks whether the config has any keys.
@@ -37,4 +37,4 @@ if(replacementValue!==undefined&&replacementValue.toString()===value){return rep
37
37
  * Whether the prop is an object.
38
38
  * @param {*} prop The prop to test.
39
39
  * @returns {boolean}
40
- */},{key:"isObject",value:function isObject(prop){return _typeof(prop)==='object'&&prop!==null&&prop.constructor===Object;}}]);return ThemeConfigResolver;}();/* eslint-enable class-methods-use-this */
40
+ */},{key:"isObject",value:function isObject(prop){return _typeof(prop)==='object'&&prop!==null&&prop.constructor===Object;}}]);}();/* eslint-enable class-methods-use-this */
@@ -1,4 +1,4 @@
1
- import*as Redux from'redux';import{REQUEST_CORE_CONFIG,RECEIVE_CORE_CONFIG,ERROR_CORE_CONFIG}from"./config.constants";/**
1
+ import{REQUEST_CORE_CONFIG,RECEIVE_CORE_CONFIG,ERROR_CORE_CONFIG}from"./config.constants";/**
2
2
  * Dispatches the REQUEST_CORE_CONFIG action.
3
3
  * @return {Object} The REQUEST_CORE_CONFIG action.
4
4
  */export var requestConfig=function requestConfig(){return{type:REQUEST_CORE_CONFIG};};/**
@@ -1,3 +1,3 @@
1
- import*as Redux from'redux';import PipelineRequest from'@shopgate/pwa-core/classes/PipelineRequest';import{shouldFetchData}from'@shopgate/pwa-common/helpers/redux';import{requestConfig,receiveConfig,errorConfig}from"./config.action-creators";import{makeGetConfig}from"./config.selectors";import{PIPELINE_CORE_GET_CONFIG}from"./config.constants";/**
1
+ import PipelineRequest from'@shopgate/pwa-core/classes/PipelineRequest';import{shouldFetchData}from'@shopgate/pwa-common/helpers/redux';import{requestConfig,receiveConfig,errorConfig}from"./config.action-creators";import{makeGetConfig}from"./config.selectors";import{PIPELINE_CORE_GET_CONFIG}from"./config.constants";/**
2
2
  * @returns {Function} A redux thunk.
3
3
  */export var fetchConfig=function fetchConfig(){return function(dispatch,getState){var getConfig=makeGetConfig();var config=getConfig(getState());if(!shouldFetchData(config)){return Promise.resolve(config);}dispatch(requestConfig());var request=new PipelineRequest(PIPELINE_CORE_GET_CONFIG).dispatch();request.then(function(result){dispatch(receiveConfig(result));})["catch"](function(error){dispatch(errorConfig(error));});return request;};};
@@ -1,4 +1,4 @@
1
- function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import*as Redux from'redux';import{REQUEST_CORE_CONFIG,RECEIVE_CORE_CONFIG,ERROR_CORE_CONFIG,CONFIG_LIFETIME}from"./config.constants";/**
1
+ function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}import{REQUEST_CORE_CONFIG,RECEIVE_CORE_CONFIG,ERROR_CORE_CONFIG,CONFIG_LIFETIME}from"./config.constants";/**
2
2
  * Stores the product locations by the ID of the product.
3
3
  * @param {Object} [state={}] The current state.
4
4
  * @param {Object} action The action object.
@@ -1,4 +1,4 @@
1
- import{appWillStart$}from'@shopgate/pwa-common/streams';import{fetchConfig}from"./config.actions";/**
1
+ import{appWillStart$}from'@shopgate/pwa-common/streams';import{hasNewServices}from'@shopgate/engage/core/helpers';import{fetchConfig}from"./config.actions";/**
2
2
  * Config subscriptions.
3
3
  * @param {Function} subscribe The subscribe function.
4
- */function config(subscribe){subscribe(appWillStart$,function(_ref){var dispatch=_ref.dispatch;dispatch(fetchConfig());});}export default config;
4
+ */function config(subscribe){subscribe(appWillStart$,function(_ref){var dispatch=_ref.dispatch;if(hasNewServices()){dispatch(fetchConfig());}});}export default config;
@@ -1 +1 @@
1
- export{default as subscriptions}from"./config.subscriptions";export{default as reducers}from"./config.reducers";export{fetchConfig}from"./config.actions";export{makeGetConfig,makeGetMerchantSettings,makeGetFulfillmentPaths,makeGetEnabledFulfillmentMethods,makeGetEnabledFulfillmentMethodsCount,makeUseLocationFulfillmentMethods,getShopSettings,getConfigFetching}from"./config.selectors";export{requestCoreConfig$,receiveCoreConfig$,errorCoreConfig$}from"./config.streams";export{getPageConfig}from"./getPageConfig";export{getPageSettings}from"./getPageSettings";export{getThemeAssets}from"./getThemeAssets";export{getThemeColors}from"./getThemeColors";export{getThemeConfig}from"./getThemeConfig";export{getThemeSettings}from"./getThemeSettings";export{getThemeStyles}from"./getThemeStyles";export{getWidgetConfig}from"./getWidgetConfig";export{getWidgetSettings}from"./getWidgetSettings";
1
+ export{default as subscriptions}from"./config.subscriptions";export{default as reducers}from"./config.reducers";export{fetchConfig}from"./config.actions";export{makeGetConfig,makeGetMerchantSettings,makeGetFulfillmentPaths,makeGetEnabledFulfillmentMethods,makeGetEnabledFulfillmentMethodsCount,makeUseLocationFulfillmentMethods,getShopSettings,getConfigFetching}from"./config.selectors";export{requestCoreConfig$,receiveCoreConfig$,errorCoreConfig$}from"./config.streams";export{ThemeConfigResolver}from"./ThemeConfigResolver";export{isBeta}from"./isBeta";export{getPageConfig}from"./getPageConfig";export{getPageSettings}from"./getPageSettings";export{getThemeAssets}from"./getThemeAssets";export{getThemeColors}from"./getThemeColors";export{getThemeConfig}from"./getThemeConfig";export{getThemeSettings}from"./getThemeSettings";export{getThemeStyles}from"./getThemeStyles";export{getWidgetConfig}from"./getWidgetConfig";export{getWidgetSettings}from"./getWidgetSettings";
@@ -0,0 +1 @@
1
+ export var APP_PERMISSION_STATUS_RECEIVED='APP_PERMISSION_STATUS_RECEIVED';export var RELOAD_APP='RELOAD_APP';
@@ -0,0 +1 @@
1
+ export var APP_FEATURE_PUSH_OPT_IN='optIn';export var APP_FEATURE_COOKIE_CONSENT='cookieConsent';
@@ -1 +1,6 @@
1
- export{RECEIVE_SHOP_SETTINGS,ERROR_SHOP_SETTINGS,CACHE_LEASE_SHOP_SETTINGS,SHOP_SETTING_GOOGLE_SITE_VERIFICATION_CODE,SHOP_SETTING_CART_SUPPLEMENTAL_CONTENT,SHOP_SETTING_ORDER_SUPPLEMENTAL_CONTENT,SHOP_SETTING_SHOW_SHOP_LOGO_IN_APP,SHOP_SETTING_SHOW_SHOP_LOGO_IN_WEB,SHOP_SETTING_PRODUCTS_SORT_ORDER,SHOP_SETTING_COOKIE_CONSENT_MODE,SHOP_SETTING_DISPLAY_PRICE_PER_MEASURE_UNIT,SHOP_SETTING_IMAGES,SHOP_SETTING_IMAGES_PRODUCT_PLACEHOLDER,SHOP_SETTING_IMAGES_CATEGORY_PLACEHOLDER,SHOP_SETTING_IMAGES_FAVICON,SHOP_SETTING_NUMBER_OF_ADDRESS_LINES,SHOP_SETTING_REGISTRATION_MODE_SIMPLE,SHOP_SETTING_REGISTRATION_MODE_EXTENDED,SHOP_SETTING_WISHLIST_ITEM_QUANTITY_ENABLED,SHOP_SETTING_WISHLIST_ITEM_NOTES_ENABLED,SHOP_SETTING_LOAD_WISHLIST_ON_APP_START_ENABLED,SHOP_SETTING_SHOW_WISHLIST_ITEMS_COUNT_BADGE}from"./shopSettings";export{RECEIVE_MERCHANT_SETTINGS,MERCHANT_SETTINGS_LOCATION_BASED_SHOPPING_ENABLED,MERCHANT_SETTINGS_SUBSTITUTION_PREFERENCES_ENABLED,MERCHANT_SETTINGS_CUSTOMER_ATTRIBUTES,MERCHANT_SETTINGS_FULFILLMENT_SCHEDULED_ENABLED,MERCHANT_SETTINGS_RESTRICT_MULTI_LOCATION_ORDERS,MERCHANT_SETTINGS_DEFAULT_CURRENCY,MERCHANT_SETTINGS_ENABLE_WEB_INDEXING,MERCHANT_SETTINGS_PRODUCT_SHOW_ALTERNATIVE_LOCATION,MERCHANT_SETTINGS_PRODUCTLIST_SHOW_INVENTORY}from"./merchantSettings";export{SHOPGATE_CORE_GET_SHOP_SETTINGS,EUNAUTHORIZED,EAUTHENTICATION}from"./pipelines";
1
+ import{INDEX_PATH,INDEX_PATH_DEEPLINK,LOGIN_PATH}from'@shopgate/pwa-common/constants/RoutePaths';export{RECEIVE_SHOP_SETTINGS,ERROR_SHOP_SETTINGS,CACHE_LEASE_SHOP_SETTINGS,SHOP_SETTING_GOOGLE_SITE_VERIFICATION_CODE,SHOP_SETTING_CART_SUPPLEMENTAL_CONTENT,SHOP_SETTING_ORDER_SUPPLEMENTAL_CONTENT,SHOP_SETTING_SHOW_SHOP_LOGO_IN_APP,SHOP_SETTING_SHOW_SHOP_LOGO_IN_WEB,SHOP_SETTING_PRODUCTS_SORT_ORDER,SHOP_SETTING_COOKIE_CONSENT_MODE,SHOP_SETTING_DISPLAY_PRICE_PER_MEASURE_UNIT,SHOP_SETTING_IMAGES,SHOP_SETTING_IMAGES_PRODUCT_PLACEHOLDER,SHOP_SETTING_IMAGES_CATEGORY_PLACEHOLDER,SHOP_SETTING_IMAGES_FAVICON,SHOP_SETTING_NUMBER_OF_ADDRESS_LINES,SHOP_SETTING_REGISTRATION_MODE_SIMPLE,SHOP_SETTING_REGISTRATION_MODE_EXTENDED,SHOP_SETTING_WISHLIST_ITEM_QUANTITY_ENABLED,SHOP_SETTING_WISHLIST_ITEM_NOTES_ENABLED,SHOP_SETTING_LOAD_WISHLIST_ON_APP_START_ENABLED,SHOP_SETTING_SHOW_WISHLIST_ITEMS_COUNT_BADGE}from"./shopSettings";export{RECEIVE_MERCHANT_SETTINGS,MERCHANT_SETTINGS_LOCATION_BASED_SHOPPING_ENABLED,MERCHANT_SETTINGS_SUBSTITUTION_PREFERENCES_ENABLED,MERCHANT_SETTINGS_CUSTOMER_ATTRIBUTES,MERCHANT_SETTINGS_FULFILLMENT_SCHEDULED_ENABLED,MERCHANT_SETTINGS_RESTRICT_MULTI_LOCATION_ORDERS,MERCHANT_SETTINGS_DEFAULT_CURRENCY,MERCHANT_SETTINGS_ENABLE_WEB_INDEXING,MERCHANT_SETTINGS_PRODUCT_SHOW_ALTERNATIVE_LOCATION,MERCHANT_SETTINGS_PRODUCTLIST_SHOW_INVENTORY}from"./merchantSettings";export{SHOPGATE_CORE_GET_SHOP_SETTINGS,EUNAUTHORIZED,EAUTHENTICATION}from"./pipelines";export*from"./actionTypes";export*from"./appFeatures";export*from"./deviceTypes";export*from"./geolocationRequest";// Core Constants
2
+ export*from'@shopgate/pwa-core/constants/AppEvents';export*from'@shopgate/pwa-core/constants/AppPermissions';export*from'@shopgate/pwa-core/constants/ErrorHandleTypes';export*from'@shopgate/pwa-core/constants/Pipeline';export*from'@shopgate/pwa-core/constants/ProcessTypes';export*from'@shopgate/pwa-core/constants/Scanner';export*from'@shopgate/pwa-core/constants/Trilean';// Common Constants
3
+ export*from'@shopgate/pwa-common/constants/ActionTypes';export*from'@shopgate/pwa-common/constants/Configuration';export*from'@shopgate/pwa-common/constants/Device';export*from'@shopgate/pwa-common/constants/DisplayOptions';export*from'@shopgate/pwa-common/constants/Pipelines';export*from'@shopgate/pwa-common/constants/Portals';// CLIENT CONSTANTS
4
+ export*from'@shopgate/pwa-common/constants/client';// MENU CONSTANTS
5
+ export*from'@shopgate/pwa-common/constants/MenuIDs';// MODAL CONSTANTS
6
+ export*from'@shopgate/pwa-common/constants/ModalTypes';export{INDEX_PATH,INDEX_PATH_DEEPLINK,LOGIN_PATH};
@@ -0,0 +1 @@
1
+ export*from'@shopgate/pwa-common/context';export{default as AppContext}from"./AppContext";
@@ -0,0 +1,14 @@
1
+ import{APP_FEATURE_PUSH_OPT_IN,APP_FEATURE_COOKIE_CONSENT}from'@shopgate/engage/core/constants';import{hasSGJavaScriptBridge,hasWebBridge,hasNewServices}from'@shopgate/engage/core/helpers';/**
2
+ * Determines if the app supports the push opt-in feature
3
+ * @returns {boolean}
4
+ */export var appSupportsPushOptIn=function appSupportsPushOptIn(){var _window,_window$SGAppInfo,_window$SGAppInfo$fea,_window$SGAppInfo$fea2,_window$SGAppInfo$fea3;if(hasWebBridge()||hasNewServices()){// Not push notifications in browser mode. Deactivated for new system for now
5
+ return false;}if(!hasSGJavaScriptBridge()){// Always supported in development
6
+ return true;}if(!Array.isArray((_window=window)===null||_window===void 0?void 0:(_window$SGAppInfo=_window.SGAppInfo)===null||_window$SGAppInfo===void 0?void 0:(_window$SGAppInfo$fea=_window$SGAppInfo.featureFlags)===null||_window$SGAppInfo$fea===void 0?void 0:(_window$SGAppInfo$fea2=_window$SGAppInfo$fea.Push)===null||_window$SGAppInfo$fea2===void 0?void 0:(_window$SGAppInfo$fea3=_window$SGAppInfo$fea2['1'])===null||_window$SGAppInfo$fea3===void 0?void 0:_window$SGAppInfo$fea3.flags)){// Not supported on app versions that don't provide the featureFlags object
7
+ return false;}// Supported when the feature flags contain the push opt-in flag
8
+ return window.SGAppInfo.featureFlags.Push['1'].flags.includes(APP_FEATURE_PUSH_OPT_IN);};/**
9
+ * Determines if the app supports the cookie consent feature
10
+ * @returns {boolean}
11
+ */export var appSupportsCookieConsent=function appSupportsCookieConsent(){var _window2,_window2$SGAppInfo,_window2$SGAppInfo$fe,_window2$SGAppInfo$fe2,_window2$SGAppInfo$fe3;if(!hasSGJavaScriptBridge()){// Always supported in development
12
+ return true;}if(!Array.isArray((_window2=window)===null||_window2===void 0?void 0:(_window2$SGAppInfo=_window2.SGAppInfo)===null||_window2$SGAppInfo===void 0?void 0:(_window2$SGAppInfo$fe=_window2$SGAppInfo.featureFlags)===null||_window2$SGAppInfo$fe===void 0?void 0:(_window2$SGAppInfo$fe2=_window2$SGAppInfo$fe.Analytics)===null||_window2$SGAppInfo$fe2===void 0?void 0:(_window2$SGAppInfo$fe3=_window2$SGAppInfo$fe2['1'])===null||_window2$SGAppInfo$fe3===void 0?void 0:_window2$SGAppInfo$fe3.flags)){// Not supported on app versions that don't provide the featureFlags object
13
+ return false;}// Supported when the feature flags contain the cookie consent flag
14
+ return window.SGAppInfo.featureFlags.Analytics['1'].flags.includes(APP_FEATURE_COOKIE_CONSENT);};
@@ -1,21 +1,58 @@
1
- import _regeneratorRuntime from"@babel/runtime/regenerator";function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{COMMAND_GET_APP_PERMISSIONS,COMMAND_REQUEST_APP_PERMISSIONS}from'@shopgate/pwa-core/constants/AppCommands';import{STATUS_NOT_DETERMINED,STATUS_GRANTED,STATUS_DENIED,PERMISSION_ID_LOCATION}from'@shopgate/pwa-core/constants/AppPermissions';import geolocationRequestBrowser from"../classes/GeolocationRequestBrowser";/**
1
+ import _regeneratorRuntime from"@babel/runtime/regenerator";function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value;}catch(error){reject(error);return;}if(info.done){resolve(value);}else{Promise.resolve(value).then(_next,_throw);}}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value);}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err);}_next(undefined);});};}import{COMMAND_GET_APP_PERMISSIONS,COMMAND_REQUEST_APP_PERMISSIONS}from'@shopgate/pwa-core/constants/AppCommands';import{PERMISSION_STATUS_NOT_DETERMINED,PERMISSION_STATUS_NOT_SUPPORTED,PERMISSION_STATUS_GRANTED,PERMISSION_STATUS_DENIED,PERMISSION_ID_LOCATION,PERMISSION_ID_PUSH,PERMISSION_ID_CAMERA}from'@shopgate/pwa-core/constants/AppPermissions';import geolocationRequestBrowser from"../classes/GeolocationRequestBrowser";var MOCK_PERMISSIONS_KEY='sg-mocked-app-permissions';var getMockedAppPermissions;/**
2
+ * In development within the browser, app permissions can be mocked by calling a global functions
3
+ * on the MockedPermissions object. The values are persisted in local storage, so that they survive
4
+ * reload of the PWA.
5
+ *
6
+ * Permissions are stored "globally" and will affect every shop.
7
+ *
8
+ * Example:
9
+ * MockedAppPermissions.setGetAppPermissionsResponse('push', 'notDetermined')
10
+ * MockedAppPermissions.setRequestAppPermissionsResponse('push', 'denied')
11
+ *
12
+ * The object also provides access to the relevant constants.
13
+ *
14
+ * Example:
15
+ * MockedAppPermissions.ID_PUSH
16
+ * MockedAppPermissions.STATUS_DENIED
17
+ *
18
+ * Complete Example:
19
+ * MockedAppPermissions.setRequestAppPermissionsResponse(
20
+ * MockedAppPermissions.ID_PUSH,
21
+ * MockedAppPermissions.STATUS_DENIED
22
+ * )
23
+ */if(process.env.NODE_ENV==='development'){/**
24
+ * Retrieves mocked app permissions from the local storage
25
+ * @returns {Object|null}
26
+ */getMockedAppPermissions=function getMockedAppPermissions(){return JSON.parse(localStorage.getItem(MOCK_PERMISSIONS_KEY));};/**
27
+ * Sets a single mocked app permission status from the local storage
28
+ * @param {string} commandType Command type for which the status is set (get / request)
29
+ * @param {string} permissionId The permissionId for which the status is set
30
+ * @param {string} status The mocked permission status
31
+ */var setMockedAppPermission=function setMockedAppPermission(commandType,permissionId,status){var _current;var current=getMockedAppPermissions();if(current===null){current={};}if(!((_current=current)===null||_current===void 0?void 0:_current[permissionId])){// Add defaults for the permissionId when not set yet
32
+ current[permissionId]={get:PERMISSION_STATUS_GRANTED,request:PERMISSION_STATUS_GRANTED};}// Add the status to the mocked app permissions
33
+ current[permissionId][commandType]=status;// Update local storage
34
+ localStorage.setItem(MOCK_PERMISSIONS_KEY,JSON.stringify(current));};/**
35
+ * Prepare global object in DEV environment to mock app permissions
36
+ */var obj={setGetAppPermissionsResponse:function setGetAppPermissionsResponse(permissionId){var status=arguments.length>1&&arguments[1]!==undefined?arguments[1]:PERMISSION_STATUS_GRANTED;setMockedAppPermission('get',permissionId,status);},setRequestAppPermissionsResponse:function setRequestAppPermissionsResponse(permissionId){var status=arguments.length>1&&arguments[1]!==undefined?arguments[1]:PERMISSION_STATUS_GRANTED;setMockedAppPermission('request',permissionId,status);}};// Populate useful constants
37
+ obj.STATUS_GRANTED=PERMISSION_STATUS_GRANTED;obj.STATUS_DENIED=PERMISSION_STATUS_DENIED;obj.STATUS_NOT_DETERMINED=PERMISSION_STATUS_NOT_DETERMINED;obj.STATUS_NOT_SUPPORTED=PERMISSION_STATUS_NOT_SUPPORTED;obj.ID_PUSH=PERMISSION_ID_PUSH;obj.ID_CAMERA=PERMISSION_ID_CAMERA;obj.ID_LOCATION=PERMISSION_ID_LOCATION;window.MockedAppPermissions=obj;}/**
2
38
  * Mapping of states from the browser permissions API to app permissions.
3
- */var permissionsApiStateMapping={prompt:STATUS_NOT_DETERMINED,granted:STATUS_GRANTED,denied:STATUS_DENIED};/**
39
+ */var permissionsApiStateMapping={prompt:PERMISSION_STATUS_NOT_DETERMINED,granted:PERMISSION_STATUS_GRANTED,denied:PERMISSION_STATUS_DENIED};/**
4
40
  * Determines geolocation permissions from the browser permissions API.
5
41
  * @see https://developer.mozilla.org/en-US/docs/Web/API/Permissions_API
6
42
  * @returns {string|null}
7
- */var getGeolocationPermissionsFromPermissionsApi=/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(){var state,_ref2;return _regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:_context.prev=0;_context.next=3;return navigator.permissions.query({name:'geolocation'});case 3:_ref2=_context.sent;state=_ref2.state;_context.next=9;break;case 7:_context.prev=7;_context.t0=_context["catch"](0);case 9:return _context.abrupt("return",{state:permissionsApiStateMapping[state]||null});case 10:case"end":return _context.stop();}}},_callee,null,[[0,7]]);}));return function getGeolocationPermissionsFromPermissionsApi(){return _ref.apply(this,arguments);};}();/**
43
+ */var getGeolocationPermissionsFromPermissionsApi=/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(){var state,_ref2;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_context.prev=0;_context.next=3;return navigator.permissions.query({name:'geolocation'});case 3:_ref2=_context.sent;state=_ref2.state;_context.next=9;break;case 7:_context.prev=7;_context.t0=_context["catch"](0);case 9:return _context.abrupt("return",{state:permissionsApiStateMapping[state]||null});case 10:case"end":return _context.stop();}},_callee,null,[[0,7]]);}));return function getGeolocationPermissionsFromPermissionsApi(){return _ref.apply(this,arguments);};}();/**
8
44
  * Determines geolocation permissions from the browser geolocation API.
9
45
  * @see https://developer.mozilla.org/en-US/docs/Web/API/Geolocation_API
10
46
  * @returns {string}
11
- */var getGeolocationPermissionsFromGeolocationApi=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(){var state,geolocation,_ref4$code,code;return _regeneratorRuntime.wrap(function _callee2$(_context2){while(1){switch(_context2.prev=_context2.next){case 0:state=STATUS_GRANTED;_context2.prev=1;_context2.next=4;return geolocationRequestBrowser.dispatch();case 4:geolocation=_context2.sent;_context2.next=12;break;case 7:_context2.prev=7;_context2.t0=_context2["catch"](1);_ref4$code=_context2.t0.code;code=_ref4$code===void 0?null:_ref4$code;if(code!==null){state=STATUS_DENIED;}case 12:return _context2.abrupt("return",{state:state,geolocation:geolocation});case 13:case"end":return _context2.stop();}}},_callee2,null,[[1,7]]);}));return function getGeolocationPermissionsFromGeolocationApi(){return _ref3.apply(this,arguments);};}();/**
47
+ */var getGeolocationPermissionsFromGeolocationApi=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(){var state,geolocation,_ref4$code,code;return _regeneratorRuntime.wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:state=PERMISSION_STATUS_GRANTED;_context2.prev=1;_context2.next=4;return geolocationRequestBrowser.dispatch();case 4:geolocation=_context2.sent;_context2.next=12;break;case 7:_context2.prev=7;_context2.t0=_context2["catch"](1);_ref4$code=_context2.t0.code;code=_ref4$code===void 0?null:_ref4$code;if(code!==null){state=PERMISSION_STATUS_DENIED;}case 12:return _context2.abrupt("return",{state:state,geolocation:geolocation});case 13:case"end":return _context2.stop();}},_callee2,null,[[1,7]]);}));return function getGeolocationPermissionsFromGeolocationApi(){return _ref3.apply(this,arguments);};}();/**
12
48
  * Creates mocked app permissions to support development within browser environments.
13
49
  * @param {string} commandName The name of the command for which the permissions are created
14
50
  * @param {Object} [commandParams={}] The command params.
15
51
  * @param {string} [fallbackStatus] The status that's returned when no status could be determined.
16
52
  * @returns {Array}
17
- */var mockedPermissions=/*#__PURE__*/function(){var _ref5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(commandName){var commandParams,fallbackStatus,permissionIds,permissions,geolocationState,result,_args3=arguments;return _regeneratorRuntime.wrap(function _callee3$(_context3){while(1){switch(_context3.prev=_context3.next){case 0:commandParams=_args3.length>1&&_args3[1]!==undefined?_args3[1]:{};fallbackStatus=_args3.length>2&&_args3[2]!==undefined?_args3[2]:STATUS_GRANTED;permissionIds=commandParams.permissionIds;permissions=commandParams.permissions;if(permissions){permissionIds=permissions.map(function(permission){return permission.permissionId;});}if(!permissionIds.includes(PERMISSION_ID_LOCATION)){_context3.next=14;break;}if(!(commandName===COMMAND_GET_APP_PERMISSIONS)){_context3.next=10;break;}_context3.next=9;return getGeolocationPermissionsFromPermissionsApi();case 9:geolocationState=_context3.sent;case 10:if(!(commandName===COMMAND_REQUEST_APP_PERMISSIONS)){_context3.next=14;break;}_context3.next=13;return getGeolocationPermissionsFromGeolocationApi();case 13:geolocationState=_context3.sent;case 14:result=permissionIds.map(function(permissionId){var _geolocationState;var state=fallbackStatus;var geolocation;if(permissionId===PERMISSION_ID_LOCATION&&((_geolocationState=geolocationState)===null||_geolocationState===void 0?void 0:_geolocationState.state)){var _geolocationState2=geolocationState;state=_geolocationState2.state;geolocation=_geolocationState2.geolocation;}return _extends({permissionId:permissionId,status:state},geolocation?{data:geolocation}:{});});return _context3.abrupt("return",result);case 16:case"end":return _context3.stop();}}},_callee3);}));return function mockedPermissions(_x){return _ref5.apply(this,arguments);};}();/**
53
+ */var mockedPermissions=/*#__PURE__*/function(){var _ref5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(commandName){var commandParams,fallbackStatus,permissionIds,permissions,geolocationState,result,_args3=arguments;return _regeneratorRuntime.wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:commandParams=_args3.length>1&&_args3[1]!==undefined?_args3[1]:{};fallbackStatus=_args3.length>2&&_args3[2]!==undefined?_args3[2]:PERMISSION_STATUS_GRANTED;permissionIds=commandParams.permissionIds;permissions=commandParams.permissions;if(permissions){permissionIds=permissions.map(function(permission){return permission.permissionId;});}if(!permissionIds.includes(PERMISSION_ID_LOCATION)){_context3.next=14;break;}if(!(commandName===COMMAND_GET_APP_PERMISSIONS)){_context3.next=10;break;}_context3.next=9;return getGeolocationPermissionsFromPermissionsApi();case 9:geolocationState=_context3.sent;case 10:if(!(commandName===COMMAND_REQUEST_APP_PERMISSIONS)){_context3.next=14;break;}_context3.next=13;return getGeolocationPermissionsFromGeolocationApi();case 13:geolocationState=_context3.sent;case 14:result=permissionIds.map(function(permissionId){var _geolocationState;var state=fallbackStatus;var geolocation;var useLocalStorageMock=false;// Use mocked permissions from local storage if available
54
+ if(typeof getMockedAppPermissions==='function'){var _permissionMock$permi;var permissionMock=getMockedAppPermissions();var type=commandName===COMMAND_GET_APP_PERMISSIONS?'get':'request';var mockValue=permissionMock===null||permissionMock===void 0?void 0:(_permissionMock$permi=permissionMock[permissionId])===null||_permissionMock$permi===void 0?void 0:_permissionMock$permi[type];if(mockValue){useLocalStorageMock=true;state=mockValue||PERMISSION_STATUS_GRANTED;}}if(!useLocalStorageMock&&permissionId===PERMISSION_ID_LOCATION&&((_geolocationState=geolocationState)===null||_geolocationState===void 0?void 0:_geolocationState.state)){var _geolocationState2=geolocationState;state=_geolocationState2.state;geolocation=_geolocationState2.geolocation;}return _extends({permissionId:permissionId,status:state},geolocation?{data:geolocation}:{});});return _context3.abrupt("return",result);case 16:case"end":return _context3.stop();}},_callee3);}));return function mockedPermissions(_x){return _ref5.apply(this,arguments);};}();/**
18
55
  * Creates a function to mock app permissions.
19
56
  * @param {string} [fallbackStatus] The status that's returned when no status could be determined.
20
57
  * @returns {Function}
21
- */export var createMockedPermissions=function createMockedPermissions(){var fallbackStatus=arguments.length>0&&arguments[0]!==undefined?arguments[0]:STATUS_GRANTED;return function(commandName,commandParams){return mockedPermissions(commandName,commandParams,fallbackStatus);};};
58
+ */export var createMockedPermissions=function createMockedPermissions(){var fallbackStatus=arguments.length>0&&arguments[0]!==undefined?arguments[0]:PERMISSION_STATUS_GRANTED;return function(commandName,commandParams){return mockedPermissions(commandName,commandParams,fallbackStatus);};};
@@ -0,0 +1,14 @@
1
+ function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance");}function _iterableToArrayLimit(arr,i){var _arr=[];var _n=true;var _d=false;var _e=undefined;try{for(var _i=arr[Symbol.iterator](),_s;!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}/**
2
+ * Regular expression to decode all possible types of base url from an url
3
+ *
4
+ * URLs of deployed apps
5
+ * https://sandbox.cdn.connect.shopgate.com/shop_30186/@shopgate/theme-ios11/6.22.4/11953/index.html
6
+ *
7
+ * URLs while local development
8
+ * http://192.168.0.1:8080
9
+ */var baseUrlRegex=/https?:\/\/(?:(?:(?:[0-9]{1,3}\.){3}[0-9]{1,3}(?::[0-9]+)?)|(?:.+index.html))/gm;/**
10
+ * Decodes the base url from a passed url. When url parameter left empty, window.location.href will
11
+ * be used as source
12
+ * @param {string} [sourceUrl=''] An optional url to be used for decode process
13
+ * @return {string} The decoded base url
14
+ */export var getAppBaseUrl=function getAppBaseUrl(){var sourceUrl=arguments.length>0&&arguments[0]!==undefined?arguments[0]:'';var _ref=(sourceUrl||window.location.href).match(baseUrlRegex)||[],_ref2=_slicedToArray(_ref,1),_ref2$=_ref2[0],basedUrl=_ref2$===void 0?'':_ref2$;return basedUrl;};