@dropins/storefront-order 0.1.0-alpha14 → 0.1.0-alpha16

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 (40) hide show
  1. package/api/requestGuestOrderCancel/requestGuestOrderCancel.d.ts +1 -1
  2. package/api.js +1 -1
  3. package/chunks/OrderCancelForm.js +1 -0
  4. package/chunks/OrderLoaders.js +1 -1
  5. package/chunks/getCustomer.js +2 -2
  6. package/chunks/getCustomerOrdersReturn.js +2 -2
  7. package/chunks/requestGuestOrderCancel.js +5 -5
  8. package/chunks/transform-order-details.js +1 -1
  9. package/chunks/useIsMobile.js +1 -1
  10. package/components/OrderCancel/OrderCancel.d.ts +5 -0
  11. package/components/OrderCostSummaryContent/Blocks.d.ts +1 -1
  12. package/components/index.d.ts +1 -1
  13. package/containers/CustomerDetails.js +1 -1
  14. package/containers/OrderCancelForm/OrderCancelForm.d.ts +5 -0
  15. package/containers/OrderCancelForm/index.d.ts +3 -0
  16. package/containers/OrderCancelForm.d.ts +3 -0
  17. package/containers/OrderCancelForm.js +1 -0
  18. package/containers/OrderCostSummary.js +1 -1
  19. package/containers/OrderProductList.js +1 -1
  20. package/containers/OrderReturns.js +1 -1
  21. package/containers/OrderSearch.js +1 -1
  22. package/containers/OrderStatus.js +3 -3
  23. package/containers/ReturnsList.js +1 -1
  24. package/containers/ShippingStatus.js +1 -1
  25. package/containers/index.d.ts +1 -1
  26. package/data/models/order-details.d.ts +1 -0
  27. package/hooks/containers/useShippingStatus.d.ts +2 -0
  28. package/i18n/en_US.json.d.ts +1 -1
  29. package/package.json +1 -1
  30. package/render.js +2 -2
  31. package/types/customerDetails.types.d.ts +2 -2
  32. package/types/orderCancel.types.d.ts +1 -2
  33. package/chunks/useGetStoreConfig.js +0 -1
  34. package/components/OrderCancelReasonsForm/OrderCancelReasonsForm.d.ts +0 -5
  35. package/components/OrderCancelReasonsForm/index.d.ts +0 -3
  36. package/containers/OrderCancel/OrderCancel.d.ts +0 -5
  37. package/containers/OrderCancel.d.ts +0 -3
  38. package/containers/OrderCancel.js +0 -1
  39. /package/chunks/{OrderCancelReasonsForm.js → OrderCancel.js} +0 -0
  40. /package/{containers → components}/OrderCancel/index.d.ts +0 -0
@@ -1,2 +1,2 @@
1
- export declare const requestGuestOrderCancel: (token: string, reason: string, onSuccess: Function, onError: Function) => Promise<boolean>;
1
+ export declare const requestGuestOrderCancel: (token: string, reason: string, onSuccess: Function, onError: Function) => Promise<void>;
2
2
  //# sourceMappingURL=requestGuestOrderCancel.d.ts.map
