import {
  G as j,
  a8 as F,
  r as m,
  B as G,
  C as A,
  W as J,
  $,
  H as b,
  N as a,
  I as o,
  J as e,
  P as n,
  ao as u,
  K as p,
  M as g,
  Q as _,
  av as z,
  ap as I,
  V as K,
} from "./common.modules-cecf9b0d.js";
import { R as Q, v as q } from "./page-saasLottery-D5-c991f6a0.js";
import { _ as O } from "./page-activity-ActivityDetail-6713f46c.js";
import "./page-home-other-6d9782ba.js";
import "./page-home-Casino-ff36f722.js";
import "./page-home-AllGames-ebd16353.js";
import "./page-activity-Bonus-c94a181e.js";
import "./page-turntable-assets-d6267459.js";
import "./native/index-9bac92b2.js";
import "./en-5d34117c.js";
const U = { class: "t" },
  X = { class: "t-b1" },
  Y = { class: "t-b1-l w" },
  Z = { class: "w" },
  ee = { class: "t-b1-l" },
  te = { class: "t-b1-l-n" },
  se = { class: "t-b1-l" },
  ae = { class: "t-b1-l-n" },
  oe = { class: "t-b1-l" },
  ne = { class: "t-b1-l-n" },
  le = { class: "t-b1-l" },
  ie = { class: "t-b1-l-n" },
  re = { class: "t-b2" },
  ce = ["IssueNumber", "Number", "Colour", "rowId"],
  ue = { class: "t-b2-i" },
  de = { class: "t-b2-Num" },
  ve = ["id"],
  _e = { key: 0, class: "flex-center t-b2-loading", style: { height: "100%" } },
  me = { key: 1, class: "t-b2-empty flex-center" },
  pe = { key: 0, class: "t-foot" },
  ge = { class: "t-foot-page" },
  fe = j({
    __name: "trend",
    setup(he) {
      const L = F("trxWinHook"),
        {
          historyIssuesTotalPage: D,
          historyIssues: H,
          gameCode: E,
          update: V,
        } = L,
        B = m([]),
        c = G(() => (B.value.length ? B.value : H.value)),
        f = m([]),
        l = m(1),
        W = m(10),
        y = m(!1),
        h = m(D.value);
      function P() {
        K(() => {
          for (let t = 0; t < c.value.length; t++)
            c.value[t + 1] && x(t, c.value[t], c.value[t + 1]);
        });
      }
      function x(t, d, N) {
        let C = parseInt(d.number),
          k = parseInt(N.number);
        const v = document.getElementById("myCanvas" + t);
        if (v && v.getContext) {
          var r = v.getContext("2d");
          r.clearRect(0, 0, v.width, v.height),
            r.beginPath(),
            r.moveTo(C == 0 ? 20 : C * 29 + 20, 0),
            r.lineTo(k == 0 ? 20 : k * 29 + 20, v.height),
            (r.strokeStyle = "red"),
            r.stroke(),
            r.closePath();
        }
      }
      const M = () => {
          l.value < 2 || (l.value--, T());
        },
        R = () => {
          l.value++, !(l.value > h.value) && T();
        },
        S = async () => {
          const { result: t, data: d } = await Q({
            gameCode: E.value,
            pageNo: l.value,
            pageSize: 10,
          });
          t && (f.value = d);
        },
        T = async () => {
          try {
            y.value = !0;
            const { result: t, data: d } = await q({
              gameCode: E.value,
              pageNo: l.value,
              pageSize: W.value,
            });
            t &&
              ((B.value = d.list || []),
              (l.value = d.pageNo || 1),
              (h.value = d.totalPage || 0));
          } catch {
          } finally {
            y.value = !1;
          }
        };
      return (
        A(async () => {
          c.value.length && P(), await S();
        }),
        J(() => {
          P();
        }),
        $(c, () => {
          P(), S();
        }),
        $(D, () => {
          h.value = D.value;
        }),
        $(V, () => {
          (l.value = 1), T(), S();
        }),
        (t, d) => {
          const N = b("van-col"),
            C = b("van-row"),
            k = b("van-loading"),
            v = b("Empty"),
            r = b("van-icon");
          return (
            a(),
            o("div", U, [
              e("div", X, [
                e("div", Y, [e("span", Z, n(t.$t("trendDesc1")), 1)]),
                u('      <div class="t-b1-l lottery">'),
                u("        <div>{{ $t('trendDesc2') }}</div>"),
                u('        <div class="t-b1-l-n">'),
                u(
                  '          <div v-for="item in 10" :key="item">{{ item - 1 }}</div>'
                ),
                u("        </div>"),
                u("      </div>"),
                e("div", ee, [
                  e("div", null, n(t.$t("trendDesc3")), 1),
                  e("div", te, [
                    (a(!0),
                    o(
                      p,
                      null,
                      g(
                        f.value,
                        (s, i) => (
                          a(), o("div", { key: "4" + i }, n(s.missingCount), 1)
                        )
                      ),
                      128
                    )),
                  ]),
                ]),
                e("div", se, [
                  e("div", null, n(t.$t("trendDesc4")), 1),
                  e("div", ae, [
                    (a(!0),
                    o(
                      p,
                      null,
                      g(
                        f.value,
                        (s, i) => (
                          a(), o("div", { key: "2" + i }, n(s.avgMissing), 1)
                        )
                      ),
                      128
                    )),
                  ]),
                ]),
                e("div", oe, [
                  e("div", null, n(t.$t("trendDesc5")), 1),
                  e("div", ne, [
                    (a(!0),
                    o(
                      p,
                      null,
                      g(
                        f.value,
                        (s, i) => (
                          a(), o("div", { key: "5" + i }, n(s.openCount), 1)
                        )
                      ),
                      128
                    )),
                  ]),
                ]),
                e("div", le, [
                  e("div", null, n(t.$t("trendDesc6")), 1),
                  e("div", ie, [
                    (a(!0),
                    o(
                      p,
                      null,
                      g(
                        f.value,
                        (s, i) => (
                          a(), o("div", { key: "3" + i }, n(s.maxContinuous), 1)
                        )
                      ),
                      128
                    )),
                  ]),
                ]),
              ]),
              e("div", re, [
                (a(!0),
                o(
                  p,
                  null,
                  g(
                    c.value,
                    (s, i) => (
                      a(),
                      o(
                        "div",
                        {
                          key: i,
                          IssueNumber: s.issueNumber,
                          Number: s.number,
                          Colour: s.colour,
                          rowId: i,
                          class: "t-b2-item",
                        },
                        [
                          _(
                            C,
                            null,
                            {
                              default: z(() => [
                                _(
                                  N,
                                  { span: "9" },
                                  {
                                    default: z(() => [
                                      e("div", ue, n(s.issueNumber), 1),
                                    ]),
                                    _: 2,
                                  },
                                  1024
                                ),
                                _(
                                  N,
                                  { span: "15" },
                                  {
                                    default: z(() => [
                                      e("div", de, [
                                        e(
                                          "canvas",
                                          {
                                            id: "myCanvas" + i,
                                            ref_for: !0,
                                            ref: "canvas",
                                            class: "line-canvas",
                                          },
                                          null,
                                          8,
                                          ve
                                        ),
                                        (a(),
                                        o(
                                          p,
                                          null,
                                          g(10, (w) =>
                                            e(
                                              "div",
                                              {
                                                class: I([
                                                  "t-b2-Num-item",
                                                  Number(s.number) == w - 1
                                                    ? "action" + (w - 1)
                                                    : "",
                                                ]),
                                                key: w,
                                              },
                                              n(w - 1),
                                              3
                                            )
                                          ),
                                          64
                                        )),
                                        e(
                                          "div",
                                          {
                                            class: I([
                                              "t-b2-Num-BS",
                                              { isB: Number(s.number) > 4 },
                                            ]),
                                          },
                                          n(Number(s.number) > 4 ? "B" : "S"),
                                          3
                                        ),
                                      ]),
                                    ]),
                                    _: 2,
                                  },
                                  1024
                                ),
                              ]),
                              _: 2,
                            },
                            1024
                          ),
                        ],
                        8,
                        ce
                      )
                    )
                  ),
                  128
                )),
                y.value
                  ? (a(),
                    o("div", _e, [_(k, { type: "spinner", color: "#FD565C" })]))
                  : u("v-if", !0),
                c.value.length === 0 && !y.value
                  ? (a(), o("div", me, [_(v)]))
                  : u("v-if", !0),
              ]),
              c.value.length
                ? (a(),
                  o("div", pe, [
                    e(
                      "div",
                      {
                        class: I([
                          "t-foot-previous",
                          { disabled: l.value <= 1 },
                        ]),
                        onClick: M,
                      },
                      [
                        _(r, {
                          name: "arrow-left",
                          class: "t-icon",
                          size: "20",
                        }),
                      ],
                      2
                    ),
                    e("div", ge, n(l.value) + "/" + n(h.value), 1),
                    e(
                      "div",
                      {
                        class: I([
                          "t-foot-next",
                          { disabled: l.value >= h.value },
                        ]),
                        onClick: R,
                      },
                      [_(r, { name: "arrow", class: "t-icon", size: "20" })],
                      2
                    ),
                  ]))
                : u("v-if", !0),
            ])
          );
        }
      );
    },
  });
const Se = O(fe, [
  ["__scopeId", "data-v-e3d7427f"],
  [
    "__file",
    "/usr/local/jenkins-prod/workspace/ar051-india-tiranga/src/saasLottery/game/TrxWinGo/components/trx2/trend.vue",
  ],
]);
export { Se as default };
