@pisell/pisellos 2.3.37 → 2.3.39

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 (169) hide show
  1. package/dist/modules/Discount/index.d.ts +1 -0
  2. package/dist/modules/Discount/index.js +40 -11
  3. package/dist/modules/Discount/types.d.ts +1 -0
  4. package/dist/modules/Holder/index.d.ts +48 -0
  5. package/dist/modules/Holder/index.js +640 -0
  6. package/dist/modules/Holder/types.d.ts +123 -0
  7. package/dist/modules/Holder/types.js +1 -0
  8. package/dist/modules/Holder/utils.d.ts +13 -0
  9. package/dist/modules/Holder/utils.js +34 -0
  10. package/dist/modules/OpenData/index.js +2 -2
  11. package/dist/modules/Order/index.d.ts +11 -28
  12. package/dist/modules/Order/index.js +513 -747
  13. package/dist/modules/Order/types.d.ts +10 -33
  14. package/dist/modules/Order/utils/orderCollectionIdentity.js +2 -7
  15. package/dist/modules/Order/utils.d.ts +10 -0
  16. package/dist/modules/Order/utils.js +40 -11
  17. package/dist/modules/Payment/index.d.ts +0 -2
  18. package/dist/modules/Payment/index.js +49 -78
  19. package/dist/modules/Payment/types.d.ts +24 -26
  20. package/dist/modules/Payment/types.js +0 -2
  21. package/dist/modules/Product/types.d.ts +1 -0
  22. package/dist/modules/ProductList/index.js +33 -14
  23. package/dist/modules/Quotation/index.d.ts +1 -1
  24. package/dist/modules/Quotation/index.js +2 -2
  25. package/dist/modules/ResourcePlanner/index.d.ts +24 -0
  26. package/dist/modules/ResourcePlanner/index.js +181 -0
  27. package/dist/modules/ResourcePlanner/planner.d.ts +14 -0
  28. package/dist/modules/ResourcePlanner/planner.js +1069 -0
  29. package/dist/modules/ResourcePlanner/types.d.ts +227 -0
  30. package/dist/modules/ResourcePlanner/types.js +1 -0
  31. package/dist/modules/Rules/index.js +48 -15
  32. package/dist/modules/SalesSummary/index.js +12 -13
  33. package/dist/modules/ScanOrderLogger/index.d.ts +2 -0
  34. package/dist/modules/ScanOrderLogger/index.js +15 -2
  35. package/dist/modules/ScanOrderLogger/providers/feishu.js +45 -27
  36. package/dist/modules/ScanOrderLogger/types.d.ts +1 -0
  37. package/dist/modules/Schedule/index.d.ts +3 -1
  38. package/dist/modules/Schedule/index.js +21 -16
  39. package/dist/modules/Summary/utils.js +38 -13
  40. package/dist/modules/index.d.ts +2 -0
  41. package/dist/modules/index.js +3 -1
  42. package/dist/plugins/window.d.ts +1 -0
  43. package/dist/server/index.d.ts +14 -16
  44. package/dist/server/index.js +1162 -1943
  45. package/dist/server/modules/order/index.d.ts +4 -49
  46. package/dist/server/modules/order/index.js +695 -1574
  47. package/dist/server/modules/order/types.d.ts +3 -11
  48. package/dist/server/modules/order/types.js +1 -1
  49. package/dist/solution/BaseSales/index.d.ts +10 -33
  50. package/dist/solution/BaseSales/index.js +385 -676
  51. package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +1 -6
  52. package/dist/solution/BookingByStep/index.d.ts +17 -2
  53. package/dist/solution/BookingByStep/index.js +294 -215
  54. package/dist/solution/BookingByStep/types.d.ts +2 -1
  55. package/dist/solution/BookingByStep/types.js +3 -1
  56. package/dist/solution/BookingByStep/utils/capacity.js +17 -1
  57. package/dist/solution/BookingByStep/utils/timeslots.d.ts +3 -1
  58. package/dist/solution/BookingByStep/utils/timeslots.js +19 -12
  59. package/dist/solution/BookingTicket/index.js +1 -2
  60. package/dist/solution/Sales/index.d.ts +0 -1
  61. package/dist/solution/Sales/index.js +2 -10
  62. package/dist/solution/ScanOrder/index.d.ts +26 -14
  63. package/dist/solution/ScanOrder/index.js +1140 -737
  64. package/dist/solution/ScanOrder/types.d.ts +21 -1
  65. package/dist/solution/ScanOrder/utils.d.ts +8 -0
  66. package/dist/solution/ScanOrder/utils.js +66 -25
  67. package/dist/solution/ShopDiscount/index.d.ts +1 -0
  68. package/dist/solution/ShopDiscount/index.js +125 -87
  69. package/dist/solution/UnifiedBookingSales/index.d.ts +183 -0
  70. package/dist/solution/UnifiedBookingSales/index.js +1871 -0
  71. package/dist/solution/UnifiedBookingSales/types.d.ts +143 -0
  72. package/dist/solution/UnifiedBookingSales/types.js +11 -0
  73. package/dist/solution/VenueBooking/index.d.ts +39 -11
  74. package/dist/solution/VenueBooking/index.js +1177 -850
  75. package/dist/solution/VenueBooking/types.d.ts +3 -0
  76. package/dist/solution/VenueBooking/utils/resource.js +1 -0
  77. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
  78. package/dist/solution/VenueBooking/utils/slotMerge.js +10 -5
  79. package/dist/solution/index.d.ts +1 -0
  80. package/dist/solution/index.js +2 -1
  81. package/dist/types/index.d.ts +1 -0
  82. package/lib/modules/Discount/index.d.ts +1 -0
  83. package/lib/modules/Discount/index.js +9 -0
  84. package/lib/modules/Discount/types.d.ts +1 -0
  85. package/lib/modules/Holder/index.d.ts +48 -0
  86. package/lib/modules/Holder/index.js +402 -0
  87. package/lib/modules/Holder/types.d.ts +123 -0
  88. package/lib/modules/Holder/types.js +17 -0
  89. package/lib/modules/Holder/utils.d.ts +13 -0
  90. package/lib/modules/Holder/utils.js +71 -0
  91. package/lib/modules/OpenData/index.js +1 -1
  92. package/lib/modules/Order/index.d.ts +11 -28
  93. package/lib/modules/Order/index.js +83 -187
  94. package/lib/modules/Order/types.d.ts +10 -33
  95. package/lib/modules/Order/utils/orderCollectionIdentity.js +0 -3
  96. package/lib/modules/Order/utils.d.ts +10 -0
  97. package/lib/modules/Order/utils.js +39 -10
  98. package/lib/modules/Payment/index.d.ts +0 -2
  99. package/lib/modules/Payment/index.js +12 -33
  100. package/lib/modules/Payment/types.d.ts +24 -26
  101. package/lib/modules/Product/types.d.ts +1 -0
  102. package/lib/modules/ProductList/index.js +40 -31
  103. package/lib/modules/Quotation/index.d.ts +1 -1
  104. package/lib/modules/Quotation/index.js +2 -2
  105. package/lib/modules/ResourcePlanner/index.d.ts +24 -0
  106. package/lib/modules/ResourcePlanner/index.js +148 -0
  107. package/lib/modules/ResourcePlanner/planner.d.ts +14 -0
  108. package/lib/modules/ResourcePlanner/planner.js +933 -0
  109. package/lib/modules/ResourcePlanner/types.d.ts +227 -0
  110. package/lib/modules/ResourcePlanner/types.js +17 -0
  111. package/lib/modules/Rules/index.js +34 -18
  112. package/lib/modules/SalesSummary/index.js +6 -7
  113. package/lib/modules/ScanOrderLogger/index.d.ts +2 -0
  114. package/lib/modules/ScanOrderLogger/index.js +13 -1
  115. package/lib/modules/ScanOrderLogger/providers/feishu.js +15 -6
  116. package/lib/modules/ScanOrderLogger/types.d.ts +1 -0
  117. package/lib/modules/Schedule/index.d.ts +3 -1
  118. package/lib/modules/Schedule/index.js +10 -8
  119. package/lib/modules/Summary/utils.js +21 -1
  120. package/lib/modules/index.d.ts +2 -0
  121. package/lib/modules/index.js +5 -1
  122. package/lib/plugins/window.d.ts +1 -0
  123. package/lib/server/index.d.ts +14 -16
  124. package/lib/server/index.js +88 -678
  125. package/lib/server/modules/order/index.d.ts +4 -49
  126. package/lib/server/modules/order/index.js +66 -657
  127. package/lib/server/modules/order/types.d.ts +3 -11
  128. package/lib/solution/BaseSales/index.d.ts +10 -33
  129. package/lib/solution/BaseSales/index.js +33 -201
  130. package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +1 -6
  131. package/lib/solution/BookingByStep/index.d.ts +17 -2
  132. package/lib/solution/BookingByStep/index.js +60 -18
  133. package/lib/solution/BookingByStep/types.d.ts +2 -1
  134. package/lib/solution/BookingByStep/types.js +5 -0
  135. package/lib/solution/BookingByStep/utils/capacity.js +20 -1
  136. package/lib/solution/BookingByStep/utils/timeslots.d.ts +3 -1
  137. package/lib/solution/BookingByStep/utils/timeslots.js +19 -11
  138. package/lib/solution/BookingTicket/index.js +1 -2
  139. package/lib/solution/Sales/index.d.ts +0 -1
  140. package/lib/solution/Sales/index.js +3 -5
  141. package/lib/solution/ScanOrder/index.d.ts +26 -14
  142. package/lib/solution/ScanOrder/index.js +449 -182
  143. package/lib/solution/ScanOrder/types.d.ts +21 -1
  144. package/lib/solution/ScanOrder/utils.d.ts +8 -0
  145. package/lib/solution/ScanOrder/utils.js +31 -0
  146. package/lib/solution/ShopDiscount/index.d.ts +1 -0
  147. package/lib/solution/ShopDiscount/index.js +14 -0
  148. package/lib/solution/UnifiedBookingSales/index.d.ts +183 -0
  149. package/lib/solution/UnifiedBookingSales/index.js +1076 -0
  150. package/lib/solution/UnifiedBookingSales/types.d.ts +143 -0
  151. package/lib/solution/UnifiedBookingSales/types.js +33 -0
  152. package/lib/solution/VenueBooking/index.d.ts +39 -11
  153. package/lib/solution/VenueBooking/index.js +328 -115
  154. package/lib/solution/VenueBooking/types.d.ts +3 -0
  155. package/lib/solution/VenueBooking/utils/resource.js +1 -0
  156. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
  157. package/lib/solution/VenueBooking/utils/slotMerge.js +6 -4
  158. package/lib/solution/index.d.ts +1 -0
  159. package/lib/solution/index.js +3 -1
  160. package/lib/types/index.d.ts +1 -0
  161. package/package.json +2 -2
  162. package/dist/modules/Order/payment-utils.d.ts +0 -26
  163. package/dist/modules/Order/payment-utils.js +0 -225
  164. package/dist/utils/payment-number.d.ts +0 -9
  165. package/dist/utils/payment-number.js +0 -69
  166. package/lib/modules/Order/payment-utils.d.ts +0 -26
  167. package/lib/modules/Order/payment-utils.js +0 -224
  168. package/lib/utils/payment-number.d.ts +0 -9
  169. package/lib/utils/payment-number.js +0 -64
@@ -1,14 +1,16 @@
1
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
1
2
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
3
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
4
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
4
5
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
5
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
6
6
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
7
7
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
8
8
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
9
9
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
10
10
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
11
11
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
12
+ function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
13
+ function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
12
14
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
13
15
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
14
16
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
@@ -28,7 +30,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
28
30
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
29
31
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
30
32
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
31
- import { BaseModule } from "../../modules/BaseModule";
33
+ import { BaseSalesImpl } from "../BaseSales";
32
34
  import { DEFAULT_SLOT_CONFIG, VenueBookingHooks } from "./types";
33
35
  import { attachItemRuleLimitsToTopLevelProducts, buildProductKey, buildItemRuleBusinessData, createEmptySummary, getProductIdentityIndex, getSafeProductNum, normalizeOrderProduct, normalizeItemRuleStrategies, toNonNegativeInt, toPriceString } from "./utils";
34
36
  import { createModule } from "../BookingByStep/types";
@@ -49,6 +51,8 @@ import { composeLinePrice, createUuidV4, getProductSkuOptions, sumOptionUnitPric
49
51
  import { OrderModule } from "../../modules/Order";
50
52
  import { RegisterAndLoginHooks } from "../RegisterAndLogin/types";
51
53
  import Decimal from 'decimal.js';
54
+ import { HolderModule } from "../../modules/Holder";
55
+ import { getFormIdFromHolderConfig, getProductHolderConfig } from "../../modules/Holder/utils";
52
56
  export * from "./types";
53
57
  var OPEN_DATA_SECTION_CODES = ['basic', 'fulfillment', 'reservation', 'sale', 'menu', 'availability', 'workflow', 'checkout'];
54
58
  function cloneCustomDepositData(customDepositData) {
@@ -59,8 +63,8 @@ function cloneCustomDepositData(customDepositData) {
59
63
  deposit_policy_data: Array.isArray(customDepositData.deposit_policy_data) ? _toConsumableArray(customDepositData.deposit_policy_data) : []
60
64
  });
61
65
  }
62
- export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
63
- _inherits(VenueBookingImpl, _BaseModule);
66
+ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
67
+ _inherits(VenueBookingImpl, _BaseSalesImpl);
64
68
  var _super = _createSuper(VenueBookingImpl);
65
69
  function VenueBookingImpl(name, version) {
66
70
  var _this;
@@ -269,6 +273,76 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
269
273
  }
270
274
  return addLog;
271
275
  }()
276
+ }, {
277
+ key: "getRegisteredModuleNames",
278
+ value: function getRegisteredModuleNames() {
279
+ return ['scanOrderLogger', 'products', 'order', 'salesSummary', 'venueProducts', 'addonProducts', 'date', 'schedule', 'quotation', 'openData'];
280
+ }
281
+ }, {
282
+ key: "createSubModule",
283
+ value: function createSubModule(moduleName) {
284
+ switch (moduleName) {
285
+ case 'scanOrderLogger':
286
+ return createModule('scanOrderLogger', this.name);
287
+ case 'venueProducts':
288
+ return new ProductList("".concat(this.name, "_venueProducts"));
289
+ case 'addonProducts':
290
+ return new ProductList("".concat(this.name, "_addonProducts"));
291
+ case 'date':
292
+ return new DateModule("".concat(this.name, "_date"));
293
+ case 'openData':
294
+ return new OpenDataModule("".concat(this.name, "_openData"));
295
+ default:
296
+ return _get(_getPrototypeOf(VenueBookingImpl.prototype), "createSubModule", this).call(this, moduleName);
297
+ }
298
+ }
299
+ }, {
300
+ key: "attachProductOriginToTempOrder",
301
+ value: function attachProductOriginToTempOrder(tempOrder, productUid, origin) {
302
+ var _tempOrder$_extend, _tempOrder$_extend2;
303
+ if (!productUid || !origin) return;
304
+ tempOrder._extend = _objectSpread(_objectSpread({}, tempOrder._extend || {}), {}, {
305
+ productsByUid: _objectSpread(_objectSpread({}, ((_tempOrder$_extend = tempOrder._extend) === null || _tempOrder$_extend === void 0 ? void 0 : _tempOrder$_extend.productsByUid) || {}), {}, _defineProperty({}, productUid, _objectSpread(_objectSpread({}, ((_tempOrder$_extend2 = tempOrder._extend) === null || _tempOrder$_extend2 === void 0 || (_tempOrder$_extend2 = _tempOrder$_extend2.productsByUid) === null || _tempOrder$_extend2 === void 0 ? void 0 : _tempOrder$_extend2[productUid]) || {}), {}, {
306
+ origin: origin
307
+ })))
308
+ });
309
+ }
310
+ }, {
311
+ key: "readProductOriginFromTempOrder",
312
+ value: function readProductOriginFromTempOrder(tempOrder, product) {
313
+ var _product$metadata, _tempOrder$_extend3;
314
+ var uid = ((_product$metadata = product.metadata) === null || _product$metadata === void 0 ? void 0 : _product$metadata.unique_identification_number) || product.identity_key;
315
+ if (uid && (_tempOrder$_extend3 = tempOrder._extend) !== null && _tempOrder$_extend3 !== void 0 && (_tempOrder$_extend3 = _tempOrder$_extend3.productsByUid) !== null && _tempOrder$_extend3 !== void 0 && (_tempOrder$_extend3 = _tempOrder$_extend3[uid]) !== null && _tempOrder$_extend3 !== void 0 && _tempOrder$_extend3.origin) {
316
+ return tempOrder._extend.productsByUid[uid].origin;
317
+ }
318
+ return product._origin;
319
+ }
320
+ }, {
321
+ key: "normalizeVenueProductTitle",
322
+ value: function normalizeVenueProductTitle(value) {
323
+ if (typeof value === 'string') {
324
+ var text = value.trim();
325
+ return text ? {
326
+ auto: text
327
+ } : undefined;
328
+ }
329
+ if (!value || _typeof(value) !== 'object' || Array.isArray(value)) return undefined;
330
+ var source = value;
331
+ var normalized = {};
332
+ Object.entries(source).forEach(function (_ref) {
333
+ var _ref2 = _slicedToArray(_ref, 2),
334
+ key = _ref2[0],
335
+ text = _ref2[1];
336
+ if (typeof text === 'string') normalized[key] = text;
337
+ });
338
+ if (!normalized.auto) {
339
+ var fallback = normalized.original || normalized.en || normalized['zh-CN'] || normalized['zh-HK'];
340
+ if (fallback) normalized.auto = fallback;
341
+ }
342
+ return Object.values(normalized).some(function (text) {
343
+ return String(text || '').trim();
344
+ }) ? normalized : undefined;
345
+ }
272
346
  }, {
273
347
  key: "normalizeCustomerId",
274
348
  value: function normalizeCustomerId(value) {
@@ -288,20 +362,115 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
288
362
  }
289
363
  return null;
290
364
  }
365
+ }, {
366
+ key: "resolveHolderCustomerId",
367
+ value: function resolveHolderCustomerId() {
368
+ var _this$window, _this$window$getLocal;
369
+ var customer = JSON.parse(((_this$window = this.window) === null || _this$window === void 0 || (_this$window$getLocal = _this$window.getLocalStorage) === null || _this$window$getLocal === void 0 ? void 0 : _this$window$getLocal.call(_this$window, 'customer')) || '{}');
370
+ if (customer !== null && customer !== void 0 && customer.id) return Number(customer.id);
371
+ return undefined;
372
+ }
373
+
374
+ /**
375
+ * 按商品 holder_config 预加载表单数据到 holderMap。
376
+ * appointment_booking 在加购时触发;venueBooking 在商品加载后预加载,避免 getHolderFormMap 为空。
377
+ */
378
+ }, {
379
+ key: "preloadHolderForms",
380
+ value: (function () {
381
+ var _preloadHolderForms = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(products) {
382
+ var seenFormIds, _iterator, _step, _item$_origin, item, holderConfig, formId, _item$_origin2, _item$_origin3;
383
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
384
+ while (1) switch (_context3.prev = _context3.next) {
385
+ case 0:
386
+ if (!(!this.store.holder || !products.length)) {
387
+ _context3.next = 2;
388
+ break;
389
+ }
390
+ return _context3.abrupt("return");
391
+ case 2:
392
+ seenFormIds = new Set();
393
+ _iterator = _createForOfIteratorHelper(products);
394
+ _context3.prev = 4;
395
+ _iterator.s();
396
+ case 6:
397
+ if ((_step = _iterator.n()).done) {
398
+ _context3.next = 25;
399
+ break;
400
+ }
401
+ item = _step.value;
402
+ holderConfig = getProductHolderConfig(item === null || item === void 0 || (_item$_origin = item._origin) === null || _item$_origin === void 0 ? void 0 : _item$_origin.product);
403
+ if (holderConfig) {
404
+ _context3.next = 11;
405
+ break;
406
+ }
407
+ return _context3.abrupt("continue", 23);
408
+ case 11:
409
+ formId = getFormIdFromHolderConfig(holderConfig);
410
+ if (!seenFormIds.has(formId)) {
411
+ _context3.next = 14;
412
+ break;
413
+ }
414
+ return _context3.abrupt("continue", 23);
415
+ case 14:
416
+ seenFormIds.add(formId);
417
+ _context3.prev = 15;
418
+ _context3.next = 18;
419
+ return this.store.holder.ensureFormByProduct({
420
+ product: (item === null || item === void 0 || (_item$_origin2 = item._origin) === null || _item$_origin2 === void 0 ? void 0 : _item$_origin2.product) || {},
421
+ customer_id: this.resolveHolderCustomerId(),
422
+ shop_id: item === null || item === void 0 || (_item$_origin3 = item._origin) === null || _item$_origin3 === void 0 || (_item$_origin3 = _item$_origin3.product) === null || _item$_origin3 === void 0 ? void 0 : _item$_origin3.shop_id,
423
+ useCache: true
424
+ });
425
+ case 18:
426
+ _context3.next = 23;
427
+ break;
428
+ case 20:
429
+ _context3.prev = 20;
430
+ _context3.t0 = _context3["catch"](15);
431
+ console.error('[VenueBooking] 预加载 holder 表单失败', {
432
+ formId: formId,
433
+ error: _context3.t0
434
+ });
435
+ case 23:
436
+ _context3.next = 6;
437
+ break;
438
+ case 25:
439
+ _context3.next = 30;
440
+ break;
441
+ case 27:
442
+ _context3.prev = 27;
443
+ _context3.t1 = _context3["catch"](4);
444
+ _iterator.e(_context3.t1);
445
+ case 30:
446
+ _context3.prev = 30;
447
+ _iterator.f();
448
+ return _context3.finish(30);
449
+ case 33:
450
+ case "end":
451
+ return _context3.stop();
452
+ }
453
+ }, _callee3, this, [[4, 27, 30, 33], [15, 20]]);
454
+ }));
455
+ function preloadHolderForms(_x3) {
456
+ return _preloadHolderForms.apply(this, arguments);
457
+ }
458
+ return preloadHolderForms;
459
+ }())
291
460
  }, {
292
461
  key: "clearLoginEffectListeners",
293
462
  value: function clearLoginEffectListeners() {
294
- var _iterator = _createForOfIteratorHelper(this.loginEffectDisposers),
295
- _step;
463
+ var _iterator2 = _createForOfIteratorHelper(this.loginEffectDisposers),
464
+ _step2;
296
465
  try {
297
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
298
- var dispose = _step.value;
466
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
467
+ var dispose = _step2.value;
299
468
  dispose();
300
469
  }
301
470
  } catch (err) {
302
- _iterator.e(err);
471
+ _iterator2.e(err);
303
472
  } finally {
304
- _iterator.f();
473
+ _iterator2.f();
305
474
  }
306
475
  this.loginEffectDisposers = [];
307
476
  }
@@ -332,30 +501,30 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
332
501
  var currentAccount = (accountModule === null || accountModule === void 0 || (_accountModule$getCur = accountModule.getCurrentAccount) === null || _accountModule$getCur === void 0 ? void 0 : _accountModule$getCur.call(accountModule)) || (accountModule === null || accountModule === void 0 || (_accountModule$getAcc = accountModule.getAccount) === null || _accountModule$getAcc === void 0 ? void 0 : _accountModule$getAcc.call(accountModule)) || null;
