@medusajs/draft-order 2.10.4-preview-20250925090152 → 2.10.4-preview-20250925180208

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.
@@ -9573,217 +9573,6 @@ const ID = () => {
9573
9573
  /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Outlet, {})
9574
9574
  ] });
9575
9575
  };
9576
- const BillingAddress = () => {
9577
- const { id } = reactRouterDom.useParams();
9578
- const { order, isPending, isError, error } = useOrder(id, {
9579
- fields: "+billing_address"
9580
- });
9581
- if (isError) {
9582
- throw error;
9583
- }
9584
- const isReady = !isPending && !!order;
9585
- return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
9586
- /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer.Header, { children: [
9587
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Billing Address" }) }),
9588
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit the billing address for the draft order" }) })
9589
- ] }),
9590
- isReady && /* @__PURE__ */ jsxRuntime.jsx(BillingAddressForm, { order })
9591
- ] });
9592
- };
9593
- const BillingAddressForm = ({ order }) => {
9594
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
9595
- const form = reactHookForm.useForm({
9596
- defaultValues: {
9597
- first_name: ((_a = order.billing_address) == null ? void 0 : _a.first_name) ?? "",
9598
- last_name: ((_b = order.billing_address) == null ? void 0 : _b.last_name) ?? "",
9599
- company: ((_c = order.billing_address) == null ? void 0 : _c.company) ?? "",
9600
- address_1: ((_d = order.billing_address) == null ? void 0 : _d.address_1) ?? "",
9601
- address_2: ((_e = order.billing_address) == null ? void 0 : _e.address_2) ?? "",
9602
- city: ((_f = order.billing_address) == null ? void 0 : _f.city) ?? "",
9603
- province: ((_g = order.billing_address) == null ? void 0 : _g.province) ?? "",
9604
- country_code: ((_h = order.billing_address) == null ? void 0 : _h.country_code) ?? "",
9605
- postal_code: ((_i = order.billing_address) == null ? void 0 : _i.postal_code) ?? "",
9606
- phone: ((_j = order.billing_address) == null ? void 0 : _j.phone) ?? ""
9607
- },
9608
- resolver: zod.zodResolver(schema$5)
9609
- });
9610
- const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
9611
- const { handleSuccess } = useRouteModal();
9612
- const onSubmit = form.handleSubmit(async (data) => {
9613
- await mutateAsync(
9614
- { billing_address: data },
9615
- {
9616
- onSuccess: () => {
9617
- handleSuccess();
9618
- },
9619
- onError: (error) => {
9620
- ui.toast.error(error.message);
9621
- }
9622
- }
9623
- );
9624
- });
9625
- return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(
9626
- KeyboundForm,
9627
- {
9628
- className: "flex flex-1 flex-col overflow-hidden",
9629
- onSubmit,
9630
- children: [
9631
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-y-4", children: [
9632
- /* @__PURE__ */ jsxRuntime.jsx(
9633
- Form$2.Field,
9634
- {
9635
- control: form.control,
9636
- name: "country_code",
9637
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9638
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Country" }),
9639
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(CountrySelect, { ...field }) }),
9640
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9641
- ] })
9642
- }
9643
- ),
9644
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
9645
- /* @__PURE__ */ jsxRuntime.jsx(
9646
- Form$2.Field,
9647
- {
9648
- control: form.control,
9649
- name: "first_name",
9650
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9651
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "First name" }),
9652
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9653
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9654
- ] })
9655
- }
9656
- ),
9657
- /* @__PURE__ */ jsxRuntime.jsx(
9658
- Form$2.Field,
9659
- {
9660
- control: form.control,
9661
- name: "last_name",
9662
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9663
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Last name" }),
9664
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9665
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9666
- ] })
9667
- }
9668
- )
9669
- ] }),
9670
- /* @__PURE__ */ jsxRuntime.jsx(
9671
- Form$2.Field,
9672
- {
9673
- control: form.control,
9674
- name: "company",
9675
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9676
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Company" }),
9677
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9678
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9679
- ] })
9680
- }
9681
- ),
9682
- /* @__PURE__ */ jsxRuntime.jsx(
9683
- Form$2.Field,
9684
- {
9685
- control: form.control,
9686
- name: "address_1",
9687
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9688
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Address" }),
9689
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9690
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9691
- ] })
9692
- }
9693
- ),
9694
- /* @__PURE__ */ jsxRuntime.jsx(
9695
- Form$2.Field,
9696
- {
9697
- control: form.control,
9698
- name: "address_2",
9699
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9700
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Apartment, suite, etc." }),
9701
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9702
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9703
- ] })
9704
- }
9705
- ),
9706
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
9707
- /* @__PURE__ */ jsxRuntime.jsx(
9708
- Form$2.Field,
9709
- {
9710
- control: form.control,
9711
- name: "postal_code",
9712
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9713
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Postal code" }),
9714
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9715
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9716
- ] })
9717
- }
9718
- ),
9719
- /* @__PURE__ */ jsxRuntime.jsx(
9720
- Form$2.Field,
9721
- {
9722
- control: form.control,
9723
- name: "city",
9724
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9725
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "City" }),
9726
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9727
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9728
- ] })
9729
- }
9730
- )
9731
- ] }),
9732
- /* @__PURE__ */ jsxRuntime.jsx(
9733
- Form$2.Field,
9734
- {
9735
- control: form.control,
9736
- name: "province",
9737
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9738
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Province / State" }),
9739
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9740
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9741
- ] })
9742
- }
9743
- ),
9744
- /* @__PURE__ */ jsxRuntime.jsx(
9745
- Form$2.Field,
9746
- {
9747
- control: form.control,
9748
- name: "phone",
9749
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9750
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Phone" }),
9751
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9752
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9753
- ] })
9754
- }
9755
- )
9756
- ] }) }),
9757
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
9758
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
9759
- /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
9760
- ] }) })
9761
- ]
9762
- }
9763
- ) });
9764
- };
9765
- const schema$5 = addressSchema;
9766
- const CustomItems = () => {
9767
- return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
9768
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Custom Items" }) }) }),
9769
- /* @__PURE__ */ jsxRuntime.jsx(CustomItemsForm, {})
9770
- ] });
9771
- };
9772
- const CustomItemsForm = () => {
9773
- const form = reactHookForm.useForm({
9774
- resolver: zod.zodResolver(schema$4)
9775
- });
9776
- return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(KeyboundForm, { className: "flex flex-1 flex-col", children: [
9777
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, {}),
9778
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
9779
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
9780
- /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", children: "Save" })
9781
- ] }) })
9782
- ] }) });
9783
- };
9784
- const schema$4 = objectType({
9785
- email: stringType().email()
9786
- });
9787
9576
  const Email = () => {
9788
9577
  const { id } = reactRouterDom.useParams();
9789
9578
  const { order, isPending, isError, error } = useOrder(id, {
@@ -9806,7 +9595,7 @@ const EmailForm = ({ order }) => {
9806
9595
  defaultValues: {
9807
9596
  email: order.email ?? ""
9808
9597
  },
9809
- resolver: zod.zodResolver(schema$3)
9598
+ resolver: zod.zodResolver(schema$5)
9810
9599
  });
9811
9600
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
9812
9601
  const { handleSuccess } = useRouteModal();
@@ -9849,7 +9638,7 @@ const EmailForm = ({ order }) => {
9849
9638
  }
9850
9639
  ) });
