/*!
* Ace v1.3.2
*/
if("undefined"==typeof jQuery)throw new Error("Ace's JavaScript requires jQuery");!function(a,b){var c=function(c,d){function e(a){a.preventDefault(),a.stopPropagation();var b=A.offset(),c=b[o],d=u?a.pageY:a.pageX;d>c+G?(G=d-c-F+I,G>H&&(G=H)):(G=d-c-I,0>G&&(G=0)),m.update_scroll()}function f(b){b.preventDefault(),b.stopPropagation(),bb=ab=u?b.pageY:b.pageX,Q=!0,a("html").off("mousemove.ace_scroll").on("mousemove.ace_scroll",g),a(R).off("mouseup.ace_scroll").on("mouseup.ace_scroll",h),A.addClass("active"),S&&m.$element.trigger("drag.start")}function g(a){a.preventDefault(),a.stopPropagation(),bb=u?a.pageY:a.pageX,bb-ab+G>H?bb=ab+H-G:0>bb-ab+G&&(bb=ab-G),G+=bb-ab,ab=bb,0>G?G=0:G>H&&(G=H),m.update_scroll()}function h(b){b.preventDefault(),b.stopPropagation(),Q=!1,a("html").off(".ace_scroll"),a(R).off(".ace_scroll"),A.removeClass("active"),S&&m.$element.trigger("drag.end"),w&&W&&!Y&&j()}function i(a){var b=+new Date;if(Z&&b-db>1e3){var c=z[t];$!=c&&($=c,_=!0,m.reset(!0)),db=b}w&&W&&(null!=cb&&(clearTimeout(cb),cb=null),A.addClass("not-idle"),Y||1!=a||j())}function j(){null!=cb&&(clearTimeout(cb),cb=null),cb=setTimeout(function(){cb=null,A.removeClass("not-idle")},X)}function k(){A.css("visibility","hidden").addClass("scroll-hover"),N=u?parseInt(A.outerWidth())||0:parseInt(A.outerHeight())||0,A.css("visibility","").removeClass("scroll-hover")}function l(){if(V!==!1){var a=y.offset(),b=a.left,c=a.top;u?M||(b+=y.outerWidth()-N):M||(c+=y.outerHeight()-N),V===!0?A.css({top:parseInt(c),left:parseInt(b)}):"left"===V?A.css("left",parseInt(b)):"top"===V&&A.css("top",parseInt(c))}}var m=this,n=a.extend({},a.fn.ace_scroll.defaults,d);this.size=0,this.lock=!1,this.lock_anyway=!1,this.$element=a(c),this.element=c;var o,p,q,r,s,t,u=!0,v=!1,w=!1,x=!1,y=null,z=null,A=null,B=null,C=null,D=null,E=null,F=0,G=0,H=0,I=0,J=!0,K=!1,L="",M=!1,N=0,O=1,P=!1,Q=!1,R="onmouseup"in window?window:"html",S=n.dragEvent||!1,T=d.scrollEvent||!1,U=n.detached||!1,V=n.updatePos||!1,W=n.hideOnIdle||!1,X=n.hideDelay||1500,Y=!1,Z=n.observeContent||!1,$=0,_=!0;this.create=function(b){if(!x){b&&(n=a.extend({},a.fn.ace_scroll.defaults,b)),this.size=parseInt(this.$element.attr("data-size"))||n.size||200,u=!n.horizontal,o=u?"top":"left",p=u?"height":"width",q=u?"maxHeight":"maxWidth",r=u?"clientHeight":"clientWidth",s=u?"scrollTop":"scrollLeft",t=u?"scrollHeight":"scrollWidth",this.$element.addClass("ace-scroll"),"static"==this.$element.css("position")?(P=this.element.style.position,this.element.style.position="relative"):P=!1;var c=null;U?c=a('
').appendTo("body"):(this.$element.wrapInner(''),this.$element.prepend('')),y=this.$element,U||(y=this.$element.find(".scroll-content").eq(0)),u||y.wrapInner(""),z=y.get(0),U?(A=c,l()):A=this.$element.find(".scroll-track").eq(0),B=A.find(".scroll-bar").eq(0),C=A.get(0),D=B.get(0),E=D.style,u||A.addClass("scroll-hz"),n.styleClass&&(L=n.styleClass,A.addClass(L),M=!!L.match(/scroll\-left|scroll\-top/)),0==N&&(A.show(),k()),A.hide(),A.on("mousedown",e),B.on("mousedown",f),y.on("scroll",function(){J&&(G=parseInt(Math.round(this[s]*O)),E[o]=G+"px"),J=!1,T&&this.$element.trigger("scroll",[z])}),n.mouseWheel&&(this.lock=n.mouseWheelLock,this.lock_anyway=n.lockAnyway,this.$element.on(a.event.special.mousewheel?"mousewheel.ace_scroll":"mousewheel.ace_scroll DOMMouseScroll.ace_scroll",function(b){if(!v){if(i(!0),!w)return!m.lock_anyway;Q&&(Q=!1,a("html").off(".ace_scroll"),a(R).off(".ace_scroll"),S&&m.$element.trigger("drag.end")),b.deltaY=b.deltaY||0;var c=b.deltaY>0||b.originalEvent.detail<0||b.originalEvent.wheelDelta>0?1:-1,d=!1,e=z[r],f=z[s];m.lock||(d=-1==c?z[t]<=f+e:0==f),m.move_bar(!0);var g=parseInt(e/8);return 80>g&&(g=80),g>m.size&&(g=m.size),g+=1,z[s]=f-c*g,d&&!m.lock_anyway}}));var d=ace.vars.touch&&"ace_drag"in a.event.special&&n.touchDrag;if(d){var g="",h=d?"ace_drag":"swipe";this.$element.on(h+".ace_scroll",function(a){if(v)return void(a.retval.cancel=!0);if(i(!0),!w)return void(a.retval.cancel=this.lock_anyway);if(g=a.direction,u&&("up"==g||"down"==g)||!u&&("left"==g||"right"==g)){var b=u?a.dy:a.dx;0!=b&&(Math.abs(b)>20&&d&&(b=2*b),m.move_bar(!0),z[s]=z[s]+b)}})}W&&A.addClass("idle-hide"),Z&&A.on("mouseenter.ace_scroll",function(){Y=!0,i(!1)}).on("mouseleave.ace_scroll",function(){Y=!1,0==Q&&j()}),this.$element.on("mouseenter.ace_scroll touchstart.ace_scroll",function(){_=!0,Z?i(!0):n.hoverReset&&m.reset(!0),A.addClass("scroll-hover")}).on("mouseleave.ace_scroll touchend.ace_scroll",function(){A.removeClass("scroll-hover")}),u||y.children(0).css(p,this.size),y.css(q,this.size),v=!1,x=!0}},this.is_active=function(){return w},this.is_enabled=function(){return!v},this.move_bar=function(a){J=a},this.get_track=function(){return C},this.reset=function(a){if(!v){x||this.create();var b=this.size;if(!a||_){if(_=!1,U){var c=parseInt(Math.round((parseInt(y.css("border-top-width"))+parseInt(y.css("border-bottom-width")))/2.5));b-=c}var d=u?z[t]:b;if(u&&0==d||!u&&0==this.element.scrollWidth)return void A.removeClass("scroll-active");var e=u?b:z.clientWidth;u||y.children(0).css(p,b),y.css(q,this.size),d>e?(w=!0,A.css(p,e).show(),O=parseFloat((e/d).toFixed(5)),F=parseInt(Math.round(e*O)),I=parseInt(Math.round(F/2)),H=e-F,G=parseInt(Math.round(z[s]*O)),E[p]=F+"px",E[o]=G+"px",A.addClass("scroll-active"),0==N&&k(),K||(n.reset&&(z[s]=0,E[o]=0),K=!0),U&&l()):(w=!1,A.hide(),A.removeClass("scroll-active"),y.css(q,""))}}},this.disable=function(){z[s]=0,E[o]=0,v=!0,w=!1,A.hide(),this.$element.addClass("scroll-disabled"),A.removeClass("scroll-active"),y.css(q,"")},this.enable=function(){v=!1,this.$element.removeClass("scroll-disabled")},this.destroy=function(){w=!1,v=!1,x=!1,this.$element.removeClass("ace-scroll scroll-disabled scroll-active"),this.$element.off(".ace_scroll"),U||(u||y.find("> div").children().unwrap(),y.children().unwrap(),y.remove()),A.remove(),P!==!1&&(this.element.style.position=P),null!=cb&&(clearTimeout(cb),cb=null)},this.modify=function(b){b&&(n=a.extend({},n,b)),this.destroy(),this.create(),_=!0,this.reset(!0)},this.update=function(c){c&&(n=a.extend({},n,c)),this.size=c.size||this.size,this.lock=c.mouseWheelLock||this.lock,this.lock_anyway=c.lockAnyway||this.lock_anyway,c.styleClass!=b&&(L&&A.removeClass(L),L=c.styleClass,L&&A.addClass(L),M=!!L.match(/scroll\-left|scroll\-top/))},this.start=function(){z[s]=0},this.end=function(){z[s]=z[t]},this.hide=function(){A.hide()},this.show=function(){A.show()},this.update_scroll=function(){J=!1,E[o]=G+"px",z[s]=parseInt(Math.round(G/O))};var ab=-1,bb=-1,cb=null,db=0;return this.track_size=function(){return 0==N&&k(),N},this.create(),_=!0,this.reset(!0),$=z[t],this};a.fn.ace_scroll=function(d,e){var f,g=this.each(function(){var b=a(this),g=b.data("ace_scroll"),h="object"==typeof d&&d;g||b.data("ace_scroll",g=new c(this,h)),"string"==typeof d&&(f=g[d](e))});return f===b?g:f},a.fn.ace_scroll.defaults={size:200,horizontal:!1,mouseWheel:!0,mouseWheelLock:!1,lockAnyway:!1,styleClass:!1,observeContent:!1,hideOnIdle:!1,hideDelay:1500,hoverReset:!0,reset:!1,dragEvent:!1,touchDrag:!0,touchSwipe:!1,scrollEvent:!1,detached:!1,updatePos:!0}}(window.jQuery),function(a,b){var c=function(b,c){var d=a.extend({},a.fn.ace_colorpicker.defaults,c),e=a(b),f="",g="",h=null,i=[];e.addClass("hide").find("option").each(function(){var a="colorpick-btn",b=this.value.replace(/[^\w\s,#\(\)\.]/g,"");this.value!=b&&(this.value=b),this.selected&&(a+=" selected",g=b),i.push(b),f+=''}).end().on("change.color",function(){e.next().find(".btn-colorpicker").css("background-color",this.value)}).after('");var j=e.next().find(".dropdown-menu");j.on(ace.click_event,function(b){var c=a(b.target);if(!c.is(".colorpick-btn"))return!1;h&&h.removeClass("selected"),h=c,h.addClass("selected");var d=h.data("color");return e.val(d).trigger("change"),b.preventDefault(),!0}),h=e.next().find("a.selected"),this.pick=function(c,d){if("number"==typeof c){if(c>=i.length)return;b.selectedIndex=c,j.find("a:eq("+c+")").trigger(ace.click_event)}else if("string"==typeof c){var f=c.replace(/[^\w\s,#\(\)\.]/g,"");if(c=i.indexOf(f),-1==c&&d===!0&&(i.push(f),a("").appendTo(e).val(f),a('').appendTo(j).find("a").css("background-color",f).data("color",f),c=i.length-1),-1==c)return;j.find("a:eq("+c+")").trigger(ace.click_event)}},this.destroy=function(){e.removeClass("hide").off("change.color").next().remove(),i=[]}};a.fn.ace_colorpicker=function(d,e){var f,g=this.each(function(){var b=a(this),g=b.data("ace_colorpicker"),h="object"==typeof d&&d;g||b.data("ace_colorpicker",g=new c(this,h)),"string"==typeof d&&(f=g[d](e))});return f===b?g:f},a.fn.ace_colorpicker.defaults={pull_right:!1,caret:!0,auto_pos:!0}}(window.jQuery),function(a,b){var c="multiple"in document.createElement("INPUT"),d="FileList"in window,e="FileReader"in window,f="File"in window,g=function(b,c){var d=this;this.settings=a.extend({},a.fn.ace_file_input.defaults,c),this.$element=a(b),this.element=b,this.disabled=!1,this.can_reset=!0,this.$element.off("change.ace_inner_call").on("change.ace_inner_call",function(a,b){return d.disabled||b===!0?void 0:i.call(d)});var e=this.$element.closest("label").css({display:"block"}),f=0==e.length?"label":"span";this.$element.wrap("<"+f+' class="ace-file-input" />'),this.apply_settings(),this.reset_input_field()};g.error={FILE_LOAD_FAILED:1,IMAGE_LOAD_FAILED:2,THUMBNAIL_FAILED:3},g.prototype.apply_settings=function(){var b=this;this.multi=this.$element.attr("multiple")&&c,this.well_style="well"==this.settings.style,this.well_style?this.$element.parent().addClass("ace-file-multiple"):this.$element.parent().removeClass("ace-file-multiple"),this.$element.parent().find(":not(input[type=file])").remove(),this.$element.after(''+(this.settings.no_icon?'':"")+""),this.$label=this.$element.next(),this.$container=this.$element.closest(".ace-file-input");var e=!!this.settings.icon_remove;if(e){var f=a('').appendTo(this.$element.parent());f.on(ace.click_event,function(a){if(a.preventDefault(),!b.can_reset)return!1;var c=!0;if(b.settings.before_remove&&(c=b.settings.before_remove.call(b.element)),!c)return!1;b.reset_input();return!1})}this.settings.droppable&&d&&h.call(this)},g.prototype.show_file_list=function(b,c){var d="undefined"==typeof b?this.$element.data("ace_input_files"):b;if(d&&0!=d.length){this.well_style&&(this.$label.find(".ace-file-name").remove(),this.settings.btn_change||this.$label.addClass("hide-placeholder")),this.$label.attr("data-title",this.settings.btn_change).addClass("selected");for(var g=0;g');var n=c===!0&&f&&d[g]instanceof File?a.trim(d[g].type):"",o=e&&this.settings.thumbnail&&(n.length>0&&n.match("image")||0==n.length&&"image"==i);if(o){var p=this;a.when(j.call(this,d[g])).fail(function(a){p.settings.preview_error&&p.settings.preview_error.call(p,h,a.code)})}}else this.$label.find(".ace-file-name").attr({"data-title":h}).find(ace.vars[".icon"]).attr("class",ace.vars.icon+m)}return!0}},g.prototype.reset_input=function(){this.reset_input_ui(),this.reset_input_field()},g.prototype.reset_input_ui=function(){this.$label.attr({"data-title":this.settings.btn_choose,"class":"ace-file-container"}).find(".ace-file-name:first").attr({"data-title":this.settings.no_file,"class":"ace-file-name"}).find(ace.vars[".icon"]).attr("class",ace.vars.icon+this.settings.no_icon).prev("img").remove(),this.settings.no_icon||this.$label.find(ace.vars[".icon"]).remove(),this.$label.find(".ace-file-name").not(":first").remove(),this.reset_input_data()},g.prototype.reset_input_field=function(){this.$element.wrap("