@mercurjs/vendor 2.2.1 → 2.3.0-canary.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/dist/[id]-3TCOLUQH.js +197 -0
  2. package/dist/{[id]-YB3DBBXT.js → [id]-4QVLDR3S.js} +13 -10
  3. package/dist/{[id]-RJRAZN3T.js → [id]-4VX7CTRZ.js} +8 -6
  4. package/dist/{[id]-OE5TUWNF.js → [id]-5FP6JZM3.js} +9 -7
  5. package/dist/[id]-6FEVCKQU.js +949 -0
  6. package/dist/{[id]-47SUX5X3.js → [id]-7QVJAIDU.js} +13 -10
  7. package/dist/{[id]-BHU5BSQT.js → [id]-CFVBH66J.js} +20 -17
  8. package/dist/{[id]-SKU5SFBG.js → [id]-HAJ3735Z.js} +137 -204
  9. package/dist/{[id]-NGRV5I2A.js → [id]-PBNGQSNY.js} +9 -7
  10. package/dist/[id]-QGZ26C6D.js +286 -0
  11. package/dist/{[id]-ZD5HBP2R.js → [id]-RAJUZUNH.js} +13 -10
  12. package/dist/[id]-RJ3MUR4M.js +697 -0
  13. package/dist/{[id]-PIB2DEVI.js → [id]-RRVYKA7U.js} +12 -9
  14. package/dist/{[id]-BPQNQFVE.js → [id]-Y4HRAAV2.js} +75 -124
  15. package/dist/{[province_id]-CUWKNPBW.js → [province_id]-VWN4OOGM.js} +9 -7
  16. package/dist/{add-MYV5IOGP.js → add-57LM6WKL.js} +157 -227
  17. package/dist/{add-YEUSE5QA.js → add-7HIVF77P.js} +10 -8
  18. package/dist/{add-customer-groups-Q3F357F2.js → add-customer-groups-VJYI5J5Z.js} +8 -6
  19. package/dist/{add-products-WVNYODC6.js → add-products-XWU5ZUTZ.js} +13 -10
  20. package/dist/{add-promotions-F62YE3BE.js → add-promotions-DOJS6CEE.js} +27 -9
  21. package/dist/{add-to-campaign-WBSCTSKW.js → add-to-campaign-B3PGGNFA.js} +3 -2
  22. package/dist/{address-ZMZ4ST5T.js → address-X4TXBPUG.js} +7 -5
  23. package/dist/{adjust-inventory-QUGKDXOC.js → adjust-inventory-2OKDFVLK.js} +2 -3
  24. package/dist/{allocate-items-7NSBGXSF.js → allocate-items-QAYROQMK.js} +4 -2
  25. package/dist/{areas-EJCZBY2E.js → areas-WQ44GWQO.js} +2 -2
  26. package/dist/{breadcrumb-M657ZCG6.js → breadcrumb-4I7MU2QY.js} +1 -1
  27. package/dist/{breadcrumb-KNBZ3JNR.js → breadcrumb-7ZFC43R4.js} +1 -1
  28. package/dist/{breadcrumb-C7M5PG2Q.js → breadcrumb-HMW2K4DW.js} +7 -5
  29. package/dist/{breadcrumb-KLNC72RI.js → breadcrumb-MH2L34OD.js} +2 -2
  30. package/dist/{breadcrumb-QPV566YX.js → breadcrumb-Q7FS3IDL.js} +8 -6
  31. package/dist/{breadcrumb-JWFTKHLE.js → breadcrumb-RQ52GELM.js} +2 -1
  32. package/dist/{breadcrumb-M6NW3DRQ.js → breadcrumb-WBUUK3AP.js} +1 -1
  33. package/dist/breadcrumb-XCPUUZUO.js +26 -0
  34. package/dist/{breadcrumb-MXYWEBK6.js → breadcrumb-Z2QUGZM3.js} +7 -5
  35. package/dist/{campaigns-BPLAE6QQ.js → campaigns-LIPKZKI7.js} +5 -4
  36. package/dist/{categories-H2XAJCGC.js → categories-D2U6VLH5.js} +2 -2
  37. package/dist/{chunk-4RVWITM2.js → chunk-3JWHERV7.js} +76 -23
  38. package/dist/{chunk-BCXREBMV.js → chunk-4ATO577Q.js} +1 -1
  39. package/dist/{chunk-VHFKJLDH.js → chunk-4JVORTN4.js} +1 -1
  40. package/dist/{chunk-HHD2VUED.js → chunk-4UKAKFKL.js} +1 -1
  41. package/dist/{chunk-3L7WHWKB.js → chunk-5DRYAIOY.js} +3 -3
  42. package/dist/{chunk-7TIZP4YG.js → chunk-5RWK4U4V.js} +26 -0
  43. package/dist/{chunk-XQUF3WIS.js → chunk-5ZHZVKNQ.js} +4 -0
  44. package/dist/{chunk-IWAL74YU.js → chunk-6GQLSWOO.js} +1 -1
  45. package/dist/{chunk-HCUIYIIY.js → chunk-6OZQTHCR.js} +1 -1
  46. package/dist/chunk-6XMUN2BZ.js +0 -0
  47. package/dist/{chunk-RLRWDHME.js → chunk-6YQR2AWM.js} +3 -20
  48. package/dist/{chunk-26OOAKQ6.js → chunk-7H6NMQ6U.js} +8 -1
  49. package/dist/{chunk-OKJHUQBY.js → chunk-7JVJIAWS.js} +17 -29
  50. package/dist/chunk-7LIENHWP.js +26 -0
  51. package/dist/{chunk-EPSRO7C5.js → chunk-7LIT4GXO.js} +2 -2
  52. package/dist/chunk-7POOMBIN.js +108 -0
  53. package/dist/{chunk-PF7R7LMW.js → chunk-AHR2FIMC.js} +22 -0
  54. package/dist/{chunk-EJBOBB4B.js → chunk-AQT2G6K2.js} +46 -46
  55. package/dist/{chunk-UEKRQS5Q.js → chunk-ATYOOL7K.js} +2 -2
  56. package/dist/chunk-BR6PEFXX.js +27 -0
  57. package/dist/{chunk-SDFZUBS3.js → chunk-CDZALZ5E.js} +1 -1
  58. package/dist/{chunk-3XW55FZY.js → chunk-CRVVPIFZ.js} +6 -6
  59. package/dist/{chunk-72HQFLZI.js → chunk-CSEB2RNO.js} +1 -1
  60. package/dist/{chunk-X6ZQMFCT.js → chunk-DAOSTHVB.js} +44 -25
  61. package/dist/{chunk-UUBGLS7U.js → chunk-EWJTXSKI.js} +211 -36
  62. package/dist/chunk-FKKI62AC.js +282 -0
  63. package/dist/{chunk-VBKW4GWP.js → chunk-FPBXQIFJ.js} +1 -1
  64. package/dist/{chunk-SI55QRZ4.js → chunk-G5NNOOHR.js} +59 -6
  65. package/dist/chunk-G6J5ZKM3.js +31 -0
  66. package/dist/{chunk-U5V6HNVW.js → chunk-GL3XVUAY.js} +1 -1
  67. package/dist/{chunk-RJE4MAYB.js → chunk-GYLRZXWS.js} +1 -1
  68. package/dist/{chunk-SVYBMLVN.js → chunk-HHCLMWXT.js} +1 -1
  69. package/dist/{chunk-YUQA6TUA.js → chunk-JOCO7JOB.js} +3 -3
  70. package/dist/{chunk-OGUTFP6B.js → chunk-JYUHDM23.js} +13 -51
  71. package/dist/{chunk-QB7BI4B7.js → chunk-K2DXXPNA.js} +153 -86
  72. package/dist/{chunk-XG76XXM2.js → chunk-KKMA6VPG.js} +1 -1
  73. package/dist/chunk-KVAD5JGS.js +11 -0
  74. package/dist/{chunk-YRZ53SAN.js → chunk-L26J5MO2.js} +2 -2
  75. package/dist/{chunk-63XYNXUL.js → chunk-LYP7XK5O.js} +1 -1
  76. package/dist/chunk-MVVFD2JT.js +51 -0
  77. package/dist/{chunk-RVFPWOR2.js → chunk-MY5H7C3A.js} +2 -2
  78. package/dist/{chunk-3GSR455R.js → chunk-NQMHP2LC.js} +1 -1
  79. package/dist/{chunk-2S2WK2OG.js → chunk-NV2RZAHW.js} +1 -10
  80. package/dist/{chunk-4IIATKG7.js → chunk-O7OWHKWA.js} +6 -6
  81. package/dist/{chunk-GIKVFOQL.js → chunk-OJCMHDZI.js} +2 -2
  82. package/dist/chunk-QLOJNFUE.js +53 -0
  83. package/dist/{chunk-GTNCNKTC.js → chunk-RBWIHKUF.js} +1 -1
  84. package/dist/{chunk-XVBONKRV.js → chunk-RCMKDW6O.js} +1 -1
  85. package/dist/{chunk-WJF24CGA.js → chunk-RDLVH6CM.js} +33 -5
  86. package/dist/chunk-SF5N2HX4.js +268 -0
  87. package/dist/{chunk-MQR26KYT.js → chunk-SYHA2RVL.js} +1 -1
  88. package/dist/{chunk-ZXDMPIXN.js → chunk-U3OEGBHH.js} +2 -2
  89. package/dist/chunk-UTGI6R2X.js +334 -0
  90. package/dist/{chunk-VBRTC2VU.js → chunk-VAFGNDAP.js} +4 -3
  91. package/dist/{chunk-4UQMRTSC.js → chunk-VH3TGSWE.js} +46 -2
  92. package/dist/{chunk-ZEKV7LGF.js → chunk-VV2K3EBF.js} +1 -1
  93. package/dist/{chunk-S2VYK3YC.js → chunk-WI2ZAFZF.js} +1 -1
  94. package/dist/chunk-WP3B4NEU.js +32 -0
  95. package/dist/{chunk-DY3XQPHC.js → chunk-WW2XYOHJ.js} +5 -3
  96. package/dist/{chunk-IVYIMGQC.js → chunk-X44P463Q.js} +45 -10
  97. package/dist/{chunk-FEVCBT24.js → chunk-X4G64W5Q.js} +2 -2
  98. package/dist/{chunk-R5KN6IFB.js → chunk-XHWBTV72.js} +2 -2
  99. package/dist/{chunk-OVHIUZ3K.js → chunk-XQ47NZJC.js} +1 -1
  100. package/dist/{chunk-LN7XHEPJ.js → chunk-YT4RAUWM.js} +2 -2
  101. package/dist/{chunk-6VKJM537.js → chunk-ZK4DIDXG.js} +1 -1
  102. package/dist/{collections-52DJLHWW.js → collections-5TH7H2QP.js} +14 -13
  103. package/dist/{configuration-UMRBE5RQ.js → configuration-QK2FW2CV.js} +2 -2
  104. package/dist/{configuration-QEDVL2WF.js → configuration-RYH3VUBV.js} +15 -48
  105. package/dist/{create-ALUKAFJS.js → create-5M66YUYY.js} +2 -2
  106. package/dist/{create-ABRPUMHQ.js → create-A6KZEZMH.js} +7 -6
  107. package/dist/{create-LYNWCP2N.js → create-BTODQ4T4.js} +6 -5
  108. package/dist/{create-2I3GAX4C.js → create-FI6H4AJE.js} +16 -7
  109. package/dist/{create-6IRD2CVC.js → create-GF76Z5I7.js} +15 -13
  110. package/dist/create-ICCAEOSA.js +343 -0
  111. package/dist/{create-NTZH45DW.js → create-JZLU44WB.js} +14 -12
  112. package/dist/{create-GEYXN6SW.js → create-ME43PNL6.js} +7 -5
  113. package/dist/{create-MFGMTZ5A.js → create-MIYJCLAJ.js} +8 -6
  114. package/dist/{create-7SJ5DSQK.js → create-PRDQJ5WI.js} +20 -17
  115. package/dist/{create-S7VYYTUD.js → create-Q6B6JR4K.js} +10 -8
  116. package/dist/{create-5RQ32XPT.js → create-SKQAJNDF.js} +287 -287
  117. package/dist/{create-7FT7N2NH.js → create-WPN3OUJU.js} +3 -2
  118. package/dist/{create-H77ZUZG5.js → create-XBGN6XEF.js} +10 -8
  119. package/dist/{create-G76MVCJU.js → create-ZVGYET6W.js} +5 -4
  120. package/dist/customer-availability-VAOKKCTK.js +164 -0
  121. package/dist/{customer-group-add-customers-T7OYWJCB.js → customer-group-add-customers-BSMUKWVO.js} +1 -1
  122. package/dist/{customer-group-detail-E7HRZ3LE.js → customer-group-detail-QCPC2YWK.js} +2 -2
  123. package/dist/{customer-groups-26HJ55MF.js → customer-groups-6WGUNFHG.js} +2 -2
  124. package/dist/{customers-EXFRZX5F.js → customers-7OGYQSGA.js} +2 -2
  125. package/dist/edit-2BKYNGYL.js +262 -0
  126. package/dist/{edit-WHGYNDEB.js → edit-3S3EH372.js} +20 -17
  127. package/dist/{edit-MPOTIGUY.js → edit-4WP5SGH6.js} +23 -39
  128. package/dist/{edit-QBUYHSE7.js → edit-7D2OZBJS.js} +8 -6
  129. package/dist/{edit-2RN3OT27.js → edit-7T2JMZG3.js} +7 -56
  130. package/dist/edit-AK4E63X6.js +179 -0
  131. package/dist/{edit-NB5VN2E4.js → edit-DRT6VOAA.js} +5 -4
  132. package/dist/{edit-EGBVEWXS.js → edit-GBDHDJK4.js} +9 -7
  133. package/dist/{edit-TIBQEQVV.js → edit-P7FNRVGB.js} +10 -8
  134. package/dist/{edit-6VJWRZHQ.js → edit-PZN7UAJI.js} +7 -5
  135. package/dist/{edit-M4AP65HO.js → edit-RNSXXJVU.js} +8 -6
  136. package/dist/edit-SKRFQ4WN.js +81 -0
  137. package/dist/{edit-H5FJ45ZT.js → edit-ZM7NJVRE.js} +1 -1
  138. package/dist/{edit-budget-PYPHUJPW.js → edit-budget-MOZETGZV.js} +1 -1
  139. package/dist/{edit-inventory-item-BCVECCLT.js → edit-inventory-item-HFGHS732.js} +17 -14
  140. package/dist/{edit-inventory-item-attributes-GWEMP67O.js → edit-inventory-item-attributes-5ORZJF4I.js} +18 -1
  141. package/dist/{edit-price-GLAEAO7R.js → edit-price-KY7LX5QA.js} +2 -2
  142. package/dist/edit-reservation-LSYQUDYQ.js +294 -0
  143. package/dist/{edit-stock-E3PM2YOP.js → edit-stock-77VKJR4Z.js} +2 -2
  144. package/dist/extension-targets.d.ts +6 -3
  145. package/dist/{fulfillment-HDU7GATG.js → fulfillment-DEGKZL42.js} +7 -5
  146. package/dist/{fulfillment-providers-6RZNNT7U.js → fulfillment-providers-LDFPZGNX.js} +12 -11
  147. package/dist/index.css +17 -14
  148. package/dist/index.js +265 -155
  149. package/dist/{inventory-XJ2E6DPC.js → inventory-CMIRAJJY.js} +2 -2
  150. package/dist/{inventory-CKA34HWM.js → inventory-RKAUTQAU.js} +2 -2
  151. package/dist/{invite-755AJC3M.js → invite-KAHF2MCE.js} +7 -5
  152. package/dist/{invite-FD2TXZTW.js → invite-S5O7LFEY.js} +10 -8
  153. package/dist/{loader-UUSAVCK6.js → loader-3BXYSKPT.js} +1 -1
  154. package/dist/{loader-B4T2VBGV.js → loader-CF54CDM6.js} +2 -2
  155. package/dist/{login-UGKYRKMD.js → login-CRSALS6Y.js} +9 -7
  156. package/dist/manage-items-63FPRK7Z.js +302 -0
  157. package/dist/{manage-locations-PRQI5TI4.js → manage-locations-5B4HP6NQ.js} +24 -5
  158. package/dist/{media-TGFAHFBV.js → media-74PEXOLV.js} +8 -6
  159. package/dist/{media-2KEHXPRU.js → media-NKCXFG6X.js} +11 -9
  160. package/dist/{metadata-7JWZ4VFM.js → metadata-22BCBKVE.js} +7 -5
  161. package/dist/{metadata-BQQFHVKF.js → metadata-E3BDAMIO.js} +7 -5
  162. package/dist/{metadata-5TVRCKWX.js → metadata-FRXIY35J.js} +7 -5
  163. package/dist/{metadata-4ZZ4ZIWJ.js → metadata-L6IA2Z26.js} +7 -5
  164. package/dist/metadata-WN6Y35RV.js +69 -0
  165. package/dist/{metadata-G73TILNE.js → metadata-ZZMJNWS3.js} +7 -5
  166. package/dist/{offer-create-page-PPXRYET4.js → offer-create-page-N5CKYGSS.js} +12 -9
  167. package/dist/{offer-detail-page-BFGKAS4L.js → offer-detail-page-AJG6TMJC.js} +3 -3
  168. package/dist/{offer-variant-detail-page-BLHRF4MK.js → offer-variant-detail-page-CEOS2MVM.js} +40 -8
  169. package/dist/{offers-7I67VSHI.js → offers-WFJ6UGVG.js} +15 -11
  170. package/dist/{onboarding-7MURQYXX.js → onboarding-2AZ2KEWJ.js} +7 -5
  171. package/dist/{orders-D7NZNDUS.js → orders-NWYLN6BE.js} +13 -12
  172. package/dist/{organization-T6ZTYMMW.js → organization-PAWIWKHV.js} +9 -7
  173. package/dist/pages/index.d.ts +9 -1
  174. package/dist/pages/index.js +57 -48
  175. package/dist/{payment-details-UQ65D5AY.js → payment-details-O57HNHWS.js} +7 -5
  176. package/dist/{payouts-A336D2HG.js → payouts-26ZOYDRP.js} +2 -2
  177. package/dist/{price-lists-3WRT4TR2.js → price-lists-U5ASDHMI.js} +5 -8
  178. package/dist/{pricing-3NLEJYRP.js → pricing-C425JTFQ.js} +2 -2
  179. package/dist/{pricing-CPPIL627.js → pricing-PDOCJEDS.js} +9 -7
  180. package/dist/{product-tags-7DTA73YT.js → product-tags-MMQ4ZR4W.js} +20 -17
  181. package/dist/{product-types-OB26NF2D.js → product-types-CMI33S32.js} +3 -4
  182. package/dist/{product-variant-detail-4DDE6RJ5.js → product-variant-detail-D73ILATK.js} +7 -5
  183. package/dist/{product-variant-edit-SAZUI4E3.js → product-variant-edit-XN6WGKI2.js} +10 -8
  184. package/dist/{products-RYXTZFGT.js → products-OZJHGW2K.js} +19 -16
  185. package/dist/{products-GJ2KTGBZ.js → products-VWH5TAFY.js} +13 -10
  186. package/dist/{professional-details-UN5B4YDJ.js → professional-details-ZJT6YKZB.js} +7 -5
  187. package/dist/{profile-6MIDTK52.js → profile-EU46MXFW.js} +7 -5
  188. package/dist/{promotions-SQ47TCZL.js → promotions-ALWQ7J7A.js} +5 -5
  189. package/dist/{receive-ZG6FFN7H.js → receive-RRZK3FP2.js} +4 -3
  190. package/dist/{refund-KJX74N6T.js → refund-FLCZAMPR.js} +3 -2
  191. package/dist/{register-RDSK4E4D.js → register-C6ON6OL2.js} +9 -7
  192. package/dist/reservations-C326XEVA.js +350 -0
  193. package/dist/{reset-password-C462PDN2.js → reset-password-ASLKY3GK.js} +1 -1
  194. package/dist/respond-IPRDCH57.js +132 -0
  195. package/dist/{return-reasons-MY63HNF6.js → return-reasons-2BUKIQBO.js} +9 -7
  196. package/dist/reviews-LBLCFBRQ.js +14 -0
  197. package/dist/{settings-TJ6HPHMK.js → settings-Q5GAL2LK.js} +28 -25
  198. package/dist/{shipment-6CTA2GHU.js → shipment-XOU6F7AS.js} +7 -5
  199. package/dist/{shipping-TKKMYQHJ.js → shipping-IMCP7UDV.js} +2 -2
  200. package/dist/{shipping-profile-CFISOMTE.js → shipping-profile-7P3RPEIJ.js} +1 -1
  201. package/dist/{shipping-profiles-5UAZNYKJ.js → shipping-profiles-647FLCNK.js} +9 -7
  202. package/dist/{stock-465GEUY3.js → stock-D3HCV5UR.js} +22 -8
  203. package/dist/{store-2PQB2XWE.js → store-XBNFP6O4.js} +8 -6
  204. package/dist/{store-closure-DYW54VHB.js → store-closure-55EUSKE4.js} +7 -5
  205. package/dist/{store-select-6A5YR7WH.js → store-select-DEOEGT2O.js} +8 -6
  206. package/dist/{team-GXEBC57M.js → team-7MJ3NJUT.js} +10 -8
  207. package/package.json +12 -9
  208. package/dist/[id]-HEVGSOAV.js +0 -598
  209. package/dist/[id]-MU7A6SZO.js +0 -526
  210. package/dist/chunk-2ZFELO2L.js +0 -13
  211. package/dist/chunk-6IJMSVC6.js +0 -16
  212. package/dist/chunk-BNOKKKUU.js +0 -88
  213. package/dist/chunk-BX3JE7IE.js +0 -247
  214. package/dist/edit-4B364HGZ.js +0 -222
  215. package/dist/edit-735HBYH2.js +0 -103
  216. package/dist/edit-SQU5UOGE.js +0 -105
  217. package/dist/{chunk-CYE7HVAV.js → chunk-SCJBJQCL.js} +3 -3
