tinymce.PluginManager.add("b2evo_attachments",function(a){function e(){var t=a.getParam("collection"),e=a.getParam("target_ID"),n=a.getParam("rest_url");tinymce.util.XHR.send({url:n+"?api_version=1&api_request=collections/"+t+"/items/"+e,success:function(t){var e=tinymce.util.JSON.parse(t).attachments;a.settings.attachments=[],tinymce.each(e,function(t){a.settings.attachments.push(t)}),a.fire("attachmentsLoaded")}})}void 0!==a.settings.target_ID&&(void 0===a.settings.attachments&&(a.settings.attachments=[]),document.addEventListener("b2evoAttachmentsChanged",function(t){e()}),e())});