@pisell/private-materials 6.3.70 → 6.3.72

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 (312) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +2 -2
  6. package/build/lowcode/preview.js +8 -8
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +7 -7
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +9 -9
  11. package/es/components/Sales/Cart/index.js +20 -3
  12. package/es/components/Sales/Cart/utils.d.ts +5 -0
  13. package/es/components/Sales/Cart/utils.js +16 -0
  14. package/es/components/Sales/Summary/utils.js +5 -4
  15. package/es/components/booking/addons/model.d.ts +1 -10
  16. package/es/components/booking/components/TabProduct/index.d.ts +0 -1
  17. package/es/components/booking/components/TabProduct/productItem/index.d.ts +0 -1
  18. package/es/components/booking/components/TabProduct/selectProductItem/index.d.ts +0 -1
  19. package/es/components/booking/components/collapsibleList/utils.d.ts +0 -1
  20. package/es/components/booking/components/emptyBooking/index.d.ts +0 -1
  21. package/es/components/booking/components/footer/FooterMenus/index.d.ts +0 -1
  22. package/es/components/booking/components/reloadResourceModal/index.d.ts +0 -1
  23. package/es/components/booking/components/voucher/index.js +8 -7
  24. package/es/components/booking/forms/model.d.ts +1 -10
  25. package/es/components/booking/forms/single/index.d.ts +0 -1
  26. package/es/components/booking/forms/table/index.d.ts +0 -1
  27. package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +0 -1
  28. package/es/components/booking/info/date/index.d.ts +0 -1
  29. package/es/components/booking/info/model.d.ts +1 -10
  30. package/es/components/booking/info/notes/index.d.ts +0 -1
  31. package/es/components/booking/info/service/actions/index.d.ts +0 -1
  32. package/es/components/booking/info/service/addService/utils.d.ts +1 -1
  33. package/es/components/booking/info2/service/actions/index.d.ts +0 -1
  34. package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
  35. package/es/components/booking/info2/service/contactInfoMode/index.d.ts +0 -1
  36. package/es/components/booking/materiels/contacts/index.d.ts +0 -1
  37. package/es/components/booking/materiels/duration/index.d.ts +0 -1
  38. package/es/components/booking/materiels/holder/index.d.ts +0 -1
  39. package/es/components/booking/materiels/startTime/index.d.ts +0 -1
  40. package/es/components/booking/model.d.ts +1 -9
  41. package/es/components/booking/notes/NoteBlock/NoteItem/index.d.ts +0 -1
  42. package/es/components/booking/notes/NoteBlock/index.d.ts +0 -1
  43. package/es/components/booking/notes/model.d.ts +1 -10
  44. package/es/components/booking/payments/model.d.ts +1 -10
  45. package/es/components/booking/utils.d.ts +2 -2
  46. package/es/components/eftpos/index.d.ts +0 -1
  47. package/es/components/eftpos/pos.d.ts +0 -1
  48. package/es/components/eftposPay/amount.d.ts +1 -2
  49. package/es/components/eftposPay/component/fail/failCustom.d.ts +0 -1
  50. package/es/components/eftposPay/component/fail/network.d.ts +0 -1
  51. package/es/components/eftposPay/component/fail/unknow.d.ts +0 -1
  52. package/es/components/eftposPay/component/manual/index.d.ts +0 -1
  53. package/es/components/eftposPay/component/signature/index.d.ts +0 -1
  54. package/es/components/eftposPay/device.d.ts +1 -1
  55. package/es/components/eftposPay/hooks.d.ts +2 -2
  56. package/es/components/eftposPay/pay.d.ts +0 -1
  57. package/es/components/eftposPay/payo/config.d.ts +0 -1
  58. package/es/components/eftposPay/store/index.d.ts +4 -4
  59. package/es/components/eftposPay/tip.d.ts +0 -1
  60. package/es/components/eftposPay/windcave/receiptAction.d.ts +0 -1
  61. package/es/components/eftposPay/windcave/windcave.d.ts +0 -1
  62. package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +0 -1
  63. package/es/components/eventBooking/components/Provider/Cart/Item/index.js +2 -1
  64. package/es/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
  65. package/es/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
  66. package/es/components/eventBooking/components/Provider/SelectHolderModal.d.ts +0 -1
  67. package/es/components/eventBooking/components/Voucher/components/Voucher.d.ts +20 -0
  68. package/es/components/eventBooking/components/Voucher/components/Voucher.js +99 -0
  69. package/es/components/eventBooking/components/Voucher/components/index.less +124 -0
  70. package/es/components/eventBooking/components/Voucher/components/locales.d.ts +39 -0
  71. package/es/components/eventBooking/components/Voucher/components/locales.js +38 -0
  72. package/es/components/eventBooking/components/Voucher/hooks.d.ts +7 -0
  73. package/es/components/eventBooking/components/Voucher/hooks.js +212 -0
  74. package/es/components/eventBooking/components/Voucher/index.d.ts +2 -0
  75. package/es/components/eventBooking/components/Voucher/index.js +266 -0
  76. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
  77. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
  78. package/es/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +0 -1
  79. package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +0 -1
  80. package/es/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +0 -1
  81. package/es/components/kioskSkuDetail/index.d.ts +39 -0
  82. package/es/components/kioskSkuDetail/index.js +531 -0
  83. package/es/components/kioskSkuDetail/index.less +196 -0
  84. package/es/components/kioskSkuDetail/locales.d.ts +27 -0
  85. package/es/components/kioskSkuDetail/locales.js +26 -0
  86. package/es/components/login/index.d.ts +0 -1
  87. package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +5 -0
  88. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
  89. package/es/components/pay/toC/model.d.ts +1 -9
  90. package/es/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.d.ts +0 -1
  91. package/es/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +0 -1
  92. package/es/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +0 -1
  93. package/es/components/productExtension/fields/Actor/index.d.ts +0 -1
  94. package/es/components/productExtension/fields/Forms/index.d.ts +0 -1
  95. package/es/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +0 -1
  96. package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +0 -1
  97. package/es/components/productExtension/fields/SelectProducts/index.d.ts +0 -1
  98. package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +0 -1
  99. package/es/components/ruleSetting/ruleBorder/index.d.ts +0 -1
  100. package/es/components/schedules/calendar/calendarItem.d.ts +0 -1
  101. package/es/components/schedules/calendar/index.d.ts +0 -1
  102. package/es/components/schedules/components/CurrentDay/index.d.ts +0 -1
  103. package/es/components/schedules/components/ScheduleDetailList/index.d.ts +0 -1
  104. package/es/components/schedules/components/ScheduleList/index.d.ts +0 -1
  105. package/es/components/schedules/model.d.ts +1 -9
  106. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +0 -1
  107. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.d.ts +0 -1
  108. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
  109. package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
  110. package/es/components/schedules/products/ProductDetailDrawer/index.d.ts +0 -1
  111. package/es/components/schedules/products/index.d.ts +0 -1
  112. package/es/components/schedules/products/list/ProductItem/index.d.ts +0 -1
  113. package/es/components/schedules/products/list/index.d.ts +0 -1
  114. package/es/components/schedules/resources/index.d.ts +0 -1
  115. package/es/components/schedules/resources/list/index.d.ts +0 -1
  116. package/es/components/schedules/schedules/AllSchedules/index.d.ts +0 -1
  117. package/es/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +0 -1
  118. package/es/components/schedules/schedules/index.d.ts +0 -1
  119. package/es/components/shoppingCart/components/Empty/index.d.ts +0 -1
  120. package/es/components/shoppingCart/components/Render/index.d.ts +0 -1
  121. package/es/components/shoppingCart/index.d.ts +0 -1
  122. package/es/components/walletList/index.js +7 -2
  123. package/es/hooks/usePaymentLogger.d.ts +0 -1
  124. package/es/index.d.ts +3 -1
  125. package/es/index.js +3 -1
  126. package/es/plus/saasCreateOrganization/components/Header.d.ts +0 -1
  127. package/es/plus/saasRegister/components/EntryEmail.d.ts +0 -1
  128. package/es/plus/saasRegister/components/EntryInfo.d.ts +0 -1
  129. package/es/plus/saasRegister/components/GoLogin.d.ts +0 -1
  130. package/es/plus/saasRegister/components/Header.d.ts +0 -1
  131. package/es/plus/saasRegister/components/VerifyError.d.ts +0 -1
  132. package/es/plus/saasRegister/components/VerifyingLink.d.ts +0 -1
  133. package/es/plus/skuOptionsSelection/components/VariantCard/index.js +30 -1
  134. package/es/plus/skuOptionsSelection/components/VariantCard/index.less +10 -0
  135. package/es/plus/skuOptionsSelection/locales.d.ts +3 -0
  136. package/es/plus/skuOptionsSelection/locales.js +3 -0
  137. package/es/plus/skuOptionsSelection/store/actions.js +17 -2
  138. package/es/plus/skuOptionsSelection/types.d.ts +5 -0
  139. package/es/plus/skuOptionsSelection/types.js +2 -1
  140. package/es/plus/skuOptionsSelection/utils/transformVariantGroup.js +70 -3
  141. package/es/plus/walletEditor/components/relationProduct/index.d.ts +0 -1
  142. package/es/plus/walletPassGallery/components/passDetail/index.js +6 -5
  143. package/es/plus/walletPassGallery/components/timelineSection/index.d.ts +1 -0
  144. package/es/plus/walletPassGallery/components/timelineSection/index.js +9 -3
  145. package/es/plus/walletPassGallery/index.js +2 -2
  146. package/es/plus/walletPassGallery/serve.d.ts +8 -0
  147. package/es/plus/walletPassGallery/serve.js +78 -52
  148. package/es/pro/Selector/Selector.d.ts +1 -1
  149. package/es/pro/numberKeyboard/index.d.ts +28 -0
  150. package/es/pro/numberKeyboard/index.js +155 -0
  151. package/es/pro/numberKeyboard/index.less +25 -0
  152. package/es/pro/numberKeyboard/locales.d.ts +12 -0
  153. package/es/pro/numberKeyboard/locales.js +11 -0
  154. package/es/pro/pisellNumberSelector/example.d.ts +3 -0
  155. package/es/pro/pisellNumberSelector/example.js +68 -0
  156. package/es/pro/pisellNumberSelector/index.d.ts +29 -0
  157. package/es/pro/pisellNumberSelector/index.js +257 -0
  158. package/es/pro/pisellNumberSelector/index.less +235 -0
  159. package/es/pro/skuDetailModal/index.d.ts +4 -0
  160. package/es/pro/skuDetailModal/index.js +1031 -0
  161. package/lib/components/Sales/Cart/index.js +25 -7
  162. package/lib/components/Sales/Cart/utils.d.ts +5 -0
  163. package/lib/components/Sales/Cart/utils.js +13 -1
  164. package/lib/components/Sales/Summary/utils.js +2 -4
  165. package/lib/components/booking/addons/model.d.ts +1 -10
  166. package/lib/components/booking/components/TabProduct/index.d.ts +0 -1
  167. package/lib/components/booking/components/TabProduct/productItem/index.d.ts +0 -1
  168. package/lib/components/booking/components/TabProduct/selectProductItem/index.d.ts +0 -1
  169. package/lib/components/booking/components/collapsibleList/utils.d.ts +0 -1
  170. package/lib/components/booking/components/emptyBooking/index.d.ts +0 -1
  171. package/lib/components/booking/components/footer/FooterMenus/index.d.ts +0 -1
  172. package/lib/components/booking/components/reloadResourceModal/index.d.ts +0 -1
  173. package/lib/components/booking/components/voucher/index.js +0 -1
  174. package/lib/components/booking/forms/model.d.ts +1 -10
  175. package/lib/components/booking/forms/single/index.d.ts +0 -1
  176. package/lib/components/booking/forms/table/index.d.ts +0 -1
  177. package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +0 -1
  178. package/lib/components/booking/info/date/index.d.ts +0 -1
  179. package/lib/components/booking/info/model.d.ts +1 -10
  180. package/lib/components/booking/info/notes/index.d.ts +0 -1
  181. package/lib/components/booking/info/service/actions/index.d.ts +0 -1
  182. package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
  183. package/lib/components/booking/info2/service/actions/index.d.ts +0 -1
  184. package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
  185. package/lib/components/booking/info2/service/contactInfoMode/index.d.ts +0 -1
  186. package/lib/components/booking/materiels/contacts/index.d.ts +0 -1
  187. package/lib/components/booking/materiels/duration/index.d.ts +0 -1
  188. package/lib/components/booking/materiels/holder/index.d.ts +0 -1
  189. package/lib/components/booking/materiels/startTime/index.d.ts +0 -1
  190. package/lib/components/booking/model.d.ts +1 -9
  191. package/lib/components/booking/notes/NoteBlock/NoteItem/index.d.ts +0 -1
  192. package/lib/components/booking/notes/NoteBlock/index.d.ts +0 -1
  193. package/lib/components/booking/notes/model.d.ts +1 -10
  194. package/lib/components/booking/payments/model.d.ts +1 -10
  195. package/lib/components/booking/utils.d.ts +2 -2
  196. package/lib/components/eftpos/index.d.ts +0 -1
  197. package/lib/components/eftpos/pos.d.ts +0 -1
  198. package/lib/components/eftposPay/amount.d.ts +1 -2
  199. package/lib/components/eftposPay/component/fail/failCustom.d.ts +0 -1
  200. package/lib/components/eftposPay/component/fail/network.d.ts +0 -1
  201. package/lib/components/eftposPay/component/fail/unknow.d.ts +0 -1
  202. package/lib/components/eftposPay/component/manual/index.d.ts +0 -1
  203. package/lib/components/eftposPay/component/signature/index.d.ts +0 -1
  204. package/lib/components/eftposPay/device.d.ts +1 -1
  205. package/lib/components/eftposPay/hooks.d.ts +2 -2
  206. package/lib/components/eftposPay/pay.d.ts +0 -1
  207. package/lib/components/eftposPay/payo/config.d.ts +0 -1
  208. package/lib/components/eftposPay/store/index.d.ts +4 -4
  209. package/lib/components/eftposPay/tip.d.ts +0 -1
  210. package/lib/components/eftposPay/windcave/receiptAction.d.ts +0 -1
  211. package/lib/components/eftposPay/windcave/windcave.d.ts +0 -1
  212. package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +0 -1
  213. package/lib/components/eventBooking/components/Provider/Cart/Item/index.js +2 -1
  214. package/lib/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
  215. package/lib/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
  216. package/lib/components/eventBooking/components/Provider/SelectHolderModal.d.ts +0 -1
  217. package/lib/components/eventBooking/components/Voucher/components/Voucher.d.ts +20 -0
  218. package/lib/components/eventBooking/components/Voucher/components/Voucher.js +116 -0
  219. package/lib/components/eventBooking/components/Voucher/components/index.less +124 -0
  220. package/lib/components/eventBooking/components/Voucher/components/locales.d.ts +39 -0
  221. package/lib/components/eventBooking/components/Voucher/components/locales.js +59 -0
  222. package/lib/components/eventBooking/components/Voucher/hooks.d.ts +7 -0
  223. package/lib/components/eventBooking/components/Voucher/hooks.js +176 -0
  224. package/lib/components/eventBooking/components/Voucher/index.d.ts +2 -0
  225. package/lib/components/eventBooking/components/Voucher/index.js +197 -0
  226. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
  227. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
  228. package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +0 -1
  229. package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +0 -1
  230. package/lib/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +0 -1
  231. package/lib/components/kioskSkuDetail/index.d.ts +39 -0
  232. package/lib/components/kioskSkuDetail/index.js +393 -0
  233. package/lib/components/kioskSkuDetail/index.less +196 -0
  234. package/lib/components/kioskSkuDetail/locales.d.ts +27 -0
  235. package/lib/components/kioskSkuDetail/locales.js +50 -0
  236. package/lib/components/login/index.d.ts +0 -1
  237. package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +5 -0
  238. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
  239. package/lib/components/pay/toC/model.d.ts +1 -9
  240. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.d.ts +0 -1
  241. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +0 -1
  242. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +0 -1
  243. package/lib/components/productExtension/fields/Actor/index.d.ts +0 -1
  244. package/lib/components/productExtension/fields/Forms/index.d.ts +0 -1
  245. package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +0 -1
  246. package/lib/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +0 -1
  247. package/lib/components/productExtension/fields/SelectProducts/index.d.ts +0 -1
  248. package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +0 -1
  249. package/lib/components/ruleSetting/ruleBorder/index.d.ts +0 -1
  250. package/lib/components/schedules/calendar/calendarItem.d.ts +0 -1
  251. package/lib/components/schedules/calendar/index.d.ts +0 -1
  252. package/lib/components/schedules/components/CurrentDay/index.d.ts +0 -1
  253. package/lib/components/schedules/components/ScheduleDetailList/index.d.ts +0 -1
  254. package/lib/components/schedules/components/ScheduleList/index.d.ts +0 -1
  255. package/lib/components/schedules/model.d.ts +1 -9
  256. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +0 -1
  257. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.d.ts +0 -1
  258. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
  259. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
  260. package/lib/components/schedules/products/ProductDetailDrawer/index.d.ts +0 -1
  261. package/lib/components/schedules/products/index.d.ts +0 -1
  262. package/lib/components/schedules/products/list/ProductItem/index.d.ts +0 -1
  263. package/lib/components/schedules/products/list/index.d.ts +0 -1
  264. package/lib/components/schedules/resources/index.d.ts +0 -1
  265. package/lib/components/schedules/resources/list/index.d.ts +0 -1
  266. package/lib/components/schedules/schedules/AllSchedules/index.d.ts +0 -1
  267. package/lib/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +0 -1
  268. package/lib/components/schedules/schedules/index.d.ts +0 -1
  269. package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -1
  270. package/lib/components/shoppingCart/components/Render/index.d.ts +0 -1
  271. package/lib/components/shoppingCart/index.d.ts +0 -1
  272. package/lib/components/walletList/index.js +5 -1
  273. package/lib/hooks/usePaymentLogger.d.ts +0 -1
  274. package/lib/index.d.ts +3 -1
  275. package/lib/index.js +7 -1
  276. package/lib/plus/saasCreateOrganization/components/Header.d.ts +0 -1
  277. package/lib/plus/saasRegister/components/EntryEmail.d.ts +0 -1
  278. package/lib/plus/saasRegister/components/EntryInfo.d.ts +0 -1
  279. package/lib/plus/saasRegister/components/GoLogin.d.ts +0 -1
  280. package/lib/plus/saasRegister/components/Header.d.ts +0 -1
  281. package/lib/plus/saasRegister/components/VerifyError.d.ts +0 -1
  282. package/lib/plus/saasRegister/components/VerifyingLink.d.ts +0 -1
  283. package/lib/plus/skuOptionsSelection/components/VariantCard/index.js +32 -3
  284. package/lib/plus/skuOptionsSelection/components/VariantCard/index.less +10 -0
  285. package/lib/plus/skuOptionsSelection/locales.d.ts +3 -0
  286. package/lib/plus/skuOptionsSelection/locales.js +3 -0
  287. package/lib/plus/skuOptionsSelection/store/actions.js +25 -1
  288. package/lib/plus/skuOptionsSelection/types.d.ts +5 -0
  289. package/lib/plus/skuOptionsSelection/types.js +2 -1
  290. package/lib/plus/skuOptionsSelection/utils/transformVariantGroup.js +51 -5
  291. package/lib/plus/walletEditor/components/relationProduct/index.d.ts +0 -1
  292. package/lib/plus/walletPassGallery/components/passDetail/index.js +24 -6
  293. package/lib/plus/walletPassGallery/components/timelineSection/index.d.ts +1 -0
  294. package/lib/plus/walletPassGallery/components/timelineSection/index.js +17 -10
  295. package/lib/plus/walletPassGallery/index.js +2 -2
  296. package/lib/plus/walletPassGallery/serve.d.ts +8 -0
  297. package/lib/plus/walletPassGallery/serve.js +23 -10
  298. package/lib/pro/Selector/Selector.d.ts +1 -1
  299. package/lib/pro/numberKeyboard/index.d.ts +28 -0
  300. package/lib/pro/numberKeyboard/index.js +182 -0
  301. package/lib/pro/numberKeyboard/index.less +25 -0
  302. package/lib/pro/numberKeyboard/locales.d.ts +12 -0
  303. package/lib/pro/numberKeyboard/locales.js +35 -0
  304. package/lib/pro/pisellNumberSelector/example.d.ts +3 -0
  305. package/lib/pro/pisellNumberSelector/example.js +93 -0
  306. package/lib/pro/pisellNumberSelector/index.d.ts +29 -0
  307. package/lib/pro/pisellNumberSelector/index.js +275 -0
  308. package/lib/pro/pisellNumberSelector/index.less +235 -0
  309. package/lib/pro/skuDetailModal/index.d.ts +4 -0
  310. package/lib/pro/skuDetailModal/index.js +736 -0
  311. package/lowcode/kiosk-sku-detail/meta.ts +264 -0
  312. package/package.json +3 -3