@@ -1,32 +1,35 @@
1
1
  import {
2
- PriceListCreateProductsSchema,
2
+ PriceListCustomerAvailabilitySelector
3
+ } from "./chunk-FKKI62AC.js";
4
+ import {
5
+ PriceListCreateOffersSchema,
3
6
  PriceListRulesSchema,
4
7
  usePriceListCurrencyData,
5
8
  usePriceListGridColumns
6
- } from "./chunk-X6ZQMFCT.js";
7
- import {
8
- exctractPricesFromProducts,
9
- isProductRow
10
- } from "./chunk-BNOKKKUU.js";
11
- import "./chunk-6IJMSVC6.js";
9
+ } from "./chunk-DAOSTHVB.js";
12
10
  import {
13
- useProductTableColumns
14
- } from "./chunk-3GSR455R.js";
15
- import "./chunk-S2VYK3YC.js";
11
+ extractPricesFromOffers
12
+ } from "./chunk-KVAD5JGS.js";
16
13
  import {
17
- useProductTableQuery
18
- } from "./chunk-BEPAXQMU.js";
14
+ collectOfferIds,
15
+ useOfferTableColumns,
16
+ useOfferTableFilters,
17
+ useOfferTableQuery
18
+ } from "./chunk-7JVJIAWS.js";
19
+ import "./chunk-5ZHZVKNQ.js";
20
+ import "./chunk-VKOE5J66.js";
21
+ import "./chunk-JHIMVLB2.js";
22
+ import "./chunk-CMHI2RPL.js";
23
+ import "./chunk-6XMUN2BZ.js";
24
+ import "./chunk-WI2ZAFZF.js";
19
25
  import "./chunk-FWPGOIFA.js";
