@jingx/lottery-components-react-jsx 1.0.28 → 1.0.30

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.
package/dist/index.esm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import React__default, { forwardRef, Component, useRef, useState, useEffect, useLayoutEffect, useMemo, memo, useCallback, useContext, createContext as createContext$1, Fragment } from 'react';
2
+ import React__default, { forwardRef, Component, useRef, useState, useEffect, useLayoutEffect, useMemo, memo, useCallback, useContext, createContext as createContext$1, Fragment, isValidElement } from 'react';
3
3
  import ReactDOM, { createPortal } from 'react-dom';
4
4
 
5
5
  function styleInject(css, ref) {
@@ -32097,8 +32097,8 @@ function transformPostCode(posts, postCodeMap) {
32097
32097
  }
32098
32098
 
32099
32099
  var __defProp$a = Object.defineProperty;
32100
- var __defProps$2 = Object.defineProperties;
32101
- var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
32100
+ var __defProps$3 = Object.defineProperties;
32101
+ var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
32102
32102
  var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
32103
32103
  var __hasOwnProp$b = Object.prototype.hasOwnProperty;
32104
32104
  var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
@@ -32114,7 +32114,7 @@ var __spreadValues$a = (a, b) => {
32114
32114
  }
32115
32115
  return a;
32116
32116
  };