@@ -0,0 +1,197 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/components/eventBooking/components/Voucher/index.tsx
30
+ var Voucher_exports = {};
31
+ __export(Voucher_exports, {
32
+ default: () => Voucher_default
33
+ });
34
+ module.exports = __toCommonJS(Voucher_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_utils = require("@pisell/utils");
37
+ var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
38
+ var import_materials = require("@pisell/materials");
39
+ var import_Sales = require("../../../Sales");
40
+ var import_Voucher = __toESM(require("./components/Voucher"));
41
+ var import_locales = __toESM(require("./components/locales"));
42
+ var import_hooks = require("./hooks");
43
+ var ShopDiscountHooks = {
44
+ onDiscountListChange: "shopDiscount:eventBooking:onDiscountListChange",
45
+ onLoadPrepareCalcResult: "shopDiscount:eventBooking:onLoadPrepareCalcResult"
46
+ };
47
+ var VoucherCard = () => {
48
+ var _a, _b, _c;
49
+ const context = (0, import_useEngineContext.default)();
50
+ const utils = ((_a = context.appHelper) == null ? void 0 : _a.utils) || {};
51
+ const pisellos = (0, import_useEngineContext.usePisellOS)();
52
+ import_utils.locales.init(import_locales.default, ((_b = utils == null ? void 0 : utils.storage) == null ? void 0 : _b.get("umi_locale")) || "en");
53
+ const shopDiscount = (0, import_hooks.useShopDiscount)();
54
+ const { cartData, updateCartItem } = (0, import_Sales.useCart)();
55
+ const { isLogin, openLoginModal, getUserInfo } = (0, import_Sales.useCustomer)();
56
+ const [showDetail, setShowDetail] = (0, import_react.useState)(false);
57
+ const [code, setCode] = (0, import_react.useState)("");
58
+ const [discountList, setDisCountList] = (0, import_react.useState)([]);
59
+ const { getCartItemProductsWithQuotation } = (0, import_hooks.useVoucherLogin)();
60
+ const currentUser = getUserInfo() || {};
61
+ const cartUnique = (0, import_react.useMemo)(() => {
62
+ var _a2, _b2;
63
+ return (_b2 = (_a2 = cartData == null ? void 0 : cartData.cartItems) == null ? void 0 : _a2.map((item) => {
64
+ const { _id, holder, product } = (item == null ? void 0 : item._originData) || {};
65
+ const { discount_list, ...rest } = product || {};
66
+ return JSON.stringify({ _id, product: rest, holder });
67
+ })) == null ? void 0 : _b2.join("-");
68
+ }, [cartData.cartItems]);
69
+ (0, import_react.useEffect)(() => {
70
+ var _a2;
71
+ if (isLogin() && (currentUser == null ? void 0 : currentUser.id)) {
72
+ (_a2 = shopDiscount == null ? void 0 : shopDiscount.setCustomer) == null ? void 0 : _a2.call(shopDiscount, currentUser);
73
+ }
74
+ }, [currentUser == null ? void 0 : currentUser.id, isLogin, shopDiscount]);
75
+ (0, import_react.useEffect)(() => {
76
+ shopDiscount.setProductList((cartData == null ? void 0 : cartData.cartItems) || []);
77
+ }, [cartUnique, shopDiscount]);
78
+ const batchUpdateCart = (productList) => {
79
+ if (!(productList == null ? void 0 : productList.length)) return;
80
+ productList.forEach((product) => {
81
+ updateCartItem(product);
82
+ });
83
+ };
84
+ (0, import_react.useEffect)(() => {
85
+ const onDiscountListChange = (discount) => {
86
+ console.log("onDiscountListChange: ", discount);
87
+ setDisCountList(discount);
88
+ };
89
+ const onLoadPrepareCalcResult = (result) => {
90
+ var _a2;
91
+ console.log("onLoadPrepareCalcResult: ", result);
92
+ if (!((_a2 = result == null ? void 0 : result.productList) == null ? void 0 : _a2.length)) {
93
+ return;
94
+ }
95
+ batchUpdateCart(result == null ? void 0 : result.productList);
96
+ };
97
+ pisellos.effects.on(
98
+ ShopDiscountHooks.onLoadPrepareCalcResult,
99
+ onLoadPrepareCalcResult
100
+ );
101
+ pisellos.effects.on(
102
+ ShopDiscountHooks.onDiscountListChange,
103
+ onDiscountListChange
104
+ );
105
+ return () => {
106
+ pisellos.effects.off(
107
+ ShopDiscountHooks.onLoadPrepareCalcResult,
108
+ onLoadPrepareCalcResult
109
+ );
110
+ pisellos.effects.off(
111
+ ShopDiscountHooks.onDiscountListChange,
112
+ onDiscountListChange
113
+ );
114
+ };
115
+ }, []);
116
+ (0, import_react.useEffect)(() => {
117
+ var _a2;
118
+ (_a2 = shopDiscount == null ? void 0 : shopDiscount.setBookingSubject) == null ? void 0 : _a2.call(shopDiscount, { type: "form" });
119
+ const val = shopDiscount.calcDiscount((cartData == null ? void 0 : cartData.cartItems) || []);
120
+ if (val == null ? void 0 : val.productList) {
121
+ batchUpdateCart(val.productList);
122
+ }
123
+ }, [cartUnique]);
124
+ const availableData = (0, import_react.useMemo)(() => {
125
+ return discountList.filter((item) => !!item.isAvailable).map((discount) => {
126
+ return {
127
+ ...discount,
128
+ isDisabled: discount.isDisabled || discount.isDisabledForProductUsed,
129
+ savedAmount: shopDiscount.calcDiscountApplicableProductTotalPrice(discount)
130
+ };
131
+ });
132
+ }, [discountList, shopDiscount]);
133
+ const onScanCode = async () => {
134
+ if (!shopDiscount) {
135
+ (0, import_materials.PisellToast)({
136
+ content: import_utils.locales.getText("pisell2.voucher.code-invalid")
137
+ });
138
+ return;
139
+ }
140
+ const val = await shopDiscount.scanCode(code, currentUser.id);
141
+ console.log("scanCodeValue: ", val);
142
+ if (val == null ? void 0 : val.isAvailable) {
143
+ batchUpdateCart(val.productList);
144
+ setCode("");
145
+ } else {
146
+ (0, import_materials.PisellToast)({
147
+ content: val.type === "server" ? import_utils.locales.getText("pisell2.voucher.code-invalid") : import_utils.locales.getText("pisell2.voucher.code-invalid-cart")
148
+ });
149
+ }
150
+ };
151
+ const mixedSort = (val) => {
152
+ return [...val].sort((a, b) => {
153
+ return Number(b == null ? void 0 : b.isSelected) - Number(a == null ? void 0 : a.isSelected);
154
+ });
155
+ };
156
+ const handleLoginClick = () => {
157
+ openLoginModal({
158
+ callback: async (status) => {
159
+ if (status === "success") {
160
+ await getCartItemProductsWithQuotation();
161
+ }
162
+ }
163
+ });
164
+ };
165
+ const handleDiscountChange = (val) => {
166
+ if (!shopDiscount) return;
167
+ const detail = shopDiscount.setDiscountSelected({
168
+ discountId: val.id,
169
+ isSelected: val.isSelected
170
+ });
171
+ console.log("Set discount selected:", detail);
172
+ if (detail == null ? void 0 : detail.productList) {
173
+ batchUpdateCart(detail.productList);
174
+ }
175
+ };
176
+ const handleToggleDetail = () => {
177
+ setShowDetail(!showDetail);
178
+ };
179
+ if (!((_c = cartData.cartItems) == null ? void 0 : _c.length)) return null;
180
+ return /* @__PURE__ */ import_react.default.createElement(
181
+ import_Voucher.default,
182
+ {
183
+ showDetail,
184
+ onToggleDetail: handleToggleDetail,
185
+ isLogin: isLogin(),
186
+ onLoginClick: handleLoginClick,
187
+ availableData,
188
+ onDiscountChange: handleDiscountChange,
189
+ mixedSort,
190
+ code,
191
+ onCodeChange: setCode,
192
+ onApplyCode: onScanCode,
193
+ codeDisabled: !code
194
+ }
195
+ );
196
+ };
197
+ var Voucher_default = VoucherCard;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Status: (props: any) => JSX.Element;
4
3
  export default Status;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Status: (props: any) => JSX.Element;
4
3
  export default Status;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const Resource: (props: any) => JSX.Element;
3
2
  export default Resource;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const Schedule: () => JSX.Element;
3
2
  export default Schedule;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare type Item = any;
4
3
  interface ProductItemProps {
@@ -0,0 +1,39 @@
1
+ import React from 'react';
2
+ import type { SkuValue } from '../../plus/skuOptionsSelection/types';
3
+ import './index.less';
4
+ /**
5
+ * @description Kiosk 商品详情(参考 Figma: Kiosk / Launchpad screen)
6
+ * - 默认从 URL query 读取商品 id(productId / product_id / id),内部通过 getProductDetail 拉取详情
7
+ * - 中间区域用 SKUOptionsSelection 做 SKU 选择
8
+ * - 底部用 PisellNumberSelector 做数量编辑
9
+ */
10
+ declare function KioskSkuDetail(props: KioskSkuDetailProps): JSX.Element;
11
+ export default KioskSkuDetail;
12
+ /**
13
+ * @description 从原生回调 payload 中提取 productId
14
+ */
15
+ export interface KioskSkuDetailProps {
16
+ /** 商品 id(可选:目前默认从 URL 读取,props 仅作为兜底以兼容老用法) */
17
+ productId?: number | string;
18
+ /**
19
+ * 可选:用于商品报价的日期(预约类商品)
20
+ * @deprecated 目前 kiosk 详情暂时固定取当天,这个参数暂不生效
21
+ */
22
+ scheduleDate?: string;
23
+ /** 自定义类名 */
24
+ className?: string;
25
+ /** 自定义样式 */
26
+ style?: React.CSSProperties;
27
+ /** 返回 */
28
+ onBack?: () => void;
29
+ /** 加入购物车 */
30
+ onAddToCart?: (params: {
31
+ product: any;
32
+ skuValue: SkuValue;
33
+ quantity: number;
34
+ unitPrice: number;
35
+ total: number;
36
+ currencySymbol: string;
37
+ bookingConfig?: any;
38
+ }) => void;
39
+ }
@@ -0,0 +1,393 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/components/kioskSkuDetail/index.tsx
30
+ var kioskSkuDetail_exports = {};
31
+ __export(kioskSkuDetail_exports, {
32
+ default: () => kioskSkuDetail_default
33
+ });
34
+ module.exports = __toCommonJS(kioskSkuDetail_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_decimal = __toESM(require("decimal.js"));
37
+ var import_classnames = __toESM(require("classnames"));
38
+ var import_materials = require("@pisell/materials");
39
+ var import_dayjs = __toESM(require("dayjs"));
40
+ var import_utils = require("@pisell/utils");
41
+ var import_skuOptionsSelection = __toESM(require("../../plus/skuOptionsSelection"));
42
+ var import_useEngineContext = __toESM(require("../../hooks/useEngineContext"));
43
+ var import_serve = require("../booking/info/service/serve");
44
+ var import_locales = __toESM(require("./locales"));
45
+ var import_index = require("./index.less");
46
+ var import_utils2 = require("../booking/utils");
47
+ function KioskSkuDetail(props) {
48
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
49
+ const { className, style, onAddToCart } = props;
50
+ const productIdFromUrl = (0, import_react.useMemo)(() => {
51
+ return getQueryFirstMatch({ keys: ["productId", "product_id", "id"] });
52
+ }, []);
53
+ const initialProductId = productIdFromUrl ?? props.productId ?? null;
54
+ const scheduleDate = (0, import_react.useMemo)(() => (0, import_dayjs.default)().format("YYYY-MM-DD"), []);
55
+ const stageScale = useDesignStageScale({ designWidth: 1080, designHeight: 1800 });
56
+ const context = (0, import_useEngineContext.default)();
57
+ const { interaction } = ((_a = context.appHelper) == null ? void 0 : _a.utils) || {};
58
+ import_utils.locales.init(import_locales.default, ((_c = (_b = context == null ? void 0 : context.engine) == null ? void 0 : _b.props) == null ? void 0 : _c.locale) || "en");
59
+ import_utils2.request.setRequest(context.appHelper.utils.request);
60
+ const { store, getData, Toast } = ((_d = context.appHelper) == null ? void 0 : _d.utils) || {};
61
+ const state = (_e = store == null ? void 0 : store.getState) == null ? void 0 : _e.call(store);
62
+ const symbol = ((_h = (_g = (_f = store == null ? void 0 : store.getState) == null ? void 0 : _f.call(store)) == null ? void 0 : _g.global) == null ? void 0 : _h.symbol) || "$";
63
+ const currency_code = ((_k = (_j = (_i = store == null ? void 0 : store.getState) == null ? void 0 : _i.call(store)) == null ? void 0 : _j.global) == null ? void 0 : _k.currency_code) || "AUD";
64
+ const [isLoading, setIsLoading] = (0, import_react.useState)(false);
65
+ const [errorText, setErrorText] = (0, import_react.useState)(null);
66
+ const [productData, setProductData] = (0, import_react.useState)(null);
67
+ const [quantity, setQuantity] = (0, import_react.useState)(1);
68
+ const [skuValue, setSkuValue] = (0, import_react.useState)({
69
+ product_id: 0,
70
+ product_variant_id: 0,
71
+ bundle: [],
72
+ option: []
73
+ });
74
+ const [skuDefaultValue, setSkuDefaultValue] = (0, import_react.useState)({
75
+ product_id: 0,
76
+ product_variant_id: 0,
77
+ bundle: [],
78
+ option: []
79
+ });
80
+ const [isEdit, setIsEdit] = (0, import_react.useState)(false);
81
+ const skuOptionsSelectionRef = (0, import_react.useRef)(null);
82
+ const requestSeqRef = (0, import_react.useRef)(0);
83
+ const resetForInit = (0, import_react.useCallback)(() => {
84
+ setProductData(null);
85
+ setErrorText(null);
86
+ setQuantity(1);
87
+ setSkuValue({
88
+ product_id: 0,
89
+ product_variant_id: 0,
90
+ bundle: [],
91
+ option: []
92
+ });
93
+ setSkuDefaultValue({
94
+ product_id: 0,
95
+ product_variant_id: 0,
96
+ bundle: [],
97
+ option: []
98
+ });
99
+ }, []);
100
+ const loadByProductId = (0, import_react.useCallback)(async (productId, options = {}) => {
101
+ var _a2, _b2;
102
+ console.log("准备 load", productId);
103
+ if (productId === null || typeof productId === "undefined" || productId === "") return;
104
+ const reqId = ++requestSeqRef.current;
105
+ setIsLoading(true);
106
+ setErrorText(null);
107
+ try {
108
+ const open_deposit = (getData == null ? void 0 : getData("bookingv2_deposit")) || 0;
109
+ const params = { open_deposit, "translate-locale": ((_b2 = (_a2 = context == null ? void 0 : context.engine) == null ? void 0 : _a2.props) == null ? void 0 : _b2.locale) || "en" };
110
+ params.schedule_date = scheduleDate;
111
+ const res = await (0, import_serve.getProductDetail)(String(productId), params);
112
+ console.log("详情接口");
113
+ console.log(JSON.stringify(res));
114
+ const apiData = ((res == null ? void 0 : res.id) ? res : res == null ? void 0 : res.data) || {};
115
+ if (reqId !== requestSeqRef.current) return;
116
+ setProductData(apiData);
117
+ console.log("已设置 productData");
118
+ const normalizedProductId = Number(
119
+ (apiData == null ? void 0 : apiData.product_id) || (apiData == null ? void 0 : apiData.id) || productId || 0
120
+ );
121
+ const minNumUnit = Number((apiData == null ? void 0 : apiData.min_num_unit) || 1);
122
+ if (options.shouldInitQuantity !== false) {
123
+ setQuantity(minNumUnit > 0 ? minNumUnit : 1);
124
+ }
125
+ const defaultVariantId = (() => {
126
+ var _a3, _b3;
127
+ const firstVariantId = Array.isArray(apiData == null ? void 0 : apiData.variant) ? Number(((_b3 = (_a3 = apiData == null ? void 0 : apiData.variant) == null ? void 0 : _a3[0]) == null ? void 0 : _b3.id) || 0) : 0;
128
+ return Number.isFinite(firstVariantId) ? firstVariantId : 0;
129
+ })();
130
+ const initialSkuValue = {
131
+ product_id: normalizedProductId,
132
+ product_variant_id: defaultVariantId,
133
+ bundle: [],
134
+ option: []
135
+ };
136
+ if (options.shouldInitSku !== false) {
137
+ setSkuValue(initialSkuValue);
138
+ setSkuDefaultValue(initialSkuValue);
139
+ setTimeout(() => {
140
+ var _a3;
141
+ if (initialSkuValue.product_variant_id) {
142
+ (_a3 = skuOptionsSelectionRef.current) == null ? void 0 : _a3.validate();
143
+ }
144
+ }, 0);
145
+ }
146
+ } catch (error) {
147
+ console.error(error);
148
+ setErrorText("Failed to load product detail");
149
+ } finally {
150
+ if (reqId !== requestSeqRef.current) return;
151
+ setIsLoading(false);
152
+ }
153
+ }, [getData, scheduleDate]);
154
+ const loadRef = (0, import_react.useRef)(loadByProductId);
155
+ loadRef.current = loadByProductId;
156
+ (0, import_react.useEffect)(() => {
157
+ var _a2, _b2, _c2, _d2, _e2, _f2;
158
+ (_b2 = (_a2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _a2.postMessageToApp) == null ? void 0 : _b2.call(_a2, {
159
+ module: "wallet_pass",
160
+ key: "page_load"
161
+ });
162
+ (_d2 = (_c2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _c2.mountFunction) == null ? void 0 : _d2.call(
163
+ _c2,
164
+ "wallet_pass",
165
+ "restore_buy_wallet_pass",
166
+ (id) => {
167
+ console.log("重置状态", id);
168
+ console.log("宽", window.innerWidth);
169
+ console.log("高", window.innerHeight);
170
+ console.log("设备像素比", window.devicePixelRatio);
171
+ resetForInit();
172
+ if (id || id === 0) loadRef.current(id);
173
+ setIsEdit(false);
174
+ }
175
+ );
176
+ (_f2 = (_e2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _e2.mountFunction) == null ? void 0 : _f2.call(
177
+ _e2,
178
+ "wallet_pass",
179
+ "edit_buy_wallet_pass",
180
+ (data) => {
181
+ console.log("编辑状态", data);
182
+ const productData2 = JSON.parse(data);
183
+ loadRef.current(productData2.productId, {
184
+ shouldInitSku: false,
185
+ shouldInitQuantity: false
186
+ });
187
+ setSkuValue({
188
+ product_id: productData2.productId,
189
+ product_variant_id: Number(productData2.variantId),
190
+ bundle: [],
191
+ option: []
192
+ });
193
+ setSkuDefaultValue({
194
+ product_id: productData2.productId,
195
+ product_variant_id: Number(productData2.variantId),
196
+ bundle: [],
197
+ option: []
198
+ });
199
+ setIsEdit(true);
200
+ }
201
+ );
202
+ if (initialProductId || initialProductId === 0) loadRef.current(initialProductId);
203
+ }, []);
204
+ const coverUrl = (0, import_react.useMemo)(() => {
205
+ return (productData == null ? void 0 : productData.cover) || (productData == null ? void 0 : productData.image) || "";
206
+ }, [productData]);
207
+ const titleText = (0, import_react.useMemo)(() => {
208
+ var _a2;
209
+ return (productData == null ? void 0 : productData.title) || ((_a2 = productData == null ? void 0 : productData._extend) == null ? void 0 : _a2.product_name) || (productData == null ? void 0 : productData.product_name) || "";
210
+ }, [productData]);
211
+ const descriptionText = (0, import_react.useMemo)(() => {
212
+ var _a2;
213
+ return (productData == null ? void 0 : productData.description) || (productData == null ? void 0 : productData.sub_title) || ((_a2 = productData == null ? void 0 : productData._extend) == null ? void 0 : _a2.sub_title) || "";
214
+ }, [productData]);
215
+ const unitPrice = (0, import_react.useMemo)(() => {
216
+ const selectedVariantId = Number((skuValue == null ? void 0 : skuValue.product_variant_id) || 0);
217
+ if (selectedVariantId && Array.isArray(productData == null ? void 0 : productData.variant)) {
218
+ const matched = productData.variant.find(
219
+ (item) => Number(item == null ? void 0 : item.id) === selectedVariantId
220
+ );
221
+ const vPrice = Number((matched == null ? void 0 : matched.price) || 0);
222
+ if (!Number.isNaN(vPrice) && vPrice !== 0) return vPrice;
223
+ }
224
+ return Number((productData == null ? void 0 : productData.price) || 0);
225
+ }, [productData, skuValue == null ? void 0 : skuValue.product_variant_id]);
226
+ const priceRangeText = (0, import_react.useMemo)(() => {
227
+ const variantPrices = Array.isArray(productData == null ? void 0 : productData.variant) ? productData.variant.map((v) => Number((v == null ? void 0 : v.price) || 0)).filter((n) => !Number.isNaN(n) && n > 0) : [];
228
+ const base = Number((productData == null ? void 0 : productData.price) || 0);
229
+ const all = [...variantPrices, ...base > 0 ? [base] : []];
230
+ if (all.length === 0) return "";
231
+ const min = Math.min(...all);
232
+ const max = Math.max(...all);
233
+ if (min === max) return `${symbol}${min.toFixed(2)}`;
234
+ return `${symbol}${min.toFixed(2)}-${symbol}${max.toFixed(2)}`;
235
+ }, [productData, symbol]);
236
+ const itemTotal = (0, import_react.useMemo)(() => {
237
+ const deUnit = new import_decimal.default(unitPrice || 0);
238
+ const deQty = new import_decimal.default(quantity || 0);
239
+ return deUnit.mul(deQty).toNumber();
240
+ }, [quantity, unitPrice]);
241
+ const itemTotalText = (0, import_react.useMemo)(() => {
242
+ const deTotal = new import_decimal.default(itemTotal || 0);
243
+ const priceSign = deTotal.toNumber() < 0 ? "-" : "";
244
+ return `${priceSign}${symbol}${deTotal.abs().toNumber().toFixed(2)}`;
245
+ }, [itemTotal, symbol]);
246
+ const handleAddToCart = () => {
247
+ var _a2;
248
+ if (!productData) return;
249
+ (_a2 = skuOptionsSelectionRef.current) == null ? void 0 : _a2.validate();
250
+ if (!skuValue.product_variant_id) {
251
+ Toast.info(import_utils.locales.getText("pisell2.text.kiosk.sku.detail.toast.select.variant"));
252
+ return;
253
+ }
254
+ ;
255
+ const obj = {
256
+ productDetail: productData,
257
+ quantity,
258
+ variantId: skuValue.product_variant_id,
259
+ pricePerUnit: unitPrice,
260
+ isWebBuyWalletPass: true
261
+ };
262
+ interaction.utils.postMessageToApp({
263
+ module: "wallet_pass",
264
+ key: "buy_wallet_pass",
265
+ data: {
266
+ // 把洗好的数据放这里
267
+ productData: obj,
268
+ isEdit
269
+ }
270
+ });
271
+ };
272
+ const onBack = () => {
273
+ interaction.utils.postMessageToApp({
274
+ module: "wallet_pass",
275
+ key: "back"
276
+ });
277
+ };
278
+ const stageStyle = (0, import_react.useMemo)(() => {
279
+ return {
280
+ ...style || {},
281
+ width: 1080,
282
+ height: 1800,
283
+ transform: `translateX(-50%) scale(${stageScale})`,
284
+ transformOrigin: "top center"
285
+ };
286
+ }, [stageScale, style]);
287
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail-viewport" }, /* @__PURE__ */ import_react.default.createElement(
288
+ "div",
289
+ {
290
+ className: (0, import_classnames.default)("pisell-kiosk-sku-detail", className),
291
+ style: stageStyle
292
+ },
293
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__hero" }, coverUrl ? /* @__PURE__ */ import_react.default.createElement(
294
+ "img",
295
+ {
296
+ className: "pisell-kiosk-sku-detail__hero-img",
297
+ src: coverUrl,
298
+ alt: titleText || "product"
299
+ }
300
+ ) : /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__hero-placeholder" })), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__header" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__title" }, titleText || (isLoading ? "Loading…" : "")), !!descriptionText && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__desc" }, /* @__PURE__ */ import_react.default.createElement(
301
+ "div",
302
+ {
303
+ dangerouslySetInnerHTML: {
304
+ __html: descriptionText
305
+ }
306
+ }
307
+ )), !!priceRangeText && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__price-range" }, priceRangeText, " ", currency_code), !!errorText && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__error" }, errorText)), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__options-card" }, productData && Array.isArray(productData == null ? void 0 : productData.variant) && productData.variant.length > 0 ? /* @__PURE__ */ import_react.default.createElement(
308
+ import_skuOptionsSelection.default,
309
+ {
310
+ ref: skuOptionsSelectionRef,
311
+ dataSource: productData,
312
+ value: skuDefaultValue,
313
+ skuCardConfig: {
314
+ price: {
315
+ visible: true
316
+ },
317
+ variantPriceVisible: true
318
+ },
319
+ onChange: (v) => {
320
+ setSkuValue(v);
321
+ },
322
+ customScrollParent: ".pisell-kiosk-sku-detail"
323
+ }
324
+ ) : /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__options-loading" }, isLoading ? import_utils.locales.getText(
325
+ "pisell2.text.kiosk.sku.detail.loading.options"
326
+ ) : ""))),
327
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__footer" }, /* @__PURE__ */ import_react.default.createElement(
328
+ import_materials.Button,
329
+ {
330
+ className: "pisell-kiosk-sku-detail__back-btn",
331
+ size: "large",
332
+ onClick: onBack
333
+ },
334
+ import_utils.locales.getText("pisell2.text.kiosk.sku.detail.btn.back")
335
+ ), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__footer-center" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-kiosk-sku-detail__item-total" }, import_utils.locales.getText("pisell2.text.kiosk.sku.detail.item.total"), ":", " ", itemTotalText)), /* @__PURE__ */ import_react.default.createElement(
336
+ import_materials.Button,
337
+ {
338
+ type: "primary",
339
+ className: "pisell-kiosk-sku-detail__add-btn",
340
+ size: "large",
341
+ onClick: handleAddToCart,
342
+ disabled: !productData || isLoading
343
+ },
344
+ import_utils.locales.getText(
345
+ isEdit ? "pisell2.text.kiosk.sku.detail.btn.update" : "pisell2.text.kiosk.sku.detail.btn.add.to.cart"
346
+ )
347
+ ))
348
+ ));
349
+ }
350
+ var kioskSkuDetail_default = KioskSkuDetail;
351
+ function getQueryFirstMatch(params) {
352
+ var _a;
353
+ if (typeof window === "undefined") return null;
354
+ if (!((_a = params == null ? void 0 : params.keys) == null ? void 0 : _a.length)) return null;
355
+ const keys = params.keys;
356
+ const tryRead = (raw) => {
357
+ if (!raw) return null;
358
+ const normalized = raw.startsWith("?") ? raw.slice(1) : raw;
359
+ const searchParams = new URLSearchParams(normalized);
360
+ for (const key of keys) {
361
+ const value = searchParams.get(key);
362
+ if (value) return value;
363
+ }
364
+ return null;
365
+ };
366
+ const fromSearch = tryRead(window.location.search || "");
367
+ if (fromSearch) return fromSearch;
368
+ const hash = window.location.hash || "";
369
+ const queryIndex = hash.indexOf("?");
370
+ if (queryIndex === -1) return null;
371
+ return tryRead(hash.slice(queryIndex + 1));
372
+ }
373
+ function useDesignStageScale(params) {
374
+ const designWidth = params.designWidth;
375
+ const designHeight = params.designHeight;
376
+ const [scale, setScale] = (0, import_react.useState)(1);
377
+ (0, import_react.useEffect)(() => {
378
+ const update = () => {
379
+ const viewportWidth = window.innerWidth || designWidth;
380
+ const viewportHeight = window.innerHeight || designHeight;
381
+ const nextScale = Math.min(
382
+ viewportWidth / designWidth,
383
+ viewportHeight / designHeight,
384
+ 1
385
+ );
386
+ setScale(nextScale);
387
+ };
388
+ update();
389
+ window.addEventListener("resize", update);
390
+ return () => window.removeEventListener("resize", update);
391
+ }, [designHeight, designWidth]);
392
+ return scale;
393
+ }