var _____WB$wombat$assign$function_____=function(e){return self._wb_wombat&&self._wb_wombat.local_init&&self._wb_wombat.local_init(e)||self[e]};self.__WB_pmw||(self.__WB_pmw=function(e){return this.__WB_source=e,this});{let e=_____WB$wombat$assign$function_____("window");_____WB$wombat$assign$function_____("self"),_____WB$wombat$assign$function_____("document"),_____WB$wombat$assign$function_____("location"),_____WB$wombat$assign$function_____("top"),_____WB$wombat$assign$function_____("parent"),_____WB$wombat$assign$function_____("frames"),_____WB$wombat$assign$function_____("opener");!function(e){"use strict";var i=function(i,t){if(this.$element=e(i),this.type=this.$element.data("uploadtype")||(this.$element.find(".thumbnail").length>0?"image":"file"),this.$input=this.$element.find(":file"),0!==this.$input.length){this.name=this.$input.attr("name")||t.name,this.$hidden=this.$element.find('input[type=hidden][name="'+this.name+'"]'),0===this.$hidden.length&&(this.$hidden=e('<input type="hidden" />'),this.$element.prepend(this.$hidden)),this.$preview=this.$element.find(".fileupload-preview");var s=this.$preview.css("height");"inline"!=this.$preview.css("display")&&"0px"!=s&&"none"!=s&&this.$preview.css("line-height",s),this.original={exists:this.$element.hasClass("fileupload-exists"),preview:this.$preview.html(),hiddenVal:this.$hidden.val()},this.$remove=this.$element.find('[data-dismiss="fileupload"]'),this.$element.find('[data-trigger="fileupload"]').on("click.fileupload",e.proxy(this.trigger,this)),this.listen()}};i.prototype={listen:function(){this.$input.on("change.fileupload",e.proxy(this.change,this)),e(this.$input[0].form).on("reset.fileupload",e.proxy(this.reset,this)),this.$remove&&this.$remove.on("click.fileupload",e.proxy(this.clear,this))},change:function(e,i){var t=void 0!==e.target.files?e.target.files[0]:e.target.value?{name:e.target.value.replace(/^.+\\/,"")}:null;if("clear"!==i)if(t)if(this.$hidden.val(""),this.$hidden.attr("name",""),this.$input.attr("name",this.name),"image"===this.type&&this.$preview.length>0&&(void 0!==t.type?t.type.match("image.*"):t.name.match("\\.(gif|png|jpe?g)$"))&&"undefined"!=typeof FileReader){var s=new FileReader,a=this.$preview,n=this.$element;s.onload=function(e){a.html('<img src="'+e.target.result+'" '+("none"!=a.css("max-height")?'style="max-height: '+a.css("max-height")+';"':"")+" />"),n.addClass("fileupload-exists").removeClass("fileupload-new")},s.readAsDataURL(t)}else this.$preview.text(t.name),this.$element.addClass("fileupload-exists").removeClass("fileupload-new");else this.clear()},clear:function(i){if(this.$hidden.val(""),this.$hidden.attr("name",this.name),this.$input.attr("name",""),e.browser.msie){var t=this.$input.clone(!0);this.$input.after(t),this.$input.remove(),this.$input=t}else this.$input.val("");this.$preview.html(""),this.$element.addClass("fileupload-new").removeClass("fileupload-exists"),i&&(this.$input.trigger("change",["clear"]),i.preventDefault())},reset:function(e){this.clear(),this.$hidden.val(this.original.hiddenVal),this.$preview.html(this.original.preview),this.original.exists?this.$element.addClass("fileupload-exists").removeClass("fileupload-new"):this.$element.addClass("fileupload-new").removeClass("fileupload-exists")},trigger:function(e){this.$input.trigger("click"),e.preventDefault()}},e.fn.fileupload=function(t){return this.each((function(){var s=e(this),a=s.data("fileupload");a||s.data("fileupload",a=new i(this,t)),"string"==typeof t&&a[t]()}))},e.fn.fileupload.Constructor=i,e((function(){e("body").on("click.fileupload.data-api",'[data-provides="fileupload"]',(function(i){var t=e(this);if(!t.data("fileupload")){t.fileupload(t.data());var s=e(i.target).is("[data-dismiss=fileupload],[data-trigger=fileupload]")?e(i.target):e(i.target).parents("[data-dismiss=fileupload],[data-trigger=fileupload]").first();s.length>0&&(s.trigger("click.fileupload"),i.preventDefault())}}))}))}(e.jQuery)}