9851
9640
  };
9852
- const schema$3 = objectType({
9641
+ const schema$5 = objectType({
9853
9642
  email: stringType().email()
9854
9643
  });
9855
9644
  const NumberInput = React.forwardRef(
@@ -10826,283 +10615,6 @@ const customItemSchema = objectType({
10826
10615
  quantity: numberType(),
10827
10616
  unit_price: unionType([numberType(), stringType()])
10828
10617
  });
10829
- const PROMOTION_QUERY_KEY = "promotions";
10830
- const promotionsQueryKeys = {
10831
- list: (query2) => [
10832
- PROMOTION_QUERY_KEY,
10833
- query2 ? query2 : void 0
10834
- ],
10835
- detail: (id, query2) => [
10836
- PROMOTION_QUERY_KEY,
10837
- id,
10838
- query2 ? query2 : void 0
10839
- ]
10840
- };
10841
- const usePromotions = (query2, options) => {
10842
- const { data, ...rest } = reactQuery.useQuery({
10843
- queryKey: promotionsQueryKeys.list(query2),
10844
- queryFn: async () => sdk.admin.promotion.list(query2),
10845
- ...options
10846
- });
10847
- return { ...data, ...rest };
10848
- };
10849
- const Promotions = () => {
10850
- const { id } = reactRouterDom.useParams();
10851
- const {
10852
- order: preview,
10853
- isError: isPreviewError,
10854
- error: previewError
10855
- } = useOrderPreview(id, void 0);
10856
- useInitiateOrderEdit({ preview });
10857
- const { onCancel } = useCancelOrderEdit({ preview });
10858
- if (isPreviewError) {
10859
- throw previewError;
10860
- }
10861
- const isReady = !!preview;
10862
- return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { onClose: onCancel, children: [
10863
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Promotions" }) }) }),
10864
- isReady && /* @__PURE__ */ jsxRuntime.jsx(PromotionForm, { preview })
10865
- ] });
10866
- };
10867
- const PromotionForm = ({ preview }) => {
10868
- const { items, shipping_methods } = preview;
10869
- const [isSubmitting, setIsSubmitting] = React.useState(false);
10870
- const [comboboxValue, setComboboxValue] = React.useState("");
10871
- const { handleSuccess } = useRouteModal();
10872
- const { mutateAsync: addPromotions, isPending: isAddingPromotions } = useDraftOrderAddPromotions(preview.id);
10873
- const promoIds = getPromotionIds(items, shipping_methods);
10874
- const { promotions, isPending, isError, error } = usePromotions(
10875
- {
10876
- id: promoIds
10877
- },
10878
- {
10879
- enabled: !!promoIds.length
10880
- }
10881
- );
10882
- const comboboxData = useComboboxData({
10883
- queryKey: ["promotions", "combobox", promoIds],
10884
- queryFn: async (params) => {
10885
- return await sdk.admin.promotion.list({
10886
- ...params,
10887
- id: {
10888
- $nin: promoIds
10889
- }
10890
- });
10891
- },
10892
- getOptions: (data) => {
10893
- return data.promotions.map((promotion) => ({
10894
- label: promotion.code,
10895
- value: promotion.code
10896
- }));
10897
- }
10898
- });
10899
- const add = async (value) => {
10900
- if (!value) {
10901
- return;
10902
- }
10903
- addPromotions(
10904
- {
10905
- promo_codes: [value]
10906
- },
10907
- {
10908
- onError: (e) => {
10909
- ui.toast.error(e.message);
10910
- comboboxData.onSearchValueChange("");
10911
- setComboboxValue("");
10912
- },
10913
- onSuccess: () => {
10914
- comboboxData.onSearchValueChange("");
10915
- setComboboxValue("");
10916
- }
10917
- }
10918
- );
10919
- };
10920
- const { mutateAsync: confirmOrderEdit } = useDraftOrderConfirmEdit(preview.id);
10921
- const { mutateAsync: requestOrderEdit } = useOrderEditRequest(preview.id);
10922
- const onSubmit = async () => {
10923
- setIsSubmitting(true);
10924
- let requestSucceeded = false;
10925
- await requestOrderEdit(void 0, {
10926
- onError: (e) => {
10927
- ui.toast.error(e.message);
10928
- },
10929
- onSuccess: () => {
10930
- requestSucceeded = true;
10931
- }
10932
- });
10933
- if (!requestSucceeded) {
10934
- setIsSubmitting(false);
10935
- return;
10936
- }
10937
- await confirmOrderEdit(void 0, {
10938
- onError: (e) => {
10939
- ui.toast.error(e.message);
10940
- },
10941
- onSuccess: () => {
10942
- handleSuccess();
10943
- },
10944
- onSettled: () => {
10945
- setIsSubmitting(false);
10946
- }
10947
- });
10948
- };
10949
- if (isError) {
10950
- throw error;
10951
- }
10952
- return /* @__PURE__ */ jsxRuntime.jsxs(KeyboundForm, { className: "flex flex-1 flex-col", onSubmit, children: [
10953
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-4", children: [
10954
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-3", children: [
10955
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col", children: [
10956
- /* @__PURE__ */ jsxRuntime.jsx(ui.Label, { size: "small", weight: "plus", htmlFor: "promotion-combobox", children: "Apply promotions" }),
10957
- /* @__PURE__ */ jsxRuntime.jsx(ui.Hint, { id: "promotion-combobox-hint", children: "Manage promotions that should be applied to the order." })
10958
- ] }),
10959
- /* @__PURE__ */ jsxRuntime.jsx(
10960
- Combobox,
10961
- {
10962
- id: "promotion-combobox",
10963
- "aria-describedby": "promotion-combobox-hint",
10964
- isFetchingNextPage: comboboxData.isFetchingNextPage,
10965
- fetchNextPage: comboboxData.fetchNextPage,
10966
- options: comboboxData.options,
10967
- onSearchValueChange: comboboxData.onSearchValueChange,
10968
- searchValue: comboboxData.searchValue,
10969
- disabled: comboboxData.disabled || isAddingPromotions,
10970
- onChange: add,
10971
- value: comboboxValue
10972
- }
10973
- )
10974
- ] }),
10975
- /* @__PURE__ */ jsxRuntime.jsx(ui.Divider, { variant: "dashed" }),
10976
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-2", children: promotions == null ? void 0 : promotions.map((promotion) => /* @__PURE__ */ jsxRuntime.jsx(
10977
- PromotionItem,
10978
- {
10979
- promotion,
10980
- orderId: preview.id,
10981
- isLoading: isPending
10982
- },
10983
- promotion.id
10984
- )) })
10985
- ] }) }),
10986
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
10987
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
10988
- /* @__PURE__ */ jsxRuntime.jsx(
10989
- ui.Button,
10990
- {
10991
- size: "small",
10992
- type: "submit",
10993
- isLoading: isSubmitting || isAddingPromotions,
10994
- children: "Save"
10995
- }
10996
- )
10997
- ] }) })
10998
- ] });
10999
- };
11000
- const PromotionItem = ({
11001
- promotion,
11002
- orderId,
11003
- isLoading
11004
- }) => {
11005
- var _a;
11006
- const { mutateAsync: removePromotions, isPending } = useDraftOrderRemovePromotions(orderId);
11007
- const onRemove = async () => {
11008
- removePromotions(
11009
- {
11010
- promo_codes: [promotion.code]
11011
- },
11012
- {
11013
- onError: (e) => {
11014
- ui.toast.error(e.message);
11015
- }
11016
- }
11017
- );
11018
- };
11019
- const displayValue = getDisplayValue(promotion);
11020
- return /* @__PURE__ */ jsxRuntime.jsxs(
11021
- "div",
11022
- {
11023
- className: ui.clx(
11024
- "bg-ui-bg-component shadow-elevation-card-rest flex items-center justify-between rounded-lg px-3 py-2",
11025
- {
11026
- "animate-pulse": isLoading
11027
- }
11028
- ),
11029
- children: [
11030
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
11031
- /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: "small", weight: "plus", leading: "compact", children: promotion.code }),
11032
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-ui-fg-subtle flex items-center gap-1.5", children: [
11033
- displayValue && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5", children: [
11034
- /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: "small", leading: "compact", children: displayValue }),
11035
- /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: "small", leading: "compact", children: "·" })
11036
- ] }),
11037
- /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: "small", leading: "compact", className: "capitalize", children: (_a = promotion.application_method) == null ? void 0 : _a.allocation })
11038
- ] })
11039
- ] }),
11040
- /* @__PURE__ */ jsxRuntime.jsx(
11041
- ui.IconButton,
11042
- {
11043
- size: "small",
11044
- type: "button",
11045
- variant: "transparent",
11046
- onClick: onRemove,
11047
- isLoading: isPending || isLoading,
11048
- children: /* @__PURE__ */ jsxRuntime.jsx(icons.XMark, {})
11049
- }
11050
- )
11051
- ]
11052
- },
11053
- promotion.id
11054
- );
11055
- };
11056
- function getDisplayValue(promotion) {
11057
- var _a, _b, _c, _d;
11058
- const value = (_a = promotion.application_method) == null ? void 0 : _a.value;
11059
- if (!value) {
11060
- return null;
11061
- }
11062
- if (((_b = promotion.application_method) == null ? void 0 : _b.type) === "fixed") {
11063
- const currency = (_c = promotion.application_method) == null ? void 0 : _c.currency_code;
11064
- if (!currency) {
11065
- return null;
11066
- }
11067
- return getLocaleAmount(value, currency);
11068
- } else if (((_d = promotion.application_method) == null ? void 0 : _d.type) === "percentage") {
11069
- return formatPercentage(value);
11070
- }
11071
- return null;
11072
- }
11073
- const formatter = new Intl.NumberFormat([], {
11074
- style: "percent",
11075
- minimumFractionDigits: 2
11076
- });
11077
- const formatPercentage = (value, isPercentageValue = false) => {
11078
- let val = value || 0;
11079
- if (!isPercentageValue) {
11080
- val = val / 100;
11081
- }
11082
- return formatter.format(val);
11083
- };
11084
- function getPromotionIds(items, shippingMethods) {
11085
- const promotionIds = /* @__PURE__ */ new Set();
11086
- for (const item of items) {
11087
- if (item.adjustments) {
11088
- for (const adjustment of item.adjustments) {
11089
- if (adjustment.promotion_id) {
11090
- promotionIds.add(adjustment.promotion_id);
11091
- }
11092
- }
11093
- }
11094
- }
11095
- for (const shippingMethod of shippingMethods) {
11096
- if (shippingMethod.adjustments) {
11097
- for (const adjustment of shippingMethod.adjustments) {
11098
- if (adjustment.promotion_id) {
11099
- promotionIds.add(adjustment.promotion_id);
11100
- }
11101
- }
11102
- }
11103
- }
11104
- return Array.from(promotionIds);
11105
- }
11106
10618
  const InlineTip = React.forwardRef(
11107
10619
  ({ variant = "tip", label, className, children, ...props }, ref) => {
11108
10620
  const labelValue = label || (variant === "warning" ? "Warning" : "Tip");
@@ -11380,78 +10892,355 @@ const PlaceholderInner = () => {
11380
10892
  ] }) })
