require("../@babel/runtime/helpers/Objectvalues");
var n = require("../@babel/runtime/helpers/typeof"),
  e = require("../common/vendor.js");
exports.aldInit = function () {
  var r = {
      867: function (n) {
        n.exports = { wx: { name: "微信", version: "7.5.0" } };
      },
    },
    t = {};
  function o(n) {
    var e = t[n];
    if (void 0 !== e) return e.exports;
    var i = (t[n] = { exports: {} });
    return r[n](i, i.exports, o), i.exports;
  }
  (o.d = function (n, e) {
    for (var r in e)
      o.o(e, r) &&
        !o.o(n, r) &&
        Object.defineProperty(n, r, { enumerable: !0, get: e[r] });
  }),
    (o.o = function (n, e) {
      return Object.prototype.hasOwnProperty.call(n, e);
    }),
    (o.r = function (n) {
      "undefined" != typeof Symbol &&
        Symbol.toStringTag &&
        Object.defineProperty(n, Symbol.toStringTag, { value: "Module" }),
        Object.defineProperty(n, "__esModule", { value: !0 });
    });
  var i = {};
  return (
    (function () {
      o.r(i),
        o.d(i, {
          App: function () {
            return zn;
          },
          Component: function () {
            return se;
          },
          Page: function () {
            return Qn;
          },
        });
      var r = [
          "request",
          "getSystemInfoSync",
          "getNetworkType",
          "getStorageSync",
          "setStorageSync",
        ],
        t = ["login"],
        a = [
          "scanCode",
          "chooseAddress",
          "chooseImage",
          "previewImage",
          "chooseInvoiceTitle",
          "chooseInvoice",
        ],
        u = "MiniApp-Stat",
        c = "uuid_getstoragesync",
        s = "life",
        _ = "http://doc.aldwx.com",
        l = "https://log.aldwx.com",
        f = {
          SDK_VERSION: l + "/config/app.json",
          SDK_DOWNLOAD: "https://tj.aldwx.com/downSDK",
          GET_OPEN_ID: l + "/authorize/mini_program_openid",
          SEND_LOG: l + "/d.html",
        },
        p = "请参考接入文档 " + _ + " 小程序统计平台-快速接入指南-自定义事件！",
        d =
          "请参考接入文档 " + _ + " 小程序统计平台-快速接入指南-智慧零售分析！",
        v = {
          ERR_MISS_APPKEY:
            "请在 ald-stat-conf.js 文件中填写小程序统计/广告监测平台创建小程序后生成的 app_key，请参考接入文档 " +
            _ +
            " 小程序统计平台-快速接入指南！",
          WARN_SDK_NEED_UPDATE:
            "您的 SDK 不是最新版本，部分功能不可用，请尽快前往 " +
            f.SDK_DOWNLOAD +
            " 升级",
          ERR_WRONG_OPENID:
            "OpenID 不符合规则，请参考接入文档 " +
            _ +
            " 小程序统计/广告监测平台-快速接入指南！",
          ERR_MISS_SESSION_KEY: "请传入从后台获取的 session_key",
          ERR_API_WRONG_EVENT_NAME:
            "事件名称必须为 String 类型且不能超过 255 个字符，" + p,
          ERR_API_EVENT_ARGS_TOO_LONG:
            "自定义事件参数不能超过 255 个字符，" + p,
          ERR_API_WRONG_EVENT_ARGS:
            "事件参数必须为 String、Object 类型，且参数长度不能超过 255 个字符，" +
            p,
          ERR_API_EVENT_ARGS_INNER_TYPE:
            "事件参数内部只支持 Number、String 等类型，" + p,
          ERR_API_SALE_WRONG_VISIT: "wx.aldVisit() 传参不符合规则，" + d,
          ERR_API_SALE_WRONG_VISIT_ARGS:
            "category、id、name 为必传字段且数据类型必须符合规则，" + d,
          ERR_API_SALE_WRONG_VISIT_CATEGORY:
            "category 字段（商品类别）只支持 String类 型，且长度小于 32 个字符，" +
            d,
          ERR_API_SALE_WRONG_VISIT_ID:
            "id 字段（商品唯一 id）只支持 Number 类型和 String 类型，" + d,
          ERR_API_SALE_WRONG_VISIT_NAME:
            "name 字段（商品名称）只支持 String 类型，且长度小于 32 个字符，" +
            d,
          ERR_API_SALE_WRONG_ORDER: "wx.aldPayOrder() 传参不符合规则，" + d,
          ERR_API_SALE_WRONG_ORDER_ARGS:
            "price、details 为必传字段且数据类型必须符合规则，" + d,
          ERR_API_SALE_WRONG_ORDER_PRICE:
            "price 字段（付费金额）只支持 Number 类型和数字字符串，且不能小于 0，" +
            d,
          ERR_API_SALE_WRONG_ORDER_DETAILS:
            "details 字段（订单详细信息）为 Array 类型，且长度不能小于 1，" + d,
          ERR_API_SALE_WRONG_ORDER_DETAIL_ARGS:
            "amount、category、id、name 为必传字段且数据类型必须符合规则，" + d,
          ERR_API_SALE_WRONG_ORDER_DETAIL_AMOUNT:
            "details 参数下 amount 字段值（商品数量）只支持 Number 类型和数字字符串，且不能小于或等于 0，" +
            d,
          ERR_API_SALE_WRONG_ORDER_DETAIL_ID:
            "id 字段（商品唯一 id）只支持 Number 类型和 String 类型，" + d,
          ERR_API_SALE_WRONG_ORDER_DETAIL_CATEGORY:
            "details 参数下 category 字段值（商品类别）只支持 String 类型，且长度小于 32 个字符，" +
            d,
          ERR_API_SALE_WRONG_ORDER_DETAIL_NAME:
            "details 参数下 name 字段值（商品类别）只支持 String 类型，且长度小于 32 个字符，" +
            d,
        },
        h = "aldstat_op",
        R = ["aldVisit", "aldPayOrder"],
        g = { UUID: "ald_share_src", OPEN_ID: "ald_share_op" };
      function E(n, e) {
        (null == e || e > n.length) && (e = n.length);
        for (var r = 0, t = new Array(e); r < e; r++) t[r] = n[r];
        return t;
      }
      for (
        var S,
          A = {},
          y = function () {
            var n = S.value;
            A[n] = function () {
              throw new Error(
                "Do not use '" + n + "' api without implementation!"
              );
            };
          },
          O = (function (n, e) {
            var r =
              ("undefined" != typeof Symbol && n[Symbol.iterator]) ||
              n["@@iterator"];
            if (r) return (r = r.call(n)).next.bind(r);
            if (
              Array.isArray(n) ||
              (r = (function (n, e) {
                if (n) {
                  if ("string" == typeof n) return E(n, e);
                  var r = Object.prototype.toString.call(n).slice(8, -1);
                  return (
                    "Object" === r && n.constructor && (r = n.constructor.name),
                    "Map" === r || "Set" === r
                      ? Array.from(n)
                      : "Arguments" === r ||
                        /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)
                      ? E(n, e)
                      : void 0
                  );
                }
              })(n))
            ) {
              r && (n = r);
              var t = 0;
              return function () {
                return t >= n.length
                  ? { done: !0 }
                  : { done: !1, value: n[t++] };
              };
            }
            throw new TypeError(
              "Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."
            );
          })(r);
        !(S = O()).done;

      )
        y();
      var m = A;
      function I(n, e) {
        (null == e || e > n.length) && (e = n.length);
        for (var r = 0, t = new Array(e); r < e; r++) t[r] = n[r];
        return t;
      }
      function N() {
        return e.wx$1.getAccountInfoSync
          ? e.wx$1.getAccountInfoSync().miniProgram.appId
          : "";
      }
      var b = {};
      function w(n) {
        return b[n];
      }
      function P(n, e) {
        b[n] = e;
      }
      function D(n, e) {
        b[n] = Object.assign(b[n], e);
      }
      function T(n, e) {
        void 0 === e && (e = 1), (b[n] += e);
      }
      for (
        var G = "app_show_time",
          L = "app_hide_time",
          W = "app_error_count",
          j = "page_show_time",
          x = "qrcode_query",
          C = "share_source",
          M = "current_page_path",
          V = "last_visit_page_path",
          q = "page_options",
          U = "is_first_onshow",
          k = "is_first_open_mini_app",
          K = "is_first_access_page",
          $ = "page_duration",
          Y = "is_under_30s_session",
          F = "is_onshow_by_share",
          B = "is_onshow_by_api",
          J = "session_key",
          H = "user_info",
          z = "share_info",
          Q = "openid",
          X = "gender",
          Z = "user_avatar",
          nn = "ald_launch_session",
          en = "ald_access_token",
          rn = "ald_uuid",
          tn = "show_options",
          on = "show_scene",
          an = "request_common_data",
          un = "request_count",
          cn = "queue_ins",
          sn = {
            type: "",
            name: "",
            version: "",
            appKey: "",
            isPlugin: !1,
            useCompliance: !1,
          },
          _n = sn,
          ln = "aldstat_uuid",
          fn = Object.prototype.toString,
          pn = {},
          dn = function () {
            var n = hn[vn];
            pn["is" + n] = function (e) {
              return fn.call(e).slice(8, -1) === n;
            };
          },
          vn = 0,
          hn = [
            "String",
            "Array",
            "Function",
            "Number",
            "Date",
            "Boolean",
            "RegExp",
            "Symbol",
          ];
        vn < hn.length;
        vn++
      )
        dn();
      function Rn(e) {
        var r = n(e);
        return "function" === r || ("object" === r && !!r);
      }
      function gn(n) {
        var e = Number(n);
        return (pn.isNumber(n) || pn.isString(n)) && e >= 0 && !isNaN(e);
      }
      var En = pn.isString,
        Sn = pn.isArray,
        An = pn.isFunction,
        yn = pn.isNumber;
      function On() {
        return "" + Date.now() + Math.floor(1e7 * Math.random());
      }
      function mn(n, e, r) {
        var t = n[e];
        n[e] = function (n) {
          r.call(this, n, e), t && An(t) && t.call(this, n);
        };
      }
      function In(n, e) {
        (null == e || e > n.length) && (e = n.length);
        for (var r = 0, t = new Array(e); r < e; r++) t[r] = n[r];
        return t;
      }
      function Nn(n) {
        return Object.assign({}, w(an), n);
      }
      function bn(n) {
        T(un),
          (n.at = w(en)),
          (n.uu = w(rn)),
          (n.v = _n.version),
          (n.ak = _n.appKey.replace(/(\t)|(\s)/g, "")),
          (n.wsr = w(tn)),
          (n.ifo = w(k)),
          (n.rq_c = w(un)),
          (n.ls = w(nn)),
          (n.te = _n.type),
          (n.et = Date.now()),
          (n.st = Date.now()),
          (n.ge = w(X));
        var e,
          r =
            ((e = n),
            function () {
              return new Promise(function (n) {
                var r,
                  t =
                    (((r = {}).AldStat = u),
                    (r.se = w(J) || ""),
                    (r.op = w(Q) || ""),
                    (r.img = w(Z) || ""),
                    r),
                  o = w("appid");
                o && (t.ai = o),
                  m.request({
                    url: f.SEND_LOG,
                    data: e,
                    header: t,
                    method: "GET",
                    success: function (e) {
                      e && 200 === e.statusCode ? n("") : n("status error");
                    },
                    fail: function () {
                      n("fail");
                    },
                  });
              });
            });
        w(cn).push(r);
      }
      function wn(n, e, r) {
        var t,
          o = Nn(
            (((t = {}).ev = n), (t.tp = e), (t.dr = Date.now() - w(G)), t)
          );
        r && (o.ct = r), bn(o);
      }
      function Pn(n, e) {
        var r,
          t = Nn(
            (((r = {}).ev = n),
            (r[s] = e),
            (r.ec = w(W)),
            (r.dr = Date.now() - w(G)),
            r)
          );
        "show" == e && (t.uo = !1);
        var o = w(x);
        o && (t.qr = t.sr = o);
        var i = w(C);
        i && (t.usr = i), bn(t);
      }
      function Dn(n, e) {
        (null == e || e > n.length) && (e = n.length);
        for (var r = 0, t = new Array(e); r < e; r++) t[r] = n[r];
        return t;
      }
      pn.isDate, pn.isBoolean, pn.isRegExp, pn.isSymbol;
      var Tn = (function () {
          function n() {
            this.events = new Map();
          }
          var e = n.prototype;
          return (
            (e.on = function (n, e) {
              var r = this.events;
              return r.has(n) || r.set(n, []), r.get(n).push(e), this;
            }),
            (e.once = function (n, e) {
              var r = this;
              return this.on(n, function t() {
                r.off(n, t);
                for (
                  var o = arguments.length, i = new Array(o), a = 0;
                  a < o;
                  a++
                )
                  i[a] = arguments[a];
                e.apply(r, i);
              });
            }),
            (e.emit = function (n) {
              for (
                var e = this.listeners(n),
                  r = arguments.length,
                  t = new Array(r > 1 ? r - 1 : 0),
                  o = 1;
                o < r;
                o++
              )
                t[o - 1] = arguments[o];
              for (
                var i,
                  a = (function (n, e) {
                    var r =
                      ("undefined" != typeof Symbol && n[Symbol.iterator]) ||
                      n["@@iterator"];
                    if (r) return (r = r.call(n)).next.bind(r);
                    if (
                      Array.isArray(n) ||
                      (r = (function (n, e) {
                        if (n) {
                          if ("string" == typeof n) return Dn(n, e);
                          var r = Object.prototype.toString
                            .call(n)
                            .slice(8, -1);
                          return (
                            "Object" === r &&
                              n.constructor &&
                              (r = n.constructor.name),
                            "Map" === r || "Set" === r
                              ? Array.from(n)
                              : "Arguments" === r ||
                                /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(
                                  r
                                )
                              ? Dn(n, e)
                              : void 0
                          );
                        }
                      })(n))
                    ) {
                      r && (n = r);
                      var t = 0;
                      return function () {
                        return t >= n.length
                          ? { done: !0 }
                          : { done: !1, value: n[t++] };
                      };
                    }
                    throw new TypeError(
                      "Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."
                    );
                  })(e);
                !(i = a()).done;

              )
                i.value.apply(this, t);
            }),
            (e.off = function (n, e) {
              var r = this.events;
              if (!n) return r.clear(), this;
              if (!e) return r.delete(n), this;
              for (var t = this.listeners(n), o = 0, i = t.length; o < i; o++)
                t[o] === e && (t.splice(o, 1), i--, o--);
              return 0 === t.length && r.delete(n), this;
            }),
            (e.listeners = function (n) {
              return this.events.get(n) || [];
            }),
            n
          );
        })(),
        Gn = "app_on_show",
        Ln = "use_compliance",
        Wn = new Tn(),
        jn = {
          sendEvent: function (n, e) {
            return kn(function () {
              (function (n, e) {
                return !n || !En(n) || n.length > 255
                  ? (console.error(v.ERR_API_WRONG_EVENT_NAME), !1)
                  : !(
                      !(En(e) && e.length <= 255) &&
                      (Rn(e)
                        ? JSON.stringify(e).length >= 255
                          ? (console.error(v.ERR_API_EVENT_ARGS_TOO_LONG), 1)
                          : (function (n) {
                              for (var e in n)
                                if (n.hasOwnProperty(e) && n[e] && Rn(n[e]))
                                  return !0;
                              return !1;
                            })(e) &&
                            (console.error(v.ERR_API_EVENT_ARGS_INNER_TYPE), 1)
                        : void 0 !== e &&
                          (console.error(v.ERR_API_WRONG_EVENT_ARGS), 1))
                    );
              })(n, e) && wn("event", n, Rn(e) ? JSON.stringify(e) : e);
            });
          },
          sendSession: function (n) {
            return kn(function () {
              var e;
              if (n) {
                P(J, n);
                var r = Nn(
                    (((e = {}).ev = "event"),
                    (e.tp = "session"),
                    (e.ct = "session"),
                    e)
                  ),
                  t = w(H);
                if (t) {
                  r.ufo = t;
                  var o = w(z);
                  "" !== o && (r.gid = o);
                }
                bn(r);
              } else console.error(v.ERR_MISS_SESSION_KEY);
            });
          },
          sendOpenid: function (n) {
            return kn(function () {
              var e;
              n && 28 === n.length
                ? (P(Q, n),
                  m.setStorageSync(h, n),
                  bn(
                    Nn(
                      (((e = {}).ev = "event"),
                      (e.tp = "openid"),
                      (e.ct = "openid"),
                      e)
                    )
                  ))
                : console.error(v.ERR_WRONG_OPENID);
            });
          },
          setOpenid: function (n) {
            An(n) &&
              "" === w(Q) &&
              n().then(function (n) {
                28 === n.length && (P(Q, n), m.setStorageSync(h, n));
              });
          },
          sendUser: function (n, e) {
            return kn(function () {
              var n, r;
              !w(H) &&
                e &&
                (P(H, e),
                P(
                  Z,
                  (null == (n = e.avatarUrl) ? void 0 : n.split("/")).reduce(
                    function (n, e) {
                      return e.length > n.length ? e : n;
                    }
                  )
                ),
                P(X, e.gender),
                bn(Nn((((r = {}).ufo = e), r))));
            });
          },
          sendCompliance: function () {
            _n.useCompliance && Wn.emit(Ln, !0);
          },
        },
        xn = {
          aldVisit: function (n) {
            return kn(function () {
              (function (n) {
                if (!Rn(n))
                  return console.error(v.ERR_API_SALE_WRONG_VISIT), !1;
                var e = n.category,
                  r = n.id,
                  t = n.name;
                return e && (0 === r || r) && t
                  ? !En(e) || e.length > 32
                    ? (console.error(v.ERR_API_SALE_WRONG_VISIT_CATEGORY), !1)
                    : yn(r) || En(r)
                    ? !(!En(t) || t.length > 32) ||
                      (console.error(v.ERR_API_SALE_WRONG_VISIT_NAME), !1)
                    : (console.error(v.ERR_API_SALE_WRONG_VISIT_ID), !1)
                  : (console.error(v.ERR_API_SALE_WRONG_VISIT_ARGS), !1);
              })(n) &&
                wn("visit", null, {
                  category: n.category,
                  id: n.id,
                  name: n.name,
                });
            });
          },
          aldPayOrder: function (n) {
            return kn(function () {
              (function (n) {
                if (!Rn(n))
                  return console.error(v.ERR_API_SALE_WRONG_ORDER), !1;
                var e,
                  r,
                  t,
                  o,
                  i,
                  a = n.price,
                  u = n.details;
                if ((0 !== a && !a) || !u)
                  return console.error(v.ERR_API_SALE_WRONG_ORDER_ARGS), !1;
                if (!gn(a))
                  return console.error(v.ERR_API_SALE_WRONG_ORDER_PRICE), !1;
                if (!Sn(u) || u.length < 1)
                  return console.error(v.ERR_API_SALE_WRONG_ORDER_DETAILS), !1;
                for (var c = 0, s = u.length; c < s; c++)
                  if (
                    ((r = (e = u[c]).amount),
                    (t = e.category),
                    (o = e.id),
                    (i = e.name),
                    !(r && t && (0 === o || o) && i
                      ? gn(r)
                        ? yn(o) || En(o)
                          ? !En(t) || t.length > 32
                            ? (console.error(
                                v.ERR_API_SALE_WRONG_ORDER_DETAIL_CATEGORY
                              ),
                              0)
                            : (En(i) && !(i.length > 32)) ||
                              (console.error(
                                v.ERR_API_SALE_WRONG_ORDER_DETAIL_NAME
                              ),
                              0)
                          : (console.error(
                              v.ERR_API_SALE_WRONG_ORDER_DETAIL_ID
                            ),
                            0)
                        : (console.error(
                            v.ERR_API_SALE_WRONG_ORDER_DETAIL_AMOUNT
                          ),
                          0)
                      : (console.error(v.ERR_API_SALE_WRONG_ORDER_DETAIL_ARGS),
                        0)))
                  )
                    return !1;
                return !0;
              })(n) && wn("pay", null, { price: n.price, details: n.details });
            });
          },
        },
        Cn = (function () {
          function n(n) {
            void 0 === n && (n = {}),
              (this.concurrency = void 0),
              (this.queue = []),
              (this.activeCount = 0),
              (this.concurrency = n.concurrency || 4);
          }
          var e = n.prototype;
          return (
            (e.push = function (n) {
              var e = this,
                r = function () {
                  e.activeCount++,
                    n().then(function () {
                      e.next();
                    });
                };
              this.activeCount < this.concurrency ? r() : this.queue.push(r);
            }),
            (e.next = function () {
              this.activeCount--, this.queue.length > 0 && this.queue.shift()();
            }),
            n
          );
        })();
      function Mn() {
        return (Mn =
          Object.assign ||
          function (n) {
            for (var e = 1; e < arguments.length; e++) {
              var r = arguments[e];
              for (var t in r)
                Object.prototype.hasOwnProperty.call(r, t) && (n[t] = r[t]);
            }
            return n;
          }).apply(this, arguments);
      }
      var Vn = an,
        qn = o(867),
        Un = "df9b8c987dabf51846641954b93c8625";
      function kn(n) {
        n && n();
      }
      function Kn(n) {
        return (
          P(nn, On()),
          (this.aldstat = jn),
          kn(function () {
            P(tn, n), P(on, n.scene);
          })
        );
      }
      function $n(n) {
        return kn(function () {
          var e = n.scene,
            r = n.query,
            t = n.shareTicket,
            o = r.ald_share_src,
            i = e === w(on);
          P(on, e),
            P(un, 0),
            P(tn, n),
            P(C, o),
            P(x, r.aldsrc || ""),
            P("share_query", o),
            w(U) || w(F) || w(B) || P(k, !1),
            P(U, !1);
          var a = w(L);
          ((0 !== a && Date.now() - a > 3e4) || !i) &&
            (w(F) || (P(en, On()), P(G, Date.now()), P($, 0))),
            0 !== a && Date.now() - a < 3e4 && P(Y, !0),
            Pn("app", "show"),
            Wn.emit(Gn, { aldShareSrc: o, shareTicket: t, scene: e });
        });
      }
      function Yn() {
        return (
          P(L, Date.now()),
          kn(function () {
            Pn("app", "hide");
          })
        );
      }
      function Fn(n) {
        return kn(function () {
          T(W), wn("event", "ald_error_message", n);
        });
      }
      function Bn(n) {
        return kn(function () {
          P(q, n);
        });
      }
      function Jn() {
        return (
          P(j, Date.now()),
          kn(function () {
            var n;
            P(M, (n = m.getCurrentPages())[n.length - 1].route);
            var e = Boolean(w(F) || w(B));
            P(F, !1), P(B, !1);
            var r = w(K);
            P(K, !1),
              (function (n, e, r) {
                var t,
                  o = void 0 === r ? {} : r,
                  i = o.isFirstPage,
                  a = void 0 !== i && i,
                  u = o.isFromShareOrApi,
                  c = void 0 !== u && u,
                  _ = w(M),
                  l = Nn(
                    (((t = {}).ev = "page"),
                    (t[s] = "show"),
                    (t.pp = _),
                    (t.pc = w(V) || ""),
                    (t.dr = Date.now() - w(G)),
                    t)
                  );
                c && (l.so = 1);
                var f = w(q);
                f && "{}" !== JSON.stringify(f) && (l.ag = f);
                var p = w(x);
                p && (l.qr = l.sr = p);
                var d = w(C);
                d && (l.usr = d),
                  w(Y) && (l.ps = 1),
                  a ? ((l.ifp = !0), (l.fp = _), (l.pdr = 0)) : (l.pdr = w($)),
                  bn(l);
              })(0, 0, { isFromShareOrApi: e, isFirstPage: r }),
              P(Y, !1);
          })
        );
      }
      function Hn() {
        return (
          P($, Date.now() - w(j)),
          kn(function () {
            P(V, w(M));
          })
        );
      }
      var zn,
        Qn,
        Xn,
        Zn,
        ne,
        ee = Hn;
      function re() {
        return kn(function () {
          wn("event", "ald_pulldownrefresh", 1);
        });
      }
      function te() {
        return kn(function () {
          wn("event", "ald_reachbottom", 1);
        });
      }
      function oe(n, e, r) {
        var t = n[e];
        t
          ? ~t.indexOf(r) || (t.length < 200 && (n[e] = t + "," + r))
          : (n[e] = r);
      }
      function ie(n) {
        return (
          mn(n, "onLaunch", Kn),
          mn(n, "onShow", $n),
          mn(n, "onHide", Yn),
          mn(n, "onError", Fn),
          n
        );
      }
      function ae(n) {
        return (
          mn(n, "onShow", Jn),
          mn(n, "onHide", Hn),
          mn(n, "onLoad", Bn),
          mn(n, "onUnload", ee),
          mn(n, "onReachBottom", te),
          mn(n, "onPullDownRefresh", re),
          (r = (e = n).onShareAppMessage) &&
            (e.onShareAppMessage = function (n) {
              var e = r.call(this, n) || {};
              return (
                (e.path = e.path || w(M)),
                (function (n) {
                  P(F, !0);
                  var e = n.path,
                    r =
                      (function (n) {
                        if (~n.indexOf("?")) {
                          var e,
                            r,
                            t = {};
                          return (
                            n
                              .split("?")[1]
                              .split("&")
                              .forEach(function (n) {
                                if (n) {
                                  var o = n.split("=");
                                  (e = o[0]),
                                    (r =
                                      o.length >= 2
                                        ? decodeURIComponent(o[1])
                                        : null),
                                    (t[e] = r);
                                }
                              }),
                            t
                          );
                        }
                      })(e) || {},
                    t = {},
                    o = (w(tn) || {}).query;
                  for (var i in o)
                    o.hasOwnProperty(i) &&
                      Object.values(g).indexOf(i) > -1 &&
                      (t[i] = o[i]);
                  var a = e.split("?")[0] + "?";
                  for (var u in (Object.assign(t, r),
                  oe(t, g.UUID, w(rn)),
                  w(Q) && oe(t, g.OPEN_ID, w(Q)),
                  t))
                    t.hasOwnProperty(u) &&
                      !~u.indexOf("ald") &&
                      (a += u + "=" + t[u] + "&");
                  return (
                    (n.path =
                      a +
                      (t.ald_share_op
                        ? g.OPEN_ID + "=" + t.ald_share_op + "&"
                        : "") +
                      g.UUID +
                      "=" +
                      t.ald_share_src),
                    wn("event", "ald_share_status", n),
                    n
                  );
                })(e)
              );
            }),
          n
        );
        var e, r;
      }
      function ue() {
        var n;
        (function () {
          P(en, On()),
            P(
              Q,
              (function () {
                var n = "";
                try {
                  n = m.getStorageSync(h);
                } catch (n) {}
                return n;
              })()
            );
          var n = (function () {
            var n = "";
            try {
              n = m.getStorageSync(ln);
            } catch (e) {
              n = c;
            }
            return n;
          })();
          P(k, !n),
            n ||
              (function (n) {
                try {
                  m.setStorageSync(ln, n);
                } catch (n) {
                  m.setStorageSync(ln, c);
                }
              })(
                (n = (function () {
                  function n() {
                    return Math.floor(65536 * (1 + Math.random()))
                      .toString(16)
                      .substring(1);
                  }
                  return n() + n() + n() + n() + n() + n() + n() + n();
                })())
              ),
            P(rn, n),
            P(
              "appid",
              m
                .getAppid()
                .split("")
                .map(function (n) {
                  return n.charCodeAt(0) + 9;
                })
                .join("-")
            );
        })(),
          P(cn, new Cn()),
          m.request({
            url: f.SDK_VERSION,
            header: ((n = {}), (n.AldStat = u), n),
            method: "GET",
            success: function (n) {
              if (200 === n.statusCode) {
                var e = n.data;
                (function (n, e) {
                  return (
                    (function (n, e) {
                      for (
                        var r = n.split("."),
                          t = e.split("."),
                          o = Math.max(r.length, t.length);
                        r.length < o;

                      )
                        r.push("0");
                      for (; t.length < o; ) t.push("0");
                      for (var i = 0; i < o; i++) {
                        var a = parseInt(r[i], 10),
                          u = parseInt(t[i], 10);
                        if (a > u) return 1;
                        if (a < u) return -1;
                      }
                      return 0;
                    })(n, e) > 0
                  );
                })(e.version, _n.version) &&
                  console.warn(v.WARN_SDK_NEED_UPDATE),
                  e.warn && console.warn(e.warn),
                  e.error && console.error(e.error);
              }
            },
          }),
          (function () {
            var n,
              e = (function () {
                try {
                  return m.getSystemInfoSync();
                } catch (n) {}
              })();
            if (e) {
              var r,
                t = e.brand,
                o = e.model,
                i = e.pixelRatio,
                a = e.windowWidth,
                u = e.windowHeight,
                c = e.language,
                s = e.version,
                _ = e.platform,
                l = e.SDKVersion,
                f = e.system;
              D(
                Vn,
                (((r = {}).br = t),
                (r.pm = o),
                (r.pr = i),
                (r.ww = a),
                (r.wh = u),
                (r.lang = c),
                (r.wv = s),
                (r.wvv = _),
                (r.wsdk = l),
                (r.sv = f),
                r)
              );
            }
            (n = function (n) {
              var e;
              D(Vn, (((e = {}).nt = n), e));
            }),
              m.getNetworkType({
                success: function (e) {
                  n && n(e.networkType);
                },
              });
          })(),
          Wn.on(Gn, function (n) {
            var r = n.aldShareSrc,
              t = n.shareTicket,
              o = n.scene;
            if (
              (r && 1044 === o && t
                ? e.wx$1.getShareInfo({
                    shareTicket: t,
                    success: function (n) {
                      P(z, n),
                        wn("event", "ald_share_click", JSON.stringify(n));
                    },
                  })
                : r && wn("event", "ald_share_click", 1),
              !w(Q))
            ) {
              var i = m.getAppid();
              m.login({
                success: function (n) {
                  m.request({
                    url: f.GET_OPEN_ID,
                    data: { ai: i, uuid: w(rn), jc: n.code, reqid: "1" },
                    success: function (n) {
                      var e = n.data;
                      if (!e.code) {
                        var r,
                          t =
                            null == e || null == (r = e.data)
                              ? void 0
                              : r.openid;
                        P(Q, t), m.setStorageSync(h, t);
                      }
                    },
                  });
                },
                fail: function (n) {
                  console.warn("sdk-login-err", n);
                },
              });
            }
          });
      }
      if (
        ((function (n) {
          Object.assign(sn, n);
        })(
          Mn({ type: "wx" }, qn.wx, {
            appKey: Un,
            isPlugin: !1,
            useCompliance: !1,
          })
        ),
        P(Vn, {}),
        P(U, !0),
        P(K, !0),
        P(G, Date.now()),
        P(L, 0),
        P(W, 0),
        P(X, ""),
        P(un, 0),
        (function () {
          for (
            var n,
              o,
              i = {},
              a = function () {
                var r = n.value;
                i[r] = function () {
                  return e.wx$1[r].apply(null, arguments);
                };
              },
              u = (function (n, e) {
                var r =
                  ("undefined" != typeof Symbol && n[Symbol.iterator]) ||
                  n["@@iterator"];
                if (r) return (r = r.call(n)).next.bind(r);
                if (
                  Array.isArray(n) ||
                  (r = (function (n, e) {
                    if (n) {
                      if ("string" == typeof n) return I(n, e);
                      var r = Object.prototype.toString.call(n).slice(8, -1);
                      return (
                        "Object" === r &&
                          n.constructor &&
                          (r = n.constructor.name),
                        "Map" === r || "Set" === r
                          ? Array.from(n)
                          : "Arguments" === r ||
                            /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)
                          ? I(n, e)
                          : void 0
                      );
                    }
                  })(n))
                ) {
                  r && (n = r);
                  var t = 0;
                  return function () {
                    return t >= n.length
                      ? { done: !0 }
                      : { done: !1, value: n[t++] };
                  };
                }
                throw new TypeError(
                  "Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."
                );
              })(r.concat(t));
            !(n = u()).done;

          )
            a();
          (i.getAppid = N),
            (i.getCurrentPages = getCurrentPages),
            (o = i),
            Object.assign(A, o);
        })(),
        (function (n) {
          n.aldstat = jn;
          for (var r = 0, t = R.length; r < t; r++)
            (o = e.wx$1),
              (i = R[r]),
              (u = xn[R[r]]),
              Object.defineProperty(o, i, {
                value: u,
                writable: !1,
                enumerable: !0,
                configurable: !0,
              });
          var o, i, u;
          !(function (n) {
            for (
              var e,
                r = function () {
                  var r = e.value,
                    t = n[r];
                  try {
                    Object.defineProperty(n, r, {
                      get: function () {
                        return P(B, !0), t;
                      },
                    });
                  } catch (n) {}
                },
                t = (function (n, e) {
                  var r =
                    ("undefined" != typeof Symbol && n[Symbol.iterator]) ||
                    n["@@iterator"];
                  if (r) return (r = r.call(n)).next.bind(r);
                  if (
                    Array.isArray(n) ||
                    (r = (function (n, e) {
                      if (n) {
                        if ("string" == typeof n) return In(n, e);
                        var r = Object.prototype.toString.call(n).slice(8, -1);
                        return (
                          "Object" === r &&
                            n.constructor &&
                            (r = n.constructor.name),
                          "Map" === r || "Set" === r
                            ? Array.from(n)
                            : "Arguments" === r ||
                              /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)
                            ? In(n, e)
                            : void 0
                        );
                      }
                    })(n))
                  ) {
                    r && (n = r);
                    var t = 0;
                    return function () {
                      return t >= n.length
                        ? { done: !0 }
                        : { done: !1, value: n[t++] };
                    };
                  }
                  throw new TypeError(
                    "Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."
                  );
                })(a);
              !(e = t()).done;

            )
              r();
          })(n);
        })(e.wx$1),
        _n.useCompliance
          ? Wn.on(Ln, function (n) {
              P("is_compliance_enabled", n), ue();
            })
          : ue(),
        _n.isPlugin)
      ) {
        var ce = {
          App: (function (n) {
            function e(e) {
              return n.apply(this, arguments);
            }
            return (
              (e.toString = function () {
                return n.toString();
              }),
              e
            );
          })(function (n) {
            return App(ie(n));
          }),
          Page: (function (n) {
            function e(e) {
              return n.apply(this, arguments);
            }
            return (
              (e.toString = function () {
                return n.toString();
              }),
              e
            );
          })(function (n) {
            return Page(ae(n));
          }),
        };
        (zn = ce.App), (Qn = ce.Page);
      } else
        (Xn = App),
          (App = function (n) {
            ie(n), Xn(n);
          }),
          (Zn = Page),
          (Page = function (n) {
            ae(n), Zn(n);
          }),
          (ne = Component),
          (Component = function (n) {
            var e = n.methods;
            e && ae(e), ne(n);
          }),
          (zn = App),
          (Qn = Page);
      var se = Component;
    })(),
    i
  );
};
