@dropins/storefront-order 0.1.0-alpha16 → 0.1.0-alpha17
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.
- package/api/getOrderDetailsById/getOrderDetailsById.d.ts +1 -1
- package/api/getOrderDetailsById/graphql/returnsFragment.graphql.d.ts +1 -1
- package/api/guestOrderByToken/guestOrderByToken.d.ts +1 -1
- package/api.js +13 -11
- package/chunks/OrderCancel.js +2 -0
- package/chunks/OrderCancelForm.js +3 -1
- package/chunks/OrderLoaders.js +2 -0
- package/chunks/ReturnsListContent.js +3 -0
- package/chunks/convertCase.js +2 -0
- package/chunks/fetch-graphql.js +2 -0
- package/chunks/formatDateToLocale.js +3 -0
- package/chunks/getAttributesForm.js +2 -0
- package/chunks/getCustomer.js +3 -1
- package/chunks/getCustomerOrdersReturn.js +2 -0
- package/chunks/getGuestOrder.graphql.js +2 -0
- package/chunks/getStoreConfig.js +2 -0
- package/chunks/network-error.js +2 -0
- package/chunks/redirectTo.js +3 -0
- package/chunks/requestGuestOrderCancel.js +2 -0
- package/chunks/returnOrdersHelper.js +3 -0
- package/chunks/setTaxStatus.js +2 -0
- package/chunks/transform-order-details.js +4 -1
- package/chunks/useIsMobile.js +3 -1
- package/components/ShippingStatusCard/ShippingStatusReturnCard.d.ts +5 -0
- package/components/ShippingStatusCard/index.d.ts +1 -0
- package/configs/mock.config.d.ts +5 -0
- package/containers/CustomerDetails.js +3 -1
- package/containers/OrderCancelForm.js +3 -1
- package/containers/OrderCostSummary.js +3 -1
- package/containers/OrderProductList.js +3 -1
- package/containers/OrderReturns.js +3 -1
- package/containers/OrderSearch.js +3 -1
- package/containers/OrderStatus.js +5 -3
- package/containers/ReturnsList.js +3 -1
- package/containers/ShippingStatus.js +3 -1
- package/data/models/customer-orders-return.d.ts +2 -2
- package/data/models/order-details.d.ts +3 -0
- package/data/transforms/transform-guest-order.d.ts +2 -2
- package/data/transforms/transform-order-details.d.ts +2 -2
- package/i18n/en_US.json.d.ts +55 -7
- package/lib/formatDateToLocale.d.ts +31 -0
- package/lib/redirectTo.d.ts +1 -1
- package/package.json +1 -1
- package/render.js +4 -2
- package/types/api/getOrderDetails.types.d.ts +1 -0
- package/types/customerDetails.types.d.ts +6 -1
- package/types/orderStatus.types.d.ts +5 -2
- package/types/shippingStatus.types.d.ts +16 -2
- package/lib/convertToInputDateFormat.d.ts +0 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { TransformedData } from '../../data/models';
|
|
2
2
|
|
|
3
|
-
export declare const getOrderDetailsById: <T extends "orderData">(orderId?: string, queryType?: T | undefined) => Promise<TransformedData<T>>;
|
|
3
|
+
export declare const getOrderDetailsById: <T extends "orderData">(orderId?: string, returnRef?: string, queryType?: T | undefined) => Promise<TransformedData<T>>;
|
|
4
4
|
//# sourceMappingURL=getOrderDetailsById.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const RETURNS_FRAGMENT = "\n fragment OrderReturns on Returns {\n __typename\n items {\n number\n status\n shipping {\n tracking {\n status {\n text\n type\n }\n carrier {\n uid\n label\n }\n tracking_number\n }\n }\n order {\n number\n token\n }\n items {\n uid\n quantity\n status\n request_quantity\n order_item {\n ...OrderItemDetails\n ... on GiftCardOrderItem {\n ...GiftCardDetails\n product {\n ...ProductDetails\n }\n }\n }\n }\n }\n }\n";
|
|
1
|
+
export declare const RETURNS_FRAGMENT = "\n fragment OrderReturns on Returns {\n __typename\n items {\n number\n status\n created_at\n shipping {\n tracking {\n status {\n text\n type\n }\n carrier {\n uid\n label\n }\n tracking_number\n }\n }\n order {\n number\n token\n }\n items {\n uid\n quantity\n status\n request_quantity\n order_item {\n ...OrderItemDetails\n ... on GiftCardOrderItem {\n ...GiftCardDetails\n product {\n ...ProductDetails\n }\n }\n }\n }\n }\n }\n";
|
|
2
2
|
//# sourceMappingURL=returnsFragment.graphql.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { OrderDataModel } from '../../data/models';
|
|
2
2
|
|
|
3
|
-
export declare const guestOrderByToken: (token?: string) => Promise<OrderDataModel | null>;
|
|
3
|
+
export declare const guestOrderByToken: (token?: string, returnRef?: string) => Promise<OrderDataModel | null>;
|
|
4
4
|
//# sourceMappingURL=guestOrderByToken.d.ts.map
|
package/api.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Copyright 2024 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import{Initializer as T}from"@dropins/tools/lib.js";import{events as d}from"@dropins/tools/event-bus.js";import{f as n,h as m}from"./chunks/fetch-graphql.js";import{g as P,r as U,s as Y,a as q,b as Q}from"./chunks/fetch-graphql.js";import{h as l}from"./chunks/network-error.js";import{P as u,a as _,G as c,O as p,B as O,R as h,c as G}from"./chunks/transform-order-details.js";import{O as D,A as R}from"./chunks/getGuestOrder.graphql.js";import{t as I}from"./chunks/getCustomer.js";import{a as H,g as K}from"./chunks/getCustomer.js";import{g as J}from"./chunks/getAttributesForm.js";import{g as W}from"./chunks/getStoreConfig.js";import{g as Z}from"./chunks/getCustomerOrdersReturn.js";import{c as re,r as te}from"./chunks/requestGuestOrderCancel.js";import"@dropins/tools/fetch-graphql.js";import"./chunks/convertCase.js";const b=`
|
|
2
4
|
query ORDER_BY_NUMBER($orderNumber: String!) {
|
|
3
5
|
customer {
|
|
4
6
|
orders(
|
|
@@ -84,15 +86,15 @@ query ORDER_BY_NUMBER($orderNumber: String!) {
|
|
|
84
86
|
}
|
|
85
87
|
}
|
|
86
88
|
}
|
|
87
|
-
${l}
|
|
88
89
|
${u}
|
|
89
|
-
${c}
|
|
90
90
|
${_}
|
|
91
|
+
${c}
|
|
91
92
|
${p}
|
|
92
|
-
${h}
|
|
93
|
-
${D}
|
|
94
93
|
${O}
|
|
95
|
-
|
|
94
|
+
${D}
|
|
95
|
+
${R}
|
|
96
|
+
${h}
|
|
97
|
+
`,f=async(e,r,t)=>await n(b,{method:"GET",cache:"force-cache",variables:{orderNumber:e}}).then(a=>{var s;return(s=a.errors)!=null&&s.length?m(a.errors):G(t??"orderData",a,r)}).catch(l),y=`
|
|
96
98
|
query ORDER_BY_TOKEN($token: String!) {
|
|
97
99
|
guestOrderByToken(input: { token: $token }) {
|
|
98
100
|
email
|
|
@@ -178,12 +180,12 @@ query ORDER_BY_TOKEN($token: String!) {
|
|
|
178
180
|
}
|
|
179
181
|
}
|
|
180
182
|
}
|
|
181
|
-
${l}
|
|
182
183
|
${u}
|
|
183
|
-
${c}
|
|
184
184
|
${_}
|
|
185
|
+
${c}
|
|
185
186
|
${p}
|
|
186
|
-
${h}
|
|
187
|
-
${D}
|
|
188
187
|
${O}
|
|
189
|
-
|
|
188
|
+
${D}
|
|
189
|
+
${R}
|
|
190
|
+
${h}
|
|
191
|
+
`,A=async(e,r)=>await n(y,{method:"GET",cache:"no-cache",variables:{token:e}}).then(t=>{var a;return(a=t.errors)!=null&&a.length?m(t.errors):I(t,r)}).catch(l),$=async e=>{var i;const r=(e==null?void 0:e.orderRef)??"",t=(e==null?void 0:e.returnRef)??"",a=r&&typeof(e==null?void 0:e.orderRef)=="string"&&((i=e==null?void 0:e.orderRef)==null?void 0:i.length)>20,s=(e==null?void 0:e.orderData)??null;if(s){d.emit("order/data",{...s,returnNumber:t});return}if(!r){console.error("Order Token or number not received.");return}const o=a?await A(r,t):await f(r,t,"orderData");o?d.emit("order/data",{...o,returnNumber:t}):d.emit("order/error",{source:"order",type:"network",error:"The data was not received."})},E=new T({init:async e=>{const r={};E.config.setConfig({...r,...e}),$(e).catch(console.error)},listeners:()=>[]}),v=E.config;export{re as cancelOrder,v as config,n as fetchGraphQl,J as getAttributesForm,P as getConfig,H as getCustomer,Z as getCustomerOrdersReturn,K as getGuestOrder,f as getOrderDetailsById,W as getStoreConfig,A as guestOrderByToken,E as initialize,U as removeFetchGraphQlHeader,te as requestGuestOrderCancel,Y as setEndpoint,q as setFetchGraphQlHeader,Q as setFetchGraphQlHeaders};
|
package/chunks/OrderCancel.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
+
/*! Copyright 2024 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
1
3
|
import{jsx as h,Fragment as v,jsxs as M}from"@dropins/tools/preact-jsx-runtime.js";import{useRef as _,useState as D,useEffect as w,useCallback as T}from"@dropins/tools/preact-hooks.js";import{useText as y}from"@dropins/tools/i18n.js";import*as C from"@dropins/tools/preact-compat.js";import{memo as V,useCallback as L}from"@dropins/tools/preact-compat.js";import{classes as k}from"@dropins/tools/lib.js";import{Field as q,Picker as A,Input as I,InputDate as R,Checkbox as O,TextArea as N}from"@dropins/tools/components.js";const j=l=>C.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...l},C.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M11.8052 14.4968C10.8552 14.4968 9.9752 14.0268 9.4452 13.2368L9.4152 13.1868L9.3852 13.1268C8.1352 11.2268 7.5352 8.96681 7.6852 6.68681C7.7552 4.42681 9.6052 2.61681 11.8652 2.60681H12.0052C14.2752 2.47681 16.2152 4.21681 16.3452 6.47681C16.3452 6.55681 16.3452 6.62681 16.3452 6.70681C16.4852 8.94681 15.9052 11.1768 14.6852 13.0568L14.6052 13.1768C14.0552 13.9868 13.1352 14.4668 12.1652 14.4768H12.0052C11.9352 14.4768 11.8652 14.4868 11.7952 14.4868L11.8052 14.4968Z",stroke:"currentColor"}),C.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M4.3252 21.5469C4.3552 20.4169 4.4752 19.2869 4.6752 18.1769C4.8952 17.1669 6.4752 16.0269 8.9052 15.1569C9.2352 15.0369 9.4852 14.7869 9.5952 14.4569L9.8052 14.0269",stroke:"currentColor"}),C.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M14.425 14.4069L14.165 14.1569C14.375 14.5969 14.725 14.9569 15.155 15.1869C16.945 15.7969 19.125 16.9569 19.375 18.2069C19.585 19.3069 19.685 20.4269 19.675 21.5369",stroke:"currentColor"})),H=l=>l.reduce((u,{code:i,required:$,defaultValue:c})=>($&&(u[i]=c),u),{}),S=({fieldsConfig:l,onSubmit:u})=>{const{requiredFieldError:i}=y({requiredFieldError:"Order.Form.notifications.requiredFieldError"}),$=_(null),[c,n]=D({}),[o,t]=D({});w(()=>{if(n({}),!l||!l.length)return;const s=H(l);n(s)},[l==null?void 0:l.length]),w(()=>()=>{var s;n({}),(s=$.current)==null||s.reset()},[]);const p=T((s,e)=>{const r=l.find(d=>d.code===s);return r!=null&&r.required&&!e?i:""},[l,i]),b=T(s=>{const{name:e,value:r,type:a,checked:d}=s==null?void 0:s.target,f=a==="checkbox"?d:r;n(E=>({...E,[e]:f}))},[]),x=T(s=>{const{name:e,value:r,type:a,checked:d}=s==null?void 0:s.target,f=a==="checkbox"?d:r;t(E=>({...E,[e]:p(e,f)}))},[p]),F=T(s=>{s.preventDefault();let e=!0,r={},a=null;for(const[d,f]of Object.entries(c)){const E=p(d,f);E&&(r[d]=E,e=!1,a||(a=d))}if(t(r),a&&$.current){const d=$.current.elements.namedItem(a);d==null||d.focus()}u==null||u(s,e)},[c,p,u]);return{formData:c,errors:o,formRef:$,handleChange:b,handleBlur:x,handleSubmit:F}},U=V(({loading:l,values:u,fields:i=[],errors:$,className:c="",onChange:n,onBlur:o})=>{const t=`${c}__item`,p=L((e,r,a)=>{const d=e.options.map(f=>({text:f.label,value:f.value}));return h(q,{error:a,className:k([t,`${t}--${e.id}`,[`${t}--${e.id}-hidden`,e.is_hidden],e.className]),"data-testid":`${c}--${e.id}`,disabled:l,children:h(A,{name:e.id,floatingLabel:`${e.label} ${e.required?"*":""}`,placeholder:e.label,"aria-label":e.label,options:d,onBlur:o,handleSelect:n,value:r||e.defaultValue})},e.id)},[c,l,t,o,n]),b=L((e,r,a)=>{const d=e.id==="email",f=d?h(j,{}):void 0,E=d?"username":"";return h(q,{error:a,className:k([t,`${t}--${e.id}`,[`${t}--${e.id}-hidden`,e==null?void 0:e.is_hidden],e.className]),"data-testid":`${c}--${e.id}`,disabled:l,children:h(I,{"aria-label":e.label,"aria-required":e.required,autoComplete:E,icon:f,type:"text",name:e.id,value:r||e.defaultValue,placeholder:e.label,floatingLabel:`${e.label} ${e.required?"*":""}`,onBlur:o,onChange:n})},e.id)},[c,l,t,o,n]),x=L((e,r,a)=>h(q,{error:a,className:k([t,`${t}--${e.id}`,[`${t}--${e.id}-hidden`,e.is_hidden],e.className]),"data-testid":`${c}--${e.id}`,disabled:l,children:h(R,{type:"text",name:e.id,value:r||e.defaultValue,placeholder:e.label,floatingLabel:`${e.label} ${e.required?"*":""}`,onBlur:o,onChange:n})},e.id),[c,l,t,o,n]),F=L((e,r,a)=>h(q,{error:a,className:k([t,`${t}--${e.id}`,[`${t}--${e.id}-hidden`,e.is_hidden],e.className]),"data-testid":`${c}--${e.id}`,disabled:l,children:h(O,{name:e.id,checked:r||e.defaultValue,placeholder:e.label,label:`${e.label} ${e.required?"*":""}`,onBlur:o,onChange:n})},e.id),[c,l,t,o,n]),s=L((e,r,a)=>h(q,{error:a,className:k([t,`${t}--${e.id}`,[`${t}--${e.id}-hidden`,e.is_hidden],e.className]),"data-testid":`${c}--${e.id}`,disabled:l,children:h(N,{type:"text",name:e.id,value:r===void 0?e.defaultValue:r,label:`${e.label} ${e.required?"*":""}`,onBlur:o,onChange:n})},e.id),[c,l,t,o,n]);return i.length?h(v,{children:i.map(e=>{var d;const r=($==null?void 0:$[e.id])??"",a=(u==null?void 0:u[e.id])??"";switch(e.fieldType){case"TEXT":return(d=e==null?void 0:e.options)!=null&&d.length?p(e,a,r):b(e,a,r);case"MULTILINE":return b(e,a,r);case"SELECT":return p(e,a,r);case"DATE":return x(e,a,r);case"BOOLEAN":return F(e,a,r);case"TEXTAREA":return s(e,a,r);default:return null}})}):null}),K=V(({name:l,loading:u,children:i,className:$="defaultForm",fieldsConfig:c,onSubmit:n})=>{const{formData:o,errors:t,formRef:p,handleChange:b,handleBlur:x,handleSubmit:F}=S({fieldsConfig:c,onSubmit:n});return M("form",{className:k(["order-form",$]),onSubmit:F,name:l,ref:p,children:[h(U,{className:$,loading:u,fields:c,onChange:b,onBlur:x,errors:t,values:o}),i]})});export{K as F};
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Copyright 2024 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import{jsxs as g,jsx as r}from"@dropins/tools/preact-jsx-runtime.js";import{InLineAlert as v,Picker as x,Button as F}from"@dropins/tools/components.js";import{F as S}from"./OrderCancel.js";import"@dropins/tools/lib.js";import{useState as n}from"@dropins/tools/preact-hooks.js";import{events as d}from"@dropins/tools/event-bus.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/preact.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};
|
package/chunks/OrderLoaders.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
+
/*! Copyright 2024 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
1
3
|
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};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! Copyright 2024 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import{jsx as r,jsxs as s,Fragment as o}from"@dropins/tools/preact-jsx-runtime.js";import{useMemo as H}from"@dropins/tools/preact-hooks.js";import{classes as W,Slot as G}from"@dropins/tools/lib.js";import{IllustratedMessage as K,Icon as y,Card as k,ContentGrid as R,Image as D,Header as I,Pagination as r1}from"@dropins/tools/components.js";import*as l from"@dropins/tools/preact-compat.js";import{useMemo as e1}from"@dropins/tools/preact-compat.js";import"./OrderCancel.js";import{f as n1}from"./returnOrdersHelper.js";import"@dropins/tools/event-bus.js";import{C as O}from"./OrderLoaders.js";import"@dropins/tools/preact.js";import{Text as U}from"@dropins/tools/i18n.js";const q=L=>l.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",...L},l.createElement("g",{id:"Large"},l.createElement("rect",{id:"Placement_area","data-name":"Placement area",width:24,height:24,fill:"#fff",opacity:0}),l.createElement("g",{id:"Chevron_right_icon","data-name":"Chevron right icon"},l.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"})))),t1=L=>l.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...L},l.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"})),J=({typeList:L,isEmpty:C,minifiedView:M,message:n})=>{const t=e1(()=>{switch(L){case"orders":return{icon:t1,text:r("p",{children:n}),className:"order-empty-list--empty-box"};default:return{icon:"",text:"",className:""}}},[L,n]);return!C||!L||!t.text?null:r(K,{className:W(["order-empty-list",t.className,M?"order-empty-list--minified":""]),message:t.text,icon:r(y,{source:t.icon}),"data-testid":"emptyList"})},Q={size:"32",stroke:"2"},M1=({minifiedViewKey:L,withReturnNumber:C=!1,withOrderNumber:M=!1,slots:n,pageInfo:t,withReturnsListButton:E=!0,isMobile:b=!1,returnsInMinifiedView:X=1,translations:a={},orderReturns:i=[],minifiedView:h=!1,withHeader:Z=!0,withThumbnails:w=!0,selectedPage:$=1,handleSetSelectPage:V,routeReturnDetails:m,routeOrderDetails:p,routeTracking:_,routeReturnsList:g,routeProductDetails:d,loading:N})=>{const A=h?X:i.length,B=d!=null&&d()?"a":"span",f=H(()=>i.slice(0,A).map((e,T)=>{var S,z;return r(k,{variant:"secondary",className:"order-returns-list-content__cards-list",children:s("div",{className:"order-returns-list-content__cards-grid",children:[s("div",{className:"order-returns-list-content__descriptions",children:[r("p",{className:"order-returns-list-content__return-status",children:r(U,{id:`Order.Returns.${L}.returnsList.resturnStatus.${n1(e.returnStatus)}`})}),C?s("p",{children:[a.returnNumber," ",r("a",{href:(m==null?void 0:m({returnNumber:e.returnNumber,orderNumber:e.orderNumber,token:e.token}))??"#",rel:"noreferrer",children:e.returnNumber})]}):null,M?s("p",{children:[a.orderNumber," ",r("a",{href:(p==null?void 0:p({orderNumber:e.orderNumber,token:e.token}))??"#",rel:"noreferrer",children:e.orderNumber})]}):null,(S=e==null?void 0:e.tracking)==null?void 0:S.map((c,x)=>{var u,v;return s("p",{children:[`${a.carrier} ${(v=(u=c==null?void 0:c.carrier)==null?void 0:u.label)==null?void 0:v.toLocaleUpperCase()}: `,r("a",{href:`${(_==null?void 0:_(c))||"#"}`,target:"_blank",rel:"noreferrer",children:c.trackingNumber})]},`${c.trackingNumber}_${x}`)}),n!=null&&n.ReturnItemsDetails?r(G,{"data-testid":"returnItemsDetails",name:"ReturnItemsDetails",slot:n==null?void 0:n.ReturnItemsDetails,context:{items:e.items}}):e.items.length?s("p",{children:[e.items.length," ",r(U,{id:`Order.Returns.${L}.returnsList.itemText`,plural:e.items.length,fields:{count:e.items.length}})]}):null]}),w?r(R,{maxColumns:b?3:9,emptyGridContent:r(o,{}),className:W(["order-returns-list-content__images",["order-returns-list-content__images-3",b]]),children:(z=e==null?void 0:e.items)==null?void 0:z.map((c,x)=>{var j,F;const u=(j=c.thumbnail)==null?void 0:j.label,v=(F=c.thumbnail)==null?void 0:F.url;return r(B,{href:(d==null?void 0:d(c))??"#",children:r(D,{alt:u,src:v,width:85,height:114})},x+c.uid)})}):null,n!=null&&n.DetailsActionParams?r(G,{className:"order-returns-list-content__actions","data-testid":"detailsActionParams",name:"DetailsActionParams",slot:n==null?void 0:n.DetailsActionParams,context:{returnOrderItem:e}}):r("a",{href:(m==null?void 0:m({returnNumber:e.returnNumber,token:e.token,orderNumber:e.orderNumber}))??"#",className:"order-returns-list-content__actions",children:r(y,{source:q,...Q})})]})},T)}),[i,A,L,C,a,m,M,p,n,w,b,d,_,B]),Y=H(()=>s(o,{children:[Z?r(I,{title:a.minifiedViewTitle,divider:!1,className:"order-returns__header--minified"}):null,N?r(O,{withCard:!1}):s(o,{children:[f,r(J,{minifiedView:h,typeList:"orders",isEmpty:!i.length,message:a.emptyOrdersListMessage}),E?r("a",{className:"order-returns-list-content__actions",href:(g==null?void 0:g())??"#",children:r(k,{variant:"secondary",className:"order-returns-list-content__card",children:s("div",{className:"order-returns-list-content__card-wrapper",children:[r("p",{children:a.viewAllOrdersButton}),r(y,{source:q,...Q})]})})}):null]})]}),[g,E,Z,a,f,h,i.length,N]),P=H(()=>s(o,{children:[Z?r(I,{title:a.minifiedViewTitle,divider:!0,className:"order-returns__header--full-size"}):null,N?r(O,{withCard:!1}):s(o,{children:[r(J,{minifiedView:h,typeList:"orders",isEmpty:!i.length,message:a.emptyOrdersListMessage}),f,(t==null?void 0:t.totalPages)>1?r(r1,{totalPages:t==null?void 0:t.totalPages,currentPage:$,onChange:V}):null]})]}),[f,h,i,a,t,$,V,N,Z]);return r("div",{className:"order-returns-list-content",children:h?Y:P})};export{M1 as R};
|
package/chunks/convertCase.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
+
/*! Copyright 2024 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
1
3
|
const b=s=>s.replace(/_([a-z])/g,(o,e)=>e.toUpperCase()),c=(s,o,e)=>{const u=["string","boolean","number"],p=b;return Array.isArray(s)?s.map(r=>u.includes(typeof r)||r===null?r:typeof r=="object"?c(r,o,e):r):s!==null&&typeof s=="object"?Object.entries(s).reduce((r,[t,n])=>{const f=e&&e[t]?e[t]:p(t);return r[f]=u.includes(typeof n)||n===null?n:c(n,o,e),r},{}):s};export{c as a,b as c};
|
package/chunks/fetch-graphql.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
+
/*! Copyright 2024 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
1
3
|
import{FetchGraphQL as s}from"@dropins/tools/fetch-graphql.js";const h=e=>{const r=e.map(a=>a.message).join(" ");throw Error(r)},{setEndpoint:o,setFetchGraphQlHeader:c,removeFetchGraphQlHeader:n,setFetchGraphQlHeaders:p,fetchGraphQl:d,getConfig:g}=new s().getMethods();export{c as a,p as b,d as f,g,h,n as r,o as s};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/*! Copyright 2024 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
1
3
|
import{h as l}from"./network-error.js";import{f as m,h as _}from"./fetch-graphql.js";import{c as f,a as T}from"./convertCase.js";const b=o=>{let e=[];for(const t of o)if(!(t.frontend_input!=="MULTILINE"||t.multiline_count<2))for(let i=2;i<=t.multiline_count;i++){const a={...t,name:`${t.code}_${i}`,code:`${t.code}_${i}`,id:`${t.code}_${i}`};e.push(a)}return e},h=o=>{var u,c,d;const e=((c=(u=o==null?void 0:o.data)==null?void 0:u.attributesForm)==null?void 0:c.items)||[];if(!e.length)return[];const t=(d=e.filter(r=>{var n;return!((n=r.frontend_input)!=null&&n.includes("HIDDEN"))}))==null?void 0:d.map(({code:r,...n})=>{const s=r!=="country_id"?r:"country_code";return{...n,name:s,id:s,code:s}}),i=b(t);return t.concat(i).map(r=>{const n=f(r.code);return T({...r,customUpperCode:n},"camelCase",{frontend_input:"fieldType",frontend_class:"className",is_required:"required",sort_order:"orderNumber"})}).sort((r,n)=>r.orderNumber-n.orderNumber)},E=`
|
|
2
4
|
query GET_ATTRIBUTES_FORM($formCode: String!) {
|
|
3
5
|
attributesForm(formCode: $formCode) {
|
package/chunks/getCustomer.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Copyright 2024 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
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,a)=>{var u,c;if(!((u=t==null?void 0:t.data)!=null&&u.guestOrder))return null;const r=(c=t==null?void 0:t.data)==null?void 0:c.guestOrder;return l(r,a)},k=(t,a)=>{var u,c;if(!((u=t==null?void 0:t.data)!=null&&u.guestOrderByToken))return null;const r=(c=t==null?void 0:t.data)==null?void 0:c.guestOrderByToken;return l(r,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
4
|
query GET_CUSTOMER {
|
|
3
5
|
customer {
|
|
4
6
|
firstname
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/*! Copyright 2024 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
1
3
|
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
4
|
query GET_CUSTOMER_ORDERS_RETURN {
|
|
3
5
|
customer {
|
package/chunks/getStoreConfig.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/*! Copyright 2024 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
1
3
|
import{f as i,h as s}from"./fetch-graphql.js";function n(p){return p?{orderCancellationEnabled:p.order_cancellation_enabled,orderCancellationReasons:p.order_cancellation_reasons,shoppingCartDisplayPrice:p.shopping_cart_display_price,shoppingOrdersDisplaySubtotal:p.shopping_cart_display_subtotal,shoppingOrdersDisplayShipping:p.shopping_cart_display_shipping,shoppingOrdersDisplayGrandTotal:p.shopping_cart_display_grand_total,shoppingOrdersDisplayTaxGiftWrapping:p.shopping_cart_display_tax_gift_wrapping,shoppingOrdersDisplayFullSummary:p.shopping_cart_display_full_summary,shoppingOrdersDisplayZeroTax:p.shopping_cart_display_zero_tax}:null}const a=`
|
|
2
4
|
query STORE_CONFIG_QUERY {
|
|
3
5
|
storeConfig {
|
package/chunks/network-error.js
CHANGED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! Copyright 2024 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
const a=(e,n,r)=>{if(typeof e!="function")return;const t=e(r);if(!n||Object.keys(n).length===0){window.location.href=t;return}const o=new URLSearchParams;Object.entries(n).forEach(([i,s])=>{o.append(i,String(s))});const c=t.includes("?")?"&":"?";window.location.href=`${t}${c}${o.toString()}`};export{a as r};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/*! Copyright 2024 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
1
3
|
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
4
|
mutation CANCEL_ORDER_MUTATION($orderId: ID!, $reason: String!) {
|
|
3
5
|
cancelOrder(input: { order_id: $orderId, reason: $reason }) {
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! Copyright 2024 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
const E={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"},t=e=>typeof e!="string"?"":E[e]??"";export{t as f};
|
package/chunks/setTaxStatus.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/*! Copyright 2024 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
1
3
|
import{a as F}from"./convertCase.js";const J=`
|
|
2
4
|
fragment ProductDetails on ProductInterface {
|
|
3
5
|
__typename
|
|
@@ -100,6 +102,7 @@ import{a as F}from"./convertCase.js";const J=`
|
|
|
100
102
|
items {
|
|
101
103
|
number
|
|
102
104
|
status
|
|
105
|
+
created_at
|
|
103
106
|
shipping {
|
|
104
107
|
tracking {
|
|
105
108
|
status {
|
|
@@ -134,4 +137,4 @@ import{a as F}from"./convertCase.js";const J=`
|
|
|
134
137
|
}
|
|
135
138
|
}
|
|
136
139
|
}
|
|
137
|
-
`,B=n=>{var
|
|
140
|
+
`,B=n=>{var t;if(!((t=n==null?void 0:n.items)!=null&&t.length))return null;const a=n==null?void 0:n.items,s=n==null?void 0:n.page_info;return{ordersReturn:a.map(l=>{var q,v;const{order:i,status:_,number:y,created_at:p}=l,b=((v=(q=l==null?void 0:l.shipping)==null?void 0:q.tracking)==null?void 0:v.map(u=>{const{status:g,carrier:f,tracking_number:e}=u;return{status:g,carrier:f,trackingNumber:e}}))??[],h=l.items.map(u=>{var N;const g=u==null?void 0:u.quantity,f=u==null?void 0:u.status,e=u==null?void 0:u.request_quantity,O=u==null?void 0:u.uid,R=u==null?void 0:u.order_item,E=((N=M([R]))==null?void 0:N.reduce((k,T)=>T,{}))??{};return{uid:O,quantity:g,status:f,requestQuantity:e,...E}});return{createdReturnAt:p,returnStatus:_,token:i==null?void 0:i.token,orderNumber:i==null?void 0:i.number,returnNumber:y,items:h,tracking:b}}).sort((l,i)=>+i.returnNumber-+l.returnNumber),...s?{pageInfo:{pageSize:s.page_size,totalPages:s.total_pages,currentPage:s.current_page}}:{}}},U=n=>n||0,Q=n=>{var a,s,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:((s=n==null?void 0:n.thumbnail)==null?void 0:s.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 s of n.selected_options)a[s.label]=s.value;return a},w=n=>{const a=n==null?void 0:n.map(c=>({uid:c.uid,label:c.label,values:c.values.map(t=>t.product_name).join(", ")})),s={};return a==null||a.forEach(c=>{s[c.label]=c.values}),Object.keys(s).length>0?s: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 s,c,t,l,i,_,y,p,b,h,q,v,u,g,f,e,O,R,E,N,k,T,C,D,P,A,G,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=(t=(c=(s=a==null?void 0:a.product)==null?void 0:s.price_range)==null?void 0:c.maximum_price)==null?void 0:t.regular_price)==null?void 0:l.value)*(a==null?void 0:a.quantity_ordered)!==((i=a==null?void 0:a.product_sale_price)==null?void 0:i.value)*(a==null?void 0:a.quantity_ordered),total:{value:((_=a==null?void 0:a.product_sale_price)==null?void 0:_.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:((p=a==null?void 0:a.product_sale_price)==null?void 0:p.value)*(a==null?void 0:a.quantity_ordered)||0,currency:(b=a==null?void 0:a.product_sale_price)==null?void 0:b.currency},price:{value:((h=a==null?void 0:a.product_sale_price)==null?void 0:h.value)||0,currency:(q=a==null?void 0:a.product_sale_price)==null?void 0:q.currency},priceInclTax:{value:((v=a==null?void 0:a.product_sale_price)==null?void 0:v.value)||0,currency:(u=a==null?void 0:a.product_sale_price)==null?void 0:u.currency},totalQuantity:U(a==null?void 0:a.quantity_ordered),regularPrice:{value:(O=(e=(f=(g=a==null?void 0:a.product)==null?void 0:g.price_range)==null?void 0:f.maximum_price)==null?void 0:e.regular_price)==null?void 0:O.value,currency:(k=(N=(E=(R=a==null?void 0:a.product)==null?void 0:R.price_range)==null?void 0:E.maximum_price)==null?void 0:N.regular_price)==null?void 0:k.currency},product:Q(a==null?void 0:a.product),thumbnail:{label:((C=(T=a==null?void 0:a.product)==null?void 0:T.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:((A=a.gift_card)==null?void 0:A.sender_name)||"",senderEmail:((G=a.gift_card)==null?void 0:G.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,a)=>{var q,v,u,g,f,e;const s=M(n.items),c=((q=B(n==null?void 0:n.returns))==null?void 0:q.ordersReturn)??[],t=a?c.filter(O=>O.returnNumber===a):c,{total:l,...i}=F({...n,items:s,returns:t},"camelCase",{applied_coupons:"coupons",__typename:"__typename",firstname:"firstName",middlename:"middleName",lastname:"lastName",postcode:"postCode",payment_methods:"payments"}),_=(v=n==null?void 0:n.payment_methods)==null?void 0:v[0],y=(_==null?void 0:_.type)||"",p=(_==null?void 0:_.name)||"",b=(u=i==null?void 0:i.items)==null?void 0:u.reduce((O,R)=>O+(R==null?void 0:R.totalQuantity),0);return{...l,...i,totalQuantity:b,shipping:{amount:((g=i==null?void 0:i.total)==null?void 0:g.totalShipping.value)??0,currency:((e=(f=i.total)==null?void 0:f.totalShipping)==null?void 0:e.currency)||"",code:i.shippingMethod??""},payments:[{code:y,name:p}]}},$=(n,a,s)=>{var c,t,l,i,_,y,p;if((i=(l=(t=(c=a==null?void 0:a.data)==null?void 0:c.customer)==null?void 0:t.orders)==null?void 0:l.items)!=null&&i.length&&n==="orderData"){const b=(p=(y=(_=a==null?void 0:a.data)==null?void 0:_.customer)==null?void 0:y.orders)==null?void 0:p.items[0];return z(b,s)}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};
|
package/chunks/useIsMobile.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
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};
|
|
1
|
+
/*! Copyright 2024 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import{debounce as t}from"@dropins/tools/lib.js";import{useState as o,useCallback as s,useEffect as r}from"@dropins/tools/preact-hooks.js";const w=()=>{const[i,n]=o(window.innerWidth<768),e=s(t(()=>{n(window.innerWidth<768)},1e3),[]);return r(()=>(window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}),[e]),i};export{w as u};
|
package/configs/mock.config.d.ts
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Copyright 2024 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import{jsx as r,jsxs as i,Fragment as K}from"@dropins/tools/preact-jsx-runtime.js";import{Slot as G,classes as g}from"@dropins/tools/lib.js";import{useState as y,useEffect as H,useCallback as V,useMemo as j}from"@dropins/tools/preact-hooks.js";import{events as J}from"@dropins/tools/event-bus.js";import{c as Q}from"../chunks/convertCase.js";import{g as U}from"../chunks/getAttributesForm.js";import{Icon as X,Price as Y,Card as ee,Header as te}from"@dropins/tools/components.js";import"../chunks/OrderCancel.js";import*as a from"@dropins/tools/preact-compat.js";import{f as re}from"../chunks/returnOrdersHelper.js";import{f as ne}from"../chunks/formatDateToLocale.js";import{D as se}from"../chunks/OrderLoaders.js";import"@dropins/tools/preact.js";import{Text as ie,useText as oe}from"@dropins/tools/i18n.js";import"../chunks/network-error.js";import"../chunks/fetch-graphql.js";import"@dropins/tools/fetch-graphql.js";const ce=d=>a.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...d},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"})),ae=d=>a.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...d},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})),de=["firstname","lastname","city","company","country_code","region","region_code","region_id","telephone","id","vat_id","postcode","street","street_2","default_shipping","default_billing"],le=({orderData:d})=>{const[t,_]=y(!0),[l,p]=y(d),[u,e]=y([]);H(()=>{const n=J.on("order/data",m=>{p(m)},{eager:!0});return()=>{n==null||n.off()}},[]),H(()=>{U("shortRequest").then(n=>{if(n){const m=n.map(({name:s,orderNumber:C,label:f})=>({name:Q(s),orderNumber:C,label:de.includes(s)?null:f}));e(m)}}).finally(()=>{_(!1)})},[]);const o=V(n=>{if(!u.length||!l||!l[n])return[];const m=Object.fromEntries(Object.entries(l[n]).map(([s,C])=>[s.toLowerCase(),C]));return u.filter(({name:s})=>m[s.toLowerCase()]).map(s=>({name:s.name,orderNumber:s.orderNumber,value:m[s.name.toLowerCase()],label:s.label}))},[u,l]),h=j(()=>({billingAddress:o("billingAddress"),shippingAddress:o("shippingAddress")}),[o]);return{order:l,normalizeAddress:h,loading:t}},me=({loading:d,order:t,withHeader:_=!0,title:l,paymentIconsMap:p={},normalizeAddress:u,translations:e,slots:o})=>{var L,O,E,T,w,S;const h=!!(t!=null&&t.returnNumber),n=(L=t==null?void 0:t.returns)==null?void 0:L[0],m=j(()=>({checkmo:ce,card:ae,...p}),[p]),s=V(q=>{var x;return(x=u[q])==null?void 0:x.map((c,F)=>r("p",{children:c.label?`${c.label}: ${Array.isArray(c.value)?c.value.join(" "):c==null?void 0:c.value}`:Array.isArray(c.value)?c.value.join(" "):c==null?void 0:c.value},F))},[u]);if(!t||d)return r(se,{});const C=(t==null?void 0:t.email)??"",f=(O=t==null?void 0:t.shipping)==null?void 0:O.code,N=(E=t==null?void 0:t.shipping)==null?void 0:E.amount,R=(T=t==null?void 0:t.shipping)==null?void 0:T.currency,v=t==null?void 0:t.payments,k=v&&v.length>0,D=k?(w=v[0])==null?void 0:w.name:"",M=k?(S=v[0])==null?void 0:S.code:"",W=k&&D!=="",b=s("shippingAddress")??[],A=s("billingAddress")??[],I=i("div",{className:"order-customer-details-content__container-email",children:[r("div",{className:"order-customer-details-content__container-title",children:e==null?void 0:e.emailTitle}),r("p",{children:C})]}),P=h?i("div",{className:"order-customer-details-content__container-return-information",children:[r("div",{className:"order-customer-details-content__container-title",children:e==null?void 0:e.returnInformationTitle}),r("div",{className:"order-customer-details-content__container-description",children:o!=null&&o.OrderReturnInformation?r(G,{"data-testid":"OrderReturnInformation",name:"OrderReturnInformation",slot:o==null?void 0:o.OrderReturnInformation,context:n}):i(K,{children:[i("p",{children:[e.createdReturnAt,r("span",{children:ne(n==null?void 0:n.createdReturnAt)})]}),i("p",{children:[e.returnStatusLabel,r(ie,{id:`Order.CustomerDetails.returnStatus.${re(n==null?void 0:n.returnStatus)}`})]}),i("p",{children:[e.orderNumberLabel,r("span",{children:n==null?void 0:n.orderNumber})]})]})})]}):null,Z=b.length?i("div",{className:"order-customer-details-content__container-shipping_address",children:[r("div",{className:"order-customer-details-content__container-title",children:e.shippingAddressTitle}),r("div",{className:"order-customer-details-content__container-description",children:b})]}):null,$=A.length?i("div",{className:g(["order-customer-details-content__container-billing_address",["order-customer-details-content__container-billing_address--fullwidth",!b.length]]),children:[r("div",{className:"order-customer-details-content__container-title",children:e.billingAddressTitle}),r("div",{className:"order-customer-details-content__container-description",children:A})]}):null,z=W?i("div",{className:g(["order-customer-details-content__container-payment_methods",["order-customer-details-content__container-payment_methods--fullwidth",!f]]),children:[r("div",{className:"order-customer-details-content__container-title",children:e==null?void 0:e.paymentMethodsTitle}),i("p",{"data-testid":"payment_methods_description",className:g([["order-customer-details-content__container-payment_methods--icon",!!m[M]]]),children:[r(X,{source:m[M]}),D]})]}):null,B=f?i("div",{className:"order-customer-details-content__container-shipping_methods",children:[r("div",{className:"order-customer-details-content__container-title",children:e==null?void 0:e.shippingMethodsTitle}),N?i("p",{"data-testid":"shipping_methods_price",children:[r(Y,{amount:N,currency:R})," ",f]}):r("p",{"data-testid":"shipping_methods_placeholder",children:e==null?void 0:e.freeShipping})]}):null;return i(ee,{"data-testid":"order-details",variant:"secondary",className:g(["order-customer-details-content"]),children:[_?r(te,{title:l??(e==null?void 0:e.headerText)}):null,i("div",{className:g(["order-customer-details-content__container",["order-customer-details-content__container--no-margin",b.length||A.length]]),children:[I,Z,h?P:$,h?null:B,h?null:z]})]})},Oe=({paymentIconsMap:d,orderData:t,title:_,className:l,slots:p})=>{const u=oe({emailTitle:"Order.CustomerDetails.email.title",shippingAddressTitle:"Order.CustomerDetails.shippingAddress.title",shippingMethodsTitle:"Order.CustomerDetails.shippingMethods.title",billingAddressTitle:"Order.CustomerDetails.billingAddress.title",paymentMethodsTitle:"Order.CustomerDetails.paymentMethods.title",returnInformationTitle:"Order.CustomerDetails.returnInformation.title",headerText:"Order.CustomerDetails.headerText",freeShipping:"Order.CustomerDetails.freeShipping",createdReturnAt:"Order.CustomerDetails.orderReturnLabels.createdReturnAt",orderNumberLabel:"Order.CustomerDetails.orderReturnLabels.orderNumberLabel",returnStatusLabel:"Order.CustomerDetails.orderReturnLabels.returnStatusLabel"}),{order:e,normalizeAddress:o,loading:h}=le({orderData:t});return r("div",{className:g(["order-customer-details",l]),children:r(me,{slots:p,loading:h,order:e,title:_,paymentIconsMap:d,normalizeAddress:o,translations:u})})};export{Oe as CustomerDetails,Oe as default};
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Copyright 2024 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
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/event-bus.js";import"@dropins/tools/preact.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,3 @@
|
|
|
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
|
+
/*! Copyright 2024 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
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=({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}},W=({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]})]})},q=({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]})]})},F=({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]})},U=({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))})},R=({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"})]})})},G=({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]})},J=({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(W,{translations:a,order:n,subTotalValue:u,shoppingOrdersDisplaySubtotal:t==null?void 0:t.shoppingOrdersDisplaySubtotal}),c(q,{translations:a,order:n,totalShipping:p,shoppingOrdersDisplayShipping:t==null?void 0:t.shoppingOrdersDisplayShipping}),c(F,{translations:a,order:n,totalGiftcardValue:l,totalGiftcardCurrency:o}),c(U,{order:n}),c(R,{order:n,translations:a,renderTaxAccordion:r,totalAccordionTaxValue:m}),c(G,{translations:a,shoppingOrdersDisplaySubtotal:t==null?void 0:t.shoppingOrdersDisplaySubtotal,order:n})]})]})},ut=({withHeader:a,orderData:e,children:t,className:n,...i})=>{const{loading:l,storeConfig:o,order:u}=P({orderData:e}),p=B({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",headerText:"Order.OrderCostSummary.headerText"});return c("div",{...i,className:H(["order-cost-summary",n]),children:c(J,{order:u,withHeader:a,loading:l,storeConfig:o,translations:p})})};export{ut as OrderCostSummary,ut as default};
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Copyright 2024 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import{jsx as r,jsxs as E,Fragment as w}from"@dropins/tools/preact-jsx-runtime.js";import{Card as Y,Header as g,Price as D,CartItem as I,Icon as T,Image as A}from"@dropins/tools/components.js";import"../chunks/OrderCancel.js";import{classes as S}from"@dropins/tools/lib.js";import{useState as N,useEffect as J,useMemo as p,useCallback as ee}from"@dropins/tools/preact-hooks.js";import{events as te}from"@dropins/tools/event-bus.js";import{s as ne}from"../chunks/setTaxStatus.js";import{g as le}from"../chunks/getStoreConfig.js";import*as C from"@dropins/tools/preact-compat.js";import{Fragment as se}from"@dropins/tools/preact.js";import{O as ae}from"../chunks/OrderLoaders.js";import{useText as re}from"@dropins/tools/i18n.js";import"../chunks/fetch-graphql.js";import"@dropins/tools/fetch-graphql.js";const ie=v=>C.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...v},C.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"}),C.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=({orderData:v})=>{const[e,s]=N(!0),[O,u]=N(v),[y,f]=N({taxIncluded:!1,taxExcluded:!1});return J(()=>{le().then(i=>{i&&f(ne(i==null?void 0:i.shoppingCartDisplayPrice))}).finally(()=>{s(!1)})},[]),J(()=>{const i=te.on("order/data",o=>{u(o)},{eager:!0});return()=>{i==null||i.off()}},[]),{loading:e,taxConfig:y,order:O}},he=({loading:v,taxConfig:e,order:s=null,withHeader:O=!0,showConfigurableOptions:u,routeProductDetails:y})=>{const f=!!(s!=null&&s.returnNumber),i=s==null?void 0:s.returnNumber,o=re({cancelled:"Order.OrderProductListContent.cancelledTitle",allOrders:"Order.OrderProductListContent.allOrdersTitle",returned:"Order.OrderProductListContent.returnedTitle",refunded:"Order.OrderProductListContent.refundedTitle",sender:"Order.OrderProductListContent.GiftCard.sender",recipient:"Order.OrderProductListContent.GiftCard.recipient",message:"Order.OrderProductListContent.GiftCard.message",outOfStock:"Order.OrderProductListContent.stockStatus.outOfStock",downloadableCount:"Order.OrderProductListContent.downloadableCount"}),h=p(()=>{if(!s)return[];if(!f){const d=(s==null?void 0:s.items)??[],t=d.filter(a=>a.quantityReturned),n=d.filter(a=>a.quantityCanceled),l=d.filter(a=>!a.quantityCanceled);return[{type:"returned",list:t,title:o.returned},{type:"cancelled",list:n,title:o.cancelled},{type:"allItems",list:l,title:o.allOrders}].filter(a=>a.list.length>0)}const m=s.returns.find(d=>d.returnNumber===i);return[{type:"returned",list:(m==null?void 0:m.items)??[],title:o.returned}]},[s,f,o,i]);return s?h.every(m=>m.list.length===0)?null:r(Y,{variant:"secondary",className:"order-order-product-list-content",children:h.map((m,k)=>{var d;return E(se,{children:[O?r(g,{title:`${m.title} (${m.list.length})`}):null,r("ul",{className:"order-order-product-list-content__items",children:(d=m.list)==null?void 0:d.map(t=>r("li",{"data-testid":"order-product-list-content-item",children:r(ue,{loading:v,product:t,itemType:m.type,taxConfig:e,translations:o,showConfigurableOptions:u,routeProductDetails:y})},t.id))})]},k)})}):r(ae,{})},ue=({loading:v,product:e,itemType:s,taxConfig:O,translations:u,showConfigurableOptions:y,routeProductDetails:f})=>{var x,q,H,V,$,M,P,Q,F,G,R,Z,j,z,W,B,K;const{taxExcluded:i,taxIncluded:o}=O,h=ee((c,U,X)=>r(D,{amount:c,currency:U,weight:"normal",...X}),[]);let m={};const k=s==="cancelled",d=(q=(x=e==null?void 0:e.product)==null?void 0:x.stockStatus)==null?void 0:q.includes("IN_STOCK"),t=(e==null?void 0:e.giftCard)||{},n=(H=e==null?void 0:e.itemPrices)==null?void 0:H.priceIncludingTax,l=(V=e==null?void 0:e.itemPrices)==null?void 0:V.originalPrice,a=($=e==null?void 0:e.itemPrices)==null?void 0:$.price,b=s==="returned"?e==null?void 0:e.requestQuantity:e==null?void 0:e.totalQuantity,L=e.discounted&&((M=e.price)==null?void 0:M.value)!==(l==null?void 0:l.value)*b,_={..."configurableOptions"in e?e.configurableOptions:{},..."bundleOptions"in e?e.bundleOptions:{},..."senderName"in t&&(t!=null&&t.senderName)?{[u.sender]:t==null?void 0:t.senderName}:{},..."senderEmail"in t&&(t!=null&&t.senderEmail)?{[u.sender]:t==null?void 0:t.senderEmail}:{},..."recipientName"in t&&(t!=null&&t.recipientName)?{[u.recipient]:t==null?void 0:t.recipientName}:{},..."recipientEmail"in t&&(t!=null&&t.recipientEmail)?{[u.recipient]:t==null?void 0:t.recipientEmail}:{},..."message"in t&&(t!=null&&t.message)?{[u.message]:t==null?void 0:t.message}:{},..."downloadableLinks"in e&&(e!=null&&e.downloadableLinks)?{[`${(P=e==null?void 0:e.downloadableLinks)==null?void 0:P.count} ${u.downloadableCount}`]:(Q=e==null?void 0:e.downloadableLinks)==null?void 0:Q.result}:{}};if(o&&i){const c=L?l==null?void 0:l.value:(n==null?void 0:n.value)*b;m={taxExcluded:!0,taxIncluded:void 0,price:h(l==null?void 0:l.value,l==null?void 0:l.currency),total:E(w,{children:[h(c,l==null?void 0:l.currency,{variant:e.discounted&&(n==null?void 0:n.value)!==c?"strikethrough":"default"}),e.discounted&&(n==null?void 0:n.value)!==c?h(n==null?void 0:n.value,n==null?void 0:n.currency,{sale:!0,weight:"bold"}):null]}),totalExcludingTax:h((a==null?void 0:a.value)*b,a==null?void 0:a.currency)}}else if(!o&&i)m={taxExcluded:void 0,taxIncluded:void 0,price:h(l==null?void 0:l.value,l==null?void 0:l.currency),total:E(w,{children:[h((l==null?void 0:l.value)*b,n==null?void 0:n.currency,{variant:L?"strikethrough":"default"}),L?h((F=e.price)==null?void 0:F.value,(G=e.price)==null?void 0:G.currency,{sale:!0,weight:"bold"}):null]}),totalExcludingTax:h((a==null?void 0:a.value)*(e==null?void 0:e.totalQuantity),a==null?void 0:a.currency)};else if(o&&!i){const c=L?l.value:n.value*b;m={taxExcluded:void 0,taxIncluded:!0,price:h(n==null?void 0:n.value,n==null?void 0:n.currency),total:E(w,{children:[h(c,n==null?void 0:n.currency,{variant:L?"strikethrough":"default",weight:"bold"}),L?h(n==null?void 0:n.value,n==null?void 0:n.currency,{sale:!0,weight:"bold"}):null]})}}return r(I,{loading:v,alert:k&&d?E("span",{children:[r(T,{source:ie}),u.outOfStock]}):r(w,{}),configurations:(y==null?void 0:y(_))??_,title:f?r("a",{"data-testid":"product-name",className:S(["cart-summary-item__title",["cart-summary-item__title--strikethrough",k]]),href:f(e),children:(R=e==null?void 0:e.product)==null?void 0:R.name}):r("div",{"data-testid":"product-name",className:S(["cart-summary-item__title",["cart-summary-item__title--strikethrough",k]]),children:(Z=e==null?void 0:e.product)==null?void 0:Z.name}),sku:r("div",{children:(j=e==null?void 0:e.product)==null?void 0:j.sku}),quantity:b,image:f?r("a",{href:f(e),children:r(A,{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"})}):r(A,{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"}),...m})},Ce=({className:v,orderData:e,withHeader:s,showConfigurableOptions:O,routeProductDetails:u})=>{const{loading:y,taxConfig:f,order:i}=me({orderData:e});return r("div",{className:S(["order-order-product-list",v]),children:r(he,{loading:y,taxConfig:f,order:i,withHeader:s,showConfigurableOptions:O,routeProductDetails:u})})};export{Ce as OrderProductList,Ce as default};
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Copyright 2024 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import{jsx as a}from"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/components.js";import"../chunks/OrderCancel.js";import{classes as c}from"@dropins/tools/lib.js";import{useState as d,useEffect as R}from"@dropins/tools/preact-hooks.js";import{events as L}from"@dropins/tools/event-bus.js";import{u as O}from"../chunks/useIsMobile.js";import"@dropins/tools/preact-compat.js";import{R as b}from"../chunks/ReturnsListContent.js";import"@dropins/tools/preact.js";import{useText as g}from"@dropins/tools/i18n.js";import"../chunks/returnOrdersHelper.js";import"../chunks/OrderLoaders.js";const w=({orderData:s})=>{const[i,n]=d(s),[u,o]=d([]);return R(()=>{const t=L.on("order/data",e=>{n(e),o(e==null?void 0:e.returns)},{eager:!0});return()=>{t==null||t.off()}},[]),{order:i,orderReturns:u}},j=({slots:s,className:i,orderData:n,withHeader:u,withThumbnails:o,routeReturnDetails:t,routeProductDetails:e,routeTracking:f})=>{const{orderReturns:m}=w({orderData:n}),l=O(),r="fullSizeView",p=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 a("div",{className:c(["order-order-returns",i]),children:m.length?a(b,{pageInfo:{pageSize:1,totalPages:1,currentPage:1},minifiedViewKey:r,slots:s,isMobile:l,withOrderNumber:!1,withReturnNumber:!0,orderReturns:m,translations:p,withHeader:u,withThumbnails:o,minifiedView:!1,routeReturnDetails:t,routeProductDetails:e,routeTracking:f,loading:!1}):null})};export{j as OrderReturns,j as default};
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Copyright 2024 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import{jsxs as w,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{useState as R,useCallback as D,useEffect as O,useMemo as H}from"@dropins/tools/preact-hooks.js";import{events as g}from"@dropins/tools/event-bus.js";import*as A from"@dropins/tools/preact-compat.js";import"@dropins/tools/preact.js";import{Text as N,useText as k}from"@dropins/tools/i18n.js";import{r as d}from"../chunks/redirectTo.js";import{a as I,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 q=e=>A.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},A.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"})),X=({onSubmit:e,loading:a,inLineAlert:o,fieldsConfig:t})=>w(U,{variant:"secondary",className:"order-order-search-form",children:[s("h2",{className:"order-order-search-form__title",children:s(N,{id:"Order.OrderSearchForm.title"})}),s("p",{children:s(N,{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:q})}):null,s(L,{className:"order-order-search-form__wrapper",name:"orderSearchForm",loading:a,fieldsConfig:t,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:a,children:s(N,{id:"Order.OrderSearchForm.button"})},"logIn")})})]});var h=(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))(h||{});const B=e=>{if(!e)return null;const a=new FormData(e);if(e.querySelectorAll('input[type="checkbox"]').forEach(t=>{a.has(t.name)||a.set(t.name,"false"),t.checked&&a.set(t.name,"true")}),a&&typeof a.entries=="function"){const t=a.entries();if(t&&typeof t[Symbol.iterator]=="function")return JSON.parse(JSON.stringify(Object.fromEntries(t)))||{}}return{}},M=e=>{try{return new URL(window.location.href).searchParams.get(e)}catch{return null}},G=({onError:e,isAuth:a,renderSignIn:o,routeCustomerOrder:t,routeGuestOrder:m})=>{const[E,p]=R({text:"",type:"success"}),[y,u]=R(!1),i=k({invalidSearch:"Order.Errors.invalidSearch",email:"Order.OrderSearchForm.email",postcode:"Order.OrderSearchForm.postcode",number:"Order.OrderSearchForm.orderNumber"}),S=D(async r=>{const c=M("orderRef"),n=c&&c.length>20;if(!r&&!c||!(r!=null&&r.number)&&!(r!=null&&r.token)&&!c)return null;if(a){const f=await I();(f==null?void 0:f.email)===r.email?d(t,{orderRef:r==null?void 0:r.number}):n||d(m,{orderRef:r.token})}else n||d(m,{orderRef:r==null?void 0:r.token})},[a,t,m]);O(()=>{const r=g.on("order/data",c=>{S(c)},{eager:!0});return()=>{r==null||r.off()}},[S]),O(()=>{const r=M("orderRef"),c=r&&r.length>20?r:null;r&&(c?d(m,{orderRef:r}):a?d(t,{orderRef:r}):o==null||o({render:!0,formValues:{number:r}}))},[a,t,m,o]);const v=H(()=>[{entityType:"CUSTOMER_ADDRESS",is_unique:!1,label:i.email,options:[],defaultValue:"",fieldType:h.TEXT,className:"",required:!0,orderNumber:1,name:"email",id:"email",code:"email"},{entityType:"CUSTOMER_ADDRESS",is_unique:!1,label:i.postcode,options:[],defaultValue:"",fieldType:h.TEXT,className:"",required:!0,orderNumber:2,name:"postcode",id:"postcode",code:"postcode"},{entityType:"CUSTOMER_ADDRESS",is_unique:!1,label:i.number,options:[],defaultValue:"",fieldType:h.TEXT,className:"",required:!0,orderNumber:3,name:"number",id:"number",code:"number"}],[i]);return{onSubmit:D(async(r,c)=>{if(!c)return null;u(!0);const n=B(r.target);await P(n).then(l=>{l||p({text:i.invalidSearch,type:"warning"}),g.emit("order/data",l)}).catch(async l=>{var b;let f=!0;e==null||e({error:l.message});const T=a?await I():{email:""};(T==null?void 0:T.email)===(n==null?void 0:n.email)?d(t,{orderRef:n.number}):f=o==null?void 0:o({render:T===null||((b=l==null?void 0:l.message)==null?void 0:b.includes("Please login to view the order.")),formValues:n}),f&&p({text:l.message,type:"warning"})}).finally(()=>{u(!1)})},[a,e,o,t,i.invalidSearch]),inLineAlert:E,loading:y,normalizeFieldsConfig:v}},le=({className:e,isAuth:a,renderSignIn:o,routeCustomerOrder:t,routeGuestOrder:m,onError:E})=>{const{onSubmit:p,loading:y,inLineAlert:u,normalizeFieldsConfig:i}=G({onError:E,isAuth:a,renderSignIn:o,routeCustomerOrder:t,routeGuestOrder:m});return s("div",{className:_(["order-order-search",e]),children:s(X,{onSubmit:p,loading:y,inLineAlert:u,fieldsConfig:i})})};export{le as OrderSearch,le as default};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Copyright 2024 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import{jsx as c,jsxs as S,Fragment as g}from"@dropins/tools/preact-jsx-runtime.js";import{Card as x,Header as $,Button as y,InLineAlert as U,Modal as b}from"@dropins/tools/components.js";import"../chunks/OrderCancel.js";import{f as F}from"../chunks/returnOrdersHelper.js";import{classes as E,Slot as P}from"@dropins/tools/lib.js";import{f as I}from"../chunks/formatDateToLocale.js";import{useState as h,useEffect as T}from"@dropins/tools/preact-hooks.js";import{events as w}from"@dropins/tools/event-bus.js";import{useMemo as K,useState as G}from"@dropins/tools/preact-compat.js";import{r as V}from"../chunks/redirectTo.js";import"@dropins/tools/preact.js";import{O as k}from"../chunks/OrderCancelForm.js";import{useText as O,Text as M}from"@dropins/tools/i18n.js";import{C as q}from"../chunks/OrderLoaders.js";import{G as H}from"../chunks/getGuestOrder.graphql.js";import{f as W,h as j}from"../chunks/fetch-graphql.js";import{b as J}from"../chunks/transform-order-details.js";import{g as z}from"../chunks/getStoreConfig.js";import"../chunks/requestGuestOrderCancel.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/convertCase.js";const A={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"},B=({slots:t,title:r,status:n,orderData:e,routeCreateReturn:o})=>{var v;const i=!!(e!=null&&e.returnNumber),s=String(n).toLocaleLowerCase(),a=(v=e==null?void 0:e.returns)==null?void 0:v[0],l=(a==null?void 0:a.returnStatus)??"",d=(a==null?void 0:a.createdReturnAt)??"",m=O(`Order.OrderStatusContent.${A[s]}.title`),f=O(`Order.OrderStatusContent.${A[s]}.message`),p=O(`Order.OrderStatusContent.${A[s]}.messageWithoutDate`),u=O({title:`Order.OrderStatusContent.resturnStatus.${F(l)}`,returnMessage:"Order.OrderStatusContent.returnMessage"});if(!n)return c("div",{});const C=e!=null&&e.orderStatusChangeDate?f==null?void 0:f.message.replace("{DATE}",e==null?void 0:e.orderStatusChangeDate):p.messageWithoutDate,_=(u==null?void 0:u.returnMessage.replace("{ORDER_CREATE_DATE}",I(e==null?void 0:e.orderDate)).replace("{RETURN_CREATE_DATE}",I(d)))??"",N=i?r??u.title:r??m.title;return S(x,{className:"order-order-status-content",variant:"secondary",children:[c($,{title:N}),S("div",{className:"order-order-status-content__wrapper",children:[c("div",{className:E(["order-order-status-content__wrapper-description",["order-order-status-content__wrapper-description--actions-slot",!!(t!=null&&t.OrderActions)]]),children:c("p",{children:i?_:C})}),c(X,{orderData:e,slots:t,routeCreateReturn:o})]})]})};var R=(t=>(t.CANCEL="CANCEL",t.RETURN="RETURN",t.REORDER="REORDER",t))(R||{});const Q=({orderData:t})=>{const[r,n]=h(t),[e,o]=h(t==null?void 0:t.status);return T(()=>{const i=w.on("order/data",s=>{n(s),o(s.status)},{eager:!0});return()=>{i==null||i.off()}},[]),{orderStatus:e,order:r}},X=({className:t,orderData:r,slots:n,routeCreateReturn:e})=>{const o=O({cancel:"Order.OrderStatusContent.actions.cancel",createReturn:"Order.OrderStatusContent.actions.createReturn",createAnotherReturn:"Order.OrderStatusContent.actions.createAnotherReturn",reorder:"Order.OrderStatusContent.actions.reorder"}),i=K(()=>{const s=r==null?void 0:r.availableActions,a=!!(s!=null&&s.length),l=!!(r!=null&&r.returnNumber),d=()=>{V(e,{},r)};return c(g,{children:n!=null&&n.OrderActions?c(P,{"data-testid":"OrderActionsSlot",name:"OrderCanceledActions",slot:n==null?void 0:n.OrderActions,context:r}):c("div",{"data-testid":"availableActionsList",className:E(["order-order-actions__wrapper",["order-order-actions__wrapper--empty",!a]]),children:s==null?void 0:s.map(m=>{switch(m){case R.CANCEL:return c(g,{children:l?null:!!r&&c(ee,{orderRef:r.token??atob(r.id)})});case R.RETURN:return c(y,{variant:"secondary",onClick:d,children:l?o.createAnotherReturn:o.createReturn});case R.REORDER:return c(g,{children:l?null:c(y,{variant:"secondary",children:o.reorder})})}})})})},[r,e,n==null?void 0:n.OrderActions,o]);return c("div",{className:E(["order-order-actions",t]),children:i})},L=()=>{const[t,r]=h(null);return T(()=>{const n=sessionStorage.getItem("orderStoreConfig"),e=n?JSON.parse(n):null;e?r(e):z().then(o=>{o&&(sessionStorage.setItem("orderStoreConfig",JSON.stringify(o)),r(o))})},[]),t},Y=`
|
|
2
4
|
mutation CONFIRM_CANCEL_ORDER_MUTATION(
|
|
3
5
|
$orderId: ID!,
|
|
4
6
|
$confirmationKey: String!
|
|
@@ -16,5 +18,5 @@ import{jsx as s,jsxs as p,Fragment as w}from"@dropins/tools/preact-jsx-runtime.j
|
|
|
16
18
|
}
|
|
17
19
|
}
|
|
18
20
|
}
|
|
19
|
-
${
|
|
20
|
-
`,
|
|
21
|
+
${H}
|
|
22
|
+
`,Z=async(t,r)=>W(Y,{variables:{orderId:t,confirmationKey:r}}).then(async({errors:n,data:e})=>{var s,a,l,d;const o=[...(s=e==null?void 0:e.confirmCancelOrder)!=null&&s.errorV2?[(a=e==null?void 0:e.confirmCancelOrder)==null?void 0:a.errorV2]:[],...n??[]];let i=null;return(l=e==null?void 0:e.confirmCancelOrder)!=null&&l.order&&(i=J((d=e==null?void 0:e.confirmCancelOrder)==null?void 0:d.order),w.emit("order/data",i)),o.length>0?j(o):i}),D=({enableOrderCancellation:t})=>{const r=O({orderCancelled:"Order.OrderStatusContent.orderCanceled.message"}),[n,e]=h({text:"",status:void 0});return T(()=>{if(!t)return;const o=new URLSearchParams(window.location.search),i=o.get("orderId"),s=o.get("confirmationKey");i&&s&&Z(atob(i),s).then(()=>{e({text:r.orderCancelled,status:"success"})}).catch(a=>{e({text:a.message,status:"warning"})})},[t,r.orderCancelled]),{confirmOrderCancellation:n}},_e=({slots:t,orderData:r,className:n,statusTitle:e,status:o,routeCreateReturn:i})=>{const{orderStatus:s,order:a}=Q({orderData:r}),[l,d]=G(!1),m=()=>{d(!0);const C=new URL(window.location.href),_=C.searchParams.get("orderId"),N=C.searchParams.get("confirmationKey");_&&N&&(C.searchParams.delete("orderId"),C.searchParams.delete("confirmationKey"),window.history.replaceState({},document.title,C.toString()))},f=O({cancelOrder:"Order.OrderStatusContent.actions.cancel"}),p=L(),{confirmOrderCancellation:u}=D({enableOrderCancellation:p==null?void 0:p.orderCancellationEnabled});return S("div",{className:E(["order-order-status",n]),children:[!l&&(u==null?void 0:u.status)!==void 0&&c(U,{heading:f.cancelOrder,onDismiss:m,description:u.text,type:u.status}),a?c(B,{title:e,status:o||s,slots:t,orderData:a,routeCreateReturn:i}):c(q,{withCard:!1})]})},ee=({orderRef:t})=>{const[r,n]=h(!1),e=()=>{n(!0)},o=()=>{n(!1)},i=L(),s=(i==null?void 0:i.orderCancellationReasons)??[],a=l=>l.map((d,m)=>({text:d==null?void 0:d.description,value:m.toString()}));return w.on("order/data",l=>{const d=String(l.status).toLocaleLowerCase();(d==="guest order cancellation requested"||d==="canceled")&&o()}),S(g,{children:[c(y,{variant:"secondary",onClick:e,"data-testid":"cancel-button",children:c(M,{id:"Order.OrderStatusContent.actions.cancel"})}),r&&c(b,{centered:!0,size:"medium",onClose:o,className:"order-order-cancel__modal",title:c("h2",{className:"order-order-cancel__title",children:c(M,{id:"Order.OrderCancelForm.title"})}),"data-testid":"order-cancellation-reasons-modal",children:c(k,{orderRef:t,cancelReasons:a(s)})})]})};export{_e as OrderStatus,_e as default};
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Copyright 2024 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
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{useState as i,useEffect as $,useCallback as h}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/event-bus.js";import{g as I}from"../chunks/getCustomerOrdersReturn.js";import{u as y}from"../chunks/useIsMobile.js";import"@dropins/tools/preact-compat.js";import{R as A}from"../chunks/ReturnsListContent.js";import"@dropins/tools/preact.js";import{useText as M}from"@dropins/tools/i18n.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";import"../chunks/returnOrdersHelper.js";import"../chunks/OrderLoaders.js";const f={totalPages:1,currentPage:1,pageSize:1},T=()=>{const[s,n]=i(!0),[o,t]=i([]),[u,a]=i(f),[m,d]=i(1);$(()=>{I().then(r=>{t((r==null?void 0:r.ordersReturn)??[]),a((r==null?void 0:r.pageInfo)??f)}).finally(()=>{n(!1)})},[]);const l=h(r=>{d(r)},[]);return{pageInfo:u,selectedPage:m,loading:s,orderReturns:o,handleSetSelectPage:l}},W=({slots:s,withReturnsListButton:n,className:o,minifiedView:t,withHeader:u,withThumbnails:a,returnsInMinifiedView:m,routeReturnDetails:d,routeOrderDetails:l,routeTracking:r,routeReturnsList:g,routeProductDetails:L})=>{const{pageInfo:p,selectedPage:R,handleSetSelectPage:O,loading:b,orderReturns:P}=T(),w=y(),e=t?"minifiedView":"fullSizeView",N=M({viewAllOrdersButton:`Order.Returns.${e}.returnsList.viewAllOrdersButton`,ariaLabelLink:`Order.Returns.${e}.returnsList.ariaLabelLink`,emptyOrdersListMessage:`Order.Returns.${e}.returnsList.emptyOrdersListMessage`,minifiedViewTitle:`Order.Returns.${e}.returnsList.minifiedViewTitle`,orderNumber:`Order.Returns.${e}.returnsList.orderNumber`,returnNumber:`Order.Returns.${e}.returnsList.returnNumber`,carrier:`Order.Returns.${e}.returnsList.carrier`});return c("div",{className:S(["order-returns-list",o]),children:c(A,{minifiedViewKey:e,withOrderNumber:!0,withReturnNumber:!0,slots:s,selectedPage:R,handleSetSelectPage:O,pageInfo:p,withReturnsListButton:n,isMobile:w,orderReturns:P,translations:N,withHeader:u,returnsInMinifiedView:m,withThumbnails:a,minifiedView:t,routeReturnDetails:d,routeOrderDetails:l,routeTracking:r,routeReturnsList:g,routeProductDetails:L,loading:b})})};export{W as default};
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Copyright 2024 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import{jsxs as u,jsx as n,Fragment as b}from"@dropins/tools/preact-jsx-runtime.js";import{classes as L,Slot as A}from"@dropins/tools/lib.js";import{Card as N,Header as _,Accordion as o,AccordionSection as x,ContentGrid as W,Image as E}from"@dropins/tools/components.js";import"../chunks/OrderCancel.js";import{useState as y,useEffect as J}from"@dropins/tools/preact-hooks.js";import{events as K}from"@dropins/tools/event-bus.js";import{u as Q}from"../chunks/useIsMobile.js";import{Text as $,useText as X}from"@dropins/tools/i18n.js";import{C as Z}from"../chunks/OrderLoaders.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/preact.js";var R=(e=>(e.PENDING="pending",e.SHIPPING="shipping",e.COMPLETE="complete",e.PROCESSING="processing",e.HOLD="on hold",e.CANCELED="Canceled",e.SUSPECTED_FRAUD="suspected fraud",e.PAYMENT_REVIEW="payment review",e))(R||{});const Y=({orderData:e})=>{const[r,i]=y(!0),[c,d]=y(e),[m,f]=y(!1);return J(()=>{const a=K.on("order/data",t=>{d(t),f(t==null?void 0:t.isVirtual),i(!1)},{eager:!0});return()=>{a==null||a.off()}},[]),{loading:r,order:c,isVirtualProduct:m}},P=({slots:e,collapseThreshold:r,translations:i,returnData:c,routeTracking:d,routeProductDetails:m})=>{var t;const f=Q(),a=m?"a":"span";return u(N,{variant:"secondary",className:L(["order-shipping-status-card","order-shipping-status-card--return-order"]),children:[n(_,{title:i.returnOrderCardTitle}),u("div",{children:[(t=c==null?void 0:c.tracking)==null?void 0:t.map((l,C)=>{var S,p;return u("p",{children:[`${i.carrier} ${(p=(S=l==null?void 0:l.carrier)==null?void 0:S.label)==null?void 0:p.toLocaleUpperCase()}: `,n("a",{href:`${(d==null?void 0:d(l))??"#"}`,rel:"noreferrer",children:l.trackingNumber})]},`${l.trackingNumber}_${C}`)}),e!=null&&e.ReturnItemsDetails?n(A,{"data-testid":"returnItemsDetails",name:"ReturnItemsDetails",slot:e==null?void 0:e.ReturnItemsDetails,context:{items:c.items}}):null,n(o,{actionIconPosition:"right","data-testid":"dropinAccordion",children:n(x,{defaultOpen:r>=c.items.length,title:n($,{id:"Order.ShippingStatusCard.itemText",plural:c.items.length,fields:{count:c.items.length}}),children:n(W,{maxColumns:f?3:9,emptyGridContent:n(b,{}),className:L(["order-shipping-status-card__images",["order-shipping-status-card__images-3",f]]),children:c.items.map((l,C)=>{var I,T;const S=(I=l.thumbnail)==null?void 0:I.label,p=(T=l.thumbnail)==null?void 0:T.url;return n(a,{href:(m==null?void 0:m(l))??"#","data-testid":`${C}${l.uid}`,children:n(E,{alt:S,src:p,width:85,height:114})},`${C}${l.uid}`)})})})})]})]})},k=({translations:e,slots:r,orderData:i,collapseThreshold:c=10,routeProductDetails:d,routeTracking:m})=>{var I,T,w,G,M;const f=!!(i!=null&&i.returnNumber),a=i==null?void 0:i.returnNumber,t=d?"a":"span",l=(I=i==null?void 0:i.status)==null?void 0:I.toLocaleLowerCase(),S=((T=i==null?void 0:i.shipments)==null?void 0:T.length)===1&&(l==null?void 0:l.includes(R.COMPLETE)),p=(w=i==null?void 0:i.items)==null?void 0:w.filter(g=>(g==null?void 0:g.quantityShipped)===0);if(f&&(i!=null&&i.returns.length)){const g=i.returns.find(s=>s.returnNumber===a);return n(b,{children:g&&g.tracking.length>0?n(P,{slots:r,collapseThreshold:c,translations:e,returnData:g,routeTracking:m,routeProductDetails:d}):null})}return!i||l!=null&&l.includes(R.CANCELED)?null:(G=i==null?void 0:i.shipments)!=null&&G.length?u(b,{children:[(M=i==null?void 0:i.shipments)==null?void 0:M.map(({tracking:g,items:s,id:O},z)=>u(N,{variant:"secondary",className:"order-shipping-status-card",children:[n(_,{title:e.shippingCardTitle}),g==null?void 0:g.map(h=>{var v;return u("div",{className:"order-shipping-status-card__header",role:"status",children:[u("div",{className:"order-shipping-status-card__header--content",children:[u("p",{children:[e.carrier," ",(v=h==null?void 0:h.carrier)==null?void 0:v.toLocaleUpperCase()," | ",h==null?void 0:h.number]}),n("p",{children:h==null?void 0:h.title})]}),r!=null&&r.DeliveryTrackActions?n(A,{"data-testid":"deliverySlotActions",name:"DeliveryTrackActions",slot:r==null?void 0:r.DeliveryTrackActions,context:{trackInformation:h}}):null]},h.number)}),S?null:n(o,{actionIconPosition:"right","data-testid":"dropinAccordion",children:n(x,{"data-position":z+1,defaultOpen:c>=(s==null?void 0:s.length),title:n(b,{children:n($,{id:"Order.ShippingStatusCard.notYetShippedImagesTitle",plural:s==null?void 0:s.length,fields:{count:s==null?void 0:s.length}})}),children:n(W,{maxColumns:6,emptyGridContent:n(b,{}),className:"order-shipping-status-card__images",children:s==null?void 0:s.map(h=>{var V,U,H,j,F,q;const v=(H=(U=(V=h==null?void 0:h.orderItem)==null?void 0:V.product)==null?void 0:U.thumbnail)==null?void 0:H.label,B=(q=(F=(j=h==null?void 0:h.orderItem)==null?void 0:j.product)==null?void 0:F.thumbnail)==null?void 0:q.url;return n(t,{href:(d==null?void 0:d(h))??"#",children:n(E,{alt:v,src:B||"",width:85,height:114})},h.id)})})})}),r!=null&&r.DeliveryTimeLine?n(A,{"data-testid":"deliverySlotTimeLine",name:"DeliveryTimeLine",slot:r==null?void 0:r.DeliveryTimeLine,context:{}}):null]},O)),p!=null&&p.length?u(N,{variant:"secondary",className:"order-shipping-status-card","data-testid":"dropinAccordionNotYetShipped2",children:[n(_,{title:e.notYetShippedTitle}),n(o,{actionIconPosition:"right",children:n(x,{defaultOpen:c>=(p==null?void 0:p.length),title:n($,{id:"Order.ShippingStatusCard.notYetShippedImagesTitle",plural:p==null?void 0:p.length,fields:{count:p==null?void 0:p.length}}),children:n("div",{className:"order-shipping-status-card__images",children:p==null?void 0:p.map(g=>{var s,O;return n(t,{href:(d==null?void 0:d(g))??"#",children:n(E,{alt:(s=g.thumbnail)==null?void 0:s.label,src:((O=g.thumbnail)==null?void 0:O.url)||"",width:85,height:114})},g.id)})})})})]}):null]}):u(N,{variant:"secondary",className:"order-shipping-status-card",children:[n(_,{title:e.shippingInfoTitle}),n("div",{className:"order-shipping-status-card__header",children:u("div",{className:"order-shipping-status-card__header--content",children:[i!=null&&i.carrier?n("p",{children:i==null?void 0:i.carrier}):null,n("p",{children:e.noInfoTitle})]})})]})},gi=({slots:e,className:r,collapseThreshold:i,orderData:c,routeOrderDetails:d,routeTracking:m,routeProductDetails:f})=>{const{loading:a,order:t,isVirtualProduct:l}=Y({orderData:c}),C=X({carrier:"Order.ShippingStatusCard.carrier",prepositionOf:"Order.ShippingStatusCard.prepositionOf",returnOrderCardTitle:"Order.ShippingStatusCard.returnOrderCardTitle",shippingCardTitle:"Order.ShippingStatusCard.shippingCardTitle",shippingInfoTitle:"Order.ShippingStatusCard.shippingInfoTitle",notYetShippedTitle:"Order.ShippingStatusCard.notYetShippedTitle",noInfoTitle:"Order.ShippingStatusCard.noInfoTitle",returnNumber:"Order.ShippingStatusCard.returnNumber",orderNumber:"Order.ShippingStatusCard.orderNumber"});return!a&&l?null:n("div",{className:L(["order-shipping-status",r]),children:!a&&t?n(k,{translations:C,routeOrderDetails:d,routeTracking:m,slots:e,orderData:t,collapseThreshold:i,routeProductDetails:f}):n(Z,{withCard:!1})})};export{gi as ShippingStatus,gi as default};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { OrderItemModel } from './order-details';
|
|
2
2
|
|
|
3
|
-
export interface OrdersReturnItemsPropsModel {
|
|
4
|
-
orderItem: OrderItemModel;
|
|
3
|
+
export interface OrdersReturnItemsPropsModel extends OrderItemModel {
|
|
5
4
|
quantity: number;
|
|
6
5
|
requestQuantity: number;
|
|
7
6
|
status: string;
|
|
@@ -23,6 +22,7 @@ export interface OrdersReturnPropsModel {
|
|
|
23
22
|
orderNumber: string;
|
|
24
23
|
returnStatus: string;
|
|
25
24
|
returnNumber: string;
|
|
25
|
+
createdReturnAt: string;
|
|
26
26
|
tracking: OrdersReturnTrackingProps[];
|
|
27
27
|
items: OrdersReturnItemsPropsModel[];
|
|
28
28
|
}
|
|
@@ -88,6 +88,7 @@ export type OrderItemModel = {
|
|
|
88
88
|
quantityRefunded: number;
|
|
89
89
|
quantityReturned: number;
|
|
90
90
|
quantityShipped: number;
|
|
91
|
+
requestQuantity: number;
|
|
91
92
|
};
|
|
92
93
|
export type ShipmentItemsModel = {
|
|
93
94
|
id: string;
|
|
@@ -111,6 +112,7 @@ export type ShipmentsModel = {
|
|
|
111
112
|
items: ShipmentItemsModel[];
|
|
112
113
|
};
|
|
113
114
|
export type OrderDataModel = {
|
|
115
|
+
returnNumber: string;
|
|
114
116
|
id: string;
|
|
115
117
|
orderStatusChangeDate?: string;
|
|
116
118
|
number: string;
|
|
@@ -121,6 +123,7 @@ export type OrderDataModel = {
|
|
|
121
123
|
totalQuantity: number;
|
|
122
124
|
shippingMethod?: string;
|
|
123
125
|
carrier?: string;
|
|
126
|
+
orderDate: string;
|
|
124
127
|
returns: OrdersReturnPropsModel[];
|
|
125
128
|
discounts: {
|
|
126
129
|
amount: MoneyProps;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GuestOrderByTokenResponse, GuestOrderResponse } from '../../types';
|
|
2
2
|
import { OrderDataModel } from '../models';
|
|
3
3
|
|
|
4
|
-
export declare const transformGuestOrder: (response: GuestOrderResponse) => OrderDataModel | null;
|
|
5
|
-
export declare const transformGuestOrderByToken: (response: GuestOrderByTokenResponse) => OrderDataModel | null;
|
|
4
|
+
export declare const transformGuestOrder: (response: GuestOrderResponse, returnRef?: string) => OrderDataModel | null;
|
|
5
|
+
export declare const transformGuestOrderByToken: (response: GuestOrderByTokenResponse, returnRef?: string) => OrderDataModel | null;
|
|
6
6
|
//# sourceMappingURL=transform-guest-order.d.ts.map
|
|
@@ -12,6 +12,6 @@ export declare const transformLinks: (links: {
|
|
|
12
12
|
result: string;
|
|
13
13
|
} | null;
|
|
14
14
|
export declare const transformOrderItems: (items: OrderItemProps[]) => OrderItemModel[];
|
|
15
|
-
export declare const transformOrderData: (orderData: OrderProps) => any;
|
|
16
|
-
export declare const transformOrderDetails: <T extends "orderData">(queryType: QueryType, response: ResponseData<T
|
|
15
|
+
export declare const transformOrderData: (orderData: OrderProps, returnRef?: string) => any;
|
|
16
|
+
export declare const transformOrderDetails: <T extends "orderData">(queryType: QueryType, response: ResponseData<T>, returnRef?: string) => TransformedData<T>;
|
|
17
17
|
//# sourceMappingURL=transform-order-details.d.ts.map
|
package/i18n/en_US.json.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ declare const _default: {
|
|
|
2
2
|
"Order": {
|
|
3
3
|
"OrderCostSummary": {
|
|
4
4
|
"headerText": "Order summary",
|
|
5
|
+
"headerReturnText": "Return summary",
|
|
5
6
|
"subtotal": {
|
|
6
7
|
"title": "Subtotal"
|
|
7
8
|
},
|
|
@@ -90,6 +91,8 @@ declare const _default: {
|
|
|
90
91
|
"OrderProductListContent": {
|
|
91
92
|
"cancelledTitle": "Cancelled",
|
|
92
93
|
"allOrdersTitle": "Your order",
|
|
94
|
+
"returnedTitle": "Your return",
|
|
95
|
+
"refundedTitle": "Your refunded",
|
|
93
96
|
"downloadableCount": "Files",
|
|
94
97
|
"stockStatus": {
|
|
95
98
|
"inStock": "In stock",
|
|
@@ -115,23 +118,46 @@ declare const _default: {
|
|
|
115
118
|
}
|
|
116
119
|
},
|
|
117
120
|
"ShippingStatusCard": {
|
|
121
|
+
"orderNumber": "Order number:",
|
|
122
|
+
"returnNumber": "Return number:",
|
|
123
|
+
"itemText": {
|
|
124
|
+
"none": "",
|
|
125
|
+
"one": "Package contents ({{count}} item)",
|
|
126
|
+
"many": "Package contents ({{count}} items)"
|
|
127
|
+
},
|
|
118
128
|
"trackButton": "Track package",
|
|
119
129
|
"carrier": "Carrier:",
|
|
120
130
|
"prepositionOf": "of",
|
|
131
|
+
"returnOrderCardTitle": "Package details",
|
|
121
132
|
"shippingCardTitle": "Package details",
|
|
122
|
-
"shippingInfoTitle": "Shipping
|
|
133
|
+
"shippingInfoTitle": "Shipping information",
|
|
123
134
|
"notYetShippedTitle": "Not yet shipped",
|
|
124
|
-
"notYetShippedImagesTitle":
|
|
125
|
-
|
|
126
|
-
"
|
|
127
|
-
"plural": "items"
|
|
135
|
+
"notYetShippedImagesTitle": {
|
|
136
|
+
"singular": "Package contents ({{count}} item)",
|
|
137
|
+
"plural": "Package contents ({{count}} items)"
|
|
128
138
|
}
|
|
129
139
|
},
|
|
130
140
|
"OrderStatusContent": {
|
|
131
141
|
"noInfoTitle": "Check back later for more details.",
|
|
142
|
+
"returnMessage": "The order was placed on {ORDER_CREATE_DATE} and your return process started on {RETURN_CREATE_DATE}",
|
|
143
|
+
"resturnStatus": {
|
|
144
|
+
"pending": "Pending",
|
|
145
|
+
"authorized": "Authorized",
|
|
146
|
+
"partiallyAuthorized": "Partially authorized",
|
|
147
|
+
"received": "Received",
|
|
148
|
+
"partiallyReceived": "Partially received",
|
|
149
|
+
"approved": "Approved",
|
|
150
|
+
"partiallyApproved": "Partially approved",
|
|
151
|
+
"rejected": "Rejected",
|
|
152
|
+
"partiallyRejected": "Partially rejected",
|
|
153
|
+
"denied": "Denied",
|
|
154
|
+
"processedAndClosed": "Processed and closed",
|
|
155
|
+
"closed": "Closed"
|
|
156
|
+
},
|
|
132
157
|
"actions": {
|
|
133
158
|
"cancel": "Cancel order",
|
|
134
|
-
"
|
|
159
|
+
"createReturn": "Return or replace",
|
|
160
|
+
"createAnotherReturn": "Start another return",
|
|
135
161
|
"reorder": "Reorder"
|
|
136
162
|
},
|
|
137
163
|
"orderPending": {
|
|
@@ -182,6 +208,25 @@ declare const _default: {
|
|
|
182
208
|
"CustomerDetails": {
|
|
183
209
|
"headerText": "Customer information",
|
|
184
210
|
"freeShipping": "Free shipping",
|
|
211
|
+
"orderReturnLabels": {
|
|
212
|
+
"createdReturnAt": "Return requested on: ",
|
|
213
|
+
"returnStatusLabel": "Return status: ",
|
|
214
|
+
"orderNumberLabel": "Order number: "
|
|
215
|
+
},
|
|
216
|
+
"returnStatus": {
|
|
217
|
+
"pending": "Pending",
|
|
218
|
+
"authorized": "Authorized",
|
|
219
|
+
"partiallyAuthorized": "Partially authorized",
|
|
220
|
+
"received": "Received",
|
|
221
|
+
"partiallyReceived": "Partially received",
|
|
222
|
+
"approved": "Approved",
|
|
223
|
+
"partiallyApproved": "Partially approved",
|
|
224
|
+
"rejected": "Rejected",
|
|
225
|
+
"partiallyRejected": "Partially rejected",
|
|
226
|
+
"denied": "Denied",
|
|
227
|
+
"processedAndClosed": "Processed and closed",
|
|
228
|
+
"closed": "Closed"
|
|
229
|
+
},
|
|
185
230
|
"email": {
|
|
186
231
|
"title": "Contact details"
|
|
187
232
|
},
|
|
@@ -194,8 +239,11 @@ declare const _default: {
|
|
|
194
239
|
"billingAddress": {
|
|
195
240
|
"title": "Billing address"
|
|
196
241
|
},
|
|
197
|
-
"
|
|
242
|
+
"paymentMethods": {
|
|
198
243
|
"title": "Payment method"
|
|
244
|
+
},
|
|
245
|
+
"returnInformation": {
|
|
246
|
+
"title": "Return details"
|
|
199
247
|
}
|
|
200
248
|
},
|
|
201
249
|
"Errors": {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formats a date string according to a specified locale and options.
|
|
3
|
+
* Returns "Invalid Date" if the input date string is invalid.
|
|
4
|
+
*
|
|
5
|
+
* @param {string} date - The date string to be formatted.
|
|
6
|
+
* @param {string} [locale='en-US'] - The locale to use for formatting. Defaults to 'en-US'.
|
|
7
|
+
* @param {Intl.DateTimeFormatOptions} [options={}] - Optional formatting options to customize the output.
|
|
8
|
+
* @returns {string} The formatted date string, or "Invalid Date" if the input is invalid.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* // Default formatting (en-US locale, MM/DD/YYYY)
|
|
12
|
+
* console.log(formatDateToLocale('2023-08-29'));
|
|
13
|
+
* // Output: "08/29/2023"
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* // Formatting with a specified locale (e.g., en-GB for DD/MM/YYYY)
|
|
17
|
+
* console.log(formatDateToLocale('2023-08-29', 'en-GB'));
|
|
18
|
+
* // Output: "29/08/2023"
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* // Formatting with a specified locale and custom options (e.g., de-DE with long month format)
|
|
22
|
+
* console.log(formatDateToLocale('2023-08-29', 'de-DE', { month: 'long', year: 'numeric' }));
|
|
23
|
+
* // Output: "29. August 2023"
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* // Handling an invalid date string
|
|
27
|
+
* console.log(formatDateToLocale('invalid-date'));
|
|
28
|
+
* // Output: "Invalid Date"
|
|
29
|
+
*/
|
|
30
|
+
export declare const formatDateToLocale: (date: string, locale?: string, options?: Intl.DateTimeFormatOptions) => string;
|
|
31
|
+
//# sourceMappingURL=formatDateToLocale.d.ts.map
|
package/lib/redirectTo.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export type QueryParams = Record<string, string | number | boolean>;
|
|
2
|
-
export declare const redirectTo: (getUrl?: () => string, queryParams?: QueryParams) => void;
|
|
2
|
+
export declare const redirectTo: (getUrl?: ((params?: any) => string) | undefined, queryParams?: QueryParams, functionParams?: any) => void;
|
|
3
3
|
//# sourceMappingURL=redirectTo.d.ts.map
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name": "@dropins/storefront-order", "version": "0.1.0-
|
|
1
|
+
{"name": "@dropins/storefront-order", "version": "0.1.0-alpha17", "@dropins/elsie": "0.35.0"}
|
package/render.js
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
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
|
-
|
|
1
|
+
/*! Copyright 2024 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
(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 .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-order-status-content__wrapper-description{margin-bottom:var(--spacing-medium)}.order-order-status-content__wrapper-description--actions-slot{margin-bottom:0}.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,.order-shipping-status-card--return-order 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--return-order 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-shipping-status-card--return-order p a:hover{text-decoration:none;color:var(--color-brand-800)}.order-shipping-status-card .order-shipping-status-card__images .dropin-content-grid__content{grid-template-columns:repeat(6,max-content)!important}.order-shipping-status-card.order-shipping-status-card--return-order .dropin-content-grid.order-shipping-status-card__images{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,.order-customer-details-content__container-return-information{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-customer-details-content__container-return-information .order-customer-details-content__container-description p{float:none;display:block}.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"});
|
|
4
|
+
import{jsx as r}from"@dropins/tools/preact-jsx-runtime.js";import{Render as n}from"@dropins/tools/lib.js";import{useState as d,useEffect as s}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",headerReturnText:"Return 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",returnedTitle:"Your return",refundedTitle:"Your refunded",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:{orderNumber:"Order number:",returnNumber:"Return number:",itemText:{none:"",one:"Package contents ({{count}} item)",many:"Package contents ({{count}} items)"},trackButton:"Track package",carrier:"Carrier:",prepositionOf:"of",returnOrderCardTitle:"Package details",shippingCardTitle:"Package details",shippingInfoTitle:"Shipping information",notYetShippedTitle:"Not yet shipped",notYetShippedImagesTitle:{singular:"Package contents ({{count}} item)",plural:"Package contents ({{count}} items)"}},OrderStatusContent:{noInfoTitle:"Check back later for more details.",returnMessage:"The order was placed on {ORDER_CREATE_DATE} and your return process started on {RETURN_CREATE_DATE}",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"},actions:{cancel:"Cancel order",createReturn:"Return or replace",createAnotherReturn:"Start another return",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",orderReturnLabels:{createdReturnAt:"Return requested on: ",returnStatusLabel:"Return status: ",orderNumberLabel:"Order number: "},returnStatus:{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"},email:{title:"Contact details"},shippingAddress:{title:"Shipping address"},shippingMethods:{title:"Shipping method"},billingAddress:{title:"Billing address"},paymentMethods:{title:"Payment method"},returnInformation:{title:"Return details"}},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]=d("en_US");return s(()=>{const e=c.on("locale",a=>{i(a)},{eager:!0});return()=>{e==null||e.off()}},[]),r(l,{lang:o,langDefinitions:m,children:t})},v=new n(r(h,{}));export{v as render};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SlotProps } from '@dropins/tools/types/elsie/src/lib';
|
|
2
|
+
import { OrderDataModel, OrdersReturnPropsModel } from '../data/models';
|
|
2
3
|
|
|
3
4
|
export interface KeysSortOrderProps {
|
|
4
5
|
name: string;
|
|
@@ -17,11 +18,15 @@ export interface CustomerDetailsProps {
|
|
|
17
18
|
orderData?: OrderDataModel;
|
|
18
19
|
withHeader?: boolean;
|
|
19
20
|
title?: string;
|
|
21
|
+
slots: {
|
|
22
|
+
OrderReturnInformation: SlotProps<OrdersReturnPropsModel | undefined>;
|
|
23
|
+
};
|
|
20
24
|
}
|
|
21
25
|
export interface UseCustomerDetails {
|
|
22
26
|
orderData?: OrderDataModel;
|
|
23
27
|
}
|
|
24
28
|
export interface CustomerDetailsContentProps extends Omit<CustomerDetailsProps, 'orderData' | 'className'> {
|
|
29
|
+
translations: Record<string, string>;
|
|
25
30
|
loading: boolean;
|
|
26
31
|
order?: OrderDataModel;
|
|
27
32
|
normalizeAddress?: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'preact/compat';
|
|
2
|
-
import { OrderDataModel } from '../data/models';
|
|
2
|
+
import { OrderDataModel, OrdersReturnPropsModel } from '../data/models';
|
|
3
3
|
import { SlotProps } from '@dropins/tools/types/elsie/src/lib';
|
|
4
4
|
|
|
5
5
|
export declare enum StatusEnumProps {
|
|
@@ -22,17 +22,20 @@ export interface OrderStatusProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
22
22
|
slots?: {
|
|
23
23
|
OrderActions: SlotProps<DefaultSlotContext>;
|
|
24
24
|
};
|
|
25
|
+
routeCreateReturn?: (orderReturn: OrdersReturnPropsModel) => string;
|
|
25
26
|
}
|
|
26
27
|
export interface OrderStatusContentProps extends Omit<OrderStatusProps, 'statusTitle' | 'orderData' | 'status'> {
|
|
27
28
|
title?: string;
|
|
28
29
|
status?: StatusEnumProps;
|
|
29
30
|
orderData?: OrderDataModel;
|
|
30
31
|
}
|
|
31
|
-
export interface OrderActionsProps
|
|
32
|
+
export interface OrderActionsProps {
|
|
33
|
+
className?: string;
|
|
32
34
|
orderData?: OrderDataModel;
|
|
33
35
|
slots?: {
|
|
34
36
|
OrderActions: SlotProps<DefaultSlotContext>;
|
|
35
37
|
};
|
|
38
|
+
routeCreateReturn?: (orderReturn: OrdersReturnPropsModel) => string;
|
|
36
39
|
}
|
|
37
40
|
export interface UseOrderStatusProps {
|
|
38
41
|
orderData?: OrderDataModel;
|
|
@@ -1,19 +1,33 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'preact/compat';
|
|
2
2
|
import { SlotProps } from '@dropins/tools/types/elsie/src/lib';
|
|
3
|
-
import { OrderDataModel } from '../data/models';
|
|
3
|
+
import { OrderDataModel, OrdersReturnPropsModel, OrdersReturnTrackingProps } from '../data/models';
|
|
4
4
|
|
|
5
|
+
type routeTypes = {
|
|
6
|
+
returnNumber?: string;
|
|
7
|
+
token?: string;
|
|
8
|
+
orderNumber?: string;
|
|
9
|
+
};
|
|
5
10
|
export interface ShippingStatusProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
11
|
orderData?: OrderDataModel;
|
|
7
12
|
collapseThreshold?: number;
|
|
8
13
|
slots?: {
|
|
9
14
|
DeliveryTimeLine?: SlotProps;
|
|
10
15
|
DeliveryTrackActions?: SlotProps;
|
|
16
|
+
ReturnItemsDetails?: SlotProps;
|
|
11
17
|
};
|
|
12
|
-
|
|
18
|
+
routeOrderDetails?: ({ returnNumber, token, orderNumber, }: routeTypes) => string;
|
|
19
|
+
routeTracking?: (track: OrdersReturnTrackingProps) => string;
|
|
20
|
+
routeProductDetails?: (product: any) => string;
|
|
13
21
|
}
|
|
14
22
|
export interface UseShippingStatusProps {
|
|
15
23
|
orderData?: OrderDataModel;
|
|
16
24
|
}
|
|
17
25
|
export interface ShippingStatusCardProps extends ShippingStatusProps {
|
|
26
|
+
translations: Record<string, string>;
|
|
18
27
|
}
|
|
28
|
+
export interface ShippingStatusReturnCardProps extends ShippingStatusCardProps {
|
|
29
|
+
collapseThreshold: number;
|
|
30
|
+
returnData: OrdersReturnPropsModel;
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
19
33
|
//# sourceMappingURL=shippingStatus.types.d.ts.map
|