@medusajs/draft-order 2.11.4-preview-20251113180136 → 2.11.4-preview-20251113210132
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/.medusa/server/src/admin/index.js +726 -726
- package/.medusa/server/src/admin/index.mjs +726 -726
- package/package.json +16 -16
|
@@ -9762,6 +9762,27 @@ const BillingAddressForm = ({ order }) => {
|
|
|
9762
9762
|
) });
|
|
9763
9763
|
};
|
|
9764
9764
|
const schema$5 = addressSchema;
|
|
9765
|
+
const CustomItems = () => {
|
|
9766
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
|
|
9767
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Custom Items" }) }) }),
|
|
9768
|
+
/* @__PURE__ */ jsxRuntime.jsx(CustomItemsForm, {})
|
|
9769
|
+
] });
|
|
9770
|
+
};
|
|
9771
|
+
const CustomItemsForm = () => {
|
|
9772
|
+
const form = reactHookForm.useForm({
|
|
9773
|
+
resolver: zod.zodResolver(schema$4)
|
|
9774
|
+
});
|
|
9775
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(KeyboundForm, { className: "flex flex-1 flex-col", children: [
|
|
9776
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, {}),
|
|
9777
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
9778
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
|
|
9779
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", children: "Save" })
|
|
9780
|
+
] }) })
|
|
9781
|
+
] }) });
|
|
9782
|
+
};
|
|
9783
|
+
const schema$4 = objectType({
|
|
9784
|
+
email: stringType().email()
|
|
9785
|
+
});
|
|
9765
9786
|
const Email = () => {
|
|
9766
9787
|
const { id } = reactRouterDom.useParams();
|
|
9767
9788
|
const { order, isPending, isError, error } = useOrder(id, {
|
|
@@ -9784,7 +9805,7 @@ const EmailForm = ({ order }) => {
|
|
|
9784
9805
|
defaultValues: {
|
|
9785
9806
|
email: order.email ?? ""
|
|
9786
9807
|
},
|
|
9787
|
-
resolver: zod.zodResolver(schema$
|
|
9808
|
+
resolver: zod.zodResolver(schema$3)
|
|
9788
9809
|
});
|
|
9789
9810
|
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
9790
9811
|
const { handleSuccess } = useRouteModal();
|
|
@@ -9827,7 +9848,7 @@ const EmailForm = ({ order }) => {
|
|
|
9827
9848
|
}
|
|
9828
9849
|
) });
|
|
9829
9850
|
};
|
|
9830
|
-
const schema$
|
|
9851
|
+
const schema$3 = objectType({
|
|
9831
9852
|
email: stringType().email()
|
|
9832
9853
|
});
|
|
9833
9854
|
const NumberInput = React.forwardRef(
|
|
@@ -11459,7 +11480,7 @@ const SalesChannelForm = ({ order }) => {
|
|
|
11459
11480
|
defaultValues: {
|
|
11460
11481
|
sales_channel_id: order.sales_channel_id || ""
|
|
11461
11482
|
},
|
|
11462
|
-
resolver: zod.zodResolver(schema$
|
|
11483
|
+
resolver: zod.zodResolver(schema$2)
|
|
11463
11484
|
});
|
|
11464
11485
|
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
11465
11486
|
const { handleSuccess } = useRouteModal();
|
|
@@ -11534,7 +11555,7 @@ const SalesChannelField = ({ control, order }) => {
|
|
|
11534
11555
|
}
|
|
11535
11556
|
);
|
|
11536
11557
|
};
|
|
11537
|
-
const schema$
|
|
11558
|
+
const schema$2 = objectType({
|
|
11538
11559
|
sales_channel_id: stringType().min(1)
|
|
11539
11560
|
});
|
|
11540
11561
|
const ShippingAddress = () => {
|
|
@@ -11569,7 +11590,7 @@ const ShippingAddressForm = ({ order }) => {
|
|
|
11569
11590
|
postal_code: ((_i = order.shipping_address) == null ? void 0 : _i.postal_code) ?? "",
|
|
11570
11591
|
phone: ((_j = order.shipping_address) == null ? void 0 : _j.phone) ?? ""
|
|
11571
11592
|
},
|
|
11572
|
-
resolver: zod.zodResolver(schema$
|
|
11593
|
+
resolver: zod.zodResolver(schema$1)
|
|
11573
11594
|
});
|
|
11574
11595
|
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
11575
11596
|
const { handleSuccess } = useRouteModal();
|
|
@@ -11739,606 +11760,109 @@ const ShippingAddressForm = ({ order }) => {
|
|
|
11739
11760
|
}
|
|
11740
11761
|
) });
|
|
11741
11762
|
};
|
|
11742
|
-
const schema$
|
|
11743
|
-
const
|
|
11763
|
+
const schema$1 = addressSchema;
|
|
11764
|
+
const STACKED_FOCUS_MODAL_ID = "shipping-form";
|
|
11765
|
+
const Shipping = () => {
|
|
11766
|
+
var _a;
|
|
11744
11767
|
const { id } = reactRouterDom.useParams();
|
|
11745
|
-
const {
|
|
11746
|
-
fields: "
|
|
11768
|
+
const { order, isPending, isError, error } = useOrder(id, {
|
|
11769
|
+
fields: "+items.*,+items.variant.*,+items.variant.product.*,+items.variant.product.shipping_profile.*,+currency_code"
|
|
11747
11770
|
});
|
|
11771
|
+
const {
|
|
11772
|
+
order: preview,
|
|
11773
|
+
isPending: isPreviewPending,
|
|
11774
|
+
isError: isPreviewError,
|
|
11775
|
+
error: previewError
|
|
11776
|
+
} = useOrderPreview(id);
|
|
11777
|
+
useInitiateOrderEdit({ preview });
|
|
11778
|
+
const { onCancel } = useCancelOrderEdit({ preview });
|
|
11748
11779
|
if (isError) {
|
|
11749
11780
|
throw error;
|
|
11750
11781
|
}
|
|
11751
|
-
|
|
11752
|
-
|
|
11753
|
-
|
|
11754
|
-
|
|
11755
|
-
|
|
11756
|
-
|
|
11757
|
-
|
|
11758
|
-
|
|
11782
|
+
if (isPreviewError) {
|
|
11783
|
+
throw previewError;
|
|
11784
|
+
}
|
|
11785
|
+
const orderHasItems = (((_a = order == null ? void 0 : order.items) == null ? void 0 : _a.length) || 0) > 0;
|
|
11786
|
+
const isReady = preview && !isPreviewPending && order && !isPending;
|
|
11787
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RouteFocusModal, { onClose: onCancel, children: !orderHasItems ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-full flex-col overflow-hidden ", children: [
|
|
11788
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteFocusModal.Header, {}),
|
|
11789
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteFocusModal.Body, { className: "flex flex-1 flex-col overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-1 flex-col items-center overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full max-w-[720px] flex-col gap-y-6 px-6 py-16", children: [
|
|
11790
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteFocusModal.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Shipping" }) }),
|
|
11791
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteFocusModal.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: "small", className: "text-ui-fg-subtle", children: "This draft order currently has no items. Add items to the order before adding shipping." }) })
|
|
11792
|
+
] }) }) }),
|
|
11793
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteFocusModal.Footer, { children: /* @__PURE__ */ jsxRuntime.jsx(RouteFocusModal.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", type: "button", children: "Cancel" }) }) })
|
|
11794
|
+
] }) : isReady ? /* @__PURE__ */ jsxRuntime.jsx(ShippingForm, { preview, order }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
11795
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteFocusModal.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit Shipping" }) }),
|
|
11796
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteFocusModal.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Loading data for the draft order, please wait..." }) })
|
|
11797
|
+
] }) });
|
|
11759
11798
|
};
|
|
11760
|
-
const
|
|
11761
|
-
var _a
|
|
11762
|
-
const
|
|
11763
|
-
|
|
11764
|
-
|
|
11799
|
+
const ShippingForm = ({ preview, order }) => {
|
|
11800
|
+
var _a;
|
|
11801
|
+
const { setIsOpen } = useStackedModal();
|
|
11802
|
+
const [isSubmitting, setIsSubmitting] = React.useState(false);
|
|
11803
|
+
const [data, setData] = React.useState(null);
|
|
11804
|
+
const appliedShippingOptionIds = (_a = preview.shipping_methods) == null ? void 0 : _a.map((method) => method.shipping_option_id).filter(Boolean);
|
|
11805
|
+
const { shipping_options } = useShippingOptions(
|
|
11806
|
+
{
|
|
11807
|
+
id: appliedShippingOptionIds,
|
|
11808
|
+
fields: "+service_zone.*,+service_zone.fulfillment_set.*,+service_zone.fulfillment_set.location.*"
|
|
11765
11809
|
},
|
|
11766
|
-
|
|
11767
|
-
|
|
11768
|
-
|
|
11810
|
+
{
|
|
11811
|
+
enabled: appliedShippingOptionIds.length > 0
|
|
11812
|
+
}
|
|
11813
|
+
);
|
|
11814
|
+
const uniqueShippingProfiles = React.useMemo(() => {
|
|
11815
|
+
const profiles = /* @__PURE__ */ new Map();
|
|
11816
|
+
getUniqueShippingProfiles(order.items).forEach((profile) => {
|
|
11817
|
+
profiles.set(profile.id, profile);
|
|
11818
|
+
});
|
|
11819
|
+
shipping_options == null ? void 0 : shipping_options.forEach((option) => {
|
|
11820
|
+
profiles.set(option.shipping_profile_id, option.shipping_profile);
|
|
11821
|
+
});
|
|
11822
|
+
return Array.from(profiles.values());
|
|
11823
|
+
}, [order.items, shipping_options]);
|
|
11769
11824
|
const { handleSuccess } = useRouteModal();
|
|
11770
|
-
const
|
|
11771
|
-
const
|
|
11772
|
-
|
|
11773
|
-
|
|
11774
|
-
|
|
11775
|
-
|
|
11776
|
-
|
|
11777
|
-
|
|
11778
|
-
{
|
|
11779
|
-
|
|
11780
|
-
|
|
11781
|
-
|
|
11782
|
-
|
|
11783
|
-
onError: (error) => {
|
|
11784
|
-
ui.toast.error(error.message);
|
|
11785
|
-
}
|
|
11825
|
+
const { mutateAsync: confirmOrderEdit } = useDraftOrderConfirmEdit(preview.id);
|
|
11826
|
+
const { mutateAsync: requestOrderEdit } = useDraftOrderRequestEdit(preview.id);
|
|
11827
|
+
const { mutateAsync: removeShippingMethod } = useDraftOrderRemoveShippingMethod(preview.id);
|
|
11828
|
+
const { mutateAsync: removeActionShippingMethod } = useDraftOrderRemoveActionShippingMethod(preview.id);
|
|
11829
|
+
const onSubmit = async () => {
|
|
11830
|
+
setIsSubmitting(true);
|
|
11831
|
+
let requestSucceeded = false;
|
|
11832
|
+
await requestOrderEdit(void 0, {
|
|
11833
|
+
onError: (e) => {
|
|
11834
|
+
ui.toast.error(`Failed to request order edit: ${e.message}`);
|
|
11835
|
+
},
|
|
11836
|
+
onSuccess: () => {
|
|
11837
|
+
requestSucceeded = true;
|
|
11786
11838
|
}
|
|
11787
|
-
);
|
|
11788
|
-
|
|
11789
|
-
|
|
11790
|
-
|
|
11791
|
-
{
|
|
11792
|
-
className: "flex flex-1 flex-col overflow-hidden",
|
|
11793
|
-
onSubmit,
|
|
11794
|
-
children: [
|
|
11795
|
-
/* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: [
|
|
11796
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center bg-ui-bg-component rounded-md border", children: /* @__PURE__ */ jsxRuntime.jsx(Illustration, {}) }),
|
|
11797
|
-
currentCustomer && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col space-y-3", children: [
|
|
11798
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col", children: [
|
|
11799
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.Label, { size: "small", weight: "plus", htmlFor: "current-customer", children: "Current owner" }),
|
|
11800
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.Hint, { children: "The customer that is currently associated with this draft order." })
|
|
11801
|
-
] }),
|
|
11802
|
-
/* @__PURE__ */ jsxRuntime.jsxs(ui.Select, { disabled: true, value: currentCustomer.value, children: [
|
|
11803
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.Select.Trigger, { id: "current-customer", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Select.Value, {}) }),
|
|
11804
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.Select.Content, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Select.Item, { value: currentCustomer.value, children: currentCustomer.label }) })
|
|
11805
|
-
] })
|
|
11806
|
-
] }),
|
|
11807
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11808
|
-
CustomerField,
|
|
11809
|
-
{
|
|
11810
|
-
control: form.control,
|
|
11811
|
-
currentCustomerId: order.customer_id
|
|
11812
|
-
}
|
|
11813
|
-
)
|
|
11814
|
-
] }),
|
|
11815
|
-
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
|
|
11816
|
-
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "secondary", size: "small", children: "Cancel" }) }),
|
|
11817
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
|
|
11818
|
-
] }) })
|
|
11819
|
-
]
|
|
11839
|
+
});
|
|
11840
|
+
if (!requestSucceeded) {
|
|
11841
|
+
setIsSubmitting(false);
|
|
11842
|
+
return;
|
|
11820
11843
|
}
|
|
11821
|
-
|
|
11822
|
-
|
|
11823
|
-
|
|
11824
|
-
|
|
11825
|
-
|
|
11826
|
-
|
|
11827
|
-
|
|
11828
|
-
|
|
11829
|
-
|
|
11844
|
+
await confirmOrderEdit(void 0, {
|
|
11845
|
+
onError: (e) => {
|
|
11846
|
+
ui.toast.error(`Failed to confirm order edit: ${e.message}`);
|
|
11847
|
+
},
|
|
11848
|
+
onSuccess: () => {
|
|
11849
|
+
handleSuccess();
|
|
11850
|
+
},
|
|
11851
|
+
onSettled: () => {
|
|
11852
|
+
setIsSubmitting(false);
|
|
11853
|
+
}
|
|
11854
|
+
});
|
|
11855
|
+
};
|
|
11856
|
+
const onKeydown = React.useCallback(
|
|
11857
|
+
(e) => {
|
|
11858
|
+
if (e.key === "Enter" && (e.ctrlKey || e.metaKey)) {
|
|
11859
|
+
if (data || isSubmitting) {
|
|
11860
|
+
return;
|
|
11861
|
+
}
|
|
11862
|
+
onSubmit();
|
|
11863
|
+
}
|
|
11830
11864
|
},
|
|
11831
|
-
|
|
11832
|
-
getOptions: (data) => {
|
|
11833
|
-
return data.customers.map((customer) => {
|
|
11834
|
-
const name = [customer.first_name, customer.last_name].filter(Boolean).join(" ");
|
|
11835
|
-
return {
|
|
11836
|
-
label: name ? `${name} (${customer.email})` : customer.email,
|
|
11837
|
-
value: customer.id
|
|
11838
|
-
};
|
|
11839
|
-
});
|
|
11840
|
-
}
|
|
11841
|
-
});
|
|
11842
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11843
|
-
Form$2.Field,
|
|
11844
|
-
{
|
|
11845
|
-
name: "customer_id",
|
|
11846
|
-
control,
|
|
11847
|
-
render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { className: "space-y-3", children: [
|
|
11848
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col", children: [
|
|
11849
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "New customer" }),
|
|
11850
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Hint, { children: "The customer to transfer this draft order to." })
|
|
11851
|
-
] }),
|
|
11852
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11853
|
-
Combobox,
|
|
11854
|
-
{
|
|
11855
|
-
options: customers.options,
|
|
11856
|
-
fetchNextPage: customers.fetchNextPage,
|
|
11857
|
-
isFetchingNextPage: customers.isFetchingNextPage,
|
|
11858
|
-
searchValue: customers.searchValue,
|
|
11859
|
-
onSearchValueChange: customers.onSearchValueChange,
|
|
11860
|
-
placeholder: "Select customer",
|
|
11861
|
-
...field
|
|
11862
|
-
}
|
|
11863
|
-
) }),
|
|
11864
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
|
|
11865
|
-
] })
|
|
11866
|
-
}
|
|
11867
|
-
);
|
|
11868
|
-
};
|
|
11869
|
-
const Illustration = () => {
|
|
11870
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11871
|
-
"svg",
|
|
11872
|
-
{
|
|
11873
|
-
width: "280",
|
|
11874
|
-
height: "180",
|
|
11875
|
-
viewBox: "0 0 280 180",
|
|
11876
|
-
fill: "none",
|
|
11877
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
11878
|
-
children: [
|
|
11879
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11880
|
-
"rect",
|
|
11881
|
-
{
|
|
11882
|
-
x: "0.00428286",
|
|
11883
|
-
y: "-0.742904",
|
|
11884
|
-
width: "33.5",
|
|
11885
|
-
height: "65.5",
|
|
11886
|
-
rx: "6.75",
|
|
11887
|
-
transform: "matrix(0.865865 0.500278 -0.871576 0.490261 189.756 88.438)",
|
|
11888
|
-
fill: "#D4D4D8",
|
|
11889
|
-
stroke: "#52525B",
|
|
11890
|
-
strokeWidth: "1.5"
|
|
11891
|
-
}
|
|
11892
|
-
),
|
|
11893
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11894
|
-
"rect",
|
|
11895
|
-
{
|
|
11896
|
-
x: "0.00428286",
|
|
11897
|
-
y: "-0.742904",
|
|
11898
|
-
width: "33.5",
|
|
11899
|
-
height: "65.5",
|
|
11900
|
-
rx: "6.75",
|
|
11901
|
-
transform: "matrix(0.865865 0.500278 -0.871576 0.490261 189.756 85.4381)",
|
|
11902
|
-
fill: "white",
|
|
11903
|
-
stroke: "#52525B",
|
|
11904
|
-
strokeWidth: "1.5"
|
|
11905
|
-
}
|
|
11906
|
-
),
|
|
11907
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11908
|
-
"path",
|
|
11909
|
-
{
|
|
11910
|
-
d: "M180.579 107.142L179.126 107.959",
|
|
11911
|
-
stroke: "#52525B",
|
|
11912
|
-
strokeWidth: "1.5",
|
|
11913
|
-
strokeLinecap: "round",
|
|
11914
|
-
strokeLinejoin: "round"
|
|
11915
|
-
}
|
|
11916
|
-
),
|
|
11917
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11918
|
-
"path",
|
|
11919
|
-
{
|
|
11920
|
-
opacity: "0.88",
|
|
11921
|
-
d: "M182.305 109.546L180.257 109.534",
|
|
11922
|
-
stroke: "#52525B",
|
|
11923
|
-
strokeWidth: "1.5",
|
|
11924
|
-
strokeLinecap: "round",
|
|
11925
|
-
strokeLinejoin: "round"
|
|
11926
|
-
}
|
|
11927
|
-
),
|
|
11928
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11929
|
-
"path",
|
|
11930
|
-
{
|
|
11931
|
-
opacity: "0.75",
|
|
11932
|
-
d: "M180.551 111.93L179.108 111.096",
|
|
11933
|
-
stroke: "#52525B",
|
|
11934
|
-
strokeWidth: "1.5",
|
|
11935
|
-
strokeLinecap: "round",
|
|
11936
|
-
strokeLinejoin: "round"
|
|
11937
|
-
}
|
|
11938
|
-
),
|
|
11939
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11940
|
-
"path",
|
|
11941
|
-
{
|
|
11942
|
-
opacity: "0.63",
|
|
11943
|
-
d: "M176.347 112.897L176.354 111.73",
|
|
11944
|
-
stroke: "#52525B",
|
|
11945
|
-
strokeWidth: "1.5",
|
|
11946
|
-
strokeLinecap: "round",
|
|
11947
|
-
strokeLinejoin: "round"
|
|
11948
|
-
}
|
|
11949
|
-
),
|
|
11950
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11951
|
-
"path",
|
|
11952
|
-
{
|
|
11953
|
-
opacity: "0.5",
|
|
11954
|
-
d: "M172.153 111.881L173.606 111.064",
|
|
11955
|
-
stroke: "#52525B",
|
|
11956
|
-
strokeWidth: "1.5",
|
|
11957
|
-
strokeLinecap: "round",
|
|
11958
|
-
strokeLinejoin: "round"
|
|
11959
|
-
}
|
|
11960
|
-
),
|
|
11961
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11962
|
-
"path",
|
|
11963
|
-
{
|
|
11964
|
-
opacity: "0.38",
|
|
11965
|
-
d: "M170.428 109.478L172.476 109.489",
|
|
11966
|
-
stroke: "#52525B",
|
|
11967
|
-
strokeWidth: "1.5",
|
|
11968
|
-
strokeLinecap: "round",
|
|
11969
|
-
strokeLinejoin: "round"
|
|
11970
|
-
}
|
|
11971
|
-
),
|
|
11972
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11973
|
-
"path",
|
|
11974
|
-
{
|
|
11975
|
-
opacity: "0.25",
|
|
11976
|
-
d: "M172.181 107.094L173.624 107.928",
|
|
11977
|
-
stroke: "#52525B",
|
|
11978
|
-
strokeWidth: "1.5",
|
|
11979
|
-
strokeLinecap: "round",
|
|
11980
|
-
strokeLinejoin: "round"
|
|
11981
|
-
}
|
|
11982
|
-
),
|
|
11983
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11984
|
-
"path",
|
|
11985
|
-
{
|
|
11986
|
-
opacity: "0.13",
|
|
11987
|
-
d: "M176.386 106.126L176.379 107.294",
|
|
11988
|
-
stroke: "#52525B",
|
|
11989
|
-
strokeWidth: "1.5",
|
|
11990
|
-
strokeLinecap: "round",
|
|
11991
|
-
strokeLinejoin: "round"
|
|
11992
|
-
}
|
|
11993
|
-
),
|
|
11994
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11995
|
-
"rect",
|
|
11996
|
-
{
|
|
11997
|
-
width: "12",
|
|
11998
|
-
height: "3",
|
|
11999
|
-
rx: "1.5",
|
|
12000
|
-
transform: "matrix(0.865865 0.500278 -0.871576 0.490261 196.447 92.2925)",
|
|
12001
|
-
fill: "#D4D4D8"
|
|
12002
|
-
}
|
|
12003
|
-
),
|
|
12004
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12005
|
-
"rect",
|
|
12006
|
-
{
|
|
12007
|
-
x: "0.00428286",
|
|
12008
|
-
y: "-0.742904",
|
|
12009
|
-
width: "33.5",
|
|
12010
|
-
height: "65.5",
|
|
12011
|
-
rx: "6.75",
|
|
12012
|
-
transform: "matrix(0.865865 0.500278 -0.871576 0.490261 117.023 46.4147)",
|
|
12013
|
-
fill: "#D4D4D8",
|
|
12014
|
-
stroke: "#52525B",
|
|
12015
|
-
strokeWidth: "1.5"
|
|
12016
|
-
}
|
|
12017
|
-
),
|
|
12018
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12019
|
-
"rect",
|
|
12020
|
-
{
|
|
12021
|
-
x: "0.00428286",
|
|
12022
|
-
y: "-0.742904",
|
|
12023
|
-
width: "33.5",
|
|
12024
|
-
height: "65.5",
|
|
12025
|
-
rx: "6.75",
|
|
12026
|
-
transform: "matrix(0.865865 0.500278 -0.871576 0.490261 117.023 43.4147)",
|
|
12027
|
-
fill: "white",
|
|
12028
|
-
stroke: "#52525B",
|
|
12029
|
-
strokeWidth: "1.5"
|
|
12030
|
-
}
|
|
12031
|
-
),
|
|
12032
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12033
|
-
"rect",
|
|
12034
|
-
{
|
|
12035
|
-
width: "12",
|
|
12036
|
-
height: "3",
|
|
12037
|
-
rx: "1.5",
|
|
12038
|
-
transform: "matrix(0.865865 0.500278 -0.871576 0.490261 123.714 50.2691)",
|
|
12039
|
-
fill: "#D4D4D8"
|
|
12040
|
-
}
|
|
12041
|
-
),
|
|
12042
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12043
|
-
"rect",
|
|
12044
|
-
{
|
|
12045
|
-
width: "17",
|
|
12046
|
-
height: "3",
|
|
12047
|
-
rx: "1.5",
|
|
12048
|
-
transform: "matrix(0.865865 0.500278 -0.871576 0.490261 97.5557 66.958)",
|
|
12049
|
-
fill: "#D4D4D8"
|
|
12050
|
-
}
|
|
12051
|
-
),
|
|
12052
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12053
|
-
"rect",
|
|
12054
|
-
{
|
|
12055
|
-
width: "12",
|
|
12056
|
-
height: "3",
|
|
12057
|
-
rx: "1.5",
|
|
12058
|
-
transform: "matrix(0.865865 0.500278 -0.871576 0.490261 93.1978 69.4093)",
|
|
12059
|
-
fill: "#D4D4D8"
|
|
12060
|
-
}
|
|
12061
|
-
),
|
|
12062
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12063
|
-
"path",
|
|
12064
|
-
{
|
|
12065
|
-
d: "M92.3603 63.9563C90.9277 63.1286 88.59 63.1152 87.148 63.9263C85.7059 64.7374 85.6983 66.0702 87.1308 66.8979C88.5634 67.7256 90.9011 67.7391 92.3432 66.928C93.7852 66.1168 93.7929 64.784 92.3603 63.9563ZM88.4382 66.1625C87.7221 65.7488 87.726 65.0822 88.4468 64.6767C89.1676 64.2713 90.3369 64.278 91.0529 64.6917C91.769 65.1055 91.7652 65.7721 91.0444 66.1775C90.3236 66.583 89.1543 66.5762 88.4382 66.1625Z",
|
|
12066
|
-
fill: "#A1A1AA"
|
|
12067
|
-
}
|
|
12068
|
-
),
|
|
12069
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12070
|
-
"rect",
|
|
12071
|
-
{
|
|
12072
|
-
width: "17",
|
|
12073
|
-
height: "3",
|
|
12074
|
-
rx: "1.5",
|
|
12075
|
-
transform: "matrix(0.865865 0.500278 -0.871576 0.490261 109.758 60.0944)",
|
|
12076
|
-
fill: "#A1A1AA"
|
|
12077
|
-
}
|
|
12078
|
-
),
|
|
12079
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12080
|
-
"rect",
|
|
12081
|
-
{
|
|
12082
|
-
width: "12",
|
|
12083
|
-
height: "3",
|
|
12084
|
-
rx: "1.5",
|
|
12085
|
-
transform: "matrix(0.865865 0.500278 -0.871576 0.490261 105.4 62.5457)",
|
|
12086
|
-
fill: "#A1A1AA"
|
|
12087
|
-
}
|
|
12088
|
-
),
|
|
12089
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12090
|
-
"path",
|
|
12091
|
-
{
|
|
12092
|
-
d: "M104.562 57.0927C103.13 56.265 100.792 56.2515 99.3501 57.0626C97.9081 57.8738 97.9004 59.2065 99.333 60.0343C100.766 60.862 103.103 60.8754 104.545 60.0643C105.987 59.2532 105.995 57.9204 104.562 57.0927ZM103.858 58.8972L100.815 59.1265C100.683 59.1367 100.55 59.1134 100.449 59.063C100.44 59.0585 100.432 59.0545 100.425 59.05C100.339 59.0005 100.29 58.9336 100.291 58.8637L100.294 58.1201C100.294 57.9752 100.501 57.8585 100.756 57.86C101.01 57.8615 101.217 57.98 101.216 58.1256L101.214 58.5669L103.732 58.3769C103.984 58.3578 104.217 58.4584 104.251 58.603C104.286 58.7468 104.11 58.8788 103.858 58.8977L103.858 58.8972Z",
|
|
12093
|
-
fill: "#52525B"
|
|
12094
|
-
}
|
|
12095
|
-
),
|
|
12096
|
-
/* @__PURE__ */ jsxRuntime.jsx("g", { clipPath: "url(#clip0_20915_38670)", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12097
|
-
"path",
|
|
12098
|
-
{
|
|
12099
|
-
d: "M133.106 81.8022L140.49 81.8447L140.515 77.6349",
|
|
12100
|
-
stroke: "#A1A1AA",
|
|
12101
|
-
strokeWidth: "1.5",
|
|
12102
|
-
strokeLinecap: "round",
|
|
12103
|
-
strokeLinejoin: "round"
|
|
12104
|
-
}
|
|
12105
|
-
) }),
|
|
12106
|
-
/* @__PURE__ */ jsxRuntime.jsx("g", { clipPath: "url(#clip1_20915_38670)", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12107
|
-
"path",
|
|
12108
|
-
{
|
|
12109
|
-
d: "M143.496 87.8055L150.881 87.8481L150.905 83.6383",
|
|
12110
|
-
stroke: "#A1A1AA",
|
|
12111
|
-
strokeWidth: "1.5",
|
|
12112
|
-
strokeLinecap: "round",
|
|
12113
|
-
strokeLinejoin: "round"
|
|
12114
|
-
}
|
|
12115
|
-
) }),
|
|
12116
|
-
/* @__PURE__ */ jsxRuntime.jsx("g", { clipPath: "url(#clip2_20915_38670)", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12117
|
-
"path",
|
|
12118
|
-
{
|
|
12119
|
-
d: "M153.887 93.8088L161.271 93.8514L161.295 89.6416",
|
|
12120
|
-
stroke: "#A1A1AA",
|
|
12121
|
-
strokeWidth: "1.5",
|
|
12122
|
-
strokeLinecap: "round",
|
|
12123
|
-
strokeLinejoin: "round"
|
|
12124
|
-
}
|
|
12125
|
-
) }),
|
|
12126
|
-
/* @__PURE__ */ jsxRuntime.jsx("g", { clipPath: "url(#clip3_20915_38670)", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12127
|
-
"path",
|
|
12128
|
-
{
|
|
12129
|
-
d: "M126.114 89.1912L118.729 89.1486L118.705 93.3584",
|
|
12130
|
-
stroke: "#A1A1AA",
|
|
12131
|
-
strokeWidth: "1.5",
|
|
12132
|
-
strokeLinecap: "round",
|
|
12133
|
-
strokeLinejoin: "round"
|
|
12134
|
-
}
|
|
12135
|
-
) }),
|
|
12136
|
-
/* @__PURE__ */ jsxRuntime.jsx("g", { clipPath: "url(#clip4_20915_38670)", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12137
|
-
"path",
|
|
12138
|
-
{
|
|
12139
|
-
d: "M136.504 95.1945L129.12 95.1519L129.095 99.3617",
|
|
12140
|
-
stroke: "#A1A1AA",
|
|
12141
|
-
strokeWidth: "1.5",
|
|
12142
|
-
strokeLinecap: "round",
|
|
12143
|
-
strokeLinejoin: "round"
|
|
12144
|
-
}
|
|
12145
|
-
) }),
|
|
12146
|
-
/* @__PURE__ */ jsxRuntime.jsx("g", { clipPath: "url(#clip5_20915_38670)", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12147
|
-
"path",
|
|
12148
|
-
{
|
|
12149
|
-
d: "M146.894 101.198L139.51 101.155L139.486 105.365",
|
|
12150
|
-
stroke: "#A1A1AA",
|
|
12151
|
-
strokeWidth: "1.5",
|
|
12152
|
-
strokeLinecap: "round",
|
|
12153
|
-
strokeLinejoin: "round"
|
|
12154
|
-
}
|
|
12155
|
-
) }),
|
|
12156
|
-
/* @__PURE__ */ jsxRuntime.jsxs("defs", { children: [
|
|
12157
|
-
/* @__PURE__ */ jsxRuntime.jsx("clipPath", { id: "clip0_20915_38670", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12158
|
-
"rect",
|
|
12159
|
-
{
|
|
12160
|
-
width: "12",
|
|
12161
|
-
height: "12",
|
|
12162
|
-
fill: "white",
|
|
12163
|
-
transform: "matrix(0.865865 0.500278 -0.871576 0.490261 138.36 74.6508)"
|
|
12164
|
-
}
|
|
12165
|
-
) }),
|
|
12166
|
-
/* @__PURE__ */ jsxRuntime.jsx("clipPath", { id: "clip1_20915_38670", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12167
|
-
"rect",
|
|
12168
|
-
{
|
|
12169
|
-
width: "12",
|
|
12170
|
-
height: "12",
|
|
12171
|
-
fill: "white",
|
|
12172
|
-
transform: "matrix(0.865865 0.500278 -0.871576 0.490261 148.75 80.6541)"
|
|
12173
|
-
}
|
|
12174
|
-
) }),
|
|
12175
|
-
/* @__PURE__ */ jsxRuntime.jsx("clipPath", { id: "clip2_20915_38670", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12176
|
-
"rect",
|
|
12177
|
-
{
|
|
12178
|
-
width: "12",
|
|
12179
|
-
height: "12",
|
|
12180
|
-
fill: "white",
|
|
12181
|
-
transform: "matrix(0.865865 0.500278 -0.871576 0.490261 159.141 86.6575)"
|
|
12182
|
-
}
|
|
12183
|
-
) }),
|
|
12184
|
-
/* @__PURE__ */ jsxRuntime.jsx("clipPath", { id: "clip3_20915_38670", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12185
|
-
"rect",
|
|
12186
|
-
{
|
|
12187
|
-
width: "12",
|
|
12188
|
-
height: "12",
|
|
12189
|
-
fill: "white",
|
|
12190
|
-
transform: "matrix(0.865865 0.500278 -0.871576 0.490261 120.928 84.4561)"
|
|
12191
|
-
}
|
|
12192
|
-
) }),
|
|
12193
|
-
/* @__PURE__ */ jsxRuntime.jsx("clipPath", { id: "clip4_20915_38670", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12194
|
-
"rect",
|
|
12195
|
-
{
|
|
12196
|
-
width: "12",
|
|
12197
|
-
height: "12",
|
|
12198
|
-
fill: "white",
|
|
12199
|
-
transform: "matrix(0.865865 0.500278 -0.871576 0.490261 131.318 90.4594)"
|
|
12200
|
-
}
|
|
12201
|
-
) }),
|
|
12202
|
-
/* @__PURE__ */ jsxRuntime.jsx("clipPath", { id: "clip5_20915_38670", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12203
|
-
"rect",
|
|
12204
|
-
{
|
|
12205
|
-
width: "12",
|
|
12206
|
-
height: "12",
|
|
12207
|
-
fill: "white",
|
|
12208
|
-
transform: "matrix(0.865865 0.500278 -0.871576 0.490261 141.709 96.4627)"
|
|
12209
|
-
}
|
|
12210
|
-
) })
|
|
12211
|
-
] })
|
|
12212
|
-
]
|
|
12213
|
-
}
|
|
12214
|
-
);
|
|
12215
|
-
};
|
|
12216
|
-
const schema$1 = objectType({
|
|
12217
|
-
customer_id: stringType().min(1)
|
|
12218
|
-
});
|
|
12219
|
-
const CustomItems = () => {
|
|
12220
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
|
|
12221
|
-
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Custom Items" }) }) }),
|
|
12222
|
-
/* @__PURE__ */ jsxRuntime.jsx(CustomItemsForm, {})
|
|
12223
|
-
] });
|
|
12224
|
-
};
|
|
12225
|
-
const CustomItemsForm = () => {
|
|
12226
|
-
const form = reactHookForm.useForm({
|
|
12227
|
-
resolver: zod.zodResolver(schema)
|
|
12228
|
-
});
|
|
12229
|
-
return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(KeyboundForm, { className: "flex flex-1 flex-col", children: [
|
|
12230
|
-
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, {}),
|
|
12231
|
-
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
12232
|
-
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
|
|
12233
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", children: "Save" })
|
|
12234
|
-
] }) })
|
|
12235
|
-
] }) });
|
|
12236
|
-
};
|
|
12237
|
-
const schema = objectType({
|
|
12238
|
-
email: stringType().email()
|
|
12239
|
-
});
|
|
12240
|
-
const STACKED_FOCUS_MODAL_ID = "shipping-form";
|
|
12241
|
-
const Shipping = () => {
|
|
12242
|
-
var _a;
|
|
12243
|
-
const { id } = reactRouterDom.useParams();
|
|
12244
|
-
const { order, isPending, isError, error } = useOrder(id, {
|
|
12245
|
-
fields: "+items.*,+items.variant.*,+items.variant.product.*,+items.variant.product.shipping_profile.*,+currency_code"
|
|
12246
|
-
});
|
|
12247
|
-
const {
|
|
12248
|
-
order: preview,
|
|
12249
|
-
isPending: isPreviewPending,
|
|
12250
|
-
isError: isPreviewError,
|
|
12251
|
-
error: previewError
|
|
12252
|
-
} = useOrderPreview(id);
|
|
12253
|
-
useInitiateOrderEdit({ preview });
|
|
12254
|
-
const { onCancel } = useCancelOrderEdit({ preview });
|
|
12255
|
-
if (isError) {
|
|
12256
|
-
throw error;
|
|
12257
|
-
}
|
|
12258
|
-
if (isPreviewError) {
|
|
12259
|
-
throw previewError;
|
|
12260
|
-
}
|
|
12261
|
-
const orderHasItems = (((_a = order == null ? void 0 : order.items) == null ? void 0 : _a.length) || 0) > 0;
|
|
12262
|
-
const isReady = preview && !isPreviewPending && order && !isPending;
|
|
12263
|
-
return /* @__PURE__ */ jsxRuntime.jsx(RouteFocusModal, { onClose: onCancel, children: !orderHasItems ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-full flex-col overflow-hidden ", children: [
|
|
12264
|
-
/* @__PURE__ */ jsxRuntime.jsx(RouteFocusModal.Header, {}),
|
|
12265
|
-
/* @__PURE__ */ jsxRuntime.jsx(RouteFocusModal.Body, { className: "flex flex-1 flex-col overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-1 flex-col items-center overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full max-w-[720px] flex-col gap-y-6 px-6 py-16", children: [
|
|
12266
|
-
/* @__PURE__ */ jsxRuntime.jsx(RouteFocusModal.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Shipping" }) }),
|
|
12267
|
-
/* @__PURE__ */ jsxRuntime.jsx(RouteFocusModal.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: "small", className: "text-ui-fg-subtle", children: "This draft order currently has no items. Add items to the order before adding shipping." }) })
|
|
12268
|
-
] }) }) }),
|
|
12269
|
-
/* @__PURE__ */ jsxRuntime.jsx(RouteFocusModal.Footer, { children: /* @__PURE__ */ jsxRuntime.jsx(RouteFocusModal.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", type: "button", children: "Cancel" }) }) })
|
|
12270
|
-
] }) : isReady ? /* @__PURE__ */ jsxRuntime.jsx(ShippingForm, { preview, order }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
12271
|
-
/* @__PURE__ */ jsxRuntime.jsx(RouteFocusModal.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit Shipping" }) }),
|
|
12272
|
-
/* @__PURE__ */ jsxRuntime.jsx(RouteFocusModal.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Loading data for the draft order, please wait..." }) })
|
|
12273
|
-
] }) });
|
|
12274
|
-
};
|
|
12275
|
-
const ShippingForm = ({ preview, order }) => {
|
|
12276
|
-
var _a;
|
|
12277
|
-
const { setIsOpen } = useStackedModal();
|
|
12278
|
-
const [isSubmitting, setIsSubmitting] = React.useState(false);
|
|
12279
|
-
const [data, setData] = React.useState(null);
|
|
12280
|
-
const appliedShippingOptionIds = (_a = preview.shipping_methods) == null ? void 0 : _a.map((method) => method.shipping_option_id).filter(Boolean);
|
|
12281
|
-
const { shipping_options } = useShippingOptions(
|
|
12282
|
-
{
|
|
12283
|
-
id: appliedShippingOptionIds,
|
|
12284
|
-
fields: "+service_zone.*,+service_zone.fulfillment_set.*,+service_zone.fulfillment_set.location.*"
|
|
12285
|
-
},
|
|
12286
|
-
{
|
|
12287
|
-
enabled: appliedShippingOptionIds.length > 0
|
|
12288
|
-
}
|
|
12289
|
-
);
|
|
12290
|
-
const uniqueShippingProfiles = React.useMemo(() => {
|
|
12291
|
-
const profiles = /* @__PURE__ */ new Map();
|
|
12292
|
-
getUniqueShippingProfiles(order.items).forEach((profile) => {
|
|
12293
|
-
profiles.set(profile.id, profile);
|
|
12294
|
-
});
|
|
12295
|
-
shipping_options == null ? void 0 : shipping_options.forEach((option) => {
|
|
12296
|
-
profiles.set(option.shipping_profile_id, option.shipping_profile);
|
|
12297
|
-
});
|
|
12298
|
-
return Array.from(profiles.values());
|
|
12299
|
-
}, [order.items, shipping_options]);
|
|
12300
|
-
const { handleSuccess } = useRouteModal();
|
|
12301
|
-
const { mutateAsync: confirmOrderEdit } = useDraftOrderConfirmEdit(preview.id);
|
|
12302
|
-
const { mutateAsync: requestOrderEdit } = useDraftOrderRequestEdit(preview.id);
|
|
12303
|
-
const { mutateAsync: removeShippingMethod } = useDraftOrderRemoveShippingMethod(preview.id);
|
|
12304
|
-
const { mutateAsync: removeActionShippingMethod } = useDraftOrderRemoveActionShippingMethod(preview.id);
|
|
12305
|
-
const onSubmit = async () => {
|
|
12306
|
-
setIsSubmitting(true);
|
|
12307
|
-
let requestSucceeded = false;
|
|
12308
|
-
await requestOrderEdit(void 0, {
|
|
12309
|
-
onError: (e) => {
|
|
12310
|
-
ui.toast.error(`Failed to request order edit: ${e.message}`);
|
|
12311
|
-
},
|
|
12312
|
-
onSuccess: () => {
|
|
12313
|
-
requestSucceeded = true;
|
|
12314
|
-
}
|
|
12315
|
-
});
|
|
12316
|
-
if (!requestSucceeded) {
|
|
12317
|
-
setIsSubmitting(false);
|
|
12318
|
-
return;
|
|
12319
|
-
}
|
|
12320
|
-
await confirmOrderEdit(void 0, {
|
|
12321
|
-
onError: (e) => {
|
|
12322
|
-
ui.toast.error(`Failed to confirm order edit: ${e.message}`);
|
|
12323
|
-
},
|
|
12324
|
-
onSuccess: () => {
|
|
12325
|
-
handleSuccess();
|
|
12326
|
-
},
|
|
12327
|
-
onSettled: () => {
|
|
12328
|
-
setIsSubmitting(false);
|
|
12329
|
-
}
|
|
12330
|
-
});
|
|
12331
|
-
};
|
|
12332
|
-
const onKeydown = React.useCallback(
|
|
12333
|
-
(e) => {
|
|
12334
|
-
if (e.key === "Enter" && (e.ctrlKey || e.metaKey)) {
|
|
12335
|
-
if (data || isSubmitting) {
|
|
12336
|
-
return;
|
|
12337
|
-
}
|
|
12338
|
-
onSubmit();
|
|
12339
|
-
}
|
|
12340
|
-
},
|
|
12341
|
-
[data, isSubmitting, onSubmit]
|
|
11865
|
+
[data, isSubmitting, onSubmit]
|
|
12342
11866
|
);
|
|
12343
11867
|
React.useEffect(() => {
|
|
12344
11868
|
document.addEventListener("keydown", onKeydown);
|
|
@@ -12904,146 +12428,622 @@ const LocationField = ({ control, setValue }) => {
|
|
|
12904
12428
|
return await sdk.admin.stockLocation.list(params);
|
|
12905
12429
|
},
|
|
12906
12430
|
getOptions: (data) => {
|
|
12907
|
-
return data.stock_locations.map((location) => ({
|
|
12908
|
-
label: location.name,
|
|
12909
|
-
value: location.id
|
|
12910
|
-
}));
|
|
12431
|
+
return data.stock_locations.map((location) => ({
|
|
12432
|
+
label: location.name,
|
|
12433
|
+
value: location.id
|
|
12434
|
+
}));
|
|
12435
|
+
}
|
|
12436
|
+
});
|
|
12437
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12438
|
+
Form$2.Field,
|
|
12439
|
+
{
|
|
12440
|
+
control,
|
|
12441
|
+
name: "location_id",
|
|
12442
|
+
render: ({ field: { onChange, ...field } }) => {
|
|
12443
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Form$2.Item, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-x-3", children: [
|
|
12444
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
12445
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Location" }),
|
|
12446
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Hint, { children: "Choose where you want to ship the items from." })
|
|
12447
|
+
] }),
|
|
12448
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12449
|
+
Combobox,
|
|
12450
|
+
{
|
|
12451
|
+
options: locations.options,
|
|
12452
|
+
fetchNextPage: locations.fetchNextPage,
|
|
12453
|
+
isFetchingNextPage: locations.isFetchingNextPage,
|
|
12454
|
+
searchValue: locations.searchValue,
|
|
12455
|
+
onSearchValueChange: locations.onSearchValueChange,
|
|
12456
|
+
placeholder: "Select location",
|
|
12457
|
+
onChange: (value) => {
|
|
12458
|
+
setValue("shipping_option_id", "", {
|
|
12459
|
+
shouldDirty: true,
|
|
12460
|
+
shouldTouch: true
|
|
12461
|
+
});
|
|
12462
|
+
onChange(value);
|
|
12463
|
+
},
|
|
12464
|
+
...field
|
|
12465
|
+
}
|
|
12466
|
+
) })
|
|
12467
|
+
] }) });
|
|
12468
|
+
}
|
|
12469
|
+
}
|
|
12470
|
+
);
|
|
12471
|
+
};
|
|
12472
|
+
const ShippingOptionField = ({
|
|
12473
|
+
shippingProfileId,
|
|
12474
|
+
preview,
|
|
12475
|
+
control
|
|
12476
|
+
}) => {
|
|
12477
|
+
var _a;
|
|
12478
|
+
const locationId = reactHookForm.useWatch({ control, name: "location_id" });
|
|
12479
|
+
const shippingOptions = useComboboxData({
|
|
12480
|
+
queryKey: ["shipping_options", locationId, shippingProfileId],
|
|
12481
|
+
queryFn: async (params) => {
|
|
12482
|
+
return await sdk.admin.shippingOption.list({
|
|
12483
|
+
...params,
|
|
12484
|
+
stock_location_id: locationId,
|
|
12485
|
+
shipping_profile_id: shippingProfileId
|
|
12486
|
+
});
|
|
12487
|
+
},
|
|
12488
|
+
getOptions: (data) => {
|
|
12489
|
+
return data.shipping_options.map((option) => {
|
|
12490
|
+
var _a2;
|
|
12491
|
+
if ((_a2 = option.rules) == null ? void 0 : _a2.find(
|
|
12492
|
+
(r) => r.attribute === "is_return" && r.value === "true"
|
|
12493
|
+
)) {
|
|
12494
|
+
return void 0;
|
|
12495
|
+
}
|
|
12496
|
+
return {
|
|
12497
|
+
label: option.name,
|
|
12498
|
+
value: option.id
|
|
12499
|
+
};
|
|
12500
|
+
}).filter(Boolean);
|
|
12501
|
+
},
|
|
12502
|
+
enabled: !!locationId && !!shippingProfileId,
|
|
12503
|
+
defaultValue: ((_a = preview.shipping_methods[0]) == null ? void 0 : _a.shipping_option_id) || void 0
|
|
12504
|
+
});
|
|
12505
|
+
const tooltipContent = !locationId && !shippingProfileId ? "Choose a location and shipping profile first." : !locationId ? "Choose a location first." : "Choose a shipping profile first.";
|
|
12506
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12507
|
+
Form$2.Field,
|
|
12508
|
+
{
|
|
12509
|
+
control,
|
|
12510
|
+
name: "shipping_option_id",
|
|
12511
|
+
render: ({ field }) => {
|
|
12512
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Form$2.Item, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-x-3", children: [
|
|
12513
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col", children: [
|
|
12514
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Shipping option" }),
|
|
12515
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Hint, { children: "Choose the shipping option to use." })
|
|
12516
|
+
] }),
|
|
12517
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12518
|
+
ConditionalTooltip,
|
|
12519
|
+
{
|
|
12520
|
+
content: tooltipContent,
|
|
12521
|
+
showTooltip: !locationId || !shippingProfileId,
|
|
12522
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12523
|
+
Combobox,
|
|
12524
|
+
{
|
|
12525
|
+
options: shippingOptions.options,
|
|
12526
|
+
fetchNextPage: shippingOptions.fetchNextPage,
|
|
12527
|
+
isFetchingNextPage: shippingOptions.isFetchingNextPage,
|
|
12528
|
+
searchValue: shippingOptions.searchValue,
|
|
12529
|
+
onSearchValueChange: shippingOptions.onSearchValueChange,
|
|
12530
|
+
placeholder: "Select shipping option",
|
|
12531
|
+
...field,
|
|
12532
|
+
disabled: !locationId || !shippingProfileId
|
|
12533
|
+
}
|
|
12534
|
+
) }) })
|
|
12535
|
+
}
|
|
12536
|
+
)
|
|
12537
|
+
] }) });
|
|
12538
|
+
}
|
|
12539
|
+
}
|
|
12540
|
+
);
|
|
12541
|
+
};
|
|
12542
|
+
const CustomAmountField = ({
|
|
12543
|
+
control,
|
|
12544
|
+
currencyCode
|
|
12545
|
+
}) => {
|
|
12546
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12547
|
+
Form$2.Field,
|
|
12548
|
+
{
|
|
12549
|
+
control,
|
|
12550
|
+
name: "custom_amount",
|
|
12551
|
+
render: ({ field: { onChange, ...field } }) => {
|
|
12552
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-x-3", children: [
|
|
12553
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col", children: [
|
|
12554
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Custom amount" }),
|
|
12555
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Hint, { children: "Set a custom amount for the shipping option." })
|
|
12556
|
+
] }),
|
|
12557
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12558
|
+
ui.CurrencyInput,
|
|
12559
|
+
{
|
|
12560
|
+
...field,
|
|
12561
|
+
onValueChange: (value) => onChange(value),
|
|
12562
|
+
symbol: getNativeSymbol(currencyCode),
|
|
12563
|
+
code: currencyCode
|
|
12564
|
+
}
|
|
12565
|
+
) })
|
|
12566
|
+
] });
|
|
12567
|
+
}
|
|
12568
|
+
}
|
|
12569
|
+
);
|
|
12570
|
+
};
|
|
12571
|
+
const TransferOwnership = () => {
|
|
12572
|
+
const { id } = reactRouterDom.useParams();
|
|
12573
|
+
const { draft_order, isPending, isError, error } = useDraftOrder(id, {
|
|
12574
|
+
fields: "id,customer_id,customer.*"
|
|
12575
|
+
});
|
|
12576
|
+
if (isError) {
|
|
12577
|
+
throw error;
|
|
12578
|
+
}
|
|
12579
|
+
const isReady = !isPending && !!draft_order;
|
|
12580
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
|
|
12581
|
+
/* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer.Header, { children: [
|
|
12582
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Transfer Ownership" }) }),
|
|
12583
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Transfer the ownership of this draft order to a new customer" }) })
|
|
12584
|
+
] }),
|
|
12585
|
+
isReady && /* @__PURE__ */ jsxRuntime.jsx(TransferOwnershipForm, { order: draft_order })
|
|
12586
|
+
] });
|
|
12587
|
+
};
|
|
12588
|
+
const TransferOwnershipForm = ({ order }) => {
|
|
12589
|
+
var _a, _b;
|
|
12590
|
+
const form = reactHookForm.useForm({
|
|
12591
|
+
defaultValues: {
|
|
12592
|
+
customer_id: order.customer_id || ""
|
|
12593
|
+
},
|
|
12594
|
+
resolver: zod.zodResolver(schema)
|
|
12595
|
+
});
|
|
12596
|
+
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
12597
|
+
const { handleSuccess } = useRouteModal();
|
|
12598
|
+
const name = [(_a = order.customer) == null ? void 0 : _a.first_name, (_b = order.customer) == null ? void 0 : _b.last_name].filter(Boolean).join(" ");
|
|
12599
|
+
const currentCustomer = order.customer ? {
|
|
12600
|
+
label: name ? `${name} (${order.customer.email})` : order.customer.email,
|
|
12601
|
+
value: order.customer.id
|
|
12602
|
+
} : null;
|
|
12603
|
+
const onSubmit = form.handleSubmit(async (data) => {
|
|
12604
|
+
await mutateAsync(
|
|
12605
|
+
{ customer_id: data.customer_id },
|
|
12606
|
+
{
|
|
12607
|
+
onSuccess: () => {
|
|
12608
|
+
ui.toast.success("Customer updated");
|
|
12609
|
+
handleSuccess();
|
|
12610
|
+
},
|
|
12611
|
+
onError: (error) => {
|
|
12612
|
+
ui.toast.error(error.message);
|
|
12613
|
+
}
|
|
12614
|
+
}
|
|
12615
|
+
);
|
|
12616
|
+
});
|
|
12617
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12618
|
+
KeyboundForm,
|
|
12619
|
+
{
|
|
12620
|
+
className: "flex flex-1 flex-col overflow-hidden",
|
|
12621
|
+
onSubmit,
|
|
12622
|
+
children: [
|
|
12623
|
+
/* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: [
|
|
12624
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center bg-ui-bg-component rounded-md border", children: /* @__PURE__ */ jsxRuntime.jsx(Illustration, {}) }),
|
|
12625
|
+
currentCustomer && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col space-y-3", children: [
|
|
12626
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col", children: [
|
|
12627
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Label, { size: "small", weight: "plus", htmlFor: "current-customer", children: "Current owner" }),
|
|
12628
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Hint, { children: "The customer that is currently associated with this draft order." })
|
|
12629
|
+
] }),
|
|
12630
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ui.Select, { disabled: true, value: currentCustomer.value, children: [
|
|
12631
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Select.Trigger, { id: "current-customer", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Select.Value, {}) }),
|
|
12632
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Select.Content, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Select.Item, { value: currentCustomer.value, children: currentCustomer.label }) })
|
|
12633
|
+
] })
|
|
12634
|
+
] }),
|
|
12635
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12636
|
+
CustomerField,
|
|
12637
|
+
{
|
|
12638
|
+
control: form.control,
|
|
12639
|
+
currentCustomerId: order.customer_id
|
|
12640
|
+
}
|
|
12641
|
+
)
|
|
12642
|
+
] }),
|
|
12643
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
|
|
12644
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "secondary", size: "small", children: "Cancel" }) }),
|
|
12645
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
|
|
12646
|
+
] }) })
|
|
12647
|
+
]
|
|
12648
|
+
}
|
|
12649
|
+
) });
|
|
12650
|
+
};
|
|
12651
|
+
const CustomerField = ({ control, currentCustomerId }) => {
|
|
12652
|
+
const customers = useComboboxData({
|
|
12653
|
+
queryFn: async (params) => {
|
|
12654
|
+
return await sdk.admin.customer.list({
|
|
12655
|
+
...params,
|
|
12656
|
+
id: currentCustomerId ? { $nin: [currentCustomerId] } : void 0
|
|
12657
|
+
});
|
|
12658
|
+
},
|
|
12659
|
+
queryKey: ["customers"],
|
|
12660
|
+
getOptions: (data) => {
|
|
12661
|
+
return data.customers.map((customer) => {
|
|
12662
|
+
const name = [customer.first_name, customer.last_name].filter(Boolean).join(" ");
|
|
12663
|
+
return {
|
|
12664
|
+
label: name ? `${name} (${customer.email})` : customer.email,
|
|
12665
|
+
value: customer.id
|
|
12666
|
+
};
|
|
12667
|
+
});
|
|
12911
12668
|
}
|
|
12912
12669
|
});
|
|
12913
12670
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12914
12671
|
Form$2.Field,
|
|
12915
12672
|
{
|
|
12673
|
+
name: "customer_id",
|
|
12916
12674
|
control,
|
|
12917
|
-
|
|
12918
|
-
|
|
12919
|
-
|
|
12920
|
-
/* @__PURE__ */ jsxRuntime.
|
|
12921
|
-
|
|
12922
|
-
|
|
12923
|
-
|
|
12924
|
-
|
|
12925
|
-
|
|
12675
|
+
render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { className: "space-y-3", children: [
|
|
12676
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col", children: [
|
|
12677
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "New customer" }),
|
|
12678
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Hint, { children: "The customer to transfer this draft order to." })
|
|
12679
|
+
] }),
|
|
12680
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12681
|
+
Combobox,
|
|
12682
|
+
{
|
|
12683
|
+
options: customers.options,
|
|
12684
|
+
fetchNextPage: customers.fetchNextPage,
|
|
12685
|
+
isFetchingNextPage: customers.isFetchingNextPage,
|
|
12686
|
+
searchValue: customers.searchValue,
|
|
12687
|
+
onSearchValueChange: customers.onSearchValueChange,
|
|
12688
|
+
placeholder: "Select customer",
|
|
12689
|
+
...field
|
|
12690
|
+
}
|
|
12691
|
+
) }),
|
|
12692
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
|
|
12693
|
+
] })
|
|
12694
|
+
}
|
|
12695
|
+
);
|
|
12696
|
+
};
|
|
12697
|
+
const Illustration = () => {
|
|
12698
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12699
|
+
"svg",
|
|
12700
|
+
{
|
|
12701
|
+
width: "280",
|
|
12702
|
+
height: "180",
|
|
12703
|
+
viewBox: "0 0 280 180",
|
|
12704
|
+
fill: "none",
|
|
12705
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
12706
|
+
children: [
|
|
12707
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12708
|
+
"rect",
|
|
12709
|
+
{
|
|
12710
|
+
x: "0.00428286",
|
|
12711
|
+
y: "-0.742904",
|
|
12712
|
+
width: "33.5",
|
|
12713
|
+
height: "65.5",
|
|
12714
|
+
rx: "6.75",
|
|
12715
|
+
transform: "matrix(0.865865 0.500278 -0.871576 0.490261 189.756 88.438)",
|
|
12716
|
+
fill: "#D4D4D8",
|
|
12717
|
+
stroke: "#52525B",
|
|
12718
|
+
strokeWidth: "1.5"
|
|
12719
|
+
}
|
|
12720
|
+
),
|
|
12721
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12722
|
+
"rect",
|
|
12723
|
+
{
|
|
12724
|
+
x: "0.00428286",
|
|
12725
|
+
y: "-0.742904",
|
|
12726
|
+
width: "33.5",
|
|
12727
|
+
height: "65.5",
|
|
12728
|
+
rx: "6.75",
|
|
12729
|
+
transform: "matrix(0.865865 0.500278 -0.871576 0.490261 189.756 85.4381)",
|
|
12730
|
+
fill: "white",
|
|
12731
|
+
stroke: "#52525B",
|
|
12732
|
+
strokeWidth: "1.5"
|
|
12733
|
+
}
|
|
12734
|
+
),
|
|
12735
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12736
|
+
"path",
|
|
12737
|
+
{
|
|
12738
|
+
d: "M180.579 107.142L179.126 107.959",
|
|
12739
|
+
stroke: "#52525B",
|
|
12740
|
+
strokeWidth: "1.5",
|
|
12741
|
+
strokeLinecap: "round",
|
|
12742
|
+
strokeLinejoin: "round"
|
|
12743
|
+
}
|
|
12744
|
+
),
|
|
12745
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12746
|
+
"path",
|
|
12747
|
+
{
|
|
12748
|
+
opacity: "0.88",
|
|
12749
|
+
d: "M182.305 109.546L180.257 109.534",
|
|
12750
|
+
stroke: "#52525B",
|
|
12751
|
+
strokeWidth: "1.5",
|
|
12752
|
+
strokeLinecap: "round",
|
|
12753
|
+
strokeLinejoin: "round"
|
|
12754
|
+
}
|
|
12755
|
+
),
|
|
12756
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12757
|
+
"path",
|
|
12758
|
+
{
|
|
12759
|
+
opacity: "0.75",
|
|
12760
|
+
d: "M180.551 111.93L179.108 111.096",
|
|
12761
|
+
stroke: "#52525B",
|
|
12762
|
+
strokeWidth: "1.5",
|
|
12763
|
+
strokeLinecap: "round",
|
|
12764
|
+
strokeLinejoin: "round"
|
|
12765
|
+
}
|
|
12766
|
+
),
|
|
12767
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12768
|
+
"path",
|
|
12769
|
+
{
|
|
12770
|
+
opacity: "0.63",
|
|
12771
|
+
d: "M176.347 112.897L176.354 111.73",
|
|
12772
|
+
stroke: "#52525B",
|
|
12773
|
+
strokeWidth: "1.5",
|
|
12774
|
+
strokeLinecap: "round",
|
|
12775
|
+
strokeLinejoin: "round"
|
|
12776
|
+
}
|
|
12777
|
+
),
|
|
12778
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12779
|
+
"path",
|
|
12780
|
+
{
|
|
12781
|
+
opacity: "0.5",
|
|
12782
|
+
d: "M172.153 111.881L173.606 111.064",
|
|
12783
|
+
stroke: "#52525B",
|
|
12784
|
+
strokeWidth: "1.5",
|
|
12785
|
+
strokeLinecap: "round",
|
|
12786
|
+
strokeLinejoin: "round"
|
|
12787
|
+
}
|
|
12788
|
+
),
|
|
12789
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12790
|
+
"path",
|
|
12791
|
+
{
|
|
12792
|
+
opacity: "0.38",
|
|
12793
|
+
d: "M170.428 109.478L172.476 109.489",
|
|
12794
|
+
stroke: "#52525B",
|
|
12795
|
+
strokeWidth: "1.5",
|
|
12796
|
+
strokeLinecap: "round",
|
|
12797
|
+
strokeLinejoin: "round"
|
|
12798
|
+
}
|
|
12799
|
+
),
|
|
12800
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12801
|
+
"path",
|
|
12802
|
+
{
|
|
12803
|
+
opacity: "0.25",
|
|
12804
|
+
d: "M172.181 107.094L173.624 107.928",
|
|
12805
|
+
stroke: "#52525B",
|
|
12806
|
+
strokeWidth: "1.5",
|
|
12807
|
+
strokeLinecap: "round",
|
|
12808
|
+
strokeLinejoin: "round"
|
|
12809
|
+
}
|
|
12810
|
+
),
|
|
12811
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12812
|
+
"path",
|
|
12813
|
+
{
|
|
12814
|
+
opacity: "0.13",
|
|
12815
|
+
d: "M176.386 106.126L176.379 107.294",
|
|
12816
|
+
stroke: "#52525B",
|
|
12817
|
+
strokeWidth: "1.5",
|
|
12818
|
+
strokeLinecap: "round",
|
|
12819
|
+
strokeLinejoin: "round"
|
|
12820
|
+
}
|
|
12821
|
+
),
|
|
12822
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12823
|
+
"rect",
|
|
12824
|
+
{
|
|
12825
|
+
width: "12",
|
|
12826
|
+
height: "3",
|
|
12827
|
+
rx: "1.5",
|
|
12828
|
+
transform: "matrix(0.865865 0.500278 -0.871576 0.490261 196.447 92.2925)",
|
|
12829
|
+
fill: "#D4D4D8"
|
|
12830
|
+
}
|
|
12831
|
+
),
|
|
12832
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12833
|
+
"rect",
|
|
12834
|
+
{
|
|
12835
|
+
x: "0.00428286",
|
|
12836
|
+
y: "-0.742904",
|
|
12837
|
+
width: "33.5",
|
|
12838
|
+
height: "65.5",
|
|
12839
|
+
rx: "6.75",
|
|
12840
|
+
transform: "matrix(0.865865 0.500278 -0.871576 0.490261 117.023 46.4147)",
|
|
12841
|
+
fill: "#D4D4D8",
|
|
12842
|
+
stroke: "#52525B",
|
|
12843
|
+
strokeWidth: "1.5"
|
|
12844
|
+
}
|
|
12845
|
+
),
|
|
12846
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12847
|
+
"rect",
|
|
12848
|
+
{
|
|
12849
|
+
x: "0.00428286",
|
|
12850
|
+
y: "-0.742904",
|
|
12851
|
+
width: "33.5",
|
|
12852
|
+
height: "65.5",
|
|
12853
|
+
rx: "6.75",
|
|
12854
|
+
transform: "matrix(0.865865 0.500278 -0.871576 0.490261 117.023 43.4147)",
|
|
12855
|
+
fill: "white",
|
|
12856
|
+
stroke: "#52525B",
|
|
12857
|
+
strokeWidth: "1.5"
|
|
12858
|
+
}
|
|
12859
|
+
),
|
|
12860
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12861
|
+
"rect",
|
|
12862
|
+
{
|
|
12863
|
+
width: "12",
|
|
12864
|
+
height: "3",
|
|
12865
|
+
rx: "1.5",
|
|
12866
|
+
transform: "matrix(0.865865 0.500278 -0.871576 0.490261 123.714 50.2691)",
|
|
12867
|
+
fill: "#D4D4D8"
|
|
12868
|
+
}
|
|
12869
|
+
),
|
|
12870
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12871
|
+
"rect",
|
|
12872
|
+
{
|
|
12873
|
+
width: "17",
|
|
12874
|
+
height: "3",
|
|
12875
|
+
rx: "1.5",
|
|
12876
|
+
transform: "matrix(0.865865 0.500278 -0.871576 0.490261 97.5557 66.958)",
|
|
12877
|
+
fill: "#D4D4D8"
|
|
12878
|
+
}
|
|
12879
|
+
),
|
|
12880
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12881
|
+
"rect",
|
|
12882
|
+
{
|
|
12883
|
+
width: "12",
|
|
12884
|
+
height: "3",
|
|
12885
|
+
rx: "1.5",
|
|
12886
|
+
transform: "matrix(0.865865 0.500278 -0.871576 0.490261 93.1978 69.4093)",
|
|
12887
|
+
fill: "#D4D4D8"
|
|
12888
|
+
}
|
|
12889
|
+
),
|
|
12890
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12891
|
+
"path",
|
|
12892
|
+
{
|
|
12893
|
+
d: "M92.3603 63.9563C90.9277 63.1286 88.59 63.1152 87.148 63.9263C85.7059 64.7374 85.6983 66.0702 87.1308 66.8979C88.5634 67.7256 90.9011 67.7391 92.3432 66.928C93.7852 66.1168 93.7929 64.784 92.3603 63.9563ZM88.4382 66.1625C87.7221 65.7488 87.726 65.0822 88.4468 64.6767C89.1676 64.2713 90.3369 64.278 91.0529 64.6917C91.769 65.1055 91.7652 65.7721 91.0444 66.1775C90.3236 66.583 89.1543 66.5762 88.4382 66.1625Z",
|
|
12894
|
+
fill: "#A1A1AA"
|
|
12895
|
+
}
|
|
12896
|
+
),
|
|
12897
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12898
|
+
"rect",
|
|
12899
|
+
{
|
|
12900
|
+
width: "17",
|
|
12901
|
+
height: "3",
|
|
12902
|
+
rx: "1.5",
|
|
12903
|
+
transform: "matrix(0.865865 0.500278 -0.871576 0.490261 109.758 60.0944)",
|
|
12904
|
+
fill: "#A1A1AA"
|
|
12905
|
+
}
|
|
12906
|
+
),
|
|
12907
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12908
|
+
"rect",
|
|
12909
|
+
{
|
|
12910
|
+
width: "12",
|
|
12911
|
+
height: "3",
|
|
12912
|
+
rx: "1.5",
|
|
12913
|
+
transform: "matrix(0.865865 0.500278 -0.871576 0.490261 105.4 62.5457)",
|
|
12914
|
+
fill: "#A1A1AA"
|
|
12915
|
+
}
|
|
12916
|
+
),
|
|
12917
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12918
|
+
"path",
|
|
12919
|
+
{
|
|
12920
|
+
d: "M104.562 57.0927C103.13 56.265 100.792 56.2515 99.3501 57.0626C97.9081 57.8738 97.9004 59.2065 99.333 60.0343C100.766 60.862 103.103 60.8754 104.545 60.0643C105.987 59.2532 105.995 57.9204 104.562 57.0927ZM103.858 58.8972L100.815 59.1265C100.683 59.1367 100.55 59.1134 100.449 59.063C100.44 59.0585 100.432 59.0545 100.425 59.05C100.339 59.0005 100.29 58.9336 100.291 58.8637L100.294 58.1201C100.294 57.9752 100.501 57.8585 100.756 57.86C101.01 57.8615 101.217 57.98 101.216 58.1256L101.214 58.5669L103.732 58.3769C103.984 58.3578 104.217 58.4584 104.251 58.603C104.286 58.7468 104.11 58.8788 103.858 58.8977L103.858 58.8972Z",
|
|
12921
|
+
fill: "#52525B"
|
|
12922
|
+
}
|
|
12923
|
+
),
|
|
12924
|
+
/* @__PURE__ */ jsxRuntime.jsx("g", { clipPath: "url(#clip0_20915_38670)", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12925
|
+
"path",
|
|
12926
|
+
{
|
|
12927
|
+
d: "M133.106 81.8022L140.49 81.8447L140.515 77.6349",
|
|
12928
|
+
stroke: "#A1A1AA",
|
|
12929
|
+
strokeWidth: "1.5",
|
|
12930
|
+
strokeLinecap: "round",
|
|
12931
|
+
strokeLinejoin: "round"
|
|
12932
|
+
}
|
|
12933
|
+
) }),
|
|
12934
|
+
/* @__PURE__ */ jsxRuntime.jsx("g", { clipPath: "url(#clip1_20915_38670)", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12935
|
+
"path",
|
|
12936
|
+
{
|
|
12937
|
+
d: "M143.496 87.8055L150.881 87.8481L150.905 83.6383",
|
|
12938
|
+
stroke: "#A1A1AA",
|
|
12939
|
+
strokeWidth: "1.5",
|
|
12940
|
+
strokeLinecap: "round",
|
|
12941
|
+
strokeLinejoin: "round"
|
|
12942
|
+
}
|
|
12943
|
+
) }),
|
|
12944
|
+
/* @__PURE__ */ jsxRuntime.jsx("g", { clipPath: "url(#clip2_20915_38670)", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12945
|
+
"path",
|
|
12946
|
+
{
|
|
12947
|
+
d: "M153.887 93.8088L161.271 93.8514L161.295 89.6416",
|
|
12948
|
+
stroke: "#A1A1AA",
|
|
12949
|
+
strokeWidth: "1.5",
|
|
12950
|
+
strokeLinecap: "round",
|
|
12951
|
+
strokeLinejoin: "round"
|
|
12952
|
+
}
|
|
12953
|
+
) }),
|
|
12954
|
+
/* @__PURE__ */ jsxRuntime.jsx("g", { clipPath: "url(#clip3_20915_38670)", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12955
|
+
"path",
|
|
12956
|
+
{
|
|
12957
|
+
d: "M126.114 89.1912L118.729 89.1486L118.705 93.3584",
|
|
12958
|
+
stroke: "#A1A1AA",
|
|
12959
|
+
strokeWidth: "1.5",
|
|
12960
|
+
strokeLinecap: "round",
|
|
12961
|
+
strokeLinejoin: "round"
|
|
12962
|
+
}
|
|
12963
|
+
) }),
|
|
12964
|
+
/* @__PURE__ */ jsxRuntime.jsx("g", { clipPath: "url(#clip4_20915_38670)", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12965
|
+
"path",
|
|
12966
|
+
{
|
|
12967
|
+
d: "M136.504 95.1945L129.12 95.1519L129.095 99.3617",
|
|
12968
|
+
stroke: "#A1A1AA",
|
|
12969
|
+
strokeWidth: "1.5",
|
|
12970
|
+
strokeLinecap: "round",
|
|
12971
|
+
strokeLinejoin: "round"
|
|
12972
|
+
}
|
|
12973
|
+
) }),
|
|
12974
|
+
/* @__PURE__ */ jsxRuntime.jsx("g", { clipPath: "url(#clip5_20915_38670)", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12975
|
+
"path",
|
|
12976
|
+
{
|
|
12977
|
+
d: "M146.894 101.198L139.51 101.155L139.486 105.365",
|
|
12978
|
+
stroke: "#A1A1AA",
|
|
12979
|
+
strokeWidth: "1.5",
|
|
12980
|
+
strokeLinecap: "round",
|
|
12981
|
+
strokeLinejoin: "round"
|
|
12982
|
+
}
|
|
12983
|
+
) }),
|
|
12984
|
+
/* @__PURE__ */ jsxRuntime.jsxs("defs", { children: [
|
|
12985
|
+
/* @__PURE__ */ jsxRuntime.jsx("clipPath", { id: "clip0_20915_38670", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12986
|
+
"rect",
|
|
12926
12987
|
{
|
|
12927
|
-
|
|
12928
|
-
|
|
12929
|
-
|
|
12930
|
-
|
|
12931
|
-
onSearchValueChange: locations.onSearchValueChange,
|
|
12932
|
-
placeholder: "Select location",
|
|
12933
|
-
onChange: (value) => {
|
|
12934
|
-
setValue("shipping_option_id", "", {
|
|
12935
|
-
shouldDirty: true,
|
|
12936
|
-
shouldTouch: true
|
|
12937
|
-
});
|
|
12938
|
-
onChange(value);
|
|
12939
|
-
},
|
|
12940
|
-
...field
|
|
12988
|
+
width: "12",
|
|
12989
|
+
height: "12",
|
|
12990
|
+
fill: "white",
|
|
12991
|
+
transform: "matrix(0.865865 0.500278 -0.871576 0.490261 138.36 74.6508)"
|
|
12941
12992
|
}
|
|
12942
|
-
) })
|
|
12943
|
-
|
|
12944
|
-
|
|
12945
|
-
}
|
|
12946
|
-
);
|
|
12947
|
-
};
|
|
12948
|
-
const ShippingOptionField = ({
|
|
12949
|
-
shippingProfileId,
|
|
12950
|
-
preview,
|
|
12951
|
-
control
|
|
12952
|
-
}) => {
|
|
12953
|
-
var _a;
|
|
12954
|
-
const locationId = reactHookForm.useWatch({ control, name: "location_id" });
|
|
12955
|
-
const shippingOptions = useComboboxData({
|
|
12956
|
-
queryKey: ["shipping_options", locationId, shippingProfileId],
|
|
12957
|
-
queryFn: async (params) => {
|
|
12958
|
-
return await sdk.admin.shippingOption.list({
|
|
12959
|
-
...params,
|
|
12960
|
-
stock_location_id: locationId,
|
|
12961
|
-
shipping_profile_id: shippingProfileId
|
|
12962
|
-
});
|
|
12963
|
-
},
|
|
12964
|
-
getOptions: (data) => {
|
|
12965
|
-
return data.shipping_options.map((option) => {
|
|
12966
|
-
var _a2;
|
|
12967
|
-
if ((_a2 = option.rules) == null ? void 0 : _a2.find(
|
|
12968
|
-
(r) => r.attribute === "is_return" && r.value === "true"
|
|
12969
|
-
)) {
|
|
12970
|
-
return void 0;
|
|
12971
|
-
}
|
|
12972
|
-
return {
|
|
12973
|
-
label: option.name,
|
|
12974
|
-
value: option.id
|
|
12975
|
-
};
|
|
12976
|
-
}).filter(Boolean);
|
|
12977
|
-
},
|
|
12978
|
-
enabled: !!locationId && !!shippingProfileId,
|
|
12979
|
-
defaultValue: ((_a = preview.shipping_methods[0]) == null ? void 0 : _a.shipping_option_id) || void 0
|
|
12980
|
-
});
|
|
12981
|
-
const tooltipContent = !locationId && !shippingProfileId ? "Choose a location and shipping profile first." : !locationId ? "Choose a location first." : "Choose a shipping profile first.";
|
|
12982
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12983
|
-
Form$2.Field,
|
|
12984
|
-
{
|
|
12985
|
-
control,
|
|
12986
|
-
name: "shipping_option_id",
|
|
12987
|
-
render: ({ field }) => {
|
|
12988
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Form$2.Item, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-x-3", children: [
|
|
12989
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col", children: [
|
|
12990
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Shipping option" }),
|
|
12991
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Hint, { children: "Choose the shipping option to use." })
|
|
12992
|
-
] }),
|
|
12993
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12994
|
-
ConditionalTooltip,
|
|
12993
|
+
) }),
|
|
12994
|
+
/* @__PURE__ */ jsxRuntime.jsx("clipPath", { id: "clip1_20915_38670", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12995
|
+
"rect",
|
|
12995
12996
|
{
|
|
12996
|
-
|
|
12997
|
-
|
|
12998
|
-
|
|
12999
|
-
|
|
13000
|
-
{
|
|
13001
|
-
options: shippingOptions.options,
|
|
13002
|
-
fetchNextPage: shippingOptions.fetchNextPage,
|
|
13003
|
-
isFetchingNextPage: shippingOptions.isFetchingNextPage,
|
|
13004
|
-
searchValue: shippingOptions.searchValue,
|
|
13005
|
-
onSearchValueChange: shippingOptions.onSearchValueChange,
|
|
13006
|
-
placeholder: "Select shipping option",
|
|
13007
|
-
...field,
|
|
13008
|
-
disabled: !locationId || !shippingProfileId
|
|
13009
|
-
}
|
|
13010
|
-
) }) })
|
|
12997
|
+
width: "12",
|
|
12998
|
+
height: "12",
|
|
12999
|
+
fill: "white",
|
|
13000
|
+
transform: "matrix(0.865865 0.500278 -0.871576 0.490261 148.75 80.6541)"
|
|
13011
13001
|
}
|
|
13012
|
-
)
|
|
13013
|
-
|
|
13014
|
-
|
|
13015
|
-
}
|
|
13016
|
-
);
|
|
13017
|
-
};
|
|
13018
|
-
const CustomAmountField = ({
|
|
13019
|
-
control,
|
|
13020
|
-
currencyCode
|
|
13021
|
-
}) => {
|
|
13022
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
13023
|
-
Form$2.Field,
|
|
13024
|
-
{
|
|
13025
|
-
control,
|
|
13026
|
-
name: "custom_amount",
|
|
13027
|
-
render: ({ field: { onChange, ...field } }) => {
|
|
13028
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-x-3", children: [
|
|
13029
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col", children: [
|
|
13030
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Custom amount" }),
|
|
13031
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Hint, { children: "Set a custom amount for the shipping option." })
|
|
13032
|
-
] }),
|
|
13033
|
-
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
13034
|
-
ui.CurrencyInput,
|
|
13002
|
+
) }),
|
|
13003
|
+
/* @__PURE__ */ jsxRuntime.jsx("clipPath", { id: "clip2_20915_38670", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
13004
|
+
"rect",
|
|
13035
13005
|
{
|
|
13036
|
-
|
|
13037
|
-
|
|
13038
|
-
|
|
13039
|
-
|
|
13006
|
+
width: "12",
|
|
13007
|
+
height: "12",
|
|
13008
|
+
fill: "white",
|
|
13009
|
+
transform: "matrix(0.865865 0.500278 -0.871576 0.490261 159.141 86.6575)"
|
|
13010
|
+
}
|
|
13011
|
+
) }),
|
|
13012
|
+
/* @__PURE__ */ jsxRuntime.jsx("clipPath", { id: "clip3_20915_38670", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
13013
|
+
"rect",
|
|
13014
|
+
{
|
|
13015
|
+
width: "12",
|
|
13016
|
+
height: "12",
|
|
13017
|
+
fill: "white",
|
|
13018
|
+
transform: "matrix(0.865865 0.500278 -0.871576 0.490261 120.928 84.4561)"
|
|
13019
|
+
}
|
|
13020
|
+
) }),
|
|
13021
|
+
/* @__PURE__ */ jsxRuntime.jsx("clipPath", { id: "clip4_20915_38670", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
13022
|
+
"rect",
|
|
13023
|
+
{
|
|
13024
|
+
width: "12",
|
|
13025
|
+
height: "12",
|
|
13026
|
+
fill: "white",
|
|
13027
|
+
transform: "matrix(0.865865 0.500278 -0.871576 0.490261 131.318 90.4594)"
|
|
13028
|
+
}
|
|
13029
|
+
) }),
|
|
13030
|
+
/* @__PURE__ */ jsxRuntime.jsx("clipPath", { id: "clip5_20915_38670", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
13031
|
+
"rect",
|
|
13032
|
+
{
|
|
13033
|
+
width: "12",
|
|
13034
|
+
height: "12",
|
|
13035
|
+
fill: "white",
|
|
13036
|
+
transform: "matrix(0.865865 0.500278 -0.871576 0.490261 141.709 96.4627)"
|
|
13040
13037
|
}
|
|
13041
13038
|
) })
|
|
13042
|
-
] })
|
|
13043
|
-
|
|
13039
|
+
] })
|
|
13040
|
+
]
|
|
13044
13041
|
}
|
|
13045
13042
|
);
|
|
13046
13043
|
};
|
|
13044
|
+
const schema = objectType({
|
|
13045
|
+
customer_id: stringType().min(1)
|
|
13046
|
+
});
|
|
13047
13047
|
const widgetModule = { widgets: [] };
|
|
13048
13048
|
const routeModule = {
|
|
13049
13049
|
routes: [
|
|
@@ -13068,6 +13068,10 @@ const routeModule = {
|
|
|
13068
13068
|
Component: BillingAddress,
|
|
13069
13069
|
path: "/draft-orders/:id/billing-address"
|
|
13070
13070
|
},
|
|
13071
|
+
{
|
|
13072
|
+
Component: CustomItems,
|
|
13073
|
+
path: "/draft-orders/:id/custom-items"
|
|
13074
|
+
},
|
|
13071
13075
|
{
|
|
13072
13076
|
Component: Email,
|
|
13073
13077
|
path: "/draft-orders/:id/email"
|
|
@@ -13092,17 +13096,13 @@ const routeModule = {
|
|
|
13092
13096
|
Component: ShippingAddress,
|
|
13093
13097
|
path: "/draft-orders/:id/shipping-address"
|
|
13094
13098
|
},
|
|
13095
|
-
{
|
|
13096
|
-
Component: TransferOwnership,
|
|
13097
|
-
path: "/draft-orders/:id/transfer-ownership"
|
|
13098
|
-
},
|
|
13099
|
-
{
|
|
13100
|
-
Component: CustomItems,
|
|
13101
|
-
path: "/draft-orders/:id/custom-items"
|
|
13102
|
-
},
|
|
13103
13099
|
{
|
|
13104
13100
|
Component: Shipping,
|
|
13105
13101
|
path: "/draft-orders/:id/shipping"
|
|
13102
|
+
},
|
|
13103
|
+
{
|
|
13104
|
+
Component: TransferOwnership,
|
|
13105
|
+
path: "/draft-orders/:id/transfer-ownership"
|
|
13106
13106
|
}
|
|
13107
13107
|
]
|
|
13108
13108
|
}
|