@pisell/private-materials 6.12.168 → 6.12.170

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 (275) 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/meta.js +1 -1
  5. package/build/lowcode/render/default/view.css +1 -1
  6. package/build/lowcode/render/default/view.js +10 -10
  7. package/build/lowcode/view.css +1 -1
  8. package/build/lowcode/view.js +10 -10
  9. package/es/components/HDLKiosk/{contracts → app/contracts}/config.js +1 -1
  10. package/es/components/HDLKiosk/app/manifest.js +11 -11
  11. package/es/components/HDLKiosk/app/operations.js +92 -0
  12. package/es/components/HDLKiosk/app/workflow/barcode.js +7 -3
  13. package/es/components/HDLKiosk/app/workflow/index.js +16 -0
  14. package/es/components/HDLKiosk/app/workflow/predicates.js +1 -1
  15. package/es/components/HDLKiosk/app/workflow/quick.js +1 -1
  16. package/es/components/HDLKiosk/app/workflow/registry.js +4 -4
  17. package/es/components/HDLKiosk/app/workflow/scale.js +5 -1
  18. package/es/components/HDLKiosk/components/common/HDLKioskSkuOptionsSelection/index.less +1 -1
  19. package/es/components/HDLKiosk/components/overlays/HDLKioskModal/index.less +1 -1
  20. package/es/components/HDLKiosk/components/shell/HDLKioskBottomBarHost/index.js +4 -1
  21. package/es/components/HDLKiosk/docs/00-/346/226/207/344/273/266/345/257/274/350/210/252.md +104 -167
  22. package/es/components/HDLKiosk/docs/01-/346/240/270/345/277/203/350/277/220/350/241/214/346/234/272/345/210/266.md +95 -89
  23. package/es/components/HDLKiosk/docs/02-Host/351/200/202/351/205/215/344/270/216/344/270/232/345/212/241/346/225/260/346/215/256.md +20 -19
  24. package/es/components/HDLKiosk/docs/04-/350/256/276/345/244/207/344/270/216/347/247/260/351/207/215.md +43 -26
  25. package/es/components/HDLKiosk/docs/05-/344/272/244/346/230/223/345/256/211/345/205/250.md +2 -0
  26. package/es/components/HDLKiosk/docs/08-/346/227/240/345/244/264Application/350/277/220/350/241/214/346/227/266/351/207/215/346/236/204/350/256/276/350/256/241.md +719 -0
  27. package/es/components/HDLKiosk/docs/09-Entry/350/256/276/345/244/207/344/272/213/344/273/266/351/207/215/346/236/204/344/277/256/345/244/215/346/212/245/345/221/212.md +187 -0
  28. package/es/components/HDLKiosk/docs/README.md +6 -2
  29. package/es/components/HDLKiosk/docs//345/256/236/346/226/275/350/277/233/345/272/246.md +8 -7
  30. package/es/components/HDLKiosk/docs//346/236/266/346/236/204/350/256/276/350/256/241.md +16 -18
  31. package/es/components/HDLKiosk/index.js +32 -30
  32. package/es/components/HDLKiosk/index.less +8 -3
  33. package/es/components/HDLKiosk/kernel/README.md +13 -12
  34. package/es/components/HDLKiosk/kernel/application/defineApplication.js +63 -24
  35. package/es/components/HDLKiosk/kernel/application/defineSlice.js +6 -6
  36. package/es/components/HDLKiosk/kernel/application/runtime.js +237 -0
  37. package/es/components/HDLKiosk/kernel/operations/coordinator.js +1 -1
  38. package/es/components/HDLKiosk/kernel/operations/registry.js +3 -3
  39. package/es/components/HDLKiosk/kernel/operations/sessionEpoch.js +1 -1
  40. package/es/components/HDLKiosk/kernel/operations/types.js +7 -3
  41. package/es/components/HDLKiosk/kernel/workflow/actor.js +16 -17
  42. package/es/components/HDLKiosk/kernel/workflow/compiler.js +14 -16
  43. package/es/components/HDLKiosk/runtime/createRuntime.js +238 -0
  44. package/es/components/HDLKiosk/{devices → runtime/devices}/dedupeStore.js +1 -1
  45. package/es/components/HDLKiosk/{devices → runtime/devices}/scaleIngress.js +1 -1
  46. package/es/components/HDLKiosk/{devices/scale/runtime.js → runtime/devices/scaleStore.js} +18 -24
  47. package/es/components/HDLKiosk/{devices → runtime/devices}/scannerIngress.js +1 -1
  48. package/es/components/HDLKiosk/runtime/devices/scannerSessionPort.js +60 -0
  49. package/es/components/HDLKiosk/runtime/devices/scannerSessionRouter.js +212 -0
  50. package/es/components/HDLKiosk/runtime/operations/barcode.js +18 -0
  51. package/es/components/HDLKiosk/runtime/operations/cart.js +44 -0
  52. package/es/components/HDLKiosk/{app → runtime}/operations/cartConsistency.js +1 -1
  53. package/es/components/HDLKiosk/{app → runtime}/operations/checkout.js +95 -110
  54. package/es/components/HDLKiosk/{app → runtime}/operations/checkoutRequirements.js +1 -1
  55. package/es/components/HDLKiosk/{app → runtime}/operations/checkoutSafety.js +1 -1
  56. package/es/components/HDLKiosk/{app → runtime}/operations/coordinator.js +2 -2
  57. package/es/components/HDLKiosk/runtime/operations/customization.js +70 -0
  58. package/es/components/HDLKiosk/{app → runtime}/operations/errors.js +1 -1
  59. package/es/components/HDLKiosk/runtime/operations/fulfillment.js +6 -0
  60. package/es/components/HDLKiosk/runtime/operations/identity.js +55 -0
  61. package/es/components/HDLKiosk/runtime/operations/registry.js +34 -0
  62. package/es/components/HDLKiosk/runtime/operations/session.js +29 -0
  63. package/es/components/HDLKiosk/runtime/operations/types.js +13 -0
  64. package/es/components/HDLKiosk/runtime/session/blockPolicy.js +14 -0
  65. package/es/components/HDLKiosk/runtime/{createWorkflowSession.js → session/createSession.js} +67 -17
  66. package/es/components/HDLKiosk/runtime/{domainTransitionRunner.js → session/transitionRunner.js} +10 -5
  67. package/es/components/HDLKiosk/runtime/{workflowContext.js → session/workflowContext.js} +2 -2
  68. package/es/components/HDLKiosk/runtime/{workflowLifecycle.js → session/workflowLifecycle.js} +2 -2
  69. package/es/components/HDLKiosk/runtime/triggers.js +28 -0
  70. package/es/components/HDLKiosk/slices/catalog/Screen/index.js +15 -8
  71. package/es/components/HDLKiosk/slices/catalog/Screen/index.less +74 -13
  72. package/es/components/HDLKiosk/slices/catalog/slice.js +2 -2
  73. package/es/components/HDLKiosk/slices/customization/Screen/index.js +34 -35
  74. package/es/components/HDLKiosk/slices/customization/Screen/index.less +5 -0
  75. package/es/components/HDLKiosk/slices/customization/slice.js +2 -3
  76. package/es/components/HDLKiosk/slices/fulfillment/slice.js +2 -2
  77. package/es/components/HDLKiosk/slices/fulfillment/view.js +1 -1
  78. package/es/components/HDLKiosk/slices/identity/Screen/index.less +1 -1
  79. package/es/components/HDLKiosk/slices/identity/slice.js +2 -2
  80. package/es/components/HDLKiosk/slices/identity/view.js +1 -1
  81. package/es/components/HDLKiosk/slices/payment/Screen/index.less +1 -1
  82. package/es/components/HDLKiosk/slices/payment/slice.js +3 -3
  83. package/es/components/HDLKiosk/slices/primaryProductPrompt/slice.js +1 -1
  84. package/es/components/HDLKiosk/{runtime → ui}/HDLKioskWorkflowView.js +68 -129
  85. package/es/components/HDLKiosk/ui/ScaleSimulatorConsole/index.js +387 -0
  86. package/es/components/HDLKiosk/ui/ScaleSimulatorConsole/index.less +621 -0
  87. package/es/components/HDLKiosk/{app → ui}/ScreenRenderer.js +1 -1
  88. package/es/components/HDLKiosk/ui/collaborationStatus.js +11 -0
  89. package/es/components/HDLKiosk/ui/controllers/useHDLKioskActionDispatcher.js +66 -0
  90. package/es/components/HDLKiosk/{runtime → ui}/controllers/useHDLKioskCustomerController.js +1 -1
  91. package/es/components/HDLKiosk/ui/controllers/useHDLKioskDeviceController.js +25 -0
  92. package/es/components/HDLKiosk/ui/controllers/useHDLKioskExitController.js +53 -0
  93. package/es/components/HDLKiosk/{runtime → ui}/controllers/useHDLKioskScreenData.js +1 -1
  94. package/es/components/HDLKiosk/ui/controllers/useHDLKioskSessionController.js +39 -0
  95. package/es/components/HDLKiosk/{app → ui}/entry/Screen/index.js +8 -6
  96. package/es/components/HDLKiosk/{app → ui}/entry/model.js +2 -2
  97. package/es/components/HDLKiosk/ui/scale.js +20 -0
  98. package/es/components/HDLKiosk/{runtime/useHostSnapshot.js → ui/snapshots.js} +6 -8
  99. package/es/components/HDLKiosk/{app → ui}/views.js +1 -1
  100. package/es/components/HDLKiosk/{runtime → ui}/workflowEvent.js +1 -1
  101. package/es/components/HDLKiosk/utils.js +4 -4
  102. package/es/components/bigSale/templates/HDLKiosk/README.md +43 -0
  103. package/es/components/bigSale/templates/HDLKiosk/adapter/createHost.js +7 -7
  104. package/es/components/bigSale/templates/HDLKiosk/adapter/{devices.js → devices/devicePort.js} +10 -38
  105. package/es/components/bigSale/templates/HDLKiosk/adapter/{capabilities.js → host/capabilities.js} +2 -2
  106. package/es/components/bigSale/templates/HDLKiosk/adapter/{fulfillment.js → host/fulfillmentWriter.js} +3 -3
  107. package/es/components/bigSale/templates/HDLKiosk/adapter/{projection.js → host/projection.js} +24 -14
  108. package/es/components/bigSale/templates/HDLKiosk/adapter/{telemetry.js → host/telemetry.js} +1 -1
  109. package/es/components/bigSale/templates/HDLKiosk/adapter/sales/cart.js +187 -0
  110. package/es/components/bigSale/templates/HDLKiosk/adapter/sales/catalog.js +160 -0
  111. package/es/components/bigSale/templates/HDLKiosk/adapter/{customizationProduct.js → sales/customizationProduct.js} +3 -3
  112. package/es/components/bigSale/templates/HDLKiosk/adapter/sales/fulfillment.js +31 -0
  113. package/es/components/bigSale/templates/HDLKiosk/adapter/sales/identity.js +57 -0
  114. package/es/components/bigSale/templates/HDLKiosk/adapter/sales/index.js +18 -0
  115. package/es/components/bigSale/templates/HDLKiosk/adapter/sales/payment.js +123 -0
  116. package/es/components/bigSale/templates/HDLKiosk/adapter/sales/session.js +71 -0
  117. package/es/components/bigSale/templates/HDLKiosk/adapter/sales/weightedOperations.js +124 -0
  118. package/es/components/bigSale/templates/HDLKiosk/adapter/{weightedProduct.js → sales/weightedProduct.js} +2 -2
  119. package/es/components/bigSale/templates/HDLKiosk/adapter/useBigSaleHDLKioskAdapter.js +41 -0
  120. package/es/components/bigSale/templates/HDLKiosk/adapter/useBigSaleHDLKioskHost.js +10 -7
  121. package/es/components/bigSale/templates/HDLKiosk/cart/useBigSaleHDLKioskCart.js +122 -0
  122. package/es/components/bigSale/templates/HDLKiosk/{adapter → hooks}/useHDLKioskEntryPreparationToast.js +2 -1
  123. package/es/components/bigSale/templates/HDLKiosk/index.js +42 -148
  124. package/es/components/bigSale/templates/HDLKiosk/{adapter/scaleTrigger.js → runtime/BigSaleScaleRuntimeOwner.js} +33 -62
  125. package/es/components/bigSale/templates/HDLKiosk/{adapter → runtime}/HDLKioskPaymentRuntime.js +4 -3
  126. package/es/components/bigSale/templates/HDLKiosk/runtime/scaleBridge.js +44 -0
  127. package/lib/components/HDLKiosk/{contracts → app/contracts}/config.js +1 -1
  128. package/lib/components/HDLKiosk/app/manifest.js +18 -19
  129. package/lib/components/HDLKiosk/app/operations.js +105 -0
  130. package/lib/components/HDLKiosk/app/workflow/barcode.js +7 -3
  131. package/lib/components/HDLKiosk/app/workflow/index.js +16 -0
  132. package/lib/components/HDLKiosk/app/workflow/predicates.js +1 -0
  133. package/lib/components/HDLKiosk/app/workflow/quick.js +1 -1
  134. package/lib/components/HDLKiosk/app/workflow/registry.js +3 -3
  135. package/lib/components/HDLKiosk/app/workflow/scale.js +5 -1
  136. package/lib/components/HDLKiosk/components/common/HDLKioskSkuOptionsSelection/index.less +1 -1
  137. package/lib/components/HDLKiosk/components/overlays/HDLKioskModal/index.less +1 -1
  138. package/lib/components/HDLKiosk/components/shell/HDLKioskBottomBarHost/index.js +4 -1
  139. package/lib/components/HDLKiosk/docs/00-/346/226/207/344/273/266/345/257/274/350/210/252.md +104 -167
  140. package/lib/components/HDLKiosk/docs/01-/346/240/270/345/277/203/350/277/220/350/241/214/346/234/272/345/210/266.md +95 -89
  141. package/lib/components/HDLKiosk/docs/02-Host/351/200/202/351/205/215/344/270/216/344/270/232/345/212/241/346/225/260/346/215/256.md +20 -19
  142. package/lib/components/HDLKiosk/docs/04-/350/256/276/345/244/207/344/270/216/347/247/260/351/207/215.md +43 -26
  143. package/lib/components/HDLKiosk/docs/05-/344/272/244/346/230/223/345/256/211/345/205/250.md +2 -0
  144. package/lib/components/HDLKiosk/docs/08-/346/227/240/345/244/264Application/350/277/220/350/241/214/346/227/266/351/207/215/346/236/204/350/256/276/350/256/241.md +719 -0
  145. package/lib/components/HDLKiosk/docs/09-Entry/350/256/276/345/244/207/344/272/213/344/273/266/351/207/215/346/236/204/344/277/256/345/244/215/346/212/245/345/221/212.md +187 -0
  146. package/lib/components/HDLKiosk/docs/README.md +6 -2
  147. package/lib/components/HDLKiosk/docs//345/256/236/346/226/275/350/277/233/345/272/246.md +8 -7
  148. package/lib/components/HDLKiosk/docs//346/236/266/346/236/204/350/256/276/350/256/241.md +16 -18
  149. package/lib/components/HDLKiosk/index.js +35 -33
  150. package/lib/components/HDLKiosk/index.less +8 -3
  151. package/lib/components/HDLKiosk/kernel/README.md +13 -12
  152. package/lib/components/HDLKiosk/kernel/application/defineApplication.js +65 -25
  153. package/lib/components/HDLKiosk/kernel/application/defineSlice.js +6 -6
  154. package/lib/components/HDLKiosk/kernel/application/runtime.js +237 -0
  155. package/lib/components/HDLKiosk/kernel/operations/coordinator.js +1 -1
  156. package/lib/components/HDLKiosk/kernel/operations/registry.js +3 -3
  157. package/lib/components/HDLKiosk/kernel/operations/sessionEpoch.js +1 -1
  158. package/lib/components/HDLKiosk/kernel/operations/types.js +8 -3
  159. package/lib/components/HDLKiosk/kernel/workflow/actor.js +16 -17
  160. package/lib/components/HDLKiosk/kernel/workflow/compiler.js +14 -16
  161. package/lib/components/HDLKiosk/runtime/createRuntime.js +239 -0
  162. package/lib/components/HDLKiosk/{devices → runtime/devices}/dedupeStore.js +1 -1
  163. package/lib/components/HDLKiosk/{devices → runtime/devices}/scaleIngress.js +1 -1
  164. package/lib/components/HDLKiosk/{devices/scale/runtime.js → runtime/devices/scaleStore.js} +17 -27
  165. package/lib/components/HDLKiosk/{devices → runtime/devices}/scannerIngress.js +1 -1
  166. package/lib/components/HDLKiosk/runtime/devices/scannerSessionPort.js +60 -0
  167. package/lib/components/HDLKiosk/runtime/devices/scannerSessionRouter.js +212 -0
  168. package/lib/components/HDLKiosk/runtime/operations/barcode.js +17 -0
  169. package/lib/components/HDLKiosk/runtime/operations/cart.js +46 -0
  170. package/lib/components/HDLKiosk/{app → runtime}/operations/cartConsistency.js +1 -1
  171. package/lib/components/HDLKiosk/{app → runtime}/operations/checkout.js +97 -112
  172. package/lib/components/HDLKiosk/{app → runtime}/operations/checkoutRequirements.js +1 -1
  173. package/lib/components/HDLKiosk/{app → runtime}/operations/checkoutSafety.js +1 -1
  174. package/lib/components/HDLKiosk/{app → runtime}/operations/coordinator.js +2 -2
  175. package/lib/components/HDLKiosk/runtime/operations/customization.js +73 -0
  176. package/lib/components/HDLKiosk/{app → runtime}/operations/errors.js +1 -1
  177. package/lib/components/HDLKiosk/runtime/operations/fulfillment.js +5 -0
  178. package/lib/components/HDLKiosk/runtime/operations/identity.js +55 -0
  179. package/lib/components/HDLKiosk/runtime/operations/registry.js +34 -0
  180. package/lib/components/HDLKiosk/runtime/operations/session.js +30 -0
  181. package/lib/components/HDLKiosk/runtime/operations/types.js +14 -0
  182. package/lib/components/HDLKiosk/runtime/session/blockPolicy.js +14 -0
  183. package/lib/components/HDLKiosk/runtime/{createWorkflowSession.js → session/createSession.js} +71 -21
  184. package/lib/components/HDLKiosk/runtime/{domainTransitionRunner.js → session/transitionRunner.js} +10 -5
  185. package/lib/components/HDLKiosk/runtime/{workflowContext.js → session/workflowContext.js} +2 -2
  186. package/lib/components/HDLKiosk/runtime/{workflowLifecycle.js → session/workflowLifecycle.js} +2 -2
  187. package/lib/components/HDLKiosk/runtime/triggers.js +28 -0
  188. package/lib/components/HDLKiosk/slices/catalog/Screen/index.js +15 -8
  189. package/lib/components/HDLKiosk/slices/catalog/Screen/index.less +74 -13
  190. package/lib/components/HDLKiosk/slices/catalog/slice.js +3 -3
  191. package/lib/components/HDLKiosk/slices/customization/Screen/index.js +35 -36
  192. package/lib/components/HDLKiosk/slices/customization/Screen/index.less +5 -0
  193. package/lib/components/HDLKiosk/slices/customization/slice.js +5 -6
  194. package/lib/components/HDLKiosk/slices/fulfillment/slice.js +3 -3
  195. package/lib/components/HDLKiosk/slices/fulfillment/view.js +1 -1
  196. package/lib/components/HDLKiosk/slices/identity/Screen/index.less +1 -1
  197. package/lib/components/HDLKiosk/slices/identity/slice.js +4 -4
  198. package/lib/components/HDLKiosk/slices/identity/view.js +1 -1
  199. package/lib/components/HDLKiosk/slices/payment/Screen/index.less +1 -1
  200. package/lib/components/HDLKiosk/slices/payment/slice.js +5 -5
  201. package/lib/components/HDLKiosk/slices/primaryProductPrompt/slice.js +1 -1
  202. package/lib/components/HDLKiosk/{runtime → ui}/HDLKioskWorkflowView.js +69 -130
  203. package/lib/components/HDLKiosk/ui/ScaleSimulatorConsole/index.js +390 -0
  204. package/lib/components/HDLKiosk/ui/ScaleSimulatorConsole/index.less +621 -0
  205. package/lib/components/HDLKiosk/{app → ui}/ScreenRenderer.js +1 -1
  206. package/lib/components/HDLKiosk/ui/collaborationStatus.js +11 -0
  207. package/lib/components/HDLKiosk/ui/controllers/useHDLKioskActionDispatcher.js +67 -0
  208. package/lib/components/HDLKiosk/{runtime → ui}/controllers/useHDLKioskCustomerController.js +1 -1
  209. package/lib/components/HDLKiosk/ui/controllers/useHDLKioskDeviceController.js +26 -0
  210. package/lib/components/HDLKiosk/ui/controllers/useHDLKioskExitController.js +54 -0
  211. package/lib/components/HDLKiosk/{runtime → ui}/controllers/useHDLKioskScreenData.js +1 -1
  212. package/lib/components/HDLKiosk/ui/controllers/useHDLKioskSessionController.js +40 -0
  213. package/lib/components/HDLKiosk/{app → ui}/entry/Screen/index.js +8 -6
  214. package/lib/components/HDLKiosk/{app → ui}/entry/model.js +2 -2
  215. package/lib/components/HDLKiosk/ui/scale.js +24 -0
  216. package/lib/components/HDLKiosk/{runtime/useHostSnapshot.js → ui/snapshots.js} +6 -7
  217. package/lib/components/HDLKiosk/{app → ui}/views.js +1 -1
  218. package/lib/components/HDLKiosk/{runtime → ui}/workflowEvent.js +1 -1
  219. package/lib/components/HDLKiosk/utils.js +4 -4
  220. package/lib/components/bigSale/templates/HDLKiosk/README.md +43 -0
  221. package/lib/components/bigSale/templates/HDLKiosk/adapter/createHost.js +9 -9
  222. package/lib/components/bigSale/templates/HDLKiosk/adapter/{devices.js → devices/devicePort.js} +10 -38
  223. package/lib/components/bigSale/templates/HDLKiosk/adapter/{capabilities.js → host/capabilities.js} +2 -2
  224. package/lib/components/bigSale/templates/HDLKiosk/adapter/{fulfillment.js → host/fulfillmentWriter.js} +3 -3
  225. package/lib/components/bigSale/templates/HDLKiosk/adapter/{projection.js → host/projection.js} +25 -14
  226. package/lib/components/bigSale/templates/HDLKiosk/adapter/{telemetry.js → host/telemetry.js} +1 -1
  227. package/lib/components/bigSale/templates/HDLKiosk/adapter/sales/cart.js +189 -0
  228. package/lib/components/bigSale/templates/HDLKiosk/adapter/sales/catalog.js +162 -0
  229. package/lib/components/bigSale/templates/HDLKiosk/adapter/{customizationProduct.js → sales/customizationProduct.js} +4 -4
  230. package/lib/components/bigSale/templates/HDLKiosk/adapter/sales/fulfillment.js +31 -0
  231. package/lib/components/bigSale/templates/HDLKiosk/adapter/sales/identity.js +57 -0
  232. package/lib/components/bigSale/templates/HDLKiosk/adapter/sales/index.js +18 -0
  233. package/lib/components/bigSale/templates/HDLKiosk/adapter/sales/payment.js +123 -0
  234. package/lib/components/bigSale/templates/HDLKiosk/adapter/sales/session.js +71 -0
  235. package/lib/components/bigSale/templates/HDLKiosk/adapter/sales/weightedOperations.js +126 -0
  236. package/lib/components/bigSale/templates/HDLKiosk/adapter/{weightedProduct.js → sales/weightedProduct.js} +3 -3
  237. package/lib/components/bigSale/templates/HDLKiosk/adapter/useBigSaleHDLKioskAdapter.js +42 -0
  238. package/lib/components/bigSale/templates/HDLKiosk/adapter/useBigSaleHDLKioskHost.js +10 -7
  239. package/lib/components/bigSale/templates/HDLKiosk/cart/useBigSaleHDLKioskCart.js +124 -0
  240. package/lib/components/bigSale/templates/HDLKiosk/{adapter → hooks}/useHDLKioskEntryPreparationToast.js +2 -1
  241. package/lib/components/bigSale/templates/HDLKiosk/index.js +43 -149
  242. package/lib/components/bigSale/templates/HDLKiosk/{adapter/scaleTrigger.js → runtime/BigSaleScaleRuntimeOwner.js} +31 -61
  243. package/lib/components/bigSale/templates/HDLKiosk/{adapter → runtime}/HDLKioskPaymentRuntime.js +4 -3
  244. package/lib/components/bigSale/templates/HDLKiosk/runtime/scaleBridge.js +44 -0
  245. package/package.json +2 -2
  246. package/es/components/HDLKiosk/app/constants.js +0 -9
  247. package/es/components/HDLKiosk/app/operations/barcode.js +0 -22
  248. package/es/components/HDLKiosk/app/operations/cart.js +0 -60
  249. package/es/components/HDLKiosk/app/operations/fulfillment.js +0 -11
  250. package/es/components/HDLKiosk/app/operations/session.js +0 -41
  251. package/es/components/HDLKiosk/app/operations/types.js +0 -11
  252. package/es/components/HDLKiosk/devices/entryArbiter.js +0 -33
  253. package/es/components/HDLKiosk/runtime/controllers/useHDLKioskDeviceController.js +0 -75
  254. package/es/components/HDLKiosk/runtime/controllers/useHDLKioskScannerController.js +0 -160
  255. package/es/components/HDLKiosk/runtime/controllers/useHDLKioskSessionController.js +0 -185
  256. package/es/components/HDLKiosk/runtime/useWorkflowSnapshot.js +0 -12
  257. package/es/components/HDLKiosk/slices/customization/operation.js +0 -80
  258. package/es/components/HDLKiosk/slices/identity/operation.js +0 -60
  259. package/es/components/bigSale/templates/HDLKiosk/adapter/sales.js +0 -692
  260. package/lib/components/HDLKiosk/app/constants.js +0 -9
  261. package/lib/components/HDLKiosk/app/operations/barcode.js +0 -21
  262. package/lib/components/HDLKiosk/app/operations/cart.js +0 -62
  263. package/lib/components/HDLKiosk/app/operations/fulfillment.js +0 -10
  264. package/lib/components/HDLKiosk/app/operations/session.js +0 -42
  265. package/lib/components/HDLKiosk/app/operations/types.js +0 -12
  266. package/lib/components/HDLKiosk/devices/entryArbiter.js +0 -33
  267. package/lib/components/HDLKiosk/runtime/controllers/useHDLKioskDeviceController.js +0 -76
  268. package/lib/components/HDLKiosk/runtime/controllers/useHDLKioskScannerController.js +0 -161
  269. package/lib/components/HDLKiosk/runtime/controllers/useHDLKioskSessionController.js +0 -186
  270. package/lib/components/HDLKiosk/runtime/useWorkflowSnapshot.js +0 -13
  271. package/lib/components/HDLKiosk/slices/customization/operation.js +0 -83
  272. package/lib/components/HDLKiosk/slices/identity/operation.js +0 -60
  273. package/lib/components/bigSale/templates/HDLKiosk/adapter/sales.js +0 -694
  274. /package/es/components/HDLKiosk/{app → ui}/entry/Screen/index.less +0 -0
  275. /package/lib/components/HDLKiosk/{app → ui}/entry/Screen/index.less +0 -0
