@dropins/storefront-order 0.1.0-alpha9 → 1.0.0-beta2

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 (209) hide show
  1. package/api/cancelOrder/cancelOrder.d.ts +2 -0
  2. package/api/cancelOrder/graphql/cancelOrderMutation.d.ts +2 -0
  3. package/api/cancelOrder/index.d.ts +2 -0
  4. package/api/confirmCancelOrder/confirmCancelOrder.d.ts +16 -0
  5. package/api/confirmCancelOrder/graphql/ConfirmCancelOrder.d.ts +16 -0
  6. package/api/confirmCancelOrder/index.d.ts +16 -0
  7. package/api/confirmGuestReturn/confirmGuestReturn.d.ts +2 -0
  8. package/api/confirmGuestReturn/graphql/confirmGuestReturn.graphql.d.ts +2 -0
  9. package/api/confirmGuestReturn/index.d.ts +2 -0
  10. package/api/fragments.d.ts +7 -0
  11. package/api/getAttributesForm/graphql/getAttributesForm.graphql.d.ts +1 -1
  12. package/api/getAttributesList/getAttributesList.d.ts +5 -0
  13. package/api/getAttributesList/graphql/getAttributesList.graphql.d.ts +2 -0
  14. package/api/getAttributesList/index.d.ts +2 -0
  15. package/api/getCustomer/graphql/getCustomer.graphql.d.ts +1 -1
  16. package/api/getCustomerOrdersReturn/getCustomerOrdersReturn.d.ts +4 -0
  17. package/api/getCustomerOrdersReturn/graphql/getCustomerOrdersReturn.graphql.d.ts +2 -0
  18. package/api/getCustomerOrdersReturn/index.d.ts +2 -0
  19. package/api/getGuestOrder/getGuestOrder.d.ts +1 -1
  20. package/api/getGuestOrder/graphql/getGuestOrder.graphql.d.ts +0 -1
  21. package/api/getGuestOrder/graphql/index.d.ts +2 -0
  22. package/api/getOrderDetailsById/getOrderDetailsById.d.ts +2 -1
  23. package/api/getStoreConfig/getStoreConfig.d.ts +4 -0
  24. package/api/getStoreConfig/graphql/StoreConfigQuery.d.ts +2 -0
  25. package/api/getStoreConfig/index.d.ts +2 -0
  26. package/api/graphql/CustomerAddressFragment.graphql.d.ts +2 -0
  27. package/api/graphql/GurestOrderFragment.graphql.d.ts +2 -0
  28. package/api/graphql/OrderItemsFragment.graphql.d.ts +6 -0
  29. package/api/graphql/OrderSummaryFragment.graphql.d.ts +2 -0
  30. package/api/graphql/RequestReturnOrderFragment.graphql.d.ts +2 -0
  31. package/api/graphql/ReturnsFragment.graphql.d.ts +2 -0
  32. package/api/guestOrderByToken/guestOrderByToken.d.ts +1 -1
  33. package/api/index.d.ts +15 -4
  34. package/api/initialize/initialize.d.ts +7 -1
  35. package/api/placeOrder/graphql/placeOrderMutation.d.ts +2 -0
  36. package/api/placeOrder/index.d.ts +2 -0
  37. package/api/placeOrder/placeOrder.d.ts +4 -0
  38. package/api/reorderItems/graphql/reorderItems.graphql.d.ts +2 -0
  39. package/api/reorderItems/index.d.ts +2 -0
  40. package/api/reorderItems/reorderItems.d.ts +4 -0
  41. package/api/requestGuestOrderCancel/graphql/requestGuestOrderCancelMutation.d.ts +2 -0
  42. package/api/requestGuestOrderCancel/index.d.ts +2 -0
  43. package/api/requestGuestOrderCancel/requestGuestOrderCancel.d.ts +2 -0
  44. package/api/requestGuestReturn/graphql/requestGuestReturn.graphql.d.ts +2 -0
  45. package/api/requestGuestReturn/index.d.ts +2 -0
  46. package/api/requestGuestReturn/requestGuestReturn.d.ts +9 -0
  47. package/api/requestReturn/graphql/requestReturn.graphql.d.ts +2 -0
  48. package/api/requestReturn/index.d.ts +2 -0
  49. package/api/requestReturn/requestReturn.d.ts +5 -0
  50. package/api.js +56 -129
  51. package/chunks/CartSummaryItem.js +3 -0
  52. package/chunks/OrderCancelForm.js +3 -0
  53. package/chunks/OrderLoaders.js +3 -1
  54. package/chunks/ReturnsListContent.js +3 -0
  55. package/chunks/{CustomerDetailsContent.js → ShippingStatusCard.js} +3 -1
  56. package/chunks/capitalizeFirst.js +3 -0
  57. package/chunks/confirmCancelOrder.js +56 -0
  58. package/chunks/fetch-graphql.js +3 -1
  59. package/chunks/formatDateToLocale.js +3 -0
  60. package/chunks/getAttributesForm.js +6 -4
  61. package/chunks/getCustomerOrdersReturn.js +21 -0
  62. package/chunks/getFormValues.js +3 -0
  63. package/chunks/getGuestOrder.js +18 -0
  64. package/chunks/getQueryParam.js +3 -0
  65. package/chunks/getStoreConfig.js +19 -0
  66. package/chunks/initialize.js +212 -0
  67. package/chunks/network-error.js +3 -0
  68. package/chunks/redirectTo.js +3 -0
  69. package/chunks/requestGuestOrderCancel.js +102 -0
  70. package/chunks/requestGuestReturn.js +54 -0
  71. package/chunks/returnOrdersHelper.js +3 -0
  72. package/chunks/setTaxStatus.js +3 -0
  73. package/chunks/transform-attributes-form.js +3 -0
  74. package/chunks/useGetStoreConfig.js +3 -0
  75. package/chunks/useIsMobile.js +3 -0
  76. package/components/EmptyList/EmptyList.d.ts +5 -0
  77. package/components/EmptyList/index.d.ts +3 -0
  78. package/components/OrderCancel/OrderCancel.d.ts +5 -0
  79. package/components/OrderCancel/index.d.ts +3 -0
  80. package/components/OrderCostSummaryContent/Blocks.d.ts +39 -0
  81. package/components/OrderCostSummaryContent/OrderCostSummaryContent.d.ts +5 -0
  82. package/components/OrderCostSummaryContent/index.d.ts +3 -0
  83. package/components/OrderHeader/OrderHeader.d.ts +9 -0
  84. package/components/OrderHeader/index.d.ts +2 -0
  85. package/components/OrderLoaders/OrderLoaders.d.ts +3 -0
  86. package/components/OrderProductListContent/CartSummaryItem.d.ts +5 -0
  87. package/components/OrderProductListContent/OrderProductListContent.d.ts +5 -0
  88. package/components/OrderProductListContent/index.d.ts +4 -0
  89. package/components/Reorder/Reorder.d.ts +5 -0
  90. package/components/Reorder/index.d.ts +3 -0
  91. package/components/ReturnOrderMessage/ReturnOrderMessage.d.ts +5 -0
  92. package/components/ReturnOrderMessage/index.d.ts +3 -0
  93. package/components/ReturnOrderProductList/ReturnOrderProductList.d.ts +5 -0
  94. package/components/ReturnOrderProductList/index.d.ts +3 -0
  95. package/components/ReturnReasonForm/ReturnReasonForm.d.ts +5 -0
  96. package/components/ReturnReasonForm/index.d.ts +3 -0
  97. package/components/ReturnsListContent/ReturnsListContent.d.ts +5 -0
  98. package/components/ReturnsListContent/index.d.ts +3 -0
  99. package/components/ShippingStatusCard/ShippingStatusCard.d.ts +1 -1
  100. package/components/ShippingStatusCard/ShippingStatusReturnCard.d.ts +5 -0
  101. package/components/ShippingStatusCard/index.d.ts +1 -0
  102. package/components/index.d.ts +14 -4
  103. package/configs/mock.config.d.ts +2823 -19
  104. package/containers/CreateReturn/CreateReturn.d.ts +5 -0
  105. package/containers/CreateReturn/index.d.ts +3 -0
  106. package/containers/CreateReturn.d.ts +3 -0
  107. package/containers/CreateReturn.js +3 -0
  108. package/containers/CustomerDetails.js +3 -1
  109. package/containers/OrderCancelForm/OrderCancelForm.d.ts +5 -0
  110. package/containers/OrderCancelForm/index.d.ts +3 -0
  111. package/containers/OrderCancelForm.d.ts +3 -0
  112. package/containers/OrderCancelForm.js +3 -0
  113. package/containers/OrderCostSummary/OrderCostSummary.d.ts +5 -0
  114. package/containers/OrderCostSummary/index.d.ts +3 -0
  115. package/containers/OrderCostSummary.d.ts +3 -0
  116. package/containers/OrderCostSummary.js +3 -0
  117. package/containers/OrderHeader/OrderHeader.d.ts +5 -0
  118. package/containers/OrderHeader/index.d.ts +3 -0
  119. package/containers/OrderHeader.d.ts +3 -0
  120. package/containers/OrderHeader.js +3 -0
  121. package/containers/OrderProductList/OrderProductList.d.ts +5 -0
  122. package/containers/OrderProductList/index.d.ts +3 -0
  123. package/containers/OrderProductList.d.ts +3 -0
  124. package/containers/OrderProductList.js +3 -0
  125. package/containers/OrderReturns/OrderReturns.d.ts +5 -0
  126. package/containers/OrderReturns/index.d.ts +3 -0
  127. package/containers/OrderReturns.d.ts +3 -0
  128. package/containers/OrderReturns.js +3 -0
  129. package/containers/OrderSearch.js +3 -1
  130. package/containers/OrderStatus.js +3 -1
  131. package/containers/ReturnsList/ReturnsList.d.ts +5 -0
  132. package/containers/ReturnsList/index.d.ts +3 -0
  133. package/containers/ReturnsList.d.ts +3 -0
  134. package/containers/ReturnsList.js +3 -0
  135. package/containers/ShippingStatus.js +3 -1
  136. package/containers/index.d.ts +8 -1
  137. package/data/models/acdl.d.ts +99 -0
  138. package/data/models/attributes-form.d.ts +2 -21
  139. package/data/models/customer-orders-return.d.ts +38 -0
  140. package/data/models/index.d.ts +5 -1
  141. package/data/models/order-details.d.ts +64 -9
  142. package/data/models/request-return.d.ts +7 -0
  143. package/data/models/store-config.d.ts +15 -0
  144. package/data/transforms/index.d.ts +8 -2
  145. package/data/transforms/transform-acdl.d.ts +5 -0
  146. package/data/transforms/transform-attributes-form.d.ts +3 -2
  147. package/data/transforms/transform-customer-address-input.d.ts +22 -0
  148. package/data/transforms/transform-customer-orders-returns.d.ts +5 -0
  149. package/data/transforms/transform-guest-order.d.ts +2 -2
  150. package/data/transforms/transform-order-details.d.ts +13 -3
  151. package/data/transforms/transform-place-order.d.ts +5 -0
  152. package/data/transforms/transform-request-return.d.ts +5 -0
  153. package/data/transforms/transform-store-config.d.ts +4 -0
  154. package/fragments.d.ts +1 -0
  155. package/fragments.js +306 -0
  156. package/hooks/api/useGetStoreConfig.d.ts +4 -0
  157. package/hooks/containers/useCreateReturn.d.ts +65 -0
  158. package/hooks/containers/useCustomerDetails.d.ts +2 -2
  159. package/hooks/containers/useOrderActions.d.ts +12 -0
  160. package/hooks/containers/useOrderCostSummary.d.ts +9 -0
  161. package/hooks/containers/useOrderHeader.d.ts +8 -0
  162. package/hooks/containers/useOrderProductList.d.ts +8 -0
  163. package/hooks/containers/useOrderReturns.d.ts +8 -0
  164. package/hooks/containers/useReturnsList.d.ts +15 -0
  165. package/hooks/containers/useShippingStatus.d.ts +2 -0
  166. package/hooks/index.d.ts +10 -1
  167. package/hooks/useInLineAlert.d.ts +7 -0
  168. package/hooks/useIsMobile.d.ts +2 -0
  169. package/i18n/en_US.json.d.ts +268 -13
  170. package/lib/acdl.d.ts +18 -0
  171. package/lib/capitalizeFirst.d.ts +2 -0
  172. package/lib/categorizeProducts.d.ts +66 -0
  173. package/lib/formatDateToLocale.d.ts +31 -0
  174. package/lib/getQueryParam.d.ts +1 -1
  175. package/lib/redirectTo.d.ts +1 -1
  176. package/lib/removeQueryParams.d.ts +2 -0
  177. package/lib/returnOrdersHelper.d.ts +36 -0
  178. package/lib/setTaxStatus.d.ts +4 -0
  179. package/package.json +1 -1
  180. package/render.js +5 -2
  181. package/types/api/confirmGuestReturn.types.d.ts +18 -0
  182. package/types/api/getAttributesList.types.d.ts +28 -0
  183. package/types/api/getCustomerOrdersReturn.types.d.ts +21 -0
  184. package/types/api/getOrderDetails.types.d.ts +69 -11
  185. package/types/api/placeOrder.types.d.ts +19 -0
  186. package/types/api/reorderItems.types.d.ts +27 -0
  187. package/types/api/requestReturn.types.d.ts +47 -0
  188. package/types/createReturn.types.d.ts +71 -0
  189. package/types/customerDetails.types.d.ts +10 -3
  190. package/types/emptyList.types.d.ts +7 -0
  191. package/types/form.types.d.ts +1 -1
  192. package/types/index.d.ts +21 -5
  193. package/types/notification.types.d.ts +14 -0
  194. package/types/orderCancel.types.d.ts +16 -0
  195. package/types/orderCostSummary.types.d.ts +29 -0
  196. package/types/orderEmailActionHandler.types.d.ts +4 -0
  197. package/types/orderHeader.types.d.ts +19 -0
  198. package/types/orderProductList.types.d.ts +36 -0
  199. package/types/orderStatus.types.d.ts +12 -4
  200. package/types/reorder.types.d.ts +9 -0
  201. package/types/returnsList.types.d.ts +82 -0
  202. package/types/shippingStatus.types.d.ts +33 -2
  203. package/api/getOrderDetailsById/graphql/customerAddressFragment.graphql.d.ts +0 -2
  204. package/api/getOrderDetailsById/graphql/index.d.ts +0 -5
  205. package/api/getOrderDetailsById/graphql/orderItemsFragment.graphql.d.ts +0 -2
  206. package/api/getOrderDetailsById/graphql/orderSummaryFragment.graphql.d.ts +0 -2
  207. package/chunks/getCustomer.js +0 -185
  208. package/lib/convertToInputDateFormat.d.ts +0 -3
  209. package/lib/formatAddressFields.d.ts +0 -6