11381
10893
  ] });
11382
10894
  };
11383
- const EDITABLE_TYPES = ["string", "number", "boolean"];
11384
- function getDefaultValues(metadata) {
11385
- if (!metadata || !Object.keys(metadata).length) {
11386
- return [
11387
- {
11388
- key: "",
11389
- value: "",
11390
- disabled: false
11391
- }
11392
- ];
10895
+ const EDITABLE_TYPES = ["string", "number", "boolean"];
10896
+ function getDefaultValues(metadata) {
10897
+ if (!metadata || !Object.keys(metadata).length) {
10898
+ return [
10899
+ {
10900
+ key: "",
10901
+ value: "",
10902
+ disabled: false
10903
+ }
10904
+ ];
10905
+ }
10906
+ return Object.entries(metadata).map(([key, value]) => {
10907
+ if (!EDITABLE_TYPES.includes(typeof value)) {
10908
+ return {
10909
+ key,
10910
+ value,
10911
+ disabled: true
10912
+ };
10913
+ }
10914
+ let stringValue = value;
10915
+ if (typeof value !== "string") {
10916
+ stringValue = JSON.stringify(value);
10917
+ }
10918
+ return {
10919
+ key,
10920
+ value: stringValue,
10921
+ original_key: key
10922
+ };
10923
+ });
10924
+ }
10925
+ function parseValues(values) {
10926
+ const metadata = values.metadata;
10927
+ const isEmpty = !metadata.length || metadata.length === 1 && !metadata[0].key && !metadata[0].value;
10928
+ if (isEmpty) {
10929
+ return null;
10930
+ }
10931
+ const update = {};
10932
+ metadata.forEach((field) => {
10933
+ let key = field.key;
10934
+ let value = field.value;
10935
+ const disabled = field.disabled;
10936
+ if (!key || !value) {
10937
+ return;
10938
+ }
10939
+ if (disabled) {
10940
+ update[key] = value;
10941
+ return;
10942
+ }
10943
+ key = key.trim();
10944
+ value = value.trim();
10945
+ if (value === "true") {
10946
+ update[key] = true;
10947
+ } else if (value === "false") {
10948
+ update[key] = false;
10949
+ } else {
10950
+ const parsedNumber = parseFloat(value);
10951
+ if (!isNaN(parsedNumber)) {
10952
+ update[key] = parsedNumber;
10953
+ } else {
10954
+ update[key] = value;
10955
+ }
10956
+ }
10957
+ });
10958
+ return update;
10959
+ }
10960
+ function getHasUneditableRows(metadata) {
10961
+ if (!metadata) {
10962
+ return false;
10963
+ }
10964
+ return Object.values(metadata).some(
10965
+ (value) => !EDITABLE_TYPES.includes(typeof value)
10966
+ );
10967
+ }
10968
+ const PROMOTION_QUERY_KEY = "promotions";
10969
+ const promotionsQueryKeys = {
10970
+ list: (query2) => [
10971
+ PROMOTION_QUERY_KEY,
10972
+ query2 ? query2 : void 0
10973
+ ],
10974
+ detail: (id, query2) => [
10975
+ PROMOTION_QUERY_KEY,
10976
+ id,
10977
+ query2 ? query2 : void 0
10978
+ ]
10979
+ };
10980
+ const usePromotions = (query2, options) => {
10981
+ const { data, ...rest } = reactQuery.useQuery({
10982
+ queryKey: promotionsQueryKeys.list(query2),
10983
+ queryFn: async () => sdk.admin.promotion.list(query2),
10984
+ ...options
10985
+ });
10986
+ return { ...data, ...rest };
10987
+ };
10988
+ const Promotions = () => {
10989
+ const { id } = reactRouterDom.useParams();
10990
+ const {
10991
+ order: preview,
10992
+ isError: isPreviewError,
10993
+ error: previewError
10994
+ } = useOrderPreview(id, void 0);
10995
+ useInitiateOrderEdit({ preview });
10996
+ const { onCancel } = useCancelOrderEdit({ preview });
10997
+ if (isPreviewError) {
10998
+ throw previewError;
10999
+ }
11000
+ const isReady = !!preview;
11001
+ return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { onClose: onCancel, children: [
11002
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Promotions" }) }) }),
11003
+ isReady && /* @__PURE__ */ jsxRuntime.jsx(PromotionForm, { preview })
11004
+ ] });
11005
+ };
11006
+ const PromotionForm = ({ preview }) => {
11007
+ const { items, shipping_methods } = preview;
11008
+ const [isSubmitting, setIsSubmitting] = React.useState(false);
11009
+ const [comboboxValue, setComboboxValue] = React.useState("");
11010
+ const { handleSuccess } = useRouteModal();
11011
+ const { mutateAsync: addPromotions, isPending: isAddingPromotions } = useDraftOrderAddPromotions(preview.id);
11012
+ const promoIds = getPromotionIds(items, shipping_methods);
11013
+ const { promotions, isPending, isError, error } = usePromotions(
11014
+ {
11015
+ id: promoIds
11016
+ },
11017
+ {
11018
+ enabled: !!promoIds.length
11019
+ }
11020
+ );
11021
+ const comboboxData = useComboboxData({
11022
+ queryKey: ["promotions", "combobox", promoIds],
11023
+ queryFn: async (params) => {
11024
+ return await sdk.admin.promotion.list({
11025
+ ...params,
11026
+ id: {
11027
+ $nin: promoIds
11028
+ }
11029
+ });
11030
+ },
11031
+ getOptions: (data) => {
11032
+ return data.promotions.map((promotion) => ({
11033
+ label: promotion.code,
11034
+ value: promotion.code
11035
+ }));
11036
+ }
11037
+ });
11038
+ const add = async (value) => {
11039
+ if (!value) {
11040
+ return;
11041
+ }
11042
+ addPromotions(
11043
+ {
11044
+ promo_codes: [value]
11045
+ },
11046
+ {
11047
+ onError: (e) => {
11048
+ ui.toast.error(e.message);
11049
+ comboboxData.onSearchValueChange("");
11050
+ setComboboxValue("");
11051
+ },
11052
+ onSuccess: () => {
11053
+ comboboxData.onSearchValueChange("");
11054
+ setComboboxValue("");
11055
+ }
11056
+ }
11057
+ );
11058
+ };
11059
+ const { mutateAsync: confirmOrderEdit } = useDraftOrderConfirmEdit(preview.id);
11060
+ const { mutateAsync: requestOrderEdit } = useOrderEditRequest(preview.id);
11061
+ const onSubmit = async () => {
11062
+ setIsSubmitting(true);
11063
+ let requestSucceeded = false;
11064
+ await requestOrderEdit(void 0, {
11065
+ onError: (e) => {
11066
+ ui.toast.error(e.message);
11067
+ },
11068
+ onSuccess: () => {
11069
+ requestSucceeded = true;
11070
+ }
11071
+ });
11072
+ if (!requestSucceeded) {
11073
+ setIsSubmitting(false);
11074
+ return;
11075
+ }
11076
+ await confirmOrderEdit(void 0, {
11077
+ onError: (e) => {
11078
+ ui.toast.error(e.message);
11079
+ },
11080
+ onSuccess: () => {
11081
+ handleSuccess();
11082
+ },
11083
+ onSettled: () => {
11084
+ setIsSubmitting(false);
11085
+ }
11086
+ });
11087
+ };
11088
+ if (isError) {
11089
+ throw error;
11090
+ }
11091
+ return /* @__PURE__ */ jsxRuntime.jsxs(KeyboundForm, { className: "flex flex-1 flex-col", onSubmit, children: [
11092
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-4", children: [
11093
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-3", children: [
11094
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col", children: [
11095
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Label, { size: "small", weight: "plus", htmlFor: "promotion-combobox", children: "Apply promotions" }),
11096
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Hint, { id: "promotion-combobox-hint", children: "Manage promotions that should be applied to the order." })
11097
+ ] }),
11098
+ /* @__PURE__ */ jsxRuntime.jsx(
11099
+ Combobox,
11100
+ {
11101
+ id: "promotion-combobox",
11102
+ "aria-describedby": "promotion-combobox-hint",
11103
+ isFetchingNextPage: comboboxData.isFetchingNextPage,
11104
+ fetchNextPage: comboboxData.fetchNextPage,
11105
+ options: comboboxData.options,
11106
+ onSearchValueChange: comboboxData.onSearchValueChange,
11107
+ searchValue: comboboxData.searchValue,
11108
+ disabled: comboboxData.disabled || isAddingPromotions,
11109
+ onChange: add,
11110
+ value: comboboxValue
11111
+ }
11112
+ )
11113
+ ] }),
11114
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Divider, { variant: "dashed" }),
11115
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-2", children: promotions == null ? void 0 : promotions.map((promotion) => /* @__PURE__ */ jsxRuntime.jsx(
11116
+ PromotionItem,
11117
+ {
11118
+ promotion,
11119
+ orderId: preview.id,
11120
+ isLoading: isPending
11121
+ },
11122
+ promotion.id
11123
+ )) })
11124
+ ] }) }),
11125
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
11126
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
11127
+ /* @__PURE__ */ jsxRuntime.jsx(
11128
+ ui.Button,
11129
+ {
11130
+ size: "small",
11131
+ type: "submit",
11132
+ isLoading: isSubmitting || isAddingPromotions,
11133
+ children: "Save"
11134
+ }
11135
+ )
11136
+ ] }) })
11137
+ ] });
11138
+ };
11139
+ const PromotionItem = ({
11140
+ promotion,
11141
+ orderId,
11142
+ isLoading
11143
+ }) => {
11144
+ var _a;
11145
+ const { mutateAsync: removePromotions, isPending } = useDraftOrderRemovePromotions(orderId);
11146
+ const onRemove = async () => {
11147
+ removePromotions(
11148
+ {
11149
+ promo_codes: [promotion.code]
11150
+ },
11151
+ {
11152
+ onError: (e) => {
11153
+ ui.toast.error(e.message);
11154
+ }
11155
+ }
11156
+ );
11157
+ };
11158
+ const displayValue = getDisplayValue(promotion);
11159
+ return /* @__PURE__ */ jsxRuntime.jsxs(
11160
+ "div",
11161
+ {
11162
+ className: ui.clx(
11163
+ "bg-ui-bg-component shadow-elevation-card-rest flex items-center justify-between rounded-lg px-3 py-2",
11164
+ {
11165
+ "animate-pulse": isLoading
11166
+ }
11167
+ ),
11168
+ children: [
11169
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
11170
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: "small", weight: "plus", leading: "compact", children: promotion.code }),
11171
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-ui-fg-subtle flex items-center gap-1.5", children: [
11172
+ displayValue && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5", children: [
11173
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: "small", leading: "compact", children: displayValue }),
11174
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: "small", leading: "compact", children: "·" })
11175
+ ] }),
11176
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Text, { size: "small", leading: "compact", className: "capitalize", children: (_a = promotion.application_method) == null ? void 0 : _a.allocation })
11177
+ ] })
11178
+ ] }),
11179
+ /* @__PURE__ */ jsxRuntime.jsx(
11180
+ ui.IconButton,
11181
+ {
11182
+ size: "small",
11183
+ type: "button",
11184
+ variant: "transparent",
11185
+ onClick: onRemove,
11186
+ isLoading: isPending || isLoading,
11187
+ children: /* @__PURE__ */ jsxRuntime.jsx(icons.XMark, {})
11188
+ }
11189
+ )
11190
+ ]
11191
+ },
11192
+ promotion.id
11193
+ );
11194
+ };
11195
+ function getDisplayValue(promotion) {
11196
+ var _a, _b, _c, _d;
11197
+ const value = (_a = promotion.application_method) == null ? void 0 : _a.value;
11198
+ if (!value) {
11199
+ return null;
11393
11200
  }
11394
- return Object.entries(metadata).map(([key, value]) => {
11395
- if (!EDITABLE_TYPES.includes(typeof value)) {
11396
- return {
11397
- key,
11398
- value,
11399
- disabled: true
11400
- };
11401
- }
11402
- let stringValue = value;
11403
- if (typeof value !== "string") {
11404
- stringValue = JSON.stringify(value);
11201
+ if (((_b = promotion.application_method) == null ? void 0 : _b.type) === "fixed") {
11202
+ const currency = (_c = promotion.application_method) == null ? void 0 : _c.currency_code;
11203
+ if (!currency) {
11204
+ return null;
11405
11205
  }
11406
- return {
11407
- key,
11408
- value: stringValue,
11409
- original_key: key
11410
- };
11411
- });
11206
+ return getLocaleAmount(value, currency);
11207
+ } else if (((_d = promotion.application_method) == null ? void 0 : _d.type) === "percentage") {
11208
+ return formatPercentage(value);
11209
+ }
11210
+ return null;
11412
11211
  }
11413
- function parseValues(values) {
11414
- const metadata = values.metadata;
11415
- const isEmpty = !metadata.length || metadata.length === 1 && !metadata[0].key && !metadata[0].value;
11416
- if (isEmpty) {
11417
- return null;
11212
+ const formatter = new Intl.NumberFormat([], {
11213
+ style: "percent",
11214
+ minimumFractionDigits: 2
11215
+ });
11216
+ const formatPercentage = (value, isPercentageValue = false) => {
11217
+ let val = value || 0;
11218
+ if (!isPercentageValue) {
11219
+ val = val / 100;
11418
11220
  }
11419
- const update = {};
11420
- metadata.forEach((field) => {
11421
- let key = field.key;
11422
- let value = field.value;
11423
- const disabled = field.disabled;
11424
- if (!key || !value) {
11425
- return;
11426
- }
11427
- if (disabled) {
11428
- update[key] = value;
11429
- return;
11221
+ return formatter.format(val);
11222
+ };
11223
+ function getPromotionIds(items, shippingMethods) {
11224
+ const promotionIds = /* @__PURE__ */ new Set();
11225
+ for (const item of items) {
11226
+ if (item.adjustments) {
11227
+ for (const adjustment of item.adjustments) {
11228
+ if (adjustment.promotion_id) {
11229
+ promotionIds.add(adjustment.promotion_id);
11230
+ }
11231
+ }
11430
11232
  }
11431
- key = key.trim();
11432
- value = value.trim();
11433
- if (value === "true") {
11434
- update[key] = true;
11435
- } else if (value === "false") {
11436
- update[key] = false;
11437
- } else {
11438
- const parsedNumber = parseFloat(value);
11439
- if (!isNaN(parsedNumber)) {
11440
- update[key] = parsedNumber;
11441
- } else {
11442
- update[key] = value;
11233
+ }
11234
+ for (const shippingMethod of shippingMethods) {
11235
+ if (shippingMethod.adjustments) {
11236
+ for (const adjustment of shippingMethod.adjustments) {
11237
+ if (adjustment.promotion_id) {
11238
+ promotionIds.add(adjustment.promotion_id);
11239
+ }
11443
11240
  }
11444
11241
  }
11445
- });
11446
- return update;
11447
- }
11448
- function getHasUneditableRows(metadata) {
11449
- if (!metadata) {
11450
- return false;
11451
11242
  }
11452
- return Object.values(metadata).some(
11453
- (value) => !EDITABLE_TYPES.includes(typeof value)
11454
- );
11243
+ return Array.from(promotionIds);
11455
11244
  }
11456
11245
  const SalesChannel = () => {
11457
11246
  const { id } = reactRouterDom.useParams();
@@ -11481,7 +11270,7 @@ const SalesChannelForm = ({ order }) => {
11481
11270
  defaultValues: {
11482
11271
  sales_channel_id: order.sales_channel_id || ""
11483
11272
  },
11484
- resolver: zod.zodResolver(schema$2)
11273
+ resolver: zod.zodResolver(schema$4)
11485
11274
  });
11486
11275
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
11487
11276
  const { handleSuccess } = useRouteModal();
@@ -11556,7 +11345,7 @@ const SalesChannelField = ({ control, order }) => {
11556
11345
  }
11557
11346
  );
11558
11347
  };
11559
- const schema$2 = objectType({
11348
+ const schema$4 = objectType({
11560
11349
  sales_channel_id: stringType().min(1)
11561
11350
  });
11562
11351
  const STACKED_FOCUS_MODAL_ID = "shipping-form";
@@ -12313,59 +12102,262 @@ const ShippingOptionField = ({
12313
12102
  /* @__PURE__ */ jsxRuntime.jsx(Form$2.Hint, { children: "Choose the shipping option to use." })
12314
12103
  ] }),
12315
12104
  /* @__PURE__ */ jsxRuntime.jsx(
12316
- ConditionalTooltip,
12105
+ ConditionalTooltip,
12106
+ {
12107
+ content: tooltipContent,
12108
+ showTooltip: !locationId || !shippingProfileId,
12109
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(
12110
+ Combobox,
12111
+ {
12112
+ options: shippingOptions.options,
12113
+ fetchNextPage: shippingOptions.fetchNextPage,
12114
+ isFetchingNextPage: shippingOptions.isFetchingNextPage,
12115
+ searchValue: shippingOptions.searchValue,
12116
+ onSearchValueChange: shippingOptions.onSearchValueChange,
12117
+ placeholder: "Select shipping option",
12118
+ ...field,
12119
+ disabled: !locationId || !shippingProfileId
12120
+ }
12121
+ ) }) })
12122
+ }
12123
+ )
12124
+ ] }) });
12125
+ }
12126
+ }
12127
+ );
12128
+ };
12129
+ const CustomAmountField = ({
12130
+ control,
12131
+ currencyCode
12132
+ }) => {
12133
+ return /* @__PURE__ */ jsxRuntime.jsx(
12134
+ Form$2.Field,
12135
+ {
12136
+ control,
12137
+ name: "custom_amount",
12138
+ render: ({ field: { onChange, ...field } }) => {
12139
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-x-3", children: [
12140
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col", children: [
12141
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Custom amount" }),
12142
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Hint, { children: "Set a custom amount for the shipping option." })
12143
+ ] }),
12144
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(
12145
+ ui.CurrencyInput,
12146
+ {
12147
+ ...field,
12148
+ onValueChange: (value) => onChange(value),
12149
+ symbol: getNativeSymbol(currencyCode),
12150
+ code: currencyCode
12151
+ }
12152
+ ) })
12153
+ ] });
12154
+ }
12155
+ }
12156
+ );
12157
+ };
12158
+ const ShippingAddress = () => {
12159
+ const { id } = reactRouterDom.useParams();
12160
+ const { order, isPending, isError, error } = useOrder(id, {
12161
+ fields: "+shipping_address"
12162
+ });
12163
+ if (isError) {
12164
+ throw error;
12165
+ }
12166
+ const isReady = !isPending && !!order;
12167
+ return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
12168
+ /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer.Header, { children: [
12169
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Shipping Address" }) }),
12170
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit the shipping address for the draft order" }) })
12171
+ ] }),
12172
+ isReady && /* @__PURE__ */ jsxRuntime.jsx(ShippingAddressForm, { order })
12173
+ ] });
12174
+ };
12175
+ const ShippingAddressForm = ({ order }) => {
12176
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
12177
+ const form = reactHookForm.useForm({
12178
+ defaultValues: {
12179
+ first_name: ((_a = order.shipping_address) == null ? void 0 : _a.first_name) ?? "",
12180
+ last_name: ((_b = order.shipping_address) == null ? void 0 : _b.last_name) ?? "",
12181
+ company: ((_c = order.shipping_address) == null ? void 0 : _c.company) ?? "",
12182
+ address_1: ((_d = order.shipping_address) == null ? void 0 : _d.address_1) ?? "",
12183
+ address_2: ((_e = order.shipping_address) == null ? void 0 : _e.address_2) ?? "",
12184
+ city: ((_f = order.shipping_address) == null ? void 0 : _f.city) ?? "",
12185
+ province: ((_g = order.shipping_address) == null ? void 0 : _g.province) ?? "",
12186
+ country_code: ((_h = order.shipping_address) == null ? void 0 : _h.country_code) ?? "",
12187
+ postal_code: ((_i = order.shipping_address) == null ? void 0 : _i.postal_code) ?? "",
12188
+ phone: ((_j = order.shipping_address) == null ? void 0 : _j.phone) ?? ""
12189
+ },
12190
+ resolver: zod.zodResolver(schema$3)
12191
+ });
12192
+ const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12193
+ const { handleSuccess } = useRouteModal();
12194
+ const onSubmit = form.handleSubmit(async (data) => {
12195
+ await mutateAsync(
12196
+ {
12197
+ shipping_address: {
12198
+ first_name: data.first_name,
12199
+ last_name: data.last_name,
12200
+ company: data.company,
12201
+ address_1: data.address_1,
12202
+ address_2: data.address_2,
12203
+ city: data.city,
12204
+ province: data.province,
12205
+ country_code: data.country_code,
12206
+ postal_code: data.postal_code,
12207
+ phone: data.phone
12208
+ }
12209
+ },
12210
+ {
12211
+ onSuccess: () => {
12212
+ handleSuccess();
12213
+ },
12214
+ onError: (error) => {
12215
+ ui.toast.error(error.message);
12216
+ }
12217
+ }
12218
+ );
12219
+ });
12220
+ return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(
12221
+ KeyboundForm,
12222
+ {
12223
+ className: "flex flex-1 flex-col overflow-hidden",
12224
+ onSubmit,
12225
+ children: [
12226
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-y-4", children: [
12227
+ /* @__PURE__ */ jsxRuntime.jsx(
12228
+ Form$2.Field,
12229
+ {
12230
+ control: form.control,
12231
+ name: "country_code",
12232
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
12233
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Country" }),
12234
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(CountrySelect, { ...field }) }),
12235
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
12236
+ ] })
12237
+ }
12238
+ ),
12239
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
12240
+ /* @__PURE__ */ jsxRuntime.jsx(
12241
+ Form$2.Field,
12242
+ {
12243
+ control: form.control,
12244
+ name: "first_name",
12245
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
12246
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "First name" }),
12247
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
12248
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
12249
+ ] })
12250
+ }
12251
+ ),
12252
+ /* @__PURE__ */ jsxRuntime.jsx(
12253
+ Form$2.Field,
12254
+ {
12255
+ control: form.control,
12256
+ name: "last_name",
12257
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
12258
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Last name" }),
12259
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
12260
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
12261
+ ] })
12262
+ }
12263
+ )
12264
+ ] }),
12265
+ /* @__PURE__ */ jsxRuntime.jsx(
12266
+ Form$2.Field,
12317
12267
  {
12318
- content: tooltipContent,
12319
- showTooltip: !locationId || !shippingProfileId,
12320
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(
12321
- Combobox,
12322
- {
12323
- options: shippingOptions.options,
12324
- fetchNextPage: shippingOptions.fetchNextPage,
12325
- isFetchingNextPage: shippingOptions.isFetchingNextPage,
12326
- searchValue: shippingOptions.searchValue,
12327
- onSearchValueChange: shippingOptions.onSearchValueChange,
12328
- placeholder: "Select shipping option",
12329
- ...field,
12330
- disabled: !locationId || !shippingProfileId
12331
- }
12332
- ) }) })
12268
+ control: form.control,
12269
+ name: "company",
12270
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
12271
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Company" }),
12272
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
12273
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
12274
+ ] })
12333
12275
  }