@@ -0,0 +1,124 @@
1
+ import { _objectSpread2 } from "../../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
2
+ import { _asyncToGenerator } from "../../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js";
3
+ import { buildProductSkuPatch, resolvePatchProductOptions } from "../../../../../../plus/salesSdk/utils/productSkuOptions.js";
4
+ import { pickIdentity } from "../../../../../../plus/salesSdk/utils/identity.js";
5
+ import { buildProductLineUpdates } from "../../../../../../plus/salesSdk/utils/buildProductLineUpdates.js";
6
+ import { resolveHDLWeightedProduct } from "../../../../../HDLKiosk/product.js";
7
+ import { failed, partialFailure, unknown } from "../normalize.js";
8
+ import { queryPrimaryProduct } from "./catalog.js";
9
+ import { findCartLine, projectConfirmedMutationLine } from "./cart.js";
10
+ import { createHDLPrimaryWeightedPreparedProduct } from "./customizationProduct.js";
11
+ import Decimal from "decimal.js";
12
+ //#region src/components/bigSale/templates/HDLKiosk/adapter/sales/weightedOperations.ts
13
+ /** Primary weighted-product add/update operations. */
14
+ function resolveCartProduct(line) {
15
+ var _line$_extend;
16
+ return "product_id" in line ? line : (_line$_extend = line._extend) === null || _line$_extend === void 0 ? void 0 : _line$_extend.product;
17
+ }
18
+ function hasRequestedWeight(product, requestedWeightKg) {
19
+ var _product$product_sku$, _product$product_sku;
20
+ const actual = new Decimal((_product$product_sku$ = (_product$product_sku = product.product_sku) === null || _product$product_sku === void 0 ? void 0 : _product$product_sku.net_weight) !== null && _product$product_sku$ !== void 0 ? _product$product_sku$ : NaN);
21
+ const expected = new Decimal(requestedWeightKg || NaN);
22
+ return actual.isFinite() && expected.isFinite() && actual.equals(expected);
23
+ }
24
+ function findConfirmedMutationLine(products, productId, requestedWeightKg, uniqueId) {
25
+ return [...products].reverse().find((candidate) => {
26
+ var _candidate$product_id, _candidate$metadata$u, _candidate$metadata;
27
+ if (String((_candidate$product_id = candidate.product_id) !== null && _candidate$product_id !== void 0 ? _candidate$product_id : "") !== productId) return false;
28
+ if (!hasRequestedWeight(candidate, requestedWeightKg)) return false;
29
+ if (uniqueId == null || uniqueId === "") return true;
30
+ return String((_candidate$metadata$u = (_candidate$metadata = candidate.metadata) === null || _candidate$metadata === void 0 ? void 0 : _candidate$metadata.unique_identification_number) !== null && _candidate$metadata$u !== void 0 ? _candidate$metadata$u : "") === String(uniqueId);
31
+ });
32
+ }
33
+ function findOrderProduct(context, product) {
34
+ var _product$_identity, _context$sales$tempOr, _products$find;
35
+ const uniqueId = ((_product$_identity = product._identity) !== null && _product$_identity !== void 0 ? _product$_identity : pickIdentity(product)).unique_identification_number;
36
+ return (_products$find = (((_context$sales$tempOr = context.sales.tempOrder) === null || _context$sales$tempOr === void 0 ? void 0 : _context$sales$tempOr.products) || []).find((candidate) => {
37
+ var _candidate$metadata$u2, _candidate$metadata2;
38
+ return uniqueId != null && String((_candidate$metadata$u2 = (_candidate$metadata2 = candidate.metadata) === null || _candidate$metadata2 === void 0 ? void 0 : _candidate$metadata2.unique_identification_number) !== null && _candidate$metadata$u2 !== void 0 ? _candidate$metadata$u2 : "") === String(uniqueId);
39
+ })) !== null && _products$find !== void 0 ? _products$find : product;
40
+ }
41
+ function createBigSaleWeightedProductOperations({ getContext }) {
42
+ return { syncPrimaryWeightedProduct: function() {
43
+ var _ref2 = _asyncToGenerator(function* (input, signal) {
44
+ if (signal.aborted) return { status: "cancelled" };
45
+ const productId = Number(input.productId);
46
+ if (!Number.isFinite(productId)) return failed("primaryWeightedProductInputInvalid", "staff");
47
+ try {
48
+ const context = getContext();
49
+ const productResult = yield queryPrimaryProduct(context, String(productId), signal);
50
+ if (productResult.status !== "succeeded") return productResult;
51
+ const product = productResult.data;
52
+ const resolved = resolveHDLWeightedProduct(product);
53
+ if (!resolved) return failed("primaryWeightedProductConfigInvalid", "staff");
54
+ const prepared = createHDLPrimaryWeightedPreparedProduct(resolved, input);
55
+ if (!prepared) return failed("primaryWeightedProductSelectionInvalid", "retry");
56
+ if (input.existingLineId) {
57
+ var _cartProduct$_identit, _identity$product_var, _ref, _productPatch$product;
58
+ const displayLine = findCartLine(context, input.existingLineId);
59
+ const cartProduct = displayLine ? resolveCartProduct(displayLine) : void 0;
60
+ const bookingTicket = context.sales.bookingTicket;
61
+ if (!cartProduct) return failed("primaryWeightedProductLineNotFound", "back");
62
+ if (typeof context.cart.updateItem !== "function" || typeof (bookingTicket === null || bookingTicket === void 0 ? void 0 : bookingTicket.transformDetailToProductAndBooking) !== "function") return failed("primaryWeightedProductUpdateUnavailable", "staff");
63
+ const orderLine = findOrderProduct(context, cartProduct);
64
+ const identity = (_cartProduct$_identit = cartProduct._identity) !== null && _cartProduct$_identit !== void 0 ? _cartProduct$_identit : pickIdentity(orderLine);
65
+ const preparedForUpdate = _objectSpread2(_objectSpread2({}, prepared), {}, { _extend: _objectSpread2(_objectSpread2({}, prepared._extend || {}), identity.unique_identification_number != null ? { unique_identification_number: identity.unique_identification_number } : {}) });
66
+ const transformed = bookingTicket.transformDetailToProductAndBooking({
67
+ item: resolved.product,
68
+ cacheItem: preparedForUpdate
69
+ });
70
+ const productPatch = transformed === null || transformed === void 0 ? void 0 : transformed.product;
71
+ if (!productPatch) return failed("primaryWeightedProductUpdateInvalid", "retry");
72
+ const patchVariantId = Number(productPatch.product_variant_id);
73
+ const nextVariantId = Number.isFinite(patchVariantId) && patchVariantId > 0 ? patchVariantId : Number((_identity$product_var = identity.product_variant_id) !== null && _identity$product_var !== void 0 ? _identity$product_var : 0);
74
+ const nextOptions = resolvePatchProductOptions(orderLine, productPatch);
75
+ const lineUpdates = buildProductLineUpdates(orderLine, productPatch);
76
+ lineUpdates.metadata = _objectSpread2(_objectSpread2({}, lineUpdates.metadata || {}), identity.unique_identification_number != null ? { unique_identification_number: identity.unique_identification_number } : {});
77
+ const updatedProducts = yield context.cart.updateItem({
78
+ product_id: identity.product_id,
79
+ product_variant_id: nextVariantId,
80
+ unique_identification_number: identity.unique_identification_number,
81
+ identity_key: identity.identity_key,
82
+ product_sku: buildProductSkuPatch(orderLine, nextOptions, productPatch.product_sku),
83
+ product_option_item: nextOptions,
84
+ product_bundle: (_ref = (_productPatch$product = productPatch.product_bundle) !== null && _productPatch$product !== void 0 ? _productPatch$product : identity.product_bundle) !== null && _ref !== void 0 ? _ref : [],
85
+ updates: lineUpdates
86
+ });
87
+ if (signal.aborted) return unknown("primaryProductUpdateAbortedAfterDispatch");
88
+ const confirmedLine = projectConfirmedMutationLine(findConfirmedMutationLine(updatedProducts, input.productId, input.measurement.netWeightKg, identity.unique_identification_number));
89
+ return {
90
+ status: "succeeded",
91
+ data: _objectSpread2({ affectedLineId: input.existingLineId }, confirmedLine ? { confirmedLine } : {})
92
+ };
93
+ }
94
+ const result = yield context.cart.addProductWithFlow(product, {
95
+ quantity: 1,
96
+ debounceMs: 0,
97
+ notShowToast: true,
98
+ preparedCacheItem: prepared
99
+ });
100
+ if (signal.aborted) return unknown("primaryProductAddAbortedAfterDispatch");
101
+ if (result.status === "cancelled") return {
102
+ status: "cancelled",
103
+ reason: "userCancelled"
104
+ };
105
+ if (result.status !== "added") return unknown("primaryProductAddAmbiguous");
106
+ const confirmedLine = projectConfirmedMutationLine(findConfirmedMutationLine(result.products, input.productId, input.measurement.netWeightKg));
107
+ return {
108
+ status: "succeeded",
109
+ data: confirmedLine ? {
110
+ affectedLineId: confirmedLine.lineId,
111
+ confirmedLine
112
+ } : {}
113
+ };
114
+ } catch (error) {
115
+ return partialFailure("primaryWeightedProductSyncFailed", error);
116
+ }
117
+ });
118
+ return function syncPrimaryWeightedProduct(_x, _x2) {
119
+ return _ref2.apply(this, arguments);
120
+ };
121
+ }() };
122
+ }
123
+ //#endregion
124
+ export { createBigSaleWeightedProductOperations };
@@ -1,7 +1,7 @@
1
- import { _objectSpread2 } from "../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
1
+ import { _objectSpread2 } from "../../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
2
2
  import { getWeightUnitSymbol } from "@pisell/utils";