333
502
  var createHandleLogin = function createHandleLogin(eventName) {
334
503
  return /*#__PURE__*/function () {
335
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(payload) {
504
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(payload) {
336
505
  var customerId;
337
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
338
- while (1) switch (_context3.prev = _context3.next) {
506
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
507
+ while (1) switch (_context4.prev = _context4.next) {
339
508
  case 0:
340
509
  customerId = _this2.resolveCustomerIdFromLoginPayload(payload);
341
510
  if (customerId) {
342
- _context3.next = 3;
511
+ _context4.next = 3;
343
512
  break;
344
513
  }
345
- return _context3.abrupt("return");
514
+ return _context4.abrupt("return");
346
515
  case 3:
347
- _context3.next = 5;
516
+ _context4.next = 5;
348
517
  return _this2.refreshOrderMarketingAfterLogin({
349
518
  customerId: customerId
350
519
  });
351
520
  case 5:
352
521
  case "end":
353
- return _context3.stop();
522
+ return _context4.stop();
354
523
  }
355
- }, _callee3);
524
+ }, _callee4);
356
525
  }));
357
- return function (_x3) {
358
- return _ref.apply(this, arguments);
526
+ return function (_x4) {
527
+ return _ref3.apply(this, arguments);
359
528
  };
360
529
  }();
361
530
  };
@@ -365,97 +534,107 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
365
534
  }, {
366
535
  key: "refreshOrderMarketingAfterLogin",
367
536
  value: function () {
368
- var _refreshOrderMarketingAfterLogin = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(params) {
537
+ var _refreshOrderMarketingAfterLogin = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(params) {
369
538
  var _this3 = this;
370
539
  var refreshTask;
371
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
372
- while (1) switch (_context5.prev = _context5.next) {
540
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
541
+ while (1) switch (_context6.prev = _context6.next) {
373
542
  case 0:
374
543
  if (this.store.order) {
375
- _context5.next = 2;
544
+ _context6.next = 2;
376
545
  break;
377
546
  }
378
547
  throw new Error('order 模块未初始化');
379
548
  case 2:
380
549
  if (!this.customerLoginRefreshInFlight) {
381
- _context5.next = 9;
550
+ _context6.next = 9;
382
551
  break;
383
552
  }
384
553
  if (!(this.customerLoginRefreshIdInFlight === params.customerId)) {
385
- _context5.next = 7;
554
+ _context6.next = 7;
386
555
  break;
387
556
  }
388
- _context5.next = 6;
557
+ _context6.next = 6;
389
558
  return this.customerLoginRefreshInFlight;
390
559
  case 6:
391
- return _context5.abrupt("return");
560
+ return _context6.abrupt("return");
392
561
  case 7:
393
- _context5.next = 9;
562
+ _context6.next = 9;
394
563
  return this.customerLoginRefreshInFlight;
395
564
  case 9:
396
565
  this.customerLoginRefreshIdInFlight = params.customerId;
397
- refreshTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
566
+ refreshTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
398
567
  var _this3$otherParams;
399
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
400
- while (1) switch (_context4.prev = _context4.next) {
568
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
569
+ while (1) switch (_context5.prev = _context5.next) {
401
570
  case 0:
571
+ if (!_this3.store.holder) {
572
+ _context5.next = 3;
573
+ break;
574
+ }
575
+ _context5.next = 3;
576
+ return _this3.store.holder.refreshAllFormRecords({
577
+ customer_id: params.customerId,
578
+ useCache: false
579
+ });
580
+ case 3:
402
581
  if (!_this3.store.quotation) {
403
- _context4.next = 3;
582
+ _context5.next = 6;
404
583
  break;
405
584
  }
406
- _context4.next = 3;
585
+ _context5.next = 6;
407
586
  return _this3.store.quotation.loadQuotations({
408
587
  channel: (_this3$otherParams = _this3.otherParams) === null || _this3$otherParams === void 0 ? void 0 : _this3$otherParams.channel
409
588
  });
410
- case 3:
589
+ case 6:
411
590
  _this3.recalculateOrderPricesFromQuotation();
412
- _context4.next = 6;
591
+ _context5.next = 9;
413
592
  return _this3.store.order.loadDiscountConfig({
414
593
  customerId: params.customerId
415
594
  });
416
- case 6:
417
- _context4.next = 8;
595
+ case 9:
596
+ _context5.next = 11;
418
597
  return _this3.store.order.recalculateSummary({
419
598
  createIfMissing: true
420
599
  });
421
- case 8:
600
+ case 11:
422
601
  _this3.store.order.persistTempOrder();
423
- _context4.next = 11;
602
+ _context5.next = 14;
424
603
  return _this3.refreshItemRuleQuantityLimits();
425
- case 11:
426
- _context4.next = 13;
604
+ case 14:
605
+ _context5.next = 16;
427
606
  return _this3.refreshCartValidationPassed();
428
- case 13:
607
+ case 16:
429
608
  case "end":
430
- return _context4.stop();
609
+ return _context5.stop();
431
610
  }
432
- }, _callee4);
611
+ }, _callee5);
433
612
  }))();
434
613
  this.customerLoginRefreshInFlight = refreshTask;
435
- _context5.prev = 12;
436
- _context5.next = 15;
614
+ _context6.prev = 12;
615
+ _context6.next = 15;
437
616
  return refreshTask;
438
617
  case 15:
439
- _context5.next = 20;
618
+ _context6.next = 20;
440
619
  break;
441
620
  case 17:
442
- _context5.prev = 17;
443
- _context5.t0 = _context5["catch"](12);
444
- throw _context5.t0;
621
+ _context6.prev = 17;
622
+ _context6.t0 = _context6["catch"](12);
623
+ throw _context6.t0;
445
624
  case 20:
446
- _context5.prev = 20;
625
+ _context6.prev = 20;
447
626
  if (this.customerLoginRefreshInFlight === refreshTask) {
448
627
  this.customerLoginRefreshInFlight = null;
449
628
  this.customerLoginRefreshIdInFlight = null;
450
629
  }
451
- return _context5.finish(20);
630
+ return _context6.finish(20);
452
631
  case 23:
453
632
  case "end":
454
- return _context5.stop();
633
+ return _context6.stop();
455
634
  }
456
- }, _callee5, this, [[12, 17, 20, 23]]);
635
+ }, _callee6, this, [[12, 17, 20, 23]]);
457
636
  }));
458
- function refreshOrderMarketingAfterLogin(_x4) {
637
+ function refreshOrderMarketingAfterLogin(_x5) {
459
638
  return _refreshOrderMarketingAfterLogin.apply(this, arguments);
460
639
  }
461
640
  return refreshOrderMarketingAfterLogin;
@@ -463,16 +642,21 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
463
642
  }, {
464
643
  key: "initialize",
465
644
  value: function () {
466
- var _initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(core) {
645
+ var _initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(core) {
467
646
  var _options$otherParams,
468
647
  _options$otherParams2,
469
648
  _this$otherParams,
470
649
  _this$otherParams2,
471
650
  _this$otherParams3,
472
651
  _this4 = this,
473
- _this$otherParams4,
474
- _this$otherParams5;
652
+ _this$otherParams6,
653
+ _this$otherParams7,
654
+ _this$otherParams8,
655
+ _this$otherParams9,
656
+ _this$otherParams10;
475
657
  var options,
658
+ _this$otherParams4,
659
+ _this$otherParams5,
476
660
  baseModules,
477
661
  venueProductsModule,
478
662
  addonProductsModule,
@@ -480,18 +664,21 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
480
664
  scheduleModule,
481
665
  quotationModule,
482
666
  openDataModule,
667
+ holderCacheState,
668
+ sessionData,
669
+ _data$this$otherParam,
670
+ data,
671
+ holderModule,
483
672
  _this$store$order,
484
673
  _this$store$order2,
485
674
  _this$store$quotation,
486
- _this$otherParams6,
487
- _args6 = arguments;
488
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
489
- while (1) switch (_context6.prev = _context6.next) {
675
+ _this$otherParams11,
676
+ _args7 = arguments;
677
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
678
+ while (1) switch (_context7.prev = _context7.next) {
490
679
  case 0:
491
- options = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
680
+ options = _args7.length > 1 && _args7[1] !== undefined ? _args7[1] : {};
492
681
  this.logMethodStart('initialize');
493
- this.core = core;
494
- this.initializeOptions = options || {};
495
682
  this.store = _objectSpread(_objectSpread({}, this.store), options.store);
496
683
  this.store.entryContext = ((_options$otherParams = options.otherParams) === null || _options$otherParams === void 0 ? void 0 : _options$otherParams.entryContext) || this.store.entryContext;
497
684
  this.store.status = 'initializing';
@@ -510,22 +697,19 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
510
697
  passed: null,
511
698
  failures: []
512
699
  };
513
- this.window = core.getPlugin('window');
514
- this.request = core.getPlugin('request');
515
- if (this.window) {
516
- _context6.next = 24;
517
- break;
518
- }
519
- this.logMethodError('initialize', 'window plugin missing');
520
- throw new Error('venueBooking解决方案需要 window 插件支持');
521
- case 24:
522
- if (this.request) {
523
- _context6.next = 27;
524
- break;
700
+ _context7.next = 19;
701
+ return _get(_getPrototypeOf(VenueBookingImpl.prototype), "initialize", this).call(this, core, options);
702
+ case 19:
703
+ if (this.store.scanOrderLogger) {
704
+ this.store.scanOrderLogger.setProvider(((_this$otherParams4 = this.otherParams) === null || _this$otherParams4 === void 0 ? void 0 : _this$otherParams4.loggerProvider) || 'feishu');
705
+ this.store.scanOrderLogger.setProviderConfig(((_this$otherParams5 = this.otherParams) === null || _this$otherParams5 === void 0 ? void 0 : _this$otherParams5.loggerConfig) || {
706
+ feishu: {
707
+ webhook: 'https://open.feishu.cn/open-apis/bot/v2/hook/8f069b14-9d39-4728-8f78-b56f393bfde8',
708
+ errorHook: 'https://open.feishu.cn/open-apis/bot/v2/hook/bdefae5e-f233-4705-8688-946887d9543d'
709
+ }
710
+ });
711
+ this.store.scanOrderLogger.setContext(this.getLoggerContext());
525
712
  }
526
- this.logMethodError('initialize', 'request plugin missing');
527
- throw new Error('venueBooking解决方案需要 request 插件支持');
528
- case 27:
529
713
  // 注册基础模块(order, salesSummary, products, logger)
530
714
  baseModules = ['scanOrderLogger', 'products', 'order', 'salesSummary'];
531
715
  baseModules.forEach(function (step) {
@@ -538,10 +722,10 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
538
722
  } : {};
539
723
  var loggerProvider = ((_this4$otherParams = _this4.otherParams) === null || _this4$otherParams === void 0 ? void 0 : _this4$otherParams.loggerProvider) || 'feishu';
540
724
  var loggerConfig = ((_this4$otherParams2 = _this4.otherParams) === null || _this4$otherParams2 === void 0 ? void 0 : _this4$otherParams2.loggerConfig) || {
541
- feishu: {
542
- webhook: 'https://open.feishu.cn/open-apis/bot/v2/hook/8f069b14-9d39-4728-8f78-b56f393bfde8',
543
- errorHook: 'https://open.feishu.cn/open-apis/bot/v2/hook/bdefae5e-f233-4705-8688-946887d9543d'
544
- }
725
+ // feishu: {
726
+ // webhook: 'https://open.feishu.cn/open-apis/bot/v2/hook/8f069b14-9d39-4728-8f78-b56f393bfde8',
727
+ // errorHook: 'https://open.feishu.cn/open-apis/bot/v2/hook/bdefae5e-f233-4705-8688-946887d9543d',
728
+ // },
545
729
  };
546
730
  _this4.core.registerModule(targetModule, {
547
731
  initialState: initialState,
@@ -613,69 +797,87 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
613
797
  this.core.registerModule(openDataModule, {
614
798
  otherParams: _objectSpread(_objectSpread({}, this.otherParams), {}, {
615
799
  fatherModule: this.name,
616
- openCache: !!((_this$otherParams4 = this.otherParams) !== null && _this$otherParams4 !== void 0 && _this$otherParams4.cacheId),
617
- cacheId: (_this$otherParams5 = this.otherParams) === null || _this$otherParams5 === void 0 ? void 0 : _this$otherParams5.cacheId
800
+ openCache: !!((_this$otherParams6 = this.otherParams) !== null && _this$otherParams6 !== void 0 && _this$otherParams6.cacheId),
801
+ cacheId: (_this$otherParams7 = this.otherParams) === null || _this$otherParams7 === void 0 ? void 0 : _this$otherParams7.cacheId
618
802
  })
619
803
  });
620
- if (this.store.scanOrderLogger) {
621
- this.store.scanOrderLogger.setContext(this.getLoggerContext());
804
+ if ((_this$otherParams8 = this.otherParams) !== null && _this$otherParams8 !== void 0 && _this$otherParams8.cacheId) {
805
+ sessionData = this.window.sessionStorage.getItem(this.name);
806
+ if (sessionData) {
807
+ try {
808
+ data = JSON.parse(sessionData);
809
+ holderCacheState = (_data$this$otherParam = data[this.otherParams.cacheId]) === null || _data$this$otherParam === void 0 ? void 0 : _data$this$otherParam["".concat(this.name, "_holder")];
810
+ } catch (_unused2) {
811
+ // ignore invalid session cache
812
+ }
813
+ }
622
814
  }
815
+ holderModule = new HolderModule("".concat(this.name, "_holder"));
816
+ this.store.holder = holderModule;
817
+ this.core.registerModule(holderModule, {
818
+ initialState: holderCacheState,
819
+ otherParams: _objectSpread(_objectSpread({}, this.otherParams), {}, {
820
+ fatherModule: this.name,
821
+ openCache: !!((_this$otherParams9 = this.otherParams) !== null && _this$otherParams9 !== void 0 && _this$otherParams9.cacheId),
822
+ cacheId: (_this$otherParams10 = this.otherParams) === null || _this$otherParams10 === void 0 ? void 0 : _this$otherParams10.cacheId
823
+ })
824
+ });
623
825
  this.registerCustomerLoginListeners();
624
826
  console.log('[VenueBooking] 初始化开始');
625
- _context6.prev = 50;
626
- _context6.next = 53;
827
+ _context7.prev = 46;
828
+ _context7.next = 49;
627
829
  return (_this$store$order = this.store.order) === null || _this$store$order === void 0 ? void 0 : _this$store$order.recalculateSummary({
628
830
  createIfMissing: false
629
831
  });
630
- case 53:
832
+ case 49:
631
833
  (_this$store$order2 = this.store.order) === null || _this$store$order2 === void 0 || _this$store$order2.persistTempOrder();
632
- _context6.next = 56;
834
+ _context7.next = 52;
633
835
  return this.loadRuntimeConfigs();
634
- case 56:
836
+ case 52:
635
837
  if (!this.store.schedule) {
636
- _context6.next = 61;
838
+ _context7.next = 57;
637
839
  break;
638
840
  }
639
- _context6.next = 59;
841
+ _context7.next = 55;
640
842
  return this.store.schedule.loadAllSchedule();
641
- case 59:
843
+ case 55:
642
844
  this.injectScheduleResolverToQuotation();
643
845
  (_this$store$quotation = this.store.quotation) === null || _this$store$quotation === void 0 || _this$store$quotation.loadQuotations({
644
- channel: (_this$otherParams6 = this.otherParams) === null || _this$otherParams6 === void 0 ? void 0 : _this$otherParams6.channel
846
+ channel: (_this$otherParams11 = this.otherParams) === null || _this$otherParams11 === void 0 ? void 0 : _this$otherParams11.channel
645
847
  });
646
- case 61:
647
- _context6.next = 63;
848
+ case 57:
849
+ _context7.next = 59;
648
850
  return this.refreshItemRuleQuantityLimits();
649
- case 63:
851
+ case 59:
650
852
  this.store.status = 'ready';
651
853
  console.log('[VenueBooking] 初始化完成');
652
- _context6.next = 67;
854
+ _context7.next = 63;
653
855
  return this.core.effects.emit(VenueBookingHooks.onInited, {
654
856
  status: this.store.status
655
857
  });
656
- case 67:
858
+ case 63:
657
859
  this.logMethodSuccess('initialize', {
658
860
  status: this.store.status
659
861
  });
660
- _context6.next = 77;
862
+ _context7.next = 73;
661
863
  break;
662
- case 70:
663
- _context6.prev = 70;
664
- _context6.t0 = _context6["catch"](50);
864
+ case 66:
865
+ _context7.prev = 66;
866
+ _context7.t0 = _context7["catch"](46);
665
867
  this.store.status = 'error';
666
- this.store.error = _context6.t0 instanceof Error ? _context6.t0.message : '初始化失败';
667
- console.error('[VenueBooking] 初始化失败', _context6.t0);
668
- this.logMethodError('initialize', _context6.t0, {
868
+ this.store.error = _context7.t0 instanceof Error ? _context7.t0.message : '初始化失败';
869
+ console.error('[VenueBooking] 初始化失败', _context7.t0);
870
+ this.logMethodError('initialize', _context7.t0, {
669
871
  status: this.store.status
670
872
  });
671
- throw _context6.t0;
672
- case 77:
873
+ throw _context7.t0;
874
+ case 73:
673
875
  case "end":
674
- return _context6.stop();
876
+ return _context7.stop();
675
877
  }
676
- }, _callee6, this, [[50, 70]]);
878
+ }, _callee7, this, [[46, 66]]);
677
879
  }));
678
- function initialize(_x5) {
880
+ function initialize(_x6) {
679
881
  return _initialize.apply(this, arguments);
680
882
  }
681
883
  return initialize;
@@ -683,22 +885,22 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
683
885
  }, {
684
886
  key: "destroy",
685
887
  value: function () {
686
- var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
687
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
688
- while (1) switch (_context7.prev = _context7.next) {
888
+ var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
889
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
890
+ while (1) switch (_context8.prev = _context8.next) {
689
891
  case 0:
690
892
  this.logMethodStart('destroy');
691
893
  this.clearLoginEffectListeners();
692
- _context7.next = 4;
894
+ _context8.next = 4;
693
895
  return this.core.effects.emit(VenueBookingHooks.onDestroy, {});
694
896
  case 4:
695
897
  console.log('[VenueBooking] 已销毁');
696
898
  this.logMethodSuccess('destroy');
697
899
  case 6:
698
900
  case "end":
699
- return _context7.stop();
901
+ return _context8.stop();
700
902
  }
701
- }, _callee7, this);
903
+ }, _callee8, this);
702
904
  }));
703
905
  function destroy() {
704
906
  return _destroy.apply(this, arguments);
@@ -708,32 +910,32 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
708
910
  }, {
709
911
  key: "retryInit",
710
912
  value: function () {
711
- var _retryInit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
712
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
713
- while (1) switch (_context8.prev = _context8.next) {
913
+ var _retryInit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
914
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
915
+ while (1) switch (_context9.prev = _context9.next) {
714
916
  case 0:
715
917
  this.logMethodStart('retryInit');
716
918
  console.log('[VenueBooking] retryInit 调用');
717
- _context8.next = 4;
919
+ _context9.next = 4;
718
920
  return this.core.effects.emit(VenueBookingHooks.onRetryInit, {});
719
921
  case 4:
720
- _context8.prev = 4;
721
- _context8.next = 7;
922
+ _context9.prev = 4;
923
+ _context9.next = 7;
722
924
  return this.initialize(this.core, this.initializeOptions);
723
925
  case 7:
724
926
  this.logMethodSuccess('retryInit');
725
- _context8.next = 14;
927
+ _context9.next = 14;
726
928
  break;
727
929
  case 10:
728
- _context8.prev = 10;
729
- _context8.t0 = _context8["catch"](4);
730
- this.logMethodError('retryInit', _context8.t0);
731
- throw _context8.t0;
930
+ _context9.prev = 10;
931
+ _context9.t0 = _context9["catch"](4);
932
+ this.logMethodError('retryInit', _context9.t0);
933
+ throw _context9.t0;
732
934
  case 14:
733
935
  case "end":
734
- return _context8.stop();
936
+ return _context9.stop();
735
937
  }
736
- }, _callee8, this, [[4, 10]]);
938
+ }, _callee9, this, [[4, 10]]);
737
939
  }));
738
940
  function retryInit() {
739
941
  return _retryInit.apply(this, arguments);
@@ -743,22 +945,22 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
743
945
  }, {
744
946
  key: "refresh",
745
947
  value: function () {
746
- var _refresh = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
747
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
748
- while (1) switch (_context9.prev = _context9.next) {
948
+ var _refresh = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
949
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
950
+ while (1) switch (_context10.prev = _context10.next) {
749
951
  case 0:
750
952
  this.logMethodStart('refresh');
751
953
  console.log('[VenueBooking] refresh 调用');
752
- _context9.prev = 2;
954
+ _context10.prev = 2;
753
955
  this.store.status = 'initializing';
754
- _context9.next = 6;
956
+ _context10.next = 6;
755
957
  return this.loadRuntimeConfigs();
756
958
  case 6:
757
- _context9.next = 8;
959
+ _context10.next = 8;
758
960
  return this.refreshItemRuleQuantityLimits();
759
961
  case 8:
760
962
  this.store.status = 'ready';
761
- _context9.next = 11;
963
+ _context10.next = 11;
762
964
  return this.core.effects.emit(VenueBookingHooks.onRefresh, {
763
965
  status: this.store.status
764
966
  });
@@ -766,18 +968,18 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
766
968
  this.logMethodSuccess('refresh', {
767
969
  status: this.store.status
768
970
  });
769
- _context9.next = 18;
971
+ _context10.next = 18;
770
972
  break;
771
973
  case 14:
772
- _context9.prev = 14;
773
- _context9.t0 = _context9["catch"](2);
774
- this.logMethodError('refresh', _context9.t0);
775
- throw _context9.t0;
974
+ _context10.prev = 14;
975
+ _context10.t0 = _context10["catch"](2);
976
+ this.logMethodError('refresh', _context10.t0);
977
+ throw _context10.t0;
776
978
  case 18:
777
979
  case "end":
778
- return _context9.stop();
980
+ return _context10.stop();
779
981
  }
780
- }, _callee9, this, [[2, 14]]);
982
+ }, _callee10, this, [[2, 14]]);
781
983
  }));
782
984
  function refresh() {
783
985
  return _refresh.apply(this, arguments);
@@ -818,26 +1020,26 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
818
1020
  }, {
819
1021
  key: "loadAllProducts",
820
1022
  value: function () {
821
- var _loadAllProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
1023
+ var _loadAllProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
822
1024
  var _this5 = this;
823
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
824
- while (1) switch (_context10.prev = _context10.next) {
1025
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
1026
+ while (1) switch (_context11.prev = _context11.next) {
825
1027
  case 0:
826
1028
  if (!this.loadAllProductsInFlight) {
827
- _context10.next = 2;
1029
+ _context11.next = 2;
828
1030
  break;
829
1031
  }
830
- return _context10.abrupt("return", this.loadAllProductsInFlight);
1032
+ return _context11.abrupt("return", this.loadAllProductsInFlight);
831
1033
  case 2:
832
1034
  this.loadAllProductsInFlight = this._doLoadAllProducts().finally(function () {
833
1035
  _this5.loadAllProductsInFlight = null;
834
1036
  });
835
- return _context10.abrupt("return", this.loadAllProductsInFlight);
1037
+ return _context11.abrupt("return", this.loadAllProductsInFlight);
836
1038
  case 4:
837
1039
  case "end":
838
- return _context10.stop();
1040
+ return _context11.stop();
839
1041
  }
840
- }, _callee10, this);
1042
+ }, _callee11, this);
841
1043
  }));