20
- import {
21
- useProductTableFilters
22
- } from "./chunk-ZXDMPIXN.js";
26
+ import "./chunk-U3OEGBHH.js";
23
27
  import "./chunk-DB6ANJBO.js";
24
28
  import "./chunk-PHOCVOZ5.js";
25
29
  import {
26
30
  DataGrid
27
31
  } from "./chunk-5FBQOAXU.js";
28
32
  import "./chunk-IQPN4PZJ.js";
29
- import "./chunk-SMQT3ZNO.js";
30
33
  import "./chunk-TKGWSUEI.js";
31
34
  import {
32
35
  KeyboundForm
@@ -42,27 +45,29 @@ import "./chunk-FQERBIVS.js";
42
45
  import {
43
46
  _DataTable,
44
47
  useDataTable
45
- } from "./chunk-IWAL74YU.js";
48
+ } from "./chunk-6GQLSWOO.js";
46
49
  import "./chunk-YN3FGNJM.js";
47
50
  import "./chunk-KCHYLLVG.js";
48
51
  import "./chunk-3EF54XFY.js";
49
52
  import "./chunk-THHRRYRS.js";
50
53
  import "./chunk-LRD242C7.js";
51
- import "./chunk-4UQMRTSC.js";
54
+ import "./chunk-VH3TGSWE.js";
52
55
  import "./chunk-WIYFXWRI.js";