3
3
  import Decimal from "decimal.js";
4
- //#region src/components/bigSale/templates/HDLKiosk/adapter/weightedProduct.ts
4
+ //#region src/components/bigSale/templates/HDLKiosk/adapter/sales/weightedProduct.ts
5
5
  /**
6
6
  * 文件角色:根据已验证的标准称重商品生成 SalesSDK 写入结构。
7
7
  * 运行机制:提交时校验稳定净重,并生成 prepared product 及 OS 可识别的
@@ -0,0 +1,41 @@
1
+ import { createBigSaleScaleBridge } from "../runtime/scaleBridge.js";
2
+ import { createHDLKioskFulfillmentWriter } from "./host/fulfillmentWriter.js";
3
+ import { useBigSaleHDLKioskHost } from "./useBigSaleHDLKioskHost.js";
4
+ import { useCallback, useEffect, useMemo, useRef } from "react";
5
+ //#region src/components/bigSale/templates/HDLKiosk/adapter/useBigSaleHDLKioskAdapter.ts
6
+ /**
7
+ * 文件角色:集中装配 BigSale 模板接入 HDLKiosk 所需的稳定 Host、支付控制器、
8
+ * 秤 Runtime 与认证客户暂存。
9
+ * 运行机制:React refs 隔离晚到能力,Host 保持稳定引用;Template 只消费装配结果。
10
+ * 边界:不渲染 UI,不承载商品目录加载、购物车展示或 Workflow 业务规则。
11
+ */
12
+ function useBigSaleHDLKioskAdapter({ context, businessCode, isActive, nativeScaleSourceAvailable }) {
13
+ var _context$customer$sel;
14
+ const scaleBridge = useMemo(createBigSaleScaleBridge, []);
15
+ const authenticatedCustomerRef = useRef();
16
+ const paymentControllerRef = useRef();
17
+ const fulfillmentWriter = useMemo(() => createHDLKioskFulfillmentWriter(context.sales.bookingTicket), [context.sales.bookingTicket]);
18
+ const host = useBigSaleHDLKioskHost(context, businessCode, useMemo(() => ({
19
+ writeFulfillment: fulfillmentWriter,
20
+ getPaymentController: () => paymentControllerRef.current,
21
+ subscribeScaleEvents: scaleBridge.subscribeDeviceEvents,
22
+ getAuthenticatedCustomer: (customerId) => {
23
+ const customer = authenticatedCustomerRef.current;
24
+ return customer && String(customer.id) === customerId ? customer : void 0;
25
+ }
26
+ }), [fulfillmentWriter, scaleBridge]), nativeScaleSourceAvailable);
27
+ const selectedCustomerId = (_context$customer$sel = context.customer.selected) === null || _context$customer$sel === void 0 ? void 0 : _context$customer$sel.id;
28
+ useEffect(() => {
29
+ if (!isActive || selectedCustomerId == null) authenticatedCustomerRef.current = void 0;
30
+ }, [isActive, selectedCustomerId]);
31
+ return {
32
+ host,
33
+ paymentControllerRef,
34
+ rememberAuthenticatedCustomer: useCallback((customer) => {
35
+ authenticatedCustomerRef.current = customer;
36
+ }, []),
37
+ scaleBridge
38
+ };
39
+ }
40
+ //#endregion
41
+ export { useBigSaleHDLKioskAdapter };
@@ -1,5 +1,5 @@
1
1
  import useSalesSdkGlobalScanHandler from "../../../../../plus/salesSdk/hooks/useSalesSdkGlobalScanHandler.js";