@@ -0,0 +1,2 @@
1
+ export declare const cancelOrder: (orderId: string, reason: string, onSuccess: Function, onError: Function) => Promise<void | null | undefined>;
2
+ //# sourceMappingURL=cancelOrder.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare const CANCEL_ORDER_MUTATION: string;
2
+ //# sourceMappingURL=cancelOrderMutation.d.ts.map
@@ -0,0 +1,2 @@
1
+ export * from './cancelOrder';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,16 @@
1
+ /********************************************************************
2
+ *
3
+ * Copyright 2024 Adobe
4
+ * All Rights Reserved.
5
+ *
6
+ * NOTICE: All information contained herein is, and remains
7
+ * the property of Adobe and its suppliers, if any. The intellectual
8
+ * and technical concepts contained herein are proprietary to Adobe
9
+ * and its suppliers and are protected by all applicable intellectual
10
+ * property laws, including trade secret and copyright laws.
11
+ * Dissemination of this information or reproduction of this material
12
+ * is strictly forbidden unless prior written permission is obtained
13
+ * from Adobe.
14
+ *******************************************************************/
15
+ export declare const confirmCancelOrder: (orderId: string, confirmationKey: string) => Promise<any>;
16
+ //# sourceMappingURL=confirmCancelOrder.d.ts.map
@@ -0,0 +1,16 @@
1
+ /********************************************************************
2
+ *
3
+ * Copyright 2024 Adobe
4
+ * All Rights Reserved.
5
+ *
6
+ * NOTICE: All information contained herein is, and remains
7
+ * the property of Adobe and its suppliers, if any. The intellectual
8
+ * and technical concepts contained herein are proprietary to Adobe
9
+ * and its suppliers and are protected by all applicable intellectual
10
+ * property laws, including trade secret and copyright laws.
11
+ * Dissemination of this information or reproduction of this material
12
+ * is strictly forbidden unless prior written permission is obtained
13
+ * from Adobe.
14
+ *******************************************************************/
15
+ export declare const CONFIRM_CANCEL_ORDER_MUTATION: string;
16
+ //# sourceMappingURL=ConfirmCancelOrder.d.ts.map
@@ -0,0 +1,16 @@
1
+ /********************************************************************
2
+ *
3
+ * Copyright 2024 Adobe
4
+ * All Rights Reserved.
5
+ *
6
+ * NOTICE: All information contained herein is, and remains
7
+ * the property of Adobe and its suppliers, if any. The intellectual
8
+ * and technical concepts contained herein are proprietary to Adobe
9
+ * and its suppliers and are protected by all applicable intellectual
10
+ * property laws, including trade secret and copyright laws.
11
+ * Dissemination of this information or reproduction of this material
12
+ * is strictly forbidden unless prior written permission is obtained
13
+ * from Adobe.
14
+ *******************************************************************/
15
+ export * from './confirmCancelOrder';
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare const confirmGuestReturn: (orderId: string, confirmationKey: string) => Promise<void>;
2
+ //# sourceMappingURL=confirmGuestReturn.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare const CONFIRM_RETURN_GUEST_ORDER: string;
2
+ //# sourceMappingURL=confirmGuestReturn.graphql.d.ts.map
@@ -0,0 +1,2 @@
1
+ export * from './confirmGuestReturn';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,7 @@
1
+ export { REQUEST_RETURN_ORDER_FRAGMENT } from './graphql/RequestReturnOrderFragment.graphql';
2
+ export { ADDRESS_FRAGMENT } from './graphql/CustomerAddressFragment.graphql';
3
+ export { PRODUCT_DETAILS_FRAGMENT, PRICE_DETAILS_FRAGMENT, GIFT_CARD_DETAILS_FRAGMENT, ORDER_ITEM_DETAILS_FRAGMENT, BUNDLE_ORDER_ITEM_DETAILS_FRAGMENT, } from './graphql/OrderItemsFragment.graphql';
4
+ export { ORDER_SUMMARY_FRAGMENT } from './graphql/OrderSummaryFragment.graphql';
5
+ export { RETURNS_FRAGMENT } from './graphql/ReturnsFragment.graphql';
6
+ export { GUEST_ORDER_FRAGMENT } from './graphql/GurestOrderFragment.graphql';
7
+ //# sourceMappingURL=fragments.d.ts.map
@@ -1,3 +1,3 @@
1
1
  export declare const GET_ATTRIBUTES_FORM = "\n query GET_ATTRIBUTES_FORM($formCode: String!) {\n attributesForm(formCode: $formCode) {\n items {\n code\n default_value\n entity_type\n frontend_class\n frontend_input\n is_required\n is_unique\n label\n options {\n is_default\n label\n value\n }\n ... on CustomerAttributeMetadata {\n multiline_count\n sort_order\n validate_rules {\n name\n value\n }\n }\n }\n errors {\n type\n message\n }\n }\n }\n";
