What kind of Encoding or Encryption is this? How do I decode it?

Viewed 21

So I am trying to make a section similar to this on semrush.com Swiper Js (not able to embed image as new to StackOverflow)

After researching about it, I found that it's a module and to run it on the browser will require Browserling which allows you to use CommonJS style modules in the browser. source - What is (function e(t,n,r){ ...}) in Javascript?

Sample code From Semrush JS

Unminified

!(function(t) {
    var e = {};    

    function n(r) {
        if (e[r]) return e[r].exports;
        var i = (e[r] = {
            i: r,
            l: !1,
            exports: {}
        });
        return t[r].call(i.exports, i, i.exports, n), (i.l = !0), i.exports;
    }
    (n.m = t),
    (n.c = e),
    (n.d = function(t, e, r) {
        n.o(t, e) || Object.defineProperty(t, e, {
            enumerable: !0,
            get: r
        });
    }),
    (n.r = function(t) {
        "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, {
            value: "Module"
        }), Object.defineProperty(t, "__esModule", {
            value: !0
        });
    }),
    (n.t = function(t, e) {
        if ((1 & e && (t = n(t)), 8 & e)) return t;
        if (4 & e && "object" == typeof t && t && t.__esModule) return t;
        var r = Object.create(null);
        if ((n.r(r), Object.defineProperty(r, "default", {
                enumerable: !0,
                value: t
            }), 2 & e && "string" != typeof t))
            for (var i in t)
                n.d(
                    r,
                    i,
                    function(e) {
                        return t[e];
                    }.bind(null, i)
                );
        return r;
    }),
    (n.n = function(t) {
        var e =
            t && t.__esModule ?
            function() {
                return t.default;
            } :
            function() {
                return t;
            };
        return n.d(e, "a", e), e;
    }),
    (n.o = function(t, e) {
        return Object.prototype.hasOwnProperty.call(t, e);
    }),
    (n.p = "/static/"),
    n((n.s = 423));
})({
    1: function(t, e) {
        (t.exports = function(t, e, n) {
            return e in t ? Object.defineProperty(t, e, {
                value: n,
                enumerable: !0,
                configurable: !0,
                writable: !0
            }) : (t[e] = n), t;
        }),
        (t.exports.default = t.exports),
        (t.exports.__esModule = !0);
    },
    10: function(t, e) {
        function n(t, e) {
            for (var n = 0; n < e.length; n++) {
                var r = e[n];
                (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty(t, r.key, r);
            }
        }
        (t.exports = function(t, e, r) {
            return e && n(t.prototype, e), r && n(t, r), t;
        }),
        (t.exports.default = t.exports),
        (t.exports.__esModule = !0);
    },
    100: function(t, e) {
        (t.exports = function(t) {
            if (Array.isArray(t)) return t;
        }),
        (t.exports.default = t.exports),
        (t.exports.__esModule = !0);
    },
    101: function(t, e) {
        (t.exports = function() {
            throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
        }),
        (t.exports.default = t.exports),
        (t.exports.__esModule = !0);
    },
    103: function(t, e, n) {
        "use strict";
        n.d(e, "a", function() {
            return i;
        });
        var r = n(18);    

        function i(t) {
            try {
                for (var e = t, n = [], r = 0, i = 0, s = " > ".length, a = void 0; e && r++ < 5 && !("html" === (a = o(e)) || (r > 1 && i + n.length * s + a.length >= 80));) n.push(a), (i += a.length), (e = e.parentNode);
                return n.reverse().join(" > ");
            } catch (t) {
                return "<unknown>";
            }
        }    

        function o(t) {
            var e,
                n,
                i,
                o,
                s,
                a = t,
                c = [];
            if (!a || !a.tagName) return "";
            if ((c.push(a.tagName.toLowerCase()), a.id && c.push("#" + a.id), (e = a.className) && Object(r.k)(e)))
                for (n = e.split(/\s+/), s = 0; s < n.length; s++) c.push("." + n[s]);
            var u = ["type", "name", "title", "alt"];
            for (s = 0; s < u.length; s++)(i = u[s]), (o = a.getAttribute(i)) && c.push("[" + i + '="' + o + '"]');
            return c.join("");
        }
    },
    11: function(t, e, n) {
        var r = n(99);
        (t.exports = function(t, e) {
            if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
            (t.prototype = Object.create(e && e.prototype, {
                constructor: {
                    value: t,
                    writable: !0,
                    configurable: !0
                }
            })), e && r(t, e);
        }),
        (t.exports.default = t.exports),
        (t.exports.__esModule = !0);
    },

How can I read this file? I want to extract few scripts from the given js file. Mainly the "swiper js" functionality.

0 Answers
Related