32117
- var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
32117
+ var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
32118
32118
  const KPPostCode = {
32119
32119
  A: "\u179B\u17E1",
32120
32120
  F: "\u179B\u17E2",
@@ -32173,7 +32173,7 @@ const lotteryLabel = {
32173
32173
  HOSO: "\u1786\u17D2\u1793\u17C4\u178F HOSO",
32174
32174
  KP: "\u1780\u17C6\u1796\u178F KP"
32175
32175
  };
32176
- const lotteryLabelVN = __spreadProps$2(__spreadValues$a({}, lotteryLabel), {
32176
+ const lotteryLabelVN = __spreadProps$3(__spreadValues$a({}, lotteryLabel), {
32177
32177
  VN1: "\u1786\u17D2\u1793\u17C4\u178F\u1799\u17BD\u1793",
32178
32178
  TN: "\u1786\u17D2\u1793\u17C4\u178F\u1799\u17BD\u1793",
32179
32179
  KH: "\u1786\u17D2\u1793\u17C4\u178F\u1781\u17D2\u1798\u17C2\u179A"
@@ -32641,7 +32641,6 @@ const TicketPrintBody = (props) => {
32641
32641
  ] }, `select-${itemId}-${i}`);
32642
32642
  };
32643
32643
  const wrapWithCheckboxProtest = (node, obj, i) => {
32644
- console.log(obj, "OOOOOOOO");
32645
32644
  if (node == null) return null;
32646
32645
  if (!showItemCheckbox) return node;
32647
32646
  const itemId = getItemId(obj, i);
@@ -38714,7 +38713,6 @@ const ProtestTicket = ({
38714
38713
  const selectableIdSet = useMemo(() => new Set(selectableItemIds), [selectableItemIds]);
38715
38714
  const allChecked = selectableItemIds.length > 0 && selectableItemIds.every((id) => selectedIds.includes(id));
38716
38715
  const isIndeterminate = selectedIds.length > 0 && !allChecked;
38717
- console.log(selectableIdSet, "selectableIdSet");
38718
38716
  useEffect(() => {
38719
38717
  setSelectedIds((prev) => prev.filter((id) => selectableIdSet.has(id)));
38720
38718
  }, [selectableIdSet]);
@@ -38743,7 +38741,7 @@ const ProtestTicket = ({
38743
38741
  });
38744
38742
  };
38745
38743
  return /* @__PURE__ */ jsxRuntimeExports.jsx(ScopeHost, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("table", { id: "transfer-ticket-58", className: "print-tb-58-1", cellPadding: "7px", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("tbody", { children: [
38746
- /* @__PURE__ */ jsxRuntimeExports.jsx("tr", { style: { lineHeight: "35px" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
38744
+ /* @__PURE__ */ jsxRuntimeExports.jsx("tr", { style: { lineHeight: "35px" }, className: "no-hover", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
38747
38745
  RenderTitle,
38748
38746
  {
38749
38747
  className: "text-center ticket-logo pt-2 mt-1 p-0",
@@ -38753,8 +38751,8 @@ const ProtestTicket = ({
38753
38751
  logo
38754
38752
  }
38755
38753
  ) }),
38756
- /* @__PURE__ */ jsxRuntimeExports.jsx("tr", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", { className: "p-0 pt-2", colSpan: 3, children: /* @__PURE__ */ jsxRuntimeExports.jsx("hr", { className: "border-top-ticket" }) }) }),
38757
- /* @__PURE__ */ jsxRuntimeExports.jsx("tr", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", { className: "p-0 pt-2 text-black font-weight-bold", colSpan: 3, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center", children: [
38754
+ /* @__PURE__ */ jsxRuntimeExports.jsx("tr", { className: "no-hover", children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", { className: "p-0 pt-2", colSpan: 3, children: /* @__PURE__ */ jsxRuntimeExports.jsx("hr", { className: "border-top-ticket" }) }) }),
38755
+ /* @__PURE__ */ jsxRuntimeExports.jsx("tr", { className: "no-hover", children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", { className: "p-0 pt-2 text-black font-weight-bold", colSpan: 3, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center", children: [
38758
38756
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "f-16", children: [
38759
38757
  object == null ? void 0 : object.username,
38760
38758
  " / #",
@@ -38762,8 +38760,8 @@ const ProtestTicket = ({
38762
38760
  ] }),
38763
38761
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "f-16", children: getDateTime(object == null ? void 0 : object.drawAt) })
38764
38762
  ] }) }) }),
38765
- /* @__PURE__ */ jsxRuntimeExports.jsx("tr", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", { className: "p-0 pb-2", colSpan: 3, children: /* @__PURE__ */ jsxRuntimeExports.jsx("hr", { className: "border-top-ticket" }) }) }),
38766
- /* @__PURE__ */ jsxRuntimeExports.jsx("tr", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", { colSpan: 3, className: "p-0 text-left", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "m-0 d-inline-flex align-items-center text-black", children: [
38763
+ /* @__PURE__ */ jsxRuntimeExports.jsx("tr", { className: "no-hover", children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", { className: "p-0 pb-2", colSpan: 3, children: /* @__PURE__ */ jsxRuntimeExports.jsx("hr", { className: "border-top-ticket" }) }) }),
38764
+ /* @__PURE__ */ jsxRuntimeExports.jsx("tr", { className: "no-hover", children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", { colSpan: 3, className: "p-0 text-left", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "m-0 d-inline-flex align-items-center text-black", children: [
38767
38765
  /* @__PURE__ */ jsxRuntimeExports.jsx(
38768
38766
  "input",
38769
38767
  {
@@ -38777,7 +38775,7 @@ const ProtestTicket = ({
38777
38775
  ),
38778
38776
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ml-2 f-16", children: "Check all" })
38779
38777
  ] }) }) }),
38780
- /* @__PURE__ */ jsxRuntimeExports.jsx("tr", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", { colSpan: 3, className: "p-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
38778
+ /* @__PURE__ */ jsxRuntimeExports.jsx("tr", { className: "no-hover", children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", { colSpan: 3, className: "p-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
38781
38779
  PrintTicket58,
38782
38780
  {
38783
38781
  isNight,
@@ -38790,7 +38788,7 @@ const ProtestTicket = ({
38790
38788
  isProtest
38791
38789
  }
38792
38790
  ) }) }),
38793
- /* @__PURE__ */ jsxRuntimeExports.jsx("tr", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", { colSpan: 3, children: /* @__PURE__ */ jsxRuntimeExports.jsx("hr", { className: "border-top-ticket" }) }) })
38791
+ /* @__PURE__ */ jsxRuntimeExports.jsx("tr", { className: "no-hover", children: /* @__PURE__ */ jsxRuntimeExports.jsx("td", { colSpan: 3, children: /* @__PURE__ */ jsxRuntimeExports.jsx("hr", { className: "border-top-ticket" }) }) })
38794
38792
  ] }) }) });
38795
38793
  };
38796
38794
 
@@ -38857,8 +38855,8 @@ const BasePrinter = (_a) => {
38857
38855
  };
38858
38856
 
38859
38857
  var __defProp$8 = Object.defineProperty;
38860
- var __defProps$1 = Object.defineProperties;
38861
- var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
38858
+ var __defProps$2 = Object.defineProperties;
38859
+ var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
38862
38860
  var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
38863
38861
  var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
38864
38862
  var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
@@ -38874,7 +38872,7 @@ var __spreadValues$8 = (a, b) => {
38874
38872
  }
38875
38873
  return a;
38876
38874
  };
38877
- var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
38875
+ var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
38878
38876
  var __objRest$4 = (source, exclude) => {
38879
38877
  var target = {};
38880
38878
  for (var prop in source)
@@ -38891,7 +38889,7 @@ const Printer = (_a) => {
38891
38889
  var _b = _a, { children } = _b, props = __objRest$4(_b, ["children"]);
38892
38890
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
38893
38891
  BasePrinter,
38894
- __spreadProps$1(__spreadValues$8({
38892
+ __spreadProps$2(__spreadValues$8({
38895
38893
  component: /* @__PURE__ */ jsxRuntimeExports.jsx(Ticket, __spreadValues$8({}, props))
38896
38894
  }, props), {
38897
38895
  children: children != null ? children : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "btn btn-primary", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
@@ -47153,8 +47151,8 @@ const PostTable = memo(({ data = [], fallbackTwo = "", fallbackThree = "", usePo
47153
47151
  });
47154
47152
 
47155
47153
  var __defProp$5 = Object.defineProperty;
47156
- var __defProps = Object.defineProperties;
47157
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
47154
+ var __defProps$1 = Object.defineProperties;
47155
+ var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
47158
47156
  var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
47159
47157
  var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
47160
47158
  var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
@@ -47170,8 +47168,8 @@ var __spreadValues$5 = (a, b) => {
47170
47168
  }
47171
47169
  return a;
47172
47170
  };
47173
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
47174
- const loCellStyle = __spreadProps(__spreadValues$5({}, baseCellStyle), {
47171
+ var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
47172
+ const loCellStyle = __spreadProps$1(__spreadValues$5({}, baseCellStyle), {
47175
47173
  width: "200px"
47176
47174
  });
47177
47175
  const LoTable = memo(({ LO = [], columnsCount = 3, showHeader = false }) => {
@@ -47183,7 +47181,7 @@ const LoTable = memo(({ LO = [], columnsCount = 3, showHeader = false }) => {
47183
47181
  "th",
47184
47182
  {
47185
47183
  className: "text-black text-center bg-light-red",
47186
- style: __spreadProps(__spreadValues$5({}, loCellStyle), { fontSize: "16px" }),
47184
+ style: __spreadProps$1(__spreadValues$5({}, loCellStyle), { fontSize: "16px" }),
47187
47185
  children: KPLO[col.columnNumber]
47188
47186
  },
47189
47187
  idx
@@ -59003,6 +59001,13 @@ var axios_1 = axios;
59003
59001
 
59004
59002
  var axios$1 = /*@__PURE__*/getDefaultExportFromCjs(axios_1);
59005
59003
 
59004
+ const ProtestApi = "api/v1.0.0/order/protest";
59005
+ const RemoveReasonApi = "api/v1.0.0/order/remove-reason";
59006
+ const DeleteApi = "api/v1.0.0/order/remove";
59007
+ const RemarkApi = "api/v1.0.0/order/remark";
59008
+ const PaidApi = "api/v1.0.0/order/paid";
59009
+ const PayoutApi = "api/v1.0.0/order/payout";
59010
+
59006
59011
  var __defProp$4 = Object.defineProperty;
59007
59012
  var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
59008
59013
  var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
@@ -59031,10 +59036,10 @@ var __objRest$2 = (source, exclude) => {
59031
59036
  }
59032
59037
  return target;
59033
59038
  };
59034
- const DEFAULT_API_BASE_URL$3 = "https://api-web.dev.lottery.aazz168.com";
59039
+ const DEFAULT_API_BASE_URL$3 = "https://api-web.dev.lottery.aazz168.com/";
59035
59040
  function DeleteModal(_a) {
59036
59041
  var _b = _a, {
59037
- object,
59042
+ ticket,
59038
59043
  isOpen = false,
59039
59044
  onClose,
59040
59045
  onChange,
@@ -59045,7 +59050,7 @@ function DeleteModal(_a) {
59045
59050
  accessToken,
59046
59051
  isRemoveReason
59047
59052
  } = _b; __objRest$2(_b, [
59048
- "object",
59053
+ "ticket",
59049
59054
  "isOpen",
59050
59055
  "onClose",
59051
59056
  "onChange",
@@ -59067,14 +59072,14 @@ function DeleteModal(_a) {
59067
59072
  "X-DeviceType": "WEB"
59068
59073
  }, token ? { Authorization: `Bearer ${token}` } : {});
59069
59074
  useEffect(() => {
59070
- if (!object) return void 0;
59075
+ if (!ticket) return void 0;
59071
59076
  setSelectedReason(null);
59072
59077
  const fetchReasons = async () => {
59073
59078
  var _a2, _b2, _c;
59074
59079
  try {
59075
59080
  setIsLoading(true);
59076
59081
  const res = await axios$1.get(
59077
- `${Env.REACT_APP_API_BASE_URL || DEFAULT_API_BASE_URL$3}/api/v1.0.0/order/remove-reason`,
59082
+ `${Env.REACT_APP_API_BASE_URL || DEFAULT_API_BASE_URL$3}${RemoveReasonApi}`,
59078
59083
  {
59079
59084
  headers
59080
59085
  }
@@ -59096,7 +59101,7 @@ function DeleteModal(_a) {
59096
59101
  }
59097
59102
  };
59098
59103
  fetchReasons();
59099
- }, [Env.REACT_APP_API_BASE_URL, Env.REACT_APP_BASIC_TOKEN, object]);
59104
+ }, [Env.REACT_APP_API_BASE_URL, Env.REACT_APP_BASIC_TOKEN, ticket]);
59100
59105
  const handleReasonChange = (option) => {
59101
59106
  setSelectedReason(option);
59102
59107
  if (typeof onChange === "function") {
@@ -59104,7 +59109,7 @@ function DeleteModal(_a) {
59104
59109
  }
59105
59110
  };
59106
59111
  const handleConfirm = async () => {
59107
- var _a2, _b2, _c;
59112
+ var _a2, _b2, _c, _d;
59108
59113
  if (isRemoveReason && !selectedReason) {
59109
59114
  PNotify_1.alert({
59110
59115
  text: "\u179F\u17BC\u1798\u1787\u17D2\u179A\u17BE\u179F\u179A\u17BE\u179F\u1798\u17BC\u179B\u17A0\u17C1\u178F\u17BB\u179B\u17BB\u1794",
@@ -59115,12 +59120,12 @@ function DeleteModal(_a) {
59115
59120
  try {
59116
59121
  setIsSubmitting(true);
59117
59122
  const payload = {
59118
- lotteryType: object == null ? void 0 : object.lotteryType,
59119
- ticketNumber: object == null ? void 0 : object.ticketNumber,
59123
+ lotteryType: ticket == null ? void 0 : ticket.lotteryType,
59124
+ ticketNumber: ticket == null ? void 0 : ticket.ticketNumber,
59120
59125
  message: (_a2 = selectedReason == null ? void 0 : selectedReason.value) != null ? _a2 : ""
59121
59126
  };
59122
59127
  const res = await axios$1.delete(
59123
- `${Env.REACT_APP_API_BASE_URL || DEFAULT_API_BASE_URL$3}/api/v1.0.0/order/remove`,
59128
+ `${Env.REACT_APP_API_BASE_URL || DEFAULT_API_BASE_URL$3}${DeleteApi}`,
59124
59129
  {
59125
59130
  headers,
59126
59131
  data: payload
@@ -59129,9 +59134,13 @@ function DeleteModal(_a) {
59129
59134
  if (typeof onSuccess === "function") {
59130
59135
  onSuccess(res.data, payload);
59131
59136
  }
59137
+ PNotify_1.alert({
59138
+ text: ((_b2 = res.data) == null ? void 0 : _b2.message) || "\u179F\u17C6\u1794\u17BB\u178F\u17D2\u179A\u179B\u17BB\u1794\u1787\u17C4\u1782\u1787\u17D0\u1799 !",
59139
+ type: "success"
59140
+ });
59132
59141
  onClose == null ? void 0 : onClose();
59133
59142
  } catch (err) {
59134
- const message = ((_c = (_b2 = err.response) == null ? void 0 : _b2.data) == null ? void 0 : _c.message) || err.message || "\u179F\u17C6\u1794\u17BB\u178F\u17D2\u179A\u179B\u17BB\u1794\u1794\u179A\u17B6\u1787\u17D0\u1799 !";
59143
+ const message = ((_d = (_c = err.response) == null ? void 0 : _c.data) == null ? void 0 : _d.message) || err.message || "\u179F\u17C6\u1794\u17BB\u178F\u17D2\u179A\u179B\u17BB\u1794\u1794\u179A\u17B6\u1787\u17D0\u1799 !";
59135
59144
  PNotify_1.alert({
59136
59145
  text: message,
59137
59146
  type: "error"
@@ -59143,58 +59152,71 @@ function DeleteModal(_a) {
59143
59152
  setIsSubmitting(false);
59144
59153
  }
59145
59154
  };
59146
- if (!object) return null;
59147
- return /* @__PURE__ */ jsxRuntimeExports.jsx(ScopeHost, { children: (container) => container && /* @__PURE__ */ jsxRuntimeExports.jsx(
59148
- Modal,
59149
- {
59150
- isOpen,
59151
- toggle: onClose,
59152
- container,
59153
- backdropClassName: "modal-backdrop",
59154
- modalClassName: "modal scroll-modal",
59155
- contentClassName: "",
59156
- style: { width: 380 },
59157
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(ModalBody, { className: "d-inline-flex justify-content-center p-0 font-Hanuman", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-75", children: [
59158
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
59159
- FeatherIcon,
59160
- {
59161
- icon: "alert-circle",
59162
- className: "text-warning px-1",
59163
- style: { width: 110, height: 110, marginTop: 20, marginBottom: 0 }
59164
- }
59165
- ) }),
59166
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "f-25 text-center mb-2", style: { color: "#000000a6" }, children: "\u178F\u17BE\u17A2\u17D2\u1793\u1780\u1794\u17D2\u179A\u17B6\u1780\u178A\u17AC\u17A2\u178F\u17CB?" }),
59167
- isRemoveReason && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
59168
- StateManagedSelect$1,
59169
- {
59170
- options,
59171
- value: selectedReason,
59172
- isLoading,
59173
- isDisabled: isLoading || isSubmitting || externalSubmitting,
59174
- onChange: handleReasonChange,
59175
- placeholder: "\u1798\u17BC\u179B\u17A0\u17C1\u178F\u17BB \u179B\u17BB\u1794..."
59176
- }
59177
- ) }),
59178
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "my-3 d-flex justify-content-center", children: [
59179
- /* @__PURE__ */ jsxRuntimeExports.jsx("button", { type: "button", className: "btn-cancel", onClick: onClose, children: "\u1791\u17C1" }),
59180
- /* @__PURE__ */ jsxRuntimeExports.jsx(
59181
- "button",
59155
+ if (!ticket) return null;
59156
+ console.log(ticket, "ticket");
59157
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(ScopeHost, { children: (container) => {
59158
+ var _a2, _b2;
59159
+ return container && /* @__PURE__ */ jsxRuntimeExports.jsx(
59160
+ Modal,
59161
+ {
59162
+ isOpen,
59163
+ toggle: onClose,
59164
+ container,
59165
+ backdropClassName: "modal-backdrop",
59166
+ modalClassName: "modal scroll-modal",
59167
+ contentClassName: "",
59168
+ style: { width: 380 },
59169
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(ModalBody, { className: "d-inline-flex justify-content-center p-0 font-Hanuman", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-75", children: [
59170
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
59171
+ FeatherIcon,
59182
59172
  {
59183
- type: "button",
59184
- className: "btn-confirm ml-3",
59185
- onClick: handleConfirm,
59186
- disabled: isLoading || isSubmitting || externalSubmitting,
59187
- children: "\u1794\u17B6\u1791/\u1785\u17B6\u179F\u17CE"
59173
+ icon: "alert-circle",
59174
+ className: "text-warning px-1",
59175
+ style: { width: 110, height: 110, marginTop: 20, marginBottom: 0 }
59188
59176
  }
59189
- )
59190
- ] })
59191
- ] }) })
59192
- }
59193
- ) });
59177
+ ) }),
59178
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "f-25 text-center mb-0", style: { color: "#000000a6" }, children: "\u178F\u17BE\u17A2\u17D2\u1793\u1780\u1794\u17D2\u179A\u17B6\u1780\u178A\u17AC\u17A2\u178F\u17CB?" }),
59179
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "f-14 text-center mb-2 text-danger", children: [
59180
+ "\u179B\u17BB\u1794\u179F\u17C6\u1794\u17BB\u178F\u17D2\u179A #",
59181
+ ticket.ticketNumber,
59182
+ " = ",
59183
+ moneyFormatter((_a2 = ticket.totalKhr) == null ? void 0 : _a2.betAmount, "KHR"),
59184
+ "/",
59185
+ moneyFormatter((_b2 = ticket.totalUsd) == null ? void 0 : _b2.betAmount, "USD")
59186
+ ] }),
59187
+ isRemoveReason && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
59188
+ StateManagedSelect$1,
59189
+ {
59190
+ options,
59191
+ value: selectedReason,
59192
+ isLoading,
59193
+ isDisabled: isLoading || isSubmitting || externalSubmitting,
59194
+ onChange: handleReasonChange,
59195
+ placeholder: "\u1798\u17BC\u179B\u17A0\u17C1\u178F\u17BB \u179B\u17BB\u1794..."
59196
+ }
59197
+ ) }),
59198
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "my-3 d-flex justify-content-center", children: [
59199
+ /* @__PURE__ */ jsxRuntimeExports.jsx("button", { type: "button", className: "btn-cancel", onClick: onClose, children: "\u1791\u17C1" }),
59200
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
59201
+ "button",
59202
+ {
59203
+ type: "button",
59204
+ className: "btn-confirm ml-3",
59205
+ onClick: handleConfirm,
59206
+ disabled: isLoading || isSubmitting || externalSubmitting,
59207
+ children: "\u1794\u17B6\u1791/\u1785\u17B6\u179F\u17CE"
59208
+ }
59209
+ )
59210
+ ] })
59211
+ ] }) })
59212
+ }
59213
+ );
59214
+ } });
59194
59215
  }
59195
59216
  DeleteModal.propTypes = {
59196
- object: PropTypes$2.object,
59217
+ ticket: PropTypes$2.object,
59197
59218
  isOpen: PropTypes$2.bool,
59219
+ isRemoveReason: PropTypes$2.bool.isRequired,
59198
59220
  onClose: PropTypes$2.func.isRequired,
59199
59221
  Env: PropTypes$2.object.isRequired,
59200
59222
  accessToken: PropTypes$2.string.isRequired
@@ -59221,7 +59243,7 @@ function DeleteTicketButton(props) {
59221
59243
  id,
59222
59244
  onOpen,
59223
59245
  Env,
59224
- object,
59246
+ ticket,
59225
59247
  onClose,
59226
59248
  accessToken,
59227
59249
  onChange,
@@ -59269,7 +59291,7 @@ function DeleteTicketButton(props) {
59269
59291
  DeleteModal,
59270
59292
  {
59271
59293
  Env,
59272
- object,
59294
+ ticket,
59273
59295
  isOpen,
59274
59296
  onClose: handleClose,
59275
59297
  accessToken,
@@ -59285,7 +59307,7 @@ DeleteTicketButton.propTypes = {
59285
59307
  id: PropTypes$2.string.isRequired,
59286
59308
  onOpen: PropTypes$2.func.isRequired,
59287
59309
  Env: PropTypes$2.object.isRequired,
59288
- object: PropTypes$2.object,
59310
+ ticket: PropTypes$2.object,
59289
59311
  onClose: PropTypes$2.func.isRequired,
59290
59312
  isOpen: PropTypes$2.bool,
59291
59313
  isRemoveReason: PropTypes$2.bool.isRequired,
@@ -59310,7 +59332,7 @@ var __spreadValues$2 = (a, b) => {
59310
59332
  }
59311
59333
  return a;
59312
59334
  };
59313
- const DEFAULT_API_BASE_URL$2 = "https://api-web.dev.lottery.aazz168.com";
59335
+ const DEFAULT_API_BASE_URL$2 = "https://api-web.dev.lottery.aazz168.com/";
59314
59336
  const ProtestModal = ({
59315
59337
  isOpen,
59316
59338
  onClose,
@@ -59346,7 +59368,7 @@ const ProtestModal = ({
59346
59368
  try {
59347
59369
  setIsLoading(true);
59348
59370
  const res = await axios$1.get(
59349
- `${Env.REACT_APP_API_BASE_URL || DEFAULT_API_BASE_URL$2}/api/v1.0.0/order/remove-reason`,
59371
+ `${Env.REACT_APP_API_BASE_URL || DEFAULT_API_BASE_URL$2}${RemoveReasonApi}`,
59350
59372
  {
59351
59373
  params: { type: "protest" },
59352
59374
  headers
@@ -59406,7 +59428,7 @@ const ProtestModal = ({
59406
59428
  message: selectedReason.value
59407
59429
  };
59408
59430
  const res = await axios$1.post(
59409
- `${Env.REACT_APP_API_BASE_URL || DEFAULT_API_BASE_URL$2}/api/v1.0.0/order/protest`,
59431
+ `${Env.REACT_APP_API_BASE_URL || DEFAULT_API_BASE_URL$2}${ProtestApi}`,
59410
59432
  payload,
59411
59433
  { headers }
59412
59434
  );
@@ -59586,10 +59608,11 @@ var __objRest$1 = (source, exclude) => {
59586
59608
  }
59587
59609
  return target;
59588
59610
  };
59589
- const DEFAULT_API_BASE_URL$1 = "https://api-web.dev.lottery.aazz168.com";
59611
+ const DEFAULT_API_BASE_URL$1 = "https://api-web.dev.lottery.aazz168.com/";
59590
59612
  function RemarkModal(_a) {
59591
59613
  var _b = _a, {
59592
59614
  object,
59615
+ ticket,
59593
59616
  onClose,
59594
59617
  onChange,
59595
59618
  onSuccess,
@@ -59599,6 +59622,7 @@ function RemarkModal(_a) {
59599
59622
  accessToken
59600
59623
  } = _b; __objRest$1(_b, [
59601
59624
  "object",
59625
+ "ticket",
59602
59626
  "onClose",
59603
59627
  "onChange",
59604
59628
  "onSuccess",
@@ -59610,6 +59634,10 @@ function RemarkModal(_a) {
59610
59634
  const [remark, setRemark] = useState("");
59611
59635
  const [loadError, setLoadError] = useState("");
59612
59636
  const [isSubmitting, setIsSubmitting] = useState(false);
59637
+ useEffect(() => {
59638
+ var _a2;
59639
+ setRemark((_a2 = ticket == null ? void 0 : ticket.remark) != null ? _a2 : "");
59640
+ }, [ticket]);
59613
59641
  const token = accessToken || localStorage.getItem("accessToken") || sessionStorage.getItem("accessToken");
59614
59642
  const headers = __spreadValues$1({
59615
59643
  "Content-Type": "application/json",
@@ -59628,7 +59656,7 @@ function RemarkModal(_a) {
59628
59656
  }
59629
59657
  };
59630
59658
  const handleConfirm = async () => {
59631
- var _a2, _b2;
59659
+ var _a2, _b2, _c;
59632
59660
  if (!remark) return setLoadError("\u179F\u17BC\u1798\u1794\u1789\u17D2\u1785\u17BC\u179B\u1780\u17C6\u178E\u178F\u17CB\u179F\u1798\u17D2\u1782\u17B6\u179B\u17CB!");
59633
59661
  try {
59634
59662
  setIsSubmitting(true);
@@ -59638,7 +59666,7 @@ function RemarkModal(_a) {
59638
59666
  message: remark
59639
59667
  };
59640
59668
  const res = await axios$1.delete(
59641
- `${Env.REACT_APP_API_BASE_URL || DEFAULT_API_BASE_URL$1}/api/v1.0.0/order/remark`,
59669
+ `${Env.REACT_APP_API_BASE_URL || DEFAULT_API_BASE_URL$1}${RemarkApi}`,
59642
59670
  {
59643
59671
  headers,
59644
59672
  data: payload
@@ -59647,9 +59675,13 @@ function RemarkModal(_a) {
59647
59675
  if (typeof onSuccess === "function") {
59648
59676
  onSuccess(res.data, payload);
59649
59677
  }
59678
+ PNotify_1.alert({
59679
+ text: ((_a2 = res.data) == null ? void 0 : _a2.message) || "\u179F\u1798\u17D2\u1782\u17B6\u179B\u17CB\u179F\u17C6\u1794\u17BB\u178F\u17D2\u179A\u1787\u17C4\u1782\u1787\u17D0\u1799 !",
59680
+ type: "success"
59681
+ });
59650
59682
  onClose == null ? void 0 : onClose();
59651
59683
  } catch (err) {
59652
- const message = ((_b2 = (_a2 = err.response) == null ? void 0 : _a2.data) == null ? void 0 : _b2.message) || err.message || "\u1780\u17C6\u178E\u178F\u17CB\u179F\u1798\u17D2\u1782\u17B6\u179B\u17CB\u1794\u179A\u17B6\u1787\u17D0\u1799 !";
59684
+ const message = ((_c = (_b2 = err.response) == null ? void 0 : _b2.data) == null ? void 0 : _c.message) || err.message || "\u1780\u17C6\u178E\u178F\u17CB\u179F\u1798\u17D2\u1782\u17B6\u179B\u17CB\u1794\u179A\u17B6\u1787\u17D0\u1799 !";
59653
59685
  setLoadError(message);
59654
59686
  if (typeof onError === "function") {
59655
59687
  onError(err);
@@ -59711,12 +59743,15 @@ function RemarkModal(_a) {
59711
59743
  }
59712
59744
  RemarkModal.propTypes = {
59713
59745
  object: PropTypes$2.object,
59746
+ ticket: PropTypes$2.object,
59714
59747
  onClose: PropTypes$2.func.isRequired,
59715
59748
  Env: PropTypes$2.object.isRequired,
59716
59749
  accessToken: PropTypes$2.string.isRequired
59717
59750
  };
59718
59751
 
59719
59752
  var __defProp = Object.defineProperty;
59753
+ var __defProps = Object.defineProperties;
59754
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
59720
59755
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
59721
59756
  var __hasOwnProp = Object.prototype.hasOwnProperty;
59722
59757
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
@@ -59732,6 +59767,7 @@ var __spreadValues = (a, b) => {
59732
59767
  }
59733
59768
  return a;
59734
59769
  };
59770
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
59735
59771
  var __objRest = (source, exclude) => {
59736
59772
  var target = {};
59737
59773
  for (var prop in source)
@@ -59744,7 +59780,7 @@ var __objRest = (source, exclude) => {
59744
59780
  }
59745
59781
  return target;
59746
59782
  };
59747
- const DEFAULT_API_BASE_URL = "https://api-web.dev.lottery.aazz168.com";
59783
+ const DEFAULT_API_BASE_URL = "https://api-web.dev.lottery.aazz168.com/";
59748
59784
  function MoreMenu(_a) {
59749
59785
  var _b = _a, {
59750
59786
  id = "more-menu",
@@ -59761,8 +59797,9 @@ function MoreMenu(_a) {
59761
59797
  isSubmitting: externalSubmitting = false,
59762
59798
  accessToken,
59763
59799
  openCallback,
59764
- closeCallback
59765
- } = _b; __objRest(_b, [
59800
+ closeCallback,
59801
+ DropdownButton
59802
+ } = _b, props = __objRest(_b, [
59766
59803
  "id",
59767
59804
  "object",
59768
59805
  "ticket",
@@ -59777,13 +59814,16 @@ function MoreMenu(_a) {
59777
59814
  "isSubmitting",
59778
59815
  "accessToken",
59779
59816
  "openCallback",
59780
- "closeCallback"
59817
+ "closeCallback",
59818
+ "DropdownButton"
59781
59819
  ]);
59820
+ var _a2, _b2;
59782
59821
  const [activeModal, setActiveModal] = useState(null);
59783
59822
  const [isPaid, setIsPaid] = useState(Boolean(ticket == null ? void 0 : ticket.isPaid));
59784
59823
  const [isPayout, setIsPayout] = useState(Boolean(ticket == null ? void 0 : ticket.isPayout));
59785
59824
  const [isLoadingPaid, setLoadingPaid] = useState(false);
59786
59825
  const [isLoadingPayout, setLoadingPayout] = useState(false);
59826
+ const isShowPayout = ((_a2 = ticket == null ? void 0 : ticket.totalKhr) == null ? void 0 : _a2.winAmount) > 0 || ((_b2 = ticket == null ? void 0 : ticket.totalUsd) == null ? void 0 : _b2.winAmount) > 0;
59787
59827
  useEffect(() => {
59788
59828
  setIsPaid(Boolean(ticket == null ? void 0 : ticket.isPaid));
59789
59829
  setIsPayout(Boolean(ticket == null ? void 0 : ticket.isPayout));
@@ -59809,7 +59849,7 @@ function MoreMenu(_a) {
59809
59849
  };
59810
59850
  const createToggleHandler = ({ setValue, setLoading, successCallback, endpoint, failureMessage, successMessage }) => {
59811
59851
  return async (event) => {
59812
- var _a2, _b2, _c, _d, _e;
59852
+ var _a3, _b3, _c, _d, _e;
59813
59853
  const nextChecked = event.target.checked;
59814
59854
  const previousValue = !nextChecked;
59815
59855
  if (!ticket || !object) {
@@ -59819,8 +59859,8 @@ function MoreMenu(_a) {
59819
59859
  setLoading(true);
59820
59860
  setValue(nextChecked);
59821
59861
  const payload = {
59822
- lotteryType: (_a2 = object == null ? void 0 : object.lotteryType) != null ? _a2 : ticket == null ? void 0 : ticket.lotteryType,
59823
- ticketNumber: (_b2 = object == null ? void 0 : object.ticketNumber) != null ? _b2 : ticket == null ? void 0 : ticket.ticketNumber,
59862
+ lotteryType: (_a3 = object == null ? void 0 : object.lotteryType) != null ? _a3 : ticket == null ? void 0 : ticket.lotteryType,
59863
+ ticketNumber: (_b3 = object == null ? void 0 : object.ticketNumber) != null ? _b3 : ticket == null ? void 0 : ticket.ticketNumber,
59824
59864
  status: nextChecked
59825
59865
  };
59826
59866
  const res = await axios$1.post(
@@ -59853,7 +59893,7 @@ function MoreMenu(_a) {
59853
59893
  setValue: setIsPaid,
59854
59894
  setLoading: setLoadingPaid,
59855
59895
  successCallback: onSuccessPaid != null ? onSuccessPaid : onSuccess,
59856
- endpoint: "/api/v1.0.0/order/paid",
59896
+ endpoint: PaidApi,
59857
59897
  failureMessage: "Failed to mark as paid.",
59858
59898
  successMessage: "Marked as paid successfully."
59859
59899
  });
@@ -59861,32 +59901,59 @@ function MoreMenu(_a) {
59861
59901
  setValue: setIsPayout,
59862
59902
  setLoading: setLoadingPayout,
59863
59903
  successCallback: onSuccessPayout != null ? onSuccessPayout : onSuccess,
59864
- endpoint: "/api/v1.0.0/order/payout",
59904
+ endpoint: PayoutApi,
59865
59905
  failureMessage: "Failed to mark as payout.",
59866
59906
  successMessage: "Marked as payout successfully."
59867
59907
  });
59908
+ const toggleProps = {
59909
+ id,
59910
+ tag: "button",
59911
+ type: "button",
59912
+ caret: false,
59913
+ className: "border-0 p-2 rounded mb-1",
59914
+ style: { background: "#6c757d8f" }
59915
+ };
59916
+ const defaultToggleContent = /* @__PURE__ */ jsxRuntimeExports.jsx(
59917
+ FeatherIcon,
59918
+ {
59919
+ icon: "more-horizontal",
59920
+ className: "f-16 text-white px-1",
59921
+ style: { outline: "none", boxShadow: "none" }
59922
+ }
59923
+ );
59924
+ const resolveDropdownButton = () => {
59925
+ if (!DropdownButton) {
59926
+ return {
59927
+ props: toggleProps,
59928
+ children: defaultToggleContent
59929
+ };
59930
+ }
59931
+ const resolvedButton = typeof DropdownButton === "function" ? DropdownButton(toggleProps) : DropdownButton;
59932
+ if (!isValidElement(resolvedButton)) {
59933
+ return {
59934
+ props: toggleProps,
59935
+ children: resolvedButton || defaultToggleContent
59936
+ };
59937
+ }
59938
+ const customProps = __spreadValues({}, resolvedButton.props);
59939
+ const customChildren = customProps.children;
59940
+ delete customProps.children;
59941
+ if (resolvedButton.type !== DropdownToggle) {
59942
+ customProps.tag = customProps.tag || resolvedButton.type;
59943
+ }
59944
+ return {
59945
+ props: __spreadValues(__spreadValues({}, toggleProps), customProps),
59946
+ children: customChildren || defaultToggleContent
59947
+ };
59948
+ };
59949
+ const renderDropdownToggle = () => {
59950
+ const resolvedToggle = resolveDropdownButton();
59951
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(DropdownToggle, __spreadProps(__spreadValues({}, resolvedToggle.props), { children: resolvedToggle.children }));
59952
+ };
59868
59953
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
59869
- /* @__PURE__ */ jsxRuntimeExports.jsx(ScopeHost, { children: (container) => container && /* @__PURE__ */ jsxRuntimeExports.jsxs(UncontrolledDropdown, { className: "drp-user font-Hanuman", children: [
59870
- /* @__PURE__ */ jsxRuntimeExports.jsx(
59871
- DropdownToggle,
59872
- {
59873
- id,
59874
- tag: "button",
59875
- type: "button",
59876
- caret: false,
59877
- className: "border-0 p-2 rounded mb-1",
59878
- style: { background: "#6c757d8f" },
59879
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(
59880
- FeatherIcon,
59881
- {
59882
- icon: "more-horizontal",
59883
- className: "f-16 text-white px-1",
59884
- style: { outline: "none", boxShadow: "none" }
59885
- }
59886
- )
59887
- }
59888
- ),
59889
- /* @__PURE__ */ jsxRuntimeExports.jsxs(DropdownMenu, { right: true, className: "profile-notification pt-0", children: [
59954
+ /* @__PURE__ */ jsxRuntimeExports.jsx(ScopeHost, { children: (container) => container && /* @__PURE__ */ jsxRuntimeExports.jsxs(UncontrolledDropdown, __spreadProps(__spreadValues({ className: "drp-user font-Hanuman" }, props), { children: [
59955
+ renderDropdownToggle(),
59956
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(DropdownMenu, { className: "profile-notification pt-0", children: [
59890
59957
  /* @__PURE__ */ jsxRuntimeExports.jsxs(DropdownItem, { header: true, className: "drop-header", children: [
59891
59958
  "#",
59892
59959
  ticket == null ? void 0 : ticket.ticketNumber
@@ -59938,7 +60005,7 @@ function MoreMenu(_a) {
59938
60005
  ] })
59939
60006
  }
59940
60007
  ),
59941
- /* @__PURE__ */ jsxRuntimeExports.jsx(DropdownItem, { tag: "div", toggle: false, className: "w-100", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "d-flex align-items-center justify-content-between w-100", children: [
60008
+ isShowPayout && /* @__PURE__ */ jsxRuntimeExports.jsx(DropdownItem, { tag: "div", toggle: false, className: "w-100", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "d-flex align-items-center justify-content-between w-100", children: [
59942
60009
  /* @__PURE__ */ jsxRuntimeExports.jsx(FeatherIcon, { icon: "check-circle", className: "mr-2 text-info", size: 16 }),
59943
60010
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "mr-3 drop-label", children: "\u1794\u17B6\u1793\u1791\u17BC\u1791\u17B6\u178F\u17CB\u179A\u1784\u17D2\u179C\u17B6\u1793\u17CB" }),
59944
60011
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ml-auto", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -59954,7 +60021,7 @@ function MoreMenu(_a) {
59954
60021
  ) })
59955
60022
  ] }) })
59956
60023
  ] })
59957
- ] }) }),
60024
+ ] })) }),
59958
60025
  ticket && activeModal === "protest" && /* @__PURE__ */ jsxRuntimeExports.jsx(
59959
60026
  ProtestModal,
59960
60027
  {
@@ -59973,6 +60040,7 @@ function MoreMenu(_a) {
59973
60040
  object && activeModal === "remark" && /* @__PURE__ */ jsxRuntimeExports.jsx(
59974
60041
  RemarkModal,
59975
60042
  {
60043
+ ticket,
59976
60044
  object,
59977
60045
  onClose: closeModal,
59978
60046
  accessToken,
@@ -59994,7 +60062,11 @@ MoreMenu.propTypes = {
59994
60062
  isSubmitting: PropTypes$2.bool,
59995
60063
  onChange: PropTypes$2.func,
59996
60064
  onSuccess: PropTypes$2.func,
59997
- onError: PropTypes$2.func
60065
+ onError: PropTypes$2.func,
60066
+ DropdownButton: PropTypes$2.oneOfType([
60067
+ PropTypes$2.func,
60068
+ PropTypes$2.node
60069
+ ])
59998
60070
  };
59999
60071
 
60000
60072
  export { DeleteModal, DeleteTicketButton, MoreMenu as DropdownMenu, KPLO, KPPostCode, Printer, ProtestButton, ProtestModal, ProtestTicket, RemarkModal, SCPostCode, SaryLottery, SaryPrintAll, THLabel, Ticket, TicketModal, TransferTicket, getS3ImgPrint, isVNType, lType, lotteryLabel, lotteryLabelOnline, lotteryLabelVN, mapBetTitle, mapLabels, mapStrPost };