842
1044
  function loadAllProducts() {
843
1045
  return _loadAllProducts.apply(this, arguments);
@@ -847,31 +1049,31 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
847
1049
  }, {
848
1050
  key: "_doLoadAllProducts",
849
1051
  value: function () {
850
- var _doLoadAllProducts2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
851
- var _this$otherParams7, _this$store$venueProd, associatedMenus, menuListIds, allProducts, list, venueList, addonList, venueStore;
852
- return _regeneratorRuntime().wrap(function _callee11$(_context11) {
853
- while (1) switch (_context11.prev = _context11.next) {
1052
+ var _doLoadAllProducts2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
1053
+ var _this$otherParams12, _this$store$venueProd, associatedMenus, menuListIds, allProducts, list, venueList, addonList, venueStore, _this$store$order3, _this$store$order3$ge, products;
1054
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
1055
+ while (1) switch (_context12.prev = _context12.next) {
854
1056
  case 0:
855
1057
  this.logMethodStart('loadAllProducts');
856
- _context11.prev = 1;
1058
+ _context12.prev = 1;
857
1059
  if (this.store.venueProducts) {
858
- _context11.next = 4;
1060
+ _context12.next = 4;
859
1061
  break;
860
1062
  }
861
1063
  throw new Error('venueProducts 模块未初始化');
862
1064
  case 4:
863
1065
  if (this.store.addonProducts) {
864
- _context11.next = 6;
1066
+ _context12.next = 6;
865
1067
  break;
866
1068
  }
867
1069
  throw new Error('addonProducts 模块未初始化');
868
1070
  case 6:
869
- _context11.next = 8;
1071
+ _context12.next = 8;
870
1072
  return this.loadOpenDataConfig();
871
1073
  case 8:
872
- associatedMenus = ((_this$otherParams7 = this.otherParams) === null || _this$otherParams7 === void 0 || (_this$otherParams7 = _this$otherParams7.openData) === null || _this$otherParams7 === void 0 ? void 0 : _this$otherParams7['menu.associated_menus']) || [];
1074
+ associatedMenus = ((_this$otherParams12 = this.otherParams) === null || _this$otherParams12 === void 0 || (_this$otherParams12 = _this$otherParams12.openData) === null || _this$otherParams12 === void 0 ? void 0 : _this$otherParams12['menu.associated_menus']) || [];
873
1075
  if (associatedMenus.length) {
874
- _context11.next = 12;
1076
+ _context12.next = 12;
875
1077
  break;
876
1078
  }
877
1079
  this.logMethodError('loadAllProducts', new Error('未获取到餐牌配置(menu.associated_menus),请检查 OpenData 配置'));
@@ -880,7 +1082,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
880
1082
  menuListIds = associatedMenus.map(function (n) {
881
1083
  return Number(n.value);
882
1084
  });
883
- _context11.next = 15;
1085
+ _context12.next = 15;
884
1086
  return this.store.venueProducts.loadProducts({
885
1087
  menu_list_ids: menuListIds,
886
1088
  cacheId: this.cacheId,
@@ -888,7 +1090,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
888
1090
  schedule_datetime: dayjs().format('YYYY-MM-DD HH:mm:ss')
889
1091
  });
890
1092
  case 15:
891
- allProducts = _context11.sent;
1093
+ allProducts = _context12.sent;
892
1094
  list = Array.isArray(allProducts) ? allProducts : [];
893
1095
  venueList = list.filter(function (p) {
894
1096
  return p.duration != null;
@@ -904,6 +1106,16 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
904
1106
  }
905
1107
  this.store.addonProducts.addProduct(addonList);
906
1108
  this.resourceProductMap = buildResourceProductMap(venueList);
1109
+
1110
+ // 加载 holder 表单
1111
+ if (!this.store.order) {
1112
+ _context12.next = 27;
1113
+ break;
1114
+ }
1115
+ products = ((_this$store$order3 = this.store.order) === null || _this$store$order3 === void 0 || (_this$store$order3$ge = _this$store$order3.getOrderProducts) === null || _this$store$order3$ge === void 0 ? void 0 : _this$store$order3$ge.call(_this$store$order3)) || [];
1116
+ _context12.next = 27;
1117
+ return this.preloadHolderForms(products);
1118
+ case 27:
907
1119
  this.productsLoaded = true;
908
1120
  this.logMethodSuccess('loadAllProducts', {
909
1121
  total: list.length,
@@ -911,20 +1123,20 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
911
1123
  addonCount: addonList.length,
912
1124
  resourceCount: this.resourceProductMap.size
913
1125
  });
914
- return _context11.abrupt("return", {
1126
+ return _context12.abrupt("return", {
915
1127
  venueProducts: venueList,
916
1128
  addonProducts: addonList
917
1129
  });
918
- case 28:
919
- _context11.prev = 28;
920
- _context11.t0 = _context11["catch"](1);
921
- this.logMethodError('loadAllProducts', _context11.t0);
922
- throw _context11.t0;
923
1130
  case 32:
1131
+ _context12.prev = 32;
1132
+ _context12.t0 = _context12["catch"](1);
1133
+ this.logMethodError('loadAllProducts', _context12.t0);
1134
+ throw _context12.t0;
1135
+ case 36:
924
1136
  case "end":
925
- return _context11.stop();
1137
+ return _context12.stop();
926
1138
  }
927
- }, _callee11, this, [[1, 28]]);
1139
+ }, _callee12, this, [[1, 32]]);
928
1140
  }));
929
1141
  function _doLoadAllProducts() {
930
1142
  return _doLoadAllProducts2.apply(this, arguments);
@@ -934,21 +1146,21 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
934
1146
  }, {
935
1147
  key: "loadVenueProducts",
936
1148
  value: function () {
937
- var _loadVenueProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
1149
+ var _loadVenueProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
938
1150
  var result;
939
- return _regeneratorRuntime().wrap(function _callee12$(_context12) {
940
- while (1) switch (_context12.prev = _context12.next) {
1151
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
1152
+ while (1) switch (_context13.prev = _context13.next) {
941
1153
  case 0:
942
- _context12.next = 2;
1154
+ _context13.next = 2;
943
1155
  return this.loadAllProducts();
944
1156
  case 2:
945
- result = _context12.sent;
946
- return _context12.abrupt("return", result.venueProducts);
1157
+ result = _context13.sent;
1158
+ return _context13.abrupt("return", result.venueProducts);
947
1159
  case 4:
948
1160
  case "end":
949
- return _context12.stop();
1161
+ return _context13.stop();
950
1162
  }
951
- }, _callee12, this);
1163
+ }, _callee13, this);
952
1164
  }));
953
1165
  function loadVenueProducts() {
954
1166
  return _loadVenueProducts.apply(this, arguments);
@@ -958,21 +1170,21 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
958
1170
  }, {
959
1171
  key: "loadAddonProducts",
960
1172
  value: function () {
961
- var _loadAddonProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
1173
+ var _loadAddonProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
962
1174
  var result;
963
- return _regeneratorRuntime().wrap(function _callee13$(_context13) {
964
- while (1) switch (_context13.prev = _context13.next) {
1175
+ return _regeneratorRuntime().wrap(function _callee14$(_context14) {
1176
+ while (1) switch (_context14.prev = _context14.next) {
965
1177
  case 0:
966
- _context13.next = 2;
1178
+ _context14.next = 2;
967
1179
  return this.loadAllProducts();
968
1180
  case 2:
969
- result = _context13.sent;
970
- return _context13.abrupt("return", result.addonProducts);
1181
+ result = _context14.sent;
1182
+ return _context14.abrupt("return", result.addonProducts);
971
1183
  case 4:
972
1184
  case "end":
973
- return _context13.stop();
1185
+ return _context14.stop();
974
1186
  }
975
- }, _callee13, this);
1187
+ }, _callee14, this);
976
1188
  }));
977
1189
  function loadAddonProducts() {
978
1190
  return _loadAddonProducts.apply(this, arguments);
@@ -996,38 +1208,38 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
996
1208
  }, {
997
1209
  key: "loadQuotations",
998
1210
  value: function () {
999
- var _loadQuotations = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(params) {
1000
- return _regeneratorRuntime().wrap(function _callee14$(_context14) {
1001
- while (1) switch (_context14.prev = _context14.next) {
1211
+ var _loadQuotations = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(params) {
1212
+ return _regeneratorRuntime().wrap(function _callee15$(_context15) {
1213
+ while (1) switch (_context15.prev = _context15.next) {
1002
1214
  case 0:
1003
1215
  this.logMethodStart('loadQuotations');
1004
- _context14.prev = 1;
1216
+ _context15.prev = 1;
1005
1217
  if (this.store.quotation) {
1006
- _context14.next = 4;
1218
+ _context15.next = 4;
1007
1219
  break;
1008
1220
  }
1009
1221
  throw new Error('quotation 模块未初始化');
1010
1222
  case 4:
1011
- _context14.next = 6;
1223
+ _context15.next = 6;
1012
1224
  return this.store.quotation.loadQuotations(params);
1013
1225
  case 6:
1014
1226
  this.logMethodSuccess('loadQuotations', {
1015
1227
  count: this.store.quotation.getQuotationList().length
1016
1228
  });
1017
- _context14.next = 13;
1229
+ _context15.next = 13;
1018
1230
  break;
1019
1231
  case 9:
1020
- _context14.prev = 9;
1021
- _context14.t0 = _context14["catch"](1);
1022
- this.logMethodError('loadQuotations', _context14.t0);
1023
- throw _context14.t0;
1232
+ _context15.prev = 9;
1233
+ _context15.t0 = _context15["catch"](1);
1234
+ this.logMethodError('loadQuotations', _context15.t0);
1235
+ throw _context15.t0;
1024
1236
  case 13:
1025
1237
  case "end":
1026
- return _context14.stop();
1238
+ return _context15.stop();
1027
1239
  }
1028
- }, _callee14, this, [[1, 9]]);
1240
+ }, _callee15, this, [[1, 9]]);
1029
1241
  }));
1030
- function loadQuotations(_x6) {
1242
+ function loadQuotations(_x7) {
1031
1243
  return _loadQuotations.apply(this, arguments);
1032
1244
  }
1033
1245
  return loadQuotations;
@@ -1035,46 +1247,46 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1035
1247
  }, {
1036
1248
  key: "fetchResourceAvailability",
1037
1249
  value: function () {
1038
- var _fetchResourceAvailability = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(params) {
1039
- var venueProducts, resourceIds, config, crossDay, effectiveEndDate, res, rawData, _iterator2, _step2, item, _i3, _rawData, _item, mappings, _iterator3, _step3, mapping;
1040
- return _regeneratorRuntime().wrap(function _callee15$(_context15) {
1041
- while (1) switch (_context15.prev = _context15.next) {
1250
+ var _fetchResourceAvailability = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(params) {
1251
+ var venueProducts, resourceIds, config, crossDay, effectiveEndDate, res, rawData, _iterator3, _step3, item, _i3, _rawData, _item, mappings, _iterator4, _step4, mapping;
1252
+ return _regeneratorRuntime().wrap(function _callee16$(_context16) {
1253
+ while (1) switch (_context16.prev = _context16.next) {
1042
1254
  case 0:
1043
1255
  this.logMethodStart('fetchResourceAvailability', params);
1044
- _context15.prev = 1;
1256
+ _context16.prev = 1;
1045
1257
  venueProducts = this.getVenueProducts();
1046
1258
  if (venueProducts.length) {
1047
- _context15.next = 7;
1259
+ _context16.next = 7;
1048
1260
  break;
1049
1261
  }
1050
1262
  this.store.rawResourceData = [];
1051
1263
  this.logMethodSuccess('fetchResourceAvailability', {
1052
1264
  resourceCount: 0
1053
1265
  });
1054
- return _context15.abrupt("return");
1266
+ return _context16.abrupt("return");
1055
1267
  case 7:
1056
1268
  resourceIds = extractResourceIds(venueProducts);
1057
1269
  if (resourceIds.length) {
1058
- _context15.next = 12;
1270
+ _context16.next = 12;
1059
1271
  break;
1060
1272
  }
1061
1273
  this.store.rawResourceData = [];
1062
1274
  this.logMethodSuccess('fetchResourceAvailability', {
1063
1275
  resourceIds: []
1064
1276
  });
1065
- return _context15.abrupt("return");
1277
+ return _context16.abrupt("return");
1066
1278
  case 12:
1067
1279
  // 跨天营业时,endDate 扩展一天以覆盖次日凌晨时段
1068
1280
  config = this.store.slotConfig;
1069
1281
  crossDay = isBusinessHoursCrossDay(config);
1070
1282
  effectiveEndDate = crossDay ? dayjs(params.endDate).add(1, 'day').format('YYYY-MM-DD') : params.endDate;
1071
1283
  if (this.store.date) {
1072
- _context15.next = 17;
1284
+ _context16.next = 17;
1073
1285
  break;
1074
1286
  }
1075
1287
  throw new Error('date 模块未初始化');
1076
1288
  case 17:
1077
- _context15.next = 19;
1289
+ _context16.next = 19;
1078
1290
  return this.store.date.fetchResourceDates({
1079
1291
  query: {
1080
1292
  start_date: params.startDate,
@@ -1084,13 +1296,13 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1084
1296
  useCache: false
1085
1297
  });
1086
1298
  case 19:
1087
- res = _context15.sent;
1299
+ res = _context16.sent;
1088
1300
  rawData = [];
1089
1301
  if (res !== null && res !== void 0 && res.data && Array.isArray(res.data)) {
1090
- _iterator2 = _createForOfIteratorHelper(res.data);
1302
+ _iterator3 = _createForOfIteratorHelper(res.data);
1091
1303
  try {
1092
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
1093
- item = _step2.value;
1304
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
1305
+ item = _step3.value;
1094
1306
  rawData.push(_objectSpread({
1095
1307
  resourceId: item.id,
1096
1308
  formId: item.form_id,
@@ -1098,41 +1310,41 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1098
1310
  }, item));
1099
1311
  }
1100
1312
  } catch (err) {
1101
- _iterator2.e(err);
1313
+ _iterator3.e(err);
1102
1314
  } finally {
1103
- _iterator2.f();
1315
+ _iterator3.f();
1104
1316
  }
1105
1317
  }
1106
1318
  this.store.rawResourceData = rawData;
1107
1319
  _i3 = 0, _rawData = rawData;
1108
1320
  case 24:
1109
1321
  if (!(_i3 < _rawData.length)) {
1110
- _context15.next = 34;
1322
+ _context16.next = 34;
1111
1323
  break;
1112
1324
  }
1113
1325
  _item = _rawData[_i3];
1114
1326
  mappings = this.resourceProductMap.get(_item.resourceId);
1115
1327
  if (mappings) {
1116
- _context15.next = 29;
1328
+ _context16.next = 29;
1117
1329
  break;
1118
1330
  }
1119
- return _context15.abrupt("continue", 31);
1331
+ return _context16.abrupt("continue", 31);
1120
1332
  case 29:
1121
- _iterator3 = _createForOfIteratorHelper(mappings);
1333
+ _iterator4 = _createForOfIteratorHelper(mappings);
1122
1334
  try {
1123
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
1124
- mapping = _step3.value;
1335
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
1336
+ mapping = _step4.value;
1125
1337
  if (_item.main_field) mapping.resourceName = _item.main_field;
1126
1338
  if (_item.resource_form_id) mapping.formId = _item.resource_form_id;
1127
1339
  }
1128
1340
  } catch (err) {
1129
- _iterator3.e(err);
1341
+ _iterator4.e(err);
1130
1342
  } finally {
1131
- _iterator3.f();
1343
+ _iterator4.f();
1132
1344
  }
1133
1345
  case 31:
1134
1346
  _i3++;
1135
- _context15.next = 24;
1347
+ _context16.next = 24;
1136
1348
  break;
1137
1349
  case 34:
1138
1350
  this.logMethodSuccess('fetchResourceAvailability', {
@@ -1141,21 +1353,21 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1141
1353
  return sum + r.times.length;
1142
1354
  }, 0)
1143
1355
  });
1144
- _context15.next = 42;
1356
+ _context16.next = 42;
1145
1357
  break;
1146
1358
  case 37:
1147
- _context15.prev = 37;
1148
- _context15.t0 = _context15["catch"](1);
1359
+ _context16.prev = 37;
1360
+ _context16.t0 = _context16["catch"](1);
1149
1361
  this.store.rawResourceData = [];
1150
- this.logMethodError('fetchResourceAvailability', _context15.t0);
1151
- throw _context15.t0;
1362
+ this.logMethodError('fetchResourceAvailability', _context16.t0);
1363
+ throw _context16.t0;
1152
1364
  case 42:
1153
1365
  case "end":
1154
- return _context15.stop();
1366
+ return _context16.stop();
1155
1367
  }
1156
- }, _callee15, this, [[1, 37]]);
1368
+ }, _callee16, this, [[1, 37]]);
1157
1369
  }));
1158
- function fetchResourceAvailability(_x7) {
1370
+ function fetchResourceAvailability(_x8) {
1159
1371
  return _fetchResourceAvailability.apply(this, arguments);
1160
1372
  }
1161
1373
  return fetchResourceAvailability;
@@ -1187,18 +1399,18 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1187
1399
  var timeRangeMap = calcMinTimeMaxTimeBySchedules(scheduleList, undefined, date);
1188
1400
  var earliestStart = null;
1189
1401
  var latestEnd = null;
1190
- var _iterator4 = _createForOfIteratorHelper(scheduleList),
1191
- _step4;
1402
+ var _iterator5 = _createForOfIteratorHelper(scheduleList),
1403
+ _step5;
1192
1404
  try {
1193
- for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
1405
+ for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
1194
1406
  var _timeRangeMap$schedul;
1195
- var schedule = _step4.value;
1407
+ var schedule = _step5.value;
1196
1408
  var dateRangeList = (timeRangeMap === null || timeRangeMap === void 0 || (_timeRangeMap$schedul = timeRangeMap[schedule.id]) === null || _timeRangeMap$schedul === void 0 ? void 0 : _timeRangeMap$schedul.dateRangeFormat) || [];
1197
- var _iterator5 = _createForOfIteratorHelper(dateRangeList),
1198
- _step5;
1409
+ var _iterator6 = _createForOfIteratorHelper(dateRangeList),
1410
+ _step6;
1199
1411
  try {
1200
- for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
1201
- var range = _step5.value;
1412
+ for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
1413
+ var range = _step6.value;
1202
1414
  var start = dayjs(range === null || range === void 0 ? void 0 : range.start);
1203
1415
  var end = dayjs(range === null || range === void 0 ? void 0 : range.end);
1204
1416
  if (!start.isValid() || !end.isValid()) continue;
@@ -1210,15 +1422,15 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1210
1422
  }
1211
1423
  }
1212
1424
  } catch (err) {
1213
- _iterator5.e(err);
1425
+ _iterator6.e(err);
1214
1426
  } finally {
1215
- _iterator5.f();
1427
+ _iterator6.f();
1216
1428
  }
1217
1429
  }
1218
1430
  } catch (err) {
1219
- _iterator4.e(err);
1431
+ _iterator5.e(err);
1220
1432
  } finally {
1221
- _iterator4.f();
1433
+ _iterator5.f();
1222
1434
  }
1223
1435
  if (!earliestStart || !latestEnd) return nextSlotConfig;
1224
1436
  return _objectSpread(_objectSpread({}, nextSlotConfig), {}, {
@@ -1288,20 +1500,20 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1288
1500
  }, {
1289
1501
  key: "toggleSlot",
1290
1502
  value: function () {
1291
- var _toggleSlot = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(slot) {
1503
+ var _toggleSlot = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(slot) {
1292
1504
  var mappings, mapping, currentSlots, existIndex, nextSlots, products;
1293
- return _regeneratorRuntime().wrap(function _callee16$(_context16) {
1294
- while (1) switch (_context16.prev = _context16.next) {
1505
+ return _regeneratorRuntime().wrap(function _callee17$(_context17) {
1506
+ while (1) switch (_context17.prev = _context17.next) {
1295
1507
  case 0:
1296
1508
  this.logMethodStart('toggleSlot', {
1297
1509
  resourceId: slot.resourceId,
1298
1510
  productId: slot.productId,
1299
1511
  startTime: slot.startTime
1300
1512
  });
1301
- _context16.prev = 1;
1513
+ _context17.prev = 1;
1302
1514
  mappings = this.resourceProductMap.get(slot.resourceId);
1303
1515
  if (!(!mappings || !mappings.length)) {
1304
- _context16.next = 5;
1516
+ _context17.next = 5;
1305
1517
  break;
1306
1518
  }
1307
1519
  throw new Error("\u672A\u627E\u5230\u8D44\u6E90 ".concat(slot.resourceId, " \u7684\u5546\u54C1\u6620\u5C04"));
@@ -1310,13 +1522,13 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1310
1522
  return m.productId === slot.productId;
1311
1523
  });
1312
1524
  if (mapping) {
1313
- _context16.next = 8;
1525
+ _context17.next = 8;
1314
1526
  break;
1315
1527
  }
1316
1528
  throw new Error("\u8D44\u6E90 ".concat(slot.resourceId, " \u672A\u5173\u8054\u5546\u54C1 ").concat(slot.productId));
1317
1529
  case 8:
1318
1530
  if (this.store.order) {
1319
- _context16.next = 10;
1531
+ _context17.next = 10;
1320
1532
  break;
1321
1533
  }
1322
1534
  throw new Error('order 模块未初始化');
@@ -1332,14 +1544,14 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1332
1544
  } else {
1333
1545
  nextSlots = [].concat(_toConsumableArray(currentSlots), [slot]);
1334
1546
  }
1335
- _context16.next = 15;
1547
+ _context17.next = 15;
1336
1548
  return this.reconcileOrderForResourceProduct(slot.resourceId, slot.productId, nextSlots);
1337
1549
  case 15:
1338
1550
  products = this.store.order.getOrderProducts();
1339
- _context16.next = 18;
1551
+ _context17.next = 18;
1340
1552
  return this.refreshItemRuleQuantityLimits();
1341
1553
  case 18:
1342
- _context16.next = 20;
1554
+ _context17.next = 20;
1343
1555
  return this.refreshCartValidationPassed();
1344
1556
  case 20:
1345
1557
  this.logMethodSuccess('toggleSlot', {
@@ -1348,19 +1560,19 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1348
1560
  productId: slot.productId,
1349
1561
  slotCount: nextSlots.length
1350
1562
  });
1351
- return _context16.abrupt("return", products);
1563
+ return _context17.abrupt("return", products);
1352
1564
  case 24:
1353
- _context16.prev = 24;
1354
- _context16.t0 = _context16["catch"](1);
1355
- this.logMethodError('toggleSlot', _context16.t0);
1356
- throw _context16.t0;
1565
+ _context17.prev = 24;
1566
+ _context17.t0 = _context17["catch"](1);
1567
+ this.logMethodError('toggleSlot', _context17.t0);
1568
+ throw _context17.t0;
1357
1569
  case 28:
1358
1570
  case "end":
1359
- return _context16.stop();
1571
+ return _context17.stop();
1360
1572
  }
1361
- }, _callee16, this, [[1, 24]]);
1573
+ }, _callee17, this, [[1, 24]]);
1362
1574
  }));