package/api.js CHANGED
@@ -1,4 +1,4 @@
1
- import{Initializer as E}from"@dropins/tools/lib.js";import{events as s}from"@dropins/tools/event-bus.js";import{f as i,h as n}from"./chunks/fetch-graphql.js";import{g as x,r as P,s as U,a as Y,b as q}from"./chunks/fetch-graphql.js";import{h as m}from"./chunks/network-error.js";import{P as l,a as u,G as c,O as _,B as p,R as O,b as f}from"./chunks/transform-order-details.js";import{O as h,A as D}from"./chunks/getGuestOrder.graphql.js";import{t as T}from"./chunks/getCustomer.js";import{g as z,a as H}from"./chunks/getCustomer.js";import{g as j}from"./chunks/getAttributesForm.js";import{g as V}from"./chunks/getStoreConfig.js";import{g as X}from"./chunks/getCustomerOrdersReturn.js";import{c as ee,r as re}from"./chunks/requestGuestOrderCancel.js";import"@dropins/tools/fetch-graphql.js";import"./chunks/convertCase.js";const G=`
1
+ import{Initializer as E}from"@dropins/tools/lib.js";import{events as s}from"@dropins/tools/event-bus.js";import{f as i,h as n}from"./chunks/fetch-graphql.js";import{g as x,r as P,s as U,a as Y,b as q}from"./chunks/fetch-graphql.js";import{h as m}from"./chunks/network-error.js";import{P as l,a as u,G as c,O as _,B as p,R as O,c as f}from"./chunks/transform-order-details.js";import{O as h,A as D}from"./chunks/getGuestOrder.graphql.js";import{t as T}from"./chunks/getCustomer.js";import{a as z,g as H}from"./chunks/getCustomer.js";import{g as j}from"./chunks/getAttributesForm.js";import{g as V}from"./chunks/getStoreConfig.js";import{g as X}from"./chunks/getCustomerOrdersReturn.js";import{c as ee,r as re}from"./chunks/requestGuestOrderCancel.js";import"@dropins/tools/fetch-graphql.js";import"./chunks/convertCase.js";const G=`
2
2
  query ORDER_BY_NUMBER($orderNumber: String!) {
3
3
  customer {
4
4
  orders(
@@ -0,0 +1 @@
1
+ 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"./OrderCancel.js";import"@dropins/tools/lib.js";import"@dropins/tools/preact-compat.js";import{useState as n}from"@dropins/tools/preact-hooks.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 @@
1
- import{jsx as e,jsxs as a}from"@dropins/tools/preact-jsx-runtime.js";import{Card as n,Skeleton as i,SkeletonRow as r,CartItemSkeleton as t}from"@dropins/tools/components.js";import"./OrderCancelReasonsForm.js";import{classes as o}from"@dropins/tools/lib.js";const z=({testId:s,withCard:d=!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 d?l:e(n,{variant:"secondary",className:o(["order-order-loaders","order-order-loaders--card-loader"]),children:l})},g=s=>e(n,{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"})]})}),f=()=>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,{})]}),v=()=>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})]});export{z as C,g as D,f as O,v as a};
1
+ import{jsx as e,jsxs as a}from"@dropins/tools/preact-jsx-runtime.js";import{Card as n,Skeleton as i,SkeletonRow as r,CartItemSkeleton as t}from"@dropins/tools/components.js";import"./OrderCancel.js";import{classes as o}from"@dropins/tools/lib.js";const z=({testId:s,withCard:d=!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 d?l:e(n,{variant:"secondary",className:o(["order-order-loaders","order-order-loaders--card-loader"]),children:l})},g=s=>e(n,{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"})]})}),f=()=>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,{})]}),v=()=>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})]});export{z as C,g as D,f as O,v as a};
@@ -1,4 +1,4 @@
1
- import{h}from"./network-error.js";import{f,h as i}from"./fetch-graphql.js";import{a as O}from"./getGuestOrder.graphql.js";import{t as l}from"./transform-order-details.js";const T=t=>{var r,u;if(!((r=t==null?void 0:t.data)!=null&&r.guestOrder))return null;const a=(u=t==null?void 0:t.data)==null?void 0:u.guestOrder;return l(a)},k=t=>{var r,u;if(!((r=t==null?void 0:t.data)!=null&&r.guestOrderByToken))return null;const a=(u=t==null?void 0:t.data)==null?void 0:u.guestOrderByToken;return l(a)},g=t=>{var a,r,u,c,m,d;return{email:((r=(a=t==null?void 0:t.data)==null?void 0:a.customer)==null?void 0:r.email)||"",firstname:((c=(u=t==null?void 0:t.data)==null?void 0:u.customer)==null?void 0:c.firstname)||"",lastname:((d=(m=t==null?void 0:t.data)==null?void 0:m.customer)==null?void 0:d.lastname)||""}},B=async t=>await f(O,{method:"GET",cache:"no-cache",variables:{input:t}}).then(a=>{var r;return(r=a.errors)!=null&&r.length?i(a.errors):T(a)}).catch(h),E=`
1
+ import{h}from"./network-error.js";import{f,h as i}from"./fetch-graphql.js";import{a as O}from"./getGuestOrder.graphql.js";import{b as l}from"./transform-order-details.js";const T=t=>{var r,u;if(!((r=t==null?void 0:t.data)!=null&&r.guestOrder))return null;const a=(u=t==null?void 0:t.data)==null?void 0:u.guestOrder;return l(a)},k=t=>{var r,u;if(!((r=t==null?void 0:t.data)!=null&&r.guestOrderByToken))return null;const a=(u=t==null?void 0:t.data)==null?void 0:u.guestOrderByToken;return l(a)},g=t=>{var a,r,u,c,m,d;return{email:((r=(a=t==null?void 0:t.data)==null?void 0:a.customer)==null?void 0:r.email)||"",firstname:((c=(u=t==null?void 0:t.data)==null?void 0:u.customer)==null?void 0:c.firstname)||"",lastname:((d=(m=t==null?void 0:t.data)==null?void 0:m.customer)==null?void 0:d.lastname)||""}},B=async t=>await f(O,{method:"GET",cache:"no-cache",variables:{input:t}}).then(a=>{var r;return(r=a.errors)!=null&&r.length?i(a.errors):T(a)}).catch(h),E=`
2
2
  query GET_CUSTOMER {
3
3
  customer {
4
4
  firstname
@@ -6,4 +6,4 @@ import{h}from"./network-error.js";import{f,h as i}from"./fetch-graphql.js";impor
6
6
  email
7
7
  }
8
8
  }
9
- `,C=async()=>await f(E,{method:"GET",cache:"force-cache"}).then(t=>{var a;return(a=t.errors)!=null&&a.length?i(t.errors):g(t)}).catch(h);export{B as a,C as g,k as t};
9
+ `,C=async()=>await f(E,{method:"GET",cache:"force-cache"}).then(t=>{var a;return(a=t.errors)!=null&&a.length?i(t.errors):g(t)}).catch(h);export{C as a,B as g,k as t};
@@ -1,4 +1,4 @@
1
- import{h as R}from"./network-error.js";import{f as e,h as E}from"./fetch-graphql.js";import{R as _,P as T,a as o,G as c,O as s,c as u}from"./transform-order-details.js";const h=`
1
+ import{h as R}from"./network-error.js";import{f as e,h as E}from"./fetch-graphql.js";import{R as _,P as T,a as o,G as s,O as c,t as u}from"./transform-order-details.js";const h=`
2
2
  query GET_CUSTOMER_ORDERS_RETURN {
3
3
  customer {
4
4
  returns {
@@ -14,6 +14,6 @@ query GET_CUSTOMER_ORDERS_RETURN {
14
14
  ${_}
15
15
  ${T}
16
16
  ${o}
17
- ${c}
18
17
  ${s}
18
+ ${c}
19
19
  `,A=async()=>await e(h,{method:"GET",cache:"force-cache"}).then(r=>{var t,a;return(t=r.errors)!=null&&t.length?E(r.errors):u((a=r==null?void 0:r.data)==null?void 0:a.customer.returns)}).catch(R);export{A as g};
@@ -1,4 +1,4 @@
1
- import{P as _,a as l,G as E,O as c,B as m,t as d}from"./transform-order-details.js";import{O,A as D,G as R}from"./getGuestOrder.graphql.js";import{f as i,h as u}from"./fetch-graphql.js";const T=`
1
+ import{P as c,a as u,G as l,O as E,B as m,b as d}from"./transform-order-details.js";import{O,A as D,G as R}from"./getGuestOrder.graphql.js";import{f as i,h as _}from"./fetch-graphql.js";const T=`
2
2
  mutation CANCEL_ORDER_MUTATION($orderId: ID!, $reason: String!) {
3
3
  cancelOrder(input: { order_id: $orderId, reason: $reason }) {
4
4
  error
@@ -77,14 +77,14 @@ mutation CANCEL_ORDER_MUTATION($orderId: ID!, $reason: String!) {
77
77
  }
78
78
  }
79
79
  }
80
- ${_}
80
+ ${c}
81
+ ${u}
81
82
  ${l}
82
83
  ${E}
83
- ${c}
84
84
  ${m}
85
85
  ${O}
86
86
  ${D}
87
- `,G=async(r,e,o,n)=>{if(!r)throw new Error("No order ID found");if(!e)throw new Error("No reason found");return i(T,{variables:{orderId:r,reason:e}}).then(({errors:t,data:a})=>{if(t)return u(t);if(a.cancelOrder.error!=null){n();return}const s=d(a.cancelOrder.order);o(s)})},A=`
87
+ `,G=async(r,e,s,t)=>{if(!r)throw new Error("No order ID found");if(!e)throw new Error("No reason found");return i(T,{variables:{orderId:r,reason:e}}).then(({errors:a,data:o})=>{if(a)return _(a);if(o.cancelOrder.error!=null){t();return}const n=d(o.cancelOrder.order);s(n)}).catch(()=>t())},A=`
88
88
  mutation REQUEST_GUEST_ORDER_CANCEL_MUTATION($token: String!, $reason: String!) {
89
89
  requestGuestOrderCancel(input: { token: $token, reason: $reason }) {
90
90
  error
@@ -94,4 +94,4 @@ mutation REQUEST_GUEST_ORDER_CANCEL_MUTATION($token: String!, $reason: String!)
94
94
  }
95
95
  }
96
96
  ${R}
97
- `,C=async(r,e,o,n)=>{if(!r)throw new Error("No order token found");if(!e)throw new Error("No reason found");return i(A,{variables:{token:r,reason:e}}).then(({errors:t,data:a})=>{if(t)return u(t);if(a.requestGuestOrderCancel.error!=null)return n(),!1;const s=d(a.requestGuestOrderCancel.order);return o(s),!0})};export{G as c,C as r};
97
+ `,C=async(r,e,s,t)=>{if(!r)throw new Error("No order token found");if(!e)throw new Error("No reason found");return i(A,{variables:{token:r,reason:e}}).then(({errors:a,data:o})=>{if(a)return _(a);o.requestGuestOrderCancel.error!=null&&t();const n=d(o.requestGuestOrderCancel.order);s(n)}).catch(()=>t())};export{G as c,C as r};
@@ -134,4 +134,4 @@ import{a as F}from"./convertCase.js";const J=`
134
134
  }
135
135
  }
136
136
  }
137
- `,B=n=>{var s;if(!((s=n==null?void 0:n.items)!=null&&s.length))return null;const a=n==null?void 0:n.items,u=n==null?void 0:n.page_info;return{ordersReturn:a.map(l=>{var f,b;const{order:_,status:t,number:y}=l,v=((b=(f=l==null?void 0:l.shipping)==null?void 0:f.tracking)==null?void 0:b.map(i=>{const{status:p,carrier:g,tracking_number:q}=i;return{status:p,carrier:g,trackingNumber:q}}))??[],O=l.items.map(i=>{var h;const p=i==null?void 0:i.quantity,g=i==null?void 0:i.status,q=i==null?void 0:i.request_quantity,e=i==null?void 0:i.uid,R=i==null?void 0:i.order_item,E=((h=M([R]))==null?void 0:h.reduce((T,N)=>N,{}))??{};return{uid:e,quantity:p,status:g,requestQuantity:q,orderItem:E}});return{returnStatus:t,token:_==null?void 0:_.token,orderNumber:_==null?void 0:_.number,returnNumber:y,items:O,tracking:v}}),...u?{pageInfo:{pageSize:u.page_size,totalPages:u.total_pages,currentPage:u.current_page}}:{}}},U=n=>n||0,Q=n=>{var a,u,c;return{...n,canonicalUrl:(n==null?void 0:n.canonical_url)||"",urlKey:(n==null?void 0:n.url_key)||"",id:(n==null?void 0:n.uid)||"",name:(n==null?void 0:n.name)||"",sku:(n==null?void 0:n.sku)||"",image:((a=n==null?void 0:n.image)==null?void 0:a.url)||"",productType:(n==null?void 0:n.__typename)||"",thumbnail:{label:((u=n==null?void 0:n.thumbnail)==null?void 0:u.label)||"",url:((c=n==null?void 0:n.thumbnail)==null?void 0:c.url)||""}}},j=n=>{if(!n||!("selected_options"in n))return;const a={};for(const u of n.selected_options)a[u.label]=u.value;return a},w=n=>{const a=n==null?void 0:n.map(c=>({uid:c.uid,label:c.label,values:c.values.map(s=>s.product_name).join(", ")})),u={};return a==null||a.forEach(c=>{u[c.label]=c.values}),Object.keys(u).length>0?u:null},K=n=>(n==null?void 0:n.length)>0?{count:n.length,result:n.map(a=>a.title).join(", ")}:null,M=n=>n==null?void 0:n.filter(a=>a.__typename).map(a=>{var u,c,s,l,_,t,y,v,O,f,b,i,p,g,q,e,R,E,h,T,N,k,C,D,P,G,A,x,S,L;return{type:a==null?void 0:a.__typename,productName:a.product_name,productUrlKey:a.product_url_key,quantityCanceled:(a==null?void 0:a.quantity_canceled)||0,quantityInvoiced:(a==null?void 0:a.quantity_invoiced)||0,quantityOrdered:(a==null?void 0:a.quantity_ordered)||0,quantityRefunded:(a==null?void 0:a.quantity_refunded)||0,quantityReturned:(a==null?void 0:a.quantity_returned)||0,quantityShipped:(a==null?void 0:a.quantity_shipped)||0,id:a==null?void 0:a.id,discounted:((l=(s=(c=(u=a==null?void 0:a.product)==null?void 0:u.price_range)==null?void 0:c.maximum_price)==null?void 0:s.regular_price)==null?void 0:l.value)*(a==null?void 0:a.quantity_ordered)!==((_=a==null?void 0:a.product_sale_price)==null?void 0:_.value)*(a==null?void 0:a.quantity_ordered),total:{value:((t=a==null?void 0:a.product_sale_price)==null?void 0:t.value)*(a==null?void 0:a.quantity_ordered)||0,currency:((y=a==null?void 0:a.product_sale_price)==null?void 0:y.currency)||""},totalInclTax:{value:((v=a==null?void 0:a.product_sale_price)==null?void 0:v.value)*(a==null?void 0:a.quantity_ordered)||0,currency:(O=a==null?void 0:a.product_sale_price)==null?void 0:O.currency},price:{value:((f=a==null?void 0:a.product_sale_price)==null?void 0:f.value)||0,currency:(b=a==null?void 0:a.product_sale_price)==null?void 0:b.currency},priceInclTax:{value:((i=a==null?void 0:a.product_sale_price)==null?void 0:i.value)||0,currency:(p=a==null?void 0:a.product_sale_price)==null?void 0:p.currency},totalQuantity:U(a==null?void 0:a.quantity_ordered),regularPrice:{value:(R=(e=(q=(g=a==null?void 0:a.product)==null?void 0:g.price_range)==null?void 0:q.maximum_price)==null?void 0:e.regular_price)==null?void 0:R.value,currency:(N=(T=(h=(E=a==null?void 0:a.product)==null?void 0:E.price_range)==null?void 0:h.maximum_price)==null?void 0:T.regular_price)==null?void 0:N.currency},product:Q(a==null?void 0:a.product),thumbnail:{label:((C=(k=a==null?void 0:a.product)==null?void 0:k.thumbnail)==null?void 0:C.label)||"",url:((P=(D=a==null?void 0:a.product)==null?void 0:D.thumbnail)==null?void 0:P.url)||""},giftCard:(a==null?void 0:a.__typename)==="GiftCardOrderItem"?{senderName:((G=a.gift_card)==null?void 0:G.sender_name)||"",senderEmail:((A=a.gift_card)==null?void 0:A.sender_email)||"",recipientEmail:((x=a.gift_card)==null?void 0:x.recipient_email)||"",recipientName:((S=a.gift_card)==null?void 0:S.recipient_name)||"",message:((L=a.gift_card)==null?void 0:L.message)||""}:void 0,configurableOptions:j(a),bundleOptions:a.__typename==="BundleOrderItem"?w(a.bundle_options):null,itemPrices:a.prices,downloadableLinks:a.__typename==="DownloadableOrderItem"?K(a==null?void 0:a.downloadable_links):null}}),z=n=>{var O,f,b,i,p,g;const a=M(n.items),u=((O=B(n==null?void 0:n.returns))==null?void 0:O.ordersReturn)??[],{total:c,...s}=F({...n,items:a,returns:u},"camelCase",{applied_coupons:"coupons",__typename:"__typename",firstname:"firstName",middlename:"middleName",lastname:"lastName",postcode:"postCode",payment_methods:"payments"}),l=(f=n==null?void 0:n.payment_methods)==null?void 0:f[0],_=(l==null?void 0:l.type)||"",t=(l==null?void 0:l.name)||"",y=(b=s==null?void 0:s.items)==null?void 0:b.reduce((q,e)=>q+(e==null?void 0:e.totalQuantity),0);return{...c,...s,totalQuantity:y,shipping:{amount:((i=s==null?void 0:s.total)==null?void 0:i.totalShipping.value)??0,currency:((g=(p=s.total)==null?void 0:p.totalShipping)==null?void 0:g.currency)||"",code:s.shippingMethod??""},payments:[{code:_,name:t}]}},$=(n,a)=>{var u,c,s,l,_,t,y;if((l=(s=(c=(u=a==null?void 0:a.data)==null?void 0:u.customer)==null?void 0:c.orders)==null?void 0:s.items)!=null&&l.length&&n==="orderData"){const v=(y=(t=(_=a==null?void 0:a.data)==null?void 0:_.customer)==null?void 0:t.orders)==null?void 0:y.items[0];return z(v)}return null};export{Y as B,W as G,X as O,J as P,Z as R,V as a,$ as b,B as c,z as t};
137
+ `,B=n=>{var s;if(!((s=n==null?void 0:n.items)!=null&&s.length))return null;const a=n==null?void 0:n.items,u=n==null?void 0:n.page_info;return{ordersReturn:a.map(l=>{var f,b;const{order:_,status:t,number:y}=l,v=((b=(f=l==null?void 0:l.shipping)==null?void 0:f.tracking)==null?void 0:b.map(i=>{const{status:p,carrier:g,tracking_number:q}=i;return{status:p,carrier:g,trackingNumber:q}}))??[],O=l.items.map(i=>{var h;const p=i==null?void 0:i.quantity,g=i==null?void 0:i.status,q=i==null?void 0:i.request_quantity,e=i==null?void 0:i.uid,R=i==null?void 0:i.order_item,E=((h=M([R]))==null?void 0:h.reduce((T,N)=>N,{}))??{};return{uid:e,quantity:p,status:g,requestQuantity:q,orderItem:E}});return{returnStatus:t,token:_==null?void 0:_.token,orderNumber:_==null?void 0:_.number,returnNumber:y,items:O,tracking:v}}),...u?{pageInfo:{pageSize:u.page_size,totalPages:u.total_pages,currentPage:u.current_page}}:{}}},U=n=>n||0,Q=n=>{var a,u,c;return{...n,canonicalUrl:(n==null?void 0:n.canonical_url)||"",urlKey:(n==null?void 0:n.url_key)||"",id:(n==null?void 0:n.uid)||"",name:(n==null?void 0:n.name)||"",sku:(n==null?void 0:n.sku)||"",image:((a=n==null?void 0:n.image)==null?void 0:a.url)||"",productType:(n==null?void 0:n.__typename)||"",thumbnail:{label:((u=n==null?void 0:n.thumbnail)==null?void 0:u.label)||"",url:((c=n==null?void 0:n.thumbnail)==null?void 0:c.url)||""}}},j=n=>{if(!n||!("selected_options"in n))return;const a={};for(const u of n.selected_options)a[u.label]=u.value;return a},w=n=>{const a=n==null?void 0:n.map(c=>({uid:c.uid,label:c.label,values:c.values.map(s=>s.product_name).join(", ")})),u={};return a==null||a.forEach(c=>{u[c.label]=c.values}),Object.keys(u).length>0?u:null},K=n=>(n==null?void 0:n.length)>0?{count:n.length,result:n.map(a=>a.title).join(", ")}:null,M=n=>n==null?void 0:n.filter(a=>a.__typename).map(a=>{var u,c,s,l,_,t,y,v,O,f,b,i,p,g,q,e,R,E,h,T,N,k,C,D,P,G,A,x,S,L;return{type:a==null?void 0:a.__typename,productName:a.product_name,productUrlKey:a.product_url_key,quantityCanceled:(a==null?void 0:a.quantity_canceled)||0,quantityInvoiced:(a==null?void 0:a.quantity_invoiced)||0,quantityOrdered:(a==null?void 0:a.quantity_ordered)||0,quantityRefunded:(a==null?void 0:a.quantity_refunded)||0,quantityReturned:(a==null?void 0:a.quantity_returned)||0,quantityShipped:(a==null?void 0:a.quantity_shipped)||0,id:a==null?void 0:a.id,discounted:((l=(s=(c=(u=a==null?void 0:a.product)==null?void 0:u.price_range)==null?void 0:c.maximum_price)==null?void 0:s.regular_price)==null?void 0:l.value)*(a==null?void 0:a.quantity_ordered)!==((_=a==null?void 0:a.product_sale_price)==null?void 0:_.value)*(a==null?void 0:a.quantity_ordered),total:{value:((t=a==null?void 0:a.product_sale_price)==null?void 0:t.value)*(a==null?void 0:a.quantity_ordered)||0,currency:((y=a==null?void 0:a.product_sale_price)==null?void 0:y.currency)||""},totalInclTax:{value:((v=a==null?void 0:a.product_sale_price)==null?void 0:v.value)*(a==null?void 0:a.quantity_ordered)||0,currency:(O=a==null?void 0:a.product_sale_price)==null?void 0:O.currency},price:{value:((f=a==null?void 0:a.product_sale_price)==null?void 0:f.value)||0,currency:(b=a==null?void 0:a.product_sale_price)==null?void 0:b.currency},priceInclTax:{value:((i=a==null?void 0:a.product_sale_price)==null?void 0:i.value)||0,currency:(p=a==null?void 0:a.product_sale_price)==null?void 0:p.currency},totalQuantity:U(a==null?void 0:a.quantity_ordered),regularPrice:{value:(R=(e=(q=(g=a==null?void 0:a.product)==null?void 0:g.price_range)==null?void 0:q.maximum_price)==null?void 0:e.regular_price)==null?void 0:R.value,currency:(N=(T=(h=(E=a==null?void 0:a.product)==null?void 0:E.price_range)==null?void 0:h.maximum_price)==null?void 0:T.regular_price)==null?void 0:N.currency},product:Q(a==null?void 0:a.product),thumbnail:{label:((C=(k=a==null?void 0:a.product)==null?void 0:k.thumbnail)==null?void 0:C.label)||"",url:((P=(D=a==null?void 0:a.product)==null?void 0:D.thumbnail)==null?void 0:P.url)||""},giftCard:(a==null?void 0:a.__typename)==="GiftCardOrderItem"?{senderName:((G=a.gift_card)==null?void 0:G.sender_name)||"",senderEmail:((A=a.gift_card)==null?void 0:A.sender_email)||"",recipientEmail:((x=a.gift_card)==null?void 0:x.recipient_email)||"",recipientName:((S=a.gift_card)==null?void 0:S.recipient_name)||"",message:((L=a.gift_card)==null?void 0:L.message)||""}:void 0,configurableOptions:j(a),bundleOptions:a.__typename==="BundleOrderItem"?w(a.bundle_options):null,itemPrices:a.prices,downloadableLinks:a.__typename==="DownloadableOrderItem"?K(a==null?void 0:a.downloadable_links):null}}),z=n=>{var O,f,b,i,p,g;const a=M(n.items),u=((O=B(n==null?void 0:n.returns))==null?void 0:O.ordersReturn)??[],{total:c,...s}=F({...n,items:a,returns:u},"camelCase",{applied_coupons:"coupons",__typename:"__typename",firstname:"firstName",middlename:"middleName",lastname:"lastName",postcode:"postCode",payment_methods:"payments"}),l=(f=n==null?void 0:n.payment_methods)==null?void 0:f[0],_=(l==null?void 0:l.type)||"",t=(l==null?void 0:l.name)||"",y=(b=s==null?void 0:s.items)==null?void 0:b.reduce((q,e)=>q+(e==null?void 0:e.totalQuantity),0);return{...c,...s,totalQuantity:y,shipping:{amount:((i=s==null?void 0:s.total)==null?void 0:i.totalShipping.value)??0,currency:((g=(p=s.total)==null?void 0:p.totalShipping)==null?void 0:g.currency)||"",code:s.shippingMethod??""},payments:[{code:_,name:t}]}},$=(n,a)=>{var u,c,s,l,_,t,y;if((l=(s=(c=(u=a==null?void 0:a.data)==null?void 0:u.customer)==null?void 0:c.orders)==null?void 0:s.items)!=null&&l.length&&n==="orderData"){const v=(y=(t=(_=a==null?void 0:a.data)==null?void 0:_.customer)==null?void 0:t.orders)==null?void 0:y.items[0];return z(v)}return null};export{Y as B,W as G,X as O,J as P,Z as R,V as a,z as b,$ as c,B as t};
@@ -1 +1 @@
1
- import{jsx as r,jsxs as a,Fragment as p}from"@dropins/tools/preact-jsx-runtime.js";import{useMemo as A,useState as X,useCallback as K,useEffect as r1}from"@dropins/tools/preact-hooks.js";import{classes as F,Slot as T,debounce as e1}from"@dropins/tools/lib.js";import{IllustratedMessage as n1,Icon as x,Card as B,ContentGrid as t1,Image as L1,Header as j,Pagination as s1}from"@dropins/tools/components.js";import*as o from"@dropins/tools/preact-compat.js";import{useMemo as a1}from"@dropins/tools/preact-compat.js";import"./OrderCancelReasonsForm.js";import{C as R}from"./OrderLoaders.js";import"@dropins/tools/preact.js";import"@dropins/tools/event-bus.js";import{Text as Y}from"@dropins/tools/i18n.js";const G=n=>o.createElement("svg",{id:"Icon_Chevron_right_Base","data-name":"Icon \\u2013 Chevron right \\u2013 Base",xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",...n},o.createElement("g",{id:"Large"},o.createElement("rect",{id:"Placement_area","data-name":"Placement area",width:24,height:24,fill:"#fff",opacity:0}),o.createElement("g",{id:"Chevron_right_icon","data-name":"Chevron right icon"},o.createElement("path",{vectorEffect:"non-scaling-stroke",id:"chevron",d:"M199.75,367.5l4.255,-4.255-4.255,-4.255",transform:"translate(-189.25 -351.0)",fill:"none",stroke:"currentColor"})))),i1=n=>o.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n},o.createElement("path",{d:"M12.002 21L11.8275 21.4686C11.981 21.5257 12.1528 21.5041 12.2873 21.4106C12.4218 21.3172 12.502 21.1638 12.502 21H12.002ZM3.89502 17.9823H3.39502C3.39502 18.1912 3.52485 18.378 3.72059 18.4509L3.89502 17.9823ZM3.89502 8.06421L4.07193 7.59655C3.91831 7.53844 3.74595 7.55948 3.61082 7.65284C3.47568 7.74619 3.39502 7.89997 3.39502 8.06421H3.89502ZM12.0007 21H11.5007C11.5007 21.1638 11.5809 21.3172 11.7154 21.4106C11.8499 21.5041 12.0216 21.5257 12.1751 21.4686L12.0007 21ZM20.1076 17.9823L20.282 18.4509C20.4778 18.378 20.6076 18.1912 20.6076 17.9823H20.1076ZM20.1076 8.06421H20.6076C20.6076 7.89997 20.527 7.74619 20.3918 7.65284C20.2567 7.55948 20.0843 7.53844 19.9307 7.59655L20.1076 8.06421ZM12.0007 11.1311L11.8238 10.6634C11.6293 10.737 11.5007 10.9232 11.5007 11.1311H12.0007ZM20.2858 8.53191C20.5441 8.43421 20.6743 8.14562 20.5766 7.88734C20.4789 7.62906 20.1903 7.49889 19.932 7.5966L20.2858 8.53191ZM12.002 4.94826L12.1775 4.48008C12.0605 4.43623 11.9314 4.43775 11.8154 4.48436L12.002 4.94826ZM5.87955 6.87106C5.62334 6.97407 5.49915 7.26528 5.60217 7.52149C5.70518 7.77769 5.99639 7.90188 6.2526 7.79887L5.87955 6.87106ZM18.1932 7.80315C18.4518 7.90008 18.74 7.76904 18.8369 7.51047C18.9338 7.2519 18.8028 6.96371 18.5442 6.86678L18.1932 7.80315ZM12 4.94827L11.5879 5.23148C11.6812 5.36719 11.8353 5.44827 12 5.44827C12.1647 5.44827 12.3188 5.36719 12.4121 5.23148L12 4.94827ZM14.0263 2L14.2028 1.53218C13.9875 1.45097 13.7446 1.52717 13.6143 1.71679L14.0263 2ZM21.8421 4.94827L22.2673 5.2113C22.3459 5.08422 22.3636 4.92863 22.3154 4.78717C22.2673 4.64571 22.1584 4.53319 22.0186 4.48045L21.8421 4.94827ZM9.97368 2L10.3857 1.71679C10.2554 1.52717 10.0125 1.45097 9.79721 1.53218L9.97368 2ZM2.15789 4.94827L1.98142 4.48045C1.84161 4.53319 1.73271 4.64571 1.68456 4.78717C1.63641 4.92863 1.65406 5.08422 1.73267 5.2113L2.15789 4.94827ZM12 11.1256L11.6702 11.5014C11.8589 11.667 12.1411 11.667 12.3298 11.5014L12 11.1256ZM15.0395 8.45812L14.8732 7.98659C14.8131 8.00779 14.7576 8.04028 14.7097 8.08232L15.0395 8.45812ZM23 5.65024L23.3288 6.0269C23.5095 5.86916 23.5527 5.60532 23.4318 5.39817C23.3109 5.19102 23.0599 5.09893 22.8337 5.17871L23 5.65024ZM8.96053 8.45812L9.29034 8.08232C9.24244 8.04028 9.18695 8.00779 9.12685 7.98659L8.96053 8.45812ZM1 5.65024L1.16632 5.17871C0.940115 5.09893 0.689119 5.19102 0.568192 5.39817C0.447264 5.60532 0.49048 5.86916 0.671176 6.0269L1 5.65024ZM12.1764 20.5314L4.06945 17.5137L3.72059 18.4509L11.8275 21.4686L12.1764 20.5314ZM4.39502 17.9823V8.06421H3.39502V17.9823H4.39502ZM3.71811 8.53187L11.8251 11.5987L12.1789 10.6634L4.07193 7.59655L3.71811 8.53187ZM11.502 11.1311V21H12.502V11.1311H11.502ZM12.1751 21.4686L20.282 18.4509L19.9332 17.5137L11.8262 20.5314L12.1751 21.4686ZM20.6076 17.9823V8.06421H19.6076V17.9823H20.6076ZM19.9307 7.59655L11.8238 10.6634L12.1776 11.5987L20.2845 8.53187L19.9307 7.59655ZM11.5007 11.1311V21H12.5007V11.1311H11.5007ZM19.932 7.5966L11.8251 10.6634L12.1789 11.5987L20.2858 8.53191L19.932 7.5966ZM11.8154 4.48436L5.87955 6.87106L6.2526 7.79887L12.1885 5.41217L11.8154 4.48436ZM11.8265 5.41645L18.1932 7.80315L18.5442 6.86678L12.1775 4.48008L11.8265 5.41645ZM11.502 4.94826V11.1311H12.502V4.94826H11.502ZM12.4121 5.23148L14.4384 2.28321L13.6143 1.71679L11.5879 4.66507L12.4121 5.23148ZM13.8498 2.46782L21.6656 5.4161L22.0186 4.48045L14.2028 1.53218L13.8498 2.46782ZM21.4169 4.68525L20.5485 6.08919L21.3989 6.61524L22.2673 5.2113L21.4169 4.68525ZM12.4121 4.66507L10.3857 1.71679L9.56162 2.28321L11.5879 5.23148L12.4121 4.66507ZM9.79721 1.53218L1.98142 4.48045L2.33437 5.4161L10.1502 2.46782L9.79721 1.53218ZM1.73267 5.2113L2.60109 6.61524L3.45154 6.08919L2.58312 4.68525L1.73267 5.2113ZM12.3298 11.5014L15.3693 8.83392L14.7097 8.08232L11.6702 10.7498L12.3298 11.5014ZM15.2058 8.92965L23.1663 6.12177L22.8337 5.17871L14.8732 7.98659L15.2058 8.92965ZM22.6712 5.27358L19.7764 7.80067L20.4341 8.554L23.3288 6.0269L22.6712 5.27358ZM12.3298 10.7498L9.29034 8.08232L8.63072 8.83392L11.6702 11.5014L12.3298 10.7498ZM9.12685 7.98659L1.16632 5.17871L0.83368 6.12177L8.79421 8.92965L9.12685 7.98659ZM0.671176 6.0269L3.56591 8.554L4.22356 7.80067L1.32882 5.27358L0.671176 6.0269Z",fill:"#D6D6D6"})),U=({typeList:n,isEmpty:h,minifiedView:c,message:t})=>{const L=a1(()=>{switch(n){case"orders":return{icon:i1,text:r("p",{children:t}),className:"order-empty-list--empty-box"};default:return{icon:"",text:"",className:""}}},[n,t]);return!h||!n||!L.text?null:r(n1,{className:F(["order-empty-list",L.className,c?"order-empty-list--minified":""]),message:L.text,icon:r(x,{source:L.icon}),"data-testid":"emptyList"})},c1={PENDING:"pending",AUTHORIZED:"authorized",PARTIALLY_AUTHORIZED:"partiallyAuthorized",RECEIVED:"received",PARTIALLY_RECEIVED:"partiallyReceived",APPROVED:"approved",PARTIALLY_APPROVED:"partiallyApproved",REJECTED:"rejected",PARTIALLY_REJECTED:"partiallyRejected",DENIED:"denied",PROCESSED_AND_CLOSED:"processedAndClosed",CLOSED:"closed"},d1=n=>typeof n!="string"?"":c1[n]??"",k={size:"32",stroke:"2"},E1=({minifiedViewKey:n,withReturnNumber:h=!1,withOrderNumber:c=!1,slots:t,pageInfo:L,withReturnsListButton:y=!0,isMobile:v=!1,returnsInMinifiedView:J=1,translations:s={},orderReturns:d=[],minifiedView:C=!1,withHeader:Z=!0,withThumbnails:w=!0,selectedPage:H=1,handleSetSelectPage:I,routeReturnDetails:l,routeOrderDetails:u,routeTracking:_,routeReturnsList:E,routeProductDetails:m,loading:N})=>{const S=C?J:d.length,V=m!=null&&m()?"a":"span",g=A(()=>d.slice(0,S).map((e,D)=>{var P,$;return r(B,{variant:"secondary",className:"order-returns-list-content__cards-list",children:a("div",{className:"order-returns-list-content__cards-grid",children:[a("div",{className:"order-returns-list-content__descriptions",children:[r("p",{className:"order-returns-list-content__return-status",children:r(Y,{id:`Order.Returns.${n}.returnsList.resturnStatus.${d1(e.returnStatus)}`})}),h?a("p",{children:[s.returnNumber," ",r("a",{href:(l==null?void 0:l({returnNumber:e.returnNumber,orderNumber:e.orderNumber,token:e.token}))??"#",rel:"noreferrer",children:e.returnNumber})]}):null,c?a("p",{children:[s.orderNumber," ",r("a",{href:(u==null?void 0:u({orderNumber:e.orderNumber,token:e.token}))??"#",rel:"noreferrer",children:e.orderNumber})]}):null,(P=e==null?void 0:e.tracking)==null?void 0:P.map((i,b)=>{var M,f;return a("p",{children:[`${s.carrier} ${(f=(M=i==null?void 0:i.carrier)==null?void 0:M.label)==null?void 0:f.toLocaleUpperCase()}: `,r("a",{href:`${(_==null?void 0:_(i))||"#"}`,target:"_blank",rel:"noreferrer",children:i.trackingNumber})]},`${i.trackingNumber}_${b}`)}),t!=null&&t.ReturnItemsDetails?r(T,{"data-testid":"returnItemsDetails",name:"ReturnItemsDetails",slot:t==null?void 0:t.ReturnItemsDetails,context:{items:e.items}}):e.items.length?a("p",{children:[e.items.length," ",r(Y,{id:`Order.Returns.${n}.returnsList.itemText`,plural:e.items.length,fields:{count:e.items.length}})]}):null]}),w?r(t1,{maxColumns:v?3:9,emptyGridContent:r(p,{}),className:F(["order-returns-list-content__images",["order-returns-list-content__images-3",v]]),children:($=e==null?void 0:e.items)==null?void 0:$.map((i,b)=>{var z,O;const M=i.orderItem,f=(z=M.thumbnail)==null?void 0:z.label,Q=(O=M.thumbnail)==null?void 0:O.url;return r(V,{href:(m==null?void 0:m(i.orderItem))??"#",children:r(L1,{alt:f,src:Q,width:85,height:114})},b+i.uid)})}):null,t!=null&&t.DetailsActionParams?r(T,{className:"order-returns-list-content__actions","data-testid":"detailsActionParams",name:"DetailsActionParams",slot:t==null?void 0:t.DetailsActionParams,context:{returnOrderItem:e}}):r("a",{href:(l==null?void 0:l({returnNumber:e.returnNumber,token:e.token,orderNumber:e.orderNumber}))??"#",className:"order-returns-list-content__actions",children:r(x,{source:G,...k})})]})},D)}),[d,S,s,t,w,v,u,l,_,m,V,c,n,h]),W=A(()=>a(p,{children:[Z?r(j,{title:s.minifiedViewTitle,divider:!1,className:"order-returns__header--minified"}):null,N?r(R,{withCard:!1}):a(p,{children:[g,r(U,{minifiedView:C,typeList:"orders",isEmpty:!d.length,message:s.emptyOrdersListMessage}),y?r("a",{className:"order-returns-list-content__actions",href:(E==null?void 0:E())??"#",children:r(B,{variant:"secondary",className:"order-returns-list-content__card",children:a("div",{className:"order-returns-list-content__card-wrapper",children:[r("p",{children:s.viewAllOrdersButton}),r(x,{source:G,...k})]})})}):null]})]}),[E,y,Z,s,g,C,d.length,N]),q=A(()=>a(p,{children:[Z?r(j,{title:s.minifiedViewTitle,divider:!0,className:"order-returns__header--full-size"}):null,N?r(R,{withCard:!1}):a(p,{children:[r(U,{minifiedView:C,typeList:"orders",isEmpty:!d.length,message:s.emptyOrdersListMessage}),g,(L==null?void 0:L.totalPages)>1?r(s1,{totalPages:L==null?void 0:L.totalPages,currentPage:H,onChange:I}):null]})]}),[g,C,d,s,L,H,I,N,Z]);return r("div",{className:"order-returns-list-content",children:C?W:q})},N1=()=>{const[n,h]=X(window.innerWidth<768),c=K(e1(()=>{h(window.innerWidth<768)},1e3),[]);return r1(()=>(window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c)}),[c]),n};export{E1 as R,N1 as u};
1
+ import{jsx as r,jsxs as a,Fragment as p}from"@dropins/tools/preact-jsx-runtime.js";import{useMemo as A,useState as X,useCallback as K,useEffect as r1}from"@dropins/tools/preact-hooks.js";import{classes as F,Slot as T,debounce as e1}from"@dropins/tools/lib.js";import{IllustratedMessage as n1,Icon as x,Card as B,ContentGrid as t1,Image as L1,Header as j,Pagination as s1}from"@dropins/tools/components.js";import*as o from"@dropins/tools/preact-compat.js";import{useMemo as a1}from"@dropins/tools/preact-compat.js";import"./OrderCancel.js";import{C as R}from"./OrderLoaders.js";import"@dropins/tools/preact.js";import"@dropins/tools/event-bus.js";import{Text as Y}from"@dropins/tools/i18n.js";const G=n=>o.createElement("svg",{id:"Icon_Chevron_right_Base","data-name":"Icon \\u2013 Chevron right \\u2013 Base",xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",...n},o.createElement("g",{id:"Large"},o.createElement("rect",{id:"Placement_area","data-name":"Placement area",width:24,height:24,fill:"#fff",opacity:0}),o.createElement("g",{id:"Chevron_right_icon","data-name":"Chevron right icon"},o.createElement("path",{vectorEffect:"non-scaling-stroke",id:"chevron",d:"M199.75,367.5l4.255,-4.255-4.255,-4.255",transform:"translate(-189.25 -351.0)",fill:"none",stroke:"currentColor"})))),i1=n=>o.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n},o.createElement("path",{d:"M12.002 21L11.8275 21.4686C11.981 21.5257 12.1528 21.5041 12.2873 21.4106C12.4218 21.3172 12.502 21.1638 12.502 21H12.002ZM3.89502 17.9823H3.39502C3.39502 18.1912 3.52485 18.378 3.72059 18.4509L3.89502 17.9823ZM3.89502 8.06421L4.07193 7.59655C3.91831 7.53844 3.74595 7.55948 3.61082 7.65284C3.47568 7.74619 3.39502 7.89997 3.39502 8.06421H3.89502ZM12.0007 21H11.5007C11.5007 21.1638 11.5809 21.3172 11.7154 21.4106C11.8499 21.5041 12.0216 21.5257 12.1751 21.4686L12.0007 21ZM20.1076 17.9823L20.282 18.4509C20.4778 18.378 20.6076 18.1912 20.6076 17.9823H20.1076ZM20.1076 8.06421H20.6076C20.6076 7.89997 20.527 7.74619 20.3918 7.65284C20.2567 7.55948 20.0843 7.53844 19.9307 7.59655L20.1076 8.06421ZM12.0007 11.1311L11.8238 10.6634C11.6293 10.737 11.5007 10.9232 11.5007 11.1311H12.0007ZM20.2858 8.53191C20.5441 8.43421 20.6743 8.14562 20.5766 7.88734C20.4789 7.62906 20.1903 7.49889 19.932 7.5966L20.2858 8.53191ZM12.002 4.94826L12.1775 4.48008C12.0605 4.43623 11.9314 4.43775 11.8154 4.48436L12.002 4.94826ZM5.87955 6.87106C5.62334 6.97407 5.49915 7.26528 5.60217 7.52149C5.70518 7.77769 5.99639 7.90188 6.2526 7.79887L5.87955 6.87106ZM18.1932 7.80315C18.4518 7.90008 18.74 7.76904 18.8369 7.51047C18.9338 7.2519 18.8028 6.96371 18.5442 6.86678L18.1932 7.80315ZM12 4.94827L11.5879 5.23148C11.6812 5.36719 11.8353 5.44827 12 5.44827C12.1647 5.44827 12.3188 5.36719 12.4121 5.23148L12 4.94827ZM14.0263 2L14.2028 1.53218C13.9875 1.45097 13.7446 1.52717 13.6143 1.71679L14.0263 2ZM21.8421 4.94827L22.2673 5.2113C22.3459 5.08422 22.3636 4.92863 22.3154 4.78717C22.2673 4.64571 22.1584 4.53319 22.0186 4.48045L21.8421 4.94827ZM9.97368 2L10.3857 1.71679C10.2554 1.52717 10.0125 1.45097 9.79721 1.53218L9.97368 2ZM2.15789 4.94827L1.98142 4.48045C1.84161 4.53319 1.73271 4.64571 1.68456 4.78717C1.63641 4.92863 1.65406 5.08422 1.73267 5.2113L2.15789 4.94827ZM12 11.1256L11.6702 11.5014C11.8589 11.667 12.1411 11.667 12.3298 11.5014L12 11.1256ZM15.0395 8.45812L14.8732 7.98659C14.8131 8.00779 14.7576 8.04028 14.7097 8.08232L15.0395 8.45812ZM23 5.65024L23.3288 6.0269C23.5095 5.86916 23.5527 5.60532 23.4318 5.39817C23.3109 5.19102 23.0599 5.09893 22.8337 5.17871L23 5.65024ZM8.96053 8.45812L9.29034 8.08232C9.24244 8.04028 9.18695 8.00779 9.12685 7.98659L8.96053 8.45812ZM1 5.65024L1.16632 5.17871C0.940115 5.09893 0.689119 5.19102 0.568192 5.39817C0.447264 5.60532 0.49048 5.86916 0.671176 6.0269L1 5.65024ZM12.1764 20.5314L4.06945 17.5137L3.72059 18.4509L11.8275 21.4686L12.1764 20.5314ZM4.39502 17.9823V8.06421H3.39502V17.9823H4.39502ZM3.71811 8.53187L11.8251 11.5987L12.1789 10.6634L4.07193 7.59655L3.71811 8.53187ZM11.502 11.1311V21H12.502V11.1311H11.502ZM12.1751 21.4686L20.282 18.4509L19.9332 17.5137L11.8262 20.5314L12.1751 21.4686ZM20.6076 17.9823V8.06421H19.6076V17.9823H20.6076ZM19.9307 7.59655L11.8238 10.6634L12.1776 11.5987L20.2845 8.53187L19.9307 7.59655ZM11.5007 11.1311V21H12.5007V11.1311H11.5007ZM19.932 7.5966L11.8251 10.6634L12.1789 11.5987L20.2858 8.53191L19.932 7.5966ZM11.8154 4.48436L5.87955 6.87106L6.2526 7.79887L12.1885 5.41217L11.8154 4.48436ZM11.8265 5.41645L18.1932 7.80315L18.5442 6.86678L12.1775 4.48008L11.8265 5.41645ZM11.502 4.94826V11.1311H12.502V4.94826H11.502ZM12.4121 5.23148L14.4384 2.28321L13.6143 1.71679L11.5879 4.66507L12.4121 5.23148ZM13.8498 2.46782L21.6656 5.4161L22.0186 4.48045L14.2028 1.53218L13.8498 2.46782ZM21.4169 4.68525L20.5485 6.08919L21.3989 6.61524L22.2673 5.2113L21.4169 4.68525ZM12.4121 4.66507L10.3857 1.71679L9.56162 2.28321L11.5879 5.23148L12.4121 4.66507ZM9.79721 1.53218L1.98142 4.48045L2.33437 5.4161L10.1502 2.46782L9.79721 1.53218ZM1.73267 5.2113L2.60109 6.61524L3.45154 6.08919L2.58312 4.68525L1.73267 5.2113ZM12.3298 11.5014L15.3693 8.83392L14.7097 8.08232L11.6702 10.7498L12.3298 11.5014ZM15.2058 8.92965L23.1663 6.12177L22.8337 5.17871L14.8732 7.98659L15.2058 8.92965ZM22.6712 5.27358L19.7764 7.80067L20.4341 8.554L23.3288 6.0269L22.6712 5.27358ZM12.3298 10.7498L9.29034 8.08232L8.63072 8.83392L11.6702 11.5014L12.3298 10.7498ZM9.12685 7.98659L1.16632 5.17871L0.83368 6.12177L8.79421 8.92965L9.12685 7.98659ZM0.671176 6.0269L3.56591 8.554L4.22356 7.80067L1.32882 5.27358L0.671176 6.0269Z",fill:"#D6D6D6"})),U=({typeList:n,isEmpty:h,minifiedView:c,message:t})=>{const L=a1(()=>{switch(n){case"orders":return{icon:i1,text:r("p",{children:t}),className:"order-empty-list--empty-box"};default:return{icon:"",text:"",className:""}}},[n,t]);return!h||!n||!L.text?null:r(n1,{className:F(["order-empty-list",L.className,c?"order-empty-list--minified":""]),message:L.text,icon:r(x,{source:L.icon}),"data-testid":"emptyList"})},c1={PENDING:"pending",AUTHORIZED:"authorized",PARTIALLY_AUTHORIZED:"partiallyAuthorized",RECEIVED:"received",PARTIALLY_RECEIVED:"partiallyReceived",APPROVED:"approved",PARTIALLY_APPROVED:"partiallyApproved",REJECTED:"rejected",PARTIALLY_REJECTED:"partiallyRejected",DENIED:"denied",PROCESSED_AND_CLOSED:"processedAndClosed",CLOSED:"closed"},d1=n=>typeof n!="string"?"":c1[n]??"",k={size:"32",stroke:"2"},E1=({minifiedViewKey:n,withReturnNumber:h=!1,withOrderNumber:c=!1,slots:t,pageInfo:L,withReturnsListButton:y=!0,isMobile:v=!1,returnsInMinifiedView:J=1,translations:s={},orderReturns:d=[],minifiedView:C=!1,withHeader:Z=!0,withThumbnails:w=!0,selectedPage:H=1,handleSetSelectPage:I,routeReturnDetails:l,routeOrderDetails:u,routeTracking:_,routeReturnsList:E,routeProductDetails:m,loading:N})=>{const S=C?J:d.length,V=m!=null&&m()?"a":"span",g=A(()=>d.slice(0,S).map((e,D)=>{var P,$;return r(B,{variant:"secondary",className:"order-returns-list-content__cards-list",children:a("div",{className:"order-returns-list-content__cards-grid",children:[a("div",{className:"order-returns-list-content__descriptions",children:[r("p",{className:"order-returns-list-content__return-status",children:r(Y,{id:`Order.Returns.${n}.returnsList.resturnStatus.${d1(e.returnStatus)}`})}),h?a("p",{children:[s.returnNumber," ",r("a",{href:(l==null?void 0:l({returnNumber:e.returnNumber,orderNumber:e.orderNumber,token:e.token}))??"#",rel:"noreferrer",children:e.returnNumber})]}):null,c?a("p",{children:[s.orderNumber," ",r("a",{href:(u==null?void 0:u({orderNumber:e.orderNumber,token:e.token}))??"#",rel:"noreferrer",children:e.orderNumber})]}):null,(P=e==null?void 0:e.tracking)==null?void 0:P.map((i,b)=>{var M,f;return a("p",{children:[`${s.carrier} ${(f=(M=i==null?void 0:i.carrier)==null?void 0:M.label)==null?void 0:f.toLocaleUpperCase()}: `,r("a",{href:`${(_==null?void 0:_(i))||"#"}`,target:"_blank",rel:"noreferrer",children:i.trackingNumber})]},`${i.trackingNumber}_${b}`)}),t!=null&&t.ReturnItemsDetails?r(T,{"data-testid":"returnItemsDetails",name:"ReturnItemsDetails",slot:t==null?void 0:t.ReturnItemsDetails,context:{items:e.items}}):e.items.length?a("p",{children:[e.items.length," ",r(Y,{id:`Order.Returns.${n}.returnsList.itemText`,plural:e.items.length,fields:{count:e.items.length}})]}):null]}),w?r(t1,{maxColumns:v?3:9,emptyGridContent:r(p,{}),className:F(["order-returns-list-content__images",["order-returns-list-content__images-3",v]]),children:($=e==null?void 0:e.items)==null?void 0:$.map((i,b)=>{var z,O;const M=i.orderItem,f=(z=M.thumbnail)==null?void 0:z.label,Q=(O=M.thumbnail)==null?void 0:O.url;return r(V,{href:(m==null?void 0:m(i.orderItem))??"#",children:r(L1,{alt:f,src:Q,width:85,height:114})},b+i.uid)})}):null,t!=null&&t.DetailsActionParams?r(T,{className:"order-returns-list-content__actions","data-testid":"detailsActionParams",name:"DetailsActionParams",slot:t==null?void 0:t.DetailsActionParams,context:{returnOrderItem:e}}):r("a",{href:(l==null?void 0:l({returnNumber:e.returnNumber,token:e.token,orderNumber:e.orderNumber}))??"#",className:"order-returns-list-content__actions",children:r(x,{source:G,...k})})]})},D)}),[d,S,s,t,w,v,u,l,_,m,V,c,n,h]),W=A(()=>a(p,{children:[Z?r(j,{title:s.minifiedViewTitle,divider:!1,className:"order-returns__header--minified"}):null,N?r(R,{withCard:!1}):a(p,{children:[g,r(U,{minifiedView:C,typeList:"orders",isEmpty:!d.length,message:s.emptyOrdersListMessage}),y?r("a",{className:"order-returns-list-content__actions",href:(E==null?void 0:E())??"#",children:r(B,{variant:"secondary",className:"order-returns-list-content__card",children:a("div",{className:"order-returns-list-content__card-wrapper",children:[r("p",{children:s.viewAllOrdersButton}),r(x,{source:G,...k})]})})}):null]})]}),[E,y,Z,s,g,C,d.length,N]),q=A(()=>a(p,{children:[Z?r(j,{title:s.minifiedViewTitle,divider:!0,className:"order-returns__header--full-size"}):null,N?r(R,{withCard:!1}):a(p,{children:[r(U,{minifiedView:C,typeList:"orders",isEmpty:!d.length,message:s.emptyOrdersListMessage}),g,(L==null?void 0:L.totalPages)>1?r(s1,{totalPages:L==null?void 0:L.totalPages,currentPage:H,onChange:I}):null]})]}),[g,C,d,s,L,H,I,N,Z]);return r("div",{className:"order-returns-list-content",children:C?W:q})},N1=()=>{const[n,h]=X(window.innerWidth<768),c=K(e1(()=>{h(window.innerWidth<768)},1e3),[]);return r1(()=>(window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c)}),[c]),n};export{E1 as R,N1 as u};
@@ -0,0 +1,5 @@
1
+ import { OrderCancelProps } from '../../types';
2
+ import { FunctionComponent } from 'preact';
3
+
4
+ export declare const OrderCancel: FunctionComponent<OrderCancelProps>;
5
+ //# sourceMappingURL=OrderCancel.d.ts.map
@@ -13,7 +13,7 @@ export declare const Shipping: ({ translations, shoppingOrdersDisplayShipping, o
13
13
  shoppingOrdersDisplayShipping: TaxTypes;
14
14
  order: OrderDataModel;
15
15
  translations: translationsTypes;
16
- }) => import("preact").JSX.Element;
16
+ }) => import("preact").JSX.Element | null;
17
17
  export declare const Discounts: ({ translations, order, totalGiftcardValue, totalGiftcardCurrency, }: {
18
18
  totalGiftcardValue: number;
19
19
  totalGiftcardCurrency: string;
@@ -9,5 +9,5 @@ export * from './EmptyList';
9
9
  export * from './ReturnsListContent';
10
10
  export * from './OrderProductListContent';
11
11
  export * from './OrderCostSummaryContent';
12
- export * from './OrderCancelReasonsForm';
12
+ export * from './OrderCancel';
13
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- import{jsx as t,jsxs as d,Fragment as j}from"@dropins/tools/preact-jsx-runtime.js";import{classes as f}from"@dropins/tools/lib.js";import{useMemo as L,useCallback as O,useState as k,useEffect as D}from"@dropins/tools/preact-hooks.js";import{events as S}from"@dropins/tools/event-bus.js";import{c as W}from"../chunks/convertCase.js";import{g as P}from"../chunks/getAttributesForm.js";import{Card as Z,Header as z,Price as B,Icon as $}from"@dropins/tools/components.js";import"../chunks/OrderCancelReasonsForm.js";import*as i from"@dropins/tools/preact-compat.js";import{D as q}from"../chunks/OrderLoaders.js";import"@dropins/tools/preact.js";import{useText as F}from"@dropins/tools/i18n.js";import"../chunks/network-error.js";import"../chunks/fetch-graphql.js";import"@dropins/tools/fetch-graphql.js";const K=a=>i.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...a},i.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.93 14.8V18.75H5.97C4.75 18.75 3.75 17.97 3.75 17V6.5M3.75 6.5C3.75 5.53 4.74 4.75 5.97 4.75H15.94V8.25H5.97C4.75 8.25 3.75 7.47 3.75 6.5Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),i.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19.35 11.64H14.04V14.81H19.35V11.64Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),i.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.9304 11.64V8.25H15.1504",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})),R=a=>i.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...a},i.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M2.00718 5H22.1507C22.7047 5 23.1579 5.45323 23.1579 6.00718V7.51794C23.1579 7.51794 1.01007 7.58844 1 7.55823V6.00718C1 5.45323 1.45323 5 2.00718 5Z",stroke:"currentColor",strokeWidth:1}),i.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M23.1579 9.78409V18.3451C23.1579 18.899 22.7047 19.3523 22.1507 19.3523H2.00718C1.45323 19.3523 1 18.899 1 18.3451V9.78409H23.1579Z",stroke:"currentColor",strokeWidth:1}),i.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M3.01465 15.9682H8.40305",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round"}),i.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.6192 17.5897C18.4535 17.5897 19.1299 16.9133 19.1299 16.0789C19.1299 15.2446 18.4535 14.5682 17.6192 14.5682C16.7848 14.5682 16.1084 15.2446 16.1084 16.0789C16.1084 16.9133 16.7848 17.5897 17.6192 17.5897Z",stroke:"currentColor",strokeWidth:1}),i.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19.8848 17.5897C20.7192 17.5897 21.3956 16.9133 21.3956 16.0789C21.3956 15.2446 20.7192 14.5682 19.8848 14.5682C19.0504 14.5682 18.374 15.2446 18.374 16.0789C18.374 16.9133 19.0504 17.5897 19.8848 17.5897Z",stroke:"currentColor",strokeWidth:1})),G=({loading:a,order:e,withHeader:g=!0,title:c,paymentIconsMap:h={},normalizeAddress:m})=>{var A,M,E,N,T;const n=F({emailTitle:"Order.CustomerDetails.email.title",shippingAddressTitle:"Order.CustomerDetails.shippingAddress.title",shippingMethodsTitle:"Order.CustomerDetails.shippingMethods.title",billingAddressTitle:"Order.CustomerDetails.billingAddress.title",billingMethodsTitle:"Order.CustomerDetails.billingMethods.title",headerText:"Order.CustomerDetails.headerText",freeShipping:"Order.CustomerDetails.freeShipping"}),p=L(()=>({checkmo:K,card:R,...h}),[h]),_=O(H=>{var w;return(w=m[H])==null?void 0:w.map((s,V)=>t("p",{children:s.label?`${s.label}: ${Array.isArray(s.value)?s.value.join(" "):s==null?void 0:s.value}`:Array.isArray(s.value)?s.value.join(" "):s==null?void 0:s.value},V))},[m]);if(!e||a)return t(q,{});const o=(e==null?void 0:e.email)??"",l=(A=e==null?void 0:e.shipping)==null?void 0:A.code,r=(M=e==null?void 0:e.shipping)==null?void 0:M.amount,C=(E=e==null?void 0:e.shipping)==null?void 0:E.currency,u=e==null?void 0:e.payments,v=u&&u.length>0,b=v?(N=u[0])==null?void 0:N.name:"",y=v?(T=u[0])==null?void 0:T.code:"",x=v&&b!=="";return d(Z,{"data-testid":"order-details",variant:"secondary",className:f(["order-customer-details-content"]),children:[g?t(z,{title:c??n.headerText}):null,d("div",{className:"order-customer-details-content__container",children:[d("div",{className:"order-customer-details-content__container-email",children:[t("div",{className:"order-customer-details-content__container-title",children:n.emailTitle}),t("p",{children:o})]}),d("div",{className:"order-customer-details-content__container-shipping_address",children:[t("div",{className:"order-customer-details-content__container-title",children:n.shippingAddressTitle}),t("div",{className:"order-customer-details-content__container-description",children:_("shippingAddress")})]}),d("div",{className:"order-customer-details-content__container-billing_address",children:[t("div",{className:"order-customer-details-content__container-title",children:n.billingAddressTitle}),t("div",{className:"order-customer-details-content__container-description",children:_("billingAddress")})]}),d("div",{className:"order-customer-details-content__container-shipping_methods",children:[t("div",{className:"order-customer-details-content__container-title",children:n.shippingMethodsTitle}),l?t(j,{children:r?d("p",{"data-testid":"shipping_methods_price",children:[t(B,{amount:r,currency:C})," ",l]}):t("p",{"data-testid":"shipping_methods_placeholder",children:n.freeShipping})}):null]}),d("div",{className:"order-customer-details-content__container-payment_methods",children:[t("div",{className:"order-customer-details-content__container-title",children:n.billingMethodsTitle}),x&&d("p",{"data-testid":"billing_methods_description",className:f([["order-customer-details-content__container-payment_methods--icon",!!p[y]]]),children:[t($,{source:p[y]}),b]})]})]})]})},I=["firstname","lastname","city","company","country_code","region","region_code","region_id","telephone","id","vat_id","postcode","street","street_2","default_shipping","default_billing"],J=({orderData:a})=>{const[e,g]=k(!0),[c,h]=k(a),[m,n]=k([]);D(()=>{const o=S.on("order/data",l=>{h(l)},{eager:!0});return()=>{o==null||o.off()}},[]),D(()=>{P("shortRequest").then(o=>{if(o){const l=o.map(({name:r,orderNumber:C,label:u})=>({name:W(r),orderNumber:C,label:I.includes(r)?null:u}));n(l)}}).finally(()=>{g(!1)})},[]);const p=O(o=>{if(!m.length||!c||!c[o])return[];const l=Object.fromEntries(Object.entries(c[o]).map(([r,C])=>[r.toLowerCase(),C]));return m.filter(({name:r})=>l[r.toLowerCase()]).map(r=>({name:r.name,orderNumber:r.orderNumber,value:l[r.name.toLowerCase()],label:r.label}))},[m,c]),_=L(()=>({billingAddress:p("billingAddress"),shippingAddress:p("shippingAddress")}),[p]);return{order:c,normalizeAddress:_,loading:e}},de=({paymentIconsMap:a,orderData:e,title:g,className:c})=>{const{order:h,normalizeAddress:m,loading:n}=J({orderData:e});return t("div",{className:f(["order-customer-details",c]),children:t(G,{loading:n,order:h,title:g,paymentIconsMap:a,normalizeAddress:m})})};export{de as CustomerDetails,de as default};
1
+ import{jsx as t,jsxs as d}from"@dropins/tools/preact-jsx-runtime.js";import{classes as g}from"@dropins/tools/lib.js";import{useMemo as x,useCallback as H,useState as A,useEffect as O}from"@dropins/tools/preact-hooks.js";import{events as W}from"@dropins/tools/event-bus.js";import{c as P}from"../chunks/convertCase.js";import{g as Z}from"../chunks/getAttributesForm.js";import{Card as z,Header as B,Price as $,Icon as q}from"@dropins/tools/components.js";import"../chunks/OrderCancel.js";import*as a from"@dropins/tools/preact-compat.js";import{D as K}from"../chunks/OrderLoaders.js";import"@dropins/tools/preact.js";import{useText as R}from"@dropins/tools/i18n.js";import"../chunks/network-error.js";import"../chunks/fetch-graphql.js";import"@dropins/tools/fetch-graphql.js";const F=l=>a.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...l},a.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.93 14.8V18.75H5.97C4.75 18.75 3.75 17.97 3.75 17V6.5M3.75 6.5C3.75 5.53 4.74 4.75 5.97 4.75H15.94V8.25H5.97C4.75 8.25 3.75 7.47 3.75 6.5Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),a.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19.35 11.64H14.04V14.81H19.35V11.64Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),a.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.9304 11.64V8.25H15.1504",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})),G=l=>a.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...l},a.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M2.00718 5H22.1507C22.7047 5 23.1579 5.45323 23.1579 6.00718V7.51794C23.1579 7.51794 1.01007 7.58844 1 7.55823V6.00718C1 5.45323 1.45323 5 2.00718 5Z",stroke:"currentColor",strokeWidth:1}),a.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M23.1579 9.78409V18.3451C23.1579 18.899 22.7047 19.3523 22.1507 19.3523H2.00718C1.45323 19.3523 1 18.899 1 18.3451V9.78409H23.1579Z",stroke:"currentColor",strokeWidth:1}),a.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M3.01465 15.9682H8.40305",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round"}),a.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.6192 17.5897C18.4535 17.5897 19.1299 16.9133 19.1299 16.0789C19.1299 15.2446 18.4535 14.5682 17.6192 14.5682C16.7848 14.5682 16.1084 15.2446 16.1084 16.0789C16.1084 16.9133 16.7848 17.5897 17.6192 17.5897Z",stroke:"currentColor",strokeWidth:1}),a.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19.8848 17.5897C20.7192 17.5897 21.3956 16.9133 21.3956 16.0789C21.3956 15.2446 20.7192 14.5682 19.8848 14.5682C19.0504 14.5682 18.374 15.2446 18.374 16.0789C18.374 16.9133 19.0504 17.5897 19.8848 17.5897Z",stroke:"currentColor",strokeWidth:1})),I=({loading:l,order:e,withHeader:_=!0,title:c,paymentIconsMap:h={},normalizeAddress:m})=>{var E,N,w,T,D;const n=R({emailTitle:"Order.CustomerDetails.email.title",shippingAddressTitle:"Order.CustomerDetails.shippingAddress.title",shippingMethodsTitle:"Order.CustomerDetails.shippingMethods.title",billingAddressTitle:"Order.CustomerDetails.billingAddress.title",billingMethodsTitle:"Order.CustomerDetails.billingMethods.title",headerText:"Order.CustomerDetails.headerText",freeShipping:"Order.CustomerDetails.freeShipping"}),p=x(()=>({checkmo:F,card:G,...h}),[h]),v=H(j=>{var L;return(L=m[j])==null?void 0:L.map((r,S)=>t("p",{children:r.label?`${r.label}: ${Array.isArray(r.value)?r.value.join(" "):r==null?void 0:r.value}`:Array.isArray(r.value)?r.value.join(" "):r==null?void 0:r.value},S))},[m]);if(!e||l)return t(K,{});const o=(e==null?void 0:e.email)??"",i=(E=e==null?void 0:e.shipping)==null?void 0:E.code,s=(N=e==null?void 0:e.shipping)==null?void 0:N.amount,C=(w=e==null?void 0:e.shipping)==null?void 0:w.currency,u=e==null?void 0:e.payments,f=u&&u.length>0,y=f?(T=u[0])==null?void 0:T.name:"",M=f?(D=u[0])==null?void 0:D.code:"",V=f&&y!=="",k=v("shippingAddress")??[],b=v("billingAddress")??[];return d(z,{"data-testid":"order-details",variant:"secondary",className:g(["order-customer-details-content"]),children:[_?t(B,{title:c??n.headerText}):null,d("div",{className:g(["order-customer-details-content__container",["order-customer-details-content__container--no-margin",k.length||b.length]]),children:[d("div",{className:"order-customer-details-content__container-email",children:[t("div",{className:"order-customer-details-content__container-title",children:n.emailTitle}),t("p",{children:o})]}),k.length?d("div",{className:"order-customer-details-content__container-shipping_address",children:[t("div",{className:"order-customer-details-content__container-title",children:n.shippingAddressTitle}),t("div",{className:"order-customer-details-content__container-description",children:k})]}):null,b.length?d("div",{className:g(["order-customer-details-content__container-billing_address",["order-customer-details-content__container-billing_address--fullwidth",!k.length]]),children:[t("div",{className:"order-customer-details-content__container-title",children:n.billingAddressTitle}),t("div",{className:"order-customer-details-content__container-description",children:b})]}):null,i?d("div",{className:"order-customer-details-content__container-shipping_methods",children:[t("div",{className:"order-customer-details-content__container-title",children:n.shippingMethodsTitle}),s?d("p",{"data-testid":"shipping_methods_price",children:[t($,{amount:s,currency:C})," ",i]}):t("p",{"data-testid":"shipping_methods_placeholder",children:n.freeShipping})]}):null,V?d("div",{className:g(["order-customer-details-content__container-payment_methods",["order-customer-details-content__container-payment_methods--fullwidth",!i]]),children:[t("div",{className:"order-customer-details-content__container-title",children:n.billingMethodsTitle}),d("p",{"data-testid":"billing_methods_description",className:g([["order-customer-details-content__container-payment_methods--icon",!!p[M]]]),children:[t(q,{source:p[M]}),y]})]}):null]})]})},J=["firstname","lastname","city","company","country_code","region","region_code","region_id","telephone","id","vat_id","postcode","street","street_2","default_shipping","default_billing"],Q=({orderData:l})=>{const[e,_]=A(!0),[c,h]=A(l),[m,n]=A([]);O(()=>{const o=W.on("order/data",i=>{h(i)},{eager:!0});return()=>{o==null||o.off()}},[]),O(()=>{Z("shortRequest").then(o=>{if(o){const i=o.map(({name:s,orderNumber:C,label:u})=>({name:P(s),orderNumber:C,label:J.includes(s)?null:u}));n(i)}}).finally(()=>{_(!1)})},[]);const p=H(o=>{if(!m.length||!c||!c[o])return[];const i=Object.fromEntries(Object.entries(c[o]).map(([s,C])=>[s.toLowerCase(),C]));return m.filter(({name:s})=>i[s.toLowerCase()]).map(s=>({name:s.name,orderNumber:s.orderNumber,value:i[s.name.toLowerCase()],label:s.label}))},[m,c]),v=x(()=>({billingAddress:p("billingAddress"),shippingAddress:p("shippingAddress")}),[p]);return{order:c,normalizeAddress:v,loading:e}},me=({paymentIconsMap:l,orderData:e,title:_,className:c})=>{const{order:h,normalizeAddress:m,loading:n}=Q({orderData:e});return t("div",{className:g(["order-customer-details",c]),children:t(I,{loading:n,order:h,title:_,paymentIconsMap:l,normalizeAddress:m})})};export{me as CustomerDetails,me as default};
@@ -0,0 +1,5 @@
1
+ import { OrderCancelFormProps } from '../../types';
2
+ import { Container } from '@dropins/tools/types/elsie/src/lib';
3
+
4
+ export declare const OrderCancelForm: Container<OrderCancelFormProps>;
5
+ //# sourceMappingURL=OrderCancelForm.d.ts.map
@@ -0,0 +1,3 @@
1
+ export * from './OrderCancelForm';
2
+ export { OrderCancelForm as default } from './OrderCancelForm';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,3 @@
1
+ export * from './OrderCancelForm/index'
2
+ import _default from './OrderCancelForm/index'
3
+ export default _default
@@ -0,0 +1 @@
1
+ import{O as C,O as F}from"../chunks/OrderCancelForm.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/components.js";import"../chunks/OrderCancel.js";import"@dropins/tools/preact-hooks.js";import"@dropins/tools/i18n.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/lib.js";import"@dropins/tools/preact.js";import"@dropins/tools/event-bus.js";import"../chunks/requestGuestOrderCancel.js";import"../chunks/transform-order-details.js";import"../chunks/convertCase.js";import"../chunks/getGuestOrder.graphql.js";import"../chunks/fetch-graphql.js";import"@dropins/tools/fetch-graphql.js";export{C as OrderCancelForm,F as default};
@@ -1 +1 @@
1
- import{jsxs as i,jsx as c,Fragment as v}from"@dropins/tools/preact-jsx-runtime.js";import{classes as H}from"@dropins/tools/lib.js";import{useState as _,useEffect as T}from"@dropins/tools/preact-hooks.js";import{events as V}from"@dropins/tools/event-bus.js";import{s as C}from"../chunks/setTaxStatus.js";import{g as N}from"../chunks/getStoreConfig.js";import{Price as d,Icon as b,Accordion as f,AccordionSection as E,Card as D,Header as k}from"@dropins/tools/components.js";import"../chunks/OrderCancelReasonsForm.js";import*as y from"@dropins/tools/preact-compat.js";import"@dropins/tools/preact.js";import{a as z}from"../chunks/OrderLoaders.js";import{useText as B}from"@dropins/tools/i18n.js";import"../chunks/fetch-graphql.js";import"@dropins/tools/fetch-graphql.js";const A=e=>y.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},y.createElement("path",{d:"M7.74512 9.87701L12.0001 14.132L16.2551 9.87701",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"square",strokeLinejoin:"round"})),I=e=>y.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},y.createElement("path",{d:"M7.74512 14.132L12.0001 9.87701L16.2551 14.132",stroke:"#2B2B2B",strokeWidth:1.5,strokeLinecap:"square",strokeLinejoin:"round"})),j=e=>y.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},y.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M22 6.25H22.75C22.75 5.83579 22.4142 5.5 22 5.5V6.25ZM22 9.27L22.2514 9.97663C22.5503 9.87029 22.75 9.58731 22.75 9.27H22ZM20.26 12.92L19.5534 13.1714L19.5539 13.1728L20.26 12.92ZM22 14.66H22.75C22.75 14.3433 22.551 14.0607 22.2528 13.9539L22 14.66ZM22 17.68V18.43C22.4142 18.43 22.75 18.0942 22.75 17.68H22ZM2 17.68H1.25C1.25 18.0942 1.58579 18.43 2 18.43V17.68ZM2 14.66L1.74865 13.9534C1.44969 14.0597 1.25 14.3427 1.25 14.66H2ZM3.74 11.01L4.44663 10.7586L4.44611 10.7572L3.74 11.01ZM2 9.27H1.25C1.25 9.58675 1.44899 9.86934 1.7472 9.97611L2 9.27ZM2 6.25V5.5C1.58579 5.5 1.25 5.83579 1.25 6.25H2ZM21.25 6.25V9.27H22.75V6.25H21.25ZM21.7486 8.56337C19.8706 9.23141 18.8838 11.2889 19.5534 13.1714L20.9666 12.6686C20.5762 11.5711 21.1494 10.3686 22.2514 9.97663L21.7486 8.56337ZM19.5539 13.1728C19.9195 14.1941 20.7259 15.0005 21.7472 15.3661L22.2528 13.9539C21.6541 13.7395 21.1805 13.2659 20.9661 12.6672L19.5539 13.1728ZM21.25 14.66V17.68H22.75V14.66H21.25ZM22 16.93H2V18.43H22V16.93ZM2.75 17.68V14.66H1.25V17.68H2.75ZM2.25135 15.3666C4.12941 14.6986 5.11623 12.6411 4.44663 10.7586L3.03337 11.2614C3.42377 12.3589 2.85059 13.5614 1.74865 13.9534L2.25135 15.3666ZM4.44611 10.7572C4.08045 9.73588 3.27412 8.92955 2.2528 8.56389L1.7472 9.97611C2.34588 10.1905 2.81955 10.6641 3.03389 11.2628L4.44611 10.7572ZM2.75 9.27V6.25H1.25V9.27H2.75ZM2 7H22V5.5H2V7ZM7.31 6.74V18.17H8.81V6.74H7.31ZM17.0997 8.39967L11.0397 14.4597L12.1003 15.5203L18.1603 9.46033L17.0997 8.39967ZM12.57 9.67C12.57 9.87231 12.4159 10 12.27 10V11.5C13.2839 11.5 14.07 10.6606 14.07 9.67H12.57ZM12.27 10C12.1241 10 11.97 9.87231 11.97 9.67H10.47C10.47 10.6606 11.2561 11.5 12.27 11.5V10ZM11.97 9.67C11.97 9.46769 12.1241 9.34 12.27 9.34V7.84C11.2561 7.84 10.47 8.67938 10.47 9.67H11.97ZM12.27 9.34C12.4159 9.34 12.57 9.46769 12.57 9.67H14.07C14.07 8.67938 13.2839 7.84 12.27 7.84V9.34ZM17.22 14.32C17.22 14.5223 17.0659 14.65 16.92 14.65V16.15C17.9339 16.15 18.72 15.3106 18.72 14.32H17.22ZM16.92 14.65C16.7741 14.65 16.62 14.5223 16.62 14.32H15.12C15.12 15.3106 15.9061 16.15 16.92 16.15V14.65ZM16.62 14.32C16.62 14.1177 16.7741 13.99 16.92 13.99V12.49C15.9061 12.49 15.12 13.3294 15.12 14.32H16.62ZM16.92 13.99C17.0659 13.99 17.22 14.1177 17.22 14.32H18.72C18.72 13.3294 17.9339 12.49 16.92 12.49V13.99Z",fill:"#3D3D3D"})),P=({translations:e,order:a,subTotalValue:t,shoppingOrdersDisplaySubtotal:n})=>{var l,r;return i("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--subtotal",children:[i("div",{className:"order-cost-summary-content__description--header",children:[c("span",{children:e.subtotal}),c(d,{className:"order-cost-summary-content__description--normal-price",weight:"normal",currency:(l=a==null?void 0:a.subtotal)==null?void 0:l.currency,amount:t})]}),i("div",{className:"order-cost-summary-content__description--subheader",children:[!n.taxExcluded&&n.taxIncluded?c("span",{children:e.incl}):null,n.taxExcluded&&n.taxIncluded?i(v,{children:[c(d,{currency:(r=a==null?void 0:a.subtotal)==null?void 0:r.currency,amount:t,size:"small"})," ",c("span",{children:e.excl})]}):null]})]})},W=({translations:e,shoppingOrdersDisplayShipping:a,order:t,totalShipping:n})=>{var l,r,o,s;return i("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--shipping",children:[i("div",{className:"order-cost-summary-content__description--header",children:[c("span",{children:e.shipping}),(l=t==null?void 0:t.totalShipping)!=null&&l.value?c(d,{weight:"normal",currency:(r=t==null?void 0:t.totalShipping)==null?void 0:r.currency,amount:n}):c("span",{children:e.freeShipping})]}),i("div",{className:"order-cost-summary-content__description--subheader",children:[a.taxIncluded&&a.taxExcluded?i(v,{children:[c(d,{weight:"normal",currency:(o=t==null?void 0:t.totalShipping)==null?void 0:o.currency,amount:(s=t==null?void 0:t.totalShipping)==null?void 0:s.value,size:"small"}),i("span",{children:[" ",e.excl]})]}):null,a.taxIncluded&&!a.taxExcluded?c("span",{children:e.incl}):null]})]})},q=({translations:e,order:a,totalGiftcardValue:t,totalGiftcardCurrency:n})=>{var l,r,o;return!((l=a==null?void 0:a.discounts)!=null&&l.length)&&!t?null:i("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--discount",children:[i("div",{className:"order-cost-summary-content__description--header",children:[c("span",{children:e.discount}),c("span",{children:(r=a==null?void 0:a.discounts)!=null&&r.length?(o=a==null?void 0:a.discounts)==null?void 0:o.map(({amount:s},m)=>{const u=(s==null?void 0:s.value)??0;return c(d,{weight:"normal",sale:!0,currency:s==null?void 0:s.currency,amount:-(u+t)},m)}):null})]}),!(a!=null&&a.discounts.length)&&t?i("div",{className:"order-cost-summary-content__description--subheader",children:[i("span",{children:[c(b,{source:j,size:"16"}),c("span",{children:e.discountSubtitle.toLocaleUpperCase()})]}),c(d,{weight:"normal",sale:!0,currency:n,amount:-t})]}):null]})},F=({order:e})=>{var a;return c("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--coupon",children:(a=e==null?void 0:e.coupons)==null?void 0:a.map((t,n)=>i("div",{className:"order-cost-summary-content__description--header",children:[c("span",{children:t.code}),c("span",{children:"TBD"})]},n))})},U=({translations:e,renderTaxAccordion:a,totalAccordionTaxValue:t,order:n})=>{var o,s,m;const[l,r]=_(!1);return a?c(f,{"data-testid":"tax-accordionTaxes",className:"order-cost-summary-content__accordion",iconOpen:A,iconClose:I,children:i(E,{onStateChange:r,title:e.accordionTitle,secondaryText:c(v,{children:l?null:c(d,{weight:"normal",amount:t,currency:(s=n==null?void 0:n.totalTax)==null?void 0:s.currency})}),renderContentWhenClosed:!1,children:[(m=n==null?void 0:n.taxes)==null?void 0:m.map((u,x)=>{var p,h;return i("div",{className:"order-cost-summary-content__accordion-row",children:[c("p",{children:u==null?void 0:u.title}),c("p",{children:c(d,{weight:"normal",amount:(p=u==null?void 0:u.amount)==null?void 0:p.value,currency:(h=u==null?void 0:u.amount)==null?void 0:h.currency})})]},x)}),i("div",{className:"order-cost-summary-content__accordion-row order-cost-summary-content__accordion-total",children:[c("p",{children:e.accordionTotalTax}),c("p",{children:c(d,{weight:"normal",amount:t,currency:n.totalTax.currency,size:"medium"})})]})]})}):c("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--tax",children:i("div",{className:"order-cost-summary-content__description--header",children:[c("span",{children:e.tax}),c(d,{currency:(o=n==null?void 0:n.totalTax)==null?void 0:o.currency,amount:n==null?void 0:n.totalTax.value,weight:"normal",size:"small"})]})})},G=({translations:e,shoppingOrdersDisplaySubtotal:a,order:t})=>{var n,l,r,o;return i("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--total",children:[i("div",{className:"order-cost-summary-content__description--header",children:[c("span",{children:e.total}),c(d,{currency:(n=t==null?void 0:t.grandTotal)==null?void 0:n.currency,amount:(l=t==null?void 0:t.grandTotal)==null?void 0:l.value,weight:"bold",size:"medium"})]}),a.taxExcluded&&a.taxIncluded?i("div",{className:"order-cost-summary-content__description--subheader",children:[c("span",{children:e.totalExcludingTaxes}),c(d,{currency:(r=t==null?void 0:t.grandTotal)==null?void 0:r.currency,amount:((o=t==null?void 0:t.grandTotal)==null?void 0:o.value)-(t==null?void 0:t.totalTax.value),weight:"normal",size:"small"})]}):null]})},R=({translations:e,loading:a,storeConfig:t,order:n,withHeader:l=!0})=>{var p,h,S,O,w,L;if(a||!n)return c(z,{});const r=((p=n==null?void 0:n.totalGiftcard)==null?void 0:p.value)??0,o=((h=n.totalGiftcard)==null?void 0:h.currency)??"",s=((S=n.subtotal)==null?void 0:S.value)??0,m=((O=n.totalShipping)==null?void 0:O.value)??0,u=!!((w=n==null?void 0:n.taxes)!=null&&w.length)&&(t==null?void 0:t.shoppingOrdersDisplayFullSummary),x=u?(L=n==null?void 0:n.taxes)==null?void 0:L.reduce((Z,g)=>{var M;return+((M=g==null?void 0:g.amount)==null?void 0:M.value)+Z},0):0;return i(D,{variant:"secondary",className:H(["order-cost-summary-content"]),children:[l?c(k,{title:e.headerText}):null,i("div",{className:"order-cost-summary-content__wrapper",children:[c(P,{translations:e,order:n,subTotalValue:s,shoppingOrdersDisplaySubtotal:t==null?void 0:t.shoppingOrdersDisplaySubtotal}),c(W,{translations:e,order:n,totalShipping:m,shoppingOrdersDisplayShipping:t==null?void 0:t.shoppingOrdersDisplayShipping}),c(q,{translations:e,order:n,totalGiftcardValue:r,totalGiftcardCurrency:o}),c(F,{order:n}),c(U,{order:n,translations:e,renderTaxAccordion:u,totalAccordionTaxValue:x}),c(G,{translations:e,shoppingOrdersDisplaySubtotal:t==null?void 0:t.shoppingOrdersDisplaySubtotal,order:n})]})]})},J=({orderData:e})=>{const[a,t]=_(!0),[n,l]=_(e),[r,o]=_(null);return T(()=>{N().then(s=>{if(s){const{shoppingCartDisplayPrice:m,shoppingOrdersDisplayShipping:u,shoppingOrdersDisplaySubtotal:x,...p}=s;o(h=>({...h,...p,shoppingCartDisplayPrice:C(m),shoppingOrdersDisplayShipping:C(u),shoppingOrdersDisplaySubtotal:C(x)}))}}).finally(()=>{t(!1)})},[]),T(()=>{const s=V.on("order/data",m=>{l(m)},{eager:!0});return()=>{s==null||s.off()}},[]),{loading:a,storeConfig:r,order:n}},rt=({withHeader:e,orderData:a,children:t,className:n,...l})=>{const{loading:r,storeConfig:o,order:s}=J({orderData:a}),m=B({headerText:"Order.OrderCostSummary.headerText",subtotal:"Order.OrderCostSummary.subtotal.title",shipping:"Order.OrderCostSummary.shipping.title",freeShipping:"Order.OrderCostSummary.shipping.freeShipping",tax:"Order.OrderCostSummary.tax.title",incl:"Order.OrderCostSummary.tax.incl",excl:"Order.OrderCostSummary.tax.excl",discount:"Order.OrderCostSummary.discount.title",discountSubtitle:"Order.OrderCostSummary.discount.subtitle",total:"Order.OrderCostSummary.total.title",accordionTitle:"Order.OrderCostSummary.tax.accordionTitle",accordionTotalTax:"Order.OrderCostSummary.tax.accordionTotalTax",totalExcludingTaxes:"Order.OrderCostSummary.tax.totalExcludingTaxes"});return c("div",{...l,className:H(["order-cost-summary",n]),children:c(R,{order:s,withHeader:e,loading:r,storeConfig:o,translations:m})})};export{rt as OrderCostSummary,rt as default};
1
+ import{jsxs as s,jsx as c,Fragment as S}from"@dropins/tools/preact-jsx-runtime.js";import{classes as H}from"@dropins/tools/lib.js";import{useState as g,useEffect as T}from"@dropins/tools/preact-hooks.js";import{events as V}from"@dropins/tools/event-bus.js";import{s as C}from"../chunks/setTaxStatus.js";import{g as N}from"../chunks/getStoreConfig.js";import{Price as d,Icon as f,Accordion as b,AccordionSection as E,Card as D,Header as k}from"@dropins/tools/components.js";import"../chunks/OrderCancel.js";import*as x from"@dropins/tools/preact-compat.js";import"@dropins/tools/preact.js";import{a as z}from"../chunks/OrderLoaders.js";import{useText as B}from"@dropins/tools/i18n.js";import"../chunks/fetch-graphql.js";import"@dropins/tools/fetch-graphql.js";const I=a=>x.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...a},x.createElement("path",{d:"M7.74512 9.87701L12.0001 14.132L16.2551 9.87701",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"square",strokeLinejoin:"round"})),A=a=>x.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...a},x.createElement("path",{d:"M7.74512 14.132L12.0001 9.87701L16.2551 14.132",stroke:"#2B2B2B",strokeWidth:1.5,strokeLinecap:"square",strokeLinejoin:"round"})),j=a=>x.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...a},x.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M22 6.25H22.75C22.75 5.83579 22.4142 5.5 22 5.5V6.25ZM22 9.27L22.2514 9.97663C22.5503 9.87029 22.75 9.58731 22.75 9.27H22ZM20.26 12.92L19.5534 13.1714L19.5539 13.1728L20.26 12.92ZM22 14.66H22.75C22.75 14.3433 22.551 14.0607 22.2528 13.9539L22 14.66ZM22 17.68V18.43C22.4142 18.43 22.75 18.0942 22.75 17.68H22ZM2 17.68H1.25C1.25 18.0942 1.58579 18.43 2 18.43V17.68ZM2 14.66L1.74865 13.9534C1.44969 14.0597 1.25 14.3427 1.25 14.66H2ZM3.74 11.01L4.44663 10.7586L4.44611 10.7572L3.74 11.01ZM2 9.27H1.25C1.25 9.58675 1.44899 9.86934 1.7472 9.97611L2 9.27ZM2 6.25V5.5C1.58579 5.5 1.25 5.83579 1.25 6.25H2ZM21.25 6.25V9.27H22.75V6.25H21.25ZM21.7486 8.56337C19.8706 9.23141 18.8838 11.2889 19.5534 13.1714L20.9666 12.6686C20.5762 11.5711 21.1494 10.3686 22.2514 9.97663L21.7486 8.56337ZM19.5539 13.1728C19.9195 14.1941 20.7259 15.0005 21.7472 15.3661L22.2528 13.9539C21.6541 13.7395 21.1805 13.2659 20.9661 12.6672L19.5539 13.1728ZM21.25 14.66V17.68H22.75V14.66H21.25ZM22 16.93H2V18.43H22V16.93ZM2.75 17.68V14.66H1.25V17.68H2.75ZM2.25135 15.3666C4.12941 14.6986 5.11623 12.6411 4.44663 10.7586L3.03337 11.2614C3.42377 12.3589 2.85059 13.5614 1.74865 13.9534L2.25135 15.3666ZM4.44611 10.7572C4.08045 9.73588 3.27412 8.92955 2.2528 8.56389L1.7472 9.97611C2.34588 10.1905 2.81955 10.6641 3.03389 11.2628L4.44611 10.7572ZM2.75 9.27V6.25H1.25V9.27H2.75ZM2 7H22V5.5H2V7ZM7.31 6.74V18.17H8.81V6.74H7.31ZM17.0997 8.39967L11.0397 14.4597L12.1003 15.5203L18.1603 9.46033L17.0997 8.39967ZM12.57 9.67C12.57 9.87231 12.4159 10 12.27 10V11.5C13.2839 11.5 14.07 10.6606 14.07 9.67H12.57ZM12.27 10C12.1241 10 11.97 9.87231 11.97 9.67H10.47C10.47 10.6606 11.2561 11.5 12.27 11.5V10ZM11.97 9.67C11.97 9.46769 12.1241 9.34 12.27 9.34V7.84C11.2561 7.84 10.47 8.67938 10.47 9.67H11.97ZM12.27 9.34C12.4159 9.34 12.57 9.46769 12.57 9.67H14.07C14.07 8.67938 13.2839 7.84 12.27 7.84V9.34ZM17.22 14.32C17.22 14.5223 17.0659 14.65 16.92 14.65V16.15C17.9339 16.15 18.72 15.3106 18.72 14.32H17.22ZM16.92 14.65C16.7741 14.65 16.62 14.5223 16.62 14.32H15.12C15.12 15.3106 15.9061 16.15 16.92 16.15V14.65ZM16.62 14.32C16.62 14.1177 16.7741 13.99 16.92 13.99V12.49C15.9061 12.49 15.12 13.3294 15.12 14.32H16.62ZM16.92 13.99C17.0659 13.99 17.22 14.1177 17.22 14.32H18.72C18.72 13.3294 17.9339 12.49 16.92 12.49V13.99Z",fill:"#3D3D3D"})),P=({translations:a,order:e,subTotalValue:t,shoppingOrdersDisplaySubtotal:n})=>{var i,l;return s("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--subtotal",children:[s("div",{className:"order-cost-summary-content__description--header",children:[c("span",{children:a.subtotal}),c(d,{className:"order-cost-summary-content__description--normal-price",weight:"normal",currency:(i=e==null?void 0:e.subtotal)==null?void 0:i.currency,amount:t})]}),s("div",{className:"order-cost-summary-content__description--subheader",children:[!n.taxExcluded&&n.taxIncluded?c("span",{children:a.incl}):null,n.taxExcluded&&n.taxIncluded?s(S,{children:[c(d,{currency:(l=e==null?void 0:e.subtotal)==null?void 0:l.currency,amount:t,size:"small"})," ",c("span",{children:a.excl})]}):null]})]})},W=({translations:a,shoppingOrdersDisplayShipping:e,order:t,totalShipping:n})=>{var i,l,o,u;return t!=null&&t.isVirtual?null:s("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--shipping",children:[s("div",{className:"order-cost-summary-content__description--header",children:[c("span",{children:a.shipping}),(i=t==null?void 0:t.totalShipping)!=null&&i.value?c(d,{weight:"normal",currency:(l=t==null?void 0:t.totalShipping)==null?void 0:l.currency,amount:n}):c("span",{children:a.freeShipping})]}),s("div",{className:"order-cost-summary-content__description--subheader",children:[e.taxIncluded&&e.taxExcluded?s(S,{children:[c(d,{weight:"normal",currency:(o=t==null?void 0:t.totalShipping)==null?void 0:o.currency,amount:(u=t==null?void 0:t.totalShipping)==null?void 0:u.value,size:"small"}),s("span",{children:[" ",a.excl]})]}):null,e.taxIncluded&&!e.taxExcluded?c("span",{children:a.incl}):null]})]})},q=({translations:a,order:e,totalGiftcardValue:t,totalGiftcardCurrency:n})=>{var l,o,u,p,r;const i=(l=e==null?void 0:e.discounts)==null?void 0:l.every(m=>m.amount.value===0);return!((o=e==null?void 0:e.discounts)!=null&&o.length)&&(i||!t||t<1)||(u=e==null?void 0:e.discounts)!=null&&u.length&&i?null:s("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--discount",children:[s("div",{className:"order-cost-summary-content__description--header",children:[c("span",{children:a.discount}),c("span",{children:(p=e==null?void 0:e.discounts)!=null&&p.length?(r=e==null?void 0:e.discounts)==null?void 0:r.map(({amount:m},h)=>{const _=((m==null?void 0:m.value)??0)+t;return _===0?null:c(d,{weight:"normal",sale:!0,currency:m==null?void 0:m.currency,amount:-_},h)}):null})]}),t>0?s("div",{className:"order-cost-summary-content__description--subheader",children:[s("span",{children:[c(f,{source:j,size:"16"}),c("span",{children:a.discountSubtitle.toLocaleUpperCase()})]}),c(d,{weight:"normal",sale:!0,currency:n,amount:-t})]}):null]})},F=({order:a})=>{var e;return c("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--coupon",children:(e=a==null?void 0:a.coupons)==null?void 0:e.map((t,n)=>s("div",{className:"order-cost-summary-content__description--header",children:[c("span",{children:t.code}),c("span",{children:"TBD"})]},n))})},U=({translations:a,renderTaxAccordion:e,totalAccordionTaxValue:t,order:n})=>{var o,u,p;const[i,l]=g(!1);return e?c(b,{"data-testid":"tax-accordionTaxes",className:"order-cost-summary-content__accordion",iconOpen:I,iconClose:A,children:s(E,{onStateChange:l,title:a.accordionTitle,secondaryText:c(S,{children:i?null:c(d,{weight:"normal",amount:t,currency:(u=n==null?void 0:n.totalTax)==null?void 0:u.currency})}),renderContentWhenClosed:!1,children:[(p=n==null?void 0:n.taxes)==null?void 0:p.map((r,m)=>{var h,y;return s("div",{className:"order-cost-summary-content__accordion-row",children:[c("p",{children:r==null?void 0:r.title}),c("p",{children:c(d,{weight:"normal",amount:(h=r==null?void 0:r.amount)==null?void 0:h.value,currency:(y=r==null?void 0:r.amount)==null?void 0:y.currency})})]},m)}),s("div",{className:"order-cost-summary-content__accordion-row order-cost-summary-content__accordion-total",children:[c("p",{children:a.accordionTotalTax}),c("p",{children:c(d,{weight:"normal",amount:t,currency:n.totalTax.currency,size:"medium"})})]})]})}):c("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--tax",children:s("div",{className:"order-cost-summary-content__description--header",children:[c("span",{children:a.tax}),c(d,{currency:(o=n==null?void 0:n.totalTax)==null?void 0:o.currency,amount:n==null?void 0:n.totalTax.value,weight:"normal",size:"small"})]})})},R=({translations:a,shoppingOrdersDisplaySubtotal:e,order:t})=>{var n,i,l,o;return s("div",{className:"order-cost-summary-content__description order-cost-summary-content__description--total",children:[s("div",{className:"order-cost-summary-content__description--header",children:[c("span",{children:a.total}),c(d,{currency:(n=t==null?void 0:t.grandTotal)==null?void 0:n.currency,amount:(i=t==null?void 0:t.grandTotal)==null?void 0:i.value,weight:"bold",size:"medium"})]}),e.taxExcluded&&e.taxIncluded?s("div",{className:"order-cost-summary-content__description--subheader",children:[c("span",{children:a.totalExcludingTaxes}),c(d,{currency:(l=t==null?void 0:t.grandTotal)==null?void 0:l.currency,amount:((o=t==null?void 0:t.grandTotal)==null?void 0:o.value)-(t==null?void 0:t.totalTax.value),weight:"normal",size:"small"})]}):null]})},G=({translations:a,loading:e,storeConfig:t,order:n,withHeader:i=!0})=>{var h,y,_,O,w,L;if(e||!n)return c(z,{});const l=((h=n==null?void 0:n.totalGiftcard)==null?void 0:h.value)??0,o=((y=n.totalGiftcard)==null?void 0:y.currency)??"",u=((_=n.subtotal)==null?void 0:_.value)??0,p=((O=n.totalShipping)==null?void 0:O.value)??0,r=!!((w=n==null?void 0:n.taxes)!=null&&w.length)&&(t==null?void 0:t.shoppingOrdersDisplayFullSummary),m=r?(L=n==null?void 0:n.taxes)==null?void 0:L.reduce((Z,v)=>{var M;return+((M=v==null?void 0:v.amount)==null?void 0:M.value)+Z},0):0;return s(D,{variant:"secondary",className:H(["order-cost-summary-content"]),children:[i?c(k,{title:a.headerText}):null,s("div",{className:"order-cost-summary-content__wrapper",children:[c(P,{translations:a,order:n,subTotalValue:u,shoppingOrdersDisplaySubtotal:t==null?void 0:t.shoppingOrdersDisplaySubtotal}),c(W,{translations:a,order:n,totalShipping:p,shoppingOrdersDisplayShipping:t==null?void 0:t.shoppingOrdersDisplayShipping}),c(q,{translations:a,order:n,totalGiftcardValue:l,totalGiftcardCurrency:o}),c(F,{order:n}),c(U,{order:n,translations:a,renderTaxAccordion:r,totalAccordionTaxValue:m}),c(R,{translations:a,shoppingOrdersDisplaySubtotal:t==null?void 0:t.shoppingOrdersDisplaySubtotal,order:n})]})]})},J=({orderData:a})=>{const[e,t]=g(!0),[n,i]=g(a),[l,o]=g(null);return T(()=>{N().then(u=>{if(u){const{shoppingCartDisplayPrice:p,shoppingOrdersDisplayShipping:r,shoppingOrdersDisplaySubtotal:m,...h}=u;o(y=>({...y,...h,shoppingCartDisplayPrice:C(p),shoppingOrdersDisplayShipping:C(r),shoppingOrdersDisplaySubtotal:C(m)}))}}).finally(()=>{t(!1)})},[]),T(()=>{const u=V.on("order/data",p=>{i(p)},{eager:!0});return()=>{u==null||u.off()}},[]),{loading:e,storeConfig:l,order:n}},ut=({withHeader:a,orderData:e,children:t,className:n,...i})=>{const{loading:l,storeConfig:o,order:u}=J({orderData:e}),p=B({headerText:"Order.OrderCostSummary.headerText",subtotal:"Order.OrderCostSummary.subtotal.title",shipping:"Order.OrderCostSummary.shipping.title",freeShipping:"Order.OrderCostSummary.shipping.freeShipping",tax:"Order.OrderCostSummary.tax.title",incl:"Order.OrderCostSummary.tax.incl",excl:"Order.OrderCostSummary.tax.excl",discount:"Order.OrderCostSummary.discount.title",discountSubtitle:"Order.OrderCostSummary.discount.subtitle",total:"Order.OrderCostSummary.total.title",accordionTitle:"Order.OrderCostSummary.tax.accordionTitle",accordionTotalTax:"Order.OrderCostSummary.tax.accordionTotalTax",totalExcludingTaxes:"Order.OrderCostSummary.tax.totalExcludingTaxes"});return c("div",{...i,className:H(["order-cost-summary",n]),children:c(G,{order:u,withHeader:a,loading:l,storeConfig:o,translations:p})})};export{ut as OrderCostSummary,ut as default};
@@ -1 +1 @@
1
- import{jsx as a,jsxs as b,Fragment as w}from"@dropins/tools/preact-jsx-runtime.js";import{Card as U,Header as X,Price as Y,CartItem as g,Icon as I,Image as P}from"@dropins/tools/components.js";import"../chunks/OrderCancelReasonsForm.js";import{classes as C}from"@dropins/tools/lib.js";import*as u from"@dropins/tools/preact-compat.js";import{useMemo as T,useCallback as p,useState as S,useEffect as R}from"@dropins/tools/preact-hooks.js";import{Fragment as ee}from"@dropins/tools/preact.js";import{O as te}from"../chunks/OrderLoaders.js";import{events as le}from"@dropins/tools/event-bus.js";import{useText as ne}from"@dropins/tools/i18n.js";import{s as ae}from"../chunks/setTaxStatus.js";import{g as se}from"../chunks/getStoreConfig.js";import"../chunks/fetch-graphql.js";import"@dropins/tools/fetch-graphql.js";const ie=v=>u.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...v},u.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"}),u.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"})),me=({loading:v,taxConfig:e,order:y=null,withHeader:O=!0,showConfigurableOptions:r,routeProductDetails:f})=>{const h=ne({cancelled:"Order.OrderProductListContent.cancelledTitle",allOrders:"Order.OrderProductListContent.allOrdersTitle",sender:"Order.OrderProductListContent.GiftCard.sender",recipient:"Order.OrderProductListContent.GiftCard.recipient",message:"Order.OrderProductListContent.GiftCard.message",outOfStock:"Order.OrderProductListContent.stockStatus.outOfStock",downloadableCount:"Order.OrderProductListContent.downloadableCount"}),i=T(()=>{if(!y)return[];const{items:m}=y;return[{type:"cancelled",list:m.filter(s=>s.quantityCanceled),title:h.cancelled},{type:"",list:m.filter(s=>!s.quantityCanceled),title:h.allOrders}]},[y,h]);return y?a(U,{variant:"secondary",className:"order-order-product-list-content",children:i.filter(m=>m.list.length).map((m,s)=>{var k;return b(ee,{children:[O?a(X,{title:`${m.title} (${m.list.length})`}):null,a("ul",{className:"order-order-product-list-content__items",children:(k=m.list)==null?void 0:k.map(E=>a("li",{"data-testid":"order-product-list-content-item",children:a(re,{loading:v,product:E,itemType:m.type,taxConfig:e,translations:h,showConfigurableOptions:r,routeProductDetails:f})},E.id))})]},s)})}):a(te,{})},re=({loading:v,product:e,itemType:y,taxConfig:O,translations:r,showConfigurableOptions:f,routeProductDetails:h})=>{var _,c,x,Q,H,V,$,M,q,F,G,Z,j,z,W,B,K;const{taxExcluded:i,taxIncluded:m}=O,s=p((d,D,J)=>a(Y,{amount:d,currency:D,weight:"normal",...J}),[]);let k={};const E=y==="cancelled",A=(c=(_=e==null?void 0:e.product)==null?void 0:_.stockStatus)==null?void 0:c.includes("IN_STOCK"),t=(e==null?void 0:e.giftCard)||{},l=(x=e==null?void 0:e.itemPrices)==null?void 0:x.priceIncludingTax,n=(Q=e==null?void 0:e.itemPrices)==null?void 0:Q.originalPrice,o=(H=e==null?void 0:e.itemPrices)==null?void 0:H.price,L=e.discounted&&((V=e.price)==null?void 0:V.value)!==(n==null?void 0:n.value)*(e==null?void 0:e.totalQuantity),N={..."configurableOptions"in e?e.configurableOptions:{},..."bundleOptions"in e?e.bundleOptions:{},..."senderName"in t&&(t!=null&&t.senderName)?{[r.sender]:t==null?void 0:t.senderName}:{},..."senderEmail"in t&&(t!=null&&t.senderEmail)?{[r.sender]:t==null?void 0:t.senderEmail}:{},..."recipientName"in t&&(t!=null&&t.recipientName)?{[r.recipient]:t==null?void 0:t.recipientName}:{},..."recipientEmail"in t&&(t!=null&&t.recipientEmail)?{[r.recipient]:t==null?void 0:t.recipientEmail}:{},..."message"in t&&(t!=null&&t.message)?{[r.message]:t==null?void 0:t.message}:{},..."downloadableLinks"in e&&(e!=null&&e.downloadableLinks)?{[`${($=e==null?void 0:e.downloadableLinks)==null?void 0:$.count} ${r.downloadableCount}`]:(M=e==null?void 0:e.downloadableLinks)==null?void 0:M.result}:{}};if(m&&i){const d=L?n==null?void 0:n.value:(l==null?void 0:l.value)*(e==null?void 0:e.totalQuantity);k={taxExcluded:!0,taxIncluded:void 0,price:s(n==null?void 0:n.value,n==null?void 0:n.currency),total:b(w,{children:[s(d,n==null?void 0:n.currency,{variant:e.discounted&&(l==null?void 0:l.value)!==d?"strikethrough":"default"}),e.discounted&&(l==null?void 0:l.value)!==d?s(l==null?void 0:l.value,l==null?void 0:l.currency,{sale:!0,weight:"bold"}):null]}),totalExcludingTax:s((o==null?void 0:o.value)*e.totalQuantity,o==null?void 0:o.currency)}}else if(!m&&i)k={taxExcluded:void 0,taxIncluded:void 0,price:s(n==null?void 0:n.value,n==null?void 0:n.currency),total:b(w,{children:[s((n==null?void 0:n.value)*(e==null?void 0:e.totalQuantity),l==null?void 0:l.currency,{variant:L?"strikethrough":"default"}),L?s((q=e.price)==null?void 0:q.value,(F=e.price)==null?void 0:F.currency,{sale:!0,weight:"bold"}):null]}),totalExcludingTax:s((o==null?void 0:o.value)*(e==null?void 0:e.totalQuantity),o==null?void 0:o.currency)};else if(m&&!i){const d=L?n.value:l.value*e.totalQuantity;k={taxExcluded:void 0,taxIncluded:!0,price:s(l==null?void 0:l.value,l==null?void 0:l.currency),total:b(w,{children:[s(d,l==null?void 0:l.currency,{variant:L?"strikethrough":"default",weight:"bold"}),L?s(l==null?void 0:l.value,l==null?void 0:l.currency,{sale:!0,weight:"bold"}):null]})}}return a(g,{loading:v,alert:E&&A?b("span",{children:[a(I,{source:ie}),r.outOfStock]}):a(w,{}),configurations:(f==null?void 0:f(N))??N,title:h?a("a",{"data-testid":"product-name",className:C(["cart-summary-item__title",["cart-summary-item__title--strikethrough",E]]),href:h(e),children:(G=e==null?void 0:e.product)==null?void 0:G.name}):a("div",{"data-testid":"product-name",className:C(["cart-summary-item__title",["cart-summary-item__title--strikethrough",E]]),children:(Z=e==null?void 0:e.product)==null?void 0:Z.name}),sku:a("div",{children:(j=e==null?void 0:e.product)==null?void 0:j.sku}),quantity:e.totalQuantity,image:h?a("a",{href:h(e),children:a(P,{src:(z=e==null?void 0:e.product)==null?void 0:z.thumbnail.url,alt:(W=e==null?void 0:e.product)==null?void 0:W.thumbnail.label,loading:"lazy",width:"90",height:"120"})}):a(P,{src:(B=e==null?void 0:e.product)==null?void 0:B.thumbnail.url,alt:(K=e==null?void 0:e.product)==null?void 0:K.thumbnail.label,loading:"lazy",width:"90",height:"120"}),...k})},he=({orderData:v})=>{const[e,y]=S(!0),[O,r]=S(v),[f,h]=S({taxIncluded:!1,taxExcluded:!1});return R(()=>{se().then(i=>{i&&h(ae(i==null?void 0:i.shoppingCartDisplayPrice))}).finally(()=>{y(!1)})},[]),R(()=>{const i=le.on("order/data",m=>{r(m)},{eager:!0});return()=>{i==null||i.off()}},[]),{loading:e,taxConfig:f,order:O}},Ce=({className:v,orderData:e,withHeader:y,showConfigurableOptions:O,routeProductDetails:r})=>{const{loading:f,taxConfig:h,order:i}=he({orderData:e});return a("div",{className:C(["order-order-product-list",v]),children:a(me,{loading:f,taxConfig:h,order:i,withHeader:y,showConfigurableOptions:O,routeProductDetails:r})})};export{Ce as OrderProductList,Ce as default};
1
+ import{jsx as a,jsxs as b,Fragment as w}from"@dropins/tools/preact-jsx-runtime.js";import{Card as U,Header as X,Price as Y,CartItem as g,Icon as I,Image as P}from"@dropins/tools/components.js";import"../chunks/OrderCancel.js";import{classes as C}from"@dropins/tools/lib.js";import*as u from"@dropins/tools/preact-compat.js";import{useMemo as T,useCallback as p,useState as S,useEffect as R}from"@dropins/tools/preact-hooks.js";import{Fragment as ee}from"@dropins/tools/preact.js";import{O as te}from"../chunks/OrderLoaders.js";import{events as le}from"@dropins/tools/event-bus.js";import{useText as ne}from"@dropins/tools/i18n.js";import{s as ae}from"../chunks/setTaxStatus.js";import{g as se}from"../chunks/getStoreConfig.js";import"../chunks/fetch-graphql.js";import"@dropins/tools/fetch-graphql.js";const ie=v=>u.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...v},u.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"}),u.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"})),me=({loading:v,taxConfig:e,order:y=null,withHeader:O=!0,showConfigurableOptions:r,routeProductDetails:f})=>{const h=ne({cancelled:"Order.OrderProductListContent.cancelledTitle",allOrders:"Order.OrderProductListContent.allOrdersTitle",sender:"Order.OrderProductListContent.GiftCard.sender",recipient:"Order.OrderProductListContent.GiftCard.recipient",message:"Order.OrderProductListContent.GiftCard.message",outOfStock:"Order.OrderProductListContent.stockStatus.outOfStock",downloadableCount:"Order.OrderProductListContent.downloadableCount"}),i=T(()=>{if(!y)return[];const{items:m}=y;return[{type:"cancelled",list:m.filter(s=>s.quantityCanceled),title:h.cancelled},{type:"",list:m.filter(s=>!s.quantityCanceled),title:h.allOrders}]},[y,h]);return y?a(U,{variant:"secondary",className:"order-order-product-list-content",children:i.filter(m=>m.list.length).map((m,s)=>{var k;return b(ee,{children:[O?a(X,{title:`${m.title} (${m.list.length})`}):null,a("ul",{className:"order-order-product-list-content__items",children:(k=m.list)==null?void 0:k.map(E=>a("li",{"data-testid":"order-product-list-content-item",children:a(re,{loading:v,product:E,itemType:m.type,taxConfig:e,translations:h,showConfigurableOptions:r,routeProductDetails:f})},E.id))})]},s)})}):a(te,{})},re=({loading:v,product:e,itemType:y,taxConfig:O,translations:r,showConfigurableOptions:f,routeProductDetails:h})=>{var _,c,x,Q,H,V,$,M,q,F,G,Z,j,z,W,B,K;const{taxExcluded:i,taxIncluded:m}=O,s=p((d,D,J)=>a(Y,{amount:d,currency:D,weight:"normal",...J}),[]);let k={};const E=y==="cancelled",A=(c=(_=e==null?void 0:e.product)==null?void 0:_.stockStatus)==null?void 0:c.includes("IN_STOCK"),t=(e==null?void 0:e.giftCard)||{},l=(x=e==null?void 0:e.itemPrices)==null?void 0:x.priceIncludingTax,n=(Q=e==null?void 0:e.itemPrices)==null?void 0:Q.originalPrice,o=(H=e==null?void 0:e.itemPrices)==null?void 0:H.price,L=e.discounted&&((V=e.price)==null?void 0:V.value)!==(n==null?void 0:n.value)*(e==null?void 0:e.totalQuantity),N={..."configurableOptions"in e?e.configurableOptions:{},..."bundleOptions"in e?e.bundleOptions:{},..."senderName"in t&&(t!=null&&t.senderName)?{[r.sender]:t==null?void 0:t.senderName}:{},..."senderEmail"in t&&(t!=null&&t.senderEmail)?{[r.sender]:t==null?void 0:t.senderEmail}:{},..."recipientName"in t&&(t!=null&&t.recipientName)?{[r.recipient]:t==null?void 0:t.recipientName}:{},..."recipientEmail"in t&&(t!=null&&t.recipientEmail)?{[r.recipient]:t==null?void 0:t.recipientEmail}:{},..."message"in t&&(t!=null&&t.message)?{[r.message]:t==null?void 0:t.message}:{},..."downloadableLinks"in e&&(e!=null&&e.downloadableLinks)?{[`${($=e==null?void 0:e.downloadableLinks)==null?void 0:$.count} ${r.downloadableCount}`]:(M=e==null?void 0:e.downloadableLinks)==null?void 0:M.result}:{}};if(m&&i){const d=L?n==null?void 0:n.value:(l==null?void 0:l.value)*(e==null?void 0:e.totalQuantity);k={taxExcluded:!0,taxIncluded:void 0,price:s(n==null?void 0:n.value,n==null?void 0:n.currency),total:b(w,{children:[s(d,n==null?void 0:n.currency,{variant:e.discounted&&(l==null?void 0:l.value)!==d?"strikethrough":"default"}),e.discounted&&(l==null?void 0:l.value)!==d?s(l==null?void 0:l.value,l==null?void 0:l.currency,{sale:!0,weight:"bold"}):null]}),totalExcludingTax:s((o==null?void 0:o.value)*e.totalQuantity,o==null?void 0:o.currency)}}else if(!m&&i)k={taxExcluded:void 0,taxIncluded:void 0,price:s(n==null?void 0:n.value,n==null?void 0:n.currency),total:b(w,{children:[s((n==null?void 0:n.value)*(e==null?void 0:e.totalQuantity),l==null?void 0:l.currency,{variant:L?"strikethrough":"default"}),L?s((q=e.price)==null?void 0:q.value,(F=e.price)==null?void 0:F.currency,{sale:!0,weight:"bold"}):null]}),totalExcludingTax:s((o==null?void 0:o.value)*(e==null?void 0:e.totalQuantity),o==null?void 0:o.currency)};else if(m&&!i){const d=L?n.value:l.value*e.totalQuantity;k={taxExcluded:void 0,taxIncluded:!0,price:s(l==null?void 0:l.value,l==null?void 0:l.currency),total:b(w,{children:[s(d,l==null?void 0:l.currency,{variant:L?"strikethrough":"default",weight:"bold"}),L?s(l==null?void 0:l.value,l==null?void 0:l.currency,{sale:!0,weight:"bold"}):null]})}}return a(g,{loading:v,alert:E&&A?b("span",{children:[a(I,{source:ie}),r.outOfStock]}):a(w,{}),configurations:(f==null?void 0:f(N))??N,title:h?a("a",{"data-testid":"product-name",className:C(["cart-summary-item__title",["cart-summary-item__title--strikethrough",E]]),href:h(e),children:(G=e==null?void 0:e.product)==null?void 0:G.name}):a("div",{"data-testid":"product-name",className:C(["cart-summary-item__title",["cart-summary-item__title--strikethrough",E]]),children:(Z=e==null?void 0:e.product)==null?void 0:Z.name}),sku:a("div",{children:(j=e==null?void 0:e.product)==null?void 0:j.sku}),quantity:e.totalQuantity,image:h?a("a",{href:h(e),children:a(P,{src:(z=e==null?void 0:e.product)==null?void 0:z.thumbnail.url,alt:(W=e==null?void 0:e.product)==null?void 0:W.thumbnail.label,loading:"lazy",width:"90",height:"120"})}):a(P,{src:(B=e==null?void 0:e.product)==null?void 0:B.thumbnail.url,alt:(K=e==null?void 0:e.product)==null?void 0:K.thumbnail.label,loading:"lazy",width:"90",height:"120"}),...k})},he=({orderData:v})=>{const[e,y]=S(!0),[O,r]=S(v),[f,h]=S({taxIncluded:!1,taxExcluded:!1});return R(()=>{se().then(i=>{i&&h(ae(i==null?void 0:i.shoppingCartDisplayPrice))}).finally(()=>{y(!1)})},[]),R(()=>{const i=le.on("order/data",m=>{r(m)},{eager:!0});return()=>{i==null||i.off()}},[]),{loading:e,taxConfig:f,order:O}},Ce=({className:v,orderData:e,withHeader:y,showConfigurableOptions:O,routeProductDetails:r})=>{const{loading:f,taxConfig:h,order:i}=he({orderData:e});return a("div",{className:C(["order-order-product-list",v]),children:a(me,{loading:f,taxConfig:h,order:i,withHeader:y,showConfigurableOptions:O,routeProductDetails:r})})};export{Ce as OrderProductList,Ce as default};
@@ -1 +1 @@
1
- import{jsx as m}from"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/components.js";import"../chunks/OrderCancelReasonsForm.js";import{classes as p}from"@dropins/tools/lib.js";import"@dropins/tools/preact-compat.js";import{useState as d,useEffect as R}from"@dropins/tools/preact-hooks.js";import{u as L,R as O}from"../chunks/useIsMobile.js";import"@dropins/tools/preact.js";import{events as b}from"@dropins/tools/event-bus.js";import{useText as g}from"@dropins/tools/i18n.js";import"../chunks/OrderLoaders.js";const w=({orderData:s})=>{const[i,n]=d(s),[u,o]=d([]);return R(()=>{const t=b.on("order/data",e=>{n(e),o(e==null?void 0:e.returns)},{eager:!0});return()=>{t==null||t.off()}},[]),{order:i,orderReturns:u}},I=({slots:s,className:i,orderData:n,withHeader:u,withThumbnails:o,routeReturnDetails:t,routeProductDetails:e,routeTracking:l})=>{const{orderReturns:a}=w({orderData:n}),f=L(),r="fullSizeView",c=g({minifiedViewTitle:`Order.Returns.${r}.returnsList.minifiedViewTitle`,ariaLabelLink:`Order.Returns.${r}.returnsList.ariaLabelLink`,emptyOrdersListMessage:`Order.Returns.${r}.returnsList.emptyOrdersListMessage`,orderNumber:`Order.Returns.${r}.returnsList.orderNumber`,returnNumber:`Order.Returns.${r}.returnsList.returnNumber`,carrier:`Order.Returns.${r}.returnsList.carrier`});return m("div",{className:p(["order-order-returns",i]),children:a.length?m(O,{pageInfo:{pageSize:1,totalPages:1,currentPage:1},minifiedViewKey:r,slots:s,isMobile:f,withOrderNumber:!1,withReturnNumber:!0,orderReturns:a,translations:c,withHeader:u,withThumbnails:o,minifiedView:!1,routeReturnDetails:t,routeProductDetails:e,routeTracking:l,loading:!1}):null})};export{I as OrderReturns,I as default};
1
+ import{jsx as m}from"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/components.js";import"../chunks/OrderCancel.js";import{classes as p}from"@dropins/tools/lib.js";import"@dropins/tools/preact-compat.js";import{useState as d,useEffect as R}from"@dropins/tools/preact-hooks.js";import{u as L,R as O}from"../chunks/useIsMobile.js";import"@dropins/tools/preact.js";import{events as b}from"@dropins/tools/event-bus.js";import{useText as g}from"@dropins/tools/i18n.js";import"../chunks/OrderLoaders.js";const w=({orderData:s})=>{const[i,n]=d(s),[u,o]=d([]);return R(()=>{const t=b.on("order/data",e=>{n(e),o(e==null?void 0:e.returns)},{eager:!0});return()=>{t==null||t.off()}},[]),{order:i,orderReturns:u}},I=({slots:s,className:i,orderData:n,withHeader:u,withThumbnails:o,routeReturnDetails:t,routeProductDetails:e,routeTracking:l})=>{const{orderReturns:a}=w({orderData:n}),f=L(),r="fullSizeView",c=g({minifiedViewTitle:`Order.Returns.${r}.returnsList.minifiedViewTitle`,ariaLabelLink:`Order.Returns.${r}.returnsList.ariaLabelLink`,emptyOrdersListMessage:`Order.Returns.${r}.returnsList.emptyOrdersListMessage`,orderNumber:`Order.Returns.${r}.returnsList.orderNumber`,returnNumber:`Order.Returns.${r}.returnsList.returnNumber`,carrier:`Order.Returns.${r}.returnsList.carrier`});return m("div",{className:p(["order-order-returns",i]),children:a.length?m(O,{pageInfo:{pageSize:1,totalPages:1,currentPage:1},minifiedViewKey:r,slots:s,isMobile:f,withOrderNumber:!1,withReturnNumber:!0,orderReturns:a,translations:c,withHeader:u,withThumbnails:o,minifiedView:!1,routeReturnDetails:t,routeProductDetails:e,routeTracking:l,loading:!1}):null})};export{I as OrderReturns,I as default};
@@ -1 +1 @@
1
- import{jsxs as v,jsx as s}from"@dropins/tools/preact-jsx-runtime.js";import{classes as _}from"@dropins/tools/lib.js";import{Card as U,InLineAlert as C,Icon as x,Button as V}from"@dropins/tools/components.js";import{F as L}from"../chunks/OrderCancelReasonsForm.js";import*as R from"@dropins/tools/preact-compat.js";import{useState as D,useCallback as O,useEffect as g,useMemo as k}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/preact.js";import{events as w}from"@dropins/tools/event-bus.js";import{Text as S,useText as H}from"@dropins/tools/i18n.js";import{g as A,a as P}from"../chunks/getCustomer.js";import"../chunks/network-error.js";import"../chunks/fetch-graphql.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/getGuestOrder.graphql.js";import"../chunks/transform-order-details.js";import"../chunks/convertCase.js";const X=e=>R.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},R.createElement("path",{vectorEffect:"non-scaling-stroke",fillRule:"evenodd",clipRule:"evenodd",d:"M1 20.8953L12.1922 1.5L23.395 20.8953H1ZM13.0278 13.9638L13.25 10.0377V9H11.25V10.0377L11.4722 13.9638H13.0278ZM11.2994 16V17.7509H13.2253V16H11.2994Z",fill:"currentColor"})),B=({onSubmit:e,loading:t,inLineAlert:o,fieldsConfig:a})=>v(U,{variant:"secondary",className:"order-order-search-form",children:[s("h2",{className:"order-order-search-form__title",children:s(S,{id:"Order.OrderSearchForm.title"})}),s("p",{children:s(S,{id:"Order.OrderSearchForm.description"})}),o.text?s(C,{"data-testid":"orderAlert",className:"order-order-search-form__alert",type:o.type,variant:"secondary",heading:o.text,icon:s(x,{source:X})}):null,s(L,{className:"order-order-search-form__wrapper",name:"orderSearchForm",loading:t,fieldsConfig:a,onSubmit:e,children:s("div",{className:"order-order-search-form__button-container",children:s(V,{className:"order-order-search-form__button",size:"medium",variant:"primary",type:"submit",disabled:t,children:s(S,{id:"Order.OrderSearchForm.button"})},"logIn")})})]});var E=(e=>(e.BOOLEAN="BOOLEAN",e.DATE="DATE",e.DATETIME="DATETIME",e.DROPDOWN="DROPDOWN",e.FILE="FILE",e.GALLERY="GALLERY",e.HIDDEN="HIDDEN",e.IMAGE="IMAGE",e.MEDIA_IMAGE="MEDIA_IMAGE",e.MULTILINE="MULTILINE",e.MULTISELECT="MULTISELECT",e.PRICE="PRICE",e.SELECT="SELECT",e.TEXT="TEXT",e.TEXTAREA="TEXTAREA",e.UNDEFINED="UNDEFINED",e.VISUAL="VISUAL",e.WEIGHT="WEIGHT",e.EMPTY="",e))(E||{});const j=e=>{if(!e)return null;const t=new FormData(e);if(e.querySelectorAll('input[type="checkbox"]').forEach(a=>{t.has(a.name)||t.set(a.name,"false"),a.checked&&t.set(a.name,"true")}),t&&typeof t.entries=="function"){const a=t.entries();if(a&&typeof a[Symbol.iterator]=="function")return JSON.parse(JSON.stringify(Object.fromEntries(a)))||{}}return{}},p=(e,t)=>{if(typeof e!="function")return;const o=e();if(!t||Object.keys(t).length===0){window.location.href=o;return}const a=new URLSearchParams;Object.entries(t).forEach(([u,f])=>{a.append(u,String(f))});const c=o.includes("?")?"&":"?";window.location.href=`${o}${c}${a.toString()}`},I=e=>{try{return new URL(window.location.href).searchParams.get(e)}catch{return null}},q=({onError:e,isAuth:t,renderSignIn:o,routeCustomerOrder:a,routeGuestOrder:c})=>{const[u,f]=D({text:"",type:"success"}),[y,h]=D(!1),m=H({invalidSearch:"Order.Errors.invalidSearch",email:"Order.OrderSearchForm.email",postcode:"Order.OrderSearchForm.postcode",number:"Order.OrderSearchForm.orderNumber"}),b=O(async r=>{const n=I("orderRef"),i=n&&n.length>20;if(!r&&!n||!(r!=null&&r.number)&&!(r!=null&&r.token)&&!n)return null;if(t){const d=await A();(d==null?void 0:d.email)===r.email?p(a,{orderRef:r==null?void 0:r.number}):i||p(c,{orderRef:r.token})}else i||p(c,{orderRef:r==null?void 0:r.token})},[t,a,c]);g(()=>{const r=w.on("order/data",n=>{b(n)},{eager:!0});return()=>{r==null||r.off()}},[b]),g(()=>{const r=I("orderRef"),n=r&&r.length>20?r:null;r&&(n?p(c,{orderRef:r}):t?p(a,{orderRef:r}):o==null||o({render:!0,formValues:{number:r}}))},[t,a,c,o]);const M=k(()=>[{entityType:"CUSTOMER_ADDRESS",is_unique:!1,label:m.email,options:[],defaultValue:"",fieldType:E.TEXT,className:"",required:!0,orderNumber:1,name:"email",id:"email",code:"email"},{entityType:"CUSTOMER_ADDRESS",is_unique:!1,label:m.postcode,options:[],defaultValue:"",fieldType:E.TEXT,className:"",required:!0,orderNumber:2,name:"postcode",id:"postcode",code:"postcode"},{entityType:"CUSTOMER_ADDRESS",is_unique:!1,label:m.number,options:[],defaultValue:"",fieldType:E.TEXT,className:"",required:!0,orderNumber:3,name:"number",id:"number",code:"number"}],[m]);return{onSubmit:O(async(r,n)=>{if(!n)return null;h(!0);const i=j(r.target);await P(i).then(l=>{l||f({text:m.invalidSearch,type:"warning"}),w.emit("order/data",l)}).catch(async l=>{var N;let d=!0;e==null||e({error:l.message});const T=t?await A():{email:""};(T==null?void 0:T.email)===(i==null?void 0:i.email)?p(a,{orderRef:i.number}):d=o==null?void 0:o({render:T===null||((N=l==null?void 0:l.message)==null?void 0:N.includes("Please login to view the order.")),formValues:i}),d&&f({text:l.message,type:"warning"})}).finally(()=>{h(!1)})},[t,e,o,a,m.invalidSearch]),inLineAlert:u,loading:y,normalizeFieldsConfig:M}},ce=({className:e,isAuth:t,renderSignIn:o,routeCustomerOrder:a,routeGuestOrder:c,onError:u})=>{const{onSubmit:f,loading:y,inLineAlert:h,normalizeFieldsConfig:m}=q({onError:u,isAuth:t,renderSignIn:o,routeCustomerOrder:a,routeGuestOrder:c});return s("div",{className:_(["order-order-search",e]),children:s(B,{onSubmit:f,loading:y,inLineAlert:h,fieldsConfig:m})})};export{ce as OrderSearch,ce as default};
1
+ import{jsxs as v,jsx as s}from"@dropins/tools/preact-jsx-runtime.js";import{classes as _}from"@dropins/tools/lib.js";import{Card as U,InLineAlert as C,Icon as x,Button as V}from"@dropins/tools/components.js";import{F as L}from"../chunks/OrderCancel.js";import*as R from"@dropins/tools/preact-compat.js";import{useState as D,useCallback as O,useEffect as g,useMemo as k}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/preact.js";import{events as w}from"@dropins/tools/event-bus.js";import{Text as S,useText as H}from"@dropins/tools/i18n.js";import{a as A,g as P}from"../chunks/getCustomer.js";import"../chunks/network-error.js";import"../chunks/fetch-graphql.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/getGuestOrder.graphql.js";import"../chunks/transform-order-details.js";import"../chunks/convertCase.js";const X=e=>R.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},R.createElement("path",{vectorEffect:"non-scaling-stroke",fillRule:"evenodd",clipRule:"evenodd",d:"M1 20.8953L12.1922 1.5L23.395 20.8953H1ZM13.0278 13.9638L13.25 10.0377V9H11.25V10.0377L11.4722 13.9638H13.0278ZM11.2994 16V17.7509H13.2253V16H11.2994Z",fill:"currentColor"})),B=({onSubmit:e,loading:t,inLineAlert:o,fieldsConfig:a})=>v(U,{variant:"secondary",className:"order-order-search-form",children:[s("h2",{className:"order-order-search-form__title",children:s(S,{id:"Order.OrderSearchForm.title"})}),s("p",{children:s(S,{id:"Order.OrderSearchForm.description"})}),o.text?s(C,{"data-testid":"orderAlert",className:"order-order-search-form__alert",type:o.type,variant:"secondary",heading:o.text,icon:s(x,{source:X})}):null,s(L,{className:"order-order-search-form__wrapper",name:"orderSearchForm",loading:t,fieldsConfig:a,onSubmit:e,children:s("div",{className:"order-order-search-form__button-container",children:s(V,{className:"order-order-search-form__button",size:"medium",variant:"primary",type:"submit",disabled:t,children:s(S,{id:"Order.OrderSearchForm.button"})},"logIn")})})]});var E=(e=>(e.BOOLEAN="BOOLEAN",e.DATE="DATE",e.DATETIME="DATETIME",e.DROPDOWN="DROPDOWN",e.FILE="FILE",e.GALLERY="GALLERY",e.HIDDEN="HIDDEN",e.IMAGE="IMAGE",e.MEDIA_IMAGE="MEDIA_IMAGE",e.MULTILINE="MULTILINE",e.MULTISELECT="MULTISELECT",e.PRICE="PRICE",e.SELECT="SELECT",e.TEXT="TEXT",e.TEXTAREA="TEXTAREA",e.UNDEFINED="UNDEFINED",e.VISUAL="VISUAL",e.WEIGHT="WEIGHT",e.EMPTY="",e))(E||{});const j=e=>{if(!e)return null;const t=new FormData(e);if(e.querySelectorAll('input[type="checkbox"]').forEach(a=>{t.has(a.name)||t.set(a.name,"false"),a.checked&&t.set(a.name,"true")}),t&&typeof t.entries=="function"){const a=t.entries();if(a&&typeof a[Symbol.iterator]=="function")return JSON.parse(JSON.stringify(Object.fromEntries(a)))||{}}return{}},p=(e,t)=>{if(typeof e!="function")return;const o=e();if(!t||Object.keys(t).length===0){window.location.href=o;return}const a=new URLSearchParams;Object.entries(t).forEach(([u,f])=>{a.append(u,String(f))});const c=o.includes("?")?"&":"?";window.location.href=`${o}${c}${a.toString()}`},I=e=>{try{return new URL(window.location.href).searchParams.get(e)}catch{return null}},q=({onError:e,isAuth:t,renderSignIn:o,routeCustomerOrder:a,routeGuestOrder:c})=>{const[u,f]=D({text:"",type:"success"}),[y,h]=D(!1),m=H({invalidSearch:"Order.Errors.invalidSearch",email:"Order.OrderSearchForm.email",postcode:"Order.OrderSearchForm.postcode",number:"Order.OrderSearchForm.orderNumber"}),b=O(async r=>{const n=I("orderRef"),i=n&&n.length>20;if(!r&&!n||!(r!=null&&r.number)&&!(r!=null&&r.token)&&!n)return null;if(t){const d=await A();(d==null?void 0:d.email)===r.email?p(a,{orderRef:r==null?void 0:r.number}):i||p(c,{orderRef:r.token})}else i||p(c,{orderRef:r==null?void 0:r.token})},[t,a,c]);g(()=>{const r=w.on("order/data",n=>{b(n)},{eager:!0});return()=>{r==null||r.off()}},[b]),g(()=>{const r=I("orderRef"),n=r&&r.length>20?r:null;r&&(n?p(c,{orderRef:r}):t?p(a,{orderRef:r}):o==null||o({render:!0,formValues:{number:r}}))},[t,a,c,o]);const M=k(()=>[{entityType:"CUSTOMER_ADDRESS",is_unique:!1,label:m.email,options:[],defaultValue:"",fieldType:E.TEXT,className:"",required:!0,orderNumber:1,name:"email",id:"email",code:"email"},{entityType:"CUSTOMER_ADDRESS",is_unique:!1,label:m.postcode,options:[],defaultValue:"",fieldType:E.TEXT,className:"",required:!0,orderNumber:2,name:"postcode",id:"postcode",code:"postcode"},{entityType:"CUSTOMER_ADDRESS",is_unique:!1,label:m.number,options:[],defaultValue:"",fieldType:E.TEXT,className:"",required:!0,orderNumber:3,name:"number",id:"number",code:"number"}],[m]);return{onSubmit:O(async(r,n)=>{if(!n)return null;h(!0);const i=j(r.target);await P(i).then(l=>{l||f({text:m.invalidSearch,type:"warning"}),w.emit("order/data",l)}).catch(async l=>{var N;let d=!0;e==null||e({error:l.message});const T=t?await A():{email:""};(T==null?void 0:T.email)===(i==null?void 0:i.email)?p(a,{orderRef:i.number}):d=o==null?void 0:o({render:T===null||((N=l==null?void 0:l.message)==null?void 0:N.includes("Please login to view the order.")),formValues:i}),d&&f({text:l.message,type:"warning"})}).finally(()=>{h(!1)})},[t,e,o,a,m.invalidSearch]),inLineAlert:u,loading:y,normalizeFieldsConfig:M}},ce=({className:e,isAuth:t,renderSignIn:o,routeCustomerOrder:a,routeGuestOrder:c,onError:u})=>{const{onSubmit:f,loading:y,inLineAlert:h,normalizeFieldsConfig:m}=q({onError:u,isAuth:t,renderSignIn:o,routeCustomerOrder:a,routeGuestOrder:c});return s("div",{className:_(["order-order-search",e]),children:s(B,{onSubmit:f,loading:y,inLineAlert:h,fieldsConfig:m})})};export{ce as OrderSearch,ce as default};
@@ -1,4 +1,4 @@
1
- import{jsx as i,jsxs as g,Fragment as v}from"@dropins/tools/preact-jsx-runtime.js";import{Card as A,Header as I,Button as p,InLineAlert as T}from"@dropins/tools/components.js";import"../chunks/OrderCancelReasonsForm.js";import{Slot as x,classes as S}from"@dropins/tools/lib.js";import{useMemo as L,useState as $}from"@dropins/tools/preact-compat.js";import{useText as u}from"@dropins/tools/i18n.js";import{useState as R,useEffect as E}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/preact.js";import{events as y}from"@dropins/tools/event-bus.js";import{C as U}from"../chunks/OrderLoaders.js";import{G as K}from"../chunks/getGuestOrder.graphql.js";import{f as M,h as F}from"../chunks/fetch-graphql.js";import{t as P}from"../chunks/transform-order-details.js";import{u as G}from"../chunks/useGetStoreConfig.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/convertCase.js";import"../chunks/getStoreConfig.js";const h={pending:"orderPending",shiping:"orderShipped",complete:"orderComplete",processing:"orderProcessing","on hold":"orderOnHold",canceled:"orderCanceled","suspected fraud":"orderSuspectedFraud","payment Review":"orderPaymentReview","order received":"orderReceived","guest order cancellation requested":"guestOrderCancellationRequested"},H=({slots:r,title:d,status:o,orderData:e})=>{const s=String(o).toLocaleLowerCase(),t=u(`Order.OrderStatusContent.${h[s]}.title`),n=u(`Order.OrderStatusContent.${h[s]}.message`),c=u(`Order.OrderStatusContent.${h[s]}.messageWithoutDate`);if(!o)return i("div",{});const a=e!=null&&e.orderStatusChangeDate?n==null?void 0:n.message.replace("{DATE}",e==null?void 0:e.orderStatusChangeDate):c.messageWithoutDate;return g(A,{className:"order-order-status-content",variant:"secondary",children:[i(I,{title:d??t.title}),g("div",{className:"order-order-status-content__wrapper",children:[i("div",{className:"order-order-status-content__wrapper-description",children:i("p",{children:a})}),i(V,{orderData:e,slots:r})]})]})};var C=(r=>(r.CANCEL="CANCEL",r.RETURN="RETURN",r.REORDER="REORDER",r))(C||{});const V=({className:r,children:d,orderData:o,slots:e,...s})=>{const t=u({cancel:"Order.OrderStatusContent.actions.cancel",return:"Order.OrderStatusContent.actions.return",reorder:"Order.OrderStatusContent.actions.reorder"}),n=L(()=>{const c=o==null?void 0:o.availableActions,a=!!(c!=null&&c.length);return i(v,{children:e!=null&&e.OrderActions?i(x,{"data-testid":"OrderActionsSlot",name:"OrderCanceledActions",slot:e==null?void 0:e.OrderActions,context:o}):i("div",{"data-testid":"availableActionsList",className:S(["order-order-actions__wrapper",["order-order-actions__wrapper--empty",!a]]),children:c==null?void 0:c.map(m=>{switch(m){case C.CANCEL:return i(p,{variant:"secondary",children:t.cancel});case C.RETURN:return i(p,{variant:"secondary",children:t.return});case C.REORDER:return i(p,{variant:"secondary",children:t.reorder})}})})})},[o,e==null?void 0:e.OrderActions,t]);return i("div",{...s,className:S(["order-order-actions",r]),children:n})},W=({orderData:r})=>{const[d,o]=R(r),[e,s]=R(r==null?void 0:r.status);return E(()=>{const t=y.on("order/data",n=>{o(n),s(n.status)},{eager:!0});return()=>{t==null||t.off()}},[]),{orderStatus:e,order:d}},j=`
1
+ import{jsx as s,jsxs as p,Fragment as w}from"@dropins/tools/preact-jsx-runtime.js";import{Card as T,Header as x,Button as R,InLineAlert as L,Modal as M}from"@dropins/tools/components.js";import"../chunks/OrderCancel.js";import{Slot as $,classes as E}from"@dropins/tools/lib.js";import{useMemo as F,useState as U}from"@dropins/tools/preact-compat.js";import{useState as O,useEffect as N}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/preact.js";import{events as _}from"@dropins/tools/event-bus.js";import{O as K}from"../chunks/OrderCancelForm.js";import{useText as m,Text as y}from"@dropins/tools/i18n.js";import{C as b}from"../chunks/OrderLoaders.js";import{G as P}from"../chunks/getGuestOrder.graphql.js";import{f as G,h as V}from"../chunks/fetch-graphql.js";import{b as k}from"../chunks/transform-order-details.js";import{g as q}from"../chunks/getStoreConfig.js";import"../chunks/requestGuestOrderCancel.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/convertCase.js";const S={pending:"orderPending",shiping:"orderShipped",complete:"orderComplete",processing:"orderProcessing","on hold":"orderOnHold",canceled:"orderCanceled","suspected fraud":"orderSuspectedFraud","payment Review":"orderPaymentReview","order received":"orderReceived","guest order cancellation requested":"guestOrderCancellationRequested"},H=({slots:t,title:a,status:r,orderData:e})=>{const n=String(r).toLocaleLowerCase(),o=m(`Order.OrderStatusContent.${S[n]}.title`),c=m(`Order.OrderStatusContent.${S[n]}.message`),i=m(`Order.OrderStatusContent.${S[n]}.messageWithoutDate`);if(!r)return s("div",{});const l=e!=null&&e.orderStatusChangeDate?c==null?void 0:c.message.replace("{DATE}",e==null?void 0:e.orderStatusChangeDate):i.messageWithoutDate;return p(T,{className:"order-order-status-content",variant:"secondary",children:[s(x,{title:a??o.title}),p("div",{className:"order-order-status-content__wrapper",children:[s("div",{className:"order-order-status-content__wrapper-description",children:s("p",{children:l})}),s(W,{orderData:e,slots:t})]})]})};var f=(t=>(t.CANCEL="CANCEL",t.RETURN="RETURN",t.REORDER="REORDER",t))(f||{});const W=({className:t,children:a,orderData:r,slots:e,...n})=>{const o=m({cancel:"Order.OrderStatusContent.actions.cancel",return:"Order.OrderStatusContent.actions.return",reorder:"Order.OrderStatusContent.actions.reorder"}),c=F(()=>{const i=r==null?void 0:r.availableActions,l=!!(i!=null&&i.length);return s(w,{children:e!=null&&e.OrderActions?s($,{"data-testid":"OrderActionsSlot",name:"OrderCanceledActions",slot:e==null?void 0:e.OrderActions,context:r}):s("div",{"data-testid":"availableActionsList",className:E(["order-order-actions__wrapper",["order-order-actions__wrapper--empty",!l]]),children:i==null?void 0:i.map(d=>{switch(d){case f.CANCEL:return!!r&&s(Q,{orderRef:r.token??atob(r.id)});case f.RETURN:return s(R,{variant:"secondary",children:o.return});case f.REORDER:return s(R,{variant:"secondary",children:o.reorder})}})})})},[r,e==null?void 0:e.OrderActions,o]);return s("div",{...n,className:E(["order-order-actions",t]),children:c})},v=()=>{const[t,a]=O(null);return N(()=>{const r=sessionStorage.getItem("orderStoreConfig"),e=r?JSON.parse(r):null;e?a(e):q().then(n=>{n&&(sessionStorage.setItem("orderStoreConfig",JSON.stringify(n)),a(n))})},[]),t},j=({orderData:t})=>{const[a,r]=O(t),[e,n]=O(t==null?void 0:t.status);return N(()=>{const o=_.on("order/data",c=>{r(c),n(c.status)},{eager:!0});return()=>{o==null||o.off()}},[]),{orderStatus:e,order:a}},J=`
2
2
  mutation CONFIRM_CANCEL_ORDER_MUTATION(
3
3
  $orderId: ID!,
4
4
  $confirmationKey: String!
@@ -16,5 +16,5 @@ import{jsx as i,jsxs as g,Fragment as v}from"@dropins/tools/preact-jsx-runtime.j
16
16
  }