12334
- )
12335
- ] }) });
12336
- }
12337
- }
12338
- );
12339
- };
12340
- const CustomAmountField = ({
12341
- control,
12342
- currencyCode
12343
- }) => {
12344
- return /* @__PURE__ */ jsxRuntime.jsx(
12345
- Form$2.Field,
12346
- {
12347
- control,
12348
- name: "custom_amount",
12349
- render: ({ field: { onChange, ...field } }) => {
12350
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-x-3", children: [
12351
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col", children: [
12352
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Custom amount" }),
12353
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Hint, { children: "Set a custom amount for the shipping option." })
12276
+ ),
12277
+ /* @__PURE__ */ jsxRuntime.jsx(
12278
+ Form$2.Field,
12279
+ {
12280
+ control: form.control,
12281
+ name: "address_1",
12282
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
12283
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Address" }),
12284
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
12285
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
12286
+ ] })
12287
+ }
12288
+ ),
12289
+ /* @__PURE__ */ jsxRuntime.jsx(
12290
+ Form$2.Field,
12291
+ {
12292
+ control: form.control,
12293
+ name: "address_2",
12294
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
12295
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Apartment, suite, etc." }),
12296
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
12297
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
12298
+ ] })
12299
+ }
12300
+ ),
12301
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
12302
+ /* @__PURE__ */ jsxRuntime.jsx(
12303
+ Form$2.Field,
12304
+ {
12305
+ control: form.control,
12306
+ name: "postal_code",
12307
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
12308
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Postal code" }),
12309
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
12310
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
12311
+ ] })
12312
+ }
12313
+ ),
12314
+ /* @__PURE__ */ jsxRuntime.jsx(
12315
+ Form$2.Field,
12316
+ {
12317
+ control: form.control,
12318
+ name: "city",
12319
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
12320
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "City" }),
12321
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
12322
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
12323
+ ] })
12324
+ }
12325
+ )
12354
12326
  ] }),
