var e = require("../../common/vendor.js"),
  n = require("../../hooks/onMounted.js"),
  u = require("../../hooks/onShareAppMessage.js"),
  r = require("../../hooks/useState.js"),
  a = require("../../enums/index.js"),
  t = require("../../constant/index.js"),
  o = require("../../data/index.js"),
  l = require("../../utils/navigate.js"),
  i = require("../../utils/util.js"),
  f = require("../../utils/common.js"),
  c = require("../../utils/vin.js");
require("../../service/index.js"),
  require("../../utils/request.js"),
  require("../../config/index.js"),
  require("../../store/app/index.js"),
  Array ||
    (
      e.resolveComponent("uni-collapse-item") +
      e.resolveComponent("uni-collapse")
    )();
Math ||
  (
    e.unref(T) +
    e.unref(s) +
    e.unref(j) +
    e.unref(p) +
    function () {
      return "../../uni_modules/uni-collapse/components/uni-collapse-item/uni-collapse-item.js";
    } +
    function () {
      return "../../uni_modules/uni-collapse/components/uni-collapse/uni-collapse.js";
    } +
    e.unref(y) +
    e.unref(d) +
    e.unref(E) +
    e.unref(m) +
    e.unref(v)
  )();
var v = function () {
    return "../../components/popup-copy-vin/index.js";
  },
  s = function () {
    return "../../components/agreement/index.js";
  },
  m = function () {
    return "../../components/keyboard/index.js";
  },
  p = function () {
    return "../../components/time-line/index.js";
  },
  d = function () {
    return "../../components/float-back-to-top/index.js";
  },
  y = function () {
    return "../../components/divider/index.js";
  },
  T = function () {
    return "../../components/tips/index.js";
  },
  j = function () {
    return "../../components/prompt/index.js";
  },
  E = function () {
    return "../../components/float-share/index.js";
  },
  g = {
    __name: "index",
    setup: function (v) {
      var s = r.useState().showAgreementPopup,
        m = e.ref(!0),
        p = e.ref(""),
        d = e.ref(null),
        y = e.ref(a.QueryTypeEnum.VIN),
        T = e.ref(!1),
        j = e.ref(""),
        E = e.ref(!1),
        g = e.ref(["", "", "", "", "", "", "", ""]),
        k = e.ref(0),
        C = e.ref(!1),
        h = e.ref(a.KeyboardEnum.AREA),
        w = e.ref(!1),
        x = e.ref(0),
        b = e.ref(!1),
        N = e.ref(!1),
        I = e.ref(""),
        z = function () {
          var e = s.value || N.value;
          return "height: 100%; overflow: "
            .concat(e ? "hidden" : "visible", "; position: ")
            .concat(e ? "fixed" : "relative");
        },
        A = function () {
          l.navigateTo({ url: "/pages/vin-info/index" });
        },
        L = function (e) {
          (y.value = e.detail.value),
            e.detail.value === a.QueryTypeEnum.VIN
              ? ((E.value = !0), (C.value = !1))
              : ((E.value = !1), (C.value = !0));
        },
        V = function () {
          j.value = "";
        },
        q = function () {
          f.ocrIdentifyVin().then(function (e) {
            j.value = e;
          });
        },
        S = function () {
          E.value = !0;
        },
        _ = function () {
          E.value = !1;
        },
        Q = function (e) {
          j.value = e.value;
        },
        P = function () {
          C.value = !1;
        },
        O = function (e) {
          e.keyboardType
            ? (h.value = e.keyboardType)
            : ((g.value = e.value), (k.value = e.index));
        },
        R = function () {
          h.value =
            h.value === a.KeyboardEnum.AREA
              ? a.KeyboardEnum.ABC
              : a.KeyboardEnum.AREA;
        },
        M = function () {
          T.value = !T.value;
        },
        H = function () {
          N.value = !1;
        },
        D = function () {
          (j.value = I.value), (N.value = !1), K();
        },
        K = function () {
          (E.value = !1), (C.value = !1);
          var e = g.value.join("");
          if (T.value) {
            if (y.value === a.QueryTypeEnum.VIN) {
              if (0 === j.value.length)
                return void i.showToast("请输入VIN车架号");
              if (j.value.length < 17)
                return void i.showToast("请输入完整的VIN车架号");
              if (!c.validateVIN(j.value))
                return void i.showToast("车架号有误，请检查后重新输入");
            }
            y.value !== a.QueryTypeEnum.VEHICLE_NO || t.vehicleNoExp.test(e)
              ? l.navigateTo({
                  url: "/pages/order-confirm/index",
                  params: {
                    productType: d.value,
                    queryType: y.value,
                    vin: j.value,
                    vehicleNo: e,
                  },
                })
              : i.showToast("请输入正确的车牌");
          } else i.showToast("请先阅读并同意协议");
        };
      return (
        n.onMounted(function (n) {
          n.productType === a.ProductTypeEnum.OVERALL && (w.value = !0),
            n.productType === a.ProductTypeEnum.ACCIDENT && (x.value = 1),
            e.index.setNavigationBarTitle({ title: n.title }),
            (p.value = n.title),
            (d.value = n.productType),
            (y.value = n.queryType),
            (m.value = !1),
            i.hideLoading(),
            n.queryType === a.QueryTypeEnum.VIN &&
              f.hasClickAgreement() &&
              e.index.getClipboardData().then(function (n) {
                var u = n.data;
                e.index.hideToast(),
                  17 === u.trim().length &&
                    setTimeout(function () {
                      (I.value = u.trim()), (N.value = !0);
                    }, 300);
              }),
            n.queryType === a.QueryTypeEnum.VEHICLE_NO &&
              f.hasClickAgreement() &&
              setTimeout(function () {
                C.value = !0;
              }, 200);
        }),
        e.onPageScroll(function (n) {
          var u = n.scrollTop;
          b.value = u >= e.index.getSystemInfoSync().windowHeight / 3;
        }),
        u.onShareAppMessage(),
        function (n, u) {
          return e.e(
            { a: z(), b: !m.value },
            m.value
              ? {}
              : e.e(
                  { c: d.value === e.unref(a.ProductTypeEnum).OVERALL },
                  (d.value, e.unref(a.ProductTypeEnum).OVERALL, {}),
                  {
                    d:
                      d.value === e.unref(a.ProductTypeEnum).INSURANCE_MAINTAIN,
                  },
                  (d.value, e.unref(a.ProductTypeEnum).INSURANCE_MAINTAIN, {}),
                  { e: d.value === e.unref(a.ProductTypeEnum).ACCIDENT },
                  (d.value, e.unref(a.ProductTypeEnum).ACCIDENT, {}),
                  { f: e.t(p.value), g: w.value },
                  (w.value, {}),
                  {
                    h: e.o(A),
                    i: e.unref(a.QueryTypeEnum).VIN,
                    j: y.value === e.unref(a.QueryTypeEnum).VIN,
                    k: e.unref(a.QueryTypeEnum).VEHICLE_NO,
                    l: y.value === e.unref(a.QueryTypeEnum).VEHICLE_NO,
                    m: e.o(L),
                    n: y.value === e.unref(a.QueryTypeEnum).VIN,
                  },
                  y.value === e.unref(a.QueryTypeEnum).VIN
                    ? e.e(
                        { o: 0 === j.value.length },
                        (j.value.length, {}),
                        { p: e.t(j.value), q: e.o(S), r: j.value.length > 0 },
                        j.value.length > 0 ? { s: e.o(V) } : {},
                        {
                          t: e.t(j.value.length),
                          v: e.o(q),
                          w: j.value.length > 0 ? 1 : "",
                        }
                      )
                    : {},
                  { x: y.value === e.unref(a.QueryTypeEnum).VEHICLE_NO },
                  y.value === e.unref(a.QueryTypeEnum).VEHICLE_NO
                    ? {
                        y: e.f(g.value, function (n, u, r) {
                          return e.e(
                            {
                              a: e.t(n),
                              b: u === k.value ? 1 : "",
                              c: 7 === u,
                            },
                            {},
                            {
                              d: u,
                              e: 7 === u ? 1 : "",
                              f: e.o(function (e) {
                                return (function (e) {
                                  (k.value = e), (C.value = !0);
                                })(u);
                              }, u),
                            }
                          );
                        }),
                      }
                    : {},
                  {
                    z: e.o(K),
                    A: e.o(M),
                    B: e.p({ checked: T.value }),
                    C: w.value,
                  },
                  w.value
                    ? {
                        D: e.f(["维保记录", "出险记录"], function (n, u, r) {
                          return {
                            a: e.t(n),
                            b: e.n(x.value === u ? "active" : ""),
                            c: u,
                            d: e.o(function (e) {
                              return (function (e) {
                                x.value = e;
                              })(u);
                            }, u),
                          };
                        }),
                      }
                    : {},
                  { E: 0 === x.value },
                  0 === x.value
                    ? {
                        F: e.f(e.unref(o.mockMailList), function (n, u, r) {
                          return {
                            a: e.t(n.date),
                            b: e.t(n.mile),
                            c: u,
                            d: u % 2 == 1 ? 1 : "",
                          };
                        }),
                        G: e.p({
                          type: e.unref(a.TimeLineEnum).RECORD,
                          data: e.unref(o.mockInsuranceList),
                        }),
                      }
                    : {},
                  { H: 1 === x.value },
                  1 === x.value
                    ? e.e(
                        {
                          I: e.f(e.unref(o.mockJbxxList), function (n, u, r) {
                            return { a: e.t(n.label), b: e.t(n.value), c: u };
                          }),
                          J: e.f(e.unref(o.mockCkdlpcList), function (n, u, r) {
                            return e.e(
                              { a: n.icon, b: e.t(n.name), c: 0 === n.value },
                              (n.value, {}),
                              { d: 1 === n.value },
                              (n.value, {}),
                              { e: 2 === n.value },
                              (n.value, {}),
                              { f: 3 === n.value || 4 === n.value },
                              (3 === n.value || n.value, {}),
                              { g: u }
                            );
                          }),
                          K: e.f(e.unref(o.mockCkpclbList), function (n, u, r) {
                            return {
                              a: e.t(n.name),
                              b: e.t(n.value.length),
                              c: n.value.length > 0 ? 1 : "",
                              d: e.f(n.value, function (n, u, r) {
                                return { a: e.t(n.name), b: e.t(n.type), c: u };
                              }),
                              e: u,
                              f: "1a2b913a-5-" + r + ",1a2b913a-4",
                              g: e.p({
                                name: n.name,
                                open: n.value.length > 0,
                              }),
                            };
                          }),
                          L: e.f(e.unref(o.mockClfwzj), function (n, u, r) {
                            return e.e(
                              { a: !n },
                              {},
                              { b: !!n },
                              {},
                              { c: e.t(u), d: u }
                            );
                          }),
                          M: !!e.unref(o.mockClfwzj).前方左侧,
                        },
                        (e.unref(o.mockClfwzj).前方左侧, {}),
                        { N: !!e.unref(o.mockClfwzj).中间左侧 },
                        (e.unref(o.mockClfwzj).中间左侧, {}),
                        { O: !!e.unref(o.mockClfwzj).后方左侧 },
                        (e.unref(o.mockClfwzj).后方左侧, {}),
                        { P: !!e.unref(o.mockClfwzj).前方右侧 },
                        (e.unref(o.mockClfwzj).前方右侧, {}),
                        { Q: !!e.unref(o.mockClfwzj).中间右侧 },
                        (e.unref(o.mockClfwzj).中间右侧, {}),
                        { R: !!e.unref(o.mockClfwzj).底部 },
                        (e.unref(o.mockClfwzj).底部, {}),
                        { S: !!e.unref(o.mockClfwzj).后方右侧 },
                        (e.unref(o.mockClfwzj).后方右侧, {}),
                        { T: !!e.unref(o.mockClfwzj).顶部 },
                        (e.unref(o.mockClfwzj).顶部, {}),
                        { U: !!e.unref(o.mockClfwzj).正前方 },
                        (e.unref(o.mockClfwzj).正前方, {}),
                        { V: !!e.unref(o.mockClfwzj).内部 },
                        (e.unref(o.mockClfwzj).内部, {}),
                        { W: !!e.unref(o.mockClfwzj).正后方 },
                        (e.unref(o.mockClfwzj).正后方, {}),
                        { X: !!e.unref(o.mockClfwzj).其他 },
                        (e.unref(o.mockClfwzj).其他, {}),
                        {
                          Y: e.f(e.unref(o.mockCkxxList), function (n, u, r) {
                            return e.e(
                              { a: n.icon, b: e.t(n.name), c: 0 === n.value },
                              (n.value, {}),
                              { d: 1 === n.value },
                              (n.value, {}),
                              { e: 2 === n.value },
                              (n.value, {}),
                              { f: u }
                            );
                          }),
                          Z: e.f(e.unref(o.mockTjxxList), function (n, u, r) {
                            return {
                              a: e.t(n.name),
                              b: e.t(n.value || "-"),
                              c: u,
                            };
                          }),
                          aa: e.f(
                            e.unref(o.mockPzlsmxList),
                            function (n, u, r) {
                              return {
                                a: e.t(n.date),
                                b: e.t(n.claimStatus),
                                c: e.t(
                                  (Number(n.serviceMoney) / 100).toFixed(0)
                                ),
                                d: e.f(n.result, function (n, u, r) {
                                  return e.e(
                                    {
                                      a: e.t(n.dangerSingleName || "-"),
                                      b: 1 == n.dangerSingleType,
                                    },
                                    (1 == n.dangerSingleType ||
                                      2 == n.dangerSingleType ||
                                      n.dangerSingleType,
                                    {}),
                                    {
                                      c: 2 == n.dangerSingleType,
                                      d: 3 == n.dangerSingleType,
                                      e: e.t(n.dangerSingleNum),
                                      f: u,
                                    }
                                  );
                                }),
                                e: u,
                              };
                            }
                          ),
                        }
                      )
                    : {},
                  {
                    ab: e.t(e.unref(t.disclaimer)),
                    ac: e.p({ visible: b.value }),
                    ad: e.o(P),
                    ae: e.o(O),
                    af: e.o(R),
                    ag: e.p({
                      visible: C.value,
                      "can-switch": !0,
                      "keyboard-type": h.value,
                      "vehicle-no-list": g.value,
                      "vehicle-no-index": k.value,
                    }),
                    ah: e.o(_),
                    ai: e.o(Q),
                    aj: e.p({
                      visible: E.value,
                      "can-switch": !1,
                      vin: j.value,
                    }),
                    ak: e.o(D),
                    al: e.o(H),
                    am: e.p({ visible: N.value, "copy-vin": I.value }),
                  }
                )
          );
        }
      );
    },
  },
  k = e._export_sfc(g, [["__scopeId", "data-v-1a2b913a"]]);
(g.__runtimeHooks = 3), wx.createPage(k);