17
17
  }
18
18
  }
19
- ${K}
20
- `,q=async(r,d)=>M(j,{variables:{orderId:r,confirmationKey:d}}).then(async({errors:o,data:e})=>{var n,c,a,m;const s=[...(n=e==null?void 0:e.confirmCancelOrder)!=null&&n.errorV2?[(c=e==null?void 0:e.confirmCancelOrder)==null?void 0:c.errorV2]:[],...o??[]];let t=null;return(a=e==null?void 0:e.confirmCancelOrder)!=null&&a.order&&(t=P((m=e==null?void 0:e.confirmCancelOrder)==null?void 0:m.order),y.emit("order/data",t)),s.length>0?F(s):t}),b=({enableOrderCancellation:r})=>{const d=u({orderCancelled:"Order.OrderStatusContent.orderCanceled.message"}),[o,e]=R({text:"",status:void 0});return E(()=>{if(!r)return;const s=new URLSearchParams(window.location.search),t=s.get("orderId"),n=s.get("confirmationKey");t&&n&&q(atob(t),n).then(()=>{e({text:d.orderCancelled,status:"success"})}).catch(c=>{e({text:c.message,status:"warning"})})},[r,d.orderCancelled]),{confirmOrderCancellation:o}},de=({slots:r,orderData:d,className:o,statusTitle:e,status:s})=>{const{orderStatus:t,order:n}=W({orderData:d}),[c,a]=$(!1),m=()=>{a(!0);const O=new URL(window.location.href),_=O.searchParams.get("orderId"),w=O.searchParams.get("confirmationKey");_&&w&&(O.searchParams.delete("orderId"),O.searchParams.delete("confirmationKey"),window.history.replaceState({},document.title,O.toString()))},N=u({cancelOrder:"Order.OrderStatusContent.actions.cancel"}),f=G(),{confirmOrderCancellation:l}=b({enableOrderCancellation:f==null?void 0:f.orderCancellationEnabled});return g("div",{className:S(["order-order-status",o]),children:[!c&&(l==null?void 0:l.status)!==void 0&&i(T,{heading:N.cancelOrder,onDismiss:m,description:l.text,type:l.status}),n?i(H,{title:e,status:s||t,slots:r,orderData:n}):i(U,{withCard:!1})]})};export{de as OrderStatus,de as default};
19
+ ${P}
20
+ `,z=async(t,a)=>G(J,{variables:{orderId:t,confirmationKey:a}}).then(async({errors:r,data:e})=>{var c,i,l,d;const n=[...(c=e==null?void 0:e.confirmCancelOrder)!=null&&c.errorV2?[(i=e==null?void 0:e.confirmCancelOrder)==null?void 0:i.errorV2]:[],...r??[]];let o=null;return(l=e==null?void 0:e.confirmCancelOrder)!=null&&l.order&&(o=k((d=e==null?void 0:e.confirmCancelOrder)==null?void 0:d.order),_.emit("order/data",o)),n.length>0?V(n):o}),B=({enableOrderCancellation:t})=>{const a=m({orderCancelled:"Order.OrderStatusContent.orderCanceled.message"}),[r,e]=O({text:"",status:void 0});return N(()=>{if(!t)return;const n=new URLSearchParams(window.location.search),o=n.get("orderId"),c=n.get("confirmationKey");o&&c&&z(atob(o),c).then(()=>{e({text:a.orderCancelled,status:"success"})}).catch(i=>{e({text:i.message,status:"warning"})})},[t,a.orderCancelled]),{confirmOrderCancellation:r}},Oe=({slots:t,orderData:a,className:r,statusTitle:e,status:n})=>{const{orderStatus:o,order:c}=j({orderData:a}),[i,l]=U(!1),d=()=>{l(!0);const C=new URL(window.location.href),I=C.searchParams.get("orderId"),A=C.searchParams.get("confirmationKey");I&&A&&(C.searchParams.delete("orderId"),C.searchParams.delete("confirmationKey"),window.history.replaceState({},document.title,C.toString()))},h=m({cancelOrder:"Order.OrderStatusContent.actions.cancel"}),g=v(),{confirmOrderCancellation:u}=B({enableOrderCancellation:g==null?void 0:g.orderCancellationEnabled});return p("div",{className:E(["order-order-status",r]),children:[!i&&(u==null?void 0:u.status)!==void 0&&s(L,{heading:h.cancelOrder,onDismiss:d,description:u.text,type:u.status}),c?s(H,{title:e,status:n||o,slots:t,orderData:c}):s(b,{withCard:!1})]})},Q=({orderRef:t})=>{const[a,r]=O(!1),e=()=>{r(!0)},n=()=>{r(!1)},o=v(),c=(o==null?void 0:o.orderCancellationReasons)??[],i=l=>l.map((d,h)=>({text:d==null?void 0:d.description,value:h.toString()}));return _.on("order/data",l=>{const d=String(l.status).toLocaleLowerCase();(d==="guest order cancellation requested"||d==="canceled")&&n()}),p(w,{children:[s(R,{variant:"secondary",onClick:e,"data-testid":"cancel-button",children:s(y,{id:"Order.OrderStatusContent.actions.cancel"})}),a&&s(M,{centered:!0,size:"medium",onClose:n,className:"order-order-cancel__modal",title:s("h2",{className:"order-order-cancel__title",children:s(y,{id:"Order.OrderCancelForm.title"})}),"data-testid":"order-cancellation-reasons-modal",children:s(K,{orderRef:t,cancelReasons:i(c)})})]})};export{Oe as OrderStatus,Oe as default};
@@ -1 +1 @@
1
- import{jsx as c}from"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/components.js";import"../chunks/OrderCancelReasonsForm.js";import{classes as S}from"@dropins/tools/lib.js";import"@dropins/tools/preact-compat.js";import{useState as i,useEffect as $,useCallback as h}from"@dropins/tools/preact-hooks.js";import{u as I,R as y}from"../chunks/useIsMobile.js";import"@dropins/tools/preact.js";import"@dropins/tools/event-bus.js";import{g as A}from"../chunks/getCustomerOrdersReturn.js";import{useText as M}from"@dropins/tools/i18n.js";import"../chunks/OrderLoaders.js";import"../chunks/network-error.js";import"../chunks/fetch-graphql.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/transform-order-details.js";import"../chunks/convertCase.js";const f={totalPages:1,currentPage:1,pageSize:1},T=()=>{const[s,n]=i(!0),[u,t]=i([]),[o,a]=i(f),[m,d]=i(1);$(()=>{A().then(e=>{t((e==null?void 0:e.ordersReturn)??[]),a((e==null?void 0:e.pageInfo)??f)}).finally(()=>{n(!1)})},[]);const l=h(e=>{d(e)},[]);return{pageInfo:o,selectedPage:m,loading:s,orderReturns:u,handleSetSelectPage:l}},J=({slots:s,withReturnsListButton:n,className:u,minifiedView:t,withHeader:o,withThumbnails:a,returnsInMinifiedView:m,routeReturnDetails:d,routeOrderDetails:l,routeTracking:e,routeReturnsList:g,routeProductDetails:L})=>{const{pageInfo:R,selectedPage:p,handleSetSelectPage:O,loading:b,orderReturns:P}=T(),w=I(),r=t?"minifiedView":"fullSizeView",N=M({viewAllOrdersButton:`Order.Returns.${r}.returnsList.viewAllOrdersButton`,ariaLabelLink:`Order.Returns.${r}.returnsList.ariaLabelLink`,emptyOrdersListMessage:`Order.Returns.${r}.returnsList.emptyOrdersListMessage`,minifiedViewTitle:`Order.Returns.${r}.returnsList.minifiedViewTitle`,orderNumber:`Order.Returns.${r}.returnsList.orderNumber`,returnNumber:`Order.Returns.${r}.returnsList.returnNumber`,carrier:`Order.Returns.${r}.returnsList.carrier`});return c("div",{className:S(["order-returns-list",u]),children:c(y,{minifiedViewKey:r,withOrderNumber:!0,withReturnNumber:!0,slots:s,selectedPage:p,handleSetSelectPage:O,pageInfo:R,withReturnsListButton:n,isMobile:w,orderReturns:P,translations:N,withHeader:o,returnsInMinifiedView:m,withThumbnails:a,minifiedView:t,routeReturnDetails:d,routeOrderDetails:l,routeTracking:e,routeReturnsList:g,routeProductDetails:L,loading:b})})};export{J as default};
1
+ import{jsx as c}from"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/components.js";import"../chunks/OrderCancel.js";import{classes as S}from"@dropins/tools/lib.js";import"@dropins/tools/preact-compat.js";import{useState as i,useEffect as $,useCallback as h}from"@dropins/tools/preact-hooks.js";import{u as I,R as y}from"../chunks/useIsMobile.js";import"@dropins/tools/preact.js";import"@dropins/tools/event-bus.js";import{g as A}from"../chunks/getCustomerOrdersReturn.js";import{useText as M}from"@dropins/tools/i18n.js";import"../chunks/OrderLoaders.js";import"../chunks/network-error.js";import"../chunks/fetch-graphql.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/transform-order-details.js";import"../chunks/convertCase.js";const f={totalPages:1,currentPage:1,pageSize:1},T=()=>{const[s,n]=i(!0),[u,t]=i([]),[o,a]=i(f),[m,d]=i(1);$(()=>{A().then(e=>{t((e==null?void 0:e.ordersReturn)??[]),a((e==null?void 0:e.pageInfo)??f)}).finally(()=>{n(!1)})},[]);const l=h(e=>{d(e)},[]);return{pageInfo:o,selectedPage:m,loading:s,orderReturns:u,handleSetSelectPage:l}},J=({slots:s,withReturnsListButton:n,className:u,minifiedView:t,withHeader:o,withThumbnails:a,returnsInMinifiedView:m,routeReturnDetails:d,routeOrderDetails:l,routeTracking:e,routeReturnsList:g,routeProductDetails:L})=>{const{pageInfo:R,selectedPage:p,handleSetSelectPage:O,loading:b,orderReturns:P}=T(),w=I(),r=t?"minifiedView":"fullSizeView",N=M({viewAllOrdersButton:`Order.Returns.${r}.returnsList.viewAllOrdersButton`,ariaLabelLink:`Order.Returns.${r}.returnsList.ariaLabelLink`,emptyOrdersListMessage:`Order.Returns.${r}.returnsList.emptyOrdersListMessage`,minifiedViewTitle:`Order.Returns.${r}.returnsList.minifiedViewTitle`,orderNumber:`Order.Returns.${r}.returnsList.orderNumber`,returnNumber:`Order.Returns.${r}.returnsList.returnNumber`,carrier:`Order.Returns.${r}.returnsList.carrier`});return c("div",{className:S(["order-returns-list",u]),children:c(y,{minifiedViewKey:r,withOrderNumber:!0,withReturnNumber:!0,slots:s,selectedPage:p,handleSetSelectPage:O,pageInfo:R,withReturnsListButton:n,isMobile:w,orderReturns:P,translations:N,withHeader:o,returnsInMinifiedView:m,withThumbnails:a,minifiedView:t,routeReturnDetails:d,routeOrderDetails:l,routeTracking:e,routeReturnsList:g,routeProductDetails:L,loading:b})})};export{J as default};
@@ -1 +1 @@
1
- import{jsxs as s,jsx as e,Fragment as S}from"@dropins/tools/preact-jsx-runtime.js";import{Slot as x,classes as F}from"@dropins/tools/lib.js";import{Card as f,Header as m,Accordion as w,AccordionSection as G,ContentGrid as q,Image as $}from"@dropins/tools/components.js";import"../chunks/OrderCancelReasonsForm.js";import{useText as V,Text as H}from"@dropins/tools/i18n.js";import{C as W}from"../chunks/OrderLoaders.js";import"@dropins/tools/preact-compat.js";import{useState as z,useEffect as B}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/preact.js";import{events as J}from"@dropins/tools/event-bus.js";var T=(n=>(n.PENDING="pending",n.SHIPPING="shipping",n.COMPLETE="complete",n.PROCESSING="processing",n.HOLD="on hold",n.CANCELED="Canceled",n.SUSPECTED_FRAUD="suspected fraud",n.PAYMENT_REVIEW="payment review",n))(T||{});const K=({slots:n,orderData:i,collapseThreshold:t=10,routeProductDetails:c})=>{var I,u,v,O,L;const d=V({carrier:"Order.ShippingStatusCard.carrier",prepositionOf:"Order.ShippingStatusCard.prepositionOf",shippingCardTitle:"Order.ShippingStatusCard.shippingCardTitle",shippingInfoTitle:"Order.ShippingStatusCard.shippingInfoTitle",notYetShippedTitle:"Order.ShippingStatusCard.notYetShippedTitle",notYetShippedImagesTitle:"Order.ShippingStatusCard.notYetShippedImagesTitle",noInfoTitle:"Order.OrderStatusContent.noInfoTitle"}),g=c?"a":"span",a=(I=i==null?void 0:i.status)==null?void 0:I.toLocaleLowerCase(),M=((u=i==null?void 0:i.shipments)==null?void 0:u.length)===1&&(a==null?void 0:a.includes(T.COMPLETE)),l=(v=i==null?void 0:i.items)==null?void 0:v.filter(r=>(r==null?void 0:r.quantityShipped)===0);if(!i||a!=null&&a.includes(T.CANCELED))return null;if(!((O=i==null?void 0:i.shipments)!=null&&O.length))return s(f,{variant:"secondary",className:"order-shipping-status-card",children:[e(m,{title:d.shippingInfoTitle}),e("div",{className:"order-shipping-status-card__header",children:s("div",{className:"order-shipping-status-card__header--content",children:[i!=null&&i.carrier?e("p",{children:i==null?void 0:i.carrier}):null,e("p",{children:d.noInfoTitle})]})})]});const R=e(H,{id:"Order.ShippingStatusCard.notYetShippedItem",plural:l==null?void 0:l.length});return s(S,{children:[(L=i==null?void 0:i.shipments)==null?void 0:L.map(({tracking:r,items:h,id:o},U)=>{const Y=e(H,{id:"Order.ShippingStatusCard.notYetShippedItem",plural:h==null?void 0:h.length});return s(f,{variant:"secondary",className:"order-shipping-status-card",children:[e(m,{title:d.shippingCardTitle}),r==null?void 0:r.map(p=>{var C;return s("div",{className:"order-shipping-status-card__header",role:"status",children:[s("div",{className:"order-shipping-status-card__header--content",children:[s("p",{children:[d.carrier," ",(C=p==null?void 0:p.carrier)==null?void 0:C.toLocaleUpperCase()," | ",p==null?void 0:p.number]}),e("p",{children:p==null?void 0:p.title})]}),n!=null&&n.DeliveryTrackActions?e(x,{"data-testid":"deliverySlotActions",name:"DeliveryTrackActions",slot:n==null?void 0:n.DeliveryTrackActions,context:{trackInformation:p}}):null]},p.number)}),M?null:e(w,{actionIconPosition:"right","data-testid":"dropinAccordion",children:e(G,{"data-position":U+1,defaultOpen:t>=(h==null?void 0:h.length),title:s(S,{children:[`${d.notYetShippedImagesTitle} (${h==null?void 0:h.length} `,Y,")"]}),children:e(q,{maxColumns:6,emptyGridContent:e(S,{}),className:"order-shipping-status-card__images",children:h==null?void 0:h.map(p=>{var y,_,A,b,E,N;const C=(A=(_=(y=p==null?void 0:p.orderItem)==null?void 0:y.product)==null?void 0:_.thumbnail)==null?void 0:A.label,j=(N=(E=(b=p==null?void 0:p.orderItem)==null?void 0:b.product)==null?void 0:E.thumbnail)==null?void 0:N.url;return e(g,{href:(c==null?void 0:c(p))??"#",children:e($,{alt:C,src:j||"",width:85,height:114})},p.id)})})})}),n!=null&&n.DeliveryTimeLine?e(x,{"data-testid":"deliverySlotTimeLine",name:"DeliveryTimeLine",slot:n==null?void 0:n.DeliveryTimeLine,context:{}}):null]},o)}),l!=null&&l.length?s(f,{variant:"secondary",className:"order-shipping-status-card","data-testid":"dropinAccordionNotYetShipped2",children:[e(m,{title:d.notYetShippedTitle}),e(w,{actionIconPosition:"right",children:e(G,{defaultOpen:t>=(l==null?void 0:l.length),title:s(S,{children:[`${d.notYetShippedImagesTitle} (${l==null?void 0:l.length} `,R,")"]}),children:e("div",{className:"order-shipping-status-card__images",children:l==null?void 0:l.map(r=>{var h,o;return e(g,{href:(c==null?void 0:c(r))??"#",children:e($,{alt:(h=r.thumbnail)==null?void 0:h.label,src:((o=r.thumbnail)==null?void 0:o.url)||"",width:85,height:114})},r.id)})})})})]}):null]})},Q=({orderData:n})=>{const[i,t]=z(n);return B(()=>{const c=J.on("order/data",d=>{t(d)},{eager:!0});return()=>{c==null||c.off()}},[]),{order:i}},rn=({slots:n,className:i,collapseThreshold:t,orderData:c,routeProductDetails:d})=>{const{order:g}=Q({orderData:c});return e("div",{className:F(["order-shipping-status",i]),children:g?e(K,{slots:n,orderData:g,collapseThreshold:t,routeProductDetails:d}):e(W,{withCard:!1})})};export{rn as ShippingStatus,rn as default};
1
+ import{jsxs as d,jsx as e,Fragment as S}from"@dropins/tools/preact-jsx-runtime.js";import{Slot as V,classes as q}from"@dropins/tools/lib.js";import{Card as m,Header as T,Accordion as $,AccordionSection as H,ContentGrid as W,Image as M}from"@dropins/tools/components.js";import"../chunks/OrderCancel.js";import{useText as z,Text as R}from"@dropins/tools/i18n.js";import{C as B}from"../chunks/OrderLoaders.js";import"@dropins/tools/preact-compat.js";import{useState as I,useEffect as J}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/preact.js";import{events as K}from"@dropins/tools/event-bus.js";var v=(i=>(i.PENDING="pending",i.SHIPPING="shipping",i.COMPLETE="complete",i.PROCESSING="processing",i.HOLD="on hold",i.CANCELED="Canceled",i.SUSPECTED_FRAUD="suspected fraud",i.PAYMENT_REVIEW="payment review",i))(v||{});const Q=({slots:i,orderData:n,collapseThreshold:g=10,routeProductDetails:c})=>{var O,L,y,_,A;const t=z({carrier:"Order.ShippingStatusCard.carrier",prepositionOf:"Order.ShippingStatusCard.prepositionOf",shippingCardTitle:"Order.ShippingStatusCard.shippingCardTitle",shippingInfoTitle:"Order.ShippingStatusCard.shippingInfoTitle",notYetShippedTitle:"Order.ShippingStatusCard.notYetShippedTitle",notYetShippedImagesTitle:"Order.ShippingStatusCard.notYetShippedImagesTitle",noInfoTitle:"Order.OrderStatusContent.noInfoTitle"}),a=c?"a":"span",r=(O=n==null?void 0:n.status)==null?void 0:O.toLocaleLowerCase(),f=((L=n==null?void 0:n.shipments)==null?void 0:L.length)===1&&(r==null?void 0:r.includes(v.COMPLETE)),p=(y=n==null?void 0:n.items)==null?void 0:y.filter(s=>(s==null?void 0:s.quantityShipped)===0);if(!n||r!=null&&r.includes(v.CANCELED))return null;if(!((_=n==null?void 0:n.shipments)!=null&&_.length))return d(m,{variant:"secondary",className:"order-shipping-status-card",children:[e(T,{title:t.shippingInfoTitle}),e("div",{className:"order-shipping-status-card__header",children:d("div",{className:"order-shipping-status-card__header--content",children:[n!=null&&n.carrier?e("p",{children:n==null?void 0:n.carrier}):null,e("p",{children:t.noInfoTitle})]})})]});const U=e(R,{id:"Order.ShippingStatusCard.notYetShippedItem",plural:p==null?void 0:p.length});return d(S,{children:[(A=n==null?void 0:n.shipments)==null?void 0:A.map(({tracking:s,items:h,id:u},Y)=>{const j=e(R,{id:"Order.ShippingStatusCard.notYetShippedItem",plural:h==null?void 0:h.length});return d(m,{variant:"secondary",className:"order-shipping-status-card",children:[e(T,{title:t.shippingCardTitle}),s==null?void 0:s.map(l=>{var C;return d("div",{className:"order-shipping-status-card__header",role:"status",children:[d("div",{className:"order-shipping-status-card__header--content",children:[d("p",{children:[t.carrier," ",(C=l==null?void 0:l.carrier)==null?void 0:C.toLocaleUpperCase()," | ",l==null?void 0:l.number]}),e("p",{children:l==null?void 0:l.title})]}),i!=null&&i.DeliveryTrackActions?e(V,{"data-testid":"deliverySlotActions",name:"DeliveryTrackActions",slot:i==null?void 0:i.DeliveryTrackActions,context:{trackInformation:l}}):null]},l.number)}),f?null:e($,{actionIconPosition:"right","data-testid":"dropinAccordion",children:e(H,{"data-position":Y+1,defaultOpen:g>=(h==null?void 0:h.length),title:d(S,{children:[`${t.notYetShippedImagesTitle} (${h==null?void 0:h.length} `,j,")"]}),children:e(W,{maxColumns:6,emptyGridContent:e(S,{}),className:"order-shipping-status-card__images",children:h==null?void 0:h.map(l=>{var b,E,N,x,w,G;const C=(N=(E=(b=l==null?void 0:l.orderItem)==null?void 0:b.product)==null?void 0:E.thumbnail)==null?void 0:N.label,F=(G=(w=(x=l==null?void 0:l.orderItem)==null?void 0:x.product)==null?void 0:w.thumbnail)==null?void 0:G.url;return e(a,{href:(c==null?void 0:c(l))??"#",children:e(M,{alt:C,src:F||"",width:85,height:114})},l.id)})})})}),i!=null&&i.DeliveryTimeLine?e(V,{"data-testid":"deliverySlotTimeLine",name:"DeliveryTimeLine",slot:i==null?void 0:i.DeliveryTimeLine,context:{}}):null]},u)}),p!=null&&p.length?d(m,{variant:"secondary",className:"order-shipping-status-card","data-testid":"dropinAccordionNotYetShipped2",children:[e(T,{title:t.notYetShippedTitle}),e($,{actionIconPosition:"right",children:e(H,{defaultOpen:g>=(p==null?void 0:p.length),title:d(S,{children:[`${t.notYetShippedImagesTitle} (${p==null?void 0:p.length} `,U,")"]}),children:e("div",{className:"order-shipping-status-card__images",children:p==null?void 0:p.map(s=>{var h,u;return e(a,{href:(c==null?void 0:c(s))??"#",children:e(M,{alt:(h=s.thumbnail)==null?void 0:h.label,src:((u=s.thumbnail)==null?void 0:u.url)||"",width:85,height:114})},s.id)})})})})]}):null]})},X=({orderData:i})=>{const[n,g]=I(!0),[c,t]=I(i),[a,r]=I(!1);return J(()=>{const o=K.on("order/data",f=>{t(f),r(f==null?void 0:f.isVirtual),g(!1)},{eager:!0});return()=>{o==null||o.off()}},[]),{loading:n,order:c,isVirtualProduct:a}},si=({slots:i,className:n,collapseThreshold:g,orderData:c,routeProductDetails:t})=>{const{loading:a,order:r,isVirtualProduct:o}=X({orderData:c});return!a&&o?null:e("div",{className:q(["order-shipping-status",n]),children:!a&&r?e(Q,{slots:i,orderData:r,collapseThreshold:g,routeProductDetails:t}):e(B,{withCard:!1})})};export{si as ShippingStatus,si as default};
@@ -5,6 +5,6 @@ export * from './CustomerDetails';
5
5
  export * from './ReturnsList';
