!function(e,t){var i=function(t,i){function n(e){e.preventDefault(),e.stopPropagation();var t=y.offset(),i=t[c],n=v?e.pageY:e.pageX;n>i+z?(z=n-i-A+I,z>E&&(z=E)):(z=n-i-I,0>z&&(z=0)),o.update_scroll()}function a(t){t.preventDefault(),t.stopPropagation(),j=N=v?t.pageY:t.pageX,H=!0,e("html").off("mousemove.ace_scroll").on("mousemove.ace_scroll",s),e(P).off("mouseup.ace_scroll").on("mouseup.ace_scroll",r),y.addClass("active"),q&&o.$element.trigger("drag.start")}function s(e){e.preventDefault(),e.stopPropagation(),j=v?e.pageY:e.pageX,j-N+z>E?j=N+E-z:0>j-N+z&&(j=N-z),z+=j-N,N=j,0>z?z=0:z>E&&(z=E),o.update_scroll()}function r(t){t.preventDefault(),t.stopPropagation(),H=!1,e("html").off(".ace_scroll"),e(P).off(".ace_scroll"),y.removeClass("active"),q&&o.$element.trigger("drag.end")}var o=this,l=e.extend({},e.fn.ace_scroll.defaults,i);this.size=0,this.$element=e(t),this.element=t;var c,d,h,u,f,p,v=!0,g=!1,m=!1,b=!1,w=null,_=null,y=null,C=null,k=null,x=null,$=null,A=0,z=0,E=0,I=0,D=!0,T=!1,S=1,M=!1,H=!1,P="onmouseup"in window?window:"html",q=l.dragEvent||!1,L=i.scrollEvent||!1;this.create=function(t){if(!b){if(t&&(l=e.extend({},e.fn.ace_scroll.defaults,t)),this.size=parseInt(this.$element.attr("data-size"))||l.size||200,v=!l.horizontal,c=v?"top":"left",d=v?"height":"width",h=v?"maxHeight":"maxWidth",u=v?"clientHeight":"clientWidth",f=v?"scrollTop":"scrollLeft",p=v?"scrollHeight":"scrollWidth",this.$element.addClass("ace-scroll "+((v?"":" scroll-hz")+(l.styleClass?" "+l.styleClass:""))),"static"==this.$element.css("position")?(M=this.element.style.position,this.element.style.position="relative"):M=!1,this.$element.wrapInner('
'),this.$element.prepend('
'),w=this.$element.find(".scroll-content").eq(0),v||w.wrapInner("
"),_=w.get(0),y=this.$element.find(".scroll-track").eq(0),C=y.find(".scroll-bar").eq(0),k=y.get(0),x=C.get(0),$=x.style,y.hide(),y.on("mousedown",n),C.on("mousedown",a),w.on("scroll",function(){D&&(z=parseInt(Math.round(this[f]*S)),$[c]=z+"px"),D=!1,L&&this.$element.trigger("scroll",[_])}),l.mouseWheel){var i=l.mouseWheelLock,s=!l.lockAnyway;this.$element.on("mousewheel.ace_scroll DOMMouseScroll.ace_scroll",function(t){if(!g){if(!m)return s;H&&(H=!1,e("html").off(".ace_scroll"),e(P).off(".ace_scroll"),q&&o.$element.trigger("drag.end"));var n=t.originalEvent.detail<0||t.originalEvent.wheelDelta>0?1:-1,a=!1,r=_[u],l=_[f];i||(a=-1==n?_[p]<=l+r:0==l),o.move_bar(!0);var c=parseInt(Math.round(Math.min(Math.max(r/8,54)),o.size))+1;return _[f]=l-n*c,a&&s}})}var r=ace.vars.touch&&"ace_drag"in e.event.special&&l.touchDrag;if(r){var A="",E=r?"ace_drag":"swipe";this.$element.on(E+".ace_scroll",function(e){if(A=e.direction,v&&("up"==A||"down"==A)||!v&&("left"==A||"right"==A)){var t=v?e.dy:e.dx;0!=t&&(Math.abs(t)>20&&r&&(t=2*t),o.move_bar(!0),_[f]=_[f]+t)}})}l.hoverReset&&this.$element.on("mouseenter.ace_scroll touchstart.ace_scroll",function(){o.reset()}),v||w.children(0).css(d,this.size),w.css(h,this.size),g=!1,b=!0}},this.is_active=function(){return m},this.is_enabled=function(){return!g},this.move_bar=function(e){D=e},this.reset=function(){if(!g){b||this.create();var e=v?_[p]:this.size;if(v&&0==e||!v&&0==this.element.scrollWidth)return void this.$element.removeClass("scroll-active");var t=v?this.size:_.clientWidth;v||w.children(0).css(d,this.size),w.css(h,this.size),e>t?(m=!0,y.css(d,t).show(),S=parseFloat((t/e).toFixed(5)),A=parseInt(Math.round(t*S)),I=parseInt(Math.round(A/2)),E=t-A,z=parseInt(Math.round(_[f]*S)),$[d]=A+"px",$[c]=z+"px",this.$element.addClass("scroll-active"),T||(l.reset&&(_[f]=0,$[c]=0),T=!0)):(m=!1,y.hide(),this.$element.removeClass("scroll-active"),w.css(h,""))}},this.disable=function(){return _[f]=0,$[c]=0,g=!0,m=!1,y.hide(),this.$element.removeClass("scroll-active"),w.css(h,""),this},this.enable=function(){return g=!1,this.reset(),this},this.destroy=function(){return m=!1,g=!1,b=!1,this.$element.removeClass("ace-scroll scroll-hz"+(l.extraClass?" "+l.extraClass:"")),this.$element.off(".ace_scroll"),v||w.find("> div").children().unwrap(),w.children().unwrap(),w.remove(),y.remove(),M!==!1&&(this.element.style.position=M),this},this.modify=function(t){return t&&(l=e.extend({},e.fn.ace_scroll.defaults,t)),this.destroy(),this.create(),this.reset(),this},this.update=function(e){return this.size=e.size,this},this.update_scroll=function(){D=!1,$[c]=z+"px",_[f]=parseInt(Math.round(z/S))};var N=-1,j=-1;return this.create(),this.reset(),this};e.fn.ace_scroll=function(n,a){var s,r=this.each(function(){var t=e(this),r=t.data("ace_scroll"),o="object"==typeof n&&n;r||t.data("ace_scroll",r=new i(this,o)),"string"==typeof n&&(s=r[n](a))});return s===t?r:s},e.fn.ace_scroll.defaults={size:200,horizontal:!1,mouseWheel:!0,mouseWheelLock:!1,lockAnyway:!1,styleClass:!1,hoverReset:!0,reset:!1,dragEvent:!1,touchDrag:!0,touchSwipe:!1,scrollEvent:!1}}(window.jQuery),function(e,t){var i=function(t,i){var n=e.extend({},e.fn.ace_colorpicker.defaults,i),a=e(t),s="",r="",o=null,l=[];a.addClass("hide").find("option").each(function(){var e="colorpick-btn",t=this.value.replace(/[^\w\s,#\(\)\.]/g,"");this.value!=t&&(this.value=t),this.selected&&(e+=" selected",r=t),l.push(t),s+='
  • '}).end().on("change.color",function(){a.next().find(".btn-colorpicker").css("background-color",this.value)}).after('");var c=a.next().find(".dropdown-menu");c.on(ace.click_event,function(t){var i=e(t.target);if(!i.is(".colorpick-btn"))return!1;o&&o.removeClass("selected"),o=i,o.addClass("selected");var n=o.data("color");return a.val(n).trigger("change"),t.preventDefault(),!0}),o=a.next().find("a.selected"),this.pick=function(i,n){if("number"==typeof i){if(i>=l.length)return;t.selectedIndex=i,c.find("a:eq("+i+")").trigger(ace.click_event)}else if("string"==typeof i){var s=i.replace(/[^\w\s,#\(\)\.]/g,"");if(i=l.indexOf(s),-1==i&&n===!0&&(l.push(s),e("