53
56
  import "./chunk-INNFZYX2.js";
57
+ import "./chunk-BDGZ4EQO.js";
54
58
  import "./chunk-LAVHRER2.js";
55
59
  import "./chunk-QHQWEERJ.js";
56
60
  import "./chunk-Y7QKP6QU.js";
57
- import "./chunk-RLRWDHME.js";
61
+ import "./chunk-6YQR2AWM.js";
58
62
  import "./chunk-K5324KIX.js";
59
63
  import "./chunk-FV76G2D7.js";
60
64
  import "./chunk-GHDLST2P.js";
61
65
  import "./chunk-YVYYOBAE.js";
62
66
  import "./chunk-L2NJPDUD.js";
67
+ import "./chunk-7LIENHWP.js";
63
68
  import {
64
69
  useCreatePriceList
65
- } from "./chunk-2S2WK2OG.js";
70
+ } from "./chunk-NV2RZAHW.js";
66
71
  import "./chunk-MR6REQKT.js";
67
72
  import "./chunk-EPSDO2MJ.js";
68
73
  import "./chunk-BHEU34FL.js";
@@ -73,9 +78,12 @@ import "./chunk-J2XUEO2E.js";
73
78
  import "./chunk-DETQ6IBQ.js";
74
79
  import "./chunk-VWPNMEOE.js";
75
80
  import "./chunk-O72AIZUN.js";
76
- import "./chunk-U5V6HNVW.js";
77
- import "./chunk-PF7R7LMW.js";
78
- import "./chunk-OGUTFP6B.js";
81
+ import "./chunk-GL3XVUAY.js";
82
+ import {
83
+ useOffers
84
+ } from "./chunk-AHR2FIMC.js";
85
+ import "./chunk-JYUHDM23.js";
86
+ import "./chunk-7POOMBIN.js";
79
87
  import "./chunk-4U2BLH45.js";