2
- import { resolveHDLKioskPickupReferenceMode } from "./projection.js";
2
+ import { resolveHDLKioskPickupReferenceMode } from "./host/projection.js";
3
3
  import { createBigSaleHDLKioskHost } from "./createHost.js";
4
4
  import { useEffect, useRef } from "react";
5
5
  //#region src/components/bigSale/templates/HDLKiosk/adapter/useBigSaleHDLKioskHost.ts
@@ -18,6 +18,7 @@ function useBigSaleHDLKioskHost(context, businessCode, bridge, scaleSourceAvaila
18
18
  const bridgeRef = useRef(bridge);
19
19
  const scaleSourceAvailableRef = useRef(scaleSourceAvailable);
20
20
  const projectionListenersRef = useRef(/* @__PURE__ */ new Set());
21
+ const publishedObservationIdRef = useRef();
21
22
  const pickupReferenceModeRef = useRef("short_number");
22
23
  contextRef.current = context;
23
24
  scanRef.current = scan.handleGlobalScanCode;
@@ -65,16 +66,18 @@ function useBigSaleHDLKioskHost(context, businessCode, bridge, scaleSourceAvaila
65
66
  devices: {
66
67
  getPubsub: () => getPubsubRef.current(),
67
68
  getAcquireScanFocus: () => getAcquireScanFocusRef.current(),
68
- getSubscribeWeightChange: () => {
69
+ getSubscribeScaleEvents: () => {
69
70
  var _bridgeRef$current4;
70
- return scaleSourceAvailableRef.current ? (_bridgeRef$current4 = bridgeRef.current) === null || _bridgeRef$current4 === void 0 ? void 0 : _bridgeRef$current4.subscribeWeightChange : void 0;
71
- },
72
- getSubscribeScaleConnection: () => {
73
- var _bridgeRef$current5;
74
- return scaleSourceAvailableRef.current ? (_bridgeRef$current5 = bridgeRef.current) === null || _bridgeRef$current5 === void 0 ? void 0 : _bridgeRef$current5.subscribeScaleConnection : void 0;
71
+ return scaleSourceAvailableRef.current ? (_bridgeRef$current4 = bridgeRef.current) === null || _bridgeRef$current4 === void 0 ? void 0 : _bridgeRef$current4.subscribeScaleEvents : void 0;
75
72
  }
76
73
  }
77
74
  });
75
+ useEffect(() => {
76
+ const observationId = hostRef.current.sales.getObservedSnapshot().observationId;
77
+ if (publishedObservationIdRef.current === observationId) return;
78
+ publishedObservationIdRef.current = observationId;
79
+ projectionListenersRef.current.forEach((listener) => listener());
80
+ });
78
81
  return hostRef.current;
79
82
  }