2
- export declare const GET_ATTRIBUTES_FORM_SHORT = "\n query GET_ATTRIBUTES_FORM_SHORT {\n attributesForm(formCode: customer_register_address) {\n items {\n frontend_input\n label\n code\n ... on CustomerAttributeMetadata {\n multiline_count\n sort_order\n }\n }\n }\n }\n";
2
+ export declare const GET_ATTRIBUTES_FORM_SHORT = "\n query GET_ATTRIBUTES_FORM_SHORT {\n attributesForm(formCode: \"customer_register_address\") {\n items {\n frontend_input\n label\n code\n ... on CustomerAttributeMetadata {\n multiline_count\n sort_order\n }\n }\n }\n }\n";
3
3
  //# sourceMappingURL=getAttributesForm.graphql.d.ts.map
@@ -0,0 +1,5 @@
1
+ import { AttributesFormModel } from '../../data/models';
2
+
3
+ export declare const getAttributesList: (entityType: string) => Promise<AttributesFormModel[] | [
4
+ ]>;
5
+ //# sourceMappingURL=getAttributesList.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare const GET_ATTRIBUTES_LIST = "\n query GET_ATTRIBUTES_LIST($entityType: AttributeEntityTypeEnum!) {\n attributesList(entityType: $entityType) {\n items {\n ... on CustomerAttributeMetadata {\n multiline_count\n sort_order\n validate_rules {\n name\n value\n }\n }\n ... on ReturnItemAttributeMetadata {\n sort_order\n }\n code\n label\n default_value\n frontend_input\n is_unique\n is_required\n options {\n is_default\n label\n value\n }\n }\n errors {\n type\n message\n }\n }\n }\n";
2
+ //# sourceMappingURL=getAttributesList.graphql.d.ts.map
@@ -0,0 +1,2 @@
1
+ export * from './getAttributesList';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,2 @@
1
- export declare const GET_CUSTOMER = "\n query GET_CUSTOMER {\n customer {\n firstname\n lastname\n email\n }\n }\n";
1
+ export declare const GET_CUSTOMER = "\n query GET_CUSTOMER {\n customer {\n firstname\n lastname\n email\n }\n }\n";
2
2
  //# sourceMappingURL=getCustomer.graphql.d.ts.map