80
88
  import {
81
89
  useProducts
@@ -103,20 +111,13 @@ import {
103
111
  Heading,
104
112
  Input,
105
113
  RadioGroup,
106
- Select,
107
114
  Text,
108
115
  Textarea
109
116
  } from "@medusajs/ui";
110
- import { useFieldArray } from "react-hook-form";
111
117
  import { useTranslation } from "react-i18next";
112
118
  import { jsx, jsxs } from "react/jsx-runtime";
113
119
  var PriceListDetailsForm = ({ form }) => {
114
120
  const { t } = useTranslation();
115
- const { remove: _remove } = useFieldArray({
116
- control: form.control,
117
- name: "rules.customer_group_id",
118
- keyName: "cg_id"
119
- });
120
121
  return /* @__PURE__ */ jsx("div", { className: "flex flex-1 flex-col items-center overflow-y-auto", children: /* @__PURE__ */ jsxs("div", { className: "flex w-full max-w-[720px] flex-col gap-y-8 px-8 py-16", children: [
121
122
  /* @__PURE__ */ jsxs("div", { children: [
122
123
  /* @__PURE__ */ jsx(Heading, { children: t("priceLists.create.header") }),
@@ -128,227 +129,246 @@ var PriceListDetailsForm = ({ form }) => {
128
129
  control: form.control,
129
130
  name: "type",
130
131
  render: ({ field: { onChange, ...rest } }) => {
131
- return /* @__PURE__ */ jsxs(Form.Item, { children: [
132
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-4", children: [
133
- /* @__PURE__ */ jsxs("div", { children: [
134
- /* @__PURE__ */ jsx(Form.Label, { children: t("priceLists.fields.type.label") }),
135
- /* @__PURE__ */ jsx(Form.Hint, { children: t("priceLists.fields.type.hint") })
136
- ] }),
137
- /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsxs(
138
- RadioGroup,
139
- {
140
- onValueChange: onChange,
141
- ...rest,
142
- className: "grid grid-cols-1 gap-4 md:grid-cols-2",
143
- children: [
144
- /* @__PURE__ */ jsx(
145
- RadioGroup.ChoiceBox,
146
- {
147
- value: "sale",
148
- label: t("priceLists.fields.type.options.sale.label"),
149
- description: t(
150
- "priceLists.fields.type.options.sale.description"
151
- )
152
- }
153
- ),
154
- /* @__PURE__ */ jsx(
155
- RadioGroup.ChoiceBox,
156
- {
157
- value: "override",
158
- label: t(
159
- "priceLists.fields.type.options.override.label"
160
- ),
161
- description: t(
162
- "priceLists.fields.type.options.override.description"
163
- )
164
- }
165
- )
166
- ]
167
- }
168
- ) })
132
+ return /* @__PURE__ */ jsx(Form.Item, { children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-4", children: [
133
+ /* @__PURE__ */ jsxs("div", { children: [
134
+ /* @__PURE__ */ jsx(Form.Label, { children: t("priceLists.fields.type.label") }),
135
+ /* @__PURE__ */ jsx(Form.Hint, { children: t("priceLists.fields.type.hint") })
169
136
  ] }),
137
+ /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsxs(
138
+ RadioGroup,
139
+ {
140
+ onValueChange: onChange,
141
+ ...rest,
142
+ className: "grid grid-cols-1 gap-4 md:grid-cols-2",
143
+ children: [
144
+ /* @__PURE__ */ jsx(
145
+ RadioGroup.ChoiceBox,
146
+ {
147
+ value: "sale",
148
+ label: t("priceLists.fields.type.options.sale.label"),
149
+ description: t(
150
+ "priceLists.fields.type.options.sale.description"
151
+ )
152
+ }
153
+ ),
154
+ /* @__PURE__ */ jsx(
155
+ RadioGroup.ChoiceBox,
156
+ {
157
+ value: "override",
158
+ label: t(
159
+ "priceLists.fields.type.options.override.label"
160
+ ),
161
+ description: t(
162
+ "priceLists.fields.type.options.override.description"
163
+ )
164
+ }
165
+ )
166
+ ]
167
+ }
168
+ ) }),
170
169
  /* @__PURE__ */ jsx(Form.ErrorMessage, {})
171
- ] });
170
+ ] }) });
172
171
  }
173
172
  }
174
173
  ),
175
174
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-4", children: [
176
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
177
- /* @__PURE__ */ jsx(
178
- Form.Field,
179
- {
180
- control: form.control,
181
- name: "title",
182
- render: ({ field }) => {
183
- return /* @__PURE__ */ jsxs(Form.Item, { children: [
184
- /* @__PURE__ */ jsx(Form.Label, { children: t("fields.title") }),
185
- /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
186
- /* @__PURE__ */ jsx(Form.ErrorMessage, {})
187
- ] });
188
- }
189
- }
190
- ),
191
- /* @__PURE__ */ jsx(
192
- Form.Field,
193
- {
194
- control: form.control,
195
- name: "status",
196
- render: ({ field: { onChange, ref, ...field } }) => {
197
- return /* @__PURE__ */ jsxs(Form.Item, { children: [
198
- /* @__PURE__ */ jsx(Form.Label, { children: t("priceLists.fields.status.label") }),
199
- /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsxs(Select, { ...field, onValueChange: onChange, children: [
200
- /* @__PURE__ */ jsx(Select.Trigger, { ref, children: /* @__PURE__ */ jsx(Select.Value, {}) }),
201
- /* @__PURE__ */ jsxs(Select.Content, { children: [
202
- /* @__PURE__ */ jsx(Select.Item, { value: "active", children: t("priceLists.fields.status.options.active") }),
203
- /* @__PURE__ */ jsx(Select.Item, { value: "draft", children: t("priceLists.fields.status.options.draft") })
204
- ] })
205
- ] }) }),
206
- /* @__PURE__ */ jsx(Form.ErrorMessage, {})
207
- ] });
208
- }
209
- }
210
- )
211
- ] }),
175
+ /* @__PURE__ */ jsx(
176
+ Form.Field,
177
+ {
178
+ control: form.control,
179
+ name: "status",
180
+ render: ({ field: { onChange, ...rest } }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
181
+ /* @__PURE__ */ jsx(Form.Label, { children: t("priceLists.fields.status.label") }),
182
+ /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsxs(
183
+ RadioGroup,
184
+ {
185
+ onValueChange: onChange,
186
+ ...rest,
187
+ className: "grid grid-cols-1 gap-4 md:grid-cols-2",
188
+ children: [
189
+ /* @__PURE__ */ jsx(
190
+ RadioGroup.ChoiceBox,
191
+ {
192
+ value: "draft",
193
+ label: t("priceLists.fields.status.options.draft"),
194
+ description: t(
195
+ "priceLists.fields.status.descriptions.draft"
196
+ )
197
+ }
198
+ ),
199
+ /* @__PURE__ */ jsx(
200
+ RadioGroup.ChoiceBox,
201
+ {
202
+ value: "active",
203
+ label: t("priceLists.fields.status.options.active"),
204
+ description: t(
205
+ "priceLists.fields.status.descriptions.active"
206
+ )
207
+ }
208
+ )
209
+ ]
210
+ }
211
+ ) }),
212
+ /* @__PURE__ */ jsx(Form.ErrorMessage, {})
213
+ ] })
214
+ }
215
+ ),
216
+ /* @__PURE__ */ jsx(
217
+ Form.Field,
218
+ {
219
+ control: form.control,
220
+ name: "title",
221
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
222
+ /* @__PURE__ */ jsx(Form.Label, { children: t("fields.title") }),
223
+ /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
224
+ /* @__PURE__ */ jsx(Form.ErrorMessage, {})
225
+ ] })
226
+ }
227
+ ),
212
228
  /* @__PURE__ */ jsx(
213
229
  Form.Field,
214
230
  {
215
231
  control: form.control,
216
232
  name: "description",
217
- render: ({ field }) => {
218
- return /* @__PURE__ */ jsxs(Form.Item, { children: [
219
- /* @__PURE__ */ jsx(Form.Label, { children: t("fields.description") }),
220
- /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Textarea, { ...field }) }),
221
- /* @__PURE__ */ jsx(Form.ErrorMessage, {})
222
- ] });
223
- }
233
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
234
+ /* @__PURE__ */ jsx(Form.Label, { children: t("fields.description") }),
235
+ /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Textarea, { ...field }) }),
236
+ /* @__PURE__ */ jsx(Form.ErrorMessage, {})
237
+ ] })
224
238
  }
