!function(e){var r={};function n(t){if(r[t])return r[t].exports;var a=r[t]={i:t,l:!1,exports:{}};return e[t].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=r,n.d=function(e,r,t){n.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:t})},n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,"a",r),r},n.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},n.p="",n(n.s="./js/public-share.js")}({"./js/public-share.js":function(e,r){$(document).ready(function(){var e=$("#isPublic").val(),r=$("#mimetype").val(),n=$("#filesize").val();if(e&&"text/markdown"===r&&n<524288){var t=$("#sharingToken").val(),a=OC.generateUrl("/s/{token}/download",{token:t}),i=$("#imgframe"),o=new marked.Renderer;o.link=function(e,r,n){try{var t=decodeURIComponent(unescape(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return""}if(0!==t.indexOf("http:")&&0!==t.indexOf("https:"))return"";var a='<a href="'+e+'" rel="noreferrer noopener"';return r&&(a+=' title="'+r+'"'),a+=">"+n+"</a>"},o.image=function(e,r,n){return n||r},o.blockquote=function(e){return e},i.addClass("icon-loading").children().remove(),$.get(a).success(function(e){i.removeClass("icon-loading").addClass("preview formatted-text").html(DOMPurify.sanitize(marked(e,{renderer:o,gfm:!1,breaks:!1,pedantic:!1,smartLists:!0,smartypants:!1}),{SAFE_FOR_JQUERY:!0}))}).fail(function(e){i.removeClass("icon-loading")})}else if(e&&"text"===r.substr(0,r.indexOf("/"))){(i=$("#imgframe")).addClass("icon-loading").children().remove();var s=$(window).height()-350;s=Math.max(200,s);t=$("#sharingToken").val();$.ajax({url:OC.generateUrl("/apps/files_texteditor/public/{token}",{token:t}),headers:{Range:"bytes=0-524288"}}).success(function(e){var r=$("<div/>").addClass("text-preview default-overridden");r.text(e),i.removeClass("icon-loading").addClass("preview").append(r);var n=r.height();if(e.length>524289){var t=$("<div/>").addClass("ellipsis");t.html("(&#133;)"),t.appendTo("#imgframe")}n>s&&r.height(s)})}})}});
//# sourceMappingURL=public-share.js.map