@@ -0,0 +1,4 @@
1
+ import { CustomerOrdersReturnModel } from '../../data/models';
2
+
3
+ export declare const getCustomerOrdersReturn: (pageSize?: number, currentPage?: number) => Promise<CustomerOrdersReturnModel | null>;
4
+ //# sourceMappingURL=getCustomerOrdersReturn.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare const GET_CUSTOMER_ORDERS_RETURN: string;
2
+ //# sourceMappingURL=getCustomerOrdersReturn.graphql.d.ts.map
@@ -0,0 +1,2 @@
1
+ export * from './getCustomerOrdersReturn';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -3,6 +3,6 @@ import { OrderDataModel } from '../../data/models';
3
3
  export declare const getGuestOrder: (form: {
4
4
  number: string;
5
5
  email: string;
6
- postcode: string;
6
+ lastname: string;
7
7
  }) => Promise<OrderDataModel | null>;
8
8
  //# sourceMappingURL=getGuestOrder.d.ts.map
@@ -1,3 +1,2 @@
1
- export declare const GUEST_ORDER_FRAGMENT: string;
2
1
  export declare const GET_GUEST_ORDER: string;
3
2
  //# sourceMappingURL=getGuestOrder.graphql.d.ts.map
@@ -0,0 +1,2 @@
1
+ export * from './getGuestOrder.graphql';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,5 @@
1
+ import { GetOrderDetailsByIdProps } from '../../types';
1
2
  import { TransformedData } from '../../data/models';
2
3
 
3
- export declare const getOrderDetailsById: <T extends "orderData">(orderId?: string, queryType?: T | undefined) => Promise<TransformedData<T>>;
4
+ export declare const getOrderDetailsById: <T extends "orderData">({ orderId, returnRef, queryType, returnsPageSize, }: GetOrderDetailsByIdProps) => Promise<TransformedData<T>>;
4
5
  //# sourceMappingURL=getOrderDetailsById.d.ts.map
@@ -0,0 +1,4 @@
1
+ import { StoreConfigModel } from '../../data/models';
2
+
3
+ export declare const getStoreConfig: () => Promise<StoreConfigModel | null>;
4
+ //# sourceMappingURL=getStoreConfig.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare const STORE_CONFIG_QUERY = "\n query STORE_CONFIG_QUERY {\n storeConfig {\n order_cancellation_enabled\n order_cancellation_reasons {\n description\n }\n base_media_url\n orders_invoices_credit_memos_display_price\n orders_invoices_credit_memos_display_shipping_amount\n orders_invoices_credit_memos_display_subtotal\n orders_invoices_credit_memos_display_grandtotal\n orders_invoices_credit_memos_display_full_summary\n orders_invoices_credit_memos_display_zero_tax\n }\n }\n";
2
+ //# sourceMappingURL=StoreConfigQuery.d.ts.map
@@ -0,0 +1,2 @@
1
+ export * from './getStoreConfig';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare const ADDRESS_FRAGMENT = "\n fragment ADDRESS_FRAGMENT on OrderAddress {\n city\n company\n country_code\n fax\n firstname\n lastname\n middlename\n postcode\n prefix\n region\n region_id\n street\n suffix\n telephone\n vat_id\n }\n";
2
+ //# sourceMappingURL=CustomerAddressFragment.graphql.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare const GUEST_ORDER_FRAGMENT: string;
2
+ //# sourceMappingURL=GurestOrderFragment.graphql.d.ts.map
@@ -0,0 +1,6 @@
1
+ export declare const PRODUCT_DETAILS_FRAGMENT = "\n fragment PRODUCT_DETAILS_FRAGMENT on ProductInterface {\n __typename\n canonical_url\n url_key\n uid\n name\n sku\n only_x_left_in_stock\n stock_status\n thumbnail {\n label\n url\n }\n price_range {\n maximum_price {\n regular_price {\n currency\n value\n }\n }\n }\n }\n";
2
+ export declare const PRICE_DETAILS_FRAGMENT = "\n fragment PRICE_DETAILS_FRAGMENT on OrderItemInterface {\n prices {\n price_including_tax {\n value\n currency\n }\n original_price {\n value\n currency\n }\n original_price_including_tax {\n value\n currency\n }\n price {\n value\n currency\n }\n }\n }\n";
3
+ export declare const GIFT_CARD_DETAILS_FRAGMENT = "\n fragment GIFT_CARD_DETAILS_FRAGMENT on GiftCardOrderItem {\n ...PRICE_DETAILS_FRAGMENT\n gift_message {\n message\n }\n gift_card {\n recipient_name\n recipient_email\n sender_name\n sender_email\n message\n }\n }\n";
4
+ export declare const ORDER_ITEM_DETAILS_FRAGMENT = "\n fragment ORDER_ITEM_DETAILS_FRAGMENT on OrderItemInterface {\n __typename\n status\n product_sku\n eligible_for_return\n product_name\n product_url_key\n id\n quantity_ordered\n quantity_shipped\n quantity_canceled\n quantity_invoiced\n quantity_refunded\n quantity_return_requested\n product_sale_price {\n value\n currency\n }\n selected_options {\n label\n value\n }\n product {\n ...PRODUCT_DETAILS_FRAGMENT\n }\n ...PRICE_DETAILS_FRAGMENT\n }\n";
5
+ export declare const BUNDLE_ORDER_ITEM_DETAILS_FRAGMENT = "\n fragment BUNDLE_ORDER_ITEM_DETAILS_FRAGMENT on BundleOrderItem {\n ...PRICE_DETAILS_FRAGMENT\n bundle_options {\n uid\n label\n values {\n uid\n product_name\n }\n }\n }\n";
6
+ //# sourceMappingURL=OrderItemsFragment.graphql.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare const ORDER_SUMMARY_FRAGMENT = "\n fragment ORDER_SUMMARY_FRAGMENT on OrderTotal {\n grand_total {\n value\n currency\n }\n total_giftcard {\n currency\n value\n }\n subtotal_excl_tax {\n currency\n value\n }\n subtotal_incl_tax {\n currency\n value\n }\n taxes {\n amount {\n currency\n value\n }\n rate\n title\n }\n total_tax {\n currency\n value\n }\n total_shipping {\n currency\n value\n }\n discounts {\n amount {\n currency\n value\n }\n label\n }\n }\n";
2
+ //# sourceMappingURL=OrderSummaryFragment.graphql.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare const REQUEST_RETURN_ORDER_FRAGMENT = "\n fragment REQUEST_RETURN_ORDER_FRAGMENT on Return {\n __typename\n uid\n status\n number\n created_at\n }\n";
2
+ //# sourceMappingURL=RequestReturnOrderFragment.graphql.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare const RETURNS_FRAGMENT = "\n fragment RETURNS_FRAGMENT on Returns {\n __typename\n items {\n number\n status\n created_at\n shipping {\n tracking {\n status {\n text\n type\n }\n carrier {\n uid\n label\n }\n tracking_number\n }\n }\n order {\n number\n token\n }\n items {\n uid\n quantity\n status\n request_quantity\n order_item {\n ...ORDER_ITEM_DETAILS_FRAGMENT\n ... on GiftCardOrderItem {\n ...GIFT_CARD_DETAILS_FRAGMENT\n product {\n ...PRODUCT_DETAILS_FRAGMENT\n }\n }\n }\n }\n }\n }\n";
2
+ //# sourceMappingURL=ReturnsFragment.graphql.d.ts.map
@@ -1,4 +1,4 @@
1
1
  import { OrderDataModel } from '../../data/models';
2
2
 
