require(["jquery"],function(a){var p=function(){var b='\x3ca href\x3d"#" id\x3d"feedback-button" class\x3d"feedback-button"\x3eFeedback\x3c/a\x3e\x3cdiv id\x3d"fade-bg" class\x3d"feedback-form-fade-bg" style\x3d"display: none;"\x3e\x3c/div\x3e\x3cdiv id\x3d"feedback-form-loading" class\x3d"feedback-form-loading" tabindex\x3d"0" style\x3d"display: none;"\x3e\x3c/div\x3e';a("body").append(b)},l=function(){a("#fade-bg").show();a("#feedback-form-loading").show()},m=function(){a("#fade-bg").hide();a("#feedback-form-loading").hide()},
t=function(){l();var b=XWiki.Model.serialize(XWiki.currentDocument.documentReference);b=(new XWiki.Document("FeedbackForm","HLSCode")).getURL("get","action\x3dloadFeedbackForm\x26reference\x3d"+encodeURIComponent(b));a.get(b+"\x26language\x3dde",function(d){a("#feedbackformModal").remove();a("body").append(d);var c=a("#feedbackformModal"),e=a("#feedbackForm");c.modal();a(e).submit(function(n){var g=!0,f=a("#feedbackFile");if(0<f.get(0).files.length){var h=f.get(0).files[0].name;h=h.substr(h.lastIndexOf(".")+
1);var q=["jpg","jpeg","png","pdf"];5242880<f.get(0).files[0].size||-1==a.inArray(h,q)?(f.get(0).setCustomValidity("Es sind nur jpeg-, png- und pdf-Formate erlaubt und die Dateigr\u00f6\u00dfe darf 5 MB nicht \u00fcberschreiten!"),f.get(0).reportValidity(),g=!1):f.get(0).setCustomValidity("")}g&&r(e,c);n.preventDefault()})}).always(function(){m()})},k=function(b,d,c){a(".modal-body",b).html(a("\x3cdiv/\x3e").addClass("box "+d+"message").html(c))},r=function(b,d){b=new FormData(b[0]);b.append("pageURL",
window.location.href);var c=XWiki.Model.serialize(XWiki.currentDocument.documentReference);c=(new XWiki.Document("FeedbackForm","HLSCode")).getURL("get","action\x3dsendFeedback\x26xpage\x3dplain\x26outputSyntax\x3dplain\x26reference\x3d"+encodeURIComponent(c));c+="\x26language\x3dde";l();a.ajax({url:c,type:"post",data:b,contentType:!1,processData:!1,dataType:"json"}).done(function(e){e?k(d,e.status?"success":"error",e.message):k(d,"error","Unknown error !")}).fail(function(e,n,g){k(d,"error","An error occurred while sending the feedback. Error : "+
g)}).always(function(){a("#submitFeedbackButton").remove();m()})};a(document).ready(function(){p();a(".showFeedbackForm, #feedback-button").click(function(b){b.preventDefault();t()})})});