!function(n,t){"use strict";var f={"font-styles":function(n,t){var i=t&&t.size?" btn-"+t.size:"";return"<li class='dropdown'><a class='btn dropdown-toggle btn-"+i+" btn-default' data-toggle='dropdown' href='#'><i class='glyphicon glyphicon-font'><\/i>&nbsp;<span class='current-font'>"+n.font_styles.normal+"<\/span>&nbsp;<b class='caret'><\/b><\/a><ul class='dropdown-menu'><li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='div' tabindex='-1'>"+n.font_styles.normal+"<\/a><\/li><li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h1' tabindex='-1'>"+n.font_styles.h1+"<\/a><\/li><li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h2' tabindex='-1'>"+n.font_styles.h2+"<\/a><\/li><li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h3' tabindex='-1'>"+n.font_styles.h3+"<\/a><\/li><li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h4'>"+n.font_styles.h4+"<\/a><\/li><li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h5'>"+n.font_styles.h5+"<\/a><\/li><li><a data-wysihtml5-command='formatBlock' data-wysihtml5-command-value='h6'>"+n.font_styles.h6+"<\/a><\/li><\/ul><\/li>"},emphasis:function(n,t){var i=t&&t.size?" btn-"+t.size:"";return"<li><div class='btn-group'><a class='btn btn-"+i+" btn-default' data-wysihtml5-command='bold' title='CTRL+B' tabindex='-1'>"+n.emphasis.bold+"<\/a><a class='btn btn-"+i+" btn-default' data-wysihtml5-command='italic' title='CTRL+I' tabindex='-1'>"+n.emphasis.italic+"<\/a><a class='btn btn-"+i+" btn-default' data-wysihtml5-command='underline' title='CTRL+U' tabindex='-1'>"+n.emphasis.underline+"<\/a><\/div><\/li>"},lists:function(n,t){var i=t&&t.size?" btn-"+t.size:"";return"<li><div class='btn-group'><a class='btn btn-"+i+" btn-default' data-wysihtml5-command='insertUnorderedList' title='"+n.lists.unordered+"' tabindex='-1'><i class='glyphicon glyphicon-list'><\/i><\/a><a class='btn btn-"+i+" btn-default' data-wysihtml5-command='insertOrderedList' title='"+n.lists.ordered+"' tabindex='-1'><i class='glyphicon glyphicon-th-list'><\/i><\/a><a class='btn btn-"+i+" btn-default' data-wysihtml5-command='Outdent' title='"+n.lists.outdent+"' tabindex='-1'><i class='glyphicon glyphicon-indent-right'><\/i><\/a><a class='btn btn-"+i+" btn-default' data-wysihtml5-command='Indent' title='"+n.lists.indent+"' tabindex='-1'><i class='glyphicon glyphicon-indent-left'><\/i><\/a><\/div><\/li>"},link:function(n,t){var i=t&&t.size?" btn-"+t.size:"";return"<li><div class='bootstrap-wysihtml5-insert-link-modal modal fade'><div class='modal-dialog'><div class='modal-content'><div class='modal-header'><a class='close' data-dismiss='modal'>&times;<\/a><h4>"+n.link.insert+"<\/h4><\/div><div class='modal-body'><input value='http://' class='bootstrap-wysihtml5-insert-link-url form-control'><label class='checkbox'> <input type='checkbox' class='bootstrap-wysihtml5-insert-link-target' checked>"+n.link.target+"<\/label><\/div><div class='modal-footer'><button class='btn btn-default' data-dismiss='modal'>"+n.link.cancel+"<\/button><button href='#' class='btn btn-primary' data-dismiss='modal'>"+n.link.insert+"<\/button><\/div><\/div><\/div><\/div><a class='btn btn-"+i+" btn-default' data-wysihtml5-command='createLink' title='"+n.link.insert+"' tabindex='-1'><i class='glyphicon glyphicon-share'><\/i><\/a><\/li>"},image:function(n,t){var i=t&&t.size?" btn-"+t.size:"";return"<li><div class='bootstrap-wysihtml5-insert-image-modal modal fade'><div class='modal-dialog'><div class='modal-content'><div class='modal-header'><a class='close' data-dismiss='modal'>&times;<\/a><h4>"+n.image.insert+"<\/h4><\/div><div class='modal-body'><input value='http://' class='bootstrap-wysihtml5-insert-image-url form-control'><\/div><div class='modal-footer'><button class='btn btn-default' data-dismiss='modal'>"+n.image.cancel+"<\/button><button class='btn btn-primary' data-dismiss='modal'>"+n.image.insert+"<\/button><\/div><\/div><\/div><\/div><a class='btn btn-"+i+" btn-default' data-wysihtml5-command='insertImage' title='"+n.image.insert+"' tabindex='-1'><i class='glyphicon glyphicon-picture'><\/i><\/a><\/li>"},html:function(n,t){var i=t&&t.size?" btn-"+t.size:"";return"<li><div class='btn-group'><a class='btn btn-"+i+" btn-default' data-wysihtml5-action='change_view' title='"+n.html.edit+"' tabindex='-1'><i class='glyphicon glyphicon-pencil'><\/i><\/a><\/div><\/li>"},color:function(n,t){var i=t&&t.size?" btn-"+t.size:"";return"<li class='dropdown'><a class='btn dropdown-toggle btn-"+i+" btn-default' data-toggle='dropdown' href='#' tabindex='-1'><span class='current-color'>"+n.colours.black+"<\/span>&nbsp;<b class='caret'><\/b><\/a><ul class='dropdown-menu'><li><div class='wysihtml5-colors' data-wysihtml5-command-value='black'><\/div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='black'>"+n.colours.black+"<\/a><\/li><li><div class='wysihtml5-colors' data-wysihtml5-command-value='silver'><\/div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='silver'>"+n.colours.silver+"<\/a><\/li><li><div class='wysihtml5-colors' data-wysihtml5-command-value='gray'><\/div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='gray'>"+n.colours.gray+"<\/a><\/li><li><div class='wysihtml5-colors' data-wysihtml5-command-value='maroon'><\/div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='maroon'>"+n.colours.maroon+"<\/a><\/li><li><div class='wysihtml5-colors' data-wysihtml5-command-value='red'><\/div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='red'>"+n.colours.red+"<\/a><\/li><li><div class='wysihtml5-colors' data-wysihtml5-command-value='purple'><\/div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='purple'>"+n.colours.purple+"<\/a><\/li><li><div class='wysihtml5-colors' data-wysihtml5-command-value='green'><\/div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='green'>"+n.colours.green+"<\/a><\/li><li><div class='wysihtml5-colors' data-wysihtml5-command-value='olive'><\/div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='olive'>"+n.colours.olive+"<\/a><\/li><li><div class='wysihtml5-colors' data-wysihtml5-command-value='navy'><\/div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='navy'>"+n.colours.navy+"<\/a><\/li><li><div class='wysihtml5-colors' data-wysihtml5-command-value='blue'><\/div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='blue'>"+n.colours.blue+"<\/a><\/li><li><div class='wysihtml5-colors' data-wysihtml5-command-value='orange'><\/div><a class='wysihtml5-colors-title' data-wysihtml5-command='foreColor' data-wysihtml5-command-value='orange'>"+n.colours.orange+"<\/a><\/li><\/ul><\/li>"}},o=function(n,t,i){return f[n](t,i)},u=function(t,i){var u,e;this.el=t;u=i||r;for(e in u.customTemplates)f[e]=u.customTemplates[e];this.toolbar=this.createToolbar(t,u);this.editor=this.createEditor(i);window.editor=this.editor;n("iframe.wysihtml5-sandbox").each(function(t,i){n(i.contentWindow).off("focus.wysihtml5").on({"focus.wysihtml5":function(){n("li.dropdown").removeClass("open")}})})},i,r,e;u.prototype={constructor:u,createEditor:function(i){var r,u;if(i=i||{},i=n.extend(!0,{},i),i.toolbar=this.toolbar[0],r=new t.Editor(this.el[0],i),i&&i.events)for(u in i.events)r.on(u,i.events[u]);return r},createToolbar:function(t,i){var h=this,f=n("<ul/>",{"class":"wysihtml5-toolbar",style:"display:none"}),c=i.locale||r.locale||"en",u,s;for(u in r)s=!1,i[u]!==undefined?i[u]===!0&&(s=!0):s=r[u],s===!0&&(f.append(o(u,e[c],i)),u==="html"&&this.initHtml(f),u==="link"&&this.initInsertLink(f),u==="image"&&this.initInsertImage(f));if(i.toolbar)for(u in i.toolbar)f.append(i.toolbar[u]);return f.find("a[data-wysihtml5-command='formatBlock']").click(function(t){var i=t.target||t.srcElement,r=n(i);h.toolbar.find(".current-font").text(r.html())}),f.find("a[data-wysihtml5-command='foreColor']").click(function(t){var i=t.target||t.srcElement,r=n(i);h.toolbar.find(".current-color").text(r.html())}),this.el.before(f),f},initHtml:function(n){var t="a[data-wysihtml5-action='change_view']";n.find(t).click(function(){n.find("a.btn").not(t).toggleClass("disabled")})},initInsertImage:function(t){var r=this,i=t.find(".bootstrap-wysihtml5-insert-image-modal"),u=i.find(".bootstrap-wysihtml5-insert-image-url"),o=i.find(".btn-primary"),s=u.val(),f,e=function(){var n=u.val();u.val(s);r.editor.currentView.element.focus();f&&(r.editor.composer.selection.setBookmark(f),f=null);r.editor.composer.commands.exec("insertImage",n)};u.keypress(function(n){n.which==13&&(e(),i.modal("hide"))});o.click(e);i.on("shown",function(){u.focus()});i.on("hide",function(){r.editor.currentView.element.focus()});t.find("a[data-wysihtml5-command=insertImage]").click(function(){var t=n(this).hasClass("wysihtml5-command-active");if(t)return!0;r.editor.currentView.element.focus(!1);f=r.editor.composer.selection.getBookmark();i.appendTo("body").modal("show");i.on("click.dismiss.modal",'[data-dismiss="modal"]',function(n){n.stopPropagation()});return!1})},initInsertLink:function(t){var r=this,i=t.find(".bootstrap-wysihtml5-insert-link-modal"),u=i.find(".bootstrap-wysihtml5-insert-link-url"),o=i.find(".bootstrap-wysihtml5-insert-link-target"),s=i.find(".btn-primary"),h=u.val(),f,e=function(){var t=u.val(),n;u.val(h);r.editor.currentView.element.focus();f&&(r.editor.composer.selection.setBookmark(f),f=null);n=o.prop("checked");r.editor.composer.commands.exec("createLink",{href:t,target:n?"_blank":"_self",rel:n?"nofollow":""})};u.keypress(function(n){n.which==13&&(e(),i.modal("hide"))});s.click(e);i.on("shown",function(){u.focus()});i.on("hide",function(){r.editor.currentView.element.focus()});t.find("a[data-wysihtml5-command=createLink]").click(function(){var t=n(this).hasClass("wysihtml5-command-active");if(t)return!0;r.editor.currentView.element.focus(!1);f=r.editor.composer.selection.getBookmark();i.appendTo("body").modal("show");i.on("click.dismiss.modal",'[data-dismiss="modal"]',function(n){n.stopPropagation()});return!1})}};i={resetDefaults:function(){n.fn.wysihtml5.defaultOptions=n.extend(!0,{},n.fn.wysihtml5.defaultOptionsCache)},bypassDefaults:function(t){return this.each(function(){var i=n(this);i.data("wysihtml5",new u(i,t))})},shallowExtend:function(t){var r=n.extend({},n.fn.wysihtml5.defaultOptions,t||{},n(this).data()),u=this;return i.bypassDefaults.apply(u,[r])},deepExtend:function(t){var r=n.extend(!0,{},n.fn.wysihtml5.defaultOptions,t||{}),u=this;return i.bypassDefaults.apply(u,[r])},init:function(n){var t=this;return i.shallowExtend.apply(t,[n])}};n.fn.wysihtml5=function(t){if(i[t])return i[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t!="object"&&t)n.error("Method "+t+" does not exist on jQuery.wysihtml5");else return i.init.apply(this,arguments)};n.fn.wysihtml5.Constructor=u;r=n.fn.wysihtml5.defaultOptions={"font-styles":!0,color:!1,emphasis:!0,lists:!0,html:!1,link:!0,image:!0,size:"sm",events:{},parserRules:{classes:{"wysiwyg-color-silver":1,"wysiwyg-color-gray":1,"wysiwyg-color-white":1,"wysiwyg-color-maroon":1,"wysiwyg-color-red":1,"wysiwyg-color-purple":1,"wysiwyg-color-fuchsia":1,"wysiwyg-color-green":1,"wysiwyg-color-lime":1,"wysiwyg-color-olive":1,"wysiwyg-color-yellow":1,"wysiwyg-color-navy":1,"wysiwyg-color-blue":1,"wysiwyg-color-teal":1,"wysiwyg-color-aqua":1,"wysiwyg-color-orange":1},tags:{b:{},i:{},br:{},ol:{},ul:{},li:{},h1:{},h2:{},h3:{},h4:{},h5:{},h6:{},blockquote:{},u:1,img:{check_attributes:{width:"numbers",alt:"alt",src:"url",height:"numbers"}},a:{check_attributes:{href:"url",target:"alt",rel:"alt"}},span:1,div:1,code:1,pre:1}},stylesheets:["./css/bootstrap3-wysiwyg5-color.css"],locale:"en"};typeof n.fn.wysihtml5.defaultOptionsCache=="undefined"&&(n.fn.wysihtml5.defaultOptionsCache=n.extend(!0,{},n.fn.wysihtml5.defaultOptions));e=n.fn.wysihtml5.locale={en:{font_styles:{normal:"Normal text",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6"},emphasis:{bold:"Bold",italic:"Italic",underline:"Underline"},lists:{unordered:"Unordered list",ordered:"Ordered list",outdent:"Outdent",indent:"Indent"},link:{insert:"Insert link",cancel:"Cancel",target:"Open link in new window"},image:{insert:"Insert image",cancel:"Cancel"},html:{edit:"Edit HTML"},colours:{black:"Black",silver:"Silver",gray:"Grey",maroon:"Maroon",red:"Red",purple:"Purple",green:"Green",olive:"Olive",navy:"Navy",blue:"Blue",orange:"Orange"}}}}(window.jQuery,window.wysihtml5)