3
- export declare const guestOrderByToken: (token?: string) => Promise<OrderDataModel | null>;
3
+ export declare const guestOrderByToken: (token?: string, returnRef?: string) => Promise<OrderDataModel | null>;
4
4
  //# sourceMappingURL=guestOrderByToken.d.ts.map
package/api/index.d.ts CHANGED
@@ -1,8 +1,19 @@
1
- export * from './initialize';
1
+ export * from './cancelOrder';
2
2
  export * from './fetch-graphql';
3
- export * from './getOrderDetailsById';
4
- export * from './getGuestOrder';
5
- export * from './guestOrderByToken';
6
3
  export * from './getAttributesForm';
4
+ export * from './getAttributesList';
7
5
  export * from './getCustomer';
6
+ export * from './getCustomerOrdersReturn';
7
+ export * from './getGuestOrder';
8
+ export * from './getOrderDetailsById';
9
+ export * from './getStoreConfig';
10
+ export * from './guestOrderByToken';
11
+ export * from './initialize';
12
+ export * from './placeOrder';
13
+ export * from './reorderItems';
14
+ export * from './requestGuestOrderCancel';
15
+ export * from './requestReturn';
16
+ export * from './requestGuestReturn';
17
+ export * from './confirmGuestReturn';
18
+ export * from './confirmCancelOrder';
8
19
  //# sourceMappingURL=index.d.ts.map
@@ -1,8 +1,14 @@
1
- import { Initializer } from '@dropins/tools/types/elsie/src/lib';
1
+ import { Initializer, Model } from '@dropins/tools/types/elsie/src/lib';
2
2
  import { Lang } from '@dropins/tools/types/elsie/src/i18n';
3
+ import { CustomerOrdersReturnModel, OrderDataModel, RequestReturnModel } from '../../data/models';
3
4
 
4
5
  type ConfigProps = {
5
6
  langDefinitions?: Lang;
7
+ models?: {
8
+ OrderDataModel?: Model<OrderDataModel>;
9
+ CustomerOrdersReturnModel?: Model<CustomerOrdersReturnModel>;
10
+ RequestReturnModel?: Model<RequestReturnModel>;
11
+ };
6
12
  };
7
13
  export declare const initialize: Initializer<ConfigProps>;
8
14
  export declare const config: import('@dropins/tools/types/elsie/src/lib').Config<ConfigProps>;