225
239
  )
226
240
  ] }),
227
241
  /* @__PURE__ */ jsx(Divider, {}),
228
- /* @__PURE__ */ jsx(
229
- Form.Field,
230
- {
231
- control: form.control,
232
- name: "starts_at",
233
- render: ({ field }) => {
234
- return /* @__PURE__ */ jsxs(Form.Item, { children: [
235
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-3 md:grid-cols-2", children: [
236
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
237
- /* @__PURE__ */ jsx(Form.Label, { optional: true, children: t("priceLists.fields.startsAt.label") }),
238
- /* @__PURE__ */ jsx(Form.Hint, { children: t("priceLists.fields.startsAt.hint") })
239
- ] }),
240
- /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
241
- DatePicker,
242
- {
243
- granularity: "minute",
244
- shouldCloseOnSelect: false,
245
- ...field
246
- }
247
- ) })
248
- ] }),
242
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
243
+ /* @__PURE__ */ jsx(
244
+ Form.Field,
245
+ {
246
+ control: form.control,
247
+ name: "starts_at",
248
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
249
+ /* @__PURE__ */ jsx(Form.Label, { optional: true, children: t("priceLists.fields.startsAt.label") }),
250
+ /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
251
+ DatePicker,
252
+ {
253
+ granularity: "minute",
254
+ shouldCloseOnSelect: false,
255
+ ...field
256
+ }
257
+ ) }),
249
258
  /* @__PURE__ */ jsx(Form.ErrorMessage, {})
250
- ] });
259
+ ] })
251
260
  }
252
- }
253
- ),
261
+ ),
262
+ /* @__PURE__ */ jsx(
263
+ Form.Field,
264
+ {
265
+ control: form.control,
266
+ name: "ends_at",
267
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
268
+ /* @__PURE__ */ jsx(Form.Label, { optional: true, children: t("priceLists.fields.endsAt.label") }),
269
+ /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
270
+ DatePicker,
271
+ {
272
+ granularity: "minute",
273
+ shouldCloseOnSelect: false,
274
+ ...field
275
+ }
276
+ ) }),
277
+ /* @__PURE__ */ jsx(Form.ErrorMessage, {})
278
+ ] })
279
+ }
280
+ )
281
+ ] }),
254
282
  /* @__PURE__ */ jsx(Divider, {}),
255
283
  /* @__PURE__ */ jsx(
256
284
  Form.Field,
257
285
  {
258
286
  control: form.control,
259
- name: "ends_at",
260
- render: ({ field }) => {
261
- return /* @__PURE__ */ jsxs(Form.Item, { children: [
262
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-3 md:grid-cols-2", children: [
263
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
264
- /* @__PURE__ */ jsx(Form.Label, { optional: true, children: t("priceLists.fields.endsAt.label") }),
265
- /* @__PURE__ */ jsx(Form.Hint, { children: t("priceLists.fields.endsAt.hint") })
266
- ] }),
267
- /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
268
- DatePicker,
269
- {
270
- granularity: "minute",
271
- shouldCloseOnSelect: false,
272
- ...field
273
- }
274
- ) })
275
- ] }),
276
- /* @__PURE__ */ jsx(Form.ErrorMessage, {})
277
- ] });
278
- }
287
+ name: "rules.customer_group_id",
288
+ render: () => /* @__PURE__ */ jsxs(Form.Item, { children: [
289
+ /* @__PURE__ */ jsxs("div", { children: [
290
+ /* @__PURE__ */ jsx(Form.Label, { optional: true, children: t("priceLists.fields.customerAvailability.label") }),
291
+ /* @__PURE__ */ jsx(Form.Hint, { children: t("priceLists.fields.customerAvailability.hint") })
292
+ ] }),
293
+ /* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
294
+ PriceListCustomerAvailabilitySelector,
295
+ {
296
+ control: form.control,
297
+ name: "rules.customer_group_id"
298
+ }
299
+ ) }),
300
+ /* @__PURE__ */ jsx(Form.ErrorMessage, {})
301
+ ] })
279
302
  }
280
303
  )
281
304
  ] }) });
282
305
  };
283
306
 
284
307
  // src/pages/price-lists/create/price-list-create-form/price-list-prices-form.tsx
285
- import { useEffect } from "react";
308
+ import { buildOfferGridData } from "@mercurjs/dashboard-shared";
309
+ import { useEffect, useMemo } from "react";
286
310
  import { useWatch } from "react-hook-form";
287
311
  import { jsx as jsx2 } from "react/jsx-runtime";