12355
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(
12356
- ui.CurrencyInput,
12327
+ /* @__PURE__ */ jsxRuntime.jsx(
12328
+ Form$2.Field,
12357
12329
  {
12358
- ...field,
12359
- onValueChange: (value) => onChange(value),
12360
- symbol: getNativeSymbol(currencyCode),
12361
- code: currencyCode
12330
+ control: form.control,
12331
+ name: "province",
12332
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
12333
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Province / State" }),
12334
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
12335
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
12336
+ ] })
12362
12337
  }
12363
- ) })
12364
- ] });
12365
- }
12338
+ ),
12339
+ /* @__PURE__ */ jsxRuntime.jsx(
12340
+ Form$2.Field,
12341
+ {
12342
+ control: form.control,
12343
+ name: "phone",
12344
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
12345
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Phone" }),
12346
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
12347
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
12348
+ ] })
12349
+ }
12350
+ )
12351
+ ] }) }),
12352
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
12353
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
12354
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
12355
+ ] }) })
12356
+ ]
12366
12357
  }
12367
- );
12358
+ ) });
12368
12359
  };
12360
+ const schema$3 = addressSchema;
12369
12361
  const TransferOwnership = () => {
12370
12362
  const { id } = reactRouterDom.useParams();
12371
12363
  const { draft_order, isPending, isError, error } = useDraftOrder(id, {
@@ -12389,7 +12381,7 @@ const TransferOwnershipForm = ({ order }) => {
12389
12381
  defaultValues: {
12390
12382
  customer_id: order.customer_id || ""
12391
12383
  },
12392
- resolver: zod.zodResolver(schema$1)
12384
+ resolver: zod.zodResolver(schema$2)
12393
12385
  });
12394
12386
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12395
12387
  const { handleSuccess } = useRouteModal();
@@ -12839,13 +12831,13 @@ const Illustration = () => {
12839
12831
  }
12840
12832
  );
12841
12833
  };
