// jQuery Mask Plugin v1.14.8
// github.com/igorescobar/jQuery-Mask-Plugin
var $jscomp = {
  scope: {},
  findInternal: function (a, f, c) {
    a instanceof String && (a = String(a));
    for (var l = a.length, g = 0; g < l; g++) {
      var b = a[g];
      if (f.call(c, b, g, a)) return { i: g, v: b };
    }
    return { i: -1, v: void 0 };
  },
};
$jscomp.defineProperty =
  "function" == typeof Object.defineProperties
    ? Object.defineProperty
    : function (a, f, c) {
        if (c.get || c.set)
          throw new TypeError("ES3 does not support getters and setters.");
        a != Array.prototype && a != Object.prototype && (a[f] = c.value);
      };
$jscomp.getGlobal = function (a) {
  return "undefined" != typeof window && window === a
    ? a
    : "undefined" != typeof global && null != global
    ? global
    : a;
};
$jscomp.global = $jscomp.getGlobal(this);
$jscomp.polyfill = function (a, f, c, l) {
  if (f) {
    c = $jscomp.global;
    a = a.split(".");
    for (l = 0; l < a.length - 1; l++) {
      var g = a[l];
      g in c || (c[g] = {});
      c = c[g];
    }
    a = a[a.length - 1];
    l = c[a];
    f = f(l);
    f != l &&
      null != f &&
      $jscomp.defineProperty(c, a, {
        configurable: !0,
        writable: !0,
        value: f,
      });
  }
};
$jscomp.polyfill(
  "Array.prototype.find",
  function (a) {
    return a
      ? a
      : function (a, c) {
          return $jscomp.findInternal(this, a, c).v;
        };
  },
  "es6-impl",
  "es3"
);
(function (a, f, c) {
  "function" === typeof define && define.amd
    ? define(["jquery"], a)
    : "object" === typeof exports
    ? (module.exports = a(require("jquery")))
    : a(f || c);
})(
  function (a) {
    var f = function (b, h, e) {
      var d = {
        invalid: [],
        getCaret: function () {
          try {
            var a,
              n = 0,
              h = b.get(0),
              e = document.selection,
              k = h.selectionStart;
            if (e && -1 === navigator.appVersion.indexOf("MSIE 10"))
              (a = e.createRange()),
                a.moveStart("character", -d.val().length),
                (n = a.text.length);
            else if (k || "0" === k) n = k;
            return n;
          } catch (A) {}
        },
        setCaret: function (a) {
          try {
            if (b.is(":focus")) {
              var p,
                d = b.get(0);
              d.setSelectionRange
                ? d.setSelectionRange(a, a)
                : ((p = d.createTextRange()),
                  p.collapse(!0),
                  p.moveEnd("character", a),
                  p.moveStart("character", a),
                  p.select());
            }
          } catch (z) {}
        },
        events: function () {
          b.on("keydown.mask", function (a) {
            b.data("mask-keycode", a.keyCode || a.which);
            b.data("mask-previus-value", b.val());
          })
            .on(
              a.jMaskGlobals.useInput ? "input.mask" : "keyup.mask",
              d.behaviour
            )
            .on("paste.mask drop.mask", function () {
              setTimeout(function () {
                b.keydown().keyup();
              }, 100);
            })
            .on("change.mask", function () {
              b.data("changed", !0);
            })
            .on("blur.mask", function () {
              c === d.val() || b.data("changed") || b.trigger("change");
              b.data("changed", !1);
            })
            .on("blur.mask", function () {
              c = d.val();
            })
            .on("focus.mask", function (b) {
              !0 === e.selectOnFocus && a(b.target).select();
            })
            .on("focusout.mask", function () {
              e.clearIfNotMatch && !g.test(d.val()) && d.val("");
            });
        },
        getRegexMask: function () {
          for (var a = [], b, d, e, k, c = 0; c < h.length; c++)
            (b = m.translation[h.charAt(c)])
              ? ((d = b.pattern.toString().replace(/.{1}$|^.{1}/g, "")),
                (e = b.optional),
                (b = b.recursive)
                  ? (a.push(h.charAt(c)),
                    (k = { digit: h.charAt(c), pattern: d }))
                  : a.push(e || b ? d + "?" : d))
              : a.push(h.charAt(c).replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"));
          a = a.join("");
          k &&
            (a = a
              .replace(
                new RegExp("(" + k.digit + "(.*" + k.digit + ")?)"),
                "($1)?"
              )
              .replace(new RegExp(k.digit, "g"), k.pattern));
          return new RegExp(a);
        },
        destroyEvents: function () {
          b.off(
            "input keydown keyup paste drop blur focusout "
              .split(" ")
              .join(".mask ")
          );
        },
        val: function (a) {
          var d = b.is("input") ? "val" : "text";
          if (0 < arguments.length) {
            if (b[d]() !== a) b[d](a);
            d = b;
          } else d = b[d]();
          return d;
        },
        calculateCaretPosition: function (a, d) {
          var h = d.length,
            e = b.data("mask-previus-value"),
            k = e.length;
          8 === b.data("mask-keycode") && e !== d
            ? (a -= d.slice(0, a).length - e.slice(0, a).length)
            : e !== d &&
              (a =
                a >= k ? h : a + (d.slice(0, a).length - e.slice(0, a).length));
          return a;
        },
        behaviour: function (e) {
          e = e || window.event;
          d.invalid = [];
          var h = b.data("mask-keycode");
          if (-1 === a.inArray(h, m.byPassKeys)) {
            var h = d.getMasked(),
              c = d.getCaret();
            setTimeout(
              function (a, b) {
                d.setCaret(d.calculateCaretPosition(a, b));
              },
              10,
              c,
              h
            );
            d.val(h);
            d.setCaret(c);
            return d.callbacks(e);
          }
        },
        getMasked: function (a, b) {
          var c = [],
            p = void 0 === b ? d.val() : b + "",
            k = 0,
            g = h.length,
            f = 0,
            l = p.length,
            n = 1,
            v = "push",
            w = -1,
            r,
            u;
          e.reverse
            ? ((v = "unshift"),
              (n = -1),
              (r = 0),
              (k = g - 1),
              (f = l - 1),
              (u = function () {
                return -1 < k && -1 < f;
              }))
            : ((r = g - 1),
              (u = function () {
                return k < g && f < l;
              }));
          for (var y; u(); ) {
            var x = h.charAt(k),
              t = p.charAt(f),
              q = m.translation[x];
            if (q)
              t.match(q.pattern)
                ? (c[v](t),
                  q.recursive &&
                    (-1 === w ? (w = k) : k === r && (k = w - n),
                    r === w && (k -= n)),
                  (k += n))
                : t === y
                ? (y = void 0)
                : q.optional
                ? ((k += n), (f -= n))
                : q.fallback
                ? (c[v](q.fallback), (k += n), (f -= n))
                : d.invalid.push({ p: f, v: t, e: q.pattern }),
                (f += n);
            else {
              if (!a) c[v](x);
              t === x ? (f += n) : (y = x);
              k += n;
            }
          }
          p = h.charAt(r);
          g !== l + 1 || m.translation[p] || c.push(p);
          return c.join("");
        },
        callbacks: function (a) {
          var f = d.val(),
            p = f !== c,
            g = [f, a, b, e],
            k = function (a, b, d) {
              "function" === typeof e[a] && b && e[a].apply(this, d);
            };
          k("onChange", !0 === p, g);
          k("onKeyPress", !0 === p, g);
          k("onComplete", f.length === h.length, g);
          k("onInvalid", 0 < d.invalid.length, [f, a, b, d.invalid, e]);
        },
      };
      b = a(b);
      var m = this,
        c = d.val(),
        g;
      h = "function" === typeof h ? h(d.val(), void 0, b, e) : h;
      m.mask = h;
      m.options = e;
      m.remove = function () {
        var a = d.getCaret();
        d.destroyEvents();
        d.val(m.getCleanVal());
        d.setCaret(a);
        return b;
      };
      m.getCleanVal = function () {
        return d.getMasked(!0);
      };
      m.getMaskedVal = function (a) {
        return d.getMasked(!1, a);
      };
      m.init = function (c) {
        c = c || !1;
        e = e || {};
        m.clearIfNotMatch = a.jMaskGlobals.clearIfNotMatch;
        m.byPassKeys = a.jMaskGlobals.byPassKeys;
        m.translation = a.extend({}, a.jMaskGlobals.translation, e.translation);
        m = a.extend(!0, {}, m, e);
        g = d.getRegexMask();
        if (c) d.events(), d.val(d.getMasked());
        else {
          e.placeholder && b.attr("placeholder", e.placeholder);
          b.data("mask") && b.attr("autocomplete", "off");
          c = 0;
          for (var f = !0; c < h.length; c++) {
            var l = m.translation[h.charAt(c)];
            if (l && l.recursive) {
              f = !1;
              break;
            }
          }
          f && b.attr("maxlength", h.length);
          d.destroyEvents();
          d.events();
          c = d.getCaret();
          d.val(d.getMasked());
          d.setCaret(c);
        }
      };
      m.init(!b.is("input"));
    };
    a.maskWatchers = {};
    var c = function () {
        var b = a(this),
          c = {},
          e = b.attr("data-mask");
        b.attr("data-mask-reverse") && (c.reverse = !0);
        b.attr("data-mask-clearifnotmatch") && (c.clearIfNotMatch = !0);
        "true" === b.attr("data-mask-selectonfocus") && (c.selectOnFocus = !0);
        if (l(b, e, c)) return b.data("mask", new f(this, e, c));
      },
      l = function (b, c, e) {
        e = e || {};
        var d = a(b).data("mask"),
          h = JSON.stringify;
        b = a(b).val() || a(b).text();
        try {
          return (
            "function" === typeof c && (c = c(b)),
            "object" !== typeof d || h(d.options) !== h(e) || d.mask !== c
          );
        } catch (u) {}
      },
      g = function (a) {
        var b = document.createElement("div"),
          c;
        a = "on" + a;
        c = a in b;
        c || (b.setAttribute(a, "return;"), (c = "function" === typeof b[a]));
        return c;
      };
    a.fn.mask = function (b, c) {
      c = c || {};
      var e = this.selector,
        d = a.jMaskGlobals,
        h = d.watchInterval,
        d = c.watchInputs || d.watchInputs,
        g = function () {
          if (l(this, b, c)) return a(this).data("mask", new f(this, b, c));
        };
      a(this).each(g);
      e &&
        "" !== e &&
        d &&
        (clearInterval(a.maskWatchers[e]),
        (a.maskWatchers[e] = setInterval(function () {
          a(document).find(e).each(g);
        }, h)));
      return this;
    };
    a.fn.masked = function (a) {
      return this.data("mask").getMaskedVal(a);
    };
    a.fn.unmask = function () {
      clearInterval(a.maskWatchers[this.selector]);
      delete a.maskWatchers[this.selector];
      return this.each(function () {
        var b = a(this).data("mask");
        b && b.remove().removeData("mask");
      });
    };
    a.fn.cleanVal = function () {
      return this.data("mask").getCleanVal();
    };
    a.applyDataMask = function (b) {
      b = b || a.jMaskGlobals.maskElements;
      (b instanceof a ? b : a(b)).filter(a.jMaskGlobals.dataMaskAttr).each(c);
    };
    g = {
      maskElements: "input,td,span,div",
      dataMaskAttr: "*[data-mask]",
      dataMask: !0,
      watchInterval: 300,
      watchInputs: !0,
      useInput: !/Chrome\/28/.test(window.navigator.userAgent) && g("input"),
      watchDataMask: !1,
      byPassKeys: [9, 16, 17, 18, 36, 37, 38, 39, 40, 91],
      translation: {
        0: { pattern: /\d/ },
        9: { pattern: /\d/, optional: !0 },
        "#": { pattern: /\d/, recursive: !0 },
        A: { pattern: /[a-zA-Z0-9]/ },
        S: { pattern: /[a-zA-Z]/ },
      },
    };
    a.jMaskGlobals = a.jMaskGlobals || {};
    g = a.jMaskGlobals = a.extend(!0, {}, g, a.jMaskGlobals);
    g.dataMask && a.applyDataMask();
    setInterval(function () {
      a.jMaskGlobals.watchDataMask && a.applyDataMask();
    }, g.watchInterval);
  },
  window.jQuery,
  window.Zepto
);

(function () {
  var t,
    e,
    n,
    r,
    a,
    i,
    o,
    l,
    u,
    s,
    c,
    h,
    p,
    f,
    g,
    v,
    d,
    m,
    y,
    C,
    T,
    w,
    $,
    D,
    S = [].slice,
    k =
      [].indexOf ||
      function (t) {
        for (var e = 0, n = this.length; e < n; e++)
          if (e in this && this[e] === t) return e;
        return -1;
      };
  (t = window.jQuery || window.Zepto || window.$),
    (t.payment = {}),
    (t.payment.fn = {}),
    (t.fn.payment = function () {
      var e, n;
      return (
        (n = arguments[0]),
        (e = 2 <= arguments.length ? S.call(arguments, 1) : []),
        t.payment.fn[n].apply(this, e)
      );
    }),
    (a = /(\d{1,4})/g),
    (t.payment.cards = r =
      [
        {
          type: "maestro",
          patterns: [5018, 502, 503, 506, 56, 58, 639, 6220, 67],
          format: a,
          length: [12, 13, 14, 15, 16, 17, 18, 19],
          cvcLength: [3],
          luhn: !0,
        },
        {
          type: "forbrugsforeningen",
          patterns: [600],
          format: a,
          length: [16],
          cvcLength: [3],
          luhn: !0,
        },
        {
          type: "dankort",
          patterns: [5019],
          format: a,
          length: [16],
          cvcLength: [3],
          luhn: !0,
        },
        {
          type: "visa",
          patterns: [4],
          format: a,
          length: [13, 16],
          cvcLength: [3],
          luhn: !0,
        },
        {
          type: "mastercard",
          patterns: [51, 52, 53, 54, 55, 22, 23, 24, 25, 26, 27],
          format: a,
          length: [16],
          cvcLength: [3],
          luhn: !0,
        },
        {
          type: "amex",
          patterns: [34, 37],
          format: /(\d{1,4})(\d{1,6})?(\d{1,5})?/,
          length: [15],
          cvcLength: [3, 4],
          luhn: !0,
        },
        {
          type: "dinersclub",
          patterns: [30, 36, 38, 39],
          format: /(\d{1,4})(\d{1,6})?(\d{1,4})?/,
          length: [14],
          cvcLength: [3],
          luhn: !0,
        },
        {
          type: "discover",
          patterns: [60, 64, 65, 622],
          format: a,
          length: [16],
          cvcLength: [3],
          luhn: !0,
        },
        {
          type: "unionpay",
          patterns: [62, 88],
          format: a,
          length: [16, 17, 18, 19],
          cvcLength: [3],
          luhn: !1,
        },
        {
          type: "jcb",
          patterns: [35],
          format: a,
          length: [16],
          cvcLength: [3],
          luhn: !0,
        },
      ]),
    (e = function (t) {
      var e, n, a, i, o, l, u, s;
      for (t = (t + "").replace(/\D/g, ""), i = 0, l = r.length; i < l; i++)
        for (e = r[i], s = e.patterns, o = 0, u = s.length; o < u; o++)
          if (((a = s[o]), (n = a + ""), t.substr(0, n.length) === n)) return e;
    }),
    (n = function (t) {
      var e, n, a;
      for (n = 0, a = r.length; n < a; n++)
        if (((e = r[n]), e.type === t)) return e;
    }),
    (p = function (t) {
      var e, n, r, a, i, o;
      for (
        r = !0, a = 0, n = (t + "").split("").reverse(), i = 0, o = n.length;
        i < o;
        i++
      )
        (e = n[i]),
          (e = parseInt(e, 10)),
          (r = !r) && (e *= 2),
          e > 9 && (e -= 9),
          (a += e);
      return a % 10 === 0;
    }),
    (h = function (t) {
      var e;
      return (
        (null != t.prop("selectionStart") &&
          t.prop("selectionStart") !== t.prop("selectionEnd")) ||
        !(
          null ==
            ("undefined" != typeof document &&
            null !== document &&
            null != (e = document.selection)
              ? e.createRange
              : void 0) || !document.selection.createRange().text
        )
      );
    }),
    ($ = function (t, e) {
      var n, r, a, i, o, l;
      try {
        r = e.prop("selectionStart");
      } catch (t) {
        (i = t), (r = null);
      }
      if (((o = e.val()), e.val(t), null !== r && e.is(":focus")))
        return (
          r === o.length && (r = t.length),
          o !== t &&
            ((l = o.slice(r - 1, +r + 1 || 9e9)),
            (n = t.slice(r - 1, +r + 1 || 9e9)),
            (a = t[r]),
            /\d/.test(a) && l === "" + a + " " && n === " " + a && (r += 1)),
          e.prop("selectionStart", r),
          e.prop("selectionEnd", r)
        );
    }),
    (m = function (t) {
      var e, n, r, a, i, o, l, u;
      for (
        null == t && (t = ""),
          r = "０１２３４５６７８９",
          a = "0123456789",
          o = "",
          e = t.split(""),
          l = 0,
          u = e.length;
        l < u;
        l++
      )
        (n = e[l]), (i = r.indexOf(n)), i > -1 && (n = a[i]), (o += n);
      return o;
    }),
    (d = function (e) {
      var n;
      return (
        (n = t(e.currentTarget)),
        setTimeout(function () {
          var t;
          return (t = n.val()), (t = m(t)), (t = t.replace(/\D/g, "")), $(t, n);
        })
      );
    }),
    (g = function (e) {
      var n;
      return (
        (n = t(e.currentTarget)),
        setTimeout(function () {
          var e;
          return (
            (e = n.val()),
            (e = m(e)),
            (e = t.payment.formatCardNumber(e)),
            $(e, n)
          );
        })
      );
    }),
    (l = function (n) {
      var r, a, i, o, l, u, s;
      if (
        ((i = String.fromCharCode(n.which)),
        /^\d+$/.test(i) &&
          ((r = t(n.currentTarget)),
          (s = r.val()),
          (a = e(s + i)),
          (o = (s.replace(/\D/g, "") + i).length),
          (u = 16),
          a && (u = a.length[a.length.length - 1]),
          !(
            o >= u ||
            (null != r.prop("selectionStart") &&
              r.prop("selectionStart") !== s.length)
          )))
      )
        return (
          (l =
            a && "amex" === a.type
              ? /^(\d{4}|\d{4}\s\d{6})$/
              : /(?:^|\s)(\d{4})$/),
          l.test(s)
            ? (n.preventDefault(),
              setTimeout(function () {
                return r.val(s + " " + i);
              }))
            : l.test(s + i)
            ? (n.preventDefault(),
              setTimeout(function () {
                return r.val(s + i + " ");
              }))
            : void 0
        );
    }),
    (i = function (e) {
      var n, r;
      if (
        ((n = t(e.currentTarget)),
        (r = n.val()),
        8 === e.which &&
          (null == n.prop("selectionStart") ||
            n.prop("selectionStart") === r.length))
      )
        return /\d\s$/.test(r)
          ? (e.preventDefault(),
            setTimeout(function () {
              return n.val(r.replace(/\d\s$/, ""));
            }))
          : /\s\d?$/.test(r)
          ? (e.preventDefault(),
            setTimeout(function () {
              return n.val(r.replace(/\d$/, ""));
            }))
          : void 0;
    }),
    (v = function (e) {
      var n;
      return (
        (n = t(e.currentTarget)),
        setTimeout(function () {
          var e;
          return (
            (e = n.val()), (e = m(e)), (e = t.payment.formatExpiry(e)), $(e, n)
          );
        })
      );
    }),
    (u = function (e) {
      var n, r, a;
      if (((r = String.fromCharCode(e.which)), /^\d+$/.test(r)))
        return (
          (n = t(e.currentTarget)),
          (a = n.val() + r),
          /^\d$/.test(a) && "0" !== a && "1" !== a
            ? (e.preventDefault(),
              setTimeout(function () {
                return n.val("0" + a + " / ");
              }))
            : /^\d\d$/.test(a)
            ? (e.preventDefault(),
              setTimeout(function () {
                var t, e;
                return (
                  (t = parseInt(a[0], 10)),
                  (e = parseInt(a[1], 10)),
                  e > 2 && 0 !== t
                    ? n.val("0" + t + " / " + e)
                    : n.val("" + a + " / ")
                );
              }))
            : void 0
        );
    }),
    (s = function (e) {
      var n, r, a;
      if (((r = String.fromCharCode(e.which)), /^\d+$/.test(r)))
        return (
          (n = t(e.currentTarget)),
          (a = n.val()),
          /^\d\d$/.test(a) ? n.val("" + a + " / ") : void 0
        );
    }),
    (c = function (e) {
      var n, r, a;
      if (((a = String.fromCharCode(e.which)), "/" === a || " " === a))
        return (
          (n = t(e.currentTarget)),
          (r = n.val()),
          /^\d$/.test(r) && "0" !== r ? n.val("0" + r + " / ") : void 0
        );
    }),
    (o = function (e) {
      var n, r;
      if (
        ((n = t(e.currentTarget)),
        (r = n.val()),
        8 === e.which &&
          (null == n.prop("selectionStart") ||
            n.prop("selectionStart") === r.length))
      )
        return /\d\s\/\s$/.test(r)
          ? (e.preventDefault(),
            setTimeout(function () {
              return n.val(r.replace(/\d\s\/\s$/, ""));
            }))
          : void 0;
    }),
    (f = function (e) {
      var n;
      return (
        (n = t(e.currentTarget)),
        setTimeout(function () {
          var t;
          return (
            (t = n.val()),
            (t = m(t)),
            (t = t.replace(/\D/g, "").slice(0, 4)),
            $(t, n)
          );
        })
      );
    }),
    (w = function (t) {
      var e;
      return (
        !(!t.metaKey && !t.ctrlKey) ||
        (32 !== t.which &&
          (0 === t.which ||
            t.which < 33 ||
            ((e = String.fromCharCode(t.which)), !!/[\d\s]/.test(e))))
      );
    }),
    (C = function (n) {
      var r, a, i, o;
      if (
        ((r = t(n.currentTarget)),
        (i = String.fromCharCode(n.which)),
        /^\d+$/.test(i) && !h(r))
      )
        return (
          (o = (r.val() + i).replace(/\D/g, "")),
          (a = e(o)),
          a ? o.length <= a.length[a.length.length - 1] : o.length <= 16
        );
    }),
    (T = function (e) {
      var n, r, a;
      if (
        ((n = t(e.currentTarget)),
        (r = String.fromCharCode(e.which)),
        /^\d+$/.test(r) && !h(n))
      )
        return (
          (a = n.val() + r),
          (a = a.replace(/\D/g, "")),
          !(a.length > 6) && void 0
        );
    }),
    (y = function (e) {
      var n, r, a;
      if (
        ((n = t(e.currentTarget)),
        (r = String.fromCharCode(e.which)),
        /^\d+$/.test(r) && !h(n))
      )
        return (a = n.val() + r), a.length <= 4;
    }),
    (D = function (e) {
      var n, a, i, o, l;
      if (
        ((n = t(e.currentTarget)),
        (l = n.val()),
        (o = t.payment.cardType(l) || "unknown"),
        !n.hasClass(o))
      )
        return (
          (a = (function () {
            var t, e, n;
            for (n = [], t = 0, e = r.length; t < e; t++)
              (i = r[t]), n.push(i.type);
            return n;
          })()),
          n.removeClass("unknown"),
          n.removeClass(a.join(" ")),
          n.addClass(o),
          n.toggleClass("identified", "unknown" !== o),
          n.trigger("payment.cardType", o)
        );
    }),
    (t.payment.fn.formatCardCVC = function () {
      return (
        this.on("keypress", w),
        this.on("keypress", y),
        this.on("paste", f),
        this.on("change", f),
        this.on("input", f),
        this
      );
    }),
    (t.payment.fn.formatCardExpiry = function () {
      return (
        this.on("keypress", w),
        this.on("keypress", T),
        this.on("keypress", u),
        this.on("keypress", c),
        this.on("keypress", s),
        this.on("keydown", o),
        this.on("change", v),
        this.on("input", v),
        this
      );
    }),
    (t.payment.fn.formatCardNumber = function () {
      return (
        this.on("keypress", w),
        this.on("keypress", C),
        this.on("keypress", l),
        this.on("keydown", i),
        this.on("keyup", D),
        this.on("paste", g),
        this.on("change", g),
        this.on("input", g),
        this.on("input", D),
        this
      );
    }),
    (t.payment.fn.restrictNumeric = function () {
      return (
        this.on("keypress", w),
        this.on("paste", d),
        this.on("change", d),
        this.on("input", d),
        this
      );
    }),
    (t.payment.fn.cardExpiryVal = function () {
      return t.payment.cardExpiryVal(t(this).val());
    }),
    (t.payment.cardExpiryVal = function (t) {
      var e, n, r, a;
      return (
        (a = t.split(/[\s\/]+/, 2)),
        (e = a[0]),
        (r = a[1]),
        2 === (null != r ? r.length : void 0) &&
          /^\d+$/.test(r) &&
          ((n = new Date().getFullYear()),
          (n = n.toString().slice(0, 2)),
          (r = n + r)),
        (e = parseInt(e, 10)),
        (r = parseInt(r, 10)),
        { month: e, year: r }
      );
    }),
    (t.payment.validateCardNumber = function (t) {
      var n, r;
      return (
        (t = (t + "").replace(/\s+|-/g, "")),
        !!/^\d+$/.test(t) &&
          ((n = e(t)),
          !!n &&
            ((r = t.length),
            k.call(n.length, r) >= 0 && (n.luhn === !1 || p(t))))
      );
    }),
    (t.payment.validateCardExpiry = function (e, n) {
      var r, a, i;
      return (
        "object" == typeof e &&
          "month" in e &&
          ((i = e), (e = i.month), (n = i.year)),
        !(!e || !n) &&
          ((e = t.trim(e)),
          (n = t.trim(n)),
          !!/^\d+$/.test(e) &&
            !!/^\d+$/.test(n) &&
            1 <= e &&
            e <= 12 &&
            (2 === n.length && (n = n < 70 ? "20" + n : "19" + n),
            4 === n.length &&
              ((a = new Date(n, e)),
              (r = new Date()),
              a.setMonth(a.getMonth() - 1),
              a.setMonth(a.getMonth() + 1, 1),
              a > r)))
      );
    }),
    (t.payment.validateCardCVC = function (e, r) {
      var a, i;
      return (
        (e = t.trim(e)),
        !!/^\d+$/.test(e) &&
          ((a = n(r)),
          null != a
            ? ((i = e.length), k.call(a.cvcLength, i) >= 0)
            : e.length >= 3 && e.length <= 4)
      );
    }),
    (t.payment.cardType = function (t) {
      var n;
      return t ? (null != (n = e(t)) ? n.type : void 0) || null : null;
    }),
    (t.payment.formatCardNumber = function (n) {
      var r, a, i, o;
      return (
        (n = n.replace(/\D/g, "")),
        (r = e(n))
          ? ((i = r.length[r.length.length - 1]),
            (n = n.slice(0, i)),
            r.format.global
              ? null != (o = n.match(r.format))
                ? o.join(" ")
                : void 0
              : ((a = r.format.exec(n)),
                null != a
                  ? (a.shift(),
                    (a = t.grep(a, function (t) {
                      return t;
                    })),
                    a.join(" "))
                  : void 0))
          : n
      );
    }),
    (t.payment.formatExpiry = function (t) {
      var e, n, r, a;
      return (n = t.match(/^\D*(\d{1,2})(\D+)?(\d{1,4})?/))
        ? ((e = n[1] || ""),
          (r = n[2] || ""),
          (a = n[3] || ""),
          a.length > 0
            ? (r = " / ")
            : " /" === r
            ? ((e = e.substring(0, 1)), (r = ""))
            : 2 === e.length || r.length > 0
            ? (r = " / ")
            : 1 === e.length &&
              "0" !== e &&
              "1" !== e &&
              ((e = "0" + e), (r = " / ")),
          e + r + a)
        : "";
    });
}).call(this);
//# sourceMappingURL=jquery.payment.min.js.map