80
83
  //#endregion
@@ -0,0 +1,122 @@
1
+ import { _objectSpread2 } from "../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
2
+ import { usePickSaleDetailContext } from "../../../hooks/usePickSaleDetailContext.js";
3
+ import { useOrderNoteModal } from "../../../../../plus/saleDetail/hooks/useOrderNoteModal.js";
4
+ import { buildVoucherViews } from "../../../../../plus/saleDetail/components/PromotionWalletPanels/adapters.js";
5
+ import { createSaleWalletAssetsCleanupCoordinator } from "../../../../../plus/saleDetail/components/PromotionWalletPanels/useSaleWalletAssets.js";
6
+ import Base_default from "../../../../../plus/saleDetail/Base.js";
7
+ import React, { useCallback, useMemo, useRef } from "react";
8
+ //#region src/components/bigSale/templates/HDLKiosk/cart/useBigSaleHDLKioskCart.tsx
9
+ /**
10
+ * 文件角色:封装 HDLKiosk 复用 SaleDetail 时的购物车展示、备注和优惠券配置。
11
+ * 边界:只负责 Cart Overlay 的 BigSale UI 接入,不创建 Host 或执行 Workflow。
12
+ */
13
+ const HIDDEN_MODULES = [
14
+ "overview",
15
+ "customer",
16
+ "contact",
17
+ "cartActions",
18
+ "orderActions",
19
+ "promotionAlert"
20
+ ];
21
+ const CART_ITEM_PRESENTATION = {
22
+ density: "comfortable",
23
+ optionColumns: 2,
24
+ mediaFit: "cover",
25
+ contentAlign: "center",
26
+ tokens: {
27
+ background: "#ffffff",
28
+ borderColor: "#e4e7ec",
29
+ borderRadius: "18px",
30
+ minHeight: "164px",
31
+ mediaWidth: "228px",
32
+ actionRailWidth: "174px",
33
+ contentPadding: "20px 22px",
34
+ actionRailPadding: "18px 20px",
35
+ accentColor: "#b20d12",
36
+ titleColor: "#101828",
37
+ titleFontSize: "32px",
38
+ titleFontWeight: 800,
39
+ priceColor: "#b20d12",
40
+ priceFontSize: "30px",
41
+ optionBackground: "#f5f6f8",
42
+ optionLabelColor: "#667085",
43
+ optionValueColor: "#101828",
44
+ optionGap: "6px",
45
+ shadow: "0 12px 28px rgba(16, 24, 40, 0.08)"
46
+ }
47
+ };
48
+ function useBigSaleHDLKioskCart({ context, onOrderComplete, primaryWeightedProductId, saleDetailModuleConfig, variant }) {
49
+ var _note, _ref, _context$sales$tempOr, _context$sales$bookin, _context$sales$bookin2;
50
+ const walletAssetsCleanupCoordinatorRef = useRef(createSaleWalletAssetsCleanupCoordinator());
51
+ const saleDetailContext = usePickSaleDetailContext(context, onOrderComplete);
52
+ const { openOrderNoteModal, orderNoteModal } = useOrderNoteModal({
53
+ context: saleDetailContext,
54
+ modalClassName: "pisell-kiosk-modal pisell-kiosk-note-modal"
55
+ });
56
+ const hasOrderNote = Boolean(String((_note = (_ref = (_context$sales$tempOr = context.sales.tempOrder) !== null && _context$sales$tempOr !== void 0 ? _context$sales$tempOr : (_context$sales$bookin = context.sales.bookingTicket) === null || _context$sales$bookin === void 0 || (_context$sales$bookin2 = _context$sales$bookin.getTempOrder) === null || _context$sales$bookin2 === void 0 ? void 0 : _context$sales$bookin2.call(_context$sales$bookin)) === null || _ref === void 0 ? void 0 : _ref.note) !== null && _note !== void 0 ? _note : "").trim());
57
+ const selectedPromotionCount = useMemo(() => buildVoucherViews(context.cart.discountList || []).filter((voucher) => voucher.selected).length, [context.cart.discountList]);
58
+ const cartOverlayActions = useMemo(() => ({
59
+ hasNote: hasOrderNote,
60
+ onAddNote: openOrderNoteModal,
61
+ promotionAppliedCount: selectedPromotionCount
62
+ }), [
63
+ hasOrderNote,
64
+ openOrderNoteModal,
65
+ selectedPromotionCount
66
+ ]);
67
+ const moduleConfig = useMemo(() => _objectSpread2(_objectSpread2({}, saleDetailModuleConfig), {}, {
68
+ hidden: HIDDEN_MODULES,
69
+ cartItems: _objectSpread2(_objectSpread2({}, saleDetailModuleConfig === null || saleDetailModuleConfig === void 0 ? void 0 : saleDetailModuleConfig.cartItems), {}, {
70
+ rightActionsDisplay: "inline",
71
+ bookingQuantityMode: "hidden",
72
+ lineNoteEditingEnabled: true,
73
+ showInlineRemoveButton: false,
74
+ showQuantityBadge: false,
75
+ showRemoveButton: true,
76
+ clearSelectedQuantityOnDelete: true,
77
+ productLineItemType: "a12",
78
+ productLineItemPresentation: CART_ITEM_PRESENTATION
79
+ }),
80
+ amountDetails: _objectSpread2(_objectSpread2({}, saleDetailModuleConfig === null || saleDetailModuleConfig === void 0 ? void 0 : saleDetailModuleConfig.amountDetails), {}, { defaultExpanded: true }),
81
+ promotionWalletPanels: typeof (saleDetailModuleConfig === null || saleDetailModuleConfig === void 0 ? void 0 : saleDetailModuleConfig.promotionWalletPanels) === "object" ? saleDetailModuleConfig.promotionWalletPanels : void 0,
82
+ promotionWalletPanelsAppearance: "light",
83
+ promotionWalletPanelsBehavior: _objectSpread2(_objectSpread2({}, saleDetailModuleConfig === null || saleDetailModuleConfig === void 0 ? void 0 : saleDetailModuleConfig.promotionWalletPanelsBehavior), {}, {
84
+ walletAssetsCleanupCoordinator: walletAssetsCleanupCoordinatorRef.current,
85
+ enableManualPromotionCode: true,
86
+ enablePromotionBanner: true,
87
+ enableVoucherProductAdd: true,
88
+ enableWalletAssets: true,
89
+ preserveWalletAssetsWhileRefreshing: true
90
+ })
91
+ }), [saleDetailModuleConfig]);
92
+ const isPrimaryProductLine = useCallback((item) => {
93
+ var _ref2, _item$_extend$product, _item$_extend;
94
+ return String((_ref2 = (_item$_extend$product = item === null || item === void 0 || (_item$_extend = item._extend) === null || _item$_extend === void 0 || (_item$_extend = _item$_extend.product) === null || _item$_extend === void 0 ? void 0 : _item$_extend.product_id) !== null && _item$_extend$product !== void 0 ? _item$_extend$product : item === null || item === void 0 ? void 0 : item.product_id) !== null && _ref2 !== void 0 ? _ref2 : "") === String(primaryWeightedProductId !== null && primaryWeightedProductId !== void 0 ? primaryWeightedProductId : "");
95
+ }, [primaryWeightedProductId]);
96
+ return {
97
+ cartOverlayActions,
98
+ orderNoteModal,
99
+ renderCartContent: useCallback(({ promotionsVisible, onEditPrimaryProduct }) => /* @__PURE__ */ React.createElement(Base_default, {
100
+ className: "hdl-kiosk-voucher-wallet",
101
+ context: saleDetailContext,
102
+ mobilePresentation: "inline",
103
+ moduleConfig: _objectSpread2(_objectSpread2({}, moduleConfig), {}, {
104
+ hidden: [...HIDDEN_MODULES, ...promotionsVisible ? [] : ["promotionWalletPanels"]],
105
+ cartItems: _objectSpread2(_objectSpread2({}, moduleConfig.cartItems), {}, {
106
+ isProductLineItemEditable: isPrimaryProductLine,
107
+ onProductLineItemEdit: onEditPrimaryProduct ? () => onEditPrimaryProduct() : void 0
108
+ })
109
+ }),
110
+ renderType: "current",
111
+ template: "A",
112
+ variant
113
+ }), [
114
+ isPrimaryProductLine,
115
+ moduleConfig,
116
+ saleDetailContext,
117
+ variant
118
+ ])
119
+ };
120
+ }
121
+ //#endregion
122
+ export { useBigSaleHDLKioskCart };
@@ -1,5 +1,6 @@
1
1
  import { useEffect } from "react";
