(function() {
    "use strict";

    document.addEventListener('appReady.EappsInstagramTestimonials', function() {
        var widgets = document.querySelectorAll('[data-elfsight-instagram-testimonials-options]');

        Array.prototype.slice.call(widgets).forEach(function(widget) {
            var version = widget.getAttribute('data-elfsight-instagram-testimonials-version');
            var options = widget.getAttribute('data-elfsight-instagram-testimonials-options');
            var data = JSON.parse(decodeURIComponent(options));

            window.eappsInstagramTestimonials(widget, data);

            widget.removeAttribute('data-elfsight-instagram-testimonials-options');
            widget.removeAttribute('data-elfsight-instagram-testimonials-version');

            widget.data = {
                options: data,
                version: version
            };
        });
    });

    //= ../app/app/dist/instagram-testimonials.js
})();