1363
- function toggleSlot(_x8) {
1575
+ function toggleSlot(_x9) {
1364
1576
  return _toggleSlot.apply(this, arguments);
1365
1577
  }
1366
1578
  return toggleSlot;
@@ -1372,8 +1584,8 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1372
1584
  }, {
1373
1585
  key: "getSelectedSlotsForResource",
1374
1586
  value: function getSelectedSlotsForResource(resourceId, productId) {
1375
- var _this$store$order3;
1376
- var tempOrder = (_this$store$order3 = this.store.order) === null || _this$store$order3 === void 0 ? void 0 : _this$store$order3.getTempOrder();
1587
+ var _this$store$order4;
1588
+ var tempOrder = (_this$store$order4 = this.store.order) === null || _this$store$order4 === void 0 ? void 0 : _this$store$order4.getTempOrder();
1377
1589
  if (!tempOrder) return [];
1378
1590
  var venueProducts = tempOrder.products.filter(function (p) {
1379
1591
  var _p$metadata, _p$metadata2;
@@ -1384,24 +1596,24 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1384
1596
  });
1385
1597
  var slotDuration = this.store.slotConfig.slotDurationMinutes;
1386
1598
  var slots = [];
1387
- var _iterator6 = _createForOfIteratorHelper(venueProducts),
1388
- _step6;
1599
+ var _iterator7 = _createForOfIteratorHelper(venueProducts),
1600
+ _step7;
1389
1601
  try {
1390
1602
  var _loop = function _loop() {
1391
- var product = _step6.value;
1603
+ var product = _step7.value;
1392
1604
  slots.push.apply(slots, _toConsumableArray(expandMergedSlotToIndividual(product, slotDuration).map(function (s) {
1393
1605
  return _objectSpread(_objectSpread({}, s), {}, {
1394
1606
  productId: Number(product.product_id)
1395
1607
  });
1396
1608
  })));
1397
1609
  };
1398
- for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
1610
+ for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
1399
1611
  _loop();
1400
1612
  }
1401
1613
  } catch (err) {
1402
- _iterator6.e(err);
1614
+ _iterator7.e(err);
1403
1615
  } finally {
1404
- _iterator6.f();
1616
+ _iterator7.f();
1405
1617
  }
1406
1618
  return slots.sort(function (a, b) {
1407
1619
  return a.startTime.localeCompare(b.startTime);
@@ -1474,28 +1686,28 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1474
1686
 
1475
1687
  // 规则 2:当前是组合资源,任一子资源被选 → 禁用
1476
1688
  if (currentIsCombined) {
1477
- var _iterator7 = _createForOfIteratorHelper(currentChildIds),
1478
- _step7;
1689
+ var _iterator8 = _createForOfIteratorHelper(currentChildIds),
1690
+ _step8;
1479
1691
  try {
1480
- for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
1481
- var childId = _step7.value;
1692
+ for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
1693
+ var childId = _step8.value;
1482
1694
  if (getSelectedAt(childId).length > 0) return true;
1483
1695
  }
1484
1696
  } catch (err) {
1485
- _iterator7.e(err);
1697
+ _iterator8.e(err);
1486
1698
  } finally {
1487
- _iterator7.f();
1699
+ _iterator8.f();
1488
1700
  }
1489
1701
  }
1490
1702
 
1491
1703
  // 规则 3 & 4:扫描所有已选的 (resId),若是组合资源,检查其 children 是否包含当前 resourceId 或与当前 child 集合有交集
1492
- var _iterator8 = _createForOfIteratorHelper(allSelected),
1493
- _step8;
1704
+ var _iterator9 = _createForOfIteratorHelper(allSelected),
1705
+ _step9;
1494
1706
  try {
1495
- for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
1496
- var _step8$value = _slicedToArray(_step8.value, 2),
1497
- selectedResId = _step8$value[0],
1498
- slots = _step8$value[1];
1707
+ for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
1708
+ var _step9$value = _slicedToArray(_step9.value, 2),
1709
+ selectedResId = _step9$value[0],
1710
+ slots = _step9$value[1];
1499
1711
  if (!slots.some(function (s) {
1500
1712
  return s.startTime === startTime;
1501
1713
  })) continue;
@@ -1521,9 +1733,9 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1521
1733
  }
1522
1734
  }
1523
1735
  } catch (err) {
1524
- _iterator8.e(err);
1736
+ _iterator9.e(err);
1525
1737
  } finally {
1526
- _iterator8.f();
1738
+ _iterator9.f();
1527
1739
  }
1528
1740
  return false;
1529
1741
  }
@@ -1534,22 +1746,22 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1534
1746
  }, {
1535
1747
  key: "getAllSelectedSlots",
1536
1748
  value: function getAllSelectedSlots() {
1537
- var _this$store$order4;
1749
+ var _this$store$order5;
1538
1750
  var result = new Map();
1539
- var tempOrder = (_this$store$order4 = this.store.order) === null || _this$store$order4 === void 0 ? void 0 : _this$store$order4.getTempOrder();
1751
+ var tempOrder = (_this$store$order5 = this.store.order) === null || _this$store$order5 === void 0 ? void 0 : _this$store$order5.getTempOrder();
1540
1752
  if (!tempOrder) return result;
1541
1753
  var venueProducts = tempOrder.products.filter(function (p) {
1542
1754
  var _p$metadata3;
1543
1755
  return (_p$metadata3 = p.metadata) === null || _p$metadata3 === void 0 ? void 0 : _p$metadata3.venue_booking;
1544
1756
  });
1545
1757
  var slotDuration = this.store.slotConfig.slotDurationMinutes;
1546
- var _iterator9 = _createForOfIteratorHelper(venueProducts),
1547
- _step9;
1758
+ var _iterator10 = _createForOfIteratorHelper(venueProducts),
1759
+ _step10;
1548
1760
  try {
1549
1761
  var _loop2 = function _loop2() {
1550
- var _product$metadata;
1551
- var product = _step9.value;
1552
- var resourceId = (_product$metadata = product.metadata) === null || _product$metadata === void 0 ? void 0 : _product$metadata.resource_id;
1762
+ var _product$metadata2;
1763
+ var product = _step10.value;
1764
+ var resourceId = (_product$metadata2 = product.metadata) === null || _product$metadata2 === void 0 ? void 0 : _product$metadata2.resource_id;
1553
1765
  if (resourceId == null) return 1; // continue
1554
1766
  var productId = Number(product.product_id);
1555
1767
  var existing = result.get(resourceId) || [];
@@ -1560,29 +1772,29 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1560
1772
  })));
1561
1773
  result.set(resourceId, existing);
1562
1774
  };
1563
- for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
1775
+ for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
1564
1776
  if (_loop2()) continue;
1565
1777
  }
1566
1778
  } catch (err) {
1567
- _iterator9.e(err);
1779
+ _iterator10.e(err);
1568
1780
  } finally {
1569
- _iterator9.f();
1781
+ _iterator10.f();
1570
1782
  }
1571
- var _iterator10 = _createForOfIteratorHelper(result),
1572
- _step10;
1783
+ var _iterator11 = _createForOfIteratorHelper(result),
1784
+ _step11;
1573
1785
  try {
1574
- for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
1575
- var _step10$value = _slicedToArray(_step10.value, 2),
1576
- key = _step10$value[0],
1577
- slots = _step10$value[1];
1786
+ for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
1787
+ var _step11$value = _slicedToArray(_step11.value, 2),
1788
+ key = _step11$value[0],
1789
+ slots = _step11$value[1];
1578
1790
  result.set(key, slots.sort(function (a, b) {
1579
1791
  return a.startTime.localeCompare(b.startTime);
1580
1792
  }));
1581
1793
  }
1582
1794
  } catch (err) {
1583
- _iterator10.e(err);
1795
+ _iterator11.e(err);
1584
1796
  } finally {
1585
- _iterator10.f();
1797
+ _iterator11.f();
1586
1798
  }
1587
1799
  return result;
1588
1800
  }
@@ -1595,26 +1807,27 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1595
1807
  }, {
1596
1808
  key: "reconcileOrderForResourceProduct",
1597
1809
  value: (function () {
1598
- var _reconcileOrderForResourceProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(resourceId, productId, slots) {
1599
- var mappings, mapping, tempOrder, matchesCurrent, merged, rawResource, childRawResources, venueProduct, i, _rawResource$form_id, _venueProduct$is_char, group, identityKey, bookingUuid, startMoment, endMoment, duration, customDepositData, resourceEntry, booking;
1600
- return _regeneratorRuntime().wrap(function _callee17$(_context17) {
1601
- while (1) switch (_context17.prev = _context17.next) {
1810
+ var _reconcileOrderForResourceProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(resourceId, productId, slots) {
1811
+ var _this$store$order6, _this$store$order6$ge;
1812
+ var mappings, mapping, tempOrder, matchesCurrent, merged, rawResource, childRawResources, venueProduct, i, _rawResource$form_id, _venueProduct$is_char, group, identityKey, bookingUuid, startMoment, endMoment, duration, customDepositData, productTitle, resourceEntry, venueProductOrigin, normalizedVenueOrderProduct, venueOrderProduct, booking, products;
1813
+ return _regeneratorRuntime().wrap(function _callee18$(_context18) {
1814
+ while (1) switch (_context18.prev = _context18.next) {
1602
1815
  case 0:
1603
1816
  mappings = this.resourceProductMap.get(resourceId);
1604
1817
  if (!(!mappings || !mappings.length || !this.store.order)) {
1605
- _context17.next = 3;
1818
+ _context18.next = 3;
1606
1819
  break;
1607
1820
  }
1608
- return _context17.abrupt("return");
1821
+ return _context18.abrupt("return");
1609
1822
  case 3:
1610
1823
  mapping = mappings.find(function (m) {
1611
1824
  return m.productId === productId;
1612
1825
  });
1613
1826
  if (mapping) {
1614
- _context17.next = 6;
1827
+ _context18.next = 6;
1615
1828
  break;
1616
1829
  }
1617
- return _context17.abrupt("return");
1830
+ return _context18.abrupt("return");
1618
1831
  case 6:
1619
1832
  tempOrder = this.store.order.ensureTempOrder();
1620
1833
  matchesCurrent = function matchesCurrent(meta, pid) {
@@ -1632,17 +1845,17 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1632
1845
  return Number(bookingProductId) !== Number(productId);
1633
1846
  });
1634
1847
  if (slots.length) {
1635
- _context17.next = 16;
1848
+ _context18.next = 16;
1636
1849
  break;
1637
1850
  }
1638
1851
  this.store.order.applyDiscount();
1639
- _context17.next = 14;
1852
+ _context18.next = 14;
1640
1853
  return this.store.order.recalculateSummary({
1641
1854
  createIfMissing: true
1642
1855
  });
1643
1856
  case 14:
1644
1857
  this.store.order.persistTempOrder();
1645
- return _context17.abrupt("return");
1858
+ return _context18.abrupt("return");
1646
1859
  case 16:
1647
1860
  merged = mergeConsecutiveSlots(slots);
1648
1861
  rawResource = this.store.rawResourceData.find(function (r) {
@@ -1661,6 +1874,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1661
1874
  endMoment = dayjs(group.endTime, 'YYYY-MM-DD HH:mm');
1662
1875
  duration = endMoment.diff(startMoment, 'minute');
1663
1876
  customDepositData = cloneCustomDepositData(venueProduct === null || venueProduct === void 0 ? void 0 : venueProduct.custom_deposit_data);
1877
+ productTitle = this.normalizeVenueProductTitle(venueProduct === null || venueProduct === void 0 ? void 0 : venueProduct.product_title) || this.normalizeVenueProductTitle(venueProduct === null || venueProduct === void 0 ? void 0 : venueProduct.title) || this.normalizeVenueProductTitle(mapping.productTitle);
1664
1878
  resourceEntry = {
1665
1879
  relation_type: 'form',
1666
1880
  like_status: 'common',
@@ -1689,7 +1903,45 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1689
1903
  };
1690
1904
  });
1691
1905
  }
1692
- tempOrder.products.push(normalizeOrderProduct({
1906
+ venueProductOrigin = {
1907
+ name: mapping.productTitle,
1908
+ product_title: productTitle,
1909
+ cover: (venueProduct === null || venueProduct === void 0 ? void 0 : venueProduct.cover) || '',
1910
+ custom_deposit_data: customDepositData,
1911
+ id: 0,
1912
+ number: 1,
1913
+ registration_type: 'all',
1914
+ relation_products: [],
1915
+ is_all: false,
1916
+ product: {
1917
+ product_id: mapping.productId,
1918
+ product_variant_id: 0,
1919
+ num: 1,
1920
+ product_bundle: [],
1921
+ product_sku: {
1922
+ option: []
1923
+ },
1924
+ discount_list: [],
1925
+ custom_deposit_data: customDepositData,
1926
+ metadata: {}
1927
+ },
1928
+ sub_type: 'minutes',
1929
+ duration: duration,
1930
+ like_status: 'common',
1931
+ resources: [resourceEntry],
1932
+ schedule_id: 0,
1933
+ select_date: startMoment.format('YYYY-MM-DD'),
1934
+ start_date: startMoment.format('YYYY-MM-DD'),
1935
+ start_time: startMoment.format('HH:mm'),
1936
+ end_date: endMoment.format('YYYY-MM-DD'),
1937
+ end_time: endMoment.format('HH:mm'),
1938
+ metadata: {
1939
+ venue_booking: true,
1940
+ slot_count: group.slotCount
1941
+ },
1942
+ holder: null
1943
+ };
1944
+ normalizedVenueOrderProduct = normalizeOrderProduct({
1693
1945
  product_id: mapping.productId,
1694
1946
  product_variant_id: 0,
1695
1947
  identity_key: identityKey,
@@ -1697,8 +1949,11 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1697
1949
  selling_price: group.totalPrice,
1698
1950
  original_price: group.totalPrice,
1699
1951
  is_charge_tax: (_venueProduct$is_char = venueProduct === null || venueProduct === void 0 ? void 0 : venueProduct.is_charge_tax) !== null && _venueProduct$is_char !== void 0 ? _venueProduct$is_char : 0,
1700
- metadata: {
1701
- venue_booking: true,
1952
+ metadata: _objectSpread(_objectSpread({
1953
+ venue_booking: true
1954
+ }, productTitle ? {
1955
+ product_title: productTitle
1956
+ } : {}), {}, {
1702
1957
  resource_id: resourceId,
1703
1958
  resource_form_id: mapping.formId,
1704
1959
  resource_name: mapping.resourceName,
@@ -1711,45 +1966,14 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1711
1966
  productId: mapping.productId,
1712
1967
  quotation: this.store.quotation
1713
1968
  })
1714
- },
1715
- _origin: {
1716
- name: mapping.productTitle,
1717
- cover: (venueProduct === null || venueProduct === void 0 ? void 0 : venueProduct.cover) || '',
1718
- custom_deposit_data: customDepositData,
1719
- id: 0,
1720
- number: 1,
1721
- registration_type: 'all',
1722
- relation_products: [],
1723
- is_all: false,
1724
- product: {
1725
- product_id: mapping.productId,
1726
- product_variant_id: 0,
1727
- num: 1,
1728
- product_bundle: [],
1729
- product_sku: {
1730
- option: []
1731
- },
1732
- discount_list: [],
1733
- custom_deposit_data: customDepositData,
1734
- metadata: {}
1735
- },
1736
- sub_type: 'minutes',
1737
- duration: duration,
1738
- like_status: 'common',
1739
- resources: [resourceEntry],
1740
- schedule_id: 0,
1741
- select_date: startMoment.format('YYYY-MM-DD'),
1742
- start_date: startMoment.format('YYYY-MM-DD'),
1743
- start_time: startMoment.format('HH:mm'),
1744
- end_date: endMoment.format('YYYY-MM-DD'),
1745
- end_time: endMoment.format('HH:mm'),
1746
- metadata: {
1747
- venue_booking: true,
1748
- slot_count: group.slotCount
1749
- },
1750
- holder: null
1751
- }
1752
- }));
1969
+ }),
1970
+ _origin: venueProductOrigin
1971
+ });
1972
+ venueOrderProduct = productTitle ? _objectSpread(_objectSpread({}, normalizedVenueOrderProduct), {}, {
1973
+ product_title: productTitle
1974
+ }) : normalizedVenueOrderProduct;
1975
+ this.attachProductOriginToTempOrder(tempOrder, identityKey, venueProductOrigin);
1976
+ tempOrder.products.push(venueOrderProduct);
1753
1977
  booking = buildVenueBookingEntry({
1754
1978
  group: group,
1755
1979
  resourceId: resourceId,
@@ -1761,20 +1985,26 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1761
1985
  });
1762
1986
  tempOrder.bookings.push(booking);
1763
1987
  }
1988
+
1989
+ // 获取表单信息
1990
+ products = ((_this$store$order6 = this.store.order) === null || _this$store$order6 === void 0 || (_this$store$order6$ge = _this$store$order6.getOrderProducts) === null || _this$store$order6$ge === void 0 ? void 0 : _this$store$order6$ge.call(_this$store$order6)) || [];
1991
+ _context18.next = 25;
1992
+ return this.preloadHolderForms(products);
1993
+ case 25:
1764
1994
  this.store.order.applyDiscount();
1765
- _context17.next = 25;
1995
+ _context18.next = 28;
1766
1996
  return this.store.order.recalculateSummary({
1767
1997
  createIfMissing: true
1768
1998
  });
1769
- case 25:
1999
+ case 28:
1770
2000
  this.store.order.persistTempOrder();
1771
- case 26:
2001
+ case 29:
1772
2002
  case "end":
1773
- return _context17.stop();
2003
+ return _context18.stop();
1774
2004
  }
1775
- }, _callee17, this);
2005
+ }, _callee18, this);
1776
2006
  }));
1777
- function reconcileOrderForResourceProduct(_x9, _x10, _x11) {
2007
+ function reconcileOrderForResourceProduct(_x10, _x11, _x12) {
1778
2008
  return _reconcileOrderForResourceProduct.apply(this, arguments);
1779
2009
  }
1780
2010
  return reconcileOrderForResourceProduct;
@@ -1789,23 +2019,23 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1789
2019
  return undefined;
1790
2020
  }
1791
2021
  var children = [];
1792
- var _iterator11 = _createForOfIteratorHelper(combined.resource_ids),
1793
- _step11;
2022
+ var _iterator12 = _createForOfIteratorHelper(combined.resource_ids),
2023
+ _step12;
1794
2024
  try {
1795
2025
  var _loop3 = function _loop3() {
1796
- var id = _step11.value;
2026
+ var id = _step12.value;
1797
2027
  var child = _this8.store.rawResourceData.find(function (r) {
1798
2028
  return String(r.resourceId) === String(id);
1799
2029
  });
1800
2030
  if (child) children.push(child);
1801
2031
  };
1802
- for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
2032
+ for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
1803
2033
  _loop3();
1804
2034
  }
1805
2035
  } catch (err) {
1806
- _iterator11.e(err);
2036
+ _iterator12.e(err);
1807
2037
  } finally {
1808
- _iterator11.f();
2038
+ _iterator12.f();
1809
2039
  }
1810
2040
  return children.length ? children : undefined;
1811
2041
  }
