1"use strict";(self.webpackChunknodebb=self.webpackChunknodebb||[]).push([[33085],{43103:((d,g,h)=>{var p,m;p=[h(29930)],m=(function(c){const l={};return l.init=function(a){const t=a.uploadFormEl;if(t.length&&(t.attr("action",config.relative_path+a.route),a.dragDropAreaEl&&l.handleDragDrop({container:a.dragDropAreaEl,callback:function(n){l.ajaxSubmit({uploadForm:t,upload:n,callback:a.callback})}}),a.pasteEl&&l.handlePaste({container:a.pasteEl,callback:function(n){l.ajaxSubmit({uploadForm:t,upload:n,callback:a.callback})}}),a.uploadBtnEl)){const n=t.find('input[name="files[]"]');a.uploadBtnEl.on("click",function(){return n.trigger("click"),!1}),n.on("change",function(e){const r=(e.target||{}).files||($(this).val()?[{name:$(this).val(),type:utils.fileMimeType($(this).val())}]:null);r&&l.ajaxSubmit({uploadForm:t,upload:{files:r,fileNames:Array.from(r).map(o=>o.name)},callback:a.callback})})}},l.handleDragDrop=function(a){let t=!1;const n=a.container,e=a.container.find(".imagedrop");n.on("dragenter",function(){t||(e.css("top","0px"),e.css("height",n.height()+"px"),e.css("line-height",n.height()+"px"),e.show(),e.on("dragleave",function(){e.hide(),e.off("dragleave")}))}),e.on("drop",function(i){i.preventDefault();const f=i.originalEvent.dataTransfer.files;if(f.length){let u;if(window.FormData){u=new FormData;for(var s=0;s<f.length;++s)u.append("files[]",f[s],f[s].name)}a.callback({files:f,formData:u})}return e.hide(),!1});function r(o){return o.preventDefault(),!1}$(document).off("dragstart").on("dragstart",function(){t=!0}).off("dragend").on("dragend, mouseup",function(){t=!1}),e.on("dragover",r),e.on("dragenter",r)},l.handlePaste=function(a){a.container.on("paste",function(n){const e=(n.clipboardData||n.originalEvent.clipboardData||{}).items,r=[],o=[];let i=null;window.FormData&&(i=new FormData),[].forEach.call(e,function(f){const s=f.getAsFile();if(s){const u=utils.generateUUID()+"-"+s.name;i&&i.append("files[]",s,u),r.push(s),o.push(u)}}),r.length&&a.callback({files:r,fileNames:o,formData:i})})},l.ajaxSubmit=function(a){const t=[...a.upload.files];for(let e=0;e<t.length;++e){const r=t[e].type.match(/image./);if(r&&!app.user.privileges["upload:post:image"]||!r&&!app.user.privileges["upload:post:file"])return c.error("[[error:no-privileges]]");if(!app.user.isAdmin&&t[e].size>parseInt(config.maximumFileSize,10)*1024)return a.uploadForm[0].reset(),c.error("[[error:file-too-big, "+config.maximumFileSize+"]]")}const n=Date.now();a.uploadForm.off("submit").on("submit",function(){return $(this).ajaxSubmit({headers:{"x-csrf-token":config.csrf_token},resetForm:!0,clearForm:!0,formData:a.upload.formData,error:function(e){let r=e.responseJSON&&(e.responseJSON.error||e.responseJSON.status&&e.responseJSON.status.message)||"[[error:parse-error]]";
1e&&e.status===413&&(r=e.statusText||"Request Entity Too Large"),c.error(r),c.remove(n)},uploadProgress:function(e,r,o,i){c.alert({alert_id:n,message:"[[modules:composer.uploading, "+i+"%]]"})},success:function(e){const r=e.response.images;if(r&&r.length)for(var o=0;o<r.length;++o)r[o].filename=t[o].name,r[o].isImage=/image./.test(t[o].type);a.callback(r)},complete:function(){a.uploadForm[0].reset(),setTimeout(c.remove,100,n)}}),!1}),a.uploadForm.submit()},l}).apply(g,p),m!==void 0&&(d.exports=m)})}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.