@@ -0,0 +1,2 @@
1
+ export declare const PLACE_ORDER_MUTATION: string;
2
+ //# sourceMappingURL=placeOrderMutation.d.ts.map
@@ -0,0 +1,2 @@
1
+ export * from './placeOrder';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ import { OrderDataModel } from '../../data/models';
2
+
3
+ export declare const placeOrder: (cartId: string) => Promise<OrderDataModel | null | undefined>;
4
+ //# sourceMappingURL=placeOrder.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare const REORDER_ITEMS_MUTATION = "\n mutation REORDER_ITEMS_MUTATION($orderNumber: String!) {\n reorderItems(orderNumber: $orderNumber) {\n cart {\n itemsV2 {\n items {\n uid\n }\n }\n }\n userInputErrors {\n code\n message\n path\n }\n }\n }\n";
2
+ //# sourceMappingURL=reorderItems.graphql.d.ts.map
@@ -0,0 +1,2 @@
1
+ export * from './reorderItems';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ import { ReorderItemsProps } from '../../types/api/reorderItems.types';
2
+
3
+ export declare const reorderItems: (orderNumber: string) => Promise<ReorderItemsProps>;
4
+ //# sourceMappingURL=reorderItems.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare const REQUEST_GUEST_ORDER_CANCEL_MUTATION: string;
2
+ //# sourceMappingURL=requestGuestOrderCancelMutation.d.ts.map
@@ -0,0 +1,2 @@
1
+ export * from './requestGuestOrderCancel';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare const requestGuestOrderCancel: (token: string, reason: string, onSuccess: Function, onError: Function) => Promise<void>;
2
+ //# sourceMappingURL=requestGuestOrderCancel.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare const REQUEST_RETURN_GUEST_ORDER: string;
2
+ //# sourceMappingURL=requestGuestReturn.graphql.d.ts.map
@@ -0,0 +1,2 @@
1
+ export * from './requestGuestReturn';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,9 @@
1
+ import { RequestGuestReturnProps } from '../../types';
2
+
3
+ export declare const requestGuestReturn: (form: RequestGuestReturnProps) => Promise<{
4
+ uid: string;
5
+ number: string;
6
+ status: string;
7
+ createdAt: string;
8
+ }>;
9
+ //# sourceMappingURL=requestGuestReturn.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare const REQUEST_RETURN_ORDER: string;
2
+ //# sourceMappingURL=requestReturn.graphql.d.ts.map
@@ -0,0 +1,2 @@
1
+ export * from './requestReturn';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,5 @@
1
+ import { RequestReturnProps } from '../../types';
2
+ import { RequestReturnModel } from '../../data/models';
3
+
4
+ export declare const requestReturn: (form: RequestReturnProps) => Promise<RequestReturnModel | {}>;
5
+ //# sourceMappingURL=requestReturn.d.ts.map
package/api.js CHANGED
@@ -1,10 +1,13 @@
1
- import{Initializer as u}from"@dropins/tools/lib.js";import{events as s}from"@dropins/tools/event-bus.js";import{f as n,h as m,a as o}from"./chunks/fetch-graphql.js";import{g as $,r as w,s as A,b as C,c as N}from"./chunks/fetch-graphql.js";import{O as c,a as _,A as p,t as h,b as O}from"./chunks/getCustomer.js";import{c as F,g as M}from"./chunks/getCustomer.js";import{g as x}from"./chunks/getAttributesForm.js";import"@dropins/tools/fetch-graphql.js";const y=`
2
- query ORDER_BY_NUMBER($orderNumber: String!) {
3
- customer {
4
- orders(
5
- filter: {number: {eq: $orderNumber}},
6
- ) {
7
- items {
1
+ /*! Copyright 2024 Adobe
2
+ All Rights Reserved. */
3
+ import{c as H,r as q}from"./chunks/requestGuestOrderCancel.js";import{f as E,h as _}from"./chunks/fetch-graphql.js";import{g as V,r as Y,s as z,a as j,b as J}from"./chunks/fetch-graphql.js";import{g as W}from"./chunks/getAttributesForm.js";import{g as ee,a as te,r as re}from"./chunks/requestGuestReturn.js";import{g as oe,a as ne}from"./chunks/getGuestOrder.js";import{g as ie}from"./chunks/getCustomerOrdersReturn.js";import{a as T}from"./chunks/initialize.js";import{c as ce,g as ue,b as de,i as le}from"./chunks/initialize.js";import{g as Ee}from"./chunks/getStoreConfig.js";import{h as R}from"./chunks/network-error.js";import{events as u}from"@dropins/tools/event-bus.js";import{PRODUCT_DETAILS_FRAGMENT as D,PRICE_DETAILS_FRAGMENT as A,GIFT_CARD_DETAILS_FRAGMENT as g,ORDER_ITEM_DETAILS_FRAGMENT as O,BUNDLE_ORDER_ITEM_DETAILS_FRAGMENT as h,ORDER_SUMMARY_FRAGMENT as f,ADDRESS_FRAGMENT as C}from"./fragments.js";import{a as Te,c as Re,r as De}from"./chunks/confirmCancelOrder.js";import"@dropins/tools/fetch-graphql.js";import"./chunks/transform-attributes-form.js";import"@dropins/tools/lib.js";const G=(t,r)=>({id:t,totalQuantity:r.totalQuantity,possibleOnepageCheckout:!0,items:r.items.map(e=>{var a,o,n,s,i,p;return{canApplyMsrp:!0,formattedPrice:"",id:e.id,quantity:e.totalQuantity,product:{canonicalUrl:((a=e.product)==null?void 0:a.canonicalUrl)??"",mainImageUrl:((o=e.product)==null?void 0:o.image)??"",name:((n=e.product)==null?void 0:n.name)??"",productId:0,productType:(s=e.product)==null?void 0:s.productType,sku:((i=e.product)==null?void 0:i.sku)??""},prices:{price:{value:e.price.value,currency:e.price.currency}},configurableOptions:((p=e.selectedOptions)==null?void 0:p.map(c=>({optionLabel:c.label,valueLabel:c.value})))||[]}})}),M=t=>{var a,o,n;const r=t.coupons[0],e=(a=t.payments)==null?void 0:a[0];return{appliedCouponCode:(r==null?void 0:r.code)??"",email:t.email,grandTotal:t.grandTotal.value,orderId:t.number,orderType:"checkout",otherTax:0,salesTax:t.totalTax.value,shipping:{shippingMethod:((o=t.shipping)==null?void 0:o.code)??"",shippingAmount:((n=t.shipping)==null?void 0:n.amount)??0},subtotalExcludingTax:t.subtotal.value,subtotalIncludingTax:0,payments:e?[{paymentMethodCode:(e==null?void 0:e.code)||"",paymentMethodName:(e==null?void 0:e.name)||"",total:t.grandTotal.value}]:[]}},N=t=>{var e,a;const r=(a=(e=t==null?void 0:t.data)==null?void 0:e.placeOrder)==null?void 0:a.orderV2;return r?T(r):null},d={SHOPPING_CART_CONTEXT:"shoppingCartContext",ORDER_CONTEXT:"orderContext"},b={PLACE_ORDER:"place-order"};function m(){return window.adobeDataLayer=window.adobeDataLayer||[],window.adobeDataLayer}function l(t,r){const e=m();e.push({[t]:null}),e.push({[t]:r})}function I(t,r){m().push(a=>{const o=a.getState?a.getState():{};a.push({event:t,eventInfo:{...o,...r}})})}function L(t,r){const e=M(r),a=G(t,r);l(d.ORDER_CONTEXT,{...e}),l(d.SHOPPING_CART_CONTEXT,{...a}),I(b.PLACE_ORDER)}const S=`
4
+ mutation PLACE_ORDER_MUTATION($cartId: String!) {
5
+ placeOrder(input: { cart_id: $cartId }) {
6
+ errors {
7
+ code
8
+ message
9
+ }
10
+ orderV2 {
8
11
  email
9
12
  available_actions
10
13
  status
@@ -18,148 +21,72 @@ query ORDER_BY_NUMBER($orderNumber: String!) {
18
21
  code
19
22
  }
20
23
  shipments {
21
- id
22
- number
23
- tracking {
24
- title
25
- number
26
- carrier
27
- }
28
- comments {
29
- message
30
- timestamp
31
- }
32
- items {
33
24
  id
34
- product_sku
35
- product_name
36
- order_item {
37
- ...OrderItems
38
- ... on GiftCardOrderItem {
39
- gift_card {
40
- recipient_name
41
- recipient_email
42
- sender_name
43
- sender_email
44
- message
25
+ number
26
+ tracking {
27
+ title
28
+ number
29
+ carrier
30
+ }
31
+ comments {
32
+ message
33
+ timestamp
34
+ }
35
+ items {
36
+ id
37
+ product_sku
38
+ product_name
39
+ order_item {
40
+ ...ORDER_ITEM_DETAILS_FRAGMENT
41
+ ... on GiftCardOrderItem {
42
+ ...GIFT_CARD_DETAILS_FRAGMENT
43
+ product {
44
+ ...PRODUCT_DETAILS_FRAGMENT
45
+ }
45
46
  }
46
47
  }
47
48
  }
48
- }
49
- }
49
+ }
50
50
  payment_methods {
51
51
  name
52
52
  type
53
53
  }
54
54
  shipping_address {
55
- ...AddressesList
55
+ ...ADDRESS_FRAGMENT
56
56
  }
57
57
  billing_address {
58
- ...AddressesList
58
+ ...ADDRESS_FRAGMENT
59
59
  }
60
60
  items {
61
- ...OrderItems
61
+ ...ORDER_ITEM_DETAILS_FRAGMENT
62
+ ... on BundleOrderItem {
63
+ ...BUNDLE_ORDER_ITEM_DETAILS_FRAGMENT
64
+ }
62
65
  ... on GiftCardOrderItem {
63
- __typename
64
- gift_card {
65
- recipient_name
66
- recipient_email
67
- sender_name
68
- sender_email
69
- message
66
+ ...GIFT_CARD_DETAILS_FRAGMENT
67
+ product {
68
+ ...PRODUCT_DETAILS_FRAGMENT
70
69
  }
71
70
  }
72
- }
73
- total {
74
- ...OrderSummary
75
- }
76
- }
77
- }
78
- }
79
- }
80
- ${c}
81
- ${_}
82
- ${p}
83
- `,g=async(e,r)=>await n(y,{method:"GET",cache:"force-cache",variables:{orderNumber:e}}).then(t=>{var a;return(a=t.errors)!=null&&a.length?m(t.errors):h(r??"orderData",t)}).catch(o),R=`
84
- query ORDER_BY_TOKEN($token: String!) {
85
- guestOrderByToken(input: { token: $token }) {
86
- email
87
- id
88
- number
89
- order_date
90
- status
91
- token
92
- carrier
93
- shipping_method
94
- printed_card_included
95
- gift_receipt_included
96
- available_actions
97
- is_virtual
98
- payment_methods {
99
- name
100
- type
101
- }
102
- applied_coupons {
103
- code
104
- }
105
- shipments {
106
- id
107
- tracking {
108
- title
109
- number
110
- carrier
111
- }
112
- comments {
113
- message
114
- timestamp
115
- }
116
- items {
117
- id
118
- product_sku
119
- product_name
120
- order_item {
121
- ...OrderItems
122
- ... on GiftCardOrderItem {
123
- gift_card {
124
- recipient_name
125
- recipient_email
126
- sender_name
127
- sender_email
128
- message
71
+ ... on DownloadableOrderItem {
72
+ product_name
73
+ downloadable_links {
74
+ sort_order
75
+ title
129
76
  }
130
77
  }
131
78
  }
132
- }
133
- }
134
- payment_methods {
135
- name
136
- type
137
- }
138
- shipping_address {
139
- ...AddressesList
140
- }
141
- billing_address {
142
- ...AddressesList
143
- }
144
- items {
145
- ...OrderItems
146
- ... on GiftCardOrderItem {
147
- __typename
148
- gift_card {
149
- recipient_name
150
- recipient_email
151
- sender_name
152
- sender_email
153
- message
79
+ total {
80
+ ...ORDER_SUMMARY_FRAGMENT
154
81
  }
155
82
  }
156
83
  }
157
- total {
158
- ...OrderSummary
159
- }
160
84
  }
161
- }
162
- ${c}
163
- ${_}
164
- ${p}
165
- `,b=async e=>await n(R,{method:"GET",cache:"no-cache",variables:{token:e}}).then(r=>{var t;return(t=r.errors)!=null&&t.length?m(r.errors):O(r)}).catch(o),f=async e=>{var d;const r=(e==null?void 0:e.orderRef)??"",t=r&&typeof(e==null?void 0:e.orderRef)=="string"&&((d=e==null?void 0:e.orderRef)==null?void 0:d.length)>20,a=(e==null?void 0:e.orderData)??null;if(a){s.emit("order/data",a);return}if(!r){console.error("Order Token or number not received.");return}const i=t?await b(r):await g(r);i?s.emit("order/data",i):s.emit("order/error",{source:"order",type:"network",error:"The data was not received."})},l=new u({init:async e=>{const r={};l.config.setConfig({...r,...e}),f(e).catch(console.error)},listeners:()=>[]}),T=l.config;export{T as config,n as fetchGraphQl,x as getAttributesForm,$ as getConfig,F as getCustomer,M as getGuestOrder,g as getOrderDetailsById,b as guestOrderByToken,l as initialize,w as removeFetchGraphQlHeader,A as setEndpoint,C as setFetchGraphQlHeader,N as setFetchGraphQlHeaders};
85
+ ${D}
86
+ ${A}
87
+ ${g}
88
+ ${O}
89
+ ${h}
90
+ ${f}
91
+ ${C}
92
+ `,k=async t=>{if(!t)throw new Error("No cart ID found");return E(S,{variables:{cartId:t}}).then(r=>{var a;(a=r.errors)!=null&&a.length&&_(r.errors);const e=N(r);return e&&(u.emit("order/placed",e),u.emit("cart/reset",void 0),L(t,e)),e}).catch(R)};export{H as cancelOrder,ce as config,Te as confirmCancelOrder,Re as confirmGuestReturn,E as fetchGraphQl,W as getAttributesForm,ee as getAttributesList,V as getConfig,oe as getCustomer,ie as getCustomerOrdersReturn,ne as getGuestOrder,ue as getOrderDetailsById,Ee as getStoreConfig,de as guestOrderByToken,le as initialize,k as placeOrder,Y as removeFetchGraphQlHeader,De as reorderItems,q as requestGuestOrderCancel,te as requestGuestReturn,re as requestReturn,z as setEndpoint,j as setFetchGraphQlHeader,J as setFetchGraphQlHeaders};
@@ -0,0 +1,3 @@
1
+ /*! Copyright 2024 Adobe
2
+ All Rights Reserved. */
3
+ import{jsx as v,jsxs as S,Fragment as _}from"@dropins/tools/preact-jsx-runtime.js";import{Price as P,Image as T,CartItem as g,Icon as u,Incrementer as o}from"@dropins/tools/components.js";import{useCallback as G}from"@dropins/tools/preact-hooks.js";import{classes as J}from"@dropins/tools/lib.js";import{O as r}from"./OrderLoaders.js";import*as M from"@dropins/tools/preact-compat.js";const c=k=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...k},M.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M0.75 12C0.75 5.78421 5.78421 0.75 12 0.75C18.2158 0.75 23.25 5.78421 23.25 12C23.25 18.2158 18.2158 23.25 12 23.25C5.78421 23.25 0.75 18.2158 0.75 12Z",stroke:"currentColor"}),M.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M11.75 5.88423V4.75H12.25V5.88423L12.0485 13.0713H11.9515L11.75 5.88423ZM11.7994 18.25V16.9868H12.2253V18.25H11.7994Z",stroke:"currentColor"})),se=({placeholderImage:k="",loading:X,product:e,itemType:Y,taxConfig:D,translations:h,disabledIncrementer:i,onQuantity:E,showConfigurableOptions:V,routeProductDetails:w})=>{var q,x,O,W,$,z,B,F,K,R,U;const{taxExcluded:f,taxIncluded:L}=D,t=G((m,H,b)=>v(P,{amount:m,currency:H,weight:"normal",...b}),[]),Z=G(m=>{var b,A;const H=(b=m==null?void 0:m.product)!=null&&b.thumbnail.url.length?(A=m==null?void 0:m.product)==null?void 0:A.thumbnail.url:k;return v(T,{src:H,alt:m==null?void 0:m.productName,loading:"lazy",width:"90",height:"120"})},[k]);if(!e)return v(r,{});let N={};const Q=Y==="cancelled",C=(x=(q=e==null?void 0:e.product)==null?void 0:q.stockStatus)==null?void 0:x.includes("IN_STOCK"),l=e==null?void 0:e.giftCard,a=(O=e==null?void 0:e.itemPrices)==null?void 0:O.priceIncludingTax,s=(W=e==null?void 0:e.itemPrices)==null?void 0:W.originalPrice,n=($=e==null?void 0:e.itemPrices)==null?void 0:$.price,I=e.totalQuantity>1?{quantity:e.totalQuantity}:{},y=e.discounted&&((z=e.price)==null?void 0:z.value)!==(s==null?void 0:s.value)*(e==null?void 0:e.totalQuantity),j={...(e==null?void 0:e.configurableOptions)||{},...(e==null?void 0:e.bundleOptions)||{},...l!=null&&l.senderName?{[h.sender]:l==null?void 0:l.senderName}:{},...l!=null&&l.senderEmail?{[h.sender]:l==null?void 0:l.senderEmail}:{},...l!=null&&l.senderName?{[h.sender]:l==null?void 0:l.senderName}:{},...l!=null&&l.recipientEmail?{[h.recipient]:l==null?void 0:l.recipientEmail}:{},...l!=null&&l.message?{[h.message]:l==null?void 0:l.message}:{},...e!=null&&e.downloadableLinks?{[`${(B=e==null?void 0:e.downloadableLinks)==null?void 0:B.count} ${h.downloadableCount}`]:(F=e==null?void 0:e.downloadableLinks)==null?void 0:F.result}:{}};if(L&&f){const m=y?s==null?void 0:s.value:(a==null?void 0:a.value)*(e==null?void 0:e.totalQuantity);N={taxExcluded:!0,taxIncluded:void 0,price:t(s==null?void 0:s.value,s==null?void 0:s.currency),total:S(_,{children:[t(m,s==null?void 0:s.currency,{variant:e.discounted&&(a==null?void 0:a.value)!==m?"strikethrough":"default"}),e.discounted&&(a==null?void 0:a.value)!==m?t(a==null?void 0:a.value,a==null?void 0:a.currency,{sale:!0,weight:"bold"}):null]}),totalExcludingTax:t((n==null?void 0:n.value)*e.totalQuantity,n==null?void 0:n.currency)}}else if(!L&&f)N={taxExcluded:void 0,taxIncluded:void 0,price:t(s==null?void 0:s.value,s==null?void 0:s.currency),total:S(_,{children:[t((s==null?void 0:s.value)*(e==null?void 0:e.totalQuantity),a==null?void 0:a.currency,{variant:y?"strikethrough":"default"}),y?t((K=e.price)==null?void 0:K.value,(R=e.price)==null?void 0:R.currency,{sale:!0,weight:"bold"}):null]}),totalExcludingTax:t((n==null?void 0:n.value)*(e==null?void 0:e.totalQuantity),n==null?void 0:n.currency)};else if(L&&!f){const m=y?s.value:a.value*e.totalQuantity;N={taxExcluded:void 0,taxIncluded:!0,price:t(a==null?void 0:a.value,a==null?void 0:a.currency),total:S(_,{children:[t(m,a==null?void 0:a.currency,{variant:y?"strikethrough":"default",weight:"bold"}),y?t(a==null?void 0:a.value,a==null?void 0:a.currency,{sale:!0,weight:"bold"}):null]})}}return v(g,{loading:X,alert:Q&&C?S("span",{children:[v(u,{source:c}),h.outOfStock]}):v(_,{}),configurations:(V==null?void 0:V(j))??j,title:w?v("a",{"data-testid":"product-name",className:J(["cart-summary-item__title",["cart-summary-item__title--strikethrough",Q]]),href:w(e),children:e==null?void 0:e.productName}):v("div",{"data-testid":"product-name",className:J(["cart-summary-item__title",["cart-summary-item__title--strikethrough",Q]]),children:e==null?void 0:e.productName}),sku:v("div",{children:(U=e==null?void 0:e.product)==null?void 0:U.sku}),...I,image:w?v("a",{href:w(e),children:Z(e)}):Z(e),...N,footer:E&&!i?v(o,{value:1,min:1,max:e==null?void 0:e.totalQuantity,onValue:m=>E==null?void 0:E(Number(m)),name:"quantity","data-testid":"returnIncrementer",readonly:!0}):void 0})};export{se as C,c as S};
@@ -0,0 +1,3 @@
1
+ /*! Copyright 2024 Adobe
2
+ All Rights Reserved. */
3
+ import{jsxs as g,jsx as r}from"@dropins/tools/preact-jsx-runtime.js";import{InLineAlert as v,Picker as x,Button as F}from"@dropins/tools/components.js";import{F as S}from"./ShippingStatusCard.js";import"@dropins/tools/lib.js";import{useState as n}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/preact.js";import{events as d}from"@dropins/tools/event-bus.js";import{r as E,c as _}from"./requestGuestOrderCancel.js";import{useText as D,Text as l}from"@dropins/tools/i18n.js";const k=({orderRef:a,pickerProps:m,submitButtonProps:u,cancelReasons:t})=>{const o=D({ErrorHeading:"Order.OrderCancelForm.errorHeading",ErrorDescription:"Order.OrderCancelForm.errorDescription",orderCancellationLabel:"Order.OrderCancelForm.label"}),[i,p]=n(0),[f,O]=n(!1),[b,h]=n(!1);d.on("authenticated",e=>{e&&h(!0)},{eager:!0});const C=e=>{e.preventDefault();const s=Number(e.target.value);p(s)};return g(S,{onSubmit:async e=>(e.preventDefault(),(a.length>20?E:_)(a,t[i].text,c=>{b||(c.status="guest order cancellation requested"),d.emit("order/data",c)},()=>{O(!0)})),"data-testid":"order-order-cancel-reasons-form__text",children:[f&&r(v,{heading:o.ErrorHeading,description:o.ErrorDescription}),r("div",{className:"order-order-cancel-reasons-form__text",children:r(l,{id:"Order.OrderCancelForm.description"})}),r(x,{name:"cancellationReasons",floatingLabel:o.orderCancellationLabel,defaultOption:t[0],variant:"primary",options:t,value:String(i),handleSelect:C,required:!0,"data-testid":"order-cancellation-reasons-selector",...m}),r("div",{className:"order-order-cancel-reasons-form__button-container",children:r(F,{variant:"primary","data-testid":"order-cancel-submit-button",...u,children:r(l,{id:"Order.OrderCancelForm.button"})})})]})};export{k as O};
@@ -1 +1,3 @@
1
- import{jsx as e,jsxs as t}from"@dropins/tools/preact-jsx-runtime.js";import{Card as l,Skeleton as s,SkeletonRow as r}from"@dropins/tools/components.js";import"./CustomerDetailsContent.js";import{classes as n}from"@dropins/tools/lib.js";const h=({testId:a,withCard:d=!0})=>{const i=t(s,{"data-testid":a??"skeletonLoader",children:[e(r,{variant:"heading",size:"xlarge",fullWidth:!1,lines:1}),e(r,{variant:"heading",size:"xlarge",fullWidth:!0,lines:1}),e(r,{variant:"heading",size:"xlarge",fullWidth:!0,lines:1})]});return d?i:e(l,{variant:"secondary",className:n(["dropin-order-loaders","dropin-order-loaders--card-loader"]),children:i})},g=a=>e(l,{variant:"secondary",...a,children:t(s,{"data-testid":"order-details-skeleton",children:[e(r,{variant:"heading",size:"medium",fullWidth:!0}),e(r,{size:"medium"}),e(r,{variant:"empty",size:"medium"}),e(r,{size:"xlarge"}),e(r,{size:"xlarge"}),e(r,{size:"xlarge"}),e(r,{size:"xlarge"})]})});export{h as C,g as D};
1
+ /*! Copyright 2024 Adobe
2
+ All Rights Reserved. */
3
+ import{jsx as e,jsxs as a}from"@dropins/tools/preact-jsx-runtime.js";import"./ShippingStatusCard.js";import{Card as d,Skeleton as i,SkeletonRow as r,CartItemSkeleton as t}from"@dropins/tools/components.js";import{classes as m}from"@dropins/tools/lib.js";const z=({testId:s,withCard:n=!0})=>{const l=a(i,{"data-testid":s??"skeletonLoader",children:[e(r,{variant:"heading",size:"xlarge",fullWidth:!1,lines:1}),e(r,{variant:"heading",size:"xlarge",fullWidth:!0,lines:1}),e(r,{variant:"heading",size:"xlarge",fullWidth:!0,lines:1})]});return n?l:e(d,{variant:"secondary",className:m(["order-order-loaders","order-order-loaders--card-loader"]),children:l})},v=s=>e(d,{variant:"secondary",...s,children:a(i,{"data-testid":"order-details-skeleton",children:[e(r,{variant:"heading",size:"medium",fullWidth:!0}),e(r,{size:"medium"}),e(r,{variant:"empty",size:"medium"}),e(r,{size:"xlarge"}),e(r,{size:"xlarge"}),e(r,{size:"xlarge"}),e(r,{size:"xlarge"})]})}),g=()=>a(i,{"data-testid":"order-product-list-skeleton",style:{gridTemplateColumns:"1fr"},children:[e(r,{variant:"heading",fullWidth:!0,size:"medium"}),e(t,{}),e(t,{}),e(t,{}),e(t,{}),e(t,{})]}),p=()=>a(i,{"data-testid":"order-cost-summary-content-skeleton",className:"order-cost-summary-content",children:[e(r,{variant:"heading",size:"small"}),e(r,{variant:"empty",size:"small"}),e(r,{variant:"empty",size:"small"}),e(r,{variant:"empty",size:"small"}),e(r,{variant:"heading",size:"small",fullWidth:!0,lines:3})]}),f=()=>a(i,{"data-testid":"order-header-skeleton",className:"order-header",children:[e(r,{variant:"empty",size:"xlarge",fullWidth:!0}),e(r,{variant:"empty",size:"medium"}),e(r,{variant:"empty",size:"medium"}),e(r,{variant:"empty",size:"medium"}),e(r,{variant:"empty",size:"medium"}),e(r,{variant:"empty",size:"medium"}),e(r,{size:"small",fullWidth:!0}),e(r,{variant:"heading",size:"xsmall",fullWidth:!0})]});export{z as C,v as D,p as O,g as a,f as b};