@@ -1827,35 +2057,35 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1827
2057
  }, {
1828
2058
  key: "loadSchedules",
1829
2059
  value: function () {
1830
- var _loadSchedules = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
1831
- return _regeneratorRuntime().wrap(function _callee18$(_context18) {
1832
- while (1) switch (_context18.prev = _context18.next) {
2060
+ var _loadSchedules = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19() {
2061
+ return _regeneratorRuntime().wrap(function _callee19$(_context19) {
2062
+ while (1) switch (_context19.prev = _context19.next) {
1833
2063
  case 0:
1834
2064
  this.logMethodStart('loadSchedules');
1835
- _context18.prev = 1;
2065
+ _context19.prev = 1;
1836
2066
  if (this.store.schedule) {
1837
- _context18.next = 4;
2067
+ _context19.next = 4;
1838
2068
  break;
1839
2069
  }
1840
2070
  throw new Error('schedule 模块未初始化');
1841
2071
  case 4:
1842
- _context18.next = 6;
2072
+ _context19.next = 6;
1843
2073
  return this.store.schedule.loadAllSchedule();
1844
2074
  case 6:
1845
2075
  this.injectScheduleResolverToQuotation();
1846
2076
  this.logMethodSuccess('loadSchedules');
1847
- _context18.next = 14;
2077
+ _context19.next = 14;
1848
2078
  break;
1849
2079
  case 10:
1850
- _context18.prev = 10;
1851
- _context18.t0 = _context18["catch"](1);
1852
- this.logMethodError('loadSchedules', _context18.t0);
1853
- throw _context18.t0;
2080
+ _context19.prev = 10;
2081
+ _context19.t0 = _context19["catch"](1);
2082
+ this.logMethodError('loadSchedules', _context19.t0);
2083
+ throw _context19.t0;
1854
2084
  case 14:
1855
2085
  case "end":
1856
- return _context18.stop();
2086
+ return _context19.stop();
1857
2087
  }
1858
- }, _callee18, this, [[1, 10]]);
2088
+ }, _callee19, this, [[1, 10]]);
1859
2089
  }));
1860
2090
  function loadSchedules() {
1861
2091
  return _loadSchedules.apply(this, arguments);
@@ -1883,15 +2113,16 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1883
2113
  }, {
1884
2114
  key: "getTempOrder",
1885
2115
  value: function getTempOrder() {
1886
- var _this$store$order5;
1887
- var result = ((_this$store$order5 = this.store.order) === null || _this$store$order5 === void 0 ? void 0 : _this$store$order5.getTempOrder()) || null;
2116
+ var _this$store$order7;
2117
+ var result = ((_this$store$order7 = this.store.order) === null || _this$store$order7 === void 0 ? void 0 : _this$store$order7.getTempOrder()) || null;
1888
2118
  return result;
1889
2119
  }
1890
2120
  }, {
1891
2121
  key: "updateTempOrderNote",
1892
2122
  value: function updateTempOrderNote(note) {
2123
+ var sync = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1893
2124
  if (!this.store.order) throw new Error('order 模块未初始化');
1894
- return this.store.order.updateTempOrderNote(note);
2125
+ return this.store.order.updateTempOrderNote(note, sync);
1895
2126
  }
1896
2127
  }, {
1897
2128
  key: "updateTempOrderContactsInfo",
@@ -1900,23 +2131,23 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1900
2131
  return this.store.order.updateTempOrderContactsInfo(contactsInfo);
1901
2132
  }
1902
2133
  }, {
1903
- key: "ensureTempOrder",
1904
- value: function ensureTempOrder() {
2134
+ key: "ensureVenueTempOrder",
2135
+ value: function ensureVenueTempOrder() {
1905
2136
  if (!this.store.order) throw new Error('order 模块未初始化');
1906
2137
  return this.store.order.ensureTempOrder();
1907
2138
  }
1908
2139
  }, {
1909
2140
  key: "onCustomerLogin",
1910
2141
  value: function () {
1911
- var _onCustomerLogin = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(params) {
1912
- return _regeneratorRuntime().wrap(function _callee19$(_context19) {
1913
- while (1) switch (_context19.prev = _context19.next) {
2142
+ var _onCustomerLogin = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(params) {
2143
+ return _regeneratorRuntime().wrap(function _callee20$(_context20) {
2144
+ while (1) switch (_context20.prev = _context20.next) {
1914
2145
  case 0:
1915
2146
  this.logMethodStart('onCustomerLogin', {
1916
2147
  customerId: params.customerId
1917
2148
  });
1918
- _context19.prev = 1;
1919
- _context19.next = 4;
2149
+ _context20.prev = 1;
2150
+ _context20.next = 4;
1920
2151
  return this.refreshOrderMarketingAfterLogin({
1921
2152
  customerId: params.customerId
1922
2153
  });
@@ -1924,20 +2155,20 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1924
2155
  this.logMethodSuccess('onCustomerLogin', {
1925
2156
  customerId: params.customerId
1926
2157
  });
1927
- _context19.next = 11;
2158
+ _context20.next = 11;
1928
2159
  break;
1929
2160
  case 7:
1930
- _context19.prev = 7;
1931
- _context19.t0 = _context19["catch"](1);
1932
- this.logMethodError('onCustomerLogin', _context19.t0);
1933
- throw _context19.t0;
2161
+ _context20.prev = 7;
2162
+ _context20.t0 = _context20["catch"](1);
2163
+ this.logMethodError('onCustomerLogin', _context20.t0);
2164
+ throw _context20.t0;
1934
2165
  case 11:
1935
2166
  case "end":
1936
- return _context19.stop();
2167
+ return _context20.stop();
1937
2168
  }
1938
- }, _callee19, this, [[1, 7]]);
2169
+ }, _callee20, this, [[1, 7]]);
1939
2170
  }));
1940
- function onCustomerLogin(_x12) {
2171
+ function onCustomerLogin(_x13) {
1941
2172
  return _onCustomerLogin.apply(this, arguments);
1942
2173
  }
1943
2174
  return onCustomerLogin;
@@ -1951,13 +2182,13 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1951
2182
  var tempOrder = this.store.order.getTempOrder();
1952
2183
  if (!(tempOrder !== null && tempOrder !== void 0 && (_tempOrder$products = tempOrder.products) !== null && _tempOrder$products !== void 0 && _tempOrder$products.length)) return;
1953
2184
  var now = dayjs().format('YYYY-MM-DD HH:mm:ss');
1954
- var _iterator12 = _createForOfIteratorHelper(tempOrder.products),
1955
- _step12;
2185
+ var _iterator13 = _createForOfIteratorHelper(tempOrder.products),
2186
+ _step13;
1956
2187
  try {
1957
2188
  var _loop4 = function _loop4() {
1958
- var _product$metadata2;
1959
- var product = _step12.value;
1960
- if ((_product$metadata2 = product.metadata) !== null && _product$metadata2 !== void 0 && _product$metadata2.venue_booking) {
2189
+ var _product$metadata3;
2190
+ var product = _step13.value;
2191
+ if ((_product$metadata3 = product.metadata) !== null && _product$metadata3 !== void 0 && _product$metadata3.venue_booking) {
1961
2192
  var mappings = _this10.resourceProductMap.get(product.metadata.resource_id);
1962
2193
  if (!mappings || !mappings.length) return 0; // continue
1963
2194
  var mapping = mappings.find(function (m) {
@@ -1999,43 +2230,43 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
1999
2230
  }
2000
2231
  },
2001
2232
  _ret;
2002
- for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
2233
+ for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
2003
2234
  _ret = _loop4();
2004
2235
  if (_ret === 0) continue;
2005
2236
  }
2006
2237
  } catch (err) {
2007
- _iterator12.e(err);
2238
+ _iterator13.e(err);
2008
2239
  } finally {
2009
- _iterator12.f();
2240
+ _iterator13.f();
2010
2241
  }
2011
2242
  }
2012
2243
  }, {
2013
2244
  key: "scanCode",
2014
2245
  value: function () {
2015
- var _scanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(code, customerId) {
2246
+ var _scanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(code, customerId) {
2016
2247
  var result;
2017
- return _regeneratorRuntime().wrap(function _callee20$(_context20) {
2018
- while (1) switch (_context20.prev = _context20.next) {
2248
+ return _regeneratorRuntime().wrap(function _callee21$(_context21) {
2249
+ while (1) switch (_context21.prev = _context21.next) {
2019
2250
  case 0:
2020
2251
  this.logMethodStart('scanCode', {
2021
2252
  code: code
2022
2253
  });
2023
- _context20.prev = 1;
2254
+ _context21.prev = 1;
2024
2255
  if (this.store.order) {
2025
- _context20.next = 4;
2256
+ _context21.next = 4;
2026
2257
  break;
2027
2258
  }
2028
2259
  throw new Error('order 模块未初始化');
2029
2260
  case 4:
2030
- _context20.next = 6;
2261
+ _context21.next = 6;
2031
2262
  return this.store.order.scanCode(code, customerId);
2032
2263
  case 6:
2033
- result = _context20.sent;
2264
+ result = _context21.sent;
2034
2265
  if (!result.isAvailable) {
2035
- _context20.next = 11;
2266
+ _context21.next = 11;
2036
2267
  break;
2037
2268
  }
2038
- _context20.next = 10;
2269
+ _context21.next = 10;
2039
2270
  return this.store.order.recalculateSummary({
2040
2271
  createIfMissing: true
2041
2272
  });
@@ -2045,19 +2276,19 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2045
2276
  this.logMethodSuccess('scanCode', {
2046
2277
  isAvailable: result.isAvailable
2047
2278
  });
2048
- return _context20.abrupt("return", result);
2279
+ return _context21.abrupt("return", result);
2049
2280
  case 15:
2050
- _context20.prev = 15;
2051
- _context20.t0 = _context20["catch"](1);
2052
- this.logMethodError('scanCode', _context20.t0);
2053
- throw _context20.t0;
2281
+ _context21.prev = 15;
2282
+ _context21.t0 = _context21["catch"](1);
2283
+ this.logMethodError('scanCode', _context21.t0);
2284
+ throw _context21.t0;
2054
2285
  case 19:
2055
2286
  case "end":
2056
- return _context20.stop();
2287
+ return _context21.stop();
2057
2288
  }
2058
- }, _callee20, this, [[1, 15]]);
2289
+ }, _callee21, this, [[1, 15]]);
2059
2290
  }));
2060
- function scanCode(_x13, _x14) {
2291
+ function scanCode(_x14, _x15) {
2061
2292
  return _scanCode.apply(this, arguments);
2062
2293
  }
2063
2294
  return scanCode;
@@ -2073,15 +2304,15 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2073
2304
  }, {
2074
2305
  key: "setDiscountSelected",
2075
2306
  value: (function () {
2076
- var _setDiscountSelected = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(params) {
2077
- var _tempOrder$holder, _this$store$order$get, _this$store$order$get2, list, beforeTarget, updated, updatedTarget, tempOrder, orderStore, discountModule, rulesModule, holders, nextDiscountList, _tempOrder$holder2, result, beforeSelectedIds, _iterator13, _step13, d, selectedResourceIds, _iterator14, _step14, _origin, _product$metadata$sou, _product$metadata3, _product$metadata4, _product$original_pri, product, totalPerUnitDiscount, optionSum, sourcePrice, newSourceSellingPrice, newMainSellingPrice, afterApplyTarget, finalSummary, finalProduct, finalTarget;
2078
- return _regeneratorRuntime().wrap(function _callee21$(_context21) {
2079
- while (1) switch (_context21.prev = _context21.next) {
2307
+ var _setDiscountSelected = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(params) {
2308
+ var _tempOrder$holder, _this$store$order$get, _this$store$order$get2, list, beforeTarget, updated, updatedTarget, tempOrder, orderStore, discountModule, rulesModule, holders, nextDiscountList, _tempOrder$holder2, result, beforeSelectedIds, _iterator14, _step14, d, selectedResourceIds, _iterator15, _step15, _product$metadata$sou, _product$metadata4, _product$metadata5, _product$original_pri, product, origin, totalPerUnitDiscount, optionSum, sourcePrice, newSourceSellingPrice, newMainSellingPrice, afterApplyTarget, finalSummary, finalProduct, finalTarget;
2309
+ return _regeneratorRuntime().wrap(function _callee22$(_context22) {
2310
+ while (1) switch (_context22.prev = _context22.next) {
2080
2311
  case 0:
2081
2312
  this.logMethodStart('setDiscountSelected', params);
2082
- _context21.prev = 1;
2313
+ _context22.prev = 1;
2083
2314
  if (this.store.order) {
2084
- _context21.next = 4;
2315
+ _context22.next = 4;
2085
2316
  break;
2086
2317
  }
2087
2318
  throw new Error('order 模块未初始化');
@@ -2107,7 +2338,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2107
2338
  form_record_id: tempOrder.holder.form_record_id
2108
2339
  }] : [];
2109
2340
  nextDiscountList = updated;
2110
- _context21.next = 16;
2341
+ _context22.next = 16;
2111
2342
  return discountModule === null || discountModule === void 0 ? void 0 : discountModule.setDiscountList(updated);
2112
2343
  case 16:
2113
2344
  if (rulesModule) {
@@ -2134,18 +2365,18 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2134
2365
  }).map(function (d) {
2135
2366
  return d.id;
2136
2367
  }));
2137
- _iterator13 = _createForOfIteratorHelper(nextDiscountList);
2368
+ _iterator14 = _createForOfIteratorHelper(nextDiscountList);
2138
2369
  try {
2139
- for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
2140
- d = _step13.value;
2370
+ for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
2371
+ d = _step14.value;
2141
2372
  if (d.isSelected && !beforeSelectedIds.has(d.id)) {
2142
2373
  d.isSelected = false;
2143
2374
  }
2144
2375
  }
2145
2376
  } catch (err) {
2146
- _iterator13.e(err);
2377
+ _iterator14.e(err);
2147
2378
  } finally {
2148
- _iterator13.f();
2379
+ _iterator14.f();
2149
2380
  }
2150
2381
  }
2151
2382
  }
@@ -2158,21 +2389,22 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2158
2389
  // 都以 original_price - Σ (当前选中 discount_list.amount) 重算 selling_price。
2159
2390
  // 目的:避免 unselect 后 selling_price 残留、reselect 时把残留价带进下一轮 Rules 造成双折扣。
2160
2391
  // 手动改价商品(_origin.isManualDiscount=true)不参与券流程归一化,保留手工价。
2161
- _iterator14 = _createForOfIteratorHelper(tempOrder.products);
2162
- _context21.prev = 19;
2163
- _iterator14.s();
2392
+ _iterator15 = _createForOfIteratorHelper(tempOrder.products);
2393
+ _context22.prev = 19;
2394
+ _iterator15.s();
2164
2395
  case 21:
2165
- if ((_step14 = _iterator14.n()).done) {
2166
- _context21.next = 35;
2396
+ if ((_step15 = _iterator15.n()).done) {
2397
+ _context22.next = 36;
2167
2398
  break;
2168
2399
  }
2169
- product = _step14.value;
2170
- if (!((_origin = product._origin) !== null && _origin !== void 0 && _origin.isManualDiscount)) {
2171
- _context21.next = 25;
2400
+ product = _step15.value;
2401
+ origin = this.readProductOriginFromTempOrder(tempOrder, product);
2402
+ if (!(origin !== null && origin !== void 0 && origin.isManualDiscount)) {
2403
+ _context22.next = 26;
2172
2404
  break;
2173
2405
  }
2174
- return _context21.abrupt("continue", 33);
2175
- case 25:
2406
+ return _context22.abrupt("continue", 34);
2407
+ case 26:
2176
2408
  // 1. 把 product.discount_list 和当前选中的 discount 对齐(剔除已取消的券)
2177
2409
  product.discount_list = (product.discount_list || []).filter(function (pd) {
2178
2410
  var _pd$discount$resource, _pd$discount;
@@ -2186,7 +2418,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2186
2418
  return sum + (pd.amount || 0);
2187
2419
  }, 0);
2188
2420
  optionSum = sumOptionUnitPrice(getProductSkuOptions(product));
2189
- sourcePrice = (_product$metadata$sou = (_product$metadata3 = product.metadata) === null || _product$metadata3 === void 0 ? void 0 : _product$metadata3.source_product_price) !== null && _product$metadata$sou !== void 0 ? _product$metadata$sou : ((_product$metadata4 = product.metadata) === null || _product$metadata4 === void 0 ? void 0 : _product$metadata4.main_product_original_price) != null ? new Decimal(Number(product.metadata.main_product_original_price) || 0).minus(optionSum).toFixed(2) : (_product$original_pri = product.original_price) !== null && _product$original_pri !== void 0 ? _product$original_pri : '0';
2421
+ sourcePrice = (_product$metadata$sou = (_product$metadata4 = product.metadata) === null || _product$metadata4 === void 0 ? void 0 : _product$metadata4.source_product_price) !== null && _product$metadata$sou !== void 0 ? _product$metadata$sou : ((_product$metadata5 = product.metadata) === null || _product$metadata5 === void 0 ? void 0 : _product$metadata5.main_product_original_price) != null ? new Decimal(Number(product.metadata.main_product_original_price) || 0).minus(optionSum).toFixed(2) : (_product$original_pri = product.original_price) !== null && _product$original_pri !== void 0 ? _product$original_pri : '0';
2190
2422
  newSourceSellingPrice = new Decimal(Number(sourcePrice) || 0).minus(totalPerUnitDiscount).toDecimalPlaces(2).toString();
2191
2423
  newMainSellingPrice = new Decimal(Number(newSourceSellingPrice) || 0).plus(optionSum).toDecimalPlaces(2).toFixed(2);
2192
2424
  if (product.metadata) {
@@ -2197,36 +2429,36 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2197
2429
  mainPrice: newMainSellingPrice,
2198
2430
  bundle: product.product_bundle
2199
2431
  });
2200
- case 33:
2201
- _context21.next = 21;
2432
+ case 34:
2433
+ _context22.next = 21;
2202
2434
  break;
2203
- case 35:
2204
- _context21.next = 40;
2435
+ case 36:
2436
+ _context22.next = 41;
2205
2437
  break;
2206
- case 37:
2207
- _context21.prev = 37;
2208
- _context21.t0 = _context21["catch"](19);
2209
- _iterator14.e(_context21.t0);
2210
- case 40:
2211
- _context21.prev = 40;
2212
- _iterator14.f();
2213
- return _context21.finish(40);
2214
- case 43:
2438
+ case 38:
2439
+ _context22.prev = 38;
2440
+ _context22.t0 = _context22["catch"](19);
2441
+ _iterator15.e(_context22.t0);
2442
+ case 41:
2443
+ _context22.prev = 41;
2444
+ _iterator15.f();
2445
+ return _context22.finish(41);
2446
+ case 44:
2215
2447
  OrderModule.populateSavedAmounts(tempOrder.products, nextDiscountList);
2216
- _context21.next = 46;
2448
+ _context22.next = 47;
2217
2449
  return discountModule === null || discountModule === void 0 ? void 0 : discountModule.setDiscountList(nextDiscountList);
2218
- case 46:
2450
+ case 47:
2219
2451
  tempOrder.discount_list = (nextDiscountList || []).filter(function (d) {
2220
2452
  return d.isSelected;
2221
2453
  });
2222
2454
  afterApplyTarget = this.store.order.getDiscountList().find(function (d) {
2223
2455
  return d.id === params.discountId;
2224
2456
  }) || null;
2225
- _context21.next = 50;
2457
+ _context22.next = 51;
2226
2458
  return this.store.order.recalculateSummary({
2227
2459
  createIfMissing: true
2228
2460
  });
2229
- case 50:
2461
+ case 51:
2230
2462
  this.store.order.persistTempOrder();
2231
2463
  finalSummary = ((_this$store$order$get = this.store.order.getTempOrder()) === null || _this$store$order$get === void 0 ? void 0 : _this$store$order$get.summary) || null;
2232
2464
  finalProduct = ((_this$store$order$get2 = this.store.order.getTempOrder()) === null || _this$store$order$get2 === void 0 || (_this$store$order$get2 = _this$store$order$get2.products) === null || _this$store$order$get2 === void 0 ? void 0 : _this$store$order$get2[0]) || null;
@@ -2234,19 +2466,19 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2234
2466
  finalTarget = this.store.order.getDiscountList().find(function (d) {
2235
2467
  return d.id === params.discountId;
2236
2468
  }) || null;
2237
- return _context21.abrupt("return", this.store.order.getDiscountList());
2238
- case 58:
2239
- _context21.prev = 58;
2240
- _context21.t1 = _context21["catch"](1);
2241
- this.logMethodError('setDiscountSelected', _context21.t1);
2242
- throw _context21.t1;
2243
- case 62:
2469
+ return _context22.abrupt("return", this.store.order.getDiscountList());
2470
+ case 59:
2471
+ _context22.prev = 59;
2472
+ _context22.t1 = _context22["catch"](1);
2473
+ this.logMethodError('setDiscountSelected', _context22.t1);
2474
+ throw _context22.t1;
2475
+ case 63:
2244
2476
  case "end":
2245
- return _context21.stop();
2477
+ return _context22.stop();
2246
2478
  }
2247
- }, _callee21, this, [[1, 58], [19, 37, 40, 43]]);
2479
+ }, _callee22, this, [[1, 59], [19, 38, 41, 44]]);
2248
2480
  }));
2249
- function setDiscountSelected(_x15) {
2481
+ function setDiscountSelected(_x16) {
2250
2482
  return _setDiscountSelected.apply(this, arguments);
2251
2483
  }
2252
2484
  return setDiscountSelected;
@@ -2254,37 +2486,37 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2254
2486
  }, {
2255
2487
  key: "addNewOrder",
2256
2488
  value: function () {
2257
- var _addNewOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22() {
2489
+ var _addNewOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23() {
2258
2490
  var tempOrder;
2259
- return _regeneratorRuntime().wrap(function _callee22$(_context22) {
2260
- while (1) switch (_context22.prev = _context22.next) {
2491
+ return _regeneratorRuntime().wrap(function _callee23$(_context23) {
2492
+ while (1) switch (_context23.prev = _context23.next) {
2261
2493
  case 0:
2262
2494
  this.logMethodStart('addNewOrder');
2263
- _context22.prev = 1;
2495
+ _context23.prev = 1;
2264
2496
  if (this.store.order) {
2265
- _context22.next = 4;
2497
+ _context23.next = 4;
2266
2498
  break;
2267
2499
  }
2268
2500
  throw new Error('order 模块未初始化');
2269
2501
  case 4:
2270
- _context22.next = 6;
2502
+ _context23.next = 6;
2271
2503
  return this.store.order.addNewOrder();
2272
2504
  case 6:
2273
- tempOrder = _context22.sent;
2505
+ tempOrder = _context23.sent;
2274
2506
  this.logMethodSuccess('addNewOrder', {
2275
2507
  productCount: tempOrder.products.length
2276
2508
  });
2277
- return _context22.abrupt("return", tempOrder);
2509
+ return _context23.abrupt("return", tempOrder);
2278
2510
  case 11:
2279
- _context22.prev = 11;
2280
- _context22.t0 = _context22["catch"](1);
2281
- this.logMethodError('addNewOrder', _context22.t0);
2282
- throw _context22.t0;
2511
+ _context23.prev = 11;
2512
+ _context23.t0 = _context23["catch"](1);
2513
+ this.logMethodError('addNewOrder', _context23.t0);
2514
+ throw _context23.t0;
2283
2515
  case 15:
2284
2516
  case "end":
2285
- return _context22.stop();
2517
+ return _context23.stop();
2286
2518
  }
2287
- }, _callee22, this, [[1, 11]]);
2519
+ }, _callee23, this, [[1, 11]]);
2288
2520
  }));
2289
2521
  function addNewOrder() {
2290
2522
  return _addNewOrder.apply(this, arguments);
@@ -2301,37 +2533,37 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2301
2533
  }, {
2302
2534
  key: "getSummary",
2303
2535
  value: function () {
2304
- var _getSummary = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23() {
2536
+ var _getSummary = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24() {
2305
2537
  var summary;
2306
- return _regeneratorRuntime().wrap(function _callee23$(_context23) {
2307
- while (1) switch (_context23.prev = _context23.next) {
2538
+ return _regeneratorRuntime().wrap(function _callee24$(_context24) {
2539
+ while (1) switch (_context24.prev = _context24.next) {
2308
2540
  case 0:
2309
2541
  this.logMethodStart('getSummary');
2310
- _context23.prev = 1;
2542
+ _context24.prev = 1;
2311
2543
  if (this.store.order) {
2312
- _context23.next = 4;
2544
+ _context24.next = 4;
2313
2545
  break;
2314
2546
  }
2315
2547
  throw new Error('order 模块未初始化');
2316
2548
  case 4:
2317
- _context23.next = 6;
2549
+ _context24.next = 6;
2318
2550
  return this.store.order.getOrderSummary();
2319
2551
  case 6:
2320
- summary = _context23.sent;
2552
+ summary = _context24.sent;
2321
2553
  this.logMethodSuccess('getSummary', {
2322
2554
  totalAmount: summary.total_amount
2323
2555
  });
2324
- return _context23.abrupt("return", summary);
2556
+ return _context24.abrupt("return", summary);
2325
2557
  case 11:
2326
- _context23.prev = 11;
2327
- _context23.t0 = _context23["catch"](1);
2328
- this.logMethodError('getSummary', _context23.t0);
2329
- throw _context23.t0;
2558
+ _context24.prev = 11;
2559
+ _context24.t0 = _context24["catch"](1);
2560
+ this.logMethodError('getSummary', _context24.t0);
2561
+ throw _context24.t0;
2330
2562
  case 15:
2331
2563
  case "end":
2332
- return _context23.stop();
2564
+ return _context24.stop();
2333
2565
  }
2334
- }, _callee23, this, [[1, 11]]);
2566
+ }, _callee24, this, [[1, 11]]);
2335
2567
  }));
2336
2568
  function getSummary() {
2337
2569
  return _getSummary.apply(this, arguments);
@@ -2341,47 +2573,47 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2341
2573
  }, {
2342
2574
  key: "submitOrder",
2343
2575
  value: function () {
2344
- var _submitOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24() {
2345
- var _this$otherParams8, _this$otherParams9, _this$otherParams10, _this$otherParams11, _tempOrder$products2, result, tempOrder;
2346
- return _regeneratorRuntime().wrap(function _callee24$(_context24) {
2347
- while (1) switch (_context24.prev = _context24.next) {
2576
+ var _submitOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25() {
2577
+ var _this$otherParams13, _this$otherParams14, _this$otherParams15, _this$otherParams16, _tempOrder$products2, result, tempOrder;
2578
+ return _regeneratorRuntime().wrap(function _callee25$(_context25) {
2579
+ while (1) switch (_context25.prev = _context25.next) {
2348
2580
  case 0:
2349
2581
  this.logMethodStart('submitOrder');
2350
- _context24.prev = 1;
2351
- _context24.next = 4;
2582
+ _context25.prev = 1;
2583
+ _context25.next = 4;
2352
2584
  return this.validateBeforeSubmitByItemRule();
2353
2585
  case 4:
2354
2586
  if (this.store.order) {
2355
- _context24.next = 6;
2587
+ _context25.next = 6;
2356
2588
  break;
2357
2589
  }
2358
2590
  throw new Error('venueBooking解决方案需要 order 模块支持');
2359
2591
  case 6:
2360
- _context24.next = 8;
2592
+ _context25.next = 8;
2361
2593
  return this.store.order.submitTempOrder({
2362
2594
  cacheId: this.cacheId,
2363
- platform: (_this$otherParams8 = this.otherParams) === null || _this$otherParams8 === void 0 ? void 0 : _this$otherParams8.platform,
2364
- businessCode: (_this$otherParams9 = this.otherParams) === null || _this$otherParams9 === void 0 ? void 0 : _this$otherParams9.businessCode,
2365
- channel: (_this$otherParams10 = this.otherParams) === null || _this$otherParams10 === void 0 ? void 0 : _this$otherParams10.channel,
2366
- type: (_this$otherParams11 = this.otherParams) === null || _this$otherParams11 === void 0 ? void 0 : _this$otherParams11.type
2595
+ platform: (_this$otherParams13 = this.otherParams) === null || _this$otherParams13 === void 0 ? void 0 : _this$otherParams13.platform,
2596
+ businessCode: (_this$otherParams14 = this.otherParams) === null || _this$otherParams14 === void 0 ? void 0 : _this$otherParams14.businessCode,
2597
+ channel: (_this$otherParams15 = this.otherParams) === null || _this$otherParams15 === void 0 ? void 0 : _this$otherParams15.channel,
2598
+ type: (_this$otherParams16 = this.otherParams) === null || _this$otherParams16 === void 0 ? void 0 : _this$otherParams16.type
2367
2599
  });
2368
2600
  case 8:
2369
- result = _context24.sent;
2601
+ result = _context25.sent;
2370
2602
  tempOrder = this.store.order.getTempOrder();
2371
2603
  this.logMethodSuccess('submitOrder', {
2372
2604
  productCount: (tempOrder === null || tempOrder === void 0 || (_tempOrder$products2 = tempOrder.products) === null || _tempOrder$products2 === void 0 ? void 0 : _tempOrder$products2.length) || 0
2373
2605
  });
2374
- return _context24.abrupt("return", result);
2606
+ return _context25.abrupt("return", result);
2375
2607
  case 14:
2376
- _context24.prev = 14;
2377
- _context24.t0 = _context24["catch"](1);
2378
- this.logMethodError('submitOrder', _context24.t0);
2379
- throw _context24.t0;
2608
+ _context25.prev = 14;
2609
+ _context25.t0 = _context25["catch"](1);
2610
+ this.logMethodError('submitOrder', _context25.t0);
2611
+ throw _context25.t0;
2380
2612
  case 18:
2381
2613
  case "end":
2382
- return _context24.stop();
2614
+ return _context25.stop();
2383
2615
  }
2384
- }, _callee24, this, [[1, 14]]);
2616
+ }, _callee25, this, [[1, 14]]);
2385
2617
  }));
2386
2618
  function submitOrder() {
2387
2619
  return _submitOrder.apply(this, arguments);
@@ -2391,23 +2623,23 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2391
2623
  }, {
2392
2624
  key: "addProductToOrder",
2393
2625
  value: function () {
2394
- var _addProductToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25(product) {
2395
- var _product$metadata5, _product$product_vari2, quotationPrice, products;
2396
- return _regeneratorRuntime().wrap(function _callee25$(_context25) {
2397
- while (1) switch (_context25.prev = _context25.next) {
2626
+ var _addProductToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(product) {
2627
+ var _product$metadata6, _product$product_vari2, quotationPrice, products;
2628
+ return _regeneratorRuntime().wrap(function _callee26$(_context26) {
2629
+ while (1) switch (_context26.prev = _context26.next) {
2398
2630
  case 0:
2399
2631
  this.logMethodStart('addProductToOrder', {
2400
2632
  product_id: product.product_id,
2401
2633
  product_variant_id: product.product_variant_id
2402
2634
  });
2403
- _context25.prev = 1;
2635
+ _context26.prev = 1;
2404
2636
  if (this.store.order) {
2405
- _context25.next = 4;
2637
+ _context26.next = 4;
2406
2638
  break;
2407
2639
  }
2408
2640
  throw new Error('order 模块未初始化');
2409
2641
  case 4:
2410
- if (!((_product$metadata5 = product.metadata) !== null && _product$metadata5 !== void 0 && _product$metadata5.venue_booking) && this.store.quotation && product.product_id != null) {
2642
+ if (!((_product$metadata6 = product.metadata) !== null && _product$metadata6 !== void 0 && _product$metadata6.venue_booking) && this.store.quotation && product.product_id != null) {
2411
2643
  quotationPrice = this.store.quotation.getPriceForProduct({
2412
2644
  productId: product.product_id,
2413
2645
  variantId: (_product$product_vari2 = product.product_variant_id) !== null && _product$product_vari2 !== void 0 ? _product$product_vari2 : undefined,
@@ -2420,32 +2652,32 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2420
2652
  product.original_price = product.selling_price;
2421
2653
  }
2422
2654
  }
2423
- _context25.next = 7;
2655
+ _context26.next = 7;
2424
2656
  return this.store.order.addProductToOrder(product);
2425
2657
  case 7:
2426
- products = _context25.sent;
2427
- _context25.next = 10;
2658
+ products = _context26.sent;
2659
+ _context26.next = 10;
2428
2660
  return this.refreshItemRuleQuantityLimits();
2429
2661
  case 10:
2430
- _context25.next = 12;
2662
+ _context26.next = 12;
2431
2663
  return this.refreshCartValidationPassed();
2432
2664
  case 12:
2433
2665
  this.logMethodSuccess('addProductToOrder', {
2434
2666
  productCount: products.length
2435
2667
  });
2436
- return _context25.abrupt("return", products);
2668
+ return _context26.abrupt("return", products);
2437
2669
  case 16:
2438
- _context25.prev = 16;
2439
- _context25.t0 = _context25["catch"](1);
2440
- this.logMethodError('addProductToOrder', _context25.t0);
2441
- throw _context25.t0;
2670
+ _context26.prev = 16;
2671
+ _context26.t0 = _context26["catch"](1);
2672
+ this.logMethodError('addProductToOrder', _context26.t0);
2673
+ throw _context26.t0;
2442
2674
  case 20:
2443
2675
  case "end":
2444
- return _context25.stop();
2676
+ return _context26.stop();
2445
2677
  }
2446
- }, _callee25, this, [[1, 16]]);
2678
+ }, _callee26, this, [[1, 16]]);
2447
2679
  }));
2448
- function addProductToOrder(_x16) {
2680
+ function addProductToOrder(_x17) {
2449
2681
  return _addProductToOrder.apply(this, arguments);
2450
2682
  }
2451
2683
  return addProductToOrder;
@@ -2453,48 +2685,48 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2453
2685
  }, {
2454
2686
  key: "updateOrderProduct",
2455
2687
  value: function () {
2456
- var _updateOrderProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(params) {
2688
+ var _updateOrderProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(params) {
2457
2689
  var products;
2458
- return _regeneratorRuntime().wrap(function _callee26$(_context26) {
2459
- while (1) switch (_context26.prev = _context26.next) {
2690
+ return _regeneratorRuntime().wrap(function _callee27$(_context27) {
2691
+ while (1) switch (_context27.prev = _context27.next) {
2460
2692
  case 0:
2461
2693
  this.logMethodStart('updateOrderProduct', {
2462
2694
  product_id: params.product_id,
2463
2695
  product_variant_id: params.product_variant_id
2464
2696
  });
2465
- _context26.prev = 1;
2697
+ _context27.prev = 1;
2466
2698
  if (this.store.order) {
2467
- _context26.next = 4;
2699
+ _context27.next = 4;
2468
2700
  break;
2469
2701
  }
2470
2702
  throw new Error('order 模块未初始化');
2471
2703
  case 4:
2472
- _context26.next = 6;
2704
+ _context27.next = 6;
2473
2705
  return this.store.order.updateOrderProduct(params);
2474
2706
  case 6:
2475
- products = _context26.sent;
2476
- _context26.next = 9;
2707
+ products = _context27.sent;
2708
+ _context27.next = 9;
2477
2709
  return this.refreshItemRuleQuantityLimits();
2478
2710
  case 9:
2479
- _context26.next = 11;
2711
+ _context27.next = 11;
2480
2712
  return this.refreshCartValidationPassed();
2481
2713
  case 11:
2482
2714
  this.logMethodSuccess('updateOrderProduct', {
2483
2715
  productCount: products.length
2484
2716
  });
2485
- return _context26.abrupt("return", products);
2717
+ return _context27.abrupt("return", products);
2486
2718
  case 15:
2487
- _context26.prev = 15;
2488
- _context26.t0 = _context26["catch"](1);
2489
- this.logMethodError('updateOrderProduct', _context26.t0);
2490
- throw _context26.t0;
2719
+ _context27.prev = 15;
2720
+ _context27.t0 = _context27["catch"](1);
2721
+ this.logMethodError('updateOrderProduct', _context27.t0);
2722
+ throw _context27.t0;
2491
2723
  case 19:
2492
2724
  case "end":
2493
- return _context26.stop();
2725
+ return _context27.stop();
2494
2726
  }
2495
- }, _callee26, this, [[1, 15]]);
2727
+ }, _callee27, this, [[1, 15]]);
2496
2728
  }));
2497
- function updateOrderProduct(_x17) {
2729
+ function updateOrderProduct(_x18) {
2498
2730
  return _updateOrderProduct.apply(this, arguments);
2499
2731
  }
2500
2732
  return updateOrderProduct;
@@ -2502,66 +2734,66 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2502
2734
  }, {
2503
2735
  key: "removeProductFromOrder",
2504
2736
  value: function () {
2505
- var _removeProductFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(identity) {
2506
- var _this$store$order$get3, _this$store$order6, _this$store$order$ens, _this$store$order7, _tempOrder$bookings, tempOrder, products, _tempOrder$bookings2, _tempOrder$bookings3, venueProductUids, venueBookingUids, _iterator15, _step15, _product$metadata6, _product$metadata7, product, beforeBookingCount, _this$store$order$per, _this$store$order8;
2507
- return _regeneratorRuntime().wrap(function _callee27$(_context27) {
2508
- while (1) switch (_context27.prev = _context27.next) {
2737
+ var _removeProductFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(identity) {
2738
+ var _this$store$order$get3, _this$store$order8, _this$store$order$ens, _this$store$order9, _tempOrder$bookings, tempOrder, products, _tempOrder$bookings2, _tempOrder$bookings3, venueProductUids, venueBookingUids, _iterator16, _step16, _product$metadata7, _product$metadata8, product, beforeBookingCount, _this$store$order$per, _this$store$order10;
2739
+ return _regeneratorRuntime().wrap(function _callee28$(_context28) {
2740
+ while (1) switch (_context28.prev = _context28.next) {
2509
2741
  case 0:
2510
2742
  this.logMethodStart('removeProductFromOrder', {
2511
2743
  product_id: identity.product_id,
2512
2744
  product_variant_id: identity.product_variant_id
2513
2745
  });
2514
- _context27.prev = 1;
2746
+ _context28.prev = 1;
2515
2747
  if (this.store.order) {
2516
- _context27.next = 4;
2748
+ _context28.next = 4;
2517
2749
  break;
2518
2750
  }
2519
2751
  throw new Error('order 模块未初始化');
2520
2752
  case 4:
2521
- tempOrder = ((_this$store$order$get3 = (_this$store$order6 = this.store.order).getTempOrder) === null || _this$store$order$get3 === void 0 ? void 0 : _this$store$order$get3.call(_this$store$order6)) || ((_this$store$order$ens = (_this$store$order7 = this.store.order).ensureTempOrder) === null || _this$store$order$ens === void 0 ? void 0 : _this$store$order$ens.call(_this$store$order7));
2522
- _context27.next = 7;
2753
+ tempOrder = ((_this$store$order$get3 = (_this$store$order8 = this.store.order).getTempOrder) === null || _this$store$order$get3 === void 0 ? void 0 : _this$store$order$get3.call(_this$store$order8)) || ((_this$store$order$ens = (_this$store$order9 = this.store.order).ensureTempOrder) === null || _this$store$order$ens === void 0 ? void 0 : _this$store$order$ens.call(_this$store$order9));
2754
+ _context28.next = 7;
2523
2755
  return this.store.order.removeProductFromOrder(identity);
2524
2756
  case 7:
2525
- products = _context27.sent;
2757
+ products = _context28.sent;
2526
2758
  if (!(tempOrder !== null && tempOrder !== void 0 && (_tempOrder$bookings = tempOrder.bookings) !== null && _tempOrder$bookings !== void 0 && _tempOrder$bookings.length)) {
2527
- _context27.next = 33;
2759
+ _context28.next = 33;
2528
2760
  break;
2529
2761
  }
2530
2762
  venueProductUids = new Set();
2531
2763
  venueBookingUids = new Set();
2532
- _iterator15 = _createForOfIteratorHelper(tempOrder.products || []);
2533
- _context27.prev = 12;
2534
- _iterator15.s();
2764
+ _iterator16 = _createForOfIteratorHelper(tempOrder.products || []);
2765
+ _context28.prev = 12;
2766
+ _iterator16.s();
2535
2767
  case 14:
2536
- if ((_step15 = _iterator15.n()).done) {
2537
- _context27.next = 22;
2768
+ if ((_step16 = _iterator16.n()).done) {
2769
+ _context28.next = 22;
2538
2770
  break;
2539
2771
  }
2540
- product = _step15.value;
2541
- if (product !== null && product !== void 0 && (_product$metadata6 = product.metadata) !== null && _product$metadata6 !== void 0 && _product$metadata6.venue_booking) {
2542
- _context27.next = 18;
2772
+ product = _step16.value;
2773
+ if (product !== null && product !== void 0 && (_product$metadata7 = product.metadata) !== null && _product$metadata7 !== void 0 && _product$metadata7.venue_booking) {
2774
+ _context28.next = 18;
2543
2775
  break;
2544
2776
  }
2545
- return _context27.abrupt("continue", 20);
2777
+ return _context28.abrupt("continue", 20);
2546
2778
  case 18:
2547
2779
  if (product.identity_key) venueProductUids.add(String(product.identity_key));
2548
- if ((_product$metadata7 = product.metadata) !== null && _product$metadata7 !== void 0 && _product$metadata7.booking_uid) {
2780
+ if ((_product$metadata8 = product.metadata) !== null && _product$metadata8 !== void 0 && _product$metadata8.booking_uid) {
2549
2781
  venueBookingUids.add(String(product.metadata.booking_uid));
2550
2782
  }
2551
2783
  case 20:
2552
- _context27.next = 14;
2784
+ _context28.next = 14;
2553
2785
  break;
2554
2786
  case 22:
2555
- _context27.next = 27;
2787
+ _context28.next = 27;
2556
2788
  break;
2557
2789
  case 24:
2558
- _context27.prev = 24;
2559
- _context27.t0 = _context27["catch"](12);
2560
- _iterator15.e(_context27.t0);
2790
+ _context28.prev = 24;
2791
+ _context28.t0 = _context28["catch"](12);
2792
+ _iterator16.e(_context28.t0);
2561
2793
  case 27:
2562
- _context27.prev = 27;
2563
- _iterator15.f();
2564
- return _context27.finish(27);
2794
+ _context28.prev = 27;
2795
+ _iterator16.f();
2796
+ return _context28.finish(27);
2565
2797
  case 30:
2566
2798
  beforeBookingCount = ((_tempOrder$bookings2 = tempOrder.bookings) === null || _tempOrder$bookings2 === void 0 ? void 0 : _tempOrder$bookings2.length) || 0;
2567
2799
  tempOrder.bookings = (tempOrder.bookings || []).filter(function (booking) {
@@ -2575,31 +2807,31 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2575
2807
  return true;
2576
2808
  });
2577
2809
  if ((((_tempOrder$bookings3 = tempOrder.bookings) === null || _tempOrder$bookings3 === void 0 ? void 0 : _tempOrder$bookings3.length) || 0) !== beforeBookingCount) {
2578
- (_this$store$order$per = (_this$store$order8 = this.store.order).persistTempOrder) === null || _this$store$order$per === void 0 || _this$store$order$per.call(_this$store$order8);
2810
+ (_this$store$order$per = (_this$store$order10 = this.store.order).persistTempOrder) === null || _this$store$order$per === void 0 || _this$store$order$per.call(_this$store$order10);
2579
2811
  }
2580
2812
  case 33:
2581
- _context27.next = 35;
2813
+ _context28.next = 35;
2582
2814
  return this.refreshItemRuleQuantityLimits();
2583
2815
  case 35:
2584
- _context27.next = 37;
2816
+ _context28.next = 37;
2585
2817
  return this.refreshCartValidationPassed();
2586
2818
  case 37:
2587
2819
  this.logMethodSuccess('removeProductFromOrder', {
2588
2820
  productCount: products.length
2589
2821
  });
2590
- return _context27.abrupt("return", products);
2822
+ return _context28.abrupt("return", products);
2591
2823
  case 41:
2592
- _context27.prev = 41;
2593
- _context27.t1 = _context27["catch"](1);
2594
- this.logMethodError('removeProductFromOrder', _context27.t1);
2595
- throw _context27.t1;
2824
+ _context28.prev = 41;
2825
+ _context28.t1 = _context28["catch"](1);
2826
+ this.logMethodError('removeProductFromOrder', _context28.t1);
2827
+ throw _context28.t1;
2596
2828
  case 45:
2597
2829
  case "end":
2598
- return _context27.stop();
2830
+ return _context28.stop();
2599
2831
  }
2600
- }, _callee27, this, [[1, 41], [12, 24, 27, 30]]);
2832
+ }, _callee28, this, [[1, 41], [12, 24, 27, 30]]);
2601
2833
  }));
2602
- function removeProductFromOrder(_x18) {
2834
+ function removeProductFromOrder(_x19) {
2603
2835
  return _removeProductFromOrder.apply(this, arguments);
2604
2836
  }
2605
2837
  return removeProductFromOrder;
@@ -2607,27 +2839,27 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2607
2839
  }, {
2608
2840
  key: "getProductList",
2609
2841
  value: function () {
2610
- var _getProductList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28() {
2842
+ var _getProductList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29() {
2611
2843
  var result;
2612
- return _regeneratorRuntime().wrap(function _callee28$(_context28) {
2613
- while (1) switch (_context28.prev = _context28.next) {
2844
+ return _regeneratorRuntime().wrap(function _callee29$(_context29) {
2845
+ while (1) switch (_context29.prev = _context29.next) {
2614
2846
  case 0:
2615
2847
  if (!this.productsLoaded) {
2616
- _context28.next = 2;
2848
+ _context29.next = 2;
2617
2849
  break;
2618
2850
  }
2619
- return _context28.abrupt("return", attachItemRuleLimitsToTopLevelProducts(this.getAddonProductsList(), this.store.itemRuleQuantityLimits || []));
2851
+ return _context29.abrupt("return", attachItemRuleLimitsToTopLevelProducts(this.getAddonProductsList(), this.store.itemRuleQuantityLimits || []));
2620
2852
  case 2:
2621
- _context28.next = 4;
2853
+ _context29.next = 4;
2622
2854
  return this.loadAllProducts();
2623
2855
  case 4:
2624
- result = _context28.sent;
2625
- return _context28.abrupt("return", attachItemRuleLimitsToTopLevelProducts(result.addonProducts, this.store.itemRuleQuantityLimits || []));
2856
+ result = _context29.sent;
2857
+ return _context29.abrupt("return", attachItemRuleLimitsToTopLevelProducts(result.addonProducts, this.store.itemRuleQuantityLimits || []));
2626
2858
  case 6:
2627
2859
  case "end":
2628
- return _context28.stop();
2860
+ return _context29.stop();
2629
2861
  }
2630
- }, _callee28, this);
2862
+ }, _callee29, this);
2631
2863
  }));
2632
2864
  function getProductList() {
2633
2865
  return _getProductList.apply(this, arguments);
@@ -2637,13 +2869,13 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2637
2869
  }, {
2638
2870
  key: "loadOpenDataConfig",
2639
2871
  value: function () {
2640
- var _loadOpenDataConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29() {
2872
+ var _loadOpenDataConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30() {
2641
2873
  var lastFetchedAt, cachedData, openDataConfig;
2642
- return _regeneratorRuntime().wrap(function _callee29$(_context29) {
2643
- while (1) switch (_context29.prev = _context29.next) {
2874
+ return _regeneratorRuntime().wrap(function _callee30$(_context30) {
2875
+ while (1) switch (_context30.prev = _context30.next) {
2644
2876
  case 0:
2645
2877
  if (this.store.openData) {
2646
- _context29.next = 2;
2878
+ _context30.next = 2;
2647
2879
  break;
2648
2880
  }
2649
2881
  throw new Error('openData 模块未初始化');
@@ -2651,42 +2883,42 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2651
2883
  lastFetchedAt = this.store.openData.getLastFetchedAt();
2652
2884
  cachedData = this.store.openData.getOpenData();
2653
2885
  if (!(cachedData && lastFetchedAt && Date.now() - lastFetchedAt < VenueBookingImpl.OPEN_DATA_CACHE_TTL)) {
2654
- _context29.next = 7;
2886
+ _context30.next = 7;
2655
2887
  break;
2656
2888
  }
2657
2889
  this.otherParams.openData = cachedData;
2658
- return _context29.abrupt("return", cachedData);
2890
+ return _context30.abrupt("return", cachedData);
2659
2891
  case 7:
2660
2892
  if (!this.loadOpenDataConfigInFlight) {
2661
- _context29.next = 11;
2893
+ _context30.next = 11;
2662
2894
  break;
2663
2895
  }
2664
- _context29.next = 10;
2896
+ _context30.next = 10;
2665
2897
  return this.loadOpenDataConfigInFlight;
2666
2898
  case 10:
2667
- return _context29.abrupt("return", _context29.sent);
2899
+ return _context30.abrupt("return", _context30.sent);
2668
2900
  case 11:
2669
2901
  this.loadOpenDataConfigInFlight = this.store.openData.fetchOpenData({
2670
2902
  scope: 'board',
2671
2903
  target: 'venue_booking+online_store',
2672
2904
  section_code: [].concat(OPEN_DATA_SECTION_CODES)
2673
2905
  });
2674
- _context29.prev = 12;
2675
- _context29.next = 15;
2906
+ _context30.prev = 12;
2907
+ _context30.next = 15;
2676
2908
  return this.loadOpenDataConfigInFlight;
2677
2909
  case 15:
2678
- openDataConfig = _context29.sent;
2910
+ openDataConfig = _context30.sent;
2679
2911
  this.otherParams.openData = openDataConfig;
2680
- return _context29.abrupt("return", openDataConfig);
2912
+ return _context30.abrupt("return", openDataConfig);
2681
2913
  case 18:
2682
- _context29.prev = 18;
2914
+ _context30.prev = 18;
2683
2915
  this.loadOpenDataConfigInFlight = null;
2684
- return _context29.finish(18);
2916
+ return _context30.finish(18);
2685
2917
  case 21:
2686
2918
  case "end":
2687
- return _context29.stop();
2919
+ return _context30.stop();
2688
2920
  }
2689
- }, _callee29, this, [[12,, 18, 21]]);
2921
+ }, _callee30, this, [[12,, 18, 21]]);
2690
2922
  }));
2691
2923
  function loadOpenDataConfig() {
2692
2924
  return _loadOpenDataConfig.apply(this, arguments);
@@ -2696,29 +2928,29 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2696
2928
  }, {
2697
2929
  key: "loadRuntimeConfigs",
2698
2930
  value: function () {
2699
- var _loadRuntimeConfigs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30() {
2931
+ var _loadRuntimeConfigs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31() {
2700
2932
  var itemRuleConfigs;
2701
- return _regeneratorRuntime().wrap(function _callee30$(_context30) {
2702
- while (1) switch (_context30.prev = _context30.next) {
2933
+ return _regeneratorRuntime().wrap(function _callee31$(_context31) {
2934
+ while (1) switch (_context31.prev = _context31.next) {
2703
2935
  case 0:
2704
- _context30.next = 2;
2936
+ _context31.next = 2;
2705
2937
  return this.loadOpenDataConfig();
2706
2938
  case 2:
2707
- _context30.next = 4;
2939
+ _context31.next = 4;
2708
2940
  return this.ensureItemRuleConfigsLoaded();
2709
2941
  case 4:
2710
- itemRuleConfigs = _context30.sent;
2942
+ itemRuleConfigs = _context31.sent;
2711
2943
  this.logMethodSuccess('loadRuntimeConfigs', {
2712
2944
  itemRuleCount: itemRuleConfigs.length
2713
2945
  });
2714
- return _context30.abrupt("return", {
2946
+ return _context31.abrupt("return", {
2715
2947
  itemRuleConfigs: itemRuleConfigs
2716
2948
  });
2717
2949
  case 7:
2718
2950
  case "end":
2719
- return _context30.stop();
2951
+ return _context31.stop();
2720
2952
  }
2721
- }, _callee30, this);
2953
+ }, _callee31, this);
2722
2954
  }));
2723
2955
  function loadRuntimeConfigs() {
2724
2956
  return _loadRuntimeConfigs.apply(this, arguments);
@@ -2728,22 +2960,22 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2728
2960
  }, {
2729
2961
  key: "fetchItemRuleConfigsByModelIds",
2730
2962
  value: function () {
2731
- var _fetchItemRuleConfigsByModelIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(strategyModelIds) {
2963
+ var _fetchItemRuleConfigsByModelIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(strategyModelIds) {
2732
2964
  var result, configs;
2733
- return _regeneratorRuntime().wrap(function _callee31$(_context31) {
2734
- while (1) switch (_context31.prev = _context31.next) {
2965
+ return _regeneratorRuntime().wrap(function _callee32$(_context32) {
2966
+ while (1) switch (_context32.prev = _context32.next) {
2735
2967
  case 0:
2736
2968
  this.logMethodStart('fetchItemRuleConfigsByModelIds', {
2737
2969
  strategyModelIds: strategyModelIds
2738
2970
  });
2739
2971
  if (strategyModelIds.length) {
2740
- _context31.next = 3;
2972
+ _context32.next = 3;
2741
2973
  break;
2742
2974
  }
2743
- return _context31.abrupt("return", []);
2975
+ return _context32.abrupt("return", []);
2744
2976
  case 3:
2745
- _context31.prev = 3;
2746
- _context31.next = 6;
2977
+ _context32.prev = 3;
2978
+ _context32.next = 6;
2747
2979
  return this.request.get('/promotion', {
2748
2980
  skip: 1,
2749
2981
  num: 99,
@@ -2751,7 +2983,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2751
2983
  ids: strategyModelIds
2752
2984
  });
2753
2985
  case 6:
2754
- result = _context31.sent;
2986
+ result = _context32.sent;
2755
2987
  configs = [];
2756
2988
  if (result.code === 200) {
2757
2989
  configs = result.data.list.map(function (item) {
@@ -2762,21 +2994,21 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2762
2994
  strategyModelIds: strategyModelIds,
2763
2995
  strategyCount: configs.length
2764
2996
  });
2765
- return _context31.abrupt("return", configs);
2997
+ return _context32.abrupt("return", configs);
2766
2998
  case 13:
2767
- _context31.prev = 13;
2768
- _context31.t0 = _context31["catch"](3);
2769
- this.logMethodError('fetchItemRuleConfigsByModelIds', _context31.t0, {
2999
+ _context32.prev = 13;
3000
+ _context32.t0 = _context32["catch"](3);
3001
+ this.logMethodError('fetchItemRuleConfigsByModelIds', _context32.t0, {
2770
3002
  strategyModelIds: strategyModelIds
2771
3003
  });
2772
- return _context31.abrupt("return", []);
3004
+ return _context32.abrupt("return", []);
2773
3005
  case 17:
2774
3006
  case "end":
2775
- return _context31.stop();
3007
+ return _context32.stop();
2776
3008
  }
2777
- }, _callee31, this, [[3, 13]]);
3009
+ }, _callee32, this, [[3, 13]]);
2778
3010
  }));
2779
- function fetchItemRuleConfigsByModelIds(_x19) {
3011
+ function fetchItemRuleConfigsByModelIds(_x20) {
2780
3012
  return _fetchItemRuleConfigsByModelIds.apply(this, arguments);
2781
3013
  }
2782
3014
  return fetchItemRuleConfigsByModelIds;
@@ -2784,22 +3016,22 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2784
3016
  }, {
2785
3017
  key: "buildPrefillProductSourceMap",
2786
3018
  value: function () {
2787
- var _buildPrefillProductSourceMap = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32() {
3019
+ var _buildPrefillProductSourceMap = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33() {
2788
3020
  var sourceMap, productList, visited, collectFromValue;
2789
- return _regeneratorRuntime().wrap(function _callee32$(_context32) {
2790
- while (1) switch (_context32.prev = _context32.next) {
3021
+ return _regeneratorRuntime().wrap(function _callee33$(_context33) {
3022
+ while (1) switch (_context33.prev = _context33.next) {
2791
3023
  case 0:
2792
3024
  sourceMap = new Map();
2793
- _context32.prev = 1;
2794
- _context32.next = 4;
3025
+ _context33.prev = 1;
3026
+ _context33.next = 4;
2795
3027
  return this.getProductList();
2796
3028
  case 4:
2797
- productList = _context32.sent;
3029
+ productList = _context33.sent;
2798
3030
  if (Array.isArray(productList)) {
2799
- _context32.next = 7;
3031
+ _context33.next = 7;
2800
3032
  break;
2801
3033
  }
2802
- return _context32.abrupt("return", sourceMap);
3034
+ return _context33.abrupt("return", sourceMap);
2803
3035
  case 7:
2804
3036
  visited = new Set();
2805
3037
  collectFromValue = function collectFromValue(value) {
@@ -2808,17 +3040,17 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2808
3040
  if (visited.has(value)) return;
2809
3041
  visited.add(value);
2810
3042
  if (Array.isArray(value)) {
2811
- var _iterator16 = _createForOfIteratorHelper(value),
2812
- _step16;
3043
+ var _iterator17 = _createForOfIteratorHelper(value),
3044
+ _step17;
2813
3045
  try {
2814
- for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) {
2815
- var item = _step16.value;
3046
+ for (_iterator17.s(); !(_step17 = _iterator17.n()).done;) {
3047
+ var item = _step17.value;
2816
3048
  collectFromValue(item);
2817
3049
  }
2818
3050
  } catch (err) {
2819
- _iterator16.e(err);
3051
+ _iterator17.e(err);
2820
3052
  } finally {
2821
- _iterator16.f();
3053
+ _iterator17.f();
2822
3054
  }
2823
3055
  return;
2824
3056
  }
@@ -2826,8 +3058,8 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2826
3058
  var rawProductId = (_node$product_id = node.product_id) !== null && _node$product_id !== void 0 ? _node$product_id : node.id;
2827
3059
  var productId = Number(rawProductId);
2828
3060
  if (Number.isFinite(productId) && productId > 0) {
2829
- var _ref3, _node$product_variant;
2830
- var productVariantId = Number((_ref3 = (_node$product_variant = node.product_variant_id) !== null && _node$product_variant !== void 0 ? _node$product_variant : node.variant_id) !== null && _ref3 !== void 0 ? _ref3 : 0);
3061
+ var _ref5, _node$product_variant;
3062
+ var productVariantId = Number((_ref5 = (_node$product_variant = node.product_variant_id) !== null && _node$product_variant !== void 0 ? _node$product_variant : node.variant_id) !== null && _ref5 !== void 0 ? _ref5 : 0);
2831
3063
  var normalizedVariantId = Number.isNaN(productVariantId) ? 0 : productVariantId;
2832
3064
  var key = buildProductKey(productId, normalizedVariantId);
2833
3065
  if (!sourceMap.has(key)) sourceMap.set(key, node);
@@ -2838,19 +3070,19 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2838
3070
  }
2839
3071
  };
2840
3072
  collectFromValue(productList);
2841
- _context32.next = 15;
3073
+ _context33.next = 15;
2842
3074
  break;
2843
3075
  case 12:
2844
- _context32.prev = 12;
2845
- _context32.t0 = _context32["catch"](1);
2846
- this.logMethodError('buildPrefillProductSourceMap', _context32.t0);
3076
+ _context33.prev = 12;
3077
+ _context33.t0 = _context33["catch"](1);
3078
+ this.logMethodError('buildPrefillProductSourceMap', _context33.t0);
2847
3079
  case 15:
2848
- return _context32.abrupt("return", sourceMap);
3080
+ return _context33.abrupt("return", sourceMap);
2849
3081
  case 16:
2850
3082
  case "end":
2851
- return _context32.stop();
3083
+ return _context33.stop();
2852
3084
  }
2853
- }, _callee32, this, [[1, 12]]);
3085
+ }, _callee33, this, [[1, 12]]);
2854
3086
  }));
2855
3087
  function buildPrefillProductSourceMap() {
2856
3088
  return _buildPrefillProductSourceMap.apply(this, arguments);
@@ -2865,56 +3097,56 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2865
3097
  }, {
2866
3098
  key: "ensureItemRuleConfigsLoaded",
2867
3099
  value: function () {
2868
- var _ensureItemRuleConfigsLoaded = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34() {
3100
+ var _ensureItemRuleConfigsLoaded = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35() {
2869
3101
  var _this11 = this;
2870
- return _regeneratorRuntime().wrap(function _callee34$(_context34) {
2871
- while (1) switch (_context34.prev = _context34.next) {
3102
+ return _regeneratorRuntime().wrap(function _callee35$(_context35) {
3103
+ while (1) switch (_context35.prev = _context35.next) {
2872
3104
  case 0:
2873
3105
  if (!(this.itemRuleConfigs.length > 0)) {
2874
- _context34.next = 2;
3106
+ _context35.next = 2;
2875
3107
  break;
2876
3108
  }
2877
- return _context34.abrupt("return", this.itemRuleConfigs);
3109
+ return _context35.abrupt("return", this.itemRuleConfigs);
2878
3110
  case 2:
2879
3111
  if (!this.itemRuleConfigsPromise) {
2880
- _context34.next = 4;
3112
+ _context35.next = 4;
2881
3113
  break;
2882
3114
  }
2883
- return _context34.abrupt("return", this.itemRuleConfigsPromise);
3115
+ return _context35.abrupt("return", this.itemRuleConfigsPromise);
2884
3116
  case 4:
2885
- this.itemRuleConfigsPromise = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33() {
3117
+ this.itemRuleConfigsPromise = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34() {
2886
3118
  var runtimeConfig, staticConfigs;
2887
- return _regeneratorRuntime().wrap(function _callee33$(_context33) {
2888
- while (1) switch (_context33.prev = _context33.next) {
3119
+ return _regeneratorRuntime().wrap(function _callee34$(_context34) {
3120
+ while (1) switch (_context34.prev = _context34.next) {
2889
3121
  case 0:
2890
3122
  runtimeConfig = _this11.getItemRuleRuntimeConfig();
2891
3123
  staticConfigs = normalizeItemRuleStrategies(runtimeConfig.strategyConfigs);
2892
3124
  if (!(staticConfigs.length > 0)) {
2893
- _context33.next = 6;
3125
+ _context34.next = 6;
2894
3126
  break;
2895
3127
  }
2896
3128
  _this11.itemRuleConfigs = staticConfigs;
2897
3129
  _this11.itemRuleEvaluator.setStrategyConfigs(staticConfigs);
2898
- return _context33.abrupt("return", _this11.itemRuleConfigs);
3130
+ return _context34.abrupt("return", _this11.itemRuleConfigs);
2899
3131
  case 6:
2900
3132
  _this11.itemRuleConfigs = [];
2901
3133
  _this11.itemRuleEvaluator.setStrategyConfigs([]);
2902
- return _context33.abrupt("return", _this11.itemRuleConfigs);
3134
+ return _context34.abrupt("return", _this11.itemRuleConfigs);
2903
3135
  case 9:
2904
3136
  case "end":
2905
- return _context33.stop();
3137
+ return _context34.stop();
2906
3138
  }
2907
- }, _callee33);
3139
+ }, _callee34);
2908
3140
  }))();
2909
- _context34.next = 7;
3141
+ _context35.next = 7;
2910
3142
  return this.itemRuleConfigsPromise;
2911
3143
  case 7:
2912
- return _context34.abrupt("return", _context34.sent);
3144
+ return _context35.abrupt("return", _context35.sent);
2913
3145
  case 8:
2914
3146
  case "end":
2915
- return _context34.stop();
3147
+ return _context35.stop();
2916
3148
  }
2917
- }, _callee34, this);
3149
+ }, _callee35, this);
2918
3150
  }));
2919
3151
  function ensureItemRuleConfigsLoaded() {
2920
3152
  return _ensureItemRuleConfigsLoaded.apply(this, arguments);
@@ -2924,25 +3156,25 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2924
3156
  }, {
2925
3157
  key: "refreshItemRuleQuantityLimits",
2926
3158
  value: function () {
2927
- var _refreshItemRuleQuantityLimits = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35() {
3159
+ var _refreshItemRuleQuantityLimits = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36() {
2928
3160
  var strategyConfigs, businessData, limits;
2929
- return _regeneratorRuntime().wrap(function _callee35$(_context35) {
2930
- while (1) switch (_context35.prev = _context35.next) {
3161
+ return _regeneratorRuntime().wrap(function _callee36$(_context36) {
3162
+ while (1) switch (_context36.prev = _context36.next) {
2931
3163
  case 0:
2932
- _context35.prev = 0;
2933
- _context35.next = 3;
3164
+ _context36.prev = 0;
3165
+ _context36.next = 3;
2934
3166
  return this.ensureItemRuleConfigsLoaded();
2935
3167
  case 3:
2936
- strategyConfigs = _context35.sent;
3168
+ strategyConfigs = _context36.sent;
2937
3169
  if (strategyConfigs.length) {
2938
- _context35.next = 7;
3170
+ _context36.next = 7;
2939
3171
  break;
2940
3172
  }
2941
3173
  this.store.itemRuleQuantityLimits = [];
2942
- return _context35.abrupt("return", []);
3174
+ return _context36.abrupt("return", []);
2943
3175
  case 7:
2944
3176
  businessData = buildItemRuleBusinessData({
2945
- tempOrder: this.ensureTempOrder(),
3177
+ tempOrder: this.ensureVenueTempOrder(),
2946
3178
  runtimeConfig: this.getItemRuleRuntimeConfig(),
2947
3179
  itemRuleConfigs: this.itemRuleConfigs
2948
3180
  });
@@ -2951,18 +3183,18 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2951
3183
  this.logMethodSuccess('refreshItemRuleQuantityLimits', {
2952
3184
  limitCount: limits.length
2953
3185
  });
2954
- return _context35.abrupt("return", limits);
3186
+ return _context36.abrupt("return", limits);
2955
3187
  case 14:
2956
- _context35.prev = 14;
2957
- _context35.t0 = _context35["catch"](0);
3188
+ _context36.prev = 14;
3189
+ _context36.t0 = _context36["catch"](0);
2958
3190
  this.store.itemRuleQuantityLimits = [];
2959
- this.logMethodError('refreshItemRuleQuantityLimits', _context35.t0);
2960
- return _context35.abrupt("return", []);
3191
+ this.logMethodError('refreshItemRuleQuantityLimits', _context36.t0);
3192
+ return _context36.abrupt("return", []);
2961
3193
  case 19:
2962
3194
  case "end":
2963
- return _context35.stop();
3195
+ return _context36.stop();
2964
3196
  }
2965
- }, _callee35, this, [[0, 14]]);
3197
+ }, _callee36, this, [[0, 14]]);
2966
3198
  }));
2967
3199
  function refreshItemRuleQuantityLimits() {
2968
3200
  return _refreshItemRuleQuantityLimits.apply(this, arguments);
@@ -2972,75 +3204,75 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
2972
3204
  }, {
2973
3205
  key: "applyPrefillByItemRule",
2974
3206
  value: function () {
2975
- var _applyPrefillByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36() {
2976
- var strategyConfigs, businessData, prefillItems, productSourceMap, tempOrder, hasChanges, _iterator17, _step17, _prefillItem$product_, _origin2, prefillItem, productId, productVariantId, targetQuantity, sourceItem, productIndex, _sourceItem$price, sellingPrice, targetProduct, existedQuantity, delta, nextProduct;
2977
- return _regeneratorRuntime().wrap(function _callee36$(_context36) {
2978
- while (1) switch (_context36.prev = _context36.next) {
3207
+ var _applyPrefillByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee37() {
3208
+ var strategyConfigs, businessData, prefillItems, productSourceMap, tempOrder, hasChanges, _iterator18, _step18, _prefillItem$product_, prefillItem, productId, productVariantId, targetQuantity, sourceItem, productIndex, _sourceItem$price, _product$metadata9, sellingPrice, origin, product, productUid, targetProduct, previousOrigin, nextOrigin, existedQuantity, delta, nextProduct, _nextProduct$metadata, _productUid;
3209
+ return _regeneratorRuntime().wrap(function _callee37$(_context37) {
3210
+ while (1) switch (_context37.prev = _context37.next) {
2979
3211
  case 0:
2980
3212
  if (!this.itemRulePrefillApplied) {
2981
- _context36.next = 2;
3213
+ _context37.next = 2;
2982
3214
  break;
2983
3215
  }
2984
- return _context36.abrupt("return");
3216
+ return _context37.abrupt("return");
2985
3217
  case 2:
2986
3218
  if (this.store.order) {
2987
- _context36.next = 4;
3219
+ _context37.next = 4;
2988
3220
  break;
2989
3221
  }
2990
- return _context36.abrupt("return");
3222
+ return _context37.abrupt("return");
2991
3223
  case 4:
2992
- _context36.next = 6;
3224
+ _context37.next = 6;
2993
3225
  return this.ensureItemRuleConfigsLoaded();
2994
3226
  case 6:
2995
- strategyConfigs = _context36.sent;
3227
+ strategyConfigs = _context37.sent;
2996
3228
  if (strategyConfigs.length) {
2997
- _context36.next = 9;
3229
+ _context37.next = 9;
2998
3230
  break;
2999
3231
  }
3000
- return _context36.abrupt("return");
3232
+ return _context37.abrupt("return");
3001
3233
  case 9:
3002
3234
  businessData = buildItemRuleBusinessData({
3003
- tempOrder: this.ensureTempOrder(),
3235
+ tempOrder: this.ensureVenueTempOrder(),
3004
3236
  runtimeConfig: this.getItemRuleRuntimeConfig(),
3005
3237
  itemRuleConfigs: this.itemRuleConfigs
3006
3238
  });
3007
3239
  prefillItems = this.itemRuleEvaluator.getPrefillItems(businessData);
3008
3240
  if (prefillItems.length) {
3009
- _context36.next = 14;
3241
+ _context37.next = 14;
3010
3242
  break;
3011
3243
  }
3012
3244
  this.itemRulePrefillApplied = true;
3013
- return _context36.abrupt("return");
3245
+ return _context37.abrupt("return");
3014
3246
  case 14:
3015
- _context36.next = 16;
3247
+ _context37.next = 16;
3016
3248
  return this.buildPrefillProductSourceMap();
3017
3249
  case 16:
3018
- productSourceMap = _context36.sent;
3019
- tempOrder = this.ensureTempOrder();
3250
+ productSourceMap = _context37.sent;
3251
+ tempOrder = this.ensureVenueTempOrder();
3020
3252
  hasChanges = false;
3021
- _iterator17 = _createForOfIteratorHelper(prefillItems);
3022
- _context36.prev = 20;
3023
- _iterator17.s();
3253
+ _iterator18 = _createForOfIteratorHelper(prefillItems);
3254
+ _context37.prev = 20;
3255
+ _iterator18.s();
3024
3256
  case 22:
3025
- if ((_step17 = _iterator17.n()).done) {
3026
- _context36.next = 45;
3257
+ if ((_step18 = _iterator18.n()).done) {
3258
+ _context37.next = 51;
3027
3259
  break;
3028
3260
  }
3029
- prefillItem = _step17.value;
3261
+ prefillItem = _step18.value;
3030
3262
  productId = Number(prefillItem.product_id);
3031
3263
  productVariantId = Number((_prefillItem$product_ = prefillItem.product_variant_id) !== null && _prefillItem$product_ !== void 0 ? _prefillItem$product_ : 0);
3032
3264
  targetQuantity = toNonNegativeInt(prefillItem.quantity);
3033
3265
  if (!(!Number.isFinite(productId) || targetQuantity <= 0)) {
3034
- _context36.next = 29;
3266
+ _context37.next = 29;
3035
3267
  break;
3036
3268
  }
3037
- return _context36.abrupt("continue", 43);
3269
+ return _context37.abrupt("continue", 49);
3038
3270
  case 29:
3039
3271
  if (!Number.isNaN(productVariantId)) {
3040
- _context36.next = 31;
3272
+ _context37.next = 31;
3041
3273
  break;
3042
3274
  }
3043
- return _context36.abrupt("continue", 43);
3275
+ return _context37.abrupt("continue", 49);
3044
3276
  case 31:
3045
3277
  sourceItem = productSourceMap.get(buildProductKey(productId, productVariantId)) || productSourceMap.get(buildProductKey(productId, 0)) || null;
3046
3278
  productIndex = getProductIdentityIndex(tempOrder.products, {
@@ -3048,11 +3280,15 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
3048
3280
  product_variant_id: productVariantId
3049
3281
  });
3050
3282
  if (!(productIndex === -1)) {
3051
- _context36.next = 38;
3283
+ _context37.next = 42;
3052
3284
  break;
3053
3285
  }
3054
3286
  sellingPrice = toPriceString((_sourceItem$price = sourceItem === null || sourceItem === void 0 ? void 0 : sourceItem.price) !== null && _sourceItem$price !== void 0 ? _sourceItem$price : sourceItem === null || sourceItem === void 0 ? void 0 : sourceItem.selling_price, '0.00');
3055
- tempOrder.products.push(normalizeOrderProduct({
3287
+ origin = _objectSpread(_objectSpread({}, sourceItem || {}), {}, {
3288
+ item_rule_prefill: true,
3289
+ item_rule_id: prefillItem.ruleId
3290
+ });
3291
+ product = normalizeOrderProduct({
3056
3292
  product_id: productId,
3057
3293
  product_variant_id: productVariantId,
3058
3294
  num: targetQuantity,
@@ -3062,15 +3298,17 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
3062
3298
  item_rule_prefill: true,
3063
3299
  item_rule_id: prefillItem.ruleId
3064
3300
  },
3065
- _origin: _objectSpread(_objectSpread({}, sourceItem || {}), {}, {
3066
- item_rule_prefill: true,
3067
- item_rule_id: prefillItem.ruleId
3068
- })
3069
- }));
3301
+ _origin: origin
3302
+ });
3303
+ productUid = String(((_product$metadata9 = product.metadata) === null || _product$metadata9 === void 0 ? void 0 : _product$metadata9.unique_identification_number) || '');
3304
+ this.attachProductOriginToTempOrder(tempOrder, productUid, origin);
3305
+ tempOrder.products.push(product);
3070
3306
  hasChanges = true;
3071
- return _context36.abrupt("continue", 43);
3072
- case 38:
3307
+ return _context37.abrupt("continue", 49);
3308
+ case 42:
3073
3309
  targetProduct = tempOrder.products[productIndex];
3310
+ previousOrigin = this.readProductOriginFromTempOrder(tempOrder, targetProduct);
3311
+ nextOrigin = sourceItem ? _objectSpread(_objectSpread({}, previousOrigin || {}), sourceItem) : previousOrigin;
3074
3312
  existedQuantity = toNonNegativeInt(targetProduct.num);
3075
3313
  delta = targetQuantity - existedQuantity;
3076
3314
  nextProduct = _objectSpread(_objectSpread(_objectSpread({}, targetProduct), delta > 0 ? {
@@ -3079,54 +3317,55 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
3079
3317
  metadata: _objectSpread(_objectSpread({}, targetProduct.metadata || {}), {}, {
3080
3318
  item_rule_prefill: true,
3081
3319
  item_rule_id: prefillItem.ruleId
3082
- }),
3083
- _origin: sourceItem ? _objectSpread(_objectSpread({}, targetProduct._origin || {}), sourceItem) : targetProduct._origin
3320
+ })
3084
3321
  });
3085
- if (delta > 0 || Boolean(sourceItem && (!targetProduct._origin || ((_origin2 = targetProduct._origin) === null || _origin2 === void 0 ? void 0 : _origin2.price) !== (sourceItem === null || sourceItem === void 0 ? void 0 : sourceItem.price)))) {
3322
+ if (delta > 0 || Boolean(sourceItem && (!previousOrigin || (previousOrigin === null || previousOrigin === void 0 ? void 0 : previousOrigin.price) !== (sourceItem === null || sourceItem === void 0 ? void 0 : sourceItem.price)))) {
3323
+ _productUid = String(((_nextProduct$metadata = nextProduct.metadata) === null || _nextProduct$metadata === void 0 ? void 0 : _nextProduct$metadata.unique_identification_number) || '');
3324
+ this.attachProductOriginToTempOrder(tempOrder, _productUid, nextOrigin);
3086
3325
  tempOrder.products[productIndex] = nextProduct;
3087
3326
  hasChanges = true;
3088
3327
  }
3089
- case 43:
3090
- _context36.next = 22;
3328
+ case 49:
3329
+ _context37.next = 22;
3091
3330
  break;
3092
- case 45:
3093
- _context36.next = 50;
3331
+ case 51:
3332
+ _context37.next = 56;
3094
3333
  break;
3095
- case 47:
3096
- _context36.prev = 47;
3097
- _context36.t0 = _context36["catch"](20);
3098
- _iterator17.e(_context36.t0);
3099
- case 50:
3100
- _context36.prev = 50;
3101
- _iterator17.f();
3102
- return _context36.finish(50);
3103
3334
  case 53:
3335
+ _context37.prev = 53;
3336
+ _context37.t0 = _context37["catch"](20);
3337
+ _iterator18.e(_context37.t0);
3338
+ case 56:
3339
+ _context37.prev = 56;
3340
+ _iterator18.f();
3341
+ return _context37.finish(56);
3342
+ case 59:
3104
3343
  if (!hasChanges) {
3105
- _context36.next = 58;
3344
+ _context37.next = 64;
3106
3345
  break;
3107
3346
  }
3108
3347
  // Prefill 属于 products CRUD 的一种形式:新增后让 Rules 重算,以支持自动应用可用优惠券。
3109
3348
  this.store.order.applyDiscount();
3110
- _context36.next = 57;
3349
+ _context37.next = 63;
3111
3350
  return this.store.order.recalculateSummary({
3112
3351
  createIfMissing: true
3113
3352
  });
3114
- case 57:
3353
+ case 63:
3115
3354
  this.store.order.persistTempOrder();
3116
- case 58:
3117
- _context36.next = 60;
3355
+ case 64:
3356
+ _context37.next = 66;
3118
3357
  return this.refreshItemRuleQuantityLimits();
3119
- case 60:
3358
+ case 66:
3120
3359
  this.itemRulePrefillApplied = true;
3121
3360
  this.logMethodSuccess('applyPrefillByItemRule', {
3122
3361
  prefillCount: prefillItems.length,
3123
3362
  hasChanges: hasChanges
3124
3363
  });
3125
- case 62:
3364
+ case 68:
3126
3365
  case "end":
3127
- return _context36.stop();
3366
+ return _context37.stop();
3128
3367
  }
3129
- }, _callee36, this, [[20, 47, 50, 53]]);
3368
+ }, _callee37, this, [[20, 53, 56, 59]]);
3130
3369
  }));
3131
3370
  function applyPrefillByItemRule() {
3132
3371
  return _applyPrefillByItemRule.apply(this, arguments);
@@ -3136,24 +3375,24 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
3136
3375
  }, {
3137
3376
  key: "applyItemRulePrefill",
3138
3377
  value: function () {
3139
- var _applyItemRulePrefill = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee37() {
3140
- return _regeneratorRuntime().wrap(function _callee37$(_context37) {
3141
- while (1) switch (_context37.prev = _context37.next) {
3378
+ var _applyItemRulePrefill = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee38() {
3379
+ return _regeneratorRuntime().wrap(function _callee38$(_context38) {
3380
+ while (1) switch (_context38.prev = _context38.next) {
3142
3381
  case 0:
3143
3382
  this.logMethodStart('applyItemRulePrefill');
3144
- _context37.next = 3;
3383
+ _context38.next = 3;
3145
3384
  return this.applyPrefillByItemRule();
3146
3385
  case 3:
3147
- _context37.next = 5;
3386
+ _context38.next = 5;
3148
3387
  return this.refreshItemRuleQuantityLimits();
3149
3388
  case 5:
3150
- _context37.next = 7;
3389
+ _context38.next = 7;
3151
3390
  return this.refreshCartValidationPassed();
3152
3391
  case 7:
3153
3392
  case "end":
3154
- return _context37.stop();
3393
+ return _context38.stop();
3155
3394
  }
3156
- }, _callee37, this);
3395
+ }, _callee38, this);
3157
3396
  }));
3158
3397
  function applyItemRulePrefill() {
3159
3398
  return _applyItemRulePrefill.apply(this, arguments);
@@ -3163,35 +3402,35 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
3163
3402
  }, {
3164
3403
  key: "evaluateCartValidationByItemRule",
3165
3404
  value: function () {
3166
- var _evaluateCartValidationByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee38() {
3405
+ var _evaluateCartValidationByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee39() {
3167
3406
  var strategyConfigs, businessData;
3168
- return _regeneratorRuntime().wrap(function _callee38$(_context38) {
3169
- while (1) switch (_context38.prev = _context38.next) {
3407
+ return _regeneratorRuntime().wrap(function _callee39$(_context39) {
3408
+ while (1) switch (_context39.prev = _context39.next) {
3170
3409
  case 0:
3171
- _context38.next = 2;
3410
+ _context39.next = 2;
3172
3411
  return this.ensureItemRuleConfigsLoaded();
3173
3412
  case 2:
3174
- strategyConfigs = _context38.sent;
3413
+ strategyConfigs = _context39.sent;
3175
3414
  if (strategyConfigs.length) {
3176
- _context38.next = 5;
3415
+ _context39.next = 5;
3177
3416
  break;
3178
3417
  }
3179
- return _context38.abrupt("return", {
3418
+ return _context39.abrupt("return", {
3180
3419
  passed: true,
3181
3420
  failures: []
3182
3421
  });
3183
3422
  case 5:
3184
3423
  businessData = buildItemRuleBusinessData({
3185
- tempOrder: this.ensureTempOrder(),
3424
+ tempOrder: this.ensureVenueTempOrder(),
3186
3425
  runtimeConfig: this.getItemRuleRuntimeConfig(),
3187
3426
  itemRuleConfigs: this.itemRuleConfigs
3188
3427
  });
3189
- return _context38.abrupt("return", this.itemRuleEvaluator.validateCart(businessData));
3428
+ return _context39.abrupt("return", this.itemRuleEvaluator.validateCart(businessData));
3190
3429
  case 7:
3191
3430
  case "end":
3192
- return _context38.stop();
3431
+ return _context39.stop();
3193
3432
  }
3194
- }, _callee38, this);
3433
+ }, _callee39, this);
3195
3434
  }));
3196
3435
  function evaluateCartValidationByItemRule() {
3197
3436
  return _evaluateCartValidationByItemRule.apply(this, arguments);
@@ -3201,20 +3440,20 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
3201
3440
  }, {
3202
3441
  key: "validateBeforeSubmitByItemRule",
3203
3442
  value: function () {
3204
- var _validateBeforeSubmitByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee39() {
3443
+ var _validateBeforeSubmitByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40() {
3205
3444
  var validationResult, firstFailure, errorMessage, error;
3206
- return _regeneratorRuntime().wrap(function _callee39$(_context39) {
3207
- while (1) switch (_context39.prev = _context39.next) {
3445
+ return _regeneratorRuntime().wrap(function _callee40$(_context40) {
3446
+ while (1) switch (_context40.prev = _context40.next) {
3208
3447
  case 0:
3209
- _context39.next = 2;
3448
+ _context40.next = 2;
3210
3449
  return this.evaluateCartValidationByItemRule();
3211
3450
  case 2:
3212
- validationResult = _context39.sent;
3451
+ validationResult = _context40.sent;
3213
3452
  if (!validationResult.passed) {
3214
- _context39.next = 5;
3453
+ _context40.next = 5;
3215
3454
  break;
3216
3455
  }
3217
- return _context39.abrupt("return");
3456
+ return _context40.abrupt("return");
3218
3457
  case 5:
3219
3458
  firstFailure = validationResult.failures[0];
3220
3459
  errorMessage = (firstFailure === null || firstFailure === void 0 ? void 0 : firstFailure.validationMessage) || '当前购物车未满足商品规则,请调整后再提交';
@@ -3223,9 +3462,9 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
3223
3462
  throw error;
3224
3463
  case 10:
3225
3464
  case "end":
3226
- return _context39.stop();
3465
+ return _context40.stop();
3227
3466
  }
3228
- }, _callee39, this);
3467
+ }, _callee40, this);
3229
3468
  }));
3230
3469
  function validateBeforeSubmitByItemRule() {
3231
3470
  return _validateBeforeSubmitByItemRule.apply(this, arguments);
@@ -3235,10 +3474,10 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
3235
3474
  }, {
3236
3475
  key: "refreshCartValidationPassed",
3237
3476
  value: function () {
3238
- var _refreshCartValidationPassed = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40() {
3477
+ var _refreshCartValidationPassed = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee41() {
3239
3478
  var previous, nextState, validationResult, changed;
3240
- return _regeneratorRuntime().wrap(function _callee40$(_context40) {
3241
- while (1) switch (_context40.prev = _context40.next) {
3479
+ return _regeneratorRuntime().wrap(function _callee41$(_context41) {
3480
+ while (1) switch (_context41.prev = _context41.next) {
3242
3481
  case 0:
3243
3482
  previous = this.store.cartValidation || {
3244
3483
  passed: null,
@@ -3248,20 +3487,20 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
3248
3487
  passed: null,
3249
3488
  failures: []
3250
3489
  };
3251
- _context40.prev = 2;
3252
- _context40.next = 5;
3490
+ _context41.prev = 2;
3491
+ _context41.next = 5;
3253
3492
  return this.evaluateCartValidationByItemRule();
3254
3493
  case 5:
3255
- validationResult = _context40.sent;
3494
+ validationResult = _context41.sent;
3256
3495
  nextState = {
3257
3496
  passed: validationResult.passed,
3258
3497
  failures: validationResult.failures || []
3259
3498
  };
3260
- _context40.next = 12;
3499
+ _context41.next = 12;
3261
3500
  break;
3262
3501
  case 9:
3263
- _context40.prev = 9;
3264
- _context40.t0 = _context40["catch"](2);
3502
+ _context41.prev = 9;
3503
+ _context41.t0 = _context41["catch"](2);
3265
3504
  nextState = {
3266
3505
  passed: false,
3267
3506
  failures: []
@@ -3270,21 +3509,21 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
3270
3509
  this.store.cartValidation = nextState;
3271
3510
  changed = previous.passed !== nextState.passed || previous.failures !== nextState.failures;
3272
3511
  if (!changed) {
3273
- _context40.next = 17;
3512
+ _context41.next = 17;
3274
3513
  break;
3275
3514
  }
3276
- _context40.next = 17;
3515
+ _context41.next = 17;
3277
3516
  return this.core.effects.emit(VenueBookingHooks.onCartValidationChanged, {
3278
3517
  cartValidation: nextState,
3279
3518
  cartValidationPassed: nextState.passed
3280
3519
  });
3281
3520
  case 17:
3282
- return _context40.abrupt("return", nextState.passed);
3521
+ return _context41.abrupt("return", nextState.passed);
3283
3522
  case 18:
3284
3523
  case "end":
3285
- return _context40.stop();
3524
+ return _context41.stop();
3286
3525
  }
3287
- }, _callee40, this, [[2, 9]]);
3526
+ }, _callee41, this, [[2, 9]]);
3288
3527
  }));
3289
3528
  function refreshCartValidationPassed() {
3290
3529
  return _refreshCartValidationPassed.apply(this, arguments);
@@ -3294,14 +3533,14 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
3294
3533
  }, {
3295
3534
  key: "setItemRuleRuntimeConfig",
3296
3535
  value: function () {
3297
- var _setItemRuleRuntimeConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee41() {
3536
+ var _setItemRuleRuntimeConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee42() {
3298
3537
  var _this$itemRuleRuntime, _this$itemRuleRuntime2;
3299
3538
  var config,
3300
- _args41 = arguments;
3301
- return _regeneratorRuntime().wrap(function _callee41$(_context41) {
3302
- while (1) switch (_context41.prev = _context41.next) {
3539
+ _args42 = arguments;
3540
+ return _regeneratorRuntime().wrap(function _callee42$(_context42) {
3541
+ while (1) switch (_context42.prev = _context42.next) {
3303
3542
  case 0:
3304
- config = _args41.length > 0 && _args41[0] !== undefined ? _args41[0] : {};
3543
+ config = _args42.length > 0 && _args42[0] !== undefined ? _args42[0] : {};
3305
3544
  this.logMethodStart('setItemRuleRuntimeConfig');
3306
3545
  this.itemRuleRuntimeConfig = _objectSpread(_objectSpread(_objectSpread({}, this.itemRuleRuntimeConfig), config), {}, {
3307
3546
  pax: _objectSpread(_objectSpread({}, ((_this$itemRuleRuntime = this.itemRuleRuntimeConfig) === null || _this$itemRuleRuntime === void 0 ? void 0 : _this$itemRuleRuntime.pax) || {}), (config === null || config === void 0 ? void 0 : config.pax) || {}),
@@ -3313,10 +3552,10 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
3313
3552
  this.itemRuleEvaluator.setStrategyConfigs([]);
3314
3553
  }
3315
3554
  this.itemRulePrefillApplied = false;
3316
- _context41.next = 7;
3555
+ _context42.next = 7;
3317
3556
  return this.refreshItemRuleQuantityLimits();
3318
3557
  case 7:
3319
- _context41.next = 9;
3558
+ _context42.next = 9;
3320
3559
  return this.refreshCartValidationPassed();
3321
3560
  case 9:
3322
3561
  this.logMethodSuccess('setItemRuleRuntimeConfig', {
@@ -3324,9 +3563,9 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
3324
3563
  });
3325
3564
  case 10:
3326
3565
  case "end":
3327
- return _context41.stop();
3566
+ return _context42.stop();
3328
3567
  }
3329
- }, _callee41, this);
3568
+ }, _callee42, this);
3330
3569
  }));
3331
3570
  function setItemRuleRuntimeConfig() {
3332
3571
  return _setItemRuleRuntimeConfig.apply(this, arguments);
@@ -3353,23 +3592,23 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
3353
3592
  }, {
3354
3593
  key: "readUIStateBucket",
3355
3594
  value: function readUIStateBucket() {
3356
- var _this$window;
3595
+ var _this$window2;
3357
3596
  var key = this.getUIStateBucketKey();
3358
- if (!key || !((_this$window = this.window) !== null && _this$window !== void 0 && _this$window.sessionStorage)) return {};
3597
+ if (!key || !((_this$window2 = this.window) !== null && _this$window2 !== void 0 && _this$window2.sessionStorage)) return {};
3359
3598
  try {
3360
3599
  var raw = this.window.sessionStorage.getItem(key) || '{}';
3361
3600
  var parsed = JSON.parse(raw);
3362
3601
  return parsed && _typeof(parsed) === 'object' ? parsed : {};
3363
- } catch (_unused3) {
3602
+ } catch (_unused4) {
3364
3603
  return {};
3365
3604
  }
3366
3605
  }
3367
3606
  }, {
3368
3607
  key: "writeUIStateBucket",
3369
3608
  value: function writeUIStateBucket(bucket) {
3370
- var _this$window2;
3609
+ var _this$window3;
3371
3610
  var key = this.getUIStateBucketKey();
3372
- if (!key || !((_this$window2 = this.window) !== null && _this$window2 !== void 0 && _this$window2.sessionStorage)) return;
3611
+ if (!key || !((_this$window3 = this.window) !== null && _this$window3 !== void 0 && _this$window3.sessionStorage)) return;
3373
3612
  this.window.sessionStorage.setItem(key, JSON.stringify(bucket));
3374
3613
  }
3375
3614
  }, {
@@ -3397,30 +3636,118 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
3397
3636
  this.writeUIStateBucket(bucket);
3398
3637
  }
3399
3638
  }
3639
+ }, {
3640
+ key: "setBookingHolder",
3641
+ value: function setBookingHolder(bookingUid, holder) {
3642
+ var _tempOrder$bookings4;
3643
+ if (!this.store.order) return;
3644
+ var tempOrder = this.store.order.ensureTempOrder();
3645
+ var booking = (_tempOrder$bookings4 = tempOrder.bookings) === null || _tempOrder$bookings4 === void 0 ? void 0 : _tempOrder$bookings4.find(function (b) {
3646
+ var _b$metadata4;
3647
+ return ((_b$metadata4 = b.metadata) === null || _b$metadata4 === void 0 ? void 0 : _b$metadata4.unique_identification_number) === bookingUid;
3648
+ });
3649
+ if (booking) {
3650
+ booking.holder = holder;
3651
+ }
3652
+ var _iterator19 = _createForOfIteratorHelper(tempOrder.products),
3653
+ _step19;
3654
+ try {
3655
+ for (_iterator19.s(); !(_step19 = _iterator19.n()).done;) {
3656
+ var _runtimeProduct$metad, _runtimeProduct$metad2, _runtimeProduct$_orig;
3657
+ var product = _step19.value;
3658
+ var runtimeProduct = product;
3659
+ var productBookingUid = (_runtimeProduct$metad = (_runtimeProduct$metad2 = runtimeProduct.metadata) === null || _runtimeProduct$metad2 === void 0 ? void 0 : _runtimeProduct$metad2.booking_uid) !== null && _runtimeProduct$metad !== void 0 ? _runtimeProduct$metad : (_runtimeProduct$_orig = runtimeProduct._origin) === null || _runtimeProduct$_orig === void 0 || (_runtimeProduct$_orig = _runtimeProduct$_orig.product) === null || _runtimeProduct$_orig === void 0 ? void 0 : _runtimeProduct$_orig.bookingUuid;
3660
+ if (String(productBookingUid) !== String(bookingUid)) continue;
3661
+ var origin = runtimeProduct._origin && _typeof(runtimeProduct._origin) === 'object' ? runtimeProduct._origin : {};
3662
+ origin.holder = holder;
3663
+ runtimeProduct._origin = origin;
3664
+ }
3665
+ } catch (err) {
3666
+ _iterator19.e(err);
3667
+ } finally {
3668
+ _iterator19.f();
3669
+ }
3670
+ this.store.order.notifyTempOrderChanged();
3671
+ }
3672
+
3673
+ /**
3674
+ * 获取 holder 表单 map
3675
+ */
3676
+ }, {
3677
+ key: "getHolderFormMap",
3678
+ value: function getHolderFormMap() {
3679
+ if (!this.store.holder) throw new Error('[VenueBooking] holder 模块未初始化');
3680
+ return this.store.holder.getHolderFormMap();
3681
+ }
3682
+
3683
+ /**
3684
+ * UI 层触发:按当前 holderMap 批量刷新所有表单的 records
3685
+ */
3686
+ }, {
3687
+ key: "refreshAllHolderFormRecords",
3688
+ value: (function () {
3689
+ var _refreshAllHolderFormRecords = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee43(params) {
3690
+ var _params$customer_id, _params$useCache;
3691
+ var customer_id;
3692
+ return _regeneratorRuntime().wrap(function _callee43$(_context43) {
3693
+ while (1) switch (_context43.prev = _context43.next) {
3694
+ case 0:
3695
+ if (this.store.holder) {
3696
+ _context43.next = 2;
3697
+ break;
3698
+ }
3699
+ throw new Error('[VenueBooking] holder 模块未初始化');
3700
+ case 2:
3701
+ customer_id = (_params$customer_id = params === null || params === void 0 ? void 0 : params.customer_id) !== null && _params$customer_id !== void 0 ? _params$customer_id : this.resolveHolderCustomerId();
3702
+ return _context43.abrupt("return", this.store.holder.refreshAllFormRecords(_objectSpread(_objectSpread({}, params), {}, {
3703
+ customer_id: customer_id,
3704
+ useCache: (_params$useCache = params === null || params === void 0 ? void 0 : params.useCache) !== null && _params$useCache !== void 0 ? _params$useCache : false
3705
+ })));
3706
+ case 4:
3707
+ case "end":
3708
+ return _context43.stop();
3709
+ }
3710
+ }, _callee43, this);
3711
+ }));
3712
+ function refreshAllHolderFormRecords(_x21) {
3713
+ return _refreshAllHolderFormRecords.apply(this, arguments);
3714
+ }
3715
+ return refreshAllHolderFormRecords;
3716
+ }()
3717
+ /**
3718
+ * 添加表单记录
3719
+ */
3720
+ )
3721
+ }, {
3722
+ key: "appendFormRecord",
3723
+ value: function appendFormRecord(params) {
3724
+ if (!this.store.holder) throw new Error('[VenueBooking] holder 模块未初始化');
3725
+ return this.store.holder.appendFormRecord(params);
3726
+ }
3400
3727
 
3401
3728
  // ─── OpenData 可用性 ───
3402
3729
  }, {
3403
3730
  key: "checkOpenDataAvailability",
3404
3731
  value: function () {
3405
- var _checkOpenDataAvailability = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee42() {
3406
- return _regeneratorRuntime().wrap(function _callee42$(_context42) {
3407
- while (1) switch (_context42.prev = _context42.next) {
3732
+ var _checkOpenDataAvailability = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee44() {
3733
+ return _regeneratorRuntime().wrap(function _callee44$(_context44) {
3734
+ while (1) switch (_context44.prev = _context44.next) {
3408
3735
  case 0:
3409
3736
  if (this.store.openData) {
3410
- _context42.next = 2;
3737
+ _context44.next = 2;
3411
3738
  break;
3412
3739
  }
3413
3740
  throw new Error('openData 模块未初始化');
3414
3741
  case 2:
3415
- _context42.next = 4;
3742
+ _context44.next = 4;
3416
3743
  return this.loadOpenDataConfig();
3417
3744
  case 4:
3418
- return _context42.abrupt("return", this.store.openData.checkAvailability(this.store.schedule));
3745
+ return _context44.abrupt("return", this.store.openData.checkAvailability(this.store.schedule));
3419
3746
  case 5:
3420
3747
  case "end":
3421
- return _context42.stop();
3748
+ return _context44.stop();
3422
3749
  }
3423
- }, _callee42, this);
3750
+ }, _callee44, this);
3424
3751
  }));
3425
3752
  function checkOpenDataAvailability() {
3426
3753
  return _checkOpenDataAvailability.apply(this, arguments);
@@ -3430,15 +3757,15 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
3430
3757
  }, {
3431
3758
  key: "setOtherParams",
3432
3759
  value: function () {
3433
- var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee43(params) {
3434
- var _ref5,
3435
- _ref5$cover,
3760
+ var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee45(params) {
3761
+ var _ref7,
3762
+ _ref7$cover,
3436
3763
  cover,
3437
- _args43 = arguments;
3438
- return _regeneratorRuntime().wrap(function _callee43$(_context43) {
3439
- while (1) switch (_context43.prev = _context43.next) {
3764
+ _args45 = arguments;
3765
+ return _regeneratorRuntime().wrap(function _callee45$(_context45) {
3766
+ while (1) switch (_context45.prev = _context45.next) {
3440
3767
  case 0:
3441
- _ref5 = _args43.length > 1 && _args43[1] !== undefined ? _args43[1] : {}, _ref5$cover = _ref5.cover, cover = _ref5$cover === void 0 ? false : _ref5$cover;
3768
+ _ref7 = _args45.length > 1 && _args45[1] !== undefined ? _args45[1] : {}, _ref7$cover = _ref7.cover, cover = _ref7$cover === void 0 ? false : _ref7$cover;
3442
3769
  if (cover) {
3443
3770
  this.otherParams = params;
3444
3771
  } else {
@@ -3446,17 +3773,17 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
3446
3773
  }
3447
3774
  case 2:
3448
3775
  case "end":
3449
- return _context43.stop();
3776
+ return _context45.stop();
3450
3777
  }
3451
- }, _callee43, this);
3778
+ }, _callee45, this);
3452
3779
  }));
3453
- function setOtherParams(_x20) {
3780
+ function setOtherParams(_x22) {
3454
3781
  return _setOtherParams.apply(this, arguments);
3455
3782
  }
3456
3783
  return setOtherParams;
3457
3784
  }()
3458
3785
  }]);
3459
3786
  return VenueBookingImpl;
3460
- }(BaseModule);
3787
+ }(BaseSalesImpl);
3461
3788
  _defineProperty(VenueBookingImpl, "OPEN_DATA_CACHE_TTL", 5 * 60 * 1000);
3462
3789
  _defineProperty(VenueBookingImpl, "UI_STATE_KEY_PREFIX", 'pisell.venueBooking.uiState:');