var DOMAIN = '//embedded-form-lith.wembii.com';

function loadWembiiFormStyle(path) {
    return new Promise(function(resolve) {
        var script = document.createElement("link")
        script.onload = function() {
            resolve()
        }
        script.href = DOMAIN + path
        script.rel = "stylesheet"
        document.getElementsByTagName("head")[0].appendChild(script)
    })
}

function loadWembiiFormScript(path) {
    return new Promise(function(resolve) {
        var script = document.createElement("script")
        script.onload = function() {
            resolve()
        }
        script.src = DOMAIN + path
        document.getElementsByTagName("head")[0].appendChild(script)
    })
}

// Load all styles
["main.36497136.chunk.css"]
    .forEach(file => {
        loadWembiiFormStyle(`/static/css/${file}`);
    });

// Load all scripts
["2.f0872695.chunk.js","main.1781910d.chunk.js"]
    .forEach(file => {
        loadWembiiFormScript(`/static/js/${file}`);
    });

window.loadWembiiForm = function (companyId, formId) {
    window.wembiiFormCompanyId = companyId;
    window.formId = formId;

    var l = [];
    function e(e) {
        for (var r, t, n = e[0], o = e[1], u = e[2], i = 0, f = []; i < n.length; i++) t = n[i], Object.prototype.hasOwnProperty.call(c, t) && c[t] && f.push(c[t][0]), c[t] = 0;
        for (r in o) Object.prototype.hasOwnProperty.call(o, r) && (l[r] = o[r]);
        for (s && s(e); f.length;) f.shift()();
        return p.push.apply(p, u || []), a()
    }

    function a() {
        for (var e, r = 0; r < p.length; r++) {
            for (var t = p[r], n = !0, o = 1; o < t.length; o++) {
                var u = t[o];
                0 !== c[u] && (n = !1)
            }
            n && (p.splice(r--, 1), e = i(i.s = t[0]))
        }
        return e
    }

    var t = {}, c = {1: 0}, p = [];

    function i(e) {
        if (t[e]) return t[e].exports;
        var r = t[e] = {i: e, l: !1, exports: {}};
        return l[e].call(r.exports, r, r.exports, i), r.l = !0, r.exports
    }

    i.m = l, i.c = t, i.d = function (e, r, t) {
        i.o(e, r) || Object.defineProperty(e, r, {enumerable: !0, get: t})
    }, i.r = function (e) {
        "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, {value: "Module"}), Object.defineProperty(e, "__esModule", {value: !0})
    }, i.t = function (r, e) {
        if (1 & e && (r = i(r)), 8 & e) return r;
        if (4 & e && "object" == typeof r && r && r.__esModule) return r;
        var t = Object.create(null);
        if (i.r(t), Object.defineProperty(t, "default", {
            enumerable: !0,
            value: r
        }), 2 & e && "string" != typeof r) for (var n in r) i.d(t, n, function (e) {
            return r[e]
        }.bind(null, n));
        return t
    }, i.n = function (e) {
        var r = e && e.__esModule ? function () {
            return e.default
        } : function () {
            return e
        };
        return i.d(r, "a", r), r
    }, i.o = function (e, r) {
        return Object.prototype.hasOwnProperty.call(e, r)
    }, i.p = "/";
    var r = this["webpackJsonpwembii-react-form"] = this["webpackJsonpwembii-react-form"] || [], n = r.push.bind(r);
    r.push = e, r = r.slice();
    for (var o = 0; o < r.length; o++) e(r[o]);
    var s = n;
    a()
};