12842
- const schema$1 = objectType({
12834
+ const schema$2 = objectType({
12843
12835
  customer_id: stringType().min(1)
12844
12836
  });
12845
- const ShippingAddress = () => {
12837
+ const BillingAddress = () => {
12846
12838
  const { id } = reactRouterDom.useParams();
12847
12839
  const { order, isPending, isError, error } = useOrder(id, {
12848
- fields: "+shipping_address"
12840
+ fields: "+billing_address"
12849
12841
  });
12850
12842
  if (isError) {
12851
12843
  throw error;
@@ -12853,47 +12845,34 @@ const ShippingAddress = () => {
12853
12845
  const isReady = !isPending && !!order;
12854
12846
  return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
12855
12847
  /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer.Header, { children: [
12856
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Shipping Address" }) }),
12857
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit the shipping address for the draft order" }) })
12848
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Billing Address" }) }),
12849
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit the billing address for the draft order" }) })
12858
12850
  ] }),
12859
- isReady && /* @__PURE__ */ jsxRuntime.jsx(ShippingAddressForm, { order })
12851
+ isReady && /* @__PURE__ */ jsxRuntime.jsx(BillingAddressForm, { order })
12860
12852
  ] });
12861
12853
  };
12862
- const ShippingAddressForm = ({ order }) => {
12854
+ const BillingAddressForm = ({ order }) => {
12863
12855
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
12864
12856
  const form = reactHookForm.useForm({
12865
12857
  defaultValues: {
12866
- first_name: ((_a = order.shipping_address) == null ? void 0 : _a.first_name) ?? "",
12867
- last_name: ((_b = order.shipping_address) == null ? void 0 : _b.last_name) ?? "",
12868
- company: ((_c = order.shipping_address) == null ? void 0 : _c.company) ?? "",
12869
- address_1: ((_d = order.shipping_address) == null ? void 0 : _d.address_1) ?? "",
12870
- address_2: ((_e = order.shipping_address) == null ? void 0 : _e.address_2) ?? "",
12871
- city: ((_f = order.shipping_address) == null ? void 0 : _f.city) ?? "",
12872
- province: ((_g = order.shipping_address) == null ? void 0 : _g.province) ?? "",
12873
- country_code: ((_h = order.shipping_address) == null ? void 0 : _h.country_code) ?? "",
12874
- postal_code: ((_i = order.shipping_address) == null ? void 0 : _i.postal_code) ?? "",
12875
- phone: ((_j = order.shipping_address) == null ? void 0 : _j.phone) ?? ""
12858
+ first_name: ((_a = order.billing_address) == null ? void 0 : _a.first_name) ?? "",
12859
+ last_name: ((_b = order.billing_address) == null ? void 0 : _b.last_name) ?? "",
12860
+ company: ((_c = order.billing_address) == null ? void 0 : _c.company) ?? "",
12861
+ address_1: ((_d = order.billing_address) == null ? void 0 : _d.address_1) ?? "",
12862
+ address_2: ((_e = order.billing_address) == null ? void 0 : _e.address_2) ?? "",
12863
+ city: ((_f = order.billing_address) == null ? void 0 : _f.city) ?? "",
12864
+ province: ((_g = order.billing_address) == null ? void 0 : _g.province) ?? "",
12865
+ country_code: ((_h = order.billing_address) == null ? void 0 : _h.country_code) ?? "",
12866
+ postal_code: ((_i = order.billing_address) == null ? void 0 : _i.postal_code) ?? "",
12867
+ phone: ((_j = order.billing_address) == null ? void 0 : _j.phone) ?? ""
12876
12868
  },
12877
- resolver: zod.zodResolver(schema)
12869
+ resolver: zod.zodResolver(schema$1)
12878
12870
  });
12879
12871
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12880
12872
  const { handleSuccess } = useRouteModal();
12881
12873
  const onSubmit = form.handleSubmit(async (data) => {
12882
12874
  await mutateAsync(
12883
- {
12884
- shipping_address: {
12885
- first_name: data.first_name,
12886
- last_name: data.last_name,
12887
- company: data.company,
12888
- address_1: data.address_1,
12889
- address_2: data.address_2,
12890
- city: data.city,
12891
- province: data.province,
12892
- country_code: data.country_code,
12893
- postal_code: data.postal_code,
12894
- phone: data.phone
12895
- }
12896
- },
12875
+ { billing_address: data },
12897
12876
  {
12898
12877
  onSuccess: () => {
12899
12878
  handleSuccess();
@@ -13044,7 +13023,28 @@ const ShippingAddressForm = ({ order }) => {
13044
13023
  }
13045
13024
  ) });
13046
13025
  };
13047
- const schema = addressSchema;
13026
+ const schema$1 = addressSchema;
13027
+ const CustomItems = () => {
13028
+ return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
13029
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Custom Items" }) }) }),
13030
+ /* @__PURE__ */ jsxRuntime.jsx(CustomItemsForm, {})
13031
+ ] });
13032
+ };
13033
+ const CustomItemsForm = () => {
13034
+ const form = reactHookForm.useForm({
13035
+ resolver: zod.zodResolver(schema)
13036
+ });
13037
+ return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(KeyboundForm, { className: "flex flex-1 flex-col", children: [
13038
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, {}),
13039
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
13040
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
13041
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", children: "Save" })
13042
+ ] }) })
13043
+ ] }) });
13044
+ };
13045
+ const schema = objectType({
13046
+ email: stringType().email()
13047
+ });
13048
13048
  const widgetModule = { widgets: [] };