2
- //#region src/components/bigSale/templates/HDLKiosk/adapter/useHDLKioskEntryPreparationToast.ts
2
+ //#region src/components/bigSale/templates/HDLKiosk/hooks/useHDLKioskEntryPreparationToast.ts
3
+ /** React 层入口准备提示;不属于 BigSale Host/Port 适配。 */
3
4
  function useHDLKioskEntryPreparationToast({ active, message, preparing, toast }) {
4
5
  useEffect(() => {
5
6
  if (!active || !preparing || !(toast === null || toast === void 0 ? void 0 : toast.loading)) return;
@@ -1,22 +1,16 @@
1
1
  import { _objectSpread2 } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
2
2
  import useEngineContext from "../../../../hooks/useEngineContext.js";
3
- import { usePickSaleDetailContext } from "../../hooks/usePickSaleDetailContext.js";
4
- import { useOrderNoteModal } from "../../../../plus/saleDetail/hooks/useOrderNoteModal.js";
5
- import { buildVoucherViews } from "../../../../plus/saleDetail/components/PromotionWalletPanels/adapters.js";
6
- import { createSaleWalletAssetsCleanupCoordinator } from "../../../../plus/saleDetail/components/PromotionWalletPanels/useSaleWalletAssets.js";
7
- import Base_default from "../../../../plus/saleDetail/Base.js";
8
3
  import localeTexts from "../../../HDLKiosk/locales.js";
9
- import { createHDLScaleRuntime } from "../../../HDLKiosk/devices/scale/runtime.js";
10
4
  import HDLKiosk from "../../../HDLKiosk/index.js";
11
- import { resolveHDLKioskConfig } from "../../../HDLKiosk/contracts/config.js";
12
- import { useBigSaleHDLKioskHost } from "./adapter/useBigSaleHDLKioskHost.js";
13
- import { useHDLKioskEntryPreparationToast } from "./adapter/useHDLKioskEntryPreparationToast.js";
14
- import { HDLKioskPaymentRuntime } from "./adapter/HDLKioskPaymentRuntime.js";
15
- import { createHDLKioskFulfillmentWriter } from "./adapter/fulfillment.js";
5
+ import { resolveHDLKioskConfig } from "../../../HDLKiosk/app/contracts/config.js";
6
+ import { useBigSaleHDLKioskAdapter } from "./adapter/useBigSaleHDLKioskAdapter.js";
7
+ import { useHDLKioskEntryPreparationToast } from "./hooks/useHDLKioskEntryPreparationToast.js";
8
+ import { HDLKioskPaymentRuntime } from "./runtime/HDLKioskPaymentRuntime.js";
16
9
  import { HDLKioskIdentityAuthPanel } from "./auth/HDLKioskIdentityAuthPanel.js";
17
10
  import { useHDLKioskH5AuthModule } from "./auth/useHDLKioskH5AuthModule.js";
18
- import { BigSaleScaleRuntimeOwner, createScaleTriggerHub } from "./adapter/scaleTrigger.js";
11
+ import { BigSaleScaleRuntimeOwner } from "./runtime/BigSaleScaleRuntimeOwner.js";
19
12
  import { resolvePrimaryWeightedProductId } from "./primaryWeightedProduct.js";
13
+ import { useBigSaleHDLKioskCart } from "./cart/useBigSaleHDLKioskCart.js";
20
14
  import React, { useCallback, useEffect, useMemo, useRef } from "react";
21
15
  import { locales } from "@pisell/utils";
22
16
  //#region src/components/bigSale/templates/HDLKiosk/index.tsx
@@ -26,41 +20,6 @@ import { locales } from "@pisell/utils";
26
20
  * NativeScale owner,再将独立 HDLKiosk 作为物料渲染。
27
21
  * 边界:兼容代码限制在本目录,不修改 HDLKiosk Core,也不要求 BigSale 上层传专用 props。
28
22
  */
29
- const HDL_KIOSK_CART_HIDDEN_MODULES = [
30
- "overview",
31
- "customer",
32
- "contact",
33
- "cartActions",
34
- "orderActions",
35
- "promotionAlert"
36
- ];
37
- const HDL_KIOSK_A12_PRESENTATION = {
38
- density: "comfortable",
39
- optionColumns: 2,
40
- mediaFit: "cover",
41
- contentAlign: "center",
42
- tokens: {
43
- background: "#ffffff",
44
- borderColor: "#e4e7ec",
45
- borderRadius: "18px",
46
- minHeight: "164px",
47
- mediaWidth: "228px",
48
- actionRailWidth: "174px",
49
- contentPadding: "20px 22px",
50
- actionRailPadding: "18px 20px",
51
- accentColor: "#b20d12",
52
- titleColor: "#101828",
53
- titleFontSize: "32px",
54
- titleFontWeight: 800,
55
- priceColor: "#b20d12",
56
- priceFontSize: "30px",
57
- optionBackground: "#f5f6f8",
58
- optionLabelColor: "#667085",
59
- optionValueColor: "#101828",
60
- optionGap: "6px",
61
- shadow: "0 12px 28px rgba(16, 24, 40, 0.08)"
62
- }
63
- };
64
23
  function resolveHDLKioskBigSaleConfig(primaryWeightedProductId) {
65
24
  return resolveHDLKioskConfig({ primaryWeightedProductId });
66
25
  }
@@ -69,7 +28,7 @@ function resolveHDLKioskBigSaleConfig(primaryWeightedProductId) {
69
28
  * 仅负责装配 Host 和配置,不承载流程或页面语义。
70
29
  */
71
30
  function HDLKioskBigSaleTemplate({ isActive = true, context, businessCode, locale, productLoadParams, productCatalogSessionKey, productCatalogReady = true, saleDetailModuleConfig, onOrderComplete, variant }) {
72
- var _engineContext$appHel, _engineContext$appHel2, _engineContext$appHel4, _engineContext$appHel5, _engineContext$appHel6, _engineContext$appHel7, _note, _ref, _context$sales$tempOr, _context$sales$bookin, _context$sales$bookin2, _context$customer$sel, _context$sales$bookin3, _context$sales$bookin4, _context$sales$bookin5, _productLoadParams$me, _context$sales$defaul, _context$sales$tempOr2, _context$sales$tempOr3, _context$sales$tempOr4, _context$sales$tempOr5, _ref3;
31
+ var _engineContext$appHel, _engineContext$appHel2, _engineContext$appHel4, _engineContext$appHel9, _engineContext$appHel10, _engineContext$appHel11, _engineContext$appHel12, _context$sales$bookin, _context$sales$bookin2, _context$sales$bookin3, _productLoadParams$me, _context$sales$defaul, _context$sales$tempOr, _context$sales$tempOr2, _context$sales$tempOr3, _context$sales$tempOr4, _ref;
73
32
  const entryDataPreparing = !productCatalogReady || context.products.loading || context.sales.catalogState === "pending";
74
33
  const primaryWeightedProductId = !entryDataPreparing && !context.products.error && context.sales.catalogState === "ready" ? resolvePrimaryWeightedProductId(context.products.products) : void 0;
75
34
  const config = useMemo(() => resolveHDLKioskBigSaleConfig(primaryWeightedProductId), [primaryWeightedProductId]);
@@ -90,113 +49,49 @@ function HDLKioskBigSaleTemplate({ isActive = true, context, businessCode, local
90
49
  const app = engineContext === null || engineContext === void 0 || (_engineContext$appHel3 = engineContext.appHelper) === null || _engineContext$appHel3 === void 0 || (_engineContext$appHel3 = _engineContext$appHel3.utils) === null || _engineContext$appHel3 === void 0 ? void 0 : _engineContext$appHel3.getApp();
91
50
  app === null || app === void 0 || (_app$history = app.history) === null || _app$history === void 0 || _app$history.push("/admin-entry");
92
51
  }, [engineContext === null || engineContext === void 0 || (_engineContext$appHel4 = engineContext.appHelper) === null || _engineContext$appHel4 === void 0 ? void 0 : _engineContext$appHel4.utils]);
93
- const h5AuthModuleName = useHDLKioskH5AuthModule(engineContext, context.sales);
94
- const scaleTriggerHub = useMemo(() => createScaleTriggerHub(), []);
95
- const scaleRuntime = useMemo(createHDLScaleRuntime, []);
96
- const authenticatedCustomerRef = useRef(void 0);
97
- const paymentControllerRef = useRef();
98
- const walletAssetsCleanupCoordinatorRef = useRef(createSaleWalletAssetsCleanupCoordinator());
99
- const scaleRuntimeOwnerId = useMemo(() => `hdl-kiosk-scale-runtime:${Date.now()}`, []);
100
- const nativeScaleTools = engineContext === null || engineContext === void 0 || (_engineContext$appHel5 = engineContext.appHelper) === null || _engineContext$appHel5 === void 0 || (_engineContext$appHel5 = _engineContext$appHel5.utils) === null || _engineContext$appHel5 === void 0 || (_engineContext$appHel6 = _engineContext$appHel5.getApp) === null || _engineContext$appHel6 === void 0 || (_engineContext$appHel6 = _engineContext$appHel6.call(_engineContext$appHel5)) === null || _engineContext$appHel6 === void 0 || (_engineContext$appHel6 = _engineContext$appHel6.plugins) === null || _engineContext$appHel6 === void 0 || (_engineContext$appHel7 = _engineContext$appHel6.get) === null || _engineContext$appHel7 === void 0 ? void 0 : _engineContext$appHel7.call(_engineContext$appHel6, "nativeScaleTools");
101
- const nativeScaleSourceAvailable = typeof (nativeScaleTools === null || nativeScaleTools === void 0 ? void 0 : nativeScaleTools.useNativeScale) === "function";
102
- const fulfillmentWriter = useMemo(() => createHDLKioskFulfillmentWriter(context.sales.bookingTicket), [context.sales.bookingTicket]);
103
- const host = useBigSaleHDLKioskHost(context, businessCode, useMemo(() => ({
104
- writeFulfillment: fulfillmentWriter,
105
- getPaymentController: () => paymentControllerRef.current,
106
- subscribeWeightChange: scaleTriggerHub.subscribeWeightChange,
107
- subscribeScaleConnection: scaleTriggerHub.subscribeConnection,
108
- getAuthenticatedCustomer: (customerId) => {
109
- const customer = authenticatedCustomerRef.current;
110
- return customer && String(customer.id) === customerId ? customer : void 0;
52
+ const publishCollaborationStatus = useCallback((status) => {
53
+ try {
54
+ var _engineContext$appHel5, _engineContext$appHel6, _engineContext$appHel7, _engineContext$appHel8;
55
+ engineContext === null || engineContext === void 0 || (_engineContext$appHel5 = engineContext.appHelper) === null || _engineContext$appHel5 === void 0 || (_engineContext$appHel5 = _engineContext$appHel5.utils) === null || _engineContext$appHel5 === void 0 || (_engineContext$appHel6 = _engineContext$appHel5.getApp) === null || _engineContext$appHel6 === void 0 || (_engineContext$appHel6 = _engineContext$appHel6.call(_engineContext$appHel5)) === null || _engineContext$appHel6 === void 0 || (_engineContext$appHel6 = _engineContext$appHel6.applicationManager) === null || _engineContext$appHel6 === void 0 || (_engineContext$appHel7 = _engineContext$appHel6.get) === null || _engineContext$appHel7 === void 0 || (_engineContext$appHel7 = _engineContext$appHel7.call(_engineContext$appHel6, "kioskCollaborationPreview")) === null || _engineContext$appHel7 === void 0 || (_engineContext$appHel8 = _engineContext$appHel7.runFunction) === null || _engineContext$appHel8 === void 0 || _engineContext$appHel8.call(_engineContext$appHel7, "publishStatus", { status });
56
+ } catch (error) {
57
+ console.warn("[HDLKiosk] 协同预览状态上报失败,不影响销售流程", error);
111
58
  }
112
- }), [fulfillmentWriter, scaleTriggerHub]), nativeScaleSourceAvailable);
59
+ }, [engineContext === null || engineContext === void 0 || (_engineContext$appHel9 = engineContext.appHelper) === null || _engineContext$appHel9 === void 0 ? void 0 : _engineContext$appHel9.utils]);
60
+ const h5AuthModuleName = useHDLKioskH5AuthModule(engineContext, context.sales);
61
+ const nativeScaleTools = engineContext === null || engineContext === void 0 || (_engineContext$appHel10 = engineContext.appHelper) === null || _engineContext$appHel10 === void 0 || (_engineContext$appHel10 = _engineContext$appHel10.utils) === null || _engineContext$appHel10 === void 0 || (_engineContext$appHel11 = _engineContext$appHel10.getApp) === null || _engineContext$appHel11 === void 0 || (_engineContext$appHel11 = _engineContext$appHel11.call(_engineContext$appHel10)) === null || _engineContext$appHel11 === void 0 || (_engineContext$appHel11 = _engineContext$appHel11.plugins) === null || _engineContext$appHel11 === void 0 || (_engineContext$appHel12 = _engineContext$appHel11.get) === null || _engineContext$appHel12 === void 0 ? void 0 : _engineContext$appHel12.call(_engineContext$appHel11, "nativeScaleTools");
62
+ const { host, paymentControllerRef, rememberAuthenticatedCustomer, scaleBridge } = useBigSaleHDLKioskAdapter({
63
+ context,
64
+ businessCode,
65
+ isActive,
66
+ nativeScaleSourceAvailable: typeof (nativeScaleTools === null || nativeScaleTools === void 0 ? void 0 : nativeScaleTools.useNativeScale) === "function"
67
+ });
113
68
  const catalogLoadAttemptRef = useRef(void 0);
114
69
  const renderIdentityAuth = useCallback((props) => /* @__PURE__ */ React.createElement(HDLKioskIdentityAuthPanel, _objectSpread2(_objectSpread2({}, props), {}, {
115
70
  context,
116
71
  registerAndLoginModuleName: h5AuthModuleName,
117
- onCustomerResolved: (customer) => {
118
- authenticatedCustomerRef.current = customer;
119
- }
120
- })), [context, h5AuthModuleName]);
121
- const saleDetailContext = usePickSaleDetailContext(context, onOrderComplete);
122
- const { openOrderNoteModal, orderNoteModal } = useOrderNoteModal({
123
- context: saleDetailContext,
124
- modalClassName: "pisell-kiosk-modal pisell-kiosk-note-modal"
125
- });
126
- const hasOrderNote = Boolean(String((_note = (_ref = (_context$sales$tempOr = context.sales.tempOrder) !== null && _context$sales$tempOr !== void 0 ? _context$sales$tempOr : (_context$sales$bookin = context.sales.bookingTicket) === null || _context$sales$bookin === void 0 || (_context$sales$bookin2 = _context$sales$bookin.getTempOrder) === null || _context$sales$bookin2 === void 0 ? void 0 : _context$sales$bookin2.call(_context$sales$bookin)) === null || _ref === void 0 ? void 0 : _ref.note) !== null && _note !== void 0 ? _note : "").trim());
127
- const selectedPromotionCount = useMemo(() => buildVoucherViews(context.cart.discountList || []).filter((voucher) => voucher.selected).length, [context.cart.discountList]);
128
- const cartOverlayActions = useMemo(() => ({
129
- hasNote: hasOrderNote,
130
- onAddNote: openOrderNoteModal,
131
- promotionAppliedCount: selectedPromotionCount
132
- }), [
133
- hasOrderNote,
134
- openOrderNoteModal,
135
- selectedPromotionCount
72
+ onCustomerResolved: rememberAuthenticatedCustomer
73
+ })), [
74
+ context,
75
+ h5AuthModuleName,
76
+ rememberAuthenticatedCustomer
136
77
  ]);
137
- const voucherWalletModuleConfig = useMemo(() => _objectSpread2(_objectSpread2({}, saleDetailModuleConfig), {}, {
138
- hidden: HDL_KIOSK_CART_HIDDEN_MODULES,
139
- cartItems: _objectSpread2(_objectSpread2({}, saleDetailModuleConfig === null || saleDetailModuleConfig === void 0 ? void 0 : saleDetailModuleConfig.cartItems), {}, {
140
- rightActionsDisplay: "inline",
141
- bookingQuantityMode: "hidden",
142
- lineNoteEditingEnabled: true,
143
- showInlineRemoveButton: false,
144
- showQuantityBadge: false,
145
- showRemoveButton: true,
146
- clearSelectedQuantityOnDelete: true,
147
- productLineItemType: "a12",
148
- productLineItemPresentation: HDL_KIOSK_A12_PRESENTATION
149
- }),
150
- amountDetails: _objectSpread2(_objectSpread2({}, saleDetailModuleConfig === null || saleDetailModuleConfig === void 0 ? void 0 : saleDetailModuleConfig.amountDetails), {}, { defaultExpanded: true }),
151
- promotionWalletPanels: typeof (saleDetailModuleConfig === null || saleDetailModuleConfig === void 0 ? void 0 : saleDetailModuleConfig.promotionWalletPanels) === "object" ? saleDetailModuleConfig.promotionWalletPanels : void 0,
152
- promotionWalletPanelsAppearance: "light",
153
- promotionWalletPanelsBehavior: _objectSpread2(_objectSpread2({}, saleDetailModuleConfig === null || saleDetailModuleConfig === void 0 ? void 0 : saleDetailModuleConfig.promotionWalletPanelsBehavior), {}, {
154
- walletAssetsCleanupCoordinator: walletAssetsCleanupCoordinatorRef.current,
155
- enableManualPromotionCode: true,
156
- enablePromotionBanner: true,
157
- enableVoucherProductAdd: true,
158
- enableWalletAssets: true,
159
- preserveWalletAssetsWhileRefreshing: true
160
- })
161
- }), [saleDetailModuleConfig]);
162
- const isPrimaryProductLine = useCallback((item) => {
163
- var _ref2, _item$_extend$product, _item$_extend, _config$primaryWeight;
164
- return String((_ref2 = (_item$_extend$product = item === null || item === void 0 || (_item$_extend = item._extend) === null || _item$_extend === void 0 || (_item$_extend = _item$_extend.product) === null || _item$_extend === void 0 ? void 0 : _item$_extend.product_id) !== null && _item$_extend$product !== void 0 ? _item$_extend$product : item === null || item === void 0 ? void 0 : item.product_id) !== null && _ref2 !== void 0 ? _ref2 : "") === String((_config$primaryWeight = config.primaryWeightedProductId) !== null && _config$primaryWeight !== void 0 ? _config$primaryWeight : "");
165
- }, [config.primaryWeightedProductId]);
166
- const renderCartContent = useCallback(({ promotionsVisible, onEditPrimaryProduct }) => /* @__PURE__ */ React.createElement(Base_default, {
167
- className: "hdl-kiosk-voucher-wallet",
168
- context: saleDetailContext,
169
- mobilePresentation: "inline",
170
- moduleConfig: _objectSpread2(_objectSpread2({}, voucherWalletModuleConfig), {}, {
171
- hidden: [...HDL_KIOSK_CART_HIDDEN_MODULES, ...promotionsVisible ? [] : ["promotionWalletPanels"]],
172
- cartItems: _objectSpread2(_objectSpread2({}, voucherWalletModuleConfig.cartItems), {}, {
173
- isProductLineItemEditable: isPrimaryProductLine,
174
- onProductLineItemEdit: onEditPrimaryProduct ? () => onEditPrimaryProduct() : void 0
175
- })
176
- }),
177
- renderType: "current",
178
- template: "A",
78
+ const { cartOverlayActions, orderNoteModal, renderCartContent } = useBigSaleHDLKioskCart({
79
+ context,
80
+ onOrderComplete,
81
+ primaryWeightedProductId: config.primaryWeightedProductId,
82
+ saleDetailModuleConfig,
179
83
  variant
180
- }), [
181
- isPrimaryProductLine,
182
- saleDetailContext,
183
- variant,
184
- voucherWalletModuleConfig
185
- ]);
186
- const selectedCustomerId = (_context$customer$sel = context.customer.selected) === null || _context$customer$sel === void 0 ? void 0 : _context$customer$sel.id;
187
- useEffect(() => {
188
- if (!isActive || selectedCustomerId == null) authenticatedCustomerRef.current = void 0;
189
- }, [isActive, selectedCustomerId]);
84
+ });
190
85
  const catalogProductCount = context.products.products.length;
191
- const osCatalogProductCount = (_context$sales$bookin3 = (_context$sales$bookin4 = context.sales.bookingTicket) === null || _context$sales$bookin4 === void 0 || (_context$sales$bookin5 = _context$sales$bookin4.getProductCatalog) === null || _context$sales$bookin5 === void 0 || (_context$sales$bookin5 = _context$sales$bookin5.call(_context$sales$bookin4)) === null || _context$sales$bookin5 === void 0 || (_context$sales$bookin5 = _context$sales$bookin5.products) === null || _context$sales$bookin5 === void 0 ? void 0 : _context$sales$bookin5.length) !== null && _context$sales$bookin3 !== void 0 ? _context$sales$bookin3 : 0;
86
+ const osCatalogProductCount = (_context$sales$bookin = (_context$sales$bookin2 = context.sales.bookingTicket) === null || _context$sales$bookin2 === void 0 || (_context$sales$bookin3 = _context$sales$bookin2.getProductCatalog) === null || _context$sales$bookin3 === void 0 || (_context$sales$bookin3 = _context$sales$bookin3.call(_context$sales$bookin2)) === null || _context$sales$bookin3 === void 0 || (_context$sales$bookin3 = _context$sales$bookin3.products) === null || _context$sales$bookin3 === void 0 ? void 0 : _context$sales$bookin3.length) !== null && _context$sales$bookin !== void 0 ? _context$sales$bookin : 0;
192
87
  const menuListIds = (_productLoadParams$me = productLoadParams === null || productLoadParams === void 0 ? void 0 : productLoadParams.menu_list_ids) !== null && _productLoadParams$me !== void 0 ? _productLoadParams$me : (_context$sales$defaul = context.sales.defaultProductLoadParams) === null || _context$sales$defaul === void 0 ? void 0 : _context$sales$defaul.menu_list_ids;
193
88
  const hasCatalogSource = catalogProductCount > 0 || osCatalogProductCount > 0 || Array.isArray(menuListIds) && menuListIds.length > 0;
194
89
  const skipsCatalogLoad = typeof productCatalogSessionKey === "string" && /-p0$/.test(productCatalogSessionKey);
195
90
  const catalogLoadKey = JSON.stringify({
196
91
  sessionKey: productCatalogSessionKey !== null && productCatalogSessionKey !== void 0 ? productCatalogSessionKey : "",
197
- orderId: (_context$sales$tempOr2 = (_context$sales$tempOr3 = context.sales.tempOrder) === null || _context$sales$tempOr3 === void 0 ? void 0 : _context$sales$tempOr3.order_id) !== null && _context$sales$tempOr2 !== void 0 ? _context$sales$tempOr2 : null,
198
- customerId: (_context$sales$tempOr4 = (_context$sales$tempOr5 = context.sales.tempOrder) === null || _context$sales$tempOr5 === void 0 ? void 0 : _context$sales$tempOr5.customer_id) !== null && _context$sales$tempOr4 !== void 0 ? _context$sales$tempOr4 : null,
199
- params: (_ref3 = productLoadParams !== null && productLoadParams !== void 0 ? productLoadParams : context.sales.defaultProductLoadParams) !== null && _ref3 !== void 0 ? _ref3 : {}
92
+ orderId: (_context$sales$tempOr = (_context$sales$tempOr2 = context.sales.tempOrder) === null || _context$sales$tempOr2 === void 0 ? void 0 : _context$sales$tempOr2.order_id) !== null && _context$sales$tempOr !== void 0 ? _context$sales$tempOr : null,
93
+ customerId: (_context$sales$tempOr3 = (_context$sales$tempOr4 = context.sales.tempOrder) === null || _context$sales$tempOr4 === void 0 ? void 0 : _context$sales$tempOr4.customer_id) !== null && _context$sales$tempOr3 !== void 0 ? _context$sales$tempOr3 : null,
94
+ params: (_ref = productLoadParams !== null && productLoadParams !== void 0 ? productLoadParams : context.sales.defaultProductLoadParams) !== null && _ref !== void 0 ? _ref : {}
200
95
  });
201
96
  useEffect(() => {
202
97
  if (!isActive || !productCatalogReady || skipsCatalogLoad || !context.sales.isReady || context.sales.catalogState !== "ready" || !context.sales.bookingTicket || !hasCatalogSource || catalogLoadAttemptRef.current === catalogLoadKey) return;
@@ -219,12 +114,10 @@ function HDLKioskBigSaleTemplate({ isActive = true, context, businessCode, local
219
114
  skipsCatalogLoad
220
115
  ]);
221
116
  return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(BigSaleScaleRuntimeOwner, {
222
- active: isActive && (config.enabledEntries.includes("scale") || config.enabledEntries.includes("quick")) && Boolean(config.primaryWeightedProductId),
223
- hub: scaleTriggerHub,
117
+ active: isActive && (config.enabledEntries.includes("scale") || config.enabledEntries.includes("quick") || config.enabledEntries.includes("barcode")) && Boolean(config.primaryWeightedProductId),
118
+ bridge: scaleBridge,
224
119
  nativeScaleTools,
225
- minimumWeightKg: config.scaleTriggerMinimumWeightKg,
226
- ownerId: scaleRuntimeOwnerId,
227
- runtime: scaleRuntime
120
+ minimumWeightKg: config.scaleTriggerMinimumWeightKg
228
121
  }), /* @__PURE__ */ React.createElement(HDLKiosk, {
229
122
  host,
230
123
  config,
@@ -232,8 +125,9 @@ function HDLKioskBigSaleTemplate({ isActive = true, context, businessCode, local
232
125
  isActive,
233
126
  locale,
234
127
  onTechnicalSupportClick: handleTechnicalSupportClick,
128
+ onCollaborationStatusChange: publishCollaborationStatus,
235
129
  onLocaleChange: typeof updateLocaleRuntime === "function" ? handleLocaleChange : void 0,
236
- scaleRuntime,
130
+ scaleRuntime: scaleBridge.runtime,
237
131
  renderIdentityAuth: h5AuthModuleName ? renderIdentityAuth : void 0,
238
132
  renderCartContent,
239
133
  cartOverlayActions