312
+ var OFFER_GRID_FIELDS = "id,variant_id,product_id,sku,product.title,product.thumbnail";
288
313
  var PriceListPricesForm = ({
289
314
  form,
290
315
  currencies,
291
316
  regions,
292
317
  pricePreferences
293
318
  }) => {
294
- const ids = useWatch({
295
- control: form.control,
296
- name: "product_ids"
297
- });
298
- const existingProducts = useWatch({
299
- control: form.control,
300
- name: "products"
301
- });
302
- const {
303
- products: productsRaw,
304
- isLoading,
305
- isError,
306
- error
307
- } = useProducts({
308
- fields: "title,thumbnail,*variants,+status,*variants.prices"
309
- });
310
- const products = productsRaw?.filter(
311
- (product) => ids.some((id) => id.id === product.id)
312
- );
313
- const { setCloseOnEscape } = useRouteModal();
314
319
  const { setValue } = form;
320
+ const { setCloseOnEscape } = useRouteModal();
321
+ const offerIds = useWatch({ control: form.control, name: "offer_ids" });
322
+ const existingOffers = useWatch({ control: form.control, name: "offers" });
323
+ const { offers: selectedOffers } = useOffers(
324
+ {
325
+ id: offerIds,
326
+ limit: offerIds?.length || 1,
327
+ fields: OFFER_GRID_FIELDS
328
+ },
329
+ { enabled: (offerIds?.length ?? 0) > 0 }
330
+ );
331
+ const productIds = useMemo(
332
+ () => Array.from(
333
+ new Set(
334
+ (selectedOffers ?? []).map((o) => o.product_id)
335
+ )
336
+ ),
337
+ [selectedOffers]
338
+ );
339
+ const { products, isLoading } = useProducts(
340
+ { id: productIds, limit: productIds.length || 1, fields: "id,*variants" },
341
+ { enabled: productIds.length > 0 }
342
+ );
343
+ const { gridData, variantIdByOffer } = useMemo(
344
+ () => buildOfferGridData(
345
+ selectedOffers ?? [],
346
+ products ?? []
347
+ ),
348
+ [selectedOffers, products]
349
+ );
315
350
  useEffect(() => {
316
- if (!isLoading && products) {
317
- products.forEach((product) => {
318
- if (existingProducts[product.id] || !product.variants) {
319
- return;
320
- }
321
- setValue(`products.${product.id}.variants`, {
322
- ...product.variants.reduce((variants, variant) => {
323
- variants[variant.id] = {
324
- currency_prices: {},
325
- region_prices: {}
326
- };
327
- return variants;
328
- }, {})
351
+ for (const [offerId, variantId] of Object.entries(variantIdByOffer)) {
352
+ if (!existingOffers?.[offerId]) {
353
+ setValue(`offers.${offerId}`, {
354
+ variant_id: variantId,
355
+ currency_prices: {},
356
+ region_prices: {}
329
357
  });
330
- });
358
+ }
331
359
  }
332
- }, [products, existingProducts, isLoading, setValue]);
360
+ }, [variantIdByOffer, existingOffers, setValue]);
333
361
  const columns = usePriceListGridColumns({
334
362
  currencies,
335
363
  regions,
336
364
  pricePreferences
337
365
  });
338
- if (isError) {
339
- throw error;
340
- }
341
366
  return /* @__PURE__ */ jsx2("div", { className: "flex size-full flex-col divide-y overflow-hidden", children: /* @__PURE__ */ jsx2(
342
367
  DataGrid,
343
368
  {
344
369
  isLoading,
345
370
  columns,
346
- data: products,
347
- getSubRows: (row) => {
348
- if (isProductRow(row) && row.variants) {
349
- return row.variants;
350
- }
351
- },
371
+ data: gridData,
352
372
  state: form,
353
373
  onEditingChange: (editing) => setCloseOnEscape(!editing)
354
374
  }
@@ -361,7 +381,7 @@ import { keepPreviousData } from "@tanstack/react-query";
361
381
  import {
362
382
  createColumnHelper
363
383
  } from "@tanstack/react-table";
364
- import { useMemo, useState } from "react";
384
+ import { useMemo as useMemo2, useRef, useState } from "react";
365
385
  import { useWatch as useWatch2 } from "react-hook-form";
366
386
  import { useTranslation as useTranslation2 } from "react-i18next";
367
387
  import { jsx as jsx3 } from "react/jsx-runtime";
@@ -376,58 +396,47 @@ function getInitialSelection(products) {
376
396
  var PriceListProductsForm = ({ form }) => {
377
397
  const { t } = useTranslation2();
378
398
  const { control, setValue } = form;
379
- const selectedIds = useWatch2({
380
- control,
381
- name: "product_ids"
382
- });
383
- const productRecords = useWatch2({
384
- control,
385
- name: "products"
386
- });
399
+ const selectedIds = useWatch2({ control, name: "product_ids" });
387
400
  const [rowSelection, setRowSelection] = useState(
388
401
  getInitialSelection(selectedIds)
389
402
  );
390
- const { searchParams, raw } = useProductTableQuery({
403
+ const { searchParams, raw } = useOfferTableQuery({
391
404
  pageSize: PAGE_SIZE,
392
405
  prefix: PREFIX
393
406
  });
394
407
  const { products, count, isLoading, isError, error } = useProducts(
395
- { ...searchParams, fields: "+thumbnail" },
396
- {
397
- placeholderData: keepPreviousData
398
- }
408
+ searchParams,
409
+ { placeholderData: keepPreviousData }
399
410
  );
411
+ const rows = products ?? [];
412
+ const offerMeta = useRef({});
413
+ for (const row of rows) {
414
+ offerMeta.current[row.id] = collectOfferIds(row);
415
+ }
400
416
  const updater = (fn) => {
401
417
  const state = typeof fn === "function" ? fn(rowSelection) : fn;
402
- const ids = Object.keys(state);
403
- const productRecordKeys = Object.keys(productRecords);
404
- const updatedRecords = productRecordKeys.reduce((acc, key) => {
405
- if (ids.includes(key)) {
406
- acc[key] = productRecords[key];
407
- }
408
- return acc;
409
- }, {});
410
- const update = ids.map((id) => ({ id }));
411
- setValue("product_ids", update, {
412
- shouldDirty: true,
413
- shouldTouch: true
414
- });
415
- setValue("products", updatedRecords, {
416
- shouldDirty: true,
417
- shouldTouch: true
418
- });
418
+ const productIds = Object.keys(state).filter(
419
+ (id) => offerMeta.current[id]
420
+ );
421
+ const offerIds = Array.from(
422
+ new Set(productIds.flatMap((id) => offerMeta.current[id] ?? []))
423
+ );
424
+ setValue(
425
+ "product_ids",
426
+ productIds.map((id) => ({ id })),
427
+ { shouldDirty: true, shouldTouch: true }
428
+ );
429
+ setValue("offer_ids", offerIds, { shouldDirty: true, shouldTouch: true });
419
430
  setRowSelection(state);
420
431
  };
421
432
  const columns = useColumns();
422
- const filters = useProductTableFilters();
433
+ const filters = useOfferTableFilters();
423
434
  const { table } = useDataTable({
424
- data: products || [],
435
+ data: rows,
425
436
  columns,
426
437
  count,
427
438
  enablePagination: true,
428
- enableRowSelection: (row) => {
429
- return !!row.original.variants?.length;
430
- },
439
+ enableRowSelection: (row) => collectOfferIds(row.original).length > 0,
431
440
  getRowId: (row) => row.id,
432
441
  rowSelection: {
433
442
  state: rowSelection,
@@ -451,15 +460,8 @@ var PriceListProductsForm = ({ form }) => {
451
460
  layout: "fill",
452
461
  orderBy: [
453
462
  { key: "title", label: t("fields.title") },
454
- { key: "status", label: t("fields.status") },
455
- {
456
- key: "created_at",
457
- label: t("fields.createdAt")
458
- },
459
- {
460
- key: "updated_at",
461
- label: t("fields.updatedAt")
462
- }
463
+ { key: "created_at", label: t("fields.createdAt") },
464
+ { key: "updated_at", label: t("fields.updatedAt") }
463
465
  ],
464
466
  pagination: true,
465
467
  search: true,
@@ -472,41 +474,34 @@ var PriceListProductsForm = ({ form }) => {
472
474
  };
473
475
  var columnHelper = createColumnHelper();
474
476
  var useColumns = () => {
475
- const base = useProductTableColumns();
476
- return useMemo(
477
- () => [
478
- columnHelper.display({
479
- id: "select",
480
- header: ({ table }) => {
481
- return /* @__PURE__ */ jsx3(
482
- Checkbox,
483
- {
484
- checked: table.getIsSomePageRowsSelected() ? "indeterminate" : table.getIsAllPageRowsSelected(),
485
- onCheckedChange: (value) => table.toggleAllPageRowsSelected(!!value)
486
- }
487
- );
488
- },
489
- cell: ({ row }) => {
490
- return /* @__PURE__ */ jsx3(
491
- Checkbox,
492
- {
493
- checked: row.getIsSelected(),
494
- disabled: !row.getCanSelect(),
495
- onCheckedChange: (value) => row.toggleSelected(!!value),
496
- onClick: (e) => {
497
- e.stopPropagation();
498
- }
499
- }
500
- );
477
+ const base = useOfferTableColumns();
478
+ return useMemo2(() => {
479
+ const selectColumn = columnHelper.display({
480
+ id: "select",
481
+ header: ({ table }) => /* @__PURE__ */ jsx3(
482
+ Checkbox,
483
+ {
484
+ checked: table.getIsSomePageRowsSelected() ? "indeterminate" : table.getIsAllPageRowsSelected(),
485
+ onCheckedChange: (value) => table.toggleAllPageRowsSelected(!!value)
501
486
  }
502
- }),
503
- ...base
504
- ],
505
- [base]
506
- );
487
+ ),
488
+ cell: ({ row }) => /* @__PURE__ */ jsx3(
489
+ Checkbox,
490
+ {
491
+ checked: row.getIsSelected(),
492
+ disabled: !row.getCanSelect(),
493
+ onCheckedChange: (value) => row.toggleSelected(!!value),
494
+ onClick: (e) => e.stopPropagation()
495
+ }
496
+ )
497
+ });
498
+ const informative = base.slice(0, -1);
499
+ return [selectColumn, ...informative];
500
+ }, [base]);
507
501
  };
508
502
 
509
503
  // src/pages/price-lists/create/price-list-create-form/schema.ts
504
+ import i18n from "i18next";
510
505
  import { z } from "zod";
511
506
  var PricingCustomerGroupsArray = z.array(
512
507
  z.object({
@@ -517,12 +512,17 @@ var PricingCustomerGroupsArray = z.array(
517
512
  var PricingCreateSchema = z.object({
518
513
  type: z.enum(["sale", "override"]),
519
514
  status: z.enum(["draft", "active"]),
520
- title: z.string().min(1),
521
- description: z.string().min(1),
515
+ title: z.string().min(1, i18n.t("priceLists.create.validation.title")),
516
+ description: z.string().min(1, i18n.t("priceLists.create.validation.description")),
522
517
  starts_at: z.date().nullish(),
523
518
  ends_at: z.date().nullish(),
524
519
  product_ids: z.array(z.object({ id: z.string() })).min(1),
525
- products: PriceListCreateProductsSchema,
520
+ // Offer ids selected in the picker (every variant of the chosen products).
521
+ // The Prices tab hydrates `offers` from these.
522
+ offer_ids: z.array(z.string()).default([]),
523
+ // Offer-keyed prices (offer_id -> { variant_id, prices }), so every price
524
+ // carries its offer_id rule and stays scoped to that offer.
525
+ offers: PriceListCreateOffersSchema.default({}),
526
526
  rules: PriceListRulesSchema.nullish()
527
527
  });
528
528
  var PricingDetailsSchema = PricingCreateSchema.pick({
@@ -530,8 +530,7 @@ var PricingDetailsSchema = PricingCreateSchema.pick({
530
530
  title: true,
531
531
  description: true,
532
532
  starts_at: true,
533
- ends_at: true,
534
- customer_group_ids: true
533
+ ends_at: true
535
534
  });
536
535
  var PricingDetailsFields = Object.keys(
537
536
  PricingDetailsSchema.shape
@@ -543,7 +542,7 @@ var PricingProductsFields = Object.keys(
543
542
  PricingProductsSchema.shape
544
543
  );
545
544
  var PricingPricesSchema = PricingCreateSchema.pick({
546
- products: true
545
+ offers: true
547
546
  });
548
547
  var PricingPricesFields = Object.keys(
549
548
  PricingPricesSchema.shape
@@ -569,13 +568,14 @@ var PriceListCreateForm = ({
569
568
  const form = useForm({
570
569
  defaultValues: {
571
570
  type: "sale",
572
- status: "active",
571
+ status: "draft",
573
572
  title: "",
574
573
  description: "",
575
574
  starts_at: null,
576
575
  ends_at: null,
577
576
  product_ids: [],
578
- products: {},
577
+ offer_ids: [],
578
+ offers: {},
579
579
  rules: {
580
580
  customer_group_id: []
581
581
  }
@@ -584,9 +584,9 @@ var PriceListCreateForm = ({
584
584
  });
585
585
  const { mutateAsync, isPending } = useCreatePriceList();
586
586
  const handleSubmit = form.handleSubmit(async (data) => {
587
- const { rules, products } = data;
587
+ const { rules, offers } = data;
588
588
  const rulesPayload = rules?.customer_group_id?.length ? { "customer.groups.id": rules.customer_group_id.map((cg) => cg.id) } : void 0;
589
- const prices = exctractPricesFromProducts(products, regions);
589
+ const prices = extractPricesFromOffers(offers, regions);
590
590
  await mutateAsync(
591
591
  {
592
592
  title: data.title,