13049
13049
  const routeModule = {
13050
13050
  routes: [
@@ -13065,14 +13065,6 @@ const routeModule = {
13065
13065
  handle,
13066
13066
  loader,
13067
13067
  children: [
13068
- {
13069
- Component: BillingAddress,
13070
- path: "/draft-orders/:id/billing-address"
13071
- },
13072
- {
13073
- Component: CustomItems,
13074
- path: "/draft-orders/:id/custom-items"
13075
- },
13076
13068
  {
13077
13069
  Component: Email,
13078
13070
  path: "/draft-orders/:id/email"
@@ -13081,14 +13073,14 @@ const routeModule = {
13081
13073
  Component: Items,
13082
13074
  path: "/draft-orders/:id/items"
13083
13075
  },
13084
- {
13085
- Component: Promotions,
13086
- path: "/draft-orders/:id/promotions"
13087
- },
13088
13076
  {
13089
13077
  Component: Metadata,
13090
13078
  path: "/draft-orders/:id/metadata"
13091
13079
  },
13080
+ {
13081
+ Component: Promotions,
13082
+ path: "/draft-orders/:id/promotions"
13083
+ },
13092
13084
  {
13093
13085
  Component: SalesChannel,
13094
13086
  path: "/draft-orders/:id/sales-channel"
@@ -13097,13 +13089,21 @@ const routeModule = {
13097
13089
  Component: Shipping,
13098
13090
  path: "/draft-orders/:id/shipping"
13099
13091
  },
13092
+ {
13093
+ Component: ShippingAddress,
13094
+ path: "/draft-orders/:id/shipping-address"
13095
+ },
13100
13096
  {
13101
13097
  Component: TransferOwnership,
13102
13098
  path: "/draft-orders/:id/transfer-ownership"
13103
13099
  },
13104
13100
  {
13105
- Component: ShippingAddress,
13106
- path: "/draft-orders/:id/shipping-address"
13101
+ Component: BillingAddress,
13102
+ path: "/draft-orders/:id/billing-address"
13103
+ },
13104
+ {
13105
+ Component: CustomItems,
13106
+ path: "/draft-orders/:id/custom-items"
13107
13107
  }
13108
13108
  ]
13109
13109
  }