6
6
  export * from './OrderProductList';
7
7
  export * from './OrderCostSummary';
8
- export * from './OrderCancel';
9
8
  export * from './OrderReturns';
9
+ export * from './OrderCancelForm';
10
10
  //# sourceMappingURL=index.d.ts.map
@@ -19,6 +19,7 @@ export type OrderAddressModel = {
19
19
  }[];
20
20
  } | null;
21
21
  export type OrderItemProductModel = {
22
+ __typename: string;
22
23
  stockStatus?: string;
23
24
  canonicalUrl?: string;
24
25
  urlKey?: string;
@@ -2,6 +2,8 @@ import { OrderDataModel } from '../../data/models';
2
2
  import { UseShippingStatusProps } from '../../types';
3
3
 
4
4
  export declare const useShippingStatus: ({ orderData }: UseShippingStatusProps) => {
5
+ loading: boolean;
5
6
  order: OrderDataModel | undefined;
7
+ isVirtualProduct: boolean;
6
8
  };
7
9
  //# sourceMappingURL=useShippingStatus.d.ts.map
@@ -205,7 +205,7 @@ declare const _default: {
205
205
  "OrderCancel": {
206
206
  "buttonText": "Cancel Order"
207
207
  },
208
- "OrderCancellationReasonsForm": {
208
+ "OrderCancelForm": {
209
209
  "title": "Cancel order",
210
210
  "description": "Select a reason for canceling the order",
211
211
  "label": "Reason for cancel",
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name": "@dropins/storefront-order", "version": "0.1.0-alpha14", "@dropins/elsie": "0.34.0"}
1
+ {"name": "@dropins/storefront-order", "version": "0.1.0-alpha16", "@dropins/elsie": "0.34.0"}
package/render.js CHANGED
@@ -1,2 +1,2 @@
1
- (function(n,e){try{if(typeof document<"u"){const r=document.createElement("style"),a=e.styleId;for(const t in e.attributes)r.setAttribute(t,e.attributes[t]);r.setAttribute("data-dropin",a),r.appendChild(document.createTextNode(n));const o=document.querySelector('style[data-dropin="sdk"]');if(o)o.after(r);else{const t=document.querySelector('link[rel="stylesheet"], style');t?t.before(r):document.head.append(r)}}}catch(r){console.error("dropin-styles (injectCodeFunction)",r)}})('.order-order-search-form{gap:var(--spacing-small);border-color:transparent}.order-order-search-form .dropin-card__content{padding:var(--spacing-big) var(--spacing-xxbig) var(--spacing-xxbig) var(--spacing-xxbig)}.order-order-search-form p{color:var(--color-neutral-700);font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);margin:0}.order-order-search-form__title{color:var(--color-neutral-800);font:var(--type-headline-2-strong-font);letter-spacing:var(--type-headline-2-strong-letter-spacing);margin:0}.order-order-search-form__wrapper{display:grid;grid-template-columns:1fr;grid-template-rows:auto;grid-template-areas:"email" "postcode" "number" "button";gap:var(--spacing-medium)}.order-order-search-form__wrapper__item--email{grid-area:email}.order-order-search-form__wrapper__item--postcode{grid-area:postcode}.order-order-search-form__wrapper__item--number{grid-area:number}.order-order-search-form__button-container{display:flex;justify-content:flex-end;grid-area:button}.order-order-search-form form button{align-self:flex-end;justify-self:flex-end;margin-top:var(--spacing-small)}@media (min-width: 768px){.order-order-search-form__wrapper{grid-template-columns:1fr 1fr;grid-template-rows:auto auto auto;grid-template-areas:"email postcode" "number number" "button button"}}.order-order-status-content .dropin-card__content{gap:0}.order-order-status-content__wrapper p{padding:0;margin:0;box-sizing:border-box;font:var(--type-body-1-strong-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.order-order-status-content__wrapper-description{margin-bottom:var(--spacing-medium)}.order-shipping-status-card .dropin-card__content{gap:0}.order-shipping-status-card--count-steper{font:var(--type-headline-2-strong-font);letter-spacing:var(--type-headline-2-strong-letter-spacing)}.order-shipping-status-card__header{display:grid;grid-template-columns:1fr auto;justify-items:self-start;align-items:center;margin-bottom:var(--spacing-xsmall)}.order-shipping-status-card__header button{max-height:40px}.order-shipping-status-card__header--content p{margin:0;padding:0;margin-bottom:var(--spacing-xsmall)}.order-shipping-status-card .order-shipping-status-card__images .dropin-content-grid__content{grid-template-columns:repeat(6,max-content)!important;overflow:auto!important}.order-shipping-status-card .order-shipping-status-card__images img{object-fit:contain;width:85px;height:114px}.order-order-loaders--card-loader{margin-bottom:var(--spacing-small)}.order-order-actions__wrapper{display:flex;justify-content:space-between;gap:0 var(--spacing-small);margin-bottom:var(--spacing-small);margin-top:var(--spacing-medium)}.order-order-actions__wrapper button{width:100%;font:var(--type-body-1-strong-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.order-order-actions__wrapper--empty{display:none}.order-customer-details-content .dropin-card__content{gap:0}.order-customer-details-content__container{display:grid;flex-direction:column;gap:var(--spacing-medium)}@media (min-width: 768px){.order-customer-details-content__container{display:grid;grid-template-columns:auto;grid-template-rows:auto auto auto;gap:var(--spacing-medium);grid-auto-flow:row}.order-customer-details-content__container-email{grid-area:1 / 1 / 2 / 2}.order-customer-details-content__container-shipping_address{grid-area:2 / 1 / 3 / 2}.order-customer-details-content__container-billing_address{grid-area:2 / 2 / 3 / 3}.order-customer-details-content__container-shipping_methods{grid-area:3 / 1 / 4 / 2}.order-customer-details-content__container-payment_methods{grid-area:3 / 2 / 4 / 3}}.order-customer-details-content__container-title{font:var(--type-body-1-strong-font);letter-spacing:var(--type-body-1-strong-letter-spacing);margin:0 0 var(--spacing-xsmall) 0}.order-customer-details-content__container p{color:var(--color-neutral-800);font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);margin-top:0}.order-customer-details-content__container-payment_methods p{display:grid;gap:0;grid-template-columns:auto 1fr}.order-customer-details-content__container-payment_methods p.order-customer-details-content__container-payment_methods--icon{gap:0 var(--spacing-xsmall)}.order-customer-details-content__container-description p{margin:0 var(--spacing-xsmall) 0 0;line-height:var(--spacing-big);padding:0}.order-customer-details-content__container-description p:nth-child(1),.order-customer-details-content__container-description p:nth-child(3),.order-customer-details-content__container-description p:nth-child(4),.order-customer-details-content__container-description p:nth-child(6){float:left}.order-empty-list{margin-bottom:var(--spacing-small)}.order-empty-list.order-empty-list--minified,.order-empty-list .dropin-card{border:none}.order-empty-list .dropin-card__content{gap:0;padding:var(--spacing-xxbig)}.order-empty-list.order-empty-list--minified .dropin-card__content{flex-direction:row;align-items:center;padding:var(--spacing-big) var(--spacing-small)}.order-empty-list .dropin-card__content svg{width:64px;height:64px;margin-bottom:var(--spacing-medium)}.order-empty-list.order-empty-list--minified .dropin-card__content svg{margin:0 var(--spacing-small) 0 0;width:32px;height:32px}.order-empty-list .dropin-card__content svg path{fill:var(--color-neutral-800)}.order-empty-list.order-empty-list--minified .dropin-card__content svg path{fill:var(--color-neutral-500)}.order-empty-list--empty-box .dropin-card__content svg path{fill:var(--color-neutral-500)}.order-empty-list .dropin-card__content p{font:var(--type-headline-1-font);letter-spacing:var(--type-headline-1-letter-spacing);color:var(--color-neutral-800)}.order-empty-list.order-empty-list--minified .dropin-card__content p{font:var(--type-body-1-strong-font);color:var(--color-neutral-800)}.order-returns-list-content .order-returns__header--minified{margin-bottom:var(--spacing-small)}.order-returns-list-content .order-returns__header--full-size{margin-bottom:0}.order-returns-list-content__cards-list{margin-bottom:var(--spacing-small)}.order-returns-list-content__cards-list .dropin-card__content{gap:0}.order-returns-list-content__cards-grid{display:grid;grid-template-columns:1fr 1fr auto;gap:0px 0px;grid-template-areas:"descriptions descriptions actions" "images images actions"}.order-returns-list-content__descriptions{grid-area:descriptions}.order-returns-list-content__descriptions p{margin:0 0 var(--spacing-small) 0;padding:0;box-sizing:border-box;font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing);color:var(--color-neutral-800)}.order-returns-list-content__descriptions p a{display:inline-block;font:var(--type-button-2-font);letter-spacing:var(--type-button-2-letter-spacing);color:var(--color-brand-800)}.order-returns-list-content__descriptions p a:hover{color:var(--color-brand-800)}.order-returns-list-content__descriptions .order-returns-list-content__return-status{font:var(--type-button-2-font);font-weight:500;color:var(--color-neutral-800)}.order-returns-list-content .order-returns-list-content__actions{margin:0;padding:0;border:none;background-color:transparent;cursor:pointer;text-decoration:none}.order-returns-list-content .order-returns-list-content__actions:hover{text-decoration:none;color:var(--color-brand-500)}.order-returns-list-content__card .dropin-card__content{padding:var(--spacing-small) var(--spacing-medium)}.order-returns-list-content__card .order-returns-list-content__card-wrapper{display:flex;justify-content:space-between;align-items:center;color:var(--color-neutral-800);height:calc(88px - var(--spacing-small) * 2)}.order-returns-list-content__card-wrapper>p{font:var(--type-button-2-font);letter-spacing:var(--type-button-2-letter-spacing)}.order-returns-list-content__card-wrapper svg{color:var(--color-neutral-800)}.order-returns-list-content__images{margin-top:var(--spacing-small);grid-area:images}.order-returns-list-content__actions{grid-area:actions;align-self:center}.order-returns-list-content .order-returns-list-content__images{overflow:auto}.order-returns-list-content .order-returns-list-content__images .dropin-content-grid__content{grid-template-columns:repeat(6,max-content)!important}.order-returns-list-content .order-returns-list-content__images-3 .dropin-content-grid__content{grid-template-columns:repeat(3,max-content)!important}.order-returns-list-content .order-returns-list-content__images img{object-fit:contain;width:65px;height:65px}.order-order-product-list-content__items{display:grid;gap:var(--spacing-medium);list-style:none;margin:0;padding:0}.dropin-card__content{gap:0}.order-order-product-list-content__items .dropin-card__content{gap:var(--spacing-xsmall)}.order-order-product-list-content .dropin-cart-item__alert{margin-top:var(--spacing-xsmall)}.order-order-product-list-content .cart-summary-item__title--strikethrough{text-decoration:line-through;color:var(--color-neutral-500);font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}@media only screen and (min-width: 320px) and (max-width: 768px){.order-confirmation-cart-summary-item{margin-bottom:var(--spacing-medium)}}.order-cost-summary-content .dropin-card__content{gap:0}.order-cost-summary-content__description{margin-bottom:var(--spacing-xsmall)}.order-cost-summary-content__description .order-cost-summary-content__description--header,.order-cost-summary-content__description .order-cost-summary-content__description--subheader{display:flex;justify-content:space-between;align-items:center}.order-cost-summary-content__description .order-cost-summary-content__description--header span{color:var(--color-neutral-800);font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.order-cost-summary-content__description--subheader{margin-top:var(--spacing-xxsmall)}.order-cost-summary-content__description--subheader span{font:var(--type-details-caption-2-font);letter-spacing:var(--type-details-caption-2-letter-spacing);color:var(--color-brand-700)}.order-cost-summary-content__description--subtotal .order-cost-summary-content__description--subheader,.order-cost-summary-content__description--shipping .order-cost-summary-content__description--subheader{display:flex;justify-content:flex-start;align-items:center;gap:0 var(--spacing-xxsmall)}.order-cost-summary-content__description--subtotal .order-cost-summary-content__description--subheader .dropin-price,.order-cost-summary-content__description--shipping .order-cost-summary-content__description--subheader .dropin-price{font:var(--type-details-overline-font)}.order-cost-summary-content__description--discount .order-cost-summary-content__description--header span:last-child{color:var(--color-alert-800)}.order-cost-summary-content__description--discount .order-cost-summary-content__description--subheader span:first-child{display:flex;justify-content:flex-start;align-items:flex-end;gap:0 var(--spacing-xsmall)}.order-cost-summary-content__description--discount .order-cost-summary-content__description--subheader span:first-child span{font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing);color:var(--color-neutral-700)}.order-cost-summary-content__description--discount .order-cost-summary-content__description--subheader .dropin-price{font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing);color:var(--color-alert-800)}.order-cost-summary-content__description--total{margin-top:var(--spacing-medium)}.order-cost-summary-content__description--total .order-cost-summary-content__description--header span{font:var(--type-body-1-emphasized-font);letter-spacing:var(--type-body-1-emphasized-letter-spacing)}.order-cost-summary-content__accordion .dropin-accordion-section .dropin-accordion-section__content-container{gap:var(--spacing-small);margin:var(--spacing-small) 0}.order-cost-summary-content__accordion-row{display:flex;justify-content:space-between;align-items:center}.order-cost-summary-content__accordion-row p{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing)}.order-cost-summary-content__accordion-row p:first-child{color:var(--color-neutral-700)}.order-cost-summary-content__accordion .order-cost-summary-content__accordion-row.order-cost-summary-content__accordion-total p:first-child{font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.order-order-cancel-reasons-form__text{color:var(--color-neutral-800);font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing);padding-bottom:var(--spacing-xsmall)}.order-order-cancel-reasons-form__button-container{display:grid;margin-top:var(--spacing-xbig);justify-content:end}',{styleId:"order"});
2
- import{jsx as r}from"@dropins/tools/preact-jsx-runtime.js";import{Render as a}from"@dropins/tools/lib.js";import{useState as n,useEffect as d}from"@dropins/tools/preact-hooks.js";import{UIProvider as l}from"@dropins/tools/components.js";import{events as c}from"@dropins/tools/event-bus.js";const u={OrderCostSummary:{headerText:"Order summary",subtotal:{title:"Subtotal"},shipping:{title:"Shipping",freeShipping:"Free shipping"},tax:{accordionTitle:"Taxes",accordionTotalTax:"Tax Total",totalExcludingTaxes:"Total excluding taxes",title:"Tax",incl:"Including taxes",excl:"Excluding taxes"},discount:{title:"Discount",subtitle:"discounted"},total:{title:"Total"}},Returns:{minifiedView:{returnsList:{viewAllOrdersButton:"View all returns",ariaLabelLink:"Redirect to full order information",emptyOrdersListMessage:"No returns",minifiedViewTitle:"Recent returns",orderNumber:"Order number:",returnNumber:"Return number:",carrier:"Carrier:",itemText:{none:"",one:"item",many:"items"},resturnStatus:{pending:"Pending",authorized:"Authorized",partiallyAuthorized:"Partially authorized",received:"Received",partiallyReceived:"Partially received",approved:"Approved",partiallyApproved:"Partially approved",rejected:"Rejected",partiallyRejected:"Partially rejected",denied:"Denied",processedAndClosed:"Processed and closed",closed:"Closed"}}},fullSizeView:{returnsList:{viewAllOrdersButton:"View all orders",ariaLabelLink:"Redirect to full order information",emptyOrdersListMessage:"No returns",minifiedViewTitle:"Returns",orderNumber:"Order number:",returnNumber:"Return number:",carrier:"Carrier:",itemText:{none:"",one:"item",many:"items"},resturnStatus:{pending:"Pending",authorized:"Authorized",partiallyAuthorized:"Partially authorized",received:"Received",partiallyReceived:"Partially received",approved:"Approved",partiallyApproved:"Partially approved",rejected:"Rejected",partiallyRejected:"Partially rejected",denied:"Denied",processedAndClosed:"Processed and closed",closed:"Closed"}}}},OrderProductListContent:{cancelledTitle:"Cancelled",allOrdersTitle:"Your order",downloadableCount:"Files",stockStatus:{inStock:"In stock",outOfStock:"Out of stock"},GiftCard:{sender:"Sender",recipient:"Recipient",message:"Note"}},OrderSearchForm:{title:"Enter your information to view order details",description:"You can find your order number in the receipt you received via email.",button:"View Order",email:"Email",postcode:"Zip Code",orderNumber:"Order Number"},Form:{notifications:{requiredFieldError:"This is a required field."}},ShippingStatusCard:{trackButton:"Track package",carrier:"Carrier:",prepositionOf:"of",shippingCardTitle:"Package details",shippingInfoTitle:"Shipping info",notYetShippedTitle:"Not yet shipped",notYetShippedImagesTitle:"Package contents",notYetShippedItem:{singular:"item",plural:"items"}},OrderStatusContent:{noInfoTitle:"Check back later for more details.",actions:{cancel:"Cancel order",return:"Return or replace",reorder:"Reorder"},orderPending:{title:"Pending",message:"The order was successfully placed on {DATE} and your order is processing. Check back for more details when your order ships.",messageWithoutDate:"Your order is processing. Check back for more details when your order ships."},orderProcessing:{title:"Processing",message:"The order was successfully placed on {DATE} and your order is processing. Check back for more details when your order ships.",messageWithoutDate:"Your order is processing. Check back for more details when your order ships."},orderOnHold:{title:"On hold",message:"We’ve run into an issue while processing your order on {DATE}. Please check back later or contact us at support@adobe.com for more information.",messageWithoutDate:"We’ve run into an issue while processing your order. Please check back later or contact us at support@adobe.com for more information."},orderReceived:{title:"Order received",message:"The order was successfully placed on {DATE} and your order is processing. Check back for more details when your order ships.",messageWithoutDate:"Your order is processing. Check back for more details when your order ships."},orderComplete:{title:"Complete",message:"Your order is complete. Need help with your order? Contact us at support@adobe.com"},orderCanceled:{title:"Canceled",message:"This order was cancelled by you. You should see a refund to your original payment method with 5-7 business days.",messageWithoutDate:"This order was cancelled by you. You should see a refund to your original payment method with 5-7 business days."},orderSuspectedFraud:{title:"Suspected fraud",message:"We’ve run into an issue while processing your order on {DATE}. Please check back later or contact us at support@adobe.com for more information.",messageWithoutDate:"We’ve run into an issue while processing your order. Please check back later or contact us at support@adobe.com for more information."},orderPaymentReview:{title:"Payment Review",message:"The order was successfully placed on {DATE} and your order is processing. Check back for more details when your order ships.",messageWithoutDate:"Your order is processing. Check back for more details when your order ships."},guestOrderCancellationRequested:{title:"cancellation requested",message:"The cancellation has been requested on {DATE}. Check your email for further instructions.",messageWithoutDate:"The cancellation has been requested. Check your email for further instructions."}},CustomerDetails:{headerText:"Customer information",freeShipping:"Free shipping",email:{title:"Contact details"},shippingAddress:{title:"Shipping address"},shippingMethods:{title:"Shipping method"},billingAddress:{title:"Billing address"},billingMethods:{title:"Payment method"}},Errors:{invalidOrder:"Invalid order. Please try again.",invalidSearch:"No order found with these order details."},OrderCancel:{buttonText:"Cancel Order"},OrderCancellationReasonsForm:{title:"Cancel order",description:"Select a reason for canceling the order",label:"Reason for cancel",button:"Submit Cancellation",errorHeading:"Error",errorDescription:"There was an error processing your order cancellation."}},p={Order:u},m={default:p},h=({children:t})=>{const[o,i]=n("en_US");return d(()=>{const e=c.on("locale",s=>{i(s)},{eager:!0});return()=>{e==null||e.off()}},[]),r(l,{lang:o,langDefinitions:m,children:t})},T=new a(r(h,{}));export{T as render};
1
+ (function(n,e){try{if(typeof document<"u"){const r=document.createElement("style"),a=e.styleId;for(const t in e.attributes)r.setAttribute(t,e.attributes[t]);r.setAttribute("data-dropin",a),r.appendChild(document.createTextNode(n));const o=document.querySelector('style[data-dropin="sdk"]');if(o)o.after(r);else{const t=document.querySelector('link[rel="stylesheet"], style');t?t.before(r):document.head.append(r)}}}catch(r){console.error("dropin-styles (injectCodeFunction)",r)}})('.order-order-search-form{gap:var(--spacing-small);border-color:transparent}.order-order-search-form .dropin-card__content{padding:var(--spacing-big) var(--spacing-xxbig) var(--spacing-xxbig) var(--spacing-xxbig)}.order-order-search-form p{color:var(--color-neutral-700);font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);margin:0}.order-order-search-form__title{color:var(--color-neutral-800);font:var(--type-headline-2-strong-font);letter-spacing:var(--type-headline-2-strong-letter-spacing);margin:0}.order-order-search-form__wrapper{display:grid;grid-template-columns:1fr;grid-template-rows:auto;grid-template-areas:"email" "postcode" "number" "button";gap:var(--spacing-medium)}.order-order-search-form__wrapper__item--email{grid-area:email}.order-order-search-form__wrapper__item--postcode{grid-area:postcode}.order-order-search-form__wrapper__item--number{grid-area:number}.order-order-search-form__button-container{display:flex;justify-content:flex-end;grid-area:button}.order-order-search-form form button{align-self:flex-end;justify-self:flex-end;margin-top:var(--spacing-small)}@media (min-width: 768px){.order-order-search-form__wrapper{grid-template-columns:1fr 1fr;grid-template-rows:auto auto auto;grid-template-areas:"email postcode" "number number" "button button"}}.order-order-status-content .dropin-card__content{gap:0}.order-order-status-content__wrapper-description{margin-bottom:var(--spacing-medium)}.order-order-status-content__wrapper .order-order-status-content__wrapper-description p{padding:0;margin:0;box-sizing:border-box;font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.order-shipping-status-card .dropin-card__content{gap:0}.order-shipping-status-card--count-steper{font:var(--type-headline-2-strong-font);letter-spacing:var(--type-headline-2-strong-letter-spacing)}.order-shipping-status-card__header{display:grid;grid-template-columns:1fr auto;justify-items:self-start;align-items:center;margin-bottom:var(--spacing-xsmall)}.order-shipping-status-card__header button{max-height:40px}.order-shipping-status-card__header--content p{padding:0;margin:0;box-sizing:border-box;font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing);margin-bottom:var(--spacing-xsmall)}.order-shipping-status-card .order-shipping-status-card__images .dropin-content-grid__content{grid-template-columns:repeat(6,max-content)!important;overflow:auto!important}.order-shipping-status-card .order-shipping-status-card__images img{object-fit:contain;width:85px;height:114px}.order-order-loaders--card-loader{margin-bottom:var(--spacing-small)}.order-order-actions__wrapper{display:flex;justify-content:space-between;gap:0 var(--spacing-small);margin-bottom:var(--spacing-small);margin-top:var(--spacing-medium)}.order-order-actions__wrapper button{width:100%;font:var(--type-body-1-strong-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.order-order-actions__wrapper--empty{display:none}.order-customer-details-content .dropin-card__content{gap:0}.order-customer-details-content__container{display:block;flex-direction:column}.order-customer-details-content__container-shipping_address,.order-customer-details-content__container-billing_address{margin:var(--spacing-medium) 0}@media (min-width: 768px){.order-customer-details-content__container{display:grid;grid-template-columns:auto;grid-template-rows:auto auto auto;grid-auto-flow:row}.order-customer-details-content__container-email{grid-area:1 / 1 / 2 / 2}.order-customer-details-content__container--no-margin p{margin-bottom:0}.order-customer-details-content__container-shipping_address{grid-area:2 / 1 / 3 / 2;margin:var(--spacing-medium) 0}.order-customer-details-content__container-billing_address{grid-area:2 / 2 / 3 / 3;margin:var(--spacing-medium) 0}.order-customer-details-content__container-billing_address--fullwidth{grid-area:2 / 1 / 3 / 3}.order-customer-details-content__container-shipping_methods{grid-area:3 / 1 / 4 / 2}.order-customer-details-content__container-payment_methods{grid-area:3 / 2 / 4 / 3}.order-customer-details-content__container-payment_methods--fullwidth{grid-area:3 / 1 / 4 / 3}}.order-customer-details-content__container-title{font:var(--type-body-1-strong-font);letter-spacing:var(--type-body-1-strong-letter-spacing);margin:0 0 var(--spacing-xsmall) 0}.order-customer-details-content__container p{color:var(--color-neutral-800);font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);margin-top:0}.order-customer-details-content__container-payment_methods p{display:grid;gap:0;grid-template-columns:auto 1fr}.order-customer-details-content__container-payment_methods p.order-customer-details-content__container-payment_methods--icon{gap:0 var(--spacing-xsmall)}.order-customer-details-content__container-description p{margin:0 var(--spacing-xsmall) 0 0;line-height:var(--spacing-big);padding:0}.order-customer-details-content__container-description p:nth-child(1),.order-customer-details-content__container-description p:nth-child(3),.order-customer-details-content__container-description p:nth-child(4),.order-customer-details-content__container-description p:nth-child(6){float:left}.order-empty-list{margin-bottom:var(--spacing-small)}.order-empty-list.order-empty-list--minified,.order-empty-list .dropin-card{border:none}.order-empty-list .dropin-card__content{gap:0;padding:var(--spacing-xxbig)}.order-empty-list.order-empty-list--minified .dropin-card__content{flex-direction:row;align-items:center;padding:var(--spacing-big) var(--spacing-small)}.order-empty-list .dropin-card__content svg{width:64px;height:64px;margin-bottom:var(--spacing-medium)}.order-empty-list.order-empty-list--minified .dropin-card__content svg{margin:0 var(--spacing-small) 0 0;width:32px;height:32px}.order-empty-list .dropin-card__content svg path{fill:var(--color-neutral-800)}.order-empty-list.order-empty-list--minified .dropin-card__content svg path{fill:var(--color-neutral-500)}.order-empty-list--empty-box .dropin-card__content svg path{fill:var(--color-neutral-500)}.order-empty-list .dropin-card__content p{font:var(--type-headline-1-font);letter-spacing:var(--type-headline-1-letter-spacing);color:var(--color-neutral-800)}.order-empty-list.order-empty-list--minified .dropin-card__content p{font:var(--type-body-1-strong-font);color:var(--color-neutral-800)}.order-returns-list-content .order-returns__header--minified{margin-bottom:var(--spacing-small)}.order-returns-list-content .order-returns__header--full-size{margin-bottom:0}.order-returns-list-content__cards-list{margin-bottom:var(--spacing-small)}.order-returns-list-content__cards-list .dropin-card__content{gap:0}.order-returns-list-content__cards-grid{display:grid;grid-template-columns:1fr 1fr auto;gap:0px 0px;grid-template-areas:"descriptions descriptions actions" "images images actions"}.order-returns-list-content__descriptions{grid-area:descriptions}.order-returns-list-content__descriptions p{margin:0 0 var(--spacing-small) 0;padding:0;box-sizing:border-box;font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing);color:var(--color-neutral-800)}.order-returns-list-content__descriptions p a{display:inline-block;font:var(--type-button-2-font);letter-spacing:var(--type-button-2-letter-spacing);color:var(--color-brand-800)}.order-returns-list-content__descriptions p a:hover{color:var(--color-brand-800)}.order-returns-list-content__descriptions .order-returns-list-content__return-status{font:var(--type-button-2-font);font-weight:500;color:var(--color-neutral-800)}.order-returns-list-content .order-returns-list-content__actions{margin:0;padding:0;border:none;background-color:transparent;cursor:pointer;text-decoration:none}.order-returns-list-content .order-returns-list-content__actions:hover{text-decoration:none;color:var(--color-brand-500)}.order-returns-list-content__card .dropin-card__content{padding:var(--spacing-small) var(--spacing-medium)}.order-returns-list-content__card .order-returns-list-content__card-wrapper{display:flex;justify-content:space-between;align-items:center;color:var(--color-neutral-800);height:calc(88px - var(--spacing-small) * 2)}.order-returns-list-content__card-wrapper>p{font:var(--type-button-2-font);letter-spacing:var(--type-button-2-letter-spacing)}.order-returns-list-content__card-wrapper svg{color:var(--color-neutral-800)}.order-returns-list-content__images{margin-top:var(--spacing-small);grid-area:images}.order-returns-list-content__actions{grid-area:actions;align-self:center}.order-returns-list-content .order-returns-list-content__images{overflow:auto}.order-returns-list-content .order-returns-list-content__images .dropin-content-grid__content{grid-template-columns:repeat(6,max-content)!important}.order-returns-list-content .order-returns-list-content__images-3 .dropin-content-grid__content{grid-template-columns:repeat(3,max-content)!important}.order-returns-list-content .order-returns-list-content__images img{object-fit:contain;width:65px;height:65px}.order-order-product-list-content__items{display:grid;gap:var(--spacing-medium);list-style:none;margin:0;padding:0}.order-order-product-list-content .dropin-card__content{gap:0}.order-order-product-list-content__items .dropin-card__content{gap:var(--spacing-xsmall)}.order-order-product-list-content .dropin-cart-item__alert{margin-top:var(--spacing-xsmall)}.order-order-product-list-content .cart-summary-item__title--strikethrough{text-decoration:line-through;color:var(--color-neutral-500);font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}@media only screen and (min-width: 320px) and (max-width: 768px){.order-confirmation-cart-summary-item{margin-bottom:var(--spacing-medium)}}.order-cost-summary-content .dropin-card__content{gap:0}.order-cost-summary-content__description{margin-bottom:var(--spacing-xsmall)}.order-cost-summary-content__description .order-cost-summary-content__description--header,.order-cost-summary-content__description .order-cost-summary-content__description--subheader{display:flex;justify-content:space-between;align-items:center}.order-cost-summary-content__description .order-cost-summary-content__description--header span{color:var(--color-neutral-800);font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.order-cost-summary-content__description--subheader{margin-top:var(--spacing-xxsmall)}.order-cost-summary-content__description--subheader span{font:var(--type-details-caption-2-font);letter-spacing:var(--type-details-caption-2-letter-spacing);color:var(--color-brand-700)}.order-cost-summary-content__description--subtotal .order-cost-summary-content__description--subheader,.order-cost-summary-content__description--shipping .order-cost-summary-content__description--subheader{display:flex;justify-content:flex-start;align-items:center;gap:0 var(--spacing-xxsmall)}.order-cost-summary-content__description--subtotal .order-cost-summary-content__description--subheader .dropin-price,.order-cost-summary-content__description--shipping .order-cost-summary-content__description--subheader .dropin-price{font:var(--type-details-overline-font)}.order-cost-summary-content__description--discount .order-cost-summary-content__description--header span:last-child{color:var(--color-alert-800)}.order-cost-summary-content__description--discount .order-cost-summary-content__description--subheader span:first-child{display:flex;justify-content:flex-start;align-items:flex-end;gap:0 var(--spacing-xsmall)}.order-cost-summary-content__description--discount .order-cost-summary-content__description--subheader span:first-child span{font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing);color:var(--color-neutral-700)}.order-cost-summary-content__description--discount .order-cost-summary-content__description--subheader .dropin-price{font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing);color:var(--color-alert-800)}.order-cost-summary-content__description--total{margin-top:var(--spacing-medium)}.order-cost-summary-content__description--total .order-cost-summary-content__description--header span{font:var(--type-body-1-emphasized-font);letter-spacing:var(--type-body-1-emphasized-letter-spacing)}.order-cost-summary-content__accordion .dropin-accordion-section .dropin-accordion-section__content-container{gap:var(--spacing-small);margin:var(--spacing-small) 0}.order-cost-summary-content__accordion-row{display:flex;justify-content:space-between;align-items:center}.order-cost-summary-content__accordion-row p{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing)}.order-cost-summary-content__accordion-row p:first-child{color:var(--color-neutral-700)}.order-cost-summary-content__accordion .order-cost-summary-content__accordion-row.order-cost-summary-content__accordion-total p:first-child{font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.order-order-cancel-reasons-form__text{color:var(--color-neutral-800);font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing);padding-bottom:var(--spacing-xsmall)}.order-order-cancel-reasons-form__button-container{display:grid;margin-top:var(--spacing-xbig);justify-content:end}.order-order-cancel__modal{margin:auto}.order-order-cancel__modal .dropin-modal__header{display:grid;grid-template-columns:1fr auto}.order-order-cancel__title{color:var(--color-neutral-900);font:var(--type-headline-2-strong-font);letter-spacing:var(--type-headline-2-strong-letter-spacing)}.order-order-cancel__text{color:var(--color-neutral-800);font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing);padding-bottom:var(--spacing-xsmall)}.order-order-cancel__modal .dropin-modal__header-close-button{align-self:center}.order-order-cancel__button-container{display:grid;margin-top:var(--spacing-xbig);justify-content:end}@media only screen and (min-width: 768px){.dropin-modal__body--medium.order-order-cancel__modal>.dropin-modal__header-title{margin:0 var(--spacing-xxbig) var(--spacing-medium)}}',{styleId:"order"});
2
+ import{jsx as r}from"@dropins/tools/preact-jsx-runtime.js";import{Render as a}from"@dropins/tools/lib.js";import{useState as n,useEffect as d}from"@dropins/tools/preact-hooks.js";import{UIProvider as l}from"@dropins/tools/components.js";import{events as c}from"@dropins/tools/event-bus.js";const u={OrderCostSummary:{headerText:"Order summary",subtotal:{title:"Subtotal"},shipping:{title:"Shipping",freeShipping:"Free shipping"},tax:{accordionTitle:"Taxes",accordionTotalTax:"Tax Total",totalExcludingTaxes:"Total excluding taxes",title:"Tax",incl:"Including taxes",excl:"Excluding taxes"},discount:{title:"Discount",subtitle:"discounted"},total:{title:"Total"}},Returns:{minifiedView:{returnsList:{viewAllOrdersButton:"View all returns",ariaLabelLink:"Redirect to full order information",emptyOrdersListMessage:"No returns",minifiedViewTitle:"Recent returns",orderNumber:"Order number:",returnNumber:"Return number:",carrier:"Carrier:",itemText:{none:"",one:"item",many:"items"},resturnStatus:{pending:"Pending",authorized:"Authorized",partiallyAuthorized:"Partially authorized",received:"Received",partiallyReceived:"Partially received",approved:"Approved",partiallyApproved:"Partially approved",rejected:"Rejected",partiallyRejected:"Partially rejected",denied:"Denied",processedAndClosed:"Processed and closed",closed:"Closed"}}},fullSizeView:{returnsList:{viewAllOrdersButton:"View all orders",ariaLabelLink:"Redirect to full order information",emptyOrdersListMessage:"No returns",minifiedViewTitle:"Returns",orderNumber:"Order number:",returnNumber:"Return number:",carrier:"Carrier:",itemText:{none:"",one:"item",many:"items"},resturnStatus:{pending:"Pending",authorized:"Authorized",partiallyAuthorized:"Partially authorized",received:"Received",partiallyReceived:"Partially received",approved:"Approved",partiallyApproved:"Partially approved",rejected:"Rejected",partiallyRejected:"Partially rejected",denied:"Denied",processedAndClosed:"Processed and closed",closed:"Closed"}}}},OrderProductListContent:{cancelledTitle:"Cancelled",allOrdersTitle:"Your order",downloadableCount:"Files",stockStatus:{inStock:"In stock",outOfStock:"Out of stock"},GiftCard:{sender:"Sender",recipient:"Recipient",message:"Note"}},OrderSearchForm:{title:"Enter your information to view order details",description:"You can find your order number in the receipt you received via email.",button:"View Order",email:"Email",postcode:"Zip Code",orderNumber:"Order Number"},Form:{notifications:{requiredFieldError:"This is a required field."}},ShippingStatusCard:{trackButton:"Track package",carrier:"Carrier:",prepositionOf:"of",shippingCardTitle:"Package details",shippingInfoTitle:"Shipping info",notYetShippedTitle:"Not yet shipped",notYetShippedImagesTitle:"Package contents",notYetShippedItem:{singular:"item",plural:"items"}},OrderStatusContent:{noInfoTitle:"Check back later for more details.",actions:{cancel:"Cancel order",return:"Return or replace",reorder:"Reorder"},orderPending:{title:"Pending",message:"The order was successfully placed on {DATE} and your order is processing. Check back for more details when your order ships.",messageWithoutDate:"Your order is processing. Check back for more details when your order ships."},orderProcessing:{title:"Processing",message:"The order was successfully placed on {DATE} and your order is processing. Check back for more details when your order ships.",messageWithoutDate:"Your order is processing. Check back for more details when your order ships."},orderOnHold:{title:"On hold",message:"We’ve run into an issue while processing your order on {DATE}. Please check back later or contact us at support@adobe.com for more information.",messageWithoutDate:"We’ve run into an issue while processing your order. Please check back later or contact us at support@adobe.com for more information."},orderReceived:{title:"Order received",message:"The order was successfully placed on {DATE} and your order is processing. Check back for more details when your order ships.",messageWithoutDate:"Your order is processing. Check back for more details when your order ships."},orderComplete:{title:"Complete",message:"Your order is complete. Need help with your order? Contact us at support@adobe.com"},orderCanceled:{title:"Canceled",message:"This order was cancelled by you. You should see a refund to your original payment method with 5-7 business days.",messageWithoutDate:"This order was cancelled by you. You should see a refund to your original payment method with 5-7 business days."},orderSuspectedFraud:{title:"Suspected fraud",message:"We’ve run into an issue while processing your order on {DATE}. Please check back later or contact us at support@adobe.com for more information.",messageWithoutDate:"We’ve run into an issue while processing your order. Please check back later or contact us at support@adobe.com for more information."},orderPaymentReview:{title:"Payment Review",message:"The order was successfully placed on {DATE} and your order is processing. Check back for more details when your order ships.",messageWithoutDate:"Your order is processing. Check back for more details when your order ships."},guestOrderCancellationRequested:{title:"cancellation requested",message:"The cancellation has been requested on {DATE}. Check your email for further instructions.",messageWithoutDate:"The cancellation has been requested. Check your email for further instructions."}},CustomerDetails:{headerText:"Customer information",freeShipping:"Free shipping",email:{title:"Contact details"},shippingAddress:{title:"Shipping address"},shippingMethods:{title:"Shipping method"},billingAddress:{title:"Billing address"},billingMethods:{title:"Payment method"}},Errors:{invalidOrder:"Invalid order. Please try again.",invalidSearch:"No order found with these order details."},OrderCancel:{buttonText:"Cancel Order"},OrderCancelForm:{title:"Cancel order",description:"Select a reason for canceling the order",label:"Reason for cancel",button:"Submit Cancellation",errorHeading:"Error",errorDescription:"There was an error processing your order cancellation."}},p={Order:u},m={default:p},h=({children:t})=>{const[o,i]=n("en_US");return d(()=>{const e=c.on("locale",s=>{i(s)},{eager:!0});return()=>{e==null||e.off()}},[]),r(l,{lang:o,langDefinitions:m,children:t})},T=new a(r(h,{}));export{T as render};
@@ -25,8 +25,8 @@ export interface CustomerDetailsContentProps extends Omit<CustomerDetailsProps,
25
25
  loading: boolean;
26
26
  order?: OrderDataModel;
27
27
  normalizeAddress?: {
28
- billingAddress: NormalizeAddressProps[][];
29
- shippingAddress: NormalizeAddressProps[][];
28
+ billingAddress: NormalizeAddressProps[];
29
+ shippingAddress: NormalizeAddressProps[];
30
30
  };
31
31
  }
32
32
  export interface CustomerAddressesModel {
@@ -4,11 +4,10 @@ import { PickerOption } from '@dropins/tools/types/elsie/src/components';
4
4
  export interface OrderCancelProps {
5
5
  orderRef: string;
6
6
  }
7
- export interface OrderCancelReasonFormProps {
7
+ export interface OrderCancelFormProps {
8
8
  orderRef: string;
9
9
  pickerProps?: PickerProps;
10
10
  submitButtonProps?: ButtonProps;
11
- cancelOrder: (orderId: string, reason: string, onSuccess: Function, onError: Function) => Promise<void | null | undefined>;
12
11
  cancelReasons: PickerOption[];
13
12
  }
14
13
  export interface ConfirmCancelOrderProps {
@@ -1 +0,0 @@
1
- import{useState as i,useEffect as s}from"@dropins/tools/preact-hooks.js";import{g as f}from"./getStoreConfig.js";const c=()=>{const[n,e]=i(null);return s(()=>{const o=sessionStorage.getItem("orderStoreConfig"),r=o?JSON.parse(o):null;r?e(r):f().then(t=>{t&&(sessionStorage.setItem("orderStoreConfig",JSON.stringify(t)),e(t))})},[]),n};export{c as u};
@@ -1,5 +0,0 @@
1
- import { FunctionComponent } from 'preact';
2
- import { OrderCancelReasonFormProps } from '../../types';
3
-
4
- export declare const OrderCancelReasonsForm: FunctionComponent<OrderCancelReasonFormProps>;
5
- //# sourceMappingURL=OrderCancelReasonsForm.d.ts.map
@@ -1,3 +0,0 @@
1
- export * from './OrderCancelReasonsForm';
2
- export { OrderCancelReasonsForm as default } from './OrderCancelReasonsForm';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1,5 +0,0 @@
1
- import { OrderCancelProps } from '../../types';
2
- import { Container } from '@dropins/tools/types/elsie/src/lib';
3
-
4
- export declare const OrderCancel: Container<OrderCancelProps>;
5
- //# sourceMappingURL=OrderCancel.d.ts.map
@@ -1,3 +0,0 @@
1
- export * from './OrderCancel/index'
2
- import _default from './OrderCancel/index'
3
- export default _default
@@ -1 +0,0 @@
1
- import{jsxs as g,jsx as e}from"@dropins/tools/preact-jsx-runtime.js";import{u as h}from"../chunks/useGetStoreConfig.js";import{InLineAlert as v,Picker as x,Button as S}from"@dropins/tools/components.js";import{F}from"../chunks/OrderCancelReasonsForm.js";import"@dropins/tools/lib.js";import"@dropins/tools/preact-compat.js";import{useState as d}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/preact.js";import{events as u}from"@dropins/tools/event-bus.js";import{useText as E,Text as p}from"@dropins/tools/i18n.js";import{c as _,r as D}from"../chunks/requestGuestOrderCancel.js";import"../chunks/getStoreConfig.js";import"../chunks/fetch-graphql.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/transform-order-details.js";import"../chunks/convertCase.js";import"../chunks/getGuestOrder.graphql.js";const L=({pickerProps:s,submitButtonProps:o,cancelReasons:n,cancelOrder:i,orderRef:m})=>{const a=E({ErrorHeading:"Order.OrderCancellationReasonsForm.errorHeading",ErrorDescription:"Order.OrderCancellationReasonsForm.errorDescription",orderCancellationLabel:"Order.OrderCancellationReasonsForm.label"}),[r,c]=d(0),[f,C]=d(!1),[O,b]=d(!1);u.on("authenticated",t=>{t&&b(!0)},{eager:!0});const R=t=>{t.preventDefault();const l=Number(t.target.value);c(l)};return g(F,{onSubmit:async t=>(t.preventDefault(),i(m,n[r].text,l=>{O||(l.status="guest order cancellation requested"),u.emit("order/data",l)},()=>{C(!0)})),"data-testid":"order-order-cancel-reasons-form__text",children:[f&&e(v,{heading:a.ErrorHeading,description:a.ErrorDescription}),e("div",{className:"order-order-cancel-reasons-form__text",children:e(p,{id:"Order.OrderCancellationReasonsForm.description"})}),e(x,{name:"cancellationReasons",floatingLabel:a.orderCancellationLabel,defaultOption:n[0],variant:"primary",options:n,value:String(r),handleSelect:R,required:!0,"data-testid":"order-cancellation-reasons-selector",...s}),e("div",{className:"order-order-cancel-reasons-form__button-container",children:e(S,{variant:"primary","data-testid":"order-cancel-submit-button",...o,children:e(p,{id:"Order.OrderCancellationReasonsForm.button"})})})]})},Q=({orderRef:s})=>{const o=h(),n=(o==null?void 0:o.orderCancellationReasons)??[];let i=_;return s.length>20&&(i=D),e(L,{orderRef:s,cancelOrder:i,cancelReasons:(a=>a.map((r,c)=>({text:r==null?void 0:r.description,value:c.toString()})))(n)})};export{Q as OrderCancel,Q as default};