WRMCB=function(e){var c=console;if(c&&c.log&&c.error){c.log('Error running batched script.');c.error(e);}}
;
try {
/* module-key = 'confluence.extra.jira:macro-browser-resources', location = 'templates/extra/jira/view-in-jira.js' */
AJS.bind("add-handler.property-panel",function(b,a){AJS.log("add-handler.property-panel: panel name = "+a.name);if(a.name!="macro"){return}a.registerButtonHandler("view-in-jira",function(d,j){if(AJS.Editor.JiraConnector.servers){var s=AJS.Editor.JiraConnector.servers;var l=AJS.$(j);var g=l.attr("data-macro-default-parameter");var k=l.attr("data-macro-parameters")||"";var t=Confluence.MacroParameterSerializer.deserialize(k);var n=/=|!=|~|>|<|!~| is | in /i;var h=function(u){var i=u.indexOf("|");if(i>=0){return u.substring(0,i)}return u};var f=g||t.jqlQuery||t.key||h(k);var c=t.server;var q=t.serverId;var p=f.match(n);var m=null;for(var o=0;o<s.length;o++){if((q&&s[o].id==q)){m=s[o];break}if((c&&s[o].name==c)||(!c&&s[o].selected)){m=s[o];break}}if(m!=null){var e=(typeof m.displayUrl!=="undefined")?m.displayUrl:m.url;if(e.charAt(e.length-1)=="/"){e=e.substr(0,e.length-1)}var r=tinymce.isIE?"_blank":"confluence-goto-jiralink-"+AJS.params.pageId;if(!p){window.open(e+"/browse/"+encodeURIComponent(f),r)}else{window.open(e+"/secure/IssueNavigator.jspa?reset=true&jqlQuery="+encodeURIComponent(f),r)}}}})});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.extra.jira:macro-browser-resources', location = 'templates/extra/jira/show-summary.js' */
AJS.bind("init.rte",function(){if(!AJS.Confluence&&!AJS.Confluence.PropertyPanel&&!AJS.Confluence.PropertyPanel.Macro){AJS.logError("JIRA Issues Macro : can't register property panel init handler since AJS.Confluence.PropertyPanel.Macro is undefined");return}var a="showSummary";var f="jira";var e="jiraissues";var d="show-summary";AJS.Confluence.PropertyPanel.Macro.registerInitHandler(c,f);AJS.Confluence.PropertyPanel.Macro.registerInitHandler(c,e);function c(g,m,j){var l=AJS.$.grep(m,function(i){return i.parameterName==d})[0];if(!l){AJS.logError("JIRA Issues Macro - Show-summary : The system cannot find SummaryButton, all buttons are: ");for(var k in m){AJS.logError(m[k].text)}return}if(b(g)){var h=AJS.SummaryHelper.getParam(g,a);if(h=="false"){l.text="Show summary"}else{l.text="Hide summary"}}else{l.className+=" hidden"}}function b(g){var i=AJS.$(g);var j=i.attr("src");if(!j){return true}var h=AJS.SummaryHelper.getParam(g,"count");if(j.indexOf("confluence.extra.jira/jira-table")==-1&&h!="true"){return true}return false}});AJS.bind("add-handler.property-panel",function(b,a){if(a.name!="macro"){return}a.registerButtonHandler("show-summary",function(e,c){var d=AJS.SummaryHelper.getParam(c,"showSummary");AJS.SummaryHelper.updateMacro("jira",c,"showSummary",d=="false"?"true":"false")})});AJS.SummaryHelper=(function(){return{getCurrentParams:function(a){return Confluence.MacroParameterSerializer.deserialize(a.attr("data-macro-parameters"))},getParam:function(a,d){var c=AJS.$(a);var b=AJS.SummaryHelper.getCurrentParams(c);return b[d]},updateMacro:function(b,a,c,g){var e=AJS.$(a);AJS.Rte.getEditor().selection.select(e[0]);AJS.Rte.BookmarkManager.storeBookmark();var d=AJS.SummaryHelper.getCurrentParams(e);d[c]=g;var f={contentId:Confluence.Editor.getContentId(),macro:{name:b,params:d,defaultParameterValue:e.attr("data-macro-default-parameter")}};tinymce.confluence.MacroUtils.insertMacro(f)}}})();
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.web.resources:editor-notifications', location = 'includes/js/editor-notifications.js' */
define("confluence/editor-notifications",[],function(){var a;return{notify:function(b,d,c){var e=require("aui/flag");void 0!==a&&"true"!==a.getAttribute("aria-hidden")&&a.close();void 0===c&&(c="error"===b?"manual":"auto");a=e({type:b,body:d,close:c})}}});require("confluence/module-exporter").safeRequire("confluence/editor-notifications",function(a){var b=require("ajs");b.bind("init.rte",function(){b.Confluence.EditorNotification=a})});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-link-browser:link-object', location = 'js/link-object.js' */
define("confluence-link-browser/link-object",["jquery","ajs","confluence-rest/confluence-rest"],function(c,g,m){function j(a){return c.nodeName(a,"img")?a:a.hasChildNodes()&&1===a.childNodes.length&&c.nodeName(a,"a")&&c.nodeName(a.firstChild,"img")?a.firstChild:null}function k(a){return!a?"":c(a).attr("data-linked-resource-default-alias")||c(a).attr("src")}function l(a){var b={};"A"===a.nodeName&&c(a.attributes).each(function(){b[this.name]=this.value});return b}function i(a,b){for(var c=a;c&&c!=
b;){if(3!=c.nodeType)return!1;c=c.nextSibling}return 3===b.nodeType}var e={isLink:function(a){return a&&!!a.fillNode}},f=function(a){if(e.isLink(a))return a;var b={insert:function(){return require("confluence-link-browser/link-adapter").setLink(b)},fillNode:function(a){var b=this.attrs;b.href=b.href||"#";a.attr(b);this.classes&&this.classes.length&&a.addClass(this.classes.join(" "));a.html(this.body.html);return a},getData:function(){var a={},b;for(b in this)this.hasOwnProperty(b)&&!c.isFunction(this[b])&&
(a[b]=this[b]);return a},getLinkedImage:function(){return this.body&&this.body.jquery?1===this.body.length&&this.body.is("img")&&this.body:null},getResourceId:function(){return this.attrs["data-linked-resource-id"]||""},getResourceVersion:function(){return this.attrs["data-linked-resource-version"]||""},isToConfluenceEntity:function(){return this.attrs["data-linked-resource-id"]},isToAttachmentOnSamePage:function(a){return"attachment"==this.attrs["data-linked-resource-type"]&&this.attrs["data-linked-resource-container-id"]==
a},isCustomAtlassianContentLink:function(){return this.classes&&this.classes.length?-1!=c.inArray("confluence-link",this.classes):!1},hasAnchor:function(){return this.attrs["data-anchor"]},getResourceType:function(){return this.attrs["data-linked-resource-type"]},getDefaultAlias:function(){return this.attrs["data-linked-resource-default-alias"]},getHref:function(){return this.attrs.href},getAnchor:function(){return this.attrs["data-anchor"]},getHtml:function(){return this.body.html},getShortcut:function(){return this.attrs["data-linked-resource-shortcut"]},
isHrefValid:function(){return this.attrs.href&&"http://"!=this.attrs.href},isImage:function(){return this.body.isImage},isNewLink:function(){return c.isEmptyObject(this.attrs)},isShortcutLink:function(){return"shortcut"===this.getResourceType()},showsBreadcrumbs:function(){return!0}};if(a&&a.attrs){var f={},h=null;c.each(a.attrs,function(a,b){"class"==a?h=b:f[a]=b});a.attrs=f;if(h){var d=h.split(" ");a.classes=a.classes&&a.classes.length?a.classes.concat(d):d}}c.extend(b,a);return b};e.fromData=function(a){return f(a)};
e.fromNode=function(a,b){f({attrs:{},body:{html:b,text:b}});return f({attrs:l(a),body:{html:b,text:b}})};e.fromSelectedAnchor=function(a,b){var e=c(a),h=j(a),d=!h&&i(a.firstChild,a.lastChild);return f({attrs:l(a),body:{isEditable:d,isImage:!!h,html:e.html(),imgName:k(h),text:b}})};e.fromSelection=function(a,b,c,e){var b=j(b),d;if(d=!b)if(a.collapsed)d=!0;else if(d=a.startContainer,d==a.endContainer)d=3===d.nodeType?!0:i(d.childNodes[a.startOffset],d.childNodes[a.endOffset-1]);else{var g=require("tinymce").activeEditor.dom;
d=g.isBlock(a.startContainer)?a.startContainer.childNodes[a.startOffset]:a.startContainer;a=g.isBlock(a.endContainer)?a.endContainer.childNodes[a.endOffset-1]:a.endContainer;a=d&&a&&d.parentNode==a.parentNode?{start:d,end:a}:null;d=!!a&&i(a.start,a.end)}return f({attrs:{},body:{isEditable:d,isImage:!!b,html:c,imgName:k(b),text:e}})};e.fromREST=function(a){var b=f({attrs:{"data-base-url":g.Confluence.getBaseUrl(),"data-linked-resource-id":a.id,"data-linked-resource-type":a.type,"data-linked-resource-content-type":a.contentType,
href:m.REST.findLink(a.link),"data-linked-resource-default-alias":a.title},body:{html:g.escapeHtml(a.title),text:g.escapeHtml(a.title)},classes:["confluence-link"]});"user"===a.type&&(b.attrs["data-linked-resource-type"]="userinfo");return b};e.createLinkToNewPage=function(a,b){return f({attrs:{"data-space-key":b,"data-content-title":a,href:g.contextPath()+"/pages/createpage.action?spaceKey="+b+"&title="+a},body:{html:g.escapeEntities(a),text:a},classes:["createlink","confluence-link"]})};e.makeExternalLink=
function(a){return f({attrs:{href:a},body:{html:a,text:a}})};e.isExternalLink=function(a){return a&&(a.match(/^(\/\/|mailto:|file:|http:|https:)/)||0===a.indexOf("\\"))};return e});require("confluence/module-exporter").exportModuleAsGlobal("confluence-link-browser/link-object","Confluence.Link");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-link-browser:link-adapter', location = 'js/link-adapter.js' */
define("confluence-link-browser/link-adapter",["ajs","jquery","confluence-link-browser/link-object"],function(d,e,f){return{setLink:function(a){var b=d.Rte.getEditor(),b=e(b.dom.create("a"),b.getDoc());a.fillNode(b);a=require("confluence-editor/utils/tinymce-node-utils").replaceSelection(b);e("#comments-section").length&&d.Rte.fixEditorFocus();return a},getLink:function(){var a,b,c;a=d.Rte.getEditor().selection;var g=a.getNode();if(c=e(g).parents().andSelf().filter("a[href]")[0])return a.select(c),
b=a.getContent({format:"text"}),f.fromSelectedAnchor(c,b);c=a.getRng(!0);b=a.getContent({format:"text"});a=a.getContent();return f.fromSelection(c,g,a,b)}}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.drag-and-drop:files-upload-analytics', location = 'js/analytics/files-upload-analytics.js' */
define("conf/confluence-drag-and-drop/analytics/files-upload-analytics",["ajs","underscore"],function(d,e){return{triggerEvent:function(b,a,c){a&&a.length&&(a={multiple:1<a.length,number:a.length,isAllImage:void 0===c?this._isAllImages(a):c},d.trigger("analyticsEvent",{name:b,data:a}))},_isAllImages:function(b){return e.every(b,function(a){return a.nativeFile&&a.nativeFile.type&&0===a.nativeFile.type.indexOf("image/")})}}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:panel-components', location = 'files/file-item/file-item.soy' */
// This file was automatically generated from file-item.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.File.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.File == 'undefined') { Confluence.Templates.File = {}; }


Confluence.Templates.File.fileDialogListItem = function(opt_data, opt_ignored) {
  return '<li class="attached-file loading" data-attachment-id="' + soy.$$escapeHtml(opt_data.file.id) + '" data-owner-id="' + soy.$$escapeHtml(opt_data.file.ownerId) + '" data-file-name="' + soy.$$escapeHtml(opt_data.file.fileName) + '"><div class="file-container" title="' + soy.$$escapeHtml(opt_data.tooltip) + '">' + ((opt_data.file.isImage) ? '<img class="thumbnail hidden" src="' + soy.$$escapeHtml(opt_data.file.nonceUrl) + '" ><a href="' + soy.$$escapeHtml(opt_data.file.downloadUrl) + '" class="abs-icon zoom">Zoom</a><p class="hidden image-preview-throbber">&nbsp;</p>' : (opt_data.file.isPreviewable) ? '<span class="thumbnail ' + soy.$$escapeHtml(opt_data.file.iconClass) + '" ><i class="aui-icon size-48 svg-icon ' + soy.$$escapeHtml(opt_data.file.iconAUIClass) + '">File</i></span><a href="' + soy.$$escapeHtml(opt_data.file.downloadUrl) + '" class="abs-icon zoom">Zoom</a><p class="hidden image-preview-throbber">&nbsp;</p>' : '<span class="thumbnail ' + soy.$$escapeHtml(opt_data.file.iconClass) + '" ><i class="aui-icon size-48 svg-icon ' + soy.$$escapeHtml(opt_data.file.iconAUIClass) + '">File</i></span>') + '<i class="abs-icon select">Select</i></div><span class="caption filename" title="' + soy.$$escapeHtml(opt_data.file.fileName) + '">' + soy.$$filterNoAutoescape(opt_data.highlightedImageNameContent) + '</span>' + ((opt_data.highlightedParentTitleContent) ? '<span class="caption owner-title" title="' + soy.$$escapeHtml(opt_data.file.parentTitle) + '">' + soy.$$filterNoAutoescape(opt_data.highlightedParentTitleContent) + '</span>' : '') + '</li>';
};
if (goog.DEBUG) {
  Confluence.Templates.File.fileDialogListItem.soyTemplateName = 'Confluence.Templates.File.fileDialogListItem';
}


Confluence.Templates.File.fileDialogListItemPlaceHolder = function(opt_data, opt_ignored) {
  return '<li class="attached-file loading" data-attachment-id="' + soy.$$escapeHtml(opt_data.file.id) + '" data-file-name="' + soy.$$escapeHtml(opt_data.file.fileName) + '"><div class="file-container" title="' + soy.$$escapeHtml(opt_data.file.fileName) + '">' + ((opt_data.file.isImage && opt_data.file.url) ? '<img class="thumbnail" src="' + soy.$$escapeHtml(opt_data.file.url) + '">' : '<span class="thumbnail"><i class="aui-icon size-48 svg-icon ' + soy.$$escapeHtml(opt_data.file.iconAUIClass) + '">File</i></span>') + '<div id="docs-progress-bar-' + soy.$$escapeHtml(opt_data.file.fileId) + '" class="aui-progress-indicator"><span class="aui-progress-indicator-value"></span></div><div class="overlay"></div><i class="aui-icon aui-icon-small aui-iconfont-close-dialog abs-icon cancel">Cancel</i></div><span class="caption filename" title="' + soy.$$escapeHtml(opt_data.file.fileName) + '">' + soy.$$escapeHtml(opt_data.file.fileName) + '</span><span class="caption owner-title hidden" title=""></span></li>';
};
if (goog.DEBUG) {
  Confluence.Templates.File.fileDialogListItemPlaceHolder.soyTemplateName = 'Confluence.Templates.File.fileDialogListItemPlaceHolder';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:panel-components', location = 'files/file-item/file-item-model.js' */
define("confluence-editor/files/file-item/file-item-model","backbone ajs underscore plupload confluence-editor/utils/file-types-utils confluence-rest/confluence-rest confluence/api/constants".split(" "),function(e,f,g,c,h,i,d){return e.Model.extend({defaults:{id:-1,ownerId:-1,fileName:"",nonceUrl:"",isImage:false,isFilePlaceHolder:false,isSelect:false,thumbnailUrl:"",downloadUrl:""},initialize:function(){var a=this;this._findDownloadUrl();this._findThumbnailUrl();this.set("fileName",this.getFileName());
this.set("nonceUrl",this.getNonceUrl());this.set("isImage",this.isImage());this.set("isPreviewable",this.isPreviewable());this.get("attachmentId")&&this.set("id",this.get("attachmentId"));this.get("isFilePlaceHolder")&&this.set("id",this.get("fileId"));this.listenTo(this,"change:link",function(){a.set("nonceUrl",a.getNonceUrl());a._findDownloadUrl()});this.set("iconAUIClass",this._parseFileNameToAuiIconClass(this.get("fileName")))},isImage:function(){return this.get("isImage")?true:!!this.get("thumbnailUrl")},
isPreviewable:function(){return(this.get("niceType")||"").toLocaleLowerCase()==="pdf document"||this.isImage()},getFileName:function(){return this.get("fileName")||this.get("name")||""},getDestinationUrl:function(){return i.REST.wikiLink(this.attributes).destination},getNonceUrl:function(){var a=this.get("thumbnailUrl");if(a.indexOf("modificationDate")>=0)return a;var b=this.get("lastModifiedDate"),b=b?b.date:+new Date,b=encodeURIComponent(b);if(a){b=(a.indexOf("?")+1?"&":"?")+"nonce="+b;a=a+b}return a},
getRelativeUrl:function(a){if(!a)return a;if(a.indexOf(d.BASE_URL)===0){a=a.replace(d.BASE_URL,"");a=f.contextPath()+a}return a},_findThumbnailUrl:function(){!this.get("thumbnailUrl")&&this.get("thumbnailLink")&&this.set("thumbnailUrl",this.getRelativeUrl(this.get("thumbnailLink").href))},_findDownloadUrl:function(){var a=this.get("link");if(!this.get("downloadUrl")&&a){a=g.findWhere(a,{rel:"download"}).href;this.set("downloadUrl",this.getRelativeUrl(a))}},_getFileExtension:function(a){return a.substr(a.lastIndexOf(".")+
1)},_parseFileNameToAuiIconClass:function(a){a=typeof c!=="undefined"?c.mimeTypes[this._getFileExtension(a)]:"";return h.getAUIIconFromMime(a)}})});require("confluence/module-exporter").exportModuleAsGlobal("confluence-editor/files/file-item/file-item-model","Confluence.Editor.FileDialog.FileItemModel");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:panel-components', location = 'files/file-item/file-item-view.js' */
define("confluence-editor/files/file-item/file-item-view","backbone confluence/templates confluence/highlighter raphael underscore wrm jquery".split(" "),function(f,g,h,i,e,j,d){return f.View.extend({template:g.File.fileDialogListItem,model:null,initialize:function(a){var b=this;this.eventListener=a.eventListener;this.model=a.model;this.showContainerInfo=a.showContainerInfo;this.highlighter=a.highlighter;this.listenTo(this.model,"change:isSelect",function(){b.$el.toggleClass("selected",b.model.get("isSelect"))})},
render:function(){var a=this.highlighter||new h,b=this.model.get("space"),c=this.model.getFileName(),a={file:this.model.attributes,tooltip:this.showContainerInfo&&b?c+" ("+b.name+")":c,highlightedImageNameContent:a.highlight(c),highlightedParentTitleContent:this.showContainerInfo?a.highlight(this.model.attributes.parentTitle):null};this.$el=d(this.template(a));this.el=this.$el[0];this.delegateEvents();this.$el.find(".file-container").tooltip({aria:true});this.$el.attr("data-destination",this.model.getDestinationUrl());
this.model.get("isImage")?this._renderLoadingSpinner():this.$el.removeClass("loading");this.model.get("isPreviewable")&&this._renderPreviewButton();return this},_renderPreviewButton:function(){this.$(".zoom").on("click",e.bind(function(a){a.preventDefault();a={src:this.model.get("downloadUrl"),thumbnail:this.model.get("nonceUrl")||this.model.get("downloadUrl"),type:this.model.get("contentType"),rank:0,title:this.model.getFileName(),id:this.model.get("id"),ownerId:this.model.get("ownerId"),version:this.model.get("version")};
this._setupAndShowPreviewer(a)},this))},_setupAndShowPreviewer:function(a){var b={viewMode:"simple",openPreviewCallback:function(){d("#insert-image-dialog").hide();d(".aui-blanket").hide()},closePreviewCallback:function(){d("#insert-image-dialog").show();d(".aui-blanket").show()}},c=e.bind(function(a,b){this.loader=require("cp/confluence/file-preview-loader");var c=this.loader.setupPreviewForSingleFile([a],b);c.on("fv.open",b.openPreviewCallback);c.on("fv.close",b.closePreviewCallback);c.open();c.showFileWhere()},
this);this.dfd?this.dfd.done(e.partial(c,a,b)):this.dfd=j.require("wr!com.atlassian.confluence.plugins.confluence-previews:confluence-previews-resources",e.partial(c,a,b))},_renderLoadingSpinner:function(){var a=this,b=this.$el.find(".image-preview-throbber").removeClass("hidden"),c=i.spinner(b[0],8,"#666"),d=this.$el.find("img").load(function(){c();b.remove();d.removeClass("hidden");a.$el.removeClass("loading")})}})});
require("confluence/module-exporter").exportModuleAsGlobal("confluence-editor/files/file-item/file-item-view","Confluence.Editor.FileDialog.FileItemView");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:panel-components', location = 'files/file-item/file-placeholder-view.js' */
define("confluence-editor/files/file-item/file-placeholder-view",["backbone","confluence/templates","underscore","ajs","jquery"],function(b,d,e,f,g){return b.View.extend({model:null,template:d.File.fileDialogListItemPlaceHolder,initialize:function(a){this.model=a.model;this.eventListener=a.eventListener;this.eventListener.on("file.placeholder.process",e.bind(this._setUploadInProgress,this))},events:{"click .cancel":"_cancelUpload"},render:function(){this.$el=g(this.template({file:this.model.attributes}));
this.el=this.$el[0];this.delegateEvents();return this},_setUploadInProgress:function(a,b){var c=this.$el.find("#docs-progress-bar-"+b||"");c.length&&(1===a&&this.$(".cancel").hide(),c.show(),f.progressBars.update(c,a))},_cancelUpload:function(){this.eventListener.trigger("uploadingfile.cancelled",this.model.get("fileId"))}})});require("confluence/module-exporter").exportModuleAsGlobal("confluence-editor/files/file-item/file-placeholder-view","Confluence.Editor.FileDialog.FilePlaceHolderView");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:panel-components', location = 'files/file-list/file-list-collection.js' */
define("confluence-editor/files/file-list/file-list-collection",["backbone","confluence-editor/files/file-item/file-item-model","underscore"],function(c,d,e){return c.Collection.extend({model:d,clearSelection:function(){this.each(function(a){a.get("isSelect")&&a.set("isSelect",!1)});this.trigger("clear.selection")},getAllSelectItems:function(){return this.filter(function(a){return a.get("isSelect")})},setSelection:function(a){e.each(a,function(a){return a.set("isSelect",!0)})},resetFiles:function(a){this.reset();
for(var b=0;b<a.length;b++)this.addFile(a[b])},addFile:function(a){a=this.add(a);this.trigger("add-file",a.at(a.length-1))},removeFile:function(a){this.remove(a);this.trigger("remove-file",a)},replaceFile:function(a,b){this.remove(a);this.add(b);this.trigger("replace-file",a,b)}})});require("confluence/module-exporter").exportModuleAsGlobal("confluence-editor/files/file-list/file-list-collection","Confluence.Editor.FileDialog.FileListCollection");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:panel-components', location = 'files/file-list/file-list-view.js' */
define("confluence-editor/files/file-list/file-list-view","backbone confluence-editor/files/file-item/file-item-view confluence-editor/files/file-item/file-item-model confluence-editor/files/file-item/file-placeholder-view ajs jquery".split(" "),function(f,g,h,i,j,c){return f.View.extend({eventListener:null,events:{click:"_clearSelection","click li.attached-file":"_clickItem","dblclick li.attached-file":"_doubleClickItem"},initialize:function(a){var b=this;this.collection=a.collection;if(a.eventListener){this.eventListener=
a.eventListener;this.listenTo(this.eventListener,"uploadingfile.completed",this._addUploadedFile);this.listenTo(this.eventListener,"uploadingfile.cancelled",this._cancelUploadingFile)}this.listenTo(this.collection,"reset",this._clearFileList);this.listenTo(this.collection,"add-file",this._renderNewItem);this.listenTo(this.collection,"remove-file",this._removeItem);this.listenTo(this.collection,"replace-file",this._replaceItem);this.listenTo(this.collection,"change:isSelect",function(){this.context.setSelectItems(this.collection.getAllSelectItems())});
this.listenTo(this.collection,"change:link",function(a){b.collection.removeFile(a);b.collection.addFile(a)});this.updateDialogContext(a.context);this.updatePanelContext(a.panelContext)},_addUploadedFile:function(a,b){var d=this,e=j.contextPath()+"/rest/prototype/1/attachment/"+b+".json";c.get(e).done(function(b){var b=new h(b),c=d.collection.get(a);c||(c=d.collection.findWhere({fileName:b.get("fileName")}));c?d.collection.replaceFile(c,b):d.collection.addFile(b)})},_cancelUploadingFile:function(a){(a=
this.collection.get(a))&&(a.get("previousUploadedFile")?this.collection.replaceFile(a,a.get("previousUploadedFile")):this.collection.removeFile(a))},render:function(){return this},resetFileList:function(a,b){b=b||{};this.$el.find(".loading-message").addClass("hidden");this.$el.find(".no-files").remove();this.collection.resetFiles(a);this.collection.length===0&&this.$fileList.before(c("<p></p>").addClass("no-files").text(this.noFileMessage));b.shouldClearSelection&&this.collection.clearSelection();
this._checkError(b.errors);this.$el.sizeToFit()},_getViewFromModel:function(a){return a.get("isFilePlaceHolder")?(new i({model:a,eventListener:this.eventListener})).render():(new g({model:a,showContainerInfo:this.showContainerInfo,highlighter:this.highlighter,eventListener:this.eventListener})).render()},_renderNewItem:function(a){if(this.$fileList&&this.$fileList.length){var b=this._getViewFromModel(a);this.$fileList.prepend(b.el);a.get("isFilePlaceHolder")||a.set("isSelect",true)}},_removeItem:function(a){if(this.$fileList&&
this.$fileList.length)(a=this._getDomElementByFileName(a.get("fileName")))&&a.remove()},_replaceItem:function(a,b){if(this.$fileList&&this.$fileList.length){var c=this._getViewFromModel(b),e=this._getDomElementByFileName(a.get("fileName"));e&&e.length?e.replaceWith(c.el):this.$fileList.prepend(c.el);b.set("isSelect",true)}},_getDomElementByFileName:function(a){var b=null;this.$fileList.find("li").each(function(){var d=c(this);d.attr("data-file-name")===a&&(b=d)});return b},updatePanelContext:function(a){if(a){this.panelContext=
a;this.errors=this.panelContext.errors||[];this.$el=this.fileContainer=this.panelContext.fileContainer;this.el=this.$el[0];this.$fileList=this.$el.find(".file-list");this.delegateEvents();this.noFileMessage=this.panelContext.noFileMessage;this.showContainerInfo=this.panelContext.showContainerInfo;this.highlighter=this.panelContext.highlighter;this.displayErrors=this.panelContext.displayErrors}},updateDialogContext:function(a){if(a){this.context=a;this.contextOptions=this.context.options}},_checkError:function(a){(a=
a||[])&&a.length&&this.displayErrors(a)},_clearSelection:function(a){a=a&&c(a.target);if(!a||!a.hasClass("close-tip")){this.collection.clearSelection();this.$el.find(".current").removeClass("current")}},_clearFileList:function(){this.$fileList&&this.$fileList.empty()},_clickItem:function(a){a.stopPropagation();a.preventDefault();var b=c(a.target);if(!b.closest(".zoom").length){a.isTrigger||this.$fileList.find(".current").removeClass("current");a=b.closest("li").attr("data-attachment-id");(a=this.collection.get(a))&&
!a.get("isFilePlaceHolder")&&a.set("isSelect",!a.get("isSelect"))}},_doubleClickItem:function(a){var a=c(a.target).closest("li"),b=a.attr("data-attachment-id");if((b=this.collection.get(b))&&!b.get("isFilePlaceHolder")){a.click();this.context.insert()}}})});require("confluence/module-exporter").exportModuleAsGlobal("confluence-editor/files/file-list/file-list-view","Confluence.Editor.FileDialog.FileListView");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:panel-components', location = 'files/base-panel/base-panel-view.js' */
define("confluence-editor/files/base-panel/base-panel-view",["backbone","ajs","jquery"],function(b,a,c){return b.View.extend({context:null,cssContainer:"",cssPanel:"",textErrorSearch:"Error searching for attachments from Confluence. The server may be unavailable.",textErrorRetrieving:"Error retrieving attachments from Confluence. The server may be unavailable.",textDefaultErrorMessage:"Could not upload the file to Confluence. The server may be unavailable.",textUploading:"Image uploading...",initialize:function(){},createPanel:function(d){this.context=
d;this.render();var a=this;if(d=this.context.getPanel(this.panelId))d.onselect=function(){a.context.clearSelection();a.focus&&a.focus()}},render:function(){return this},getPanelElement:function(){return c(this.cssPanel,this.context.baseElement)},getContainer:function(){return c(this.cssContainer)},getForm:function(){return c("form",this.getPanelElement())},clearContainer:function(){var a=this.getContainer();a.find(".loading-message").removeClass("hidden");a.find(".warning").addClass("hidden")},clearErrors:function(){this.messenger.clearMessages()},
displayErrors:function(a){this.uploader.displayErrors(a);this.getContainer().sizeToFit()},getNoFileContainer:function(){return this.getPanelElement().find(".no-files")},getFileListContainer:function(){return this.getPanelElement().find("ul.file-list")}})});
require("confluence/module-exporter").exportModuleAsGlobal("confluence-editor/files/base-panel/base-panel-view","Confluence.Editor.FileDialog.BasePanel",function(){var b=require("underscore"),a=require("backbone");Confluence.Editor.FileDialog.eventListener=b.extend({},a.Events)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:panel-components', location = 'files/attachments-panel/attachments-panel.soy' */
// This file was automatically generated from attachments-panel.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.File.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.File == 'undefined') { Confluence.Templates.File = {}; }


Confluence.Templates.File.uploadFileForm = function(opt_data, opt_ignored) {
  return '' + ((opt_data.hasAttachPermission) ? '<div id="upload-attachment">' + ((opt_data.isNonSupportDragDrop) ? '<form action="' + soy.$$escapeHtml("/wiki") + '/pages/attachfile.action" method="post" enctype="multipart/form-data">' : '<form>') + '<label id="upload-files-button" class="aui-button upload-files"><span class="file-upload-icon">' + soy.$$escapeHtml('Upload files') + '</span>&nbsp;&nbsp;' + soy.$$escapeHtml('Upload files') + ((opt_data.isNonSupportDragDrop) ? '<input name="file_0" type="file" class="upfile invisible">' : '') + '</label>' + ((opt_data.isNonSupportDragDrop) ? '<input type="hidden" name="minorEdit_0" value="true" /><input type="hidden" name="atl_token" value="' + soy.$$escapeHtml(opt_data.atlToken) + '" />' : '') + '</form>' + ((opt_data.isNonSupportDragDrop) ? '<div class="upload-in-progress hidden">' + soy.$$escapeHtml('Image uploading...') + '</div>' : '') + '</div>' : '') + ((opt_data.hasAttachPermission) ? '<div class="divider"></div>' : '');
};
if (goog.DEBUG) {
  Confluence.Templates.File.uploadFileForm.soyTemplateName = 'Confluence.Templates.File.uploadFileForm';
}


Confluence.Templates.File.attachedFilesPanel = function(opt_data, opt_ignored) {
  return '<div id="attached-files" class="scroll-wrapper">' + aui.message.warning({title: '', closeable: 'true', content: ''}) + '<div class="loading-message hidden">' + soy.$$escapeHtml('Loading\u2026') + '</div><ul class="file-list"></ul></div>';
};
if (goog.DEBUG) {
  Confluence.Templates.File.attachedFilesPanel.soyTemplateName = 'Confluence.Templates.File.attachedFilesPanel';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:panel-components', location = 'files/attachments-panel/attachments-panel-view.js' */
define("confluence-editor/files/attachments-panel/attachments-panel-view","confluence-editor/files/file-list/file-list-view confluence-editor/files/file-item/file-item-model confluence-editor/files/file-list/file-list-collection confluence-editor/files/base-panel/base-panel-view confluence/templates ajs confluence/meta underscore window jquery confluence/attachment-uploader confluence-editor/utils/file-types-utils confluence-rest/confluence-rest".split(" "),function(m,i,n,j,k,f,h,l,e,g,o,p,q){return j.extend({id:"attachments",
panelId:"",cssPanel:".attachments-panel",cssContainer:"#attached-files",textNoFileMessage:"There are no files attached to this page.",textPanelTitle:"Attached to this page",initialize:function(a){j.prototype.initialize.call(this);this.eventListener=a.eventListener;this.context=null;this.collection=new n;this.fileListView=new m({collection:this.collection,eventListener:this.eventListener});this.xhrCount=0},render:function(){var a=this;this.eventListener.trigger("AttachmentsPanelView.render",
this);this.fileListView.updateDialogContext(this.context);this.panelId=this.context.addPanel(this.textPanelTitle,this.getPanel(),"attachments-panel");this.el=this.getPanelElement();this.$el=g(this.el);this.delegateEvents();this.fileListView.updatePanelContext({fileContainer:this.getContainer(),noFileMessage:this.textNoFileMessage,showContainerInfo:false,errors:[],displayErrors:function(b){a.uploader.clearErrors();a.uploader.displayErrors(b)}});this.uploader=this.getUploaderController(this.context);
this.messenger=this.uploader.getMessageHandler();this.collection.reset();this._canAttachFiles()?this.refresh({shouldClearSelection:true}):this.refresh({errors:["You\'ll need to ask permission to insert files here."],shouldClearSelection:true});return this},getPanel:function(){return k.File.uploadFileForm({isNonSupportDragDrop:!this._hasXhrSupport(),atlToken:h.get("atl-token"),hasAttachPermission:this._canAttachFiles()})+k.File.attachedFilesPanel()},_overideUploaderClientForNonDragDropSupport:function(){var a=
this;return{onUploadSuccess:function(b){for(var d=0;d<b.length;d++){var c=b[d].id,e=a.collection.get(c);e&&a.collection.removeFile(e);c=f.contextPath()+"/rest/prototype/1/attachment/"+c+".json";g.get(c).done(function(b){b=new i(b);a.collection.addFile(b)})}},pack:function(){a.getContainer().sizeToFit()},getDefaultErrorMessage:function(){return a.textDefaultErrorMessage},getDefaultUploadingMessage:function(){return a.textUploading},displayErrors:function(b){this.getMessageHandler().displayMessages(b);
a._showErrorIconInMessageBox();this.pack()}}},getUploaderController:function(){return o({baseElement:this.getPanelElement()},l.bind(this._overideUploaderClientForNonDragDropSupport,this))},refresh:function(a){var b=this,d=a.shouldClearSelection?this.getPanelElement().find(".loading-message"):false,c=this.xhrCount=this.xhrCount+1;f.getJSONWrap({url:this._getUrlREST(),messageHandler:this.messenger,loadingElement:d,errorMessage:this.textErrorRetrieving,successCallback:function(d){if(c===b.xhrCount){a.data=
d;b._onSuccessLoadFiles(a)}},errorCallback:l.bind(this._onErrorLoadFiles,this)})},_onSuccessLoadFiles:function(a){this.fileListView.resetFileList(a.data.attachment?a.data.attachment:a.data.images,a)},_onErrorLoadFiles:function(){this._showErrorIconInMessageBox()},_showErrorIconInMessageBox:function(){var a=this.messenger.getMessageContainer().find("ul");a.toggleClass("one-message",a.find("li").length===1);a.closest(".aui-message").append("<span class='aui-icon icon-warning'></span>")},setUploadInProgress:function(a,
b){this.eventListener.trigger("file.placeholder.process",a,b)},attachmentUploaded:function(a,b){this.eventListener.trigger("uploadingfile.completed",a,b)},attachmentUploadingCancelled:function(a){this.eventListener.trigger("uploadingfile.cancelled",a)},_hasXhrSupport:function(){var a,b;try{a=new XMLHttpRequest;b=!(!a.sendAsBinary&&!a.upload)&&!(g.browser.mozilla&&g.browser.version.indexOf("1.9.1")>-1)}catch(d){b=false}return b},addPreviewImage:function(a){var b=require("tinymce");if(e.File&&e.FileReader&&
e.FileList&&e.Blob){var d=this,b=b.isIE?1048576:5242880;a.isImage=a.nativeFile&&a.nativeFile.type&&this._isImageType(a.nativeFile.type);if(a.isImage&&a.nativeFile.size<b){var c=new FileReader;c.onload=function(){d._addFilePlaceHolderToCollection(a,c.result)};c.readAsDataURL(a.nativeFile)}else this._addFilePlaceHolderToCollection(a,null)}},_addFilePlaceHolderToCollection:function(a,b){var d=null,c=this.collection.findWhere({fileName:a.name});if(c){this.collection.removeFile(c);c.get("isFilePlaceHolder")?
c.get("previousUploadedFile")&&(d=c.get("previousUploadedFile")):d=c}d=new i({isFilePlaceHolder:true,fileName:a.name,fileId:a.id,fileNative:a.nativeFile,url:b?b:"",isImage:a.isImage,niceType:a.isImage?"Image":"",fileType:a.nativeFile.type,thumbnailUrl:b?b:"",previousUploadedFile:d});this.collection.addFile(d)},_isImageType:function(a){return p.isImage(a)},_canAttachFiles:function(){return h.getBoolean("can-attach-files")},_getUrlREST:function(){var a=parseInt(h.get("attachment-source-content-id"),
10);return q.REST.makeUrl("content/"+a+"/attachments.json")},focus:function(){this.collection.clearSelection()}})});require("confluence/module-exporter").exportModuleAsGlobal("confluence-editor/files/attachments-panel/attachments-panel-view","Confluence.Editor.FileDialog.AttachmentsPanelView");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:panel-components', location = 'files/external-panel/external-panel.soy' */
// This file was automatically generated from external-panel.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.File.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.File == 'undefined') { Confluence.Templates.File = {}; }


Confluence.Templates.File.webPanel = function(opt_data, opt_ignored) {
  return '<div class="insert-web-image"><form id="insert-web-image-form" action="#" class="aui"><fieldset class="inline"><div class="web-image-input"><label for="insert-web-image-image-url" id="insert-web-image-image-url-label">' + soy.$$escapeHtml('Image URL:') + '</label><input type="text" class="text image-url" id="insert-web-image-image-url" name="insert-web-image-image-url"></div><input type="submit" class="image-preview aui-button" value="' + soy.$$escapeHtml('Preview') + '"></fieldset></form><p class="faraway image-preview-area"></p><p class="hidden image-preview-error">' + soy.$$escapeHtml('This image couldn\x27t be loaded for preview. Please check the URL.') + '</p><p class="hidden image-preview-throbber">&nbsp;</p></div>';
};
if (goog.DEBUG) {
  Confluence.Templates.File.webPanel.soyTemplateName = 'Confluence.Templates.File.webPanel';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:panel-components', location = 'files/external-panel/external-panel-view.js' */
define("confluence-editor/files/external-panel/external-panel-view",["confluence-editor/files/base-panel/base-panel-view","confluence/templates","jquery","raphael","ajs"],function(c,e,d,f,g){return c.extend({id:"external",panelId:"",cssPanel:".web-image-panel",cssContainer:".insert-web-image",textPanelTitle:"Images from the web",template:e.File.searchPanel,events:{"submit form":"_submit","keyup input.image-url":"_checkAllowInsert","click input.image-url":"_checkAllowInsert",
"blur input.image-url":"_checkAllowInsert"},initialize:function(){c.prototype.initialize.call(this);this.context=null;this.token=0},render:function(){this.panelId=this.context.addPanel(this.textPanelTitle,this.getPanel(),"web-image-panel");this.container=this.getContainer();this.preview=this.container.find(".image-preview-area");this.throbber=this.container.find(".image-preview-throbber");this.killSpinner=null;this.error=this.container.find(".image-preview-error")},focus:function(){this._getImageInput().focus();
this._checkAllowInsert()},getPanel:function(){this.$el=d(e.File.webPanel());this.el=this.$el[0];this.delegateEvents();return this.el},_getImageInput:function(){return d("input.image-url",this.context.baseElement)},_submit:function(b){b.preventDefault();b.stopPropagation();var a=this,b=this._getImageInput().val();if("http://"===b)return!1;this.token++;var c=this.token;this.preview.addClass("faraway").html("");this.throbber.removeClass("hidden");this.killSpinner||(this.killSpinner=f.spinner(this.throbber[0],
60,"#666"));this.error.addClass("hidden");d("<img>").load(function(){if(c===a.token){a.killSpinner();a.killSpinner=null;a.throbber.addClass("hidden");a.preview.removeClass("faraway");a._checkAllowInsert()}}).error(function(){if(c===a.token){a.killSpinner();a.killSpinner=null;a.throbber.addClass("hidden");a.error.removeClass("hidden");a._checkAllowInsert()}}).appendTo(this.preview).attr("src",b)},_checkAllowInsert:function(){var b=this.$el.find("input.image-url").val();this.context.setSelectItems(""!==
b&&"http://"!==b?b:[])}})});require("confluence/module-exporter").exportModuleAsGlobal("confluence-editor/files/external-panel/external-panel-view","Confluence.Editor.FileDialog.ExternalPanelView");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:panel-components', location = 'files/search-panel/search-panel.soy' */
// This file was automatically generated from search-panel.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.File.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.File == 'undefined') { Confluence.Templates.File = {}; }


Confluence.Templates.File.searchPanel = function(opt_data, opt_ignored) {
  return '<div class="search-panel-wrapper"><div id="search-image"><form class="aui search-form" id="search-image-form" action="#"><fieldset class="inline"><div class="search-input"><label for="search-image" class="assistive">' + soy.$$escapeHtml('Search') + '</label><input autofocus type="text" class="text search-image-text" size="50" autocomplete="off"></div><select class="search-space select" id="search-image-space-select"><option value="">' + soy.$$escapeHtml('All Spaces') + '</option><option value="' + soy.$$escapeHtml(opt_data.spaceKey) + '">' + soy.$$escapeHtml(opt_data.spaceName) + '</option></select><button type="submit" class="aui-button search-button">' + soy.$$escapeHtml('Search') + '</button></fieldset></form></div><div id="searched-images" class="scroll-wrapper"><div class="loading-message hidden">' + soy.$$escapeHtml('Searching\u2026') + '</div><ul class="file-list"></ul></div></div>';
};
if (goog.DEBUG) {
  Confluence.Templates.File.searchPanel.soyTemplateName = 'Confluence.Templates.File.searchPanel';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:panel-components', location = 'files/search-panel/search-panel-view.js' */
define("confluence-editor/files/search-panel/search-panel-view","confluence-editor/files/file-item/file-item-model confluence-editor/files/file-list/file-list-view confluence-editor/files/file-list/file-list-collection confluence-editor/files/base-panel/base-panel-view confluence/templates confluence/meta confluence/defaults confluence/highlighter underscore ajs jquery confluence-rest/confluence-rest".split(" "),function(m,g,h,d,i,e,j,k,f,c,b,l){return d.extend({id:"search",panelId:"",cssPanel:".search-panel",
cssContainer:"#searched-images",template:i.File.searchPanel,events:{"submit form":"_submit"},initialize:function(){d.prototype.initialize.call(this);this.context=null;this.collection=new h;this.fileListView=new g({collection:this.collection})},getPanel:function(){this.$el=b(this.template({spaceKey:e.get("space-key"),spaceName:e.get("space-name")}));this.el=this.$el[0];this.delegateEvents();return this.el},render:function(){this.fileListView.updateDialogContext(this.context);this.panelId=this.context.addPanel("Search on other pages",
this.getPanel(),"search-panel");this.fileListView.updatePanelContext({fileContainer:this.getContainer(),noFileMessage:"No search results found.",showContainerInfo:true})},_submit:function(a){a.preventDefault();a.stopPropagation();if(this._getQuery()){this.clearContainer();this.collection.reset();this._loadImages().then(f.bind(this._onSuccessLoadFiles,this),f.bind(this._onErrorLoadFiles,this))}},_loadImages:function(){return b.ajax({type:"GET",dataType:"json",url:c.contextPath()+
l.REST.getBaseUrl()+"search.json",data:{spaceKey:this.getForm().find(".search-space").val(),query:this._getQuery(),search:"name",type:"attachment",attachmentType:[],groupResults:true,maxResultsPerGroup:50,searchParentName:true,pageSize:j.maxResults}})},_onSuccessLoadFiles:function(a){var b={result:[]};a.result&&a.result.length>0?b=a:a.group&&a.group[0]&&(b=a.group[0]);this.fileListView.highlighter=new k(this._getQuery().split(" "));this.fileListView.resetFileList(b.result,{shouldClearSelection:true})},
_onErrorLoadFiles:function(){var a=this.getContainer();a.find(".loading-message").addClass("hidden");a.append(b("<p class='warning'>"+b(this.textErrorSearch).text()+"</p>"))},_getSearchText:function(){return b("input.search-image-text",this.getForm())},_getQuery:function(){return this._getSearchText().val()||""},focus:function(){this.collection.clearSelection();this._getSearchText().focus()}})});
require("confluence/module-exporter").exportModuleAsGlobal("confluence-editor/files/search-panel/search-panel-view","Confluence.Editor.FileDialog.SearchPanelView");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:panel-components', location = 'files/file-dialog/file-dialog.soy' */
// This file was automatically generated from file-dialog.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.File.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.File == 'undefined') { Confluence.Templates.File = {}; }


Confluence.Templates.File.helpLink = function(opt_data, opt_ignored) {
  return '<div class="dialog-help-link"><a href="' + soy.$$escapeHtml("https://confluence.atlassian.com/display/ConfCloud/Display+Files+and+Images") + '" target="_blank">' + soy.$$escapeHtml('Help') + '</a></div>';
};
if (goog.DEBUG) {
  Confluence.Templates.File.helpLink.soyTemplateName = 'Confluence.Templates.File.helpLink';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:panel-components', location = 'files/file-dialog/file-dialog-view.js' */
define("confluence-editor/files/file-dialog/file-dialog-view","backbone ajs confluence/templates underscore jquery document window".split(" "),function(j,d,l,f,e,i,m){return j.View.extend({dialogId:"insert-image-dialog",ESC_KEY_CODE:27,width:840,height:530,initialize:function(a){this.urlExternalImg="";this.selectItems=[];this.submitCallback=a.submitCallback;this.cancelCallback=a.cancelCallback;this.beforeShowListeners=a.beforeShowListeners;this.panelComponents=a.panelComponents},render:function(){this._createDialog();
this.clearSelection();e(i).on("keydown.insert-image",f.bind(this._onNavigationByKey,this));return this},_createDialog:function(){var a=new d.Dialog(this.width,this.height,this.dialogId),n="Insert files and images",b="Insert";this.dialog=a;a.addHeader(n);a.addButton(b,f.bind(this._submitDialog,this),"insert");a.addCancel("Close",f.bind(this._killDialog,this));this.el=a.popup.element;this.$el=e(this.el);this.baseElement=this.el;
this.$el.attr("data-tab-default","0");this.$insertButton=this.$el.find(".dialog-button-panel .insert");e("#"+this.dialogId+" .dialog-components .dialog-title").prepend(l.File.helpLink());this.$el.find(".dialog-button-panel").append(e("<div></div>").addClass("dialog-tip").html("Hint: type \"\u003cstrong\u003e!\u003c/strong\u003e\" in the Editor to insert attached images on the page."));this._createPanels();e(i).on("hideLayer",f.bind(function(c,b,d){if(b==="popup"&&d===a.popup){d.remove();this.teardown();typeof this.cancelCallback==="function"&&this.cancelCallback()}},
this));d.bind("remove.dialog",f.bind(function(a,b){b.dialog.id===this.dialog.id&&this.teardown()},this));a.show();return a},_createPanels:function(){var a=this;e.each(this.panelComponents,function(){this&&typeof this.createPanel==="function"&&this.createPanel(a)});d.debug(this.beforeShowListeners.length+" beforeShow listeners registered.");e.each(this.beforeShowListeners,function(){typeof this==="function"&&this()})},teardown:function(){e(i).unbind(".insert-image");e(".tipsy").remove();this.undelegateEvents()},
_killDialog:function(){this.dialog.remove();this.clearSelection();typeof this.cancelCallback==="function"&&this.cancelCallback()},_submitDialog:function(){var a={url:this.urlExternalImg,contentId:d.Meta.get("attachment-source-content-id"),selectItems:this.selectItems};this.dialog.remove();typeof this.submitCallback==="function"&&this.submitCallback(a)},setSelectItems:function(a){if(typeof a==="string"){this.urlExternalImg=a;this.selectItems=[]}else{this.urlExternalImg="";this.selectItems=a}a=this.selectItems.length>
0||this.urlExternalImg;if(this.$insertButton){this.$insertButton.prop("disabled",!a);this.$insertButton.attr("aria-disabled",!a)}},clearSelection:function(){this.setSelectItems([])},insert:function(){this.$insertButton&&(!this.$insertButton.is(":disabled")||!this.$insertButton.attr("aria-disabled"))&&this.$insertButton.click()},addPanel:function(a,d,b,c){var e=this.dialog.getPage(0).panel.length;this.dialog.addPanel(a,d,b,c);return e},getPanel:function(a){return this.dialog.getPanel(a)},_onNavigationByKey:function(a){if(!e("#"+
this.dialog.id).is(":hidden")){var f=this.dialog.getCurrentPanel().body,b=f.find(".attached-file");if(!(b.length===0||e(i.activeElement).is("input[type=text], select, button"))){var c=m.tinymce.VK;switch(a.which){case c.LEFT:case c.UP:case c.RIGHT:case c.DOWN:var k=a.which,g;g=b.filter(".current");g.length||(g=b.filter(".selected"));if(g.length){g=b.index(g);var j=b.length,h={};h[c.LEFT]=-1;h[c.RIGHT]=1;h[c.UP]=-4;h[c.DOWN]=4;c=g+(h[k]?h[k]:0);b=b.eq(c<0||c>=j?g:c)}else b=b.first();b.parent().find("li.attached-file.current").removeClass("current");
b.addClass("current");b.length&&f.find(".scroll-wrapper").simpleScrollTo(b);return d.stopEvent(a);case c.SPACEBAR:f.find("li.attached-file.current").click();return d.stopEvent(a);case c.ENTER:this.insert();return d.stopEvent(a)}}}}})});require("confluence/module-exporter").exportModuleAsGlobal("confluence-editor/files/file-dialog/file-dialog-view","Confluence.Editor.FileDialog.FileDialogView");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.web.resources:dictionary', location = 'includes/js/api/dictionary.js' */
define("confluence/api/dictionary",[],function(){return function(){var a={};return{get:function(b){return a[b]},put:function(b,c){return a[b]=c},reset:function(){a={}},elements:function(){return a}}}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.web.resources:macro-js-overrides', location = 'includes/js/macro-js-overrides.js' */
define("confluence/macro-js-overrides",["confluence/api/dictionary","underscore"],function(f,e){var a=new f;return e.extend(a,{getFunction:function(b,c){var d=a.get(b);if(d&&"function"===typeof d[c])return d[c]},assignFunction:function(b,c){a.put(b,e.extend({},a.get(b),c))}})});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:space-picker', location = '/js/internal/space-resolver.js' */
define("confluence-ui-components/js/internal/space-resolver",["underscore","jquery","ajs"],function(i,b,h){var g={conf_all:"All spaces",conf_current:"Current space",conf_favorites:"Favourite spaces",conf_global:"Site spaces",conf_personal:"Personal spaces"};function e(j){var k=i.map(j,function(l){return"spaceKey="+encodeURI(l)});return k.join("&")}function f(k,l){var j=typeof l==="undefined";var m=i.escape(j?k:l);return{id:k,text:m,idOnly:j}}function a(m,p){var n={};var o=[];i.each(m,function(r){var q=d(r);if(q){n[r]=f(r,q)}else{o.push(r)}});var k;if(o.length){var l=h.contextPath()+"/rest/api/space?"+e(o);k=b.getJSON(l)}else{k=new b.Deferred();k.resolve({results:[]})}function j(r){var q=r.results;i.each(q,function(t){n[t.key]=f(t.key,t.name)});var s=i.map(m,function(t){return n[t]||f(t)});p(s)}k.done(j)}function d(j){return g[j]}var c=["conf_favorites","conf_global","conf_personal"];return{getSpaceDisplayItems:a,getSpaceCategoryDisplayName:d,getSpaceTypeKeys:function(){return c}}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:space-picker', location = '/js/space-picker.js' */
define("confluence-ui-components/js/space-picker",["underscore","ajs","jquery","confluence-ui-components/js/internal/space-resolver"],function(r,f,b,d){var a={data:null,suggestCategories:null};var p=function(s){return function(t){var u={id:t.spaceKey,text:t.spaceName};if(typeof s==="function"){return s(u)}return u}};var k;var c=function(s){return function(t,x){var w=b(t).val();if(w===""){return}var u=w.split(",");function v(y){if(!s.multiple){y=y[0]}x(y)}d.getSpaceDisplayItems(u,v)}};var e=function(t){var s;if(t.suggestCategories){var u={text:"Select a suggestion or type to search",children:r.map(t.suggestCategories,function(v){return{id:v,text:d.getSpaceCategoryDisplayName(v)}})}}return function(w){if(s){w.callback(s);return}function v(x){var y={results:[]};if(u){y.results.push(u)}if(x.length>0){y.results.push({text:"Suggested spaces",children:r.map(x,function(z){return{id:z.key,text:r.escape(z.name)}})})}s=y;w.callback(s)}b.getJSON(f.contextPath()+"/rest/recentlyviewed/1.0/recent/spaces").done(v).fail(function(){f.log("Couldn't fetch recent spaces");var x={results:[]};if(u){x.results.push(u)}w.callback(x)})}};var n=function(){return window.Select2.query.ajax({url:f.contextPath()+"/rest/quicknav/1/search?type=spacedesc&type=personalspacedesc",data:function(s){return{query:s,maxPerCategory:25}},quietMillis:250,results:function(u){var t=u.contentNameMatches;if(t.length<=1){return{results:[]}}else{var s=r.map(t[0],k);return{results:[{text:"Search results",children:s}]}}}})};function g(t){var s=n();var u=e(t);return function(v,x,w){if(v.term.length<2){return u(v)}else{if(typeof x==="function"){v.term=x(v.term)}k=p(w);return s(v)}}}function h(){var s=b(".select2-container-active").next("input");var t=s.val().trim();return(t!=="")?t.split(","):[]}function i(s){var t=r.intersection(s,d.getSpaceTypeKeys());return t.length>0}function j(s){return(typeof s.id!=="undefined")&&r.contains(d.getSpaceTypeKeys(),s.id)}function q(t,u,v){var s=[];t.forEach(function(w){if(w.children){var x=q(w.children,u,v);if(x.length){s.push(b.extend({},w,{children:x}))}}else{var y=j(w);if((u&&y)||(!u&&!y)){if(!r.contains(v,w.id)){s.push(w)}}}});return s}function m(t,v){if(!t.length||!v.length){return t}var u=i(v);var s=q(t,u,v);if(!s.length){s.push({text:"Can\'t filter by space types AND spaces",disabled:true})}return s}function o(s){var t=h();return m(s,t)}function l(t){t=r.extend({},a,t);var s={placeholder:"Select a space",formatResult:function(u,v,w){v.attr("title",b("<div/>").html(u.text).text());return b.fn.select2.defaults.formatResult.apply(this,arguments)},escapeMarkup:function(u){return u},multiple:t.multiple===true};if(t.disableMixedSpaceTypes){s.sortResults=o}if(t.data){return r.extend(s,{data:t.data})}else{return r.extend(s,{initSelection:c(t),query:g(t)})}}return{build:l,filterMixedTypesForValues:m}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:space-picker', location = '/js/internal/space-picker-legacy.js' */
window.Confluence.UI.Components.SpacePicker=require("confluence-ui-components/js/space-picker");AJS.deprecate.prop(window.Confluence.UI.Components.SpacePicker,"build",{sinceVersion:"1.4.22",extraInfo:"Use require('confluence-ui-components/js/space-picker')"});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.auiplugin:internal-@atlassian-aui-src-js-vendor-jquery-jquery-ui-jquery-ui-datepicker', location = 'node_modules/@atlassian/aui/src/js-vendor/jquery/jquery-ui/jquery.ui.datepicker.js' */
("undefined"===typeof window?global:window).__601fc554d291439a8ef8bcac7fc51f19=function(){(function(d){function B(){this.debug=!1;this._curInst=null;this._keyEvent=!1;this._disabledInputs=[];this._inDialog=this._datepickerShowing=!1;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass=
"ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass="ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:"January February March April May June July August September October November December".split(" "),monthNamesShort:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),dayNames:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),dayNamesShort:"Sun Mon Tue Wed Thu Fri Sat".split(" "),
dayNamesMin:"Su Mo Tu We Th Fr Sa".split(" "),weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",
minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1};d.extend(this._defaults,this.regional[""]);this.dpDiv=C(d('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}function C(a){return a.bind("mouseout",
function(a){a=d(a.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");a.length&&a.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(b){b=d(b.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");if(!d.datepicker._isDisabledDatepicker(D.inline?a.parent()[0]:D.input[0])&&b.length)b.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),
b.addClass("ui-state-hover"),b.hasClass("ui-datepicker-prev")&&b.addClass("ui-datepicker-prev-hover"),b.hasClass("ui-datepicker-next")&&b.addClass("ui-datepicker-next-hover")})}function z(a,b){d.extend(a,b);for(var c in b)if(null==b[c]||void 0==b[c])a[c]=b[c];return a}d.extend(d.ui,{datepicker:{version:"1.8.24"}});var x=(new Date).getTime(),D;d.extend(B.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},
setDefaults:function(a){z(this._defaults,a||{});return this},_attachDatepicker:function(a,b){var c=null,e;for(e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{};try{c[e]=eval(f)}catch(h){c[e]=f}}}e=a.nodeName.toLowerCase();f="div"==e||"span"==e;a.id||(this.uuid+=1,a.id="dp"+this.uuid);var j=this._newInst(d(a),f);j.settings=d.extend({},b||{},c||{});"input"==e?this._connectDatepicker(a,j):f&&this._inlineDatepicker(a,j)},_newInst:function(a,b){return{id:a[0].id.replace(/([^A-Za-z0-9_-])/g,
"\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:C(d('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}},_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);c.hasClass(this.markerClassName)||(this._attachments(c,b),c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",
function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),this._autoSize(b),d.data(a,"datepicker",b),b.settings.disabled&&this._disableDatepicker(a))},_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL");b.append&&b.append.remove();c&&(b.append=d('<span class="'+this._appendClass+'">'+c+"</span>"),a[e?"before":"after"](b.append));a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");("focus"==
c||"both"==c)&&a.focus(this._showDatepicker);if("button"==c||"both"==c){var c=this._get(b,"buttonText"),f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("<img/>").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d('<button type="button"></button>').addClass(this._triggerClass).html(""==f?c:d("<img/>").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trigger.click(function(){if(d.datepicker._datepickerShowing&&d.datepicker._lastInput==a[0])d.datepicker._hideDatepicker();
else{d.datepicker._datepickerShowing&&d.datepicker._lastInput!=a[0]&&d.datepicker._hideDatepicker();d.datepicker._showDatepicker(a[0])}return false})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var d=function(a){for(var b=0,c=0,d=0;d<a.length;d++)a[d].length>b&&(b=a[d].length,c=d);return c};b.setMonth(d(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(d(this._get(a,c.match(/DD/)?"dayNames":
"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=d(a);c.hasClass(this.markerClassName)||(c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),d.data(a,"datepicker",b),this._setDate(b,this._getDefaultDate(b),!0),this._updateDatepicker(b),this._updateAlternate(b),b.settings.disabled&&this._disableDatepicker(a),
b.dpDiv.css("display","block"))},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;a||(this.uuid+=1,this._dialogInput=d('<input type="text" id="dp'+this.uuid+'" style="position: absolute; top: -100px; width: 0px;"/>'),this._dialogInput.keydown(this._doKeyDown),d("body").append(this._dialogInput),a=this._dialogInst=this._newInst(this._dialogInput,!1),a.settings={},d.data(this._dialogInput[0],"datepicker",a));z(a.settings,e||{});b=b&&b.constructor==Date?this._formatDate(a,b):b;this._dialogInput.val(b);
this._pos=f?f.length?f:[f.pageX,f.pageY]:null;this._pos||(this._pos=[document.documentElement.clientWidth/2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)]);this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=!0;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);d.blockUI&&d.blockUI(this.dpDiv);
d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");"input"==e?(c.append.remove(),c.trigger.remove(),b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"==e||"span"==e)&&b.removeClass(this.markerClassName).empty()}},
_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if("input"==e)a.disabled=!1,c.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if("div"==e||"span"==e)b=b.children("."+this._inlineClass),b.children().removeClass("ui-state-disabled"),b.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled");this._disabledInputs=d.map(this._disabledInputs,
function(b){return b==a?null:b})}},_disableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if("input"==e)a.disabled=!0,c.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if("div"==e||"span"==e)b=b.children("."+this._inlineClass),b.children().addClass("ui-state-disabled"),b.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled",
"disabled");this._disabledInputs=d.map(this._disabledInputs,function(b){return b==a?null:b});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return!1;for(var b=0;b<this._disabledInputs.length;b++)if(this._disabledInputs[b]==a)return!0;return!1},_getInst:function(a){try{return d.data(a,"datepicker")}catch(b){throw"Missing instance data for this datepicker";}},_optionDatepicker:function(a,b,c){var e=this._getInst(a);if(2==arguments.length&&"string"==typeof b)return"defaults"==
b?d.extend({},d.datepicker._defaults):e?"all"==b?d.extend({},e.settings):this._get(e,b):null;var f=b||{};"string"==typeof b&&(f={},f[b]=c);if(e){this._curInst==e&&this._hideDatepicker();var h=this._getDateDatepicker(a,!0),j=this._getMinMaxDate(e,"min"),g=this._getMinMaxDate(e,"max");z(e.settings,f);null!==j&&(void 0!==f.dateFormat&&void 0===f.minDate)&&(e.settings.minDate=this._formatDate(e,j));null!==g&&(void 0!==f.dateFormat&&void 0===f.maxDate)&&(e.settings.maxDate=this._formatDate(e,g));this._attachments(d(a),
e);this._autoSize(e);this._setDate(e,h);this._updateAlternate(e);this._updateDatepicker(e)}},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){(a=this._getInst(a))&&this._updateDatepicker(a)},_setDateDatepicker:function(a,b){var c=this._getInst(a);c&&(this._setDate(c,b),this._updateDatepicker(c),this._updateAlternate(c))},_getDateDatepicker:function(a,b){var c=this._getInst(a);c&&!c.inline&&this._setDateFromField(c,b);return c?this._getDate(c):null},_doKeyDown:function(a){var b=
d.datepicker._getInst(a.target),c=!0,e=b.dpDiv.is(".ui-datepicker-rtl");b._keyEvent=!0;if(d.datepicker._datepickerShowing)switch(a.keyCode){case 9:d.datepicker._hideDatepicker();c=!1;break;case 13:return c=d("td."+d.datepicker._dayOverClass+":not(."+d.datepicker._currentClass+")",b.dpDiv),c[0]&&d.datepicker._selectDay(a.target,b.selectedMonth,b.selectedYear,c[0]),(a=d.datepicker._get(b,"onSelect"))?(c=d.datepicker._formatDate(b),a.apply(b.input?b.input[0]:null,[c,b])):d.datepicker._hideDatepicker(),
!1;case 27:d.datepicker._hideDatepicker();break;case 33:d.datepicker._adjustDate(a.target,a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 34:d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,"stepMonths"),"M");break;case 35:(a.ctrlKey||a.metaKey)&&d.datepicker._clearDate(a.target);c=a.ctrlKey||a.metaKey;break;case 36:(a.ctrlKey||a.metaKey)&&d.datepicker._gotoToday(a.target);c=a.ctrlKey||a.metaKey;
break;case 37:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,e?1:-1,"D");c=a.ctrlKey||a.metaKey;a.originalEvent.altKey&&d.datepicker._adjustDate(a.target,a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 38:(a.ctrlKey||a.metaKey)&&d.datepicker._adjustDate(a.target,-7,"D");c=a.ctrlKey||a.metaKey;break;case 39:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,e?-1:1,"D");c=a.ctrlKey||a.metaKey;a.originalEvent.altKey&&d.datepicker._adjustDate(a.target,
a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,"stepMonths"),"M");break;case 40:(a.ctrlKey||a.metaKey)&&d.datepicker._adjustDate(a.target,7,"D");c=a.ctrlKey||a.metaKey;break;default:c=!1}else 36==a.keyCode&&a.ctrlKey?d.datepicker._showDatepicker(this):c=!1;c&&(a.preventDefault(),a.stopPropagation())},_doKeyPress:function(a){var b=d.datepicker._getInst(a.target);if(d.datepicker._get(b,"constrainInput")){var b=d.datepicker._possibleChars(d.datepicker._get(b,"dateFormat")),c=String.fromCharCode(void 0==
a.charCode?a.keyCode:a.charCode);return a.ctrlKey||a.metaKey||" ">c||!b||-1<b.indexOf(c)}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal)try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a)))d.datepicker._setDateFromField(a),d.datepicker._updateAlternate(a),d.datepicker._updateDatepicker(a)}catch(b){d.datepicker.log(b)}return!0},_showDatepicker:function(a){a=a.target||a;"input"!=a.nodeName.toLowerCase()&&
(a=d("input",a.parentNode)[0]);if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a);d.datepicker._curInst&&d.datepicker._curInst!=b&&(d.datepicker._curInst.dpDiv.stop(!0,!0),b&&d.datepicker._datepickerShowing&&d.datepicker._hideDatepicker(d.datepicker._curInst.input[0]));var c=d.datepicker._get(b,"beforeShow"),c=c?c.apply(a,[a,b]):{};if(!1!==c){z(b.settings,c);b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);d.datepicker._inDialog&&
(a.value="");d.datepicker._pos||(d.datepicker._pos=d.datepicker._findPos(a),d.datepicker._pos[1]+=a.offsetHeight);var e=!1;d(a).parents().each(function(){e=e|d(this).css("position")=="fixed";return!e});e&&d.browser.opera&&(d.datepicker._pos[0]-=document.documentElement.scrollLeft,d.datepicker._pos[1]-=document.documentElement.scrollTop);c={left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.empty();b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b);
c=d.datepicker._checkOffset(b,c,e);b.dpDiv.css({position:d.datepicker._inDialog&&d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){var c=d.datepicker._get(b,"showAnim"),f=d.datepicker._get(b,"duration"),h=function(){var a=b.dpDiv.find("iframe.ui-datepicker-cover");if(a.length){var c=d.datepicker._getBorders(b.dpDiv);a.css({left:-c[0],top:-c[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex(d(a).zIndex()+1);d.datepicker._datepickerShowing=
!0;if(d.effects&&d.effects[c])b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f,h);else b.dpDiv[c||"show"](c?f:null,h);(!c||!f)&&h();b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst=b}}}},_updateDatepicker:function(a){this.maxRows=4;var b=d.datepicker._getBorders(a.dpDiv);D=a;a.dpDiv.empty().append(this._generateHTML(a));this._attachHandlers(a);var c=a.dpDiv.find("iframe.ui-datepicker-cover");c.length&&c.css({left:-b[0],top:-b[1],width:a.dpDiv.outerWidth(),
height:a.dpDiv.outerHeight()});a.dpDiv.find("."+this._dayOverClass+" a").mouseover();b=this._getNumberOfMonths(a);c=b[1];a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");1<c&&a.dpDiv.addClass("ui-datepicker-multi-"+c).css("width",17*c+"em");a.dpDiv[(1!=b[0]||1!=b[1]?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");a==d.datepicker._curInst&&(d.datepicker._datepickerShowing&&
a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input[0]!=document.activeElement)&&a.input.focus();if(a.yearshtml){var e=a.yearshtml;setTimeout(function(){e===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml);e=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(a){return{thin:1,medium:2,thick:3}[a]||a};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var e=
a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(),h=a.input?a.input.outerWidth():0,j=a.input?a.input.outerHeight():0,g=document.documentElement.clientWidth+(c?0:d(document).scrollLeft()),i=document.documentElement.clientHeight+(c?0:d(document).scrollTop());b.left-=this._get(a,"isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+j?d(document).scrollTop():0;b.left-=Math.min(b.left,b.left+e>g&&g>e?Math.abs(b.left+e-g):0);b.top-=Math.min(b.top,
b.top+f>i&&i>f?Math.abs(f+j):0);return b},_findPos:function(a){for(var b=this._getInst(a),b=this._get(b,"isRTL");a&&("hidden"==a.type||1!=a.nodeType||d.expr.filters.hidden(a));)a=a[b?"previousSibling":"nextSibling"];a=d(a).offset();return[a.left,a.top]},_hideDatepicker:function(a){var b=this._curInst;if(b&&!(a&&b!=d.data(a,"datepicker"))&&this._datepickerShowing){var a=this._get(b,"showAnim"),c=this._get(b,"duration"),e=function(){d.datepicker._tidyDialog(b)};if(d.effects&&d.effects[a])b.dpDiv.hide(a,
d.datepicker._get(b,"showOptions"),c,e);else b.dpDiv["slideDown"==a?"slideUp":"fadeIn"==a?"fadeOut":"hide"](a?c:null,e);a||e();this._datepickerShowing=!1;(a=this._get(b,"onClose"))&&a.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b]);this._lastInput=null;this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),d.blockUI&&(d.unblockUI(),d("body").append(this.dpDiv)));this._inDialog=!1}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},
_checkExternalClick:function(a){if(d.datepicker._curInst){var a=d(a.target),b=d.datepicker._getInst(a[0]);(a[0].id!=d.datepicker._mainDivId&&0==a.parents("#"+d.datepicker._mainDivId).length&&!a.hasClass(d.datepicker.markerClassName)&&!a.closest("."+d.datepicker._triggerClass).length&&d.datepicker._datepickerShowing&&(!d.datepicker._inDialog||!d.blockUI)||a.hasClass(d.datepicker.markerClassName)&&d.datepicker._curInst!=b)&&d.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){var a=d(a),e=this._getInst(a[0]);
this._isDisabledDatepicker(a[0])||(this._adjustInstDate(e,b+("M"==c?this._get(e,"showCurrentAtPos"):0),c),this._updateDatepicker(e))},_gotoToday:function(a){var a=d(a),b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay)b.selectedDay=b.currentDay,b.drawMonth=b.selectedMonth=b.currentMonth,b.drawYear=b.selectedYear=b.currentYear;else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth=b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._notifyChange(b);this._adjustDate(a)},
_selectMonthYear:function(a,b,c){var a=d(a),e=this._getInst(a[0]);e["selected"+("M"==c?"Month":"Year")]=e["draw"+("M"==c?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a)},_selectDay:function(a,b,c,e){var f=d(a);!d(e).hasClass(this._unselectableClass)&&!this._isDisabledDatepicker(f[0])&&(f=this._getInst(f[0]),f.selectedDay=f.currentDay=d("a",e).html(),f.selectedMonth=f.currentMonth=b,f.selectedYear=f.currentYear=c,this._selectDate(a,this._formatDate(f,
f.currentDay,f.currentMonth,f.currentYear)))},_clearDate:function(a){a=d(a);this._getInst(a[0]);this._selectDate(a,"")},_selectDate:function(a,b){var c=d(a),c=this._getInst(c[0]),b=null!=b?b:this._formatDate(c);c.input&&c.input.val(b);this._updateAlternate(c);var e=this._get(c,"onSelect");e?e.apply(c.input?c.input[0]:null,[b,c]):c.input&&c.input.trigger("change");c.inline?this._updateDatepicker(c):(this._hideDatepicker(),this._lastInput=c.input[0],"object"!=typeof c.input[0]&&c.input.focus(),this._lastInput=
null)},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a));d(b).each(function(){d(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[0<a&&6>a,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b=a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(null==
a||null==b)throw"Invalid arguments";b="object"==typeof b?b.toString():b+"";if(""==b)return null;for(var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff,e="string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames,j=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,i=c=-1,p=-1,r=-1,k=!1,m=function(b){(b=y+1<a.length&&
a.charAt(y+1)==b)&&y++;return b},l=function(a){var c=m(a),a=RegExp("^\\d{1,"+("@"==a?14:"!"==a?20:"y"==a&&c?4:"o"==a?3:2)+"}"),a=b.substring(u).match(a);if(!a)throw"Missing number at position "+u;u+=a[0].length;return parseInt(a[0],10)},n=function(a,c,e){var a=d.map(m(a)?e:c,function(a,b){return[[b,a]]}).sort(function(a,b){return-(a[1].length-b[1].length)}),f=-1;d.each(a,function(a,c){var d=c[1];if(b.substr(u,d.length).toLowerCase()==d.toLowerCase())return f=c[0],u+=d.length,!1});if(-1!=f)return f+
1;throw"Unknown name at position "+u;},s=function(){if(b.charAt(u)!=a.charAt(y))throw"Unexpected literal at position "+u;u++},u=0,y=0;y<a.length;y++)if(k)"'"==a.charAt(y)&&!m("'")?k=!1:s();else switch(a.charAt(y)){case "d":p=l("d");break;case "D":n("D",f,h);break;case "o":r=l("o");break;case "m":i=l("m");break;case "M":i=n("M",j,g);break;case "y":c=l("y");break;case "@":var v=new Date(l("@")),c=v.getFullYear(),i=v.getMonth()+1,p=v.getDate();break;case "!":v=new Date((l("!")-this._ticksTo1970)/1E4);
c=v.getFullYear();i=v.getMonth()+1;p=v.getDate();break;case "'":m("'")?s():k=!0;break;default:s()}if(u<b.length)throw"Extra/unparsed characters found in date: "+b.substring(u);-1==c?c=(new Date).getFullYear():100>c&&(c+=(new Date).getFullYear()-(new Date).getFullYear()%100+(c<=e?0:-100));if(-1<r){i=1;p=r;do{e=this._getDaysInMonth(c,i-1);if(p<=e)break;i++;p-=e}while(1)}v=this._daylightSavingAdjust(new Date(c,i-1,p));if(v.getFullYear()!=c||v.getMonth()+1!=i||v.getDate()!=p)throw"Invalid date";return v},
ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:864E9*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(a,b,c){if(!b)return"";var d=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,
c=(c?c.monthNames:null)||this._defaults.monthNames,j=function(b){(b=r+1<a.length&&a.charAt(r+1)==b)&&r++;return b},g=function(a,b,c){b=""+b;if(j(a))for(;b.length<c;)b="0"+b;return b},i="",p=!1;if(b)for(var r=0;r<a.length;r++)if(p)"'"==a.charAt(r)&&!j("'")?p=!1:i+=a.charAt(r);else switch(a.charAt(r)){case "d":i+=g("d",b.getDate(),2);break;case "D":var k;k=b.getDay();var m=d,l=f;k=j("D")?l[k]:m[k];i+=k;break;case "o":i+=g("o",Math.round(((new Date(b.getFullYear(),b.getMonth(),b.getDate())).getTime()-
(new Date(b.getFullYear(),0,0)).getTime())/864E5),3);break;case "m":i+=g("m",b.getMonth()+1,2);break;case "M":k=b.getMonth();m=h;l=c;k=j("M")?l[k]:m[k];i+=k;break;case "y":i+=j("y")?b.getFullYear():(10>b.getYear()%100?"0":"")+b.getYear()%100;break;case "@":i+=b.getTime();break;case "!":i+=1E4*b.getTime()+this._ticksTo1970;break;case "'":j("'")?i+="'":p=!0;break;default:i+=a.charAt(r)}return i},_possibleChars:function(a){for(var b="",c=!1,d=function(b){(b=f+1<a.length&&a.charAt(f+1)==b)&&f++;return b},
f=0;f<a.length;f++)if(c)"'"==a.charAt(f)&&!d("'")?c=!1:b+=a.charAt(f);else switch(a.charAt(f)){case "d":case "m":case "y":case "@":b+="0123456789";break;case "D":case "M":return null;case "'":d("'")?b+="'":c=!0;break;default:b+=a.charAt(f)}return b},_get:function(a,b){return void 0!==a.settings[b]?a.settings[b]:this._defaults[b]},_setDateFromField:function(a,b){if(a.input.val()!=a.lastVal){var c=this._get(a,"dateFormat"),d=a.lastVal=a.input?a.input.val():null,f,h;f=h=this._getDefaultDate(a);var j=
this._getFormatConfig(a);try{f=this.parseDate(c,d,j)||h}catch(g){this.log(g),d=b?"":d}a.selectedDay=f.getDate();a.drawMonth=a.selectedMonth=f.getMonth();a.drawYear=a.selectedYear=f.getFullYear();a.currentDay=d?f.getDate():0;a.currentMonth=d?f.getMonth():0;a.currentYear=d?f.getFullYear():0;this._adjustInstDate(a)}},_getDefaultDate:function(a){return this._restrictMinMax(a,this._determineDate(a,this._get(a,"defaultDate"),new Date))},_determineDate:function(a,b,c){if(null==b||""===b)b=c;else{var e;if("string"==
typeof b)a:{try{e=d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),b,d.datepicker._getFormatConfig(a));break a}catch(f){}var h=(b.toLowerCase().match(/^c/)?d.datepicker._getDate(a):null)||new Date,a=h.getFullYear();e=h.getMonth();for(var h=h.getDate(),j=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,g=j.exec(b);g;){switch(g[2]||"d"){case "d":case "D":h+=parseInt(g[1],10);break;case "w":case "W":h+=7*parseInt(g[1],10);break;case "m":case "M":e+=parseInt(g[1],10);h=Math.min(h,d.datepicker._getDaysInMonth(a,
e));break;case "y":case "Y":a+=parseInt(g[1],10),h=Math.min(h,d.datepicker._getDaysInMonth(a,e))}g=j.exec(b)}e=new Date(a,e,h)}else"number"==typeof b?isNaN(b)?b=c:(a=new Date,a.setDate(a.getDate()+b),b=a):b=new Date(b.getTime()),e=b;b=e}if(b=b&&"Invalid Date"==b.toString()?c:b)b.setHours(0),b.setMinutes(0),b.setSeconds(0),b.setMilliseconds(0);return this._daylightSavingAdjust(b)},_daylightSavingAdjust:function(a){if(!a)return null;a.setHours(12<a.getHours()?a.getHours()+2:0);return a},_setDate:function(a,
b,c){var d=!b,f=a.selectedMonth,h=a.selectedYear,b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();(f!=a.selectedMonth||h!=a.selectedYear)&&!c&&this._notifyChange(a);this._adjustInstDate(a);a.input&&a.input.val(d?"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||a.input&&""==a.input.val()?null:this._daylightSavingAdjust(new Date(a.currentYear,
a.currentMonth,a.currentDay))},_attachHandlers:function(a){var b=this._get(a,"stepMonths"),c="#"+a.id.replace(/\\\\/g,"\\");a.dpDiv.find("[data-handler]").map(function(){d(this).bind(this.getAttribute("data-event"),{prev:function(){window["DP_jQuery_"+x].datepicker._adjustDate(c,-b,"M")},next:function(){window["DP_jQuery_"+x].datepicker._adjustDate(c,+b,"M")},hide:function(){window["DP_jQuery_"+x].datepicker._hideDatepicker()},today:function(){window["DP_jQuery_"+x].datepicker._gotoToday(c)},selectDay:function(){window["DP_jQuery_"+
x].datepicker._selectDay(c,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this);return!1},selectMonth:function(){window["DP_jQuery_"+x].datepicker._selectMonthYear(c,this,"M");return!1},selectYear:function(){window["DP_jQuery_"+x].datepicker._selectMonthYear(c,this,"Y");return!1}}[this.getAttribute("data-handler")])})},_generateHTML:function(a){var b=new Date,b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate())),c=this._get(a,"isRTL"),e=this._get(a,"showButtonPanel"),
f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFormat"),j=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),i=this._get(a,"stepMonths"),p=1!=j[0]||1!=j[1],r=this._daylightSavingAdjust(!a.currentDay?new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),k=this._getMinMaxDate(a,"min"),m=this._getMinMaxDate(a,"max"),g=a.drawMonth-g,l=a.drawYear;0>g&&(g+=12,l--);if(m)for(var n=this._daylightSavingAdjust(new Date(m.getFullYear(),m.getMonth()-j[0]*j[1]+1,m.getDate())),
n=k&&n<k?k:n;this._daylightSavingAdjust(new Date(l,g,1))>n;)g--,0>g&&(g=11,l--);a.drawMonth=g;a.drawYear=l;var n=this._get(a,"prevText"),n=!h?n:this.formatDate(n,this._daylightSavingAdjust(new Date(l,g-i,1)),this._getFormatConfig(a)),n=this._canAdjustMonth(a,-1,l,g)?'<a class="ui-datepicker-prev ui-corner-all" data-handler="prev" data-event="click" title="'+n+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+n+"</span></a>":f?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+
n+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+n+"</span></a>",s=this._get(a,"nextText"),s=!h?s:this.formatDate(s,this._daylightSavingAdjust(new Date(l,g+i,1)),this._getFormatConfig(a)),f=this._canAdjustMonth(a,1,l,g)?'<a class="ui-datepicker-next ui-corner-all" data-handler="next" data-event="click" title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>":f?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+
(c?"w":"e")+'">'+s+"</span></a>",i=this._get(a,"currentText"),s=this._get(a,"gotoCurrent")&&a.currentDay?r:b,i=!h?i:this.formatDate(i,s,this._getFormatConfig(a)),h=!a.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" data-handler="hide" data-event="click">'+this._get(a,"closeText")+"</button>":"",e=e?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(c?h:"")+(this._isInRange(a,s)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" data-handler="today" data-event="click">'+
i+"</button>":"")+(c?"":h)+"</div>":"",h=parseInt(this._get(a,"firstDay"),10),h=isNaN(h)?0:h,i=this._get(a,"showWeek"),s=this._get(a,"dayNames");this._get(a,"dayNamesShort");var u=this._get(a,"dayNamesMin"),y=this._get(a,"monthNames"),v=this._get(a,"monthNamesShort"),x=this._get(a,"beforeShowDay"),z=this._get(a,"showOtherMonths"),D=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var B=this._getDefaultDate(a),E="",F=0;F<j[0];F++){var I="";this.maxRows=4;for(var G=0;G<j[1];G++){var C=
this._daylightSavingAdjust(new Date(l,g,a.selectedDay)),t=" ui-corner-all",q="";if(p){q+='<div class="ui-datepicker-group';if(1<j[1])switch(G){case 0:q+=" ui-datepicker-group-first";t=" ui-corner-"+(c?"right":"left");break;case j[1]-1:q+=" ui-datepicker-group-last";t=" ui-corner-"+(c?"left":"right");break;default:q+=" ui-datepicker-group-middle",t=""}q+='">'}for(var q=q+('<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+t+'">'+(/all|left/.test(t)&&0==F?c?f:n:"")+(/all|right/.test(t)&&
0==F?c?n:f:"")+this._generateMonthYearHeader(a,g,l,k,m,0<F||0<G,y,v)+'</div><table class="ui-datepicker-calendar"><thead><tr>'),w=i?'<th class="ui-datepicker-week-col">'+this._get(a,"weekHeader")+"</th>":"",t=0;7>t;t++)var o=(t+h)%7,w=w+("<th"+(5<=(t+h+6)%7?' class="ui-datepicker-week-end"':"")+'><span title="'+s[o]+'">'+u[o]+"</span></th>");q+=w+"</tr></thead><tbody>";w=this._getDaysInMonth(l,g);l==a.selectedYear&&g==a.selectedMonth&&(a.selectedDay=Math.min(a.selectedDay,w));t=(this._getFirstDayOfMonth(l,
g)-h+7)%7;w=Math.ceil((t+w)/7);this.maxRows=w=p?this.maxRows>w?this.maxRows:w:w;for(var o=this._daylightSavingAdjust(new Date(l,g,1-t)),L=0;L<w;L++){for(var q=q+"<tr>",J=!i?"":'<td class="ui-datepicker-week-col">'+this._get(a,"calculateWeek")(o)+"</td>",t=0;7>t;t++){var H=x?x.apply(a.input?a.input[0]:null,[o]):[!0,""],A=o.getMonth()!=g,K=A&&!D||!H[0]||k&&o<k||m&&o>m,J=J+('<td class="'+(5<=(t+h+6)%7?" ui-datepicker-week-end":"")+(A?" ui-datepicker-other-month":"")+(o.getTime()==C.getTime()&&g==a.selectedMonth&&
a._keyEvent||B.getTime()==o.getTime()&&B.getTime()==C.getTime()?" "+this._dayOverClass:"")+(K?" "+this._unselectableClass+" ui-state-disabled":"")+(A&&!z?"":" "+H[1]+(o.getTime()==r.getTime()?" "+this._currentClass:"")+(o.getTime()==b.getTime()?" ui-datepicker-today":""))+'"'+((!A||z)&&H[2]?' title="'+H[2]+'"':"")+(K?"":' data-handler="selectDay" data-event="click" data-month="'+o.getMonth()+'" data-year="'+o.getFullYear()+'"')+">"+(A&&!z?"&#xa0;":K?'<span class="ui-state-default">'+o.getDate()+"</span>":
'<a class="ui-state-default'+(o.getTime()==b.getTime()?" ui-state-highlight":"")+(o.getTime()==r.getTime()?" ui-state-active":"")+(A?" ui-priority-secondary":"")+'" href="#">'+o.getDate()+"</a>")+"</td>");o.setDate(o.getDate()+1);o=this._daylightSavingAdjust(o)}q+=J+"</tr>"}g++;11<g&&(g=0,l++);q+="</tbody></table>"+(p?"</div>"+(0<j[0]&&G==j[1]-1?'<div class="ui-datepicker-row-break"></div>':""):"");I+=q}E+=I}E+=e+(d.browser.msie&&7>parseInt(d.browser.version,10)&&!a.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':
"");a._keyEvent=!1;return E},_generateMonthYearHeader:function(a,b,c,d,f,h,j,g){var i=this._get(a,"changeMonth"),p=this._get(a,"changeYear"),r=this._get(a,"showMonthAfterYear"),k='<div class="ui-datepicker-title">',m="";if(h||!i)m+='<span class="ui-datepicker-month">'+j[b]+"</span>";else{for(var j=d&&d.getFullYear()==c,l=f&&f.getFullYear()==c,m=m+'<select class="ui-datepicker-month" data-handler="selectMonth" data-event="change">',n=0;12>n;n++)if((!j||n>=d.getMonth())&&(!l||n<=f.getMonth()))m+='<option value="'+
n+'"'+(n==b?' selected="selected"':"")+">"+g[n]+"</option>";m+="</select>"}r||(k+=m+(h||!i||!p?"&#xa0;":""));if(!a.yearshtml)if(a.yearshtml="",h||!p)k+='<span class="ui-datepicker-year">'+c+"</span>";else{var g=this._get(a,"yearRange").split(":"),s=(new Date).getFullYear(),j=function(a){a=a.match(/c[+-].*/)?c+parseInt(a.substring(1),10):a.match(/[+-].*/)?s+parseInt(a,10):parseInt(a,10);return isNaN(a)?s:a},b=j(g[0]),g=Math.max(b,j(g[1]||"")),b=d?Math.max(b,d.getFullYear()):b,g=f?Math.min(g,f.getFullYear()):
g;for(a.yearshtml+='<select class="ui-datepicker-year" data-handler="selectYear" data-event="change">';b<=g;b++)a.yearshtml+='<option value="'+b+'"'+(b==c?' selected="selected"':"")+">"+b+"</option>";a.yearshtml+="</select>";k+=a.yearshtml;a.yearshtml=null}k+=this._get(a,"yearSuffix");r&&(k+=(h||!i||!p?"&#xa0;":"")+m);return k+"</div>"},_adjustInstDate:function(a,b,c){var d=a.drawYear+("Y"==c?b:0),f=a.drawMonth+("M"==c?b:0),b=Math.min(a.selectedDay,this._getDaysInMonth(d,f))+("D"==c?b:0),d=this._restrictMinMax(a,
this._daylightSavingAdjust(new Date(d,f,b)));a.selectedDay=d.getDate();a.drawMonth=a.selectedMonth=d.getMonth();a.drawYear=a.selectedYear=d.getFullYear();("M"==c||"Y"==c)&&this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max"),c=c&&b<c?c:b;return d&&c>d?d:c},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");b&&b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,
"numberOfMonths");return null==a?[1,1]:"number"==typeof a?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,d){var f=this._getNumberOfMonths(a),c=this._daylightSavingAdjust(new Date(c,d+(0>b?b:f[0]*f[1]),1));0>b&&c.setDate(this._getDaysInMonth(c.getFullYear(),
c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!d||b.getTime()<=d.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff"),b="string"!=typeof b?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,
"monthNames")}},_formatDate:function(a,b,c,d){b||(a.currentDay=a.selectedDay,a.currentMonth=a.selectedMonth,a.currentYear=a.selectedYear);b=b?"object"==typeof b?b:this._daylightSavingAdjust(new Date(d,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker=function(a){if(!this.length)return this;d.datepicker.initialized||(d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv),
d.datepicker.initialized=!0);var b=Array.prototype.slice.call(arguments,1);return"string"==typeof a&&("isDisabled"==a||"getDate"==a||"widget"==a)||"option"==a&&2==arguments.length&&"string"==typeof arguments[1]?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b)):this.each(function(){typeof a=="string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new B;d.datepicker.initialized=!1;d.datepicker.uuid=
(new Date).getTime();d.datepicker.version="1.8.24";window["DP_jQuery_"+x]=d})(jQuery);return{}}.call(this);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.auiplugin:internal-@atlassian-aui-src-js-aui-date-picker', location = 'node_modules/@atlassian/aui/src/js/aui/date-picker.js' */
("undefined"===typeof window?global:window).__b9c4058e54a8cdac47eaf6f5b237bbb4=function(){function g(a){return a&&a.__esModule?a:{"default":a}}function f(a,c){var d,g,b,i,m;d={};i=w++;b=(0,e.default)(a);b.attr("data-aui-dp-uuid",i);c=e.default.extend(void 0,f.prototype.defaultOptions,c);d.getField=function(){return b};d.getOptions=function(){return c};g=function(){var a,g,h,k,s,u,p,q,j,n;d.hide=function(){j.hide()};d.show=function(){j.show()};d.setDate=function(b){"undefined"!==typeof a&&a.datepicker("setDate",
b)};d.getDate=function(){if("undefined"!==typeof a)return a.datepicker("getDate")};u=function(f){n.off();if(c.hint){var l=(0,e.default)("<div/>").addClass("aui-datepicker-hint");l.append("<span/>").text(c.hint);n.append(l)}a=(0,e.default)("<div/>");a.attr("data-aui-dp-popup-uuid",i);n.append(a);l={dateFormat:c.dateFormat,defaultDate:b.val(),maxDate:b.attr("max"),minDate:b.attr("min"),nextText:">",onSelect:function(a){b.val(a);b.change();d.hide();p=!0;b.focus();c.onSelect&&c.onSelect.call(this,a)},
onChangeMonthYear:function(){setTimeout(j.refresh,0)},prevText:"<"};e.default.extend(l,f);-1<c.firstDay&&(l.firstDay=c.firstDay);"undefined"!==typeof b.attr("step")&&t.log("WARNING: The date picker polyfill currently does not support the step attribute!");a.datepicker(l);(0,e.default)("body").on("keydown",g);b.on("focusout keydown",h);b.on("propertychange keyup input paste",s)};g=function(a){var c=(0,e.default)(a.target),f=c.closest(n).length||c.is(b),g=c.closest(".ui-datepicker-header").length;!f&&
!g||a.keyCode===x.default.ESCAPE?d.hide():c[0]!==b[0]&&a.preventDefault()};h=function(){q||((0,e.default)("body").on("focus blur click mousedown","*",g),q=!0)};k=function(){p?p=!1:d.show()};s=function(){if((0,e.default)(this).val())a.datepicker("setDate",b.val()),a.datepicker("option",{maxDate:b.attr("max"),minDate:b.attr("min")})};d.destroyPolyfill=function(){d.hide();b.attr("placeholder",null);b.off("propertychange keyup input paste",s);b.off("focus click",k);b.off("focusout keydown",h);(0,e.default)("body").off("keydown",
h);f.prototype.browserSupportsDateField&&(b[0].type="date");"undefined"!==typeof a&&a.datepicker("destroy");delete d.destroyPolyfill;delete d.show;delete d.hide};q=p=!1;c.languageCode in f.prototype.localisations||(c.languageCode="");var v=f.prototype.localisations,r="",o=240;"large"===v.size&&(o=325,r="aui-datepicker-dialog-large");o={hideCallback:function(){(0,e.default)("body").off("focus blur click mousedown","*",g);q=false;m&&m._datePickerPopup&&delete m._datePickerPopup},hideDelay:null,noBind:!0,
persistent:!0,closeOthers:!1,width:o};c.position&&(o.calculatePositions=function(a,b){var d=(0,e.default)(a[0]);return c.position.call(this,d,b)});j=(0,y.default)(b,void 0,function(b,c,d){if(typeof a==="undefined"){n=b;u(v)}if(m=(0,e.default)(c).closest(".aui-inline-dialog").get(0))m._datePickerPopup=j;d()},o);j.addClass("aui-datepicker-dialog");j.addClass(r);b.on("focus click",k);b.attr("placeholder",c.dateFormat);if(c.overrideBrowserDefault&&f.prototype.browserSupportsDateField&&(b[0].type="text",
r=b[0].getAttribute("value")))b[0].value=r};d.reset=function(){"function"===typeof d.destroyPolyfill&&d.destroyPolyfill();(!f.prototype.browserSupportsDateField||c.overrideBrowserDefault)&&g()};d.reset();return d}var h={};"use strict";Object.defineProperty(h,"__esModule",{value:!0});var e=g(__307d3e18fd611f85395c67cddeb1fe24);__601fc554d291439a8ef8bcac7fc51f19;var t;var a=__cf890abdf040e0993fb71f2f839bc972;if(a&&a.__esModule)t=a;else{var k={};if(null!=a)for(var i in a)Object.prototype.hasOwnProperty.call(a,
i)&&(k[i]=a[i]);k.default=a;t=k}i=g(__4d02fe17b8e885a34493e34af3d145dd);var y=g(__8a05e920b7d8181524465449ac7de6d2),x=g(__509557c937caa8763def39004fcf3193),a=g(__d74c881c8f23921c15438d0f30c99f80),w=0;f.prototype.browserSupportsDateField="date"===(0,e.default)('<input type="date" />')[0].type;f.prototype.defaultOptions={overrideBrowserDefault:!1,firstDay:-1,languageCode:(0,e.default)("html").attr("lang")||"en-AU",dateFormat:e.default.datepicker.W3C};f.prototype.localisations={dayNames:[a.default.getText("ajs.datepicker.localisations.day-names.sunday"),
a.default.getText("ajs.datepicker.localisations.day-names.monday"),a.default.getText("ajs.datepicker.localisations.day-names.tuesday"),a.default.getText("ajs.datepicker.localisations.day-names.wednesday"),a.default.getText("ajs.datepicker.localisations.day-names.thursday"),a.default.getText("ajs.datepicker.localisations.day-names.friday"),a.default.getText("ajs.datepicker.localisations.day-names.saturday")],dayNamesMin:[a.default.getText("ajs.datepicker.localisations.day-names-min.sunday"),a.default.getText("ajs.datepicker.localisations.day-names-min.monday"),
a.default.getText("ajs.datepicker.localisations.day-names-min.tuesday"),a.default.getText("ajs.datepicker.localisations.day-names-min.wednesday"),a.default.getText("ajs.datepicker.localisations.day-names-min.thursday"),a.default.getText("ajs.datepicker.localisations.day-names-min.friday"),a.default.getText("ajs.datepicker.localisations.day-names-min.saturday")],firstDay:a.default.getText("ajs.datepicker.localisations.first-day"),isRTL:"true"===a.default.getText("ajs.datepicker.localisations.is-RTL")?
!0:!1,monthNames:[a.default.getText("ajs.datepicker.localisations.month-names.january"),a.default.getText("ajs.datepicker.localisations.month-names.february"),a.default.getText("ajs.datepicker.localisations.month-names.march"),a.default.getText("ajs.datepicker.localisations.month-names.april"),a.default.getText("ajs.datepicker.localisations.month-names.may"),a.default.getText("ajs.datepicker.localisations.month-names.june"),a.default.getText("ajs.datepicker.localisations.month-names.july"),a.default.getText("ajs.datepicker.localisations.month-names.august"),
a.default.getText("ajs.datepicker.localisations.month-names.september"),a.default.getText("ajs.datepicker.localisations.month-names.october"),a.default.getText("ajs.datepicker.localisations.month-names.november"),a.default.getText("ajs.datepicker.localisations.month-names.december")],showMonthAfterYear:"true"===a.default.getText("ajs.datepicker.localisations.show-month-after-year")?!0:!1,yearSuffix:a.default.getText("ajs.datepicker.localisations.year-suffix")};e.default.fn.datePicker=function(a){return new f(this,
a)};(0,i.default)("DatePicker",f);h.default=f;return h=h["default"]}.call(this);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.auiplugin:internal-jquery-ui-datepicker', location = 'node_modules/@atlassian/aui/src/js-vendor/jquery/jquery-ui/jquery.ui.datepicker.js' */
("undefined"===typeof window?global:window).__601fc554d291439a8ef8bcac7fc51f19=function(){(function(d){function B(){this.debug=!1;this._curInst=null;this._keyEvent=!1;this._disabledInputs=[];this._inDialog=this._datepickerShowing=!1;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass=
"ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass="ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:"January February March April May June July August September October November December".split(" "),monthNamesShort:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),dayNames:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),dayNamesShort:"Sun Mon Tue Wed Thu Fri Sat".split(" "),
dayNamesMin:"Su Mo Tu We Th Fr Sa".split(" "),weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",
minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1};d.extend(this._defaults,this.regional[""]);this.dpDiv=C(d('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}function C(a){return a.bind("mouseout",
function(a){a=d(a.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");a.length&&a.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(b){b=d(b.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");if(!d.datepicker._isDisabledDatepicker(D.inline?a.parent()[0]:D.input[0])&&b.length)b.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),
b.addClass("ui-state-hover"),b.hasClass("ui-datepicker-prev")&&b.addClass("ui-datepicker-prev-hover"),b.hasClass("ui-datepicker-next")&&b.addClass("ui-datepicker-next-hover")})}function z(a,b){d.extend(a,b);for(var c in b)if(null==b[c]||void 0==b[c])a[c]=b[c];return a}d.extend(d.ui,{datepicker:{version:"1.8.24"}});var x=(new Date).getTime(),D;d.extend(B.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},
setDefaults:function(a){z(this._defaults,a||{});return this},_attachDatepicker:function(a,b){var c=null,e;for(e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{};try{c[e]=eval(f)}catch(h){c[e]=f}}}e=a.nodeName.toLowerCase();f="div"==e||"span"==e;a.id||(this.uuid+=1,a.id="dp"+this.uuid);var j=this._newInst(d(a),f);j.settings=d.extend({},b||{},c||{});"input"==e?this._connectDatepicker(a,j):f&&this._inlineDatepicker(a,j)},_newInst:function(a,b){return{id:a[0].id.replace(/([^A-Za-z0-9_-])/g,
"\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:C(d('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}},_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);c.hasClass(this.markerClassName)||(this._attachments(c,b),c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",
function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),this._autoSize(b),d.data(a,"datepicker",b),b.settings.disabled&&this._disableDatepicker(a))},_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL");b.append&&b.append.remove();c&&(b.append=d('<span class="'+this._appendClass+'">'+c+"</span>"),a[e?"before":"after"](b.append));a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");("focus"==
c||"both"==c)&&a.focus(this._showDatepicker);if("button"==c||"both"==c){var c=this._get(b,"buttonText"),f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("<img/>").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d('<button type="button"></button>').addClass(this._triggerClass).html(""==f?c:d("<img/>").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trigger.click(function(){if(d.datepicker._datepickerShowing&&d.datepicker._lastInput==a[0])d.datepicker._hideDatepicker();
else{d.datepicker._datepickerShowing&&d.datepicker._lastInput!=a[0]&&d.datepicker._hideDatepicker();d.datepicker._showDatepicker(a[0])}return false})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var d=function(a){for(var b=0,c=0,d=0;d<a.length;d++)a[d].length>b&&(b=a[d].length,c=d);return c};b.setMonth(d(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(d(this._get(a,c.match(/DD/)?"dayNames":
"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=d(a);c.hasClass(this.markerClassName)||(c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),d.data(a,"datepicker",b),this._setDate(b,this._getDefaultDate(b),!0),this._updateDatepicker(b),this._updateAlternate(b),b.settings.disabled&&this._disableDatepicker(a),
b.dpDiv.css("display","block"))},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;a||(this.uuid+=1,this._dialogInput=d('<input type="text" id="dp'+this.uuid+'" style="position: absolute; top: -100px; width: 0px;"/>'),this._dialogInput.keydown(this._doKeyDown),d("body").append(this._dialogInput),a=this._dialogInst=this._newInst(this._dialogInput,!1),a.settings={},d.data(this._dialogInput[0],"datepicker",a));z(a.settings,e||{});b=b&&b.constructor==Date?this._formatDate(a,b):b;this._dialogInput.val(b);
this._pos=f?f.length?f:[f.pageX,f.pageY]:null;this._pos||(this._pos=[document.documentElement.clientWidth/2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)]);this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=!0;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);d.blockUI&&d.blockUI(this.dpDiv);
d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");"input"==e?(c.append.remove(),c.trigger.remove(),b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"==e||"span"==e)&&b.removeClass(this.markerClassName).empty()}},
_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if("input"==e)a.disabled=!1,c.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if("div"==e||"span"==e)b=b.children("."+this._inlineClass),b.children().removeClass("ui-state-disabled"),b.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled");this._disabledInputs=d.map(this._disabledInputs,
function(b){return b==a?null:b})}},_disableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if("input"==e)a.disabled=!0,c.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if("div"==e||"span"==e)b=b.children("."+this._inlineClass),b.children().addClass("ui-state-disabled"),b.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled",
"disabled");this._disabledInputs=d.map(this._disabledInputs,function(b){return b==a?null:b});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return!1;for(var b=0;b<this._disabledInputs.length;b++)if(this._disabledInputs[b]==a)return!0;return!1},_getInst:function(a){try{return d.data(a,"datepicker")}catch(b){throw"Missing instance data for this datepicker";}},_optionDatepicker:function(a,b,c){var e=this._getInst(a);if(2==arguments.length&&"string"==typeof b)return"defaults"==
b?d.extend({},d.datepicker._defaults):e?"all"==b?d.extend({},e.settings):this._get(e,b):null;var f=b||{};"string"==typeof b&&(f={},f[b]=c);if(e){this._curInst==e&&this._hideDatepicker();var h=this._getDateDatepicker(a,!0),j=this._getMinMaxDate(e,"min"),g=this._getMinMaxDate(e,"max");z(e.settings,f);null!==j&&(void 0!==f.dateFormat&&void 0===f.minDate)&&(e.settings.minDate=this._formatDate(e,j));null!==g&&(void 0!==f.dateFormat&&void 0===f.maxDate)&&(e.settings.maxDate=this._formatDate(e,g));this._attachments(d(a),
e);this._autoSize(e);this._setDate(e,h);this._updateAlternate(e);this._updateDatepicker(e)}},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){(a=this._getInst(a))&&this._updateDatepicker(a)},_setDateDatepicker:function(a,b){var c=this._getInst(a);c&&(this._setDate(c,b),this._updateDatepicker(c),this._updateAlternate(c))},_getDateDatepicker:function(a,b){var c=this._getInst(a);c&&!c.inline&&this._setDateFromField(c,b);return c?this._getDate(c):null},_doKeyDown:function(a){var b=
d.datepicker._getInst(a.target),c=!0,e=b.dpDiv.is(".ui-datepicker-rtl");b._keyEvent=!0;if(d.datepicker._datepickerShowing)switch(a.keyCode){case 9:d.datepicker._hideDatepicker();c=!1;break;case 13:return c=d("td."+d.datepicker._dayOverClass+":not(."+d.datepicker._currentClass+")",b.dpDiv),c[0]&&d.datepicker._selectDay(a.target,b.selectedMonth,b.selectedYear,c[0]),(a=d.datepicker._get(b,"onSelect"))?(c=d.datepicker._formatDate(b),a.apply(b.input?b.input[0]:null,[c,b])):d.datepicker._hideDatepicker(),
!1;case 27:d.datepicker._hideDatepicker();break;case 33:d.datepicker._adjustDate(a.target,a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 34:d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,"stepMonths"),"M");break;case 35:(a.ctrlKey||a.metaKey)&&d.datepicker._clearDate(a.target);c=a.ctrlKey||a.metaKey;break;case 36:(a.ctrlKey||a.metaKey)&&d.datepicker._gotoToday(a.target);c=a.ctrlKey||a.metaKey;
break;case 37:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,e?1:-1,"D");c=a.ctrlKey||a.metaKey;a.originalEvent.altKey&&d.datepicker._adjustDate(a.target,a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 38:(a.ctrlKey||a.metaKey)&&d.datepicker._adjustDate(a.target,-7,"D");c=a.ctrlKey||a.metaKey;break;case 39:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,e?-1:1,"D");c=a.ctrlKey||a.metaKey;a.originalEvent.altKey&&d.datepicker._adjustDate(a.target,
a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,"stepMonths"),"M");break;case 40:(a.ctrlKey||a.metaKey)&&d.datepicker._adjustDate(a.target,7,"D");c=a.ctrlKey||a.metaKey;break;default:c=!1}else 36==a.keyCode&&a.ctrlKey?d.datepicker._showDatepicker(this):c=!1;c&&(a.preventDefault(),a.stopPropagation())},_doKeyPress:function(a){var b=d.datepicker._getInst(a.target);if(d.datepicker._get(b,"constrainInput")){var b=d.datepicker._possibleChars(d.datepicker._get(b,"dateFormat")),c=String.fromCharCode(void 0==
a.charCode?a.keyCode:a.charCode);return a.ctrlKey||a.metaKey||" ">c||!b||-1<b.indexOf(c)}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal)try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a)))d.datepicker._setDateFromField(a),d.datepicker._updateAlternate(a),d.datepicker._updateDatepicker(a)}catch(b){d.datepicker.log(b)}return!0},_showDatepicker:function(a){a=a.target||a;"input"!=a.nodeName.toLowerCase()&&
(a=d("input",a.parentNode)[0]);if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a);d.datepicker._curInst&&d.datepicker._curInst!=b&&(d.datepicker._curInst.dpDiv.stop(!0,!0),b&&d.datepicker._datepickerShowing&&d.datepicker._hideDatepicker(d.datepicker._curInst.input[0]));var c=d.datepicker._get(b,"beforeShow"),c=c?c.apply(a,[a,b]):{};if(!1!==c){z(b.settings,c);b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);d.datepicker._inDialog&&
(a.value="");d.datepicker._pos||(d.datepicker._pos=d.datepicker._findPos(a),d.datepicker._pos[1]+=a.offsetHeight);var e=!1;d(a).parents().each(function(){e=e|d(this).css("position")=="fixed";return!e});e&&d.browser.opera&&(d.datepicker._pos[0]-=document.documentElement.scrollLeft,d.datepicker._pos[1]-=document.documentElement.scrollTop);c={left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.empty();b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b);
c=d.datepicker._checkOffset(b,c,e);b.dpDiv.css({position:d.datepicker._inDialog&&d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){var c=d.datepicker._get(b,"showAnim"),f=d.datepicker._get(b,"duration"),h=function(){var a=b.dpDiv.find("iframe.ui-datepicker-cover");if(a.length){var c=d.datepicker._getBorders(b.dpDiv);a.css({left:-c[0],top:-c[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex(d(a).zIndex()+1);d.datepicker._datepickerShowing=
!0;if(d.effects&&d.effects[c])b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f,h);else b.dpDiv[c||"show"](c?f:null,h);(!c||!f)&&h();b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst=b}}}},_updateDatepicker:function(a){this.maxRows=4;var b=d.datepicker._getBorders(a.dpDiv);D=a;a.dpDiv.empty().append(this._generateHTML(a));this._attachHandlers(a);var c=a.dpDiv.find("iframe.ui-datepicker-cover");c.length&&c.css({left:-b[0],top:-b[1],width:a.dpDiv.outerWidth(),
height:a.dpDiv.outerHeight()});a.dpDiv.find("."+this._dayOverClass+" a").mouseover();b=this._getNumberOfMonths(a);c=b[1];a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");1<c&&a.dpDiv.addClass("ui-datepicker-multi-"+c).css("width",17*c+"em");a.dpDiv[(1!=b[0]||1!=b[1]?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");a==d.datepicker._curInst&&(d.datepicker._datepickerShowing&&
a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input[0]!=document.activeElement)&&a.input.focus();if(a.yearshtml){var e=a.yearshtml;setTimeout(function(){e===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml);e=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(a){return{thin:1,medium:2,thick:3}[a]||a};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var e=
a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(),h=a.input?a.input.outerWidth():0,j=a.input?a.input.outerHeight():0,g=document.documentElement.clientWidth+(c?0:d(document).scrollLeft()),i=document.documentElement.clientHeight+(c?0:d(document).scrollTop());b.left-=this._get(a,"isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+j?d(document).scrollTop():0;b.left-=Math.min(b.left,b.left+e>g&&g>e?Math.abs(b.left+e-g):0);b.top-=Math.min(b.top,
b.top+f>i&&i>f?Math.abs(f+j):0);return b},_findPos:function(a){for(var b=this._getInst(a),b=this._get(b,"isRTL");a&&("hidden"==a.type||1!=a.nodeType||d.expr.filters.hidden(a));)a=a[b?"previousSibling":"nextSibling"];a=d(a).offset();return[a.left,a.top]},_hideDatepicker:function(a){var b=this._curInst;if(b&&!(a&&b!=d.data(a,"datepicker"))&&this._datepickerShowing){var a=this._get(b,"showAnim"),c=this._get(b,"duration"),e=function(){d.datepicker._tidyDialog(b)};if(d.effects&&d.effects[a])b.dpDiv.hide(a,
d.datepicker._get(b,"showOptions"),c,e);else b.dpDiv["slideDown"==a?"slideUp":"fadeIn"==a?"fadeOut":"hide"](a?c:null,e);a||e();this._datepickerShowing=!1;(a=this._get(b,"onClose"))&&a.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b]);this._lastInput=null;this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),d.blockUI&&(d.unblockUI(),d("body").append(this.dpDiv)));this._inDialog=!1}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},
_checkExternalClick:function(a){if(d.datepicker._curInst){var a=d(a.target),b=d.datepicker._getInst(a[0]);(a[0].id!=d.datepicker._mainDivId&&0==a.parents("#"+d.datepicker._mainDivId).length&&!a.hasClass(d.datepicker.markerClassName)&&!a.closest("."+d.datepicker._triggerClass).length&&d.datepicker._datepickerShowing&&(!d.datepicker._inDialog||!d.blockUI)||a.hasClass(d.datepicker.markerClassName)&&d.datepicker._curInst!=b)&&d.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){var a=d(a),e=this._getInst(a[0]);
this._isDisabledDatepicker(a[0])||(this._adjustInstDate(e,b+("M"==c?this._get(e,"showCurrentAtPos"):0),c),this._updateDatepicker(e))},_gotoToday:function(a){var a=d(a),b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay)b.selectedDay=b.currentDay,b.drawMonth=b.selectedMonth=b.currentMonth,b.drawYear=b.selectedYear=b.currentYear;else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth=b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._notifyChange(b);this._adjustDate(a)},
_selectMonthYear:function(a,b,c){var a=d(a),e=this._getInst(a[0]);e["selected"+("M"==c?"Month":"Year")]=e["draw"+("M"==c?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a)},_selectDay:function(a,b,c,e){var f=d(a);!d(e).hasClass(this._unselectableClass)&&!this._isDisabledDatepicker(f[0])&&(f=this._getInst(f[0]),f.selectedDay=f.currentDay=d("a",e).html(),f.selectedMonth=f.currentMonth=b,f.selectedYear=f.currentYear=c,this._selectDate(a,this._formatDate(f,
f.currentDay,f.currentMonth,f.currentYear)))},_clearDate:function(a){a=d(a);this._getInst(a[0]);this._selectDate(a,"")},_selectDate:function(a,b){var c=d(a),c=this._getInst(c[0]),b=null!=b?b:this._formatDate(c);c.input&&c.input.val(b);this._updateAlternate(c);var e=this._get(c,"onSelect");e?e.apply(c.input?c.input[0]:null,[b,c]):c.input&&c.input.trigger("change");c.inline?this._updateDatepicker(c):(this._hideDatepicker(),this._lastInput=c.input[0],"object"!=typeof c.input[0]&&c.input.focus(),this._lastInput=
null)},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a));d(b).each(function(){d(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[0<a&&6>a,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b=a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(null==
a||null==b)throw"Invalid arguments";b="object"==typeof b?b.toString():b+"";if(""==b)return null;for(var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff,e="string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames,j=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,i=c=-1,p=-1,r=-1,k=!1,m=function(b){(b=y+1<a.length&&
a.charAt(y+1)==b)&&y++;return b},l=function(a){var c=m(a),a=RegExp("^\\d{1,"+("@"==a?14:"!"==a?20:"y"==a&&c?4:"o"==a?3:2)+"}"),a=b.substring(u).match(a);if(!a)throw"Missing number at position "+u;u+=a[0].length;return parseInt(a[0],10)},n=function(a,c,e){var a=d.map(m(a)?e:c,function(a,b){return[[b,a]]}).sort(function(a,b){return-(a[1].length-b[1].length)}),f=-1;d.each(a,function(a,c){var d=c[1];if(b.substr(u,d.length).toLowerCase()==d.toLowerCase())return f=c[0],u+=d.length,!1});if(-1!=f)return f+
1;throw"Unknown name at position "+u;},s=function(){if(b.charAt(u)!=a.charAt(y))throw"Unexpected literal at position "+u;u++},u=0,y=0;y<a.length;y++)if(k)"'"==a.charAt(y)&&!m("'")?k=!1:s();else switch(a.charAt(y)){case "d":p=l("d");break;case "D":n("D",f,h);break;case "o":r=l("o");break;case "m":i=l("m");break;case "M":i=n("M",j,g);break;case "y":c=l("y");break;case "@":var v=new Date(l("@")),c=v.getFullYear(),i=v.getMonth()+1,p=v.getDate();break;case "!":v=new Date((l("!")-this._ticksTo1970)/1E4);
c=v.getFullYear();i=v.getMonth()+1;p=v.getDate();break;case "'":m("'")?s():k=!0;break;default:s()}if(u<b.length)throw"Extra/unparsed characters found in date: "+b.substring(u);-1==c?c=(new Date).getFullYear():100>c&&(c+=(new Date).getFullYear()-(new Date).getFullYear()%100+(c<=e?0:-100));if(-1<r){i=1;p=r;do{e=this._getDaysInMonth(c,i-1);if(p<=e)break;i++;p-=e}while(1)}v=this._daylightSavingAdjust(new Date(c,i-1,p));if(v.getFullYear()!=c||v.getMonth()+1!=i||v.getDate()!=p)throw"Invalid date";return v},
ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:864E9*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(a,b,c){if(!b)return"";var d=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,
c=(c?c.monthNames:null)||this._defaults.monthNames,j=function(b){(b=r+1<a.length&&a.charAt(r+1)==b)&&r++;return b},g=function(a,b,c){b=""+b;if(j(a))for(;b.length<c;)b="0"+b;return b},i="",p=!1;if(b)for(var r=0;r<a.length;r++)if(p)"'"==a.charAt(r)&&!j("'")?p=!1:i+=a.charAt(r);else switch(a.charAt(r)){case "d":i+=g("d",b.getDate(),2);break;case "D":var k;k=b.getDay();var m=d,l=f;k=j("D")?l[k]:m[k];i+=k;break;case "o":i+=g("o",Math.round(((new Date(b.getFullYear(),b.getMonth(),b.getDate())).getTime()-
(new Date(b.getFullYear(),0,0)).getTime())/864E5),3);break;case "m":i+=g("m",b.getMonth()+1,2);break;case "M":k=b.getMonth();m=h;l=c;k=j("M")?l[k]:m[k];i+=k;break;case "y":i+=j("y")?b.getFullYear():(10>b.getYear()%100?"0":"")+b.getYear()%100;break;case "@":i+=b.getTime();break;case "!":i+=1E4*b.getTime()+this._ticksTo1970;break;case "'":j("'")?i+="'":p=!0;break;default:i+=a.charAt(r)}return i},_possibleChars:function(a){for(var b="",c=!1,d=function(b){(b=f+1<a.length&&a.charAt(f+1)==b)&&f++;return b},
f=0;f<a.length;f++)if(c)"'"==a.charAt(f)&&!d("'")?c=!1:b+=a.charAt(f);else switch(a.charAt(f)){case "d":case "m":case "y":case "@":b+="0123456789";break;case "D":case "M":return null;case "'":d("'")?b+="'":c=!0;break;default:b+=a.charAt(f)}return b},_get:function(a,b){return void 0!==a.settings[b]?a.settings[b]:this._defaults[b]},_setDateFromField:function(a,b){if(a.input.val()!=a.lastVal){var c=this._get(a,"dateFormat"),d=a.lastVal=a.input?a.input.val():null,f,h;f=h=this._getDefaultDate(a);var j=
this._getFormatConfig(a);try{f=this.parseDate(c,d,j)||h}catch(g){this.log(g),d=b?"":d}a.selectedDay=f.getDate();a.drawMonth=a.selectedMonth=f.getMonth();a.drawYear=a.selectedYear=f.getFullYear();a.currentDay=d?f.getDate():0;a.currentMonth=d?f.getMonth():0;a.currentYear=d?f.getFullYear():0;this._adjustInstDate(a)}},_getDefaultDate:function(a){return this._restrictMinMax(a,this._determineDate(a,this._get(a,"defaultDate"),new Date))},_determineDate:function(a,b,c){if(null==b||""===b)b=c;else{var e;if("string"==
typeof b)a:{try{e=d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),b,d.datepicker._getFormatConfig(a));break a}catch(f){}var h=(b.toLowerCase().match(/^c/)?d.datepicker._getDate(a):null)||new Date,a=h.getFullYear();e=h.getMonth();for(var h=h.getDate(),j=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,g=j.exec(b);g;){switch(g[2]||"d"){case "d":case "D":h+=parseInt(g[1],10);break;case "w":case "W":h+=7*parseInt(g[1],10);break;case "m":case "M":e+=parseInt(g[1],10);h=Math.min(h,d.datepicker._getDaysInMonth(a,
e));break;case "y":case "Y":a+=parseInt(g[1],10),h=Math.min(h,d.datepicker._getDaysInMonth(a,e))}g=j.exec(b)}e=new Date(a,e,h)}else"number"==typeof b?isNaN(b)?b=c:(a=new Date,a.setDate(a.getDate()+b),b=a):b=new Date(b.getTime()),e=b;b=e}if(b=b&&"Invalid Date"==b.toString()?c:b)b.setHours(0),b.setMinutes(0),b.setSeconds(0),b.setMilliseconds(0);return this._daylightSavingAdjust(b)},_daylightSavingAdjust:function(a){if(!a)return null;a.setHours(12<a.getHours()?a.getHours()+2:0);return a},_setDate:function(a,
b,c){var d=!b,f=a.selectedMonth,h=a.selectedYear,b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();(f!=a.selectedMonth||h!=a.selectedYear)&&!c&&this._notifyChange(a);this._adjustInstDate(a);a.input&&a.input.val(d?"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||a.input&&""==a.input.val()?null:this._daylightSavingAdjust(new Date(a.currentYear,
a.currentMonth,a.currentDay))},_attachHandlers:function(a){var b=this._get(a,"stepMonths"),c="#"+a.id.replace(/\\\\/g,"\\");a.dpDiv.find("[data-handler]").map(function(){d(this).bind(this.getAttribute("data-event"),{prev:function(){window["DP_jQuery_"+x].datepicker._adjustDate(c,-b,"M")},next:function(){window["DP_jQuery_"+x].datepicker._adjustDate(c,+b,"M")},hide:function(){window["DP_jQuery_"+x].datepicker._hideDatepicker()},today:function(){window["DP_jQuery_"+x].datepicker._gotoToday(c)},selectDay:function(){window["DP_jQuery_"+
x].datepicker._selectDay(c,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this);return!1},selectMonth:function(){window["DP_jQuery_"+x].datepicker._selectMonthYear(c,this,"M");return!1},selectYear:function(){window["DP_jQuery_"+x].datepicker._selectMonthYear(c,this,"Y");return!1}}[this.getAttribute("data-handler")])})},_generateHTML:function(a){var b=new Date,b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate())),c=this._get(a,"isRTL"),e=this._get(a,"showButtonPanel"),
f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFormat"),j=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),i=this._get(a,"stepMonths"),p=1!=j[0]||1!=j[1],r=this._daylightSavingAdjust(!a.currentDay?new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),k=this._getMinMaxDate(a,"min"),m=this._getMinMaxDate(a,"max"),g=a.drawMonth-g,l=a.drawYear;0>g&&(g+=12,l--);if(m)for(var n=this._daylightSavingAdjust(new Date(m.getFullYear(),m.getMonth()-j[0]*j[1]+1,m.getDate())),
n=k&&n<k?k:n;this._daylightSavingAdjust(new Date(l,g,1))>n;)g--,0>g&&(g=11,l--);a.drawMonth=g;a.drawYear=l;var n=this._get(a,"prevText"),n=!h?n:this.formatDate(n,this._daylightSavingAdjust(new Date(l,g-i,1)),this._getFormatConfig(a)),n=this._canAdjustMonth(a,-1,l,g)?'<a class="ui-datepicker-prev ui-corner-all" data-handler="prev" data-event="click" title="'+n+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+n+"</span></a>":f?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+
n+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+n+"</span></a>",s=this._get(a,"nextText"),s=!h?s:this.formatDate(s,this._daylightSavingAdjust(new Date(l,g+i,1)),this._getFormatConfig(a)),f=this._canAdjustMonth(a,1,l,g)?'<a class="ui-datepicker-next ui-corner-all" data-handler="next" data-event="click" title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>":f?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+
(c?"w":"e")+'">'+s+"</span></a>",i=this._get(a,"currentText"),s=this._get(a,"gotoCurrent")&&a.currentDay?r:b,i=!h?i:this.formatDate(i,s,this._getFormatConfig(a)),h=!a.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" data-handler="hide" data-event="click">'+this._get(a,"closeText")+"</button>":"",e=e?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(c?h:"")+(this._isInRange(a,s)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" data-handler="today" data-event="click">'+
i+"</button>":"")+(c?"":h)+"</div>":"",h=parseInt(this._get(a,"firstDay"),10),h=isNaN(h)?0:h,i=this._get(a,"showWeek"),s=this._get(a,"dayNames");this._get(a,"dayNamesShort");var u=this._get(a,"dayNamesMin"),y=this._get(a,"monthNames"),v=this._get(a,"monthNamesShort"),x=this._get(a,"beforeShowDay"),z=this._get(a,"showOtherMonths"),D=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var B=this._getDefaultDate(a),E="",F=0;F<j[0];F++){var I="";this.maxRows=4;for(var G=0;G<j[1];G++){var C=
this._daylightSavingAdjust(new Date(l,g,a.selectedDay)),t=" ui-corner-all",q="";if(p){q+='<div class="ui-datepicker-group';if(1<j[1])switch(G){case 0:q+=" ui-datepicker-group-first";t=" ui-corner-"+(c?"right":"left");break;case j[1]-1:q+=" ui-datepicker-group-last";t=" ui-corner-"+(c?"left":"right");break;default:q+=" ui-datepicker-group-middle",t=""}q+='">'}for(var q=q+('<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+t+'">'+(/all|left/.test(t)&&0==F?c?f:n:"")+(/all|right/.test(t)&&
0==F?c?n:f:"")+this._generateMonthYearHeader(a,g,l,k,m,0<F||0<G,y,v)+'</div><table class="ui-datepicker-calendar"><thead><tr>'),w=i?'<th class="ui-datepicker-week-col">'+this._get(a,"weekHeader")+"</th>":"",t=0;7>t;t++)var o=(t+h)%7,w=w+("<th"+(5<=(t+h+6)%7?' class="ui-datepicker-week-end"':"")+'><span title="'+s[o]+'">'+u[o]+"</span></th>");q+=w+"</tr></thead><tbody>";w=this._getDaysInMonth(l,g);l==a.selectedYear&&g==a.selectedMonth&&(a.selectedDay=Math.min(a.selectedDay,w));t=(this._getFirstDayOfMonth(l,
g)-h+7)%7;w=Math.ceil((t+w)/7);this.maxRows=w=p?this.maxRows>w?this.maxRows:w:w;for(var o=this._daylightSavingAdjust(new Date(l,g,1-t)),L=0;L<w;L++){for(var q=q+"<tr>",J=!i?"":'<td class="ui-datepicker-week-col">'+this._get(a,"calculateWeek")(o)+"</td>",t=0;7>t;t++){var H=x?x.apply(a.input?a.input[0]:null,[o]):[!0,""],A=o.getMonth()!=g,K=A&&!D||!H[0]||k&&o<k||m&&o>m,J=J+('<td class="'+(5<=(t+h+6)%7?" ui-datepicker-week-end":"")+(A?" ui-datepicker-other-month":"")+(o.getTime()==C.getTime()&&g==a.selectedMonth&&
a._keyEvent||B.getTime()==o.getTime()&&B.getTime()==C.getTime()?" "+this._dayOverClass:"")+(K?" "+this._unselectableClass+" ui-state-disabled":"")+(A&&!z?"":" "+H[1]+(o.getTime()==r.getTime()?" "+this._currentClass:"")+(o.getTime()==b.getTime()?" ui-datepicker-today":""))+'"'+((!A||z)&&H[2]?' title="'+H[2]+'"':"")+(K?"":' data-handler="selectDay" data-event="click" data-month="'+o.getMonth()+'" data-year="'+o.getFullYear()+'"')+">"+(A&&!z?"&#xa0;":K?'<span class="ui-state-default">'+o.getDate()+"</span>":
'<a class="ui-state-default'+(o.getTime()==b.getTime()?" ui-state-highlight":"")+(o.getTime()==r.getTime()?" ui-state-active":"")+(A?" ui-priority-secondary":"")+'" href="#">'+o.getDate()+"</a>")+"</td>");o.setDate(o.getDate()+1);o=this._daylightSavingAdjust(o)}q+=J+"</tr>"}g++;11<g&&(g=0,l++);q+="</tbody></table>"+(p?"</div>"+(0<j[0]&&G==j[1]-1?'<div class="ui-datepicker-row-break"></div>':""):"");I+=q}E+=I}E+=e+(d.browser.msie&&7>parseInt(d.browser.version,10)&&!a.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':
"");a._keyEvent=!1;return E},_generateMonthYearHeader:function(a,b,c,d,f,h,j,g){var i=this._get(a,"changeMonth"),p=this._get(a,"changeYear"),r=this._get(a,"showMonthAfterYear"),k='<div class="ui-datepicker-title">',m="";if(h||!i)m+='<span class="ui-datepicker-month">'+j[b]+"</span>";else{for(var j=d&&d.getFullYear()==c,l=f&&f.getFullYear()==c,m=m+'<select class="ui-datepicker-month" data-handler="selectMonth" data-event="change">',n=0;12>n;n++)if((!j||n>=d.getMonth())&&(!l||n<=f.getMonth()))m+='<option value="'+
n+'"'+(n==b?' selected="selected"':"")+">"+g[n]+"</option>";m+="</select>"}r||(k+=m+(h||!i||!p?"&#xa0;":""));if(!a.yearshtml)if(a.yearshtml="",h||!p)k+='<span class="ui-datepicker-year">'+c+"</span>";else{var g=this._get(a,"yearRange").split(":"),s=(new Date).getFullYear(),j=function(a){a=a.match(/c[+-].*/)?c+parseInt(a.substring(1),10):a.match(/[+-].*/)?s+parseInt(a,10):parseInt(a,10);return isNaN(a)?s:a},b=j(g[0]),g=Math.max(b,j(g[1]||"")),b=d?Math.max(b,d.getFullYear()):b,g=f?Math.min(g,f.getFullYear()):
g;for(a.yearshtml+='<select class="ui-datepicker-year" data-handler="selectYear" data-event="change">';b<=g;b++)a.yearshtml+='<option value="'+b+'"'+(b==c?' selected="selected"':"")+">"+b+"</option>";a.yearshtml+="</select>";k+=a.yearshtml;a.yearshtml=null}k+=this._get(a,"yearSuffix");r&&(k+=(h||!i||!p?"&#xa0;":"")+m);return k+"</div>"},_adjustInstDate:function(a,b,c){var d=a.drawYear+("Y"==c?b:0),f=a.drawMonth+("M"==c?b:0),b=Math.min(a.selectedDay,this._getDaysInMonth(d,f))+("D"==c?b:0),d=this._restrictMinMax(a,
this._daylightSavingAdjust(new Date(d,f,b)));a.selectedDay=d.getDate();a.drawMonth=a.selectedMonth=d.getMonth();a.drawYear=a.selectedYear=d.getFullYear();("M"==c||"Y"==c)&&this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max"),c=c&&b<c?c:b;return d&&c>d?d:c},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");b&&b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,
"numberOfMonths");return null==a?[1,1]:"number"==typeof a?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,d){var f=this._getNumberOfMonths(a),c=this._daylightSavingAdjust(new Date(c,d+(0>b?b:f[0]*f[1]),1));0>b&&c.setDate(this._getDaysInMonth(c.getFullYear(),
c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!d||b.getTime()<=d.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff"),b="string"!=typeof b?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,
"monthNames")}},_formatDate:function(a,b,c,d){b||(a.currentDay=a.selectedDay,a.currentMonth=a.selectedMonth,a.currentYear=a.selectedYear);b=b?"object"==typeof b?b:this._daylightSavingAdjust(new Date(d,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker=function(a){if(!this.length)return this;d.datepicker.initialized||(d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv),
d.datepicker.initialized=!0);var b=Array.prototype.slice.call(arguments,1);return"string"==typeof a&&("isDisabled"==a||"getDate"==a||"widget"==a)||"option"==a&&2==arguments.length&&"string"==typeof arguments[1]?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b)):this.each(function(){typeof a=="string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new B;d.datepicker.initialized=!1;d.datepicker.uuid=
(new Date).getTime();d.datepicker.version="1.8.24";window["DP_jQuery_"+x]=d})(jQuery);return{}}.call(this);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.auiplugin:internal-@atlassian-aui-src-js-vendor-jquery-plugins-jquery-select2', location = 'node_modules/@atlassian/aui/src/js-vendor/jquery/plugins/jquery.select2.js' */
("undefined"===typeof window?global:window).__f8808db850ac1b5b58d33da133a8f08d=function(){var y=jQuery;"undefined"==typeof y.fn.each2&&y.extend(y.fn,{each2:function(a){for(var b=y([0]),c=-1,d=this.length;++c<d&&(b.context=b[0]=this[c])&&!1!==a.call(b[0],c,b););return this}});var e=jQuery,w=function(a){var b,c,d,g;if(!a||1>a.length)return a;b="";c=0;for(d=a.length;c<d;c++)g=a.charAt(c),b+=O[g]||g;return b},k=function(a,b){for(var c=0,d=b.length;c<d;c+=1)if(m(a,b[c]))return c;return-1},m=function(a,
b){return a===b?!0:void 0===a||void 0===b||null===a||null===b?!1:a.constructor===String?a+""===b+"":b.constructor===String?b+""===a+"":!1},B=function(a,b){var c,d,g;if(null===a||1>a.length)return[];c=a.split(b);d=0;for(g=c.length;d<g;d+=1)c[d]=e.trim(c[d]);return c},G=function(a){a.on("keydown",function(){void 0===e.data(a,"keyup-change-value")&&e.data(a,"keyup-change-value",a.val())});a.on("keyup",function(){var b=e.data(a,"keyup-change-value");void 0!==b&&a.val()!==b&&(e.removeData(a,"keyup-change-value"),
a.trigger("keyup-change"))})},H=function(a,b,c){var c=c||void 0,d;return function(){var g=arguments;window.clearTimeout(d);d=window.setTimeout(function(){b.apply(c,g)},a)}},j=function(a){a.preventDefault();a.stopPropagation()},z=function(a,b,c){var d,g=[],h;(d=a.attr("class"))&&e((""+d).split(" ")).each2(function(){0===this.indexOf("select2-")&&g.push(this)});(d=b.attr("class"))&&e((""+d).split(" ")).each2(function(){0!==this.indexOf("select2-")&&(h=c(this))&&g.push(h)});a.attr("class",g.join(" "))},
I=function(a,b,c,d){var g=w(a.toUpperCase()).indexOf(w(b.toUpperCase())),b=b.length;0>g?c.push(d(a)):(c.push(d(a.substring(0,g))),c.push("<span class='select2-match'>"),c.push(d(a.substring(g,g+b))),c.push("</span>"),c.push(d(a.substring(g+b,a.length))))},J=function(a){var b={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},K=function(a){var b,c=null,d=a.quietMillis||100,g=a.url,h=this;return function(l){window.clearTimeout(b);
b=window.setTimeout(function(){var b=a.data,d=g,t=a.transport||e.fn.select2.ajaxDefaults.transport,f=e.extend({},e.fn.select2.ajaxDefaults.params,{type:a.type||"GET",cache:a.cache||!1,jsonpCallback:a.jsonpCallback||void 0,dataType:a.dataType||"json"}),b=b?b.call(h,l.term,l.page,l.context):null,d="function"===typeof d?d.call(h,l.term,l.page,l.context):d;c&&c.abort();a.params&&(e.isFunction(a.params)?e.extend(f,a.params.call(h)):e.extend(f,a.params));e.extend(f,{url:d,dataType:a.dataType,data:b,success:function(b){b=
a.results(b,l.page);l.callback(b)}});c=t.call(h,f)},d)}},L=function(a){var b=a,c,d,g=function(a){return""+a.text};e.isArray(b)&&(d=b,b={results:d});!1===e.isFunction(b)&&(d=b,b=function(){return d});a=b();a.text&&(g=a.text,e.isFunction(g)||(c=a.text,g=function(a){return a[c]}));return function(a){var c=a.term,d={results:[]},n;if(c==="")a.callback(b());else{n=function(b,d){var i,f,b=b[0];if(b.children){i={};for(f in b)b.hasOwnProperty(f)&&(i[f]=b[f]);i.children=[];e(b.children).each2(function(a,b){n(b,
i.children)});(i.children.length||a.matcher(c,g(i),b))&&d.push(i)}else a.matcher(c,g(b),b)&&d.push(b)};e(b().results).each2(function(a,b){n(b,d.results)});a.callback(d)}}},M=function(a){var b=e.isFunction(a);return function(c){var d=c.term,g={results:[]};e(b?a():a).each(function(){var a=void 0!==this.text,b=a?this.text:this;if(""===d||c.matcher(d,b))g.results.push(a?this:{id:this,text:this})});c.callback(g)}},r=function(a,b){if(e.isFunction(a))return!0;if(!a)return!1;throw Error(b+" must be a function or a falsy value");
},o=function(a){return e.isFunction(a)?a():a},N=function(a){var b=0;e.each(a,function(a,d){d.children?b+=N(d.children):b++});return b},P=function(a,b,c,d){var g=a,h=!1,e,i,f,t;if(d.createSearchChoice&&d.tokenSeparators&&!(1>d.tokenSeparators.length)){for(;;){h=-1;i=0;for(f=d.tokenSeparators.length;i<f&&!(t=d.tokenSeparators[i],h=a.indexOf(t),0<=h);i++);if(0>h)break;e=a.substring(0,h);a=a.substring(h+t.length);if(0<e.length&&(e=d.createSearchChoice.call(this,e,b),void 0!==e&&null!==e&&void 0!==d.id(e)&&
null!==d.id(e))){h=!1;i=0;for(f=b.length;i<f;i++)if(m(d.id(e),d.id(b[i]))){h=!0;break}h||c(e)}}if(g!==a)return a}},C=function(a,b){var c=function(){};c.prototype=new a;c.prototype.constructor=c;c.prototype.parent=a.prototype;c.prototype=e.extend(c.prototype,b);return c};if(void 0===window.Select2){var f,s,D,E,A,v,x={x:0,y:0},F;f={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(a){a=
a.which?a.which:a;switch(a){case f.LEFT:case f.RIGHT:case f.UP:case f.DOWN:return!0}return!1},isControl:function(a){switch(a.which){case f.SHIFT:case f.CTRL:case f.ALT:return!0}return a.metaKey?!0:!1},isFunctionKey:function(a){a=a.which?a.which:a;return 112<=a&&123>=a}};var O={"\u24b6":"A","\uff21":"A","\u00c0":"A","\u00c1":"A","\u00c2":"A","\u1ea6":"A","\u1ea4":"A","\u1eaa":"A","\u1ea8":"A","\u00c3":"A","\u0100":"A","\u0102":"A","\u1eb0":"A","\u1eae":"A","\u1eb4":"A","\u1eb2":"A","\u0226":"A","\u01e0":"A",
"\u00c4":"A","\u01de":"A","\u1ea2":"A","\u00c5":"A","\u01fa":"A","\u01cd":"A","\u0200":"A","\u0202":"A","\u1ea0":"A","\u1eac":"A","\u1eb6":"A","\u1e00":"A","\u0104":"A","\u023a":"A","\u2c6f":"A","\ua732":"AA","\u00c6":"AE","\u01fc":"AE","\u01e2":"AE","\ua734":"AO","\ua736":"AU","\ua738":"AV","\ua73a":"AV","\ua73c":"AY","\u24b7":"B","\uff22":"B","\u1e02":"B","\u1e04":"B","\u1e06":"B","\u0243":"B","\u0182":"B","\u0181":"B","\u24b8":"C","\uff23":"C","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C",
"\u00c7":"C","\u1e08":"C","\u0187":"C","\u023b":"C","\ua73e":"C","\u24b9":"D","\uff24":"D","\u1e0a":"D","\u010e":"D","\u1e0c":"D","\u1e10":"D","\u1e12":"D","\u1e0e":"D","\u0110":"D","\u018b":"D","\u018a":"D","\u0189":"D","\ua779":"D","\u01f1":"DZ","\u01c4":"DZ","\u01f2":"Dz","\u01c5":"Dz","\u24ba":"E","\uff25":"E","\u00c8":"E","\u00c9":"E","\u00ca":"E","\u1ec0":"E","\u1ebe":"E","\u1ec4":"E","\u1ec2":"E","\u1ebc":"E","\u0112":"E","\u1e14":"E","\u1e16":"E","\u0114":"E","\u0116":"E","\u00cb":"E","\u1eba":"E",
"\u011a":"E","\u0204":"E","\u0206":"E","\u1eb8":"E","\u1ec6":"E","\u0228":"E","\u1e1c":"E","\u0118":"E","\u1e18":"E","\u1e1a":"E","\u0190":"E","\u018e":"E","\u24bb":"F","\uff26":"F","\u1e1e":"F","\u0191":"F","\ua77b":"F","\u24bc":"G","\uff27":"G","\u01f4":"G","\u011c":"G","\u1e20":"G","\u011e":"G","\u0120":"G","\u01e6":"G","\u0122":"G","\u01e4":"G","\u0193":"G","\ua7a0":"G","\ua77d":"G","\ua77e":"G","\u24bd":"H","\uff28":"H","\u0124":"H","\u1e22":"H","\u1e26":"H","\u021e":"H","\u1e24":"H","\u1e28":"H",
"\u1e2a":"H","\u0126":"H","\u2c67":"H","\u2c75":"H","\ua78d":"H","\u24be":"I","\uff29":"I","\u00cc":"I","\u00cd":"I","\u00ce":"I","\u0128":"I","\u012a":"I","\u012c":"I","\u0130":"I","\u00cf":"I","\u1e2e":"I","\u1ec8":"I","\u01cf":"I","\u0208":"I","\u020a":"I","\u1eca":"I","\u012e":"I","\u1e2c":"I","\u0197":"I","\u24bf":"J","\uff2a":"J","\u0134":"J","\u0248":"J","\u24c0":"K","\uff2b":"K","\u1e30":"K","\u01e8":"K","\u1e32":"K","\u0136":"K","\u1e34":"K","\u0198":"K","\u2c69":"K","\ua740":"K","\ua742":"K",
"\ua744":"K","\ua7a2":"K","\u24c1":"L","\uff2c":"L","\u013f":"L","\u0139":"L","\u013d":"L","\u1e36":"L","\u1e38":"L","\u013b":"L","\u1e3c":"L","\u1e3a":"L","\u0141":"L","\u023d":"L","\u2c62":"L","\u2c60":"L","\ua748":"L","\ua746":"L","\ua780":"L","\u01c7":"LJ","\u01c8":"Lj","\u24c2":"M","\uff2d":"M","\u1e3e":"M","\u1e40":"M","\u1e42":"M","\u2c6e":"M","\u019c":"M","\u24c3":"N","\uff2e":"N","\u01f8":"N","\u0143":"N","\u00d1":"N","\u1e44":"N","\u0147":"N","\u1e46":"N","\u0145":"N","\u1e4a":"N","\u1e48":"N",
"\u0220":"N","\u019d":"N","\ua790":"N","\ua7a4":"N","\u01ca":"NJ","\u01cb":"Nj","\u24c4":"O","\uff2f":"O","\u00d2":"O","\u00d3":"O","\u00d4":"O","\u1ed2":"O","\u1ed0":"O","\u1ed6":"O","\u1ed4":"O","\u00d5":"O","\u1e4c":"O","\u022c":"O","\u1e4e":"O","\u014c":"O","\u1e50":"O","\u1e52":"O","\u014e":"O","\u022e":"O","\u0230":"O","\u00d6":"O","\u022a":"O","\u1ece":"O","\u0150":"O","\u01d1":"O","\u020c":"O","\u020e":"O","\u01a0":"O","\u1edc":"O","\u1eda":"O","\u1ee0":"O","\u1ede":"O","\u1ee2":"O","\u1ecc":"O",
"\u1ed8":"O","\u01ea":"O","\u01ec":"O","\u00d8":"O","\u01fe":"O","\u0186":"O","\u019f":"O","\ua74a":"O","\ua74c":"O","\u01a2":"OI","\ua74e":"OO","\u0222":"OU","\u24c5":"P","\uff30":"P","\u1e54":"P","\u1e56":"P","\u01a4":"P","\u2c63":"P","\ua750":"P","\ua752":"P","\ua754":"P","\u24c6":"Q","\uff31":"Q","\ua756":"Q","\ua758":"Q","\u024a":"Q","\u24c7":"R","\uff32":"R","\u0154":"R","\u1e58":"R","\u0158":"R","\u0210":"R","\u0212":"R","\u1e5a":"R","\u1e5c":"R","\u0156":"R","\u1e5e":"R","\u024c":"R","\u2c64":"R",
"\ua75a":"R","\ua7a6":"R","\ua782":"R","\u24c8":"S","\uff33":"S","\u1e9e":"S","\u015a":"S","\u1e64":"S","\u015c":"S","\u1e60":"S","\u0160":"S","\u1e66":"S","\u1e62":"S","\u1e68":"S","\u0218":"S","\u015e":"S","\u2c7e":"S","\ua7a8":"S","\ua784":"S","\u24c9":"T","\uff34":"T","\u1e6a":"T","\u0164":"T","\u1e6c":"T","\u021a":"T","\u0162":"T","\u1e70":"T","\u1e6e":"T","\u0166":"T","\u01ac":"T","\u01ae":"T","\u023e":"T","\ua786":"T","\ua728":"TZ","\u24ca":"U","\uff35":"U","\u00d9":"U","\u00da":"U","\u00db":"U",
"\u0168":"U","\u1e78":"U","\u016a":"U","\u1e7a":"U","\u016c":"U","\u00dc":"U","\u01db":"U","\u01d7":"U","\u01d5":"U","\u01d9":"U","\u1ee6":"U","\u016e":"U","\u0170":"U","\u01d3":"U","\u0214":"U","\u0216":"U","\u01af":"U","\u1eea":"U","\u1ee8":"U","\u1eee":"U","\u1eec":"U","\u1ef0":"U","\u1ee4":"U","\u1e72":"U","\u0172":"U","\u1e76":"U","\u1e74":"U","\u0244":"U","\u24cb":"V","\uff36":"V","\u1e7c":"V","\u1e7e":"V","\u01b2":"V","\ua75e":"V","\u0245":"V","\ua760":"VY","\u24cc":"W","\uff37":"W","\u1e80":"W",
"\u1e82":"W","\u0174":"W","\u1e86":"W","\u1e84":"W","\u1e88":"W","\u2c72":"W","\u24cd":"X","\uff38":"X","\u1e8a":"X","\u1e8c":"X","\u24ce":"Y","\uff39":"Y","\u1ef2":"Y","\u00dd":"Y","\u0176":"Y","\u1ef8":"Y","\u0232":"Y","\u1e8e":"Y","\u0178":"Y","\u1ef6":"Y","\u1ef4":"Y","\u01b3":"Y","\u024e":"Y","\u1efe":"Y","\u24cf":"Z","\uff3a":"Z","\u0179":"Z","\u1e90":"Z","\u017b":"Z","\u017d":"Z","\u1e92":"Z","\u1e94":"Z","\u01b5":"Z","\u0224":"Z","\u2c7f":"Z","\u2c6b":"Z","\ua762":"Z","\u24d0":"a","\uff41":"a",
"\u1e9a":"a","\u00e0":"a","\u00e1":"a","\u00e2":"a","\u1ea7":"a","\u1ea5":"a","\u1eab":"a","\u1ea9":"a","\u00e3":"a","\u0101":"a","\u0103":"a","\u1eb1":"a","\u1eaf":"a","\u1eb5":"a","\u1eb3":"a","\u0227":"a","\u01e1":"a","\u00e4":"a","\u01df":"a","\u1ea3":"a","\u00e5":"a","\u01fb":"a","\u01ce":"a","\u0201":"a","\u0203":"a","\u1ea1":"a","\u1ead":"a","\u1eb7":"a","\u1e01":"a","\u0105":"a","\u2c65":"a","\u0250":"a","\ua733":"aa","\u00e6":"ae","\u01fd":"ae","\u01e3":"ae","\ua735":"ao","\ua737":"au","\ua739":"av",
"\ua73b":"av","\ua73d":"ay","\u24d1":"b","\uff42":"b","\u1e03":"b","\u1e05":"b","\u1e07":"b","\u0180":"b","\u0183":"b","\u0253":"b","\u24d2":"c","\uff43":"c","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u00e7":"c","\u1e09":"c","\u0188":"c","\u023c":"c","\ua73f":"c","\u2184":"c","\u24d3":"d","\uff44":"d","\u1e0b":"d","\u010f":"d","\u1e0d":"d","\u1e11":"d","\u1e13":"d","\u1e0f":"d","\u0111":"d","\u018c":"d","\u0256":"d","\u0257":"d","\ua77a":"d","\u01f3":"dz","\u01c6":"dz","\u24d4":"e","\uff45":"e",
"\u00e8":"e","\u00e9":"e","\u00ea":"e","\u1ec1":"e","\u1ebf":"e","\u1ec5":"e","\u1ec3":"e","\u1ebd":"e","\u0113":"e","\u1e15":"e","\u1e17":"e","\u0115":"e","\u0117":"e","\u00eb":"e","\u1ebb":"e","\u011b":"e","\u0205":"e","\u0207":"e","\u1eb9":"e","\u1ec7":"e","\u0229":"e","\u1e1d":"e","\u0119":"e","\u1e19":"e","\u1e1b":"e","\u0247":"e","\u025b":"e","\u01dd":"e","\u24d5":"f","\uff46":"f","\u1e1f":"f","\u0192":"f","\ua77c":"f","\u24d6":"g","\uff47":"g","\u01f5":"g","\u011d":"g","\u1e21":"g","\u011f":"g",
"\u0121":"g","\u01e7":"g","\u0123":"g","\u01e5":"g","\u0260":"g","\ua7a1":"g","\u1d79":"g","\ua77f":"g","\u24d7":"h","\uff48":"h","\u0125":"h","\u1e23":"h","\u1e27":"h","\u021f":"h","\u1e25":"h","\u1e29":"h","\u1e2b":"h","\u1e96":"h","\u0127":"h","\u2c68":"h","\u2c76":"h","\u0265":"h","\u0195":"hv","\u24d8":"i","\uff49":"i","\u00ec":"i","\u00ed":"i","\u00ee":"i","\u0129":"i","\u012b":"i","\u012d":"i","\u00ef":"i","\u1e2f":"i","\u1ec9":"i","\u01d0":"i","\u0209":"i","\u020b":"i","\u1ecb":"i","\u012f":"i",
"\u1e2d":"i","\u0268":"i","\u0131":"i","\u24d9":"j","\uff4a":"j","\u0135":"j","\u01f0":"j","\u0249":"j","\u24da":"k","\uff4b":"k","\u1e31":"k","\u01e9":"k","\u1e33":"k","\u0137":"k","\u1e35":"k","\u0199":"k","\u2c6a":"k","\ua741":"k","\ua743":"k","\ua745":"k","\ua7a3":"k","\u24db":"l","\uff4c":"l","\u0140":"l","\u013a":"l","\u013e":"l","\u1e37":"l","\u1e39":"l","\u013c":"l","\u1e3d":"l","\u1e3b":"l","\u017f":"l","\u0142":"l","\u019a":"l","\u026b":"l","\u2c61":"l","\ua749":"l","\ua781":"l","\ua747":"l",
"\u01c9":"lj","\u24dc":"m","\uff4d":"m","\u1e3f":"m","\u1e41":"m","\u1e43":"m","\u0271":"m","\u026f":"m","\u24dd":"n","\uff4e":"n","\u01f9":"n","\u0144":"n","\u00f1":"n","\u1e45":"n","\u0148":"n","\u1e47":"n","\u0146":"n","\u1e4b":"n","\u1e49":"n","\u019e":"n","\u0272":"n","\u0149":"n","\ua791":"n","\ua7a5":"n","\u01cc":"nj","\u24de":"o","\uff4f":"o","\u00f2":"o","\u00f3":"o","\u00f4":"o","\u1ed3":"o","\u1ed1":"o","\u1ed7":"o","\u1ed5":"o","\u00f5":"o","\u1e4d":"o","\u022d":"o","\u1e4f":"o","\u014d":"o",
"\u1e51":"o","\u1e53":"o","\u014f":"o","\u022f":"o","\u0231":"o","\u00f6":"o","\u022b":"o","\u1ecf":"o","\u0151":"o","\u01d2":"o","\u020d":"o","\u020f":"o","\u01a1":"o","\u1edd":"o","\u1edb":"o","\u1ee1":"o","\u1edf":"o","\u1ee3":"o","\u1ecd":"o","\u1ed9":"o","\u01eb":"o","\u01ed":"o","\u00f8":"o","\u01ff":"o","\u0254":"o","\ua74b":"o","\ua74d":"o","\u0275":"o","\u01a3":"oi","\u0223":"ou","\ua74f":"oo","\u24df":"p","\uff50":"p","\u1e55":"p","\u1e57":"p","\u01a5":"p","\u1d7d":"p","\ua751":"p","\ua753":"p",
"\ua755":"p","\u24e0":"q","\uff51":"q","\u024b":"q","\ua757":"q","\ua759":"q","\u24e1":"r","\uff52":"r","\u0155":"r","\u1e59":"r","\u0159":"r","\u0211":"r","\u0213":"r","\u1e5b":"r","\u1e5d":"r","\u0157":"r","\u1e5f":"r","\u024d":"r","\u027d":"r","\ua75b":"r","\ua7a7":"r","\ua783":"r","\u24e2":"s","\uff53":"s","\u00df":"s","\u015b":"s","\u1e65":"s","\u015d":"s","\u1e61":"s","\u0161":"s","\u1e67":"s","\u1e63":"s","\u1e69":"s","\u0219":"s","\u015f":"s","\u023f":"s","\ua7a9":"s","\ua785":"s","\u1e9b":"s",
"\u24e3":"t","\uff54":"t","\u1e6b":"t","\u1e97":"t","\u0165":"t","\u1e6d":"t","\u021b":"t","\u0163":"t","\u1e71":"t","\u1e6f":"t","\u0167":"t","\u01ad":"t","\u0288":"t","\u2c66":"t","\ua787":"t","\ua729":"tz","\u24e4":"u","\uff55":"u","\u00f9":"u","\u00fa":"u","\u00fb":"u","\u0169":"u","\u1e79":"u","\u016b":"u","\u1e7b":"u","\u016d":"u","\u00fc":"u","\u01dc":"u","\u01d8":"u","\u01d6":"u","\u01da":"u","\u1ee7":"u","\u016f":"u","\u0171":"u","\u01d4":"u","\u0215":"u","\u0217":"u","\u01b0":"u","\u1eeb":"u",
"\u1ee9":"u","\u1eef":"u","\u1eed":"u","\u1ef1":"u","\u1ee5":"u","\u1e73":"u","\u0173":"u","\u1e77":"u","\u1e75":"u","\u0289":"u","\u24e5":"v","\uff56":"v","\u1e7d":"v","\u1e7f":"v","\u028b":"v","\ua75f":"v","\u028c":"v","\ua761":"vy","\u24e6":"w","\uff57":"w","\u1e81":"w","\u1e83":"w","\u0175":"w","\u1e87":"w","\u1e85":"w","\u1e98":"w","\u1e89":"w","\u2c73":"w","\u24e7":"x","\uff58":"x","\u1e8b":"x","\u1e8d":"x","\u24e8":"y","\uff59":"y","\u1ef3":"y","\u00fd":"y","\u0177":"y","\u1ef9":"y","\u0233":"y",
"\u1e8f":"y","\u00ff":"y","\u1ef7":"y","\u1e99":"y","\u1ef5":"y","\u01b4":"y","\u024f":"y","\u1eff":"y","\u24e9":"z","\uff5a":"z","\u017a":"z","\u1e91":"z","\u017c":"z","\u017e":"z","\u1e93":"z","\u1e95":"z","\u01b6":"z","\u0225":"z","\u0240":"z","\u2c6c":"z","\ua763":"z"};s=e(document);var Q=1;A=function(){return Q++};s.on("mousemove",function(a){x.x=a.pageX;x.y=a.pageY});s=C(Object,{bind:function(a){var b=this;return function(){a.apply(b,arguments)}},init:function(a){var b,c;this.opts=a=this.prepareOpts(a);
this.id=a.id;void 0!==a.element.data("select2")&&null!==a.element.data("select2")&&a.element.data("select2").destroy();this.container=this.createContainer();this.containerId="s2id_"+(a.element.attr("id")||"autogen"+A());this.containerSelector="#"+this.containerId.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1");this.container.attr("id",this.containerId);var d=!1,g;this.body=function(){!1===d&&(g=a.element.closest("body"),d=!0);return g};z(this.container,this.opts.element,this.opts.adaptContainerCssClass);
this.container.attr("style",a.element.attr("style"));this.container.css(o(a.containerCss));this.container.addClass(o(a.containerCssClass));this.elementTabIndex=this.opts.element.attr("tabindex");this.opts.element.data("select2",this).attr("tabindex","-1").before(this.container).on("click.select2",j);this.container.data("select2",this);this.dropdown=this.container.find(".select2-drop");z(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass);this.dropdown.addClass(o(a.dropdownCssClass));
this.dropdown.data("select2",this);this.dropdown.on("click",j);this.results=b=this.container.find(".select2-results");this.search=c=this.container.find("input.select2-input");this.resultsPage=this.queryCount=0;this.context=null;this.initContainer();this.container.on("click",j);this.results.on("mousemove",function(a){(void 0===x||x.x!==a.pageX||x.y!==a.pageY)&&e(a.target).trigger("mousemove-filtered",a)});this.dropdown.on("mousemove-filtered touchstart touchmove touchend",".select2-results",this.bind(this.highlightUnderEvent));
var h=this.results,l=H(80,function(a){h.trigger("scroll-debounced",a)});h.on("scroll",function(a){0<=k(a.target,h.get())&&l(a)});this.dropdown.on("scroll-debounced",".select2-results",this.bind(this.loadMoreIfNeeded));e(this.container).on("change",".select2-input",function(a){a.stopPropagation()});e(this.dropdown).on("change",".select2-input",function(a){a.stopPropagation()});e.fn.mousewheel&&b.mousewheel(function(a,c,d,g){c=b.scrollTop();0<g&&0>=c-g?(b.scrollTop(0),j(a)):0>g&&b.get(0).scrollHeight-
b.scrollTop()+g<=b.height()&&(b.scrollTop(b.get(0).scrollHeight-b.height()),j(a))});G(c);c.on("keyup-change input paste",this.bind(this.updateResults));c.on("focus",function(){c.addClass("select2-focused")});c.on("blur",function(){c.removeClass("select2-focused")});this.dropdown.on("mouseup",".select2-results",this.bind(function(a){0<e(a.target).closest(".select2-result-selectable").length&&(this.highlightUnderEvent(a),this.selectHighlighted(a))}));this.dropdown.on("click mouseup mousedown",function(a){a.stopPropagation()});
e.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource());null!==a.maximumInputLength&&this.search.attr("maxlength",a.maximumInputLength);var i=a.element.prop("disabled");void 0===i&&(i=!1);this.enable(!i);i=a.element.prop("readonly");void 0===i&&(i=!1);this.readonly(i);if(!(i=F)){i=e("<div class='select2-measure-scrollbar'></div>");i.appendTo("body");var f={width:i.width()-i[0].clientWidth,height:i.height()-i[0].clientHeight};i.remove();i=f}F=i;this.autofocus=a.element.prop("autofocus");
a.element.prop("autofocus",!1);this.autofocus&&this.focus();this.nextSearchTerm=void 0},destroy:function(){var a=this.opts.element,b=a.data("select2");this.close();this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null);void 0!==b&&(b.container.remove(),b.dropdown.remove(),a.removeClass("select2-offscreen").removeData("select2").off(".select2").prop("autofocus",this.autofocus||!1),this.elementTabIndex?a.attr({tabindex:this.elementTabIndex}):a.removeAttr("tabindex"),a.show())},
optionToData:function(a){if(a.is("option"))return{id:a.prop("value"),text:a.text(),element:a.get(),css:a.attr("class"),disabled:a.prop("disabled"),locked:m(a.attr("locked"),"locked")||m(a.data("locked"),!0)};if(a.is("optgroup"))return{text:a.attr("label"),children:[],element:a.get(),css:a.attr("class")}},prepareOpts:function(a){var b,c,d,g=this;b=a.element;"select"===b.get(0).tagName.toLowerCase()&&(this.select=c=a.element);c&&e.each("id multiple ajax query createSearchChoice initSelection data tags".split(" "),
function(){if(this in a)throw Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.");});a=e.extend({},{populateResults:function(b,c,d){var f,t=this.opts.id;f=function(b,c,h){var l,j,m,k,o,u,q,b=a.sortResults(b,c,d);l=0;for(j=b.length;l<j;l=l+1){m=b[l];o=m.disabled===true;k=!o&&t(m)!==void 0;u=m.children&&m.children.length>0;q=e("<li></li>");q.addClass("select2-results-dept-"+h);q.addClass("select2-result");q.addClass(k?"select2-result-selectable":"select2-result-unselectable");
o&&q.addClass("select2-disabled");u&&q.addClass("select2-result-with-children");q.addClass(g.opts.formatResultCssClass(m));k=e(document.createElement("div"));k.addClass("select2-result-label");o=a.formatResult(m,k,d,g.opts.escapeMarkup);o!==void 0&&k.html(o);q.append(k);if(u){u=e("<ul></ul>");u.addClass("select2-result-sub");f(m.children,u,h+1);q.append(u)}q.data("select2-data",m);c.append(q)}};f(c,b,0)}},e.fn.select2.defaults,a);"function"!==typeof a.id&&(d=a.id,a.id=function(a){return a[d]});if(e.isArray(a.element.data("select2Tags"))){if("tags"in
a)throw"tags specified as both an attribute 'data-select2-tags' and in options of Select2 "+a.element.attr("id");a.tags=a.element.data("select2Tags")}if(c)a.query=this.bind(function(a){var c={results:[],more:false},d=a.term,e,f,p;p=function(b,c){var e;if(b.is("option"))a.matcher(d,b.text(),b)&&c.push(g.optionToData(b));else if(b.is("optgroup")){e=g.optionToData(b);b.children().each2(function(a,b){p(b,e.children)});e.children.length>0&&c.push(e)}};e=b.children();if(this.getPlaceholder()!==void 0&&
e.length>0)(f=this.getPlaceholderOption())&&(e=e.not(f));e.each2(function(a,b){p(b,c.results)});a.callback(c)}),a.id=function(a){return a.id},a.formatResultCssClass=function(a){return a.css};else if(!("query"in a))if("ajax"in a){if((c=a.element.data("ajax-url"))&&0<c.length)a.ajax.url=c;a.query=K.call(a.element,a.ajax)}else if("data"in a)a.query=L(a.data);else if("tags"in a&&(a.query=M(a.tags),void 0===a.createSearchChoice&&(a.createSearchChoice=function(a){return{id:e.trim(a),text:e.trim(a)}}),void 0===
a.initSelection))a.initSelection=function(b,c){var d=[];e(B(b.val(),a.separator)).each(function(){var b={id:this,text:this},c=a.tags;e.isFunction(c)&&(c=c());e(c).each(function(){if(m(this.id,b.id)){b=this;return false}});d.push(b)});c(d)};if("function"!==typeof a.query)throw"query function not defined for Select2 "+a.element.attr("id");return a},monitorSource:function(){var a=this.opts.element,b,c;a.on("change.select2",this.bind(function(){!0!==this.opts.element.data("select2-change-triggered")&&
this.initSelection()}));b=this.bind(function(){var b=a.prop("disabled");void 0===b&&(b=!1);this.enable(!b);b=a.prop("readonly");void 0===b&&(b=!1);this.readonly(b);z(this.container,this.opts.element,this.opts.adaptContainerCssClass);this.container.addClass(o(this.opts.containerCssClass));z(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass);this.dropdown.addClass(o(this.opts.dropdownCssClass))});a.on("propertychange.select2",b);void 0===this.mutationCallback&&(this.mutationCallback=function(a){a.forEach(b)});
c=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;void 0!==c&&(this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),this.propertyObserver=new c(this.mutationCallback),this.propertyObserver.observe(a.get(0),{attributes:!0,subtree:!1}))},triggerSelect:function(a){a=e.Event("select2-selecting",{val:this.id(a),object:a});this.opts.element.trigger(a);return!a.isDefaultPrevented()},triggerChange:function(a){a=a||{};a=e.extend({},a,{type:"change",
val:this.val()});this.opts.element.data("select2-change-triggered",!0);this.opts.element.trigger(a);this.opts.element.data("select2-change-triggered",!1);this.opts.element.click();this.opts.blurOnChange&&this.opts.element.blur()},isInterfaceEnabled:function(){return!0===this.enabledInterface},enableInterface:function(){var a=this._enabled&&!this._readonly;if(a===this.enabledInterface)return!1;this.container.toggleClass("select2-container-disabled",!a);this.close();this.enabledInterface=a;return!0},
enable:function(a){void 0===a&&(a=!0);this._enabled!==a&&(this._enabled=a,this.opts.element.prop("disabled",!a),this.enableInterface())},disable:function(){this.enable(!1)},readonly:function(a){void 0===a&&(a=!1);if(this._readonly===a)return!1;this._readonly=a;this.opts.element.prop("readonly",a);this.enableInterface();return!0},opened:function(){return this.container.hasClass("select2-dropdown-open")},positionDropdown:function(){var a=this.dropdown,b=this.container.offset(),c=this.container.outerHeight(!1),
d=this.container.outerWidth(!1),g=a.outerHeight(!1),h=e(window),f=h.width(),i=h.height(),n=h.scrollLeft()+f,j=h.scrollTop()+i,c=b.top+c,p=b.left,j=c+g<=j,m=b.top-g>=this.body().scrollTop(),k=a.outerWidth(!1),r=p+k<=n,s;a.hasClass("select2-drop-above")?(g=!0,!m&&j&&(s=!0,g=!1)):(g=!1,!j&&m&&(g=s=!0));s&&(a.hide(),b=this.container.offset(),c=this.container.outerHeight(!1),d=this.container.outerWidth(!1),a.outerHeight(!1),n=h.scrollLeft()+f,h.scrollTop(),c=b.top+c,p=b.left,k=a.outerWidth(!1),r=p+k<=
n,a.show());this.opts.dropdownAutoWidth?(h=e(".select2-results",a)[0],a.addClass("select2-drop-auto-width"),a.css("width",""),k=a.outerWidth(!1)+(h.scrollHeight===h.clientHeight?0:F.width),k>d?d=k:k=d,r=p+k<=n):this.container.removeClass("select2-drop-auto-width");"static"!==this.body().css("position")&&(n=this.body().offset(),c-=n.top,p-=n.left);r||(p=b.left+d-k);d={left:p,width:d};g?(d.bottom=i-b.top,d.top="auto",this.container.addClass("select2-drop-above"),a.addClass("select2-drop-above")):(d.top=
c,d.bottom="auto",this.container.removeClass("select2-drop-above"),a.removeClass("select2-drop-above"));d=e.extend(d,o(this.opts.dropdownCss));a.css(d)},shouldOpen:function(){var a;if(this.opened()||!1===this._enabled||!0===this._readonly)return!1;a=e.Event("select2-opening");this.opts.element.trigger(a);return!a.isDefaultPrevented()},clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above");this.dropdown.removeClass("select2-drop-above")},open:function(){if(!this.shouldOpen())return!1;
this.opening();return!0},opening:function(){var a=this.containerId,b="scroll."+a,c="resize."+a,d="orientationchange."+a;this.container.addClass("select2-dropdown-open").addClass("select2-container-active");this.clearDropdownAlignmentPreference();this.dropdown[0]!==this.body().children().last()[0]&&this.dropdown.detach().appendTo(this.body());a=e("#select2-drop-mask");0==a.length&&(a=e(document.createElement("div")),a.attr("id","select2-drop-mask").attr("class","select2-drop-mask"),a.hide(),a.appendTo(this.body()),
a.on("mousedown touchstart click",function(a){var b=e("#select2-drop");0<b.length&&(b=b.data("select2"),b.opts.selectOnBlur&&b.selectHighlighted({noFocus:!0}),b.close({focus:!0}),a.preventDefault(),a.stopPropagation())}));this.dropdown.prev()[0]!==a[0]&&this.dropdown.before(a);e("#select2-drop").removeAttr("id");this.dropdown.attr("id","select2-drop");a.show();this.positionDropdown();this.dropdown.show();this.positionDropdown();this.dropdown.addClass("select2-drop-active");var g=this;this.container.parents().add(window).each(function(){e(this).on(c+
" "+b+" "+d,function(){g.positionDropdown()})})},close:function(){if(this.opened()){var a=this.containerId,b="scroll."+a,c="resize."+a,d="orientationchange."+a;this.container.parents().add(window).each(function(){e(this).off(b).off(c).off(d)});this.clearDropdownAlignmentPreference();e("#select2-drop-mask").hide();this.dropdown.removeAttr("id");this.dropdown.hide();this.container.removeClass("select2-dropdown-open").removeClass("select2-container-active");this.results.empty();this.clearSearch();this.search.removeClass("select2-active");
this.opts.element.trigger(e.Event("select2-close"))}},externalSearch:function(a){this.open();this.search.val(a);this.updateResults(!1)},clearSearch:function(){},getMaximumSelectionSize:function(){return o(this.opts.maximumSelectionSize)},ensureHighlightVisible:function(){var a=this.results,b,c,d,g;c=this.highlight();0>c||(0==c?a.scrollTop(0):(b=this.findHighlightableChoices().find(".select2-result-label"),d=e(b[c]),g=d.offset().top+d.outerHeight(!0),c===b.length-1&&(b=a.find("li.select2-more-results"),
0<b.length&&(g=b.offset().top+b.outerHeight(!0))),b=a.offset().top+a.outerHeight(!0),g>b&&a.scrollTop(a.scrollTop()+(g-b)),g=d.offset().top-a.offset().top,0>g&&"none"!=d.css("display")&&a.scrollTop(a.scrollTop()+g)))},findHighlightableChoices:function(){return this.results.find(".select2-result-selectable:not(.select2-disabled, .select2-selected)")},moveHighlight:function(a){for(var b=this.findHighlightableChoices(),c=this.highlight();-1<c&&c<b.length;){var c=c+a,d=e(b[c]);if(d.hasClass("select2-result-selectable")&&
!d.hasClass("select2-disabled")&&!d.hasClass("select2-selected")){this.highlight(c);break}}},highlight:function(a){var b=this.findHighlightableChoices();if(0===arguments.length)return k(b.filter(".select2-highlighted")[0],b.get());a>=b.length&&(a=b.length-1);0>a&&(a=0);this.removeHighlight();b=e(b[a]);b.addClass("select2-highlighted");this.ensureHighlightVisible();(b=b.data("select2-data"))&&this.opts.element.trigger({type:"select2-highlight",val:this.id(b),choice:b})},removeHighlight:function(){this.results.find(".select2-highlighted").removeClass("select2-highlighted")},
countSelectableResults:function(){return this.findHighlightableChoices().length},highlightUnderEvent:function(a){a=e(a.target).closest(".select2-result-selectable");if(0<a.length&&!a.is(".select2-highlighted")){var b=this.findHighlightableChoices();this.highlight(b.index(a))}else 0==a.length&&this.removeHighlight()},loadMoreIfNeeded:function(){var a=this.results,b=a.find("li.select2-more-results"),c,d=this.resultsPage+1,e=this,h=this.search.val(),f=this.context;0!==b.length&&(c=b.offset().top-a.offset().top-
a.height(),c<=this.opts.loadMorePadding&&(b.addClass("select2-active"),this.opts.query({element:this.opts.element,term:h,page:d,context:f,matcher:this.opts.matcher,callback:this.bind(function(c){e.opened()&&(e.opts.populateResults.call(this,a,c.results,{term:h,page:d,context:f}),e.postprocessResults(c,!1,!1),!0===c.more?(b.detach().appendTo(a).text(e.opts.formatLoadMore(d+1)),window.setTimeout(function(){e.loadMoreIfNeeded()},10)):b.remove(),e.positionDropdown(),e.resultsPage=d,e.context=c.context,
this.opts.element.trigger({type:"select2-loaded",items:c}))})})))},tokenize:function(){},updateResults:function(a){function b(){d.removeClass("select2-active");i.positionDropdown()}function c(a){g.html(a);b()}var d=this.search,g=this.results,h=this.opts,f,i=this;f=d.val();var n=e.data(this.container,"select2-last-term"),j;if(!(!0!==a&&n&&m(f,n))&&(e.data(this.container,"select2-last-term",f),!(!0!==a&&(!1===this.showSearchInput||!this.opened())))){j=++this.queryCount;n=this.getMaximumSelectionSize();
if(1<=n&&(f=this.data(),e.isArray(f)&&f.length>=n&&r(h.formatSelectionTooBig,"formatSelectionTooBig"))){c("<li class='select2-selection-limit'>"+h.formatSelectionTooBig(n)+"</li>");return}d.val().length<h.minimumInputLength?(r(h.formatInputTooShort,"formatInputTooShort")?c("<li class='select2-no-results'>"+h.formatInputTooShort(d.val(),h.minimumInputLength)+"</li>"):c(""),a&&this.showSearch&&this.showSearch(!0)):h.maximumInputLength&&d.val().length>h.maximumInputLength?r(h.formatInputTooLong,"formatInputTooLong")?
c("<li class='select2-no-results'>"+h.formatInputTooLong(d.val(),h.maximumInputLength)+"</li>"):c(""):(h.formatSearching&&0===this.findHighlightableChoices().length&&c("<li class='select2-searching'>"+h.formatSearching()+"</li>"),d.addClass("select2-active"),this.removeHighlight(),f=this.tokenize(),void 0!=f&&null!=f&&d.val(f),this.resultsPage=1,h.query({element:h.element,term:d.val(),page:this.resultsPage,context:null,matcher:h.matcher,callback:this.bind(function(f){var l;j==this.queryCount&&(this.opened()?
(this.context=void 0===f.context?null:f.context,this.opts.createSearchChoice&&""!==d.val()&&(l=this.opts.createSearchChoice.call(i,d.val(),f.results),void 0!==l&&null!==l&&void 0!==i.id(l)&&null!==i.id(l)&&0===e(f.results).filter(function(){return m(i.id(this),i.id(l))}).length&&f.results.unshift(l)),0===f.results.length&&r(h.formatNoMatches,"formatNoMatches"))?c("<li class='select2-no-results'>"+h.formatNoMatches(d.val())+"</li>"):(g.empty(),i.opts.populateResults.call(this,g,f.results,{term:d.val(),
page:this.resultsPage,context:null}),!0===f.more&&r(h.formatLoadMore,"formatLoadMore")&&(g.append("<li class='select2-more-results'>"+i.opts.escapeMarkup(h.formatLoadMore(this.resultsPage))+"</li>"),window.setTimeout(function(){i.loadMoreIfNeeded()},10)),this.postprocessResults(f,a),b(),this.opts.element.trigger({type:"select2-loaded",items:f})):this.search.removeClass("select2-active"))})}))}},cancel:function(){this.close()},blur:function(){this.opts.selectOnBlur&&this.selectHighlighted({noFocus:!0});
this.close();this.container.removeClass("select2-container-active");this.search[0]===document.activeElement&&this.search.blur();this.clearSearch();this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){var a=this.search;a[0]!==document.activeElement&&window.setTimeout(function(){var b=a[0],c=a.val().length;a.focus();a.is(":visible")&&b===document.activeElement&&(b.setSelectionRange?b.setSelectionRange(c,c):b.createTextRange&&(b=b.createTextRange(),
b.collapse(!1),b.select()))},0)},selectHighlighted:function(a){var b=this.highlight(),c=this.results.find(".select2-highlighted").closest(".select2-result").data("select2-data");c?(this.highlight(b),this.onSelect(c,a)):a&&a.noFocus&&this.close()},getPlaceholder:function(){var a;return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||this.opts.placeholder||(void 0!==(a=this.getPlaceholderOption())?a.text():void 0)},getPlaceholderOption:function(){if(this.select){var a=
this.select.children("option").first();if(void 0!==this.opts.placeholderOption)return"first"===this.opts.placeholderOption&&a||"function"===typeof this.opts.placeholderOption&&this.opts.placeholderOption(this.select);if(""===a.text()&&""===a.val())return a}},initContainerWidth:function(){var a=function(){var a,c,d,g;if("off"===this.opts.width)return null;if("element"===this.opts.width)return 0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px";if("copy"===this.opts.width||
"resolve"===this.opts.width){a=this.opts.element.attr("style");if(void 0!==a){a=a.split(";");d=0;for(g=a.length;d<g;d+=1)if(c=a[d].replace(/\s/g,""),c=c.match(/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i),null!==c&&1<=c.length)return c[1]}return"resolve"===this.opts.width?(a=this.opts.element.css("width"),0<a.indexOf("%")?a:0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px"):null}return e.isFunction(this.opts.width)?this.opts.width():this.opts.width}.call(this);
null!==a&&this.container.css("width",a)}});D=C(s,{createContainer:function(){return e(document.createElement("div")).attr({"class":"select2-container"}).html("<a href='javascript:void(0)' onclick='return false;' class='select2-choice' tabindex='-1'>   <span class='select2-chosen'>&nbsp;</span><abbr class='select2-search-choice-close'></abbr>   <span class='select2-arrow'><b></b></span></a><input class='select2-focusser select2-offscreen' type='text'/><div class='select2-drop select2-display-none'>   <div class='select2-search'>       <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input'/>   </div>   <ul class='select2-results'>   </ul></div>")},
enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.focusser.prop("disabled",!this.isInterfaceEnabled())},opening:function(){var a,b;0<=this.opts.minimumResultsForSearch&&this.showSearch(!0);this.parent.opening.apply(this,arguments);!1!==this.showSearchInput&&this.search.val(this.focusser.val());this.search.focus();a=this.search.get(0);a.createTextRange?(a=a.createTextRange(),a.collapse(!1),a.select()):a.setSelectionRange&&(b=this.search.val().length,a.setSelectionRange(b,
b));""===this.search.val()&&void 0!=this.nextSearchTerm&&(this.search.val(this.nextSearchTerm),this.search.select());this.focusser.prop("disabled",!0).val("");this.updateResults(!0);this.opts.element.trigger(e.Event("select2-open"))},close:function(a){this.opened()&&(this.parent.close.apply(this,arguments),a=a||{focus:!0},this.focusser.removeAttr("disabled"),a.focus&&this.focusser.focus())},focus:function(){this.opened()?this.close():(this.focusser.removeAttr("disabled"),this.focusser.focus())},isFocused:function(){return this.container.hasClass("select2-container-active")},
cancel:function(){this.parent.cancel.apply(this,arguments);this.focusser.removeAttr("disabled");this.focusser.focus()},destroy:function(){e("label[for='"+this.focusser.attr("id")+"']").attr("for",this.opts.element.attr("id"));this.parent.destroy.apply(this,arguments)},initContainer:function(){var a,b=this.container,c=this.dropdown;0>this.opts.minimumResultsForSearch?this.showSearch(!1):this.showSearch(!0);this.selection=a=b.find(".select2-choice");this.focusser=b.find(".select2-focusser");this.focusser.attr("id",
"s2id_autogen"+A());e("label[for='"+this.opts.element.attr("id")+"']").attr("for",this.focusser.attr("id"));this.focusser.attr("tabindex",this.elementTabIndex);this.search.on("keydown",this.bind(function(a){if(this.isInterfaceEnabled())if(a.which===f.PAGE_UP||a.which===f.PAGE_DOWN)j(a);else switch(a.which){case f.UP:case f.DOWN:this.moveHighlight(a.which===f.UP?-1:1);j(a);break;case f.ENTER:this.selectHighlighted();j(a);break;case f.TAB:this.selectHighlighted({noFocus:!0});break;case f.ESC:this.cancel(a),
j(a)}}));this.search.on("blur",this.bind(function(){document.activeElement===this.body().get(0)&&window.setTimeout(this.bind(function(){this.search.focus()}),0)}));this.focusser.on("keydown",this.bind(function(a){if(this.isInterfaceEnabled()&&!(a.which===f.TAB||f.isControl(a)||f.isFunctionKey(a)||a.which===f.ESC))if(!1===this.opts.openOnEnter&&a.which===f.ENTER)j(a);else if(a.which==f.DOWN||a.which==f.UP||a.which==f.ENTER&&this.opts.openOnEnter)!a.altKey&&(!a.ctrlKey&&!a.shiftKey&&!a.metaKey)&&(this.open(),
j(a));else if(a.which==f.DELETE||a.which==f.BACKSPACE)this.opts.allowClear&&this.clear(),j(a)}));G(this.focusser);this.focusser.on("keyup-change input",this.bind(function(a){0<=this.opts.minimumResultsForSearch&&(a.stopPropagation(),this.opened()||this.open())}));a.on("mousedown","abbr",this.bind(function(a){this.isInterfaceEnabled()&&(this.clear(),a.preventDefault(),a.stopImmediatePropagation(),this.close(),this.selection.focus())}));a.on("mousedown",this.bind(function(a){this.container.hasClass("select2-container-active")||
this.opts.element.trigger(e.Event("select2-focus"));this.opened()?this.close():this.isInterfaceEnabled()&&this.open();j(a)}));c.on("mousedown",this.bind(function(){this.search.focus()}));a.on("focus",this.bind(function(a){j(a)}));this.focusser.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus"));this.container.addClass("select2-container-active")})).on("blur",this.bind(function(){this.opened()||(this.container.removeClass("select2-container-active"),
this.opts.element.trigger(e.Event("select2-blur")))}));this.search.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus"));this.container.addClass("select2-container-active")}));this.initContainerWidth();this.opts.element.addClass("select2-offscreen");this.setPlaceholder()},clear:function(a){var b=this.selection.data("select2-data");if(b){var c=e.Event("select2-clearing");this.opts.element.trigger(c);c.isDefaultPrevented()||
(c=this.getPlaceholderOption(),this.opts.element.val(c?c.val():""),this.selection.find(".select2-chosen").empty(),this.selection.removeData("select2-data"),this.setPlaceholder(),!1!==a&&(this.opts.element.trigger({type:"select2-removed",val:this.id(b),choice:b}),this.triggerChange({removed:b})))}},initSelection:function(){if(this.isPlaceholderOptionSelected())this.updateSelection(null),this.close(),this.setPlaceholder();else{var a=this;this.opts.initSelection.call(null,this.opts.element,function(b){void 0!==
b&&null!==b&&(a.updateSelection(b),a.close(),a.setPlaceholder())})}},isPlaceholderOptionSelected:function(){var a;return!this.getPlaceholder()?!1:void 0!==(a=this.getPlaceholderOption())&&a.prop("selected")||""===this.opts.element.val()||void 0===this.opts.element.val()||null===this.opts.element.val()},prepareOpts:function(){var a=this.parent.prepareOpts.apply(this,arguments),b=this;"select"===a.element.get(0).tagName.toLowerCase()?a.initSelection=function(a,d){var e=a.find("option").filter(function(){return this.selected});
d(b.optionToData(e))}:"data"in a&&(a.initSelection=a.initSelection||function(b,d){var g=b.val(),f=null;a.query({matcher:function(b,c,d){(b=m(g,a.id(d)))&&(f=d);return b},callback:!e.isFunction(d)?e.noop:function(){d(f)}})});return a},getPlaceholder:function(){return this.select&&void 0===this.getPlaceholderOption()?void 0:this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var a=this.getPlaceholder();this.isPlaceholderOptionSelected()&&void 0!==a&&!(this.select&&void 0===this.getPlaceholderOption())&&
(this.selection.find(".select2-chosen").html(this.opts.escapeMarkup(a)),this.selection.addClass("select2-default"),this.container.removeClass("select2-allowclear"))},postprocessResults:function(a,b,c){var d=0,e=this;this.findHighlightableChoices().each2(function(a,b){if(m(e.id(b.data("select2-data")),e.opts.element.val()))return d=a,!1});!1!==c&&(!0===b&&0<=d?this.highlight(d):this.highlight(0));!0===b&&(b=this.opts.minimumResultsForSearch,0<=b&&this.showSearch(N(a.results)>=b))},showSearch:function(a){this.showSearchInput!==
a&&(this.showSearchInput=a,this.dropdown.find(".select2-search").toggleClass("select2-search-hidden",!a),this.dropdown.find(".select2-search").toggleClass("select2-offscreen",!a),e(this.dropdown,this.container).toggleClass("select2-with-searchbox",a))},onSelect:function(a,b){if(this.triggerSelect(a)){var c=this.opts.element.val(),d=this.data();this.opts.element.val(this.id(a));this.updateSelection(a);this.opts.element.trigger({type:"select2-selected",val:this.id(a),choice:a});this.nextSearchTerm=
this.opts.nextSearchTerm(a,this.search.val());this.close();(!b||!b.noFocus)&&this.focusser.focus();m(c,this.id(a))||this.triggerChange({added:a,removed:d})}},updateSelection:function(a){var b=this.selection.find(".select2-chosen"),c;this.selection.data("select2-data",a);b.empty();null!==a&&(c=this.opts.formatSelection(a,b,this.opts.escapeMarkup));void 0!==c&&b.append(c);a=this.opts.formatSelectionCssClass(a,b);void 0!==a&&b.addClass(a);this.selection.removeClass("select2-default");this.opts.allowClear&&
void 0!==this.getPlaceholder()&&this.container.addClass("select2-allowclear")},val:function(){var a,b=!1,c=null,d=this,e=this.data();if(0===arguments.length)return this.opts.element.val();a=arguments[0];1<arguments.length&&(b=arguments[1]);if(this.select)this.select.val(a).find("option").filter(function(){return this.selected}).each2(function(a,b){c=d.optionToData(b);return!1}),this.updateSelection(c),this.setPlaceholder(),b&&this.triggerChange({added:c,removed:e});else if(!a&&0!==a)this.clear(b);
else{if(void 0===this.opts.initSelection)throw Error("cannot call val() if initSelection() is not defined");this.opts.element.val(a);this.opts.initSelection(this.opts.element,function(a){d.opts.element.val(!a?"":d.id(a));d.updateSelection(a);d.setPlaceholder();b&&d.triggerChange({added:a,removed:e})})}},clearSearch:function(){this.search.val("");this.focusser.val("")},data:function(a){var b,c=!1;if(0===arguments.length)return b=this.selection.data("select2-data"),void 0==b&&(b=null),b;1<arguments.length&&
(c=arguments[1]);a?(b=this.data(),this.opts.element.val(!a?"":this.id(a)),this.updateSelection(a),c&&this.triggerChange({added:a,removed:b})):this.clear(c)}});E=C(s,{createContainer:function(){return e(document.createElement("div")).attr({"class":"select2-container select2-container-multi"}).html("<ul class='select2-choices'>  <li class='select2-search-field'>    <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input'>  </li></ul><div class='select2-drop select2-drop-multi select2-display-none'>   <ul class='select2-results'>   </ul></div>")},
prepareOpts:function(){var a=this.parent.prepareOpts.apply(this,arguments),b=this;"select"===a.element.get(0).tagName.toLowerCase()?a.initSelection=function(a,d){var e=[];a.find("option").filter(function(){return this.selected}).each2(function(a,c){e.push(b.optionToData(c))});d(e)}:"data"in a&&(a.initSelection=a.initSelection||function(b,d){var g=B(b.val(),a.separator),f=[];a.query({matcher:function(b,c,d){(b=e.grep(g,function(b){return m(b,a.id(d))}).length)&&f.push(d);return b},callback:!e.isFunction(d)?
e.noop:function(){for(var b=[],c=0;c<g.length;c++)for(var e=g[c],j=0;j<f.length;j++){var k=f[j];if(m(e,a.id(k))){b.push(k);f.splice(j,1);break}}d(b)}})});return a},selectChoice:function(a){var b=this.container.find(".select2-search-choice-focus");if(!b.length||!(a&&a[0]==b[0]))b.length&&this.opts.element.trigger("choice-deselected",b),b.removeClass("select2-search-choice-focus"),a&&a.length&&(this.close(),a.addClass("select2-search-choice-focus"),this.opts.element.trigger("choice-selected",a))},destroy:function(){e("label[for='"+
this.search.attr("id")+"']").attr("for",this.opts.element.attr("id"));this.parent.destroy.apply(this,arguments)},initContainer:function(){var a;this.searchContainer=this.container.find(".select2-search-field");this.selection=a=this.container.find(".select2-choices");var b=this;this.selection.on("click",".select2-search-choice:not(.select2-locked)",function(){b.search[0].focus();b.selectChoice(e(this))});this.search.attr("id","s2id_autogen"+A());e("label[for='"+this.opts.element.attr("id")+"']").attr("for",
this.search.attr("id"));this.search.on("input paste",this.bind(function(){this.isInterfaceEnabled()&&(this.opened()||this.open())}));this.search.attr("tabindex",this.elementTabIndex);this.keydowns=0;this.search.on("keydown",this.bind(function(b){var d,g;if(this.isInterfaceEnabled()){++this.keydowns;var h=a.find(".select2-search-choice-focus"),l=h.prev(".select2-search-choice:not(.select2-locked)"),i=h.next(".select2-search-choice:not(.select2-locked)");d=this.search;d=e(d)[0];var k=0;g=0;"selectionStart"in
d?(k=d.selectionStart,g=d.selectionEnd-k):"selection"in document&&(d.focus(),k=document.selection.createRange(),g=document.selection.createRange().text.length,k.moveStart("character",-d.value.length),k=k.text.length-g);d=k;if(h.length&&(b.which==f.LEFT||b.which==f.RIGHT||b.which==f.BACKSPACE||b.which==f.DELETE||b.which==f.ENTER))g=h,b.which==f.LEFT&&l.length?g=l:b.which==f.RIGHT?g=i.length?i:null:b.which===f.BACKSPACE?(this.unselect(h.first()),this.search.width(10),g=l.length?l:i):b.which==f.DELETE?
(this.unselect(h.first()),this.search.width(10),g=i.length?i:null):b.which==f.ENTER&&(g=null),this.selectChoice(g),j(b),(!g||!g.length)&&this.open();else if((b.which===f.BACKSPACE&&1==this.keydowns||b.which==f.LEFT)&&0==d&&!g)this.selectChoice(a.find(".select2-search-choice:not(.select2-locked)").last()),j(b);else{this.selectChoice(null);if(this.opened())switch(b.which){case f.UP:case f.DOWN:this.moveHighlight(b.which===f.UP?-1:1);j(b);return;case f.ENTER:this.selectHighlighted();j(b);return;case f.TAB:this.selectHighlighted({noFocus:!0});
this.close();return;case f.ESC:this.cancel(b);j(b);return}b.which===f.TAB||f.isControl(b)||f.isFunctionKey(b)||b.which===f.BACKSPACE||b.which===f.ESC||b.which===f.ENTER&&(!1===this.opts.openOnEnter||b.altKey||b.ctrlKey||b.shiftKey||b.metaKey)||(this.open(),(b.which===f.PAGE_UP||b.which===f.PAGE_DOWN)&&j(b),b.which===f.ENTER&&j(b))}}}));this.search.on("keyup",this.bind(function(){this.keydowns=0;this.resizeSearch()}));this.search.on("blur",this.bind(function(a){this.container.removeClass("select2-container-active");
this.search.removeClass("select2-focused");this.selectChoice(null);this.opened()||this.clearSearch();a.stopImmediatePropagation();this.opts.element.trigger(e.Event("select2-blur"))}));this.container.on("click",".select2-choices",this.bind(function(a){this.isInterfaceEnabled()&&!(0<e(a.target).closest(".select2-search-choice").length)&&(this.selectChoice(null),this.clearPlaceholder(),this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.open(),
this.focusSearch(),a.preventDefault())}));this.container.on("focus",".select2-choices",this.bind(function(){this.isInterfaceEnabled()&&(this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"),this.clearPlaceholder())}));this.initContainerWidth();this.opts.element.addClass("select2-offscreen");this.clearSearch()},enableInterface:function(){this.parent.enableInterface.apply(this,
arguments)&&this.search.prop("disabled",!this.isInterfaceEnabled())},initSelection:function(){""===this.opts.element.val()&&""===this.opts.element.text()&&(this.updateSelection([]),this.close(),this.clearSearch());if(this.select||""!==this.opts.element.val()){var a=this;this.opts.initSelection.call(null,this.opts.element,function(b){if(b!==void 0&&b!==null){a.updateSelection(b);a.close();a.clearSearch()}})}},clearSearch:function(){var a=this.getPlaceholder(),b=this.getMaxSearchWidth();void 0!==a&&
0===this.getVal().length&&!1===this.search.hasClass("select2-focused")?(this.search.val(a).addClass("select2-default"),this.search.width(0<b?b:this.container.css("width"))):this.search.val("").width(10)},clearPlaceholder:function(){this.search.hasClass("select2-default")&&this.search.val("").removeClass("select2-default")},opening:function(){this.clearPlaceholder();this.resizeSearch();this.parent.opening.apply(this,arguments);this.focusSearch();this.updateResults(!0);this.search.focus();this.opts.element.trigger(e.Event("select2-open"))},
close:function(){this.opened()&&this.parent.close.apply(this,arguments)},focus:function(){this.close();this.search.focus()},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(a){var b=[],c=[],d=this;e(a).each(function(){0>k(d.id(this),b)&&(b.push(d.id(this)),c.push(this))});a=c;this.selection.find(".select2-search-choice").remove();e(a).each(function(){d.addSelectedChoice(this)});d.postprocessResults()},tokenize:function(){var a=this.search.val(),a=this.opts.tokenizer.call(this,
a,this.data(),this.bind(this.onSelect),this.opts);null!=a&&void 0!=a&&(this.search.val(a),0<a.length&&this.open())},onSelect:function(a,b){this.triggerSelect(a)&&(this.addSelectedChoice(a),this.opts.element.trigger({type:"selected",val:this.id(a),choice:a}),(this.select||!this.opts.closeOnSelect)&&this.postprocessResults(a,!1,!0===this.opts.closeOnSelect),this.opts.closeOnSelect?(this.close(),this.search.width(10)):0<this.countSelectableResults()?(this.search.width(10),this.resizeSearch(),0<this.getMaximumSelectionSize()&&
this.val().length>=this.getMaximumSelectionSize()&&this.updateResults(!0),this.positionDropdown()):(this.close(),this.search.width(10)),this.triggerChange({added:a}),(!b||!b.noFocus)&&this.focusSearch())},cancel:function(){this.close();this.focusSearch()},addSelectedChoice:function(a){var b=!a.locked,c=e("<li class='select2-search-choice'>    <div></div>    <a href='#' onclick='return false;' class='select2-search-choice-close' tabindex='-1'></a></li>"),d=e("<li class='select2-search-choice select2-locked'><div></div></li>"),
c=b?c:d,d=this.id(a),f=this.getVal(),h;h=this.opts.formatSelection(a,c.find("div"),this.opts.escapeMarkup);void 0!=h&&c.find("div").replaceWith("<div>"+h+"</div>");h=this.opts.formatSelectionCssClass(a,c.find("div"));void 0!=h&&c.addClass(h);if(b)c.find(".select2-search-choice-close").on("mousedown",j).on("click dblclick",this.bind(function(a){this.isInterfaceEnabled()&&(e(a.target).closest(".select2-search-choice").fadeOut("fast",this.bind(function(){this.unselect(e(a.target));this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");
this.close();this.focusSearch()})).dequeue(),j(a))})).on("focus",this.bind(function(){this.isInterfaceEnabled()&&(this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"))}));c.data("select2-data",a);c.insertBefore(this.searchContainer);f.push(d);this.setVal(f)},unselect:function(a){var b=this.getVal(),c,d,a=a.closest(".select2-search-choice");if(0===a.length)throw"Invalid argument: "+a+". Must be .select2-search-choice";if(c=a.data("select2-data")){for(;0<=
(d=k(this.id(c),b));)b.splice(d,1),this.setVal(b),this.select&&this.postprocessResults();b=e.Event("select2-removing");b.val=this.id(c);b.choice=c;this.opts.element.trigger(b);b.isDefaultPrevented()||(a.remove(),this.opts.element.trigger({type:"select2-removed",val:this.id(c),choice:c}),this.triggerChange({removed:c}))}},postprocessResults:function(a,b,c){var d=this.getVal(),b=this.results.find(".select2-result"),e=this.results.find(".select2-result-with-children"),f=this;b.each2(function(a,b){var c=
f.id(b.data("select2-data"));0<=k(c,d)&&(b.addClass("select2-selected"),b.find(".select2-result-selectable").addClass("select2-selected"))});e.each2(function(a,b){!b.is(".select2-result-selectable")&&0===b.find(".select2-result-selectable:not(.select2-selected)").length&&b.addClass("select2-selected")});-1==this.highlight()&&!1!==c&&f.highlight(0);!this.opts.createSearchChoice&&0<!b.filter(".select2-result:not(.select2-selected)").length&&(!a||a&&!a.more&&0===this.results.find(".select2-no-results").length)&&
r(f.opts.formatNoMatches,"formatNoMatches")&&this.results.append("<li class='select2-no-results'>"+f.opts.formatNoMatches(f.search.val())+"</li>")},getMaxSearchWidth:function(){return this.selection.width()-(this.search.outerWidth(!1)-this.search.width())},resizeSearch:function(){var a,b,c,d,f=this.search.outerWidth(!1)-this.search.width();a=this.search;v||(c=a[0].currentStyle||window.getComputedStyle(a[0],null),v=e(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",
display:"none",fontSize:c.fontSize,fontFamily:c.fontFamily,fontStyle:c.fontStyle,fontWeight:c.fontWeight,letterSpacing:c.letterSpacing,textTransform:c.textTransform,whiteSpace:"nowrap"}),v.attr("class","select2-sizer"),e("body").append(v));v.text(a.val());a=v.width()+10;b=this.search.offset().left;c=this.selection.width();d=this.selection.offset().left;b=c-(b-d)-f;b<a&&(b=c-f);40>b&&(b=c-f);0>=b&&(b=a);this.search.width(Math.floor(b))},getVal:function(){var a;if(this.select)return a=this.select.val(),
null===a?[]:a;a=this.opts.element.val();return B(a,this.opts.separator)},setVal:function(a){var b;this.select?this.select.val(a):(b=[],e(a).each(function(){0>k(this,b)&&b.push(this)}),this.opts.element.val(0===b.length?"":b.join(this.opts.separator)))},buildChangeDetails:function(a,b){for(var b=b.slice(0),a=a.slice(0),c=0;c<b.length;c++)for(var d=0;d<a.length;d++)m(this.opts.id(b[c]),this.opts.id(a[d]))&&(b.splice(c,1),0<c&&c--,a.splice(d,1),d--);return{added:b,removed:a}},val:function(a,b){var c,
d=this;if(0===arguments.length)return this.getVal();c=this.data();c.length||(c=[]);if(!a&&0!==a)this.opts.element.val(""),this.updateSelection([]),this.clearSearch(),b&&this.triggerChange({added:this.data(),removed:c});else{this.setVal(a);if(this.select)this.opts.initSelection(this.select,this.bind(this.updateSelection)),b&&this.triggerChange(this.buildChangeDetails(c,this.data()));else{if(void 0===this.opts.initSelection)throw Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element,
function(a){var f=e.map(a,d.id);d.setVal(f);d.updateSelection(a);d.clearSearch();b&&d.triggerChange(d.buildChangeDetails(c,d.data()))})}this.clearSearch()}},onSortStart:function(){if(this.select)throw Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");this.search.width(0);this.searchContainer.hide()},onSortEnd:function(){var a=[],b=this;this.searchContainer.show();this.searchContainer.appendTo(this.searchContainer.parent());this.resizeSearch();
this.selection.find(".select2-search-choice").each(function(){a.push(b.opts.id(e(this).data("select2-data")))});this.setVal(a);this.triggerChange()},data:function(a,b){var c=this,d,f;if(0===arguments.length)return this.selection.find(".select2-search-choice").map(function(){return e(this).data("select2-data")}).get();f=this.data();a||(a=[]);d=e.map(a,function(a){return c.opts.id(a)});this.setVal(d);this.updateSelection(a);this.clearSearch();b&&this.triggerChange(this.buildChangeDetails(f,this.data()))}});
e.fn.select2=function(){var a=Array.prototype.slice.call(arguments,0),b,c,d,f,h,j="val destroy opened open close focus isFocused container dropdown onSortStart onSortEnd enable disable readonly positionDropdown data search".split(" "),i=["opened","isFocused","container","dropdown"],m=["val","data"],o={search:"externalSearch"};this.each(function(){if(0===a.length||"object"===typeof a[0])b=0===a.length?{}:e.extend({},a[0]),b.element=e(this),"select"===b.element.get(0).tagName.toLowerCase()?h=b.element.prop("multiple"):
(h=b.multiple||!1,"tags"in b&&(b.multiple=h=!0)),c=h?new E:new D,c.init(b);else if("string"===typeof a[0]){if(0>k(a[0],j))throw"Unknown method: "+a[0];f=void 0;c=e(this).data("select2");if(void 0!==c&&(d=a[0],"container"===d?f=c.container:"dropdown"===d?f=c.dropdown:(o[d]&&(d=o[d]),f=c[d].apply(c,a.slice(1))),0<=k(a[0],i)||k(a[0],m)&&1==a.length))return!1}else throw"Invalid arguments to select2 plugin: "+a;});return void 0===f?this:f};e.fn.select2.defaults={width:"copy",loadMorePadding:0,closeOnSelect:!0,
openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(a,b,c,d){b=[];I(a.text,c.term,b,d);return b.join("")},formatSelection:function(a,b,c){return a?c(a.text):void 0},sortResults:function(a){return a},formatResultCssClass:function(){},formatSelectionCssClass:function(){},formatNoMatches:function(){return"No matches found"},formatInputTooShort:function(a,b){var c=b-a.length;return"Please enter "+c+" more character"+(1==c?"":"s")},formatInputTooLong:function(a,
b){var c=a.length-b;return"Please delete "+c+" character"+(1==c?"":"s")},formatSelectionTooBig:function(a){return"You can only select "+a+" item"+(1==a?"":"s")},formatLoadMore:function(){return"Loading more results..."},formatSearching:function(){return"Searching..."},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(a){return a.id},matcher:function(a,b){return 0<=w(""+b).toUpperCase().indexOf(w(""+a).toUpperCase())},separator:",",tokenSeparators:[],
tokenizer:P,escapeMarkup:J,blurOnChange:!1,selectOnBlur:!1,adaptContainerCssClass:function(a){return a},adaptDropdownCssClass:function(){return null},nextSearchTerm:function(){}};e.fn.select2.ajaxDefaults={transport:e.ajax,params:{type:"GET",cache:!1,dataType:"json"}};window.Select2={query:{ajax:K,local:L,tags:M},util:{debounce:H,markMatch:I,escapeMarkup:J,stripDiacritics:w},"class":{"abstract":s,single:D,multi:E}}}return{}}.call(this);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.auiplugin:internal-@atlassian-aui-src-js-aui-select2', location = 'node_modules/@atlassian/aui/src/js/aui/select2.js' */
("undefined"===typeof window?global:window).__cbae0711ad03dade6eafbd2c419f6a9c=function(){"use strict";var b=__307d3e18fd611f85395c67cddeb1fe24,d=b&&b.__esModule?b:{"default":b};__f8808db850ac1b5b58d33da133a8f08d;var e=d.default.fn.select2;d.default.fn.auiSelect2=function(b){var c;if(d.default.isPlainObject(b)){var a=d.default.extend({},b);c=a.hasAvatar?" aui-has-avatar":"";a.containerCssClass="aui-select2-container"+c+(a.containerCssClass?" "+a.containerCssClass:"");a.dropdownCssClass="aui-select2-drop aui-dropdown2 aui-style-default"+
c+(a.dropdownCssClass?" "+a.dropdownCssClass:"");c=Array.prototype.slice.call(arguments,1);c.unshift(a)}else c=arguments.length?arguments:[{containerCssClass:"aui-select2-container",dropdownCssClass:"aui-select2-drop aui-dropdown2 aui-style-default"}];return e.apply(this,c)};return{}}.call(this);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:space-page-picker', location = '/js/space-page-picker.js' */
define("confluence-ui-components/js/space-page-picker",["underscore","ajs","jquery"],function(J,s,y){var H={conf_all:"All spaces",conf_favorites:"Favourite spaces",conf_global:"Site spaces",conf_personal:"Personal spaces",conf_current:"Current space"};var i={"currentContent()":"Current page"};var A={data:null,suggestCategories:null};var r="SPACE-PAGE-TRIGGER-VALUE";var m={placeholder:"Select a space or page",multiple:true,formatInputTooShort:function(){return "Start typing to search"},formatResult:function(M,O,R){if(M.children){O.addClass("space-page-picker-result-category");return y.fn.select2.defaults.formatResult.apply(this,arguments)}else{if(M.id){O.attr("title",M.text);O.addClass("space-page-picker-result-label-with-icon");var L=y("<span/>").addClass(M.className+" item-text").html(y.fn.select2.defaults.formatResult.apply(this,arguments));var Q=(M.subText)?y("<span/>").addClass("space-name").html(M.subText):y("");var N=y("<span/>").attr(e(M.id),M.id).append(L).append(Q);var P=y("<span/>").append(N);return P}else{O.addClass(M.className);return y.fn.select2.defaults.formatResult.apply(this,arguments)}}},formatSelection:function(M,N){N.addClass("space-page-picker-selected-item");N.attr("title",M.text);var L=y("<span/>").attr(e(M.id),M.id).addClass(M.className+" item-text").html(y.fn.select2.defaults.formatSelection.apply(this,arguments));N.append(L)},escapeMarkup:function(L){return L},formatResultCssClass:function(L){return(L.children||L.id)?"":"select2-result-space-page-separator"},containerCssClass:"space-page-picker-container",dropdownCssClass:"space-page-picker-drop"};var p=function(L,N){var M=L.data("select2").opts.manualInit;if(M===true){return}C(L.val(),L,N)};function K(N,M,L){var O=J.map(N,function(P){return M[P]});return(L)?O:((O.length>0)?O[0]:null)}var q=function(L){var N;if(L.suggestCategories){var O={text:"Suggested categories",children:J.map(L.suggestCategories,function(P){return g(P)})}}if(L.suggestedContentFunctions){var M=J.map(L.suggestedContentFunctions,function(P){return x(P)})}return function(Q){if(N){Q.callback(N);return}var P=[];N={results:[]};if(a(L)){var S=y.getJSON(s.contextPath()+"/rest/recentlyviewed/1.0/recent/spaces").done(function(T){var U=(O)?[O]:[];(T.length>0)&&U.push({text:"Suggested spaces",children:J.map(T,function(V){return z(V.key,J.escape(V.name),null,true)})});(U.length>0)&&(N.results=N.results.concat(U))}).fail(function(){s.debug("Couldn't fetch recent spaces");var T=(O)?[O]:[];(T.length>0)&&(N.results=N.results.concat(T))});P.push(S)}if(n(L)){var R=y.getJSON(s.contextPath()+"/rest/recentlyviewed/1.0/recent/pages",{noTrashedContent:true}).done(function(T){if(T.length>0||M){var U=[];if(M){U=U.concat(M)}if(T.length>0){U=U.concat(J.map(T,function(V){return t(V.id,J.escape(V.title),J.escape(V.space),"content-type-page",true)}))}N.results.push({text:"Suggested pages",children:U})}}).fail(function(){s.debug("Couldn't fetch recent pages")});P.push(R)}y.when.apply(y,J.map(P,function(U){var T=y.Deferred();U.always(function(){T.resolve()});return T})).done(function(){if(N.results.length===0){N.results=[{text:"",children:[]}]}Q.callback(N)})}};var u=function(L){var M="";if(!L||L.length===2&&L.indexOf("space")>=0&&L.indexOf("page")>=0){M="type=spacedesc&type=personalspacedesc&type=page"}else{if(L.length===1&&L[0]==="space"){M="type=spacedesc&type=personalspacedesc"}else{if(L.length===1&&L[0]==="page"){M="type=page"}else{return}}}return window.Select2.query.ajax({url:s.contextPath()+"/rest/quicknav/1/search?"+M,data:function(N,O){return{query:N,maxPerCategory:25}},quietMillis:250,results:function(Q,U){var T=Q.contentNameMatches;if(T.length<=1){return{results:[]}}else{var V=[];var O=function(W){return G(W.spaceKey,W.spaceName,W.id,W.name,W.className)};for(var R=0;R<T.length-1;R++){var S=[];for(var P=0;P<T[R].length;P++){var N=O(T[R][P]);if(N){S.push(N)}}if(S.length>0){V=V.concat(S);V.push({id:"",text:"",subText:"",className:"",disabled:true})}}return{results:[{text:"Search results",children:V}]}}}})};var I=function(M){var L=u(M.contentType);var N=q(M);return function(O){if(O.term.length<2){N(O)}else{L(O)}}};function e(L){return(L.indexOf("page:")===0)?"data-item-id":"data-item-key"}function z(L,O,M,N){M=(M)?M:((L.indexOf("~")===0)?"content-type-personalspacedesc":"content-type-spacedesc");return h("space",L,O,"",M,N)}function g(L){var M=H[L];return h("space-cat",L,M,"","content-type-space-category",M)}function x(L){var M=i[L];return h("content-function",L,M,"","content-type-page",M)}function t(P,O,L,M,N){return h("page",P,O,L,M,N)}function h(R,O,Q,N,M,P){var L=f(R,O);Q=(!Q)?O:Q;M=(P)?M:(M+" content-not-found");return{id:L,text:Q,subText:N,className:M,disabled:(P?false:true)}}function k(L){return"space-cat:"+L}function j(L){return"content-function:"+L}function v(L){return"space:"+L}function w(L){return"page:"+L}function G(P,M,Q,N,O){var L;if(O==="content-type-spacedesc"||O==="content-type-personalspacedesc"){L=z(P,M,O,true)}else{if(O==="content-type-page"){L=t(Q,N,M,O,true)}}return L}function f(){var L=Array.prototype.slice.apply(arguments);return L.join(":")}function a(L){return((!L.contentType||L.contentType.length===0||L.contentType.indexOf("space")>=0)&&L.showRecentlyViewedSpaces!==false)}function n(L){return((!L.contentType||L.contentType.length===0||L.contentType.indexOf("page")>=0)&&L.showRecentlyViewedPages!==false)}function E(M,L){var N=c("SpaceCat",M,L.inputSpaceCatId,(L.inputSpaceCatName)?L.inputSpaceCatName:L.inputSpaceCatId);return B(M,N.id,N.name)}function F(M,L){var O=L.inputContentFunctionId||"legacy-macro-param-content-funcs";var N=c("ContentFunction",M,O,L.inputContentFunctionName||O);return B(M,N.id,N.name)}function l(M,L){var N=c("Space",M,L.inputSpaceId,(L.inputSpaceName)?L.inputSpaceName:L.inputSpaceId);return B(M,N.id,N.name)}function o(M,L){var N=c("Page",M,L.inputPageId,(L.inputPageName)?L.inputPageName:L.inputPageId);return B(M,N.id,N.name)}function c(P,N,Q,M){var L;if(!Q){L=N.attr("id");if(!L){return null}Q=L+P}if(!M){var O=N.attr("name")||L;M=O+P}return{id:Q,name:M}}function B(M,O,L){var N=y("#"+O);if(N.length===0){N=y(Confluence.UI.Components.templates.hiddenField({id:O,name:L}));M.after(N)}return N}function b(M,O,N){if(!M){return}var L=J.filter(O,function(P){return P.indexOf(N)===0});L=J.map(L,function(P){return P.substring(N.length,P.length)});M.val(L.join(","))}function d(S,N,O,L){O=(O)?(J.isArray(O)?O:O.split(",")):[];L=(L)?L.split(","):[];var R=J.union(O,L);var M=J.map(R,function(U){return N+U});var P=S.val();var T=P?P.split(","):[];var Q=J.union(T,M);if(Q.length>0){S.val(Q.join(","))}}function D(M){var L=J.extend({},A,m,M);if(!M.data){L=J.extend({},{initSelection:p,query:I(L)},L)}var N=y(L.orgElement);if(!N||N.length!==1){return L}if(!N.val()&&!L.manualInit){N.val(r)}N.addClass("select2-input");return L}function C(R,U,N){var M=U.data("select2").opts;var P=M.placeholder||U.data("placeholder");var T=E(U,M);var W=F(U,M);var L=l(U,M);var X=o(U,M);U.on("change",function(ad){b(T,ad.val,"space-cat:");b(W,ad.val,"content-function:");b(L,ad.val,"space:");b(X,ad.val,"page:")});U.val("");var ab=(U["0"].tagName==="SELECT")?(U.context.multiple):(M.multiple);var V=[];var Y=[];var ac=[];var O=[];var aa={};var Q=(R)?R.split(","):[];Q=J.filter(Q,function(ad){var ae=ad.split(":");if(ae.length===2){return true}else{if(ae.length<0||ae.length>=3||(ae.length===1&&(ae[0]!==r&&ae[0]!==P))){s.debug("Error value: "+ae)}}});R=Q.join(",");U.val(R);d(U,"space-cat:",M.spaceCatKeys,(T)?T.val():"");d(U,"content-function:",M.pageCatKeys,(W)?W.val():"");d(U,"space:",M.spaceKeys,(L)?L.val():"");d(U,"page:",M.pageIds,(X)?X.val():"");R=U.val();Q=(R)?R.split(","):[];b(T,Q,"space-cat:");b(W,Q,"content-function:");b(L,Q,"space:");b(X,Q,"page:");if(Q.length===0){return}J.each(Q,function(ad,ae){var ah=ad.split(":");if(ah.length===2){var ag=ah[0];var af=ah[1];if(ag==="space-cat"){V.push(af)}else{if(ag==="content-function"){ac.push(af)}else{if(ag==="space"){Y.push(af)}else{if(ag==="page"){O.push(af)}}}}}});J.each(V,function(ad){aa[k(ad)]=g(ad)});J.each(ac,function(ad){aa[j(ad)]=x(ad)});var Z=[];if(Y.length>0){var S=y.getJSON(s.contextPath()+"/rest/prototype/1/space",{spaceKey:Y}).done(function(af){var ad=[];J.each(af.space,function(ag){aa[v(ag.key)]=z(ag.key,J.escape(ag.name),null,true);ad.push(ag.key)});var ae=J.difference(Y,ad);J.each(ae,function(ag){aa[v(ag)]=z(ag,ag,null,false)})}).fail(function(){s.debug("Couldn't resolve spaceKeys:",Y);J.each(Y,function(ad){aa[v(ad)]=z(ad,ad,null,false)})});Z.push(S)}J.each(O,function(ad){var ae=y.getJSON(s.contextPath()+"/rest/api/content/"+ad,{expand:"space"}).done(function(af){aa[w(af.id)]=t(af.id,J.escape(af.title),J.escape(af.space.name),"content-type-page",true)}).fail(function(){s.debug("Couldn't resolve pageId:",ad);aa[w(ad)]=t(ad,ad,"","content-type-page",false)});Z.push(ae)});y.when.apply(y,J.map(Z,function(ae){var ad=new y.Deferred();ae.always(function(){ad.resolve()});return ad.promise()})).done(function(){N(K(Q,aa,ab))})}return{build:D,setValue:function(M,L){C(M,L,function(N){L.auiSelect2("data",N)})}}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:space-page-picker', location = '/js/internal/space-page-picker-legacy.js' */
window.Confluence.UI.Components.SpacePagePicker=require("confluence-ui-components/js/space-page-picker");AJS.deprecate.prop(window.Confluence.UI.Components.SpacePagePicker,"build",{sinceVersion:"1.4.34",extraInfo:"Use require('confluence-ui-components/js/space-page-picker')"});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:space-page-picker', location = '/soy/space-page-picker.soy' */
// This file was automatically generated from space-page-picker.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.UI.Components.templates.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.UI == 'undefined') { Confluence.UI = {}; }
if (typeof Confluence.UI.Components == 'undefined') { Confluence.UI.Components = {}; }
if (typeof Confluence.UI.Components.templates == 'undefined') { Confluence.UI.Components.templates = {}; }


Confluence.UI.Components.templates.hiddenField = function(opt_data, opt_ignored) {
  return '<input type="hidden" id="' + soy.$$escapeHtml(opt_data.id) + '" name="' + soy.$$escapeHtml(opt_data.name) + '" />';
};
if (goog.DEBUG) {
  Confluence.UI.Components.templates.hiddenField.soyTemplateName = 'Confluence.UI.Components.templates.hiddenField';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:page-picker', location = '/js/page-picker.js' */
define("confluence-ui-components/js/page-picker",["ajs","confluence-ui-components/js/space-page-picker"],function(a,b){return{build:function(c){c.placeholder="Select a page";c.contentType=["page"];c.showRecentlyViewedSpaces=false;c.spaceCatKeys=[];c.spaceKeys=[];return b.build(c)}}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:page-picker', location = '/js/internal/page-picker-legacy.js' */
window.Confluence.UI.Components.PagePicker=require("confluence-ui-components/js/page-picker");AJS.deprecate.prop(window.Confluence.UI.Components.PagePicker,"build",{sinceVersion:"1.4.34",extraInfo:"Use require('confluence-ui-components/js/page-picker')"});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:label-picker', location = '/js/label-picker.js' */
define("confluence-ui-components/js/label-picker",["ajs","confluence/legacy","jquery","underscore"],function(g,i,e,j){var a=/[;,\.\?&\[\(\)#\^\*@!<>\]]/g;function l(m){var n=j.uniq(m.match(a));return n.join(" ")}function b(m){return{id:m.name,text:m.name}}function c(m){if(!m||!m.length){return null}var n=j.map(m,b);return j.sortBy(n,function(o){return o.text.toLowerCase()})}function k(o){var n=o.contentNameMatches;var p=c(n[0]);var m=c(n[1]);if(p&&m){return[{text:"Suggested",children:p},{text:"Other",children:m}]}return p||m||[]}function f(m){return function(n){return e.extend({query:n,ignoreRelated:true,maxResults:10},m)}}var d={placeholder:"Add labels",multiple:true,minimumInputLength:1,maximumSelectionSize:20,tokenSeparators:[" ",","],formatInputTooShort:function(n,m){return "Start typing to search for a label"},formatSelectionTooBig:function(m){return g.format("You can only input {0} labels",m)},formatResult:function(m){return i.UI.Components.LabelPicker.templates.labelResult({label:{labelName:m.text,isNew:m.isNew}})},formatNoMatches:function(n){var m=l(n);if(m){return i.UI.Components.LabelPicker.templates.labelInvalid({inputValue:n,invalidCharacters:m})}return this.noMatches},createSearchChoice:function(n){if(!n){return null}var m=l(n);if(m){return null}return{id:n,text:n,isNew:true}},ajax:{data:f(),dataType:"json",url:i.getContextPath()+"/labels/autocompletelabel.action",results:function(m){return{results:k(m)}},quietMillis:300},dropdownCssClass:"labels-dropdown",containerCssClass:"labels-autocomplete",initSelection:function(m,p){var o=m.val().split(",");var n=j.map(o,function(q){return{id:q,text:q}});p(n)}};function h(n){var m=e.extend({},d,n);if(n&&n.queryOpts){m.ajax.data=f(n.queryOpts);delete m.queryOpts}if(!n||!n.noMatches){m.noMatches=m.placeholder}return m}return{build:h}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:label-picker', location = '/js/label-picker-legacy.js' */
window.Confluence.UI.Components.LabelPicker=require("confluence-ui-components/js/label-picker");AJS.deprecate.prop(window.Confluence.UI.Components.LabelPicker,"build",{sinceVersion:"1.4.18",extraInfo:"Use require('confluence-ui-components/js/label-picker')"});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:label-picker', location = '/soy/label-picker.soy' */
// This file was automatically generated from label-picker.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.UI.Components.LabelPicker.templates.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.UI == 'undefined') { Confluence.UI = {}; }
if (typeof Confluence.UI.Components == 'undefined') { Confluence.UI.Components = {}; }
if (typeof Confluence.UI.Components.LabelPicker == 'undefined') { Confluence.UI.Components.LabelPicker = {}; }
if (typeof Confluence.UI.Components.LabelPicker.templates == 'undefined') { Confluence.UI.Components.LabelPicker.templates = {}; }


Confluence.UI.Components.LabelPicker.templates.labelResult = function(opt_data, opt_ignored) {
  return '' + ((opt_data.label.isNew) ? soy.$$escapeHtml(AJS.format('\x22{0}\x22 - add a new label',opt_data.label.labelName)) : soy.$$escapeHtml(opt_data.label.labelName));
};
if (goog.DEBUG) {
  Confluence.UI.Components.LabelPicker.templates.labelResult.soyTemplateName = 'Confluence.UI.Components.LabelPicker.templates.labelResult';
}


Confluence.UI.Components.LabelPicker.templates.labelInvalid = function(opt_data, opt_ignored) {
  var output = '';
  var inputValueHtml__soy9 = '<b>' + soy.$$escapeHtml(opt_data.inputValue) + '</b>';
  var invalidCharactersHtml__soy13 = '<b>' + soy.$$escapeHtml(opt_data.invalidCharacters) + '</b>';
  output += soy.$$filterNoAutoescape(AJS.format('{0} contains invalid characters {1}',inputValueHtml__soy9,invalidCharactersHtml__soy13));
  return output;
};
if (goog.DEBUG) {
  Confluence.UI.Components.LabelPicker.templates.labelInvalid.soyTemplateName = 'Confluence.UI.Components.LabelPicker.templates.labelInvalid';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:include-exclude-picker', location = '/js/include-exclude-picker.js' */
define("confluence-ui-components/js/include-exclude-picker",["jquery","underscore"],function(d,j){var e="";function c(k){var l=k.charAt(0);if(j.contains(["-"],l)){e=l;k=k.substring(1)}else{e=""}return k}function h(k){var l=d.extend({},k);if(l.children){l.children=j.map(l.children,h)}else{l.id=e+l.id;l.text=e+l.text}return l}function b(k){return function(l){l=c(l);return k(l)}}function f(k){return function(m){var l=k?k(m):m;if(e){l.results=j.map(l.results,h)}return l}}function a(k){return function(l){return k(l,c,h)}}function g(k){var l=k.text.charAt(0);if(l==="-"){return"select2-search-choice-subtle"}return}function i(l){var k=d.extend({formatSelectionCssClass:g},l);if(k.query){k.query=a(k.query);return k}else{k.ajax=d.extend({},k.ajax);k.ajax.data=b(k.ajax.data);k.ajax.results=f(k.ajax.results);return k}}return{build:i}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:user-group-select2', location = '/js/user-group-select2.js' */
define("confluence-ui-components/js/user-group-select2",["ajs","confluence/legacy","jquery"],function(a,d,b){function c(f){f=f||document.body;var e=function(){var g=b(".select2-drop-active > .select2-results");if(g.children(".select2-result-selectable").length===0&&g.children(".select2-disabled").length){g.append('<li class="select2-no-results">'+a.escapeHtml("No matches found")+"</li>")}};b("input.autocomplete-multiusergroup[data-autocomplete-bound != 'true']",f).each(function(){var g=b(this);g.attr("data-autocomplete-bound","true");var h=g.attr("data-include-groups");g.auiSelect2({multiple:true,minimumInputLength:2,formatInputTooShort:function(){return h?"Start typing to search for a user or group":"Start typing to search for a user"},ajax:{transport:function(l){var m=l.success;delete l.success;return b.ajax.apply(b.ajax,arguments).done(m).done(e)},data:function(l){return{"max-results":6,query:l}},dataType:"json",url:d.getContextPath()+"/rest/prototype/1/search/user"+(h?"-or-group":"")+".json",results:function(m){var l=[];b.each(m.result,function(){if(this.type=="user"){l.push({id:this.username,text:this.title,imgSrc:this.thumbnailLink.href,entity:this})}else{l.push({id:this.name,text:this.name,imgSrc:a.contextPath()+"/images/icons/avatar_group_48.png",entity:this})}});return{results:l}},quietMillis:300},formatResult:function(l){return d.UI.Components.UserGroupSelect2.avatarWithName({size:"small",displayName:l.text,userId:l.id,avatarImageUrl:l.imgSrc})},escapeMarkup:function(l){return l},formatSelection:function(l){return d.UI.Components.UserGroupSelect2.avatarWithName({size:"xsmall",displayName:l.text,userId:l.id,avatarImageUrl:l.imgSrc})},dropdownCssClass:"users-dropdown",containerCssClass:"users-autocomplete",hasAvatar:true});if(!g.data("autofill-user")){return}var k=a.Meta.get("remote-user"),j=a.Meta.get("current-user-fullname"),i=a.Meta.get("current-user-avatar-uri-reference");if(k&&j&&i){g.auiSelect2("data",[{id:k,text:j,imgSrc:i}])}})}return{bind:c}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:user-group-select2', location = '/soy/user-group-select2.soy' */
// This file was automatically generated from user-group-select2.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.UI.Components.UserGroupSelect2.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.UI == 'undefined') { Confluence.UI = {}; }
if (typeof Confluence.UI.Components == 'undefined') { Confluence.UI.Components = {}; }
if (typeof Confluence.UI.Components.UserGroupSelect2 == 'undefined') { Confluence.UI.Components.UserGroupSelect2 = {}; }


Confluence.UI.Components.UserGroupSelect2.avatarWithName = function(opt_data, opt_ignored) {
  return '' + aui.avatar.avatar({size: opt_data.size, avatarImageUrl: opt_data.avatarImageUrl, accessibilityText: opt_data.displayName, title: opt_data.displayName, extraAttributes: {'data-username': opt_data.userId}}) + soy.$$escapeHtml(opt_data.displayName);
};
if (goog.DEBUG) {
  Confluence.UI.Components.UserGroupSelect2.avatarWithName.soyTemplateName = 'Confluence.UI.Components.UserGroupSelect2.avatarWithName';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:cql', location = 'soy/cql/cql-component.soy' */
// This file was automatically generated from cql-component.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.UI.Components.CQL.Templates.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.UI == 'undefined') { Confluence.UI = {}; }
if (typeof Confluence.UI.Components == 'undefined') { Confluence.UI.Components = {}; }
if (typeof Confluence.UI.Components.CQL == 'undefined') { Confluence.UI.Components.CQL = {}; }
if (typeof Confluence.UI.Components.CQL.Templates == 'undefined') { Confluence.UI.Components.CQL.Templates = {}; }


Confluence.UI.Components.CQL.Templates.container = function(opt_data, opt_ignored) {
  return '<div class="cql-container"><div class="cql-error-container"></div><div class="cql-fields"></div></div>';
};
if (goog.DEBUG) {
  Confluence.UI.Components.CQL.Templates.container.soyTemplateName = 'Confluence.UI.Components.CQL.Templates.container';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:cql', location = 'soy/cql/cql-filter-field.soy' */
// This file was automatically generated from cql-filter-field.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.UI.Components.CQLFilters.Templates.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.UI == 'undefined') { Confluence.UI = {}; }
if (typeof Confluence.UI.Components == 'undefined') { Confluence.UI.Components = {}; }
if (typeof Confluence.UI.Components.CQLFilters == 'undefined') { Confluence.UI.Components.CQLFilters = {}; }
if (typeof Confluence.UI.Components.CQLFilters.Templates == 'undefined') { Confluence.UI.Components.CQLFilters.Templates = {}; }


Confluence.UI.Components.CQLFilters.Templates.baseFilterField = function(opt_data, opt_ignored) {
  var output = '<div class="cql-filter cql-field-' + soy.$$escapeHtml(opt_data.field.fieldName) + ' cql-type-' + soy.$$escapeHtml(opt_data.field.uiSupport.valueType) + '">';
  var id__soy8 = 'cql-field-' + soy.$$escapeHtml(opt_data.field.fieldName) + '-' + soy.$$escapeHtml(opt_data.counter);
  output += '<div class=\'cql-field-heading\'><label for="' + soy.$$escapeHtml(id__soy8) + '">' + soy.$$escapeHtml(opt_data.label) + ((! opt_data.field.fixed) ? '<span class="aui-icon aui-icon-small aui-iconfont-remove" title="' + soy.$$escapeHtml('Remove filter') + '"></span>' : '') + '</label></div><div class=\'cql-filter-field-input-container\'><input type="text" class="cql-field-input text" id="' + soy.$$escapeHtml(id__soy8) + '"></div></div>';
  return output;
};
if (goog.DEBUG) {
  Confluence.UI.Components.CQLFilters.Templates.baseFilterField.soyTemplateName = 'Confluence.UI.Components.CQLFilters.Templates.baseFilterField';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:cql', location = 'soy/cql/cql-filter-select.soy' */
// This file was automatically generated from cql-filter-select.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.UI.Components.CQL.FilterSelect.Templates.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.UI == 'undefined') { Confluence.UI = {}; }
if (typeof Confluence.UI.Components == 'undefined') { Confluence.UI.Components = {}; }
if (typeof Confluence.UI.Components.CQL == 'undefined') { Confluence.UI.Components.CQL = {}; }
if (typeof Confluence.UI.Components.CQL.FilterSelect == 'undefined') { Confluence.UI.Components.CQL.FilterSelect = {}; }
if (typeof Confluence.UI.Components.CQL.FilterSelect.Templates == 'undefined') { Confluence.UI.Components.CQL.FilterSelect.Templates = {}; }


Confluence.UI.Components.CQL.FilterSelect.Templates.container = function(opt_data, opt_ignored) {
  return '<div class="cql-add-filter-container"><button type="button" class="aui-button aui-button-link">' + soy.$$escapeHtml('Add a filter') + '</button><div class="input-wrapper hidden"><input class="select2-input" type="text" /></div></div>';
};
if (goog.DEBUG) {
  Confluence.UI.Components.CQL.FilterSelect.Templates.container.soyTemplateName = 'Confluence.UI.Components.CQL.FilterSelect.Templates.container';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:cql', location = 'soy/date-picker.soy' */
// This file was automatically generated from date-picker.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.UI.Components.DatePicker.templates.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.UI == 'undefined') { Confluence.UI = {}; }
if (typeof Confluence.UI.Components == 'undefined') { Confluence.UI.Components = {}; }
if (typeof Confluence.UI.Components.DatePicker == 'undefined') { Confluence.UI.Components.DatePicker = {}; }
if (typeof Confluence.UI.Components.DatePicker.templates == 'undefined') { Confluence.UI.Components.DatePicker.templates = {}; }


Confluence.UI.Components.DatePicker.templates.input = function(opt_data, opt_ignored) {
  return '<div class="aui-navgroup-vertical"><ul class="aui-nav"><li class="aui-nav-selected"><a data-value="">' + soy.$$escapeHtml('Any date') + '</a></li><li><a data-value="now(\'-1d\')">' + soy.$$escapeHtml('Last 24 hours') + '</a></li><li><a data-value="now(\'-1w\')">' + soy.$$escapeHtml('Last week') + '</a></li><li><a data-value="now(\'-1M\')">' + soy.$$escapeHtml('Last month') + '</a></li><li><a data-value="now(\'-1y\')">' + soy.$$escapeHtml('Last year') + '</a></li><li><a data-value="custom">' + soy.$$escapeHtml('Custom') + '</a><span class="absolute-date-pickers"><input class="from-date-picker text" type="date" /><span>&ndash;</span><input class="to-date-picker text" type="date" /></span></li></ul></div>';
};
if (goog.DEBUG) {
  Confluence.UI.Components.DatePicker.templates.input.soyTemplateName = 'Confluence.UI.Components.DatePicker.templates.input';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:cql', location = 'soy/cql/cql-type-picker.soy' */
// This file was automatically generated from cql-type-picker.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.UI.Components.CQL.TypePicker.templates.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.UI == 'undefined') { Confluence.UI = {}; }
if (typeof Confluence.UI.Components == 'undefined') { Confluence.UI.Components = {}; }
if (typeof Confluence.UI.Components.CQL == 'undefined') { Confluence.UI.Components.CQL = {}; }
if (typeof Confluence.UI.Components.CQL.TypePicker == 'undefined') { Confluence.UI.Components.CQL.TypePicker = {}; }
if (typeof Confluence.UI.Components.CQL.TypePicker.templates == 'undefined') { Confluence.UI.Components.CQL.TypePicker.templates = {}; }


Confluence.UI.Components.CQL.TypePicker.templates.suggestions = function(opt_data, opt_ignored) {
  var output = '<div class="aui-navgroup-vertical"><ul class="aui-nav">';
  var typeList4 = opt_data.types;
  var typeListLen4 = typeList4.length;
  for (var typeIndex4 = 0; typeIndex4 < typeListLen4; typeIndex4++) {
    var typeData4 = typeList4[typeIndex4];
    output += '<li ' + ((typeIndex4 == 0) ? ' class="aui-nav-selected"' : '') + '><a data-value="' + soy.$$escapeHtml(typeData4.type) + '">' + soy.$$escapeHtml(typeData4.label) + '</a></li>';
  }
  output += '<li><a data-value="custom">' + soy.$$escapeHtml('Custom') + '</a></li></ul></div>';
  return output;
};
if (goog.DEBUG) {
  Confluence.UI.Components.CQL.TypePicker.templates.suggestions.soyTemplateName = 'Confluence.UI.Components.CQL.TypePicker.templates.suggestions';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:cql', location = 'soy/cql/cql-space-field.soy' */
// This file was automatically generated from cql-space-field.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.UI.Components.CQL.SpaceField.templates.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.UI == 'undefined') { Confluence.UI = {}; }
if (typeof Confluence.UI.Components == 'undefined') { Confluence.UI.Components = {}; }
if (typeof Confluence.UI.Components.CQL == 'undefined') { Confluence.UI.Components.CQL = {}; }
if (typeof Confluence.UI.Components.CQL.SpaceField == 'undefined') { Confluence.UI.Components.CQL.SpaceField = {}; }
if (typeof Confluence.UI.Components.CQL.SpaceField.templates == 'undefined') { Confluence.UI.Components.CQL.SpaceField.templates = {}; }


Confluence.UI.Components.CQL.SpaceField.templates.archivedSpacesOption = function(opt_data, opt_ignored) {
  return '<span><input type="checkbox" value="true" id="search-filter-include-archived" name="includeArchivedSpaces"><label for="search-filter-include-archived">Search archived spaces</label></span>';
};
if (goog.DEBUG) {
  Confluence.UI.Components.CQL.SpaceField.templates.archivedSpacesOption.soyTemplateName = 'Confluence.UI.Components.CQL.SpaceField.templates.archivedSpacesOption';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:cql', location = 'js/cql/internal/cql-special-spaces.js' */
define("confluence-ui-components/js/cql/internal/cql-special-spaces",["underscore"],function(c){var b={conf_current:"currentSpace()",conf_favorites:"favourite",conf_global:"global",conf_personal:"personal"};var f=c.invert(b);function d(g){if(g==="search-screen"){return c.omit(b,"conf_current")}return b}function a(g){return c.keys(d(g))}function e(g){return f[g]}return{getMap:d,getKeys:a,getUIValue:e}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:cql', location = 'js/cql/internal/cql-ajax.js' */
define("confluence-ui-components/js/cql/internal/cql-ajax",["jquery","underscore","ajs"],function(d,c,b){var g;function f(){if(!g){g=d.Deferred();var j=function(l){var m=c.values(l);if(!m.length){throw Error("Unknown CQL field data returned from server - cannot initialise CQL fields.")}var k=c.union.apply(c,m);k=c.sortBy(k,"fieldName");g.resolve(k)};var i=function(){g.reject()};d.getJSON(b.contextPath()+"/rest/cql/fields?filter=withUiSupport").done(j).fail(i)}return g.promise()}function e(i){return d.getJSON(b.contextPath()+"/rest/cql/expressions?cql="+encodeURIComponent(i))}function a(){return d.getJSON(b.contextPath()+"/rest/cql/contenttypes?category=content")}function h(){return d.getJSON(b.contextPath()+"/rest/cql/contenttypes?category=all")}return{getFields:f,parseClauses:e,getTypes:h,getContentTypes:a}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:cql', location = 'js/cql/internal/cql-date-picker.js' */
define("confluence-ui-components/js/cql/internal/cql-date-picker",["ajs","jquery"],function(a,b){function c(k){var h=b(Confluence.UI.Components.DatePicker.templates.input());var d=h.find(".aui-nav li");var g=h.find(".absolute-date-pickers").hide();var f=h.find(".from-date-picker");var i=h.find(".to-date-picker");var e=function(){};this.onChange=function(l){e=l;f.change(l);i.change(l)};h.on("click",".aui-nav a",function(){var l=d.filter("li.aui-nav-selected");var m=b(this).closest("li");if(l[0]!=m[0]){d.not(m).removeClass("aui-nav-selected");m.addClass("aui-nav-selected");e()}if(b(this).data("value")==="custom"){g.slideDown("fast")}else{g.slideUp("fast")}});var j={overrideBrowserDefault:true};a.DatePicker(f,j);a.DatePicker(i,j);f.attr("placeholder","From");i.attr("placeholder","To");k.replaceWith(h);return{getSelectedOption:function(){var l=d.filter(".aui-nav-selected").find("a");return l.data("value")},selectOption:function(m){var l=d.find('a[data-value="'+m+'"]');l.click()},getFromDate:function(){return f.val()},getToDate:function(){return i.val()},setFromDate:function(l){f.val(l);d.find("a[data-value='custom']").click()},setToDate:function(l){i.val(l);d.find("a[data-value='custom']").click()}}}return{build:c}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:cql', location = 'js/cql/internal/cql-type-picker.js' */
define("confluence-ui-components/js/cql/internal/cql-type-picker",["jquery","underscore","ajs","confluence-ui-components/js/cql/internal/cql-ajax","confluence-ui-components/js/include-exclude-picker","confluence/legacy","confluence-ui-components/js/cql/internal/cql-set-value-helper"],function(e,k,g,a,c,j,f){var b;var d=[];function m(n){d=k.map(n,function(o){return{id:o.type,text:o.label}})}function l(){b=null;d=[]}function h(o,n){if(o.length===0){return""}if(o.length==1&&k.contains(k.pluck(n,"type"),o[0])){return o[0]}return"custom"}function i(o,s){var u,n,q,t=[];if(!b){b=s?a.getContentTypes():a.getTypes();b.done(m)}b.done(function(){if(o.length){var v=k.pluck(d,"id");t=[].concat(d);o.forEach(function(w){if(w.type!==""&&!k.contains(v,w.type)){t.push({id:w.type,text:w.label})}})}else{t=d}});var r={query:function(v,x,w){b.done(function(){x(v.term);var y=window.Select2.query.local({results:k.map(t,w)});y(v)})},initSelection:function(w,z){var v=w.val().split(",");var y="";var x=k.map(v,function(A){var B=A.charAt(0);if(B==="-"){y="-";return A.substring(1)}return A});b.done(function(){var A=k.filter(t,function(B){return k.contains(x,B.id)});z(k.map(A,function(B){return{id:y+B.id,text:y+B.text}}))})},multiple:true,placeholder:"All content types"};function p(v){u=v;if(g.trace){u.on("change",function(){g.trace("type.field.changed")})}if(o.length){var w=e(j.UI.Components.CQL.TypePicker.templates.suggestions({types:o}));n=w.find(".aui-nav li");u.before(w);w.on("click",".aui-nav a",function(){var A=e(this).closest("li");var z=n.filter(".aui-nav-selected");if(A[0]===z[0]){return}z.removeClass("aui-nav-selected");A.addClass("aui-nav-selected");var y=e(this).attr("data-value");if(y=="custom"){q.slideDown("fast")}else{q.hide()}var x=true;u.select2("val",[y],x)})}u.auiSelect2(c.build(r));if(o.length){q=u.closest(".cql-filter").find(".select2-container");q.hide()}}return{setupInput:p,setValues:function(v){if(n){var w=h(v,o);var y=n.find('[data-value="'+w+'"]').parent();n.not(y).removeClass("aui-nav-selected");y.addClass("aui-nav-selected");if(w==="custom"){q.show()}}var x=e.Deferred();b.done(function(){f.setValues(u,v).done(function(){x.resolve()})});return x}}}return{build:i,_clearCache:l,_getPicklistKey:h}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:cql', location = 'js/cql/internal/cql-field-model.js' */
define("confluence-ui-components/js/cql/internal/cql-field-model",[],function(){function a(b){return b.uiSupport.label.translation}return{getLabel:a}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:cql', location = 'js/cql/internal/cql-space-expression-adjuster.js' */
define("confluence-ui-components/js/cql/internal/cql-space-expression-adjuster",["underscore","confluence-ui-components/js/cql/internal/cql-special-spaces"],function(c,a){function b(f){var e=f.functionValues;if(!e||!e.length){return f}var d=[];c.each(e,function(g){if(g.functionName==="currentSpace"){d.push(a.getUIValue("currentSpace()"))}else{throw new Error(g.functionName+" is not a known function")}});f.values=d.concat(f.values);return f}return{convertFunctionValues:b}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:cql', location = 'js/cql/internal/filterfields/cql-autocomplete-filter-field.js' */
define("confluence-ui-components/js/cql/internal/filterfields/cql-autocomplete-filter-field",["jquery","ajs","confluence/legacy","confluence-ui-components/js/cql/internal/cql-expression-builder","confluence-ui-components/js/cql/internal/cql-set-value-helper"],function(d,h,j,b,f){function k(m){var n=m.suggestedResults;var l=m.searchResults;if(!n.length){return l}if(!l.length){return n}return[{text:"Suggestions",children:n},{text:"Search results",children:l}]}function a(l){return{query:l,searchContext:JSON.stringify({spaceKey:h.Meta.get("space-key"),contentId:h.Meta.get("content-id")})}}var c={placeholder:"Start typing to search",multiple:true,tokenSeparators:[" ",","],createSearchChoice:function(l){if(!l){return null}return{id:l,text:"New result: "+l,isNew:true}},createSearchChoicePosition:"bottom",ajax:{data:a,results:function(l){return{results:k(l)}},quietMillis:300},initSelection:function(l,o){var n=l.val().split(",");var m=n.map(function(p){return{id:p,text:p}});o(m)}};function e(l){return l.indexOf("http://")===0||l.indexOf("https://")===0}function g(l){if(e(l)){return l}else{return j.getContextPath()+l}}function i(l){var m;return{setupInput:function(n){m=n;var p=d.extend({},c.ajax,{url:g(l.uiSupport.dataUri)});var o=d.extend({},c,{ajax:p});n.auiSelect2(o)},asCqlFunc:function(){var n=this.input.val().trim();if(!n){return undefined}return b.buildEqualityExpressionFromValuesString(this.fieldName,n)},setValues:function(n){return f.setValues(m,n.values)}}}return{build:i,_getUrl:g,_ajaxData:a}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:cql', location = 'js/cql/internal/filterfields/cql-content-filter-field.js' */
define("confluence-ui-components/js/cql/internal/filterfields/cql-content-filter-field",["jquery","confluence-ui-components/js/page-picker","confluence-ui-components/js/cql/internal/cql-expression-builder","confluence-ui-components/js/cql/internal/cql-set-value-helper"],function(d,h,a,b){function e(i){return"page:"+i}function c(i){return"content-function:"+i.functionName+"()"}function g(i){return i.values.map(e).concat(i.functionValues.map(c))}function f(){var i;return{setupInput:function(j){i=j;var k={multiple:this.fieldName!=="parent",suggestedContentFunctions:["currentContent()"]};j.auiSelect2(h.build(k))},asCqlFunc:function(){var k=this.input.val().trim();if(!k){return undefined}var j=k.replace(/[a-z\-]+:/g,"");return a.buildEqualityExpressionFromValuesString(this.fieldName,j)},_addValuePrefixes:g,setValues:function(k){var j=g(k);return b.setValues(i,j)}}}return{build:f}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:cql', location = 'js/cql/internal/filterfields/cql-type-suggestions.js' */
define("confluence-ui-components/js/cql/internal/filterfields/cql-type-suggestions",["ajs"],function(b){var c=[{type:"",label:"All content"},{type:"page",label:"Pages"},{type:"blogpost",label:"Blog Posts"},{type:"attachment",label:"Attachments"},{type:"space",label:"Spaces"}];function a(){return c}return{getList:a}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:cql', location = 'js/cql/internal/filterfields/cql-type-filter-field.js' */
define("confluence-ui-components/js/cql/internal/filterfields/cql-type-filter-field",["confluence-ui-components/js/cql/internal/cql-type-picker","confluence-ui-components/dark-features","confluence-ui-components/js/cql/internal/filterfields/cql-type-suggestions"],function(a,b,c){function d(f){var e;return{setupInput:function(g,h){var j=[];var i=true;if((h.environment==="search-screen"&&h.searchType=="all")||b.isEnabled("cql.force.full.search.mode")){j=c.getList();i=false}e=a.build(j,i);e.setupInput(g)},setValues:function(g){return e.setValues(g.values)}}}return{build:d}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:cql', location = 'js/cql/internal/filterfields/cql-date-filter-field.js' */
define("confluence-ui-components/js/cql/internal/filterfields/cql-date-filter-field",["ajs","underscore","confluence-ui-components/js/cql/internal/cql-date-picker"],function(b,c,a){function d(g){var h=g.fieldName;var f;function e(){var j=f.getFromDate();var i=f.getToDate();var l,k;if(j){l=h+' >= "'+j+'"'}if(i){k=h+' <= "'+i+'"'}if(l&&k){return l+" and "+k}return l||k||""}return{setupInput:function(i){f=a.build.call(this,i)},setValues:function(k){if(!f){b.warn("DatePicker not set yet, can't set values");return}var j=k.expressions;if(j.length<1||j.length>2){b.warn("Can't set date value with expressions.length: "+j.length);return}if(j.length===1&&j[0].functionValues.length===1&&j[0].functionValues[0].functionName==="now"){if(j[0].operator!==">="){b.warn("Unsupported date picker relative date operator: "+j[0].operator);return}var i=j[0].functionValues[0].parameters[0];f.selectOption("now('"+i+"')")}else{c.each(j,function(m){if(m.values.length===1){var l=m.values[0];if(m.operator===">="){f.setFromDate(l)}else{if(m.operator==="<="){f.setToDate(l)}}}})}},asCqlFunc:function(){if(!f){b.warn("DatePicker not set yet, can't get CQL");return}var i=f.getSelectedOption();if(!i){return""}if(i==="custom"){return e()}return h+" >= "+i}}}return{build:d}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:cql', location = 'js/cql/internal/filterfields/cql-label-filter-field.js' */
define("confluence-ui-components/js/cql/internal/filterfields/cql-label-filter-field",["jquery","ajs","confluence-ui-components/js/label-picker","confluence-ui-components/js/include-exclude-picker","confluence-ui-components/js/cql/internal/cql-set-value-helper"],function(d,c,a,e,b){function f(){var g;return{setupInput:function(h){g=h;h.auiSelect2(e.build(a.build({noMatches:"No matching labels found"})))},setValues:function(h){return b.setValues(g,h.values)}}}return{build:f}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:cql', location = 'js/cql/internal/filterfields/cql-space-filter-field.js' */
define("confluence-ui-components/js/cql/internal/filterfields/cql-space-filter-field",["jquery","confluence-ui-components/js/space-picker","confluence-ui-components/js/include-exclude-picker","confluence-ui-components/js/cql/internal/cql-special-spaces","confluence-ui-components/js/cql/internal/cql-space-expression-adjuster","confluence-ui-components/js/cql/internal/cql-space-expression-builder","confluence-ui-components/js/cql/internal/cql-set-value-helper","confluence/legacy"],function(b,e,a,d,i,f,c,h){function g(){var j;return{setupInput:function(k,l){j=k;k.auiSelect2(a.build(e.build({multiple:true,suggestCategories:d.getKeys(l.environment),disableMixedSpaceTypes:true})));if(l.environment==="search-screen"){var m=b(h.UI.Components.CQL.SpaceField.templates.archivedSpacesOption());j.after(m);this.onChange=function(o){var n=m.find("#search-filter-include-archived");n.change(o);j.change(o)}}},asCqlFunc:function(){return f.buildExpressionFromValuesString(this.input.val())},setValues:function(k){i.convertFunctionValues(k);return c.setValues(j,k.values)}}}return{build:g}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:cql', location = 'js/cql/internal/filterfields/cql-user-filter-field.js' */
define("confluence-ui-components/js/cql/internal/filterfields/cql-user-filter-field",["jquery","ajs","confluence-ui-components/js/user-group-select2"],function(c,b,a){function d(){var f;function e(h){var g=h[0].result[0];return{id:g.username,text:g.title,imgSrc:g.thumbnailLink.href}}return{setupInput:function(g){f=g;g.addClass("select2-input autocomplete-multiusergroup");a.bind(g.parent())},setValues:function(j){var h=j.values;if(!h||!h[0]){return}var i=h.map(function(k){return c.getJSON(b.contextPath()+"/rest/prototype/1/search/user.json?query="+encodeURI(k))});function g(){var l=i.length>1?arguments:[arguments];var k=l.map(e);f.auiSelect2("data",k)}return c.when.apply(c,i).done(g)}}}return{build:d}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:cql', location = 'js/cql/internal/filterfields/cql-filter-field-configs.js' */
define("confluence-ui-components/js/cql/internal/filterfields/cql-filter-field-configs",["confluence-ui-components/js/cql/internal/filterfields/cql-autocomplete-filter-field","confluence-ui-components/js/cql/internal/filterfields/cql-content-filter-field","confluence-ui-components/js/cql/internal/filterfields/cql-type-filter-field","confluence-ui-components/js/cql/internal/filterfields/cql-date-filter-field","confluence-ui-components/js/cql/internal/filterfields/cql-label-filter-field","confluence-ui-components/js/cql/internal/filterfields/cql-space-filter-field","confluence-ui-components/js/cql/internal/filterfields/cql-user-filter-field"],function(b,h,a,g,c,f,e){var d={contentId:h,contentType:a,date:g,label:c,space:f,user:e};return{getConfig:function(j){var i=j.uiSupport;if(i.dataUri){return b.build(j)}if(d[i.valueType]){return d[i.valueType].build(j)}return{}}}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:cql', location = 'js/cql/internal/cql-filter-field.js' */
define("confluence-ui-components/js/cql/internal/cql-filter-field",["jquery","underscore","ajs","confluence-ui-components/js/cql/internal/cql-field-model","confluence-ui-components/js/cql/internal/cql-expression-builder","confluence-ui-components/js/cql/internal/filterfields/cql-filter-field-configs"],function(d,j,h,g,c,a){var e=window.Confluence.UI.Components.CQLFilters.Templates;var f=0;function b(n){var l=g.getLabel(n);var m=d(e.baseFilterField({label:l,field:n,counter:f++}));var k=m.find("input");m.data("fieldName",n.fieldName);return d.extend({input:k,element:m,onChange:function(o){k.change(o)}},n)}function i(p,o){var n=p.uiSupport;var r=n.valueType;var q=p.fieldName;if(!r){throw new Error("Can't create filter without valueType.")}if(!q){throw new Error("Can't create filter without fieldName.")}var m=a.getConfig(p);var k=b(p);k.asCql=j.bind(m.asCqlFunc||function(){return c.buildExpression(k,this.input.val())},k);var l=k.element.find("input");if(typeof m.setupInput==="function"){k.setupInput=m.setupInput;k.setupInput(l,o.context)}k.setValues=m.setValues||function(s){l.val(s.values.join(","))};k.element.find(".aui-iconfont-remove").click(function(){k.element.remove();o.removeField(k)});return k}return{build:i}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:cql', location = 'js/cql/internal/cql-filter-select.js' */
define("confluence-ui-components/js/cql/internal/cql-filter-select",["jquery","underscore","ajs","confluence-ui-components/js/cql/internal/cql-ajax","confluence-ui-components/js/cql/internal/cql-field-model"],function(f,c,a,e,b){var d=window.Confluence.UI.Components.CQL.FilterSelect.Templates;function g(t){var r=t.cqlContainer;var m=r.find(".cql-fields");var i=t.onSelection;if(!i){throw Error("An onSelection callback must be provided to the FilterSelect.")}var s=f(d.container());var n=s.children("button");var q=s.find(".input-wrapper");var p=s.find("input");function j(u){u.preventDefault();q.removeClass("hidden");n.hide();s.find(".select2-choice").mousedown()}n.click(j);function h(){q.addClass("hidden");n.show()}p.bind("select2-close",function(){a.debug("CQL Field selector closed");h();setTimeout(function(){a.log("Checking CQL Field selector focus");if(!f(document.activeElement).closest(".cql-filter").length){a.debug("Setting CQL Field selector focus");n.focus()}},1)});r.append(s);function o(u){if(!u.added){return}p.auiSelect2("val","");i(u.added);a.debug("CQL Field selection made");h()}function k(u){if(t.context.environment!=="search-screen"&&!a.DarkFeatures.isEnabled("cql.search.screen")){u=c.reject(u,function(w){return w.type==="date"})}u=c.reject(u,function(w){return c.contains(t.ignoredFields,w.fieldName)});function v(){if(!m[0]){throw new Error("Why no cql-container?")}var x=m.find(".cql-filter").map(function(){return f(this).data("fieldName")});var w=c.reject(u,function(y){return c.contains(x,y.fieldName)&&!c.contains(["label"],y.fieldName)});return{results:w,text:b.getLabel}}p.auiSelect2({id:"fieldName",data:v,formatResult:b.getLabel,formatSelection:b.getLabel,placeholder:"Add a filter"}).change(o)}function l(){a.log("Couldn't fetch CQL fields - unable to initialise CQL field picker")}e.getFields().done(k).fail(l);return p}return{build:g}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:cql', location = 'js/cql/internal/cql-space-expression-builder.js' */
define("confluence-ui-components/js/cql/internal/cql-space-expression-builder",["jquery","underscore","confluence-ui-components/js/cql/internal/cql-special-spaces","confluence-ui-components/js/cql/internal/cql-expression-builder"],function(d,c,b,a){function e(k){var l=k.trim();if(!l){return undefined}var g=l.split(",");var m=b.getKeys();var f=[];var j=[];c.each(g,function(n){if(n==="conf_current"){f.push("currentSpace()")}else{if(c.contains(m,n)){j.push(n)}else{f.push(n)}}});var h=[];if(j.length){var i=b.getMap();j=c.map(j,function(n){return i[n]});if(j.indexOf("global")!==-1){h.push(a.buildEqualityExpressionFromValuesString("space.type","-personal"));j=c.filter(j,function(n){return n!=="global"})}if(j.length>0){h.push(a.buildEqualityExpressionFromValuesArray("space.type",j))}}if(f.length){h.push(a.buildEqualityExpressionFromValuesArray("space",f))}if(h.length===1){return h[0]}return"("+h.join(" or ")+")"}return{buildExpressionFromValuesString:e}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:cql', location = 'js/cql/internal/cql-expression-builder.js' */
define("confluence-ui-components/js/cql/internal/cql-expression-builder",["jquery","underscore"],function(e,j){function c(n){if(j.contains(["currentContent()","currentSpace()"],n)){return n}return'"'+a(n)+'"'}function a(n){return n.replace(/"/g,'\\"')}function i(n,p){var o=p.trim();if(!o){return undefined}return n+" ~ "+c(o)}function f(n){var o={"+":[],"-":[],"":[]};j.each(n,function(q){var p=q.charAt(0);if(p==="+"){o["+"].push(q.substring(1))}else{if(p==="-"){o["-"].push(q.substring(1))}else{o[""].push(q)}}});return o}function d(p,n){var o=j.map(n,function(q){return p+" = "+c(q)});return o.join(" AND ")}function m(s,p,n){if(p.length===0){return""}var q=j.map(p,c);var o;if(q.length===1){o=n?" = ":" != ";return s+o+q[0]}var r=q.join(",");o=n?" in ":" not in ";return s+o+"("+r+")"}function l(o,n){return m(o,n,false)}function h(o,n){return m(o,n,true)}function k(t,q){var r=f(q);var n=[];var s=d(t,r["+"]);if(s){n.push(s)}var o=h(t,r[""]);if(o){n.push(o)}var p=l(t,r["-"]);if(p){n.push(p)}return n.join(" AND ")}function b(q,o){var p=o.trim();if(!p){return undefined}var n=p.split(",");n=j.map(n,function(r){return r.trim()});return k(q,n)}function g(o,n){if(o.type==="equality"){return b(o.fieldName,n)}if(o.type==="text"){return i(o.fieldName,n)}throw new Error("buildExpression does not yet support type: "+o.type)}return{buildExpression:g,buildEqualityExpressionFromValuesString:b,buildEqualityExpressionFromValuesArray:k,makeValueMap:f,makePlusCql:d,makeMinusCql:l,makeRegularCql:h}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:cql', location = 'js/cql/internal/cql-space-type-expression-converter.js' */
define("confluence-ui-components/js/cql/internal/cql-space-type-expression-converter",["underscore","confluence-ui-components/js/cql/internal/cql-special-spaces"],function(b,a){function c(h,d){var f=b.clone(d);var g=b.map(h.values,a.getUIValue);var e=h.negate&&g.length==1&&g[0]==="conf_personal";return{field:f,values:e?["conf_global"]:g,negate:e?false:h.negate}}return{convert:c}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:cql', location = 'js/cql/internal/cql-space-expression-aggregator.js' */
define("confluence-ui-components/js/cql/internal/cql-space-expression-aggregator",["underscore","confluence-ui-components/js/cql/internal/cql-space-type-expression-converter"],function(b,d){function c(h,f){var g=b.filter(h,function(j){return j.field.fieldName==="space.type"});if(g.length===0){return h}if(g.length>1){throw Error("Only a single space.type expression is supported.")}var e=d.convert(g[0],f);var i=b.filter(h,function(j){return j.field.fieldName==="space"});h=b.difference(h,g);if(i.length){i[0]=a(i[0],e)}else{h.push(e)}return h}function a(f,e){f.values=f.values.concat(e.values);return f}return{aggregate:c,combineSpaceExpressions:a}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:cql', location = 'js/cql/internal/cql-set-value-helper.js' */
define("confluence-ui-components/js/cql/internal/cql-set-value-helper",["jquery"],function(b){function a(f,c){var e=b.Deferred();f.on("change",function(){e.resolve()});var d=true;f.select2("val",c,d);return e}return{setValues:a}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:cql', location = 'js/cql/internal/cql-date-expression-aggregator.js' */
define("confluence-ui-components/js/cql/internal/cql-date-expression-aggregator",["underscore","confluence-ui-components/js/cql/internal/cql-space-type-expression-converter"],function(a){function c(d){return{field:d.field,expressions:[d]}}function b(f){var d=[];var e={};f.forEach(function(h){var i=h.field.fieldName;if(h.field.type!=="date"){d.push(h)}else{if(!e[i]){var g=c(h);e[i]=g;d.push(g)}else{e[i].expressions.push(h)}}});return d}return{aggregate:b}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:cql', location = 'js/cql/internal/cql-negation-converter.js' */
define("confluence-ui-components/js/cql/internal/cql-negation-converter",["underscore"],function(a){function b(d){d.values=a.map(d.values,function(e){return"-"+e})}function c(e){var d=$.extend({},e);if(d.field.type==="equality"){if(d.operator==="!="){d.operator="=";b(d)}else{if(d.operator==="notin"){d.operator="in";b(d)}}}return d}return{convert:c}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:cql', location = 'js/cql/internal/cql-negation-aggregator.js' */
define("confluence-ui-components/js/cql/internal/cql-negation-aggregator",["underscore","confluence-ui-components/js/cql/internal/cql-negation-converter"],function(a,d){function b(i){var h=[];var g={};var f={};i.forEach(function(k){var l=k.field.fieldName;if(!a.contains(h,l)){h.push(l);g[l]=[];f[l]=[]}var j=d.convert(k);if(j.operator!==k.operator){f[l].push(j)}else{g[l].push(j)}});var e=[];h.forEach(function(k){var j=c(g[k],f[k]);e=e.concat(j)});return e}function c(g,e){if(!e.length){return g}var f=g[0];if(!f){f=e[0];e=a.rest(e)}e.forEach(function(h){f.values=f.values.concat(h.values)});if(f.operator==="="&&f.values.length>1){f.operator="in"}return[f].concat(a.rest(g))}return{aggregate:b}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:cql', location = 'js/cql/internal/cql-ignored-field-expression-converter.js' */
define("confluence-ui-components/js/cql/internal/cql-ignored-field-expression-converter",[],function(){function a(f,e,d){if(e){f=f.filter(function(g){if(e.indexOf(g.field.fieldName)>-1){return d}return !d})}return f}function c(e,d){return a(e,d,true)}function b(e,d){return a(e,d,false)}return{removeFieldsByName:b,getFieldsByName:c}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-ui-components:cql', location = 'js/cql/cql-component.js' */
define("confluence-ui-components/js/cql/cql-component",["jquery","underscore","ajs","confluence-ui-components/js/cql/internal/cql-ajax","confluence-ui-components/js/cql/internal/cql-filter-field","confluence-ui-components/js/cql/internal/cql-filter-select","confluence-ui-components/js/cql/internal/cql-space-expression-aggregator","confluence-ui-components/js/cql/internal/cql-date-expression-aggregator","confluence-ui-components/js/cql/internal/cql-negation-aggregator","confluence-ui-components/js/cql/internal/cql-ignored-field-expression-converter"],function(c,m,i,a,f,n,d,b,h,l){var j=window.Confluence.UI.Components.CQL.Templates;function e(o){var p=[];m.each(o,function(q){q.forEach(function(s){if(!s){return}var r=s.asCql();if(r){p.push(r)}})});return p.join(" and ")}function g(o,p){return m.find(o,function(q){return q.fieldName===p})}function k(s){var p=s.context||{environment:"macro-browser"};var F=s.defaultFieldNames;if(!F){F=s.defaultFields?s.defaultFields.split(","):[]}var x=c(j.container());if(s.container){c(s.container).append(x)}var G=x.find(".cql-fields");var C;var H=s.value||s.defaultValue;if(H){C=a.parseClauses(H)}else{C=new c.Deferred();C.resolve()}var v={};var w={};var u=new c.Deferred();var I=s.onChange||function(){};function o(t){var K=t.fieldName;v[K]=m.without(v[K],t);if(v[K].length===0){delete v[K];I()}}var B={element:x,loading:u,context:s.context||{environment:"macro-browser",searchType:"content"},getValue:function(){return e(v)},getIgnoredFields:function(){return w},removeField:o,fieldArrays:v,fieldRegistry:v};function A(L){var K=f.build(L,B);K.onChange(I);var M=L.fieldName;v[M]=v[M]||[];v[M].push(K);x.trigger("cql-field-adding",K);var t=G.find(".cql-field-"+M+":last");if(t.length){t.after(K.element)}else{G.append(K.element)}return K}function E(K,t){t=t||0;var L=K.fieldName;return v[L]&&v[L][t]}var D;function z(O){var K=c.Deferred();if(!O){K.resolve();return K}var N={};function L(Q){var P=N[Q];if(typeof P==="number"){N[Q]=P+1}else{N[Q]=0}return N[Q]}var t=m.findWhere(D,{fieldName:"space"});O=d.aggregate(O,t);O=b.aggregate(O);O=h.aggregate(O);w=l.getFieldsByName(O,s.ignoredFields);O=l.removeFieldsByName(O,s.ignoredFields);var M=[];m.each(O,function(T){var U=T.field.fieldName;var S=g(D,U);var Q=L(U);var P=E(S,Q)||A(S);var R=P.setValues(T);if(R){M.push(R)}});c.when.apply(c,M).then(function(){K.resolve()});return K}function r(K){var L,t;if(K){var M=m.escape(K);L="We can\'t load your filters";t=i.format("Curses! We had trouble with \"{0}\". Try refreshing the page, but you may need to re-enter your macro parameters.",M)}else{L="We couldn\'t load the macro";t="If you refresh your page, we\'ll give it another shot."}i.messages.error(".cql-error-container",{title:L,body:t,closeable:true})}function J(t){var K;if(t.element.find(".aui-nav-selected").length!==0){return}if(t.element.find(".select2-container-multi").length!==0){K=t.element.find("input.select2-input");K.focus().click()}else{K=t.element.find("a.select2-choice.select2-default");if(!K.length){K=c(":input:visible",t.element).first()}if(!K.length){i.log("Unable to focus CQL field: "+t.fieldName)}K.focus().mousedown()}}function y(L){var K=c.extend({},L,{fixed:false});var t=A(K);J(t)}function q(t){D=t;F.forEach(function(M){var L=g(D,M);if(!L){throw Error("Unknown fieldname: "+M)}var K=c.extend({fixed:true},L);A(K)});n.build({onSelection:y,cqlContainer:x,context:p,ignoredFields:s.ignoredFields});C.done(function(K){z(K).done(function(){u.resolve()})}).fail(function(){if(p.environment==="search-screen"){i.log("Error parsing CQL param from search screen URL: "+s.value)}else{r(s.value)}u.resolve()})}a.getFields().done(q).fail(function(){r()});return B}return{build:k}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-create-content-plugin:user-select2', location = 'user-select2/avatar.soy' */
// This file was automatically generated from avatar.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace CreateContent.avatar.
 */

if (typeof CreateContent == 'undefined') { var CreateContent = {}; }
if (typeof CreateContent.avatar == 'undefined') { CreateContent.avatar = {}; }


CreateContent.avatar.avatarWithName = function(opt_data, opt_ignored) {
  return '' + aui.avatar.avatar({size: opt_data.size, avatarImageUrl: opt_data.avatarImageUrl, accessibilityText: opt_data.displayName, title: opt_data.displayName, extraAttributes: {'data-username': opt_data.userId}}) + soy.$$escapeHtml(opt_data.displayName);
};
if (goog.DEBUG) {
  CreateContent.avatar.avatarWithName.soyTemplateName = 'CreateContent.avatar.avatarWithName';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-create-content-plugin:user-select2', location = 'user-select2/user-multiselect.js' */
Confluence.Binder.autocompleteMultiUser=function(b){b=b||document.body;var c=AJS.$;var a=function(){var d=c(".select2-drop-active > .select2-results");if(d.children(".select2-result-selectable").length===0&&d.children(".select2-disabled").length){d.append('<li class="select2-no-results">'+AJS.escapeHtml("No matches found")+"</li>")}};c("input.autocomplete-multiuser[data-autocomplete-bound != 'true']",b).each(function(){var d=c(this);d.auiSelect2({multiple:true,minimumInputLength:2,formatInputTooShort:function(){return "Start typing to search for a user"},ajax:{transport:function(h){var i=h.success;delete h.success;return c.ajax.apply(c.ajax,arguments).done(i).done(a)},data:function(h){return{"max-results":6,query:h}},dataType:"json",url:Confluence.getContextPath()+"/rest/prototype/1/search/user.json",results:function(i){var h=[];c.each(i.result,function(){h.push({id:this.username,text:this.title,imgSrc:this.thumbnailLink.href})});return{results:h}},quietMillis:300},formatResult:function(h){return CreateContent.avatar.avatarWithName({size:"small",displayName:h.text,userId:h.id,avatarImageUrl:h.imgSrc})},escapeMarkup:function(h){return h},formatSelection:function(h){return CreateContent.avatar.avatarWithName({size:"xsmall",displayName:h.text,userId:h.id,avatarImageUrl:h.imgSrc})},dropdownCssClass:"users-dropdown",containerCssClass:"users-autocomplete",hasAvatar:true});if(!d.data("autofill-user")){return}var g=AJS.Meta.get("remote-user"),f=AJS.Meta.get("current-user-fullname"),e=AJS.Meta.get("current-user-avatar-url");if(g&&f&&e){d.auiSelect2("data",[{id:g,text:f,imgSrc:AJS.contextPath()+e}])}})};
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-macro-browser:macro-browser-js', location = 'js/macro-parameter-serializer.js' */
define("confluence-macro-browser/macro-parameter-serializer",["jquery"],function(h){function e(d){return d.replace(/\\/g,"\\\\").replace(/=/g,"\\=").replace(/[|]/g,"\\|")}return{serialize:function(d){var a=[],b;for(b in d)a.push(e(b)+"="+e(d[b]));return a.join("|")},deserialize:function(d){function a(f,d){for(var c=[],b=[],a,f=f||"",g=0,e=f.length;g<e;g++)a=f[g],"\\"==a?c.push(a+(g+1!=f.length?f[++g]:"")):a==d?(b.push(c.join("")),c=[]):c.push(a);b.push(c.join(""));return b}var b={};h.each(a(d||"",
"|"),function(d,e){var c=a(e,"=");2===c.length&&c[0]&&(b[c[0].replace(/\\(.)/g,"$1")]=c[1].replace(/\\(.)/g,"$1"))});return b}}});require("confluence/module-exporter").exportModuleAsGlobal("confluence-macro-browser/macro-parameter-serializer","Confluence.MacroParameterSerializer");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-macro-browser:macro-browser-js', location = 'js/macro-browser-fields.js' */
define("confluence-macro-browser/macro-browser-fields","ajs jquery underscore confluence/legacy confluence/templates confluence/autocomplete-user confluence/autocomplete-content".split(" "),function(h,e,p,q,k,r,m){function o(i,g,l){return function(j,b){if(j.multiple)return i.string(j,b);var a=e(k.MacroBrowser.macroParameterSelect()),c=e("select",a),b=b||{};b.setValue=b.setValue||function(a){var b=false;c.find("option").each(function(){if(this.value==a){b=true;return false}});if(b)delete c.tempValue;
else{c.append(e("<option/>").attr("value",a).text(a+" ("+"Not found"+")"));c.tempValue=a}try{c.val(a)}catch(n){h.logError(n)}c.change()};a=g(a,c,b);a.updateDependencies=l;a.getData=function(a){if(a.title&&a.spaceKey||a.pageId||a.draftId){var f=c.tempValue||c.val();if(b.fileTypes)a.fileTypes=b.fileTypes;var n=h.contextPath()+(a.draftId?"/json/draftattachmentsearch.action":"/json/attachmentsearch.action");e.getJSON(n,a,function(a){if(!a.error){e("option",c).remove();
a=a.attachments;if(!a||!a.length){c.append(e("<option/>").attr("value","").html("No appropriate attachments"));c.tempValue&&b.setValue(c.tempValue)}else{for(var d=0,n=a.length;d<n;d++)c.append(e("<option/>").attr("value",a[d].name).text(a[d].name));f=f||c.tempValue;b.setValue(f||a[0].name)}c.attr("style","")}})}else h.log("Not enough parameters to send attachmentsearch request")};return a}}return function(i){var g=function(b,a,c){var c=c||{},d=c.setValue||function(b){a.val(b)},
e=c.getValue||function(){return a.val()};a.change(c.onchange||i.paramChanged);return{paramDiv:b,input:a,setValue:d,getValue:e}},l=function(b,a,c){if(a&&a.length)for(var d=0,e=a.length;d<e;d++)i.fields[a[d]]&&i.fields[a[d]].dependencyUpdated(b,c)},j={updateDependencies:l,username:function(b,a){var a=a||{},c=b.multiple?"autocomplete-multiuser":"autocomplete-user",d=e(k.MacroBrowser.macroParameter()),f=e("input[type='text']",d);f.addClass(c).attr("data-none-message","Not found");
b.required&&f.keyup(i.processRequiredParameters);if(b.multiple){q.Binder.autocompleteMultiUser(d);a.setValue=function(a){f.val(a);for(var a=a.split(","),b=[],c=[],d=0,g=a.length;d<g;d++)b.push(function(a){return e.getJSON(h.contextPath()+"/rest/prototype/1/user/non-system/"+a).done(function(a){a&&a.name&&c.push({id:a.name,text:a.displayName,imgSrc:a.avatarUrl})}).fail(function(b){h.logError("Cannot parse user data for macro browser field with: "+b);c.push({id:a,text:h.format("Unknown User ({0})",
a),imgSrc:h.contextPath()+"/images/icons/profilepics/default.png"})})}(a[d]));e.when.apply(e,p.map(b,function(a){var b=e.Deferred();a.always(function(){b.resolve()});return b.promise()})).done(function(){c.length&&f.auiSelect2("data",c)})}}else{f.bind("selected.autocomplete-content",function(c,d){if(a.onselect)a.onselect(d.selection);else if(a.setValue)a.setValue(d.content.username);else{l(b.name,a.dependencies,f.val());typeof a.onchange==="function"&&a.onchange.apply(f)}});r(d)}return g(d,f,a)},
spacekey:function(b,a){if(b.multiple)return j.string(b,a);var a=a||{},c=e(k.MacroBrowser.macroParameter()),d=e("input[type='text']",c);d.addClass("autocomplete-space").attr("data-template","{key}").attr("data-none-message","Not found");b.required&&d.keyup(i.processRequiredParameters);d.bind("selected.autocomplete-content",function(c,e){if(a.onselect)a.onselect(e.selection);else if(a.setValue)a.setValue(e.content.key);else{l(b.name,a.dependencies,d.val());
typeof a.onchange==="function"&&a.onchange.apply(d)}});m.autocompleteSpace(c);return g(c,d)},attachment:o(j,g,l),full_attachment:o(j,g,l),"confluence-content":function(b,a){if(b.multiple)return j.string(b,a);a=a||{};b.options=b.options||{};var c=e(k.MacroBrowser.macroParameter()),d=e("input[type='text']",c).attr("data-none-message","Not found").attr("data-template","");b.required&&d.keyup(i.processRequiredParameters);a.onchange=a.onchange||function(){var c=
d.val();l(b.name,a.dependencies,c)};a.setValue=a.setValue||function(b){d.val(b);typeof a.onchange==="function"&&a.onchange.apply(d)};d.bind("selected.autocomplete-content",function(c,e){var f="";if(b.options.includeDatePath=="true"&&e.content.type==="blogpost"){f=e.content.createdDate.date.split("-");f="/"+f[0]+"/"+f[1]+"/"+f[2].substring(0,2)+"/"}var g=e.content.space&&e.content.space.key,i=g&&g!=h.Meta.get("space-key");e.content.title.indexOf(":")!==-1&&(i=true);f=(i?g+":":"")+f+e.content.title;
d.val(f);if(a.onselect)a.onselect(e.selection);else a.setValue(f,d)});if(b.options.spaceKey){if(b.options.spaceKey.toLowerCase()==="@self")b.options.spaceKey=h.Meta.get("space-key");d.attr("data-spacekey",b.options.spaceKey)}var f=b.options.type;if(typeof f==="string")if(f==="page"){d.addClass("autocomplete-page");m.autocompletePage(c)}else if(f==="blogpost"){d.addClass("autocomplete-blogpost");m.autocompleteBlogpost(c)}else{if(f==="attachment"||f==="full_attachment"){d.addClass("autocomplete-attachment");
m.autocompleteAttachment(c)}}else{d.addClass("autocomplete-confluence-content");m.autocompleteConfluenceContent(c)}return g(c,d,a)},string:function(b,a){var c=e(k.MacroBrowser.macroParameter()),d=e("input",c);b.required&&d.keyup(i.processRequiredParameters);return g(c,d,a)},"boolean":function(b,a){var c=e(k.MacroBrowser.macroParameterBoolean()),d=e("input",c),a=a||{};a.setValue=a.setValue||function(a){(/true/i.test(a)||/true/i.test(b.defaultValue)&&!/false/i.test(a))&&d.prop("checked",true)};return g(c,
d,a)},"enum":function(b,a){if(b.multiple)return j.string(b,a);var c=e(k.MacroBrowser.macroParameterSelect()),d=e("select",c);!b.required&&!b.defaultValue&&d.append(e("<option/>").attr("value",""));e(b.enumValues).each(function(){d.append(e("<option/>").attr("value",this).html(""+this))});return g(c,d,a)},_hidden:function(b,a){var c=e(k.MacroBrowser.macroParameterHidden()).hide(),d=e("input",c);return g(c,d,a)}};return{Field:g,ParameterFields:j}}});require("confluence/module-exporter").safeRequire("confluence-macro-browser/macro-browser-fields");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-macro-browser:macro-browser-js', location = 'js/macro-browser-smartfields.js' */
define("confluence-macro-browser/macro-browser-smartfields",["ajs","confluence/macro-js-overrides"],function(c,f){return function(h,d){var e=function(a){this.fileTypes=a};e.prototype.beforeParamsSet=function(a){!a.page&&(!a.date&&!a.space)&&("page"==c.params.contentType||"blogpost"==c.params.contentType?a.page=c.Editor.getCurrentTitle():"comment"==c.params.contentType&&(a.page=c.params.pageTitle));if(a.date){var b=a.date.split("/");a.page=["",b[2],b[0],b[1],a.page].join("/")}a.space&&(a.page=a.space+
":"+a.page);return a};e.prototype.beforeParamsRetrieved=function(a){if(a.page){var b=a.page.split(":");1<b.length&&(a.space=b[0],a.page=b[1]);b=a.page.split("/");1<b.length&&(a.date=[b[2],b[3],b[1]].join("/"),a.page=b[4]);(("page"==c.params.contentType||"blogpost"==c.params.contentType)&&a.page==c.Editor.getCurrentTitle()||"comment"==c.params.contentType&&a.page==c.params.pageTitle)&&delete a.page}return a};e.prototype.fields={attachment:function(a){a=d.attachment(a,{fileTypes:this.fileTypes});a.dependencyUpdated=
function(a,g){c.debug("attachment:dependencyUpdated called: "+a+", "+g);var d=e.prototype.fields._parsePageLink(g);this.getData(d)};return a},full_attachment:function(a){a=d.full_attachment(a,{fileTypes:this.fileTypes});a.dependencyUpdated=function(a,d){c.debug("attachment:dependencyUpdated called: "+a+", "+d);var f=e.prototype.fields._parsePageLink(d);this.getData(f)};return a},"confluence-content":function(a){return d["confluence-content"](a,{dependencies:["name"]})},_parsePageLink:function(a){var b=
{},a=a.split(":",2);b.spaceKey=2===a.length&&a[0]||c.Meta.get("space-key");b.title=a[a.length-1];0===b.title.indexOf("/")&&(b.postingDay=b.title.substr(1,10),b.title=b.title.substr(12));b.title===c.Editor.getCurrentTitle()&&(b.title="");b.title||(c.params.newPage?b.draftId=c.Meta.get("content-id"):b.pageId=c.params.pageId);return b}};h.activateSmartFieldsAttachmentsOnPage=function(a,b){f.put(a,new e(b))}}});require("confluence/module-exporter").safeRequire("confluence-macro-browser/macro-browser-smartfields");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-macro-browser:macro-browser-js', location = 'js/macro-browser-utils.js' */
define("confluence-macro-browser/macro-browser-utils",["jquery"],function(a){return{makeDefaultKey:function(){return a.makeArray(arguments).join(".")}}});require("confluence/module-exporter").safeRequire("confluence-macro-browser/macro-browser-utils");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-macro-browser:macro-browser-js', location = 'js/macro-browser-cql.js' */
define("confluence-macro-browser/macro-browser-cql",["ajs","underscore","confluence/templates","confluence-ui-components/js/cql/cql-component","jquery"],function(i,g,m,n,d){function j(b){var a=b.param;return d.extend({},b,a.options,{defaultValue:a.defaultValue||a.options.defaultValue})}function k(b){return d(m.MacroBrowser.CQL.sections({hasRenderParameters:0<b.renderParams.length}))}return{build:function(b){var a=k(b),e=b.container;e.append(a);e.bind("cql-field-adding",function(b,c){c.element.addClass("macro-param-div");
c.element.find(".cql-field-input").addClass("macro-param-input")});e.addClass("loading");a.filter(".cql-render-heading").find("button").click(function(){var b=d(this),c=b.closest(".cql-render-heading").next(),a=c.is(":visible");a?c.slideUp(300):(c.removeClass("hidden").show(),c=d(".cql-render-heading").position().top,d(".macro-input-fields").animate({scrollTop:c},300));a=a?"Show":"Hide";
b.text(a)});var f,h={param:b.cqlParam,value:b.cqlValue,container:a.filter(".cql-filter-fields")},h=j(h);f=n.build(h);e.data("cqlComponent",f);var l=d.Deferred();f.loading.done(function(){var a=b.cqlParam.options.requiredFields;if(a){var c=a.split(",");g.each(f.fieldRegistry||f.fieldArrays,function(a){var d=!1;g.each(a,function(a){!d&&g.contains(c,a.fieldName)&&(b.flagRequiredParam(a.element),d=!0,a.onChange(b.paramChanged))})})}e.removeClass("loading");l.resolve()});return{elements:a,loading:l}},
_makeCqlComponentOptions:j,_renderCqlSections:k}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-macro-browser:macro-browser-js', location = 'soy/macro-browser-cql.soy' */
// This file was automatically generated from macro-browser-cql.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.MacroBrowser.CQL.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.MacroBrowser == 'undefined') { Confluence.Templates.MacroBrowser = {}; }
if (typeof Confluence.Templates.MacroBrowser.CQL == 'undefined') { Confluence.Templates.MacroBrowser.CQL = {}; }


Confluence.Templates.MacroBrowser.CQL.sections = function(opt_data, opt_ignored) {
  return '<div class="cql-filter-fields"></div>' + ((opt_data.hasRenderParameters) ? '<h4 class="cql-render-heading"><span>' + soy.$$escapeHtml('Options') + '</span>' + aui.buttons.button({type: 'link', text: 'Show', extraAttributes: {type: 'button'}}) + '</h4><div class="cql-render-fields hidden"></div>' : '');
};
if (goog.DEBUG) {
  Confluence.Templates.MacroBrowser.CQL.sections.soyTemplateName = 'Confluence.Templates.MacroBrowser.CQL.sections';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-macro-browser:macro-browser-js', location = 'js/macro-browser-editor.js' */
define("confluence-macro-browser/macro-browser-editor","ajs jquery confluence/templates confluence-macro-browser/macro-browser-cql confluence/macro-js-overrides underscore".split(" "),function(q,d,p,u,r,s){return function(k){function o(g){var a=d("#macro-insert-container").find(".macro-name").val(),b,c=k,e={},f;f={};for(var h=0,l=g.formDetails.parameters.length;h<l;h++){var i=g.formDetails.parameters[h],j;if(i.type&&i.type.name==="cql")j=d(".macro-input-fields form").data("cqlComponent").getValue();
else{j=d("#macro-param-"+i.name);var n=j.val();j.attr("type")=="checkbox"&&(n=""+j.prop("checked"));j=n}if(j){i.shared&&(e[i.name]=j);if(i.hidden||!i.defaultValue||i.defaultValue!=j)f[i.name]=j}}f[""]&&(b=f[""]);d.extend(f,c.unknownParams);(h=r.getFunction(a,"beforeParamsRetrieved"))&&(f=h(f,g,e));return{name:a,bodyHtml:c.getMacroBody(),params:f,defaultParameterValue:b}}function v(g,a,b){var c=k,e,f=a.type.name;if(b){var h=b.fields&&b.fields[f];h&&typeof h!=="function"&&(h=h[a.name]);typeof h==="function"&&
(e=h.call(b,a))}if(!e){f in c.ParameterFields&&typeof c.ParameterFields[f]==="function"||(f="string");e=c.ParameterFields[f](a)}c.fields[a.name]=e;b=e.paramDiv;c=e.input;e="macro-param-"+a.name;b.attr("id","macro-param-div-"+a.name);c.addClass("macro-param-input").attr("id",e);a.hidden&&b.hide();c=g.pluginKey;if(a.displayName==k.Utils.makeDefaultKey(c,g.macroName,"param",a.name,"label"))a.displayName=a.name;if(a.description==k.Utils.makeDefaultKey(c,g.macroName,"param",a.name,"desc"))a.description=
"";d("label",b).attr("for",e).text(a.displayName);a.required&&t(b);a.description&&b.append(p.MacroBrowser.macroParameterDesc({description:a.description}));return b}function t(d){var a=d.find("label"),b=a.text()+" *";a.text(b);d.addClass("required")}return{loadMacroInBrowser:function(g){if(!g||!g.formDetails){q.trigger("analytics",{name:"macro-browser.unknown-macro-error"});alert("Could not load unknown macro in the macro browser.")}else{var a=require("tinymce"),b=k,c=g.formDetails,e=c.macroName,
f=r.get(e),h=b.settings.selectedMacro,l=a.confluence.macrobrowser.editedMacroDiv;if(f&&typeof f.opener==="function"){b.close();f.opener({name:e})}else{var a=c.parameters,i=s.find(a,function(a){return a.type.name==="cql"});d("#save-warning-span").addClass("hidden");d("#macro-insert-container .macro-name").val(e);var j=d("#macro-insert-container .macro-input-fields form");j.empty();var n=g.extendedDescription||g.description;if(i)c.documentationLink&&b.UI.setHelpLink(b.dialog,{href:c.documentationLink});
else if(n||c.documentationLink){n=d(p.MacroBrowser.macroDescription({descriptionHtml:n,documentationLink:c.documentationLink}));j.append(n)}if(c.body&&c.body.bodyType!="NONE"&&l&&d(l).hasClass("editor-inline-macro")){l=g.pluginKey;if(c.body.label==k.Utils.makeDefaultKey(l,e,"body","label"))c.body.label="";if(c.body.description==k.Utils.makeDefaultKey(l,e,"body","desc"))c.body.description="";c=c.body;l=b.selectedMacroDefinition;n=k;e=d(p.MacroBrowser.macroBody());l=l?l.body:n.settings.selectedText;
d("textarea",e).val(l||"");c.label&&d("label",e).text(c.label);c.description&&e.append(p.MacroBrowser.macroParameterDesc({description:c.description}));c.hidden&&e.hide();e&&j.append(e)}var m=h?d.extend({},h.params):{},o=j;if(i){a=s.without(a,i);i=u.build({cqlParam:i,renderParams:a,cqlValue:m.cql,container:j,flagRequiredParam:t,paramChanged:k.paramChanged});delete m.cql;o=i.elements.filter(".cql-render-fields");i.loading.done(function(){k.paramChanged();k.Preview.previewMacro(g,h);k.UI.focusOnMacroDetailsFirstInput()})}d(a).each(function(){o.append(v(g,
this,f))});f&&typeof f.beforeParamsSet==="function"&&(m=f.beforeParamsSet(m,!h));d(a).each(function(){var a;a=this.name==""?b.selectedMacroDefinition?b.selectedMacroDefinition.defaultParameterValue:this.defaultValue:m[this.name];a!=null?delete m[this.name]:d(this.aliases).each(function(){if(m[this]){a=m[this];delete m[this]}});if(a==null)a=this.defaultValue;a!=null&&b.fields[this.name].setValue(a)});b.unknownParams=m;d("a",j).click(function(){window.open(this.href,"_blank").focus();return false});
d("#macro-browser-dialog:visible").length||b.showBrowserDialog();a={};d.extend(true,a,g);if(!a.formDetails)a.formDetails={};if(!a.formDetails.body)a.formDetails.body={};b.dialog.activeMetadata=a;a.formDetails.body.content=b.settings.selectedMacro?b.settings.selectedMacro.body:a.formDetails.body.bodyType&&a.formDetails.body.bodyType.toLowerCase()==="plain_text"?b.settings.selectedText:b.settings.selectedHtml}}},getMacroParametersFromForm:function(d){return o(d).params},getMacroDefinitionFromForm:o,
processRequiredParameters:function(){if(d(".macro-input-fields form").is(".loading")){q.log("Form still loading - cannot processRequiredParameters");return false}var g=d("#macro-insert-container .macro-param-div.required .macro-param-input").not(".select2-container").filter(function(){var a=d(this).val();return a===null||a===""}).length===0,a=g?"":"disabled",b=a?"addClass":"removeClass";d("#macro-browser-dialog button.ok").prop("disabled",a);d("#macro-browser-dialog .macro-preview-header .refresh-link").prop("disabled",
a)[b]("disabled");return g}}}});require("confluence/module-exporter").safeRequire("confluence-macro-browser/macro-browser-editor");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-macro-browser:macro-browser-js', location = 'js/macro-browser-preview.js' */
define("confluence-macro-browser/macro-browser-preview",["jquery","ajs","confluence/macro-js-overrides","confluence/get-content-id"],function(e,b,m,n){return function(d){function h(){return e("#macro-insert-container .macro-preview")}function l(){h().html("")}function i(b){b?(d.UI.showPreviewSpinner(!0),f.disable()):(d.UI.showPreviewSpinner(!1),f.enable())}var f={disable:function(){e("#macro-browser-preview-link").attr("disabled",!0).addClass("disabled")},enable:function(){e("#macro-browser-preview-link").removeAttr("disabled").removeClass("disabled")}};
return{previewMacro:function(j,g){var k=d;l();if(!d.Editor.processRequiredParameters())return b.trigger("analytics",{name:"macro-browser.missing-params-error"}),b.log("previewMacro: missing required params"),!1;"object"!==typeof g&&(g=d.Editor.getMacroDefinitionFromForm(j));var a=g.params,f=m.getFunction(j.macroName,"updateMacroParametersForPreview");f&&(a=f(a));a[""]&&delete a[""];k={contentId:n(),macroName:j.macroName,params:a,body:k.getMacroBody(),defaultParameterValue:g.defaultParameterValue,
successCallback:function(a){var c=h().find("iframe")[0],c=c.contentDocument||c.contentWindow.document;c.write(a);c.close();e(c).ready(function(){b.trigger("macro-browser.preview-ready")});e("div.error span.error",c).length&&b.logError("Error rendering macro definition : ");setTimeout(function(){i(!1)},1E3)},errorCallback:function(a){b.logError(a);i(!1)}};a=b.params.staticResourceUrlPrefix+"/blank.html";h().html('<iframe src="'+a+'" frameborder="0" name="macro-browser-preview-frame" id="macro-preview-iframe"></iframe>');
i(!0);d.Rest.fetchMacroPreviewData(k)},removePreviewContainer:l}}});require("confluence/module-exporter").safeRequire("confluence-macro-browser/macro-browser-preview");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-macro-browser:macro-browser-js', location = 'js/macro-browser-model.js' */
define("confluence-macro-browser/macro-browser-model",["ajs"],function(h){return function(f){function g(a){a.title==f.Utils.makeDefaultKey(a.pluginKey,a.macroName,"label")&&(a.title=a.macroName.charAt(0).toUpperCase()+a.macroName.substring(1).replace(/-/g," "));a.description==f.Utils.makeDefaultKey(a.pluginKey,a.macroName,"desc")&&(a.description="");a.id="macro-"+(a.alternateId||a.macroName);var b=[a.macroName,a.title].concat(a.aliases||[]);a.keywordsNoDesc=b.join(",");var d=a.description&&a.description.replace(/,/g,
" ")||"";b.push(d);a.keywords=b.join(",");return a}return{loadMacros:function(a){if(a){var b=f;b.metadataList=[];b.aliasMap={};for(var d=0,i=a.length;d<i;d++){var c=a[d],c=g(c);if(c.aliases)for(var e=0,j=c.aliases.length;e<j;e++)c.aliases[e]=c.aliases[e].toLowerCase(),b.aliasMap[c.aliases[e]]=c.macroName.toLowerCase();b.metadataList.push(c)}b.metadataList.sort(function(a,b){return a.title.toLowerCase()>b.title.toLowerCase()?1:-1})}else h.log("AJS.MacroBrowser.loadModel - no macro data, aborting")},
transformMetaDataDefault:g}}});require("confluence/module-exporter").safeRequire("confluence-macro-browser/macro-browser-model");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-macro-browser:macro-browser-js', location = 'js/macro-browser-rest.js' */
define("confluence-macro-browser/macro-browser-rest",["jquery","ajs","wrm","confluence/api/constants"],function(b,f,g,d){function c(a){f.logError(a)}var h=g.data.claim("confluence.macro.metadata.provider:macro-browser-metadata-resources.macro-meta-client-cache-key");return{loadMacroMetadata:function(a){a.data=a.data||{};a.data.macroMetadataClientCacheKey=h;return b.ajax({type:"GET",cache:!0,timeout:a.timeout||3E4,dataType:"json",url:(a.context||d.CONTEXT_PATH)+"/plugins/macrobrowser/browse-macros.action",
data:a.data,success:a.successCallback,error:a.errorCallback||c}).promise()},fetchMacroMetadataDetails:function(a){var e={id:a.id};a.alternateId&&(e.alternateId=a.alternateId);b.ajax({type:"GET",dataType:"json",url:(a.context||d.CONTEXT_PATH)+"/plugins/macrobrowser/browse-macros-details.action",data:e,success:a.successCallback,error:a.errorCallback||c})},fetchMacroPreviewData:function(a){if(!a.contentId||!a.macroName)return(a.errorCallback||c)("invalid parameters");b.ajax({type:"POST",contentType:"application/json; charset=utf-8",
url:(a.context||d.CONTEXT_PATH)+"/rest/tinymce/1/macro/preview",data:b.toJSON({contentId:a.contentId,macro:{name:a.macroName,body:a.body,params:a.params,defaultParameterValue:a.defaultParameterValue}}),dataType:"html",success:a.successCallback,error:a.errorCallback||c})}}});require("confluence/module-exporter").safeRequire("confluence-macro-browser/macro-browser-rest");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-macro-browser:macro-browser-js', location = 'js/macro-browser-UI.js' */
define("confluence-macro-browser/macro-browser-UI","jquery ajs confluence/templates confluence/api/constants confluence/dom-filter-field confluence/meta confluence/dialog".split(" "),function(e,f,j,m,r,s,t){return function(k){function n(a){return e(j.MacroBrowser.macroSummaryList({category:a}))}function p(a,b){var g=e(j.MacroBrowser.macroSummaryItem());if(a.icon){var c=(a.icon.relative?f.params.staticResourceUrlPrefix:"")+a.icon.location;!a.icon.relative&&e.browser.msie&&!window.location.href.indexOf("https")&&
c.indexOf("https")?g.prepend("<span class='macro-icon-holder icon-"+a.macroName+"'></span>"):g.prepend("<img src='"+c+"' alt='icon' width='"+a.icon.width+"' height='"+a.icon.height+"' title='"+a.title+"'/>")}else g.prepend("<span class='macro-icon-holder icon-"+a.macroName+"'></span>");e(".macro-title",g).text(a.title);e(".macro-desc",g).prepend(a.description);if(a.macroName=="gadget")if(c=a.gadgetUrl){c.match("^https?://.*")||(c=m.CONTEXT_PATH+"/"+c);e(".macro-title",g).after(j.MacroBrowser.gadgetLink({url:c}))}g.click(function(c){b(c,
a)});return g}function q(a,b){var e;e=b?j.Dialog.helpLink(b):j.MacroBrowser.helpLink();a.getPage(a.curpage).element.find(".dialog-title").prepend(e)}return{createDialog:function(a){for(var b=a.macros,g=a.onClickMacroSummary,c={all:n("all")},h=0,m=b.length;h<m;h++){var i=b[h];if(i.hidden)if(k.isHiddenMacroShown(i))i.categories.push("hidden-macros");else continue;c.all.append(p(i,g).attr("id",i.id));for(var o=0,u=i.categories.length;o<u;o++){var l=i.categories[o];c[l]=c[l]||n(l);c[l].append(p(i,g).attr("id",
l+"-"+i.id))}}var d=t.component({width:a.width||865,height:a.height||530,id:"macro-browser-dialog",onSubmit:a.onSubmit,onCancel:a.onCancel});d.popup.element.on("keydown",".aui-button",function(a){a.stopPropagation()});d.getPage(0).element.attr("id","select-macro-page");d.addHeader(a.title);d.addPanel("All",c.all,"all","category-button-all").getPanel(0).setPadding(0);b=0;for(g=a.categories.length;b<g;b++){h=a.categories[b];d.addPanel(h.displayName,c[h.name]||
n(h.name),h.name,"category-button-"+h.name).getPanel(b+1).setPadding(0)}d.addCancel("Cancel",a.onCancel);q(d);d.addHelpText("Hint: type \"\u003cstrong\u003e{\u003c/strong\u003e\" in the Editor to insert macros on the page.");c=e(j.MacroBrowser.insertMacroPanel());c.find("form").submit(function(a){k.complete();return f.stopEvent(a)});e("#macro-browser-preview-link",c).click(function(a){e(this).prop("disabled")||k.previewMacro(d.activeMetadata);return f.stopEvent(a)});d.addPage().addPanel("X",c,"macro-input-panel").addLink("Select macro",
function(a){a.prevPage();a.searcher.focus()},"dialog-back-link").addButton("insert.name",function(){k.complete()},"ok").addCancel("Cancel",function(){return a.onCancel()}).getPanel(0).setPadding(0);d.getPage(1).element.attr("id","macro-details-page");e("#macro-browser-dialog .dialog-button-panel .ok").before("<span id='save-warning-span' class='hidden'/>");d.searcher=r({items:"#macro-browser-dialog .dialog-panel-body #category-all .macro-list-item",formId:"macro-browser-search-form",
inputId:"macro-browser-search",searcher:function(a,b){var c=null;if(b!=""){d.getCurrentPanel()!=d.getPanel(0)&&d.gotoPanel(0);var f=k.searchSummaries(b),c={};e.each(f,function(){c[this.id]=this})}a.each(function(){!c||this.id in c?e(this).show():e(this).hide()})},submitCallback:function(a,b){b!=""&&a.length===1&&a.click()}});d.page[0].header.append(d.searcher.form);d.page[0].ontabchange=function(a){a!=d.getPanel(0,0)&&d.searcher.reset()};c=e(j.MacroBrowser.missingUserMacroMetadataPanel({showAdminMessage:s.getBoolean("is-admin")}));
d.addPage().addPanel("No macro metadata",c,"missing-metadata-panel").addLink("Back",function(a){a.gotoPage(0);a.searcher.focus()},"dialog-back-link").addCancel("Cancel",function(){return a.onCancel()});d.gotoPage(2);d.addHeader("No macro metadata");d.gotoPanel(0,0);d.ready=true;return d},showBrowserSpinner:function(a){var b=e("#macro-browser-dialog");a?b.spin("large"):b.spinStop()},
showPreviewSpinner:function(a){var b=e("#macro-browser-preview");a?b.spin("large"):b.spinStop()},updateButtonText:function(a){var b=e("#macro-browser-dialog .dialog-button-panel .ok");a=="edit"?b.text("Save"):b.text("Insert")},enableSaveButton:function(a){e("#macro-browser-dialog .dialog-button-panel .ok").prop("disabled",!a)},focusOnMacroDetailsFirstInput:function(){var a=e("#macro-insert-container").find(".macro-input-fields :input:visible:not(button,.select2-offscreen)").first();
if(a.length){if(a.hasClass("select2-input")){var b=a.closest(".select2-container").parent().find(".select2-offscreen");if(typeof b.select2!=="function"){f.log("select2Hidden is not a select2 hidden input, skipping focus attempt.");return}b.select2("open");b.select2("close")}else a.focus();!k.selectedMacroDefinition&&a.val()!==""&&a.select()}else f.log("No input to focus")},setHelpLink:q}}});require("confluence/module-exporter").safeRequire("confluence-macro-browser/macro-browser-UI");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-macro-browser:macro-browser-js', location = 'js/macro-browser.js' */
define("confluence-macro-browser/macro-browser","window jquery ajs confluence-macro-browser/macro-browser-utils confluence-macro-browser/macro-browser-editor confluence-macro-browser/macro-browser-fields confluence-macro-browser/macro-browser-model confluence-macro-browser/macro-browser-preview confluence-macro-browser/macro-browser-rest confluence-macro-browser/macro-browser-UI confluence-macro-browser/macro-browser-smartfields confluence-macro-browser/macro-parameter-serializer confluence/macro-js-overrides underscore".split(" "),
function(k,f,d,m,n,l,o,p,q,r,s,t,h){var a={},l=l(a);a.ParameterFields=l.ParameterFields;a.Field=l.Field;s(a,a.ParameterFields);a.Utils=m;a.Editor=n(a);a.Preview=p(a);a.Model=o(a);a.Rest=q;a.UI=r(a);var g,i=function(b,c){var e={id:b.macroName,successCallback:function(b){if(b&&b.details)b.details=a.Model.transformMetaDataDefault(b.details);a.Editor.loadMacroInBrowser(b.details,c);i.displayDetails();a.Preview.previewMacro(b.details)},errorCallback:function(){d.trigger("analytics",{name:"macro-browser.fetch-metadata-error"});
k.alert("There has been an error loading the macro browser. Please try again or see your system administrator.");i.displayDetails()}};if(b.alternateId)e.alternateId=b.alternateId;i.setUI(c,b.title);a.Rest.fetchMacroMetadataDetails(e)};i.setUI=function(b,c){var e=b=="edit"?a.editTitle:a.insertTitle;f("#macro-insert-container").hide();a.UI.updateButtonText(b);a.UI.enableSaveButton(false);a.dialog.gotoPage(1).addHeader(e.replace(/\{0\}/,c));a.dialog.show();a.UI.showBrowserSpinner(true)};i.displayDetails=function(){a.UI.showBrowserSpinner(false);a.UI.enableSaveButton(false);
f("#macro-insert-container").show();a.UI.focusOnMacroDetailsFirstInput()};a.reset=function(){g&&g.resolve&&g.resolve();g=null;a.initMacroBrowserAfterRequest=null;a.initData=null;a.hasInit=false;a.metadataList=[];a.aliasMap={};a.fields={};h.reset();a.Macros=h.elements()};a.getMacroJsOverride=h.get;a.setMacroJsOverride=h.put;a.Macros=h.elements();a.hasInit=false;a.metadataList=[];a.aliasMap={};a.fields={};a.processRequiredParameters=function(){return a.Editor.processRequiredParameters()};a.paramChanged=
function(){a.Editor.processRequiredParameters()};a.loadMacroInBrowser=function(b,c){a.Editor.loadMacroInBrowser(b,c)};a.getMacroDefinitionFromForm=function(b){a.Editor.getMacroDefinitionFromForm(b)};a.getMacroParametersFromForm=function(b){a.Editor.getMacroParametersFromForm(b)};a.previewMacro=function(b){a.Preview.previewMacro(b)};a.previewOnload=function(b){var c=h.getFunction(a.dialog.activeMetadata.macroName,"postPreview");c&&c(f("#macro-preview-iframe")[0],a.dialog.activeMetadata);d.Editor.disableFrame(b);
f(b).click(function(a){if(a.target.tagName.toLowerCase()==="a"){(a=f(a.target).attr("href"))&&(a.indexOf("#")!=0&&a.indexOf(k.location)==-1)&&k.open(a,"_blank").focus();return false}})};a.getMacroMetadata=function(b){for(var c=0,e=a.metadataList.length;c<e;c++){var d=a.metadataList[c];if(d.macroName==b)return d}return null};a.getMetadataPromise=function(){return g};a.open=function(b){if(!b){b={};d.log("No settings to open the macro browser.")}var c=b.selectedMacro;!c&&b.presetMacroMetadata&&(c={name:b.presetMacroMetadata.macroName});
if(c&&c.name){var e=h.getFunction(c.name,"opener");if(e){e(c);return}}if(!a.hasInit){d.debug("init macro browser");a.UI.showBrowserSpinner(true);if(a.initData!==null&&f.isEmptyObject(a.initData)){d.trigger("analytics",{name:"macro-browser.init-reattempt"});d.logError("Macro browser preload failed. Trying again...");a.initMacroBrowserAfterRequest=b;a.preLoadMacro();return}if(a.initData)a.initBrowser();else{d.trigger("analytics",{name:"macro-browser.init-overlap"});d.debug("Waiting for macro browser preloading...");
a.initMacroBrowserAfterRequest=b;return}}a.openMacroBrowser(b)};a.openMacroBrowser=function(b){a.settings=b;a.selectedMacroDefinition=b.selectedMacro;var c=a.selectedMacroDefinition&&a.selectedMacroDefinition.name||b.presetMacroName;if(b.presetMacroName)b.presetMacroMetadata=a.getMacroMetadata(b.presetMacroName);var e=b.presetMacroMetadata;if(!e){var j=b.selectedMacro;if(j){var c=j.name.toLowerCase(),c=a.aliasMap[c]||c,g=h.getFunction(c,"updateSelectedMacro"),i=h.getFunction(c,"getMacroDetailsFromSelectedMacro");
g&&g(j);i&&(e=i(a.metadataList,j));e||(e=a.getMacroMetadata(c))}}j=f("#macro-browser-dialog").find("button.back");if(e){d.debug("Open macro browser to edit macro: "+e.macroName);j.hide();a.replicateSelectMacro(e,b.mode||"edit")}else if(c){j.show();a.dialog.overrideLastTab();a.dialog.gotoPage(2);a.showBrowserDialog()}else{j.show();if(b.selectedCategory){c=f("#select-macro-page .dialog-page-menu button").index(f("#category-button-"+b.selectedCategory));c<0&&(c=0);a.dialog.overrideLastTab();a.dialog.gotoPanel(0,
c)}else a.dialog.gotoPage(0);a.showBrowserDialog();a.dialog.searcher.focusAndSearch(b.searchText)}};a.showBrowserDialog=function(){a.dialog.show();a.UI.showBrowserSpinner(false)};a.complete=function(){if(f("#macro-browser-dialog .dialog-button-panel .ok").is(":visible:not(:disabled)")){var b=a.dialog.activeMetadata,c=h.getFunction(b.macroName,"manipulateMarkup");c&&c(b);b=a.Editor.getMacroDefinitionFromForm(b);a.close();if(a.settings.onComplete)a.settings.onComplete(b)}};a.cancel=function(){a.close();
if(typeof a.settings.onCancel=="function")a.settings.onCancel();return false};a.close=function(){this.unknownParams={};this.fields={};a.Preview.removePreviewContainer();this.dialog.hide()};a.replicateSelectMacro=function(a,c){i(a,c)};a.initBrowser=function(){var b=a.initData;if(!b.categories||!a.metadataList.length){d.trigger("analytics",{name:"macro-browser.init-browser-error"});k.alert("There has been an error loading the macro browser. Please try again or see your system administrator.");a.UI.showBrowserSpinner(false);return false}a.editTitle=b.editTitle;
a.insertTitle=b.insertTitle;var c;b.categories=f.map(b.categories,function(a){if(a.name=="hidden-macros"){c=a;return null}return a});b.categories.sort(function(a,b){return a.displayName.toLowerCase()>b.displayName.toLowerCase()?1:-1});c&&d.params.showHiddenUserMacros&&b.categories.push(c);a.dialog=a.UI.createDialog({title:b.title,categories:b.categories,macros:a.metadataList,onClickMacroSummary:function(a,b){a.preventDefault();i(b,"insert")},onSubmit:a.complete,onCancel:a.cancel});return a.hasInit=
true};a.searchSummaries=function(b,c){c=f.extend({splitRegex:/[\s\-]+/},c);return d.filterBySearch(a.metadataList,b,c)};a.getMacroBody=function(){var b="";if(f("#macro-insert-container .macro-body-div textarea").length)b=f("#macro-insert-container .macro-body-div textarea").val();else if(a.selectedMacroDefinition){if(a.selectedMacroDefinition.body)b=a.selectedMacroDefinition.body}else if(a.dialog.activeMetadata)b=a.dialog.activeMetadata.formDetails.body.content;return b};a.getMacroParams=function(a){return t.deserialize(a.getAttribute("data-macro-parameters"))};
a.getMacroName=function(a){return!a.hasAttribute("data-macro-name")?void 0:a.getAttribute("data-macro-name")};a.isHiddenMacroShown=function(a){return d.params.showHiddenUserMacros&&a.pluginKey=="_-user-macro-_"};a.hasRequiredParameters=function(a){return a.anyParameterRequired};a.setWhitelist=function(b){a.whitelist=b};a.preLoadMacro=function(){a.initData=null;if(g&&g.state()==="pending")return g;g=a.Rest.loadMacroMetadata({data:a.whitelist?{whitelist:a.whitelist}:{detailed:false},successCallback:function(b){a.initData=
b;a.Model.loadMacros(b.macros);if(a.initMacroBrowserAfterRequest){a.initBrowser();a.openMacroBrowser(a.initMacroBrowserAfterRequest)}},errorCallback:function(b){d.trigger("analytics",{name:"macro-browser.preload-error"});d.logError("Error requesting macro browser metadata:");d.logError(b);a.initData={}}})};return a});require("confluence/module-exporter").exportModuleAsGlobal("confluence-macro-browser/macro-browser","AJS.MacroBrowser");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-macro-browser:macro-browser-js', location = 'soy/macro-browser.soy' */
// This file was automatically generated from macro-browser.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.MacroBrowser.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.MacroBrowser == 'undefined') { Confluence.Templates.MacroBrowser = {}; }


Confluence.Templates.MacroBrowser.macroSummaryList = function(opt_data, opt_ignored) {
  return '<ol id="category-' + soy.$$escapeHtml(opt_data.category) + '" class="macro-list"></ol>';
};
if (goog.DEBUG) {
  Confluence.Templates.MacroBrowser.macroSummaryList.soyTemplateName = 'Confluence.Templates.MacroBrowser.macroSummaryList';
}


Confluence.Templates.MacroBrowser.macroSummaryItem = function(opt_data, opt_ignored) {
  return '<li class="macro-list-item"><h4 class="macro-title"></h4>' + Confluence.Templates.MacroBrowser.macroDescription({description: ''}) + '</li>';
};
if (goog.DEBUG) {
  Confluence.Templates.MacroBrowser.macroSummaryItem.soyTemplateName = 'Confluence.Templates.MacroBrowser.macroSummaryItem';
}


Confluence.Templates.MacroBrowser.macroDescription = function(opt_data, opt_ignored) {
  opt_data = opt_data || {};
  return '<div class="macro-desc">' + ((opt_data.descriptionHtml) ? soy.$$filterNoAutoescape(opt_data.descriptionHtml) : '') + ((opt_data.documentationLink) ? ' <a href="' + soy.$$escapeHtml(opt_data.documentationLink) + '" class="macro-doco-link">' + soy.$$escapeHtml('Documentation') + '</a>' : '') + '</div>';
};
if (goog.DEBUG) {
  Confluence.Templates.MacroBrowser.macroDescription.soyTemplateName = 'Confluence.Templates.MacroBrowser.macroDescription';
}


Confluence.Templates.MacroBrowser.insertMacroPanel = function(opt_data, opt_ignored) {
  return '<div id="macro-insert-container"><input class="macro-name" type="hidden"/><div class="macro-input-fields dialog-panel"><form action="#" class="aui"></form></div><div class="macro-preview-container dialog-panel"><div class="macro-preview-header"><ul class="macro-preview-links"><li><a id="macro-browser-preview-link" class="refresh-link icon icon-refresh" href="#">' + soy.$$escapeHtml('Refresh') + '</a></li></ul><span>' + soy.$$escapeHtml('Preview') + '</span></div><div id="macro-browser-preview" class="macro-preview"></div></div></div>';
};
if (goog.DEBUG) {
  Confluence.Templates.MacroBrowser.insertMacroPanel.soyTemplateName = 'Confluence.Templates.MacroBrowser.insertMacroPanel';
}


Confluence.Templates.MacroBrowser.missingUserMacroMetadataPanel = function(opt_data, opt_ignored) {
  return '<div id="macro-missing-metadata-container"><p>' + 'There is no metadata configured for this macro which means no configuration screen can be presented here.' + '</p>' + ((opt_data.showAdminMessage) ? '<p>' + AJS.format('If this is a user macro then you can add metadata to the template using the \x3ca href\x3d\x22{0}\x22 target\x3d\x22_blank\x22\x3eUser Macro Administration\x3c/a\x3e console.',"/wiki" + '/admin/usermacros.action') + '</p>' : '<p>' + 'You must contact an administrator to configure metadata for this macro.' + '</p>') + '</div>';
};
if (goog.DEBUG) {
  Confluence.Templates.MacroBrowser.missingUserMacroMetadataPanel.soyTemplateName = 'Confluence.Templates.MacroBrowser.missingUserMacroMetadataPanel';
}


Confluence.Templates.MacroBrowser.macroParameter = function(opt_data, opt_ignored) {
  return '<div class="macro-param-div"><label></label><input type="text" class="text"/></div>';
};
if (goog.DEBUG) {
  Confluence.Templates.MacroBrowser.macroParameter.soyTemplateName = 'Confluence.Templates.MacroBrowser.macroParameter';
}


Confluence.Templates.MacroBrowser.macroParameterBoolean = function(opt_data, opt_ignored) {
  return '<div class="checkbox macro-param-div boolean-param"><input class="checkbox" type="checkbox" value="true"/><label></label></div>';
};
if (goog.DEBUG) {
  Confluence.Templates.MacroBrowser.macroParameterBoolean.soyTemplateName = 'Confluence.Templates.MacroBrowser.macroParameterBoolean';
}


Confluence.Templates.MacroBrowser.macroParameterSelect = function(opt_data, opt_ignored) {
  return '<div class="macro-param-div"><label></label><select class="select"></select></div>';
};
if (goog.DEBUG) {
  Confluence.Templates.MacroBrowser.macroParameterSelect.soyTemplateName = 'Confluence.Templates.MacroBrowser.macroParameterSelect';
}


Confluence.Templates.MacroBrowser.macroParameterHidden = function(opt_data, opt_ignored) {
  return '<div class="macro-param-div"><input type="hidden"/></div>';
};
if (goog.DEBUG) {
  Confluence.Templates.MacroBrowser.macroParameterHidden.soyTemplateName = 'Confluence.Templates.MacroBrowser.macroParameterHidden';
}


Confluence.Templates.MacroBrowser.macroParameterDesc = function(opt_data, opt_ignored) {
  return '<div class="macro-param-desc">' + soy.$$filterNoAutoescape(opt_data.description) + '</div>';
};
if (goog.DEBUG) {
  Confluence.Templates.MacroBrowser.macroParameterDesc.soyTemplateName = 'Confluence.Templates.MacroBrowser.macroParameterDesc';
}


Confluence.Templates.MacroBrowser.macroBody = function(opt_data, opt_ignored) {
  return '<div class="macro-body-div"><label>' + soy.$$escapeHtml('Body text') + '</label><textarea class="monospaceInput textarea" type="text" rows="10"></textarea></div>';
};
if (goog.DEBUG) {
  Confluence.Templates.MacroBrowser.macroBody.soyTemplateName = 'Confluence.Templates.MacroBrowser.macroBody';
}


Confluence.Templates.MacroBrowser.helpLink = function(opt_data, opt_ignored) {
  return '' + Confluence.Templates.Dialog.helpLink({href: "https://confluence.atlassian.com/display/ConfCloud/Macros"});
};
if (goog.DEBUG) {
  Confluence.Templates.MacroBrowser.helpLink.soyTemplateName = 'Confluence.Templates.MacroBrowser.helpLink';
}


Confluence.Templates.MacroBrowser.gadgetLink = function(opt_data, opt_ignored) {
  return '<a class=\'macro-uri\' href="' + soy.$$escapeHtml(opt_data.url) + '" title="' + soy.$$escapeHtml(opt_data.url) + '" target=\'_blank\'>' + soy.$$escapeHtml('Gadget URL') + '</a>';
};
if (goog.DEBUG) {
  Confluence.Templates.MacroBrowser.gadgetLink.soyTemplateName = 'Confluence.Templates.MacroBrowser.gadgetLink';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-macro-browser:macro-browser-js', location = 'js/macro-browser-preload.js' */
define("confluence-macro-browser/macro-browser-preload",["jquery","ajs","window"],function(a,b,c){return{macroBrowserPreload:function(){a(c).bind("render-content-loaded",function(c,d){a("#macro-preview-iframe").contents().find("body")[0]==d&&b.MacroBrowser.previewOnload(d)});b.MacroBrowser.preLoadMacro()}}});require("confluence/module-exporter").safeRequire("confluence-macro-browser/macro-browser-preload",function(a){require("ajs").toInit(a.macroBrowserPreload)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.web.resources:moment', location = 'includes/js/dist/moment.js' */
(function(){function R(a,b){return function(c){return k(a.call(this,c),b)}}function pa(a,b){return function(c){return this.lang().ordinal(a.call(this,c),b)}}function S(){}function B(a){T(a);m(this,a)}function C(a){var a=U(a),b=a.year||0,c=a.month||0,d=a.week||0,f=a.day||0;this._milliseconds=+(a.millisecond||0)+1E3*(a.second||0)+6E4*(a.minute||0)+36E5*(a.hour||0);this._days=+f+7*d;this._months=+c+12*b;this._data={};this._bubble()}function m(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);b.hasOwnProperty("toString")&&
(a.toString=b.toString);b.hasOwnProperty("valueOf")&&(a.valueOf=b.valueOf);return a}function s(a){return 0>a?Math.ceil(a):Math.floor(a)}function k(a,b,c){for(var d=Math.abs(a)+"";d.length<b;)d="0"+d;return(0<=a?c?"+":"":"-")+d}function D(a,b,c,d){var f=b._milliseconds,i=b._days,b=b._months,g,h;f&&a._d.setTime(+a._d+f*c);if(i||b)g=a.minute(),h=a.hour();i&&a.date(a.date()+i*c);b&&a.month(a.month()+b*c);f&&!d&&e.updateOffset(a);if(i||b)a.minute(g),a.hour(h)}function E(a){return"[object Array]"===Object.prototype.toString.call(a)}
function V(a,b,c){var d=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),e=0,g;for(g=0;g<d;g++)(c&&a[g]!==b[g]||!c&&h(a[g])!==h(b[g]))&&e++;return e+f}function l(a){if(a)var b=a.toLowerCase().replace(/(.)s$/,"$1"),a=qa[a]||ra[b]||b;return a}function U(a){var b={},c,d;for(d in a)a.hasOwnProperty(d)&&(c=l(d))&&(b[c]=a[d]);return b}function sa(a){var b,c;if(0===a.indexOf("week"))b=7,c="day";else if(0===a.indexOf("month"))b=12,c="month";else return;e[a]=function(d,f){var i,g,h=e.fn._lang[a],
j=[];"number"===typeof d&&(f=d,d=void 0);g=function(a){a=e().utc().set(c,a);return h.call(e.fn._lang,a,d||"")};if(null!=f)return g(f);for(i=0;i<b;i++)j.push(g(i));return j}}function h(a){var a=+a,b=0;0!==a&&isFinite(a)&&(b=0<=a?Math.floor(a):Math.ceil(a));return b}function F(a){return 0===a%4&&0!==a%100||0===a%400}function T(a){var b;if(a._a&&-2===a._pf.overflow){b=0>a._a[t]||11<a._a[t]?t:1>a._a[q]||a._a[q]>(new Date(Date.UTC(a._a[o],a._a[t]+1,0))).getUTCDate()?q:0>a._a[n]||23<a._a[n]?n:0>a._a[u]||
59<a._a[u]?u:0>a._a[x]||59<a._a[x]?x:0>a._a[y]||999<a._a[y]?y:-1;if(a._pf._overflowDayOfYear&&(b<o||b>q))b=q;a._pf.overflow=b}}function W(a){a._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function X(a){null==a._isValid&&(a._isValid=!isNaN(a._d.getTime())&&0>a._pf.overflow&&!a._pf.empty&&!a._pf.invalidMonth&&!a._pf.nullInput&&!a._pf.invalidFormat&&!a._pf.userInvalidated,a._strict&&(a._isValid=a._isValid&&
0===a._pf.charsLeftOver&&0===a._pf.unusedTokens.length));return a._isValid}function G(a){return a?a.toLowerCase().replace("_","-"):a}function H(a,b){return b._isUTC?e(a).zone(b._offset||0):e(a).local()}function p(a){var b=0,c,d,f,i,g=function(a){if(!v[a]&&Y)try{require("./lang/"+a)}catch(b){}return v[a]};if(!a)return e.fn._lang;if(!E(a)){if(d=g(a))return d;a=[a]}for(;b<a.length;){i=G(a[b]).split("-");c=i.length;for(f=(f=G(a[b+1]))?f.split("-"):null;0<c;){if(d=g(i.slice(0,c).join("-")))return d;if(f&&
f.length>=c&&V(i,f,!0)>=c-1)break;c--}b++}return e.fn._lang}function I(a,b){if(!a.isValid())return a.lang().invalidDate();b=Z(b,a.lang());if(!J[b]){var c=J,d=b,f=b,e=f.match($),g,h;g=0;for(h=e.length;g<h;g++)e[g]=r[e[g]]?r[e[g]]:e[g].match(/\[[\s\S]/)?e[g].replace(/^\[|\]$/g,""):e[g].replace(/\\/g,"");c[d]=function(a){var b="";for(g=0;g<h;g++)b+=e[g]instanceof Function?e[g].call(a,f):e[g];return b}}return J[b](a)}function Z(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(z.lastIndex=
0;0<=d&&z.test(a);)a=a.replace(z,c),z.lastIndex=0,d-=1;return a}function ta(a,b){var c=b._strict;switch(a){case "DDDD":return aa;case "YYYY":case "GGGG":case "gggg":return c?ua:va;case "YYYYYY":case "YYYYY":case "GGGGG":case "ggggg":return c?wa:xa;case "S":if(c)return ba;case "SS":if(c)return ca;case "SSS":case "DDD":return c?aa:ya;case "MMM":case "MMMM":case "dd":case "ddd":case "dddd":return za;case "a":case "A":return p(b._l)._meridiemParse;case "X":return Aa;case "Z":case "ZZ":return K;case "T":return Ba;
case "SSSS":return Ca;case "MM":case "DD":case "YY":case "GG":case "gg":case "HH":case "hh":case "mm":case "ss":case "ww":case "WW":return c?ca:da;case "M":case "D":case "d":case "H":case "h":case "m":case "s":case "w":case "W":case "e":case "E":return c?ba:da;default:var c=RegExp,d;d=a.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e}).replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");return new c(d)}}function ea(a){var a=(a||"").match(K)||[],a=((a[a.length-
1]||[])+"").match(Da)||["-",0,0],b=+(60*a[1])+h(a[2]);return"+"===a[0]?-b:b}function L(a){var b,c=[],d,f,i,g,j;if(!a._d){d=new Date;d=a._useUTC?[d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()]:[d.getFullYear(),d.getMonth(),d.getDate()];a._w&&(null==a._a[q]&&null==a._a[t])&&(b=function(b){var c=parseInt(b,10);return b?3>b.length?68<c?1900+c:2E3+c:c:null==a._a[o]?e().weekYear():a._a[o]},f=a._w,null!=f.GG||null!=f.W||null!=f.E?b=fa(b(f.GG),f.W||1,f.E,4,1):(i=p(a._l),g=null!=f.d?ga(f.d,i):null!=f.e?
parseInt(f.e,10)+i._week.dow:0,j=parseInt(f.w,10)||1,null!=f.d&&g<i._week.dow&&j++,b=fa(b(f.gg),j,g,i._week.doy,i._week.dow)),a._a[o]=b.year,a._dayOfYear=b.dayOfYear);if(a._dayOfYear){b=null==a._a[o]?d[o]:a._a[o];if(a._dayOfYear>(F(b)?366:365))a._pf._overflowDayOfYear=!0;b=ha(b,0,a._dayOfYear);a._a[t]=b.getUTCMonth();a._a[q]=b.getUTCDate()}for(b=0;3>b&&null==a._a[b];++b)a._a[b]=c[b]=d[b];for(;7>b;b++)a._a[b]=c[b]=null==a._a[b]?2===b?1:0:a._a[b];c[n]+=h((a._tzm||0)/60);c[u]+=h((a._tzm||0)%60);a._d=
(a._useUTC?ha:Ea).apply(null,c)}}function M(a){a._a=[];a._pf.empty=!0;var b=p(a._l),c=""+a._i,d,f,e,g,j=c.length,k=0;f=Z(a._f,b).match($)||[];for(b=0;b<f.length;b++){e=f[b];if(d=(c.match(ta(e,a))||[])[0])g=c.substr(0,c.indexOf(d)),0<g.length&&a._pf.unusedInput.push(g),c=c.slice(c.indexOf(d)+d.length),k+=d.length;if(r[e]){d?a._pf.empty=!1:a._pf.unusedTokens.push(e);g=a;var m=void 0,l=g._a;switch(e){case "M":case "MM":null!=d&&(l[t]=h(d)-1);break;case "MMM":case "MMMM":m=p(g._l).monthsParse(d);null!=
m?l[t]=m:g._pf.invalidMonth=d;break;case "D":case "DD":null!=d&&(l[q]=h(d));break;case "DDD":case "DDDD":null!=d&&(g._dayOfYear=h(d));break;case "YY":l[o]=h(d)+(68<h(d)?1900:2E3);break;case "YYYY":case "YYYYY":case "YYYYYY":l[o]=h(d);break;case "a":case "A":g._isPm=p(g._l).isPM(d);break;case "H":case "HH":case "h":case "hh":l[n]=h(d);break;case "m":case "mm":l[u]=h(d);break;case "s":case "ss":l[x]=h(d);break;case "S":case "SS":case "SSS":case "SSSS":l[y]=h(1E3*("0."+d));break;case "X":g._d=new Date(1E3*
parseFloat(d));break;case "Z":case "ZZ":g._useUTC=!0;g._tzm=ea(d);break;case "w":case "ww":case "W":case "WW":case "d":case "dd":case "ddd":case "dddd":case "e":case "E":e=e.substr(0,1);case "gg":case "gggg":case "GG":case "GGGG":case "GGGGG":e=e.substr(0,2),d&&(g._w=g._w||{},g._w[e]=d)}}else a._strict&&!d&&a._pf.unusedTokens.push(e)}a._pf.charsLeftOver=j-k;0<c.length&&a._pf.unusedInput.push(c);a._isPm&&12>a._a[n]&&(a._a[n]+=12);!1===a._isPm&&12===a._a[n]&&(a._a[n]=0);L(a);T(a)}function Ea(a,b,c,
d,f,e,g){b=new Date(a,b,c,d,f,e,g);1970>a&&b.setFullYear(a);return b}function ha(a){var b=new Date(Date.UTC.apply(null,arguments));1970>a&&b.setUTCFullYear(a);return b}function ga(a,b){if("string"===typeof a)if(isNaN(a)){if(a=b.weekdaysParse(a),"number"!==typeof a)return null}else a=parseInt(a,10);return a}function Fa(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function A(a,b,c){b=c-b;c-=a.day();c>b&&(c-=7);c<b-7&&(c+=7);a=e(a).add("d",c);return{week:Math.ceil(a.dayOfYear()/7),year:a.year()}}function fa(a,
b,c,d,e){var i=(new Date(k(a,6,!0)+"-01-01")).getUTCDay(),b=7*(b-1)+((null!=c?c:e)-e)+(e-i+(i>d?7:0))+1;return{year:0<b?a:a-1,dayOfYear:0<b?b:(F(a-1)?366:365)+b}}function ia(a){var b=a._i,c=a._f;"undefined"===typeof a._pf&&W(a);if(null===b)return e.invalid({nullInput:!0});"string"===typeof b&&(a._i=b=p().preparse(b));if(e.isMoment(b))a=m({},b),a._d=new Date(+b._d);else if(c)if(E(c)){var b=a,d,f,i,g;if(0===b._f.length)b._pf.invalidFormat=!0,b._d=new Date(NaN);else{for(c=0;c<b._f.length;c++)if(g=0,
d=m({},b),W(d),d._f=b._f[c],M(d),X(d)&&(g+=d._pf.charsLeftOver,g+=10*d._pf.unusedTokens.length,d._pf.score=g,null==i||g<i))i=g,f=d;m(b,f||d)}}else M(a);else if(d=a,f=d._i,i=Ga.exec(f),void 0===f)d._d=new Date;else if(i)d._d=new Date(+i[1]);else if("string"===typeof f)if(i=d._i,b=Ha.exec(i)){d._pf.iso=!0;for(f=4;0<f;f--)if(b[f]){d._f=Ia[f-1]+(b[6]||" ");break}for(f=0;4>f;f++)if(ja[f][1].exec(i)){d._f+=ja[f][0];break}i.match(K)&&(d._f+="Z");M(d)}else d._d=new Date(i);else E(f)?(d._a=f.slice(0),L(d)):
"[object Date]"===Object.prototype.toString.call(f)||f instanceof Date?d._d=new Date(+f):"object"===typeof f?d._d||(f=U(d._i),d._a=[f.year,f.month,f.day,f.hour,f.minute,f.second,f.millisecond],L(d)):d._d=new Date(f);return new B(a)}function ka(a,b){e.fn[a]=e.fn[a+"s"]=function(a){var d=this._isUTC?"UTC":"";return null!=a?(this._d["set"+d+b](a),e.updateOffset(this),this):this._d["get"+d+b]()}}function Ja(a){e.duration.fn[a]=function(){return this._data[a]}}function la(a,b){e.duration.fn["as"+a]=function(){return+this/
b}}function N(a){var b=!1,c=e;"undefined"===typeof ender&&(a?(O.moment=function(){!b&&(console&&console.warn)&&(b=!0,console.warn("Accessing Moment through the global scope is deprecated, and will be removed in an upcoming release."));return c.apply(null,arguments)},m(O.moment,c)):O.moment=e)}for(var e,O=this,w=Math.round,j,o=0,t=1,q=2,n=3,u=4,x=5,y=6,v={},Y="undefined"!==typeof module&&module.exports&&"undefined"!==typeof require,Ga=/^\/?Date\((\-?\d+)/i,Ka=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,
La=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/,$=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|X|zz?|ZZ?|.)/g,z=/(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g,da=/\d\d?/,ya=/\d{1,3}/,va=/\d{1,4}/,xa=/[+\-]?\d{1,6}/,Ca=/\d+/,za=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,
K=/Z|[\+\-]\d\d:?\d\d/gi,Ba=/T/i,Aa=/[\+\-]?\d+(\.\d{1,3})?/,ba=/\d/,ca=/\d\d/,aa=/\d{3}/,ua=/\d{4}/,wa=/[+\-]?\d{6}/,Ha=/^\s*\d{4}-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ia=["YYYY-MM-DD","GGGG-[W]WW","GGGG-[W]WW-E","YYYY-DDD"],ja=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d{1,3}/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],Da=/([\+\-]|\d\d)/gi,P=["Date","Hours","Minutes","Seconds","Milliseconds"],
Q={Milliseconds:1,Seconds:1E3,Minutes:6E4,Hours:36E5,Days:864E5,Months:2592E6,Years:31536E6},qa={ms:"millisecond",s:"second",m:"minute",h:"hour",d:"day",D:"date",w:"week",W:"isoWeek",M:"month",y:"year",DDD:"dayOfYear",e:"weekday",E:"isoWeekday",gg:"weekYear",GG:"isoWeekYear"},ra={dayofyear:"dayOfYear",isoweekday:"isoWeekday",isoweek:"isoWeek",weekyear:"weekYear",isoweekyear:"isoWeekYear"},J={},ma="DDD w W M D d".split(" "),na="MDHhmswW".split(""),r={M:function(){return this.month()+1},MMM:function(a){return this.lang().monthsShort(this,
a)},MMMM:function(a){return this.lang().months(this,a)},D:function(){return this.date()},DDD:function(){return this.dayOfYear()},d:function(){return this.day()},dd:function(a){return this.lang().weekdaysMin(this,a)},ddd:function(a){return this.lang().weekdaysShort(this,a)},dddd:function(a){return this.lang().weekdays(this,a)},w:function(){return this.week()},W:function(){return this.isoWeek()},YY:function(){return k(this.year()%100,2)},YYYY:function(){return k(this.year(),4)},YYYYY:function(){return k(this.year(),
5)},YYYYYY:function(){var a=this.year();return(0<=a?"+":"-")+k(Math.abs(a),6)},gg:function(){return k(this.weekYear()%100,2)},gggg:function(){return this.weekYear()},ggggg:function(){return k(this.weekYear(),5)},GG:function(){return k(this.isoWeekYear()%100,2)},GGGG:function(){return this.isoWeekYear()},GGGGG:function(){return k(this.isoWeekYear(),5)},e:function(){return this.weekday()},E:function(){return this.isoWeekday()},a:function(){return this.lang().meridiem(this.hours(),this.minutes(),!0)},
A:function(){return this.lang().meridiem(this.hours(),this.minutes(),!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return h(this.milliseconds()/100)},SS:function(){return k(h(this.milliseconds()/10),2)},SSS:function(){return k(this.milliseconds(),3)},SSSS:function(){return k(this.milliseconds(),3)},Z:function(){var a=-this.zone(),b="+";0>a&&(a=-a,b="-");return b+k(h(a/60),2)+":"+
k(h(a)%60,2)},ZZ:function(){var a=-this.zone(),b="+";0>a&&(a=-a,b="-");return b+k(h(a/60),2)+k(h(a)%60,2)},z:function(){return this.zoneAbbr()},zz:function(){return this.zoneName()},X:function(){return this.unix()},Q:function(){return this.quarter()}},oa=["months","monthsShort","weekdays","weekdaysShort","weekdaysMin"];ma.length;)j=ma.pop(),r[j+"o"]=pa(r[j],j);for(;na.length;)j=na.pop(),r[j+j]=R(r[j],2);r.DDDD=R(r.DDD,3);m(S.prototype,{set:function(a){var b,c;for(c in a)b=a[c],"function"===typeof b?
this[c]=b:this["_"+c]=b},_months:"January February March April May June July August September October November December".split(" "),months:function(a){return this._months[a.month()]},_monthsShort:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),monthsShort:function(a){return this._monthsShort[a.month()]},monthsParse:function(a){var b,c;this._monthsParse||(this._monthsParse=[]);for(b=0;12>b;b++)if(this._monthsParse[b]||(c=e.utc([2E3,b]),c="^"+this.months(c,"")+"|^"+this.monthsShort(c,""),
this._monthsParse[b]=RegExp(c.replace(".",""),"i")),this._monthsParse[b].test(a))return b},_weekdays:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),weekdays:function(a){return this._weekdays[a.day()]},_weekdaysShort:"Sun Mon Tue Wed Thu Fri Sat".split(" "),weekdaysShort:function(a){return this._weekdaysShort[a.day()]},_weekdaysMin:"Su Mo Tu We Th Fr Sa".split(" "),weekdaysMin:function(a){return this._weekdaysMin[a.day()]},weekdaysParse:function(a){var b,c;this._weekdaysParse||
(this._weekdaysParse=[]);for(b=0;7>b;b++)if(this._weekdaysParse[b]||(c=e([2E3,1]).day(b),c="^"+this.weekdays(c,"")+"|^"+this.weekdaysShort(c,"")+"|^"+this.weekdaysMin(c,""),this._weekdaysParse[b]=RegExp(c.replace(".",""),"i")),this._weekdaysParse[b].test(a))return b},_longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY LT",LLLL:"dddd, MMMM D YYYY LT"},longDateFormat:function(a){var b=this._longDateFormat[a];!b&&this._longDateFormat[a.toUpperCase()]&&(b=this._longDateFormat[a.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,
function(a){return a.slice(1)}),this._longDateFormat[a]=b);return b},isPM:function(a){return"p"===(a+"").toLowerCase().charAt(0)},_meridiemParse:/[ap]\.?m?\.?/i,meridiem:function(a,b,c){return 11<a?c?"pm":"PM":c?"am":"AM"},_calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},calendar:function(a,b){var c=this._calendar[a];return"function"===typeof c?c.apply(b):c},_relativeTime:{future:"in %s",
past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},relativeTime:function(a,b,c,d){var e=this._relativeTime[c];return"function"===typeof e?e(a,b,c,d):e.replace(/%d/i,a)},pastFuture:function(a,b){var c=this._relativeTime[0<a?"future":"past"];return"function"===typeof c?c(b):c.replace(/%s/i,b)},ordinal:function(a){return this._ordinal.replace("%d",a)},_ordinal:"%d",preparse:function(a){return a},
postformat:function(a){return a},week:function(a){return A(a,this._week.dow,this._week.doy).week},_week:{dow:0,doy:6},_invalidDate:"Invalid date",invalidDate:function(){return this._invalidDate}});e=function(a,b,c,d){"boolean"===typeof c&&(d=c,c=void 0);return ia({_i:a,_f:b,_l:c,_strict:d,_isUTC:!1})};e.utc=function(a,b,c,d){"boolean"===typeof c&&(d=c,c=void 0);return ia({_useUTC:!0,_isUTC:!0,_l:c,_i:a,_f:b,_strict:d}).utc()};e.unix=function(a){return e(1E3*a)};e.duration=function(a,b){var c=a,d=
null,f;if(e.isDuration(a))c={ms:a._milliseconds,d:a._days,M:a._months};else if("number"===typeof a)c={},b?c[b]=a:c.milliseconds=a;else if(d=Ka.exec(a))f="-"===d[1]?-1:1,c={y:0,d:h(d[q])*f,h:h(d[n])*f,m:h(d[u])*f,s:h(d[x])*f,ms:h(d[y])*f};else if(d=La.exec(a))f="-"===d[1]?-1:1,c=function(a){a=a&&parseFloat(a.replace(",","."));return(isNaN(a)?0:a)*f},c={y:c(d[2]),M:c(d[3]),d:c(d[4]),h:c(d[5]),m:c(d[6]),s:c(d[7]),w:c(d[8])};d=new C(c);e.isDuration(a)&&a.hasOwnProperty("_lang")&&(d._lang=a._lang);return d};
e.version="2.5.0";e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";e.updateOffset=function(){};e.lang=function(a,b){if(!a)return e.fn._lang._abbr;if(b){var c=G(a);b.abbr=c;v[c]||(v[c]=new S);v[c].set(b)}else null===b?(delete v[a],a="en"):v[a]||p(a);return(e.duration.fn._lang=e.fn._lang=p(a))._abbr};e.langData=function(a){a&&(a._lang&&a._lang._abbr)&&(a=a._lang._abbr);return p(a)};e.isMoment=function(a){return a instanceof B};e.isDuration=function(a){return a instanceof C};for(j=oa.length-1;0<=j;--j)sa(oa[j]);
e.normalizeUnits=function(a){return l(a)};e.invalid=function(a){var b=e.utc(NaN);null!=a?m(b._pf,a):b._pf.userInvalidated=!0;return b};e.parseZone=function(a){return e(a).parseZone()};m(e.fn=B.prototype,{clone:function(){return e(this)},valueOf:function(){return+this._d+6E4*(this._offset||0)},unix:function(){return Math.floor(+this/1E3)},toString:function(){return this.clone().lang("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._offset?new Date(+this):this._d},toISOString:function(){var a=
e(this).utc();return 0<a.year()&&9999>=a.year()?I(a,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):I(a,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},toArray:function(){return[this.year(),this.month(),this.date(),this.hours(),this.minutes(),this.seconds(),this.milliseconds()]},isValid:function(){return X(this)},isDSTShifted:function(){return this._a?this.isValid()&&0<V(this._a,(this._isUTC?e.utc(this._a):e(this._a)).toArray()):!1},parsingFlags:function(){return m({},this._pf)},invalidAt:function(){return this._pf.overflow},
utc:function(){return this.zone(0)},local:function(){this.zone(0);this._isUTC=!1;return this},format:function(a){a=I(this,a||e.defaultFormat);return this.lang().postformat(a)},add:function(a,b){var c;c="string"===typeof a?e.duration(+b,a):e.duration(a,b);D(this,c,1);return this},subtract:function(a,b){var c;c="string"===typeof a?e.duration(+b,a):e.duration(a,b);D(this,c,-1);return this},diff:function(a,b,c){var a=H(a,this),d=6E4*(this.zone()-a.zone()),f,b=l(b);"year"===b||"month"===b?(f=432E5*(this.daysInMonth()+
a.daysInMonth()),d=12*(this.year()-a.year())+(this.month()-a.month()),d+=(this-e(this).startOf("month")-(a-e(a).startOf("month")))/f,d-=6E4*(this.zone()-e(this).startOf("month").zone()-(a.zone()-e(a).startOf("month").zone()))/f,"year"===b&&(d/=12)):(f=this-a,d="second"===b?f/1E3:"minute"===b?f/6E4:"hour"===b?f/36E5:"day"===b?(f-d)/864E5:"week"===b?(f-d)/6048E5:f);return c?d:s(d)},from:function(a,b){return e.duration(this.diff(a)).lang(this.lang()._abbr).humanize(!b)},fromNow:function(a){return this.from(e(),
a)},calendar:function(){var a=H(e(),this).startOf("day"),a=this.diff(a,"days",!0);return this.format(this.lang().calendar(-6>a?"sameElse":-1>a?"lastWeek":0>a?"lastDay":1>a?"sameDay":2>a?"nextDay":7>a?"nextWeek":"sameElse",this))},isLeapYear:function(){return F(this.year())},isDST:function(){return this.zone()<this.clone().month(0).zone()||this.zone()<this.clone().month(5).zone()},day:function(a){var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=ga(a,this.lang()),this.add({d:a-
b})):b},month:function(a){var b=this._isUTC?"UTC":"",c;if(null!=a){if("string"===typeof a&&(a=this.lang().monthsParse(a),"number"!==typeof a))return this;c=this.date();this.date(1);this._d["set"+b+"Month"](a);this.date(Math.min(c,this.daysInMonth()));e.updateOffset(this);return this}return this._d["get"+b+"Month"]()},startOf:function(a){a=l(a);switch(a){case "year":this.month(0);case "month":this.date(1);case "week":case "isoWeek":case "day":this.hours(0);case "hour":this.minutes(0);case "minute":this.seconds(0);
case "second":this.milliseconds(0)}"week"===a?this.weekday(0):"isoWeek"===a&&this.isoWeekday(1);return this},endOf:function(a){a=l(a);return this.startOf(a).add("isoWeek"===a?"week":a,1).subtract("ms",1)},isAfter:function(a,b){b="undefined"!==typeof b?b:"millisecond";return+this.clone().startOf(b)>+e(a).startOf(b)},isBefore:function(a,b){b="undefined"!==typeof b?b:"millisecond";return+this.clone().startOf(b)<+e(a).startOf(b)},isSame:function(a,b){b=b||"ms";return+this.clone().startOf(b)===+H(a,this).startOf(b)},
min:function(a){a=e.apply(null,arguments);return a<this?this:a},max:function(a){a=e.apply(null,arguments);return a>this?this:a},zone:function(a){var b=this._offset||0;if(null!=a)"string"===typeof a&&(a=ea(a)),16>Math.abs(a)&&(a*=60),this._offset=a,this._isUTC=!0,b!==a&&D(this,e.duration(b-a,"m"),1,!0);else return this._isUTC?b:this._d.getTimezoneOffset();return this},zoneAbbr:function(){return this._isUTC?"UTC":""},zoneName:function(){return this._isUTC?"Coordinated Universal Time":""},parseZone:function(){this._tzm?
this.zone(this._tzm):"string"===typeof this._i&&this.zone(this._i);return this},hasAlignedHourOffset:function(a){a=a?e(a).zone():0;return 0===(this.zone()-a)%60},daysInMonth:function(){var a=this.year(),b=this.month();return(new Date(Date.UTC(a,b+1,0))).getUTCDate()},dayOfYear:function(a){var b=w((e(this).startOf("day")-e(this).startOf("year"))/864E5)+1;return null==a?b:this.add("d",a-b)},quarter:function(){return Math.ceil((this.month()+1)/3)},weekYear:function(a){var b=A(this,this.lang()._week.dow,
this.lang()._week.doy).year;return null==a?b:this.add("y",a-b)},isoWeekYear:function(a){var b=A(this,1,4).year;return null==a?b:this.add("y",a-b)},week:function(a){var b=this.lang().week(this);return null==a?b:this.add("d",7*(a-b))},isoWeek:function(a){var b=A(this,1,4).week;return null==a?b:this.add("d",7*(a-b))},weekday:function(a){var b=(this.day()+7-this.lang()._week.dow)%7;return null==a?b:this.add("d",a-b)},isoWeekday:function(a){return null==a?this.day()||7:this.day(this.day()%7?a:a-7)},get:function(a){a=
l(a);return this[a]()},set:function(a,b){a=l(a);if("function"===typeof this[a])this[a](b);return this},lang:function(a){if(void 0===a)return this._lang;this._lang=p(a);return this}});for(j=0;j<P.length;j++)ka(P[j].toLowerCase().replace(/s$/,""),P[j]);ka("year","FullYear");e.fn.days=e.fn.day;e.fn.months=e.fn.month;e.fn.weeks=e.fn.week;e.fn.isoWeeks=e.fn.isoWeek;e.fn.toJSON=e.fn.toISOString;m(e.duration.fn=C.prototype,{_bubble:function(){var a=this._milliseconds,b=this._days,c=this._months,d=this._data;
d.milliseconds=a%1E3;a=s(a/1E3);d.seconds=a%60;a=s(a/60);d.minutes=a%60;a=s(a/60);d.hours=a%24;b+=s(a/24);d.days=b%30;c+=s(b/30);d.months=c%12;b=s(c/12);d.years=b},weeks:function(){return s(this.days()/7)},valueOf:function(){return this._milliseconds+864E5*this._days+2592E6*(this._months%12)+31536E6*h(this._months/12)},humanize:function(a){var b=+this,c;c=!a;var d=this.lang(),e=w(Math.abs(b)/1E3),i=w(e/60),g=w(i/60),h=w(g/24),j=w(h/365),e=45>e&&["s",e]||1===i&&["m"]||45>i&&["mm",i]||1===g&&["h"]||
22>g&&["hh",g]||1===h&&["d"]||25>=h&&["dd",h]||45>=h&&["M"]||345>h&&["MM",w(h/30)]||1===j&&["y"]||["yy",j];e[2]=c;e[3]=0<b;e[4]=d;c=Fa.apply({},e);a&&(c=this.lang().pastFuture(b,c));return this.lang().postformat(c)},add:function(a,b){var c=e.duration(a,b);this._milliseconds+=c._milliseconds;this._days+=c._days;this._months+=c._months;this._bubble();return this},subtract:function(a,b){var c=e.duration(a,b);this._milliseconds-=c._milliseconds;this._days-=c._days;this._months-=c._months;this._bubble();
return this},get:function(a){a=l(a);return this[a.toLowerCase()+"s"]()},as:function(a){a=l(a);return this["as"+a.charAt(0).toUpperCase()+a.slice(1)+"s"]()},lang:e.fn.lang,toIsoString:function(){var a=Math.abs(this.years()),b=Math.abs(this.months()),c=Math.abs(this.days()),d=Math.abs(this.hours()),e=Math.abs(this.minutes()),h=Math.abs(this.seconds()+this.milliseconds()/1E3);return!this.asSeconds()?"P0D":(0>this.asSeconds()?"-":"")+"P"+(a?a+"Y":"")+(b?b+"M":"")+(c?c+"D":"")+(d||e||h?"T":"")+(d?d+"H":
"")+(e?e+"M":"")+(h?h+"S":"")}});for(j in Q)Q.hasOwnProperty(j)&&(la(j,Q[j]),Ja(j.toLowerCase()));la("Weeks",6048E5);e.duration.fn.asMonths=function(){return(+this-31536E6*this.years())/2592E6+12*this.years()};e.lang("en",{ordinal:function(a){var b=a%10,b=1===h(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+b}});Y?(module.exports=e,N(!0)):"function"===typeof define&&define.amd?define("moment",function(a,b,c){c.config&&(c.config()&&!0!==c.config().noGlobal)&&N(void 0===c.config().noGlobal);
return e}):N()}).call(this);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.web.resources:moment', location = 'includes/js/amd/shim/moment-amd.js' */
define("moment",function(){return moment});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:page-editor-js', location = 'editor/page-editor-message.js' */
define("confluence-editor/editor/page-editor-message",["jquery","ajs","aui/flag","document","underscore"],function(f,i,g,h,d){var b=Object.create(null),e=Object.create(null);h.addEventListener("aui-flag-close",function(a){a&&a.target&&(b=d.filter(Object.keys(b),function(c){return!f(a.target).find("span").hasClass(c)}))});return{handleMessage:function(a,c,d){b[a]||(e[a]?delete e[a]:c&&(b[a]=g({title:c.title?c.title:"",type:c.type,close:c.close?c.close:"manual",persistent:!1,body:"<span class='"+a+
"'>"+c.message+"</span>"}),d&&d()))},closeMessages:function(a){d.each(a,function(a){b[a]&&(b[a].close(),delete b[a])})},isDisplayed:function(a){return a in b},displayedErrors:function(){return Object.keys(b)},suppressMessage:function(a){e[a]={}}}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:page-editor-js', location = 'editor/page-editor-quit-dialog.js' */
define("confluence-editor/editor/page-editor-quit-dialog","jquery confluence/templates ajs confluence/meta window document confluence-editor/editor/page-editor-message confluence/api/constants underscore confluence/legacy-editor-global-AVOID-IF-POSSIBLE".split(" "),function(e,l,c,g,v,G,m,w,x,d){function y(b){b.stopPropagation();b.preventDefault();c.trigger("analyticsEvent",{name:"confluence.synchrony.editor.quit-dialog.show-diff-clicked"});a.showDiffButton.hide();a.hideDiffButton.show();r()}function z(b){b.stopPropagation();
b.preventDefault();c.trigger("analyticsEvent",{name:"confluence.synchrony.editor.quit-dialog.hide-diff-clicked"});a.hideDiffButton.hide();a.showDiffButton.show();a.dialogEl.removeClass("aui-dialog2-xlarge").addClass("aui-dialog2-medium");j(n)}function A(b){c.trigger("analyticsEvent",{name:"confluence.synchrony.editor.quit-dialog.discard"});b.stopPropagation();b.preventDefault();d.UI.setButtonsState(false,a.buttonsAll);var h=g.get("content-id"),b=c.contextPath(),b=f?b+"/rest/synchrony/1.0/content/"+
h+"/changes/unpublished":b+"/rest/api/content/"+h+"?status=draft";f&&m.suppressMessage("editor.synchrony.revert-page");e.ajax({url:b,type:"DELETE",data:{draftId:h},contentType:"application/json",dataType:"json"}).done(function(){f&&m.handleMessage("collaborative-editor-discard-error",{type:"success",close:"auto",message:"Successfully reverted to the last published version"});c.trigger("analyticsEvent",{name:"confluence.synchrony.editor.quit-dialog.discard-success",data:{contentId:h}});s()}).fail(function(b){m.handleMessage("collaborative-editor-discard-error",
{type:"error",title:f?"Can\'t revert to last published version":"There were errors discarding your draft.",message:f?"We can\'t get the last published version of the page at the moment. Give it a few moments then try discarding the draft again.":b.errors||"An unknown error has occurred. Please check your logs."});c.trigger("analyticsEvent",{name:"confluence.synchrony.editor.quit-dialog.discard-error",data:{contentId:h}});d.UI.setButtonsState(true,a.buttonsAll)})}function s(){a.editorForm.append(l.Editor.Page.hiddenInputCancel()).submit()}function t(a){if(a){a.stopPropagation();
a.preventDefault()}s()}function B(b){d.UI.setButtonsState(false,a.buttonsAll);o.save(b)}function C(b){b.stopPropagation();b.preventDefault();c.trigger("analyticsEvent",{name:"confluence.synchrony.editor.draft-status-indicator.click"});p(function(){a.closeButton.show();r()})}function D(b){b.stopPropagation();b.preventDefault();a.dialog.hide()}function r(){a.dialogEl.removeClass("aui-dialog2-medium").addClass("aui-dialog2-xlarge");j(i.SHOW_DIFF);e.ajax({url:w.CONTEXT_PATH+"/rest/tinymce/1/content/"+
g.get("page-id")+"/draft/diff",type:"GET"}).success(function(b){a.dialogContent.find(".wiki-content").html(b).children().first().hasClass("diff-context-placeholder")&&a.dialogContent.find("hr").hide()})}function j(b){a.dialogHeader.html(l.Editor.Page.quitDialogHeader({dialogType:b}));a.dialogContent.html(l.Editor.Page.quitDialogContent({dialogType:b,contributors:k}));a.dialogFooter.find("."+b).show();a.dialog.show()}function E(){c.trigger("analyticsEvent",{name:"confluence.synchrony.editor.quit-dialog.dialog-closed"});
a.dialogEl.removeClass("aui-dialog2-xlarge").addClass("aui-dialog2-medium");d.UI.toggleSavebarBusy(false);a.dialogFooter.find(".aui-button").hide();a.dialogContent.empty()}function F(a,c){c&&c.contributors&&(k=x.reject(c.contributors,function(a){return a.name===g.get("remote-user")}))}function p(a){d.Drafts.save({forceSave:f,skipErrorHandler:true,onSuccessHandler:a||e.noop})}var a={},f,u,i={EXIT:"exit",PUBLISH:"publish",SHOW_DIFF:"diff"},k=[],q=false,o={},n;return{init:function(b){if(u=g.getBoolean("shared-drafts")&&
(g.get("content-type")==="page"||g.get("content-type")==="blogpost"))if(q){o.save=b.saveHandler;a.publishButton.click(B)}else{f=!g.get("new-page");a.discardButton=e("#qed-discard-button").tooltip({gravity:"s",className:"quit-editor-dialog"});if(d.isLimitedModeEnabled()&&f){d.UI.setButtonState(false,a.discardButton);a.discardButton.removeAttr("disabled")}else a.discardButton.click(A);a.saveExitButton=e("#qed-save-exit-button").click(t);a.showDiffButton=e("#qed-show-diff-button").click(y);a.hideDiffButton=
e("#qed-hide-diff-button").click(z);a.publishButton=e("#qed-publish-button");a.closeButton=e("#qed-close-button").click(D);a.buttonsAll=[a.discardButton,a.saveExitButton,a.showDiffButton,a.hideDiffButton,a.publishButton];a.dialog=c.dialog2("#quit-editor-dialog");a.dialogEl=a.dialog.$el;a.dialogHeader=a.dialogEl.find(".aui-dialog2-header");a.dialogContent=a.dialogEl.find(".aui-dialog2-content");a.dialogFooter=a.dialogEl.find(".aui-dialog2-footer");a.editorForm=e("#wysiwyg").closest("form");e("#pluggable-status").on("click",
"a",C);a.dialog.on("hide",E);c.bind("editor-heartbeat",F);q=true}},process:function(b){if(u){b.stopPropagation();b.preventDefault();e(v).one("editor-heartbeat",function(){switch(b.target.id){case d.UI.saveButton.attr("id"):case d.UI.versionCommentInput.attr("id"):d.UI.toggleSavebarBusy(true);if(k.length===0)o.save();else{p();f&&a.showDiffButton.show();j(i.PUBLISH);n=i.PUBLISH}break;case d.UI.cancelButton.attr("id"):if(d.Drafts.isDraftDirty()){p();f&&a.showDiffButton.show();d.UI.toggleSavebarBusy(true);
k.length===0?a.discardButton.html("Discard \u003cstrong\u003eall\u003c/strong\u003e changes"):a.discardButton.html("Discard \u003cstrong\u003eeveryone\'s\u003c/strong\u003e changes");j(i.EXIT);n=i.EXIT}else t()}});d.heartbeat()}},_destroy:function(){q=false}}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:page-editor-js', location = 'editor/page-editor.js' */
define("confluence-editor/editor/page-editor","ajs jquery document window confluence/meta confluence/api/constants confluence-editor/editor/page-editor-message confluence/analytics-support confluence/legacy-editor-global-AVOID-IF-POSSIBLE confluence/get-content-id".split(" "),function(d,b,l,M,h,o,j,N,c,y){function z(){var a=h.getBoolean("shared-drafts"),e=h.get("content-type")==="page"||h.get("content-type")==="blogpost",b=d.params.pageId!=="0";return e&&(b||a)}function A(a){b("#editpageform").find("input[name='atl_token']").val(a);
h.set("atl-token",a);h.set("atlassian-token",a);b("#atlassian-token").attr("content",a)}var s=d.DarkFeatures.isEnabled("editor.ajax.save")&&!d.DarkFeatures.isEnabled("editor.ajax.save.disable")&&h.get("remote-user")!=="",m=[],n=[],p=[],B=false,i=1,C=function(a){c.UI.setButtonState(a,c.UI.saveButton);c.UI.setButtonState(a,c.UI.previewButton);c.UI.setButtonState(a,c.UI.cancelButton)},q=function(a){var a=a||{},e=a.messageKey||"editor-error-message",b=a.message||"Something went wrong with the editor. Copy your unsaved changes and refresh the page to keep editing.";
j.handleMessage(e,{title:a.title,type:"error",message:b},function(){a.disablePublish&&C(false)})},D=function(){return h.get("edit-mode")==="limited"},P=function(a){var e=true;j.closeMessages(["offline-before-save-error"]);for(var b=0;b<n.length;b++){n[b](a)===false&&(e=false);if(a.isImmediatePropagationStopped())break}if(!e||a.isDefaultPrevented()||a.isPropagationStopped())return false;a.preventDefault();E(a).done(t).fail(O)},O=function(a){var e=a||{};q({messageKey:e.messageKey||"offline-before-save-error",
message:e.disablePublish?"Something went wrong with the editor. Copy your unsaved changes and refresh the page to keep editing.":"Unable to communicate with server. Saving is not possible at the moment.",disablePublish:e.disablePublish});a&&d.trigger("analytics",{name:"editor.save.error."+a.origin+"."+a.cause});c.UI.toggleSavebarBusy(false);c.Drafts.bindUnloadMessage()},E=function(a){var e=b.Deferred();e.resolve(a);return e.promise()},F=function(){b(c.getCurrentForm()).submit();d.trigger("analytics",{name:"confluence.editor.close",data:{source:"publishButton"}})},t=F;d.bind("rte-ready",
function(){d.Meta.getBoolean("collaborative-content")||b('meta[name="ajs-collaborative-editor-status"]').attr("content","off");c.UI.saveButton.bind("click",P)});d.bind("editor.error.message",function(a,e){q(e)});d.bind("dismiss.editor.error.message",function(a,e){j.closeMessages([e.messageKey]);e.enablePublish&&C(true)});var Q=function(){var a;for(a=0;a<m.length;a++)c.UI.cancelButton.click(m[a]);var e=b(c.getCurrentForm());for(a=0;a<p.length;a++)e.submit(p[a]);b.unbind("init.rte",this)},G=function(a,
e,c,g){g.push(c);if(d.Rte&&d.Rte.BootstrapManager&&d.Rte.BootstrapManager.isInitComplete())a.bind(e,c);else if(!B){B=true;b.bind("init.rte",Q)}},u=function(a,e,b){var c=null;d.Rte&&(d.Rte.BootstrapManager&&d.Rte.BootstrapManager.isInitComplete())&&(c=function(a,e,b){a.unbind(e,b)});for(var h=b.pop();h;){c&&c(a,e,h);h=b.pop()}},H=function(a){if(f!==a){f&&f.clear();a.start(c.heartbeat);f=a}},f,I=d.Meta.getNumber("heartbeat-interval")||3E4,v,J;v={start:function(a){d.debug("Changing heartbeat to the normal scheduler");
J=setInterval(a,I)},clear:function(){clearInterval(J)}};var K,L=Math.max(I/5,5E3),w,x;K={start:function(a){d.debug("Changing heartbeat to the recovery scheduler");x=0;var e=function(){a();var b=L*Math.pow(2,x);w=setTimeout(e,Math.min(b,3E5));x++};w=setTimeout(e,L)},clear:function(){clearTimeout(w)}};return{bookmark:"",MODE_RICHTEXT:"richtext",MODE_SOURCE:"source",MODE_PREVIEW:"preview",PREVIEW_OUTPUT_TYPE:"PREVIEW",currentEditMode:null,contentHasChangedSinceLastSave:false,sourceInitialValue:false,
isSubmitting:false,isCancelling:false,isLimitedModeEnabled:D,overrideBeforeSave:function(a){E=a},overrideSave:function(a){t=a},restoreDefaultSave:function(){t=F},getNumConcurrentEditors:function(){return i},addCancelHandler:function(a){G(c.UI.cancelButton,"click",a,m)},addSaveHandler:function(a){n.push(a)},addSubmitHandler:function(a){G(b(c.getCurrentForm()),"submit",a,p)},removeAllCancelHandlers:function(){u(c.UI.cancelButton,"click",m)},removeAllSaveHandlers:function(){u(c.UI.saveButton,"click",
n)},removeAllSubmitHandlers:function(){u(b(c.getCurrentForm()),"submit",p)},hasContentChanged:function(){return!this.inRichTextMode()&&!this.contentHasChangedSinceLastSave?false:this.editorHasContentChanged()},editorHasContentChanged:function(){if(d.Rte.getEditor()==null){d.debug("Editor: editorHasContentChanged - No active editor present. Returning false.");return false}return d.Rte.Content.editorHasContentChanged()},isEmpty:function(){var a=b(d.Rte.getEditor().getContent()).text();return!b.trim(a)},
getResumeDraftUrl:function(){var a=[];a.push(o.CONTEXT_PATH);a.push("/pages/"+(d.params.newPage?"create":"edit")+d.params.draftType+".action");a.push("?useDraft=true");a.push("&pageId="+d.params.pageId);a.push("&contentChanged="+this.hasContentChanged());this.getCurrentForm().spaceKey&&a.push("&spaceKey="+h.get("space-key"));return a.join("")},getCurrentTitle:function(){return b("#content-title")&&b("#content-title").val()},contentFormSubmit:function(){(D()||!c.Drafts.isSharedDraftsEnabled())&&c.Drafts.unBindUnloadMessage();
b(".editable-title #content-title").prop("disabled",true);return true},metadataSyncRequired:z,heartbeat:function(){var a={dataType:"json",contentId:h.get("content-id"),draftType:d.params.draftType,spaceKey:d.params.spaceKey,contributorsHash:h.get("contributors-hash")};d.safe.post(o.CONTEXT_PATH+"/json/startheartbeatactivity.action",a,function(a){if(!z()&&a){A(a.atlToken);d.Meta.set("shared-drafts",a.editMode!=="legacy");d.trigger("rte.heartbeat",a)}else if(!a||!a.atlToken||!(a.activityResponses instanceof
Array)){d.trigger("rte.heartbeat-error","Invalid server response");d.logError("Unexpected server response for heartbeat:");d.log(a)}else{h.set("contributors-hash",a.contributorsHash);d.Meta.set("shared-drafts",a.editMode!=="legacy");var k=a.activityResponses;A(a.atlToken);c.heartbeatType.normal();d.trigger("rte.heartbeat",k);i=(k.length||0)+1;if(i>1){var g=!s?b("#other-users-span"):b("#reliable-other-users-span").length===0?b("<span id='reliable-other-users-span'></span>"):b("#reliable-other-users-span");
g.empty();for(var r=0;r<i-1;++r){r>0&&g.append(", ");var f=k[r];g.append(d("a").attr("href",o.CONTEXT_PATH+"/display/~"+encodeURIComponent(f.userName)).text(f.fullName));f.lastEditMessage!=null&&g.append(" ").append(d("span").addClass("smalltext").text(f.lastEditMessage))}s&&!j.isDisplayed(["heartBeat"])&&g.html().trim()!==""&&j.handleMessage("heartBeat",{type:"info",message:d.format("This page is also being edited by {0}. Your changes will be merged with theirs when you save.","<span id='reliable-other-users-span'>"+g.html()+"</span>")});d.isVisible("#heartbeat-div")||
N.publish("rte.notification.concurrent-editing",{numEditors:i,pageId:d.params.pageId,draftType:d.params.draftType})}s&&i<=1&&j.closeMessages(["heartBeat"]);d.setVisible("#heartbeat-div",i>1);b(l).trigger("resize.resizeplugin");d.trigger("editor-heartbeat",a);a=a.editMode;if(a!==h.get("edit-mode")&&!(a==="collaborative"&&h.get("edit-mode")!=="limited")){h.set("edit-mode",a);a=a==="collaborative"?"Collaborative editing was switched off, but it\'s back in business. Copy your changes and refresh the page to keep editing.":"Collaborative editing is offline right now. Copy your work, then refresh the page to continue editing.";
q({messageKey:"edit-mode-transition",message:a,disablePublish:true})}}},"json").fail(function(a,b,g){(a.status>=500||a.status===0)&&c.heartbeatType.recovery();if(a.status===403||a.status===401)d.logError("Heartbeat error: Unauthorized");else{d.logError("Server error on heartbeat request:");d.log(g)}d.trigger("rte.heartbeat-error",a)})},heartbeatType:{normal:function(){H(v)},recovery:function(){H(K)},reset:function(){f&&f.clear();f=v;f.start(c.heartbeat)}},disableFrame:function(a){b("form",a).each(function(){b(this).unbind();
this.onsubmit=function(){return false}});b("a",a).each(function(){b(this).attr("target","_top").unbind()});b("input, img",a).each(function(){b(this).unbind()})},previewFrameOnload:function(a,e){var k=require("tinymce");c.setMode(c.MODE_PREVIEW);k.activeEditor.setProgressState(false);c.disableFrame(a);var g=b("#main",a)[0];if(h.get("content-type")!=="comment"&&b(g).find("#main-header").length===0){var f=b("#title-heading"),j=f.attr("class");b(g).prepend('<div id="preview-header"><div id="title-heading" class="'+
j+'">'+f.html()+"</div></div>")}if(b(d.Rte.getEditor().getBody()).hasClass("resizable")){var i=b(e||"#previewArea iframe"),o=0,m=0,n,p=i.height();g&&function R(){var a=b(g).outerHeight(true);if(o!==a){a!==i.height()&&i.height(0).height(Math.max(a,p));o=a;m=0}else m++;m<500&&(n=setTimeout(R,500))}();b(l).one("mode-changed.resize-editor",function(a,b){b!==c.MODE_PREVIEW&&n&&clearTimeout(n)})}else if(k.isIE||k.isOpera){k=b(M).height();f=b("#header-precursor").height()+b("#header").height()+b("#editor-precursor").height();
j=b("#savebar-container").height();b("#preview iframe").height(k-f-j-4);b("#content.edit").height("auto")}},showRichText:function(a){var e=require("tinymce");d.setVisible("#wysiwyg",a);b(".toolbar-group-preview").toggleClass("assistive",!a);b(".toolbar-group-edit").toggleClass("assistive",a);b("#main").toggleClass("active-richtext",a);e.isGecko&&a&&d.Rte.fixEditorFocus(c.bookmark)},showPreview:function(a){if(h.get("content-type")!=="comment"){var e=b("#content-title");if(e.hasClass("placeholded")){b("#preview-title-text").text("");
b("#title-text").text("")}else{b("#preview-title-text").text(e.val());b("#title-text").text(e.val())}}d.setVisible("#preview",a);b(".toolbar-group-preview").toggleClass("assistive",a);b(".toolbar-group-edit").toggleClass("assistive",!a);b("#main").toggleClass("active-preview",a);b("#full-height-container").length&&b("#full-height-container").toggleClass("active-preview",a)},showSource:function(a){a?this.showSourceArea():this.hideSourceArea();b("#main")[a?"addClass":"removeClass"]("active-source")},
setMode:function(a){d.debug("Set mode: "+a);if(a===c.MODE_RICHTEXT){this.showRichText(true);this.showPreview(false);this.showSource(false)}else if(a===c.MODE_SOURCE){this.showSource(true);this.showRichText(false);this.showPreview(false)}else if(a===c.MODE_PREVIEW){this.showPreview(true);this.showRichText(false);this.showSource(false);c.UI.spinner.removeClass("aui-icon-wait")}setTimeout(function(){var a=b(".toolbar-group-preview");a.height(0);a.height();a.height("auto")},1);this.currentEditMode=a;
b(l).trigger("mode-changed",[a])},getContentId:function(){return y()},addErrorMessage:function(a,e,c){var g=b("#"+a),c=c?"#all-messages":"#editor-messages";g.length?g.empty():g=b("<div></div>").attr("id",a).appendTo(c);d.messages.error(g,{closeable:true,body:e})},changeMode:function(a,e){var f=require("tinymce");d.debug("Change mode: "+a);e=e||{};if(this.inRichTextMode()&&!d.Rte.BootstrapManager.isInitComplete()||this.currentEditMode===a)return false;var g=this.currentEditMode;d.trigger("rte-changeMode",
a);if(a===c.MODE_PREVIEW){var i=d.Rte.getEditor();g===c.MODE_SOURCE&&c.transferSourceToEditor();if(f.isGecko&&g===c.MODE_RICHTEXT&&!c.bookmark)c.bookmark=f.activeEditor.selection.getBookmark();this.currentEditMode=a;f={contentId:y(),contentType:h.get("content-type"),spaceKey:h.get("space-key"),xHtml:i.getContent(),outputType:c.PREVIEW_OUTPUT_TYPE};d.safe.ajax({type:"POST",url:o.CONTEXT_PATH+"/pages/rendercontent.action",data:f,success:c.replysetPreviewArea,timeout:2E4,error:function(){d.trigger("rte-preview-action-selected");
d.trigger("rte.preview.error",{status:0});j.closeMessages(["server-offline"]);q({messageKey:"server-offline",message:"Can\'t reach the server. Check you\'re connected to the internet and Confluence is up and running.",disablePublish:false});c.currentEditMode=g;e.errorCallback&&e.errorCallback()}})}else this.setMode(a);a===c.MODE_RICHTEXT&&b(l).trigger("resize.resizeplugin");return false},replysetPreviewArea:function(a){var c=require("tinymce");d.trigger("rte-preview-action-selected");b("#preview-error").remove();var f=d.params.staticResourceUrlPrefix+
"/blank.html";c.activeEditor.setProgressState(true);b("#previewArea").html('<iframe id="editor-preview-iframe" src="'+f+'" scrolling="yes" frameborder="0"></iframe>');c=b("#previewArea iframe")[0];c=c.contentDocument||c.contentWindow.document;c.write(a);c.close()},inRichTextMode:function(){return this.currentEditMode===c.MODE_RICHTEXT},isNewPage:function(){return b("#createpageform, #createpagetemplate").length>0},onInit:function(){var a=require("tinymce");c.setMode(c.MODE_RICHTEXT);a.activeEditor.onClick.add(function(){var a=
c.UI.postingDatePicker;a&&a.hide()})},contentChangeHandler:function(){this.contentHasChangedSinceLastSave=true},getCurrentForm:function(){return require("tinymce").activeEditor.formElement},transferSourceToEditor:function(){if(c.sourceInitialValue){var a=c.getSourceAreaVal();if(a!==c.sourceInitialValue){var b=require("tinymce").activeEditor;b.setContent(a);b.setDirty(a)}}c.sourceInitialValue=false},hideSourceArea:function(){b("#editor-html-source-container").addClass("hidden");this.setToolBarInactive(false);
this.transferSourceToEditor();b("#rte-button-source-mode").removeClass("active");b("#rte-button-publish").unbind("click.source-save")},showSourceArea:function(){var a=require("tinymce");b("#editor-html-source-container").removeClass("hidden");this.setSourceAreaHeight();this.setToolBarInactive(true);this.sourceInitialValue=a.activeEditor.getContent();this.setSourceAreaVal(this.sourceInitialValue);b("#rte-button-source-mode").addClass("active");b("#rte-button-publish").bind("click.source-save",c.transferSourceToEditor)},
getSourceAreaVal:function(){return b("#editor-html-source").val()},setSourceAreaVal:function(a){b("#editor-html-source").val(a)},setSourceAreaHeight:function(){var a=d.Rte.getTinyMceEditorMinHeight();d.debug("HTML source height= "+a);var c=b("#editor-html-source")[0].scrollHeight;if(c>a){a=c;d.debug("ACTUAL HEIGHT "+c)}b("#editor-html-source-container").height(a+"px")},setToolBarInactive:function(a){b("#rte-toolbar").toggleClass("disabled",a)},isVisible:function(){return b("#wysiwyg:visible").length>
0||b("#editor-html-source-container:visible").length>0||b("#preview:visible").length>0}}});require("confluence/module-exporter").safeRequire("confluence-editor/editor/page-editor",function(d){var b=require("jquery"),l=require("ajs");Confluence.Editor=b.extend(Confluence.Editor||{},d);l.toInit(function(){l.bind("init.rte",Confluence.Editor.onInit)});l.Editor=Confluence.Editor});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:page-editor-js', location = 'editor/page-editor-ui.js' */
define("confluence-editor/editor/page-editor-ui","jquery confluence/templates ajs confluence/meta window moment document confluence/api/constants confluence-editor/editor/page-editor-message confluence-editor/editor/page-editor-quit-dialog confluence/analytics-support confluence/legacy-editor-global-AVOID-IF-POSSIBLE confluence/editor-notifications".split(" "),function(b,f,e,d,k,r,g,u,v,l,m,c,s){return function(){var a={},i=function(c,b){for(var b=b||a.buttons,n=0;n<b.length;n++)o(c,b[n])},o=function(a,
b){if(b)if(a){b.removeAttr("aria-disabled");b.removeAttr("disabled");b.removeClass("disabled")}else{b.attr("aria-disabled","true");b.attr("disabled","disabled");b.addClass("disabled")}},p=function(a){return a.length&&a.attr("aria-disabled")!=="true"},h=function(){return d.get("new-page")},q=function(){var a="";h()||(a="Edit"+" - ");return a};a.spinner=b("#rte-spinner");var j;j=f.Editor.Page.saveButton({contentType:d.get("content-type"),sharedDraftsEnabled:d.getBoolean("shared-drafts"),
isNewPage:h()});b("#rte-button-publish").replaceWith(j);j=b("#rte-button-publish");a.saveButton=j;a.overwriteButton=b("#rte-button-overwrite");a.editButton=b("#rte-button-edit");a.previewButton=b("#rte-button-preview");a.cancelButton=b("#rte-button-cancel");a.versionCommentInput=b("#versionComment");a.watchPageCheckbox=b("#watchPage");a.watchPageToolbarGroup=b(".toolbar-group-watch-page");a.buttons=[a.saveButton,a.overwriteButton,a.editButton,a.previewButton,a.cancelButton];e.bind("editor-shared-drafts-published",
function(){var b=/\(.+\)/g.exec(a.saveButton.data("tooltip"))[0];a.saveButton.text(f.Editor.Page.saveButtonText({contentType:d.get("content-type"),sharedDraftsEnabled:d.getBoolean("shared-drafts"),isNewPage:h()})).attr("title",f.Editor.Page.saveButtonTitle({contentType:d.get("content-type"),sharedDraftsEnabled:d.getBoolean("shared-drafts"),isNewPage:h()})+b).tooltip({gravity:"s"})});a.setButtonsState=i;a.setButtonState=o;a.isButtonEnabled=p;a.registerFormButton=function(b,c){a[b]=c;a.buttons.push(c)};
a.postingDatePicker=null;a.isFormEnabled=function(){for(var b=0;b<a.buttons.length;b++)if(p(a.buttons[b]))return true;return false};a.toggleSavebarBusy=function(b){if(b){if(!a.isFormEnabled())return false;a.spinner.addClass("aui-icon-wait");i(false)}else{a.spinner.removeClass("aui-icon-wait");i(true)}return true};a.init=function(){l.init();c.addSaveHandler(function(b){if(a.isButtonEnabled(a.saveButton)){a.toggleSavebarBusy(true);e.trigger("confluence.editor.on.save")}else{b.stopImmediatePropagation();
b.preventDefault()}});e.trigger("rte.init.ui");c.isNewPage()&&b("#content-title").focus().select();c.addCancelHandler(function(a){c.getNumConcurrentEditors()>1&&m.publish("rte.notification.concurrent-editing.cancel",{numEditors:c.getNumConcurrentEditors(),pageId:e.params.pageId,draftType:e.params.draftType});b("#rte-button-overwrite").length&&m.publish("confluence.editor.legacy.draft.conflict",{action:"clickClose"});l.process(a)});d.get("content-type")==="comment"&&c.addSaveHandler(function(){if(e.Rte.Content.isEmpty()){s.notify("warning",
"Comment text is empty. Cannot create empty comments.");a.toggleSavebarBusy(false);return false}});(d.get("content-type")==="comment"||d.get("content-type")==="template")&&c.addCancelHandler(function(b){if(a.isFormEnabled()&&c.hasContentChanged()&&!c.isEmpty()){var t=d.get("content-type")==="comment"?"Your comment will be lost.":"Your unsaved template changes will be lost.";if(!k.confirm(t)){b.stopImmediatePropagation();return false}}});a.versionCommentInput.on("keypress",function(a){a.keyCode===13&&l.process(a)});
c.addSaveHandler(function(){c.getNumConcurrentEditors()>1&&m.publish("rte.notification.concurrent-editing.save",{numEditors:c.getNumConcurrentEditors(),pageId:e.params.pageId,draftType:e.params.draftType})});c.addSubmitHandler(function(a){return c.contentFormSubmit(a)});this.currentEditMode=this.MODE_RICHTEXT;a.editButton.click(function(b){var d=require("tinymce");if(a.isFormEnabled()){c.changeMode(c.MODE_RICHTEXT);setTimeout(function(){e.Rte.getEditor().focus();d.isGecko&&c.bookmark&&e.Rte.getEditor().selection.moveToBookmark(c.bookmark)},
0);a.cancelButton.enable()}b.preventDefault()});a.previewButton.click(function(b){var d=require("tinymce");if(a.isFormEnabled()&&c.currentEditMode!==c.MODE_PREVIEW){i(false);a.spinner.addClass("aui-icon-wait");if(d.isGecko&&!c.bookmark)c.bookmark=d.activeEditor.selection.getBookmark();c.changeMode(c.MODE_PREVIEW,{errorCallback:function(){i(true);a.spinner.removeClass("aui-icon-wait")}});a.cancelButton.disable()}b.preventDefault()});b("#editor-html-source").change(c.setSourceAreaHeight).keyup(c.setSourceAreaHeight);
b("#rte-button-labels").bind("updateLabel",function(){var a=+d.get("num-labels")||0,c="Labels";a===1?c=e.format("{0} Label",a):a>1&&(c=e.format("{0} Labels",a));b("#rte-button-labels").attr("data-tooltip",c)});var f=b("#PostingDate");if(f.length){f.attr("max",r().format("YYYY-MM-DD"));a.postingDatePicker=f.datePicker({overrideBrowserDefault:true});a.postingDatePicker.hide()}b("#wysiwygTextarea_parent .mceProgress, #wysiwygTextarea_parent .mceBlocker").on("click",
function(){e.Rte.getEditor().focus()});b(k).bind("render-content-loaded",function(d,e){var f=b("#previewArea iframe");if(f.contents().find("body")[0]==e){c.previewFrameOnload(e,f);[a.saveButton,a.overwriteButton,a.editButton,a.previewButton].forEach(function(a){o(true,a)});f.focus();k.focus();b(g).trigger("iframeAppended",f)}});if(d.get("heartbeat")){c.heartbeat();c.heartbeatType.normal()}e.bind("watchpage.pageoperation",function(){a.toggleWatchPage(false)});e.bind("unwatchpage.pageoperation",function(){a.toggleWatchPage(true)});
if(d.get("new-page")&&d.get("form-name")==="inlinecommentform")g.title="Edit"+g.title;var h=g.title;if(d.get("new-page")&&b.trim(b("input#content-title").val()))g.title=q()+b("input#content-title").val()+" - "+d.get("space-name")+" - "+d.get("site-title");b("input#content-title").on("change input",function(){if(d.get("content-type")!=="template"){var a=q();g.title=b.trim(this.value)?a+this.value+" - "+d.get("space-name")+" - "+d.get("site-title"):h}});e.trigger("init.rte-control")};
a.toggleWatchPage=function(b){if(b&&d.get("content-type")==="comment"){a.watchPageToolbarGroup.show();if(a.watchPageCheckbox.length)a.watchPageCheckbox[0].checked=false}else a.watchPageToolbarGroup.hide()};return a}});require("confluence/module-exporter").safeRequire("confluence-editor/editor/page-editor-ui",function(b){require("ajs").bind("init.rte",function(){var f=b();Confluence.Editor.UI=f;f.init()})});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:page-editor-js', location = 'tinymce3/plugins/insertwiki/insert-wiki-markup.soy' */
// This file was automatically generated from insert-wiki-markup.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.InsertWiki.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.InsertWiki == 'undefined') { Confluence.Templates.InsertWiki = {}; }


Confluence.Templates.InsertWiki.originalDefaultTempWikiMarkupDialog = function(opt_data, opt_ignored) {
  return '<form action=\'#\' method=\'post\' id="insert-wiki-markup-form" class="aui"><textarea class=\'monospaceInput textarea originalDefault\' id=\'insert-wiki-textarea\' name=\'wikitext\'/></form>';
};
if (goog.DEBUG) {
  Confluence.Templates.InsertWiki.originalDefaultTempWikiMarkupDialog.soyTemplateName = 'Confluence.Templates.InsertWiki.originalDefaultTempWikiMarkupDialog';
}


Confluence.Templates.InsertWiki.previewWikiIframeContent = function(opt_data, opt_ignored) {
  return '<!DOCTYPE html><html class="insert-wiki-markup-dialog"><head></head><body class="wiki-content previewWiki"></body></html>';
};
if (goog.DEBUG) {
  Confluence.Templates.InsertWiki.previewWikiIframeContent.soyTemplateName = 'Confluence.Templates.InsertWiki.previewWikiIframeContent';
}


Confluence.Templates.InsertWiki.wikiMarkupDialog = function(opt_data, opt_ignored) {
  return '<p id="insert-wiki-info-title">' + soy.$$escapeHtml('Enter wiki markup or markdown below. Confluence will convert your content to editor format and insert it into your page.') + '</p><form action=\'#\' method=\'post\' id="insert-wiki-markup-form" class="aui"><h3 class="wiki-title"><span id="insert-wiki-insert-title">' + soy.$$escapeHtml('Insert') + '</span><span id="insert-wiki-preview-title">' + soy.$$escapeHtml('Preview') + '</span></h3><textarea class=\'monospaceInput textarea\' id=\'insert-wiki-textarea\' name=\'wikitext\'/><!-- --><div class=\'example-container\' id=\'insert-wiki-textarea-preview\'></div></form>';
};
if (goog.DEBUG) {
  Confluence.Templates.InsertWiki.wikiMarkupDialog.soyTemplateName = 'Confluence.Templates.InsertWiki.wikiMarkupDialog';
}


Confluence.Templates.InsertWiki.wikiErrorSubDialog = function(opt_data, opt_ignored) {
  return '<p class=\'warning\'>' + soy.$$escapeHtml(opt_data.warningMessage) + '</p><p class=\'exception-report\'><span class=\'exceptionMessage\'>' + soy.$$escapeHtml(opt_data.exceptionMessage) + '</span></p>';
};
if (goog.DEBUG) {
  Confluence.Templates.InsertWiki.wikiErrorSubDialog.soyTemplateName = 'Confluence.Templates.InsertWiki.wikiErrorSubDialog';
}


Confluence.Templates.InsertWiki.wikiParserSelector = function(opt_data, opt_ignored) {
  var output = '<span class="wiki-parser-selector"><form action="#" method="post" id="d" class="aui"><select class="select medium-field" id="wiki-parser-selection-tool" name="wiki-parser-selection-tool" title="wiki parser selector"><option value="' + soy.$$escapeHtml(opt_data.DEFAULT.val) + '">' + soy.$$escapeHtml(opt_data.DEFAULT.label) + '</option>';
  var wikiLangList26 = soy.$$getMapKeys(opt_data.WIKI);
  var wikiLangListLen26 = wikiLangList26.length;
  for (var wikiLangIndex26 = 0; wikiLangIndex26 < wikiLangListLen26; wikiLangIndex26++) {
    var wikiLangData26 = wikiLangList26[wikiLangIndex26];
    output += (opt_data.WIKI[wikiLangData26].val != opt_data.DEFAULT.val) ? '<option value="' + soy.$$escapeHtml(opt_data.WIKI[wikiLangData26].val) + '">' + soy.$$escapeHtml(opt_data.WIKI[wikiLangData26].label) + '</option>' : '';
  }
  output += '</select></form></span>';
  return output;
};
if (goog.DEBUG) {
  Confluence.Templates.InsertWiki.wikiParserSelector.soyTemplateName = 'Confluence.Templates.InsertWiki.wikiParserSelector';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:page-editor-js', location = 'editor/page-editor.soy' */
// This file was automatically generated from page-editor.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.Editor.Page.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.Editor == 'undefined') { Confluence.Templates.Editor = {}; }
if (typeof Confluence.Templates.Editor.Page == 'undefined') { Confluence.Templates.Editor.Page = {}; }


Confluence.Templates.Editor.Page.saveButton = function(opt_data, opt_ignored) {
  return '<button id="rte-button-publish" class="aui-button aui-button-primary default-submit" type="submit" name="confirm" value="Save" title="' + Confluence.Templates.Editor.Page.saveButtonTitle(opt_data) + '" tabindex="101">' + Confluence.Templates.Editor.Page.saveButtonText(opt_data) + '</button>';
};
if (goog.DEBUG) {
  Confluence.Templates.Editor.Page.saveButton.soyTemplateName = 'Confluence.Templates.Editor.Page.saveButton';
}


Confluence.Templates.Editor.Page.saveButtonTitle = function(opt_data, opt_ignored) {
  return '' + ((opt_data.contentType == 'blogpost') ? soy.$$escapeHtml('Publish your blog post') : (opt_data.contentType == 'page') ? (opt_data.sharedDraftsEnabled) ? (opt_data.isNewPage) ? soy.$$escapeHtml('Publish changes') : soy.$$escapeHtml('Update published page') : soy.$$escapeHtml('Save your page') : soy.$$escapeHtml('Save'));
};
if (goog.DEBUG) {
  Confluence.Templates.Editor.Page.saveButtonTitle.soyTemplateName = 'Confluence.Templates.Editor.Page.saveButtonTitle';
}


Confluence.Templates.Editor.Page.saveButtonText = function(opt_data, opt_ignored) {
  return '' + ((opt_data.sharedDraftsEnabled && (opt_data.contentType == 'blogpost' || opt_data.contentType == 'page')) ? (opt_data.isNewPage) ? soy.$$escapeHtml('Publish') : soy.$$escapeHtml('Update') : (opt_data.contentType == 'blogpost') ? soy.$$escapeHtml('Publish') : soy.$$escapeHtml('Save'));
};
if (goog.DEBUG) {
  Confluence.Templates.Editor.Page.saveButtonText.soyTemplateName = 'Confluence.Templates.Editor.Page.saveButtonText';
}


Confluence.Templates.Editor.Page.cancelButton = function(opt_data, opt_ignored) {
  return '' + ((opt_data.sharedDraftsEnabled && (opt_data.contentType == 'page' || opt_data.contentType == 'blogpost')) ? '<ul class="aui-buttons rte-toolbar-group-done close"><button class="aui-button shared-drafts" type="submit" id="rte-button-cancel" name="cancel" value="cancel"><span class="icon aui-icon aui-icon-small aui-iconfont-close-dialog"></span></button></ul>' : '<button class="toolbar-item-link aui-button aui-button-link" type="submit" id="rte-button-cancel" name="cancel" value="cancel"><span class="trigger-text">' + ((opt_data.contentType == 'page' || opt_data.contentType == 'blogpost') ? soy.$$escapeHtml('Close') : soy.$$escapeHtml('Cancel')) + '</span></button>');
};
if (goog.DEBUG) {
  Confluence.Templates.Editor.Page.cancelButton.soyTemplateName = 'Confluence.Templates.Editor.Page.cancelButton';
}


Confluence.Templates.Editor.Page.quitDialogHeader = function(opt_data, opt_ignored) {
  var output = '';
  switch (opt_data.dialogType) {
    case 'exit':
      output += '<h2 class="aui-dialog2-header-main">' + soy.$$escapeHtml('Close the editor') + '</h2>';
      break;
    case 'publish':
      output += '<h2 class="aui-dialog2-header-main">' + soy.$$escapeHtml('Publish all changes?') + '</h2>';
      break;
    case 'diff':
      output += '<h2 class="aui-dialog2-header-main">' + soy.$$escapeHtml('Unpublished changes') + '</h2>';
      break;
  }
  output += '<a class="aui-dialog2-header-close"><span class="aui-icon aui-icon-small aui-iconfont-close-dialog">' + soy.$$escapeHtml('Close') + '</span></a>';
  return output;
};
if (goog.DEBUG) {
  Confluence.Templates.Editor.Page.quitDialogHeader.soyTemplateName = 'Confluence.Templates.Editor.Page.quitDialogHeader';
}


Confluence.Templates.Editor.Page.quitDialogContent = function(opt_data, opt_ignored) {
  var output = '';
  switch (opt_data.dialogType) {
    case 'exit':
      output += (opt_data.contributors.length == 0) ? soy.$$filterNoAutoescape('\x3cp\x3eYou\x27ve made changes that haven\x27t been published yet.\x3c/p\x3e\x3cp\x3eIf you discard changes, your unpublished changes will be deleted. You can\x27t undo this action.\x3c/p\x3e') : soy.$$filterNoAutoescape('\x3cp\x3eThere are changes made by you and other people that haven\x27t been published yet.\x3c/p\x3e\x3cp\x3eIf you discard changes, you\x27ll delete changes made by the following people, and revert to the last published version of this page. They won\x27t be able to recover their work if you do this.\x3c/p\x3e \x3cp\x3eThese people have made changes:\x3c/p\x3e') + Confluence.Templates.Editor.Page.contributorList(opt_data);
      break;
    case 'publish':
      output += soy.$$filterNoAutoescape('\x3cp\x3eThere are changes made by you and other people that haven\x27t been published yet.\x3c/p\x3e\x3cp\x3eThese people have made changes:\x3c/p\x3e') + Confluence.Templates.Editor.Page.contributorList(opt_data);
      break;
    case 'diff':
      output += '<div><div class="legend"><span class="legend-title">' + soy.$$escapeHtml('Key') + ': </span><span class="diff-html-added">' + soy.$$escapeHtml('This line was added.') + '</span><span class="diff-html-removed">' + soy.$$escapeHtml('This line was removed.') + '</span><span class="diff-html-changed">' + soy.$$escapeHtml('Formatting was changed.') + '</span></div><hr/><div class="wiki-content"></div></div>';
      break;
  }
  return output;
};
if (goog.DEBUG) {
  Confluence.Templates.Editor.Page.quitDialogContent.soyTemplateName = 'Confluence.Templates.Editor.Page.quitDialogContent';
}


Confluence.Templates.Editor.Page.hiddenInputCancel = function(opt_data, opt_ignored) {
  return '<input type="hidden" name="cancel" value="cancel">';
};
if (goog.DEBUG) {
  Confluence.Templates.Editor.Page.hiddenInputCancel.soyTemplateName = 'Confluence.Templates.Editor.Page.hiddenInputCancel';
}


Confluence.Templates.Editor.Page.contributorList = function(opt_data, opt_ignored) {
  var output = '<ul class="contributor-list">';
  var contributorList102 = opt_data.contributors;
  var contributorListLen102 = contributorList102.length;
  for (var contributorIndex102 = 0; contributorIndex102 < contributorListLen102; contributorIndex102++) {
    var contributorData102 = contributorList102[contributorIndex102];
    output += '<li><div class="contributor-avatar"><img src="' + soy.$$escapeHtml(contributorData102.avatarURL) + '"></div><div class="contributor-name"><span>' + soy.$$escapeHtml(contributorData102.fullname) + '</span></div></li>';
  }
  output += '</ul>';
  return output;
};
if (goog.DEBUG) {
  Confluence.Templates.Editor.Page.contributorList.soyTemplateName = 'Confluence.Templates.Editor.Page.contributorList';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:page-editor-js', location = 'insert-image-dialog/insert-image-dialog.js' */
define("confluence-editor/insert-image-dialog/insert-image-dialog","jquery ajs underscore confluence-link-browser/link-object confluence-link-browser/link-adapter confluence/legacy-editor-global-AVOID-IF-POSSIBLE".split(" "),function(c,f,i,j,k,g){var e={beforeShowListeners:[],panelComponent:[],sizeToFit:function(){this.each(function(){var a=this,b=c(this).parent(),d=b.height();b.children().each(function(){this!==a&&c(this).is(":visible")&&(d=d-c(this).outerHeight())});b=c(this).outerHeight()-c(this).height();
c(this).css("height",Math.max(0,d-b)+"px")});return this},defaultInsertImageDialog:function(){f.Rte.BookmarkManager.storeBookmark();e.insertImageDialog(function(a){var b=require("tinymce");f.Rte.BookmarkManager.restoreBookmark();var d={};if(a.url){d={url:a.url,filename:a.url,contentId:a.contentId};b.confluence.ImageUtils.insertFromProperties(d)}else{var h=true,g=a.selectItems.length>1;i.each(a.selectItems,function(a){if(a.isImage()){d={filename:a.getFileName(),contentId:a.get("ownerId")};b.confluence.ImageUtils.insertFromProperties(d,
g)}else{h=false;f.MacroBrowser.getMacroMetadata("view-file")?e._insertFilePlaceholderToEditor(a):e._insertLinkToEditor(a)}});require(["conf/confluence-drag-and-drop/analytics/files-upload-analytics"],function(b){b.triggerEvent("confluence.insert-files-dialog.insert",a.selectItems,h)})}c("#comments-section").length&&f.Rte.fixEditorFocus()},function(){f.Rte.BookmarkManager.restoreBookmark()})},findPanelComponentById:function(a){for(var b=g.ImageDialog.panelComponent,d=0,c=b.length;d<c;d++)if(b[d].id==
a)return b[d]},insertImageDialog:function(a,b){var d=new g.FileDialog.FileDialogView({submitCallback:a,cancelCallback:b,beforeShowListeners:e.beforeShowListeners,panelComponents:e.panelComponent});d.render();return d},_insertLinkToEditor:function(a){var b=j.fromREST(a.attributes);b.attrs["data-linked-resource-container-id"]=a.get("ownerId");b.attrs.href=a.get("downloadUrl");k.setLink(b)},_insertFilePlaceholderToEditor:function(a){var b={name:a.get("fileName"),page:a.get("parentTitle"),space:a.get("space")?
a.get("space").key:"",date:a.get("datePath"),ownerId:a.get("ownerId")};require(["confluence-editor/utils/attachments-insert-utils"],function(a){a.insertFilePlaceholder(b)})}};return e});
require("confluence/module-exporter").safeRequire("confluence-editor/insert-image-dialog/insert-image-dialog",function(c){require("jquery").fn.sizeToFit=c.sizeToFit;Confluence.Editor.ImageDialog=c;Confluence.Editor.defaultInsertImageDialog=c.defaultInsertImageDialog;Confluence.Editor.ImageDialog.findPanelComponentById=c.findPanelComponentById;Confluence.Editor.insertImageDialog=c.insertImageDialog;Confluence.Editor.ImageDialog._insertLinkToEditor=c._insertLinkToEditor;Confluence.Editor.ImageDialog._insertFilePlaceholderToEditor=
c._insertFilePlaceholderToEditor});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:page-editor-js', location = 'panel-components/panel-components-init.js' */
define("confluence-editor/panel-components/panel-components-init",["confluence/legacy-editor-global-AVOID-IF-POSSIBLE","ajs"],function(a,d){return function(){if(a&&a.ImageDialog&&a.ImageDialog.panelComponent){var b=a.FileDialog.eventListener,e=a.FileDialog.ExternalPanelView,f=a.FileDialog.SearchPanelView,g=a.FileDialog.AttachmentsPanelView,c=a.ImageDialog.panelComponent;"template"!==d.Meta.get("content-type")&&(b=new g({eventListener:b}),c.push(b));c.push(new e);c.push(new f)}}});
require("confluence/module-exporter").safeRequire("confluence-editor/panel-components/panel-components-init",function(a){require("ajs").toInit(a)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:page-editor-js', location = 'drafts/page-editor-drafts.js' */
define("confluence-editor/page-editor-drafts","jquery ajs confluence/meta confluence/api/constants confluence-editor/editor/page-editor-message confluence/analytics-support confluence/legacy-editor-global-AVOID-IF-POSSIBLE".split(" "),function(f,b,e,n,p,l,a){var o=false,m=false,i=false,q=e.get("remote-user")!=="",r=b.DarkFeatures.isEnabled("editor.ajax.save")&&!b.DarkFeatures.isEnabled("editor.ajax.save.disable"),h=function(b,c,a){f("<input>").attr({type:"hidden",name:b,value:c}).appendTo(a)},k=function(){return e.getBoolean("shared-drafts")};
b.bind("editor-shared-drafts-published editor-shared-drafts-discarded",function(){m=o=false});return{isDraftSaved:function(){return o},isDraftManuallySaved:function(){return m},isDraftBlank:function(){return b.Rte.Content.isEmpty()&&!f.trim(a.getCurrentTitle())},isNewContent:function(){return b.Rte.getEditor()&&e.getBoolean("new-page")===true},isDraftDirty:function(){return a.hasContentChanged()||a.Drafts.isDraftSaved()&&!a.Drafts.isDraftManuallySaved()},unloadMessage:function(d){if(d&&(d.srcElement&&
d.srcElement.activeElement instanceof HTMLIFrameElement)&&(e.get("content-type")==="page"||e.get("content-type")==="blogpost")){f("#rte-button-overwrite").length&&l.publish("confluence.editor.legacy.draft.conflict",{action:"closeWindow"});l.publish("confluence.editor.close",{source:"closeWindow"})}d=function(){a.Drafts.isDraftBlank()&&!k()?a.Drafts.discardDraft(e.get("draft-id")):a.Drafts.save({skipErrorHandler:true})};if(typeof seleniumAlert!=="undefined")d();else if(a.isLimitedModeEnabled()||!k()){if(a.Drafts.isDraftDirty()){d();
return "A draft will be saved. You can resume editing this draft the next time you open the editor or view all your drafts in your profile."}}else{d();if(i)return "We haven\'t finished saving your changes. If you leave before seeing the \'Draft saved\' message, you might lose your changes."}},hasPendingChanges:function(){return i},isSharedDraftsEnabled:k,bindUnloadMessage:function(){if(!a.isLimitedModeEnabled()&&k()){b.bind("synchrony.entity.ack",function(b,a){a.pendingChanges||(i=false)});b.bind("editor.local.change",function(){i=true})}f(window).bind("beforeunload",a.Drafts.unloadMessage)},unBindUnloadMessage:function(){f(window).unbind("beforeunload")},useDraft:function(){var d=
e.get("existing-draft-id");a.Drafts.unBindUnloadMessage();var c=a.getCurrentForm();h("useDraft","true",c);h("contentChanged",""+a.hasContentChanged(),c);h("pageId",b.params.pageId,c);f("#draftId",a.getCurrentForm()).val(d);c.spaceKey||h("spaceKey",e.get("space-key"),c);c.action=n.CONTEXT_PATH+"/pages/"+(b.params.newPage?"create":"edit")+b.params.draftType+".action";c.submit()},discardDraft:function(a){return b.safe.ajax({url:n.CONTEXT_PATH+"/json/deletedraft.action",type:"GET",dataType:"json",data:{draftId:a},
success:function(a){if(a.actionErrors){for(var d=["<ul>"],a=a.actionErrors,e=0;e<a.length;e++){b.log("error: "+a[e]);d.push("<li>"+a[e]+"</li>")}d.push("</ul>");b.messages.error("#editor-messages",{title:"Error",body:"There were errors discarding your draft: "+d.join("\n")})}else{f("#draft-messages").remove();b.messages.success("#editor-messages",{body:"Your draft has been discarded."})}},error:function(a){b.messages.error({title:"Error",body:a.errors||"An unknown error has occurred. Please check your logs."})}})},
save:function(d){d=d||{};if(a.isSubmitting||!a.hasContentChanged()&&!d.forceSave)b.debug("skipping draft save");else{b.debug("preparing to save editor draft");var c=f("#content-title"),i=f("#newSpaceKey"),h=f("#originalVersion"),l=a.inRichTextMode(),c={draftId:e.get("draft-id"),pageId:e.get("page-id"),type:b.params.draftType,syncRev:f("#syncRev").val(),title:c.hasClass("placeholded")?"":c.val(),spaceKey:i.length?i.val():encodeURIComponent(e.get("space-key")),content:b.Rte.getEditor().getContent()};
if(h.length)c.pageVersion=parseInt(h.val(),10);f.ajax({type:"POST",url:n.CONTEXT_PATH+"/rest/tinymce/1/drafts",data:f.toJSON(c),contentType:"application/json",dataType:"text json",success:function(c){if(c!=null&&(!(q&&c.draftId===0)||!r)){a.contentHasChangedSinceLastSave=false;l&&b.Rte.Content.editorResetContentChanged();o=true;m=!!d.manualSave;e.set("draft-id",c.draftId+"");f("#draftId",a.getCurrentForm()).val(c.draftId);f("#draft-error").remove();if(!e.get("collaborative-content")){var i=f("#draft-status"),
g;if(!(g=c.time)){var j=new Date;g=j.getHours();var j=j.getMinutes(),h=g>11?"PM":"AM";g=g%12;g=(g==0?"12":g)+":"+(j<10?"0":"")+j+" "+h}j=m?b.format("Draft saved at {0}",g):b.format("Draft autosaved at {0}",g);h=b.params.newPage?j:"<a id='view-diff-link-heartbeat' class='view-diff-link' href='#'>"+j+"</a>";i.attr("data-tooltip",j);i.html(h)}if(f.isFunction(d.onSuccessHandler))d.onSuccessHandler(c);a.Drafts.lastSaveTime=g;b.trigger("rte-draft-saved",{draftId:c.draftId})}},error:function(c,
e){var g=function(){a.addErrorMessage("draft-error",a.Drafts.lastSaveTime?b.format("Error saving draft. Last draft saved at {0}",a.Drafts.lastSaveTime):"Error saving draft. No draft has been saved.",true)};if(!d.skipErrorHandler&&!k()){c.status===400?c.responseText.indexOf("Legacy drafts deprecated")>=0?p.handleMessage("legacy-draft-deprecated",{type:"error",message:"Collaborative editing is here! That means we need a little help from you to restart your editing session. All you need to do is copy the content, edit this page again, then paste it in and save."}):g():g();if(f.isFunction(d.onErrorHandler))d.onErrorHandler(e)}},timeout:3E4})}}}});
require("confluence/module-exporter").exportModuleAsGlobal("confluence-editor/page-editor-drafts","Confluence.Editor.Drafts");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:page-editor-js', location = 'editor/page-editor-permissions.js' */
define("confluence-editor/editor/page-editor-permissions",["ajs","jquery"],function(b,d){var c={updateEditPageRestrictions:function(c,a,e,g){var f=d("#rte-button-restrictions"),i=f.find(".icon"),h="";c||a?(i.removeClass("aui-iconfont-locked aui-iconfont-unlocked icon-red").addClass(c?"aui-iconfont-locked icon-red":"aui-iconfont-unlocked icon-red"),h="Restrictions apply"):(i.removeClass("aui-iconfont-locked aui-iconfont-unlocked icon-red").addClass("aui-iconfont-unlocked"),h=e?
"Restrictions apply":"Unrestricted");f.attr("data-tooltip",h);f.data("explicit-restrictions",c);f.data("inherited-restrictions",a);f.data("restrictionsHash",g)},handleHeartbeat:function(j,a){if("undefined"!==typeof a.restrictionsHash){var e=d("#rte-button-restrictions");if(e.data("restrictionsHash")!==a.restrictionsHash)if(d("#update-page-restrictions-dialog").is(":visible")&&b.PagePermissions.updateRestrictionsDialog)b.PagePermissions.updateRestrictionsDialog(),
e.data("restrictionsHash",a.restrictionsHash);else{var g=""!==a.restrictionsHash,f=a.hasViewRestrictions,e=!!e.data("inherited-restrictions");c.updateEditPageRestrictions(f,e,g,a.restrictionsHash)}}},init:function(){b.bind("editor-heartbeat",c.handleHeartbeat);b.bind("edit-page-restrictions-updated",function(b,a){c.updateEditPageRestrictions(a.hasExplicitRestrictions,a.hasInheritedRestrictions,a.hasAnyExplicitRestrictions,a.restrictionsHash)})}};return c});
require("confluence/module-exporter").safeRequire("confluence-editor/editor/page-editor-permissions",function(b){var d=require("ajs"),c=require("jquery");d.PagePermissions=d.PagePermissions||{};c.extend(d.PagePermissions,{updateEditPageRestrictions:b.updateEditPageRestrictions});d.toInit(b.init)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.web.resources:draft-changes-js', location = 'includes/soy/draft-changes-dialog.soy' */
// This file was automatically generated from draft-changes-dialog.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.DraftChanges.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.DraftChanges == 'undefined') { Confluence.Templates.DraftChanges = {}; }


Confluence.Templates.DraftChanges.dialogContent = function(opt_data, opt_ignored) {
  return '<div id="draft-changes-dialog" class="hidden"><div id="diff-view" class="wiki-content"></div></div>';
};
if (goog.DEBUG) {
  Confluence.Templates.DraftChanges.dialogContent.soyTemplateName = 'Confluence.Templates.DraftChanges.dialogContent';
}


Confluence.Templates.DraftChanges.helpLink = function(opt_data, opt_ignored) {
  return '' + Confluence.Templates.Dialog.helpLink({href: "https://confluence.atlassian.com/display/ConfCloud/Drafts#viewchange"});
};
if (goog.DEBUG) {
  Confluence.Templates.DraftChanges.helpLink.soyTemplateName = 'Confluence.Templates.DraftChanges.helpLink';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.web.resources:draft-changes-js', location = 'includes/js/draft-changes.js' */
define("confluence/draft-changes","jquery ajs window confluence/templates confluence/analytics-support confluence/legacy-editor-global-AVOID-IF-POSSIBLE".split(" "),function(d,a,n,k,i,c){return{init:function(){var b,m=function(b){var c="Are you sure you want to discard these unpublished changes?",f=d("#draft-"+b);if(confirm(c)){var g;if(f.find(".discard-draft-link").data("discard-method")==="rest"){g=a.contextPath()+"/rest/api/content/"+b+"?status=draft";c="DELETE"}else{g=a.contextPath()+"/json/deletedraft.action";
c="GET"}a.safe.ajax({url:g,type:c,data:{draftId:b},contentType:"application/json",dataType:"json",success:function(b){if(b&&b.actionErrors){for(var d=["<ul>"],b=b.actionErrors,c=0;c<b.length;c++){a.log("error: "+b[c]);d.push("<li>"+b[c]+"</li>")}d.push("</ul>");a.messages.error("#errors",{title:"Error",body:"There were errors discarding your draft."+" "+d.join("\n")})}else{d=f.closest("table");b=d.closest(".drafts-container");f.remove();d.find("tbody tr").length===
0&&b.append('<span id="no-drafts-message">'+"No drafts found."+"</span>")}},error:function(b){a.messages.error({title:"There were errors discarding your draft.",body:b.errors||"An unknown error has occurred. Please check your logs."})}});return true}return false};d("body").on("click",".view-diff-link",function(o){var l=this.id,f=d(this);if(!b){var g=l==="view-diff-link-notification";b=new a.Dialog(860,530,"view-diff-draft-dialog");var e="Unpublished Changes for \'{0}\'";b.addHeader(e.replace(/\{0\}/,
""));e=d(k.DraftChanges.dialogContent());b.addPanel("Diff",e);if(g){b.addButton("Edit",function(){b.hide();c&&c.Drafts?c.Drafts.useDraft():n.location=d(this).attr("data-href")},"resume-diff-link");b.addButton("Discard",function(){if(a.DarkFeatures.isEnabled("editor.ajax.save")&&!a.DarkFeatures.isEnabled("editor.ajax.save.disable")&&a.Meta.get("remote-user")!==""){c.SafeSave.Draft.discardDraft(a.params.pageId,a.Meta.get("existing-draft-id")).done(c.SafeSave.Draft.onSuccessDiscardDraft).fail(c.SafeSave.Draft.onErrorDiscardDraft);
b.hide()}else if(c&&c.Drafts){b.hide();c.Drafts.discardDraft(a.Meta.get("existing-draft-id"));i.publish("rte.notification.draft.discard")}else{var p=d(this).data("draftid");m(p)&&b.hide()}},"discard-diff-link")}b.addCancel("Close",function(){b.hide();return false});e.removeClass("hidden")}b.addHeader("Loading");d("#diff-view").html("<tr><td id='draft-changes-waiting-icon'>Loading...</td></tr>");var j,e=f.attr("class"),h=/draftPageId:([^ ]*)/.exec(e),f=h?h[1]:
a.Meta.get("page-id"),g=(h=/username:([^ ]*)/.exec(e))?h[1]:a.Meta.get("remote-user");j=(h=/draftId:([^ ]*)/.exec(e))?h[1]:null;d.ajax({url:a.contextPath()+"/draftchanges/viewdraftchanges.action",type:"GET",dataType:"json",data:{pageId:f,username:g},success:function(c){if(c.actionErrors){for(var e="",c=c.actionErrors,f=0;f<c.length;f++){a.log("error: "+c[f]);e=e+"<div>"+c[f]+"</div>"}d("#diff-view").html(e)}else{d("#diff-view").html(c.htmlDiff);e=a.format("Unpublished Changes for \'\'{0}\'\'",a.escapeHtml(c.title));
b.addHeader(e);b.popup.element.find(".dialog-title").prepend(k.DraftChanges.helpLink());e=a.contextPath();d(".resume-diff-link").attr("data-href",e+"/pages/resumedraft.action?draftId="+j);d(".discard-diff-link").data("draftid",j);a.setVisible("#merge-warning",c.isMergeRequired)}},error:function(a){a=a.errors||"An unknown error has occurred. Please check your logs";d("#diff-view").html(a)}});b.show();a.trigger("analytics",{name:"confluence.editor.view-diff-dialog.open",data:{elementTriggerId:l}});
return a.stopEvent(o)});d(".drafts-by-space").on("click",".discard-draft-link",function(a){a.preventDefault();i.publish("confluence.draft-list.discard");a=d(this).data("draftid");m(a)}).on("click",".resume-draft-link",function(){i.publish("confluence.draft-list.resume")})}}});require("confluence/module-exporter").safeRequire("confluence/draft-changes",function(d){require("ajs").toInit(d.init)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.plugins.tinymce:atlassian-rte-javascript-tinymce-core', location = 'jscripts/atlassian-editor-build/atlassian-editor.js' */
(function(c){var h=/^\s*|\s*$/g,l="$1"==="B".replace(/A(.)|B/,"$1"),f={majorVersion:"3",minorVersion:"4.9-atlassian-11",releaseDate:"2012-03-06",_init:function(){function b(d){var i=/editor/.test(d);if(d&&/tiny_mce(|_gzip|_jquery|_prototype|_full)(_dev|_src)?.js/.test(d)||i){/_(src|dev)\.js/g.test(d)&&(a.suffix="_src");if(-1!=(g=d.indexOf("?")))a.query=d.substring(g+1);a.baseURL=i?d.substring(0,d.indexOf("/download/")):d.substring(0,d.lastIndexOf("/"));e&&(-1==a.baseURL.indexOf("://")&&0!==a.baseURL.indexOf("/"))&&
(a.baseURL=e+a.baseURL);i&&(a.baseURL+="/download/resources/com.atlassian.plugins.editor/tinymcesource");return a.baseURL}return null}var a=this,k=document,d=navigator,j=d.userAgent,e,g,n;a.isOpera=c.opera&&opera.buildNumber;a.isWebKit=/WebKit/.test(j);a.isChrome=a.isWebKit&&/Chrome/.test(j);a.isIE11=!!(-1!=j.indexOf("Trident/")&&(-1!=j.indexOf("rv:")||-1!=d.appName.indexOf("Netscape")));a.isIE=!a.isWebKit&&!a.isOpera&&/MSIE/gi.test(j)&&/Explorer/gi.test(d.appName);a.isIE=a.isIE&&/MSIE (\w+)\./.exec(j)[1];
a.isIE=a.isIE||a.isIE11;a.isIE6=a.isIE&&/MSIE [56]/.test(j);a.isIE7=a.isIE&&/MSIE [7]/.test(j);a.isIE8=a.isIE&&/MSIE [8]/.test(j);a.isIE9=a.isIE&&/MSIE [9]/.test(j);a.isIE10=a.isIE&&/MSIE \d\d/.test(j);a.isIE10up=a.isIE&&/MSIE \d\d/.test(j)||a.isIE11;a.isGecko=!a.isWebKit&&!a.isIE11&&/Gecko/.test(j);a.isMac=-1!=j.indexOf("Mac");a.isAir=/adobeair/i.test(j);a.isIDevice=/(iPad|iPhone)/.test(j);a.isIOS5=a.isIDevice&&534<=j.match(/AppleWebKit\/(\d*)/)[1];if(c.tinyMCEPreInit)a.suffix=tinyMCEPreInit.suffix,
a.baseURL=tinyMCEPreInit.base,a.query=tinyMCEPreInit.query;else{a.suffix="";j=k.getElementsByTagName("base");for(d=0;d<j.length;d++)if(n=j[d].href)/^https?:\/\/[^\/]+$/.test(n)&&(n+="/"),e=n?n.match(/.*\//)[0]:"";e||(d=document.location,e=d.protocol+"//"+d.hostname+(d.port?":"+d.port:""));if(d=AJS.Meta.get("rte.src.url"))b(d);else{j=k.getElementsByTagName("script");for(d=0;d<j.length;d++)if(b(j[d].src))return;if(k=k.getElementsByTagName("head")[0]){j=k.getElementsByTagName("script");for(d=0;d<j.length&&
!b(j[d].src);d++);}}}},is:function(b,a){return!a?void 0!==b:"array"==a&&b.hasOwnProperty&&b instanceof Array?!0:typeof b==a},makeMap:function(b,a,k){b=b||[];"string"==typeof b&&(b=b.split(a||","));k=k||{};for(a=b.length;a--;)k[b[a]]={};return k},each:function(b,a,k){var d,j;if(!b)return 0;k=k||b;if(void 0!==b.length){d=0;for(j=b.length;d<j;d++)if(!1===a.call(k,b[d],d,b))return 0}else for(d in b)if(b.hasOwnProperty(d)&&!1===a.call(k,b[d],d,b))return 0;return 1},map:function(b,a){var k=[];f.each(b,
function(d){k.push(a(d))});return k},grep:function(b,a){var k=[];f.each(b,function(d){(!a||a(d))&&k.push(d)});return k},inArray:function(b,a){var k,d;if(b){k=0;for(d=b.length;k<d;k++)if(b[k]===a)return k}return-1},extend:function(b,a){var k,d,j=arguments;k=1;for(d=j.length;k<d;k++)a=j[k],f.each(a,function(a,g){void 0!==a&&(b[g]=a)});return b},trim:function(b){return(b?""+b:"").replace(h,"")},create:function(b,a,k){var d,j,e,g,n,c=0,b=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(b);e=b[3].match(/(^|\.)(\w+)$/i)[2];
j=this.createNS(b[3].replace(/\.\w+$/,""),k);if(!j[e])if("static"==b[2]){if(j[e]=a,this.onCreate)this.onCreate(b[2],b[3],j[e])}else if(a[e]||(a[e]=function(){},c=1),j[e]=a[e],this.extend(j[e].prototype,a),b[5]&&(d=this.resolve(b[5]).prototype,g=b[5].match(/\.(\w+)$/i)[1],n=j[e],j[e]=c?function(){return d[g].apply(this,arguments)}:function(){this.parent=d[g];return n.apply(this,arguments)},j[e].prototype[e]=j[e],this.each(d,function(a,g){j[e].prototype[g]=d[g]}),this.each(a,function(a,g){d[g]?j[e].prototype[g]=
function(){this.parent=d[g];return a.apply(this,arguments)}:g!=e&&(j[e].prototype[g]=a)})),this.each(a["static"],function(a,g){j[e][g]=a}),this.onCreate)this.onCreate(b[2],b[3],j[e].prototype)},walk:function(b,a,k,d){d=d||this;b&&(k&&(b=b[k]),f.each(b,function(b,e){if(!1===a.call(d,b,e,k))return!1;f.walk(b,a,k,d)}))},createNS:function(b,a){var k,d,a=a||c,b=b.split(".");for(k=0;k<b.length;k++)d=b[k],a[d]||(a[d]={}),a=a[d];return a},resolve:function(b,a){var k,d,a=a||c,b=b.split(".");k=0;for(d=b.length;k<
d&&!(a=a[b[k]],!a);k++);return a},addUnload:function(b,a){var k=this,b={func:b,scope:a||this};if(k.unloads)k.unloads.push(b);else{var d=function(){var a=k.unloads,g,b;if(a){for(b in a)(g=a[b])&&g.func&&g.func.call(g.scope,1);c.detachEvent?(c.detachEvent("onbeforeunload",j),c.detachEvent("onunload",d)):c.removeEventListener&&c.removeEventListener("unload",d,!1);k.unloads=w=d=0;c.CollectGarbage&&CollectGarbage()}},j=function(){var a=document;if("interactive"==a.readyState){var g=function(){a.detachEvent("onstop",
g);d&&d();a=0};a&&a.attachEvent("onstop",g);c.setTimeout(function(){a&&a.detachEvent("onstop",g)},0)}};c.attachEvent?(c.attachEvent("onunload",d),c.attachEvent("onbeforeunload",j)):c.addEventListener&&c.addEventListener("unload",d,!1);k.unloads=[b]}return b},removeUnload:function(b){var a=this.unloads,k=null;f.each(a,function(d,j){if(d&&d.func==b)return a.splice(j,1),k=b,!1});return k},explode:function(b,a){return b?f.map(b.split(a||","),f.trim):b},_addVer:function(b){var a;if(!this.query)return b;
a=(-1==b.indexOf("?")?"?":"&")+this.query;return-1==b.indexOf("#")?b+a:b.replace("#",a+"#")},_replace:function(b,a,k){return l?k.replace(b,function(){var d=a,b=arguments,e;for(e=0;e<b.length-2;e++)d=void 0===b[e]?d.replace(RegExp("\\$"+e,"g"),""):d.replace(RegExp("\\$"+e,"g"),b[e]);return d}):k.replace(b,a)}};f._init();c.tinyMCE=c.tinymce=f})(window);
tinymce.create("tinymce.util.Dispatcher",{scope:null,listeners:null,Dispatcher:function(c){this.scope=c||this;this.listeners=[]},add:function(c,h){this.listeners.push({cb:c,scope:h||this.scope});return c},addToTop:function(c,h){this.listeners.unshift({cb:c,scope:h||this.scope});return c},remove:function(c){var h=this.listeners,l=null;tinymce.each(h,function(f,b){if(c==f.cb)return l=c,h.splice(b,1),!1});return l},dispatch:function(){var c,h=arguments,l,f=this.listeners;for(l=0;l<f.length&&!(c=f[l],
c=c.cb.apply(c.scope,0<h.length?h:[c.scope]),!1===c);l++);return c}});
(function(){var c=tinymce.each;tinymce.create("tinymce.util.URI",{URI:function(h,l){var f=this,b,h=tinymce.trim(h),l=f.settings=l||{};if(/^([\w\-]+):([^\/]{2})/i.test(h)||/^\s*#/.test(h))f.source=h;else if(0===h.indexOf("/")&&0!==h.indexOf("//")&&(h=(l.base_uri?l.base_uri.protocol||"http":"http")+"://mce_host"+h),/^[\w-]*:?\/\//.test(h)||(b=l.base_uri?l.base_uri.path:(new tinymce.util.URI(location.href)).directory,h=(l.base_uri&&l.base_uri.protocol||"http")+"://mce_host"+f.toAbsPath(b,h)),h=h.replace(/@@/g,
"(mce_at)"),h=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(h),c("source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),function(a,b){var d=h[b];d&&(d=d.replace(/\(mce_at\)/g,"@@"));f[a]=d}),b=l.base_uri){f.protocol||(f.protocol=b.protocol);f.userInfo||(f.userInfo=b.userInfo);!f.port&&"mce_host"==
f.host&&(f.port=b.port);if(!f.host||"mce_host"==f.host)f.host=b.host;f.source=""}},setPath:function(c){c=/^(.*?)\/?(\w+)?$/.exec(c);this.path=c[0];this.directory=c[1];this.file=c[2];this.source="";this.getURI()},toRelative:function(c){var l;if("./"===c)return c;c=new tinymce.util.URI(c,{base_uri:this});if("mce_host"!=c.host&&this.host!=c.host&&c.host||this.port!=c.port||this.protocol!=c.protocol)return c.getURI();l=this.toRelPath(this.path,c.path);c.query&&(l+="?"+c.query);c.anchor&&(l+="#"+c.anchor);
return l},toAbsolute:function(c,l){c=new tinymce.util.URI(c,{base_uri:this});return c.getURI(this.host==c.host&&this.protocol==c.protocol?l:0)},toRelPath:function(c,l){var f,b=0,a="",k,d,c=c.substring(0,c.lastIndexOf("/")),c=c.split("/");f=l.split("/");if(c.length>=f.length){k=0;for(d=c.length;k<d;k++)if(k>=f.length||c[k]!=f[k]){b=k+1;break}}if(c.length<f.length){k=0;for(d=f.length;k<d;k++)if(k>=c.length||c[k]!=f[k]){b=k+1;break}}if(1==b)return l;k=0;for(d=c.length-(b-1);k<d;k++)a+="../";k=b-1;for(d=
f.length;k<d;k++)a=k!=b-1?a+("/"+f[k]):a+f[k];return a},toAbsPath:function(h,l){var f,b=0,a=[],k;k=/\/$/.test(l)?"/":"";h=h.split("/");l=l.split("/");c(h,function(d){d&&a.push(d)});h=a;f=l.length-1;for(a=[];0<=f;f--)0==l[f].length||"."==l[f]||(".."==l[f]?b++:0<b?b--:a.push(l[f]));f=h.length-b;f=0>=f?a.reverse().join("/"):h.slice(0,f).join("/")+"/"+a.reverse().join("/");0!==f.indexOf("/")&&(f="/"+f);k&&f.lastIndexOf("/")!==f.length-1&&(f+=k);return f},getURI:function(c){var l;if(!this.source||c)l=
"",c||(this.protocol&&(l+=this.protocol+"://"),this.userInfo&&(l+=this.userInfo+"@"),this.host&&(l+=this.host),this.port&&(l+=":"+this.port)),this.path&&(l+=this.path),this.query&&(l+="?"+this.query),this.anchor&&(l+="#"+this.anchor),this.source=l;return this.source}})})();
(function(){var c=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(h){var h=this.get(h),l;h&&c(h.split("&"),function(c){c=c.split("=");l=l||{};l[unescape(c[0])]=unescape(c[1])});return l},setHash:function(h,l,f,b,a,k){var d="";c(l,function(a,e){d+=(!d?"":"&")+escape(e)+"="+escape(a)});this.set(h,d,f,b,a,k)},get:function(c){var l=document.cookie,f=c+"=",b;if(l){b=l.indexOf("; "+f);if(-1==b){if(b=l.indexOf(f),0!=b)return null}else b+=2;c=l.indexOf(";",b);-1==c&&(c=l.length);
return unescape(l.substring(b+f.length,c))}},set:function(c,l,f,b,a,k){document.cookie=c+"="+escape(l)+(f?"; expires="+f.toGMTString():"")+(b?"; path="+escape(b):"")+(a?"; domain="+a:"")+(k?"; secure":"")},remove:function(c,l){var f=new Date;f.setTime(f.getTime()-1E3);this.set(c,"",f,l,f)}})})();
(function(){function c(h,l){var f,b,a,l=l||'"';if(null==h)return"null";a=typeof h;if("string"==a)return b="\bb\tt\nn\ff\rr\"\"''\\\\",l+h.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(a,d){if('"'===l&&"'"===a)return a;f=b.indexOf(d);if(f+1)return"\\"+b.charAt(f+1);a=d.charCodeAt().toString(16);return"\\u"+"0000".substring(a.length)+a})+l;if("object"==a){if(h.hasOwnProperty&&h instanceof Array){f=0;for(b="[";f<h.length;f++)b+=(0<f?",":"")+c(h[f],l);return b+"]"}b="{";for(f in h)h.hasOwnProperty(f)&&
(b+="function"!=typeof h[f]?(1<b.length?","+l:l)+f+l+":"+c(h[f],l):"");return b+"}"}return""+h}tinymce.util.JSON={serialize:c,parse:function(c){try{return eval("("+c+")")}catch(l){}}}})();
tinymce.create("static tinymce.util.XHR",{send:function(c){function h(a){l=0;try{l=new ActiveXObject(a)}catch(d){}return l}var l,f=window,b=0;c.scope=c.scope||this;c.success_scope=c.success_scope||c.scope;c.error_scope=c.error_scope||c.scope;c.async=!1===c.async?!1:!0;c.data=c.data||"";if(l=f.XMLHttpRequest?new XMLHttpRequest:h("Microsoft.XMLHTTP")||h("Msxml2.XMLHTTP")){l.overrideMimeType&&l.overrideMimeType(c.content_type);l.open(c.type||(c.data?"POST":"GET"),c.url,c.async);c.content_type&&l.setRequestHeader("Content-Type",
c.content_type);l.setRequestHeader("X-Requested-With","XMLHttpRequest");l.send(c.data);var a=function(){!c.async||4==l.readyState||1E4<b++?(c.success&&1E4>b&&200==l.status?c.success.call(c.success_scope,""+l.responseText,l,c):c.error&&c.error.call(c.error_scope,1E4<b?"TIMED_OUT":"GENERAL",l,c),l=null):f.setTimeout(a,10)};if(!c.async)return a();f.setTimeout(a,10)}}});
(function(){var c=tinymce.extend,h=tinymce.util.JSON,l=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(f){this.settings=c({},f);this.count=0},send:function(f){var b=f.error,a=f.success,f=c(this.settings,f);f.success=function(k,d){k=h.parse(k);"undefined"==typeof k&&(k={error:"JSON Parse error."});k.error?b.call(f.error_scope||f.scope,k.error,d):a.call(f.success_scope||f.scope,k.result)};f.error=function(a,d){b&&b.call(f.error_scope||f.scope,a,d)};f.data=h.serialize({id:f.id||
"c"+this.count++,method:f.method,params:f.params});f.content_type="application/json";l.send(f)},"static":{sendRPC:function(c){return(new tinymce.util.JSONRequest).send(c)}}})})();(function(c){c.VK={DELETE:46,BACKSPACE:8,ENTER:13,TAB:9,SPACEBAR:32,UP:38,DOWN:40,modifierPressed:function(c){return c.shiftKey||c.ctrlKey||c.altKey}}})(tinymce);
(function(c){function h(a){function g(g){var d=a.dom.create("body"),g=g.cloneContents();d.appendChild(g);return a.selection.serializer.serialize(d,{format:"html"})}a.onKeyDown.addToTop(function(b,k){var i=k.keyCode;if(i==j||i==d){var i=b.selection.getRng(!0),m;if(m=!i.collapsed)i=g(i),m=a.dom.createRng(),m.selectNode(a.getBody()),m=g(m),m=i===m;m&&(b.setContent("",{format:"raw"}),b.nodeChanged(),k.preventDefault())}})}function l(a){a.onKeyDown.add(function(a,e){if(e.keyCode===d&&a.selection.isCollapsed()&&
0===a.selection.getRng(!0).startOffset){var b=a.selection.getNode().previousSibling;b&&(b.nodeName&&"hr"===b.nodeName.toLowerCase())&&(a.dom.remove(b),c.dom.Event.cancel(e))}})}function f(a){function g(a,e,g){var b=/^&nbsp;$|^<br>$/,g=g||e,g=g.parentNode?g.parentNode.childNodes||[]:[],d=!0,n=/TABLE|TH|TD/;return(d=(d=(d=!n.test(e.nodeName))&&e.previousSibling?!n.test(e.previousSibling.nodeName):d)&&e.nextSibling?!n.test(e.nextSibling.nodeName):d)&&(b.test(a)||1<g.length&&"BR"==g[0].nodeName)}function b(a){return a&&
a.innerHTML&&(a.innerHTML.replace(/\uFEFF|\u200B/g,"")||"&nbsp;")}a.onKeyDown.add(function(a,e){var m=a.selection.getNode(),k=m.nextSibling,o;if(a.selection.isCollapsed()&&m!=a.dom.getRoot())if(e.keyCode===d)0===a.selection.getRng(!0).startOffset&&(k=m.previousSibling,o=b(k),k&&g(o,m,k)&&(a.dom.remove(k),c.dom.Event.cancel(e)));else if(e.keyCode==j&&(o=b(m),!(1>=(m.parentNode?m.parentNode.childNodes||[]:[]).length||1<m.childNodes.length)&&k&&g(o,m,k)))a.dom.remove(m),c.dom.Event.cancel(e),m=a.selection,
o=m.getRng(!0),a.focus(),k.focus(),o.setStart(k,0),o.setEnd(k,0),m.setRng(o)})}function b(a){a.onClick.add(function(a,e){e=e.target;/^(IMG|HR)$/.test(e.nodeName)&&a.selection.getSel().setBaseAndExtent(e,0,e,1);"A"==e.nodeName&&a.dom.hasClass(e,"mceItemAnchor")&&a.selection.select(e);a.nodeChanged()})}function b(a){a.onClick.add(function(a,e){e=e.target;/^(IMG|HR)$/.test(e.nodeName)&&a.selection.getSel().setBaseAndExtent(e,0,e,1);"A"==e.nodeName&&a.dom.hasClass(e,"mceItemAnchor")&&a.selection.select(e);
a.nodeChanged()})}function a(){document.body.setAttribute("role","application")}function a(){document.body.setAttribute("role","application")}var k=c.VK,d=k.BACKSPACE,j=k.DELETE;c.create("tinymce.util.Quirks",{Quirks:function(e){if(c.isWebKit){if(c.isChrome){var g=function(a,e){"[object Array]"===toString.call(a)?c.each(a,function(a){a?n.setAttrib(n.select(".non-editable",a),"contenteditable",e):n.setAttrib(c.DOM.select(".non-editable"),"contenteditable",e)}):n.setAttrib(n.select(".non-editable",
a),"contenteditable",e)},n=e.dom,u=e.selection;e.onKeyDown.add(function(a,e){var i,b,m,f=function(){var a=[],e=!1;c.each(b,function(g){g?a=a.concat(n.select("span",g)):e||(a=a.concat(c.DOM.select("span")),e=!0)});return a};if(((m=e.keyCode==j)||e.keyCode==d)&&!k.modifierPressed(e)){e.preventDefault();i=u.getRng();var l;l=n.getParent(i.startContainer,n.isBlock);b=m?[l,n.getNext(l,n.isBlock)]:[n.getPrev(l,n.isBlock),l];c.each(f(),function(a){a.setAttribute("data-mce-mark","1")});(i=!m&&b[1]&&AJS.EditorUtils.isCursorAtStartOf(b[1],
i)||m&&b[0]&&AJS.EditorUtils.isCursorAtEndOf(b[0],i))&&g(b[1],!0);a.getDoc().execCommand(m?"ForwardDelete":"Delete",!1,null);i&&g(b,!1);c.each(f(),function(a){a.getAttribute("data-mce-mark")?a.removeAttribute("data-mce-mark"):a.style.color?n.setAttrib(a,"style","color: "+a.style.color):n.remove(a,!0)})}})}h(e);e.dom.bind(e.getDoc(),"focusin",function(){setTimeout(function(){e&&!e.destroyed&&e.selection.setRng(e.selection.getRng())},0)});b(e);if(c.isIDevice){var i,m;e.dom.bind(e.getDoc(),"selectionchange",
function(){m&&(clearTimeout(m),m=0);m=window.setTimeout(function(){var a=e.selection.getRng();if(!i||!c.dom.RangeUtils.compareRanges(a,i)){e.nodeChanged();i=a}},50)})}f(e)}c.isIE&&(l(e),h(e),a(e),e.onKeyDown.add(function(a,e){var g;if(g=e.keyCode===k.ENTER)if(g=!k.modifierPressed(e))g=a.selection.getNode(),g=a.dom.is(g,"h1,h2,h3,h4,h5,h6")||null!==a.dom.getParent(g,"h1,h2,h3,h4,h5,h6");g&&setTimeout(function(){var e=a.selection.getNode();a.dom.is(e,"p")&&(a.dom.setAttrib(e,"style",null),a.execCommand("mceCleanup"))},
0)}),f(e));c.isGecko&&(l(e),f(e),Range.prototype.getClientRects||e.onMouseDown.add(function(a,e){if(e.target.nodeName==="HTML"){var g=a.getBody();g.blur();setTimeout(function(){g.focus()},0)}}))}})})(tinymce);
(function(c){function h(a,e){var b,i,m,d={};if(a){a=a.split(",");e=e||10;for(b=0;b<a.length;b+=2)i=String.fromCharCode(parseInt(a[b],e)),f[i]||(m="&"+a[b+1]+";",d[i]=m,d[m]=i);return d}}var l,f,b,a=/[&<>\"\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,k=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,d=/[<>&\"\']/g,j=/&(#x|#)?([\w]+);/g,e={128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",
148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"};f={'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;","&":"&amp;"};b={"&lt;":"<","&gt;":">","&amp;":"&","&quot;":'"',"&apos;":"'"};l=h("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",
32);c.html=c.html||{};c.html.Entities={encodeRaw:function(e,b){return e.replace(b?a:k,function(a){return f[a]||a})},encodeAllRaw:function(a){return(""+a).replace(d,function(a){return f[a]||a})},encodeNumeric:function(e,b){return e.replace(b?a:k,function(a){return 1<a.length?"&#"+(1024*(a.charCodeAt(0)-55296)+(a.charCodeAt(1)-56320)+65536)+";":f[a]||"&#"+a.charCodeAt(0)+";"})},encodeNamed:function(e,b,d){d=d||l;return e.replace(b?a:k,function(a){return f[a]||d[a]||a})},getEncodeFunc:function(e,b){function d(e,
g){return e.replace(g?a:k,function(a){return f[a]||b[a]||"&#"+a.charCodeAt(0)+";"||a})}function i(a,e){return m.encodeNamed(a,e,b)}var m=c.html.Entities,b=h(b)||l,e=c.makeMap(e.replace(/\+/g,","));return e.named&&e.numeric?d:e.named?b?i:m.encodeNamed:e.numeric?m.encodeNumeric:m.encodeRaw},decode:function(a){return a.replace(j,function(a,g,i){if(g)return i=parseInt(i,2===g.length?16:10),65535<i?(i-=65536,String.fromCharCode(55296+(i>>10),56320+(i&1023))):e[i]||String.fromCharCode(i);if(!(g=b[a]))if(!(g=
l[a]))g=document.createElement("div"),g.innerHTML=a,g=g.textContent||g.innerText||a;return g})}}})(tinymce);
tinymce.html.Styles=function(c,h){function l(a,e,b,i){function d(a){a=parseInt(a).toString(16);return 1<a.length?a:"0"+a}return"#"+d(e)+d(b)+d(i)}var f=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,b=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,a=/\s*([^:]+):\s*([^;]+);?/g,k=/\s+$/,d,j={},e,c=c||{};e="\\\" \\' \\; \\: ; : ﻿".split(" ");for(d=0;d<e.length;d++)j[e[d]]="﻿"+d,j["﻿"+d]=e[d];return{toHex:function(a){return a.replace(f,
l)},parse:function(e){function d(a,e){var g,i;if(g=h[a+"-top"+e])i=h[a+"-right"+e],g==i&&(g=h[a+"-bottom"+e],i==g&&(i=h[a+"-left"+e],g==i&&(h[a+e]=i,delete h[a+"-top"+e],delete h[a+"-right"+e],delete h[a+"-bottom"+e],delete h[a+"-left"+e])))}function u(a){var e=h[a],g;if(e&&!(0>e.indexOf(" "))){e=e.split(" ");for(g=e.length;g--;)if(e[g]!==e[0])return!1;h[a]=e[0];return!0}}function i(a){A=!0;return j[a]}function m(a,e){A&&(a=a.replace(/\uFEFF[0-9]/g,function(a){return j[a]}));e||(a=a.replace(/\\([\'\";:])/g,
"$1"));return a}var h={},o,s,p,A,y=c.url_converter,x=c.url_converter_scope||this;if(e){for(e=e.replace(/\\[\"\';:\uFEFF]/g,i).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(a){return a.replace(/[;:]/g,i)});o=a.exec(e);){s=o[1].replace(k,"").toLowerCase();p=o[2].replace(k,"");if(s&&0<p.length){if("font-weight"===s&&"700"===p)p="bold";else if("color"===s||"background-color"===s)p=p.toLowerCase();p=p.replace(f,l);p=p.replace(b,function(a,e,g,i,b,d){if(b=b||d)return b=m(b),"'"+b.replace(/\'/g,"\\'")+"'";e=
m(e||g||i);y&&(e=y.call(x,e,"style"));return"url('"+e.replace(/\'/g,"\\'")+"')"});h[s]=A?m(p,!0):p}a.lastIndex=o.index+o[0].length}d("border","");d("border","-width");d("border","-color");d("border","-style");d("padding","");d("margin","");u("border-width")&&(u("border-style")&&u("border-color"))&&(h.border=h["border-width"]+" "+h["border-style"]+" "+h["border-color"],delete h["border-width"],delete h["border-style"],delete h["border-color"]);"medium none"===h.border&&delete h.border}return h},serialize:function(a,
e){function b(e){var d,m,k,c;if(d=h.styles[e]){m=0;for(k=d.length;m<k;m++)e=d[m],c=a[e],void 0!==c&&0<c.length&&(i+=(0<i.length?" ":"")+e+": "+c+";")}}var i="",d,k;if(e&&h&&h.styles)b("*"),b(e);else for(d in a)k=a[d],void 0!==k&&0<k.length&&(i+=(0<i.length?" ":"")+d+": "+k+";");return i}}};
(function(c){function h(a,e){return a.split(e||",")}var l={},f,b,a,k,d={},j,e,g=c.makeMap,n=c.each;b="h1,h2,h3,h4,h5,h6,hr,p,div,address,pre,form,table,tbody,thead,tfoot,th,tr,td,li,ol,ul,caption,blockquote,center,dl,dt,dd,dir,fieldset,noscript,menu,isindex,samp,header,footer,article,section,hgroup";b=g(b,",",g(b.toUpperCase()));var u={Z:"H|K|N|O|P",Y:"X|form|R|Q",ZG:"E|span|width|align|char|charoff|valign",X:"p|T|div|U|W|isindex|fieldset|table",ZF:"E|align|char|charoff|valign",W:"pre|hr|blockquote|address|center|noframes",
ZE:"abbr|axis|headers|scope|rowspan|colspan|align|char|charoff|valign|nowrap|bgcolor|width|height",ZD:"[E][S]",U:"ul|ol|dl|menu|dir",ZC:"p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q",T:"h1|h2|h3|h4|h5|h6",ZB:"X|S|Q",S:"R|P",ZA:"a|G|J|M|O|P",R:"a|H|K|N|O",Q:"noscript|P",P:"ins|del|script",O:"input|select|textarea|label|button",N:"M|L",M:"em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym",L:"sub|sup",K:"J|I",J:"tt|i|b|u|s|strike",I:"big|small|font|basefont",H:"G|F",G:"br|span|bdo",F:"object|applet|img|map|iframe",
E:"A|B|C",D:"accesskey|tabindex|onfocus|onblur",C:"onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup",B:"lang|xml:lang|dir",A:"id|class|style|title"},i=function(a){return a.replace(/[A-Z]+/g,function(a){return i(u[a])})},m,q={};for(m in u)u.hasOwnProperty(m)&&(u[m]=i(u[m]));i("script[id|charset|type|language|src|defer|xml:space][]style[B|id|type|media|title|xml:space][]object[E|declare|classid|codebase|data|type|codetype|archive|standby|width|height|usemap|name|tabindex|align|border|hspace|vspace][#|param|Y]param[id|name|value|valuetype|type][]p[E|align][#|S]a[E|D|charset|type|name|href|hreflang|rel|rev|shape|coords|target][#|Z]br[A|clear][]span[E][#|S]bdo[A|C|B][#|S]applet[A|codebase|archive|code|object|alt|name|width|height|align|hspace|vspace][#|param|Y]h1[E|align][#|S]img[E|src|alt|name|longdesc|width|height|usemap|ismap|align|border|hspace|vspace][]map[B|C|A|name][X|form|Q|area]h2[E|align][#|S]iframe[A|longdesc|name|src|frameborder|marginwidth|marginheight|scrolling|align|width|height][#|Y]h3[E|align][#|S]tt[E][#|S]i[E][#|S]b[E][#|S]u[E][#|S]s[E][#|S]strike[E][#|S]big[E][#|S]small[E][#|S]font[A|B|size|color|face][#|S]basefont[id|size|color|face][]em[E][#|S]strong[E][#|S]dfn[E][#|S]code[E][#|S]q[E|cite][#|S]samp[E][#|S]kbd[E][#|S]var[E][#|S]cite[E][#|S]abbr[E][#|S]acronym[E][#|S]sub[E][#|S]sup[E][#|S]input[E|D|type|name|value|checked|disabled|readonly|size|maxlength|src|alt|usemap|onselect|onchange|accept|align][]select[E|name|size|multiple|disabled|tabindex|onfocus|onblur|onchange][optgroup|option]optgroup[E|disabled|label][option]option[E|selected|disabled|label|value][]textarea[E|D|name|rows|cols|disabled|readonly|onselect|onchange][]label[E|for|accesskey|onfocus|onblur][#|S]button[E|D|name|value|type|disabled][#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]h4[E|align][#|S]ins[E|cite|datetime][#|Y]h5[E|align][#|S]del[E|cite|datetime][#|Y]h6[E|align][#|S]div[E|align][#|Y]ul[E|type|compact][li]li[E|type|value][#|Y]ol[E|type|compact|start][li]dl[E|compact][dt|dd]dt[E][#|S]dd[E][#|Y]menu[E|compact][li]dir[E|compact][li]pre[E|width|xml:space][#|ZA]hr[E|align|noshade|size|width][]blockquote[E|cite][#|Y]address[E][#|S|p]center[E][#|Y]noframes[E][#|Y]isindex[A|B|prompt][]fieldset[E][#|legend|Y]legend[E|accesskey|align][#|S]table[E|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor][caption|col|colgroup|thead|tfoot|tbody|tr]caption[E|align][#|S]col[ZG][]colgroup[ZG][col]thead[ZF][tr]tr[ZF|bgcolor][th|td]th[E|ZE][#|Y]form[E|action|method|name|enctype|onsubmit|onreset|accept|accept-charset|target][#|X|R|Q]noscript[E][#|Y]td[E|ZE][#|Y]tfoot[ZF][tr]tbody[ZF][tr]area[E|D|shape|coords|href|nohref|alt|target][]base[id|href|target][]body[E|onload|onunload|background|bgcolor|text|link|vlink|alink][#|Y]").replace(/#/g,
"#text").replace(/(\w+)\[([^\]]+)\]\[([^\]]*)\]/g,function(a,e,i,b){i=h(i,"|");q[e]={attributes:g(i),attributesOrder:i,children:g(b,"|",{"#comment":{}})}});l=q;f=g("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected,autoplay,loop,controls");a=g("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed,source");k=c.extend(g("td,th,iframe,video,audio,object"),a);j=g("pre,script,style,textarea,code");e=g("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr");
c.html.Schema=function(i){function m(a){var e,i,b,d,k,n,j,o,s,f,A,l,u,p,q,y,x,r,v=/^([#+-])?([^\[\/]+)(?:\/([^\[]+))?(?:\[([^\]]+)\])?$/,B=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,M=/[*?+]/;if(a){a=h(a);t["@"]&&(y=t["@"].attributes,x=t["@"].attributesOrder);e=0;for(i=a.length;e<i;e++)if(k=v.exec(a[e])){p=k[1];s=k[2];q=k[3];o=k[4];l={};u=[];n={attributes:l,attributesOrder:u};"#"===p&&(n.paddEmpty=!0);"-"===p&&(n.removeEmpty=!0);if(y){for(r in y)l[r]=y[r];u.push.apply(u,x)}if(o){o=h(o,"|");b=
0;for(d=o.length;b<d;b++)if(k=B.exec(o[b]))if(j={},A=k[1],f=k[2].replace(/::/g,":"),p=k[3],k=k[4],"!"===A&&(n.attributesRequired=n.attributesRequired||[],n.attributesRequired.push(f),j.required=!0),"-"===A)delete l[f],u.splice(c.inArray(u,f),1);else{if(p&&("="===p&&(n.attributesDefault=n.attributesDefault||[],n.attributesDefault.push({name:f,value:k}),j.defaultValue=k),":"===p&&(n.attributesForced=n.attributesForced||[],n.attributesForced.push({name:f,value:k}),j.forcedValue=k),"<"===p))j.validValues=
g(k,"?");M.test(f)?(n.attributePatterns=n.attributePatterns||[],j.pattern=RegExp("^"+f.replace(/([?+*])/g,".$1")+"$"),n.attributePatterns.push(j)):(l[f]||u.push(f),l[f]=j)}}!y&&"@"==s&&(y=l,x=u);q&&(n.outputName=s,t[q]=n);M.test(s)?(n.pattern=RegExp("^"+s.replace(/([?+*])/g,".$1")+"$"),z.push(n)):t[s]=n}}}function u(a){t={};z=[];m(a);n(l,function(a,e){v[e]=a.children})}function A(a){var e=/^(~)?(.+)$/;a&&n(h(a),function(a){var a=e.exec(a),i="~"===a[1],g=i?"span":"div",m=a[2];v[m]=v[g];d[m]=g;i||(b[m]=
{});n(v,function(a){a[g]&&(a[m]=a[g])})})}function q(a){var e=/^([+\-]?)(\w+)\[([^\]]+)\]$/;a&&n(h(a),function(a){var a=e.exec(a),i,g;a&&(i=(g=a[1])?v[a[2]]:v[a[2]]={"#comment":{}},i=v[a[2]],n(h(a[3],"|"),function(a){"-"===g?delete i[a]:i[a]={}}))})}function x(a){var e=t[a],i;if(e)return e;for(i=z.length;i--;)if(e=z[i],e.pattern.test(a))return e}var t={},v={},z=[],r,B,i=i||{};!1===i.verify_html&&(i.valid_elements="*[*]");i.valid_styles&&(r={},n(i.valid_styles,function(a,e){r[e]=c.explode(a)}));B=
i.whitespace_elements?g(i.whitespace_elements):j;i.valid_elements?u(i.valid_elements):(n(l,function(a,e){t[e]={attributes:a.attributes,attributesOrder:a.attributesOrder};v[e]=a.children}),n(h("strong/b,em/i"),function(a){a=h(a,"/");t[a[1]].outputName=a[0]}),t.img.attributesDefault=[{name:"alt",value:""}],n(h("ol,ul,sub,sup,blockquote,span,font,a,table,tbody,tr"),function(a){t[a].removeEmpty=true}),n(h("p,h1,h2,h3,h4,h5,h6,th,td,pre,div,address,caption"),function(a){t[a].paddEmpty=true}));A(i.custom_elements);
q(i.valid_children);m(i.extended_valid_elements);q("+ol[ul|ol],+ul[ul|ol]");x("span")||m("span[!data-mce-type|*]");i.invalid_elements&&c.each(c.explode(i.invalid_elements),function(a){t[a]&&delete t[a]});this.children=v;this.styles=r;this.getBoolAttrs=function(){return f};this.getBlockElements=function(){return b};this.getShortEndedElements=function(){return a};this.getSelfClosingElements=function(){return e};this.getNonEmptyElements=function(){return k};this.getWhiteSpaceElements=function(){return B};
this.isValidChild=function(a,e){var i=v[a];return!(!i||!i[e])};this.getElementRule=x;this.getCustomElements=function(){return d};this.addValidElements=m;this.setValidElements=u;this.addCustomElements=A;this.addValidChildren=q};c.html.Schema.boolAttrMap=f;c.html.Schema.blockElementsMap=b})(tinymce);
(function(c){c.html.SaxParser=function(h,l){var f=this,b=function(){},h=h||{};f.schema=l=l||new c.html.Schema;!1!==h.fix_self_closing&&(h.fix_self_closing=!0);c.each("comment cdata text start end pi doctype".split(" "),function(a){a&&(f[a]=h[a]||b)});f.parse=function(a){function b(a){var e,i;for(e=f.length;e--;)if(f[e].name===a)break;if(e>=0){for(i=f.length-1;i>=e;i--){a=f[i];a.valid&&d.end(a.name)}f.length=e}}var d=this,j,e=0,g,n,f=[],i,m,q,o,s,p,A,y,x,t,v,z,r,B,E,I,C,D,J,F,K,L,H=0,G=c.html.Entities.decode,
N,O;F=RegExp("<(?:(?:!--([\\w\\W]*?)--\>)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([^\\s\\/<>]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/)>))","g");K=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:\\.|[^\"])*)\")|(?:\'((?:\\.|[^\'])*)\')|([^>\s]+)))?/g;L={script:/<\/script[^>]*>/gi,style:/<\/style[^>]*>/gi,noscript:/<\/noscript[^>]*>/gi};p=l.getShortEndedElements();J=l.getSelfClosingElements();A=l.getBoolAttrs();
y=h.validate;s=h.remove_internals;N=h.fix_self_closing;O=c.isIE;for(r=/^:/;j=F.exec(a);){e<j.index&&d.text(G(a.substr(e,j.index-e)));if(g=j[6]){g=g.toLowerCase();O&&r.test(g)&&(g=g.substr(1));b(g)}else if(g=j[7]){g=g.toLowerCase();O&&r.test(g)&&(g=g.substr(1));e=g in p;N&&(J[g]&&f.length>0&&f[f.length-1].name===g)&&b(g);if(!y||(x=l.getElementRule(g))){t=true;if(y){B=x.attributes;E=x.attributePatterns}if(z=j[8]){(o=z.indexOf("data-mce-type")!==-1)&&s&&(t=false);i=[];i.map={};z.replace(K,function(a,
e,g,b,d){e=e.toLowerCase();g=e in A?e:G(g||b||d||"");if(y&&!o&&e.indexOf("data-")!==0){a=B[e];if(!a&&E){for(b=E.length;b--;){a=E[b];if(a.pattern.test(e))break}b===-1&&(a=null)}if(!a||a.validValues&&!(g in a.validValues))return}i.map[e]=g;i.push({name:e,value:g})})}else{i=[];i.map={}}if(y&&!o){I=x.attributesRequired;C=x.attributesDefault;if(D=x.attributesForced)for(n=D.length;n--;){v=D[n];q=v.name;v=v.value;v==="{$uid}"&&(v="mce_"+H++);i.map[q]=v;i.push({name:q,value:v})}if(C)for(n=C.length;n--;){v=
C[n];q=v.name;if(!(q in i.map)){v=v.value;v==="{$uid}"&&(v="mce_"+H++);i.map[q]=v;i.push({name:q,value:v})}}if(I){for(n=I.length;n--;)if(I[n]in i.map)break;n===-1&&(t=false)}i.map["data-mce-bogus"]&&(t=false)}t&&d.start(g,i,e)}else t=false;if(n=L[g]){n.lastIndex=e=j.index+j[0].length;if(j=n.exec(a)){t&&(m=a.substr(e,j.index-e));e=j.index+j[0].length}else{m=a.substr(e);e=a.length}t&&m.length>0&&d.text(m,true);t&&d.end(g);F.lastIndex=e;continue}e||(!z||z.indexOf("/")!=z.length-1?f.push({name:g,valid:t}):
t&&d.end(g))}else(g=j[1])?d.comment(g):(g=j[2])?d.cdata(g):(g=j[3])?d.doctype(g):(g=j[4])&&d.pi(g,j[5]);e=j.index+j[0].length}e<a.length&&d.text(G(a.substr(e)));for(n=f.length-1;n>=0;n--){g=f[n];g.valid&&d.end(g.name)}}}})(tinymce);
(function(c){function h(a,b,d){var c;c=d?"lastChild":"firstChild";d=d?"prev":"next";if(a[c])return a[c];if(a!==b){if(c=a[d])return c;for(a=a.parent;a&&a!==b;a=a.parent)if(c=a[d])return c}}function l(a,b){this.name=a;this.type=b;1===b&&(this.attributes=[],this.attributes.map={})}var f=/^[ \t\r\n]*$/,b={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};c.extend(l.prototype,{replace:function(a){a.parent&&a.remove();this.insert(a,this);this.remove();return this},attr:function(a,
b){var d,c;if("string"!==typeof a){for(c in a)this.attr(c,a[c]);return this}if(d=this.attributes){if(void 0!==b){if(null===b){if(a in d.map){delete d.map[a];for(c=d.length;c--;)if(d[c].name===a){d.splice(c,1);break}}return this}if(a in d.map)for(c=d.length;c--;){if(d[c].name===a){d[c].value=b;break}}else d.push({name:a,value:b});d.map[a]=b;return this}return d.map[a]}},clone:function(){var a=new l(this.name,this.type),b,d,c,e,g;if(c=this.attributes){g=[];g.map={};b=0;for(d=c.length;b<d;b++)e=c[b],
"id"!==e.name&&(g[g.length]={name:e.name,value:e.value},g.map[e.name]=e.value);a.attributes=g}a.value=this.value;a.shortEnded=this.shortEnded;return a},wrap:function(a){this.parent.insert(a,this);a.append(this);return this},unwrap:function(){var a,b;for(a=this.firstChild;a;)b=a.next,this.insert(a,this,!0),a=b;this.remove()},remove:function(){var a=this.parent,b=this.next,d=this.prev;if(a){if(a.firstChild===this){if(a.firstChild=b)b.prev=null}else d.next=b;if(a.lastChild===this){if(a.lastChild=d)d.next=
null}else b.prev=d;this.parent=this.next=this.prev=null}return this},append:function(a){var b;a.parent&&a.remove();(b=this.lastChild)?(b.next=a,a.prev=b,this.lastChild=a):this.lastChild=this.firstChild=a;a.parent=this;return a},insert:function(a,b,d){var c;a.parent&&a.remove();c=b.parent||this;d?(b===c.firstChild?c.firstChild=a:b.prev.next=a,a.prev=b.prev,a.next=b,b.prev=a):(b===c.lastChild?c.lastChild=a:b.next.prev=a,a.next=b.next,a.prev=b,b.next=a);a.parent=c;return a},getAll:function(a){var b,
d=[];for(b=this.firstChild;b;b=h(b,this))b.name===a&&d.push(b);return d},empty:function(){var a,b,d;if(this.firstChild){a=[];for(d=this.firstChild;d;d=h(d,this))a.push(d);for(b=a.length;b--;)d=a[b],d.parent=d.firstChild=d.lastChild=d.next=d.prev=null}this.firstChild=this.lastChild=null;return this},isEmpty:function(a){var a=a||new c.html.Schema,b=this.firstChild,d,j=a.getNonEmptyElements(),e=a.getWhiteSpaceElements();if(b){do{if(1===b.type){if(b.attributes.map["data-mce-bogus"])continue;if(j[b.name])return!1;
for(a=b.attributes.length;a--;)if(d=b.attributes[a].name,"name"===d||0===d.indexOf("data-"))return!1}if(8===b.type||3===b.type&&(!f.test(b.value)||e[this.name]&&b.value&&0<b.value.length&&f.test(b.value)))return!1}while(b=h(b,this))}return!0},walk:function(a){return h(this,null,a)}});c.extend(l,{create:function(a,c){var d,j;d=new l(a,b[a]||1);if(c)for(j in c)d.attr(j,c[j]);return d}});c.html.Node=l})(tinymce);
(function(c){var h=c.html.Node;c.html.DomParser=function(l,f){var b=this,a={},k=[],d={},j={},l=l||{};l.validate="validate"in l?l.validate:!0;l.root_name=l.root_name||"body";b.schema=f=f||new c.html.Schema;b.filterNode=function(e){var b,c,f;c in a&&((f=d[c])?f.push(e):d[c]=[e]);for(b=k.length;b--;)c=k[b].name,c in e.attributes.map&&((f=j[c])?f.push(e):j[c]=[e]);return e};b.addNodeFilter=function(e,b){c.each(c.explode(e),function(e){var d=a[e];d||(a[e]=d=[]);d.push(b)})};b.addAttributeFilter=function(a,
b){c.each(c.explode(a),function(a){var e;for(e=0;e<k.length;e++)if(k[e].name===a){k[e].callbacks.push(b);return}k.push({name:a,callbacks:[b]})})};b.parse=function(e,g){function n(e,i){var b=new h(e,i),g;e in a&&((g=d[e])?g.push(b):d[e]=[b]);return b}function u(a){for(var e,a=a.prev;a&&3===a.type;)e=a.value.replace(r,""),0<e.length?(a.value=e,a=a.prev):(e=a.prev,a.remove(),a=e)}var i,m,q,o,s,p,A,y,x,t,v,z=[],r,B,E,I,g=g||{};d={};j={};t=c.extend(c.makeMap("script,style,head,html,body,title,meta,param"),
f.getBlockElements());f.getNonEmptyElements();I=f.children;x=l.validate;o="forced_root_block"in g?g.forced_root_block:l.forced_root_block;E=f.getWhiteSpaceElements();v=/^[ \t\r\n]+/;r=/[ \t\r\n]+$/;B=/[ \t\r\n]+/g;i=new c.html.SaxParser({validate:x,fix_self_closing:!x,cdata:function(a){q.append(n("#cdata",4)).value=a},text:function(a,e){var i;E[q.name]||(a=a.replace(B," "),q.lastChild&&t[q.lastChild.name]&&(a=a.replace(v,"")));0!==a.length&&(i=n("#text",3),i.raw=!!e,q.append(i).value=a)},comment:function(a){q.append(n("#comment",
8)).value=a},pi:function(a,e){q.append(n(a,7)).value=e;u(q)},doctype:function(a){q.append(n("#doctype",10)).value=a;u(q)},start:function(a,e,i){var b,g,d;if(b=x?f.getElementRule(a):{}){b=n(b.outputName||a,1);b.attributes=e;b.shortEnded=i;q.append(b);(g=I[q.name])&&(I[b.name]&&!g[b.name])&&z.push(b);for(g=k.length;g--;)d=k[g].name,d in e.map&&((y=j[d])?y.push(b):j[d]=[b]);t[a]&&u(b);i||(q=b)}},end:function(a){var e,i;if(e=x?f.getElementRule(a):{}){if(t[a]&&!E[q.name]){for(a=q.firstChild;a&&3===a.type;)i=
a.value.replace(v,""),0<i.length?(a.value=i,a=a.next):(i=a.next,a.remove(),a=i);for(a=q.lastChild;a&&3===a.type;)i=a.value.replace(r,""),0<i.length?(a.value=i,a=a.prev):(i=a.prev,a.remove(),a=i)}if((e.removeEmpty||e.paddEmpty)&&q.isEmpty(f))if(e.paddEmpty)q.empty().append(new c.html.Node("br",1)).shortEnded=!0;else if(!q.attributes.map.name){e=q.parent;q.empty().remove();q=e;return}q=q.parent}}},f);m=q=new h(g.context||l.root_name,11);i.parse(e);if(x&&z.length)if(g.context)g.invalid=!0;else{var C,
D,J,F,K,L,H,G;H=c.makeMap("tr,td,th,tbody,thead,tfoot,table");f.getNonEmptyElements();for(i=0;i<z.length;i++)if(p=z[i],p.parent){D=[p];for(C=p.parent;C&&!f.isValidChild(C.name,p.name)&&!H[C.name];C=C.parent)D.push(C);if(C&&1<D.length){D.reverse();J=F=b.filterNode(D[0].clone());for(L=0;L<D.length-1;L++){f.isValidChild(F.name,D[L].name)?(K=b.filterNode(D[L].clone()),F.append(K)):K=F;for(F=D[L].firstChild;F&&F!=D[L+1];)G=F.next,K.append(F),F=G;F=K}J.isEmpty(f)?C.insert(p,D[0],!0):(C.insert(J,D[0],!0),
C.insert(p,J));C=D[0];(C.isEmpty(f)||C.firstChild===C.lastChild&&"br"===C.firstChild.name)&&C.empty().remove()}else p.parent&&("li"===p.name?(C=p.prev)&&("ul"===C.name||"ul"===C.name)?C.append(p):(C=p.next)&&("ul"===C.name||"ul"===C.name)?C.insert(p,C.firstChild,!0):p.wrap(b.filterNode(new h("ul",1))):f.isValidChild(p.parent.name,"div")&&f.isValidChild("div",p.name)?p.wrap(b.filterNode(new h("div",1))):"style"===p.name||"script"===p.name?p.empty().remove():p.unwrap())}}if(o&&"body"==m.name)for(i=
m.firstChild;i;)p=i.next,3==i.type||1==i.type&&"p"!==i.name&&!t[i.name]&&!i.attr("data-mce-type")?(s||(s=n(o,1),m.insert(s,i)),s.append(i)):s=null,i=p;if(!g.invalid){for(A in d){y=a[A];o=d[A];for(p=o.length;p--;)o[p].parent||o.splice(p,1);s=0;for(i=y.length;s<i;s++)y[s](o,A,g)}s=0;for(i=k.length;s<i;s++)if(y=k[s],y.name in j){o=j[y.name];for(p=o.length;p--;)o[p].parent||o.splice(p,1);p=0;for(A=y.callbacks.length;p<A;p++)y.callbacks[p](o,y.name,g)}}return m};l.remove_trailing_brs&&b.addNodeFilter("br",
function(a){var b,d=a.length,k,i=f.getBlockElements();f.getNonEmptyElements();var m,j,o;i.body=1;for(b=0;b<d;b++)if(k=a[b],m=k.parent,i[k.parent.name]&&k===m.lastChild){for(j=k.prev;j;){o=j.name;if("span"!==o||"bookmark"!==j.attr("data-mce-type")){if("br"!==o)break;if("br"===o){k=null;break}}j=j.prev}if(k&&(k.remove(),m.isEmpty(f)&&(elementRule=f.getElementRule(m.name))))elementRule.removeEmpty?m.remove():elementRule.paddEmpty&&(m.empty().append(new c.html.Node("br",1)).shortEnded=!0)}})}})(tinymce);
tinymce.html.Writer=function(c){var h=[],l,f,b,a,k,c=c||{};l=c.indent;f=tinymce.makeMap(c.indent_before||"");b=tinymce.makeMap(c.indent_after||"");a=tinymce.html.Entities.getEncodeFunc(c.entity_encoding||"raw",c.entities);k="html"==c.element_format;return{start:function(d,c,e){var g,n,u;l&&(f[d]&&0<h.length)&&(g=h[h.length-1],0<g.length&&"\n"!==g&&h.push("\n"));h.push("<",d);if(c){g=0;for(n=c.length;g<n;g++)u=c[g],h.push(" ",u.name,'="',a(u.value,!0),'"')}h[h.length]=!e||k?">":" />";e&&(l&&b[d]&&
0<h.length)&&(g=h[h.length-1],0<g.length&&"\n"!==g&&h.push("\n"))},end:function(a){h.push("</",a,">");l&&(b[a]&&0<h.length)&&(a=h[h.length-1],0<a.length&&"\n"!==a&&h.push("\n"))},text:function(b,c){0<b.length&&(h[h.length]=c?b:a(b))},cdata:function(a){h.push("<![CDATA[",a,"]]\>")},comment:function(a){h.push("<\!--",a,"--\>")},pi:function(a,b){b?h.push("<?",a," ",b,"?>"):h.push("<?",a,"?>");l&&h.push("\n")},doctype:function(a){h.push("<!DOCTYPE",a,">",l?"\n":"")},reset:function(){h.length=0},getContent:function(){return h.join("").replace(/\n$/,
"")}}};
(function(c){c.html.Serializer=function(h,l){var f=new c.html.Writer(h),h=h||{};h.validate="validate"in h?h.validate:!0;this.schema=l=l||new c.html.Schema;this.writer=f;this.serialize=function(b){function a(b){var e=c[b.type],g,n,h,i,m,q,o,s;if(e)e(b);else{e=b.name;g=b.shortEnded;n=b.attributes;if(d&&n&&1<n.length){m=[];m.map={};s=l.getElementRule(b.name);q=0;for(o=s.attributesOrder.length;q<o;q++)h=s.attributesOrder[q],h in n.map&&(i=n.map[h],m.map[h]=i,m.push({name:h,value:i}));q=0;for(o=n.length;q<
o;q++)h=n[q].name,h in m.map||(i=n.map[h],m.map[h]=i,m.push({name:h,value:i}));n=m}f.start(b.name,n,g);if(!g){if(b=b.firstChild){do a(b);while(b=b.next)}f.end(e)}}}var c,d;d=h.validate;c={3:function(a){f.text(a.value,a.raw)},8:function(a){f.comment(a.value)},7:function(a){f.pi(a.name,a.value)},10:function(a){f.doctype(a.value)},4:function(a){f.cdata(a.value)},11:function(b){if(b=b.firstChild){do a(b);while(b=b.next)}}};f.reset();if(1==b.type&&!h.inner)a(b);else c[11](b);return f.getContent()}}})(tinymce);
(function(c){var h=c.each,l=c.is,f=c.isWebKit,b=c.isIE,a=c.html.Entities,k=/^([a-z0-9],?)+$/i,d=c.html.Schema.blockElementsMap,j=/^[ \t\r\n]*$/;c.create("tinymce.dom.DOMUtils",{doc:null,root:null,files:null,pixelStyles:/^(top|left|bottom|right|width|height|borderWidth)$/,props:{"for":"htmlFor","class":"className",className:"className",checked:"checked",disabled:"disabled",maxlength:"maxLength",readonly:"readOnly",selected:"selected",value:"value",id:"id",name:"name",type:"type"},DOMUtils:function(a,
g){var d;this.doc=a;this.win=window;this.files={};this.cssFlicker=!1;this.counter=0;this.stdMode=!c.isIE||8<=a.documentMode;this.boxModel=!c.isIE||"CSS1Compat"==a.compatMode||this.stdMode;this.hasOuterHTML="outerHTML"in a.createElement("a");this.settings=g=c.extend({keep_values:!1,hex_colors:1},g);this.schema=g.schema;this.styles=new c.html.Styles({url_converter:g.url_converter,url_converter_scope:g.url_converter_scope},g.schema);if(c.isIE6)try{a.execCommand("BackgroundImageCache",!1,!0)}catch(k){this.cssFlicker=
!0}if(b&&g.schema)for(d in"abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video".replace(/\w+/g,function(b){a.createElement(b)}),g.schema.getCustomElements())a.createElement(d);c.addUnload(this.destroy,this)},getRoot:function(){var a=this.settings;return a&&this.get(a.root_element)||this.doc.body},getViewPort:function(a){var b,a=!a?this.win:a;b=a.document;b=this.boxModel?b.documentElement:b.body;return{x:a.pageXOffset||
b.scrollLeft,y:a.pageYOffset||b.scrollTop,w:a.innerWidth||b.clientWidth,h:a.innerHeight||b.clientHeight}},getRect:function(a){var b,a=this.get(a);b=this.getPos(a);a=this.getSize(a);return{x:b.x,y:b.y,w:a.w,h:a.h}},getSize:function(a){var b,d,a=this.get(a);b=this.getStyle(a,"width");d=this.getStyle(a,"height");-1===b.indexOf("px")&&(b=0);-1===d.indexOf("px")&&(d=0);return{w:parseInt(b)||a.offsetWidth||a.clientWidth,h:parseInt(d)||a.offsetHeight||a.clientHeight}},getParent:function(a,b,d){return this.getParents(a,
b,d,!1)},getParents:function(a,b,d,c){var i=this,m,k=i.settings,j=[],a=i.get(a),c=void 0===c;k.strict_root&&(d=d||i.getRoot());l(b,"string")&&(m=b,b="*"===b?function(a){return 1==a.nodeType}:function(a){return i.is(a,m)});for(;a&&!(a==d||!a.nodeType||9===a.nodeType);){if(!b||b(a))if(c)j.push(a);else return a;a=a.parentNode}return c?j:null},get:function(a){var b;return a&&(this.doc&&"string"==typeof a)&&(b=a,(a=this.doc.getElementById(a))&&a.id!==b)?this.doc.getElementsByName(b)[1]:a},getNext:function(a,
b){return this._findSib(a,b,"nextSibling")},getPrev:function(a,b){return this._findSib(a,b,"previousSibling")},select:function(a,b){return c.dom.Sizzle(a,this.get(b)||this.get(this.settings.root_element)||this.doc,[])},is:function(a,b){var d;if(void 0===a.length){if("*"===b)return 1==a.nodeType;if(k.test(b)){b=b.toLowerCase().split(/,/);a=a.nodeName.toLowerCase();for(d=b.length-1;0<=d;d--)if(b[d]==a)return!0;return!1}}return 0<c.dom.Sizzle.matches(b,a.nodeType?[a]:a).length},add:function(a,b,d,c,
i){var m=this;return this.run(a,function(a){var e;e=l(b,"string")?m.doc.createElement(b):b;m.setAttribs(e,d);c&&(c.nodeType?e.appendChild(c):m.setHTML(e,c));return!i?a.appendChild(e):e})},create:function(a,b,d){return this.add(this.doc.createElement(a),a,b,d,1)},createHTML:function(a,b,d){var c,i;c="<"+a;for(i in b)b.hasOwnProperty(i)&&(c+=" "+i+'="'+this.encode(b[i])+'"');return"undefined"!=typeof d?c+">"+d+"</"+a+">":c+" />"},remove:function(a,b){return this.run(a,function(a){var e,i=a.parentNode;
if(!i)return null;if(b)for(;e=a.firstChild;)!c.isIE||3!==e.nodeType||e.nodeValue?i.insertBefore(e,a):a.removeChild(e);return i.removeChild(a)})},setStyle:function(a,d,k){var j=this;return j.run(a,function(i){var m;m=i.style;d=d.replace(/-(\D)/g,function(a,e){return e.toUpperCase()});if(j.pixelStyles.test(d)&&(c.is(k,"number")||/^[\-0-9\.]+$/.test(k)))k+="px";switch(d){case "opacity":if(b&&(m.filter=""===k?"":"alpha(opacity="+100*k+")",!a.currentStyle||!a.currentStyle.hasLayout))m.display="inline-block";
m[d]=m["-moz-opacity"]=m["-khtml-opacity"]=k||"";break;case "float":b?m.styleFloat=k:m.cssFloat=k;break;default:m[d]=k||""}j.settings.update_styles&&j.setAttrib(i,"data-mce-style")})},getStyle:function(a,d,c){if(a=this.get(a)){if(this.doc.defaultView&&c){d=d.replace(/[A-Z]/g,function(a){return"-"+a});try{return this.doc.defaultView.getComputedStyle(a,null).getPropertyValue(d)}catch(k){return null}}d=d.replace(/-(\D)/g,function(a,e){return e.toUpperCase()});"float"==d&&(d=b?"styleFloat":"cssFloat");
return a.currentStyle&&c?a.currentStyle[d]:a.style?a.style[d]:void 0}},setStyles:function(a,b){var d=this,c=d.settings,i;i=c.update_styles;c.update_styles=0;h(b,function(b,i){d.setStyle(a,i,b)});c.update_styles=i;c.update_styles&&d.setAttrib(a,c.cssText)},removeAllAttribs:function(a){return this.run(a,function(a){var e,b=a.attributes;for(e=b.length-1;0<=e;e--)a.removeAttributeNode(b.item(e))})},setAttrib:function(a,b,d){var c=this;if(a&&b)return c.settings.strict&&(b=b.toLowerCase()),this.run(a,function(a){var e=
c.settings,k=a.getAttribute(b);if(null!==d)switch(b){case "style":if(!l(d,"string")){h(d,function(e,b){c.setStyle(a,b,e)});return}e.keep_values&&(d&&!c._isRes(d)?a.setAttribute("data-mce-style",d,2):a.removeAttribute("data-mce-style",2));a.style.cssText=d;break;case "class":a.className=d||"";break;case "src":case "href":e.keep_values&&(e.url_converter&&(d=e.url_converter.call(e.url_converter_scope||c,d,b,a)),c.setAttrib(a,"data-mce-"+b,d,2));break;case "shape":a.setAttribute("data-mce-style",d)}l(d)&&
null!==d&&0!==d.length?a.setAttribute(b,""+d,2):a.removeAttribute(b,2);tinyMCE.activeEditor&&k!=d&&(e=tinyMCE.activeEditor,e.onSetAttrib.dispatch(e,a,b,d))})},setAttribs:function(a,b){var d=this;return this.run(a,function(a){h(b,function(e,b){d.setAttrib(a,b,e)})})},getAttrib:function(a,d,k){var j,a=this.get(a);if(!a||1!==a.nodeType)return void 0===k?!1:k;l(k)||(k="");if(/^(src|href|style|coords|shape)$/.test(d)&&(j=a.getAttribute("data-mce-"+d)))return j;b&&this.props[d]&&(j=(j=a[this.props[d]])&&
j.nodeValue?j.nodeValue:j);j||(j=a.getAttribute(d,2));if(/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(d))return!0===a[this.props[d]]&&""===j?d:j?d:"";if("FORM"===a.nodeName&&a.getAttributeNode(d))return a.getAttributeNode(d).nodeValue;if("style"===d&&(j=j||a.style.cssText))j=this.serializeStyle(this.parseStyle(j),a.nodeName),this.settings.keep_values&&!this._isRes(j)&&a.setAttribute("data-mce-style",j);f&&("class"===d&&j)&&(j=j.replace(/(apple|webkit)\-[a-z\-]+/gi,
""));if(b)switch(d){case "rowspan":case "colspan":1===j&&(j="");break;case "size":if("+0"===j||20===j||0===j)j="";break;case "width":case "height":case "vspace":case "checked":case "disabled":case "readonly":0===j&&(j="");break;case "hspace":-1===j&&(j="");break;case "maxlength":case "tabindex":if(32768===j||2147483647===j||"32768"===j)j="";break;case "multiple":case "compact":case "noshade":case "nowrap":return 65535===j?d:k;case "shape":j=j.toLowerCase();break;default:0===d.indexOf("on")&&j&&(j=
c._replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1",""+j))}return void 0!==j&&null!==j&&""!==j?""+j:k},getPos:function(a,b){var d=0,c=0,i=this.doc,a=this.get(a),b=b||i.body;if(a){if(a.getBoundingClientRect)return a=a.getBoundingClientRect(),c=this.boxModel?i.documentElement:i.body,d=a.left+(i.documentElement.scrollLeft||i.body.scrollLeft)-c.clientTop,c=a.top+(i.documentElement.scrollTop||i.body.scrollTop)-c.clientLeft,{x:d,y:c};for(i=a;i&&i!=b&&i.nodeType;)d+=i.offsetLeft||0,c+=i.offsetTop||0,
i=i.offsetParent;for(i=a.parentNode;i&&i!=b&&i.nodeType;)d-=i.scrollLeft||0,c-=i.scrollTop||0,i=i.parentNode}return{x:d,y:c}},parseStyle:function(a){return this.styles.parse(a)},serializeStyle:function(a,b){return this.styles.serialize(a,b)},loadCSS:function(a){var d=this,k=d.doc,j;a||(a="");j=d.select("head")[0];h(a.split(","),function(a){var e;d.files[a]||(d.files[a]=!0,e=d.create("link",{rel:"stylesheet",href:c._addVer(a)}),b&&(k.documentMode&&k.recalc)&&(e.onload=function(){k.recalc&&k.recalc();
e.onload=null}),j.appendChild(e))})},addClass:function(a,b){return this.run(a,function(a){var e;if(!b)return 0;if(this.hasClass(a,b))return a.className;e=this.removeClass(a,b);return a.className=(""!=e?e+" ":"")+b})},removeClass:function(a,b){var d=this,k;return d.run(a,function(a){var e;return d.hasClass(a,b)?(k||(k=RegExp("(^|\\s+)"+b+"(\\s+|$)","g")),e=a.className.replace(k," "),e=c.trim(" "!=e?e:""),a.className=e,e||(a.removeAttribute("class"),a.removeAttribute("className")),e):a.className})},
hasClass:function(a,b){a=this.get(a);return!a||!b?!1:-1!==(" "+a.className+" ").indexOf(" "+b+" ")},show:function(a){return this.setStyle(a,"display","block")},hide:function(a){return this.setStyle(a,"display","none")},isHidden:function(a){a=this.get(a);return!a||"none"==a.style.display||"none"==this.getStyle(a,"display")},uniqueId:function(a){return(!a?"mce_":a)+this.counter++},setHTML:function(a,d){var c=this;return c.run(a,function(a){if(b){for(;a.firstChild;)a.removeChild(a.firstChild);try{a.innerHTML=
"<br />"+d,a.removeChild(a.firstChild)}catch(e){a=c.create("div"),a.innerHTML="<br />"+d,h(a.childNodes,function(b,e){e&&a.appendChild(b)})}}else a.innerHTML=d;return d})},getOuterHTML:function(a){var b,a=this.get(a);if(!a)return null;if(1===a.nodeType&&this.hasOuterHTML)return a.outerHTML;b=(a.ownerDocument||this.doc).createElement("body");b.appendChild(a.cloneNode(!0));return b.innerHTML},setOuterHTML:function(a,d,c){function k(a,b,e){e=e.createElement("body");e.innerHTML=b;for(b=e.lastChild;b;)i.insertAfter(b.cloneNode(!0),
a),b=b.previousSibling;i.remove(a)}var i=this;return this.run(a,function(a){a=i.get(a);if(1==a.nodeType)if(c=c||a.ownerDocument||i.doc,b)try{b&&1==a.nodeType?a.outerHTML=d:k(a,d,c)}catch(e){k(a,d,c)}else k(a,d,c)})},decode:a.decode,encode:a.encodeAllRaw,insertAfter:function(a,b){b=this.get(b);return this.run(a,function(a){var e,d;e=b.parentNode;(d=b.nextSibling)?e.insertBefore(a,d):e.appendChild(a);return a})},isBlock:function(a){var b=a.nodeType;return b?!!(1===b&&d[a.nodeName]):!!d[a]},replace:function(a,
b,d){l(b,"array")&&(a=a.cloneNode(!0));return this.run(b,function(b){d&&h(c.grep(b.childNodes),function(b){a.appendChild(b)});return b.parentNode.replaceChild(a,b)})},rename:function(a,b){var d=this,c;a.nodeName!=b.toUpperCase()&&(c=d.create(b),h(d.getAttribs(a),function(b){d.setAttrib(c,b.nodeName,d.getAttrib(a,b.nodeName))}),d.replace(c,a,1));return c||a},findCommonAncestor:function(a,b){for(var d=a,c;d;){for(c=b;c&&d!=c;)c=c.parentNode;if(d==c)break;d=d.parentNode}return!d&&a.ownerDocument?a.ownerDocument.documentElement:
d},toHex:function(a){function b(a){a=parseInt(a).toString(16);return 1<a.length?a:"0"+a}var d=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(a);d&&(a="#"+b(d[1])+b(d[2])+b(d[3]));return a},getClasses:function(){function a(m){h(m.imports,function(b){a(b)});h(m.cssRules||m.rules,function(m){switch(m.type||1){case 1:m.selectorText&&h(m.selectorText.split(","),function(a){a=a.replace(/^\s*|\s*$|^\s\./g,"");if(!/\.mce/.test(a)&&/\.[\w\-]+$/.test(a)&&(i=a,a=c._replace(/.*\.([a-z0-9_\-]+).*/i,
"$1",a),(!k||(a=k(a,i)))&&!d[a]))b.push({"class":a}),d[a]=1});break;case 3:a(m.styleSheet)}})}var b=[],d={},k=this.settings.class_filter,i;if(this.classes)return this.classes;try{h(this.doc.styleSheets,a)}catch(m){}0<b.length&&(this.classes=b);return b},run:function(a,b,d){var c=this,i;c.doc&&"string"===typeof a&&(a=c.get(a));if(!a)return!1;d=d||this;return!a.nodeType&&(a.length||0===a.length)?(i=[],h(a,function(a,e){a&&("string"==typeof a&&(a=c.doc.getElementById(a)),i.push(b.call(d,a,e)))}),i):
b.call(d,a)},getAttribs:function(a){var d,a=this.get(a);if(!a)return[];if(b){d=[];if("OBJECT"==a.nodeName)return a.attributes;"OPTION"===a.nodeName&&this.getAttrib(a,"selected")&&d.push({specified:1,nodeName:"selected"});a.cloneNode(!1).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi,"").replace(/[\w:\-]+/gi,function(a){d.push({specified:1,nodeName:a})});return d}return a.attributes},isEmpty:function(a,b){var d,k,i,m;if(a=a.firstChild){i=new c.dom.TreeWalker(a);b=b||this.schema?
this.schema.getNonEmptyElements():null;do{k=a.nodeType;if(1===k){if(a.getAttribute("data-mce-bogus"))continue;m=a.nodeName.toLowerCase();if(b&&b[m]){d=a.parentNode;if("br"===m&&this.isBlock(d)&&d.firstChild===a&&d.lastChild===a)continue;return!1}this.getAttribs(a);for(d=a.attributes.length;d--;)if(m=a.attributes[d].nodeName.toLowerCase(),"name"===m||"data-mce-bookmark"===m||"contenteditable"===m&&"true"===a.attributes[d].value)return!1}if(8==k||3===k&&!j.test(a.nodeValue))return!1}while(a=i.next())}return!0},
destroy:function(a){this.events&&this.events.destroy();this.win=this.doc=this.root=this.events=null;a||c.removeUnload(this.destroy)},createRng:function(){var a=this.doc;return a.createRange?a.createRange():new c.dom.Range(this)},nodeIndex:function(a,b){var d=0,c,i;if(a){c=a.nodeType;for(a=a.previousSibling;a;a=a.previousSibling)if(i=a.nodeType,!(b&&3==i)||i!=c&&a.nodeValue.length)d++,c=i}return d},split:function(a,b,d){function k(a){var b,d=a.childNodes,e=a.nodeType;if(!(1==e&&"bookmark"==a.getAttribute("data-mce-type"))){for(b=
d.length-1;0<=b;b--)k(d[b]);if(9!=e){if(3==e&&0<a.nodeValue.length){b=c.trim(a.nodeValue).length;if(!(d=!i.isBlock(a.parentNode)))if(!(d=0<b)){if(b=0==b)b=a.nextSibling&&"SPAN"==a.nextSibling.nodeName,b=a.previousSibling&&"SPAN"==a.previousSibling.nodeName&&b;d=b}if(d)return}else if(1==e&&(d=a.childNodes,1==d.length&&(d[0]&&1==d[0].nodeType&&"bookmark"==d[0].getAttribute("data-mce-type"))&&a.parentNode.insertBefore(d[0],a),d.length||/^(br|hr|input|img)$/i.test(a.nodeName)))return;i.remove(a)}return a}}
var i=this,m=i.createRng(),j,f;if(a&&b)return m.setStart(a.parentNode,i.nodeIndex(a)),m.setEnd(b.parentNode,i.nodeIndex(b)),j=m.extractContents(),m=i.createRng(),m.setStart(b.parentNode,i.nodeIndex(b)+1),m.setEnd(a.parentNode,i.nodeIndex(a)+1),m=m.extractContents(),f=a.parentNode,f.insertBefore(k(j),a),d?f.replaceChild(d,b):f.insertBefore(b,a),f.insertBefore(k(m),a),i.remove(a),d||b},bind:function(a,b,d,k){this.events||(this.events=new c.dom.EventUtils);return this.events.add(a,b,d,k||this)},unbind:function(a,
b,d){this.events||(this.events=new c.dom.EventUtils);return this.events.remove(a,b,d)},dumpRng:function(a){return"startContainer: "+a.startContainer.nodeName+", startOffset: "+a.startOffset+", endContainer: "+a.endContainer.nodeName+", endOffset: "+a.endOffset},_findSib:function(a,b,d){var c=this,i=b;if(a){l(i,"string")&&(i=function(a){return c.is(a,b)});for(a=a[d];a;a=a[d])if(i(a))return a}return null},_isRes:function(a){return/^(top|left|bottom|right|width|height)/i.test(a)||/;\s*(top|left|bottom|right|width|height)/i.test(a)}});
c.DOM=new c.dom.DOMUtils(document,{process_html:0})})(tinymce);
(function(c){function h(c){function f(a,b){e(y,a,b)}function b(a,b){e(x,a,b)}function a(a){f(a.parentNode,E(a))}function k(a){b(a.parentNode,E(a)+1)}function d(a,b){var d;if(3==a.nodeType||0>b)return a;for(d=a.firstChild;d&&0<b;)--b,d=d.nextSibling;return d?d:a}function j(a,b,d,e){var i,m;if(a==d)return b==e?0:b<e?-1:1;for(i=d;i&&i.parentNode!=a;)i=i.parentNode;if(i){m=0;for(d=a.firstChild;d!=i&&m<b;)m++,d=d.nextSibling;return b<=m?-1:1}for(i=a;i&&i.parentNode!=d;)i=i.parentNode;if(i){m=0;for(d=d.firstChild;d!=
i&&m<e;)m++,d=d.nextSibling;return m<e?-1:1}for(b=c.findCommonAncestor(a,d);a&&a.parentNode!=b;)a=a.parentNode;a||(a=b);for(e=d;e&&e.parentNode!=b;)e=e.parentNode;e||(e=b);if(a==e)return 0;for(d=b.firstChild;d;){if(d==a)return-1;if(d==e)return 1;d=d.nextSibling}}function e(a,b,d){a?(o[v]=b,o[t]=d):(o[z]=b,o[r]=d);for(b=o[z];b.parentNode;)b=b.parentNode;for(d=o[v];d.parentNode;)d=d.parentNode;d==b?0<j(o[v],o[t],o[z],o[r])&&o.collapse(a):o.collapse(a);o.collapsed=o[v]==o[z]&&o[t]==o[r];o.commonAncestorContainer=
c.findCommonAncestor(o[v],o[z])}function g(a){var b,d=0,e=0,c;if(o[v]==o[z])return n(a);b=o[z];for(c=b.parentNode;c;b=c,c=c.parentNode){if(c==o[v]){var m=b;c=e=d=d=c=b=void 0;a!=A&&(b=s.createDocumentFragment());c=u(m,a);b&&b.appendChild(c);d=E(m);d-=o[t];if(!(0>=d))for(c=m.previousSibling;0<d;)e=c.previousSibling,c=q(c,a),b&&b.insertBefore(c,b.firstChild),--d,c=e;a!=p&&(o.setEndBefore(m),o.collapse(x));a=b;return a}++d}b=o[v];for(c=b.parentNode;c;b=c,c=c.parentNode){if(c==o[z]){m=b;c=e=d=c=d=b=void 0;
a!=A&&(b=s.createDocumentFragment());c=i(m,a);b&&b.appendChild(c);d=E(m);++d;d=o[r]-d;for(c=m.nextSibling;0<d;)e=c.nextSibling,c=q(c,a),b&&b.appendChild(c),--d,c=e;a!=p&&(o.setStartAfter(m),o.collapse(y));return b}++e}e-=d;for(b=o[v];0<e;)b=b.parentNode,e--;for(d=o[z];0>e;)d=d.parentNode,e++;e=b.parentNode;for(c=d.parentNode;e!=c;e=e.parentNode,c=c.parentNode)b=e,d=c;var k;a!=A&&(m=s.createDocumentFragment());k=i(b,a);m&&m.appendChild(k);e=E(b);c=E(d);++e;e=c-e;for(k=b.nextSibling;0<e;)c=k.nextSibling,
k=q(k,a),m&&m.appendChild(k),k=c,--e;k=u(d,a);m&&m.appendChild(k);a!=p&&(o.setStartAfter(b),o.collapse(y));return m}function n(a){var b,e,i,c;a!=A&&(b=s.createDocumentFragment());if(o[t]==o[r])return b;if(3==o[v].nodeType){e=o[v].nodeValue;e=e.substring(o[t],o[r]);a!=p&&(o[v].deleteData(o[t],o[r]-o[t]),o.collapse(y));if(a==A)return;b.appendChild(s.createTextNode(e));return b}i=d(o[v],o[t]);for(e=o[r]-o[t];0<e;)c=i.nextSibling,i=q(i,a),b&&b.appendChild(i),--e,i=c;a!=p&&o.collapse(y);return b}function u(a,
b){var e=d(o[z],o[r]-1),i,c,k,g=e!=o[z];if(e==a)return m(e,g,x,b);i=e.parentNode;for(c=m(i,x,x,b);i;){for(;e;)k=e.previousSibling,e=m(e,g,x,b),b!=A&&c.insertBefore(e,c.firstChild),g=y,e=k;if(i==a)return c;e=i.previousSibling;i=i.parentNode;k=m(i,x,x,b);b!=A&&k.appendChild(c);c=k}}function i(a,b){var e=d(o[v],o[t]),i=e!=o[v],c,k,g;if(e==a)return m(e,i,y,b);c=e.parentNode;for(k=m(c,x,y,b);c;){for(;e;)g=e.nextSibling,e=m(e,i,y,b),b!=A&&k.appendChild(e),i=y,e=g;if(c==a)return k;e=c.nextSibling;c=c.parentNode;
g=m(c,x,y,b);b!=A&&g.appendChild(k);k=g}}function m(a,b,d,e){var i;if(b)return q(a,e);if(3==a.nodeType){b=a.nodeValue;d?(i=o[t],d=b.substring(i),b=b.substring(0,i)):(i=o[r],d=b.substring(0,i),b=b.substring(i));e!=p&&(a.nodeValue=b);if(e==A)return;a=a.cloneNode(x);a.nodeValue=d;return a}if(e!=A)return a.cloneNode(x)}function q(a,b){if(b!=A)return b==p?a.cloneNode(y):a;a.parentNode.removeChild(a)}var o=this,s=c.doc,p=1,A=2,y=!0,x=!1,t="startOffset",v="startContainer",z="endContainer",r="endOffset",
B=tinymce.extend,E=c.nodeIndex;B(o,{startContainer:s,startOffset:0,endContainer:s,endOffset:0,collapsed:y,commonAncestorContainer:s,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:f,setEnd:b,setStartBefore:a,setStartAfter:function(a){f(a.parentNode,E(a)+1)},setEndBefore:function(a){b(a.parentNode,E(a))},setEndAfter:k,collapse:function(a){a?(o[z]=o[v],o[r]=o[t]):(o[v]=o[z],o[t]=o[r]);o.collapsed=y},selectNode:function(b){a(b);k(b)},selectNodeContents:function(a){f(a,0);b(a,1===
a.nodeType?a.childNodes.length:a.nodeValue.length)},compareBoundaryPoints:function(a,b){var d=o[v],e=o[t],i=o[z],c=o[r],m=b.startContainer,k=b.startOffset,g=b.endContainer,f=b.endOffset;if(0===a)return j(d,e,m,k);if(1===a)return j(i,c,m,k);if(2===a)return j(i,c,g,f);if(3===a)return j(d,e,g,f)},deleteContents:function(){g(A)},extractContents:function(){return g(0)},cloneContents:function(){return g(p)},insertNode:function(a){var b=this[v],d=this[t],e;(3===b.nodeType||4===b.nodeType)&&b.nodeValue?d?
d>=b.nodeValue.length?c.insertAfter(a,b):(d=b.splitText(d),b.parentNode.insertBefore(a,d)):b.parentNode.insertBefore(a,b):(0<b.childNodes.length&&(e=b.childNodes[d]),e?b.insertBefore(a,e):b.appendChild(a))},surroundContents:function(a){var b=o.extractContents();o.insertNode(a);a.appendChild(b);o.selectNode(a)},cloneRange:function(){return B(new h(c),{startContainer:o[v],startOffset:o[t],endContainer:o[z],endOffset:o[r],collapsed:o.collapsed,commonAncestorContainer:o.commonAncestorContainer})}})}c.Range=
h})(tinymce.dom);
(function(){tinymce.dom.TridentSelection=function(c){function h(a,b){var d,j=0,e,g,f,l,i,m,h=-1,o;d=a.duplicate();d.collapse(b);o=d.parentElement();if(o.ownerDocument===c.dom.doc){for(;"false"===o.contentEditable;)o=o.parentNode;if(!o.hasChildNodes())return{node:o,inside:1};f=o.children;for(e=f.length-1;j<=e;)if(m=Math.floor((j+e)/2),l=f[m],d.moveToElementText(l),h=d.compareEndPoints(b?"StartToStart":"EndToEnd",a),0<h)e=m-1;else if(0>h)j=m+1;else return{node:l};if(0>h){l?d.collapse(!1):(d.moveToElementText(o),
d.collapse(!0),l=o,g=!0);d.setEndPoint(b?"EndToStart":"EndToEnd",a);if(0<d.compareEndPoints(b?"StartToStart":"StartToEnd",a)){d=a.duplicate();d.collapse(b);for(i=-1;o==d.parentElement()&&0!=d.move("character",-1);)i++}i=i||d.text.replace("\r\n"," ").length}else d.collapse(!0),d.setEndPoint(b?"StartToStart":"StartToEnd",a),i=d.text.replace("\r\n"," ").length;return{node:l,position:h,offset:i,inside:g}}}var l=this,f=c.dom,b=!0;this.getBookmark=function(a){function b(a){var d,e,i,c,k=[];d=a.parentNode;
for(e=f.doc.body.parentNode;d!=e&&9!==d.nodeType;){i=d.children;for(c=i.length;c--;)if(a===i[c]){k.push(c);break}a=d;d=d.parentNode}return k}function d(a){if(a=h(j,a))return{position:a.position,offset:a.offset,indexes:b(a.node),inside:a.inside}}var j=c.getRng(),e={};2===a&&(j.item?e.start={ctrl:!0,indexes:b(j.item(0))}:(e.start=d(!0),c.isCollapsed()||(e.end=d())));return e};this.moveToBookmark=function(a){function b(a){var d,e,i,c;d=f.doc.body;for(e=a.length-1;0<=e;e--)c=d.children,i=a[e],i<=c.length-
1&&(d=c[i]);return d}function d(d){var f=a[d?"start":"end"],l,i;f&&(l=0<f.position,i=e.createTextRange(),i.moveToElementText(b(f.indexes)),offset=f.offset,void 0!==offset?(i.collapse(f.inside||l),i.moveStart("character",l?-offset:offset)):i.collapse(d),c.setEndPoint(d?"StartToStart":"EndToStart",i),d&&c.collapse(!0))}var c,e=f.doc.body;a.start&&(a.start.ctrl?(c=e.createControlRange(),c.addElement(b(a.start.indexes))):(c=e.createTextRange(),d(!0),d()),c.select())};this.addRange=function(a){function k(a){var c,
k,j,q,x;j=f.create("a");c=a?e:l;k=a?g:h;q=d.duplicate();if(c==i||c==i.documentElement)c=m,k=0;3==c.nodeType?(c.parentNode.insertBefore(j,c),q.moveToElementText(j),q.moveStart("character",k),f.remove(j),d.setEndPoint(a?"StartToStart":"EndToEnd",q)):(x=c.childNodes,x.length?(k>=x.length?f.insertAfter(j,x[x.length-1]):c.insertBefore(j,x[k]),q.moveToElementText(j)):(j=i.createTextNode("﻿"),c.appendChild(j),q.moveToElementText(j.parentNode),q.collapse(b)),d.setEndPoint(a?"StartToStart":"EndToEnd",q),f.remove(j))}
var d,j,e,g,l,h,i=c.dom.doc,m=i.body;e=a.startContainer;g=a.startOffset;l=a.endContainer;h=a.endOffset;d=m.createTextRange();if(e==l&&(1==e.nodeType&&g==h-1)&&g==h-1)try{j=m.createControlRange();j.addElement(e.childNodes[g]);j.select();return}catch(q){}k(!0);k();d.select()};this.getRangeAt=function(){function a(a){var e=h(b,a),c,j,g=0,f;c=e.node;j=e.offset;if(e.inside&&!c.hasChildNodes())d[a?"setStart":"setEnd"](c,0);else if(void 0===j)d[a?"setStartBefore":"setEndAfter"](c);else{if(0>e.position){e=
e.inside?c.firstChild:c.nextSibling;if(!e){d[a?"setStartAfter":"setEndAfter"](c);return}if(!j){if(3==e.nodeType)d[a?"setStart":"setEnd"](e,0);else d[a?"setStartBefore":"setEndBefore"](e);return}for(;e;){f=e.nodeValue;g+=f.length;if(g>=j){c=e;g-=j;g=f.length-g;break}e=e.nextSibling}}else{e=c.previousSibling;if(!e)return d[a?"setStartBefore":"setEndBefore"](c);if(!j){if(3==c.nodeType)d[a?"setStart":"setEnd"](e,c.nodeValue.length);else d[a?"setStartAfter":"setEndAfter"](e);return}for(;e;){g+=e.nodeValue.length;
if(g>=j){c=e;g-=j;break}e=e.previousSibling}}d[a?"setStart":"setEnd"](c,g)}}var b=c.getRng(),d=f.createRng(),j,e,g,n;j=b.item?b.item(0):b.parentElement();if(j.ownerDocument!=f.doc)return d;e=c.isCollapsed();if(b.item)return d.setStart(j.parentNode,f.nodeIndex(j)),d.setEnd(d.startContainer,d.startOffset+1),d;try{a(!0),e||a()}catch(u){if(-2147024809==u.number)n=l.getBookmark(2),g=b.duplicate(),g.collapse(!0),j=g.parentElement(),e||(g=b.duplicate(),g.collapse(!1),g=g.parentElement(),g.innerHTML=g.innerHTML),
j.innerHTML=j.innerHTML,l.moveToBookmark(n),b=c.getRng(),a(!0),e||a();else throw u;}return d}}})();
(function(){function c(a,b,d,e,c,i){for(var c=0,m=e.length;c<m;c++){var k=e[c];if(k){for(var k=k[a],g=!1;k;){if(k.sizcache===d){g=e[k.sizset];break}1===k.nodeType&&!i&&(k.sizcache=d,k.sizset=c);if(k.nodeName.toLowerCase()===b){g=k;break}k=k[a]}e[c]=g}}}function h(a,b,e,c,i,k){for(var i=0,m=c.length;i<m;i++){var g=c[i];if(g){for(var g=g[a],j=!1;g;){if(g.sizcache===e){j=c[g.sizset];break}if(1===g.nodeType)if(k||(g.sizcache=e,g.sizset=i),"string"!==typeof b){if(g===b){j=!0;break}}else if(0<d.filter(b,
[g]).length){j=g;break}g=g[a]}c[i]=j}}}var l=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,f=0,b=Object.prototype.toString,a=!1,k=!0;[0,0].sort(function(){k=!1;return 0});var d=function(a,c,i,k){var i=i||[],m=c=c||document;if(1!==c.nodeType&&9!==c.nodeType)return[];if(!a||"string"!==typeof a)return i;var g=[],f,o,h,s,n=!0,q=d.isXML(c),J=a,F;do if(l.exec(""),f=l.exec(J))if(J=f[3],g.push(f[1]),f[2]){s=f[3];break}while(f);
if(1<g.length&&e.exec(a))if(2===g.length&&j.relative[g[0]])o=p(g[0]+g[1],c);else for(o=j.relative[g[0]]?[c]:d(g.shift(),c);g.length;)a=g.shift(),j.relative[a]&&(a+=g.shift()),o=p(a,o);else if(!k&&(1<g.length&&9===c.nodeType&&!q&&j.match.ID.test(g[0])&&!j.match.ID.test(g[g.length-1]))&&(f=d.find(g.shift(),c,q),c=f.expr?d.filter(f.expr,f.set)[0]:f.set[0]),c){f=k?{expr:g.pop(),set:u(k)}:d.find(g.pop(),1===g.length&&("~"===g[0]||"+"===g[0])&&c.parentNode?c.parentNode:c,q);o=f.expr?d.filter(f.expr,f.set):
f.set;for(0<g.length?h=u(o):n=!1;g.length;)f=F=g.pop(),j.relative[F]?f=g.pop():F="",null==f&&(f=c),j.relative[F](h,f,q)}else h=[];h||(h=o);h||d.error(F||a);if("[object Array]"===b.call(h))if(n)if(c&&1===c.nodeType)for(a=0;null!=h[a];a++)h[a]&&(!0===h[a]||1===h[a].nodeType&&d.contains(c,h[a]))&&i.push(o[a]);else for(a=0;null!=h[a];a++)h[a]&&1===h[a].nodeType&&i.push(o[a]);else i.push.apply(i,h);else u(h,i);s&&(d(s,m,i,k),d.uniqueSort(i));return i};d.uniqueSort=function(b){if(m&&(a=k,b.sort(m),a))for(var d=
1;d<b.length;d++)b[d]===b[d-1]&&b.splice(d--,1);return b};d.matches=function(a,b){return d(a,null,null,b)};d.find=function(a,b,d){var e;if(!a)return[];for(var c=0,i=j.order.length;c<i;c++){var k=j.order[c],m;if(m=j.leftMatch[k].exec(a)){var g=m[1];m.splice(1,1);if("\\"!==g.substr(g.length-1)&&(m[1]=(m[1]||"").replace(/\\/g,""),e=j.find[k](m,b,d),null!=e)){a=a.replace(j.match[k],"");break}}}e||(e=b.getElementsByTagName("*"));return{set:e,expr:a}};d.filter=function(a,b,e,c){for(var i=a,k=[],m=b,g,f,
o=b&&b[0]&&d.isXML(b[0]);a&&b.length;){for(var h in j.filter)if(null!=(g=j.leftMatch[h].exec(a))&&g[2]){var l=j.filter[h],s,n;n=g[1];f=!1;g.splice(1,1);if("\\"!==n.substr(n.length-1)){m===k&&(k=[]);if(j.preFilter[h])if(g=j.preFilter[h](g,m,e,k,c,o)){if(!0===g)continue}else f=s=!0;if(g)for(var p=0;null!=(n=m[p]);p++)if(n){s=l(n,g,p,m);var q=c^!!s;e&&null!=s?q?f=!0:m[p]=!1:q&&(k.push(n),f=!0)}if(void 0!==s){e||(m=k);a=a.replace(j.match[h],"");if(!f)return[];break}}}if(a===i)if(null==f)d.error(a);else break;
i=a}return m};d.error=function(a){throw"Syntax error, unrecognized expression: "+a;};var j=d.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")}},relative:{"+":function(a,b){var e="string"===typeof b,c=e&&!/\W/.test(b),e=e&&!c;c&&(b=b.toLowerCase());for(var c=0,i=a.length,k;c<i;c++)if(k=a[c]){for(;(k=k.previousSibling)&&1!==k.nodeType;);a[c]=e||k&&k.nodeName.toLowerCase()===b?k||!1:k===b}e&&d.filter(b,a,!0)},">":function(a,b){var e="string"===
typeof b,c,i=0,k=a.length;if(e&&!/\W/.test(b))for(b=b.toLowerCase();i<k;i++){if(c=a[i])e=c.parentNode,a[i]=e.nodeName.toLowerCase()===b?e:!1}else{for(;i<k;i++)(c=a[i])&&(a[i]=e?c.parentNode:c.parentNode===b);e&&d.filter(b,a,!0)}},"":function(a,b,d){var e=f++,i=h,k;"string"===typeof b&&!/\W/.test(b)&&(k=b=b.toLowerCase(),i=c);i("parentNode",b,e,a,k,d)},"~":function(a,b,d){var e=f++,i=h,k;"string"===typeof b&&!/\W/.test(b)&&(k=b=b.toLowerCase(),i=c);i("previousSibling",b,e,a,k,d)}},find:{ID:function(a,
b,d){if("undefined"!==typeof b.getElementById&&!d)return(a=b.getElementById(a[1]))?[a]:[]},NAME:function(a,b){if("undefined"!==typeof b.getElementsByName){for(var d=[],e=b.getElementsByName(a[1]),c=0,i=e.length;c<i;c++)e[c].getAttribute("name")===a[1]&&d.push(e[c]);return 0===d.length?null:d}},TAG:function(a,b){return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,d,e,c,i){a=" "+a[1].replace(/\\/g,"")+" ";if(i)return a;for(var i=0,k;null!=(k=b[i]);i++)k&&(c^(k.className&&0<=(" "+k.className+
" ").replace(/[\t\n]/g," ").indexOf(a))?d||e.push(k):d&&(b[i]=!1));return!1},ID:function(a){return a[1].replace(/\\/g,"")},TAG:function(a){return a[1].toLowerCase()},CHILD:function(a){if("nth"===a[1]){var b=/(-?)(\d*)n((?:\+|-)?\d*)/.exec("even"===a[2]&&"2n"||"odd"===a[2]&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0;a[3]=b[3]-0}a[0]=f++;return a},ATTR:function(a,b,d,e,c,i){b=a[1].replace(/\\/g,"");!i&&j.attrMap[b]&&(a[1]=j.attrMap[b]);"~="===a[2]&&(a[4]=" "+a[4]+" ");return a},
PSEUDO:function(a,b,e,c,i){if("not"===a[1])if(1<(l.exec(a[3])||"").length||/^\w/.test(a[3]))a[3]=d(a[3],null,null,b);else return a=d.filter(a[3],b,e,1^i),e||c.push.apply(c,a),!1;else if(j.match.POS.test(a[0])||j.match.CHILD.test(a[0]))return!0;return a},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return!1===a.disabled&&"hidden"!==a.type},disabled:function(a){return!0===a.disabled},checked:function(a){return!0===a.checked},selected:function(a){a.parentNode.selectedIndex;return!0===
a.selected},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,e){return!!d(e[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){return"text"===a.type},radio:function(a){return"radio"===a.type},checkbox:function(a){return"checkbox"===a.type},file:function(a){return"file"===a.type},password:function(a){return"password"===a.type},submit:function(a){return"submit"===a.type},image:function(a){return"image"===a.type},reset:function(a){return"reset"===
a.type},button:function(a){return"button"===a.type||"button"===a.nodeName.toLowerCase()},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)}},setFilters:{first:function(a,b){return 0===b},last:function(a,b,d,e){return b===e.length-1},even:function(a,b){return 0===b%2},odd:function(a,b){return 1===b%2},lt:function(a,b,d){return b<d[3]-0},gt:function(a,b,d){return b>d[3]-0},nth:function(a,b,d){return d[3]-0===b},eq:function(a,b,d){return d[3]-0===b}},filter:{PSEUDO:function(a,
b,e,c){var i=b[1],k=j.filters[i];if(k)return k(a,e,b,c);if("contains"===i)return 0<=(a.textContent||a.innerText||d.getText([a])||"").indexOf(b[3]);if("not"===i){b=b[3];e=0;for(c=b.length;e<c;e++)if(b[e]===a)return!1;return!0}d.error("Syntax error, unrecognized expression: "+i)},CHILD:function(a,b){var d=b[1],e=a;switch(d){case "only":case "first":for(;e=e.previousSibling;)if(1===e.nodeType)return!1;if("first"===d)return!0;e=a;case "last":for(;e=e.nextSibling;)if(1===e.nodeType)return!1;return!0;case "nth":var d=
b[2],c=b[3];if(1===d&&0===c)return!0;var i=b[0],k=a.parentNode;if(k&&(k.sizcache!==i||!a.nodeIndex)){for(var m=0,e=k.firstChild;e;e=e.nextSibling)1===e.nodeType&&(e.nodeIndex=++m);k.sizcache=i}e=a.nodeIndex-c;return 0===d?0===e:0===e%d&&0<=e/d}},ID:function(a,b){return 1===a.nodeType&&a.getAttribute("id")===b},TAG:function(a,b){return"*"===b&&1===a.nodeType||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return-1<(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)},ATTR:function(a,b){var d=
b[1],d=j.attrHandle[d]?j.attrHandle[d](a):null!=a[d]?a[d]:a.getAttribute(d),e=d+"",c=b[2],i=b[4];return null==d?"!="===c:"="===c?e===i:"*="===c?0<=e.indexOf(i):"~="===c?0<=(" "+e+" ").indexOf(i):!i?e&&!1!==d:"!="===c?e!==i:"^="===c?0===e.indexOf(i):"$="===c?e.substr(e.length-i.length)===i:"|="===c?e===i||e.substr(0,i.length+1)===i+"-":!1},POS:function(a,b,d,e){var c=j.setFilters[b[2]];if(c)return c(a,d,b,e)}}},e=j.match.POS,g=function(a,b){return"\\"+(b-0+1)},n;for(n in j.match)j.match[n]=RegExp(j.match[n].source+
/(?![^\[]*\])(?![^\(]*\))/.source),j.leftMatch[n]=RegExp(/(^(?:.|\r|\n)*?)/.source+j.match[n].source.replace(/\\(\d+)/g,g));var u=function(a,b){a=Array.prototype.slice.call(a,0);return b?(b.push.apply(b,a),b):a};try{Array.prototype.slice.call(document.documentElement.childNodes,0)[0].nodeType}catch(i){u=function(a,d){var e=d||[],c=0;if("[object Array]"===b.call(a))Array.prototype.push.apply(e,a);else if("number"===typeof a.length)for(var i=a.length;c<i;c++)e.push(a[c]);else for(;a[c];c++)e.push(a[c]);
return e}}var m;document.documentElement.compareDocumentPosition?m=function(b,d){if(!b.compareDocumentPosition||!d.compareDocumentPosition)return b==d&&(a=!0),b.compareDocumentPosition?-1:1;var e=b.compareDocumentPosition(d)&4?-1:b===d?0:1;0===e&&(a=!0);return e}:"sourceIndex"in document.documentElement?m=function(b,d){if(!b.sourceIndex||!d.sourceIndex)return b==d&&(a=!0),b.sourceIndex?-1:1;var e=b.sourceIndex-d.sourceIndex;0===e&&(a=!0);return e}:document.createRange&&(m=function(b,d){if(!b.ownerDocument||
!d.ownerDocument)return b==d&&(a=!0),b.ownerDocument?-1:1;var e=b.ownerDocument.createRange(),c=d.ownerDocument.createRange();e.setStart(b,0);e.setEnd(b,0);c.setStart(d,0);c.setEnd(d,0);e=e.compareBoundaryPoints(Range.START_TO_END,c);0===e&&(a=!0);return e});d.getText=function(a){for(var b="",e,c=0;a[c];c++)e=a[c],3===e.nodeType||4===e.nodeType?b+=e.nodeValue:8!==e.nodeType&&(b+=d.getText(e.childNodes));return b};g=document.createElement("div");n="script"+(new Date).getTime();g.innerHTML="<a name='"+
n+"'/>";var q=document.documentElement;q.insertBefore(g,q.firstChild);document.getElementById(n)&&(j.find.ID=function(a,b,d){if("undefined"!==typeof b.getElementById&&!d)return(b=b.getElementById(a[1]))?b.id===a[1]||"undefined"!==typeof b.getAttributeNode&&b.getAttributeNode("id").nodeValue===a[1]?[b]:void 0:[]},j.filter.ID=function(a,b){var d="undefined"!==typeof a.getAttributeNode&&a.getAttributeNode("id");return 1===a.nodeType&&d&&d.nodeValue===b});q.removeChild(g);q=g=null;g=document.createElement("div");
g.appendChild(document.createComment(""));0<g.getElementsByTagName("*").length&&(j.find.TAG=function(a,b){var d=b.getElementsByTagName(a[1]);if(a[1]==="*"){for(var e=[],c=0;d[c];c++)d[c].nodeType===1&&e.push(d[c]);d=e}return d});g.innerHTML="<a href='#'></a>";g.firstChild&&("undefined"!==typeof g.firstChild.getAttribute&&"#"!==g.firstChild.getAttribute("href"))&&(j.attrHandle.href=function(a){return a.getAttribute("href",2)});g=null;if(document.querySelectorAll){var o=d,g=document.createElement("div");
g.innerHTML="<p class='TEST'></p>";if(!(g.querySelectorAll&&0===g.querySelectorAll(".TEST").length)){var d=function(a,b,e,c){b=b||document;if(!c&&b.nodeType===9&&!d.isXML(b))try{return u(b.querySelectorAll(a),e)}catch(i){}return o(a,b,e,c)},s;for(s in o)d[s]=o[s];g=null}}s=document.createElement("div");s.innerHTML="<div class='test e'></div><div class='test'></div>";s.getElementsByClassName&&0!==s.getElementsByClassName("e").length&&(s.lastChild.className="e",1!==s.getElementsByClassName("e").length&&
(j.order.splice(1,0,"CLASS"),j.find.CLASS=function(a,b,d){if(typeof b.getElementsByClassName!=="undefined"&&!d)return b.getElementsByClassName(a[1])},s=null));d.contains=document.compareDocumentPosition?function(a,b){return!!(a.compareDocumentPosition(b)&16)}:function(a,b){return a!==b&&(a.contains?a.contains(b):true)};d.isXML=function(a){return(a=(a?a.ownerDocument||a:0).documentElement)?a.nodeName!=="HTML":false};var p=function(a,b){for(var e=[],c="",i,k=b.nodeType?[b]:b;i=j.match.PSEUDO.exec(a);){c=
c+i[0];a=a.replace(j.match.PSEUDO,"")}a=j.relative[a]?a+"*":a;i=0;for(var m=k.length;i<m;i++)d(a,k[i],e);return d.filter(c,e)};window.tinymce.dom.Sizzle=d})();
(function(c){var h=c.each,l=c.DOM,f=c.isIE,b;c.create("tinymce.dom.EventUtils",{EventUtils:function(){this.inits=[];this.events=[]},add:function(a,b,d,j){var e,g=this,n=g.events,u;if(b instanceof Array)return u=[],h(b,function(b){u.push(g.add(a,b,d,j))}),u;if(a&&a.hasOwnProperty&&a instanceof Array)return u=[],h(a,function(a){a=l.get(a);u.push(g.add(a,b,d,j))}),u;if(a=l.get(a)){e=function(a){if(!g.disabled&&(!c.activeEditor||!a||!("keydown"===a.type||"keypress"===a.type)||!(0===c.activeEditor.selection.getSel().rangeCount&&
(!(c.isMac?a.metaKey:a.ctrlKey)||!(83===a.keyCode||69===a.keyCode&&a.shiftKey))))){if((a=a||window.event)&&f&&!c.isIE11)a.target||(a.target=a.srcElement),c.extend(a,g._stoppers);return!j?d(a):d.call(j,a)}};if("unload"==b)return c.unloads.unshift({func:e}),e;if("init"==b)return g.domLoaded?e():g.inits.push(e),e;n.push({obj:a,name:b,func:d,cfunc:e,scope:j});g._add(a,b,e);return d}},remove:function(a,b,d){var c=this,e=c.events,g=!1,f;if(a&&a.hasOwnProperty&&a instanceof Array)return f=[],h(a,function(a){a=
l.get(a);f.push(c.remove(a,b,d))}),f;a=l.get(a);h(e,function(f,i){if(f.obj==a&&f.name==b&&(!d||f.func==d||f.cfunc==d))return e.splice(i,1),c._remove(a,b,f.cfunc),g=!0,!1});return g},clear:function(a){var b=this.events,d,c;if(a){a=l.get(a);for(d=b.length-1;0<=d;d--)c=b[d],c.obj===a&&(this._remove(c.obj,c.name,c.cfunc),c.obj=c.cfunc=null,b.splice(d,1))}},cancel:function(a){if(!a)return!1;this.stop(a);return this.prevent(a)},stop:function(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0;return!1},
prevent:function(a){a.preventDefault?a.preventDefault():a.returnValue=!1;return!1},destroy:function(){var a=this;h(a.events,function(b){a._remove(b.obj,b.name,b.cfunc);b.obj=b.cfunc=null});a.events=[];a=null},_add:function(a,b,d){a.attachEvent?a.attachEvent("on"+b,d):a.addEventListener?a.addEventListener(b,d,!1):a["on"+b]=d},_remove:function(a,b,d){if(a)try{a.detachEvent?a.detachEvent("on"+b,d):a.removeEventListener?a.removeEventListener(b,d,!1):a["on"+b]=null}catch(c){}},_pageInit:function(){this.domLoaded||
(this.domLoaded=!0,h(this.inits,function(a){a()}),this.inits=[])},_wait:function(a){var b=this,d=a.document;a.tinyMCE_GZ&&tinyMCE_GZ.loaded?b.domLoaded=1:"complete"===d.readyState?b._pageInit(a):(d.attachEvent?(d.attachEvent("onreadystatechange",function(){"complete"===d.readyState&&(d.detachEvent("onreadystatechange",arguments.callee),b._pageInit(a))}),d.documentElement.doScroll&&a==a.top&&function(){if(!b.domLoaded){try{d.documentElement.doScroll("left")}catch(c){setTimeout(arguments.callee,0);
return}b._pageInit(a)}}()):d.addEventListener&&b._add(a,"DOMContentLoaded",function(){b._pageInit(a)}),b._add(a,"load",function(){b._pageInit(a)}))},_stoppers:{preventDefault:function(){this.returnValue=!1},stopPropagation:function(){this.cancelBubble=!0}}});b=c.dom.Event=new c.dom.EventUtils;b._wait(window);c.addUnload(function(){b.destroy()})})(tinymce);
(function(c){c.dom.Element=function(h,l){var f=this,b;f.settings=l=l||{};f.id=h;f.dom=b=l.dom||c.DOM;c.isIE||b.get(f.id);c.each("getPos,getRect,getParent,add,setStyle,getStyle,setStyles,setAttrib,setAttribs,getAttrib,addClass,removeClass,hasClass,getOuterHTML,setOuterHTML,remove,show,hide,isHidden,setHTML,get".split(/,/),function(a){f[a]=function(){var c=[h],d;for(d=0;d<arguments.length;d++)c.push(arguments[d]);c=b[a].apply(b,c);f.update(a);return c}});c.extend(f,{on:function(a,b,d){return c.dom.Event.add(f.id,
a,b,d)},getXY:function(){return{x:parseInt(f.getStyle("left")),y:parseInt(f.getStyle("top"))}},getSize:function(){var a=b.get(f.id);return{w:parseInt(f.getStyle("width")||a.clientWidth),h:parseInt(f.getStyle("height")||a.clientHeight)}},moveTo:function(a,b){f.setStyles({left:a,top:b})},moveBy:function(a,b){var d=f.getXY();f.moveTo(d.x+a,d.y+b)},resizeTo:function(a,b){f.setStyles({width:a,height:b})},resizeBy:function(a,b){var d=f.getSize();f.resizeTo(d.w+a,d.h+b)},update:function(a){c.isIE6&&l.blocker&&
(a=a||"",0===a.indexOf("get")||(0===a.indexOf("has")||0===a.indexOf("is"))||("remove"==a?b.remove(f.blocker):(f.blocker?a=b.get(f.blocker):(f.blocker=b.uniqueId(),a=b.add(l.container||b.getRoot(),"iframe",{id:f.blocker,style:"position:absolute;",frameBorder:0,src:'javascript:""'}),b.setStyle(a,"opacity",0)),b.setStyles(a,{left:f.getStyle("left",1),top:f.getStyle("top",1),width:f.getStyle("width",1),height:f.getStyle("height",1),display:f.getStyle("display",1),zIndex:parseInt(f.getStyle("zIndex",1)||
0)-1}))))}})}})(tinymce);
(function(c){var h=c.is,l=c.isIE,f=c.each;c.create("tinymce.dom.Selection",{Selection:function(b,a,k){var d=this;d.dom=b;d.win=a;d.serializer=k;f(["onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent"],function(a){d[a]=new c.util.Dispatcher(d)});d.win.getSelection||(d.tridentSel=new c.dom.TridentSelection(d));c.isIE&&b.boxModel&&this._fixIESelection();c.addUnload(d.destroy,d)},setCursorLocation:function(b,a){var c=this.dom.createRng();c.setStart(b,a);c.setEnd(b,a);this.setRng(c);
this.collapse(!1)},getContent:function(b){var a=this.getRng(),c=this.dom.create("body"),d=this.getSel(),j,e,b=b||{};j=e="";b.get=!0;b.format=b.format||"html";b.forced_root_block="";this.onBeforeGetContent.dispatch(this,b);if("text"==b.format)return this.isCollapsed()?"":a.text||(d.toString?d.toString():"");a.cloneContents?(a=a.cloneContents())&&c.appendChild(a):h(a.item)||h(a.htmlText)?(c.innerHTML="<br>"+(a.item?a.item(0).outerHTML:a.htmlText),c.removeChild(c.firstChild)):c.innerHTML=a.toString();
/^\s/.test(c.innerHTML)&&(j=" ");/\s+$/.test(c.innerHTML)&&(e=" ");b.getInner=!0;b.content=this.isCollapsed()?"":j+this.serializer.serialize(c,b)+e;this.onGetContent.dispatch(this,b);return b.content},setContent:function(b,a){var c=this.getRng(),d,j=this.win.document,e,g,a=a||{format:"html"};a.set=!0;a.content=b;a.no_events||this.onBeforeSetContent.dispatch(this,a);b=a.content;if(c.insertNode){b+='<span id="__caret">_</span>';if(c.startContainer==j&&c.endContainer==j)j.body.innerHTML=b;else if(c.deleteContents(),
0==j.body.childNodes.length)j.body.innerHTML=b;else if(c.createContextualFragment)try{c.insertNode(c.createContextualFragment(b))}catch(f){if(0===c.startOffset&&0===c.endOffset&&0===c.startContainer.children.length){e=j.createDocumentFragment();g=j.createElement("div");g.innerHTML=b;g=g.children[0];for(e.appendChild(g.cloneNode());g=g.nextSibling;)e.appendChild(g.cloneNode());c.startContainer.parentNode.insertBefore(e,c.startContainer)}else throw f;}else e=j.createDocumentFragment(),g=j.createElement("div"),
e.appendChild(g),g.outerHTML=b,c.insertNode(e);try{d=this.dom.get("__caret"),c=j.createRange(),c.setStartBefore(d),c.setEndBefore(d),this.setRng(c),this.dom.remove("__caret"),this.setRng(c)}catch(h){AJS.logError("Exception occurred at tinymce setContent(): "+h)}}else(c.item&&(j.execCommand("Delete",!1,null),c=this.getRng()),/^\s+/.test(b))?(c.pasteHTML('<span id="__mce_tmp">_</span>'+b),this.dom.remove("__mce_tmp")):c.pasteHTML(b);a.no_events||this.onSetContent.dispatch(this,a)},getStart:function(){var b=
this.getRng(),a,c;if(b.duplicate||b.item){if(b.item)return b.item(0);a=b.duplicate();a.collapse(1);a=a.parentElement();for(b=c=b.parentElement();c=c.parentNode;)if(c==a){a=b;break}return a}a=b.startContainer;1==a.nodeType&&a.hasChildNodes()&&(a=a.childNodes[Math.min(a.childNodes.length-1,b.startOffset)]);return a&&3==a.nodeType?a.parentNode:a},getEnd:function(){var b=this.getRng(),a;if(b.duplicate||b.item){if(b.item)return b.item(0);b=b.duplicate();b.collapse(0);return(a=b.parentElement())&&"BODY"==
a.nodeName?a.lastChild||a:a}a=b.endContainer;b=b.endOffset;1==a.nodeType&&a.hasChildNodes()&&(a=a.childNodes[0<b?b-1:b]);return a&&3==a.nodeType?a.parentNode:a},getBookmark:function(b,a){function c(a,b){var d=0;f(j.select(a),function(a,e){a==b&&(d=e)});return d}var d=this,j=d.dom,e,g,h,l,i;if(2==b){if(d.tridentSel)return d.tridentSel.getBookmark(b);e=function(b,e){var c=b[e?"startContainer":"endContainer"],i=b[e?"startOffset":"endOffset"],g=[],k,j=0;if(3==c.nodeType){if(a)for(k=c.previousSibling;k&&
3==k.nodeType;k=k.previousSibling)i+=k.nodeValue.length;g.push(i)}else k=c.childNodes,i>=k.length&&k.length&&(j=1,i=Math.max(0,k.length-1)),g.push(d.dom.nodeIndex(k[i],a)+j);for(;c&&c!=m;c=c.parentNode)g.push(d.dom.nodeIndex(c,a));return g};h=d.getRng(!0);var m=j.doc.body;l={};l.start=e(h,!0);d.isCollapsed()||(l.end=e(h));return l}if(b)return{rng:d.getRng()};e=d.getRng();h=j.uniqueId();l=tinyMCE.activeEditor.selection.isCollapsed();if(e.duplicate||e.item){if(e.item)return i=e.item(0),g=i.nodeName,
{name:g,index:c(g,i)};g=e.duplicate();try{e.collapse(),e.pasteHTML('<span data-mce-type="bookmark" id="'+h+'_start" style="overflow:hidden;line-height:0px">﻿</span>'),l||(g.collapse(!1),e.moveToElementText(g.parentElement()),0==e.compareEndPoints("StartToEnd",g)&&g.move("character",-1),g.pasteHTML('<span data-mce-type="bookmark" id="'+h+'_end" style="overflow:hidden;line-height:0px">﻿</span>'))}catch(q){return null}}else{i=d.getNode();g=i.nodeName;if("IMG"==g)return{name:g,index:c(g,i)};g=e.cloneRange();
l||(g.collapse(!1),g.insertNode(j.create("span",{"data-mce-type":"bookmark",id:h+"_end",style:"overflow:hidden;line-height:0px"},"﻿")));e.collapse(!0);e.insertNode(j.create("span",{"data-mce-type":"bookmark",id:h+"_start",style:"overflow:hidden;line-height:0px"},"﻿"))}d.moveToBookmark({id:h,keep:1});return{id:h}},moveToBookmark:function(b){var a=this.dom,k,d,j,e,g,h;if(b)if(b.start){k=a.createRng();d=a.doc.body;var u=function(a){var e=b[a?"start":"end"],c,i,g;if(e){g=e[0];i=d;for(c=e.length-1;1<=
c;c--){i=i.childNodes;if(e[c]>i.length-1)return;i=i[e[c]]}3===i.nodeType&&(g=Math.min(e[0],i.nodeValue.length));1===i.nodeType&&(g=Math.min(e[0],i.childNodes.length));a?k.setStart(i,g):k.setEnd(i,g)}return!0};if(this.tridentSel)return this.tridentSel.moveToBookmark(b);u(!0)&&u()&&this.setRng(k)}else if(b.id){var u=function(d){var i=a.get(b.id+"_"+d),k,l,p;p=b.keep;if(i&&(k=i.parentNode,"start"==d?(p?(k=i.firstChild,l=1):l=a.nodeIndex(i),j=e=k,g=h=l):(p?(k=i.firstChild,l=1):l=a.nodeIndex(i),e=k,h=
l),!p)){p=i.previousSibling;k=i.nextSibling;for(f(c.grep(i.childNodes),function(a){if(a.nodeType==3)a.nodeValue=a.nodeValue.replace(/\uFEFF/g,"")});i=a.get(b.id+"_"+d);)a.remove(i,1);p&&(k&&p.nodeType==k.nodeType&&3==p.nodeType&&!c.isOpera)&&(l=p.nodeValue.length,p.appendData(k.nodeValue),a.remove(k),"start"==d?(j=e=p,g=h=l):(e=p,h=l))}},i=function(b){a.isBlock(b)&&!b.innerHTML&&(b.innerHTML=!l?'<br data-mce-bogus="1" />':" ");return b};u("start");u("end");j&&(k=a.createRng(),k.setStart(i(j),g),k.setEnd(i(e),
h),this.setRng(k))}else b.name?this.select(a.select(b.name)[b.index]):b.rng&&this.setRng(b.rng)},select:function(b,a){var k=this.dom,d=k.createRng();b&&(k=k.nodeIndex(b),d.setStart(b.parentNode,k),d.setEnd(b.parentNode,k+1),a&&(k=function(a,b){var g=new c.dom.TreeWalker(a,a);try{do{if(3==a.nodeType&&0!=c.trim(a.nodeValue).length){b?d.setStart(a,0):d.setEnd(a,a.nodeValue.length);break}if("BR"==a.nodeName){b?d.setStartBefore(a):d.setEndBefore(a);break}}while(a=b?g.next():g.prev())}catch(k){AJS.log("Error in Selection.js: select : setPoint: "+
k)}},k(b,1),k(b)),this.setRng(d));return b},isCollapsed:function(){var b=this.getRng(),a=this.getSel();return!b||b.item?!1:b.compareEndPoints?0===b.compareEndPoints("StartToEnd",b):!a||b.collapsed},collapse:function(b){var a=this.getRng(),c;a.item&&(c=a.item(0),a=this.win.document.body.createTextRange(),a.moveToElementText(c));a.collapse(!!b);this.setRng(a)},getSel:function(){var b=this.win;return b.getSelection?b.getSelection():b.document.selection},getRng:function(b){var a,k,d,j=this.win.document;
if(b&&this.tridentSel)return this.tridentSel.getRangeAt(0);try{if(a=this.getSel())k=0<a.rangeCount?a.getRangeAt(0):a.createRange?a.createRange():j.createRange()}catch(e){}try{c.isIE&&(k&&k.setStart&&j.selection&&j.selection.createRange().item)&&(d=j.selection.createRange().item(0),k=j.createRange(),k.setStartBefore(d),k.setEndAfter(d))}catch(g){}k||(k=j.createRange?j.createRange():j.body.createTextRange());this.selectedRange&&this.explicitRange&&(0===k.compareBoundaryPoints(k.START_TO_START,this.selectedRange)&&
0===k.compareBoundaryPoints(k.END_TO_END,this.selectedRange)?k=this.explicitRange:this.explicitRange=this.selectedRange=null);return k},setRng:function(b){var a;if(this.tridentSel){if(b.cloneRange)try{this.tridentSel.addRange(b);return}catch(c){AJS.logError("Exception occurred at tinymce setRng() - tridentSel.addRange(): "+c)}try{b.select()}catch(d){AJS.logError("Exception occurred at tinymce setRng() - select(): "+d)}}else if(a=this.getSel()){this.explicitRange=b;try{a.removeAllRanges()}catch(j){AJS.logError("Exception occurred at tinymce setRng() - removeAllRanges(): "+
j)}try{a.addRange(b)}catch(e){AJS.logError("Exception occurred at tinymce setRng() - addRange(): "+e)}this.selectedRange=0<a.rangeCount?a.getRangeAt(0):null}},setNode:function(b){this.setContent(this.dom.getOuterHTML(b));return b},getNode:function(){var b=this.getRng();this.getSel();var a,c=b.startContainer,d=b.endContainer;if(!b)return this.dom.getRoot();if(b.setStart){a=b.commonAncestorContainer;if(!b.collapsed&&(b.startContainer==b.endContainer&&2>b.endOffset-b.startOffset&&b.startContainer.hasChildNodes()&&
(a=b.startContainer.childNodes[b.startOffset]),3===c.nodeType&&3===d.nodeType)){var j=function(a,b){for(var d=a;a&&3===a.nodeType&&0===a.length;)a=b?a.nextSibling:a.previousSibling;return a||d},c=c.length===b.startOffset?j(c.nextSibling,!0):c.parentNode,d=0===b.endOffset?j(d.previousSibling,!1):d.parentNode;if(c&&c===d)return c}return a&&3==a.nodeType?a.parentNode:a}return b.item?b.item(0):b.parentElement()},getSelectedBlocks:function(b,a){var k=this.dom,d,j,e,g=[];d=k.getParent(b||this.getStart(),
k.isBlock);j=k.getParent(a||this.getEnd(),k.isBlock);d&&g.push(d);if(d&&j&&d!=j){e=d;for(var f=new c.dom.TreeWalker(d,k.getRoot());(e=f.next())&&e!=j;)k.isBlock(e)&&g.push(e)}j&&d!=j&&g.push(j);return g},normalize:function(){function b(b){var e,g,f,h=a.dom;f=h.getRoot();var i;e=k[(b?"start":"end")+"Container"];g=k[(b?"start":"end")+"Offset"];9===e.nodeType&&(e=e.body,g=0);if(e===f&&e.hasChildNodes()){e=e.childNodes[Math.min(!b&&0<g?g-1:g,e.childNodes.length-1)];g=0;if("TABLE"===e.nodeName)return;
if(e.hasChildNodes()){i=e;f=new c.dom.TreeWalker(e,f);do{if(3===i.nodeType){g=b?0:i.nodeValue.length-1;e=i;d=!0;break}if(/^(BR|IMG)$/.test(i.nodeName)){g=h.nodeIndex(i);e=i.parentNode;"IMG"==i.nodeName&&!b&&g++;d=!0;break}}while(i=b?f.next():f.prev())}}if(d)k["set"+(b?"Start":"End")](e,g)}var a=this,k,d;c.isIE||(k=a.getRng(),b(!0),k.collapsed&&d&&b(),d&&a.setRng(k))},destroy:function(b){this.win=null;b||c.removeUnload(this.destroy)},_fixIESelection:function(){function b(a,b){var d=e.createTextRange();
try{d.moveToPoint(a,b)}catch(c){d=null}return d}function a(a){if(a.button){if(a=b(a.x,a.y))0<a.compareEndPoints("StartToStart",f)?a.setEndPoint("StartToStart",f):a.setEndPoint("EndToEnd",f),a.select()}else c()}function c(){var b=j.selection?j.selection.createRange():tinyMCE.activeEditor.getBody().createTextRange();f&&(!b.item&&0===b.compareEndPoints("StartToEnd",b))&&f.select();d.unbind(j,"mouseup",c);d.unbind(j,"mousemove",a);f=g=0}var d=this.dom,j=d.doc,e=j.body,g,f,h;j.documentElement.unselectable=
!0;d.bind(j,["mousedown","contextmenu"],function(e){if("HTML"===e.target.nodeName&&(g&&c(),h=j.documentElement,!(h.scrollHeight>h.clientHeight)&&(g=1,f=b(e.x,e.y))))d.bind(j,"mouseup",c),d.bind(j,"mousemove",a),d.win.focus(),f.select()})}})})(tinymce);
(function(c){c.dom.Serializer=function(h,l,f){var b,a,k=c.each,d;h.apply_source_formatting||(h.indent=!1);l=l||c.DOM;f=f||new c.html.Schema(h);h.entity_encoding=h.entity_encoding||"named";h.remove_trailing_brs="remove_trailing_brs"in h?h.remove_trailing_brs:!0;b=new c.util.Dispatcher(self);a=new c.util.Dispatcher(self);d=new c.html.DomParser(h,f);d.addAttributeFilter("src,href,style",function(a,b){for(var d=a.length,c,k,i="data-mce-"+b,m=h.url_converter,f=h.url_converter_scope;d--;){c=a[d];k=c.attributes.map[i];
if(k!==void 0){c.attr(b,k.length>0?k:null);c.attr(i,null)}else{k=c.attributes.map[b];b==="style"?k=l.serializeStyle(l.parseStyle(k),c.name):m&&(k=m.call(f,k,b,c.name));c.attr(b,k.length>0?k:null)}}});d.addAttributeFilter("class",function(a){for(var b=a.length,d,c;b--;){d=a[b];c=d.attr("class").replace(/\s*mce(Item\w+|Selected)\s*/g,"");d.attr("class",c.length>0?c:null)}});d.addAttributeFilter("data-mce-type",function(a,b,d){for(var b=a.length,c;b--;){c=a[b];c.attributes.map["data-mce-type"]==="bookmark"&&
!d.cleanup&&c.remove()}});d.addNodeFilter("script,style",function(a,b){function d(a){return a.replace(/(<\!--\[CDATA\[|\]\]--\>)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<\!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<\!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<\!--|\/\*\s*<\!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(--\>)?|\s*\/\/\s*\]\]>(--\>)?|\/\/\s*(--\>)?|\]\]>|\/\*\s*--\>\s*\*\/|\s*--\>\s*)\s*$/g,"")}for(var c=a.length,k,i;c--;){k=a[c];i=k.firstChild?k.firstChild.value:
"";if(b==="script"){k.attr("type",(k.attr("type")||"text/javascript").replace(/^mce\-/,""));if(i.length>0)k.firstChild.value="// <![CDATA[\n"+d(i)+"\n// ]]\>"}else if(i.length>0)k.firstChild.value="<\!--\n"+d(i)+"\n--\>"}});d.addNodeFilter("#comment",function(a){for(var b=a.length,d;b--;){d=a[b];if(d.value.indexOf("[CDATA[")===0){d.name="#cdata";d.type=4;d.value=d.value.replace(/^\[CDATA\[|\]\]$/g,"")}else if(d.value.indexOf("mce:protected ")===0){d.name="#text";d.type=3;d.raw=true;d.value=unescape(d.value).substr(14)}}});
d.addNodeFilter("xml:namespace,input",function(a,b){for(var d=a.length,c;d--;){c=a[d];c.type===7?c.remove():c.type===1&&b==="input"&&!("type"in c.attributes.map)&&c.attr("type","text")}});h.fix_list_elements&&d.addNodeFilter("ul,ol",function(a){for(var b=a.length,d,c;b--;){d=a[b];c=d.parent;(c.name==="ul"||c.name==="ol")&&d.prev&&d.prev.name==="li"&&d.prev.append(d)}});d.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style",function(a,b){for(var d=a.length;d--;)a[d].attr(b,null)});return{schema:f,
addNodeFilter:d.addNodeFilter,addAttributeFilter:d.addAttributeFilter,onPreProcess:b,onPostProcess:a,serialize:function(j,e){var g,n,u,j=j.cloneNode(true);g=j.ownerDocument.implementation;if(g.createHTMLDocument){n=g.createHTMLDocument("");k(j.nodeName=="BODY"?j.childNodes:[j],function(a){n.body.appendChild(n.importNode(a,true))});j=j.nodeName!="BODY"?n.body.firstChild:n.body;u=l.doc;l.doc=n}e=e||{};e.format=e.format||"html";if(!e.no_events){e.node=j;b.dispatch(self,e)}g=new c.html.Serializer(h,f);
e.content=g.serialize(d.parse(e.getInner?j.innerHTML:c.trim(l.getOuterHTML(j),e),e));if(!e.cleanup)e.content=e.content.replace(/\uFEFF|\u200B/g,"");e.no_events||a.dispatch(self,e);if(u)l.doc=u;e.node=null;return e.content},addRules:function(a){f.addValidElements(a)},setRules:function(a){f.setValidElements(a)}}}})(tinymce);
(function(c){c.dom.ScriptLoader=function(){var h={},l=[],f={},b=[],a=0;this.isDone=function(a){return 2==h[a]};this.markDone=function(a){h[a]=2};this.add=this.load=function(a,b,c){void 0==h[a]&&(l.push(a),h[a]=0);b&&(f[a]||(f[a]=[]),f[a].push({func:b,scope:c||this}))};this.loadQueue=function(a,b){this.loadScripts(l,a,b)};this.loadScripts=function(k,d,j){function e(a){c.each(f[a],function(a){a.func.call(a.scope)});f[a]=void 0}var g;b.push({func:d,scope:j||this});g=function(){var d=c.grep(k);k.length=
0;c.each(d,function(b){if(2==h[b])e(b);else if(1!=h[b]){h[b]=1;a++;a:{var d=function(){k.remove(n);f&&(f.onreadystatechange=f.onload=f=null);h[b]=2;a--;e(b);g()},m=function(){AJS.log("Failed to load: "+b)},k=c.DOM,f,j,l,n;n=k.uniqueId();if(c.isIE6&&(j=new c.util.URI(b),l=location,j.host==l.hostname&&j.port==l.port&&j.protocol+":"==l.protocol&&"file"!=j.protocol.toLowerCase())){c.util.XHR.send({url:c._addVer(j.getURI()),success:function(a){var b=k.create("script",{type:"text/javascript"});b.text=a;
document.getElementsByTagName("head")[0].appendChild(b);k.remove(b);d()},error:m});break a}f=k.create("script",{id:n,type:"text/javascript",src:c._addVer(b)});c.isIE||(f.onload=d);f.onerror=m;c.isOpera||(f.onreadystatechange=function(){var a=f.readyState;(a=="complete"||a=="loaded")&&d()});(document.getElementsByTagName("head")[0]||document.body).appendChild(f)}}});a||(c.each(b,function(a){a.func.call(a.scope)}),b.length=0)};g()}};c.ScriptLoader=new c.dom.ScriptLoader})(tinymce);
tinymce.dom.TreeWalker=function(c,h){function l(b,a,c,d){if(b){if(!d&&b[a])return b[a];if(b!=h){if(a=b[c])return a;for(b=b.parentNode;b&&b!=h;b=b.parentNode)if(a=b[c])return a}}}var f=c;this.current=function(){return f};this.next=function(b){return f=l(f,"firstChild","nextSibling",b)};this.prev=function(b){return f=l(f,"lastChild","previousSibling",b)}};
(function(c){c.dom.RangeUtils=function(h){this.walk=function(l,f){function b(a){var b;b=a[0];3===b.nodeType&&(b===j&&e>=b.nodeValue.length)&&a.splice(0,1);b=a[a.length-1];0===n&&(0<a.length&&b===g&&3===b.nodeType)&&a.splice(a.length-1,1);return a}function a(a,b,d){for(var c=[];a&&a!=d;a=a[b])c.push(a);return c}function k(a,b){do{if(a.parentNode==b)return a;a=a.parentNode}while(a)}function d(d,c,e){var i=e?"nextSibling":"previousSibling";m=d;for(q=m.parentNode;m&&m!=c;m=q)q=m.parentNode,o=a(m==d?m:
m[i],i),o.length&&(e||o.reverse(),f(b(o)))}var j=l.startContainer,e=l.startOffset,g=l.endContainer,n=l.endOffset,u,i,m,q,o;i=h.select("td.mceSelected,th.mceSelected");if(0<i.length)c.each(i,function(a){f([a])});else{1==j.nodeType&&j.hasChildNodes()&&(j=j.childNodes[e]);1==g.nodeType&&g.hasChildNodes()&&(g=g.childNodes[Math.min(n-1,g.childNodes.length-1)]);if(j==g)return f(b([j]));u=h.findCommonAncestor(j,g);for(m=j;m;m=m.parentNode){if(m===g)return d(j,u,!0);if(m===u)break}for(m=g;m;m=m.parentNode){if(m===
j)return d(g,u);if(m===u)break}i=k(j,u)||j;u=k(g,u)||g;d(j,i,!0);o=a(i==j?i:i.nextSibling,"nextSibling",u==g?u.nextSibling:u);o.length&&f(b(o));d(g,u)}};this.split=function(c){var f=c.startContainer,b=c.startOffset,a=c.endContainer,c=c.endOffset;if(f==a&&3==f.nodeType)0<b&&b<f.nodeValue.length&&(a=f.splitText(b),f=a.previousSibling,c>b?(f=a=a.splitText(c-b).previousSibling,c=a.nodeValue.length,b=0):c=0);else if(3==f.nodeType&&(0<b&&b<f.nodeValue.length)&&(f=f.splitText(b),b=0),3==a.nodeType&&0<c&&
c<a.nodeValue.length)a=a.splitText(c).previousSibling,c=a.nodeValue.length;return{startContainer:f,startOffset:b,endContainer:a,endOffset:c}}};c.dom.RangeUtils.compareRanges=function(c,l){if(c&&l)if(c.item||c.duplicate){if(c.item&&l.item&&c.item(0)===l.item(0)||c.isEqual&&l.isEqual&&l.isEqual(c))return!0}else return c.startContainer==l.startContainer&&c.startOffset==l.startOffset;return!1}})(tinymce);
(function(c){var h=c.dom.Event,l=c.each;c.create("tinymce.ui.KeyboardNavigation",{KeyboardNavigation:function(f,b){var a=this,k=f.root,d=f.items,j=f.enableUpDown,e=f.enableLeftRight||!f.enableUpDown,g=f.excludeFromTabOrder,n,u,i,m,q,b=b||c.DOM;n=function(a){q=a.target.id};u=function(a){b.setAttrib(a.target.id,"tabindex","-1")};m=function(){var a=b.get(q);b.setAttrib(a,"tabindex","0");a.focus()};a.focus=function(){b.get(q).focus()};a.destroy=function(){l(d,function(a){b.unbind(b.get(a.id),"focus",
n);b.unbind(b.get(a.id),"blur",u)});b.unbind(b.get(k),"focus",m);b.unbind(b.get(k),"keydown",i);d=b=k=a.focus=n=u=i=m=null;a.destroy=function(){}};a.moveFocus=function(a,c){var e=-1,i;if(q){l(d,function(a,b){if(a.id===q)return e=b,!1});e+=a;0>e?e=d.length-1:e>=d.length&&(e=0);i=d[e];b.setAttrib(q,"tabindex","-1");b.setAttrib(i.id,"tabindex","0");b.get(i.id).focus();if(f.actOnFocus)f.onAction(i.id);c&&h.cancel(c)}};i=function(b){switch(b.keyCode){case 37:e&&a.moveFocus(-1);break;case 39:e&&a.moveFocus(1);
break;case 38:j&&a.moveFocus(-1);break;case 40:j&&a.moveFocus(1);break;case 27:f.onCancel&&(f.onCancel(),h.cancel(b));break;case 14:case 13:case 32:f.onAction&&(f.onAction(q),h.cancel(b))}};l(d,function(a,d){var c;a.id||(a.id=b.uniqueId("_mce_item_"));g?(b.bind(a.id,"blur",u),c="-1"):c=0===d?"0":"-1";b.setAttrib(a.id,"tabindex",c);b.bind(b.get(a.id),"focus",n)});d[0]&&(q=d[0].id);b.setAttrib(k,"tabindex","-1");b.bind(b.get(k),"focus",m);b.bind(b.get(k),"keydown",i)}})})(tinymce);
(function(c){var h=c.DOM,l=c.is;c.create("tinymce.ui.Control",{Control:function(f,b,a){this.id=f;this.settings=b=b||{};this.rendered=!1;this.onRender=new c.util.Dispatcher(this);this.classPrefix="";this.scope=b.scope||this;this.active=this.disabled=0;this.editor=a},setAriaProperty:function(c,b){var a=h.get(this.id+"_aria")||h.get(this.id);a&&h.setAttrib(a,"aria-"+c,!!b)},focus:function(){h.get(this.id).focus()},setDisabled:function(c){c!=this.disabled&&(this.setAriaProperty("disabled",c),this.setState("Disabled",
c),this.setState("Enabled",!c),this.disabled=c)},isDisabled:function(){return this.disabled},setActive:function(c){c!=this.active&&(this.setState("Active",c),this.active=c,this.setAriaProperty("pressed",c))},isActive:function(){return this.active},setState:function(c,b){var a=h.get(this.id),c=this.classPrefix+c;b?h.addClass(a,c):h.removeClass(a,c)},isRendered:function(){return this.rendered},renderHTML:function(){},renderTo:function(c){h.setHTML(c,this.renderHTML())},postRender:function(){var c;l(this.disabled)&&
(c=this.disabled,this.disabled=-1,this.setDisabled(c));l(this.active)&&(c=this.active,this.active=-1,this.setActive(c))},remove:function(){h.remove(this.id);this.destroy()},destroy:function(){c.dom.Event.clear(this.id)}})})(tinymce);tinymce.create("tinymce.ui.Container:tinymce.ui.Control",{Container:function(c,h,l){this.parent(c,h,l);this.controls=[];this.lookup={}},add:function(c){this.lookup[c.id]=c;this.controls.push(c);return c},get:function(c){return this.lookup[c]}});
tinymce.create("tinymce.ui.Separator:tinymce.ui.Control",{Separator:function(c,h){this.parent(c,h);this.classPrefix="mceSeparator";this.setDisabled(!0)},renderHTML:function(){return tinymce.DOM.createHTML("span",{"class":this.classPrefix,role:"separator","aria-orientation":"vertical",tabindex:"-1"})}});
(function(c){var h=c.is;c.create("tinymce.ui.MenuItem:tinymce.ui.Control",{MenuItem:function(c,f){this.parent(c,f);this.classPrefix="mceMenuItem"},setSelected:function(c){this.setState("Selected",c);this.setAriaProperty("checked",!!c);this.selected=c},isSelected:function(){return this.selected},postRender:function(){this.parent();h(this.selected)&&this.setSelected(this.selected)}})})(tinymce);
(function(c){var h=c.DOM,l=c.walk;c.create("tinymce.ui.Menu:tinymce.ui.MenuItem",{Menu:function(f,b){this.parent(f,b);this.items={};this.collapsed=!1;this.menuCount=0;this.onAddItem=new c.util.Dispatcher(this)},expand:function(c){c&&l(this,function(b){b.expand&&b.expand()},"items",this);this.collapsed=!1},collapse:function(c){c&&l(this,function(b){b.collapse&&b.collapse()},"items",this);this.collapsed=!0},isCollapsed:function(){return this.collapsed},add:function(f){f.settings||(f=new c.ui.MenuItem(f.id||
h.uniqueId(),f));this.onAddItem.dispatch(this,f);return this.items[f.id]=f},addSeparator:function(){return this.add({separator:!0})},addMenu:function(c){c.collapse||(c=this.createMenu(c));this.menuCount++;return this.add(c)},hasMenus:function(){return 0!==this.menuCount},remove:function(c){delete this.items[c.id]},removeAll:function(){l(this,function(c){c.removeAll?c.removeAll():c.remove();c.destroy()},"items",this);this.items={}},createMenu:function(f){f=new c.ui.Menu(f.id||h.uniqueId(),f);f.onAddItem.add(this.onAddItem.dispatch,
this.onAddItem);return f}})})(tinymce);
(function(c){var h=c.is,l=c.DOM,f=c.each,b=c.dom.Event,a=c.dom.Element;c.create("tinymce.ui.DropMenu:tinymce.ui.Menu",{DropMenu:function(a,b){b=b||{};b.container=b.container||l.doc.body;b.offset_x=b.offset_x||0;b.offset_y=b.offset_y||0;b.vp_offset_x=b.vp_offset_x||0;b.vp_offset_y=b.vp_offset_y||0;h(b.icons)&&!b.icons&&(b["class"]+=" mceNoIcons");this.parent(a,b);this.onShowMenu=new c.util.Dispatcher(this);this.onHideMenu=new c.util.Dispatcher(this);this.classPrefix="mceMenu"},createMenu:function(a){var b=
this.settings;a.container=a.container||b.container;a.parent=this;a.constrain=a.constrain||b.constrain;a["class"]=a["class"]||b["class"];a.vp_offset_x=a.vp_offset_x||b.vp_offset_x;a.vp_offset_y=a.vp_offset_y||b.vp_offset_y;a.keyboard_focus=b.keyboard_focus;a=new c.ui.DropMenu(a.id||l.uniqueId(),a);a.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return a},focus:function(){this.keyboardNav&&this.keyboardNav.focus()},update:function(){var a=this.settings,b=l.get("menu_"+this.id+"_tbl"),c=l.get("menu_"+
this.id+"_co"),e,g;e=a.max_width?Math.min(b.clientWidth,a.max_width):b.clientWidth;g=a.max_height?Math.min(b.clientHeight,a.max_height):b.clientHeight;l.boxModel?this.element.setStyles({width:e,height:g}):this.element.setStyles({width:e+2,height:g+2});a.max_width&&l.setStyle(c,"width",e);a.max_height&&(l.setStyle(c,"height",g),b.clientHeight<a.max_height&&l.setStyle(c,"overflow","hidden"))},showMenu:function(k,d,j){var e=this,g=e.settings,h,u=l.getViewPort(),i,m,q,o,s=e.classPrefix;e.collapse(1);
e.isMenuVisible||(e.rendered?h=l.get("menu_"+e.id):(h=l.add(e.settings.container,e.renderNode()),f(e.items,function(a){a.postRender()}),e.element=new a("menu_"+e.id,{blocker:1,container:g.container})),c.isOpera||l.setStyles(h,{left:-65535,top:-65535}),l.show(h),e.update(),k+=g.offset_x||0,d+=g.offset_y||0,u.w-=4,u.h-=4,g.constrain&&(i=h.clientWidth-2,m=h.clientHeight-2,q=u.x+u.w,u=u.y+u.h,k+g.vp_offset_x+i>q&&(k=j?j-i:Math.max(0,q-g.vp_offset_x-i)),d+g.vp_offset_y+m>u&&(d=Math.max(0,u-g.vp_offset_y-
m))),l.setStyles(h,{left:k,top:d}),e.element.update(),e.isMenuVisible=1,e.mouseClickFunc=b.add(h,"click",function(a){var c;if((a=a.target)&&(a=l.getParent(a,"tr"))&&!l.hasClass(a,s+"ItemSub")){c=e.items[a.id];if(!c.isDisabled()){for(o=e;o;){o.hideMenu&&o.hideMenu();o=o.settings.parent}if(c.settings.onclick)c.settings.onclick(a);return b.cancel(a)}}}),e.hasMenus()&&(e.mouseOverFunc=b.add(h,"mouseover",function(a){var b;if((a=a.target)&&(a=l.getParent(a,"tr"))){b=e.items[a.id];e.lastMenu&&e.lastMenu.collapse(1);
if(!b.isDisabled()&&a&&l.hasClass(a,s+"ItemSub")){a=l.getRect(a);b.showMenu(a.x+a.w-2,a.y-2,a.x);e.lastMenu=b;l.addClass(l.get(b.id).firstChild,s+"ItemActive")}}})),b.add(h,"keydown",e._keyHandler,e),e.onShowMenu.dispatch(e),g.keyboard_focus&&e._setupKeyboardNav())},hideMenu:function(a){var c=l.get("menu_"+this.id),j;this.isMenuVisible&&(this.keyboardNav&&this.keyboardNav.destroy(),b.remove(c,"mouseover",this.mouseOverFunc),b.remove(c,"click",this.mouseClickFunc),b.remove(c,"keydown",this._keyHandler),
l.hide(c),this.isMenuVisible=0,a||this.collapse(1),this.element&&this.element.hide(),(j=l.get(this.id))&&l.removeClass(j.firstChild,this.classPrefix+"ItemActive"),this.onHideMenu.dispatch(this))},add:function(a){var b,a=this.parent(a);this.isRendered&&(b=l.get("menu_"+this.id))&&this._add(l.select("tbody",b)[0],a);return a},collapse:function(a){this.parent(a);this.hideMenu(1)},remove:function(a){l.remove(a.id);this.destroy();return this.parent(a)},destroy:function(){var a=l.get("menu_"+this.id);this.keyboardNav&&
this.keyboardNav.destroy();b.remove(a,"mouseover",this.mouseOverFunc);b.remove(l.select("a",a),"focus",this.mouseOverFunc);b.remove(a,"click",this.mouseClickFunc);b.remove(a,"keydown",this._keyHandler);this.element&&this.element.remove();l.remove(a)},renderNode:function(){var b=this,c=b.settings,j,e,g;g=l.create("div",{role:"listbox",id:"menu_"+b.id,"class":c["class"],style:"position:absolute;left:0;top:0;z-index:200000;outline:0"});b.settings.parent&&l.setAttrib(g,"aria-parent","menu_"+b.settings.parent.id);
e=l.add(g,"div",{role:"presentation",id:"menu_"+b.id+"_co","class":b.classPrefix+(c["class"]?" "+c["class"]:"")});b.element=new a("menu_"+b.id,{blocker:1,container:c.container});c.menu_line&&l.add(e,"span",{"class":b.classPrefix+"Line"});c=l.add(e,"table",{role:"presentation",id:"menu_"+b.id+"_tbl",border:0,cellPadding:0,cellSpacing:0});j=l.add(c,"tbody");f(b.items,function(a){b._add(j,a)});b.rendered=!0;return g},_setupKeyboardNav:function(){var a,b,j=this;a=l.get("menu_"+j.id);b=l.select("a[role=option]",
"menu_"+j.id);b.splice(0,0,a);j.keyboardNav=new c.ui.KeyboardNavigation({root:"menu_"+j.id,items:b,onCancel:function(){j.hideMenu()},enableUpDown:!0});a.focus()},_keyHandler:function(a){switch(a.keyCode){case 37:this.settings.parent&&(this.hideMenu(),this.settings.parent.focus(),b.cancel(a));break;case 39:this.mouseOverFunc&&this.mouseOverFunc(a)}},_add:function(a,b){var c,e=b.settings,g,f,h,i=this.classPrefix;e.separator?(f=l.add(a,"tr",{id:b.id,"class":i+"ItemSeparator"}),l.add(f,"td",{"class":i+
"ItemSeparator"}),(c=f.previousSibling)&&l.addClass(c,"mceLast")):(c=f=l.add(a,"tr",{id:b.id,"class":i+"Item "+i+"ItemEnabled"}),c=h=l.add(c,e.titleItem?"th":"td"),c=g=l.add(c,"a",{id:b.id+"_aria",role:e.titleItem?"presentation":"option",href:"javascript:;",onclick:"return false;",onmousedown:"return false;"}),e.parent&&(l.setAttrib(g,"aria-haspopup","true"),l.setAttrib(g,"aria-owns","menu_"+b.id)),l.addClass(h,e["class"]),g=l.add(c,"span",{"class":"mceIcon"+(e.icon?" mce_"+e.icon:"")}),e.icon_src&&
l.add(g,"img",{src:e.icon_src}),c=l.add(c,e.element||"span",{"class":"mceText",title:b.settings.title},b.settings.title),b.settings.style&&l.setAttrib(c,"style",b.settings.style),1==a.childNodes.length&&l.addClass(f,"mceFirst"),(c=f.previousSibling)&&l.hasClass(c,i+"ItemSeparator")&&l.addClass(f,"mceFirst"),b.collapse&&l.addClass(f,i+"ItemSub"),(c=f.previousSibling)&&l.removeClass(c,"mceLast"),l.addClass(f,"mceLast"))}})})(tinymce);
(function(c){var h=c.DOM;c.create("tinymce.ui.Button:tinymce.ui.Control",{Button:function(c,f,b){this.parent(c,f,b);this.classPrefix="mceButton"},renderHTML:function(){var c=this.classPrefix,f=this.settings,b,a;a=h.encode(f.label||"");b='<a role="button" id="'+this.id+'" href="javascript:;" class="'+c+" "+c+"Enabled "+f["class"]+(a?" "+c+"Labeled":"")+'" onmousedown="return false;" onclick="return false;" aria-labelledby="'+this.id+'_voice" title="'+h.encode(f.title)+'">';b=f.image&&(!this.editor||
!this.editor.forcedHighContrastMode)?b+('<img class="mceIcon" src="'+f.image+'" alt="'+h.encode(f.title)+'" />'+a):b+('<span class="mceIcon '+f["class"]+'"></span>'+(a?'<span class="'+c+'Label">'+a+"</span>":""));b+='<span class="mceVoiceLabel mceIconOnly" style="display: none;" id="'+this.id+'_voice">'+f.title+"</span>";return b+"</a>"},postRender:function(){var h=this,f=h.settings,b;c.isIE&&h.editor&&c.dom.Event.add(h.id,"mousedown",function(){b="IMG"===h.editor.selection.getNode().nodeName?h.editor.selection.getBookmark():
null});c.dom.Event.add(h.id,"click",function(a){if(!h.isDisabled())return c.isIE&&(h.editor&&null!==b)&&h.editor.selection.moveToBookmark(b),f.onclick.call(f.scope,a)});c.dom.Event.add(h.id,"keyup",function(a){if(!h.isDisabled()&&a.keyCode==c.VK.SPACEBAR)return f.onclick.call(f.scope,a)})}})})(tinymce);
(function(c){var h=c.DOM,l=c.dom.Event,f=c.each,b=c.util.Dispatcher;c.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(a,k,d){this.parent(a,k,d);this.items=[];this.onChange=new b(this);this.onPostRender=new b(this);this.onAdd=new b(this);this.onRenderMenu=new c.util.Dispatcher(this);this.classPrefix="mceListBox"},select:function(a){var b=this,c,j;if(void 0==a)return b.selectByIndex(-1);j=a&&"function"==typeof a?a:function(b){return b==a};a!=b.selectedValue&&(f(b.items,function(a,g){if(j(a.value))return c=
1,b.selectByIndex(g),!1}),c||b.selectByIndex(-1))},selectByIndex:function(a){var b,c,f;a!=this.selectedIndex&&(b=h.get(this.id+"_text"),f=h.get(this.id+"_voiceDesc"),(c=this.items[a])?(this.selectedValue=c.value,this.selectedIndex=a,h.setHTML(b,h.encode(c.title)),h.setHTML(f,this.settings.title+" - "+c.title),h.removeClass(b,"mceTitle"),h.setAttrib(this.id,"aria-valuenow",c.title)):(h.setHTML(b,h.encode(this.settings.title)),h.setHTML(f,h.encode(this.settings.title)),h.addClass(b,"mceTitle"),this.selectedValue=
this.selectedIndex=null,h.setAttrib(this.id,"aria-valuenow",this.settings.title)))},add:function(a,b,d){d=d||{};d=c.extend(d,{title:a,value:b});this.items.push(d);this.onAdd.dispatch(this,d)},getLength:function(){return this.items.length},renderHTML:function(){var a="",a=this.settings,b=this.classPrefix,a='<span role="listbox" aria-haspopup="true" aria-labelledby="'+this.id+'_voiceDesc" aria-describedby="'+this.id+'_voiceDesc"><table role="presentation" tabindex="0" id="'+this.id+'" cellpadding="0" cellspacing="0" class="'+
b+" "+b+"Enabled"+(a["class"]?" "+a["class"]:"")+'"><tbody><tr>',a=a+("<td>"+h.createHTML("span",{id:this.id+"_voiceDesc","class":"voiceLabel",style:"display:none;"},this.settings.title)),a=a+(h.createHTML("a",{id:this.id+"_text",tabindex:-1,href:"javascript:;","class":"mceText",onclick:"return false;",onmousedown:"return false;"},h.encode(this.settings.title))+"</td>"),a=a+("<td>"+h.createHTML("a",{id:this.id+"_open",tabindex:-1,href:"javascript:;","class":"mceOpen",onclick:"return false;",onmousedown:"return false;"},
'<span><span style="display:none;" class="mceIconOnly" aria-hidden="true">▼</span></span>')+"</td>");return a+"</tr></tbody></table></span>"},showMenu:function(){var a=this,b,d=h.get(this.id),j;if(!(a.isDisabled()||0==a.items.length)){if(a.menu&&a.menu.isMenuVisible)return a.hideMenu();a.isMenuRendered||(a.renderMenu(),a.isMenuRendered=!0);b=h.getPos(d);j=a.menu;j.settings.offset_x=b.x;j.settings.offset_y=b.y;j.settings.keyboard_focus=!c.isOpera;a.oldID&&j.items[a.oldID].setSelected(0);f(a.items,
function(b){if(b.value===a.selectedValue){j.items[b.id].setSelected(1);a.oldID=b.id}});j.showMenu(0,d.clientHeight);l.add(h.doc,"mousedown",a.hideMenu,a);h.addClass(a.id,a.classPrefix+"Selected")}},hideMenu:function(a){if(this.menu&&this.menu.isMenuVisible&&(h.removeClass(this.id,this.classPrefix+"Selected"),!a||!("mousedown"==a.type&&(a.target.id==this.id+"_text"||a.target.id==this.id+"_open"))))if(!a||!h.getParent(a.target,".mceMenu"))h.removeClass(this.id,this.classPrefix+"Selected"),l.remove(h.doc,
"mousedown",this.hideMenu,this),this.menu.hideMenu()},renderMenu:function(){var a=this,b;b=a.settings.control_manager.createDropMenu(a.id+"_menu",{menu_line:1,"class":a.classPrefix+"Menu mceNoIcons",max_width:150,max_height:150});b.onHideMenu.add(function(){a.hideMenu();a.focus()});b.add({title:a.settings.title,"class":"mceMenuItemTitle",onclick:function(){!1!==a.settings.onselect("")&&a.select("")}});f(a.items,function(c){void 0===c.value?b.add({title:c.title,role:"option","class":"mceMenuItemTitle",
onclick:function(){!1!==a.settings.onselect("")&&a.select("")}}):(c.id=h.uniqueId(),c.role="option",c.onclick=function(){!1!==a.settings.onselect(c.value)&&a.select(c.value)},b.add(c))});a.onRenderMenu.dispatch(a,b);a.menu=b},postRender:function(){var a=this,b=a.classPrefix;l.add(a.id,"click",a.showMenu,a);l.add(a.id,"keydown",function(b){32==b.keyCode&&(a.showMenu(b),l.cancel(b))});l.add(a.id,"focus",function(){a._focused||(a.keyDownHandler=l.add(a.id,"keydown",function(b){40==b.keyCode&&(a.showMenu(),
l.cancel(b))}),a.keyPressHandler=l.add(a.id,"keypress",function(b){var c;13==b.keyCode&&(c=a.selectedValue,a.selectedValue=null,l.cancel(b),a.settings.onselect(c))}));a._focused=1});l.add(a.id,"blur",function(){l.remove(a.id,"keydown",a.keyDownHandler);l.remove(a.id,"keypress",a.keyPressHandler);a._focused=0});if(c.isIE6||!h.boxModel)l.add(a.id,"mouseover",function(){h.hasClass(a.id,b+"Disabled")||h.addClass(a.id,b+"Hover")}),l.add(a.id,"mouseout",function(){h.hasClass(a.id,b+"Disabled")||h.removeClass(a.id,
b+"Hover")});a.onPostRender.dispatch(a,h.get(a.id))},destroy:function(){this.parent();l.clear(this.id+"_text");l.clear(this.id+"_open")}})})(tinymce);
(function(c){var h=c.DOM,l=c.dom.Event,f=c.each;c.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox",{NativeListBox:function(b,a){this.parent(b,a);this.classPrefix="mceNativeListBox"},setDisabled:function(b){h.get(this.id).disabled=b;this.setAriaProperty("disabled",b)},isDisabled:function(){return h.get(this.id).disabled},select:function(b){var a=this,c,d;if(void 0==b)return a.selectByIndex(-1);d=b&&"function"==typeof b?b:function(a){return a==b};b!=a.selectedValue&&(f(a.items,function(b,e){if(d(b.value))return c=
1,a.selectByIndex(e),!1}),c||a.selectByIndex(-1))},selectByIndex:function(b){h.get(this.id).selectedIndex=b+1;this.selectedValue=this.items[b]?this.items[b].value:null},add:function(b,a,c){c=c||{};c.value=a;this.isRendered()&&h.add(h.get(this.id),"option",c,b);b={title:b,value:a,attribs:c};this.items.push(b);this.onAdd.dispatch(this,b)},getLength:function(){return this.items.length},renderHTML:function(){var b;b=h.createHTML("option",{value:""},"-- "+this.settings.title+" --");f(this.items,function(a){b+=
h.createHTML("option",{value:a.value},a.title)});b=h.createHTML("select",{id:this.id,"class":"mceNativeListBox","aria-labelledby":this.id+"_aria"},b);return b+=h.createHTML("span",{id:this.id+"_aria",style:"display: none"},this.settings.title)},postRender:function(){function b(b){if((b=a.items[b.target.selectedIndex-1])&&(b=b.value))if(a.onChange.dispatch(a,b),a.settings.onselect)a.settings.onselect(b)}var a=this,f=!0;a.rendered=!0;l.add(a.id,"change",b);l.add(a.id,"keydown",function(d){var j;l.remove(a.id,
"change",void 0);f=!1;j=l.add(a.id,"blur",function(){f||(f=!0,l.add(a.id,"change",b),l.remove(a.id,"blur",j))});if(c.isWebKit&&(37==d.keyCode||39==d.keyCode))return l.prevent(d);if(13==d.keyCode||32==d.keyCode)return b(d),l.cancel(d)});a.onPostRender.dispatch(a,h.get(a.id))}})})(tinymce);
(function(c){var h=c.DOM,l=c.dom.Event;c.create("tinymce.ui.MenuButton:tinymce.ui.Button",{MenuButton:function(f,b,a){this.parent(f,b,a);this.onRenderMenu=new c.util.Dispatcher(this);b.menu_container=b.menu_container||h.doc.body},showMenu:function(){var c,b=h.get(this.id),a;if(!this.isDisabled()){this.isMenuRendered||(this.renderMenu(),this.isMenuRendered=!0);if(this.isMenuVisible)return this.hideMenu();h.getPos(this.settings.menu_container);c=h.getPos(b);a=this.menu;a.settings.offset_x=c.x;a.settings.offset_y=
c.y;a.settings.vp_offset_x=c.x;a.settings.vp_offset_y=c.y;a.settings.keyboard_focus=this._focused;a.showMenu(0,b.clientHeight);l.add(h.doc,"mousedown",this.hideMenu,this);this.setState("Selected",1);this.isMenuVisible=1}},renderMenu:function(){var c=this,b;b=c.settings.control_manager.createDropMenu(c.id+"_menu",{menu_line:1,"class":this.classPrefix+"Menu",icons:c.settings.icons});b.onHideMenu.add(function(){c.hideMenu();c.focus()});c.onRenderMenu.dispatch(c,b);c.menu=b},hideMenu:function(c){var b=
this;if(!c||!("mousedown"==c.type&&h.getParent(c.target,function(a){return a.id===b.id||a.id===b.id+"_open"}))){if(!c||!h.getParent(c.target,".mceMenu"))b.setState("Selected",0),l.remove(h.doc,"mousedown",b.hideMenu,b),b.menu&&b.menu.hideMenu();b.isMenuVisible=0}},postRender:function(){var c=this,b=c.settings;l.add(c.id,"click",function(){if(!c.isDisabled()){if(b.onclick)b.onclick(c.value);c.showMenu()}})}})})(tinymce);
(function(c){var h=c.DOM,l=c.dom.Event;c.create("tinymce.ui.SplitButton:tinymce.ui.MenuButton",{SplitButton:function(c,b,a){this.parent(c,b,a);this.classPrefix="mceSplitButton"},renderHTML:function(){var c,b=this.settings,a;c="<tbody><tr>";a=b.image?h.createHTML("img ",{src:b.image,role:"presentation","class":"mceAction "+b["class"]}):h.createHTML("span",{"class":"mceAction "+b["class"]},"");a+=h.createHTML("span",{"class":"mceVoiceLabel mceIconOnly",id:this.id+"_voice",style:"display:none;"},b.title);
c+="<td >"+h.createHTML("a",{role:"button",id:this.id+"_action",tabindex:"-1",href:"javascript:;","class":"mceAction "+b["class"],onclick:"return false;",onmousedown:"return false;",title:b.title},a)+"</td>";a=h.createHTML("span",{"class":"mceOpen "+b["class"]},'<span style="display:none;" class="mceIconOnly" aria-hidden="true">▼</span>');c+="<td >"+h.createHTML("a",{role:"button",id:this.id+"_open",tabindex:"-1",href:"javascript:;","class":"mceOpen "+b["class"],onclick:"return false;",onmousedown:"return false;",
title:b.title},a)+"</td>";c=h.createHTML("table",{role:"presentation","class":"mceSplitButton mceSplitButtonEnabled "+b["class"],cellpadding:"0",cellspacing:"0",title:b.title},c+"</tr></tbody>");return h.createHTML("div",{id:this.id,role:"button",tabindex:"0","aria-labelledby":this.id+"_voice","aria-haspopup":"true"},c)},postRender:function(){var f=this,b=f.settings,a;b.onclick&&(a=function(a){f.isDisabled()||(b.onclick(f.value),l.cancel(a))},l.add(f.id+"_action","click",a),l.add(f.id,["click","keydown"],
function(b){if((32===b.keyCode||13===b.keyCode||14===b.keyCode)&&!b.altKey&&!b.ctrlKey&&!b.metaKey)a(),l.cancel(b);else if("click"===b.type||40===b.keyCode)f.showMenu(),l.cancel(b)}));l.add(f.id+"_open","click",function(a){f.showMenu();l.cancel(a)});l.add([f.id,f.id+"_open"],"focus",function(){f._focused=1});l.add([f.id,f.id+"_open"],"blur",function(){f._focused=0});if(c.isIE6||!h.boxModel)l.add(f.id,"mouseover",function(){h.hasClass(f.id,"mceSplitButtonDisabled")||h.addClass(f.id,"mceSplitButtonHover")}),
l.add(f.id,"mouseout",function(){h.hasClass(f.id,"mceSplitButtonDisabled")||h.removeClass(f.id,"mceSplitButtonHover")})},destroy:function(){this.parent();l.clear(this.id+"_action");l.clear(this.id+"_open");l.clear(this.id)}})})(tinymce);
(function(c){var h=c.DOM,l=c.dom.Event,f=c.is,b=c.each;c.create("tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton",{ColorSplitButton:function(a,b,d){this.parent(a,b,d);this.settings=b=c.extend({colors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",grid_width:8,default_color:"#888888"},
this.settings);this.onShowMenu=new c.util.Dispatcher(this);this.onHideMenu=new c.util.Dispatcher(this);this.value=b.default_color},showMenu:function(){var a=this,b,c;if(!a.isDisabled()){a.isMenuRendered||(a.renderMenu(),a.isMenuRendered=!0);if(a.isMenuVisible)return a.hideMenu();b=h.get(a.id);h.show(a.id+"_menu");h.addClass(b,"mceSplitButtonSelected");c=h.getPos(b);h.setStyles(a.id+"_menu",{left:c.x,top:c.y+b.clientHeight,zIndex:2E5});b=0;l.add(h.doc,"mousedown",a.hideMenu,a);a.onShowMenu.dispatch(a);
a._focused&&(a._keyHandler=l.add(a.id+"_menu","keydown",function(b){b.keyCode==27&&a.hideMenu()}),h.select("a",a.id+"_menu")[0].focus());a.isMenuVisible=1}},hideMenu:function(a){var b=this;if(b.isMenuVisible&&(!a||!("mousedown"==a.type&&h.getParent(a.target,function(a){return a.id===b.id+"_open"})))){if(!a||!h.getParent(a.target,".mceSplitButtonMenu"))h.removeClass(b.id,"mceSplitButtonSelected"),l.remove(h.doc,"mousedown",b.hideMenu,b),l.remove(b.id+"_menu","keydown",b._keyHandler),h.hide(b.id+"_menu");
b.isMenuVisible=0;b.onHideMenu.dispatch()}},renderMenu:function(){var a=this,k,d=0,j=a.settings,e,g,n,u,i;u=h.add(j.menu_container,"div",{role:"listbox",id:a.id+"_menu","class":j.menu_class+" "+j["class"],style:"position:absolute;left:0;top:-1000px;"});k=h.add(u,"div",{"class":j["class"]+" mceSplitButtonMenu"});h.add(k,"span",{"class":"mceMenuLine"});e=h.add(k,"table",{role:"presentation","class":"mceColorSplitMenu"});g=h.add(e,"tbody");d=0;b(f(j.colors,"array")?j.colors:j.colors.split(","),function(b){b=
b.replace(/^#/,"");d--||(n=h.add(g,"tr"),d=j.grid_width-1);e=h.add(n,"td");var f={href:"javascript:;",style:{backgroundColor:"#"+b},title:a.editor.getLang("colors."+b,b),"data-mce-color":"#"+b};c.isIE||(f.role="option");e=h.add(e,"a",f);a.editor.forcedHighContrastMode&&(e=h.add(e,"canvas",{width:16,height:16,"aria-hidden":"true"}),e.getContext&&(i=e.getContext("2d"))?(i.fillStyle="#"+b,i.fillRect(0,0,16,16)):h.remove(e))});j.more_colors_func&&(e=h.add(g,"tr"),e=h.add(e,"td",{colspan:j.grid_width,
"class":"mceMoreColors"}),e=h.add(e,"a",{role:"option",id:a.id+"_more",href:"javascript:;",onclick:"return false;","class":"mceMoreColors"},j.more_colors_title),l.add(e,"click",function(a){j.more_colors_func.call(j.more_colors_scope||this);return l.cancel(a)}));h.addClass(k,"mceColorSplitMenu");new c.ui.KeyboardNavigation({root:a.id+"_menu",items:h.select("a",a.id+"_menu"),onCancel:function(){a.hideMenu();a.focus()}});l.add(a.id+"_menu","mousedown",function(a){return l.cancel(a)});l.add(a.id+"_menu",
"click",function(b){var c;(b=h.getParent(b.target,"a",g))&&(b.nodeName.toLowerCase()=="a"&&(c=b.getAttribute("data-mce-color")))&&a.setColor(c);return l.cancel(b)});return u},setColor:function(a){this.displayColor(a);this.hideMenu();this.settings.onselect(a)},displayColor:function(a){h.setStyle(this.id+"_preview","backgroundColor",a);this.value=a},postRender:function(){var a=this.id;this.parent();h.add(a+"_action","div",{id:a+"_preview","class":"mceColorPreview"});h.setStyle(this.id+"_preview","backgroundColor",
this.value)},destroy:function(){this.parent();l.clear(this.id+"_menu");l.clear(this.id+"_more");h.remove(this.id+"_menu")}})})(tinymce);
(function(c){var h=c.DOM,l=c.each,f=c.dom.Event;c.create("tinymce.ui.ToolbarGroup:tinymce.ui.Container",{renderHTML:function(){var b=[],a=this.controls,f=c.each,d=this.settings;b.push('<div id="'+this.id+'" role="group" aria-labelledby="'+this.id+'_voice">');b.push("<span role='application'>");b.push('<span id="'+this.id+'_voice" class="mceVoiceLabel" style="display:none;">'+h.encode(d.name)+"</span>");f(a,function(a){b.push(a.renderHTML())});b.push("</span>");b.push("</div>");return b.join("")},
focus:function(){h.get(this.id).focus()},postRender:function(){var b=this,a=[];l(b.controls,function(b){l(b.controls,function(b){b.id&&a.push(b)})});b.keyNav=new c.ui.KeyboardNavigation({root:b.id,items:a,onCancel:function(){c.isWebKit&&h.get(b.editor.id+"_ifr").focus();b.editor.focus()},excludeFromTabOrder:!b.settings.tab_focus_toolbar})},destroy:function(){this.parent();this.keyNav.destroy();f.clear(this.id)}})})(tinymce);
(function(c){var h=c.DOM;c.create("tinymce.ui.Toolbar:tinymce.ui.Container",{renderHTML:function(){var c="",f,b,a=this.settings,k,d,j,e;e=this.controls;for(k=0;k<e.length;k++){b=e[k];d=e[k-1];j=e[k+1];0===k&&(f="mceToolbarStart",b.Button?f+=" mceToolbarStartButton":b.SplitButton?f+=" mceToolbarStartSplitButton":b.ListBox&&(f+=" mceToolbarStartListBox"),c+=h.createHTML("td",{"class":f},h.createHTML("span",null,"<\!-- IE --\>")));if(d&&b.ListBox&&(d.Button||d.SplitButton))c+=h.createHTML("td",{"class":"mceToolbarEnd"},
h.createHTML("span",null,"<\!-- IE --\>"));c=h.stdMode?c+('<td style="position: relative">'+b.renderHTML()+"</td>"):c+("<td>"+b.renderHTML()+"</td>");if(j&&b.ListBox&&(j.Button||j.SplitButton))c+=h.createHTML("td",{"class":"mceToolbarStart"},h.createHTML("span",null,"<\!-- IE --\>"))}f="mceToolbarEnd";b.Button?f+=" mceToolbarEndButton":b.SplitButton?f+=" mceToolbarEndSplitButton":b.ListBox&&(f+=" mceToolbarEndListBox");c+=h.createHTML("td",{"class":f},h.createHTML("span",null,"<\!-- IE --\>"));return h.createHTML("table",
{id:this.id,"class":"mceToolbar"+(a["class"]?" "+a["class"]:""),cellpadding:"0",cellspacing:"0",align:this.settings.align||"",role:"presentation",tabindex:"-1"},"<tbody><tr>"+c+"</tr></tbody>")}})})(tinymce);
(function(c){var h=c.util.Dispatcher;c.create("tinymce.AddOnManager",{AddOnManager:function(){this.items=[];this.urls={};this.lookup={};this.onAdd=new h(this)},get:function(c){if(this.lookup[c])return this.lookup[c].instance},dependencies:function(c){var f;this.lookup[c]&&(f=this.lookup[c].dependencies);return f||[]},requireLangPack:function(h){var f=c.settings;f&&(f.language&&!1!==f.language_load)&&c.ScriptLoader.add(this.urls[h]+"/langs/"+f.language+".js")},add:function(c,f,b){this.items.push(f);
this.lookup[c]={instance:f,dependencies:b};this.onAdd.dispatch(this,c,f);return f},createUrl:function(c,f){return"object"===typeof f?f:{prefix:c.prefix,resource:f,suffix:c.suffix}},addComponents:function(h,f){var b=this.urls[h];c.each(f,function(a){c.ScriptLoader.add(b+"/"+a)})},load:function(h,f,b,a){function k(){var e=d.dependencies(h);c.each(e,function(a){a=d.createUrl(f,a);d.load(a.resource,a,void 0,void 0)});b&&(a?b.call(a):b.call(c.ScriptLoader))}var d=this,j=f;d.urls[h]||("object"===typeof f&&
(j=f.prefix+f.resource+f.suffix),0!=j.indexOf("/")&&-1==j.indexOf("://")&&(j=c.baseURL+"/"+j),d.urls[h]=j.substring(0,j.lastIndexOf("/")),c.settings.atlassian||(d.lookup[h]?k():c.ScriptLoader.add(j,k,a)))}});c.PluginManager=new c.AddOnManager;c.ThemeManager=new c.AddOnManager})(tinymce);
(function(c){var h=c.each,l=c.extend,f=c.DOM,b=c.dom.Event,a=c.explode,k=c.util.Dispatcher,d=0;c.documentBaseURL=c.baseURL;AJS.log("tinymce.documentBaseURL = "+c.documentBaseURL);/[\/\\]$/.test(c.documentBaseURL)||(c.documentBaseURL+="/");c.baseURL=(new c.util.URI(c.documentBaseURL)).toAbsolute(c.baseURL);c.baseURI=new c.util.URI(c.baseURL);c.onBeforeUnload=new k(c);b.add(window,"beforeunload",function(a){c.onBeforeUnload.dispatch(c,a)});c.onAddEditor=new k(c);c.onRemoveEditor=new k(c);c.EditorManager=
l(c,{editors:[],i18n:{},activeEditor:null,init:function(j){function e(a,b,e){var d=a[b];if(d){if(c.is(d,"string")){e=(e=d.replace(/\.\w+$/,""))?c.resolve(e):0;d=c.resolve(d)}return d.apply(e||this,Array.prototype.slice.call(arguments,2))}}function g(){var b,g;e(j,"onpageload");switch(j.mode){case "exact":b=j.elements||"";b.length>0&&h(a(b),function(a){if(f.get(a)){m=new c.Editor(a,j);i.push(m);m.render(1)}else h(document.forms,function(b){h(b.elements,function(b){if(b.name===a){a="mce_editor_"+d++;
f.setAttrib(b,"id",a);m=new c.Editor(a,j);i.push(m);m.render(1)}})})});break;case "textareas":case "specific_textareas":h(f.select("textarea"),function(a){if(!j.editor_deselector||!(j.editor_deselector.constructor===RegExp?j.editor_deselector.test(a.className):f.hasClass(a,j.editor_deselector)))if(!j.editor_selector||(j.editor_selector.constructor===RegExp?j.editor_selector.test(a.className):f.hasClass(a,j.editor_selector))){u=f.get(a.name);if(!a.id&&!u)a.id=a.name;if(!a.id||k.get(a.id))a.id=f.uniqueId();
m=new c.Editor(a.id,j);i.push(m);m.render(1)}})}if(j.oninit){b=g=0;h(i,function(a){g++;a.initialized?b++:a.onInit.add(function(){b++;b==g&&e(j,"oninit")});b==g&&e(j,"oninit")})}}var k=this,u,i=[],m,j=l({theme:"simple",language:"en"},j);k.settings=j;j.atlassian?g():b.add(document,"init",g)},get:function(a){return a===void 0?this.editors:this.editors[a]},getInstanceById:function(a){return this.get(a)},add:function(a){var b=this.editors;b[a.id]=a;b.push(a);this._setActive(a);this.onAddEditor.dispatch(this,
a);c.adapter&&c.adapter.patchEditor(a);return a},remove:function(a){var b,c=this.editors;if(!c[a.id])return null;delete c[a.id];for(b=0;b<c.length;b++)if(c[b]==a){c.splice(b,1);break}this.activeEditor==a&&this._setActive(c[0]);a.destroy();this.onRemoveEditor.dispatch(this,a);return a},execCommand:function(a,b,d){var f=this.get(d),h;switch(a){case "mceFocus":f.focus();return true;case "mceAddEditor":case "mceAddControl":this.get(d)||(new c.Editor(d,this.settings)).render();return true;case "mceAddFrameControl":h=
d.window;h.tinyMCE=tinyMCE;h.tinymce=c;c.DOM.doc=h.document;c.DOM.win=h;f=new c.Editor(d.element_id,d);f.render();if(c.isIE){var i=function(){f.destroy();h.detachEvent("onunload",i);h=h.tinyMCE=h.tinymce=null};h.attachEvent("onunload",i)}d.page_window=null;return true;case "mceRemoveEditor":case "mceRemoveControl":f&&f.remove();return true;case "mceToggleEditor":if(!f){this.execCommand("mceAddControl",0,d);return true}f.isHidden()?f.show():f.hide();return true}return this.activeEditor?this.activeEditor.execCommand(a,
b,d):false},execInstanceCommand:function(a,b,c,d){return(a=this.get(a))?a.execCommand(b,c,d):false},triggerSave:function(){h(this.editors,function(a){a.save()})},addI18n:function(a,b){var d=this.i18n;c.is(a,"string")?h(b,function(b,c){d[a+"."+c]=b}):h(a,function(a,b){h(a,function(a,c){h(a,function(a,e){c==="common"?d[b+"."+e]=a:d[b+"."+c+"."+e]=a})})})},_setActive:function(a){this.selectedInstance=this.activeEditor=a}})})(tinymce);
(function(c){var h=c.DOM,l=c.dom.Event,f=c.extend,b=c.util.Dispatcher,a=c.each,k=c.isGecko,d=c.isIE,j=c.is,e=c.ThemeManager,g=c.PluginManager,n=c.explode,u=c.VK;c.create("tinymce.Editor",{Editor:function(d,e){var g=this;g.id=g.editorId=d;g.execCommands={};g.queryStateCommands={};g.queryValueCommands={};g.isNotDirty=!1;g.plugins={};a("onPreInit onBeforeRenderUI onPostRender onLoad onInit onRemove onActivate onDeactivate onClick onEvent onMouseUp onMouseDown onDblClick onKeyDown onKeyUp onKeyPress onContextMenu onSubmit onReset onPaste onPreProcess onPostProcess onBeforeSetContent onBeforeGetContent onSetContent onGetContent onLoadContent onSaveContent onNodeChange onChange onBeforeExecCommand onExecCommand onUndo onRedo onVisualAid onSetProgressState onSetAttrib".split(" "),
function(a){g[a]=new b(g)});g.settings=e=f({id:d,language:"en",docs_language:"en",theme:"simple",skin:"default",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:c.documentBaseURL,add_form_submit_trigger:1,submit_patch:1,add_unload_trigger:1,convert_urls:1,relative_urls:1,remove_script_host:1,table_inline_editing:0,object_resizing:1,cleanup:1,accessibility_focus:1,custom_shortcuts:1,custom_undo_redo_keyboard_shortcuts:1,custom_undo_redo_restore_selection:1,custom_undo_redo:1,
doctype:c.isIE6?'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">':"<!DOCTYPE html>",visual_table_class:"mceItemTable",visual:1,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",apply_source_formatting:1,directionality:"ltr",forced_root_block:"p",hidden_input:1,padd_empty_editor:1,render_ui:1,init_theme:1,force_p_newlines:1,indentation:"30px",keep_styles:1,fix_table_elements:1,inline_styles:1,
convert_fonts_to_spans:!0,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr",validate:!0,entity_encoding:"named",url_converter:g.convertURL,url_converter_scope:g,ie7_compat:!0},e);g.documentBaseURI=new c.util.URI(e.document_base_url||c.documentBaseURL,{base_uri:tinyMCE.baseURI});g.baseURI=c.baseURI;g.contentCSS=
[];g.execCallback("setup",g)},render:function(){var b=this,d=b.settings,f=b.id,k=c.ScriptLoader;if(!d.atlassian&&!l.domLoaded)l.add(document,"init",function(){b.render()});else if(tinyMCE.settings=d,b.getElement()&&(!c.isIDevice||c.isIOS5))!/TEXTAREA|INPUT/i.test(b.getElement().nodeName)&&(d.hidden_input&&h.getParent(f,"form"))&&h.insertAfter(h.create("input",{type:"hidden",name:f}),f),c.WindowManager&&(b.windowManager=new c.WindowManager(b)),"xml"==d.encoding&&b.onGetContent.add(function(a,b){if(b.save)b.content=
h.encode(b.content)}),d.add_form_submit_trigger&&b.onSubmit.addToTop(function(){if(b.initialized){b.save();b.isNotDirty=1}}),d.add_unload_trigger&&(b._beforeUnload=tinyMCE.onBeforeUnload.add(function(){b.initialized&&(!b.destroyed&&!b.isHidden())&&b.save({format:"raw",no_events:true})})),c.addUnload(b.destroy,b),d.submit_patch&&b.onBeforeRenderUI.add(function(){var a=b.getElement().form;if(a&&!a._mceOldSubmit){if(!a.submit.nodeType&&!a.submit.length){b.formElement=a;a._mceOldSubmit=a.submit;a.submit=
function(){c.triggerSave();b.isNotDirty=1;return b.formElement._mceOldSubmit(b.formElement)}}a=null}}),f=function(){b.removed||b.init()},d.theme&&("-"!=d.theme.charAt(0)&&!e.urls[d.theme])&&e.load(d.theme,"themes/"+d.theme+"/editor_template"+c.suffix+".js"),a(n(d.plugins),function(b){if(b&&!g.urls[b])if(b.charAt(0)=="-"){b=b.substr(1,b.length);b=g.dependencies(b);a(b,function(a){a=g.createUrl({prefix:"plugins/",resource:a,suffix:"/editor_plugin"+c.suffix+".js"},a);g.load(a.resource,a)})}else b!="safari"&&
g.load(b,{prefix:"plugins/",resource:b,suffix:"/editor_plugin"+c.suffix+".js"})}),d.atlassian?f():k.loadQueue(f)},init:function(){function b(d){var e=g.get(d),f=g.urls[d]||c.documentBaseURL.replace(/\/$/,"");e&&-1===c.inArray(t,d)&&(a(g.dependencies(d),function(a){b(a)}),e=new e(m,f),m.plugins[d]=e,e.init&&(e.init(m,f),t.push(d)),AJS.log("initPlugin: "+d+" initialised"))}var m=this,j=m.settings,l,s,p=m.getElement(),A,u,x,t=[];c.add(m);j.aria_label=j.aria_label||h.getAttrib(p,"aria-label",m.getLang("aria.rich_text_area"));
j.theme&&(j.theme=j.theme.replace(/-/,""),A=e.get(j.theme),m.theme=new A,m.theme.init&&j.init_theme&&m.theme.init(m,e.urls[j.theme]||c.documentBaseURL.replace(/\/$/,"")));a(n(j.plugins.replace(/\-/g,"")),b);!1!==j.popup_css&&(j.popup_css=j.popup_css?m.documentBaseURI.toAbsolute(j.popup_css):m.baseURI.toAbsolute("themes/"+j.theme+"/skins/"+j.skin+"/dialog.css"));j.popup_css_add&&(j.popup_css+=","+m.documentBaseURI.toAbsolute(j.popup_css_add));m.controlManager=new c.ControlManager(m);j.custom_undo_redo&&
(m.onBeforeExecCommand.add(function(a,b,c,d,e){b!="Undo"&&(b!="Redo"&&b!="mceRepaint"&&(!e||!e.skip_undo))&&m.undoManager.beforeChange()}),m.onExecCommand.add(function(a,b,c,d,e){b!="Undo"&&(b!="Redo"&&b!="mceRepaint"&&(!e||!e.skip_undo))&&m.undoManager.add()}));m.onExecCommand.add(function(a,b){/^(FontName|FontSize)$/.test(b)||m.nodeChanged()});k&&(x=function(a,b){(!b||!b.initial)&&m.execCommand("mceRepaint")},m.onUndo.add(x),m.onRedo.add(x),m.onSetContent.add(x));m.onBeforeRenderUI.dispatch(m,m.controlManager);
j.render_ui&&(l=j.width||p.style.width||p.offsetWidth,s=j.height||p.style.height||p.offsetHeight,m.orgDisplay=p.style.display,x=/^[0-9\.]+(|px)$/i,x.test(""+l)&&(l=Math.max(parseInt(l)+(A.deltaWidth||0),100)),x.test(""+s)&&(s=Math.max(parseInt(s)+(A.deltaHeight||0),100)),A=m.theme.renderUI({targetNode:p,width:l,height:s,deltaWidth:j.delta_width,deltaHeight:j.delta_height}),m.editorContainer=A.editorContainer);if(j.content_editable)return p=A=null,m.setupContentEditable();document.domain&&location.hostname!=
document.domain&&(c.relaxedDomain=document.domain);h.setStyles(A.sizeContainer||A.editorContainer,{width:l,height:s});j.content_css&&c.each(n(j.content_css),function(a){m.contentCSS.push(m.documentBaseURI.toAbsolute(a))});100>s&&(s=100);m.iframeHTML=j.doctype+'<html><head xmlns="http://www.w3.org/1999/xhtml">';m.iframeHTML=j.ie7_compat?m.iframeHTML+'<meta http-equiv="X-UA-Compatible" content="IE=7" />':m.iframeHTML+'<meta http-equiv="X-UA-Compatible" content="IE=edge" />';m.iframeHTML+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
for(l=0;l<m.contentCSS.length;l++)m.iframeHTML+='<link type="text/css" rel="stylesheet" href="'+m.contentCSS[l]+'" />';j.contentCssTags&&(m.iframeHTML+=j.contentCssTags);m.contentCSS=[];l=j.body_id||"tinymce";-1!=l.indexOf("=")&&(l=m.getParam("body_id","","hash"),l=l[m.id]||l);p=j.body_class||"";-1!=p.indexOf("=")&&(p=m.getParam("body_class","","hash"),p=p[m.id]||"");m.iframeHTML+='</head><body id="'+l+'" class="mceContentBody aui-theme-default '+p+'" onload="window.parent.tinyMCE.get(\''+m.id+"').onLoad.dispatch();\"><br></body></html>";
if(c.relaxedDomain&&(d||c.isOpera&&11>parseFloat(opera.version())))u='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+m.id+'");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()';j.iframe_attr=j.iframe_attr||{};j.iframe_attr=f(j.iframe_attr,{id:m.id+"_ifr",src:u||'javascript:""',frameBorder:"0",allowTransparency:"true",title:j.aria_label,style:{width:"100%",height:s,display:"block"}});h.add(A.iframeContainer,"iframe",
j.iframe_attr);m.contentAreaContainer=A.iframeContainer;h.get(A.editorContainer).style.display=m.orgDisplay;h.get(m.id).style.display="none";h.setAttrib(m.id,"aria-hidden",!0);(!c.relaxedDomain||!u)&&m.setupIframe();p=A=null},setupIframe:function(){var b=this,e=b.settings;h.get(b.id);var g=b.getDoc();if(!d||!c.relaxedDomain)g.open(),g.write(b.iframeHTML),g.close(),c.relaxedDomain&&(g.domain=c.relaxedDomain);g=b.getBody();g.disabled=!0;e.readonly||(g.contentEditable=!0);g.disabled=!1;b.schema=new c.html.Schema(e);
b.dom=new c.dom.DOMUtils(b.getDoc(),{keep_values:!0,url_converter:b.convertURL,url_converter_scope:b,hex_colors:e.force_hex_style_colors,class_filter:e.class_filter,update_styles:1,fix_ie_paragraphs:1,schema:b.schema});b.parser=new c.html.DomParser(e,b.schema);b.settings.allow_html_in_named_anchor||b.parser.addAttributeFilter("name",function(a){for(var b=a.length,c,d,e,i;b--;){i=a[b];if(i.name==="a"&&i.firstChild){e=i.parent;c=i.lastChild;do{d=c.prev;e.insert(c,i);c=d}while(c)}}});b.parser.addAttributeFilter("src,href,style",
function(a,c){for(var d=a.length,e,g=b.dom,m,f;d--;){e=a[d];m=e.attr(c);f="data-mce-"+c;e.attributes.map[f]||(c==="style"?e.attr(f,g.serializeStyle(g.parseStyle(m),e.name)):e.attr(f,b.convertURL(m,c,e.name)))}});b.parser.addNodeFilter("script",function(a){for(var b=a.length,c;b--;){c=a[b];c.attr("type","mce-"+(c.attr("type")||"text/javascript"))}});b.parser.addNodeFilter("#cdata",function(a){for(var b=a.length,c;b--;){c=a[b];c.type=8;c.name="#comment";c.value="[CDATA["+c.value+"]]"}});b.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",
function(a){var d=a.length,e;for(b.schema.getNonEmptyElements();d--;){e=a[d];if(e.isEmpty(b.schema))e.empty().append(new c.html.Node("br",1)).shortEnded=true}});b.serializer=new c.dom.Serializer(e,b.dom,b.schema);b.selection=new c.dom.Selection(b.dom,b.getWin(),b.serializer);b.formatter=new c.Formatter(this);b.formatter.register({alignleft:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"left"}},{selector:"img.confluence-embedded-image",classes:"image-left"},{selector:"img,table",
collapsed:!1,styles:{"float":"left"}}],aligncenter:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"center"}},{selector:"img.confluence-embedded-image",classes:"image-center"},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"}}],alignright:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"right"}},{selector:"img.confluence-embedded-image",classes:"image-right"},{selector:"img,table",collapsed:!1,styles:{"float":"right"}}],alignfull:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",
styles:{textAlign:"justify"}}],bold:[{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all"}],italic:[{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all"}],underline:[{inline:"u",remove:"all"},{inline:"span",styles:{textDecoration:"underline"},exact:!0}],strikethrough:[{inline:"s",remove:"all"}],forecolor:{inline:"span",styles:{color:"%value"},wrap_links:!1},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},
wrap_links:!1},fontname:{inline:"span",styles:{fontFamily:"%value"}},fontsize:{inline:"span",styles:{fontSize:"%value"}},fontsize_class:{inline:"span",attributes:{"class":"%value"}},blockquote:{block:"blockquote",wrapper:1,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:function(){return true},onformat:function(c,e,d){a(d,function(a,d){b.dom.setAttrib(c,d,a)})}},removeformat:[{selector:"b,strong,em,i,font,u,strike",
remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]});a("p h1 h2 h3 h4 h5 h6 div address pre div code dt dd samp".split(/\s/),function(a){b.formatter.register(a,{block:a,remove:"all"})});b.formatter.register(b.settings.formats);b.undoManager=new c.UndoManager(b);b.undoManager.onAdd.add(function(a,c){if(a.hasUndo())return b.onChange.dispatch(b,
c,a)});b.undoManager.onUndo.add(function(a,c){return b.onUndo.dispatch(b,c,a)});b.undoManager.onRedo.add(function(a,c){return b.onRedo.dispatch(b,c,a)});b.forceBlocks=new c.ForceBlocks(b,{forced_root_block:e.forced_root_block});b.editorCommands=new c.EditorCommands(b);b.serializer.onPreProcess.add(function(a,c){return b.onPreProcess.dispatch(b,c,a)});b.serializer.onPostProcess.add(function(a,c){return b.onPostProcess.dispatch(b,c,a)});AJS.log("Editor:setupIframe: dispatch onPreInit");b.onPreInit.dispatch(b);
e.gecko_spellcheck||(b.getBody().spellcheck=0);e.readonly||b._addEvents();AJS.log("Editor:setupIframe: dispatch controlManager onPostRender");b.controlManager.onPostRender.dispatch(b,b.controlManager);AJS.log("Editor:setupIframe: dispatch onPostRender");b.onPostRender.dispatch(b);b.quirks=new c.util.Quirks(this);e.directionality&&(b.getBody().dir=e.directionality);e.nowrap&&(b.getBody().style.whiteSpace="nowrap");e.handle_node_change_callback&&b.onNodeChange.add(function(a,c,d){b.execCallback("handle_node_change_callback",
b.id,d,-1,-1,true,b.selection.isCollapsed())});e.save_callback&&b.onSaveContent.add(function(a,c){var d=b.execCallback("save_callback",b.id,c.content,b.getBody());if(d)c.content=d});e.onchange_callback&&b.onChange.add(function(a,c){b.execCallback("onchange_callback",b,c)});e.protect&&b.onBeforeSetContent.add(function(b,c){e.protect&&a(e.protect,function(a){c.content=c.content.replace(a,function(a){return"<\!--mce:protected "+escape(a)+"--\>"})})});e.convert_newlines_to_brs&&b.onBeforeSetContent.add(function(a,
b){if(b.initial)b.content=b.content.replace(/\r?\n/g,"<br />")});e.preformatted&&b.onPostProcess.add(function(a,b){b.content=b.content.replace(/^\s*<pre.*?>/,"");b.content=b.content.replace(/<\/pre>\s*$/,"");if(b.set)b.content='<pre class="mceItemHidden">'+b.content+"</pre>"});e.verify_css_classes&&(b.serializer.attribValueFilter=function(c,d){var e,g;if(c=="class"){if(!b.classesRE){g=b.dom.getClasses();if(g.length>0){e="";a(g,function(a){e=e+((e?"|":"")+a["class"])});b.classesRE=RegExp("("+e+")",
"gi")}}return!b.classesRE||/(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(d)||b.classesRE.test(d)?d:""}return d});e.cleanup_callback&&(b.onBeforeSetContent.add(function(a,c){c.content=b.execCallback("cleanup_callback","insert_to_editor",c.content,c)}),b.onPreProcess.add(function(a,c){c.set&&b.execCallback("cleanup_callback","insert_to_editor_dom",c.node,c);c.get&&b.execCallback("cleanup_callback","get_from_editor_dom",c.node,c)}),b.onPostProcess.add(function(a,c){if(c.set)c.content=b.execCallback("cleanup_callback",
"insert_to_editor",c.content,c);if(c.get)c.content=b.execCallback("cleanup_callback","get_from_editor",c.content,c)}));e.save_callback&&b.onGetContent.add(function(a,c){if(c.save)c.content=b.execCallback("save_callback",b.id,c.content,b.getBody())});e.handle_event_callback&&b.onEvent.add(function(a,c,d){b.execCallback("handle_event_callback",c,a,d)===false&&l.cancel(c)});b.onSetContent.add(function(){b.addVisual(b.getBody())});e.padd_empty_editor&&b.onPostProcess.add(function(a,b){b.content=b.content.replace(/^(<p[^>]*>(&nbsp;|&#160;|\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,
"")});if(k){var f=function(b){a(b.dom.select("a"),function(a){var c=a.parentNode;b.dom.isBlock(c)&&c.lastChild===a&&b.dom.add(c,"br",{"data-mce-bogus":1})})};b.onExecCommand.add(function(a,b){b==="CreateLink"&&f(a)});b.onSetContent.add(b.selection.onSetContent.add(f))}b.load({initial:!0,format:"html"});b.startContent=b.getContent({format:"raw"});b.undoManager.add();b.initialized=!0;AJS.log("Editor:setupIframe: dispatch onInit");b.onInit.dispatch(b);AJS.log("Editor:setupIframe: Callback setupcontent_callback");
b.execCallback("setupcontent_callback",b.id,b.getBody(),b.getDoc());AJS.log("Editor:setupIframe: Completed setupcontent_callback");AJS.log("Editor:setupIframe: Callback init_instance_callback");b.execCallback("init_instance_callback",b);AJS.log("Editor:setupIframe: Completed init_instance_callback");b.focus(!0);b.nodeChanged({initial:1});a(b.contentCSS,function(a){b.dom.loadCSS(a)});e.auto_focus&&setTimeout(function(){var a=c.get(e.auto_focus);a.selection.select(a.getBody(),1);a.selection.collapse(1);
a.getBody().focus();a.getWin().focus()},100)},setupContentEditable:function(){var b=this,e=b.settings,g=b.getElement();b.contentDocument=e.content_document||document;b.contentWindow=e.content_window||window;b.bodyElement=g;e.content_document=e.content_window=null;h.hide(g);g.contentEditable=b.getParam("content_editable_state",!0);h.show(g);e.gecko_spellcheck||(b.getDoc().body.spellcheck=0);b.dom=new c.dom.DOMUtils(b.getDoc(),{keep_values:!0,url_converter:b.convertURL,url_converter_scope:b,hex_colors:e.force_hex_style_colors,
class_filter:e.class_filter,root_element:b.id,fix_ie_paragraphs:1,update_styles:1});b.serializer=new c.dom.Serializer(e,b.dom,schema);b.selection=new c.dom.Selection(b.dom,b.getWin(),b.serializer);b.forceBlocks=new c.ForceBlocks(b,{forced_root_block:e.forced_root_block});b.editorCommands=new c.EditorCommands(b);b.serializer.onPreProcess.add(function(a,c){return b.onPreProcess.dispatch(b,c,a)});b.serializer.onPostProcess.add(function(a,c){return b.onPostProcess.dispatch(b,c,a)});b.onPreInit.dispatch(b);
b._addEvents();b.controlManager.onPostRender.dispatch(b,b.controlManager);b.onPostRender.dispatch(b);b.onSetContent.add(function(){b.addVisual(b.getBody())});b.startContent=b.getContent({format:"raw"});b.undoManager.add({initial:!0});b.initialized=!0;b.onInit.dispatch(b);b.focus(!0);b.nodeChanged({initial:1});e.content_css&&a(n(e.content_css),function(a){b.dom.loadCSS(b.documentBaseURI.toAbsolute(a))});d&&(b.dom.bind(b.getElement(),"beforedeactivate",function(){b.lastSelectionBookmark=b.selection.getBookmark(1)}),
b.onBeforeExecCommand.add(function(a,b,c,e,d){if(!h.getParent(a.selection.getStart(),function(b){return b==a.getBody()}))d.terminate=1;if(!h.getParent(a.selection.getEnd(),function(b){return b==a.getBody()}))d.terminate=1}));g=null},focus:function(a){var b,e=this.selection,d=this.settings.content_editable,g,f=this.getDoc(),j,k;if(!a){a=e.getRng();a.item&&(g=a.item(0));this._refreshContentEditable();if(!d)if(c.isIE)try{j=this.getWin(),k=h.getViewPort(j),this.dom.getRoot().focus(),j.scrollTo(k.x,k.y)}catch(l){}else this.getWin().focus();
c.isGecko&&this.getBody().focus();g&&g.ownerDocument==f&&(a=f.body.createControlRange(),a.addElement(g),a.select());d&&(c.isWebKit?this.getWin().focus():c.isIE?this.getElement().setActive():this.getElement().focus())}c.activeEditor!=this&&(null!=(b=c.activeEditor)&&b.onDeactivate.dispatch(b,this),this.onActivate.dispatch(this,b));c._setActive(this)},execCallback:function(a){var b=this.settings[a],e;if(b){if(this.callbackLookup&&(e=this.callbackLookup[a]))b=e.func,e=e.scope;j(b,"string")&&(e=(e=b.replace(/\.\w+$/,
""))?c.resolve(e):0,b=c.resolve(b),this.callbackLookup=this.callbackLookup||{},this.callbackLookup[a]={func:b,scope:e});return b.apply(e||this,Array.prototype.slice.call(arguments,1))}},translate:function(a){var b=this.settings.language||"en",e=c.i18n;return!a?"":e[b+"."+a]||a.replace(/{\#([^}]+)\}/g,function(a,c){return e[b+"."+c]||"{#"+c+"}"})},getLang:function(a,b){return c.i18n[(this.settings.language||"en")+"."+a]||(j(b)?b:"{#"+a+"}")},getParam:function(b,e,d){var g=c.trim,b=j(this.settings[b])?
this.settings[b]:e,f;return"hash"===d?(f={},j(b,"string")?a(0<b.indexOf("=")?b.split(/[;,](?![^=;,]*(?:[;,]|$))/):b.split(","),function(a){a=a.split("=");1<a.length?f[g(a[0])]=g(a[1]):f[g(a[0])]=g(a)}):f=b,f):b},nodeChanged:function(a){var b=this.selection,c=b.getStart()||this.getBody();this.initialized&&(a=a||{},c=d&&c.ownerDocument!=this.getDoc()?this.getBody():c,a.parents=[],this.dom.getParent(c,function(b){if("BODY"==b.nodeName)return!0;a.parents.push(b)}),this.onNodeChange.dispatch(this,a?a.controlManager||
this.controlManager:this.controlManager,c,b.isCollapsed(),a))},addButton:function(a,b){this.buttons=this.buttons||{};this.buttons[a]=b},addCommand:function(a,b,c){this.execCommands[a]={func:b,scope:c||this}},addQueryStateHandler:function(a,b,c){this.queryStateCommands[a]={func:b,scope:c||this}},addQueryValueHandler:function(a,b,c){this.queryValueCommands[a]={func:b,scope:c||this}},addShortcut:function(b,c,e,d){var g=this,f;if(!g.settings.custom_shortcuts)return!1;g.shortcuts=g.shortcuts||{};j(e,"string")&&
(f=e,e=function(){g.execCommand(f,!1,null)});j(e,"object")&&(f=e,e=function(){g.execCommand(f[0],f[1],f[2])});a(n(b),function(b){var i={func:e,scope:d||this,desc:c,alt:false,ctrl:false,shift:false};a(n(b,"+"),function(a){switch(a){case "alt":case "ctrl":case "shift":i[a]=true;break;default:i.charCode=a.charCodeAt(0);i.keyCode=a.toUpperCase().charCodeAt(0)}});g.shortcuts[(i.ctrl?"ctrl":"")+","+(i.alt?"alt":"")+","+(i.shift?"shift":"")+","+i.keyCode]=i});return!0},execCommand:function(b,c,e,d){var g=
this,j=0,h;!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(b)&&(!d||!d.skip_focus)&&g.focus();d=f({},d);g.onBeforeExecCommand.dispatch(g,b,c,e,d);if(d.terminate)return!1;if(g.execCallback("execcommand_callback",g.id,g.selection.getNode(),b,c,e))return g.onExecCommand.dispatch(g,b,c,e,d),!0;if(h=g.execCommands[b])if(h=h.func.call(h.scope,c,e),!0!==h)return g.onExecCommand.dispatch(g,b,c,e,d),h;a(g.plugins,function(a){if(a.execCommand&&a.execCommand(b,c,e))return g.onExecCommand.dispatch(g,
b,c,e,d),j=1,!1});if(j)return!0;if(g.theme&&g.theme.execCommand&&g.theme.execCommand(b,c,e)||g.editorCommands.execCommand(b,c,e))return g.onExecCommand.dispatch(g,b,c,e,d),!0;g.getDoc().execCommand(b,c,e);g.onExecCommand.dispatch(g,b,c,e,d)},queryCommandState:function(a){var b;if(!this._isHidden()){if(b=this.queryStateCommands[a])if(b=b.func.call(b.scope),!0!==b)return b;b=this.editorCommands.queryCommandState(a);if(-1!==b)return b;try{return this.getDoc().queryCommandState(a)}catch(c){}}},queryCommandValue:function(a){var b;
if(!this._isHidden()){if(b=this.queryValueCommands[a])if(b=b.func.call(b.scope),!0!==b)return b;b=this.editorCommands.queryCommandValue(a);if(j(b))return b;try{return this.getDoc().queryCommandValue(a)}catch(c){}}},show:function(){h.show(this.getContainer());h.hide(this.id);this.load()},hide:function(){var a=this.getDoc();d&&a&&a.execCommand("SelectAll");this.save();h.hide(this.getContainer());h.setStyle(this.id,"display",this.orgDisplay)},isHidden:function(){return!h.isHidden(this.id)},setProgressState:function(a,
b,c){this.onSetProgressState.dispatch(this,a,b,c);return a},load:function(a){var b=this.getElement(),c;if(b)return a=a||{},a.load=!0,c=this.setContent(j(b.value)?b.value:b.innerHTML,a),a.element=b,a.no_events||this.onLoadContent.dispatch(this,a),a.element=null,c},save:function(b){var c=this,e=c.getElement(),d,g;if(e&&c.initialized){b=b||{};b.save=!0;try{b.no_events||(c.undoManager.typing=!1,c.undoManager.add())}catch(f){AJS.logError("editor.save() : "+f)}b.element=e;d=b.content=c.getContent(b);b.no_events||
c.onSaveContent.dispatch(c,b);d=b.content;/TEXTAREA|INPUT/i.test(e.nodeName)?e.value=d:(e.innerHTML=d,(g=h.getParent(c.id,"form"))&&a(g.elements,function(a){if(a.name==c.id)return a.value=d,!1}));b.element=e=null;return d}},setContent:function(a,b){var e=this.getBody(),d,b=b||{};b.format=b.format||"html";b.set=!0;b.content=a;b.no_events||this.onBeforeSetContent.dispatch(this,b);a=b.content;if(!c.isIE&&(0===a.length||/^\s+$/.test(a)))a=(d=this.settings.forced_root_block)?"<"+d+'><br data-mce-bogus="1"></'+
d+">":'<br data-mce-bogus="1">',e.innerHTML=a,this.selection.select(e,!0),this.selection.collapse(!0);"raw"!==b.format&&(a=(new c.html.Serializer({},this.schema)).serialize(this.parser.parse(a)));b.content=c.trim(a);this.dom.setHTML(e,b.content);b.no_events||this.onSetContent.dispatch(this,b);this.selection.normalize();return b.content},getContent:function(a){var b,a=a||{};a.format=a.format||"html";a.get=!0;a.no_events||this.onBeforeGetContent.dispatch(this,a);b="raw"==a.format?this.getBody().innerHTML:
this.serializer.serialize(this.getBody(),a);a.content=c.trim(b);a.no_events||this.onGetContent.dispatch(this,a);return a.content},isDirty:function(){return c.trim(this.startContent)!=c.trim(this.getContent({format:"raw",no_events:1}))&&!this.isNotDirty},setDirty:function(a){this.isNotDirty=a?0:1},getContainer:function(){this.container||(this.container=h.get(this.editorContainer||this.id+"_parent"));return this.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return h.get(this.settings.content_element||
this.id)},getWin:function(){var a;if(!this.contentWindow&&(a=h.get(this.id+"_ifr")))this.contentWindow=a.contentWindow;return this.contentWindow},getDoc:function(){var a;if(!this.contentDocument&&(a=this.getWin()))this.contentDocument=a.document;return this.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(a,b,c){var e=this.settings;return e.urlconverter_callback?this.execCallback("urlconverter_callback",a,c,!0,b):!e.convert_urls||c&&"LINK"==c.nodeName||
0===a.indexOf("file:")?a:e.relative_urls?this.documentBaseURI.toRelative(a):a=this.documentBaseURI.toAbsolute(a,e.remove_script_host)},addVisual:function(b){var c=this,e=c.settings,b=b||c.getBody();j(c.hasVisual)||(c.hasVisual=e.visual);a(c.dom.select("table,a",b),function(a){var b;switch(a.nodeName){case "TABLE":b=c.dom.getAttrib(a,"border");if(!b||b=="0")c.hasVisual?c.dom.addClass(a,e.visual_table_class):c.dom.removeClass(a,e.visual_table_class);break;case "A":(b=c.dom.getAttrib(a,"name"))&&(c.hasVisual?
c.dom.addClass(a,"mceItemAnchor"):c.dom.removeClass(a,"mceItemAnchor"))}});c.onVisualAid.dispatch(c,b,c.hasVisual)},remove:function(){var a=this.getContainer();this.removed=1;this.hide();this.execCallback("remove_instance_callback",this);this.onRemove.dispatch(this);this.onExecCommand.listeners=[];c.remove(this);h.remove(a)},destroy:function(a){this.destroyed||(a||(c.removeUnload(this.destroy),tinyMCE.onBeforeUnload.remove(this._beforeUnload),this.theme&&this.theme.destroy&&this.theme.destroy(),this.controlManager.destroy(),
this.selection.destroy(),this.dom.destroy(),this.settings.content_editable||(l.clear(this.getWin()),l.clear(this.getDoc())),l.clear(this.getBody()),l.clear(this.formElement)),this.formElement&&(this.formElement.submit=this.formElement._mceOldSubmit,this.formElement._mceOldSubmit=null),this.contentAreaContainer=this.formElement=this.container=this.settings.content_element=this.bodyElement=this.contentDocument=this.contentWindow=null,this.selection&&(this.selection=this.selection.win=this.selection.dom=
this.selection.dom.doc=null),this.destroyed=1)},_addEvents:function(){function b(a,c){e.removed||!1!==e.onEvent.dispatch(e,a,c)&&e[f[a.fakeType||a.type]].dispatch(e,a,c)}var e=this,d=e.settings,g=e.dom,f={mouseup:"onMouseUp",mousedown:"onMouseDown",click:"onClick",keyup:"onKeyUp",keydown:"onKeyDown",keypress:"onKeyPress",submit:"onSubmit",reset:"onReset",contextmenu:"onContextMenu",dblclick:"onDblClick",paste:"onPaste"};a(f,function(a,c){switch(c){case "contextmenu":g.bind(e.getDoc(),c,b);break;case "paste":g.bind(e.getBody(),
c,function(a){b(a)});break;case "submit":case "reset":g.bind(e.getElement().form||h.getParent(e.id,"form"),c,b);break;default:g.bind(d.content_editable?e.getBody():e.getDoc(),c,b)}});g.bind(d.content_editable?e.getBody():k?e.getDoc():e.getWin(),"focus",function(){e.focus(!0)});if(d.content_editable&&c.isOpera){var j=function(){e.focus(!0)};g.bind(e.getBody(),"click",j);g.bind(e.getBody(),"keydown",j)}c.isGecko&&g.bind(e.getDoc(),"DOMNodeInserted",function(a){var b,a=a.target;if(1===a.nodeType&&"IMG"===
a.nodeName&&(b=a.getAttribute("data-mce-src")))a.src=e.documentBaseURI.toAbsolute(b)});k&&(j=function(){var a=this.getDoc(),b=this.settings;if(k&&!b.readonly){this._refreshContentEditable();try{a.execCommand("styleWithCSS",0,!1)}catch(c){if(!this._isHidden())try{a.execCommand("useCSS",0,!0)}catch(e){}}if(!b.table_inline_editing)try{a.execCommand("enableInlineTableEditing",!1,!1)}catch(d){}if(!b.object_resizing)try{a.execCommand("enableObjectResizing",!1,!1)}catch(g){}}},e.onBeforeExecCommand.add(j),
e.onMouseDown.add(j));e.onMouseUp.add(e.nodeChanged);e.onKeyUp.add(function(a,b){var d=b.keyCode;(d>=33&&d<=36||d>=37&&d<=40||d==13||d==45||d==46||d==8||c.isMac&&(d==91||d==93)||b.ctrlKey)&&e.nodeChanged()});e.onKeyDown.add(function(a,b){if(b.keyCode==u.BACKSPACE){var c=a.selection.getRng(true);if(c.collapsed){for(var e=c.startContainer,d=c.startOffset;e&&e.nodeType&&e.nodeType!=1&&e.parentNode;)e=e.parentNode;if(e&&e.parentNode&&e.parentNode.tagName==="BLOCKQUOTE"&&e.parentNode.firstChild==e&&d===
0){a.formatter.toggle("blockquote",null,e.parentNode);c.setStart(e,0);c.setEnd(e,0);a.selection.setRng(c);a.selection.collapse(false)}}}});e.onReset.add(function(){e.setContent(e.startContent,{format:"raw"})});if(d.custom_shortcuts){d.custom_undo_redo_keyboard_shortcuts&&(e.addShortcut("ctrl+z",e.getLang("undo_desc"),"Undo"),e.addShortcut("ctrl+y",e.getLang("redo_desc"),"Redo"));e.addShortcut("ctrl+b",e.getLang("bold_desc"),"Bold");e.addShortcut("ctrl+i",e.getLang("italic_desc"),"Italic");e.addShortcut("ctrl+u",
e.getLang("underline_desc"),"Underline");var n=function(b){var d=null;if(!b.altKey&&!b.ctrlKey&&!b.metaKey)return d;a(e.shortcuts,function(a){if(!(c.isMac&&a.ctrl!=b.metaKey)&&(c.isMac||a.ctrl==b.ctrlKey)&&a.alt==b.altKey&&a.shift==b.shiftKey)if(b.keyCode==a.keyCode||b.charCode&&b.charCode==a.charCode){d=a;return false}});return d};e.onKeyUp.add(function(a,b){if(n(b))return l.cancel(b)});e.onKeyPress.add(function(a,b){if(n(b))return l.cancel(b)});e.onKeyDown.add(function(a,b){var c=n(b);if(c){c.func.call(c.scope);
return l.cancel(b)}})}c.isIE&&g.bind(e.getDoc(),"controlselect",function(a){var b=e.resizeInfo,a=a.target;if(a.nodeName==="IMG"){b&&g.unbind(b.node,b.ev,b.cb);if(g.hasClass(a,"mceItemNoResize")){ev="resizestart";b=g.bind(a,"resizestart",l.cancel,l)}else{ev="resizeend";b=g.bind(a,ev,function(a){var b,a=a.target;if(b=g.getStyle(a,"width")){g.setAttrib(a,"width",b.replace(/[^0-9%]+/g,""));g.setStyle(a,"width","")}if(b=g.getStyle(a,"height")){g.setAttrib(a,"height",b.replace(/[^0-9%]+/g,""));g.setStyle(a,
"height","")}})}b=e.resizeInfo={node:a,ev:ev,cb:b}}});c.isOpera&&e.onClick.add(function(a,b){l.prevent(b)});if(d.custom_undo_redo){var y=function(){e.undoManager.typing=false;e.undoManager.add()},j=c.isGecko?"blur":"focusout";g.bind(e.getDoc(),j,function(){!e.removed&&e.undoManager.typing&&y()});e.dom.bind(e.dom.getRoot(),"dragend",function(){y()});e.onKeyUp.add(function(a,b){var c=b.keyCode;(c>=33&&c<=36||c>=37&&c<=40||c==13||c==45||b.ctrlKey)&&y()});e.onKeyDown.add(function(a,b){var d=b.keyCode,
g;if(d==8)if((g=e.getDoc().selection)&&g.createRange&&g.createRange().item){e.undoManager.beforeChange();a.dom.remove(g.createRange().item(0));y();return l.cancel(b)}if(d>=33&&d<=36||d>=37&&d<=40||d==13||d==45){c.isIE&&d==13&&e.undoManager.beforeChange();e.undoManager.typing&&y()}else if((d<16||d>20)&&d!=224&&d!=91&&!e.undoManager.typing){e.undoManager.beforeChange();e.undoManager.typing=true;e.undoManager.add()}});e.onMouseDown.add(function(){e.undoManager.typing&&y()})}if(c.isGecko){var x=function(){var b=
e.dom.getAttribs(e.selection.getStart().cloneNode(false));return function(){var c=e.selection.getStart();if(c!==e.getBody()){e.dom.setAttrib(c,"style",null);a(b,function(a){c.setAttributeNode(a.cloneNode(true))})}}},t=function(){var a=e.selection;return!a.isCollapsed()&&a.getStart()!=a.getEnd()};e.onKeyPress.add(function(a,b){var c;if((b.keyCode==8||b.keyCode==46)&&t()){c=x();e.getDoc().execCommand("delete",false,null);c();return l.cancel(b)}});e.dom.bind(e.getDoc(),"cut",function(){var a;if(t()){a=
x();e.onKeyUp.addToTop(l.cancel,l);setTimeout(function(){a();e.onKeyUp.remove(l.cancel,l)},0)}})}},_refreshContentEditable:function(){var a,b;this._isHidden()&&(a=this.getBody(),b=a.parentNode,b.removeChild(a),b.appendChild(a),a.focus())},_isHidden:function(){var a;if(!k)return 0;a=this.selection.getSel();return!a||!a.rangeCount||0==a.rangeCount}})})(tinymce);
(function(c){var h=c.each,l=!0,f=!1;c.EditorCommands=function(b){function a(a,b,c){var e,a=a.toLowerCase();return(e=u.exec[a])?(e(a,b,c),l):f}function k(a){var b,a=a.toLowerCase();return(b=u.state[a])?b(a):-1}function d(a,b){b=b||"exec";h(a,function(a,c){h(c.toLowerCase().split(","),function(c){u[b][c]=a})})}function j(a,c,e){void 0===c&&(c=f);void 0===e&&(e=null);return b.getDoc().execCommand(a,c,e)}function e(a,b){m.toggle(a,b?{value:b}:void 0)}var g=b.dom,n=b.selection,u={state:{},exec:{},value:{}},
i=b.settings,m=b.formatter,q;c.extend(this,{execCommand:a,queryCommandState:k,queryCommandValue:function(a){var b,a=a.toLowerCase();return(b=u.value[a])?b(a):f},addCommands:d});d({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){b.undoManager.add()},"Cut,Copy,Paste":function(a){var e=b.getDoc(),d;try{j(a)}catch(g){d=l}if(d||!e.queryCommandSupported(a))c.isGecko?b.windowManager.confirm(b.getLang("clipboard_msg"),function(a){a&&open("http://www.mozilla.org/editor/midasdemo/securityprefs.html",
"_blank")}):b.windowManager.alert(b.getLang("clipboard_no_support"))},unlink:function(a){n.isCollapsed()&&n.select(n.getNode());j(a);n.collapse(f)},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(c){var d=c.substring(7);b.undoManager.add();var g=n.getRng(),f=n.getNode();h(["left","center","right","full"],function(a){d!=a&&m.remove("align"+a);!tinyMCE.isIE&&("IMG"==f.nodeName&&("#document"==n.getRng().startContainer.nodeName||"#text"==n.getRng().startContainer.nodeName))&&n.setRng(g)});
e("align"+d);a("mceRepaint")},"InsertUnorderedList,InsertOrderedList":function(a){var b;j(a);if(a=g.getParent(n.getNode(),"ol,ul"))b=a.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(b.nodeName)&&(q=n.getBookmark(void 0),g.split(b,a),n.moveToBookmark(q))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(a){e(a)},"ForeColor,HiliteColor,FontName":function(a,b,c){e(a,c)},FontSize:function(a,b,d){var g;1<=d&&7>=d&&(g=c.explode(i.font_size_style_values),d=(b=c.explode(i.font_size_classes))?
b[d-1]||d:g[d-1]||d);e(a,d)},RemoveFormat:function(a){m.remove(a)},mceBlockQuote:function(){e("blockquote")},FormatBlock:function(a,b,c){return e(c||"p")},mceCleanup:function(){var a=n.getBookmark();b.setContent(b.getContent({cleanup:l}),{cleanup:l});n.moveToBookmark(a)},mceRemoveNode:function(a,c,e){a=e||n.getNode();a!=b.getBody()&&(q=n.getBookmark(void 0),b.dom.remove(a,l),n.moveToBookmark(q))},mceSelectNodeDepth:function(a,c,e){var d=0;g.getParent(n.getNode(),function(a){if(1==a.nodeType&&d++==
e)return n.select(a),f},b.getBody())},mceSelectNode:function(a,b,c){n.select(c)},mceInsertContent:function(a,e,d){var f,i,j,h,k;f=b.parser;i=new c.html.Serializer({},b.schema);a={content:d,format:"html"};n.onBeforeSetContent.dispatch(n,a);d=a.content;-1==d.indexOf("{$caret}")&&(d+="{$caret}");d=d.replace(/\{\$caret\}/,'<span id="mce_marker" data-mce-type="bookmark">﻿</span>');!n.isCollapsed()&&n.getContent().length&&b.execCommand("mceDelete",!1,null,{skip_undo:!0});j=n.getNode();a={context:j.nodeName.toLowerCase()};
k=f.parse(d,a);e=k.lastChild;if("mce_marker"==e.attr("id")){d=e;for(e=e.prev;e;e=e.walk(!0))if(3==e.type||!g.isBlock(e.name)){e.parent.insert(d,e,"br"===e.name);break}}if(a.invalid){n.setContent('<span id="mce_marker" data-mce-type="bookmark">﻿</span>');j=b.selection.getNode();h=b.getBody();for(9==j.nodeType?j=e=h:e=j;e!==h;)j=e,e=e.parentNode;d=j==h?h.innerHTML:g.getOuterHTML(j);d=i.serialize(f.parse(d.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,function(){return i.serialize(k)})));
j==h?g.setHTML(h,d):g.setOuterHTML(j,d)}else d=i.serialize(k),e=j.firstChild,f=j.lastChild,!e||e===f&&"BR"===e.nodeName?g.setHTML(j,d):n.setContent(d);d=g.get("mce_marker");e=g.getRect(d);j=g.getViewPort(b.getWin());if(e.y+e.h>j.y+j.h||e.y<j.y||e.x>j.x+j.w||e.x<j.x)f=c.isIE?b.getDoc().documentElement:b.getBody(),f.scrollLeft=e.x,f.scrollTop=e.y-j.h+25;j=g.createRng();(e=d.previousSibling)&&3==e.nodeType?j.setStart(e,e.nodeValue.length):(j.setStartBefore(d),j.setEndBefore(d));g.remove(d);n.setRng(j);
n.onSetContent.dispatch(n,a);b.addVisual()},mceInsertRawHTML:function(a,c,e){n.setContent("tiny_mce_marker");b.setContent(b.getContent().replace(/tiny_mce_marker/g,function(){return e}))},mceSetContent:function(a,c,e){b.setContent(e)},"Indent,Outdent":function(a){var b,c,e;b=i.indentation;c=/[a-z%]+$/i.exec(b);b=parseInt(b);!k("InsertUnorderedList")&&!k("InsertOrderedList")&&!k("InsertInlineTaskList")?h(n.getSelectedBlocks(),function(d){"outdent"==a?(e=Math.max(0,parseInt(d.style.paddingLeft||0)-
b),g.setStyle(d,"paddingLeft",e?e+c:"")):g.setStyle(d,"paddingLeft",parseInt(d.style.paddingLeft||0)+b+c)}):j(a)},mceRepaint:function(){if(c.isGecko)try{q=n.getBookmark(l),n.getSel()&&n.getSel().selectAllChildren(b.getBody()),n.collapse(l),n.moveToBookmark(q)}catch(a){}},mceToggleFormat:function(a,b,c){m.toggle(c)},InsertHorizontalRule:function(){b.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){b.hasVisual=!b.hasVisual;b.addVisual()},mceReplaceContent:function(a,c,e){b.execCommand("mceInsertContent",
!1,e.replace(/\{\$selection\}/g,n.getContent({format:"text"})))},mceInsertLink:function(a,b,c){"string"==typeof c&&(c={href:c});a=g.getParent(n.getNode(),"a");c.href=c.href.replace(" ","%20");(!a||!c.href)&&m.remove("link");c.href&&m.apply("link",c,a)},selectAll:function(){var a=g.getRoot(),c=g.createRng();c.setStart(a,0);c.setEnd(a,a.childNodes.length);b.selection.setRng(c)}});d({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(a){var b="align"+a.substring(7),a=n.isCollapsed()?[n.getNode()]:
n.getSelectedBlocks(),a=c.map(a,function(a){return!!m.matchNode(a,b)});return-1!==c.inArray(a,l)},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(a){return m.match(a)},mceBlockQuote:function(){return m.match("blockquote")},Outdent:function(){var a;return i.inline_styles&&((a=g.getParent(n.getStart(),g.isBlock))&&0<parseInt(a.style.paddingLeft)||(a=g.getParent(n.getEnd(),g.isBlock))&&0<parseInt(a.style.paddingLeft))?l:k("InsertUnorderedList")||k("InsertOrderedList")||k("InsertInlineTaskList")||
!i.inline_styles&&!!g.getParent(n.getNode(),"BLOCKQUOTE")},"InsertUnorderedList,InsertOrderedList,InsertInlineTaskList":function(a){var b=g.getParent(n.getNode(),"ul,ol"),c;if(!b)return!1;c=b.tagName;return"OL"===c&&"insertorderedlist"===a||"UL"===c&&!g.hasClass(b,"inline-task-list")&&"insertunorderedlist"===a||"UL"===c&&g.hasClass(b,"inline-task-list")&&"insertinlinetasklist"===a}},"state");d({"FontSize,FontName":function(a){var b=0,c;if(c=g.getParent(n.getNode(),"span"))b="fontsize"==a?c.style.fontSize:
c.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase();return b}},"value");i.custom_undo_redo&&d({Undo:function(){b.undoManager.undo()},Redo:function(){b.undoManager.redo()}})}})(tinymce);
(function(c){var h=c.util.Dispatcher;c.UndoManager=function(l){var f,b=0,a=[],k;return f={typing:!1,onAdd:new h(f),onUndo:new h(f),onRedo:new h(f),beforeChange:function(){k=l.selection.getBookmark(2,!0)},add:function(d){var j;j=l.settings;var e,d=d||{};d.content=c.trim(l.getContent({format:"raw",no_events:1}));if((e=a[b])&&e.content==d.content)return null;a[b]&&(a[b].beforeBookmark=k);if(j.custom_undo_redo_levels&&a.length>j.custom_undo_redo_levels){for(j=0;j<a.length-1;j++)a[j]=a[j+1];a.length--;
b=a.length}d.bookmark=l.selection.getBookmark(2,!0);b<a.length-1&&(a.length=b+1);a.push(d);b=a.length-1;f.onAdd.dispatch(f,d);l.isNotDirty=0;return d},undo:function(){var c;f.typing&&(f.add(),f.typing=!1);0<b&&(c=a[--b],l.setContent(c.content,{format:"raw"}),l.selection.moveToBookmark(c.beforeBookmark),f.onUndo.dispatch(f,c));return c},redo:function(){var c;b<a.length-1&&(c=a[++b],l.setContent(c.content,{format:"raw"}),l.selection.moveToBookmark(c.bookmark),f.onRedo.dispatch(f,c));return c},clear:function(){a=
[];b=0;f.typing=!1},hasUndo:function(){return 0<b||this.typing},hasRedo:function(){return b<a.length-1&&!this.typing},ignore:function(b,c){var e=a.slice();b.call(c||l);a=e}}}})(tinymce);
(function(c){var h=c.dom.Event,l=c.isIE,f=c.isGecko,b=c.isOpera,a=c.each,k=!1;c.create("tinymce.ForceBlocks",{ForceBlocks:function(a){var b=a.settings,c;this.editor=a;this.dom=a.dom;c=(b.forced_root_block||"p").toLowerCase();b.element=c.toUpperCase();a.onPreInit.add(this.setup,this)},setup:function(){var a=this,b=a.editor,e=b.settings,g=b.dom,k=b.selection,u=b.schema.getBlockElements();if(e.forced_root_block){var i=function(){var a=k.getStart(),c=g.getRoot(),d=b.getDoc().body,f,i,h,l,x,t;if(a&&1===
a.nodeType){for(;a!=c;)if(a&&1===a.nodeType){if(u[a.nodeName])return;a=a.parentNode}else return;f=k.getRng();if(f.setStart)i=f.startContainer,h=f.startOffset,l=f.endContainer,x=f.endOffset;else if(f.item&&(f=b.getDoc().body.createTextRange(),f.moveToElementText(f.item(0))),tmpRng=f.duplicate(),tmpRng.collapse(!0),h=-1*tmpRng.move("character",-16777215),!tmpRng.collapsed)tmpRng=f.duplicate(),tmpRng.collapse(!1),x=-1*tmpRng.move("character",-16777215)-h;for(a=c.firstChild;a;a)3===a.nodeType||1==a.nodeType&&
!u[a.nodeName]?(t||(t=g.create(e.forced_root_block),a.parentNode.insertBefore(t,a)),c=a,a=a.nextSibling,t.appendChild(c)):(t=null,a=a.nextSibling);if(f.setStart)f.setStart(i,h),f.setEnd(l,x),k.setRng(f);else try{f=d.createTextRange(),f.moveToElementText(d),f.move("character",-16777215),f.collapse(!0),f.moveStart("character",h),0<x&&f.moveEnd("character",x),f.select()}catch(v){}b.nodeChanged()}};b.onKeyUp.add(i);b.onKeyDown.add(i);b.onClick.add(i)}e.force_br_newlines&&l&&b.onKeyPress.add(function(a,
b){var c;if(13==b.keyCode&&"LI"!=k.getNode().nodeName)return k.setContent('<br id="__" /> ',{format:"raw"}),c=g.get("__"),c.removeAttribute("id"),k.select(c),k.collapse(),h.cancel(b)});e.force_p_newlines&&(l||b.onKeyPress.add(function(b,c){13==c.keyCode&&(!c.shiftKey&&!a.insertPara(c))&&h.cancel(c)}),f&&b.onKeyDown.add(function(b,c){(8==c.keyCode||46==c.keyCode)&&!c.shiftKey&&a.backspaceDelete(c,8==c.keyCode)}));c.isWebKit&&b.onKeyPress.add(function(a,b){if(b.keyCode==13&&(b.shiftKey||e.force_br_newlines&&
!g.getParent(k.getNode(),"h1,h2,h3,h4,h5,h6,ol,ul"))){var c=k.getRng(),d,f=g.create("div",null," "),i=g.getViewPort(a.getWin());c.insertNode(d=g.create("br"));c.setStartAfter(d);c.setEndAfter(d);k.setRng(c);if(k.getSel().focusNode==d.previousSibling){k.select(g.insertAfter(g.doc.createTextNode(" "),d));k.collapse(true)}g.insertAfter(f,d);c=g.getPos(f).y;d=g.getSize(f).h;g.remove(f);f=c+d;f>i.y+i.h&&a.getWin().scrollTo(0,f-i.h);h.cancel(b)}});l&&"P"!=e.element&&(b.onKeyPress.add(function(){a.lastElm=
k.getNode().nodeName}),b.onKeyUp.add(function(b,c){var f;f=k.getNode();if(b.getBody().childNodes.length===1&&f.nodeName=="P"){f=g.rename(f,e.element);k.select(f);k.collapse();b.nodeChanged()}else if(c.keyCode==13&&!c.shiftKey&&a.lastElm!="P")if(f=g.getParent(f,"p")){g.rename(f,e.element);b.nodeChanged()}}))},getParentBlock:function(a){var b=this.dom;return b.getParent(a,b.isBlock)},insertPara:function(){function d(a,c){var d=[],g,f;a.innerHTML="";if(h.keep_styles){f=c;do/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(f.nodeName)&&
(g=f.cloneNode(k),e.setAttrib(g,"id",""),d.push(g));while(f=f.parentNode)}if(0<d.length){f=d.length-1;for(g=a;0<=f;f--)g=g.appendChild(d[f]);d[0].innerHTML=b?" ":"<br />";return d[0]}a.innerHTML=b?" ":"<br />"}var f=this.editor,e=f.dom,g=f.getDoc(),h=f.settings,l=f.selection.getSel(),i=l.getRangeAt(0),m=g.body,q,o,s,p,A,y,x,t,v,z,r,B=e.getViewPort(f.getWin());f.undoManager.beforeChange();q=g.createRange();q.setStart(l.anchorNode,l.anchorOffset);q.collapse(!0);o=g.createRange();o.setStart(l.focusNode,
l.focusOffset);o.collapse(!0);p=(s=0>q.compareBoundaryPoints(q.START_TO_END,o))?l.anchorNode:l.focusNode;A=s?l.anchorOffset:l.focusOffset;y=s?l.focusNode:l.anchorNode;l=s?l.focusOffset:l.anchorOffset;if(c.isWebKit&&p===y&&1===p.nodeType&&0<p.childNodes.length&&f.dom.is(v=p.childNodes[0<A?A-1:0],"table"))return g=e.create("p",0,'<br data-mce-bogus="1" />'),e.insertAfter(g,v),i.setStart(g,0),f.selection.setRng(i),g=f.dom.getPos(g).y,g>B.y&&f.getWin().scrollTo(0,g),f.undoManager.add(),k;if(p===y&&/^(TD|TH)$/.test(p.nodeName)){"BR"==
p.firstChild.nodeName&&e.remove(p.firstChild);if(0==p.childNodes.length)f.dom.add(p,h.element,null,"<br />"),t=f.dom.add(p,h.element,null,"<br />");else{var E=!1;a(p.childNodes,function(a){if(f.dom.isBlock(a))return E=!0,!1});E?(i=f.selection.getRng(),i.insertNode(f.dom.create(h.element,null,"<br />"))):(r=p.innerHTML,p.innerHTML="",f.dom.add(p,h.element,null,r),t=f.dom.add(p,h.element,null,"<br />"))}t&&(i=g.createRange(),i.selectNodeContents(t),i.collapse(1),f.selection.setRng(i));return k}p==m&&
(y==m&&m.firstChild&&f.dom.isBlock(m.firstChild))&&(p=y=p.firstChild,A=l=0,q=g.createRange(),q.setStart(p,0),o=g.createRange(),o.setStart(y,0));g.body.hasChildNodes()||g.body.appendChild(e.create("br"));p="HTML"==p.nodeName?g.body:p;p="BODY"==p.nodeName?p.firstChild:p;y="HTML"==y.nodeName?g.body:y;y="BODY"==y.nodeName?y.firstChild:y;t=f.dom.getRoot();p===t&&(p=p.firstChild,A=0);y===t&&(y=y.firstChild,l=0);x=this.getParentBlock(p);t=this.getParentBlock(y);v=x?x.nodeName:h.element;if(r=this.dom.getParent(x,
"li,pre"))return"LI"==r.nodeName?(B=f.selection,g=this.dom,m=r,g.isEmpty(m)?(q=g.getParent(m,"ul,ol"),g.getParent(q.parentNode,"ul,ol")||(g.split(q,m),q=g.create("p",0,'<br data-mce-bogus="1" />'),g.replace(q,m),B.select(q,1)),AJS.Rte.showSelection(),B=k):B=!0,B):!0;if(x&&("CAPTION"==x.nodeName||/absolute|relative|fixed/gi.test(e.getStyle(x,"position",1))))v=h.element,x=null;if(t&&("CAPTION"==t.nodeName||/absolute|relative|fixed/gi.test(e.getStyle(x,"position",1))))v=h.element,t=null;if(/(TD|TABLE|TH|CAPTION)/.test(v)||
x&&"DIV"==v&&/left|right/gi.test(e.getStyle(x,"float",1)))v=h.element,x=t=null;s=x&&x.nodeName==v?x.cloneNode(0):f.dom.create(v);t=t&&t.nodeName==v?t.cloneNode(0):f.dom.create(v);t.removeAttribute("id");if(r=/^(H[1-6])$/.test(v))r=x,x=r.ownerDocument.createRange(),x.setStart(i.endContainer,i.endOffset),x.setEndAfter(r),r=0==x.cloneContents().textContent.length;r&&(t=f.dom.create(h.element));r=x=p;do{if(r==m||9==r.nodeType||this.dom.isBlock(r)||/(TD|TABLE|TH|CAPTION)/.test(r.nodeName))break;x=r}while(r=
r.previousSibling?r.previousSibling:r.parentNode);r=z=y;do{if(r==m||9==r.nodeType||this.dom.isBlock(r)||/(TD|TABLE|TH|CAPTION)/.test(r.nodeName))break;z=r}while(r=r.nextSibling?r.nextSibling:r.parentNode);x.nodeName==v?q.setStart(x,0):q.setStartBefore(x);q.setEnd(p,A);s.appendChild(q.cloneContents()||g.createTextNode(""));try{o.setEndAfter(z)}catch(I){}o.setStart(y,l);t.appendChild(o.cloneContents()||g.createTextNode(""));i=g.createRange();!x.previousSibling&&x.parentNode.nodeName==v?i.setStartBefore(x.parentNode):
q.startContainer.nodeName==v&&0==q.startOffset?i.setStartBefore(q.startContainer):i.setStart(q.startContainer,q.startOffset);!z.nextSibling&&z.parentNode.nodeName==v?i.setEndAfter(z.parentNode):i.setEnd(o.endContainer,o.endOffset);i.deleteContents();b&&f.getWin().scrollTo(0,B.y);s.firstChild&&s.firstChild.nodeName==v&&(s.innerHTML=s.firstChild.innerHTML);t.firstChild&&t.firstChild.nodeName==v&&(t.innerHTML=t.firstChild.innerHTML);e.isEmpty(s)&&d(s,p);e.isEmpty(t)&&d(t,y);this.dom.removeClass(t,"auto-cursor-target");
b&&9.5>parseFloat(opera.version())?(i.insertNode(s),i.insertNode(t)):(i.insertNode(t),i.insertNode(s));t.normalize();s.normalize();f.selection.select(t,!0);f.selection.collapse(!0);g=f.dom.getPos(t).y;if(g<B.y||g+25>B.y+B.h)f.getWin().scrollTo(0,g<B.y?g:g-B.h+25);f.undoManager.add();return k},backspaceDelete:function(a,b){var e=this.editor,g=e.getBody(),f,l=e.selection,i=l.getRng(),m=i.startContainer,q;if(!(a.getPreventDefault?a.getPreventDefault():a.defaultPrevented)){if(!b&&i.collapsed&&1==m.nodeType&&
i.startOffset==m.childNodes.length){q=new c.dom.TreeWalker(m.lastChild,m);for(f=m.lastChild;f;f=q.prev())if(3==f.nodeType){i.setStart(f,f.nodeValue.length);i.collapse(!0);l.setRng(i);return}}if(m&&(e.dom.isBlock(m)&&!/^(TD|TH)$/.test(m.nodeName)&&b)&&(0==m.childNodes.length||1==m.childNodes.length&&"BR"==m.firstChild.nodeName)){for(f=m;(f=f.previousSibling)&&!e.dom.isBlock(f););if(f){if(m!=g.firstChild){for(g=e.dom.doc.createTreeWalker(f,NodeFilter.SHOW_TEXT,null,k);i=g.nextNode();)f=i;i=e.getDoc().createRange();
i.setStart(f,f.nodeValue?f.nodeValue.length:0);i.setEnd(f,f.nodeValue?f.nodeValue.length:0);l.setRng(i);e.dom.remove(m)}return h.cancel(a)}}if(!b&&i.collapsed&&/^(BODY)$/.test(m.nodeName)&&(m=m.childNodes[i.startOffset])&&(e.dom.isBlock(m)&&!/^(TD|TH)$/.test(m.nodeName))&&(0==m.childNodes.length||1==m.childNodes.length&&"BR"==m.firstChild.nodeName)){f=m;for(var o;f=f.nextSibling;)if(e.dom.isBlock(f)){o=f;break}if(o&&m!=g.lastChild)return g=e.dom.doc.createTreeWalker(o,NodeFilter.SHOW_TEXT,null,k),
o=g.nextNode(),i=e.getDoc().createRange(),i.setStart(o,0),i.setEnd(o,0),l.setRng(i),e.dom.remove(m),h.cancel(a)}}}})})(tinymce);
(function(c){var h=c.dom.Event,l=c.each,f=c.extend;c.create("tinymce.ControlManager",{ControlManager:function(b,a){var f=this,a=a||{};f.editor=b;f.controls={};f.onAdd=new c.util.Dispatcher(f);f.onPostRender=new c.util.Dispatcher(f);f.prefix=a.prefix||b.id+"_";f._cls={};f.onPostRender.add(function(){l(f.controls,function(a){a.postRender()})})},get:function(b){return this.controls[this.prefix+b]||this.controls[b]},setActive:function(b,a){var c=null;(c=this.get(b))&&c.setActive(a);return c},setDisabled:function(b,
a){var c=null;(c=this.get(b))&&c.setDisabled(a);return c},add:function(b){b&&(this.controls[b.id]=b,this.onAdd.dispatch(b,this));return b},createControl:function(b){var a,c=this,d=c.editor;l(d.plugins,function(d){if(d.createControl&&(a=d.createControl(b,c)))return!1});switch(b){case "|":case "separator":return c.createSeparator()}return!a&&d.buttons&&(a=d.buttons[b])?c.createButton(b,a):c.add(a)},createDropMenu:function(b,a,h){var d=this.editor,j,e,g,a=f({"class":"mceDropDown",constrain:d.settings.constrain_menus},
a);a["class"]=a["class"]+" "+d.getParam("skin")+"Skin";if(g=d.getParam("skin_variant"))a["class"]+=" "+d.getParam("skin")+"Skin"+g.substring(0,1).toUpperCase()+g.substring(1);b=this.prefix+b;j=this.controls[b]=new (h||this._cls.dropmenu||c.ui.DropMenu)(b,a);j.onAddItem.add(function(a,b){var c=b.settings;c.title=d.getLang(c.title,c.title);c.onclick||(c.onclick=function(){c.cmd&&d.execCommand(c.cmd,c.ui||!1,c.value)})});d.onRemove.add(function(){j.destroy()});c.isIE&&(j.onShowMenu.add(function(){d.focus();
e=d.selection.getBookmark(1)}),j.onHideMenu.add(function(){e&&(d.selection.moveToBookmark(e),e=0)}));return this.add(j)},createListBox:function(b,a,k){var d=this.editor;if(this.get(b))return null;a.title=d.translate(a.title);a.scope=a.scope||d;a.onselect||(a.onselect=function(b){d.execCommand(a.cmd,a.ui||!1,b||a.value)});a=f({title:a.title,"class":"mce_"+b,scope:a.scope,control_manager:this},a);b=this.prefix+b;d.settings.use_native_selects||d.settings.use_accessible_selects&&!c.isGecko?k=new c.ui.NativeListBox(b,
a):(k=k||this._cls.listbox||c.ui.ListBox,k=new k(b,a,d));this.controls[b]=k;c.isWebKit&&k.onPostRender.add(function(a,b){h.add(b,"mousedown",function(){d.bookmark=d.selection.getBookmark(1)});h.add(b,"focus",function(){d.selection.moveToBookmark(d.bookmark);d.bookmark=null})});k.hideMenu&&d.onMouseDown.add(k.hideMenu,k);return this.add(k)},createButton:function(b,a,h){var d=this.editor;if(this.get(b))return null;a.title=d.translate(a.title);a.label=d.translate(a.label);a.scope=a.scope||d;!a.onclick&&
!a.menu_button&&(a.onclick=function(){d.execCommand(a.cmd,a.ui||!1,a.value)});a=f({title:a.title,"class":"mce_"+b,unavailable_prefix:d.getLang("unavailable",""),scope:a.scope,control_manager:this},a);b=this.prefix+b;a.menu_button?(h=h||this._cls.menubutton||c.ui.MenuButton,b=new h(b,a,d),d.onMouseDown.add(b.hideMenu,b)):(h=this._cls.button||c.ui.Button,b=new h(b,a,d));return this.add(b)},createMenuButton:function(b,a,c){a=a||{};a.menu_button=1;return this.createButton(b,a,c)},createSplitButton:function(b,
a,h){var d=this.editor;if(this.get(b))return null;a.title=d.translate(a.title);a.scope=a.scope||d;a.onclick||(a.onclick=function(b){d.execCommand(a.cmd,a.ui||!1,b||a.value)});a.onselect||(a.onselect=function(b){d.execCommand(a.cmd,a.ui||false,b||a.value)});a=f({title:a.title,"class":"mce_"+b,scope:a.scope,control_manager:this},a);b=this.prefix+b;b=this.add(new (h||this._cls.splitbutton||c.ui.SplitButton)(b,a,d));d.onMouseDown.add(b.hideMenu,b);return b},createColorSplitButton:function(b,a,h){var d=
this.editor,j,e;if(this.get(b))return null;a.title=d.translate(a.title);a.scope=a.scope||d;a.onclick||(a.onclick=function(b){c.isIE&&(e=d.selection.getBookmark(1));d.execCommand(a.cmd,a.ui||!1,b||a.value)});a.onselect||(a.onselect=function(b){d.execCommand(a.cmd,a.ui||false,b||a.value)});a=f({title:a.title,"class":"mce_"+b,menu_class:d.getParam("skin")+"Skin",scope:a.scope,more_colors_title:d.getLang("more_colors")},a);b=this.prefix+b;j=new (h||this._cls.colorsplitbutton||c.ui.ColorSplitButton)(b,
a,d);d.onMouseDown.add(j.hideMenu,j);d.onRemove.add(function(){j.destroy()});c.isIE&&(j.onShowMenu.add(function(){d.focus();e=d.selection.getBookmark(1)}),j.onHideMenu.add(function(){if(e){d.selection.moveToBookmark(e);e=0}}));return this.add(j)},createToolbar:function(b,a,f){b=this.prefix+b;a=new (f||this._cls.toolbar||c.ui.Toolbar)(b,a,this.editor);return this.get(b)?null:this.add(a)},createToolbarGroup:function(b,a,f){b=this.prefix+b;a=new (f||this._cls.toolbarGroup||c.ui.ToolbarGroup)(b,a,this.editor);
return this.get(b)?null:this.add(a)},createSeparator:function(b){return new (b||this._cls.separator||c.ui.Separator)},setControlType:function(b,a){return this._cls[b.toLowerCase()]=a},destroy:function(){l(this.controls,function(b){b.destroy()});this.controls=null}})})(tinymce);
(function(c){var h=c.util.Dispatcher,l=c.each,f=c.isIE,b=c.isOpera;c.create("tinymce.WindowManager",{WindowManager:function(a){this.editor=a;this.onOpen=new h(this);this.onClose=new h(this);this.params={};this.features={}},open:function(a,h){var d="",j="modal"==this.editor.settings.dialog_type,e,g,n;n=c.DOM.getViewPort();a=a||{};h=h||{};g=b?n.w:screen.width;n=b?n.h:screen.height;a.name=a.name||"mc_"+(new Date).getTime();a.width=parseInt(a.width||320);a.height=parseInt(a.height||240);a.resizable=!0;
a.left=a.left||parseInt(g/2)-a.width/2;a.top=a.top||parseInt(n/2)-a.height/2;h.inline=!1;h.mce_width=a.width;h.mce_height=a.height;h.mce_auto_focus=a.auto_focus;j&&f&&(a.center=!0,a.help=!1,a.dialogWidth=a.width+"px",a.dialogHeight=a.height+"px",a.scroll=a.scrollbars||!1);l(a,function(a,b){c.is(a,"boolean")&&(a=a?"yes":"no");/^(name|url)$/.test(b)||(d=f&&j?d+((d?";":"")+b+":"+a):d+((d?",":"")+b+"="+a))});this.features=a;this.params=h;this.onOpen.dispatch(this,a,h);g=a.url||a.file;g=c._addVer(g);try{f&&
j?(e=1,window.showModalDialog(g,window,d)):e=window.open(g,a.name,d)}catch(u){}e||alert(this.editor.getLang("popup_blocked"))},close:function(a){a.close();this.onClose.dispatch(this)},createInstance:function(a,b,d,f,e,g){return new (c.resolve(a))(b,d,f,e,g)},confirm:function(a,b,c,f){f=f||window;b.call(c||this,f.confirm(this._decode(this.editor.getLang(a,a))))},alert:function(a,b,c,f){f=f||window;f.alert(this._decode(this.editor.getLang(a,a)));b&&b.call(c||this)},resizeBy:function(a,b,c){c.resizeBy(a,
b)},_decode:function(a){return c.DOM.decode(a).replace(/\\n/g,"\n")}})})(tinymce);
(function(c){c.Formatter=function(h){function l(a){return 1===a.nodeType&&"_mce_caret"===a.id}function f(a){return a?v[a]:v}function b(a,c){a&&("string"!==typeof a?z(a,function(a,c){b(c,a)}):(c=c.length?c:[c],z(c,function(a){a.deep===N&&(a.deep=!a.selector);a.split===N&&(a.split=!a.selector||a.inline);a.remove===N&&(a.selector&&!a.inline)&&(a.remove="none");a.selector&&a.inline&&(a.mixed=!0,a.block_expand=!0);"string"===typeof a.classes&&(a.classes=a.classes.split(/\s+/))}),v[a]=c))}function a(a,
b,j){function k(a,c){c=c||v;if(a){if(c.onformat)c.onformat(a,c,b,j);z(c.styles,function(c,e){r.setStyle(a,e,u(c,b))});z(c.attributes,function(c,e){r.setAttrib(a,e,u(c,b))});z(c.classes,function(c){c=u(c,b);r.hasClass(a,c)||r.addClass(a,c)})}}function m(){var a=h.selection.getRng(),b=a.startContainer,c=a.endContainer;if(b!=c&&0==a.endOffset){a:{c=new E(c);for(j=c.current();j;j=c.prev())if(1<j.childNodes.length||j==b){b=j;break a}b=void 0}a.setEnd(b,3==b.nodeType?b.length:b.childNodes.length)}return a}
function n(f,h,j){var m=[],u,q;u=v.inline||v.block;q=r.create(u);k(q);I.walk(f,function(e){function f(e){var i=e.nodeName.toLowerCase(),n=e.parentNode.nodeName.toLowerCase(),o;if(g(i,"br"))h=0,v.block&&r.remove(e);else if(v.wrapper&&d(e,a,b))h=0;else if(v.block&&!v.wrapper&&/^(h[1-6]|p|div|pre|address|dl|dt|dd)$/.test(i))e=r.rename(e,u),k(e),m.push(e),h=0;else{if(v.selector&&(z(y,function(a){!("collapsed"in a&&a.collapsed!==Q)&&(r.is(e,a.selector)&&!l(e))&&(k(e,a),o=!0)}),!v.inline||o)){h=0;return}C(u,
i)&&C(n,u)&&(j||!(3===e.nodeType&&1===e.nodeValue.length&&65279===e.nodeValue.charCodeAt(0)))&&!l(e)?(h||(h=q.cloneNode(H),e.parentNode.insertBefore(h,e),m.push(h)),h.appendChild(e)):(h=0,z(c.grep(e.childNodes),f),h=0)}}var h;z(e,f)});!1===v.wrap_links&&z(m,function(a){function b(a){var e,d,g;if("A"===a.nodeName){d=q.cloneNode(H);m.push(d);g=c.grep(a.childNodes);for(e=0;e<g.length;e++)d.appendChild(g[e]);a.appendChild(d)}z(c.grep(a.childNodes),b)}b(a)});z(m,function(c){var g,f=0;z(c.childNodes,function(a){!i(a)&&
!p(a)&&f++});g=f;if((1<m.length||!D(c))&&0===g)r.remove(c,1);else if(v.inline||v.wrapper){if(!v.exact&&1===g){g=c;var h,j;z(g.childNodes,function(a){if(1==a.nodeType&&!p(a)&&!l(a))return h=a,H});h&&e(h,v)&&(j=h.cloneNode(H),k(j),r.replace(j,g,G),r.remove(h,1));c=j||g}z(y,function(a){z(r.select(a.inline,c),function(c){var e;if(!1===a.wrap_links){e=c.parentNode;do if("A"===e.nodeName)return;while(e=e.parentNode)}o(a,b,c,a.exact?c:null)})});if(d(c.parentNode,a,b))return r.remove(c,1),c=0,G;v.merge_with_parents&&
r.getParent(c.parentNode,function(e){if(d(e,a,b))return r.remove(c,1),c=0,G});c&&!1!==v.merge_siblings&&(c=A(s(c),c),c=A(c,s(c,G)))}})}var y=f(a),v=y[0],M,Q=B.isCollapsed();if(v)if(j)j.nodeType?(M=r.createRng(),M.setStartBefore(j),M.setEndAfter(j),n(q(M,y),null,!0)):n(j,null,!0);else if(!Q||!v.inline||r.select("td.mceSelected,th.mceSelected").length){if(!r.select("td.mceSelected.numberingColumn").length){var R=h.selection.getNode();h.selection.setRng(m());M=B.getBookmark();n(q(B.getRng(G),y),M);if(v.styles&&
(v.styles.color||v.styles.textDecoration))c.walk(R,P,"childNodes"),P(R);B.moveToBookmark(M);t(B.getRng(G));h.nodeChanged()}}else x("apply",a,b)}function k(a,b,e){function g(a){var e,d,f;e=c.grep(a.childNodes);d=0;for(f=u.length;d<f&&!o(u[d],b,a,a);d++);if(s.deep){d=0;for(f=e.length;d<f;d++)g(e[d])}}function i(c){var e;z(r.getParents(c.parentNode,void 0,r.getRoot()).reverse(),function(c){var g;!e&&"_start"!=c.id&&"_end"!=c.id&&(g=d(c,a,b))&&!1!==g.split&&(e=c)});return e}function k(a,c,e,d){var g,
f,h,i,j,l;if(a){l=a.parentNode;for(g=c.parentNode;g&&g!=l;g=g.parentNode){f=g.cloneNode(H);for(j=0;j<u.length;j++)if(o(u[j],b,f,f)){f=0;break}f&&(h&&f.appendChild(h),i||(i=f),h=f)}if(d&&(!s.mixed||!D(a)))c=r.split(a,c);h&&(e.parentNode.insertBefore(h,e),i.appendChild(e))}return c}function l(a){var b=r.get(a?"_start":"_end"),c=b[a?"firstChild":"lastChild"];p(c)&&(c=c[a?"firstChild":"lastChild"]);r.remove(b,!0);return c}function n(a){var b,c,e,a=q(a,u,G);s.split&&(b=y(a,G),c=y(a),b!=c?(e=b.firstChild,
"TD"==b.nodeName&&e&&(b=e),b=m(b,"span",{id:"_start","data-mce-type":"bookmark"}),c=m(c,"span",{id:"_end","data-mce-type":"bookmark"}),k(i(b),b,b,!0),k(i(c),c,c,!0),b=l(G),c=l()):b=c=k(i(b),b,b,!0),a.startContainer=b.parentNode,a.startOffset=F(b),a.endContainer=c.parentNode,a.endOffset=F(c)+1);I.walk(a,function(a){z(a,function(a){g(a);a.nodeType===1&&(h.dom.getStyle(a,"text-decoration")==="underline"&&a.parentNode&&O(a.parentNode)==="underline")&&o({deep:false,exact:true,inline:"span",styles:{textDecoration:"underline"}},
null,a)})})}var u=f(a),s=u[0],v;e?e.nodeType?(v=r.createRng(),v.setStartBefore(e),v.setEndAfter(e),n(v)):n(e):!B.isCollapsed()||!s.inline||r.select("td.mceSelected,th.mceSelected").length?r.select("td.mceSelected.numberingColumn").length||(e=B.getBookmark(),n(B.getRng(G)),B.moveToBookmark(e),s.inline&&j(a,b,B.getStart())&&t(B.getRng(!0)),h.nodeChanged()):x("remove",a,b)}function d(a,b,c,d){function h(a,b,e){var f,i,j=b[e];if(b.onmatch)return b.onmatch(a,b,e);if(j)if(j.length===N)for(f in j){if(j.hasOwnProperty(f)&&
(i="attributes"===e?r.getAttrib(a,f):n(a,f),d&&!i&&!b.exact||(!d||b.exact)&&!g(i,u(j[f],c))))return}else for(f=0;f<j.length&&!("attributes"===e?r.getAttrib(a,j[f]):n(a,j[f]));f++);return b}var i=f(b),j;if(i&&a)for(j=0;j<i.length;j++)if(b=i[j],e(a,b)&&h(a,b,"attributes")&&h(a,b,"styles")){if(i=b.classes)for(j=0;j<i.length;j++)if(!r.hasClass(a,i[j]))return;return b}}function j(a,b,c){function e(c){c=r.getParent(c,function(c){return!!d(c,a,b,!0)});return d(c,a,b)}var g;if(c)return e(c);c=B.getNode();
if(e(c))return G;g=B.getStart();return g!=c&&e(g)?G:H}function e(a,b){if(g(a,b.inline)||g(a,b.block))return G;if(b.selector)return r.is(a,b.selector)}function g(a,b){a=a||"";b=b||"";a=""+(a.nodeName||a);b=""+(b.nodeName||b);return a.toLowerCase()==b.toLowerCase()}function n(a,b){var c=r.getStyle(a,b);if("color"==b||"backgroundColor"==b)c=r.toHex(c);"fontWeight"==b&&700==c&&(c="bold");return""+c}function u(a,b){"string"!=typeof a?a=a(b):b&&(a=a.replace(/%(\w+)/g,function(a,c){return b[c]||a}));return a}
function i(a){return a&&3===a.nodeType&&/^([\t \r\n]+|)$/.test(a.nodeValue)}function m(a,b,c){b=r.create(b,c);a.parentNode.insertBefore(b,a);b.appendChild(a);return b}function q(a,b,c){function e(a){var c,d,g;c=d=a?f:k;g=a?"previousSibling":"nextSibling";root=r.getRoot();if(3==c.nodeType&&!i(c)&&(a?0<j:l<c.nodeValue.length))return c;for(;;){if(!b[0].block_expand&&D(d))return d;for(a=d[g];a;a=a[g])if(!p(a)&&!i(a))return d;if(d.parentNode==root){c=d;break}d=d.parentNode}return c}function d(a,b){for(b===
N&&(b=3===a.nodeType?a.length:a.childNodes.length);a&&a.hasChildNodes();)(a=a.childNodes[b])&&(b=3===a.nodeType?a.length:a.childNodes.length);return{node:a,offset:b}}var f=a.startContainer,j=a.startOffset,k=a.endContainer,l=a.endOffset,m;1==f.nodeType&&f.hasChildNodes()&&(m=f.childNodes.length-1,f=f.childNodes[j>m?m:j],3==f.nodeType&&(j=0));1==k.nodeType&&k.hasChildNodes()&&(m=k.childNodes.length-1,k=k.childNodes[l>m?m:l-1],3==k.nodeType&&(l=k.nodeValue.length));if(p(f.parentNode)||p(f))f=p(f)?f:
f.parentNode,f=f.nextSibling||f,3==f.nodeType&&(j=0);if(p(k.parentNode)||p(k))k=p(k)?k:k.parentNode,k=k.previousSibling||k,3==k.nodeType&&(l=k.length);if(b[0].inline){if(a.collapsed){var n=function(a,b,e){function d(a,b){var f,g;g=a.nodeValue;typeof b=="undefined"&&(b=e?g.length:0);if(e){f=g.lastIndexOf(" ",b);g=g.lastIndexOf(" ",b);f=f>g?f:g;f!==-1&&!c&&f++}else{f=g.indexOf(" ",b);g=g.indexOf(" ",b);f=f!==-1&&(g===-1||f<g)?f:g}return f}var f,g;if(a.nodeType===3){b=d(a,b);if(b!==-1)return{container:a,
offset:b};g=a}for(a=new E(a,r.getParent(a,D)||h.getBody());f=a[e?"prev":"next"]();)if(f.nodeType===3){g=f;b=d(f);if(b!==-1)return{container:f,offset:b}}else if(D(f))break;if(g){b=e?0:g.length;return{container:g,offset:b}}};if(m=n(f,j,!0))f=m.container,j=m.offset;if(m=n(k,l))k=m.container,l=m.offset}m=d(k,l);if(m.node){for(;m.node&&0===m.offset&&m.node.previousSibling;)m=d(m.node.previousSibling);m.node&&(0<m.offset&&3===m.node.nodeType&&" "===m.node.nodeValue.charAt(m.offset-1))&&1<m.offset&&(k=m.node,
k.splitText(m.offset-1))}}if(b[0].inline||b[0].block_expand){if(!b[0].inline||3!=f.nodeType||0===j)f=e(!0);if(!b[0].inline||3!=k.nodeType||l===k.nodeValue.length)k=e()}b[0].selector&&(b[0].expand!==H&&!b[0].inline)&&(m=function(c,e){var d,f,g,h;c.nodeType==3&&(c.nodeValue.length==0&&c[e])&&(c=c[e]);d=r.getParents(c,void 0,r.getRoot());for(f=0;f<d.length;f++)for(g=0;g<b.length;g++){h=b[g];if(!("collapsed"in h&&h.collapsed!==a.collapsed)&&r.is(d[f],h.selector))return d[f]}return c},f=m(f,"previousSibling"),
k=m(k,"nextSibling"));if(b[0].block||b[0].selector)m=function(a,c){var e;if(a==r.getRoot())return a;b[0].wrapper||(e=r.getParent(a,b[0].block));e||(e=r.getParent(a.nodeType==3?a.parentNode:a,D));e&&b[0].wrapper&&(e=r.getParents(e,"ul,ol",r.getRoot()).reverse()[0]||e);if(!e)for(e=a;e[c]&&!D(e[c]);){e=e[c];if(g(e,"br"))break}return e||a},f=m(f,"previousSibling"),k=m(k,"nextSibling"),b[0].block&&(D(f)||(f=e(!0)),D(k)||(k=e()));1==f.nodeType&&(j=F(f),f=f.parentNode);1==k.nodeType&&(l=F(k)+1,k=k.parentNode);
return{startContainer:f,startOffset:j,endContainer:k,endOffset:l}}function o(a,b,d,f){var h,i,j;if(!e(d,a))return H;if("all"!=a.remove){z(a.styles,function(a,c){a=u(a,b);"number"===typeof c&&(c=a,f=0);(!f||g(n(f,c),a))&&r.setStyle(d,c,"");j=1});j&&""==r.getAttrib(d,"style")&&(d.removeAttribute("style"),d.removeAttribute("data-mce-style"));z(a.attributes,function(a,c){var e,a=u(a,b);if(typeof c==="number"){c=a;f=0}if(!f||g(r.getAttrib(f,c),a)){if(c=="class")if(a=r.getAttrib(d,c)){e="";z(a.split(/\s+/),
function(a){/mce\w+/.test(a)&&(e=e+((e?" ":"")+a))});if(e){r.setAttrib(d,c,e);return}}c=="class"&&d.removeAttribute("className");L.test(c)&&d.removeAttribute("data-mce-"+c);d.removeAttribute(c)}});z(a.classes,function(a){a=u(a,b);(!f||r.hasClass(f,a))&&r.removeClass(d,a)});i=r.getAttribs(d);for(h=0;h<i.length;h++)if(0!==i[h].nodeName.indexOf("_"))return H}if("none"!=a.remove){h=d.parentNode;var k;a.block&&(J?h==r.getRoot()&&(!a.list_block||!g(d,a.list_block))&&z(c.grep(d.childNodes),function(a){C(J,
a.nodeName.toLowerCase())?k?k.appendChild(a):k=m(a,J):k=0}):(i=function(a,b,c){a=s(a,b,c);return!a||"BR"==a.nodeName||D(a)},D(d)&&!D(h)&&(!i(d,H)&&!i(d.firstChild,G,1)&&d.insertBefore(r.create("br"),d.firstChild),!i(d,G)&&!i(d.lastChild,H,1)&&d.appendChild(r.create("br")))));(!a.selector||!a.inline||g(a.inline,d))&&r.remove(d,1);return G}}function s(a,b,c){if(a){b=b?"nextSibling":"previousSibling";for(a=c?a:a[b];a;a=a[b])if(1==a.nodeType||!i(a))return a}}function p(a){return a&&1==a.nodeType&&"bookmark"==
a.getAttribute("data-mce-type")}function A(a,b){var e,d;if(a&&b){d=function(a,b){for(e=a;e&&!(3==e.nodeType&&0!==e.nodeValue.length);e=e[b])if(1==e.nodeType&&!p(e))return e;return a};a=d(a,"previousSibling");b=d(b,"nextSibling");d=a;var f=b,g=function(a){var b={};z(r.getAttribs(a),function(c){c=c.nodeName.toLowerCase();0!==c.indexOf("_")&&"style"!==c&&(b[c]=r.getAttrib(a,c))});return b},h=function(a,b){var c,e;for(e in a)if(a.hasOwnProperty(e)){c=b[e];if(c===N||a[e]!=c)return H;delete b[e]}for(e in b)if(b.hasOwnProperty(e))return H;
return G};if(d.nodeName!=f.nodeName||!h(g(d),g(f))||!h(r.parseStyle(r.getAttrib(d,"style")),r.parseStyle(r.getAttrib(f,"style")))?H:G){for(e=a.nextSibling;e&&e!=b;)d=e,e=e.nextSibling,a.appendChild(d);r.remove(b);z(c.grep(b.childNodes),function(b){a.appendChild(b)});return a}}return b}function y(a,b){var c,e,d;c=a[b?"startContainer":"endContainer"];e=a[b?"startOffset":"endOffset"];1==c.nodeType&&(d=c.childNodes.length-1,!b&&e&&e--,c=c.childNodes[e>d?d:e]);3===c.nodeType&&(b&&e>=c.nodeValue.length)&&
(c=(new E(c,h.getBody())).next()||c);3===c.nodeType&&(!b&&0==e)&&(c=(new E(c,h.getBody())).prev()||c);return c}function x(b,e,g){function i(a){var b=r.create("span",{id:p,"data-mce-bogus":!0,style:u?"color:red":""});a&&b.appendChild(h.getDoc().createTextNode(o));return b}function j(a,b){for(;a;){if(3===a.nodeType&&a.nodeValue!==o||1<a.childNodes.length)return!1;b&&1===a.nodeType&&b.push(a);a=a.firstChild}return!0}function l(a){for(;a;){if(a.id===p)return a;a=a.parentNode}}function m(a){var b;if(a){b=
new E(a,a);for(a=b.current();a;a=b.next())if(3===a.nodeType)return a}}function n(a,b){var c,e;if(a)e=B.getRng(!0),j(a)?(!1!==b&&(e.setStartBefore(a),e.setEndBefore(a)),r.remove(a)):(c=m(a),c.nodeValue.charAt(0)===K&&c.deleteData(0,1),r.remove(a,1)),B.setRng(e);else if(a=l(B.getStart()),!a)for(;a=r.get(p);)n(a,!1)}var o,p="_mce_caret",u=h.settings.caret_debug;o=c.isGecko?"​":K;self._hasCaretEvents||(h.onBeforeGetContent.addToTop(function(){var a=[],b;if(j(l(B.getStart()),a))for(b=a.length;b--;)r.setAttrib(a[b],
"data-mce-bogus","1")}),c.each(["onMouseUp","onKeyUp"],function(a){h[a].addToTop(function(){n()})}),h.onKeyDown.addToTop(function(a,b){var c=b.keyCode;(8==c||37==c||39==c)&&n(l(B.getStart()))}),self._hasCaretEvents=!0);if("apply"==b){var s,t,v,y;s=B.getRng(!0);b=s.startOffset;y=s.startContainer.nodeValue;(t=l(B.getStart()))&&(v=m(t));if(y&&0<b&&b<y.length&&/\w/.test(y.charAt(b))&&/\w/.test(y.charAt(b-1)))t=B.getBookmark(),s.collapse(!0),s=q(s,f(e)),s=I.split(s),a(e,g,s),B.moveToBookmark(t);else{if(!t||
v.nodeValue!==o)t=i(!0),v=t.firstChild,s.insertNode(t),b=1;a(e,g,t);B.setCursorLocation(v,b)}}else{y=B.getRng(!0);var x,A,b=[];x=y.startContainer;A=y.startOffset;v=x;if(3==x.nodeType){if(A!=x.nodeValue.length||x.nodeValue===o)t=!0;v=v.parentNode}for(;v;){if(d(v,e,g)){s=v;break}v.nextSibling&&(t=!0);b.push(v);v=v.parentNode}if(s)if(t)s=B.getBookmark(),y.collapse(!0),y=q(y,f(e),!0),y=I.split(y),k(e,g,y),B.moveToBookmark(s);else{v=g=i();for(e=b.length-1;0<=e;e--)v.appendChild(b[e].cloneNode(!1)),v=v.firstChild;
v.appendChild(r.doc.createTextNode(o));v=v.firstChild;r.insertAfter(g,s);B.setCursorLocation(v,1)}}}function t(a){var b=a.startContainer,c=a.startOffset,e;3==b.nodeType&&c>=b.nodeValue.length&&(b=b.parentNode,c=F(b)+1);if(1==b.nodeType){e=b.childNodes;b=e[Math.min(c,e.length-1)];b=new E(b,r.getParent(b,r.isBlock));c>e.length-1&&b.next();for(c=b.current();c;c=b.next())if(3==c.nodeType&&!i(c)){b=r.create("a",null,K);c.parentNode.insertBefore(b,c);a.setStart(c,0);B.setRng(a);r.remove(b);break}}}var v=
{},z=c.each,r=h.dom,B=h.selection,E=c.dom.TreeWalker,I=new c.dom.RangeUtils(r),C=h.schema.isValidChild,D=r.isBlock,J=h.settings.forced_root_block,F=r.nodeIndex,K="﻿",L=/^(src|href|style)$/,H=!1,G=!0,N,O=function(a){var b;h.dom.getParent(a,function(a){return(b=h.dom.getStyle(a,"text-decoration"))&&"none"!==b});return b},P=function(a){var b;1===a.nodeType&&(a.parentNode&&1===a.parentNode.nodeType)&&(b=O(a.parentNode),h.dom.getStyle(a,"color")&&b?h.dom.setStyle(a,"text-decoration",b):h.dom.getStyle(a,
"textdecoration")===b&&h.dom.setStyle(a,"text-decoration",null))};c.extend(this,{get:f,register:b,apply:a,remove:k,toggle:function(b,c,e){var d=f(b);j(b,c,e)&&(!("toggle"in d[0])||d[0].toggle)?k(b,c,e):a(b,c,e)},match:j,matchAll:function(a,b){var c,e=[],f={};c=B.getStart();r.getParent(c,function(c){var g,h;for(g=0;g<a.length;g++)h=a[g],!f[h]&&d(c,h,b)&&(f[h]=!0,e.push(h))});return e},matchNode:d,canApply:function(a){var a=f(a),b,c,e,d;if(a){b=B.getStart();b=r.getParents(b,void 0,r.getRoot());for(e=
a.length-1;0<=e;e--){d=a[e].selector;if(!d)return G;for(c=b.length-1;0<=c;c--)if(r.is(b[c],d))return G}}return H}})}})(tinymce);
tinymce.onAddEditor.add(function(c,h){var l,f,b,a=h.settings;if(a.inline_styles){f=c.explode(a.font_size_legacy_values);var k=function(a,e){c.each(e,function(c,e){c&&b.setStyle(a,e,c)});b.rename(a,"span")};l={font:function(a,b){k(b,{backgroundColor:b.style.backgroundColor,color:b.color,fontFamily:b.face,fontSize:f[parseInt(b.size)-1]})},strike:function(a,b){k(b,{textDecoration:"line-through"})}};var d=function(d,e){b=d.dom;a.convert_fonts_to_spans&&c.each(b.select("font,strike",e.node),function(a){l[a.nodeName.toLowerCase()](h.dom,
a)})};h.onPreProcess.add(d);h.onSetContent.add(d);h.onInit.add(function(){h.selection.onSetContent.add(d)})}});
define("atlassian-editor-plugins/paste/repairer-util",function(c,h){h.getBrAndContents=function(c){return $("<br>").add(c.contents())};h.isEmptyLine=function(c){return""===c.text()};h.isNodeContainingText=function(c){return(c.nodeType===Node.ELEMENT_NODE||c.nodeType===Node.TEXT_NODE)&&$.trim(c.textContent)};h.isFirstTextContentInParent=function(c){var f=!1;c.parent().contents().each(function(){if(h.isNodeContainingText(this))return this===c[0]&&(f=!0),!1});return f};h.replaceWithP=function(c){var f=
c.attr("style"),b=$("<p></p>").append(c.contents());f&&b.attr("style",f);c.replaceWith(b)};h.appendContentsToPreviousContentOrP=function(c){var f=c.prev("p");f.length?(f.append(h.getBrAndContents(c)),c.remove()):h.isFirstTextContentInParent(c)?h.replaceWithP(c):c.replaceWith(h.getBrAndContents(c))};h.createMacro=function(c,f){var b=$('<table class="wysiwyg-macro" data-macro-name="'+c+'" data-macro-body-type="RICH_TEXT"><tbody><tr><td class="wysiwyg-macro-body"></td></tr></tbody></table>');b.find(".wysiwyg-macro-body").append(f);
return b}});
define("atlassian-editor-plugins/paste/repairer",["atlassian-editor-plugins/paste/repairer-util"],function(c){var h=[function(h){h.find(".expand-container").replaceWith(function(){var f=$(this).find(".expand-content").first().contents();return f.length?c.createMacro("expand",f):""})},function(c){c.find("span:empty").remove()},function(c){c.find("p + br").remove()},function(h){var f=!1;h.find("div:not(.content-wrapper)").each(function(){var b=$(this);c.isEmptyLine(b)?(b.remove(),f=!0):b.find("div, p, pre").length?
b.replaceWith(b.contents()):(f?c.replaceWithP(b):c.appendContentsToPreviousContentOrP(b),f=!1)})}];return{repair:function(c){var f=$("<div></div>").html(c);h.forEach(function(b){b(f)});return f.html()}}});
(function(c){function h(b,c){return b.getParam(c,a[c])}function l(a,b){a.is("ul.inline-task-list")?b.each(function(){var a=c(this);a.attr("data-inline-task-id")||a.attr("data-inline-task-id","")}):b.removeAttr("data-inline-task-id").removeAttr("data-pasted-task")}function f(a){var b=a.filter("ol,ul").length;return a.length===b}var b=tinymce.each,a={paste_auto_cleanup_on_paste:!0,paste_enable_default_filters:!0,paste_block_drop:!1,paste_retain_style_properties:"none",paste_strip_class_attributes:"mso",
paste_remove_spans:!1,paste_remove_styles:!1,paste_remove_styles_if_webkit:!1,paste_convert_middot_lists:!0,paste_convert_headers_to_strong:!1,paste_dialog_width:"450",paste_dialog_height:"400",paste_text_use_dialog:!1,paste_text_sticky:!1,paste_text_sticky_default:!1,paste_text_notifyalways:!1,paste_text_linebreaktype:"combined",paste_text_replacements:[[/\u2026/g,"..."],[/[\x93\x94\u201c\u201d]/g,'"'],[/[\x60\x91\x92\u2018\u2019]/g,"'"]]},k,d=function(a,b){if(!b.collapsed||0!=b.startOffset)return!1;
var d=c(b.startContainer).closest("ol, ul",a.getBody());if(0===d.length)return!1;d=(new tinymce.dom.TreeWalker(b.startContainer,d[0])).prev(!0);return void 0===d||c(d).is("li")},j=function(a){a=3===a.startContainer.nodeType?a.startContainer.parentNode:a.startContainer;return tinymce.isIE?"LI"===a.nodeName&&0===a.childNodes.length:"LI"===a.nodeName&&1===a.childNodes.length&&"BR"===a.firstChild.nodeName};tinymce.create("tinymce.plugins.AtlassianEditorPaste",{init:function(a,d){function f(b,c){var d=
a.dom,g;l.onPreProcess.dispatch(l,b);q&&(b.content=q.repair(b.content));b.node=d.create("div",0,b.content);tinymce.isGecko&&(g=a.selection.getRng(!0),g.startContainer==g.endContainer&&3===g.startContainer.nodeType&&1===b.node.childNodes.length&&(/^(p|h[1-6]|pre)$/i.test(b.node.firstChild.nodeName)&&-1===b.content.indexOf("__MCE_ITEM__"))&&d.remove(b.node.firstChild,!0));l.onPostProcess.dispatch(l,b);b.content=a.serializer.serialize(b.node,{getInner:1,forced_root_block:""});!c&&a.pasteAsPlainText?
(l._insertPlainText(b.content),h(a,"paste_text_sticky")||(a.pasteAsPlainText=!1,a.controlManager.setActive("pastetext",!1))):l._insert(b.content);tinymce.isGecko&&a.dom.getRoot().focus()}function j(c){if(c){var d=c.firstChild;d&&("DIV"===d.nodeName&&d.style.marginTop&&d.style.backgroundColor)&&a.dom.remove(d,1);tinymce.isWebKit&&b(a.dom.select("span.Apple-style-span",c),function(b){a.dom.removeClass(b,"Apple-style-span")});tinymce.isWebKit&&b(a.dom.select("br.Apple-interchange-newline",c),function(b){a.dom.remove(b)});
b(a.dom.select("br[data-mce-bogus]",c),function(b){a.dom.remove(b)});b(a.dom.select("meta[charset]",c),function(b){a.dom.remove(b)})}}function i(d){var g,h,i,k,q=a.selection,t=a.dom;i=a.getBody();var v,z;a.undoManager.add();if(function(b){if(!b.clipboardData||-1==c.inArray("text/html",b.clipboardData.types||[]))return!1;var b=b.clipboardData.getData("text/html"),d;if(!b||!c.browser.webkit)return!1;d=l.repair(b);if(d==b)return!1;b=l.parse(d,a.getDoc());d=c("<div></div>");d.append(b);j(d[0]);f({content:d.html()});
return!0}(d))c.Event(d).preventDefault();else{if(d.clipboardData||t.doc.dataTransfer)if(v=(d.clipboardData||t.doc.dataTransfer).getData("Text"),a.pasteAsPlainText){d.preventDefault();f({content:t.encode(v).replace(/\r?\n/g,"<br />")});return}if(!t.get("_mcePaste"))if(z=c(a.selection.getStart()).closest("[data-macro-body-type='PLAIN_TEXT']").length,k=i,"true"!=i.contentEditable&&(k=t.getParent(a.selection.getStart(),'[contenteditable="true"]',i)),g=t.add(k,"div",{id:"_mcePaste","class":"mcePaste",
"data-mce-bogus":"1"},"﻿﻿"),i!=a.getDoc().body?i=t.getPos(a.selection.getStart(),i).y:(i=t.getViewPort(a.getWin()),i=i.y+parseInt(i.h/2,10)),t.setStyles(g,{position:"absolute",left:tinymce.isGecko?-40:0,top:i-25,width:1,height:1,overflow:"hidden"}),tinymce.isIE)if(k=q.getRng(),i=t.doc.body.createTextRange(),i.moveToElementText(g),i.execCommand("Paste"),t.remove(g),"﻿﻿"===g.innerHTML)a.execCommand("mcePasteWord"),d.preventDefault();else return q.setRng(k),q.setContent(""),setTimeout(function(){f({content:g.innerHTML})},
0),tinymce.dom.Event.cancel(d);else{var r=function(a){a.preventDefault()};t.bind(a.getDoc(),"mousedown",r);t.bind(a.getDoc(),"keydown",r);h=q.getBookmark();g=g.firstChild;i=a.getDoc().createRange();i.setStart(g,0);i.setEnd(g,2);q.setRng(i);window.setTimeout(function(){var c="",d;if(t.select("div.mcePaste > div.mcePaste").length)c=z?"<p>"+t.encode(v).replace(/\r?\n/g,"<br />")+"</p>":"<p>"+t.encode(v).replace(/\r?\n\r?\n/g,"</p><p>").replace(/\r?\n/g,"<br />")+"</p>";else{d=t.select("div.mcePaste");
b(d,function(a){j(a);a.parentNode.className!="mcePaste"&&(c=c+a.innerHTML)})}b(t.select("div.mcePaste"),function(a){t.remove(a)});h&&q.moveToBookmark(h);f({content:c});t.unbind(a.getDoc(),"mousedown",r);t.unbind(a.getDoc(),"keydown",r)},0)}}}var l=this;l.editor=a;l.url=d;l.onPreProcess=new tinymce.util.Dispatcher(l);l.onPostProcess=new tinymce.util.Dispatcher(l);l.onPreProcess.add(l._preProcess);l.onPostProcess.add(l._postProcess);l.onPreProcess.add(function(b,c){a.execCallback("paste_preprocess",
b,c)});l.onPostProcess.add(function(b,c){a.execCallback("paste_postprocess",b,c)});k=[{repair:function(a){var b=/<meta charset='utf-8'>(<td.*<\/td>)<br class="Apple-interchange-newline">/.exec(a);return b?'<table class="confluenceTable"><tbody><tr>'+b[1]+"</tr></tbody></table>":a}},{repair:function(a){var b=/<meta charset='utf-8'>(<tr.*<\/tr>)<br class="Apple-interchange-newline">/.exec(a);return b?'<table class="confluenceTable"><tbody>'+b[1]+"</tbody></table>":a}}];a.onKeyDown.addToTop(function(a,
b){if((tinymce.isMac?b.metaKey:b.ctrlKey)&&!b.shiftKey&&86===b.keyCode||b.shiftKey&&45===b.keyCode)return!1});a.pasteAsPlainText=h(a,"paste_text_sticky_default");var q=null;AJS&&(AJS.DarkFeatures&&!AJS.DarkFeatures.isEnabled("editor.advanced.paste.disable"))&&require(["atlassian-editor-plugins/paste/repairer"],function(a){q=a});a.addCommand("mceInsertClipboardContent",function(a,b){f(b,!0)});h(a,"paste_text_use_dialog")||a.addCommand("mcePasteText",function(){var b=tinymce.util.Cookie;a.pasteAsPlainText=
!a.pasteAsPlainText;a.controlManager.setActive("pastetext",a.pasteAsPlainText);a.pasteAsPlainText&&!b.get("tinymcePasteText")&&(h(a,"paste_text_sticky")?a.windowManager.alert(a.translate("paste.plaintext_mode_sticky")):a.windowManager.alert(a.translate("paste.plaintext_mode")),h(a,"paste_text_notifyalways")||b.set("tinymcePasteText","1",new Date((new Date).getFullYear()+1,12,31)))});a.addButton("pastetext",{title:"paste.paste_text_desc",cmd:"mcePasteText"});a.addButton("selectall",{title:"paste.selectall_desc",
cmd:"selectall"});h(a,"paste_auto_cleanup_on_paste")&&(tinymce.isOpera||/Firefox\/2/.test(navigator.userAgent)?a.onKeyDown.addToTop(function(a,b){((tinymce.isMac?b.metaKey:b.ctrlKey)&&86===b.keyCode||b.shiftKey&&45===b.keyCode)&&i(b)}):a.onPaste.addToTop(function(a,b){return i(b)}));a.onInit.add(function(){a.controlManager.setActive("pastetext",a.pasteAsPlainText);h(a,"paste_block_drop")&&a.dom.bind(a.getBody(),"dragend dragover draggesture dragdrop drop drag".split(" "),function(a){a.preventDefault();
a.stopPropagation();return false})});a.onSaveContent.add(function(a,b){var e=c("<div/>").html(b.content);c('ul.inline-task-list > li[data-pasted-task="true"]',e).each(function(){var a=c(this),b=a.attr("data-inline-task-id");b&&1<e.find('ul.inline-task-list > li[data-inline-task-id="'+b+'"]').size()&&a.attr("data-inline-task-id","")});b.content=e.html()});l._legacySupport()},getInfo:function(){return{longname:"AtlassianEditorPaste",author:"Atlassian",authorurl:"http://www.atlassian.com",infourl:"http://www.atlassian.com",
version:tinymce.majorVersion+"."+tinymce.minorVersion}},_preProcess:function(a,c){function d(a){b(a,function(a){i=a.constructor==RegExp?i.replace(a,""):i.replace(a[0],a[1])})}var f=this.editor,i=c.content,j=tinymce.grep,k=tinymce.explode,l=tinymce.trim,s,p;if(!1!=f.settings.paste_enable_default_filters){tinymce.isIE&&9<=document.documentMode&&(d([[/(?:<br>&nbsp;[\s\r\n]+|<br>)*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:<br>&nbsp;[\s\r\n]+|<br>)*/g,
"$1"]]),d([[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]]));if(/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(i)||c.wordContent){c.wordContent=!0;d([/^\s*(&nbsp;)+/gi,/(&nbsp;|<br[^>]*>)+\s*$/gi]);h(f,"paste_convert_headers_to_strong")&&(i=i.replace(/<p [^>]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi,"<p><strong>$1</strong></p>"));h(f,"paste_convert_middot_lists")&&d([[/<\!--\[if !supportLists\]--\>/gi,"$&__MCE_ITEM__"],[/(<span[^>]+(?:mso-list:|:\s*symbol)[^>]+>)/gi,"$1__MCE_ITEM__"],
[/(<p[^>]+(?:MsoListParagraph)[^>]+>)/gi,"$1__MCE_ITEM__"]]);d([/<\!--[\s\S]+?--\>/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/&nbsp;/gi," "]]);do s=i.length,i=i.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi,"$1");while(s!=i.length);0===h(f,"paste_retain_style_properties").replace(/^none$/i,"").length?i=i.replace(/<\/?span[^>]*>/gi,""):d([[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,
function(a,b){return b.length>0?b.replace(/./," ").slice(Math.floor(b.length/2)).split("").join(" "):""}],[/(<[a-z][^>]*)\sstyle="([^"]*)"/gi,function(a,c,e){var d=[],f=0,a=k(l(e).replace(/&quot;/gi,"'"),";");b(a,function(a){function b(a){return a+(a!=="0"&&/\d$/.test(a))?"px":""}var c,e=k(a,":");if(e.length===2){a=e[0].toLowerCase();c=e[1].toLowerCase();switch(a){case "mso-padding-alt":case "mso-padding-top-alt":case "mso-padding-right-alt":case "mso-padding-bottom-alt":case "mso-padding-left-alt":case "mso-margin-alt":case "mso-margin-top-alt":case "mso-margin-right-alt":case "mso-margin-bottom-alt":case "mso-margin-left-alt":case "mso-table-layout-alt":case "mso-height":case "mso-width":case "mso-vertical-align-alt":d[f++]=
a.replace(/^mso-|-alt$/g,"")+":"+b(c);return;case "horiz-align":d[f++]="text-align:"+c;return;case "vert-align":d[f++]="vertical-align:"+c;return;case "font-color":case "mso-foreground":d[f++]="color:"+c;return;case "mso-background":case "mso-highlight":d[f++]="background:"+c;return;case "mso-default-height":d[f++]="min-height:"+b(c);return;case "mso-default-width":d[f++]="min-width:"+b(c);return;case "mso-padding-between-alt":d[f++]="border-collapse:separate;border-spacing:"+b(c);return;case "text-line-through":if(c==
"single"||c=="double")d[f++]="text-decoration:line-through";return;case "mso-zero-height":c=="yes"&&(d[f++]="display:none");return}/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(a)||(d[f++]=a+":"+e[1])}});return f>0?c+' style="'+d.join(";")+'"':c}]])}h(f,"paste_convert_headers_to_strong")&&d([[/<h[1-6][^>]*>/gi,"<p><strong>"],[/<\/h[1-6][^>]*>/gi,"</strong></p>"]]);
d([[/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi,""]]);p=h(f,"paste_strip_class_attributes");"none"!==p&&(s=function(a,b){if(p==="all")return"";var c=j(k(b.replace(/^(["'])(.*)\1$/,"$2")," "),function(a){return/^(?!mso)/i.test(a)});return c.length?' class="'+c.join(" ")+'"':""},i=i.replace(/ class="([^"]+)"/gi,s),i=i.replace(/ class=([\-\w]+)/gi,s));h(f,"paste_remove_spans")&&(i=i.replace(/<\/?span[^>]*>/gi,""));c.content=i}},_postProcess:function(a,c){var d=
this.editor,f=d.dom,i;!1!=d.settings.paste_enable_default_filters&&(c.wordContent&&(b(f.select("a",c.node),function(a){(!a.href||-1!==a.href.indexOf("#_Toc"))&&f.remove(a,1)}),h(d,"paste_convert_middot_lists")&&this._convertLists(a,c),i=h(d,"paste_retain_style_properties"),tinymce.is(i,"string")&&("all"!==i&&"*"!==i)&&(i=tinymce.explode(i.replace(/^none$/i,"")),b(f.select("*",c.node),function(a){var b={},c=0,e,d,g;if(i)for(e=0;e<i.length;e++)if(d=i[e],g=f.getStyle(a,d))b[d]=g,c++;f.setAttrib(a,"style",
"");i&&0<c?f.setStyles(a,b):"SPAN"===a.nodeName&&!a.className&&f.remove(a,!0)}))),h(d,"paste_remove_styles")||h(d,"paste_remove_styles_if_webkit")&&tinymce.isWebKit?b(f.select("*[style]",c.node),function(a){a.removeAttribute("style");a.removeAttribute("data-mce-style")}):tinymce.isWebKit&&b(f.select("*",c.node),function(a){a.removeAttribute("data-mce-style")}))},_convertLists:function(a,c){var d=a.editor.dom,f,h,j=-1,k,l=[],s,p;b(d.select("p",c.node),function(a){var c,e="",g;for(c=a.firstChild;c&&
3===c.nodeType;c=c.nextSibling)e+=c.nodeValue;e=a.innerHTML.replace(/<\/?\w+[^>]*>/gi,"").replace(/&nbsp;/g," ");/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*\u00a0*/.test(e)&&(g="ul");/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(e)&&(g="ol");g?(k=parseFloat(a.style.marginLeft||0),k>j&&l.push(k),!f||g!=s?(f=d.create(g),d.insertAfter(f,a)):k>j?f=h.appendChild(d.create(g)):k<j&&(c=tinymce.inArray(l,k),e=d.getParents(f.parentNode,g),f=e[e.length-1-c]||f),b(d.select("span",a),function(a){var b=a.innerHTML.replace(/<\/?\w+[^>]*>/gi,
"");g=="ul"&&/^__MCE_ITEM__[\u2022\u00b7\u00a7\u00d8o\u25CF]/.test(b)?d.remove(a):/^__MCE_ITEM__[\s\S]*\w+\.(&nbsp;|\u00a0)*\s*/.test(b)&&d.remove(a)}),c=a.innerHTML,c="ul"==g?a.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*(&nbsp;|\u00a0)+\s*/,""):a.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^\s*\w+\.(&nbsp;|\u00a0)+\s*/,""),h=f.appendChild(d.create("li",0,c)),d.remove(a),j=k,s=g):f=j=0});p=c.node.innerHTML;-1!==p.indexOf("__MCE_ITEM__")&&(c.node.innerHTML=
p.replace(/__MCE_ITEM__/g,""))},_insert:function(a,b){var c=this.editor,d=c.selection.getRng(!0),f,h,a=this._applyOnBeforeSetContentListeners(c,a);h=this.parse(a,c.getDoc());(f=this._getClipboardInserter(c,d,h))?(f.insert(c,d,h),c.selection.onSetContent.dispatch(c.selection,{content:a,format:"html"}),c.addVisual()):(!c.selection.isCollapsed()&&d.startContainer!=d.endContainer&&c.execCommand("mceDelete",!1,null,{skip_undo:!0}),c.execCommand("mceInsertContent",!1,a,{skip_undo:b}))},_getClipboardInserter:function(a,
b,d){var f;c.each(this.clipboardInserters,function(c,h){if(h.shouldInsert(a,b,d))return f=h,!1});return f},clipboardInserters:[{shouldInsert:function(a,b,c){return(a=(a=j(b))&&f(c))&&0<c.children("li").length},insert:function(a,b,d){b=c(3===b.startContainer.nodeType?b.startContainer.parentNode:b.startContainer);d=d.children();a.undoManager.beforeChange();a.undoManager.add();l(b.parent(),d);b.replaceWith(d);a.selection.select(d.last()[0],!0);a.selection.collapse();a.undoManager.add()}},{shouldInsert:function(a,
b,c){return(a=(a=d(a,b))&&f(c))&&0<c.children("li").length},insert:function(a,b,d){b=c(b.startContainer).closest("li",a.getBody());d=d.children();a.undoManager.beforeChange();a.undoManager.add();l(b.parent(),d);b.before(d);a.selection.select(b[0],!0);a.selection.collapse(!0);a.undoManager.add()}},{shouldInsert:function(a,b,d){!b.collapsed||3===b.startContainer.nodeType&&b.startOffset!=b.startContainer.nodeValue.length||1===b.startContainer.nodeType&&b.startOffset!=b.startContainer.childNodes.length?
b=!1:(a=c(b.startContainer).closest("ol, ul",a.getBody()),0===a.length?b=!1:(b=(new tinymce.dom.TreeWalker(b.startContainer,a[0])).next(!0),b=void 0===b||c(b).is("li")));return b&&d.length===d.filter("ol,ul").length&&0<d.children("li").length},insert:function(a,b,d){b=c(b.startContainer).closest("li",a.getBody());d=d.children();a.undoManager.beforeChange();a.undoManager.add();l(b.parent(),d);b.after(d);a.selection.select(d.last()[0],!0);a.selection.collapse(!1);a.undoManager.add()}},{shouldInsert:function(a,
b,c){var f=1<c.length;if(a=f=(f=f&&!j(b))&&d(a,b))a=c.filter("ol,ul"),c=c[c.length-1],a=1===a.length&&a[0]===c;return a},insert:function(a,b,d){b=c(b.startContainer).closest("li",a.getBody());a.undoManager.beforeChange();a.undoManager.add();l(b.parent(),d.children("li"));d=c("<li></li>").append(d);b.before(d);a.undoManager.add()}},{shouldInsert:function(a,b,d){return b.collapsed||!c(b.commonAncestorContainer).is("table.confluenceTable > tbody, table.confluenceTable > tbody > tr")?!1:d.is("table:not(.wysiwyg-macro)")},
insert:function(a,b,d){function f(a,b){for(var d=a.shift(),e=b.shift();d&&e;d=a.shift(),e=b.shift())c(e).html(c(d).html())}var h=0<d.children("tbody").length?d.children("tbody").children("tr"):d.children("tr"),j=h.children("td, th"),k=c(".mceSelected",a.getDoc()),d=k.parent();a.undoManager.beforeChange();a.undoManager.add();if(1===d.length)f(c.makeArray(j),c.makeArray(k));else{h=c.makeArray(h);d=c.makeArray(d);j=h.shift();for(k=d.shift();j&&k;j=h.shift(),k=d.shift())f(c.makeArray(c(j).children()),
c.makeArray(c(k).children()))}a.selection.setRng(b);a.undoManager.add()}},{shouldInsert:function(a,b,d){a=c(b.startContainer).closest("td.confluenceTd, th.confluenceTh",".mceContent");if(0===a.length)return!1;a=a.closest("table.confluenceTable",".mceContent");if(!(0===a.length||0===a.children("tbody").length)){if(!d.is("table:not(.wysiwyg-macro)"))return!1;var f=!1;a.find("*[colspan], *[rowspan]").each(function(a,b){if(1<c(b).attr("rowspan")||1<c(b).attr("colspan"))return f=!0,!1});return!f}},insert:function(a,
b,d){var b=c(b.startContainer).closest("td.confluenceTd, th.confluenceTh",".mceContent"),f=b.closest("table.confluenceTable",".mceContent"),d=0<d.children("tbody").length?d.children("tbody").children("tr"):d.children("tr"),h=f.children("tbody").children("tr"),j=d.length,k=d.first().children("td, th").length,l=h.length,s=h.first().children("td, th").length,p=b.parent().index(),A=b.index();a.undoManager.beforeChange();a.undoManager.add();var y=A+k-s,j=p+j-l,y=0>y?0:y,j=0>j?0:j;h.each(function(a,b){for(var d=
c(b),e=d.children().last(),f=0;f<y;f++)d.append(e.clone().html(tinymce.isIE?"":"<br/>"))});k=h.last();for(h=0;h<j;h++){k=c("<tr></tr>").insertAfter(k);for(l=0;l<s+y;l++)k.append('<td class="confluenceTd">'+(tinymce.isIE?"":"<br/>")+"</td>")}var x=[];f.children("tbody").children("tr").slice(p).each(function(a,b){x.push(c.makeArray(c(b).children("th, td").slice(A)))});var t=[];d.each(function(a,b){t.push(c.makeArray(c(b).children("th, td")))});f=t.shift();for(d=x.shift();f&&d;f=t.shift(),d=x.shift()){s=
f.shift();for(p=d.shift();s&&p;s=f.shift(),p=d.shift())c(p).html(c(s).html())}a.selection.select(b[0],1);a.selection.collapse(!0);a.undoManager.add()}}],_applyOnBeforeSetContentListeners:function(a,b){var c={content:b,format:"html"};a.selection.onBeforeSetContent.dispatch(a.selection,c);return c.content},_insertPlainText:function(a){function c(d){b(d,function(b){a=b.constructor==RegExp?a.replace(b,""):a.replace(b[0],b[1])})}var d=this.editor,f=h(d,"paste_text_linebreaktype"),i=h(d,"paste_text_replacements"),
j=tinymce.is;"string"===typeof a&&0<a.length&&(/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(a)?c([/[\n\r]+/g]):c([/\r+/g]),c([[/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi,"\n\n"],[/<br[^>]*>|<\/tr>/gi,"\n"],[/<\/t[dh]>\s*<t[dh][^>]*>/gi,"\t"],/<[a-z!\/?][^>]*>/gi,[/&nbsp;/gi," "],[/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi,"$1"],[/\n{3,}/g,"\n\n"]]),a=d.dom.decode(tinymce.html.Entities.encodeRaw(a)),j(i,"array")?c(i):j(i,
"string")&&c(RegExp(i,"gi")),"none"==f?c([[/\n+/g," "]]):"br"==f?c([[/\n/g,"<br />"]]):"p"==f?c([[/\n+/g,"</p><p>"],[/^(.*<\/p>)(<p>)$/,"<p>$1"]]):c([[/\n\n/g,"</p><p>"],[/^(.*<\/p>)(<p>)$/,"<p>$1"],[/\n/g,"<br />"]]),d.execCommand("mceInsertContent",!1,a))},_legacySupport:function(){var a=this,b=a.editor;b.addCommand("mcePasteWord",function(){b.windowManager.open({file:a.url+"/pasteword.htm",width:parseInt(h(b,"paste_dialog_width")),height:parseInt(h(b,"paste_dialog_height")),inline:1})});h(b,"paste_text_use_dialog")&&
b.addCommand("mcePasteText",function(){b.windowManager.open({file:a.url+"/pastetext.htm",width:parseInt(h(b,"paste_dialog_width")),height:parseInt(h(b,"paste_dialog_height")),inline:1})});b.addButton("pasteword",{title:"paste.paste_word_desc",cmd:"mcePasteWord"})},parse:function(a,b){return"<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&3<=a.length?c(a,b||document):c("<div>"+a+"</div>",b||document).contents()},repair:function(a){if(!a)return a;c.each(k,function(b,c){a=c.repair(a)});return a}});tinymce.PluginManager.add("aePaste",
tinymce.plugins.AtlassianEditorPaste)})($);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.plugins.tinymce:atlassian-rte-javascript-tinymce-extensions', location = 'jscripts/tiny_mce/themes/atlassian/editor_template.js' */
define("atlassian-tinymce/themes/atlassian/editor_template",["ajs","confluence/templates","jquery","tinymce","underscore"],function(k,j,g,h,i){return function(){var l=h.DOM,m=h.each,n=h.explode,o=h.extend,e;e=function(a){this.init=this.init(a)};e.INCOMPATIBLE_PLUGINS=["dfe"];e.shouldInit=function(){var a=g("body");return a.hasClass("edit")||a.hasClass("create")||a.hasClass("copy-page")};e.suppressIncompatiblePlugins=function(){for(var a=function(){},b=0,f=e.INCOMPATIBLE_PLUGINS.length;b<f;b++)h.PluginManager.lookup[e.INCOMPATIBLE_PLUGINS[b]]=
a};e.prototype.init=function(a){function b(a){c.toggleToolbarButtons(a,a,a,function(){return!g(this).parent().hasClass("close")})}function f(){var a=m-i.scrollTop(),c=l.offset().top-h.offset().top,b=j.outerHeight(),d=l.outerHeight();j.css("top",c+d+a+o+"px");e.css("padding-top",b+n+"px")}var d=g.ui.keyCode,c=a.plugins.customtoolbar,q=g("#content-title"),h=g("form.editor"),e=g(a.getBody()),i=g(a.getDoc()),j=g("#editor-precursor"),k=g(a.getWin()),l=g("#toolbar"),m=i.scrollTop(),n=parseInt(e.css("padding-top"),
10)+parseInt(e.css("margin-top"),10),o=parseInt(j.css("padding-top"),10),r=window.requestAnimationFrame||window.webkitRequestAnimationFrame;q.on("keydown",function(c){var b=c.keyCode||c.which;if(b===d.ENTER||b===d.DOWN)c.preventDefault(),c.stopPropagation(),a.focus()}).on("focus click",function(){b(!0)});k.on("focus",function(){b(!1)});(function p(){r(p);f()})();e.on("scroll mousewheel",function(){setTimeout(f,0)});return!0};return{Editor:e,ThemeOptions:{controlHandlers:{},controls:{bold:"Bold",italic:"Italic",
underline:"Underline",strikethrough:"Strikethrough",justifyleft:"JustifyLeft",justifycenter:"JustifyCenter",justifyright:"JustifyRight",bullist:"InsertUnorderedList",numlist:"InsertOrderedList",tasklist:"InsertInlineTaskList",outdent:"Outdent",indent:"Indent",cut:"Cut",copy:"Copy",paste:"Paste",undo:"Undo",redo:"Redo",removeformat:"RemoveFormat",sub:"subscript",sup:"superscript",forecolor:"ForeColor",forecolorpicker:"mceForeColor",backcolor:"HiliteColor",backcolorpicker:"mceBackColor",charmap:"mceCharMap",
visualaid:"mceToggleVisualAid",anchor:"mceInsertAnchor",newdocument:"mceNewDocument",blockquote:"mceBlockQuote"},stateControls:"bold italic underline bullist numlist tasklist justifyleft justifycenter justifyright strikethrough sub sup monospace".split(" "),init:function(a,b){var f=e.shouldInit(),d=this;f&&e.suppressIncompatiblePlugins();d.editor=a;d.url=b;d.settings=o({theme_advanced_toolbar_location:"bottom",theme_advanced_buttons1:"formatselect,bold,italic,underline,strikethrough,forecolor,separator,table,row_before,row_after,delete_row,col_before,col_after,delete_col,delete_table,separator,bullist,numlist,tasklist,outdent,indent,blockquote,justifyleft,justifycenter,justifyright,justifyfull,separator,sup,sub,separator,undo,redo,separator,conflink,oldlinkbrowserButton,confimage,conf_macro_browser,separator,search,code,customtoolbar, monospacep,h1,h2,h3,h4,h5,h6,pre,blockquote",
readonly:a.settings.readonly},a.settings);a.onInit.add(function(){a.settings.readonly||(a.onNodeChange.add(d.nodeChanged,d),a.onKeyUp.add(d._updateUndoStatus,d),a.onMouseUp.add(d._updateUndoStatus,d),a.dom.bind(a.dom.getRoot(),"dragend",function(){d._updateUndoStatus(a)}),f&&new e(a))})},execCommand:function(a,b,f){return(a=this["_"+a])?(a.call(this,b,f),!0):!1},renderUI:function(a){this.bindControls();return{iframeContainer:l.get("rte"),editorContainer:"wysiwyg",sizeContainer:void 0,deltaHeight:a.deltaHeight}},
getInfo:function(){return{longname:"Confluence theme",author:"Atlassian",authorurl:"http://tinymce.moxiecode.com",version:h.majorVersion+"."+h.minorVersion}},bindControls:function(){var a=this;m(n(a.settings.theme_advanced_buttons1),function(b){if(!a.createEditorButtons(b))switch(b){case "formatselect":a.createBlockFormats()}});a.bindControlHandlers();a.renderToolbarButtons()},renderToolbarButtons:function(){var a=this,b=j.Editor.Toolbar.toolbarButton,f={toolbar:"toolbar-primary",title:"",tooltip:"",
cmd:"",className:"",locationGroup:null,weight:Infinity,onclick:null},d=i.map(this.editor.buttons,function(a,b){a=i.extend({},f,a);a.id=b;a.weight=i.isNumber(a.weight)?a.weight:Infinity;return a}),d=i.filter(d,function(a){return!!a.locationGroup});i.each(["toolbar-primary"],function(c){var f=g("."+c),c=i.where(d,{toolbar:c}),c=i.sortBy(c,"weight");i.each(c,function(c){a.createEditorButtons(c.id);var d=f.find("."+c.locationGroup),c=g(b({button:c}));d.append(c).removeClass("hidden")})})},createEditorButtons:function(a){var b=
this.editor.buttons[a];if(b)this.controls[a]=b.cmd?b.cmd:b.onclick;else return!1},bindControlHandlers:function(){var a=this;a.controlHandlers.buttons={};a.controlHandlers.buttons.state=new h.util.Dispatcher;a.controlHandlers.buttons.click=new h.util.Dispatcher;a.controlHandlers.buttons.click.add(function(b){var f=a.controls[b],d=typeof f;"string"===d?k.Rte.getEditor().execCommand(a.controls[b]):"function"===d&&f()})},createBlockFormats:function(){this.controlHandlers.formatselect={};this.controlHandlers.formatselect.state=
new h.util.Dispatcher;this.controlHandlers.formatselect.click=new h.util.Dispatcher;this.controlHandlers.formatselect.click.add(function(a){k.Rte.getEditor().execCommand("FormatBlock",!1,a)})},createForeColorMenu:function(){return!0},_updateUndoStatus:function(a){a=a.undoManager;this.controlHandlers.buttons.state.dispatch("undo","disabled",!a.hasUndo()&&!a.typing);this.controlHandlers.buttons.state.dispatch("redo","disabled",!a.hasRedo())},nodeChanged:function(a,b,f,d,c){var e=this;m(e.stateControls,
function(b){e.controlHandlers.buttons.state.dispatch(b,"active",!!a.queryCommandState(e.controls[b]))});e._updateUndoStatus(a);e.controlHandlers.buttons.state.dispatch("outdent","disabled",!a.queryCommandState("Outdent"));a:{b=l.isBlock;f=c.parents;for(c=0;c<f.length;c++)if(b(f[c])){c=f[c];break a}c=void 0}c&&e.controlHandlers.formatselect.state.dispatch(c.nodeName.toLowerCase())}}}}});
require("confluence/module-exporter").safeRequire("atlassian-tinymce/themes/atlassian/editor_template",function(k){require("ajs").toInit(function(){var j=require("tinymce"),g=k();j.ThemeManager.requireLangPack("advanced");j.create("tinymce.themes.ConfluenceTheme",g.ThemeOptions);j.ThemeManager.add("atlassian",j.themes.ConfluenceTheme);window.requestAnimFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame})});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.plugins.tinymce:atlassian-rte-javascript-tinymce-extensions', location = 'jscripts/jquery/jquery-column.js' */
/*
 jQuery Column cell selector v1.0

 Licensed under the new BSD License.
 Copyright 2009-2012, Bram Stein
 All rights reserved.

 ATLASSIAN modified: Removed all extensions,modifications to jQuery expression internals (jQuery.expr)
 now creates pseudo selector via jQuery/Sizzle preferred method
*/
define("atlassian-tinymce/jquery/jquery-column",["jquery"],function(f){var g=/([\+\-]?\d*)[nN]([\+\-]?\d*)/,k,c;return{nthCol:function(a){var i=[],j={multiplier:0,offset:0};"even"===a?a="2n":"odd"===a?a="2n+1":/^\d*$/.test(a)&&(a="0n+"+a);i=g.exec(a);null!==i&&(j.multiplier=i[1]-0,j.offset=i[2]-0);c=j;var d,l,e=[],h=0,m=[];f.each(this,function(n,a){var b=0,c=0,f=a.rowSpan||1,g=a.colSpan||1;if(a.parentNode!==d){d=a.parentNode;if(d.parentNode!==l){l=d.parentNode;e=[]}h=0;e[d.rowIndex]===void 0&&(e[d.rowIndex]=
[])}for(b=0;b<e[d.rowIndex].length+1;b=b+1)if(e[d.rowIndex][b]===void 0){h=b;break}m[n]=h;for(b=d.rowIndex;b<d.rowIndex+f;b=b+1){e[b]===void 0&&(e[b]=[]);for(c=h;c<h+g;c=c+1)e[b][c]=true}});k=m;return f(this).filter(function(a){a=k[a]-(c.offset-1);a=c.multiplier===0?a===0:a%c.multiplier===0&&a/c.multiplier>=0;return a})}}});require("confluence/module-exporter").safeRequire("atlassian-tinymce/jquery/jquery-column",function(f){var g=require("jquery");g.extend(g.fn,f)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.plugins.tinymce:atlassian-rte-javascript-tinymce-extensions', location = 'jscripts/tiny_mce/plugins/lists/editor_plugin_src.js' */
define("atlassian-tinymce/plugins/lists/editor_plugin_src",["tinymce","ajs","jquery"],function(d,o,D){function E(a,b){for(;a&&(8===a.nodeType||3===a.nodeType&&/^[ \t\n\r]*$/.test(a.nodeValue));)a=b(a);return a}function r(a){return E(a,function(a){return a.previousSibling})}function u(a){return E(a,function(a){return a.nextSibling})}function F(a,b,k){return a.dom.getParent(b,function(a){return-1!==d.inArray(k,a)})}function q(a){return a&&("OL"===a.tagName||"UL"===a.tagName)}function C(a,b){var d,c;
for(d=r(a.lastChild);q(d);)c=d,d=r(c.previousSibling);c&&(d=b.create("li",{style:v}),b.split(a,c),b.insertAfter(d,c),d.appendChild(c),d.appendChild(c),a=d.previousSibling);return a}function x(a,b,d){var c=r(a.previousSibling),a=c?w(c,a,b?c:!1,d):a;return G(a,b,d)}function G(a,b,d){var c=u(a.nextSibling);return c?w(a,c,b?c:!1,d):a}function w(a,b,d,c){var f=!!d;if(!a||!b)c=!1;else if("LI"===a.tagName&&"LI"===b.tagName)c="none"===b.style.listStyleType||H(b);else if(q(a)){if(!(c=a.tagName===b.tagName&&
a.className===b.className&&(f||a.style.listStyleType===b.style.listStyleType)))c=u(b.firstChild),f=r(b.lastChild),c=c&&f&&q(b)&&c===f&&(q(c)||"none"===c.style.listStyleType||H(c))}else c=c&&"P"===a.tagName&&"P"===b.tagName;if(c){c=r(a.lastChild);f=u(b.firstChild);for("P"===a.tagName&&a.appendChild(a.ownerDocument.createElement("br"));b.firstChild;)a.appendChild(b.firstChild);d&&(a.style.listStyleType=d.style.listStyleType);b.parentNode.removeChild(b);w(c,f,!1);return a}a&&("LI"===a.tagName&&q(b))&&
a.appendChild(b);return b}function H(a){var d=u(a.firstChild),a=r(a.lastChild);return d&&a&&d===a&&q(d)}function I(a,d){var k;d.is(a,"li,ol,ul")||(k=d.getParent(a,"li"))&&(a=k);return a}var v="list-style-type: none; background-image: none;",J="a,b,i,em,strong,u,span,s,sub,sup,code,br",y=d.each,s=d.dom.Event,z;return{init:function(a){function b(){var n=a.selection.getStart();return"LI"==n.tagName?n:a.dom.getParent(n,"li")}function k(a){if(a){var a=D(a),d=a.find("*"),e=d.filter(J);return d.length!==
e.length?!1:0===o.trim(a.text()).length&&1>=e.filter("br").length}return!1}function c(n){if(n&&(d.isGecko||d.isWebKit))for(var n=n.childNodes,b,e=n.length-1;0<=e;e--)b=n[e],3===b.nodeType&&!b.length&&a.dom.remove(b)}function f(a,c){if(c.keyCode===d.VK.BACKSPACE&&d.isWebKit){var e=b();if(e){var h=a.dom.getParent(e,"ol,ul"),f=a.selection.getRng();if(h&&h.firstChild===e&&(0===f.startOffset||1===f.startOffset&&""===f.startContainer.textContent)&&!a.selection.getContent().trim()&&f.startContainer.textContent===
e.textContent)return a.execCommand("Outdent",!1,e),a.undoManager.add(),s.cancel(c)}}}function j(a,b,e){e&&(1===e.nodeType&&a.dom.is(e,"li"))&&(b=e.parentNode,d.each(a.dom.select("li>ul,li>ol",b),function(d){a.dom.getAttrib(d.parentNode,"data-mce-style")||d.previousSibling||d.parentNode.insertBefore(a.dom.doc.createElement("br"),d)}))}function m(a,c){var e,h;if(b()&&(c.keyCode===d.VK.ENTER&&!c.shiftKey||c.keyCode===d.VK.BACKSPACE||c.keyCode===d.VK.DELETE)){e=a.selection.getRng(!0);h=e.endContainer;
if(3===h.nodeType){if(e.endOffset!==h.length)return;h=h.nextSibling}else if(1===h.nodeType)h=h.childNodes[e.endOffset];else return;if(h&&a.dom.is(h,"ul,ol"))if(d.isIE){var f=h,i=a.dom.doc.createTextNode(String.fromCharCode(160)),g=f.previousSibling;e=d.isIE6||d.isIE7||d.isIE8?e:a.getDoc().createRange();g&&3===g.nodeType&&g.nodeValue[g.length-1]==i.nodeValue?(e.setStart(g,g.length-1),e.setEnd(g,g.length-1)):(h.parentNode.insertBefore(i,f),e.setStartBefore(i),e.setEndBefore(i));e.collapse(!0);a.selection.setRng(e)}else h.parentNode.insertBefore(a.dom.create("br"),
h)}}function g(a){function f(d){var e=d.parentNode,b=e.previousSibling,h;c(e);e.childNodes[0]===d&&!a.dom.getAttrib(e,"data-mce-style")&&(a.selection.getStart().parentNode==d&&(h=a.selection.getRng(!0),h={startOffset:h.startOffset,startContainer:h.startContainer}),b?b.appendChild(d):(b=a.dom.create("li",{style:v}),b.appendChild(d),e.parentNode.insertBefore(b,e)),h&&a.selection.setCursorLocation(h.startContainer||d.firstChild,h.startOffset),k(e)&&a.dom.remove(e))}var e=b();if(e){var h=e.parentNode;
d.grep(a.dom.select("li>ul, li>ol",h),f);a.dom.is(h.parentNode,"li")&&f(h);e===h.lastChild&&(h.nextSibling&&a.dom.is(h.nextSibling,"ul, ol"))&&d.grep(a.dom.select("li>ul, li>ol",h.nextSibling),f)}}function l(a,d){if(46===d.keyCode&&!d.shiftKey){var e=b();if(e&&(0===e.childNodes.length||1===e.childNodes.length&&"BR"===e.firstChild.nodeName)){var c,f;if(c=e.nextSibling)c=a.dom.doc.createTreeWalker(c,NodeFilter.SHOW_TEXT,null,!1),c=c.nextNode(),f=a.getDoc().createRange(),f.setStart(c,0),f.setEnd(c,0),
a.selection.setRng(f),a.dom.remove(e),a.undoManager.add(),s.cancel(d)}}}var p="UNKNOWN";this.ed=a;a.addCommand("Indent",this.indent,this);a.addCommand("Outdent",this.outdent,this);a.addCommand("InsertUnorderedList",function(){this.applyList("UL","OL")},this);a.addCommand("InsertOrderedList",function(){this.applyList("OL","UL")},this);a.addCommand("InsertInlineTaskList",function(){o.Rte.Support.inlineTasks()&&this.applyList("UL","OL","inline-task-list",{attributesOnItems:{"data-inline-task-id":""},
placeholderText:"Type your task here, using \"@\" to assign to a user and \"//\" to select a due date"})},this);a.addCommand("InsertInlineTaskListNoToggle",function(){o.Rte.Support.inlineTasks()&&this.applyList("UL","OL","inline-task-list",{attributesOnItems:{"data-inline-task-id":""},placeholderText:"Type your task here, using \"@\" to assign to a user and \"//\" to select a due date",noToggle:!0})},this);a.onInit.add(function(){a.editorCommands.addCommands({outdent:function(){function d(b){return(b=e.getParent(b,e.isBlock))&&0<parseInt(a.dom.getStyle(b,
"margin-left")||0,10)+parseInt(a.dom.getStyle(b,"padding-left")||0,10)}var b=a.selection,e=a.dom;return d(b.getStart())||d(b.getEnd())||a.queryCommandState("InsertOrderedList")||a.queryCommandState("InsertUnorderedList")||a.queryCommandState("InsertInlineTaskList")}},"state")});a.onKeyUp.add(function(f,g){if("TABBING"==p)return f.execCommand(g.shiftKey?"Outdent":"Indent",!0,null),c(b()),p="UNKNOWN",s.cancel(g);if("EMPTY"==p){var e=b();f.execCommand(!0===f.settings.list_outdent_on_enter||g.shiftKey?
"Outdent":"Indent",!0,null);if(d.isIE){var h=a.dom.getParent(e,"ol,ul");null!=h&&(h=h.lastChild,h.appendChild(a.getDoc().createTextNode(o.Rte.HIDDEN_CHAR)),a.selection.setCursorLocation(h,0))}c(e);o.Rte.showSelection();return s.cancel(g)}if("ESCAPE"==p)if(d.isIE6||d.isIE7||d.isIE8)e=f.getDoc().createTextNode(o.Rte.HIDDEN_CHAR),f.selection.getNode().appendChild(e);else if(d.isIE9||d.isIE10||d.isIE11||d.isGecko||d.isWebKit)return f.execCommand("Outdent"),s.cancel(g)});a.onKeyDown.add(function(c,f){if(f.keyCode===
d.VK.TAB&&!f.altKey&&!f.ctrlKey&&(a.queryCommandState("InsertUnorderedList")||a.queryCommandState("InsertOrderedList")||a.queryCommandState("InsertInlineTaskList")||a.queryCommandState("InsertInlineTaskListNoToggle")))p="TABBING";else{var e;if(e=f.keyCode===d.VK.ENTER&&!f.shiftKey)if(e=b()){var h=e.parentNode.parentNode;e=e.parentNode.lastChild===e&&!(q(h)?h.parentNode&&"LI"===h.parentNode.tagName:"LI"===h.tagName)&&k(e)}else e=!1;p=e?"ESCAPE":f.keyCode===d.VK.ENTER&&!f.shiftKey&&a.selection.isCollapsed()&&
k(b())?"EMPTY":"UNKNOWN"}});a.onKeyDown.add(function(a,b){("TABBING"==p||"EMPTY"==p||(d.isGecko||d.isWebKit)&&"ESCAPE"==p)&&s.cancel(b)});a.onKeyDown.add(function(a,b){var e;if(d.isGecko){var c=a.selection.getStart();if(!(b.keyCode!=d.VK.BACKSPACE||"IMG"!==c.tagName))if(e=c.parentNode.previousSibling){if(!("UL"===e.tagName||"OL"===e.tagName))if(e.previousSibling&&("UL"===e.previousSibling.tagName||"OL"===e.previousSibling.tagName))e=e.previousSibling;else return;e=e.firstChild;var f=null;do{if(!e)break;
"LI"===e.tagName&&(f=e)}while(e=e.nextSibling);e=f;f=a.dom.createRng();f.setStart(e,1);f.setEnd(e,1);a.selection.setRng(f);a.selection.collapse(!0);var f=a.selection.getBookmark(),g=c.parentNode.cloneNode(!0);if("P"===g.tagName||"DIV"===g.tagName)for(;0<g.childNodes.length;)e.appendChild(g.childNodes[0]);else e.appendChild(g);c.parentNode.parentNode.removeChild(c.parentNode);a.selection.moveToBookmark(f)}}});a.onKeyDown.add(function(b,c){var e;if(e=c.keyCode===d.VK.ENTER&&!c.shiftKey){var f=a.selection.getNode();
e=a.dom.is(f,"h1,h2,h3,h4,h5,h6,p,div")&&"LI"===f.parentNode.tagName&&f.parentNode.lastChild===f;f=o.EditorUtils.isCursorAtEndOf(f,a.selection.getRng(!0));e=a.selection.isCollapsed()&&e&&f}if(e){b.undoManager.beforeChange();b.undoManager.add();e=b.selection.getNode();var g=b.dom.create("li",{},!d.isIE?'<br data-mce-bogus="true">':"");e=b.dom.getParent(e,"li");b.dom.insertAfter(g,e);d.isIE6||d.isIE7||d.isIE8?(g.appendChild(b.dom.create("&nbsp;")),b.selection.setCursorLocation(g,1)):d.isGecko?setTimeout(function(){b.selection.setCursorLocation(g,
0)},0):b.selection.setCursorLocation(g,0);b.undoManager.add();c.preventDefault()}});d.isWebKit&&(a.onNodeChange.add(g),a.onKeyUp.add(g));d.isIE?a.onKeyDown.add(m):(a.onNodeChange.add(j),d.isGecko&&a.onKeyDown.add(m));d.isGecko&&a.onKeyDown.add(l);d.isWebKit&&a.onKeyDown.add(f)},applyList:function(a,b,k,c){function f(a){a&&"BR"===a.tagName&&i.remove(a)}function j(a){a&&"LI"===a.tagName&&(i.removeClass(a,"checked"),a.removeAttribute("data-inline-task-id"))}function m(a){if(w&&a&&"LI"===a.tagName)for(var b in w)a.setAttribute(b,
w[b])}function g(b){function e(a){(a.style.marginLeft||a.style.paddingLeft)&&h.adjustPaddingFunction(!1)(a)}var c=i.create(a),g;""!=k&&(c.className=k);if("LI"===b.tagName)m(b);else{if("P"===b.tagName||"DIV"===b.tagName||"BODY"===b.tagName){p(b,function(a,c){l(a,c,b.tagName==="BODY"?null:a.parentNode);g=a.parentNode;e(g);(!d.isChrome||d.isChrome&&c&&c.parentNode&&i.isBlock(c.parentNode))&&f(c)});if(g){if("LI"===g.tagName&&("P"===b.tagName||1<A.length)){if(B&&h.isEmptyElement(g)){var n=document.createTextNode(B),
c=i.create("span");c.appendChild(n);g.appendChild(c);setTimeout(function(){t.selection.select(n)},0);(d.isIE7||d.isIE8)&&g.appendChild(t.dom.create("br",{_mce_bogus:"1"}));var j=function(a,b){if((b.which||b.keyCode)==64)if(n.textContent==B)n.textContent=" ";else if(n.data==B)n.data=" ";window.setTimeout(function(){t.onKeyPress.remove(j)},0)};t.onKeyPress.addToTop(j)}i.split(g.parentNode.parentNode,g.parentNode)}x(g.parentNode,!0);m(g)}return}g=i.create("li");m(g);i.insertAfter(g,b);g.appendChild(b);
e(b);b=g}i.insertAfter(c,b);c.appendChild(b);x(c,!0);q.push(b)}function l(a,b,c){for(var d=a;!i.isBlock(a.parentNode)&&a.parentNode!==i.getRoot();)a=i.split(a.parentNode,a.previousSibling),d=a=a.nextSibling;if(c){c=c.cloneNode(!0);for(a.parentNode.insertBefore(c,a);c.firstChild;)i.remove(c.firstChild);c=i.rename(c,"li")}else c=i.create("li"),a.parentNode.insertBefore(c,a);d&&d==b&&(a=i.create("br"),i.setAttrib(a,"data-mce-bogus",1),c.appendChild(d),i.insertAfter(a,d));for(;d&&d!=b;)a=d.nextSibling,
c.appendChild(d),d=a;0===c.childNodes.length&&(c.innerHTML='<br _mce_bogus="1" />');g(c)}function p(a,b){function c(a,b){var d=i.createRng(),e;z.keep=!0;t.selection.moveToBookmark(z);z.keep=!1;e=t.selection.getRng(!0);b||(b=a.parentNode.lastChild);d.setStartBefore(a);d.setEndAfter(b);return!(0<d.compareBoundaryPoints(g,e)||0>=d.compareBoundaryPoints(h,e))}function d(a){if(a.nextSibling)return a.nextSibling;if(!i.isBlock(a.parentNode)&&a.parentNode!==i.getRoot())return d(a.parentNode)}var e,f,g=3,
h=1;e=a.firstChild;var k=!1;y(i.select("br,ul,ol,p,div,h1,h2,h3,h4,h5,h6,table,blockquote,address,pre,form,center,dl",a),function(a){if(a.hasAttribute&&a.hasAttribute("_mce_bogus"))return!0;c(e,a)&&(i.addClass(a,"_mce_tagged_br"),e=d(a))});k=e&&c(e,void 0);e=a.firstChild;y(i.select("br,ul,ol,p,div,h1,h2,h3,h4,h5,h6,table,blockquote,address,pre,form,center,dl",a),function(a){var c=d(a);if(a.hasAttribute&&a.hasAttribute("_mce_bogus"))return!0;i.hasClass(a,"_mce_tagged_br")?(b(e,a,f),f=null):f=a;e=c});
k&&b(e,void 0,f)}function n(a){p(a,function(a,b,c){l(a,b);f(b);f(c)})}function o(a){j(a);if(-1===d.inArray(q,a)){if(a.parentNode.tagName===b||!v)i.split(a.parentNode,a),g(a),G(a.parentNode,!1);""!=k&&(a.parentNode.className=k);m(a);q.push(a)}}function e(a){j(a);var b,c;if(-1===d.inArray(q,a)&&(a=C(a,i))){for(;i.is(a.parentNode,"ol,ul,li");)i.split(a.parentNode,a);q.push(a);a=i.rename(a,"p");b=x(a,!1,t.settings.force_br_newlines);if(b===a)for(a=a.firstChild;a;)i.isBlock(a)?(a=i.split(a.parentNode,
a),c=!0,b=a.nextSibling&&a.nextSibling.firstChild):(b=a.nextSibling,c&&"BR"===a.tagName&&i.remove(a),c=!1),a=b}}var h=this,t=h.ed,i=t.dom,q=[],r=!1,s=!1,u=!1,v=!1,A=t.selection.getSelectedBlocks(),k=k||"",c=c||{},w=c.attributesOnItems,B=c.placeholderText,c=c.noToggle;y(A,function(c){c=I(c,i);c="LI"===c.tagName?c.parentNode:c;v=c.className===k;c.tagName===b?s=!0:c.tagName===a?r=!0:u=!0});c=u&&!r||s||!v||0===A.length?{LI:o,H1:g,H2:g,H3:g,H4:g,H5:g,H6:g,P:g,BODY:g,DIV:1<A.length?g:n,defaultAction:n,
elements:this.selectedBlocks()}:c?{}:{defaultAction:e,elements:this.selectedBlocks()};this.process(c)},indent:function(){var a=this.ed,b=a.dom,k=[];this.process({LI:function(c){if(!F(a,c,k)&&(c=C(c,b))){var f=c,j=b.create("li",{style:v});b.insertAfter(j,f);var m=b.getParent(f,"ol,ul"),f=m.tagName,g=b.getStyle(m,"list-style-type"),m=m.className||"",l={};""!==g&&(l.style="list-style-type: "+g+";");f=b.create(f,l);""!=m&&(f.className=m);j.appendChild(f);(d.isIE7||d.isIE8)&&c.appendChild(a.dom.create("br",
{_mce_bogus:"1"}));f.appendChild(c);x(f.parentNode,!1);x(f,!1);k.push(c)}},defaultAction:this.adjustPaddingFunction(!0),elements:this.selectedBlocks()})},outdent:function(a,b){var k=this,c=k.ed,f=c.dom,j=[],m=b&&d.is(b,"array")?b:this.selectedBlocks();this.process({LI:function(a){var b,d;if(!F(c,a,j)){if(""!==f.getStyle(a,"margin-left")||""!==f.getStyle(a,"padding-left"))return k.adjustPaddingFunction(!1)(a);b=f.getStyle(a,"text-align",!0);if("center"===b||"right"===b)f.setStyle(a,"text-align","left");
else if(a=C(a,f))b=a.parentNode,d=a.parentNode.parentNode,"P"===d.tagName?f.split(d,a.parentNode):(f.split(b,a),"LI"===d.tagName?f.split(d,a):f.is(d,"ol,ul")||f.rename(a,"p")),f.hasClass(a.parentNode,"inline-task-list")?a.hasAttribute("data-inline-task-id")||a.setAttribute("data-inline-task-id",""):a.removeAttribute("data-inline-task-id"),j.push(a)}},defaultAction:this.adjustPaddingFunction(!1),elements:m});y(j,x)},isEmptyElement:function(a){var b=this.ed.dom;return 0===d.grep(a.childNodes,function(a){return!("BR"===
a.nodeName||"SPAN"===a.nodeName&&"bookmark"==b.getAttrib(a,"data-mce-type")||3===a.nodeType&&(a.nodeValue==String.fromCharCode(160)||""==a.nodeValue))}).length},process:function(a){function b(b){(d.isIE7||d.isIE8)&&D(b).find("br[_mce_bogus='1']").remove();m.removeClass(b,"_mce_act_on");if(b&&!(1!==b.nodeType||1<g.length&&f.isEmptyElement(b))){var b=I(b,m),c=a[b.tagName];c||(c=a.defaultAction);c(b)}}function k(a){f.splitSafeEach(a.childNodes,b)}function c(a,b){return 0<=b&&a.hasChildNodes()&&b<a.childNodes.length&&
"BR"===a.childNodes[b].tagName}var f=this,j=f.ed.selection,m=f.ed.dom,g,l;if(!m.select("td.mceSelected.numberingColumn").length){g=a.elements;l=j.getRng(!0);if(!l.collapsed&&(c(l.endContainer,l.endOffset-1)&&(l.setEnd(l.endContainer,l.endOffset-1),j.setRng(l)),c(l.startContainer,l.startOffset)))l.setStart(l.startContainer,l.startOffset+1),j.setRng(l);if(d.isIE7||d.isIE8)if(l=f.ed.selection.getNode(),"LI"===l.tagName&&l.parentNode.lastChild!==l){var p=f.ed.getDoc().createTextNode(o.Rte.HIDDEN_CHAR);
l.appendChild(p)}z=j.getBookmark();a.OL=a.UL=k;f.splitSafeEach(g,b);j.moveToBookmark(z);z=null;j=j.getNode();null===m.getParent(j,"td")&&f.ed.execCommand("mceRepaint")}},splitSafeEach:function(a,b){d.isGecko&&(/Firefox\/[12]\.[0-9]/.test(navigator.userAgent)||/Firefox\/3\.[0-4]/.test(navigator.userAgent))?this.classBasedEach(a,b):y(a,b)},classBasedEach:function(a,b){var d=this.ed.dom,c;y(a,function(a){d.addClass(a,"_mce_act_on")});for(c=d.select("._mce_act_on");0<c.length;)c=c.shift(),d.removeClass(c,
"_mce_act_on"),b(c),c=d.select("._mce_act_on")},adjustPaddingFunction:function(a){var b,d,c=this.ed;b=c.settings.indentation;d=/[a-z%]+/i.exec(b);b=parseInt(b,10);return function(f){var j;j=parseInt(c.dom.getStyle(f,"margin-left")||0,10)+parseInt(c.dom.getStyle(f,"padding-left")||0,10);j=a?j+b:j-b;c.dom.setStyle(f,"padding-left","");c.dom.setStyle(f,"margin-left",0<j?j+d:"")}},selectedBlocks:function(){var a=this.ed,b=a.selection.getSelectedBlocks();return 0===b.length?[a.dom.getRoot()]:b},getInfo:function(){return{longname:"Lists",
author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/lists",version:d.majorVersion+"."+d.minorVersion}}}});require("confluence/module-exporter").safeRequire("atlassian-tinymce/plugins/lists/editor_plugin_src",function(d){var o=require("tinymce");o.create("tinymce.plugins.Lists",d);o.PluginManager.add("lists",o.plugins.Lists)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.plugins.tinymce:atlassian-rte-javascript-tinymce-extensions', location = 'jscripts/tiny_mce/plugins/table/editor_plugin_src.js' */
define("atlassian-tinymce/plugins/table/editor_plugin_src",["tinymce","ajs","jquery","confluence/storage-manager"],function(j,r,l,X){function x(d,i){return parseInt(d.getAttribute(i)||1)}function Y(d,i,u){function C(b,L){b=b.cloneNode(L);b.removeAttribute("id");L&&D()&&b.removeChild(b.children[0]);return b}function E(){var b=0;h=[];e(["thead","tbody","tfoot"],function(L){var a=i.select("> "+L+" tr",d);e(a,function(a,g){g+=b;e(i.select("> td, > th",a),function(b,a){var o,f,c,k;if(h[g])for(;h[g][a];)a++;
c=x(b,"rowspan");k=x(b,"colspan");for(f=g;f<g+c;f++){h[f]||(h[f]=[]);for(o=a;o<a+k;o++)h[f][o]={part:L,real:f==g&&o==a,elm:b,rowspan:c,colspan:k}}})});b+=a.length})}function A(b,a){var g;if(g=h[a])return g[b]}function p(b,a,g){b&&(g=parseInt(g),1===g?b.removeAttribute(a,1):b.setAttribute(a,g,1))}function y(b){return b&&(i.hasClass(b.elm,"mceSelected")||b==H)}function B(){var b=[];e(d.rows,function(a){e(a.cells,function(g){if(i.hasClass(g,"mceSelected")||g==H.elm)return b.push(a),!1})});return b}function z(b){var a;
j.walk(b,function(g){var o;if(3===g.nodeType)return e(i.getParents(g.parentNode,null,b).reverse(),function(b){b=C(b,!1);a?o&&o.appendChild(b):a=o=b;o=b}),o&&(o.innerHTML=j.isIE?"&nbsp;":'<br data-mce-bogus="1" />'),!1},"childNodes");b=C(b,!1);p(b,"rowSpan",1);p(b,"colSpan",1);a?b.appendChild(a):j.isIE||(b.innerHTML='<br data-mce-bogus="1" />');l(b).attr("contenteditable","true").removeClass("numberingColumn");return b}function a(){var b=i.createRng();e(i.select("tr",d),function(b){0===b.cells.length&&
i.remove(b)});if(0===i.select("tr",d).length)b.setStartAfter(d),b.setEndAfter(d),u.setRng(b),i.remove(d);else if(e(i.select("thead,tbody,tfoot",d),function(b){0===b.rows.length&&i.remove(b)}),E(),b=h[Math.min(h.length-1,m.y)])if(b=b[Math.min(b.length-1,m.x)].elm)j.isIE9||j.isIE10up?u.setCursorLocation(b,0):u.select(b,!0),u.collapse(!0)}function n(b,a,g,o){var t,M,f,c,k;t=h[a][b].elm.parentNode;for(f=1;f<=g;f++)if(t=i.getNext(t,"tr")){for(M=b;0<=M;M--)if(k=h[a+f][M].elm,k.parentNode==t){for(c=1;c<=
o;c++)i.insertAfter(z(k),k);break}if(-1==M)for(c=1;c<=o;c++)t.insertBefore(z(t.cells[0]),t.cells[0])}}function Q(){e(h,function(b,a){e(b,function(b,o){var t,f,c;if(y(b)&&(b=b.elm,t=x(b,"colspan"),f=x(b,"rowspan"),1<t||1<f)){p(b,"rowSpan",1);p(b,"colSpan",1);for(c=0;c<t-1;c++)i.insertAfter(z(b),b);n(o,a,f-1,t)}})})}function O(b){var a,g,o,t,f,c,k,d;e(h,function(g,o){e(g,function(g){if(y(g)&&(g=g.elm,f=g.parentNode,c=C(f,!1),a=o,b))return!1});if(b)return!a});for(t=0;t<h[0].length;t++)if(h[a][t]&&(g=
h[a][t].elm,g!=o)){if(b){if(0<a&&h[a-1][t]&&(k=h[a-1][t].elm,d=x(k,"rowSpan"),1<d)){p(k,"rowSpan",d+1);continue}}else if(d=x(g,"rowspan"),1<d){p(g,"rowSpan",d+1);continue}a:if(o=t,1===h.length)k=!1;else{for(k=0;k<h.length;k++)if("TH"!==h[k][o].elm.tagName.toUpperCase()){k=!1;break a}k=!0}o=k?i.create("th"):i.create("td");o.colSpan=g.colSpan;o.width=g.width;o.innerHTML=j.isIE9?"":j.isIE?"&nbsp;":'<br data-mce-bogus="1" />';o.className=g.className;k||(i.removeClass(o,j.settings.confluence_table_heading_style),
i.addClass(o,j.settings.confluence_table_cell_style));k=i.getAttrib(g,"data-highlight-colour");a:{d=t;var n=h[0][d].elm.getAttribute("data-highlight-colour");if(null===n)d=!1;else{for(var s=0;s<h.length;s++)if(h[s][d].elm.getAttribute("data-highlight-colour")!==n){d=!1;break a}d=!0}}d?i.setAttrib(o,"data-highlight-colour",k):i.removeClass(o,"highlight-"+k);c.appendChild(o);o=g}c.hasChildNodes()&&(b?f.parentNode.insertBefore(c,f):i.insertAfter(c,f));w()}function v(b){var a,g,o=[];e(h,function(g){e(g,
function(g,o){if(y(g)&&(a=o,b))return!1});if(b)return!a});if(0==a&&b&&D())return!1;e(h,function(f,k){var c,d,h;if(f[a]){c=f[a].elm;if(r.DarkFeatures.isEnabled("confluence.table.resizable")&&0===k){d=l(c).closest("table");h=d.find(">colgroup>col").eq(a);var e=l("<col>");b?e.insertBefore(h):e.insertAfter(h);d.hasClass("fixed-table")&&(!F||0===parseFloat(F)?e.css({width:R+2*S+T}):e.css({width:F}))}if(c!=g){h=x(c,"colspan");d=x(c,"rowspan");if(1==h){var s=i.create(c.tagName);s.colSpan=c.colSpan;s.width=
c.width;s.className=c.className;s.innerHTML=j.isIE?"&nbsp;":'<br data-mce-bogus="1"/>';(e=i.getAttrib(c,"data-highlight-colour"))&&i.setAttrib(s,"data-highlight-colour",e);l(s).attr("contenteditable","true").removeClass("numberingColumn");b?c.parentNode.insertBefore(s,c):i.insertAfter(s,c);n(a,k,d-1,h);o.push(s)}else p(c,"colSpan",c.colSpan+1);g=c}}});return o}function w(){if(D()){q=1;var b=0,a=0;e(d.rows,function(g){g=l(g);r.Rte.Table.areCellsHeadings(g.children())?g.children(":first").addClass("numberingColumn").attr("contenteditable",
"true"):0<a?a--:(g.children(":first").html(q).attr("contenteditable","false").addClass("numberingColumn"),b=g.children(":first").attr("rowspan"),1<b&&(a=b-1),q++)})}}function D(){return l(d.rows[0]).children(":first").hasClass("numberingColumn")}function k(b){if(b){if(l(d.rows[0]).children(":first").addClass("numberingColumn"),r.DarkFeatures.isEnabled("confluence.table.resizable")){var b=l(d),a=b.find(">colgroup>col").eq(0),g=l("<col>");g.insertBefore(a);b.hasClass("fixed-table")&&g.css({width:R+
2*S+T})}}else l(d.rows[0]).children(":first").removeClass("numberingColumn"),r.DarkFeatures.isEnabled("confluence.table.resizable")&&l(d).find(">colgroup>col").eq(0).remove()}function c(){var b=[];e(h,function(a){e(a,function(a,c){y(a)&&-1===j.inArray(b,c)&&(r.DarkFeatures.isEnabled("confluence.table.resizable")&&l(a.elm).closest("table").find(">colgroup>col").eq(c).remove(),e(h,function(b){if(b[c]){var b=b[c].elm,a;a=x(b,"colSpan");1<a?p(b,"colSpan",a-1):i.remove(b)}}),b.push(c))})});a()}function f(){var b=
{};e(h,function(a){e(a,function(a,c){y(a)&&(r.DarkFeatures.isEnabled("confluence.table.resizable")&&(F=l(a.elm).closest("table").find(">colgroup>col").eq(c).css("width"),0===parseFloat(F)&&(F=a.elm.getBoundingClientRect().width)),b[c]||(b[c]=[]))})});e(h,function(a){e(a,function(a,c){b[c]&&b[c].push(a.elm.innerHTML)})});return b}function N(b){b&&b.parentNode&&(u.select(b.parentNode),u.collapse(!0))}function U(b,a){var g=A(b.x,b.y).elm,c="undefined"===typeof a?!0:a;if((j.isGecko||j.isIE)&&g.firstChild)g=
g.firstChild;if(j.isIE9||j.isIE10up){var f=u.getRng(1);c?(f.setStart(g,0),f.setEnd(g,0)):(f.setStartAfter(g,0),f.setEndAfter(g,0));u.setRng(f)}else u.select(g,!0),u.collapse(c)}function V(){var b,a=h[0].length;m.x==a-1&&m.y==h.length-1||(m.x==a-1&&D()?(b={x:1,y:m.y+1},r.Rte.Table.areCellsHeadings(l(h[b.y][0].elm).parent().children())&&(b.x=0)):b=m.x==a-1?{x:0,y:m.y+1}:{x:m.x+1,y:m.y});return b}function W(){var b;0==m.x&&0==m.y||(1==m.x&&D()&&!r.Rte.Table.areCellsHeadings(l(h[m.y][0].elm).parent().children())?
(b=m.y-1,b={x:h[b].length-1,y:b}):0<m.x?b={x:m.x-1,y:m.y}:(b=m.y-1,b={x:h[b].length-1,y:b}));return b}function G(b){var a;e(h,function(g,c){e(g,function(g,f){if(g.elm==b)return a={x:f,y:c},!1});return!a});return a}var h,m,s,H,q;E();var Z=["table.confluenceTable > tbody > tr > th","table.confluenceTable > tbody > tr > td","table.confluenceTable > thead > tr > th","table.confluenceTable > thead > tr > td"];if(H=i.select("td.mceSelected,th.mceSelected")[0]||l(u.getStart()).closest(Z.join(","))[0]){m=
G(H);var I,J;I=J=0;e(h,function(b,a){e(b,function(b,c){var f,k;y(b)&&(b=h[a][c],c>I&&(I=c),a>J&&(J=a),b.real&&(f=b.colspan-1,k=b.rowspan-1,f&&c+f>I&&(I=c+f),k&&a+k>J&&(J=a+k)))})});s={x:I,y:J};H=A(m.x,m.y)}j.extend(this,{deleteTable:function(){var b=i.createRng();b.setStartAfter(d);b.setEndAfter(d);u.setRng(b);i.remove(d)},split:Q,merge:function(b,c,g){var f,k,d,n,q,N;b?(b=G(b),f=b.x,b=b.y,c=f+(c-1),g=b+(g-1)):(f=m.x,b=m.y,c=s.x,g=s.y);if(!(0==f&&D())&&(n=A(f,b),k=A(c,g),n&&k&&n.part==k.part)){Q();
E();n=A(f,b).elm;p(n,"colSpan",c-f+1);p(n,"rowSpan",g-b+1);for(d=b;d<=g;d++)for(k=f;k<=c;k++)h[d]&&h[d][k]&&(b=h[d][k].elm,b!=n&&(q=j.grep(b.childNodes),e(q,function(b){n.appendChild(b)}),q.length&&(q=j.grep(n.childNodes),N=0,e(q,function(b){b.nodeName==="BR"&&(i.getAttrib(b,"data-mce-bogus")&&N++<q.length-1)&&n.removeChild(b)})),i.remove(b)));a()}},insertRow:O,insertCol:v,insertNumCol:function(){if(D())e(h,function(b){b=b[0].elm;l(b).hasClass("numberingColumn")&&null!==b.parentNode&&b.parentNode.removeChild(b)}),
k(!1);else{var b;e(h,function(a){a=a[0].elm;if(b!=a){var c=z(a);a.parentNode.insertBefore(c,a);1<a.rowSpan&&(c.rowSpan=a.rowSpan);b=a}});k(!0)}w()},updateNumCol:w,deleteCols:c,deleteRows:function(){var b;b=B();(j.isIE9||j.isIE10)&&N(b[0]);e(b.reverse(),function(b){var a,c;i.getNext(b,"tr");e(b.cells,function(b){var c=x(b,"rowSpan");1<c&&(p(b,"rowSpan",c-1),a=G(b),n(a.x,a.y,1,1))});a=G(b.cells[0]);e(h[a.y],function(b){var a,b=b.elm;b!=c&&(a=x(b,"rowSpan"),1>=a?i.remove(b):p(b,"rowSpan",a-1),c=b)})});
a();w()},cutRows:function(){var b=B();(j.isIE9||j.isIE10)&&N(b[0]);i.remove(b);a();w();return b},copyRows:function(){var b=B();e(b,function(a,c){b[c]=C(a,!0)});return b},pasteRows:function(b,a){var c=B(),f=c[a?0:c.length-1],k=f.cells.length;e(h,function(b){var a;k=0;e(b,function(b){b.real&&(k+=b.colspan);b.elm.parentNode==f&&(a=1)});if(a)return!1});a||b.reverse();e(b,function(b){var c=b.cells.length,g;l(b.cells[0]).hasClass("numberingColumn")&&(b.removeChild(b.cells[0]),c--);for(q=0;q<c;q++)g=b.cells[q],
p(g,"colSpan",1),p(g,"rowSpan",1);D()&&(b.insertBefore(b.firstChild.cloneNode(!1),b.firstChild),l(b.firstChild).addClass("numberingColumn"),c++);for(;k<c;)v(!1),k++;for(q=c;q<k;q++)b.appendChild(z(b.cells[c-1]));a?f.parentNode.insertBefore(b,f):i.insertAfter(b,f)});w()},getPos:G,setStartCell:function(b){m=G(b)},setEndCell:function(b){var a,c,f,k,d,n,e;s=G(b);if(m&&s){a=Math.min(m.x,s.x);c=Math.min(m.y,s.y);f=Math.max(m.x,s.x);k=Math.max(m.y,s.y);d=f;n=k;var q;for(q=c;q<=n;q++)b=h[q][a],b.real||a-
(b.colspan-1)<a&&(a-=b.colspan-1);for(var j=a;j<=d;j++)b=h[c][j],b.real||c-(b.rowspan-1)<c&&(c-=b.rowspan-1);for(q=c;q<=k;q++)for(j=a;j<=f;j++)b=h[q][j],b.real&&(e=b.colspan-1,b=b.rowspan-1,e&&j+e>d&&(d=j+e),b&&q+b>n&&(n=q+b));i.removeClass(i.select("td.mceSelected,th.mceSelected"),"mceSelected");for(q=c;q<=n;q++)for(j=a;j<=d;j++)h[q][j]&&i.addClass(h[q][j].elm,"mceSelected")}},moveCaretToNextCell:function(){var b=V();b||(O(!1),E(),b=V());U(b)},moveCaretToPrevCell:function(){var b=W();b||(O(!0),E(),
m=G(i.getParent(u.getStart(),"th,td")),b=W());U(b,!1)},cutColumns:function(){var b=f();c();return b},copyColumns:f,pasteColumns:function(b,a){var c=Object.keys(b);a||c.reverse();l.each(c,function(c,f){for(var k=v(a),c=0;c<k.length;c++)k[c].innerHTML=b[f][c]||""})},prepareTableForColPasteAndCheckIfNeedToRepaint:function(b){var a=b[Object.keys(b)[0]].length,c,f,b=!1;e(h,function(b,k){a--;c=k;e(b,function(b,a){f=a})});if(0<a){b=!0;H=A(f,c);for(q=0;q<a;q++)O(!1)}return b},toggleFluidColumnWidth:function(){d&&
d.rows&&(l(d).toggleFluidColumnWidth(),l("#table-mode-picker .dropdown-text").text(P.getLang("table.responsive")))},toggleFixedColumnWidth:function(){d&&d.rows&&(l(d).toggleFixedColumnWidth(),l("#table-mode-picker .dropdown-text").text(P.getLang("table.fixed_width")))}})}var P,e=j.each,K=X("atlassian.editor","tables"),T=1,S=10,R=8,F;return{init:function(d,i){function u(a){var n=d.selection,a=a||n.getNode().parentNode;if(a=d.dom.getParent(a,"table.confluenceTable"))return new Y(a,d.dom,n)}function C(){d.getBody().style.webkitUserSelect=
"";z&&(d.dom.removeClass(d.dom.select("td.mceSelected,th.mceSelected"),"mceSelected"),z=!1)}function E(a){for(var d=[],e="",e=0;e<a.length;e++)d.push(r.Rte.getEditor().serializer.serialize(a[e]));e="<tr>"+d.join("</tr><tr>")+"</tr>";K.setItem("copied",e,7200)}function A(){var a=[],e=K.getItem("copied")||"";e&&(a=d.getDoc().createElement("div"),a.innerHTML="<table>"+e+"</table>",a=l(a).find("tr"));return a}P=d;var p,y,B,z=!0;e([["table","table.desc","mceInsertTable",!0],["delete_table","table.del",
"mceTableDelete"],["delete_col","table.delete_col_desc","mceTableDeleteCol"],["delete_row","table.delete_row_desc","mceTableDeleteRow"],["col_after","table.col_after_desc","mceTableInsertColAfter"],["col_before","table.col_before_desc","mceTableInsertColBefore"],["row_after","table.row_after_desc","mceTableInsertRowAfter"],["row_before","table.row_before_desc","mceTableInsertRowBefore"],["row_props","table.row_desc","mceTableRowProps",!0],["cell_props","table.cell_desc","mceTableCellProps",!0],["split_cells",
"table.split_cells_desc","mceTableSplitCells",!0],["merge_cells","table.merge_cells_desc","mceTableMergeCells",!0]],function(a){d.addButton(a[0],{title:a[1],cmd:a[2],ui:a[3]})});j.isIE||d.onClick.add(function(a,d){d=d.target;"TABLE"===d.nodeName&&(a.selection.select(d),a.nodeChanged())});d.onPreProcess.add(function(a,d){var e,j,i,l=a.dom,p;e=l.select("table",d.node);for(j=e.length;j--;){i=e[j];l.setAttrib(i,"data-mce-style","");if(p=l.getAttrib(i,"width"))l.setStyle(i,"width",p),l.setAttrib(i,"width",
"");if(p=l.getAttrib(i,"height"))l.setStyle(i,"height",p),l.setAttrib(i,"height","")}});d.onNodeChange.add(function(a,d,e){e=a.selection.getStart();a=a.dom.getParent(e,"td,th,caption");d.setActive("table","TABLE"===e.nodeName||!!a);a&&"CAPTION"===a.nodeName&&(a=0);d.setDisabled("delete_table",!a);d.setDisabled("delete_col",!a);d.setDisabled("delete_table",!a);d.setDisabled("delete_row",!a);d.setDisabled("col_after",!a);d.setDisabled("col_before",!a);d.setDisabled("row_after",!a);d.setDisabled("row_before",
!a);d.setDisabled("row_props",!a);d.setDisabled("cell_props",!a);d.setDisabled("split_cells",!a);d.setDisabled("merge_cells",!a)});d.onInit.add(function(a){function d(a){if(j.isWebKit){var c=a.selection.getRng(),f=a.selection.getNode(),e=a.dom.getParent(c.startContainer,"TD,TH"),i=e,l=a.dom.getParent(c.startContainer,"TABLE"),n;l&&(n=l.parentNode);l=3===c.startContainer.nodeType&&0==c.startOffset&&0==c.endOffset&&i&&("TR"===f.nodeName||f==n);i=("TD"===f.nodeName||"TH"===f.nodeName)&&!i;if(l||i){e||
(e=f);for(f=e.lastChild;f.lastChild;)f=f.lastChild;c.setEnd(f,f.nodeValue.length);a.selection.setRng(c)}}}var i,l,v=a.dom,w;p=a.windowManager;a.onMouseDown.add(function(a,c){2!=c.button&&(C(),l=v.getParent(c.target,"td,th"),i=v.getParent(l,"table"))});v.bind(a.getDoc(),"mouseover",function(d){var c,f=v.getParent(d.target,"td,th");if(l&&(w||f!=l)&&f){c=v.getParent(f,"table");c==i&&(w||(w=u(c),w.setStartCell(l),a.getBody().style.webkitUserSelect="none"),w.setEndCell(f),z=!0);c=a.selection.getSel();
try{c.removeAllRanges?c.removeAllRanges():c.empty()}catch(e){}d.preventDefault()}});a.onMouseUp.add(function(a){var c,f=a.selection,d;f.getSel();var e,n;if(l){w&&(a.getBody().style.webkitUserSelect="");var p=function(a,f){var d=new j.dom.TreeWalker(a,a);do{if(a.nodeType===3&&j.trim(a.nodeValue).length!==0){f?c.setStart(a,0):c.setEnd(a,a.nodeValue.length);break}if(a.nodeName==="BR"){f?c.setStartBefore(a):c.setEndBefore(a);break}}while(a=f?d.next():d.prev())};d=v.select("td.mceSelected,th.mceSelected");
if(0<d.length){c=v.createRng();e=d[0];c.setStartBefore(e);c.setEndAfter(e);p(e,1);d=new j.dom.TreeWalker(e,v.getParent(d[0],"table"));do if("TD"===e.nodeName||"TH"===e.nodeName){if(!v.hasClass(e,"mceSelected"))break;n=e}while(e=d.next());p(n);f.setRng(c)}a.nodeChanged();l=w=i=null}});a.onUndo.add(function(a){z=0<a.dom.select("td.mceSelected, th.mceSelected").length});a.onKeyUp.add(function(){C()});a.onKeyDown.add(function(a){d(a)});a.onMouseDown.add(function(a,c){2!=c.button&&d(a)});a.plugins.table.fixTableCellSelection=
d;a&&a.plugins.contextmenu&&a.plugins.contextmenu.onContextMenu.add(function(d,c,f){d=a.selection.getNode()||a.getBody();a.dom.getParent(f,"td")||a.dom.getParent(f,"th")||a.dom.select("td.mceSelected,th.mceSelected").length?(c.removeAll(),"A"===d.nodeName&&!a.dom.getAttrib(d,"name")&&(c.add({title:"advanced.link_desc",icon:"link",cmd:a.plugins.advlink?"mceAdvLink":"mceLink",ui:!0}),c.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"}),c.addSeparator()),"IMG"===d.nodeName&&-1===d.className.indexOf("mceItem")&&
(c.add({title:"advanced.image_desc",icon:"image",cmd:a.plugins.advimage?"mceAdvImage":"mceImage",ui:!0}),c.addSeparator()),c.add({title:"table.desc",icon:"table",cmd:"mceInsertTable",value:{action:"insert"}}),c.add({title:"table.props_desc",icon:"table_props",cmd:"mceInsertTable"}),c.add({title:"table.del",icon:"delete_table",cmd:"mceTableDelete"}),c.addSeparator(),f=c.addMenu({title:"table.cell"}),f.add({title:"table.cell_desc",icon:"cell_props",cmd:"mceTableCellProps"}),f.add({title:"table.split_cells_desc",
icon:"split_cells",cmd:"mceTableSplitCells"}),f.add({title:"table.merge_cells_desc",icon:"merge_cells",cmd:"mceTableMergeCells"}),f=c.addMenu({title:"table.row"}),f.add({title:"table.row_desc",icon:"row_props",cmd:"mceTableRowProps"}),f.add({title:"table.row_before_desc",icon:"row_before",cmd:"mceTableInsertRowBefore"}),f.add({title:"table.row_after_desc",icon:"row_after",cmd:"mceTableInsertRowAfter"}),f.add({title:"table.delete_row_desc",icon:"delete_row",cmd:"mceTableDeleteRow"}),f.addSeparator(),
f.add({title:"table.cut_row_desc",icon:"cut",cmd:"mceTableCutRow"}),f.add({title:"table.copy_row_desc",icon:"copy",cmd:"mceTableCopyRow"}),f.add({title:"table.paste_row_before_desc",icon:"paste",cmd:"mceTablePasteRowBefore"}).setDisabled(!y),f.add({title:"table.paste_row_after_desc",icon:"paste",cmd:"mceTablePasteRowAfter"}).setDisabled(!y),f=c.addMenu({title:"table.col"}),f.add({title:"table.col_before_desc",icon:"col_before",cmd:"mceTableInsertColBefore"}),f.add({title:"table.col_after_desc",icon:"col_after",
cmd:"mceTableInsertColAfter"}),f.add({title:"table.delete_col_desc",icon:"delete_col",cmd:"mceTableDeleteCol"})):c.add({title:"table.desc",icon:"table",cmd:"mceInsertTable"})});j.isWebKit&&a.onKeyDown.add(function(a,c){function d(c,e,h){var n=c?"previousSibling":"nextSibling",m=a.dom.getParent(e,"tr"),p=m[n];if(p)return l(a,e,p,c),j.dom.Event.cancel(h),!0;var p=a.dom.getParent(m,"table"),b=m.parentNode,r=b.nodeName.toLowerCase();if("tbody"===r||r===(c?"tfoot":"thead")){var r=a.dom.select(">tbody",
p),g=r.indexOf(b);c&&0===g||!c&&g===r.length-1?(b=a.dom.select(">"+(c?"thead":"tfoot"),p),b=0!==b.length?b[0]:null):-1===g?(b="thead"===b.tagName.toLowerCase()?0:r.length-1,b=r[b]):b=r[g+(c?-1:1)];if(null!==b)return(m=i(b,c))&&l(a,e,m,c),j.dom.Event.cancel(h),!0}(e=p[n])?(a.selection.setCursorLocation(e,0),h=!0):(e=a.dom.getParent(p,"td,th"))?h=d(c,e,h):(c=i(m,!c),a.selection.setCursorLocation(c,0),h=j.dom.Event.cancel(h));return h}function i(c,d){var f=c&&c[d?"lastChild":"firstChild"];return f&&
"BR"===f.nodeName?a.dom.getParent(f,"td,th"):f}function l(c,d,f,h){for(var j=0,c=c.dom.getParent(d,"td,th");c.previousSibling;)c=c.previousSibling,j+=x(c,"colspan");var n=j,b=0,m=0;e(f.children,function(a,c){b+=x(a,"colspan");m=c;if(b>n)return!1});f=f.childNodes[m];h=i(f,h);a.selection.setCursorLocation(h||f,0)}var n=j.VK,p=c.keyCode,r;if(r=p==n.UP||p==n.DOWN){r=a;var h=r.selection.getNode();r=null!==r.dom.getParent(h,"tr")}if(r){var m=a.selection.getNode();setTimeout(function(){var e=a.selection.getNode(),
e=a.dom.getParent(e,"td,th"),h=a.dom.getParent(m,"td,th");e&&(e!==h&&a.dom.getParent(e,"TABLE")===a.dom.getParent(h,"TABLE"))&&d(!c.shiftKey&&p===n.UP,m,c)},0)}});if(!j.isIE){var r=function(){};j.isGecko&&a.onKeyDown.add(function(a,c){var d,e,i=a.dom;if(37===c.keyCode||38===c.keyCode)if(d=a.selection.getRng(),(e=i.getParent(d.startContainer,"table"))&&a.getBody().firstChild==e){var j=d,l=e.ownerDocument;d=l.createRange();d.setStartBefore(e);d.setEnd(j.endContainer,j.endOffset);j=l.createElement("body");
j.appendChild(d.cloneContents());0===j.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,"-").replace(/<[^>]+>/g,"").length&&(d=i.createRng(),d.setStartBefore(e),d.setEndBefore(e),a.selection.setRng(d),c.preventDefault())}});a.onKeyUp.add(r);a.onSetContent.add(r);a.onVisualAid.add(r);j.isGecko&&a.onKeyDown.add(function(a,c){if(c.keyCode===j.VK.ENTER&&c.shiftKey){var d=a.selection.getRng().startContainer;if(v.getParent(d,"td,th")){var e=a.getDoc().createTextNode("﻿");v.insertAfter(e,
d)}}});a.startContent=a.getContent({format:"raw"})}});e({mceTableSplitCells:function(a){a.split()},mceTableMergeCells:function(a){d.dom.getParent(d.selection.getNode(),"th,td");d.dom.select("td.mceSelected,th.mceSelected").length&&a.merge()},mceTableInsertRowBefore:function(a){a.insertRow(!0)},mceTableInsertRowAfter:function(a){a.insertRow()},mceTableInsertNumberingCol:function(a){a.insertNumCol()},mceTableUpdateNumberingCol:function(a){a.updateNumCol()},mceAutoWidth:function(a){a.toggleFluidColumnWidth()},
mceFixedWidth:function(a){a.toggleFixedColumnWidth()},mceTableInsertColBefore:function(a){F=null;a.insertCol(!0)},mceTableInsertColAfter:function(a){F=null;a.insertCol()},mceTableDeleteCol:function(a){a.deleteCols()},mceTableDeleteRow:function(a){a.deleteRows()},mceTableCutRow:function(a){y=a.cutRows();E(y)},mceTableCopyRow:function(a){y=a.copyRows();E(y)},mceTablePasteRowBefore:function(a){a.pasteRows(A(),!0)},mceTablePasteRowAfter:function(a){a.pasteRows(A())},mceTableDelete:function(a){a.deleteTable()},
mceTableMoveCaretToNextCell:function(a){a.moveCaretToNextCell()},mceTableMoveCaretToPrevCell:function(a){a.moveCaretToPrevCell()},mceTableCopyCol:function(a){B=a.copyColumns();K.setItem("copiedCols",JSON.stringify(B))},mceTableCutCol:function(a){B=a.cutColumns();K.setItem("copiedCols",JSON.stringify(B))},mceTablePasteColBefore:function(a){var e=JSON.parse(K.getItem("copiedCols"))||{};a.prepareTableForColPasteAndCheckIfNeedToRepaint(e)&&(d.execCommand("mceRepaint"),a=u());a.pasteColumns(e,!0)},mceTablePasteColAfter:function(a){a.pasteColumns(JSON.parse(K.getItem("copiedCols"))||
{},!1)}},function(a,e){d.addCommand(e,function(){var e=u();e&&(a(e),d.execCommand("mceRepaint"),C())})});e({mceInsertTable:function(a){p.open({url:i+"/table.htm",width:400+parseInt(d.getLang("table.table_delta_width",0)),height:320+parseInt(d.getLang("table.table_delta_height",0)),inline:1},{plugin_url:i,action:a?a.action:0})},mceTableRowProps:function(){p.open({url:i+"/row.htm",width:400+parseInt(d.getLang("table.rowprops_delta_width",0)),height:295+parseInt(d.getLang("table.rowprops_delta_height",
0)),inline:1},{plugin_url:i})},mceTableCellProps:function(){p.open({url:i+"/cell.htm",width:400+parseInt(d.getLang("table.cellprops_delta_width",0)),height:295+parseInt(d.getLang("table.cellprops_delta_height",0)),inline:1},{plugin_url:i})}},function(a,e){d.addCommand(e,function(d,e){a(e)})})}}});
require("confluence/module-exporter").safeRequire("atlassian-tinymce/plugins/table/editor_plugin_src",function(j){var r=require("tinymce");r.create("tinymce.plugins.TablePlugin",j);r.PluginManager.add("table",r.plugins.TablePlugin)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.plugins.tinymce:atlassian-rte-javascript-tinymce-extensions', location = 'jscripts/tiny_mce/plugins/table/js/table.js' */
define("atlassian-tinymce/plugins/table/table","ajs tinymce tinymce/popup jquery document confluence/analytics-support".split(" "),function(f,d,u,p,t,q){function k(c,a){var d=t.forms[0].elements[c];if(typeof a==="undefined"||a==null){a="";if(d)a=d.value}if(a=="")return"";a=a.replace(/&/g,"&amp;");a=a.replace(/\"/g,"&quot;");a=a.replace(/</g,"&lt;");a=a.replace(/>/g,"&gt;");return" "+c+'="'+a+'"'}return{insertTable:function(){var c=p("#tinymce-table-form")[0],a=f.Rte.getEditor(),i=a.dom,g=2,r=2,j=
d.settings.confluence_table_style,e="",b="",l;l=i.getParent(a.selection.getNode(),"table");var m,s;m=c.elements.heading.checked;s=c.elements["equal-width-columns"].checked;g=c.elements.cols.value;r=c.elements.rows.value;c=p("#tinymce-table-form input[name='width']").val();b=b+"<table"+k("data-mce-new","1");if(c&&a.settings.inline_styles){e&&(e=e+"; ");/^[0-9\.]+$/.test(c)&&(c=c+"px");e=e+("width: "+c)}else b=b+k("width",c);b=b+k("class",j);b=b+k("style",e);b=b+">";for(j=0;j<r;j++){b=b+"<tr>";for(e=
0;e<g;e++){var n,o;if(j==0&&m){c="th";o=d.settings.confluence_table_heading_style}else{c="td";o=d.settings.confluence_table_cell_style}s&&(n=' width="'+Math.round(100/g*100)/100+'%"');b=b+("<"+c+(n?n:"")+' class="'+o+'">');!d.isIE||d.isIE11?b=b+'<br data-mce-bogus="1"/>':d.isIE9&&(b=b+"&nbsp;");b=b+("</"+c+">")}b=b+"</tr>"}b=b+"</table>";if(a.settings.fix_table_elements){var h="";f.Rte.BookmarkManager.restoreBookmark();a.selection.setContent('<br class="_mce_marker" />');d.each(["h1","h2","h3","h4",
"h5","h6","p"],function(a){h&&(h=h+",");h=h+(a+" ._mce_marker")});d.each(a.dom.select(h),function(b){a.dom.split(a.dom.getParent(b,"h1,h2,h3,h4,h5,h6,p"),b)});g=i.select("br._mce_marker")[0];a.selection.select(g);a.selection.setContent(b);a.dom.remove(g)}else a.execCommand("mceInsertContent",false,b);d.each(i.select("table[data-mce-new]"),function(b){var c=i.select(m?"th":"td",b);try{a.selection.setCursorLocation(c[0],0)}catch(d){}i.setAttrib(b,"data-mce-new","")});a.addVisual();a.execCommand("mceEndUndoLevel",
false,{},{skip_undo:true});l&&d.DOM.hasClass(l,"confluenceTable")?q.publish("confluence.table.create.nested",{pageId:f.Meta.get("page-id")}):q.publish("confluence.table.create",{pageId:f.Meta.get("page-id")})}}});require("confluence/module-exporter").safeRequire("atlassian-tinymce/plugins/table/table",function(f){var d=require("tinymce");require("jquery").extend(d.plugins.TablePlugin.prototype,f)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.plugins.tinymce:atlassian-rte-javascript-tinymce-extensions', location = 'jscripts/tiny_mce/plugins/autoresize/editor_plugin_src.js' */
define("atlassian-tinymce/plugins/autoresize/editor_plugin_src",["ajs","underscore","tinymce","jquery"],function(g,h,i,l){return{init:function(a){function b(j){var e,d=a.getDoc();e=d.body;var g=d.documentElement,m=i.DOM,f=c.autoresize_min_height,j=h.isObject(j)?j.forceExec||!1:!1,d=l(d).height();d>c.autoresize_min_height&&(f=d);c.autoresize_max_height&&d>c.autoresize_max_height?(f=c.autoresize_max_height,e.style.overflowY="auto",g.style.overflowY="auto"):(e.style.overflowY="hidden",g.style.overflowY=
"hidden",e.scrollTop=0);if(j||f!==k)e=f-k,m.setStyle(m.get(a.id+"_ifr"),"height",f+"px"),k=f,i.isWebKit&&0>e&&b()}a.onInit.add(function(){l(a.getBody()).addClass("resizable")});var c=this,k=0;a.getParam("fullscreen_is_enabled")||(c.editor=a,c.autoresize_min_height=parseInt(a.getParam("autoresize_min_height",a.getElement().offsetHeight)),c.autoresize_max_height=parseInt(a.getParam("autoresize_max_height",0)),a.onChange.add(b),a.onSetContent.add(b),a.onPaste.add(b),a.onKeyUp.add(b),a.onPostRender.add(b),
a.getParam("autoresize_on_init",!0)&&(a.onLoad.add(b),a.onLoadContent.add(b)),a.addCommand("mceAutoResize",b))},getInfo:function(){return{longname:"Auto Resize",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize",version:i.majorVersion+"."+i.minorVersion}}}});
require("confluence/module-exporter").safeRequire("atlassian-tinymce/plugins/autoresize/editor_plugin_src",function(g){var h=require("tinymce");h.create("tinymce.plugins.AutoResizePlugin",g);h.PluginManager.add("autoresize",h.plugins.AutoResizePlugin)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.web.resources:browser', location = 'includes/js/api/browser.js' */
define("confluence/api/browser",[],function(){return function(a){function c(){return-1!==a.indexOf("Firefox/")}function b(){return-1!==a.indexOf("Edge/")}function d(){return-1!==a.indexOf("MSIE")||-1!==a.indexOf("Trident/")||b()}function e(){return-1!==a.indexOf("Chrome/")}function f(){return-1!==a.indexOf("Safari/")&&-1===a.indexOf("Chrome/")}function g(){return-1!==a.indexOf("PhantomJS")}return{isFirefox:c,notFirefox:function(){return!c()},isMSEdge:b,notMSEdge:function(){return!b()},isIE:d,notIE:function(){return!d()},
isChrome:e,notChrome:function(){return!e()},isSafari:f,notSafari:function(){return!f()},isPhantom:g,notPhantom:function(){return!g()},version:function(){if(d()){var b=a.match(/MSIE\s([\d.]+)/)||a.match(/rv:([\d.]+)/)||a.match(/Edge\/([\d.]+)/);return parseInt(b[1])}if(e())return parseInt(a.match(/Chrome\/([\d.]+)/)[1]);if(f())return parseInt(a.match(/Version\/([\d.]+)/)[1]);if(c())return parseInt(a.match(/Firefox\/([\d.]+)/)[1])}}}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:attachments-insert-utils-resources', location = 'utils/attachments-insert-utils.js' */
define("confluence-editor/utils/attachments-insert-utils",["underscore","confluence/meta","jquery"],function(c,b,d){return{insertFilePlaceholder:function(a,e,f){var g=require("tinymce");a.height="comment"===b.get("content-type")?"150":"250";a.ownerId&&a.ownerId===b.get("content-id")&&(delete a.page,delete a.space,delete a.date);a=c.omit(c.pick(a,"name","page","space","date","height"),function(a){return!a});a={contentId:b.get("content-id")||"0",macro:{name:"view-file",params:a}};g.confluence.MacroUtils.insertMacro(a,
e).done(function(a){f&&d(a).click()})}}});require("confluence/module-exporter").safeRequire("confluence-editor/utils/attachments-insert-utils");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/flextofullsize/editor_plugin_src.js' */
define("confluence-editor/tinymce3/plugins/flextofullsize/editor_plugin_src",["jquery","window","tinymce"],function(a,e,h){var i,g,c=function(){var d=a("#wysiwyg").is(":hidden")?a("#preview"):a("#wysiwyg");g=d.find("iframe");var b=a("#header-precursor"),c=a(e).height(),f=b.offset().top+b.height()+a("#header").height();a("#content.edit").height(c-f);setTimeout(function(){if(a("#preview").is(":hidden"))g.height(0).height(d.height());else{a("#content.edit").height("auto");var b=a("#savebar-container").height();
f+=a("#editor-precursor").height()+a("#conflict-wrapper").height();g.height(c-f-b-4)}},1)};return{init:function(d){d.onInit.add(function(){var b;a(d.getBody()).addClass("fullsize");if(h.isIE||h.isOpera)b=d.getWin(),i=a(b.parent),b=a(b.parent.document),a("body").css({overflow:"hidden"}),i.bind("resize.resizeplugin",function(){c()}),b.bind("messageClose",function(){setTimeout(c,0)}),b.bind("resize.resizeplugin",function(a,b){c(b&&b.height)}),b.bind("mode-changed",function(){c()}),d.onChange.add(function(){c()}),
d.onInit.add(function(){c()})})},getInfo:function(){return{longname:"flex editor to full size plugin",description:"adjusts height of editor so it always occupies the right space in between the toolbars",author:"Atlassian",authorurl:"http://www.atlassian.com",version:"1.0"}}}});
require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/flextofullsize/editor_plugin_src",function(a){var e=require("tinymce");e.create("tinymce.plugins.flextofullsizeplugin",a);e.PluginManager.add("flextofullsize",e.plugins.flextofullsizeplugin)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'i18n/translations.i18n.js' */
define("confluence-editor/i18n/translations.i18n",["ajs"],function(a){return{popup_blocked:"The browser has blocked a popup opened by the Editor.",ctrl_key:"Ctrl",shift_key:"Shift",searchreplace:{search_desc:"Find",replace_desc:"Find/Replace"},searchreplace_dlg:{allreplacedplural:"{0} replacements were made",allreplacedsingular:"1 replacement was made",
notfound:"No replacements were made",findlabel:"Find",replacelabel:"Replace",findnext:"Next",findprevious:"Previous",replace:"Replace",replaceall:"Replace all",close:"Close"},
advhr:{advhr_desc:"tinymce.advhr.advhr_desc"},emotions:{emotions_desc:"Emoticons"},emotions_dlg:{title:"Insert emoticon",desc:"Emoticons",smile:"Smile :)",sad:"Sad :(",tongue:"Tongue :p",biggrin:"Big grin :D",wink:"Wink ;)",
thumbs_up:"Thumbs up (y)",thumbs_down:"Thumbs down (n)",information:"Info (i)",check:"Tick (/)",error:"Error (x)",warning:"Warning (!)",add:"Plus (+)",forbidden:"Minus (-)",help_16:"Question mark (?)",
lightbulb_on:"Lightbulb on (on)",lightbulb:"Lightbulb off (off)",star_yellow:"Yellow star (*y)",star_red:"Red star (*r)",star_green:"Green star (*g)",star_blue:"Blue star (*b)",heart:"Heart \u003c3",broken_heart:"Broken heart \u003c/3"},confluence:{conf_macro_browser:"Macro",
conf_macro_browser_desc:"Insert macro",conf_image:"Image",confimage_desc:"Insert image",conf_file:"Files and images",confifile_desc:"Insert files and images",conf_link:"Link",conflink_desc:"Insert link",conf_table:"Table",
conf_wikimarkup:"Markup",conf_wikimarkup_desc:"Insert markup",conf_wikimarkup_errors:"Wiki markup conversion errors",conf_wikimarkup_timeout:"The server took too long to convert the wiki markup. This may only be a temporary problem so you could try again.",conf_wikimarkup_hint:"Hint: you can also enter wiki markup directly in the editor, where it will be formatted as you type.",conf_wikimarkup_markdown_label:"Markdown",
conf_wikimarkup_confluence_label:"Confluence wiki",conf_shortcuts_help_desc:"Keyboard shortcuts help",conf_insert_button_title:"Insert"},table:{desc:"Insert table",row_before_desc:"Insert row before",row_after_desc:"Insert row after",delete_row_desc:"Remove row",
numbering_column_desc:"Insert numbering column",responsive:"Responsive",responsive_tooltip:"Table columns get wider as you add content. Drag column borders to set width relative to each other and the page.",fixed_width:"Fixed width",fixed_width_tooltip:"Drag column borders to set width. The table always appears at the width you set.",col_before_desc:"Insert column before",col_after_desc:"Insert column after",col_copy_desc:"Copy table column",
col_paste_desc:"Paste table column",col_cut_desc:"Cut table column",delete_col_desc:"Remove column",split_cells_desc:"Split merged table cells",merge_cells_desc:"Merge table cells",row_desc:"tinymce.table.row_desc",cell_desc:"tinymce.table.cell_desc",props_desc:"tinymce.table.props_desc",paste_row_before_desc:"Paste table row",
paste_row_after_desc:"Paste row after",cut_row_desc:"Cut table row",copy_row_desc:"Copy table row",del:"Remove table",row:"Row",col:"Column",cell:"Cell",row_highlight:"Heading row",col_highlight:"Heading column",selection_highlight:"Change cell colour",
invalid_table_field:"Rows and columns must both be numbers greater than zero.",table_more_heading:"Table settings",cut_row_desc_shortcut:"Ctrl+Shift+X",copy_row_desc_shortcut:"Ctrl+Shift+C",paste_row_before_desc_shortcut:"Ctrl+Shift+V",row_before_desc_shortcut:"Alt+\u2191",row_after_desc_shortcut:"Alt+\u2193"},
advanced:{style_select:"tinymce.advanced.style_select",font_size:"tinymce.advanced.font_size",fontdefault:"tinymce.advanced.fontdefault",block:"Format",paragraph:"Paragraph",pre:"Preformatted",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",
h6:"Heading 6",blockquote:"Quote",code:"tinymce.advanced.code",samp:"tinymce.advanced.samp",dt:"tinymce.advanced.dt",dd:"tinymce.advanced.dd",bold_desc:"Bold",italic_desc:"Italic",underline_desc:"Underline",striketrough_desc:"Strikethrough",
justifyleft_desc:"Align left",justifycenter_desc:"Align center",justifyright_desc:"Align right",justifyfull_desc:"Align full",bullist_desc:"Bullet list",numlist_desc:"Numbered list",tasklist_desc:"Task list",outdent_desc:"Outdent",
indent_desc:"Indent",undo_desc:"Undo",redo_desc:"Redo",link_desc:"tinymce.advanced.link_desc",unlink_desc:"Unlink",image_desc:"tinymce.advanced.image_desc",cleanup_desc:"tinymce.advanced.cleanup_desc",code_desc:"tinymce.advanced.code_desc",sub_desc:"Subscript",
sup_desc:"Superscript",hr_desc:"Horizontal rule",removeformat_desc:"tinymce.advanced.removeformat_desc",custom1_desc:"tinymce.advanced.custom1_desc",forecolor_desc:"Select text colour",backcolor_desc:"tinymce.advanced.backcolor_desc",charmap_desc:"Symbol",visualaid_desc:"tinymce.advanced.visualaid_desc",anchor_desc:"tinymce.advanced.anchor_desc",
cut_desc:"tinymce.advanced.cut_desc",copy_desc:"tinymce.advanced.copy_desc",paste_desc:"tinymce.advanced.paste_desc",image_props_desc:"tinymce.advanced.image_props_desc",newdocument_desc:"tinymce.advanced.newdocument_desc",help_desc:"Help",blockquote_desc:"tinymce.advanced.blockquote_desc",path:"tinymce.advanced.path",newdocument:"tinymce.advanced.newdocument",
toolbar_focus:"tinymce.advanced.toolbar_focus",more_colors:"tinymce.advanced.more_colors",paragraph_shortcut:"Ctrl+0",pre_shortcut:"Ctrl+7",h1_shortcut:"Ctrl+1",h2_shortcut:"Ctrl+2",h3_shortcut:"Ctrl+3",h4_shortcut:"Ctrl+4",h5_shortcut:"Ctrl+5",
h6_shortcut:"Ctrl+6",blockquote_shortcut:"Ctrl+8",bullist_shortcut:"Ctrl+Shift+B",numlist_shortcut:"Ctrl+Shift+N",tasklist_shortcut:"[ then ]",undo_shortcut:"Ctrl+Z",redo_shortcut:"Ctrl+Y"},colorpicker:{more_colors:"More colours",
title:"Select a colour",picker_tab:"Picker",picker_title:"Colour picker",palette_title:"tinymce.colorpicker.palette_title",named_tab:"tinymce.colorpicker.named_tab",named_title:"tinymce.colorpicker.named_title",color:"Colour",name:"tinymce.colorpicker.name",apply:"tinymce.colorpicker.apply"},
hints:{drafts:"Hint: Confluence saves drafts automatically. If you ever lose a window, recover your work from the \"Username -\u003e Drafts\" menu.",dnd:"Hint: you can drag and drop images and Office files from your computer right into this editor.",insert_link_recently_viewed:"Hint: type \"\u003cstrong\u003e[\u003c/strong\u003e\" to see a list of suggested pages and insert a link.",insert_link_search:"Hint: type \"\u003cstrong\u003e[\u003c/strong\u003e\" and part of a page title to find and link to that page.",insert_link_end:"Hint: press \u003cstrong\u003eCtrl+Shift+K\u003c/strong\u003e after a word to find and link to relevant pages. Press it again for more suggestions.",insert_link_newpage:"Hint: type \"\u003cstrong\u003e[\u003c/strong\u003e\" and the title of a new page you wish to create, to see an insert link suggestion.",insert_link_user_mention:"Hint: you can mention somebody in Confluence by typing \"\u003cstrong\u003e@\u003c/strong\u003e\" and then their name.",insert_image_on_page:"Hint: type \"\u003cstrong\u003e!\u003c/strong\u003e\" to see images attached to the page and insert one of them.",
insert_image_search:"Hint: type \"\u003cstrong\u003e!\u003c/strong\u003e\" and part of an image name to find and insert the image.",insert_image_end:"Hint: press \u003cstrong\u003eCtrl+Shift+M\u003c/strong\u003e after a word to find and insert relevant images.",insert_wikimarkup:"Hint: the Editor will automatically convert wiki markup as you type it.",insert_wikimarkup_dialog:"Hint: press \u003cstrong\u003eCtrl+Shift+D\u003c/strong\u003e to open the Wiki Markup dialog.",insert_link:"Hint: press \u003cstrong\u003eCtrl+K\u003c/strong\u003e to open the link browser.",insert_image:"Hint: press \u003cstrong\u003eCtrl+M\u003c/strong\u003e to open the image browser.",insert_macro:"Hint: press \u003cstrong\u003eCtrl+Shift+A\u003c/strong\u003e to open the macro browser.",insert_macro_toc:"Hint: Let Confluence generate you a table of contents for this page. Use \"Insert -\u003e Table of contents\"",
insert_bullet_list:"Hint: press \u003cstrong\u003eCtrl+Shift+B\u003c/strong\u003e to start a bullet list.",insert_numbered_list:"Hint: press \u003cstrong\u003eCtrl+Shift+N\u003c/strong\u003e to start a numbered list.",insert_heading:"Hint: press \u003cstrong\u003eCtrl+1\u003c/strong\u003e to create a heading level 1, \u003cstrong\u003eCtrl+2\u003c/strong\u003e for heading level 2 and so on.",insert_table:"Hint: press \u003cstrong\u003eCtrl+Shift+I\u003c/strong\u003e to insert a table.",table_rows_copy:"Hint: press \u003cstrong\u003eCtrl+Shift+C\u003c/strong\u003e to copy a row and \u003cstrong\u003eCtrl+Shift+V\u003c/strong\u003e to paste a row in a table.",table_rows_cut:"Hint: press \u003cstrong\u003eCtrl+Shift+X\u003c/strong\u003e to cut a row and \u003cstrong\u003eCtrl+Shift+V\u003c/strong\u003e to paste a row in a table.",insert_newline:"Hint: Type \u003cstrong\u003eShift+Enter\u003c/strong\u003e to insert a new paragraph without spacing",autoformat_heading1:"Hint: Type \"\u003cstrong\u003eh1. Title\u003c/strong\u003e\" to quickly insert a Heading 1.",
autoformat_heading3:"Hint: Type \"\u003cstrong\u003eh3. Title\u003c/strong\u003e\" to quickly insert a Heading 3.",autoformat_code:"Hint: Type \"\u003cstrong\u003e{{code}}\u003c/strong\u003e\" to quickly insert monospaced text."},auiwindowmanager:{cancel:"Cancel",ok:"OK"},propertypanel:{links_goto:"Go to link",links_edit:"Edit",links_unlink:"Unlink",links_goto_disabled_tooltip:"This link goes to content on the page you are editing",
links_edit_tooltip:"Edit link in a dialogue",links_unlink_tooltip:"Replace link with the text it contains",images_small:"Small",images_medium:"Medium",images_large:"Large",images_original:"Original",images_border:"Border",images_link_create:"Link",
images_link_edit:"Edit link",images_link_remove:"Unlink",images_link_create_tooltip:"Link this image to other content",images_link_edit_tooltip:"Edit the link for this image",images_link_remove_tooltip:"Remove the link for this image",images_sizing_tooltip:"Resize image to a specific width",
images_small_tooltip:"Resize image to small and link to the original",images_medium_tooltip:"Resize image to medium and link to the original",images_large_tooltip:"Resize image to large and link to the original",images_original_tooltip:"Reset image size to original",images_thumbnail_tooltip:"tinymce.propertypanel.images.thumbnail.tooltip",images_border_tooltip:"Display a border around image"}}});
require("confluence/module-exporter").exportModuleAsGlobal("confluence-editor/i18n/translations.i18n","TinyMCELang");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'toolbar/toolbar.soy' */
// This file was automatically generated from toolbar.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.Editor.Toolbar.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.Editor == 'undefined') { Confluence.Templates.Editor = {}; }
if (typeof Confluence.Templates.Editor.Toolbar == 'undefined') { Confluence.Templates.Editor.Toolbar = {}; }


Confluence.Templates.Editor.Toolbar.toolbarButton = function(opt_data, opt_ignored) {
  return '<li id="' + soy.$$escapeHtml(opt_data.button.id) + '" class="toolbar-item ' + soy.$$escapeHtml(opt_data.button.className) + '" data-tooltip="' + soy.$$escapeHtml(opt_data.button.tooltip) + '" data-weight="' + soy.$$escapeHtml(opt_data.button.weight) + '"><a class="toolbar-trigger aui-button" href="#" data-control-id="' + soy.$$escapeHtml(opt_data.button.id) + '"><span class="icon ' + soy.$$escapeHtml(opt_data.button.icon) + '"></span><span class="trigger-text">' + soy.$$escapeHtml(opt_data.button.title) + '</span></a></li>';
};
if (goog.DEBUG) {
  Confluence.Templates.Editor.Toolbar.toolbarButton.soyTemplateName = 'Confluence.Templates.Editor.Toolbar.toolbarButton';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/confcharmap/editor_plugin_src.js' */
define("confluence-editor/tinymce3/plugins/confcharmap/editor_plugin_src",["tinymce"],function(b){return{init:function(a){a.addCommand("confCharmap",function(){a.windowManager.open({id:"insert-char-dialog",url:b.settings.editor_plugin_action_base_path+"/charmap.action",width:600+parseInt(a.getLang("advanced.charmap_delta_width",0)),height:290+parseInt(a.getLang("advanced.charmap_delta_height",0)),inline:!0,name:"advanced.charmap_desc"})})},getInfo:function(){return{longname:"Confluence Charmap Plugin",
author:"Atlassian",authorurl:"http://www.atlassian.com",version:b.majorVersion+"."+b.minorVersion}}}});require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/confcharmap/editor_plugin_src",function(b){var a=require("tinymce");a.create("tinymce.plugins.ConfCharmapPlugin",b);a.PluginManager.add("confcharmap",a.plugins.ConfCharmapPlugin)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/confluencelist/editor_plugin_src.js' */
define("confluence-editor/tinymce3/plugins/confluencelist/editor_plugin_src",["jquery","ajs","tinymce"],function(b,g,h){return{init:function(l){!h.isIE8&&l.onKeyDown.add(function(d,k){function j(a){a&&a.lastChild&&!d.dom.isBlock(a.lastChild)&&!b(a.lastChild).is("br")&&b(a).append("<br/>")}if(8===k.keyCode){var c=d.selection.getRng(!0),e=b(c.startContainer).closest("li",d.getBody());if(0!==e.length&&g.EditorUtils.isCursorAtStartOf(e[0],c)){var c=e.prev("li"),f,i=e[0],a;if(0<c.length)return f=c[0],
a=b(i.firstChild),h.isIE9&&0===a.length?a=b("<br/>").appendTo(e):a.is("p")&&(a=a.contents().first()),d.undoManager.beforeChange(),d.undoManager.add(),b(f.lastChild).is("p")&&!d.dom.isBlock(i.firstChild)?(j(f.lastChild),e.contents().each(function(a,c){if(d.dom.isBlock(c))return!1;b(f.lastChild).append(b(c).detach())})):b(i.firstChild).is("p")&&!d.dom.isBlock(f.lastChild)?(j(f),b.each(b.makeArray(c.contents()).reverse(),function(a,c){if(d.dom.isBlock(c))return!1;b(i.firstChild).prepend(b(c).detach())})):
j(f),c.append(e.detach().contents()),a[0]&&g.EditorUtils.setCursorAtStartOfContents(a[0]),d.undoManager.add(),h.dom.Event.cancel(k)}}})},getInfo:function(){return{longname:"Confluence List Plugin",author:"Atlassian",authorurl:"http://www.atlassian.com",version:h.majorVersion+"."+h.minorVersion}}}});
require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/confluencelist/editor_plugin_src",function(b){var g=require("tinymce");g.create("tinymce.plugins.ConfluenceListPlugin",b);g.PluginManager.add("confluencelist",g.plugins.ConfluenceListPlugin)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/atlassianemotions/editor_plugin_src.js' */
define("confluence-editor/tinymce3/plugins/atlassianemotions/editor_plugin_src",["tinymce","jquery"],function(d,e){return{init:function(a,g){a.addCommand("mceEmotion",function(){a.windowManager.open({file:d.settings.editor_plugin_action_base_path+"/emotions.action",width:190+parseInt(a.getLang("emotions.delta_width",0)),height:125+parseInt(a.getLang("emotions.delta_height",0)),inline:1,id:"insert-emoticon-dialog",name:"emotions_dlg.title"},{plugin_url:g})});a.addButton("emotions",{title:"emotions.emotions_desc",
cmd:"mceEmotion"});a.onClick.add(function(a,f){var b=f.target,c;if("IMG"===b.nodeName&&(c=e(b),c.hasClass("emoticon")))return c=a.selection.getRng(!0),(f.offsetX||f.layerX-b.x)<b.width/2?(c.setStartBefore(b),c.setEndBefore(b)):(c.setStartAfter(b),c.setEndAfter(b)),a.selection.setRng(c),a.selection.collapse(),d.dom.Event.prevent(f)})},getInfo:function(){return{longname:"Emotions",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions",
version:d.majorVersion+"."+d.minorVersion}}}});require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/atlassianemotions/editor_plugin_src",function(d){var e=require("tinymce");e.create("tinymce.plugins.EmotionsPlugin",d);e.PluginManager.add("emotions",e.plugins.EmotionsPlugin)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'com/atlassian/confluence/tinymceplugin/tinymce-confluence.js' */
tinymce.confluence=tinymce.confluence||{};
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'breadcrumbs/tinymce-breadcrumbs-oninit-rte.js' */
define("confluence-editor/breadcrumbs/tinymce-breadcrumbs-oninit-rte",["ajs","jquery","document"],function(b,a,g){return function(){function f(){var c=a("#breadcrumbs");c.detach();!c.find(".edited-page-title").length&&e.length&&c.append(e);a("#editor-precursor .cell").prepend(c)}if("comment"!==b.Meta.get("content-type")){var d=a("#quickedit-breadcrumbs");0<d.length&&(a("#breadcrumbs").detach(),d.attr("id","breadcrumbs"),a("#breadcrumb-section").append(d));var e=a(".edited-page-title").parent().detach();
f();a(g).bind("mode-changed",function(c,b){if(b==="preview"){var d=a("#breadcrumbs").detach();e.detach();a("#breadcrumb-section").append(d)}else b==="richtext"&&f()})}}});require("confluence/module-exporter").safeRequire("confluence-editor/breadcrumbs/tinymce-breadcrumbs-oninit-rte",function(b){require("ajs").bind("init.rte",b)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'utils/tinymce-node-utils.js' */
define("confluence-editor/utils/tinymce-node-utils",["tinymce","ajs","jquery"],function(n,h,k){var o=0,m;return m={updateNode:function(a,c){var f=k(a,n.activeEditor.getDoc()),b="confluence.update-node-"+o++;h.trigger("synchrony.stop",{id:b});var d=m.prepareNodeForUpdate(f);return m.replaceNode(f,c).fail(d).always(function(){h.trigger("synchrony.start",{id:b})}).promise()},storeNodeState:function(a,c){for(var f={},b,d=0,e=c.length;d<e;d++)b=c[d],f[b]=a.attr(b);return function(){for(var b in f)a.attr(b,
f[b])}},prepareNodeForUpdate:function(a){var c=null;a.is("img")&&(c=m.storeNodeState(a,["width","height","src","class"]),a.addClass("image-hotswap").attr({src:h.contextPath()+"/images/border/spacer.gif",width:a.attr("width"),height:a.attr("height")}));return c},replaceNode:function(a,c){var f=m.getDoc(),b=k(c,f),d=k(a,f),e="confluence.replace-node-"+o++;h.trigger("synchrony.stop",{id:e});return k.Deferred(function(){var a=this;b.is("img")?(b[0].onload=function(){h.debug("replaceNode: new node's src has been loaded by the browser.");
this.onload=null;a.resolve(this)},k.browser.opera&&(b[0].src=b.attr("src")),f.createDocumentFragment().appendChild(b[0])):a.resolve(b[0])}).always(function(){h.trigger("synchrony.start",{id:e})}).done(function(a){d.replaceWith(a)}).promise()},replaceSelection:function(a){var c=n.activeEditor,f=c.selection.getRng(!0),b;b=c.getDoc().createRange();a=k(a).clone(!0,!1)[0];f.deleteContents();3===f.startContainer.nodeType&&""===f.startContainer.nodeValue&&(f.startContainer.nodeValue=h.Rte.HIDDEN_CHAR);f.insertNode(a);
f=c.getDoc().createTextNode(h.Rte.HIDDEN_CHAR);c.dom.insertAfter(f,a);b.setStartBefore(f);b.setEndAfter(f);b.collapse(!1);c.selection.setRng(b);return a},normalize:function(a){var c,f,b,d,e,g,h=n.activeEditor;e=h.selection.getRng(!0);var l,m=[];if(a&&a.childNodes){if(n.isWebKit)l=e;else if(n.isGecko&&(l=e.cloneRange(),c=k.inArray(e.startContainer,a.childNodes),f=l.startOffset,b=k.inArray(e.endContainer,a.childNodes),d=l.endOffset,g=e=g=e=void 0,-1<c||-1<b)){var p=[],q=0;k.each(a.childNodes,function(a,
b){var c={},f=p[a-1]||{};c.isTextNode=3===b.nodeType;c.textNodesBefore=(c.isTextNode&&f.isTextNode?1:0)+~~f.textNodesBefore;c.precedingTextLength=q;q=c.isTextNode?q+b.nodeValue.length:0;p.push(c)});m=p}a.normalize();if(n.isGecko){if(g=m[c])e=c-g.textNodesBefore,g=f+g.precedingTextLength,l.setStart(a.childNodes[e],g);if(g=m[b])e=b-g.textNodesBefore,g=d+g.precedingTextLength,l.setEnd(a.childNodes[e],g)}l&&h.selection.setRng(l)}},getDoc:function(){var a=n.activeEditor;return k.browser.mozilla||k.browser.opera?
document:a.getDoc()},isolateSelectedRange:function(){function a(a,b,d){var e;(e=c.dom.getParent(a,c.dom.isBlock))||(e=c.getBody());a:{var g,i=null,j=null,h;h=(g=d?!0:!1)?"nextSibling":"previousSibling";i=0===b;!i&&g&&(i=3===a.nodeType?b===a.length:b===a.childNodes.length);if(i){i=a[h];for(j=a;null===i;){if(j===e){a=void 0;break a}else if(j.parentNode===e)break;j=j.parentNode;i=j[h]}}else 3===a.nodeType?(h=a.data,a.data=h.slice(b),i=f.createTextNode(h.slice(0,b)),j=a,k(i).insertBefore(j),g&&(h=j,j=
i,i=h)):(j=a.childNodes[b-(g?1:0)],i=j[h]);a=[j,i]}if(a)if(a[1]){b=a[1];a=a[0];for(d=d?!0:!1;a!==e&&a.parentNode!==e;){i=a.parentNode;g=i.cloneNode(!1);if(d)for(k(g).insertAfter(i);b;)j=b.nextSibling,g.appendChild(b),b=j;else{k(g).insertBefore(i);for(b=i.firstChild;b!==a;)j=b.nextSibling,g.appendChild(b),b=j}b=g;a=i}d=a}else d=a[0];else d=void 0;return d}var c=n.activeEditor,f=m.getDoc(),b=c.selection,d=b.getRng(!0),e=d.startContainer,g=d.startOffset,h=d.endContainer,l=d.endOffset,o;if(d.collapsed)return d;
e===h&&(o=l-g);(g=a(e,g))&&d.setStartBefore(g);e!==d.startContainer&&(l=o||l);(e=a(h,l,!0))&&d.setEndAfter(e);b.setRng(d);return d}}});require("confluence/module-exporter").exportModuleAsGlobal("confluence-editor/utils/tinymce-node-utils","tinymce.confluence.NodeUtils");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'autoformat/wiki-autoformat-oninit-rte.js' */
define("confluence-editor/wiki-autoformat",["ajs","jquery","document","window"],function(k,j,m,u){var h=function(v,w){function n(a){return j("<div>").append(a.cloneNode(!0)).html()}function x(a,b,f){if(!b)throw Error("text node is null");3!==b.nodeType&&(b=b.childNodes[f-1],f=b.length);for(;b&&3===b.nodeType;b=b.previousSibling){-1==f&&(f=b.nodeValue.length);if(f>a)return{container:b,offset:f-a};if(f==a){f=0;for(a=b.parentNode;b=b.previousSibling;)f++;return{container:a,offset:f}}a-=f;f=-1}return null}
function p(a){var b,f;if(!a||!a.collapsed)throw Error("range is null or not collapsed");b=a.startContainer;f=a.startOffset;if(1===b.nodeType&&0<f)if(b=b.childNodes[a.startOffset-1],3===b.nodeType)f=b.nodeValue.length;else return"";else if(3!==b.nodeType)return"";a=b.nodeValue.substring(0,f);for(b=b.previousSibling;b&&3===b.nodeType;b=b.previousSibling)a=b.nodeValue+a;return a}function i(a,b,f,c){return{handles:function(b){var f=!1,b=b.selection.getRng(!0),f=b.commonAncestorContainer||{};return!b.collapsed||
j(f).closest("pre,.text-placeholder").length||c&&j(f).closest(c).length?!1:f=a.test(p(b))},execute:function(c,g,h){var d,e,i=1;d=j.browser.msie?g.keyCode:g.which;32===d?c.execCommand("mceInsertContent",!1,"&nbsp;"):c.execCommand("mceInsertContent",!1,String.fromCharCode(d));c.undoManager.beforeChange();c.undoManager.add();d=c.selection.getRng(!0);e=p(d);"|"==e[e.length-1]&&(e+=" ",i=0);e=a.exec(e.substring(0,e.length-1));i=x(e[1].length+i,d.commonAncestorContainer,d.startOffset);d.setStart(i.container,
i.offset);i=j(d.commonAncestorContainer);c.selection.setRng(d);i.closest(".wysiwyg-macro-body").length&&d.toString()==i.text()?(i[0].innerHTML="<br>",c.selection.select(i[0].childNodes[0]),c.selection.collapse(!0)):c.execCommand("delete",!1,{},{skip_undo:!0});b(e,c.selection.getRng(!0));q=c.selection.getRng(!0);if(f)return h.preventDefault(),h.stopPropagation(),o.dom.Event.cancel(g),k.Rte.showElement(q.startContainer),!1}}}function r(){this.handlers={}}function e(a,b,f,d,e){var a=a.charCodeAt(0),
h=k.Rte.getResourceUrlPrefix()+"/images/icons/emoticons/"+e,b=i(b,function(){var a=c.dom.createHTML("img",{src:h,alt:c.getLang(d),title:c.getLang(d),border:0,"class":"emoticon emoticon-"+f,"data-emoticon-name":f});c.execCommand("mceInsertContent",!1,a,{skip_undo:!0})},!0);this.imagePath=h;g.registerHandler(a,b)}function s(a,b){var f=c.formatter.get(a)[0],f=c.dom.create(f.inline,{style:f.styles});f.appendChild(m.createTextNode(b+"{$caret}"));c.execCommand("mceInsertContent",!1,n(f),{skip_undo:!0});
c.formatter.remove(a)}var o=require("tinymce"),q;if(!k.Meta.get("remote-user")||!k.Meta.get("confluence.prefs.editor.disable.autoformat")){r.prototype={registerHandler:function(a,b){this.handlers[a]||(this.handlers[a]=[]);this.handlers[a].push(b)},executeHandlers:function(a,b,c,d){var e=!0;j.each(this.handlers[a]||[],function(a,g){if(g.handles(b))return e=g.execute(b,c,d),!1});return e}};var c=w.editor,g=new r,d=[new e(")",h.regularExpressions._REGEXES_EMOTICON.SMILE,"smile","emotions_dlg.smile",
"smile.png"),new e("(",h.regularExpressions._REGEXES_EMOTICON.SAD,"sad","emotions_dlg.sad","sad.png"),new e("P",h.regularExpressions._REGEXES_EMOTICON.CHEEKY,"cheeky","emotions_dlg.tongue","tongue.png"),new e("p",h.regularExpressions._REGEXES_EMOTICON.CHEEKY_2,"cheeky","emotions_dlg.tongue","tongue.png"),new e("D",h.regularExpressions._REGEXES_EMOTICON.LAUGH,"laugh","emotions_dlg.biggrin","biggrin.png"),new e(")",h.regularExpressions._REGEXES_EMOTICON.WINK,"wink","emotions_dlg.wink","wink.png"),new e(")",
h.regularExpressions._REGEXES_EMOTICON.THUMBS_UP,"thumbs-up","emotions_dlg.thumbs_up","thumbs_up.png"),new e(")",h.regularExpressions._REGEXES_EMOTICON.THUMBS_DOWN,"thumbs-down","emotions_dlg.thumbs_down","thumbs_down.png"),new e(")",h.regularExpressions._REGEXES_EMOTICON.INFORMATION,"information","emotions_dlg.information","information.png"),new e(")",h.regularExpressions._REGEXES_EMOTICON.TICK,"tick","emotions_dlg.check","check.png"),new e(")",h.regularExpressions._REGEXES_EMOTICON.CROSS,"cross",
"emotions_dlg.error","error.png"),new e(")",h.regularExpressions._REGEXES_EMOTICON.WARNING,"warning","emotions_dlg.warning","warning.png"),new e(")",h.regularExpressions._REGEXES_EMOTICON.PLUS,"plus","emotions_dlg.add","add.png"),new e(")",h.regularExpressions._REGEXES_EMOTICON.MINUS,"minus","emotions_dlg.forbidden","forbidden.png"),new e(")",h.regularExpressions._REGEXES_EMOTICON.QUESTION,"question","emotions_dlg.help_16","help_16.png"),new e(")",h.regularExpressions._REGEXES_EMOTICON.LIGHT_ON,"light-on",
"emotions_dlg.lightbulb_on","lightbulb_on.png"),new e(")",h.regularExpressions._REGEXES_EMOTICON.LIGHT_OFF,"light-off","emotions_dlg.lightbulb","lightbulb.png"),new e(")",h.regularExpressions._REGEXES_EMOTICON.YELLOW_STAR,"yellow-star","emotions_dlg.star_yellow","star_yellow.png"),new e(")",h.regularExpressions._REGEXES_EMOTICON.YELLOW_STAR_2,"yellow-star","emotions_dlg.star_yellow","star_yellow.png"),new e(")",h.regularExpressions._REGEXES_EMOTICON.RED_STAR,"red-star","emotions_dlg.star_red","star_red.png"),
new e(")",h.regularExpressions._REGEXES_EMOTICON.GREEN_STAR,"green-star","emotions_dlg.star_green","star_green.png"),new e(")",h.regularExpressions._REGEXES_EMOTICON.BLUE_STAR,"blue-star","emotions_dlg.star_blue","star_blue.png"),new e("3",h.regularExpressions._REGEXES_EMOTICON.HEART,"heart","emotions_dlg.heart","heart.png"),new e("3",h.regularExpressions._REGEXES_EMOTICON.BROKEN_HEAR,"broken-heart","emotions_dlg.broken_heart","broken_heart.png")],l,t=[];for(l=0;l<d.length;l++)t[l]=new u.Image,t[l].src=
d[l].imagePath;j.each({"*":"bold",_:"italic","~":"subscript","^":"superscript","+":"underline","-":"strikethrough"},function(a,b){var c=RegExp("(?:[\\s\\xA0\\u200b\\uFEFF]+|^)(\\"+a+"(?=[^\\s"+a+"])([^"+a+"]*?[^\\s]))$");g.registerHandler(a.charCodeAt(0),i(c,function(a){s(b,a[2])},!0))});c.formatter.register("code",{inline:"code"});g.registerHandler(125,i(/(?:[\s\xA0\u200b]+|^)({{(?=[^\s])([^}]*?[^\s])})$/,function(a){s("code",a[2])},!0));for(l=1;6>=l;l++)(function(a){g.registerHandler(32,i(RegExp("^\\u200b?(h"+
a+"\\.)$"),function(){c.execCommand("formatBlock",!1,"h"+a,{skip_undo:!0})},!0))})(l);g.registerHandler(32,i(/^\u200b?(bq\.)$/,function(){c.execCommand("formatBlock",!1,"blockquote",{skip_undo:!0})},!0));g.registerHandler(32,i(/^\u200b?(\*)$/,function(){c.plugins.lists.applyList("UL","OL")},!0));g.registerHandler(32,i(/^\u200b?(\#)$/,function(){c.plugins.lists.applyList("OL","UL")},!0));g.registerHandler(32,i(/^\u200b?(1\.)$/,function(){c.plugins.lists.applyList("OL","UL")},!0));g.registerHandler(32,
i(/^\u200b?(\-)$/,function(){var a=c.dom,b;c.plugins.lists.applyList("UL","OL");if(b=a.getParent(c.selection.getNode(),"OL,UL"))a.setStyles(b,{listStyleType:"square"}),b.removeAttribute("data-mce-style")},!0));k.trigger("confluence.editor.registerHandlers",{handlerManager:g,createHandler:i,ed:c});d=i(/((\<\-\-?\>)([^\s-]*))$/,function(a){c.execCommand("mceInsertContent",!1,"\u2194"+a[3],{skip_undo:!0})},!1);g.registerHandler(32,d);g.registerHandler(13,d);d=i(/((\-\-?\>)([^\s-]*))$/,function(a){c.execCommand("mceInsertContent",
!1,"\u2192"+a[3],{skip_undo:!0})},!1);g.registerHandler(32,d);g.registerHandler(13,d);d=i(/((\<\-\-?)([^\s-]*))$/,function(a){c.execCommand("mceInsertContent",!1,"\u2190"+a[3],{skip_undo:!0})},!1);g.registerHandler(32,d);g.registerHandler(13,d);g.registerHandler(32,i(/[^-]*[\s](\-\-\-?)$/,function(a){c.execCommand("mceInsertContent",!1,2===a[1].length?"\u2013":"\u2014",{skip_undo:!0})},!1));d=i(/(([^\s-]+)(\-\-\-?)([^\s-]+))$/,function(a){c.execCommand("mceInsertContent",!1,a[2]+(2===a[3].length?
"\u2013":"\u2014")+a[4],{skip_undo:!0})},!1);g.registerHandler(32,d);g.registerHandler(13,d);d=i(/^\u200b?(\-\-\-\-)$/,function(){c.execCommand("mceInsertContent",!1,"<hr />",{skip_undo:!0})},!0);g.registerHandler(32,d);g.registerHandler(13,d);g.registerHandler(13,i(/(^\u200b?\|\|\s*(?:[^|]*\s?\|\|\s?)+$)/,function(a){var b="<table class='confluenceTable'><tr>",f="",d=!0,a=j(a[1].slice(2,-2).split("||")).map(function(a){a=j.trim(this);d=d&&""==a;return a});d&&(a[0]="first cell");
for(var e=0,g=a.length;e<g;e++)b+="<th class='confluenceTh'>"+a[e]+"</th>",f+="<td class='confluenceTd'>"+k.Rte.ZERO_WIDTH_WHITESPACE+"</td>";c.execCommand("mceInsertContent",!1,b+("</tr><tr>"+f+"</tr></table>"),{skip_undo:!0});c.selection.select(j(c.selection.getRng(!0).commonAncestorContainer).parents("table").find(d?"th":"td")[0].childNodes[0]);j(c.selection.getRng().startContainer).parent().closest('[contenteditable="true"]').focus()},!0));g.registerHandler(13,i(/(^\u200b?\|\s?(?:[^|]*\s?\|\s?)+$)/,
function(a){var b="<table class='confluenceTable'><tr>",f=!0,a=j(a[1].slice(1,-1).split("|")).map(function(a){a=j.trim(this);f=f&&""==a;return a});f&&(a[0]="first cell");for(var d=0,e=a.length;d<e;d++)b+="<td class='confluenceTd'>"+a[d]+"</td>";c.execCommand("mceInsertContent",!1,b+"</tr></table>",{skip_undo:!0});f&&c.selection.select(j(c.selection.getRng(!0).commonAncestorContainer).parents("table").find("td")[0].childNodes[0]);j(c.selection.getRng().startContainer).parent().closest('[contenteditable="true"]').focus()},
!0));d=i(/\b(((https?|ftp):\/\/|(www\.))[\w\.\$\-_\+!\*'\(\),/\?:@=&%#~;\[\]]+)$/,function(a){var b=c.dom.create("a",{href:a[3]?a[1]:"http://"+a[1]});b.appendChild(m.createTextNode(a[1]));c.execCommand("mceInsertContent",!1,n(b),{skip_undo:!0});c.getDoc().execCommand("unlink",!1,{})},!1,"a");g.registerHandler(32,d);g.registerHandler(13,d);d=i(/\b((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)$/i,
function(a){var b=c.dom.create("a",{href:"mailto:"+a[1]});b.appendChild(m.createTextNode(a[1]));c.execCommand("mceInsertContent",!1,n(b),{skip_undo:!0});c.getDoc().execCommand("unlink",!1,{})},!1,"a");g.registerHandler(32,d);g.registerHandler(13,d);d=function(a,b){var d=i(a,function(){c.execCommand("mceInsertContent",!1,b,{skip_undo:!0})},!1);g.registerHandler(32,d);g.registerHandler(13,d)};d(/(?:\b|^)([Jj]ira)$/,"JIRA");d(/(?:\b|^)(bitbucket|[Bb]itBucket)$/,"Bitbucket");d(/(?:\b|^)(atlassian)$/,
"Atlassian");d(/(?:\b|^)([Hh]ipchat)$/,"HipChat");j.each({"]":h.regularExpressions._REGEXES.WIKI_LINK,"}":h.regularExpressions._REGEXES.WIKI_MACRO,"!":h.regularExpressions._REGEXES.WIKI_EMBED},function(a,b){g.registerHandler(a.charCodeAt(0),i(b,function(b){var d=b[1]+a,b={type:"POST",contentType:"application/json; charset=utf-8",url:k.Meta.get("context-path")+"/rest/tinymce/1/wikixhtmlconverter",data:j.toJSON({wiki:d,entityId:k.Meta.get("content-id"),spaceKey:k.Meta.get("space-key"),suppressFirstParagraph:!0}),
dataType:"text",timeout:5E3};"}"==a?o.confluence.MacroUtils.insertMacro(b):"!"==a?j.ajax(b).done(function(a){!d===a?o.confluence.ImageUtils.insertImagePlaceholder(a):c.execCommand("mceInsertContent",!1,a,{skip_undo:!0})}):j.ajax(b).done(function(a){c.execCommand("mceInsertContent",!1,a,{skip_undo:!0})})},!0))});c.onKeyPress.addToTop(function(a,b){return g.executeHandlers(j.browser.msie?b.keyCode:b.which,a,b,v)});return{}}};h.regularExpressions={_REGEXES:{WIKI_MACRO:/(?:\s|^)(\{[^{^}]+)$/,WIKI_LINK:/(?:\s|^)(\[[^\[^\]]+)$/,
WIKI_EMBED:/(?:\s|^)(![^!]{5,})$/},_REGEXES_EMOTICON:{SMILE:/\B(:-?)$/,SAD:/\B(:-?)$/,CHEEKY:/\B(:-?)$/,CHEEKY_2:/\B(:-?)$/,LAUGH:/\B(:-?)$/,WINK:/\B(;-?)$/,THUMBS_UP:/\B(\(y)$/,THUMBS_DOWN:/\B(\(n)$/,INFORMATION:/\B(\(i)$/,TICK:/\B(\(\/)$/,CROSS:/\B(\(x)$/,WARNING:/\B(\(!)$/,PLUS:/\B(\(\+)$/,MINUS:/\B(\(-)$/,QUESTION:/\B(\(\?)$/,LIGHT_ON:/\B(\(on)$/,LIGHT_OFF:/\B(\(off)$/,YELLOW_STAR:/\B(\(\*)$/,YELLOW_STAR_2:/\B(\(\*y)$/,RED_STAR:/\B(\(\*r)$/,GREEN_STAR:/\B(\(\*g)$/,BLUE_STAR:/\B(\(\*b)$/,HEART:/\B(<)$/,
BROKEN_HEAR:/\B(<\/)$/}};return h});require("confluence/module-exporter").safeRequire("confluence-editor/wiki-autoformat",function(k){require("confluence/module-exporter").namespace("AJS.Rte.autoformat",k.regularExpressions);require("ajs").bind("init.rte",k)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/confluencedrafts/editor_plugin_src.js' */
define("confluence-editor/tinymce3/plugins/confluencedrafts/editor_plugin_src",["jquery","ajs","tinymce","confluence/analytics-support","confluence/legacy-editor-global-AVOID-IF-POSSIBLE"],function(d,a,b,f,c){return{init:function(b){function h(){if(!a.Meta.get("has-collaborated")){a.Meta.set("has-collaborated",!0);var c=a.Meta.get("remote-user-key"),b=a.Meta.get("content-id");d.ajax({type:"PUT",url:a.contextPath()+"/rest/experimental/relation/user/"+c+"/collaborator/toContent/"+b+"?targetStatus=draft",
error:function(){a.Meta.set("has-collaborated",!1);a.error("Unable to store current user as a collaborator")}})}}function e(){c.editorHasContentChanged()&&c.Drafts.save({forceSave:!0})}var g;b.onInit.add(function(){a.bind("rte-preview-action-selected",e);a.Meta.get("shared-drafts")&&a.DarkFeatures.isEnabled("collaborative-audit-log")&&a.bind("editor.local.change",h)});b.onRemove.add(function(){a.unbind("rte-preview-action-selected",e)});a.bind("rte-ready",function(){a.debug("confluence drafts plugin initialisation");
d("#draft-status").show();d("#draft-messages").show();c.Drafts.bindUnloadMessage();c.UI.cancelButton.click(function(){c.Drafts.save({skipErrorHandler:!0})});d("#draft-messages").is(":visible")&&f.publish("rte.notification.draft");d("#draft-messages").find("a.use-draft").click(function(a){a.stopPropagation();a.preventDefault();c.Drafts.useDraft();f.publish("rte.notification.draft.resume")});d("#draft-messages").find("a.discard-draft").click(function(b){b.stopPropagation();b.preventDefault();c.Drafts.discardDraft(a.Meta.get("existing-draft-id"));
f.publish("rte.notification.draft.discard")});if(a.Meta.getBoolean("shared-drafts")){var b=a.Meta.get("draft-id"),e=a.Meta.get("draft-share-id");0!==b&&(window.history&&window.history.replaceState)&&(a.DarkFeatures.isEnabled("react.ui.view-page")&&d("#confluence-ui").length?window.history.replaceState(null,"",window.location.pathname+"?draftId="+b+"&draftShareId="+e):window.history.replaceState(null,"",a.Meta.get("base-url")+"/pages/resumedraft.action?draftId="+b+"&draftShareId="+e));c.UI.cancelButton.attr("data-tooltip",
"Keep the draft or discard changes");c.UI.cancelButton.on("click",function(){a.trigger("analytics",{name:"confluence.editor.done.button.clicked"});a.trigger("analytics",{name:"confluence.editor.close",data:{source:"closeButton"}})})}g=setInterval(c.Drafts.save,+a.params.draftSaveInterval||3E4)});a.bind("rte-destroyed",function(){a.debug("confluence drafts plugin tear down");clearInterval(g)})},getInfo:function(){return{longname:"Confluence Drafts",author:"Atlassian",authorurl:"http://www.atlassian.com",
version:b.majorVersion+"."+b.minorVersion}}}});require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/confluencedrafts/editor_plugin_src",function(d){var a=require("tinymce");a.create("tinymce.plugins.ConfluenceDrafts",d);a.PluginManager.add("confluencedrafts",a.plugins.ConfluenceDrafts)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/referrer/editor_plugin_src.js' */
define("confluence-editor/tinymce3/plugins/referrer/editor_plugin_src",["jquery","tinymce"],function(b,a){return{init:function(a){a.onInit.add(function(){var a=b("#createpageform"),c=a.find("#originalReferrer");a.length&&(!c.val()&&document.referrer)&&c.val(document.referrer)})},getInfo:function(){return{longname:"Confluence Cancel Return Url",author:"Atlassian",authorurl:"http://www.atlassian.com",version:a.majorVersion+"."+a.minorVersion}}}});
require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/referrer/editor_plugin_src",function(b){var a=require("tinymce");a.create("tinymce.plugins.Referrer",b);a.PluginManager.add("referrer",a.plugins.Referrer)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/watch/editor_plugin_src.js' */
define("confluence-editor/tinymce3/plugins/watch/editor_plugin_src",["jquery","ajs","tinymce","confluence/templates"],function(c,a,b,d){return{init:function(b){b.onInit.add(function(){if(a.Meta.get("use-watch")){var b={userWatchingOwnContent:a.Meta.get("user-watching-own-content")};c("#rte-savebar-tinymce-plugin-point").append(d.Editor.SaveBar.Watch.render(b))}})},getInfo:function(){return{longname:"Confluence Watch",author:"Atlassian",authorurl:"http://www.atlassian.com",version:b.majorVersion+"."+
b.minorVersion}}}});require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/watch/editor_plugin_src",function(c){var a=require("tinymce");a.create("tinymce.plugins.ConfluenceWatch",c);a.PluginManager.add("confluencewatch",a.plugins.ConfluenceWatch)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/watch/watch.soy' */
// This file was automatically generated from watch.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.Editor.SaveBar.Watch.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.Editor == 'undefined') { Confluence.Templates.Editor = {}; }
if (typeof Confluence.Templates.Editor.SaveBar == 'undefined') { Confluence.Templates.Editor.SaveBar = {}; }
if (typeof Confluence.Templates.Editor.SaveBar.Watch == 'undefined') { Confluence.Templates.Editor.SaveBar.Watch = {}; }


Confluence.Templates.Editor.SaveBar.Watch.render = function(opt_data, opt_ignored) {
  return '<ul class="toolbar-group toolbar-group-watch-page" id="toolbar-group-watch-page-after-comment"><li class="toolbar-item"><input id="watchPage" name="watchPageAfterComment" value="true" type="checkbox" ' + ((opt_data.userWatchingOwnContent) ? 'checked="checked"' : '') + '/><label for="watchPage">' + soy.$$escapeHtml('Watch this page') + '</label></li></ul>';
};
if (goog.DEBUG) {
  Confluence.Templates.Editor.SaveBar.Watch.render.soyTemplateName = 'Confluence.Templates.Editor.SaveBar.Watch.render';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/notifywatchers/editor_plugin_src.js' */
define("confluence-editor/tinymce3/plugins/notifywatchers/editor_plugin_src",["jquery","ajs","confluence/templates","tinymce"],function(c,a,d,b){return{init:function(b){b.onInit.add(function(){var b={contentId:a.params.contentId,defaultVersionComment:a.params.versionComment};c("#rte-savebar-tinymce-plugin-point").append(d.Editor.SaveBar.NotifyWatchers.render(b))});require(["confluence/persistable"])},getInfo:function(){return{longname:"Confluence Notify Watchers",author:"Atlassian",authorurl:"http://www.atlassian.com",
version:b.majorVersion+"."+b.minorVersion}}}});require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/notifywatchers/editor_plugin_src",function(c){var a=require("tinymce");a.create("tinymce.plugins.ConfluenceNotifyWatchers",c);a.PluginManager.add("confluencenotifywatchers",a.plugins.ConfluenceNotifyWatchers)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/notifywatchers/notifywatchers.soy' */
// This file was automatically generated from notifywatchers.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.Editor.SaveBar.NotifyWatchers.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.Editor == 'undefined') { Confluence.Templates.Editor = {}; }
if (typeof Confluence.Templates.Editor.SaveBar == 'undefined') { Confluence.Templates.Editor.SaveBar = {}; }
if (typeof Confluence.Templates.Editor.SaveBar.NotifyWatchers == 'undefined') { Confluence.Templates.Editor.SaveBar.NotifyWatchers = {}; }


Confluence.Templates.Editor.SaveBar.NotifyWatchers.render = function(opt_data, opt_ignored) {
  return '<span class="minor-edit toolbar-item"><input id="notifyWatchers" name="notifyWatchers" value="true" type="checkbox" data-persist="checked" data-persist-scope="' + soy.$$escapeHtml(opt_data.contentId) + '" data-default-value="true" checked><label for="notifyWatchers"><span>' + soy.$$escapeHtml('Notify watchers') + '</span></label></span>';
};
if (goog.DEBUG) {
  Confluence.Templates.Editor.SaveBar.NotifyWatchers.render.soyTemplateName = 'Confluence.Templates.Editor.SaveBar.NotifyWatchers.render';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/versioncomment/editor_plugin_src.js' */
define("confluence-editor/tinymce3/plugins/versioncomment/editor_plugin_src",["jquery","ajs","tinymce","confluence/templates"],function(c,b,a,d){return{init:function(a){a.onInit.add(function(){var a={versionComment:b.params.versionComment};c("#rte-savebar-tinymce-plugin-point").append(d.Editor.SaveBar.VersionComment.render(a))})},getInfo:function(){return{longname:"Confluence Version Comment",author:"Atlassian",authorurl:"http://www.atlassian.com",version:a.majorVersion+"."+a.minorVersion}}}});
require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/versioncomment/editor_plugin_src",function(c){var b=require("tinymce");b.create("tinymce.plugins.ConfluenceVersionComment",c);b.PluginManager.add("confluenceversioncomment",b.plugins.ConfluenceVersionComment)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/versioncomment/versioncomment.soy' */
// This file was automatically generated from versioncomment.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.Editor.SaveBar.VersionComment.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.Editor == 'undefined') { Confluence.Templates.Editor = {}; }
if (typeof Confluence.Templates.Editor.SaveBar == 'undefined') { Confluence.Templates.Editor.SaveBar = {}; }
if (typeof Confluence.Templates.Editor.SaveBar.VersionComment == 'undefined') { Confluence.Templates.Editor.SaveBar.VersionComment = {}; }


Confluence.Templates.Editor.SaveBar.VersionComment.render = function(opt_data, opt_ignored) {
  return '<span class="rte-toolbar-comment toolbar-item"><input id="versionComment" name="versionComment" ' + ((opt_data.versionComment) ? 'value="' + soy.$$escapeHtml(opt_data.versionComment) + '"' : '') + 'placeholder="' + soy.$$escapeHtml('What did you change?') + '" class="text" type="text" size="35"><label for="versionComment" class="assistive">' + soy.$$escapeHtml('What did you change?') + '</label></span>';
};
if (goog.DEBUG) {
  Confluence.Templates.Editor.SaveBar.VersionComment.render.soyTemplateName = 'Confluence.Templates.Editor.SaveBar.VersionComment.render';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/imagedialog/editor_plugin_src.js' */
define("confluence-editor/tinymce3/plugins/imagedialog/editor_plugin_src",["tinymce","confluence/legacy-editor-global-AVOID-IF-POSSIBLE"],function(a,b){return{init:function(a){a.onInit.add(function(){a.addCommand("mceConfimage",b.defaultInsertImageDialog)})},getInfo:function(){return{longname:"Confluence Image Dialog",author:"Atlassian",authorurl:"http://www.atlassian.com",version:a.majorVersion+"."+a.minorVersion}}}});
require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/imagedialog/editor_plugin_src",function(a){var b=require("tinymce");b.create("tinymce.plugins.ConfluenceImageDialog",a);b.PluginManager.add("confluenceimagedialog",b.plugins.ConfluenceImageDialog)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/macrobrowser/editor_plugin_src.js' */
define("confluence-editor/tinymce3/plugins/macrobrowser/editor_plugin_src",["tinymce"],function(b){return{init:function(a){a.onInit.add(function(){a.addCommand("mceConfMacroBrowser",b.confluence.macrobrowser.macroBrowserToolbarButtonClicked)})},getInfo:function(){return{longname:"Confluence Macro Browser",author:"Atlassian",authorurl:"http://www.atlassian.com",version:b.majorVersion+"."+b.minorVersion}}}});
require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/macrobrowser/editor_plugin_src",function(b){var a=require("tinymce");a.create("tinymce.plugins.ConfluenceMacroBrowser",b);a.PluginManager.add("confluencemacrobrowser",a.plugins.ConfluenceMacroBrowser)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/leavecomment/editor_plugin_src.js' */
define("confluence-editor/tinymce3/plugins/leavecomment/editor_plugin_src",["jquery","ajs","tinymce","confluence/legacy-editor-global-AVOID-IF-POSSIBLE","window"],function(c,a,b,e,f){return{init:function(d){function b(){if(e.UI.isFormEnabled()&&d.isDirty()&&!e.isEmpty())return "Your comment will be lost."}d.onInit.add(function(){c(f).bind("beforeunload",b)});d.onRemove.add(function(){c(f).unbind("beforeunload",b)})},getInfo:function(){return{longname:"Confluence Leave Comment",author:"Atlassian",
authorurl:"http://www.atlassian.com",version:b.majorVersion+"."+b.minorVersion}}}});require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/leavecomment/editor_plugin_src",function(c){var a=require("tinymce");a.create("tinymce.plugins.ConfluenceLeaveComment",c);a.PluginManager.add("confluenceleavecomment",a.plugins.ConfluenceLeaveComment)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/leavetemplate/editor_plugin_src.js' */
define("confluence-editor/tinymce3/plugins/leavetemplate/editor_plugin_src",["jquery","ajs","confluence/legacy-editor-global-AVOID-IF-POSSIBLE","window","tinymce"],function(c,a,e,f,b){return{init:function(d){function b(){if(e.UI.isFormEnabled()&&d.isDirty()&&!e.isEmpty())return "Your unsaved template changes will be lost."}d.onInit.add(function(){c(f).bind("beforeunload",b)});d.onRemove.add(function(){c(f).unbind("beforeunload",b)})},getInfo:function(){return{longname:"Confluence Leave Template",author:"Atlassian",
authorurl:"http://www.atlassian.com",version:b.majorVersion+"."+b.minorVersion}}}});require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/leavetemplate/editor_plugin_src",function(c){var a=require("tinymce");a.create("tinymce.plugins.ConfluenceLeaveTemplate",c);a.PluginManager.add("confluenceleavetemplate",a.plugins.ConfluenceLeaveTemplate)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/template-editor/editor_plugin_src.js' */
define("confluence-editor/tinymce3/plugins/template-editor/editor_plugin_src",["jquery","tinymce"],function(b,a){return{init:function(a){a.onInit.add(function(){b(a.getBody()).addClass("template-editor")})},getInfo:function(){return{longname:"Confluence Template Editor",author:"Atlassian",authorurl:"http://www.atlassian.com",version:a.majorVersion+"."+a.minorVersion}}}});
require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/template-editor/editor_plugin_src",function(b){var a=require("tinymce");a.create("tinymce.plugins.ConfluenceTemplateEditor",b);a.PluginManager.add("confluencetemplateeditor",a.plugins.ConfluenceTemplateEditor)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/customtoolbar/custom-toolbar-components.js' */
define("confluence-editor/tinymce3/plugins/customtoolbar/custom-toolbar-components",["jquery"],function(d){return{Button:function(a){var b=a.text,e=a.tooltip,c=a.triggerText,i=a.iconClass,h=a.click,j=!!a.disabled,g=a.id;this.render=function(){var a=d('<button type="button"></button>').addClass("aui-button").attr("data-tooltip",e||b);g&&a.attr("id",g);j&&a.prop("disabled",!0).attr("aria-disabled","true");a.click(function(){a.prop("disabled")||h()});if(i){var f=d("<span />");f.addClass("icon "+i);f.text(b);
a.append(f)}c&&(f=d("<span />"),f.addClass("trigger-text"),f.text(c),a.append(f));return a[0]}},DropDownButton:function(a){var b=a.id,e=a.tooltip,c=a.text||"",i=a.iconClass,h=!!a.disabled,j=a.dropDownContent,g;this.render=function(){var a=d("<div></div>").addClass("toolbar-item").addClass("toolbar-dropdown").attr("data-tooltip",e);a.attr("id",b);var f=d("<div/>").addClass("aui-dd-parent"),k=d("<a href='#'></a>");k.addClass("toolbar-trigger").addClass("aui-dd-trigger").addClass("aui-button");c&&k.append("<span class='dropdown-text'>"+
c+"</span>");h&&(a.addClass("disabled"),k.addClass("disabled"));if(i){var l=d("<span />");l.addClass("icon "+i);l.text(c);k.append(l)}l=d("<span/>");l.addClass("icon").addClass("icon-dropdown");k.append(l);g=d("<div/>").addClass("hidden").addClass("aui-dropdown");j&&g.append(j);f.append(k);f.append(g);a.append(f);return a[0]}},TextButton:function(a){var b=a.text,e=a.textClass,c=a.click,i=!!a.disabled,h=a.tooltip;this.render=function(){var a=d('<button type="button"></button>').addClass("aui-button").addClass(e).text(b);
h&&a.attr("data-tooltip",h);i&&a.prop("disabled",!0).attr("aria-disabled","true");a.click(function(){a.prop("disabled")||c()});return a[0]}},TextBox:function(a){var b=a.id,e=a.text,c=a.name,i=a.keydown,h=a.cssClass;this.render=function(){var a=d("<div></div>").addClass("toolbar-item");a.append(d("<label for='"+b+"'>"+e+"</label>"));var g=d("<input id='"+b+"' type='text' name='"+c+"' class='"+h+" text' autocomplete='off'>");g.keydown(function(a){i(a)});a.append(g);return a[0]}},Group:function(a,b){this.render=
function(){var e=d("<div></div>");e.addClass("aui-buttons");b&&(b.id&&e.attr("id",b.id),b.groupClass&&e.addClass(b.groupClass));for(var c=0,i=a.length;c<i;c++)e.append(a[c].render());return e[0]}},SplitGroup:function(a,b){function e(){var a=c.id,b=c.disabled,e=c.dropDownContent,g=c.title,m=c.alignment,f=d("<div></div>").addClass("toolbar-item").addClass("toolbar-dropdown").addClass("toolbar-splitbutton");a&&f.attr("id",a);g&&f.attr({"data-tooltip":g});m&&f.data("dropdown-alignment",m);a=d("<div/>").addClass("aui-dd-parent");
g=d("<a href='#'></a>");g.addClass("toolbar-trigger aui-dd-trigger");b&&(f.addClass("disabled"),g.addClass("disabled"));b=d("<span/>");b.addClass("icon").addClass("icon-dropdown");g.append(b);b=d("<div/>").addClass("hidden").addClass("aui-dropdown");e&&b.append(e);a.append(g);a.append(b);f.append(a);return f[0]}var c=b&&b.dropDownOptions||{};this.render=function(){var c=d("<div></div>");c.addClass("aui-buttons");b&&(b.id&&c.attr("id",b.id),b.groupClass&&c.addClass(b.groupClass));for(var h=0,j=a.length;h<
j;h++)c.append(a[h].render());c.append(e(b));b&&b.postProcess&&b.postProcess(c);return c[0]}}}});require("confluence/module-exporter").exportModuleAsGlobal("confluence-editor/tinymce3/plugins/customtoolbar/custom-toolbar-components","Confluence.Editor.Toolbar.Components");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/customtoolbar/table-toolbar.js' */
define("confluence-editor/tinymce3/plugins/customtoolbar/table-toolbar","ajs jquery tinymce document window confluence-editor/tinymce3/plugins/customtoolbar/custom-toolbar-components".split(" "),function(g,c,d,i,s,a){return{initContextToolbars:function(D,f){function q(a){var b=c(this),h=c("#table-highlight-group"),e=h.attr("data-highlight-colour"),d=h.attr("data-remove-highlight");if(e){h.removeClass("highlight-"+e);h.removeAttr("data-highlight-colour")}h.removeClass("remove-highlight");d&&h.removeAttr("data-remove-highlight");
if(e=b.attr("data-highlight-colour")){h.addClass("highlight-"+e);h.attr("data-highlight-colour",e)}if(b.attr("data-remove-highlight")){h.addClass("remove-highlight");h.attr("data-remove-highlight",true)}f.focus();f.execCommand("confTableSelectionToggleHighlight",false,{alwaysHighlight:true});a.preventDefault()}function u(){var a=c("<ul/>").addClass("table-mode-list"),k=[{name:b("table.responsive"),mceCmd:"mceAutoWidth",tooltip:b("table.responsive_tooltip")},{name:b("table.fixed_width"),mceCmd:"mceFixedWidth",
tooltip:b("table.fixed_width_tooltip")}];c.each(k,function(b,e){var k=c("<li/>").addClass("dropdown-item").attr("data-tooltip",e.tooltip),f=c("<a href='#'>"+e.name+"</a>").addClass("item-link");k.on("click",function(){d.execCommand(e.mceCmd,false,"")});a.append(k.append(f))});return a}var l=require("aui/templates"),o,b=function(c){var a=f.getLang(c);(c=f.getLang(c+"_shortcut",""))&&(a=a+(" ("+c+")"));return a},p=g.storageManager("atlassian.editor","tables"),m;require("aui/inline-dialog2");m=l.buttons.button({id:"table-more-settings-trigger",
text:"",iconType:"aui",iconClass:"aui-icon-small aui-iconfont-configure",iconText:b("table.table_more_heading"),extraAttributes:{type:"button","data-aui-trigger":"true","aria-controls":"table-more-settings","data-tooltip":b("table.table_more_heading")}});var v=l.inlineDialog2.inlineDialog2({alignment:"bottom left",respondsTo:"toggle",id:"table-more-settings"}),w=l.buttons.buttons({content:m});m=function(a){function d(a){var e=c("<div></div>"),t=c("<h2>"+b("table.table_more_heading")+"</h2>");e.append(t);
a.forEach(function(a){var b=c(l.form.field({type:"checkbox",id:a.id,labelContent:a.text,isChecked:a.isChecked(),isDisabled:a.isDisabled}));b.on("change",a.onChange);e.append(b)});return e}this.render=function(){var b=c(w),e=c(v),f=e[0],g=function(){f.open=false};e.on("aui-show",function(b){c(".aui-inline-dialog-contents",b.target).html(d(a))});b.append(e);c(s).on("resize",c.debounce(g,100));c(i).on("enableContextToolbarRow.Toolbar disableContextToolbarRow.Toolbar",g);return b}};f.onNodeChange.add(function(a,
b,d){a=c("body");a=!a.hasClass("no-tools")||a.hasClass("no-tools-toolbars-visible");if(!o&&d.parentNode!=null&&d.nodeName!=="BODY"){o=true;if(c(d).closest("table:not(.wysiwyg-macro)").length){c(i).trigger("createContextToolbarRow.Toolbar",{buttons:j.Buttons,topToolbar:true,animate:a}).trigger("enableContextToolbarRow.Toolbar");g.DarkFeatures.isEnabled("confluence.table.resizable")&&c.fn.updateTableModeInToolbar&&c(d).closest("table").updateTableModeInToolbar();d=c(d).closest("td,th");a=c(".mceSelected",
d.closest("table"));d.add(a).filter(function(){var a=c(this);return parseInt(a.attr("rowspan"),10)>1||parseInt(a.attr("colspan"),10)>1}).length>=1?f.plugins.customtoolbar.enableToolbarButton("aui-iconfont-table-split"):f.plugins.customtoolbar.disableToolbarButton("aui-iconfont-table-split")}else c(i).trigger("disableContextToolbarRow.Toolbar",{animate:a});o=false}});f.onUndo.add(function(a){a.nodeChanged()});f.onInit.add(function(){c(i).delegate("#table-highlight-colour .aui-dropdown a","click",q)});
f.onRemove.add(function(){c(i).undelegate("#table-highlight-colour .aui-dropdown a","click",q)});var n=new a.Group([new a.Button({text:b("table.row_before_desc"),iconClass:"aui-icon aui-icon-small aui-iconfont-table-row-up",click:function(){d.execCommand("mceTableInsertRowBefore",false,"")}}),new a.Button({text:b("table.row_after_desc"),iconClass:"aui-icon aui-icon-small aui-iconfont-table-row-down",click:function(){d.execCommand("mceTableInsertRowAfter",false,"")}}),new a.Button({text:b("table.delete_row_desc"),
iconClass:"aui-icon aui-icon-small aui-iconfont-table-row-remove",click:function(){d.execCommand("mceTableDeleteRow",false,"")}})]),p=new a.Group([new a.Button({text:b("table.cut_row_desc"),iconClass:"aui-icon aui-icon-small aui-iconfont-table-cut-row",click:function(){d.execCommand("mceTableCutRow",false,"");f.plugins.customtoolbar.enableToolbarButton("aui-iconfont-table-paste-row")}}),new a.Button({text:b("table.copy_row_desc"),iconClass:"aui-icon aui-icon-small aui-iconfont-table-copy-row",click:function(){d.execCommand("mceTableCopyRow",
false,"");f.plugins.customtoolbar.enableToolbarButton("aui-iconfont-table-paste-row")}}),new a.Button({text:b("table.paste_row_before_desc"),iconClass:"aui-icon aui-icon-small aui-iconfont-table-paste-row",click:function(){d.execCommand("mceTablePasteRowBefore",false,"")},disabled:!p.doesContain("copied")})]),x=new a.Group([new a.Button({text:b("table.col_before_desc"),iconClass:"aui-icon aui-icon-small aui-iconfont-table-col-left",click:function(){d.execCommand("mceTableInsertColBefore",false,"")}}),
new a.Button({text:b("table.col_after_desc"),iconClass:"aui-icon aui-icon-small aui-iconfont-table-col-right",click:function(){d.execCommand("mceTableInsertColAfter",false,"")}}),new a.Button({text:b("table.delete_col_desc"),iconClass:"aui-icon aui-icon-small aui-iconfont-table-col-remove",click:function(){d.execCommand("mceTableDeleteCol",false,"")}})]),y=new a.Group([new a.Button({text:b("table.merge_cells_desc"),iconClass:"aui-icon aui-icon-small aui-iconfont-table-merge",click:function(){d.execCommand("mceTableMergeCells",
false,"")}}),new a.Button({text:b("table.split_cells_desc"),iconClass:"aui-icon aui-icon-small aui-iconfont-table-split",click:function(){d.execCommand("mceTableSplitCells",false,"")}})]),z=new a.Group([new a.Button({text:b("table.row_highlight"),iconClass:"aui-icon aui-icon-small aui-iconfont-table-header-row",click:function(){d.execCommand("confTableRowToggleHeading",false);d.execCommand("mceTableUpdateNumberingCol",false)}}),new a.Button({text:b("table.col_highlight"),iconClass:"aui-icon aui-icon-small aui-iconfont-table-header-column",
click:function(){d.execCommand("confTableColumnToggleHeading",false)}})]),A=a.SplitGroup,B=[new a.Button({text:b("table.selection_highlight"),iconClass:"aui-icon aui-icon-small aui-iconfont-table-bg",click:function(){d.execCommand("confTableSelectionToggleHighlight",false)}})],r=c("<ul/>").addClass("table-highlight-picker"),C=[false,false,false,false,false,true];c.each(["grey","red","green","blue","yellow",""],function(a,b){var d=c("<li/>"),e=c("<a href='#'></a>");C[a]?e.addClass("remove-highlight").attr("data-remove-highlight",
true):e.addClass("highlight-"+b).attr("data-highlight-colour",b);d.append(e);r.append(d)});var j={Buttons:[n,p,x,y,z,new A(B,{id:"table-highlight-group",dropDownOptions:{id:"table-highlight-colour",dropDownContent:r,alignment:"right"},postProcess:function(a){a.attr("data-highlight-colour","grey");a.addClass("highlight-grey");var b=c("<span>&nbsp;</span>");b.addClass("highlight-indicator");a.find(".icon.aui-iconfont-table-bg").after(b)}}),new a.Group([new a.Button({text:b("table.del"),iconClass:"aui-icon aui-icon-small aui-iconfont-table-remove",
click:function(){d.execCommand("mceTableDelete",false,"")}})])],Events:[]};g.DarkFeatures.isEnabled("confluence.table.resizable")&&j.Buttons.splice(0,0,new a.Group([new a.DropDownButton({id:"table-mode-picker",text:b("table.auto_width"),dropDownContent:u()})]));g.DarkFeatures.isEnabled("confluence-table-enhancements.copy-cut-paste-cols.disabled")||j.Buttons.splice(3,0,new a.Group([new a.Button({text:b("table.col_cut_desc"),iconClass:"aui-icon aui-icon-small aui-iconfont-table-cut-column",click:function(){d.execCommand("mceTableCutCol",
false,"")}}),new a.Button({text:b("table.col_copy_desc"),iconClass:"aui-icon aui-icon-small aui-iconfont-table-copy-column",click:function(){d.execCommand("mceTableCopyCol",false,"")}}),new a.Button({text:b("table.col_paste_desc"),iconClass:"aui-icon aui-icon-small aui-iconfont-table-paste-column",click:function(){d.execCommand("mceTablePasteColBefore",false,"")}})]));if(!g.DarkFeatures.isEnabled("confluence-table-enhancements.auto-row.disabled")){n=[];g.DarkFeatures.isEnabled("confluence-table-enhancements.auto-row.disabled")||
n.push({text:b("table.numbering_column_desc"),id:"insert-numbering-column",isChecked:function(){return c(f.selection.getNode()).closest("table").find(".numberingColumn").length>0},onChange:function(){d.execCommand("mceTableInsertNumberingCol",false,"")}});j.Buttons.push(new m(n))}return j}}});
require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/customtoolbar/table-toolbar",function(g){var c=require("jquery"),d=require("document");c(d).bind("initContextToolbars.Toolbar",function(c,d){require("confluence/legacy-editor-global-AVOID-IF-POSSIBLE").tableToolbar=g.initContextToolbars(c,d)})});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/customtoolbar/editor_plugin_src.js' */
define("confluence-editor/tinymce3/plugins/customtoolbar/editor_plugin_src","jquery ajs confluence/legacy-editor-global-AVOID-IF-POSSIBLE document tinymce confluence/hint-manager".split(" "),function(b,g,n,o,u,x){function v(a){var c=function(){a&&a.hide()};b(o).bind("showLayer",function(b,d,f){if(d=="dropdown"&&f==a){b=g.Rte.getEditor();b.onClick.add(c);b.onKeyUp.add(c)}}).bind("hideLayer",function(b,d,f){if(d=="dropdown"&&f==a){b=g.Rte.getEditor();b.onClick.remove(c);b.onKeyUp.remove(c)}})}function w(b){b.addCallback("show",
function(){b.$.parents(".disabled").length&&b.hide()})}function y(a,c){var e=k(c);b("#"+e).removeClass("disabled")}function z(a,c){var e=k(c);b("#"+e).addClass("disabled")}function l(b,c){c?b.closest(".aui-button").prop("disabled",true).attr("aria-disabled","true").toggleClass("disabled",c):b.closest(".aui-button").prop("disabled",false).removeAttr("aria-disabled").toggleClass("disabled",c)}function q(a,c,e,d){var f=b("#toolbar"),h=f.find(".toolbar-item"),r=b("#insert-menu, #more-menu"),i=b("#insert-menu, #color-picker-control"),
j=b("#format-dropdown"),d=d||function(){return true};h.toggleClass("disabled",a);r.toggleClass("disabled",a);i.toggleClass("disabled",a);j.toggleClass("disabled",!!c);g.Rte.TablePicker[a?"disable":"enable"]();typeof e!=="undefined"&&f.find("button, input").filter(d).toggleClass("disabled",e).prop("disabled",e)}function k(b){var c="default";if(b&&b.id)c=b.id;return"rte-toolbar-row-"+c}function A(a,c){var e=c.animate;e==void 0&&(e=true);var d=function(){b(this).remove();b(o).trigger("resize.resizeplugin");
if(c.onHide)c.onHide()};clearTimeout(m);m=setTimeout(function(){var a=k(c),a=b("#"+a);if(e)a.slideUp(400,d);else{a.hide();d.call(a)}},100)}function B(a,c){var e=k(c),d=c.animate;d==void 0&&(d=true);if(b("#"+e).length>0)b("#"+e+":hidden").slideDown(400,function(){g.debug("Prevented toolbar deferred display race condition")});else{var f=b("<div></div>").addClass("toolbar-split toolbar-split-row toolbar-contextual");f.attr("id",e);c.editorAdjacent&&f.addClass("editor-adjacent");for(var e=!c.topToolbar?
b("#savebar-container .aui-toolbar:visible"):b("#rte-toolbar.aui-toolbar:visible"),h=0,r=c.buttons.length;h<r;h++)f.append(c.buttons[h].render());f.css({display:"none"});if(c.editorAdjacent)e.append(f);else{h=b(".editor-adjacent",e).filter(":first");h.length?h.before(f):e.append(f)}f.find(".toolbar-dropdown").each(function(){j(this)});var i=function(){b(o).trigger("resize.resizeplugin").trigger("shown.contextToolbar");if(c.onVisible)c.onVisible()};clearTimeout(m);m=setTimeout(function(){if(d)f.slideDown(400,
i);else{f.show();i()}},100)}}function j(a){var a=b(a),c=a.dropDown("Standard",{alignment:a.data("dropdown-alignment")||"left"})[0];a.find(".dropdown-item").click(function(a){var d=b(this),f=d.attr("data-macro-name"),h=d.attr("data-command"),j=d.attr("data-format"),d=d.attr("data-control-id"),i=g.Rte.getEditor();f&&u.confluence.macrobrowser.macroBrowserToolbarButtonClicked({presetMacroName:f});h&&i.execCommand(h,false);j&&i.theme.controlHandlers.formatselect.click.dispatch(j);d&&i.theme.controlHandlers.buttons.click.dispatch(d);
c.hide();a.preventDefault()});w(c);v(c)}var m;return{init:function(a){j("#format-dropdown");j("#more-menu .aui-dd-parent");j("#insert-menu .aui-dd-parent");b("#pagelayout-menu").length&&j("#pagelayout-menu .aui-dd-parent");b("#template-menu").length&&j("#template-menu .aui-dd-parent");var c=b("#color-picker-control");if(c.length){var e=c.find(".aui-dd-parent"),d=b("#rte-button-color"),f=d.find(".selected-color"),e=e.dropDown("Standard",{alignment:"left"})[0],h=d.attr("data-color");f.css("background-color",
"#"+h);c.delegate("a[data-color]","click",function(a){var c=b(this),e=c.attr("data-color");a.preventDefault();if(!c.closest(".disabled").length){u.execCommand("ForeColor",false,"#"+e);d.attr("data-color",e);f.css("background-color","#"+e)}});w(e);v(e)}g.Rte.TablePicker.bindToControl(g.Rte.getEditor(),b("#insert-table-dropdown"));var k=b("#rte-button-source-mode");k.click(function(){k.hasClass("active")?n.changeMode(n.MODE_RICHTEXT):n.changeMode(n.MODE_SOURCE)});var c=require("confluence-editor/i18n/translations.i18n"),
e=[],i;for(i in c.hints)e.push("hints."+i);var m=x(e),l=function(){b("#rte-savebar .hints-text").html(g.Rte.getEditor().getLang(m.getNextHint()))};l();b("#rte-savebar a.hints-close").click(function(a){b(this).closest(".toolbar-split").addClass("hidden");a.preventDefault()});b("#rte-savebar a.hints-next").click(function(b){l();b.preventDefault()});i=g.Rte.EventDelegator(a);b(o).trigger("initContextToolbars.Toolbar",a);b(o).bind("createContextToolbarRow.Toolbar",B).bind("removeContextToolbarRow.Toolbar",
A).bind("enableContextToolbarRow.Toolbar",y).bind("disableContextToolbarRow.Toolbar",z);i.addEventsForComponent("TableToolbar",n.tableToolbar.Events);var p=b("#format-dropdown"),s=p.find("span.dropdown-text");a.onBeforeExecCommand.add(function(a,c,e,d,f){b.each(["pre","blockquote"],function(){if(c=="FormatBlock"&&d==this){a.formatter.remove("alignleft");a.formatter.remove("aligncenter");a.formatter.remove("alignright")}});if(b(a.selection.getNode()).closest("pre,.text-placeholder").length)for(var e=
["Bold","Italic","Underline","Strikethrough","InsertUnorderedList","InsertOrderedList","InsertInlineTaskList","InsertInlineTaskListNoToggle","superscript","subscript","mceConfMacroBrowser","mceConfimage","mceConfAttachments","mceEmotion","InsertWikiMarkup","mceConflink","mceInsertTable","mceConfAutocompleteLink"],h=e.length,t=0;t<h;t++)if(c==e[t])f.terminate=true;if(c=="FormatBlock"&&d=="pre"){a.undoManager.add();a.execCommand("removeFormat")}if(c=="FormatBlock"&&d=="p"){e=p.find(".dropdown-item[data-format='blockquote']").text();
if(s.text()==e){f.terminate=true;a.execCommand("FormatBlock",false,"blockquote")}}else if(c=="FormatBlock"&&d=="removeformat"&&a.selection.isCollapsed()){f.terminate=true;g.debug("Not removing format for no selected text")}});a.onExecCommand.add(function(b,a,c,e){if(a=="FormatBlock"){b=p.find(".dropdown-item[data-format='"+e+"']");b.length||(b=p.find(".dropdown-item[data-format='p']"));s.text(b.text())}});a.onNodeChange.add(function(a,c,e){var d,f=e,f=b(f).closest("PRE,BLOCKQUOTE,.text-placeholder");
d=function(b){return f.is(b)};var a=d("BLOCKQUOTE"),g=d("PRE");d=d(".text-placeholder");if(g){c=b(e).parents("table").is("[data-macro-body-type='PLAIN_TEXT']");q(true,c)}else if(d)q(true);else if(a){c.setDisabled("justifyleft",a);c.setDisabled("justifycenter",a);c.setDisabled("justifyright",a)}else q(false)});a.onInit.add(function(a){g.debug("customtoolbar: ed.onInit function");var c={};b(".aui-toolbar").find("[data-control-id]").each(function(e,d){var f,d=b(d);d.closest(".toolbar-item");f=d.attr("data-control-id");
if(f=="formatselect"){f=a.theme.controlHandlers[f];f.state.add(function(a){var c=g.Rte.getEditor();if(a=="p"){c=c.selection.getNode();b(c).closest("p").parent().is("blockquote")&&(a="blockquote")}(a=p.find(".dropdown-item[data-format='"+a+"']").text())&&s.text(a)})}else c[f]=d});var e=a.theme.controlHandlers.buttons;e.state.add(function(a,b,e){var d=c[a];if(d){a=d.find(".icon-check");d=d.closest(".toolbar-item");a.length?a.toggleClass("hidden",!e):d.toggleClass(b,e)}});b(".aui-toolbar").delegate(".toolbar-item",
"click",function(a){var c=b(this);if(c.hasClass("disabled"))a.preventDefault();else if(c=c.children(".toolbar-trigger[data-control-id]").attr("data-control-id")){e.click.dispatch(c);a.preventDefault()}});b.support.shrinkWrapBlocks=false;g.debug("customtoolbar: finished ed.onInit function")})},toggleToolbarButton:l,disableToolbarButton:function(a){l(b("."+a.replace(".","")),true)},enableToolbarButton:function(a){l(b("."+a.replace(".","")),false)},focusToolbarButton:function(a){b("."+a.replace(".",
"")).closest(".aui-button").focus()},isToolbarRowEnabled:function(a){a=k({id:a});return b("#"+a).length>0&&!b("#"+a).hasClass("disabled")},getToolbarRow:function(a){a=k({id:a});a=b("#"+a);return a.length?a[0]:null},isToolbarButtonEnabled:function(a){return!b("."+a.replace(".","")).closest(".aui-button").prop("disabled")},bindDropdownMenu:j,toggleToolbarButtons:q,getInfo:function(){return{longname:"customtoolbar",author:"Atlassian",authorurl:"http://www.atlassian.com",infourl:"http://www.atlassian.com/",
version:"1.0"}}}});require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/customtoolbar/editor_plugin_src",function(b){var g=require("tinymce");g.create("tinymce.plugins.customtoolbar",b);g.PluginManager.add("customtoolbar",g.plugins.customtoolbar)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/customtoolbar/thirdpartycode/tipsy.js' */
(function(a){a.fn.tipsy.autoBounds2=function(f,b){return function(){var d,c,g=a(document).scrollTop()+f,h=a(document).scrollLeft()+f,e=a(this);1<b.length?(d=b[0],c=b[1]):"e"==b[0]||"w"==b[0]?c=b[0]:d=b[0];e.offset().top<g&&(d="n");e.offset().left<h&&(c="w");a(window).width()+a(document).scrollLeft()-(e.offset().left+e.width())<f&&(c="e");a(window).height()+a(document).scrollTop()-(e.offset().top+e.height())<f&&(d="s");return d?d+(c?c:""):c}}})($);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/customtoolbar/chunky-tips.js' */
define("confluence-editor/tinymce3/plugins/customtoolbar/chunky-tips",["ajs","tinymce","jquery"],function(b,j,a){return function(){function h(b,d,c){if("dropdown"===d&&(a(".tipsy").remove(),c&&(c.trigger&&c.trigger.jquery)&&(b=c.trigger.data("tipsy"))))b.hoverState="out"}function i(){a(".tipsy").remove()}b.debug("Enabling Chunky Tooltip for the editor");var e={live:!0,gravity:"n",title:function(){return a(this).attr("data-tooltip")||""},delayIn:250,delayOut:0},f=a.fn.tipsy.autoBounds2(50,"n"),g=a.fn.tipsy.autoBounds2(50,
"s"),k=a.fn.tipsy.autoBounds2(50,"w"),f=a.extend({},e,{gravity:f});a.extend({},e,{gravity:g});g=a.extend({},e,{gravity:k});e=a.extend({},e,{gravity:"se"});a("#rte-toolbar [data-tooltip]:not(.dropdown-item)").tooltip(f);a("#rte-toolbar .dropdown-item[data-tooltip]").tooltip(g);a("#rte-savebar [data-tooltip]").tooltip(e);a("#editor-precursor [data-tooltip]").tooltip(f);a("#property-panel [data-tooltip]").tooltip(f);a(document).bind("showLayer",h);a(document).bind("hideLayer",h);b.bind("created.property-panel",
i);b.bind("destroyed.property-panel",i);var l=/\+/g;b.bind("register-contexts.keyboardshortcuts",function(){setTimeout(function(){a("#rte-savebar .aui-button[title]").each(function(){var b=a(this),d=b.attr("title");b.removeAttr("title");if(j.isMac){var c=d.indexOf("(");0<=c&&(d=d.substr(0,c)+d.substr(c).replace(l,""))}b.attr("data-tooltip",d)})},0)})}});
require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/customtoolbar/chunky-tips",function(b){require("ajs").bind("init.rte",b)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/confluencepaste/linkify.js' */
define("confluence-editor/tinymce3/plugins/confluencepaste/linkify",function(){return{RE_EMAIL_PATTERN:"(?:\\s|\\A|^)[\\w.-]+\\+*[\\w.-]+@(?:(?:[\\w-]+\\.)+[A-Za-z]{2,6}|(?:\\d{1,3}\\.){3}\\d{1,3})",RE_URL_SCHEME:"(?:[\\w-]{2,}):/{1,3}",RE_TLD:"(?:aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|travel|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|fi|fj|fk|fm|fo|fr|ga|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|si|sj|sk|sl|sm|sn|so|sr|st|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)",
RE_URL_MIDCHAR:"(?:[^\\s()]+|\\((\\S+)\\))",RE_URL_ENDCHAR:"(?:\\((\\S+)\\)|[^\\s`!()\\[\\]{};:'\".,<>?\u00ab\u00bb\u201c\u201d\u2018\u2019])",init:function(){this.RE_URL_ENDING||(this.RE_URL_ENDING="(?:"+this.RE_URL_MIDCHAR+"*"+this.RE_URL_ENDCHAR+")?",this.RE_FULL_URL=this.RE_URL_SCHEME+"\\w+(?:.\\w+)"+this.RE_URL_ENDING,this.RE_OTHER_URL="\\w[\\w_-]*(?:\\.\\w[\\w_-]*)*\\."+this.RE_TLD+"(?:[\\/\\?#]"+this.RE_URL_ENDING+"|\\b)")},linkify:function(f,b,i){this.init();f=this.match_and_replace(this.RE_EMAIL_PATTERN,
f,!0,!1,b,i);f=this.match_and_replace(this.RE_FULL_URL,f,!1,!1,b,i);return f=this.match_and_replace(this.RE_OTHER_URL,f,!1,!0,b,i)},match_and_replace:function(f,b,i,o,k,h){for(var c=0,a=0,d=0,c=0,l=/<\/[aA]>/,f=RegExp(f,"g"),p=h.hasOwnProperty("add_wbrs")?h.add_wbrs:null,j=h.hasOwnProperty("truncate_length")?h.truncate_length:100,m=h.hasOwnProperty("link_target")?h.link_target:"_blank",h=h.hasOwnProperty("link_titles")?h.link_titles:null,d={},n=0;d=f.exec(b);){n++;if(20<n)break;c=d.index;d=d[0].length;
if(0<=b.substring(a,c).search(/<[aA]/)){l.lastIndex=a;c=b.substring(a,b.length).search(l);if(0>c)break;c+=a;f.lastIndex=c+4;a=c+4}else{var a=b.substr(c,d),g=a.search(/&(amp|gt|lt)$/);if(0<g&&b.length>c+d&&";"==b[c+d]){d-=a.length-g;for(a=b.substr(c,d);!a.match(this.RE_URL_ENDCHAR+"$")&&0<d;)d--,a=b.substr(c,d)}g=a;o&&(g="http://"+g);var e="<a";m&&(e+=' target="'+m+'"');e+=' href="';i&&(e+="mailto:");g=g.replace(/"/g,"%22");e+=g+'"';h&&(e+=' title="'+(i?"Email "+g:g)+'"');j&&a.length>j&&(a=a.substr(0,
j)+"...");p&&(a=a.replace(RegExp("([/=])","g"),"<wbr>$1"));e+=">"+a+"</a>";k&&k.push(g);b=b.slice(0,c)+e+b.slice(c+d,b.length);f.lastIndex=c+e.length;a=c+e.length}}return b}}});require("confluence/module-exporter").exportModuleAsGlobal("confluence-editor/tinymce3/plugins/confluencepaste/linkify","linkify");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/confluencepaste/post-paste-node-filter.js' */
define("confluence-editor/tinymce3/plugins/confluencepaste/post-paste-node-filter",["jquery","confluence-editor/tinymce3/plugins/confluencepaste/linkify","ajs","document","tinymce"],function(c,q,r,y,z){function u(a,b){for(var f=c(a).find("["+b+"]"),d="",e="",g="",h=0,k=f.length;h<k;h++)e=(d=c(f[h]))&&["/",d.attr(b)].join(""),g=d&&["/",d.attr("data-mce-"+b)].join(""),r.contextPath()&&0===e.indexOf(r.contextPath())&&(f[h]=d.attr(b,e)),r.contextPath()&&0===g.indexOf(r.contextPath())&&(f[h]=d.attr("data-mce-"+
b,g));return f}function m(a,b,f){var a=c(a).find("["+b+"]"),d="",e,g;if(a)for(var h=0,k=a.length;h<k;h++){e=c(a[h]);g=f.standard;for(var n in f)if(f.hasOwnProperty(n)&&e.is(n)){g=f[n];break}if(-1<b.indexOf("style")){var d=e,i=g;g=[];for(var o="",o=void 0,p=d.attr("style"),l=d.attr("data-mce-style"),j=0,m=i.length;j<m;j++)p&&-1<p.toLowerCase().indexOf(i[j])?g.push(i[j]+": "+d.css(i[j])+";"):l&&-1<l.toLowerCase().indexOf(i[j])&&(o=RegExp(i[j]+":.+?(?:;|$)"),o=l.match(o),g.push(-1<o[0].indexOf(";")?
o:o+";"));d=g.join(" ")}else{d=e;i=b;p=[];if(g){l=0;for(j=g.length;l<j;l++)d.is("["+i+"~="+g[l]+"]")&&p.push(g[l])}d=p.join(" ")}e.removeAttr(b);d.length&&e.attr(b,d)}}function A(a,b){function f(f){var e;d.index&&(e=a.splitText(d.index),a&&b.push(a),a=e);(e=a.splitText(d[0].length))&&b.push(e);c(a).wrap("<a href='"+f+a.data+"'></a>")}var d,e,g;e=s.exec(a.data);g=t.exec(a.data);e?(d=e,f("mailto:")):g&&(e=(d=g)&&-1===d[0].indexOf("://")?"http://":"",f(e))}var t;q.init();var v=RegExp(q.RE_FULL_URL),
w=RegExp(q.RE_OTHER_URL);t={exec:function(a){var b=v.exec(a);return b?b:w.exec(a)},test:function(a){return v.test(a)||w.test(a)}};var s,x=RegExp(q.RE_EMAIL_PATTERN);s={exec:function(a){if((a=x.exec(a))&&/\s/.test(a[0][0]))a[0]=a[0].replace(/\s/,""),a.index++;return a},test:function(a){return x.test(a)}};c(y).bind("postPaste",function(a,b,f){a=f.node;b={standard:["text-decoration","text-align","margin-left"],".wysiwyg-macro":["background-image"],p:["margin-left","text-align"],span:["color","text-decoration"],
pre:["margin-left"]};b.td=b.th=["text-align"];b.li=["list-style-type","background-image"];b.col=["width"];b["table.confluenceTable.relative-table"]=["width"];m(a,"style",b);m(a,"data-mce-style",b);c.browser.mozilla&&(u(a,"src"),u(a,"href"));m(a,"face",{standard:[]});m(a,"id",{standard:[]});m(a,"data-mce-href",{standard:[]});a=f.node;b=[];b.push({elements:["div"],attribute:"class",blackValue:"aui-buttons"});for(var d=0;d<b.length;d++)for(var e=b[d],g=0;g<e.elements.length;g++)for(var h=c(a).find(e.elements[g]+
"["+e.attribute+"]"),k=0;k<h.length;k++){var n=h.eq(k).attr(e.attribute),n=n.replace(e.blackValue,"");h.eq(k).attr(e.attribute,n)}var i=f.node;c.each(".contentLayout .contentLayout2 .columnLayout .header .footer .cell .innerCell .panelContent .panel .panelHeader .Apple-converted-space font .jira-status .jira-issue .diff-html-removed .diff-html-added .diff-html-changed".split(" "),function(a,b){c(b,i).contents().unwrap()});c("img",i).map(function(){c(this).attr("data-attachment-copy","");!c(this).attr("src")&&
c(this).remove()});c("dl",i).map(function(){c(this).replaceWith(c("<p/>").text(c(this).text()))});c("a",i).map(function(){c(this).removeClass("confluence-userlink userLogoLink")});if(!c.browser.msie)for(a=c.makeArray(f.node.childNodes);a.length;)b=a.pop(),c(b).is("a")||(3===b.nodeType?A(b,a):1===b.nodeType&&(b.childNodes&&"pre"!==b.nodeName.toLowerCase())&&(a=a.concat(c.makeArray(b.childNodes))));if(a=c.browser.mozilla)a=c(f.node),a=a.children("br").length&&!a.find(":not(br)").length&&!c(z.activeEditor.selection.getStart()).closest("[data-macro-body-type='PLAIN_TEXT']").length;
a&&(f=c(f.node),a="<p>"+f.html().replace(/<br>/gi,"</p><p>")+"</p>",f.html(a))});return{URL:t,EMAIL:s}});require("confluence/module-exporter").exportModuleAsGlobal("confluence-editor/tinymce3/plugins/confluencepaste/post-paste-node-filter","Confluence.Editor.regex");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/confluencepastetable/editor_plugin_src.js' */
define("confluence-editor/tinymce3/plugins/confluencepastetable/editor_plugin_src",["jquery","document"],function(g,c){return{init:function(i){function m(a){var d={id:!0,"class":!0,style:!0,rowspan:!0,colspan:!0,"data-mce-style":!0,"data-mce-bogus":!0,"data-macro-name":!0,"data-macro-parameters":!0,"data-macro-body-type":!0,"data-highlight-colour":!0,"data-highlight-class":!0},f=["highlight","nohighlight","relative-table","fixed-table"],b,e=0,c=[],h=g(a);if(!a||j(a))return a;a&&a.getAttribute&&(b=
a.getAttribute("class"));if(b&&0<=b.indexOf("table-wrap"))if(a=g("table",a),a.length)g(a).unwrap(),a=a[0];else return null;if((!a.tagName?0:"TABLE"===a.tagName||"TR"===a.tagName||"TH"===a.tagName||"TD"===a.tagName||"TBODY"===a.tagName||"THEAD"===a.tagName||"TFOOT"===a.tagName||"COL"===a.tagName||"COLGROUP"===a.tagName||"CAPTION"===a.tagName)&&a.attributes){for(;e<=a.attributes.length;)(b=a.attributes[e])&&!0===b.specified&&!(b.name in d)?a.removeAttribute(b.name):e++;k(a)&&c.push(k(a));d=0;for(e=
f.length;d<e;d++)f[d].exec||h.hasClass(f[d])&&c.push(f[d]);(f=h.attr("data-highlight-class"))&&c.push(f);(f=h.attr("data-highlight-colour"))&&c.push("highlight-"+f);h.attr("class",c.join(" "))}return a}function k(a){return!a.tagName?"":"TABLE"===a.tagName?"confluenceTable":"TH"===a.tagName?"confluenceTh":"TD"===a.tagName?"confluenceTd":""}function j(a){var d="";a&&a.getAttribute&&(d=a.getAttribute("class"));return!a.tagName?!1:"TABLE"!==a.tagName?!1:!d?!1:-1!==d.indexOf("wysiwyg-macro")}function l(a,
d,c){for(var a=c.node,d=m,b=a,e="";b;)if("function"===typeof d&&(b=d(b)),b)b.firstChild&&e.parentNode!==b&&!j(b)?(e=b,b=b.firstChild):b.nextSibling?(e=b,b=b.nextSibling):(e=b,b=b.parentNode);else break;c.node=a}i.onInit.add(function(){g(c).bind("postPaste",l)});i.onRemove.add(function(){g(c).unbind("postPaste",l)})},getInfo:function(){return{longname:"ConfluencePasteTablePlugin",author:"Atlassian",authorurl:"http://www.atlassian.com",infourl:"http://www.atlassian.com",version:"1.0"}}}});
require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/confluencepastetable/editor_plugin_src",function(g){var c=require("tinymce");c.create("tinymce.plugins.ConfluencePasteTablePlugin",g);c.PluginManager.add("confluencepastetableplugin",c.plugins.ConfluencePasteTablePlugin)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/confluencepastemacro/editor_plugin_src.js' */
define("confluence-editor/tinymce3/plugins/confluencepastemacro/editor_plugin_src",["jquery","document","tinymce"],function(f,a,g){return{init:function(e){var c=this,b=function(b,d,a){d=e.getDoc();f(e.selection.getStart()).closest("[data-macro-body-type='PLAIN_TEXT']").length&&(c.bindPostSerializeHandler(e),b=c.parseHtml(e,a.node),d=d.createElement("div"),d.appendChild(b),a.node=d)};e.onInit.add(function(){f(a).bind("postPaste",b)});e.onRemove.add(function(){f(a).unbind("postPaste",b)})},bindPostSerializeHandler:function(e){function c(e,
d){d.content=d.content.replace(/^<pre>|<\/pre>$/g,"");b.remove(c)}var b=e.serializer.onPostProcess;b.add(c)},parseHtml:function(e,c){for(var b=f.makeArray(c.childNodes),a,d=e.getDoc(),h=d.createElement("pre");b.length;)a=b.shift(),a.childNodes.length?(g.html.Schema.blockElementsMap[a.nodeName]&&b.unshift(d.createElement("br")),b=f.makeArray(a.childNodes).concat(b)):(a=this.formatMacroContent(a,d))&&h.appendChild(a);return h},formatMacroContent:function(a,c){var b,g=/\xA0/g,c=c||window.document;3===
a.nodeType?b=c.createTextNode(f(a).text().replace(g," ")):"BR"===a.nodeName&&(b=c.createElement("br"));return b},getInfo:function(){return{longname:"ConfluencePasteMacroPlugin",author:"Atlassian",authorurl:"http://www.atlassian.com",infourl:"http://www.atlassian.com",version:"1.0"}}}});
require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/confluencepastemacro/editor_plugin_src",function(f){var a=require("tinymce");a.create("tinymce.plugins.ConfluencePasteMacroPlugin",f);a.PluginManager.add("confluencepastemacroplugin",a.plugins.ConfluencePasteMacroPlugin)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/confcursortarget/editor_plugin_src.js' */
define("confluence-editor/tinymce3/plugins/confcursortarget/editor_plugin_src",["jquery","ajs","tinymce","confluence/meta"],function(d,f,i,s){var k=".wysiwyg-macro,.placeholder,table";return{cursorTarget:{addFixSelector:function(d){k+=","+d}},cursorTargetPlugin:{init:function(e){function n(a,b){d(k,a).each(function(a,l){var f=function(a){if(0===a.length)throw Error("no paragraph element specified");y()&&a.addClass("auto-cursor-target");a=a[0];0===a.childNodes.length&&(a.innerHTML="<br />");return a},
e=function(a,b){var c=d("<p/>");if(d(a.parentNode).is("li, td, th"))for(;a[b]&&!d(a[b]).is(u);)c["previousSibling"==b?"prepend":"append"](a[b]);return f(c)},h=d(l);(!h.prev().length||h.prev(k).length||d(l.parentNode).is("li, td, th")&&!d(l.previousSibling).is(u))&&h.before(e(l,"previousSibling"));(!h.next().length||h.next(".synchrony-container").length||d(l.parentNode).is("li, td, th")&&!d(l.nextSibling).is(u))&&h.after(e(l,"nextSibling"));y()&&h.next().length&&(!h.next().next().length&&o(h.next()[0]))&&
h.next().addClass("auto-cursor-target");if(b){var e=function(a){("BR"===a[0].nodeName||o(a[0]))&&a.replaceWith(f(d("<p/>")))},g=h.prev(),j;if(j=g.length)a:{for(j=g.prev();j.length&&!j.is(k);){var i=j[0];if("BR"!==i.nodeName&&"P"!==i.nodeName){j=!1;break a}j=j.prev()}j=!0}j&&e(g);h=h.next();if(g=h.length)a:{for(g=h.next();g.length&&!g.is(k);){j=g[0];if("BR"!==j.nodeName&&"P"!==j.nodeName){g=!1;break a}g=g.next()}g=!0}g&&e(h)}})}function y(){return s.getBoolean("shared-drafts")&&"limited"!==s.get("edit-mode")&&
("page"===s.get("content-type")||"blogpost"===s.get("content-type"))}function z(a){d("p",a).each(function(a,c){o(c)&&p(c)&&d(c).attr("data-tag","marked-for-deletion")});d("p[data-tag=marked-for-deletion]",a).remove();return a}function o(a){function b(a){for(var b=0,d=0,e=0,f=a.childNodes.length;e<f;e++){var g=a.childNodes[e];if("BR"===g.nodeName){if(1<++b)return!1}else if(/^[\s|\u00A0]$/.test(g.nodeValue)){if(1<++d)return!1}else if(""!==g.nodeValue)return!1}return!0}return 1===a.nodeType&&0===a.childNodes.length||
b(a)}function p(a){if(!a||1!==a.nodeType)return!1;var b=q(a,!1),c=q(a,!0),a=t(b)||d(b).is(k),e=t(c)||d(c).is(k),b=t(b)&&t(c);return a&&e&&!b}function t(a){return a?a.className&&/cell|header|footer/.test(a.className):!0}function q(a,b){var c=d(a);do{var e=b?c[0].nextSibling:c[0].previousSibling;if(e)return e;c=c.parent()}while(0<c.length&&!c.is(".cell, .mceContentBody, td, li"));return null}function v(a){var b=a.startContainer;return 3===b.nodeType?!(b.previousSibling&&(3===b.previousSibling.nodeType||
d(b.previousSibling).is("br")))&&0===a.startOffset:1===b.nodeType?0===a.startOffset:!1}function A(a){var a=d(a).children(),b;for(b=0;b<a.length;b++)if(!o(a[b])&&(d(a[b]).contents().filter(function(){return 3===this.nodeType}).length||A(a[b])))return!0;return!1}function w(a,b){var c;if(c=b.startContainer==b.endContainer)if(c=1===b.startContainer.nodeType)c=b.startOffset,a||c--,c=0<=c&&c<b.startContainer.childNodes.length&&"TABLE"===b.startContainer.childNodes[c].nodeName;return c}function B(a){if(!a.collapsed)return!1;
var b=a.startContainer,c;if(3===b.nodeType)return c=q(b,!0),a.startOffset==b.nodeValue.length&&(null==c||d(c).is("br"));if(1===b.nodeType){if(d(b).is("td, th")&&0===a.startOffset&&0<b.childNodes.length)return d(b.childNodes[0]).is("br");c=q(b.parentNode.childNodes[0===a.startOffset?0:a.startOffset-1],!0);return null==c||d(c).is("br")}return!1}function C(a){return a&&1===a.childNodes.length&&d(a.childNodes[0]).is("br")}function D(a,b){return i.isWebKit&&w(!1,b)||i.isGecko&&(B(b)||p(a)&&0===b.startOffset&&
C(a))?!0:!1}function E(a,b){var c;if(c=i.isWebKit)if(!(c=w(!0,b)))if(!(c=v(b)&&p(a)))c=e.getBody(),c=c.childNodes.length?b.collapsed&&0===b.startOffset&&c.childNodes[0]==b.startContainer:!1;return c||i.isGecko&&v(b)&&p(a)&&C(a)?!0:!1}function x(a,b){var c=b.keyCode;if(c!==m.BACKSPACE&&c!==m.DELETE)return!0;a.selection.isCollapsed()?c===m.BACKSPACE&&E(a.selection.getNode(),a.selection.getRng(F))?i.dom.Event.prevent(b):c===m.DELETE&&D(a.selection.getNode(),a.selection.getRng(F))&&i.dom.Event.prevent(b):
n(a.getBody());return!0}var F=!0,u="ol, ul, p, pre, table, blockquote, div, h1, h2, h3, h4, h5, h6",m=d.ui.keyCode,r=function(){n(e.getBody(),!0)},G=function(a){n(a,!1);i.isIE10&&d("p, td.confluenceTd, th.confluenceTh",a).each(function(a,c){c&&""===c.innerHTML&&d(c).html("<br />")})};f.Meta.get("shared-drafts")&&("page"===f.Meta.get("content-type")||"blog"===f.Meta.get("content-type"))&&"collaborative"===f.Meta.get("edit-mode")?f.bind("cursor-target-refresh",function(){G(e.getBody())}):(e.onSetContent.add(function(a){n(a.getBody());
var a=a.getBody(),b=i.isIE?"&nbsp;":"<br/>";d("p, td.confluenceTd, th.confluenceTh",a).each(function(a,e){e&&(e.childNodes&&1===e.childNodes.length&&3===e.childNodes[0].nodeType&&e.childNodes[0].nodeValue&&1===e.childNodes[0].nodeValue.length&&160===e.childNodes[0].nodeValue.charCodeAt(0))&&d(e).html(b)})}),e.onGetContent.add(function(a,b){var c=z(d("<div class='root-node'>"+b.content+"</div>")),c=f.Rte.getEditor().serializer.serialize(c[0],b);b.content=c.substring(23,c.length-6)}),e.onInit.add(function(){e.selection.onSetContent.add(r);
e.dom.bind(e.getBody(),"cut",r);f.bind("cursor-target-refresh",r)}),e.onRemove.add(function(){f.unbind("cursor-target-refresh",r)}),i.isGecko&&e.onKeyDown.add(function(a,b){(b.keyCode===m.ENTER||b.keyCode===m.BACKSPACE||b.keyCode===m.DELETE)&&a.selection.normalize()}),e.onKeyDown.add(x),e.onKeyUp.add(x),i.isGecko&&e.onKeyPress.add(x),e.onPaste.add(r));d.extend(this,{isCursorBeforeAfterTable:w,isCursorTarget:p,_isTextContainerEmpty:o,_processCursorTargets:z,_isCursorAtStartOfContainer:v,_isCursorAtEndOfContainer:function(a){var b=
a.startContainer;if(b.nodeType===3)return!(b.nextSibling&&(b.nextSibling.nodeType===3||d(b.nextSibling).is("br")))&&a.endOffset==b.nodeValue.length;if(b.nodeType===1){var c=b.childNodes[a.startOffset];return d(c).is("br")&&c.nextSibling==null?true:a.endOffset==b.childNodes.length}return false},_getSiblingWithinBlockDisregardingNesting:q,_doesContainerHaveNestedContent:A,_addCursorTargetParagraphsToContent:n,_isCursorAtEndOfBottomRightCellInTable:B,_shouldCancelDelete:D,_shouldCancelBackspace:E,_collabEditingCursorTargetRefresh:G});
f.Rte.Cursor=f.Rte.Cursor||{};d.extend(f.Rte.Cursor,{isTextContainerEmpty:o,fixCursorTargets:n})},getInfo:function(){return{longname:"Cursor Target plugin",author:"Atlassian",authorurl:"http://www.atlassian.com",version:"1.0"}}}}});
require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/confcursortarget/editor_plugin_src",function(d){require("confluence/module-exporter").namespace("AJS.Rte.CursorTarget",d.cursorTarget);var f=require("tinymce");f.create("tinymce.plugins.CursorTargetPlugin",d.cursorTargetPlugin);f.PluginManager.add("cursorTarget",f.plugins.CursorTargetPlugin)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/confcleanup/editor_plugin_src.js' */
define("confluence-editor/tinymce3/plugins/confcleanup/editor_plugin_src",["tinymce","jquery"],function(d,f){return{init:function(g){if(d.isWebKit){var h={},i=function(a,c){var b=a[c];b||(b={},a[c]=b);return b};f("#format-dropdown").find("ul.aui-dropdown li").each(function(){var a=f("a",this),c=a.css("font-size"),b=a.css("font-weight"),a=a.css("color"),a=i(h,a),b=i(a,b);b[c]||(b[c]=f(this).attr("data-format"))});g.onNodeChange.add(function(a){for(var c=a.dom.select("span.Apple-style-span",a.dom.doc.body),
b=a.dom.select("font.Apple-style-span",a.dom.doc.body),c=c.concat(b),b=0,k=c.length;b<k&&!a.dom.is(c[b],'[face="mceinline"]');b++){var e;a:{e=f(c[b]);var d=h[e.css("color")],g=void 0;if(d&&(g=d[e.css("font-weight")])){e=g[e.css("font-size")];break a}e=null}e&&(d=a.selection.getBookmark(),e&&a.dom.remove(c[b],1),a.selection.moveToBookmark(d),a.execCommand("FormatBlock",!1,e))}})}g.onNodeChange.add(function(a){for(var c=a.dom.select("img",a.dom.doc.body),b=c.length,d=0;d<b;d++)"file:///"===c[d].src.substr(0,
8)&&a.dom.remove(c[d])});if(d.isIE9){var j=function(a){a.getBody().childNodes.length||a.setContent("<p>\ufeff</p>")};g.onNodeChange.add(j);g.onSetContent.add(j)}},getInfo:function(){return{longname:"ConfluenceCleanupPlugin",author:"Atlassian",authorurl:"http://www.atlassian.com",infourl:"http://www.atlassian.com",version:"1.0"}}}});
require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/confcleanup/editor_plugin_src",function(d){var f=require("tinymce");f.create("tinymce.plugins.ConfluenceCleanupPlugin",d);f.PluginManager.add("confluencecleanupplugin",f.plugins.ConfluenceCleanupPlugin)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'com/atlassian/confluence/tinymceplugin/auiwindowmanager.js' */
define("confluence-editor/tinymceplugin/auiwindowmanager","ajs tinymce jquery raphael window confluence/api/constants confluence/dialog".split(" "),function(h,g,e,k,l,m,n){var i=g.util.Dispatcher,j=g.isIE;return{AUIWindowManager:{init:function(a){a.onBeforeRenderUI.add(function(){a.windowManager=new g.AUIWindowManager(a)})},getInfo:function(){return{longname:"AUIWindowManager",author:"Atlassian",authorurl:"http://www.atlassian.com",version:g.majorVersion+"."+g.minorVersion}}},WindowManager:{AUIWindowManager:function(a){this.editor=
a;this.onOpen=new i(this);this.onClose=new i(this);this.params={};this.features={};this.modalDialogsStack=[];this.dialogs={};this.count=0},open:function(a,c){g.DOM.getViewPort();a=a||{};this.initialiseSettings(a);c=c||{};c=this.setDefaultParameters(c);c.mce_width=a.width;c.mce_height=a.height;c.mce_auto_focus=a.auto_focus;if(j){a.center=true;a.help=false;a.dialogWidth=a.width+"px";a.dialogHeight=a.height+"px"}this.features=a;this.params=c;this.onOpen.dispatch(this,a,c);var b=a.height;a.name&&(b=b+
56);if(c.cancelLink||c.buttons)b=b+51;b=b+40;a.popup&&(b=b+8);var d=a.id||g.DOM.uniqueId(),f=new n.component({width:a.width,height:b,id:d,onCancel:function(){f.hide().remove()}});a.name&&f.addHeader(this.editor.getLang(a.name));this.createDialogButtons(f,c,d);a.file=a.file||a.url;if(a.file)a.file=g._addVer(a.file);this.createDialogContent(f,a,c,d);c.helpLink&&this.createHelpLink(f,c.helpLink,c.helpName,d);c.hintText&&this.createHintText(f,c.hintText,d);b={id:d,settings:a,params:c,dialog:f};this.modalDialogsStack.push(b);
this.dialogs[d]=b;this.count++;h.Rte.BookmarkManager.storeBookmark();f.show();f.takeFocus!=void 0&&f.takeFocus();if(j){e("#"+d).css("overflow","hidden");e("#"+d+" ."+c.cssClass).css("overflow","hidden")}return d},initialiseSettings:function(a){a.width=parseInt(a.width||400,10);a.height=parseInt(a.height||250,10);a.resizable=false;if(a.popup==void 0)a.popup=true;if(a.popup&&a.content!=void 0)a.popup=false;a.scrollbars=a.scrollbars?"yes":"no"},createDialogButtons:function(a,c,b){if(c.buttons)for(var d=
0,d=0;d<c.buttons.length;d++){var e=c.buttons[d];a.addButton(this.editor.getLang(e.label),e.action)}c.cancelLink&&a.addCancel(this.editor.getLang("auiwindowmanager.cancel"),function(){return g.activeEditor.windowManager.close(b)})},createDialogContent:function(a,c,b,d){var f=this.createContentId(d),d="panel_"+f;if(c.popup){a.addPanel(d,e("<iframe id='"+f+"' width='100%' height='"+c.height+"px' frameborder='0' name='auidialogiframe' src='"+c.file+"' scrolling='"+c.scrollbars+"'></iframe>"),b.cssClass);
a.takeFocus=function(){e("#"+f).focus()}}else{if(c.content==void 0){a.addPanel(d,e("<div id='"+f+"'/>"),b.cssClass);e("#"+f).load(c.file)}else a.addPanel(d,e("<div id='"+f+"'>"+c.content+"</div>"),b.cssClass);a.takeFocus=function(){var a=e("#"+f+" :input");if(a.length)e(a[0]).focus();else{a=e("#"+f+" .button-panel button");a.length&&e(a[0]).focus()}}}a.gotoPanel(0,0)},createHintText:function(a,c,b){a=e("<div></div>").addClass("dialog-tip");a.text(g.activeEditor.getLang(c));e("#"+b+" .dialog-button-panel").append(a)},
createHelpLink:function(a,c,b,d){a=e("<div></div>").addClass("dialog-help-link");a.load(m.CONTEXT_PATH+"/plugins/tinymce/helplink.action",{linkUrlKey:c,linkNameKey:b||""});e("#"+d+" .dialog-components .dialog-title").prepend(a)},close:function(a,c){var b,d;if(typeof a==="string")b=a;else if(c)b=c;else if(d=this.modalDialogsStack.pop())b=d.id;if(this.dialogs[b]){this.count--;d=this.dialogs[b];d.dialog.remove();this.dialogs[b]=null;g.activeEditor.focus();h.Rte.BookmarkManager.restoreBookmark()}else h.log("Couldn't find id "+
b+" in dialogs array so dialog is not closed.");return false},alert:function(a,c,b){var d;d=this.open({content:"<p>"+a+"</p>",width:500,height:160,popup:false},{buttons:[{label:"auiwindowmanager.ok",action:function(){g.activeEditor.windowManager.toggleOtherDialogs(d,true);g.activeEditor.windowManager.close(d);c&&c.call(b||this)}}],cancelLink:false,cssClass:"tinymce-auidialog-alert"});this.toggleOtherDialogs(d,false)},createInstance:function(a,c,b,d,e,h){return new (g.resolve(a))(c,b,d,e,h)},toggleOtherDialogs:function(a,
c){for(var b=0,b=0;b<this.modalDialogsStack.length;b++){var d=this.modalDialogsStack[b];d.id!=a&&e("#"+d.id+" .dialog-button-panel").toggle(c)}},confirm:function(a,c,b,d){d=d||l;c.call(b||this,d.confirm(this._decode(this.editor.getLang(a,a))))},setBusy:function(a,c){if(this.dialogs[a])if(c){var b,d;b=this.createContentId(a);b=e("#"+b);b.hide();var f=b.parent();b=this.createBusyContentId(a);d=e("#"+b,f);if(!d.length){f.append(e("<div id='"+b+"' class='spinner'></div>"));d=e("#"+b,f);k.spinner(d[0],
50,"#666")}e(".button-panel button",e("#"+a)).each(function(a,b){e(b).prop("disabled",true)});e(d[0]).show()}else{b=this.createBusyContentId(a);d=e("#"+b);d.length&&e(d[0]).hide();b=this.createContentId(a);b=e("#"+b);e(".button-panel button",e("#"+a)).each(function(a,b){e(b).prop("disabled",false)});e(b[0]).show()}},logMCESelection:function(a){var c=g.activeEditor.selection;h.log("******************************");h.log("Logging TinyMCE selection title:    "+a);h.log("Bookmark:");h.log(c.getBookmark());
a=e(c.getRng().startContainer).text()||e(c.getRng().startContainer.parentNode).text();h.log("Range: "+a);h.log(c.getRng())},setDefaultParameters:function(a){a.inline=false;if(!a.cssClass)a.cssClass="tinymce-auidialog";if(a.cancelLink!=false)a.cancelLink=true;return a},createContentId:function(a){return"content_"+a},createBusyContentId:function(a){return"content_busy_"+a}}}});
require("confluence/module-exporter").safeRequire("confluence-editor/tinymceplugin/auiwindowmanager",function(h){var g=require("tinymce");g.create("tinymce.plugins.AUIWindowManager",h.AUIWindowManager);g.create("tinymce.AUIWindowManager:tinymce.WindowManager",h.WindowManager);g.PluginManager.add("auiwindowmanager",g.plugins.AUIWindowManager)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'macrobrowser/tinymce-macrobrowser.js' */
define("confluence-editor/macrobrowser/tinymce-macrobrowser",["jquery","tinymce","ajs","confluence/api/constants","confluence/get-content-id"],function(c,e,d,g,h){return{storedRange:null,bookmark:null,getCurrentNode:function(){return c(e.activeEditor.selection.getNode())},isMacroDiv:function(a){return c(a).hasClass("wysiwyg-macro")},isMacroTag:function(a){a=c(a);return a.hasClass("wysiwyg-macro")||a.hasClass("editor-inline-macro")},isBodylessMacro:function(a){return c(a).hasClass("editor-inline-macro")},
isMacroWithBody:function(a){return c(a).hasClass("wysiwyg-macro")},isMacroStartTag:function(a){return c(a).hasClass("wysiwyg-macro-starttag")},isMacroEndTag:function(a){return c(a).hasClass("wysiwyg-macro-endtag")},isMacroBody:function(a){return c(a).hasClass("wysiwyg-macro-body")},hasMacroBody:function(a){return"true"==c(a).attr("macrohasbody")},getNestingMacros:function(a){var b=[];c(a||this.getCurrentNode()).parents(".wysiwyg-macro").each(function(){b.push(c(this).attr("data-macro-name"))});return b},
logMCESelection:function(a){var b=e.activeEditor.selection;d.log("******************************");d.log("Logging TinyMCE selection title:    "+a);d.log("Bookmark:");d.log(b.getBookmark());a=c(b.getRng().startContainer).text()||c(b.getRng().startContainer.parentNode).text();d.log("Range: "+a);d.log(b.getRng())},getSelectedMacro:function(){var a=e.confluence.macrobrowser,b=a.getCurrentNode();d.log("getSelectedMacro: $selectionNode="+b[0]);return a.isMacroDiv(b)?b:e.confluence.MacroUtils.isInMacro(b)},
openMacro:function(a){d.MacroBrowser.open({selectedMacro:a,onComplete:e.confluence.macrobrowser.macroBrowserComplete,onCancel:e.confluence.macrobrowser.macroBrowserCancel})},editMacro:function(a){var b=e.confluence.macrobrowser,a=c(a);b.editedMacroDiv=a[0];var f=d.Rte.getEditor().serializer.serialize(a.clone()[0],{forced_root_block:!1});d.Rte.getEditor().selection.select(a[0]);d.Rte.BookmarkManager.storeBookmark();c.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:g.CONTEXT_PATH+
"/rest/tinymce/1/macro/definition",data:c.toJSON({contentId:h(),macroHtml:f}),dataType:"text",success:function(a){b.openMacro(c.secureEvalJSON(a))}})},macroBrowserToolbarButtonClicked:function(a){var b=e.confluence.macrobrowser,f=e.activeEditor,g=b.getCurrentNode();d.Rte.BookmarkManager.storeBookmark();b=c.extend({presetMacroName:null,nestingMacros:b.getNestingMacros(g),onComplete:b.macroBrowserComplete,onCancel:b.macroBrowserCancel,mode:"insert",selectedHtml:"",selectedText:""},a);a.ignoreEditorSelection||
(b.selectedHtml=f.selection.getContent(),b.selectedText=f.selection.getContent({format:"text"}));d.MacroBrowser.open(b)},macroBrowserComplete:function(a){var b=e.confluence.macrobrowser,a={contentId:d.Meta.get("content-id")||"0",macro:{name:a.name,params:a.params,defaultParameterValue:a.defaultParameterValue,body:a.bodyHtml}};d.Rte.BookmarkManager.restoreBookmark();b.editedMacroDiv?(e.confluence.MacroUtils.insertMacro(a,b.editedMacroDiv),delete b.editedMacroDiv):e.confluence.MacroUtils.insertMacro(a)},
macroBrowserCancel:function(){var a=e.confluence.macrobrowser;d.Rte.BookmarkManager.restoreBookmark();a.editedMacroDiv=null;a.editedMacro=null}}});require("confluence/module-exporter").exportModuleAsGlobal("confluence-editor/macrobrowser/tinymce-macrobrowser","tinymce.confluence.macrobrowser");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'utils/tinymce-image-utils.js' */
define("confluence-editor/utils/tinymce-image-utils","jquery confluence/api/logger confluence/meta ajs tinymce confluence/api/constants confluence/property-panel".split(" "),function(d,h,q,l,n,r,m){var o=["imagetext","src","align","border","width","height"],s=/\/download\/(thumbnails|attachments)\/([0-9]+)\//,p=function(a,b,g,c,e){if(c){if(b>=e)a.width=e;a.style.maxWidth=""}else{if(g>=e)a.height=e;a.style.maxHeight=""}},i;i={isScaledByWidth:function(){return false},updateImageElement:function(a,b){var g=
d(a),c;c=b.destination;c=i.isRemoteImg(c)?c:b.thumbnail?c.replace("/attachments/","/thumbnails/"):c.replace("/thumbnails/","/attachments/");b.src=c;g.toggleClass("confluence-content-image-border",!!b.border);g.toggleClass("confluence-thumbnail",!!b.thumbnail);c=0;for(var e=o.length;c<e;c++){var f=o[c],j=b[f];j!==false&&j!=null?g.attr(f,j):g.removeAttr(f)}n.activeEditor.undoManager.add()},insertFromProperties:function(a,b){d.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:r.CONTEXT_PATH+
"/rest/tinymce/1/embed/placeholder/image",data:d.toJSON(a),dataType:"text",success:function(a){i.insertImagePlaceholder(a,b)}})},insertImagePlaceholder:function(a,b){var g,c=i.isScaledByWidth(),e=d(a);g=c?m.Image.getPresetImageSize("large"):q.get("content-type")==="comment"?m.Image.getPresetImageSize("small"):m.Image.getPresetImageSize("medium");e.css(c?"max-width":"max-height",g+"px");var f=n.activeEditor,j="_"+ +new Date,h=d("<div></div>").append(e.attr("id",j));f.selection.setContent(h.html());
var k=f.dom.get(j);f.dom.setAttrib(k,"id","");e.hasClass("confluence-external-resource")||p(k,e.attr("data-image-width"),e.attr("data-image-height"),c,g);d(k).one("load",function(){e.hasClass("confluence-external-resource")&&p(this,this.width,this.height,c,g);l.Rte.showSelection(function(){b||l.trigger("trigger.property-panel",{elem:k});f.undoManager.add()});f.onChange.dispatch()})},isRemoteImg:function(a){var b=l.Rte.getCurrentBaseUrl();return a.match("(https?://)")&&a.indexOf(b)===-1},isThumbnailUsable:function(a,
b,d,c,e,f){if(a){if(a>e)return false;e=d/c;return e>=1?true:e*f>=a}a=b;if(a>f)return false;f=c/d;return f>=1?true:f*e>=a}};return{ImageProperties:function(a){if(a&&d.nodeName(a,"img")&&d(a).hasClass("confluence-embedded-image")){var b=d(a),a={destination:b.attr("src"),url:b.attr("src"),border:b.attr("class")&&b.attr("class").indexOf("confluence-content-image-border")!==-1?1:0,width:b.prop("width"),height:b.prop("height"),originalSelected:!b.attr("width")&&!b.attr("height")};if(!i.isRemoteImg(a.destination)&&
!d(b).hasClass("confluence-external-resource")){var g=a;var b=d(b).attr("src"),c=b.match(s);if(c&&c.length===3)b=c[2];else{h.log("ERROR: could not parse page id from image url "+b);b="0"}g.pageId=b}return d.extend({},a)}if(a.destination){a.imageFileName=a.imageFileName||a.destination;return d.extend({},a)}return null},ImageUtils:i}});
require("confluence/module-exporter").safeRequire("confluence-editor/utils/tinymce-image-utils",function(d){var h=require("tinymce");h.confluence.ImageProperties=d.ImageProperties;h.confluence.ImageUtils=d.ImageUtils});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'utils/tinymce-macro-utils.js' */
define("confluence-editor/utils/tinymce-macro-utils",["tinymce","ajs","confluence/legacy-editor-global-AVOID-IF-POSSIBLE","jquery","confluence/get-content-id"],function(h,f,l,e,p){var n,o=function(a,c){var d;if(a.macro&&a.contentId)d={type:"POST",url:f.contextPath()+"/rest/tinymce/1/macro/placeholder",contentType:"application/json; charset=utf-8",data:e.toJSON(a),dataType:"text"};else if(a.url&&a.type)d=a;else throw Error("illegal argument received: "+a);var b=e.Deferred(),g=f.Rte.getEditor(),i,m;
c||(m="macro-"+(new Date).getTime(),i=g.dom.create("span",{id:m}),g.selection.setNode(i),c=i=g.dom.select("#"+m)[0],b.fail(function(){e(i).remove()}));e.extend(d,{timeout:n.DEFAULT_INSERT_MACRO_TIMEOUT});f.debug("Insert macro timeout = "+d.timeout);l.UI.setButtonsState(!1);e.ajax(d).done(function(j){j[0]!=="<"&&(j=document.createTextNode(j));if(!c||!c.parentNode){f.logError("The node to be replaced has been already deleted from the document");b.rejectWith(this,arguments)}else h.confluence.NodeUtils.updateNode(c,
j).done(function(a){b.resolve(a,j)}).fail(b.reject)}).fail(function(a,c,e){f.logError("Macro placeholder request failed "+c+": '"+e+"'");b.rejectWith(this,arguments)});b.done(function(a,c){l.UI.setButtonsState(true);h.confluence.macrobrowser.isMacroWithBody(a)&&/P|H\d/.test(a.parentNode.nodeName)&&g.dom.split(a.parentNode,a);var b=h.confluence.macrobrowser,d=h.activeEditor,i=d.getDoc(),k=d.selection.getRng(true);if(b.isMacroWithBody(a)){!h.isIE&&e("p, pre",a).each(function(){this.childNodes.length===
0&&this.appendChild(i.createElement("br"))});if(b=d.dom.select(".wysiwyg-macro-body",a)[0].firstChild){k.setStart(b,0);k.setEnd(b,0)}else f.debug("focusMacroNode: couldn't find anything to focus, cap'n!")}else{k.setStartAfter(a);k.setEndAfter(a)}d.selection.setRng(k);g.nodeChanged();f.Rte.showElement(a);g.selection.onSetContent.dispatch(g.selection,{content:c,format:"html"});h.activeEditor.undoManager.add();f.trigger("macro-browser.macro-inserted")}).fail(function(){l.UI.setButtonsState(true)});return b.promise()};
return n={DEFAULT_INSERT_MACRO_TIMEOUT:5E3,insertMacro:o,isInMacro:function(a){return 0<(a.jquery?a:e(a)).closest(".wysiwyg-macro").length},updateMacro:function(a,c,d,b){a={contentId:p(),macro:{name:d,params:a,body:c?c:""}};return o(a,b)}}});require("confluence/module-exporter").exportModuleAsGlobal("confluence-editor/utils/tinymce-macro-utils","tinymce.confluence.MacroUtils");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/confluence/editor_plugin_src.js' */
define("confluence-editor/tinymce3/plugins/confluence/editor_plugin_src",["jquery","ajs","tinymce","confluence-link-browser/link-object"],function(j,d,f,m){return{init:function(g){g.addCommand("mceConfUnlink",function(g,f){var h=d.Rte.getEditor(),i=h.selection,e=f||i.getNode(),a=j(e);if("A"!==e.nodeName){a=a.closest("a");if(!a.length)return;e=a[0]}var b=a.attr("href");b||(b="#",a.attr("href",b));var c;if(c=!a.attr("data-linked-resource-id"))if(c=m.isExternalLink(b)){c=a.text();var k=b,l=/(.*)[\/]$/.exec(k);
c=c==(null!=l?l[1]:k)}c?(i=h.dom.create("span",{"class":"nolink"},b),h.dom.replace(i,e,!1)):(i.select(e),a.removeClass("createlink unresolved"),h.execCommand("UnLink"))});g.addButton("confimage",{title:"confluence.confimage_desc",cmd:"mceConfimage"});g.addButton("conf_macro_browser",{title:"confluence.conf_macro_browser_desc",cmd:"mceConfMacroBrowser"})},getInfo:function(){return{longname:"Confluence TinyMCE Plugin",author:"Atlassian",authorurl:"http://www.atlassian.com",version:f.majorVersion+"."+
f.minorVersion}}}});require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/confluence/editor_plugin_src",function(j){var d=require("tinymce");d.create("tinymce.plugins.ConfluencePlugin",j);d.PluginManager.add("confluence",d.plugins.ConfluencePlugin)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/macroplaceholder/editor_plugin_src.js' */
define("confluence-editor/tinymce3/plugins/macroplaceholder/editor_plugin_src",["jquery","ajs","tinymce","confluence/property-panel"],function(f,i,d,p){var k=d.VK;return{init:function(j){function h(a){j.onKeyDown.add(a);d.isGecko&&(j.onKeyPress.add(a),j.onKeyUp.add(a))}function l(a,b){return a&&1===a.childNodes.length&&f(a).is(b)&&f(a.firstChild).is("br")}function m(a){if(!a.collapsed)return!1;a=3===a.startContainer.nodeType?a.startContainer.parentNode:a.startContainer;if(!a||!a.parentNode)return!1;
for(;a&&!f(a).is(".wysiwyg-macro-body");){if(a.previousSibling||a.nextSibling)return!1;a=a.parentNode}return!0}var g=this;j.onInit.add(function(a){a.selection.onSetContent.add(function(a){d.each(a.dom.select("p > .wysiwyg-macro"),function(c){var e=a.dom.getParent(c.parentNode,"p");try{a.dom.split(e,c)}catch(d){}})})});j.onSetContent.add(function(a){d.each(a.dom.select('.wysiwyg-macro[data-macro-body-type="PLAIN_TEXT"] .wysiwyg-macro-body'),function(b){a.dom.select("pre",b).length||(d.isIE?a.dom.setHTML(b,
"<pre></pre>"):a.dom.setHTML(b,"<pre><br /></pre>"))})});j.onKeyDown.add(function(a,b){var c=a.selection,e;if(!(e=-1!=f.inArray(b.keyCode,[k.BACKSPACE,k.DELETE,k.ENTER,k.ESCAPE])))e=!1,0===b.charCode&&(e=-1!=f.inArray(b.keyCode,[k.SHIFT,k.CTRL,k.ALT,k.META])),e=e||c.isCollapsed();if(!e&&!b.ctrlKey&&!(b.metaKey||!d.isMac&&b.altKey))e=c.getNode(),d.confluence.macrobrowser.isMacroWithBody(e)&&(e=f(".wysiwyg-macro-body",e),0<e.length&&(i.debug("MacroPlaceholderPlugin: Adjusting text selection to only include macro's body."),
c.select(e[0],!0)))});j.onDblClick.add(function(a,b){var c=f(b.target),e=c.closest("[data-macro-name]");if(e.length){i.debug("Double-click triggered inside a macro.");if(e.attr("data-macro-body-type"))if(d.isIE)if(c.hasClass("wysiwyg-macro-body")||c.hasClass("wysiwyg-macro"))i.debug("Double-click inside macro body, but its IE so its OK I guess...");else{i.debug("Double-click was inside bodied macro content, even in IE. Skipping.");return}else if(c.closest(".wysiwyg-macro-body").length){i.debug("Double-click was inside bodied macro content. Skipping.");
return}d.confluence.macrobrowser.editMacro(e);p&&p.current&&p.destroy()}});j.onNodeChange.addToTop(function(a){var b=a.selection.getNode();"PRE"===b.nodeName&&f(b).closest(".wysiwyg-macro").length?g._setTinymceControlsState(a,0):g._setTinymceControlsState(a,1)});j.addCommand("mceConfRemoveMacro",function(a){f(a).remove();d.isGecko&&i.Rte.getEditor().execCommand("mceRepaint",!1)});g._isCursorInMostNestedElement=m;var q=function(a){if(!a.collapsed)return!1;a=3===a.startContainer.nodeType?a.startContainer.parentNode:
a.startContainer;return a.previousSibling&&!a.nextSibling&&l(a,"p, pre")};(d.isWebKit||d.isGecko)&&h(function(a,b){if(46===b.keyCode&&q(a.selection.getRng(!0)))return d.dom.Event.cancel(b)});g._isCursorInLastParagraphOrPre=q;d.isWebKit&&h(function(a,b){if(8!==b.keyCode&&46!==b.keyCode)return!0;var c=a.selection.getRng(!0),e=3===c.startContainer.nodeType?c.startContainer.parentNode:c.startContainer;if(c.collapsed)var g=3===c.startContainer.nodeType?c.startContainer.parentNode:c.startContainer,c=m(c)&&
1===g.childNodes.length&&f(g.firstChild).is("br");else c=!1;return c&&(8===b.keyCode?!f(e).is("li"):1)?d.dom.Event.cancel(b):!0});var r=function(a){if(!a.collapsed)return!1;var b=3===a.startContainer.nodeType?a.startContainer.parentNode:a.startContainer;return 0===a.startOffset&&f(b).is(".wysiwyg-macro-body > ul > li")&&1===b.childNodes.length&&f(b.firstChild).is("br")};d.isWebKit&&h(function(a,b){return 8!==b.keyCode?!0:r(a.selection.getRng(!0))?(a.execCommand("Outdent"),d.dom.Event.cancel(b)):!0});
g._isCursorInsideMacroPlacholderInsideListItemContainingSoloBr=r;var s=function(a){var b=3===a.startContainer.nodeType?a.startContainer.parentNode:a.startContainer,c=f(b);return 0===a.startOffset&&l(b,"p, pre")&&c.parent().is("td.wysiwyg-macro-body")&&!b.previousSibling&&b.nextSibling&&l(b.nextSibling,"p, pre")};d.isWebKit&&h(function(a,b){if(46!==b.keyCode)return!0;var c=a.selection.getRng(!0),e=3===c.startContainer.nodeType?c.startContainer.parentNode:c.startContainer,g=f(e);if(s(c))return c=e.nextSibling,
g.remove(),a.selection.select(c,!0),d.dom.Event.cancel(b)});g._isCursorInFirstParagraphWhenThereAreTwoEmptyParagraphs=s;var t=function(a){var b=3===a.startContainer.nodeType?a.startContainer.parentNode:a.startContainer,c=f(b);return 0===a.startOffset&&l(b,"p, pre")&&c.parent().is("td.wysiwyg-macro-body")&&!b.nextSibling&&b.previousSibling&&!b.previousSibling.previousSibling&&l(b.previousSibling,"p, pre")};d.isWebKit&&h(function(a,b){if(8!==b.keyCode)return!0;var c=a.selection.getRng(!0),e=3===c.startContainer.nodeType?
c.startContainer.parentNode:c.startContainer,g=f(e);if(t(c))return c=e.previousSibling,g.remove(),a.selection.select(c,!0),d.dom.Event.cancel(b)});g._isCursorInSecondParagraphWhenThereAreTwoEmptyParagraphs=t;var u=function(a){if(!a.collapsed)return!1;var b=3===a.startContainer.nodeType?a.startContainer.parentNode:a.startContainer,c=f(b);if(!b||0<a.startOffset)return!1;d.confluence.NodeUtils.normalize(b);return b&&0===a.startOffset&&l(b,"p, pre")&&c.parent().is("td.wysiwyg-macro-body")&&!b.previousSibling&&
!b.nextSibling};(d.isWebKit||d.isGecko)&&h(function(a,b){if(8!==b.keyCode&&46!==b.keyCode)return!0;if(u(a.selection.getRng(!0)))return d.dom.Event.cancel(b)});g._isCursorInSoloParagraphOrPreInsidePlaceholder=u;var v=function(a){return a&&a.parentNode&&"BR"===a.nodeName&&a===a.parentNode.lastChild},w=function(a){if(!a.collapsed)return!1;var b=a.startContainer;return b&&0===a.startOffset&&3===b.nodeType&&m(a)&&1===b.nodeValue.length&&!b.previousSibling&&(!b.nextSibling||v(b.nextSibling))},x=function(a){if(!a.collapsed)return!1;
var b=a.startContainer;return b&&1===a.startOffset&&3===b.nodeType&&m(a)&&1===b.nodeValue.length&&!b.previousSibling&&(!b.nextSibling||v(b.nextSibling))},y=function(a){if(!a.collapsed)return!1;var b=a.startContainer;return b&&0===a.startOffset&&1===b.nodeType&&1===b.childNodes.length&&m(a)&&!b.previousSibling&&!b.nextSibling},z=function(a){if(!a.collapsed)return!1;var b=a.startContainer;return b&&1===a.startOffset&&1===b.nodeType&&1===b.childNodes.length&&m(a)&&!b.previousSibling&&!b.nextSibling};
(d.isWebKit||d.isGecko)&&h(function(a,b){if(8!==b.keyCode&&46!==b.keyCode)return!0;var c=a.selection.getRng(!0),e=3===c.startContainer.nodeType?c.startContainer.parentNode:c.startContainer;if(!f(e).closest(".wysiwyg-macro-body").size())return!0;d.confluence.NodeUtils.normalize(e);return 46===b.keyCode&&(w(c)||y(c))||8===b.keyCode&&(x(c)||z(c))?(e.lastChild&&!f(e.lastChild).is("br")&&f(e).append("<br/>"),f(e.firstChild).remove(),a.selection.select(e,1),d.dom.Event.cancel(b)):!0});g._isCursorBehindOnlyCharacterInNestedElement=
w;g._isCursorAfterOnlyCharacterInNestedElement=x;g._isCursorBehindOnlyChildInNestedElement=y;g._isCursorAfterOnlyChildInNestedElement=z;var B=function(a){if(a.collapsed)return!1;var b=function(a){return!a.previousSibling},c=function(a){return!a.nextSibling};return 0===a.startOffset&&A(a.startContainer,b)&&(!a.endContainer?!1:3===a.endContainer.nodeType?a.endOffset===a.endContainer.nodeValue.length:1===a.endContainer.nodeType?1===a.endContainer.childNodes.length&&f(a.endContainer.firstChild).is("br")?
0===a.endOffset:a.endOffset===a.endContainer.childNodes.length:!1)&&A(a.endContainer,c)},A=function(a,b){if(!a)return!1;if(f(a).is(".wysiwyg-macro-body"))return!0;do{if(!b(a))return!1;a=a.parentNode}while(a&&!f(a).is(".wysiwyg-macro-body"));return!0};d.isWebKit&&h(function(a,b){if(8!==b.keyCode&&46!==b.keyCode)return!0;var c=a.selection.getRng(!0);if(B(c)&&(c=f(c.startContainer).closest(".wysiwyg-macro-body"),0<c.length)){var e=f(c[0].firstChild).is("pre");a.undoManager.add();c.empty();c=e?f("<pre><br/></pre>").appendTo(c):
f("<p><br/></p>").appendTo(c);a.selection.select(c[0],!0);return d.dom.Event.cancel(b)}return!0});g._isMacroBodySelected=B;var C=function(a){if(!a.collapsed)return!1;var b=3===a.startContainer.nodeType?a.startContainer.parentNode:a.startContainer,c=f(b);return 0===a.startOffset&&l(b,"p")&&c.next().is("table")};d.isWebKit&&h(function(a,b){if(46===b.keyCode&&C(a.selection.getRng(!0)))return d.dom.Event.cancel(b)});g._isCursorInEmptyParagraphPrecedingPlaceholder=C;var D=function(a){return!a||f(a.parentNode).is(".wysiwyg-macro td")?
null:f(a.parentNode).is("p")?a.parentNode:D(a.parentNode)},n=function(a){return!a?null:3===a.nodeType?a:n(a.firstChild)||n(a.nextSibling)},o=function(a){return!a||"PRE"===a.nodeName||"TD"===a.nodeName?null:"BR"===a.nodeName?a:o(a.previousSibling)||o(a.parentNode)},E=function(a){var b,c;0<f(a.commonAncestorContainer).closest(".wysiwyg-macro td").length&&(o(a.startContainer)||(b=n(D(a.startContainer))));if(0<(c=f(a.commonAncestorContainer).closest(".wysiwyg-macro td > pre")).length)o(a.startContainer)||
(b=n(c[0]));b&&(a=a.cloneRange(),a.setStart(b,0));return a};d.isWebKit&&d.isMac&&h(function(a,b){var c=a.selection.getRng();if((b.metaKey||b.ctrlKey)&&b.shiftKey&&b.keyCode===k.LEFT){var e=E(c);if(e!==c)return a.selection.setRng(e),d.dom.Event.cancel(b)}});g._selectTillStart=E;j.onKeyDown.add(function(a,b){if(b.keyCode===d.VK.TAB){var c=a.selection.getRng(1);if(f(3===c.startContainer.nodeType?c.startContainer.parentNode:c.startContainer).is(".wysiwyg-macro-body > pre")){a.undoManager.beforeChange();
a.undoManager.add();var e=a.getDoc().createTextNode("\t");c.insertNode(e);a.selection.setCursorLocation(e,1);a.undoManager.add();return d.dom.Event.prevent(b)}}})},_setTinymceControlsState:function(f,h){d.each(f.controlManager.controls,function(d){d.setDisabled(!h)})},getInfo:function(){return{longname:"Macro Place Holder plugin",author:"Atlassian",authorurl:"http://www.atlassian.com",version:"1.0"}}}});
require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/macroplaceholder/editor_plugin_src",function(f){var i=require("tinymce");i.create("tinymce.plugins.MacroPlaceHolderPlugin",f);i.PluginManager.add("macroplaceholder",i.plugins.MacroPlaceHolderPlugin)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/insertwiki/editor_plugin_src.js' */
define("confluence-editor/tinymce3/plugins/insertwiki/editor_plugin_src","jquery ajs confluence/templates confluence/localstorage-cache tinymce underscore confluence/api/constants".split(" "),function(e,b,h,n,i,u,q){var o=!b.DarkFeatures.isEnabled("editor.insert-wiki-markdown"),d={DEFAULT:null,HELP_REST_API:b.contextPath()+"/plugins/tinymce/helplink.action",WIKI:{CONFLUENCE:{val:"CONFLUENCE",label:"Confluence wiki",helpLink:"help.insert.wiki.markup",
restApi:"/rest/tinymce/1/wikixhtmlconverter"},MARKDOWN:{val:"MARKDOWN",label:"Markdown",helpLink:"help.insert.wiki.markup.markdown",restApi:"/rest/tinymce/1/markdownxhtmlconverter"}}},r=new n("insert-wiki-markup-dialog");return{init:function(f,n){f.addCommand("InsertWikiMarkup",function(){var j={id:"insert-wiki-markup-dialog",content:o?h.InsertWiki.wikiMarkupDialog():h.InsertWiki.originalDefaultTempWikiMarkupDialog(),width:980,height:500,popup:false,
name:"confluence.conf_wikimarkup_desc"},v=b.Meta.get("content-id"),w=b.Meta.get("space-key");d.DEFAULT=d.WIKI[r.get("parser")||"CONFLUENCE"];var c={getElement:function(a){c[a]=c[a]||e(a);return c[a]}},k=null,l=function(){var a=c.getElement("#wiki-parser-selection-tool");return a.length?a.val():d.DEFAULT.val},s=function(a){a=a||{};a.setBusy&&f.windowManager.setBusy(j.id,true);e.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:a.API,data:e.toJSON({wiki:a.textToConvert,entityId:v,
spaceKey:w}),dataType:"text",success:a.successCallback,error:a.errorCallback||function(a){b.logError(a)},timeout:7500})},x=function(a){var c=j.id,d=l();f.windowManager.setBusy(c,false);i.EditorManager.activeEditor.windowManager.close(c);if(o){b.trigger("analytics",{name:"insert-wiki-markup-dialog."+d});if(d==="MARKDOWN"){a=e(a);a.find("img").addClass("confluence-embedded-image");a=e("<div>").append(a.clone()).html()}}f.execCommand("mceInsertContent",false,a);i.each(f.dom.select("p > p"),function(a){try{f.dom.split(a.parentNode,
a)}catch(c){b.logError("insertwikimarkup - splitParas()",c)}})},y=function(a,c,d){f.windowManager.setBusy(j.id,false);a={warningMessage:i.EditorManager.activeEditor.getLang("confluence.conf_wikimarkup_errors"),exceptionMessage:c==="timeout"?i.EditorManager.activeEditor.getLang("confluence.conf_wikimarkup_timeout"):b.escapeHtml(c)+" : "+b.escapeHtml(d)};a=h.InsertWiki.wikiErrorSubDialog(a);i.EditorManager.activeEditor.windowManager.alert(a)},t=function(){var a=c.getElement("#insert-wiki-textarea"),
b=a.val();e.trim(b)?s({API:q.CONTEXT_PATH+d.WIKI[l()].restApi,textToConvert:b,successCallback:function(a){k.html(a)},errorCallback:function(){k.html(a.val())}}):k.html(b)},z=function(){var a=l();r.put("parser",a);c.getElement("#"+j.id).find(".dialog-help-link").load(d.HELP_REST_API,{linkUrlKey:d.WIKI[a].helpLink});t()};f.windowManager.open(j,{buttons:[{label:"confluence.conf_insert_button_title",action:function(){s({API:q.CONTEXT_PATH+d.WIKI[l()].restApi,successCallback:x,errorCallback:y,textToConvert:c.getElement("#insert-wiki-textarea").val(),
setBusy:true})}}],plugin_url:n,helpLink:d.DEFAULT.helpLink,hintText:"confluence.conf_wikimarkup_hint",cssClass:"insert-wiki-markup-panel"});if(o){var p=e("#wysiwygTextarea_ifr").contents().find("head").html(),A=h.InsertWiki.previewWikiIframeContent(),g=e("<iframe tabindex='-1' id='insert-wiki-markup-preview' />"),m;c.getElement("#insert-wiki-textarea-preview").append(g);g=g.contents();m=g[0];m.open();m.write(A);m.close();g.find("head").html(p);k=g.find("body");p=e(h.InsertWiki.wikiParserSelector(d));
c.getElement("#insert-wiki-insert-title").append(p);c.getElement("#wiki-parser-selection-tool").on("change",z);c.getElement("#insert-wiki-textarea").on("keydown",u.debounce(t,300))}});f.addButton("insertwikimarkup",{title:"confluence.conf_wikimarkup_desc",cmd:"InsertWikiMarkup"})},getInfo:function(){return{longname:"InsertWikiMarkip",author:"Atlassian",authorurl:"http://www.atlassian.com",infourl:"http://www.atlassian.com/",version:"1.1"}}}});
require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/insertwiki/editor_plugin_src",function(e){var b=require("tinymce");b.create("tinymce.plugins.InsertWikiMarkupPlugin",e);b.PluginManager.add("insertwikimarkup",b.plugins.InsertWikiMarkupPlugin)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/propertypanel/editor_plugin_src.js' */
define("confluence-editor/tinymce3/plugins/propertypanel/editor_plugin_src",["jquery","ajs","document","tinymce","confluence/property-panel"],function(e,c,l,k,g){var i=[];c.bind("add-handler.property-panel",function(c,e){e&&i.push(e)});return{init:function(d){c.debug("init property panel plugin");var f,h=function(b,a,d){var f={focusedEl:d,focusedNodeName:d.nodeName&&d.nodeName.toLowerCase(),ed:b,e:e.extend({},a)};b=e(d);b.is("img")?b=b[0]:(b=b.closest("a,table,.wysiwyg-macro,.editor-inline-macro,.text-placeholder"),
b=b.length?b[0]:"");var d=!!e(d).closest("table:not(.wysiwyg-macro,.editor-inline-macro)").length,h=!!e(".toolbar-contextual").length;f.containerEl=b;c.trigger("user-blurred-rte-element",f);var j;if(j=b)a="click"!=a.type?!1:a.which?3===a.which:a.button?2==a.button:void 0,j=!a&&!g.current&&c.Confluence.PropertyPanel.shouldCreate;if(j){a=0;for(j=i.length;a<j;a++)if(i[a].canHandleElement(e(b))){if(h||!d)return i[a].handle(f);(function(a){e(l).bind("shown.contextToolbar",function(){a.handle(f)})})(i[a])}}};
k.isIE&&d.onMouseDown.add(function(b,a){f&&f.unbind("mouseup.IEDragHandlesWorkaround");f=e(a.target);f.filter("img, table").bind("mouseup.IEDragHandlesWorkaround",function(){h(b,a,a.target)})});c.bind("trigger.property-panel",function(b,a){h(d,b,a.elem)});d.onClick.add(function(b,a){h(b,a,a.target)});d.onKeyUp.addToTop(function(b,a){27!==a.keyCode&&h(b,a,b.selection.getNode())});d.onContextMenu.add(function(){g.destroy()});c.bind("user-blurred-rte-element",function(b,a){g.current&&(!a.containerEl||
g.current.hasAnchorChanged(a.containerEl)?g.destroy():c.trigger("same-anchor.property-panel"))});c.bind("created.property-panel",function(){setTimeout(function(){c.Rte.bindScroll("property-panel",function(){g.destroy()})},0);e(d.getDoc()).bind("keydown.property-panel.escape",function(b){27===b.keyCode&&g.current&&g.destroy()})});c.bind("destroyed.property-panel",function(){c.Rte.unbindScroll("property-panel");e(d.getDoc()).unbind("keydown.property-panel.escape")})},getInfo:function(){return{longname:"Image, Link and Macro Property Panels",
author:"Atlassian",authorurl:"http://www.atlassian.com",version:k.majorVersion+"."+k.minorVersion}}}});require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/propertypanel/editor_plugin_src",function(e){var c=require("tinymce");c.create("tinymce.plugins.PropertyPanel",e);c.PluginManager.add("propertypanel",c.plugins.PropertyPanel)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/confmonospace/editor_plugin_src.js' */
define("confluence-editor/tinymce3/plugins/confmonospace/editor_plugin_src",["tinymce"],function(b){return{init:function(a){a.addCommand("confMonospace",function(){a.formatter.toggle("monospace",void 0)});b.activeEditor.onInit.add(function(a){a.formatter.register({monospace:{inline:"code"}});a.editorCommands.addCommands({confMonospace:function(){return a.formatter.match("monospace")}},"state")});a.addButton("monospace",{title:"monospace",cmd:"confMonospace"})},getInfo:function(){return{longname:"Monospace Formatting",
author:"Atlassian",authorurl:"http://www.atlassian.com",version:b.majorVersion+"."+b.minorVersion}}}});require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/confmonospace/editor_plugin_src",function(b){var a=require("tinymce");a.create("tinymce.plugins.ConfMonospacePlugin",b);a.PluginManager.add("confmonospace",a.plugins.ConfMonospacePlugin)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/propertypanel/js/property-panel-links.js' */
define("confluence-editor/tinymce3/plugins/propertypanel/js/property-panel-links","ajs jquery confluence/legacy-editor-global-AVOID-IF-POSSIBLE tinymce window confluence/property-panel".split(" "),function(d,e,j,k,l,g){var i=0;return{name:"link",canHandleElement:function(c){return c.is("a")&&c.attr("href")!="#"&&!c.hasClass("unresolved")},handle:function(c){var b=c.containerEl,h=c.ed,a=function(b){return d.Rte.getEditor().getLang(b)},c={anchorIframe:d.Rte.getEditorFrame()},f=e(b).attr("href").indexOf("#")===
0,a=[{className:"link-property-panel-goto-button",text:a("propertypanel.links_goto"),tooltip:f?a("propertypanel.links_goto_disabled_tooltip"):b.href,href:b.href,disabled:f,click:function(){g.destroy();var a=l.open(b.href,k.isIE?"_blank":"confluence-goto-link-"+d.params.pageId+"-"+i);a&&a.focus()}},{className:"link-property-panel-edit-button",text:a("propertypanel.links_edit"),tooltip:a("propertypanel.links_edit_tooltip"),disabled:e(b).hasClass("createlink")||!b.href,click:function(){g.destroy();h.selection.select(b);
j.LinkBrowser.open()}},{className:"link-property-panel-unlink-button",text:a("propertypanel.links_unlink"),tooltip:a("propertypanel.links_unlink_tooltip"),click:function(){g.destroy();h.execCommand("mceConfUnlink",false,b);h.focus()}}],f=[];d.trigger("link-property-panel-buttons.created",{buttons:f,link:b});a=a.concat(f);g.createFromButtonModel(this.name,b,a,c);i++}}});
require("confluence/module-exporter").exportModuleAsGlobal("confluence-editor/tinymce3/plugins/propertypanel/js/property-panel-links","AJS.Confluence.PropertyPanel.Link",function(d){var e=require("ajs");e.bind("init.rte",function(){e.trigger("add-handler.property-panel",d)})});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/propertypanel/js/property-panel-images.js' */
define("confluence-editor/tinymce3/plugins/propertypanel/js/property-panel-images","jquery ajs tinymce confluence-editor/utils/tinymce-image-utils confluence/meta confluence/api/browser confluence/property-panel confluence/legacy-editor-global-AVOID-IF-POSSIBLE".split(" "),function(f,g,s,F,v,G,h,w){function x(){var a=[];f.each(t,function(b,c){a.push(c)});h.current.panel.find(a.join(", ")).removeClass("selected")}function p(a,b,c){var e=y(a,b),c=y(a,c),j=e||c;if(j){var d=h.getAnchor(),i=d.width(),
d=d.height(),f=v.get("max-thumb-width"),g=v.get("max-thumb-height");a.thumbnail=k.isRemoteImg(a.destination)?false:k.isThumbnailUsable(e,c,i,d,f,g);a.originalSelected=false;if(b){delete a.height;a.width=j}else{delete a.width;a.height=j}m(a);x();return true}return false}function z(a,b){if(u?p(a,n[b]):p(a,null,n[b])){A(b);m(a);return true}return false}function B(a){delete a.width;delete a.height;a.thumbnail=false;a.originalSelected=true;x();A("original");var b=h,c=b.getAnchor();b.current.updating=true;
c.one("load",function(){l(b);q(a);a.width=Math.floor(c.width());a.height=Math.floor(c.height())});k.updateImageElement(c,a);s.isGecko&&g.Rte.getEditor().execCommand("mceRepaint",false);c.each(function(){this.complete&&f(this).trigger("load")});return true}function A(a){h.current.panel.find(t[a]).addClass("selected")}function C(a){f(".image-border-toggle").toggleClass("selected",!a.border);a.border=+!a.border||false;m(a)}function m(a){var b=h,c=b.getAnchor(),e=c.attr("src"),f=c.height();b.current.updating=
true;k.updateImageElement(c,a);s.isGecko&&g.Rte.getEditor().execCommand("mceRepaint",false);if(a.src!=e){var d=setInterval(function(){var a=c.height();if(a!=f){g.debug("updateImageElement : height changed after image src change - "+f+" to "+a);clearTimeout(d);d=null;l(b)}},10);setTimeout(function(){if(d){clearTimeout(d);d=null;l(b)}},1E3)}else l(b);q(a)}function q(a){a=a.width?a.width:h.getAnchor().width();a=Math.floor(a);f("#image-size-input").val(a+"px")}function y(a,b){b=parseInt(b);if(isNaN(b))return null;
b<D?b=D:b>E&&(b=E);return b}var k=F.ImageUtils,u=k.isScaledByWidth(),n;n=u?{small:100,medium:300,large:500}:{small:150,medium:250,large:400};var t={small:".image-size-small",medium:".image-size-medium",large:".image-size-large",original:".image-size-original"},D=16,E=9E4,l=function(a){a.current.updating=false;a.current.snapToElement({animate:true,animateDuration:100})};return{_resizeImage:p,pluginButtons:[],name:"image",getPresetImageSize:function(a){return n[a]},canHandleElement:function(a){return a.is("img")&&
!a.hasClass("editor-inline-macro")&&!a.hasClass("template-variable")},handle:function(a){function b(){p(e,f("#image-size-input").val())?true:q(e);g.trigger("analyticsEvent",{name:"confluence.editor.image.resize.custom"})}var c;c=a.nodeName==="IMG"?a:a.containerEl;var a=f(c),e=s.confluence.ImageProperties(c);if(e&&!a.attr("data-resource-id")){var j=g.Rte.getEditor(),d=function(a){return j.getLang(a)},i=function(a){return{className:"image-size-"+a,text:d("propertypanel.images_"+a),tooltip:d("propertypanel.images_"+
a+"_tooltip"),click:function(){z(e,a);g.trigger("analyticsEvent",{name:"confluence.editor.image.resize."+a})},selected:u?e.width==n[a]:e.height==n[a]}},i=[{className:"editable",tooltip:d("propertypanel.images_sizing_tooltip"),html:'<input id="image-size-input"/>'},null,i("small"),i("medium"),i("large"),{className:"image-size-original",text:d("propertypanel.images_original"),tooltip:d("propertypanel.images_original_tooltip"),click:function(){B(e);g.trigger("analyticsEvent",{name:"confluence.editor.image.resize.original"})},
selected:e.originalSelected},null,{className:"image-border-toggle",text:d("propertypanel.images_border"),tooltip:d("propertypanel.images_border_tooltip"),click:function(){C(e)},selected:e.border||e.border==1}];i.push(null);var k=a.parent();if(k.is("a[href]")){i.push({className:"image-link-edit",text:d("propertypanel.images_link_edit"),tooltip:d("propertypanel.images_link_edit_tooltip"),click:function(){h.destroy();j.selection.select(k[0]);w.LinkBrowser.open()}});i.push({className:"image-link-remove",
text:d("propertypanel.images_link_remove"),tooltip:d("propertypanel.images_link_remove_tooltip"),click:function(){h.destroy();j.execCommand("mceConfUnlink",false,c);j.focus()}})}else i.push({className:"image-make-link",text:d("propertypanel.images_link_create"),tooltip:d("propertypanel.images_link_create_tooltip"),click:function(){h.destroy();j.selection.select(c);w.LinkBrowser.open()}});for(var l=h.Image.pluginButtons,r=0;r<l.length;r++)if(l[r]===null)i.push(null);else{var m=l[r].create(a);m&&i.push(m)}h.createFromButtonModel(this.name,
c,i,{anchorIframe:g.Rte.getEditorFrame()});a=f("#image-size-input");a.bind("focus",function(){f(this).select()});a.bind("change",function(){b()});(new G(window.navigator.userAgent)).isIE()&&a.bind("keyup",function(a){a.keyCode===13&&b()});h.current.imageProps=e;q(e);var o=e;return{setPresetSize:function(a){z(o,a)},setPixelSize:function(a){p(o,a)},setToOriginalSize:function(){B(o)},toggleBorder:function(){C(o)},getWidth:function(){return o.width},getHeight:function(){return o.height},getDisplayWidth:function(){return f("#image-size-input").val()},
isButtonSelected:function(a){return h.current.panel.find(t[a]).hasClass("selected")}}}}}});require("confluence/module-exporter").exportModuleAsGlobal("confluence-editor/tinymce3/plugins/propertypanel/js/property-panel-images","AJS.Confluence.PropertyPanel.Image",function(f){var g=require("ajs");g.bind("init.rte",function(){g.trigger("add-handler.property-panel",f)})});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/propertypanel/js/property-panel-macros.js' */
define("confluence-editor/tinymce3/plugins/propertypanel/js/property-panel-macros","ajs tinymce jquery document confluence/macro-js-overrides confluence-editor/utils/tinymce-macro-utils underscore confluence/property-panel confluence-macro-browser/macro-parameter-serializer".split(" "),function(c,q,e,u,r,A,i,s,y){var t=[],v=[],l={},j="__PROPERTY_PANEL_SPACER",m={key:j},k,g,o=function(a,e,d){Array.isArray(a)||(a=[a]);a.forEach(function(b){i.contains(i.pluck(t,"id"),b)||t.push({id:b,handler:e,macroName:d})})},
z=function(a,n,d){a=i.map(a,function(b){return b.type==="button"?[{key:b.key,label:b.label.value},m]:b.type==="group"&&b.controls.length>0?i.map(b.controls,function(b){return{key:b.key,label:b.label.value}}).concat(m):b.type==="togglegroup"&&b.controls.length>0?i.map(b.controls,function(a){var h={key:a.key,label:a.label.value,group:b.macroParameter,selected:d[b.macroParameter]===a.macroParameterValue},i=a.macroParameterValue,j=b.macroParameter;o(h.key,function(a,b,d){var f={};f[j]=i;a=k;b=c.MacroBrowser.getMacroParams(a);
e.extend(b,f);f=e(a).find(".wysiwyg-macro-body").text();A.updateMacro(b,f,n,a).done(function(a){d.parent().children().filter(".macro-property-group-"+j).removeClass("selected");d.addClass("selected");k=a;g=e(k)})},n);return h}).concat(m):m});return i.flatten(a)};return{name:"macro",registeredEvents:t,canHandleElement:function(a){return a.hasClass("editor-inline-macro")||a.hasClass("wysiwyg-macro")},handle:function(a){function n(){var a="macro-placeholder-property-panel-remove-button";b.length>0&&
b[b.length-1].key==j&&(a=a+" first");h.push({className:a,text:"Remove",click:function(){s.destroy();c.Rte.getEditor().execCommand("mceConfRemoveMacro",k)}});if(g.attr("data-macro-parameters")){var p=y.deserialize(g.attr("data-macro-parameters"));if("atlassian-macro-output-type"in p){a=function(a){return function(b){p["atlassian-macro-output-type"]=a;g.attr("data-macro-parameters",y.serialize(p));a=="INLINE"?e(".macro-placeholder-property-panel-display-newline-button").removeClass("selected"):
e(".macro-placeholder-property-panel-display-inline-button").removeClass("selected");e(b).addClass("selected")}};h.push(null);h.push({className:"macro-placeholder-property-panel-display-newline-button",tooltip:"Display on new line",selected:p["atlassian-macro-output-type"]=="BLOCK",click:a("BLOCK")});h.push({className:"macro-placeholder-property-panel-display-inline-button",tooltip:"Display inline",selected:p["atlassian-macro-output-type"]==
"INLINE",click:a("INLINE")})}}e.each(t,function(){(!this.macroName||this.macroName==d)&&e(u).bind(w(this.id,this.macroName),this.handler)});a=v;d&&l[d]&&(a=a.concat(l[d]));e.each(a,function(){try{this(k,h,o)}catch(a){c.debug("Property panel init handler failed for : "+d+".  Is global handler : "+(e.inArray(this,v)>-1),a)}});if(h.length>0){var a=s.createFromButtonModel("macro",k,h,o),f=r.getFunction(d,"propertyPanelIFrameInjector");f&&f(a)}}if(!(a.e.type!=="click"&&a.e.type!=="mouseup")){k=a.containerEl;
g=e(k);var d,b=[],a=!g.hasClass("editor-inline-macro"),i=!g.hasClass("wysiwyg-unknown-macro"),h=[],o={originalHeight:a&&g.height(),anchorIframe:c.Rte.getEditorFrame()},w=function(a,b){return a+"-button-click"+(b?b+".macro":"")+".property-panel"};if(i){var x=e.Deferred();d=g.attr("data-macro-name");if(c.MacroBrowser.getMacroMetadata(d))b=c.MacroBrowser.getMacroMetadata(d).buttons;(a=r.getFunction(d,"waitForPropertyPanelEventBindings"))&&a();(a=r.getFunction(d,"getControls"))?a(function(a){var e=b,
a=z(a,d,c.MacroBrowser.getMacroParams(g[0]));b=e.concat(m).concat(a);x.resolve()}):x.resolve();x.done(function(){var a="macro-placeholder-property-panel-edit-button";b.length>0&&b[0].key===j&&(a=a+" last");h.push({className:a,text:"Edit",click:function(){s.destroy();q.confluence.macrobrowser.editMacro(g)}});e.each(b,function(a,f){if(f.key!=j){var c="macro-property-panel-"+f.key;f.group&&(c=c+(" macro-property-group-"+f.group));a>0&&b[a-1].key==j&&(c=c+" first");
a<b.length-1&&b[a+1].key==j&&(c=c+" last");h.push({className:c,text:f.label,parameterName:f.key,click:function(a){e(u).trigger(w(f.key),g);e(u).trigger(w(f.key,d),[g,e(a)]);var b=r.getFunction(d,"handlePropertyPanelEvent");if(b){a.attr("aria-disabled","true");setTimeout(function(){if(a.attr("aria-disabled")==="true"){a.find(".panel-button-text").css("visibility","hidden");a.spin()}},2E3);b("click",f.key,d).done(function(){a.attr("aria-disabled","false");a.find(".panel-button-text").css("visibility",
"visible");a.spinStop()})}else s.destroy()},selected:f.selected})}})}).then(n())}else n()}},registerButtonHandler:o,registerInitHandler:function(a,c){if(c){l[c]=l[c]||[];l[c].push(a)}else v.push(a)},yieldButtonFor:function(a,c){var d;e.each(a,function(){this.parameterName&&this.parameterName==c&&(d=this)});return d},_convertToMacroButtons:z}});
require("confluence/module-exporter").exportModuleAsGlobal("confluence-editor/tinymce3/plugins/propertypanel/js/property-panel-macros","AJS.Confluence.PropertyPanel.Macro",function(c){var q=require("ajs");q.bind("init.rte",function(){q.trigger("add-handler.property-panel",c)})});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/conftable/editor_plugin_src.js' */
define("confluence-editor/tinymce3/plugins/conftable/editor_plugin_src",["jquery","tinymce"],function(d,a){return{init:function(h){!a.isIE8&&h.onKeyDown.add(function(f,c){if(c.altKey&&!(38!==c.keyCode&&40!==c.keyCode)){var e=f.selection.getRng(!0),b=d(e.startContainer).closest("td.confluenceTd, th.confluenceTh",".mceContent");if(0!==b.length){f.execCommand(38===c.keyCode?"mceTableInsertRowBefore":"mceTableInsertRowAfter");var b=b.parent()[38===c.keyCode?"prev":"next"]().find("td:first-child")[0],
g=d(b);g.hasClass("numberingColumn")&&(b=g.next()[0]);e.setStart(b,0);e.setEnd(b,0);f.selection.setRng(e);return a.dom.Event.prevent(c)}}})},getInfo:function(){return{longname:"Confluence Table Plugin",author:"Atlassian",authorurl:"http://www.atlassian.com",version:a.majorVersion+"."+a.minorVersion}}}});
require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/conftable/editor_plugin_src",function(d){var a=require("tinymce");a.create("tinymce.plugins.ConfluenceTablePlugin",d);a.PluginManager.add("conftable",a.plugins.ConfluenceTablePlugin)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/deletecommand/editor_plugin_src.js' */
define("confluence-editor/tinymce3/plugins/deletecommand/editor_plugin_src",["jquery","ajs","tinymce"],function(b,c,f){return{init:function(d){d.addCommand("mceDelete",function(g,h){(function(){if(f.isWebKit){var a=d.selection.getRng(1);if(a.collapsed)return!1;var e=b(a.startContainer).closest(".wysiwyg-macro-body",d.getBody())[0];if(e&&c.EditorUtils.isRangeAtStartOf(e,a)&&c.EditorUtils.isRangeAtEndOf(e,a))return a=b(e.firstChild).is("pre")?"pre":"p",a=b("<"+a+"><br data-mce-bogus='1'></"+a+">")[0],
b(e).html(a),d.selection.select(a,1),!0}return!1})()||d.getDoc().execCommand("Delete",g,h)})},getInfo:function(){return{longname:"Delete Command Plugin",author:"Atlassian",authorurl:"http://www.atlassian.com",version:f.majorVersion+"."+f.minorVersion}}}});require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/deletecommand/editor_plugin_src",function(b){var c=require("tinymce");c.create("tinymce.plugins.DeleteCommandPlugin",b);c.PluginManager.add("deletecommand",c.plugins.DeleteCommandPlugin)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/draggable/editor_plugin_src.js' */
define("confluence-editor/tinymce3/plugins/draggable/editor_plugin_src",["jquery","ajs","confluence/property-panel"],function(h,g,y){function H(b){if(1===b.which&&b.target===b.currentTarget)if(d)q(b);else{d=h(b.target);e.selection.select(b.target);b.preventDefault();i.bind({"mousemove.moveable-zone":I,"mouseup.moveable-zone":q,"keydown.moveable-zone":J,"mouseover.moveable-zone":l});var a=d.offset();t=b.pageX;u=b.pageY;z=a.top-u;A=a.left-t;r=!0;b=d;m=b.attr("style")||"";d=b}}function J(b){27===b.keyCode&&
(k.cancelScrolling(),i.unbind(".moveable-zone"),e.undoManager.undo(),e.selection.select(d[0]),e.selection.collapse(!1),d=null)}function l(){i.find(".mceSelected").removeClass("mceSelected")}function I(b){var a;if(r){a=Math.abs(t-b.pageX);var f=Math.abs(u-b.pageY);if(a<B&&f<B)return;g.Rte.BookmarkManager.storeBookmark();e.undoManager.beforeChange();e.undoManager.typing=!0;e.undoManager.add();g.trigger("synchrony.stop",{id:C});(a=e.selection.getSel())&&a.removeAllRanges&&a.removeAllRanges();d.css({position:"absolute",
width:d.css("width"),"max-width":"50%"});y.current&&y.destroy();d.detach();g.Rte.Cursor.fixCursorTargets(g.Rte.getEditor().getBody());n.append(d);var D=d,o=function(){return i.find("#move-indicator")},q=function(b,a){var c=h(i[0].elementFromPoint(b,a)),j=!0;if(c.is(s)&&"move-indicator"!==c.attr("id")&&!(c.is("td.wysiwyg-macro-body")&&"PLAIN_TEXT"===c.closest("table").attr("data-macro-body-type")||c.is("img")&&!D.is("img"))){j=c;if(c.is("img")){var d;d=c.offset();d=b+i.scrollLeft()-d.left;c=c.width()}else d=
v(c,a),c=c.height();c=d<c/2;return{target:j,before:c}}if(l?c.is(E):c.is(F)){c=c.is("div.cell")?c.children("div.innerCell").first():c;if(0>v(c.children().first(),a))c=c.children().first();else{d=c.children().last();j=v(d,a);d=d.height();if(0<j-d)c=c.children().last();else{if(0<o().length&&0<o().parent(c).length)return null;j=c;c=D.parent(s);c.length||(c=j.find(s).last());c.length||(c=n.find(s).last())}j=!1}return{target:c,before:j}}return null},v=function(b,d){var c=b.offset();return d+i.scrollTop()-
c.top},l=!!n.children(".contentLayout,.contentLayout2").length;p={positionNear:function(b,d){var c;if(c=q(b,d)){var a=c.target;c=c.before;if("move-indicator"!==a.attr("id")){var f=o();if(!a.is(G)||!a.find(f).length){f.length?f.detach():f=h('<span id="move-indicator">|</span>');if(a.is(G)){var e=a.children().first();e.is(K)&&(a=e)}!a.is("img")&&g.Rte.Cursor.isTextContainerEmpty(a[0])?a.prepend(f):a.is(L)?c?a.prepend(f):a.append(f):c?a.before(f):a.after(f)}}}},replaceWith:function(a){var b=o();if(b.length){var c;
if(c=a.is(M))c=b.parent(),c=l?c.is(E):c.is(F);c&&(a=h("<p></p>").append(a));b.replaceWith(a);e.dom.isBlock(a[0])&&a.parent().is("p")&&a.unwrap();g.Rte.showElement(a);e.selection.select(a[0]);e.selection.collapse(!0)}else g.debug("No cursor - abort drop"),e.undoManager.undo();g.Rte.Cursor.fixCursorTargets(g.Rte.getEditor().getBody())},destroy:function(){var a=o();a.length&&(a.remove(),g.Rte.Cursor.fixCursorTargets(g.Rte.getEditor().getBody()))}};r=!1}b.preventDefault();d.hide();var f=b.clientY,m;a=
w.length;f=Math.max(f,0);f<a?k.scrollUp(w[f]):(m=x.height(),f=Math.max(0,m-f),f<a?k.scrollDown(w[f]):k.cancelScrolling());p.positionNear(b.clientX,b.clientY);a=Math.min(b.pageY+z,k.scrollHeight()-d.outerHeight());d.css({top:a,left:b.pageX+A,opacity:0.5});d.show()}function q(b){i.unbind(".moveable-zone");k.cancelScrolling();r?d=null:(b.preventDefault(),d.detach(),d.attr("style",m),p.replaceWith(d),p.destroy(),p=d=null,l(),e.undoManager.add(),g.trigger("synchrony.start",{id:C}))}if(!(h.browser.msie&&
8>=h.browser.version)){var M="img",B=10,e,x,i,n,z,A,t,u,d,m,r,k,p,w=[800,800,400,400,400,300,300,300,300,300,300,300,300,300,300,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100],C="confluence.draggable-plugin",E="div.innerCell,div.cell",F="body",s="p,h1,h2,h3,h4,h5,h6,blockquote,li,td,th,img",G="li,td,th",K="p,h1,h2,h3,h4,h5,h6,blockquote",L="li,td,th";return{init:function(b){e=b;b.onInit.add(function(){x=h(b.getWin());i=h(b.getDoc());
n=h(b.getBody());h(x[0].parent);var a=h.browser.webkit?n:i.find("html"),d=0;k={scrollUp:function(b){d!==-b&&(d=-b,b=1E3*(a.scrollTop()/b),a.stop(!1,!1),a.animate({scrollTop:0},{duration:b}))},scrollDown:function(b){var e;d!==b&&(d=b,e=a[0].scrollHeight,b=1E3*((e-a.scrollTop())/b),a.stop(!1,!1),a.animate({scrollTop:e},{duration:b}))},cancelScrolling:function(){d=0;a.stop(!0,!1)},scrollHeight:function(){return a[0].scrollHeight}};i.delegate("img.confluence-embedded-image,img.editor-inline-macro,table.wysiwyg-macro",
{mousedown:H})})},getInfo:function(){return{longname:"Draggable objects (images, tables, placeholders) around the document via drag and drop",author:"Atlassian",authorurl:"http://www.atlassian.com",version:"1.0"}}}}});require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/draggable/editor_plugin_src",function(h){var g=require("tinymce");g.create("tinymce.plugins.draggable",h);g.PluginManager.add("draggable",g.plugins.draggable)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'editor/atlassian-editor.js' */
define("confluence-editor/editor/atlassian-editor",["tinymce","ajs","jquery","window","document"],function(f,b,d,g,h){function j(a){a=a&&a.jquery?a[0]:a;if(!a)return!1;if("BR"===a.tagName||3===a.nodeType)a=a.parentNode;a&&9===a.nodeType&&(a=null);return a}var k=parseInt(d.browser.version,10);return{Rte:{HIDDEN_CHAR:"\ufeff",ZERO_WIDTH_WHITESPACE:"&#x200b;",editorId:"wysiwygTextArea",isQuickEdit:!1,getEditor:function(){return f.activeEditor},getCurrentBaseUrl:function(){if(!this.currentBaseUrl){var a=
h.location;this.currentBaseUrl=a.protocol+"//"+a.hostname+(a.port?":"+a.port:"")}return this.currentBaseUrl},showSelection:function(a){b.Rte.showElement(f.activeEditor.selection.getStart(),a)},isAnyPartShown:function(a){a=j(a);if(!a)return b.debug("AJS.Rte.isAnyPartShown: no element to find"),!1;var c=d(a),a=c.offset().top,c=a+c.outerHeight(),e=d(b.Rte.getEditor().getDoc()).scrollTop(),f=e+d(b.Rte.getEditorFrame()).height();return c>e&&a<f},showElement:function(a,c){var e=j(a);if(!e)return b.log("AJS.Rte.showElement: no element to show - skipping"),
!1;var f=d(e),e=b.Rte.getEditor(),i=d(e.getDoc()),e=f.offset().top,f=e+f.outerHeight(),i=i.scrollTop(),g=i+d(b.Rte.getEditorFrame()).height(),h=function(){b.Rte.bindScroll("AJS.Rte.showElement",function(){b.Rte.unbindScroll("AJS.Rte.showElement");setTimeout(c,1)})};e<i?(b.Rte.scrollTo(e),c&&h()):f>g?(b.Rte.scrollTo(Math.min(e,i+f-g)),c&&h()):c&&c()},scrollTo:function(a){var c=b.Rte.getEditor(),a=Math.ceil(a);d(c.getDoc()).scrollTop(a)},bindScroll:function(a,c){var e=b.Rte.getEditor();d(h).add(e.getDoc()).add(e.getWin()).bind("scroll."+
a,c)},unbindScroll:function(a){var c=b.Rte.getEditor();d(h).add(c.getDoc()).add(c.getWin()).unbind("scroll."+a)},getMainEditor:function(){var a=f.EditorManager.editors[b.Rte.editorId];if(!a)throw Error("Main editor has not been initialised yet and is therefore not accessible via tinymce.EditorManager.editors");return a},getEditorContainer:function(){return d("#wysiwyg")},getEditorFrame:function(){return d("#"+b.Rte.getEditor().id+"_ifr")[0]},getEditorTable:function(){return d("#"+b.Rte.getEditor().id+
"_tbl")},webResourcePath:"/download/resources/com.atlassian.confluence.tinymceplugin%3Atinymceeditor/",getResourceUrlPrefix:function(){this.resourceUrlPrefix||(this.resourceUrlPrefix=this.getCurrentBaseUrl()+b.Meta.get("editor-plugin-resource-prefix"));return this.resourceUrlPrefix},getTinyMceBaseUrl:function(){this.absoluteUrl||(this.absoluteUrl=this.getResourceUrlPrefix()+this.webResourcePath+"tinymcesource/");return this.absoluteUrl},getMinEditorHeight:function(){return+b.Meta.get("min-editor-height")},
getTinyMceEditorMinHeight:function(a){var a=a||0,c=b.Rte.getMinEditorHeight(),e=0;if(c)return c;d("#editor-precursor,#header-precursor,#header").each(function(){e+=d(this).outerHeight(!0)});return d(g).height()-e-a},fixEditorFocus:function(){b.log("WARNING: The fixEditorFocus method has been deprecated and it will be removed in an upcoming Confluence release.");if(f.isGecko&&!isNaN(k)&&30>k){var a=b.Rte.getEditor().getBody();b.log("Fixing FF cursor positioning");"true"==a.contentEditable&&(a.contentEditable=
!1,a.contentEditable=!0)}},editorFocus:function(a){if(a&&!a.destroyed){var c;c=a.dom.getRoot();f.isWebKit&&!d(c).parents("body").length&&(c=d(a.getBody()).find("p:first-child")[0]);c?(a.selection.select(c,1),a.selection.collapse(1),c.focus()):b.log("editorFocus was called with an invalid node");a.getBody().focus();a.getWin().focus()}}},KEYS:{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46,META:91}}});
require("confluence/module-exporter").safeRequire("confluence-editor/editor/atlassian-editor",function(f){var b=require("ajs"),d=require("jquery"),g=require("tinymce");b.Rte=d.extend(f.Rte,b.Rte);g.VK=d.extend(f.KEYS,g.VK)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'editor/atlassian-editor-content.js' */
define("confluence-editor/editor/atlassian-editor-content",["jquery","ajs"],function(c,b){return{offset:function(a){var a=c(a).offset(),e=c(b.Rte.getEditorFrame()),g=e.offset(),d=e[0].contentWindow.document,f=c(b.Rte.getEditor().getBody()),e=c.support.boxModel&&d.documentElement.scrollTop||f.scrollTop(),d=c.support.boxModel&&d.documentElement.scrollLeft||f.scrollLeft();return{top:a.top-e+g.top,left:a.left-d+g.left}},getSelectedText:function(){var a=b.Rte.getEditor().selection;return a.getRng().text||
a.getSel()&&a.getSel().toString&&a.getSel().toString()||""},setHtml:function(a){a&&b.Rte.getEditor().setContent(a)},getHtml:function(){return""+b.Rte.getEditor().getContent()},isEmpty:function(){var a=b.Rte.getEditor().getContent().replace("&nbsp;","").replace("<br />","");return"<p></p>"===c.trim(a)},editorHasContentChanged:function(){return b.Rte.getEditor().isDirty()},editorResetContentChanged:function(){b.Rte.getEditor().setDirty(!1)},getChildIndex:function(a,b){for(var c=a.childNodes,d=0,f=c.length;d<
f;d++)if(c[d]==b)return d;return-1}}});require("confluence/module-exporter").exportModuleAsGlobal("confluence-editor/editor/atlassian-editor-content","AJS.Rte.Content");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'bookmark/atlassian-editor-bookmark-manager.js' */
define("confluence-editor/atlassian-editor-bookmark-manager",["tinymce"],function(c){var b;return{storeBookmark:function(){var a=c.activeEditor,d=c.DOM.getViewPort(c.activeEditor.getWin());a.focus();a=a.selection.getRng();a=a.cloneRange&&"function"===typeof a.cloneRange?a.cloneRange():a.duplicate&&a.duplicate()||a;b={scrollX:d.x,scrollY:d.y,range:a}},restoreBookmark:function(){var a=c.activeEditor.selection,d=c.activeEditor.getWin();b&&(d.scrollTo(b.scrollX,b.scrollY),d.focus(),a.setRng(b.range));
b=null}}});require("confluence/module-exporter").exportModuleAsGlobal("confluence-editor/atlassian-editor-bookmark-manager","AJS.Rte.BookmarkManager");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'support/atlassian-editor-support.js' */
define("confluence-editor/support/atlassian-editor-support",["ajs","confluence/meta"],function(c,b){return{inlineTasks:function(){var a=b.get("use-inline-tasks");return"true"===a||!0===a},isCollaborativeContentType:function(){var a=b.get("content-type");return b.get("collaborative-content")&&("page"===a||"blogpost"===a)}}});require("confluence/module-exporter").exportModuleAsGlobal("confluence-editor/support/atlassian-editor-support","AJS.Rte.Support");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'event/tinymce-event-delegator.js' */
define("confluence-editor/event/tinymce-event-delegator",[],function(){return function(h){var c={},f={},i=function(d,b){var a,e;for(e in c)if(c.hasOwnProperty(e)&&c[e].isEnabled)for(var g=0,f=c[e].events.length;g<f;g++)a=c[e].events[g],-1<a.type.toLowerCase().indexOf(b.type)&&(a.shouldTrigger(d,b)?a.callback.apply(this,[b.target]):a.missed&&a.missed())};return{addEventsForComponent:function(d,b){d in c||(c[d]={},c[d].events=[],c[d].isEnabled=!0);for(var a=0,e=b.length;a<e;a++)b[a].type in f||(f[b[a].type]=
!0,h[b[a].type].add(i)),"function"!==typeof b[a].shouldTrigger&&function(c){b[a].shouldTrigger=function(a,b){return b.target.tagName.toLowerCase()==c}}(b[a].shouldTrigger),c[d].events.push(b[a])},disableEventsForComponent:function(d){for(var b=0,a=c.length;b<a;b++)if(d in c)return c[d].isEnabled=!1,!0;return!1},enableEventsForComponent:function(d){for(var b=0,a=c.length;b<a;b++)if(d in c)return c[d].isEnabled=!0;return!1}}}});
require("confluence/module-exporter").exportModuleAsGlobal("confluence-editor/event/tinymce-event-delegator","AJS.Rte.EventDelegator");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'oninit/tinymce-cursor-fixes.js' */
define("confluence-editor/oninit/tinymce-cursor-fixes",["jquery","tinymce","ajs"],function(e,d,h){function l(a){if(0===e(a).closest("td").length)return!0;for(a=a.parentNode;"td"!==a.nodeName.toLowerCase();){if(e(a).prevAll().contents().filter(function(){return 3===this.nodeType}).length)return!1;a=a.parentNode}return!0}function m(a,b,g){if(b.compareEndPoints)return a=a.getBody().createTextRange(),a.moveToElementText(g),a.collapse(1),0===b.compareEndPoints("StartToStart",a)&&l(g);if(!a.selection.getSel().isCollapsed)return!1;
g=b.startContainer;if(3===g.nodeType)return!g.previousSibling&&0===b.startOffset&&l(g);if(e(g).is("p:first-child"))return 0===b.startOffset;if(e(g).is(".wysiwyg-macro-body"))return 1==b.startOffset&&3===b.startContainer.childNodes[0].nodeType&&"\n"==b.startContainer.childNodes[0].nodeValue}function k(a,b,g){if(b.compareEndPoints)return a=a.getBody().createTextRange(),a.moveToElementText(g),a.collapse(0),0===b.compareEndPoints("EndToEnd",a);if(!a.selection.getSel().isCollapsed)return!1;g=b.endContainer;
return 3===g.nodeType?g.wholeText.length==b.endOffset:e(g.childNodes[b.endOffset]).is(":last-child")}function i(a,b,g){var c=a.dom.create("p",0,d.isIE?"&nbsp;":'<br data-mce-bogus="1" />');g?b.after(c):b.before(c);a.selection.select(c,!0);a.selection.collapse()}return{insertParagraph:i,isCursorAtStart:m,isCursorAtEnd:k,bindCursorFixes:function(){var a=h.Rte.getEditor();d.isIE&&a.onKeyPress.add(function(b,a){var c=b.selection,f=c.getNode();if(13===a.keyCode&&"P"===f.nodeName&&b.dom.is(f,":first-child")&&
d.confluence.MacroUtils.isInMacro(f)){var e=b.dom.create("p","&#x200b");b.dom.insertAfter(e,f);c.select(e,1);c.collapse();return d.dom.Event.cancel(a)}});d.isGecko&&a.onKeyPress.add(function(b,a){var c,f,d;a.charCode==e.ui.keyCode.SPACE&&(c=b.selection.getNode(),f=e(c).closest("a"),d=b.selection.getRng(),f.length&&k(b,b.selection.getRng(),c)&&(d.setStartAfter(f[0]),d.setEndAfter(f[0]),b.selection.setRng(d),b.selection.collapse()))});a.onKeyPress.addToTop(function(b,a){if(13===a.keyCode&&!a.shiftKey){var c=
b.selection.getNode(),f=e(c).closest("pre");if(f.length&&!d.confluence.MacroUtils.isInMacro(f)&&k(b,b.selection.getRng(),c))return i(b,f,!0),d.dom.Event.cancel(a);f=e(c).closest("blockquote");if(f.length){var j=e(c).closest("p");if(j.is(":first-child")&&m(b,b.selection.getRng(),c))return i(b,f,!1),d.dom.Event.cancel(a);if(c=j.is(":last-child"))c=j.contents(),c=!c.length||1===c.length&&(c.is("br")||"&nbsp;"==c.html()||160===c.text().charCodeAt(0)||3===c[0].nodeType&&c[0].nodeValue==h.Rte.HIDDEN_CHAR)?
!0:!1;if(c)return b.dom.remove(j[0],!1),i(b,f,!0),d.dom.Event.cancel(a)}}return!0})}}});require("confluence/module-exporter").safeRequire("confluence-editor/oninit/tinymce-cursor-fixes",function(e){var d=require("ajs"),h=require("jquery");d.Rte=d.Rte||{};d.Rte.Cursor=d.Rte.Cursor||{};h.extend(d.Rte.Cursor,{insertParagraph:e.insertParagraph,isCursorAtStart:e.isCursorAtStart,isCursorAtEnd:e.isCursorAtEnd});d.bind("init.rte",e.bindCursorFixes)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/highlightnode/editor_plugin_src.js' */
define("confluence-editor/tinymce3/plugins/highlightnode/editor_plugin_src",["jquery","ajs","document","tinymce"],function(b,a,g,f){return{init:function(f){a.debug("Hightlight Current Node Plugin");var j="strong em u s sub sup a code h1 h2 h3 h4 h5 h6 pre".split(" "),h={strong:"Bold",em:"Italic",u:"Underline",s:"Strikethrough",sub:"subscript",sup:"superscript"};f.onNodeChange.add(function(c,e,d){var e=b(d),a=b(".highlight-marker",c.getBody()),c=-1!=b.inArray(d.nodeName.toLowerCase(),j)&&!(d.nodeName.toLowerCase()in
h&&!c.queryCommandState(h[d.nodeName.toLowerCase()]))&&!(!(d.nodeName.toLowerCase()in h)&&!c.formatter.match(d.nodeName.toLowerCase()));if(!e.hasClass("highlight-marker")||!c)a&&a.removeClass("highlight-marker"),c&&e.addClass("highlight-marker")});var i=function(c){b(".highlight-marker",c).each(function(){b(this).removeClass("highlight-marker")})};b(g).bind("mode-changed",function(c,a){"preview"===a&&i(b("iframe").contents().find("#content"))});f.onSaveContent.add(function(a,e){var d=b("<div>"+e.content+
"</div>");i(d);e.content=d[0].innerHTML})},getInfo:function(){return{longname:"Atlassian Show Current Node",author:"Atlassian",authorurl:"http://www.atlassian.com",version:f.majorVersion+"."+f.minorVersion}}}});
require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/highlightnode/editor_plugin_src",function(b){var a=require("tinymce"),g=require("ajs");a.create("tinymce.plugins.ShowCurrentNode",b);g.DarkFeatures.isEnabled("highlightnode")&&a.PluginManager.add("highlightnode",a.plugins.ShowCurrentNode)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/iosediting/editor_plugin_src.js' */
define("confluence-editor/tinymce3/plugins/iosediting/editor_plugin_src",["jquery","ajs","tinymce"],function(b,a,c){return{init:function(){c.isIDevice&&setTimeout(function(){b(a.Rte.getEditor().getBody()).addClass("ios")},0)},getInfo:function(){return{longname:"iOS Comments Plugin",author:"Atlassian",authorurl:"http://www.atlassian.com",version:c.majorVersion+"."+c.minorVersion}}}});
require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/iosediting/editor_plugin_src",function(b){var a=require("tinymce");a.create("tinymce.plugins.iOSEditing",b);a.PluginManager.add("iosediting",a.plugins.iOSEditing)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/overrides/dom-utils.js' */
define("confluence-editor/tinymce3/overrides/dom-utils",["ajs","jquery"],function(b,d){return{getRoot:function(){var a=b.Rte.getEditor(),e=a.dom,c=e.settings;if(!(c=c&&e.get(c.root_element)))a=d(a.selection.getNode()).closest("div.innerCell"),c=0<a.length?a[0]:e.doc.body;return c},setRoot:function(a){b.Rte.getEditor().dom.settings.root_element=a}}});
require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/overrides/dom-utils",function(b){var d=require("tinymce");d.dom.DOMUtils.prototype.getRoot=b.getRoot;d.dom.DOMUtils.prototype.setRoot=b.setRoot});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'toolbar/toolbar-configuration-manager.js' */
define("confluence-editor/toolbar/toolbar-configuration-manager",["jquery"],function(e){return function(c){var d={Formatting:".rte-toolbar-group-formatting",Style:".rte-toolbar-group-style",Indentation:".rte-toolbar-group-indentation",Lists:".rte-toolbar-group-lists",Tasks:".rte-toolbar-group-task-lists",Justification:".rte-toolbar-group-justification",Links:".rte-toolbar-group-link",Table:".rte-toolbar-group-table",Insert:".rte-toolbar-group-insert",Undo:".rte-toolbar-group-undo",PageLayouts:"#page-layout-2-group",
SearchReplace:".rte-toolbar-group-searchreplace",Help:".rte-toolbar-group-help"};return{configureToolbar:function(a){if(!1===a)c.hide();else{var a=a||{},b;for(b in a)a.hasOwnProperty(b)&&d[b]&&!1===a[b]&&e(d[b],c).hide()}}}}});require("confluence/module-exporter").exportModuleAsGlobal("confluence-editor/toolbar/toolbar-configuration-manager","AJS.Confluence._ToolbarConfigurationManager");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'loader/tinymce-bootstrap.js' */
define("confluence-editor/loader/tinymce-bootstrap","ajs underscore jquery document confluence/meta confluence/performance-session confluence-editor/support/atlassian-editor-support".split(" "),function(b,q,c,i,j,p,r){var n={atlassian:true,keep_values:true,convert_urls:true,relative_urls:false,remove_script_host:false,button_tile_map:true,gecko_spellcheck:true,apply_source_formatting:false,list_outdent_on_enter:true,visual:false,confluence_table_style:"confluenceTable",confluence_table_cell_style:"confluenceTd",
confluence_table_heading_style:"confluenceTh",confluence_table_default_rows:4,confluence_table_default_cols:3,confluence_table_default_heading:true,cleanup:true,cleanup_on_startup:true,fix_list_elements:false,fix_table_elements:true,valid_elements:"@[id|class|style|title|wysiwyg|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],a[*],strong/b,em/i,s,u,#p[align|user],-ol[type|compact],-ul[type|compact],li,br,img[imagetext|longdesc|usemap|src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,-blockquote[cite|markup],-table[*],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,div[*],span[*],-code,#pre[*],address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],object[classid|width|height|codebase|*],param[name|value],embed[type|width|height|src|*],map[name],area[shape|coords|href|alt|target],bdo,button,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|valign|width],dfn,fieldset,form[action|accept|accept-charset|enctype|method],input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value],kbd,label[for],legend,noscript,optgroup[label|disabled],option[disabled|label|selected|value],q[cite],samp,select[disabled|multiple|name|size],small,textarea[cols|rows|disabled|name|readonly],tt,var,big",
extended_valid_elements:"img[*],time[class|datetime|contenteditable|onselectstart|unselectable|oncontrolselect]",formats:{removeformat:[{selector:"h1,h2,h3,h4,h5,h6,pre",remove:"all",split:true,expand:false,block_expand:true,deep:true,block:"*"},{selector:"address,article,b,big,blockquote,center,cite,code,date,dd,del,dfn,dl,dt,em,embed,font,footer,header,hgroup,i,ins,kbd,link,menu,nav,object,param,q,s,samp,script,section,small,strike,strong,style,sub,sup,time,tt,u,var",remove:"all",split:true,expand:false,
block_expand:true,deep:true},{selector:"span",attributes:["style","class"],remove:"empty",split:true,expand:false,deep:true},{selector:"table",attributes:["cellpadding","cellspacing","border"],split:false,expand:false,deep:true},{selector:"*",attributes:["style","color","bgcolor","title","lang"],split:false,expand:false,deep:true}]},forced_root_block:"p",force_p_newlines:true,force_br_newlines:false,oninit:"AJS.Rte.BootstrapManager.onInit",object_resizing:false,paste_preprocess:function(a,b){c(i).trigger("prePaste",
[a,b])},paste_postprocess:function(a,b){c("img",b.node).not("[data-emoticon-name]").not(".editor-inline-macro").not(".confluence-embedded-image").not(".template-variable").addClass("confluence-embedded-image confluence-external-resource");c(i).trigger("postPaste",[a,b])}};return{_tinyMceHasInit:false,_beforeInitCallbacks:[],_tinymcePluginInits:[],_settings:null,isInitComplete:function(){return this._tinyMceHasInit},isEditorActive:function(){var a=require("tinymce");return this.isInitComplete()&&a&&
a.activeEditor},onInit:function(){this._tinyMceHasInit=true;var a=b.Rte.getEditor();c(a.getBody()).addClass("notranslate");b.trigger("init.rte",{editor:a});b.Meta.get("editor-auto-focus")!==false?b.Rte.editorFocus(a):b.debug("Bootstrap: editor-auto-focus=false. Do not focus the editor automatically.")},addOnInitCallback:function(a){if(c.isFunction(a))this._tinyMceHasInit?a():b.bind("init.rte",a);else throw Error("Attempt made to register an oninit callback that is not a function. Received: "+a);},
addBeforeInitCallback:function(a){this._beforeInitCallbacks.push(a)},addTinyMcePluginInit:function(a){this._tinymcePluginInits.push(a)},preInitialise:function(a){this._settings=c.extend(n,a)},initialise:function(a){p.debugTime("confluence.editor.tinymce");var k=require("tinymce");if(this._settings){var a=c.extend({},a),e=c.extend({},this._settings);b.Rte.isQuickEdit=a.isQuickEdit||false;b.debug("Bootstrap:initialise: Initialising TinyMce version "+k.majorVersion+"."+k.minorVersion);c.each(this._beforeInitCallbacks,
function(a,b){b(e)});b.trigger("rte-pre-resolveplugins");for(var d=0,h=this._tinymcePluginInits.length;d<h;d++)if(typeof this._tinymcePluginInits[d]==="function")this._tinymcePluginInits[d](e);var d=e.language,h=require("tinymce"),g=require("confluence-editor/i18n/translations.i18n");b.debug("Bootstrap: set locale translations");typeof g==void 0&&b.log("ERROR: could not find the TinyMCE language pack");var i=RegExp(g.ctrl_key+"\\+","g"),n=RegExp(g.shift_key+"\\+","g"),o=function(a){return a.replace(i,
"\u2318").replace(n,"\u21e7")},f;for(f in g){var l=g[f];if(typeof l==="object")for(var m in l)h.isMac&&(l[m]=o(l[m]));h.EditorManager.addI18n(d+"."+f,g[f])}h.isMac&&c("#rte-toolbar .toolbar-item, #rte-toolbar .dropdown-item, #rte-savebar .aui-button").each(function(){var a=c(this),b=a.attr("title"),d=a.attr("data-tooltip");b&&a.attr("title",o(b));d&&a.attr("data-tooltip",o(d))});(new b.Confluence._ToolbarConfigurationManager(c("#toolbar"))).configureToolbar(a.toolbar);f=a.plugins;m=a.excludePlugins;
d=e.plugins.split(",");d=q.chain(d).union(f).difference(m).value();f=d.join(",");e.plugins=f;e.setup=a.onInitialise;if(j.getBoolean("shared-drafts")&&(j.get("content-type")==="page"||j.get("content-type")==="blogpost")&&j.get("edit-mode")!=="limited")e.iframe_attr={"data-synchrony":"true"};k.init(e);b.Rte.Content.editorResetContentChanged();c(b.Rte.getEditorFrame()).attr("tabindex",100);k.isIE&&c(b.Rte.getEditorFrame()).attr("hidefocus","hidefocus");p.debugTimeEnd("confluence.editor.tinymce");b.trigger("rte-ready");
r.isCollaborativeContentType()&&b.trigger("rte-begin-collab-editing")}else b.log("Bootstrap:initialise: No settings found. Has preInitialise been called?")}}});require("confluence/module-exporter").exportModuleAsGlobal("confluence-editor/loader/tinymce-bootstrap","AJS.Rte.BootstrapManager");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'utils/environment.js' */
define("confluence-editor/utils/environment",["ajs"],function(b){return{isMac:0<=navigator.platform.indexOf("Mac"),transformCmdKeyTextBasingOnOS:function(a){var c="Ctrl";return this.isMac?a.replace(RegExp(c,"g"),"\u2318"):a}}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'utils/editor-utils.js' */
define("confluence-editor/utils/editor-utils",["jquery","tinymce"],function(g,e){var f={isCursorAtStartOf:function(b,a){return a.collapsed&&f.isRangeAtStartOf(b,a)},isRangeAtStartOf:function(b,a){if(!a||!a.startContainer)throw Error("range is invalid. received: "+a);if(!b||!b.nodeType)throw Error("context is invalid. received: "+b);var c=a.startContainer,d;if(3===c.nodeType){if(0!==a.startOffset)return!1;d=c}else if(d=c.childNodes[a.startOffset],void 0===d&&0<c.childNodes.length)return!1;c=new e.dom.TreeWalker(d,
b);do d=c.prev(!0);while(d&&3===d.nodeType&&0===d.nodeValue.length);return void 0===d},isCursorAtEndOf:function(b,a){return a.collapsed&&f.isRangeAtEndOf(b,a)},isRangeAtEndOf:function(b,a){if(!a||!a.endContainer)throw Error("range is invalid. received: "+a);if(!b||!b.nodeType)throw Error("container is invalid. received: "+b);var c=a.endContainer;if(3===c.nodeType){if(a.endOffset!=c.nodeValue.length)return!1}else c=c.childNodes[0===a.endOffset?a.endOffset:a.endOffset-1];var c=new e.dom.TreeWalker(c,
b),d;do d=c.next(!0);while(d&&3===d.nodeType&&0===d.nodeValue.length);return void 0===d||"BR"===d.nodeName&&void 0===c.next(!0)},setCursorAtStartOfContents:function(b){if(!b)throw Error("element is required.");if(1!==b.nodeType&&3!==b.nodeType)throw Error("invalid argument: expected a DOM element or text node, got: "+b);var a=e.activeEditor,c=a.dom.createRng();g(b).is("br, img")?(c.setStartBefore(b),c.setEndBefore(b),a.selection.setRng(c)):(a.selection.select(b,!0),a.selection.collapse(!0))}};return f});
require("confluence/module-exporter").exportModuleAsGlobal("confluence-editor/utils/editor-utils","AJS.EditorUtils");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/table/atlassian-table.js' */
define("confluence-editor/tinymce3/plugins/table/atlassian-table",["jquery","ajs","tinymce"],function(g,h,l){function p(){return g("#table-highlight-group").attr("data-highlight-colour")||""}function q(c){var j,g,d;j=0;for(g=c.length;j<g;j++)d=c.eq(j),d.attr("data-highlight-colour")&&d.removeAttr("data-highlight-colour"),d[0].className=d[0].className.replace(/( |^)highlight(-\w+)+/g,"")}function n(c,j){if(c.length){var f=h.Rte.getEditor(),d;d=g(h.Rte.getEditor().selection.getNode());d=d.length?d[0]===
c[0]?!0:!!d.closest(c).length:!1;for(var e=c[0],k=e.ownerDocument.createElement(j),i=e.attributes,m=0,l=i.length;m<l;m++){var a=i[m];k.setAttribute(a.nodeName,a.nodeValue)}for(;e.hasChildNodes();)k.appendChild(e.firstChild);e.parentNode.replaceChild(k,e);d&&(f.selection.select(k,!0),f.selection.collapse());return g(k)}}function o(){g(h.Rte.getEditor().getDoc().body).find(".confluenceTd.numberingColumn").attr("contenteditable","false")}var i={convertToNormalCells:function(c){c.filter("th").each(function(){var c=
g(this),c=n(c,"td");c.removeClass("confluenceTh");c.addClass("confluenceTd")})},convertToHeadingCells:function(c){c.filter("td").each(function(){var c=g(this),c=n(c,"th");c.removeClass("confluenceTd");c.addClass("confluenceTh")})},areCellsHeadings:function(c){var g=c.filter("th").length;return c.length===g},isColumnHeading:function(c,j){var f=g(c).children("tbody").children("tr");return 1===f.length?!1:f.children().nthCol(j).filter("th").length===f.length},areCellsHighlighted:function(c){var g=c.filter("td[data-highlight-colour],th[data-highlight-colour]");
if(c=c.length===g.length)a:{var c=p(),f,d,e;f=0;for(d=g.length;f<d;f++)if(e=g.eq(f).attr("data-highlight-colour")||"",e!==c){c=!1;break a}c=!0}return c},isColumnHighlighted:function(c,h){var f=g(c).children("tbody").children("tr").children("th,td").nthCol(h),d=f.filter("td[data-highlight-colour],th[data-highlight-colour]").length;if(f.length!==d)return!1;for(var d=f.eq(0).attr("data-highlight-colour"),e=1,i=f.length;e<i;e++)if(d!==f.eq(e).attr("data-highlight-colour"))return!1;return!0}};h.bind("init.rte",
function(c,j){function f(){var a=e.selection.getNode();return g(a).parents("table").is(".confluenceTable")?!e.dom.getParent(a,"UL,OL"):!1}var d,e=j.editor,k=function(a){return g(a.selection.getNode()).closest("th.confluenceTh,td.confluenceTd")},n=function(a){var b=g(a.getBody()).find("th.confluenceTh.mceSelected,td.confluenceTd.mceSelected");return b.length?b:k(a)},m=function(a){return 0===a.find("tbody > tr > td").length};e.addCommand("mceInsertTable",function(){h.Rte.BookmarkManager.storeBookmark();
if(!d){d=new h.Dialog({width:400,height:230,id:"insert-table-dialog",keypressListener:function(b){27===b.keyCode&&d.hide()}});d.addHeader("Insert Table");d.addPanel("Panel 1","panel1");d.getCurrentPanel().html(h.renderTemplate("tableForm","4","3"));g("#tinymce-table-form input[type='text']").click(function(){g(this).select()});var a=function(b){b.hide();e.plugins.table.insertTable()};g("#tinymce-table-form").keypress(function(b){13===b.keyCode&&a(d)});d.addButton("Insert",a,"ok");d.addCancel("Cancel",
function(b){b.hide();return!1},"cancel")}d.show()});e.addCommand("confTableRowToggleHeading",function(){var a;a=g(this.getBody()).find("td.mceSelected,th.mceSelected");a.length||(a=g(this.selection.getNode()));a=a.closest("tr");for(var b=a.parent(),b=b.is("tbody")?a.parent().parent():b;0!==a.length&&!b.is(".confluenceTable");)a=b.closest("tr"),b=a.parent(),b=b.is("tbody")?a.parent().parent():b;var b=a.children("td,th"),c=0;i.areCellsHeadings(b)?(m(a.closest("table"))||(b=b.filter(function(){var b=
g(this),a=b.closest("table");c+=b.attr("colspan")||1;return!i.isColumnHeading(a,c)})),i.convertToNormalCells(b)):i.convertToHeadingCells(b)});e.addCommand("confTableColumnToggleHeading",function(){var a;a=n(this);var b=g([]);a.each(function(){var a=g(this),c=a.index()+1,a=a.closest("table.confluenceTable").children("tbody").children("tr");b=b.add(a.children().nthCol(c))});a=b;i.areCellsHeadings(a)?(m(a.closest("table"))||(a=a.filter(function(){var a=g(this).parent("tr").children(),b=a.filter("th");
return a.length!==b.length})),i.convertToNormalCells(a)):i.convertToHeadingCells(a)});e.addCommand("confTableSelectionToggleHighlight",function(a,b){var c=b&&b.alwaysHighlight,e=n(this);e.filter("td");e.filter("th");i.areCellsHighlighted(e)&&!c||g("#table-highlight-group").attr("data-remove-highlight")?q(e):(q(e),p()&&(c=p(),e.attr("data-highlight-colour",c),e.addClass("highlight-"+c)))});(l.isIE8||h.DarkFeatures.isEnabled("confluence-table-enhancements.auto-row"))&&e.onKeyDown.add(function(a,b){function c(a,
b){var d=e.selection.getRng(!0),g=d.startContainer;if(d.collapsed){var f;a:{for(f=g;f!=a;){if(f[b]){f=!1;break a}f=f.parentNode}f=!0}return 3===g.nodeType?f&&d.startOffset==("nextSibling"==b?g.length:0):g==a?d.startOffset==("nextSibling"==b?g.childNodes.length-1:0):f}return!1}if((37===b.keyCode||39===b.keyCode)&&!b.shiftKey){var d=k(this);if(d.length){var d=d[0],f;if(f=37===b.keyCode)if(f=c(d,"previousSibling"))f=e.selection.getNode(),f=g(f).parents("table").first().find("tr:first-child").children().first()[0]!=
f;if(f)return e.execCommand("mceTableMoveCaretToPrevCell"),l.dom.Event.cancel(b);if(f=39===b.keyCode){if(d=c(d,"nextSibling"))d=e.selection.getNode(),d=g(d).parents("table").first().find("tr:last-child").children().last()[0]!=d;f=d}if(f)return e.execCommand("mceTableMoveCaretToNextCell"),l.dom.Event.cancel(b)}}});if(l.isWebKit){var o=g('<style type="text/css"></style>').html(".confluenceTable th,td { white-space: pre-wrap; }");g(e.getDoc().head).append(o)}e.onKeyDown.add(function(a,b){if(9===b.keyCode&&
f())return e.execCommand(b.shiftKey?"mceTableMoveCaretToPrevCell":"mceTableMoveCaretToNextCell"),b.preventDefault(),!1});h.DarkFeatures.isEnabled("confluence-table-enhancements.auto-row")&&(e.onClick.add(function(){var a=k(this);a.hasClass("numberingColumn")&&!a.hasClass("confluenceTh")&&e.execCommand("mceTableMoveCaretToNextCell")}),e.onKeyDown.addToTop(function(a,b){if((38===b.keyCode||40===b.keyCode)&&f()&&k(this).hasClass("numberingColumn"))return e.execCommand("mceTableMoveCaretToNextCell"),
b.preventDefault(),!1}))});h.DarkFeatures.isEnabled("confluence-table-enhancements.auto-row")&&(h.bind("quickedit.success",o),h.bind("init.rte",o));return i});require("confluence/module-exporter").exportModuleAsGlobal("confluence-editor/tinymce3/plugins/table/atlassian-table","AJS.Rte.Table");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/table/atlassian-table-picker.js' */
define("confluence-editor/tinymce3/plugins/table/atlassian-table-picker",["ajs","tinymce","jquery","document"],function(c,E,g,O){function F(){e.css({top:g("#insert-table-dropdown").outerHeight(!0)});F=function(){}}function j(){if(!e.hasClass("hidden")){var a=g(c.Rte.getEditor().getDoc());k.unbind(".atlassian-table-picker");a.unbind(".atlassian-table-picker");e.addClass("hidden");q.addClass("hidden");y.removeClass("active")}}function G(a,b){c.debugEnabled()&&c.debug("setSize("+[a,b]+")");a==f&&b==
r||(a=Math.max(1,Math.min(H,a)),b=Math.max(1,Math.min(I,b)),n=Math.max(P,a),s=Math.max(Q,b),f=a,r=b,t.width(n*l+1),t.height(s*m+R),u(o,n,s),u(z,f,r),u(A,n,1),u(v,f,1),J(),K.text(f+" x "+r))}function J(){A.toggleClass("hidden",!h);v.toggleClass("hidden",!h)}function u(a,b,c){a.width(l*b+1);a.height(m*c+1)}function S(a){var b=o.offset(),d=b.top-k.scrollTop(),g=b.left-k.scrollLeft(),b=d+o.outerHeight(!0)+w,e=b-m-w,h=g+o.outerWidth(!0)+w,j=h-l-w,f=a.clientY,i=a.clientX,a=n,p=s;c.debugEnabled()&&c.debug("[mouseX,spLeft,spRightShrink,spRightGrow][mouseY,spTop,spBottomShrink,spBottomGrow] = "+
[i,g,j,h]+"/"+[f,d,e,b]);i>h?(d=~~((i-h)/l+1),a+=d,c.debugEnabled()&&c.debug("grow: xdelta = "+d)):i<j&&(d=~~((i-j)/l-1),a+=d,c.debugEnabled()&&c.debug("shrink: xdelta = "+d));f>b?(d=~~((f-b)/m+1),p+=d,c.debugEnabled()&&c.debug("grow: ydelta = "+d)):f<e&&(d=~~((f-e)/m-1),p+=d,c.debugEnabled()&&c.debug("shrink: ydelta = "+d));G(a,p)}function L(a){c.debugEnabled()&&c.debug("enableHeading("+a+")");a!=h&&(h=a,J())}function B(a){var b;b=~~(~~(a.offsetX||a.originalEvent.layerX)/l)+1;var d=~~(~~(a.offsetY||
a.originalEvent.layerY)/m)+1;b=1>b||b>H||1>d||d>I?null:{width:b,height:d};a.preventDefault();c.debug("insertTable: size = "+(b&&[b.width,b.height]));if(b){j();a=b.width;d=b.height;b=h;var e,f;c.debugEnabled()&&c.debug("shamefulInsertTable("+a+","+d+","+b+")");e=g("#tinymce-table-form");e.length?(e.find('input[name="rows"]').val(d),e.find('input[name="cols"]').val(a)):(a=c.renderTemplate("tableForm",d,a),f=g("<div></div>").addClass("hidden"),f.append(a),M.append(f));g("#table-heading-checkbox").prop("checked",
b);c.Rte.BookmarkManager.restoreBookmark();E.activeEditor.undoManager.beforeChange();E.activeEditor.plugins.table.insertTable();f&&f.remove()}}function x(a){c.debugEnabled()&&c.debug("key: "+a.charCode+"/"+a.keyCode+"/"+a.shiftKey);c.debug("key: "+a.charCode+"/"+a.keyCode+"/"+a.shiftKey);g.browser.msie?(16===a.keyCode&&L(!a.shiftKey),27===a.keyCode&&j()):(0===a.charCode&&L(!a.shiftKey),27===a.keyCode&&0===a.charCode&&j())}function T(){j()}var N={},k,M,q,i,C,y,e,t,o,A,z,v,K,P=4,Q=4,H=15,I=20,l=25,
m=17,R=20,w=0,n,s,f,r,h,D=!1;N.insertTable=B;return{bindToControl:function(){c.debugEnabled()&&c.debug("Table Picker - bind to control");k=g(O);M=k.find("body");i=g("#insert-table-dropdown");C=g("#rte-button-insert-table");y=i.find(".aui-dd-parent");e=g("#table-picker-container");t=e.find(".table-picker-box");o=e.find(".picker-cell");A=e.find(".picker-heading");z=e.find(".picker-selected-cell");v=e.find(".picker-selected-heading");K=t.find(".desc");q=g("<div></div>").attr("id","table-picker-backdrop").addClass("hidden").appendTo(i);
C.click(function(a){a.preventDefault();D||(c.Rte.BookmarkManager.storeBookmark(),F(),h=!0,G(1,1),a=g(c.Rte.getEditor().getDoc()),k.bind("mousemove.atlassian-table-picker",S),k.bind("keydown.atlassian-table-picker",x),k.bind("keyup.atlassian-table-picker",x),a.bind("keydown.atlassian-table-picker",x),a.bind("keyup.atlassian-table-picker",x),q.removeClass("hidden"),e.removeClass("hidden"),y.addClass("active"),C.focus())});q.click(T);z.click(B);v.click(B)},disable:function(){D=!0;i.addClass("disabled")},
enable:function(){D=!1;i.removeClass("disabled")},close:j,_internal:N}});require("confluence/module-exporter").exportModuleAsGlobal("confluence-editor/tinymce3/plugins/table/atlassian-table-picker","AJS.Rte.TablePicker");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/table/atlassian-table-migration.js' */
define("confluence-editor/tinymce3/plugins/table/atlassian-table-migration",["ajs","jquery","confluence-editor/tinymce3/plugins/table/atlassian-table"],function(b,f,g){return function(d){var d=d||f(b.Rte.getEditor().getBody()),h=(new Date).getTime(),e=d.find("td.highlight,th.nohighlight,td[data-highlight-class],th[data-highlight-class]"),d=(new Date).getTime();e.each(function(){var a=f(this),b=a.attr("data-highlight-class"),c;if(a.hasClass("nohighlight"))a.removeClass("nohighlight"),g.convertToNormalCells(a);
else if(a.hasClass("highlight")&&(a.removeClass("highlight"),b||(a.attr("data-highlight-colour","grey"),a.addClass("highlight-grey"))),b){a.removeClass(b);a.removeAttr("data-highlight-class");switch(b){case "warning":c="red";break;case "success":c="green";break;case "note":c="yellow";break;case "info":c="blue"}c&&(a.addClass("highlight-"+c),a.attr("data-highlight-colour",c))}});e=(new Date).getTime();b.debug("Migration duration: selector: "+(d-h)+"ms; migration: "+(e-d)+"ms")}});
require("confluence/module-exporter").exportModuleAsGlobal("confluence-editor/tinymce3/plugins/table/atlassian-table-migration","AJS.Rte.Migration.Table.migrateTables",function(){var b=require("ajs");require("jquery")(document).bind("postPaste",function(){b.Rte.Migration.Table.migrateTables()});b.bind("init.rte",function(){b.Rte.Migration.Table.migrateTables()})});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/tablecontentwrapper/editor_plugin_src.js' */
define("confluence-editor/tinymce3/plugins/tablecontentwrapper/editor_plugin_src",["jquery","ajs","tinymce"],function(d,f){var h=["img:not(.editor-inline-macro, .emoticon)"].concat(["time.non-editable",".editor-inline-macro","a.confluence-link[data-linked-resource-type='userinfo']"]).concat([".wysiwyg-macro"]).join(",");return{init:function(g){f.bind("rte-ready",function(){d(g.dom.select("table.confluenceTable:not(.wrapped)")).each(function(c,b){d(b).addClass("wrapped").find("> tbody > tr > th, > tbody > tr > td, > thead > tr > th").each(function(b,
a){var c=d(a);!c.find("> .content-wrapper").length&&c.find(h).length&&c.wrapInner("<div class='content-wrapper'>")})})});g.onChange.add(function(){var c=g.selection,b=c.getNode(),e=d(b);if(b&&e.closest("table.confluenceTable").not("table.confluenceTable table.confluenceTable").length){b=c.getRng();if(e.is("tr")&&d(b.startContainer).is("tr")&&b.collapsed){var a=e.find(">td, >th").first(),a=a.find(":first-child:not(.content-wrapper)")[0]||a[0].firstChild;b.setStart(a,0);b.setEnd(a,0);c.setRng(b)}a=
e.closest("table.confluenceTable > tbody > tr > th, table.confluenceTable > tbody > tr > td, table.confluenceTable > thead > tr > th");if(a.find(h).length){b=a.find("> .content-wrapper");if(b.length){e=c.getBookmark();for(a=0;a<b.length;a++)b.eq(a).find("> p, > table, > ul, > ol").length||b.eq(a).wrapInner("<p/>"),0<a&&(b.eq(0).append(b.eq(a).children()),b.eq(a).remove())}else a.find("> p").length?(e=c.getBookmark(),a.wrapInner("<div class='content-wrapper'>")):(e=c.getBookmark(),a.wrapInner("<p/>").wrapInner("<div class='content-wrapper'>"));
c.moveToBookmark(e);f.Rte.BookmarkManager.storeBookmark()}}d(g.getWin().document).find(".content-wrapper:empty").remove()})},getInfo:function(){return{longname:"Table Content Wrapper Plugin",author:"Atlassian",authorurl:"http://www.atlassian.com",version:"1.0"}}}});
require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/tablecontentwrapper/editor_plugin_src",function(d){var f=require("tinymce");require("ajs").DarkFeatures.isEnabled("confluence.table.resizable")&&(f.create("tinymce.plugins.TableContentWrapperPlugin",d),f.PluginManager.add("tableContentWrapper",f.plugins.TableContentWrapperPlugin))});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/tableanalytics/editor_plugin_src.js' */
define("confluence-editor/tinymce3/plugins/tableanalytics/editor_plugin_src",["jquery","ajs","tinymce","confluence/analytics-support"],function(d,b,g,e){var f;return{init:function(a){var c=this;f=a;a.onExecCommand.add(function(a,b,e,d){switch(b){case "mceAutoWidth":case "mceRelativeWidth":case "mceFixedWidth":c._onChangeTableMode();break;case "mceTableCopyRow":c._onCopyRow();break;case "mceTablePasteRowBefore":case "mceTablePasteRowAfter":c._onPasteRow();break;case "mceTableCopyCol":c._onCopyCol();
break;case "mceTablePasteColBefore":case "mceTablePasteColAfter":c._onPasteCol();break;case "mceInsertContent":c._onInsertContent(d)}});a.onInit.add(function(){a.selection.onSetContent.add(function(a,b){c._isInsideTable()&&b&&c._onSetContent(b)})});b.bind("analyticsEvent",function(a,b){c._isInsideTable()&&c._onResizeImg(b)});b.bind("rte.safe-save.success",function(){c._onSavePage()})},_onChangeTableMode:function(){e.publish("confluence.table.mode.to."+this._getTableMode(),{pageId:b.Meta.get("page-id")})},
_onCopyRow:function(){e.publish("confluence.table.row.copy",{pageId:b.Meta.get("page-id")})},_onPasteRow:function(){e.publish("confluence.table.row.paste",{pageId:b.Meta.get("page-id")})},_onCopyCol:function(){e.publish("confluence.table.col.copy",{pageId:b.Meta.get("page-id")})},_onPasteCol:function(){e.publish("confluence.table.col.paste",{pageId:b.Meta.get("page-id")})},_onInsertContent:function(a){a=d("<div/>").html(a);a.find("img").length&&this._isInsideTable()&&this._eventInsertImage();a.find("table.confluenceTable").length&&
e.publish("confluence.table.paste",{pageId:b.Meta.get("page-id")})},_onSetContent:function(a){d(a.content).hasClass("confluence-embedded-image")&&this._eventInsertImage()},_onResizeImg:function(a){var c=function(){var a=d(f.selection.getNode()),b=a.closest("th, td");return a.width()>b.width()};a&&(a.name&&0<=a.name.indexOf("confluence.editor.image.resize"))&&e.publish("confluence.table.img.resize",{pageId:b.Meta.get("page-id"),tableMode:this._getTableMode(),isImgBiggerCell:c()})},_eventInsertImage:function(){e.publish("confluence.table.image.insert",
{pageId:b.Meta.get("page-id"),tableMode:this._getTableMode()})},_isInsideTable:function(){return!!d(f.selection.getNode()).closest("table.confluenceTable").length},_getTableMode:function(){var a=d(f.selection.getNode()).closest("table.confluenceTable");return a.hasClass("fixed-table")?"fixed":a.hasClass("relative-table")?"relative":"fluid"},_onSavePage:function(){var a=d(f.getBody()).find("table.confluenceTable");e.publish("confluence.table.quality.in.page",{pageId:b.Meta.get("page-id"),total:a.length,
fixed:a.filter(".fixed-table").length,fluid:a.filter(":not(.fixed-table,.relative-table)").length,relative:a.filter(".relative-table").length,nested:a.find("table.confluenceTable").length})},getInfo:function(){return{longname:"Table Analytics Plugin",author:"Atlassian",authorurl:"http://www.atlassian.com",version:"1.0"}}}});
require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/tableanalytics/editor_plugin_src",function(d){var b=require("tinymce");b.create("tinymce.plugins.TableAnalytics",d);b.PluginManager.add("tableAnalytics",b.plugins.TableAnalytics)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/placeholder/editor_plugin_src.js' */
define("confluence-editor/tinymce3/plugins/placeholder/editor_plugin_src",["jquery","ajs","tinymce"],function(f,d,i){var p={click:!1,keypress:!0},g=i.VK,j=i.dom.Event,q="template"===d.Meta.get("content-type"),m={UL:!0,OL:!0,LI:!0,TABLE:!0,TBODY:!0};return{init:function(k){k.onInit.add(function(){if(q)d.trigger("cursor-target-refresh"),f("#rte-button-insert-placeholder").click(function(b){b.preventDefault();d.Rte.Placeholder.insertTextPlaceHolder()}),k.onKeyPress.addToTop(function(b,c){if(13===c.keyCode&&
!c.shiftKey){var a=b.selection.getNode(),e=f(a).closest(".text-placeholder");if(e.length&&d.Rte.Cursor.isCursorAtEnd(b,b.selection.getRng(),a))return d.Rte.Cursor.insertParagraph(b,e,!0),i.dom.Event.cancel(c)}});else{var r=function(){var b=f(d.Rte.getEditor().getBody()).find(".text-placeholder.selected");b.length&&d.Rte.getEditor().selection.select(b[0])},l=function(b){b.onKeyDown.remove(n);b.onKeyPress.remove(h);b.onClick.remove(h)},n=function(b,c){var a=f(b.getBody()).find(".text-placeholder.selected");
if(a.length){if(c.keyCode===g.LEFT||c.keyCode===g.UP){for(var a=a[0],e=a.previousSibling;a&&!e;)a=a.parentNode,e=a.previousSibling;if(e){for(a=e;m[a.nodeName]&&a.lastChild;)a=a.lastChild;b.selection.select(a.lastChild||a);b.selection.collapse(!1);b.selection.normalize()}return j.cancel(c)}if(c.keyCode===g.RIGHT||c.keyCode===g.DOWN){a=a[0];for(e=a.nextSibling;a&&!e;)a=a.parentNode,e=a.nextSibling;if(e){for(a=e;m[a.nodeName]&&a.firstChild;)a=a.firstChild;b.selection.select(a.firstChild||a);b.selection.collapse(!0);
b.selection.normalize()}return j.cancel(c)}if(c.keyCode===g.BACKSPACE||c.keyCode===g.DELETE)return d.Rte.Placeholder.removePlaceholder(a),j.cancel(c)}else l(b)},h=function(b,c){if(!i.isGecko||c.isChar||"keypress"!==c.type){var a=f(b.getBody()).find(".text-placeholder.selected");if(a.length){if(a.length){var e=a.attr("data-placeholder-type"),g=c.type,h=d.Rte.Placeholder.getPlaceholderType(e);f.extend({},p,h&&h.activation)[g]&&(d.Rte.Placeholder.removePlaceholder(a),d.trigger("editor.text-placeholder.activated",
{placeholderType:e||"",triggerEvent:c}))}}else l(b)}};k.onNodeChange.addToTop(function(b,c,a){c=f(a).closest(".text-placeholder");f(b.getBody()).find(".text-placeholder.selected").not(c).removeClass("selected");c.length?(c.hasClass("selected")||(c.addClass("selected"),b.onKeyDown.addToTop(n),b.onKeyPress.addToTop(h),b.onClick.addToTop(h)),setTimeout(r,0)):l(b)})}var o=f(d.Rte.getEditor().getDoc()).find("head");f.browser.msie?o.append('<style type="text/css">.wiki-content .text-placeholder { display: inline; }</style>'):
o.append('<style type="text/css">.wiki-content .text-placeholder { display: inline-block; }</style>')})},getInfo:function(){return{longname:"Text Placeholder Plugin",author:"Atlassian",authorurl:"http://www.atlassian.com",infourl:"http://www.atlassian.com",version:"1.0"}}}});
require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/placeholder/editor_plugin_src",function(f){var d=require("tinymce");d.create("tinymce.plugins.TextPlaceholderPlugin",f);d.PluginManager.add("textplaceholders",d.plugins.TextPlaceholderPlugin)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/placeholder/placeholder.js' */
define("confluence-editor/tinymce3/plugins/placeholder/placeholder",["jquery","ajs","tinymce"],function(e,b,f){var d=[],i={};b.Rte=b.Rte||{};b.Rte.Placeholder=b.Rte.Placeholder||{};var g,h;f.isIE?(g="\ufeff{$caret}",h="<p>{$caret}</p>"):h=g=f.isWebKit?"\ufeff{$caret}<br>":"\ufeff{$caret}";return{insertTextPlaceHolder:function(a){var c=e("<div></div>").append(b.Rte.Placeholder.Templates.textPlaceholder({content:g}));a&&c.find(".text-placeholder").html(a);b.Rte.getEditor().execCommand("mceInsertContent",
false,c.html())},removePlaceholder:function(a){var c=b.Rte.getEditor(),f=e(c.getBody()),d=g;a.parent()[0].nodeName==="LI"&&(d=h);a.replaceWith('<span id="placeholder-cursor">&nbsp;</span>');a=f.find("#placeholder-cursor")[0];c.selection.select(a.firstChild);c.execCommand("mceInsertContent",false,d);c.dom.remove(a,true)},addPlaceholderType:function(a){if(!a||!a.type)b.log("PlaceHolderRegister : unable to register new place holder type !");else{d.push(a);i[a.type]=a}},getPlaceholderTypes:function(){return[].concat(d)},
getPlaceholderType:function(a){return i[a]}}});require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/placeholder/placeholder",function(e){require("jquery").extend(require("ajs").Rte.Placeholder,e)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/placeholder/property-panel-text-placeholders.js' */
define("confluence-editor/tinymce3/plugins/placeholder/property-panel-text-placeholders",["jquery","ajs","confluence/property-panel"],function(e,a,h){return{name:"textplaceholder",canHandleElement:function(a){return a.hasClass("text-placeholder")},handle:function(b){function i(a,b,c){return{className:"text-placeholder-property-panel-type-item text-placeholder-property-panel-type-"+a,text:b,tooltip:c,selected:j===a,click:function(){"default"===a?f.removeAttr("data-placeholder-type"):f.attr("data-placeholder-type",
a);var b=e(".text-placeholder-property-panel-type-"+a);b.parent().find(".text-placeholder-property-panel-type-item").removeClass("selected");b.addClass("selected")}}}if(!("click"!==b.e.type&&"mouseup"!==b.e.type)){var k=a.Rte.Placeholder.getPlaceholderTypes(),b=b.containerEl,f=e(b),j=f.attr("data-placeholder-type"),d=[],c=i("default","Text","Instructional text is replaced with empty content when a person types.");c.selected=!j;d.push(c);for(var g=
0,l=k.length;g<l;g++)c=k[g],d.push(i(c.type,c.label,c.tooltip));d.push(null);d.push({className:"text-placeholder-property-panel-remove-button",text:"Remove",click:function(){h.destroy();a.Rte.Placeholder.removePlaceholder(f)}});h.createFromButtonModel("textplaceholder",b,d,{anchorIframe:a.Rte.getEditorFrame()})}}}});
require("confluence/module-exporter").exportModuleAsGlobal("confluence-editor/tinymce3/plugins/placeholder/property-panel-text-placeholders","AJS.Confluence.PropertyPanel.TextPlaceholder",function(e){var a=require("ajs");a.bind("init.rte",function(){"template"===a.Meta.get("content-type")&&a.trigger("add-handler.property-panel",e)})});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/placeholder/placeholder.soy' */
// This file was automatically generated from placeholder.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace AJS.Rte.Placeholder.Templates.
 */

if (typeof AJS == 'undefined') { var AJS = {}; }
if (typeof AJS.Rte == 'undefined') { AJS.Rte = {}; }
if (typeof AJS.Rte.Placeholder == 'undefined') { AJS.Rte.Placeholder = {}; }
if (typeof AJS.Rte.Placeholder.Templates == 'undefined') { AJS.Rte.Placeholder.Templates = {}; }


AJS.Rte.Placeholder.Templates.textPlaceholder = function(opt_data, opt_ignored) {
  return '<span class="text-placeholder">' + opt_data.content + '</span>';
};
if (goog.DEBUG) {
  AJS.Rte.Placeholder.Templates.textPlaceholder.soyTemplateName = 'AJS.Rte.Placeholder.Templates.textPlaceholder';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/plugins/imageproperties/js/image-properties-dialog.js' */
define("confluence-editor/tinymce3/plugins/imageproperties/js/image-properties-dialog",["jquery","ajs","confluence/dialog","confluence/property-panel"],function(d,a,p,l){function m(){f||(f=d("#image-properties-tab-items > div").map(function(){var e=d(this);return{key:e.text(),weight:e.attr("data-weight"),label:this.title}}).sort(function(e,b){return e.weight-b.weight}));return f}function n(){var e=c.popup.element,b=650/60,a=d('<div class="image-properties-loading-blanket"><div class="loading-data"></div></div>').appendTo(e.find(".dialog-page-body")),
g=a.find(".loading-data");a.css({width:a.parent().width(),height:e.height()});g.css({marginTop:-60,marginLeft:-60});g.spin({color:"#666",width:b,radius:25,length:25,top:0,left:0,zIndex:0,speed:1.042});var e=[],h;for(h in i)b=i[h],(b=b.saveFn&&b.saveFn())&&b.done&&e.push(b);d.when.apply(d,e).done(function(){var a=c.popup.element.find(".image-properties-loading-blanket .loading-data");a.css({marginTop:"",marginLeft:""});a.spinStop();a.closest(".image-properties-loading-blanket").remove();c.hide().remove()})}
function q(){c.hide().remove()}var c,f,i={},o;return{init:function(){o||(f=null,0<m().length&&(o=!0,l.Image.pluginButtons.push(null,{create:function(){return{className:"image-properties",text:"Properties",tooltip:"Set additional image properties",click:function(e,b){a.trigger("analyticsEvent",{name:"confluence.editor.image-properties-trigger"});l.destroy();d("#image-properties-dialog").remove();c=new p.component({id:"image-properties-dialog",onSubmit:n});
a.trigger("dialog-created.image-properties",{img:b});c.popup.element.attr("data-tab-default","0");c.addHeader("Image Properties");c.addSubmit("Save",n);c.addCancel("Cancel",q);for(var f=c,g=m(),h=0;h<g.length;h++){var j=g[h],k=i[j.key];k&&f.addPanel(j.label,k.content,k.panelClass,j.key)}1===g.length&&f.popup.element.find(".dialog-page-menu").show();a.trigger("dialog-before-show.image-properties");
c.show()}}}})))},registerPanel:function(a,b,c,d){i[a]={content:b,panelClass:c,saveFn:d}}}});require("confluence/module-exporter").exportModuleAsGlobal("confluence-editor/tinymce3/plugins/imageproperties/js/image-properties-dialog","Confluence.Editor.ImageProps",function(d){var a=require("ajs");a.toInit(d.init);a.bind("quickedit.success",d.init)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'unpublished-changes/unpublished-changes.soy' */
// This file was automatically generated from unpublished-changes.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.UnpublishedChanges.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.UnpublishedChanges == 'undefined') { Confluence.Templates.UnpublishedChanges = {}; }


Confluence.Templates.UnpublishedChanges.lozenge = function(opt_data, opt_ignored) {
  return '<a id="unpublished-changes-lozenge" href="#" class="view-diff-link" title="' + soy.$$escapeHtml(opt_data.tooltip) + '"><span class="aui-lozenge aui-lozenge-complete aui-lozenge-subtle unpublished-changes-lozenge">' + soy.$$escapeHtml(opt_data.label) + '</span></a>';
};
if (goog.DEBUG) {
  Confluence.Templates.UnpublishedChanges.lozenge.soyTemplateName = 'Confluence.Templates.UnpublishedChanges.lozenge';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'unpublished-changes/unpublished-changes.js' */
define("confluence-editor/unpublished-changes/unpublished-changes","jquery confluence/templates confluence/legacy-editor-global-AVOID-IF-POSSIBLE ajs underscore tinymce".split(" "),function(d,f,k,g,i,h){return{init:function(a){var e=d(f.UnpublishedChanges.lozenge({tooltip:"This page has unpublished changes",label:"Unpublished"})),h=function(b){b=i.isBoolean(b)?b:true;k.UI.setButtonState(b,d("#rte-button-publish"))},j=function(b,
c){var a=c||function(){};(i.isBoolean(b)?b:1)?e.addClass("visible").fadeIn("fast",a):e.fadeOut("fast",function(){d(this).hide().removeClass("visible");a()})},c={show:function(){e.hasClass("visible")||j(true,h)},hide:function(){j(false);h(false)}};g.bind("rte-ready",function(){var b=d("#content-title-div");c.hide();e.insertBefore(b);e.tooltip();d("#content-title").on("keydown change",c.show);a.onChange.add(c.show);a.onKeyDown.add(c.show);a.onLoad.add(function(){d(a.startContent).text().trim()&&g.Meta.get("draft-id")>
0&&c.show()});e.on("mouseenter.tipsy",function(){g.trigger("analytics",{name:"confluence.editor.unpublished-changes.lozenge.hover"})});a.addCommand("mceConf.UnpublishedChangesLozenge.show",c.show);a.addCommand("mceConf.UnpublishedChangesLozenge.hide",c.hide)})},getInfo:function(){return{longname:"Unpublished Changes",author:"Atlassian",authorurl:"http://www.atlassian.com",version:h.majorVersion+"."+h.minorVersion}}}});
require("confluence/module-exporter").safeRequire("confluence-editor/unpublished-changes/unpublished-changes",function(d){var f=require("tinymce");f.create("tinymce.plugins.UnpublishedChanges",d);f.PluginManager.add("unpublishedchanges",f.plugins.UnpublishedChanges)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'tinymce3/settings/tinymce-default-settings.js' */
define("confluence-editor/tinymce3/settings/tinymce-default-settings",[],function(){});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'loader/tinymce-adapter.js' */
define("confluence-editor/loader/tinymce-adapter","ajs jquery confluence/performance-session confluence-editor/profiles confluence/api/constants confluence/meta confluence-editor/support/atlassian-editor-support".split(" "),function(b,f,h,g,i,d,j){return function(){var a;a=b.contextPath();var c=["auiwindowmanager","table","emotions","confluence","macroplaceholder","customtoolbar","insertwikimarkup","propertypanel","keyboardshortcuts","confmonospace","confcharmap","lists","aePaste","cursorTarget",
"confluencecleanupplugin","conftable","confluencepastetableplugin","confluencepastemacroplugin","pagelayoutplugin","highlightnode","iosediting","autoconvert","confluencelist","deletecommand","draggable","confluencesortabletablesplugin","textplaceholders","linkbrowser","insertfiles","tableAnalytics"];b.DarkFeatures.isEnabled("confluence.table.resizable")&&c.push("tableContentWrapper");a={autoresize_min_height:"100%",width:"100%",height:"100%",document_base_url:i.BASE_URL+"/",plugins:c.join(","),theme:"atlassian",
theme_advanced_buttons1:"formatselect,bold,italic,underline,strikethrough,forecolor,separator,table,row_before,row_after,delete_row,col_before,col_after,delete_col,delete_table,separator,bullist,numlist,tasklist,outdent,indent,blockquote,justifyleft,justifycenter,justifyright,justifyfull,separator,sup,sub,separator,undo,redo,separator,confimage,conf_macro_browser,separator,code,customtoolbar,help,monospace,separator,searchreplace,linkbrowserButton",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"left",
theme_advanced_resizing:false,theme_advanced_resize_horizontal:false,theme_advanced_statusbar_location:"none",theme_advanced_path:false,theme_advanced_blockformats:"p,h1,h2,h3,h4,h5,h6,pre,blockquote",mode:"specific_textareas",editor_selector:"tinymce-editor",body_class:"wiki-content",popup_css:false,content_css:false,editor_css:false,custom_undo_redo:true,custom_undo_redo_levels:20,context_path:a,plugin_action_base_path:a+"/plugins/tinymce",editor_plugin_action_base_path:a+"/plugins/editor/tinymce",
page_id:b.Meta.get("page-id"),draft_type:null,form_name:b.Meta.get("form-name"),space_key:encodeURI(b.Meta.get("space-key")),confluence_popup_width:620,confluence_popup_height:550,editor_id:"wysiwygTextarea"};if(a.page_id==0){a.page_id=null;a.draft_type=b.Meta.get("draft-type")}b.Rte.BootstrapManager.addBeforeInitCallback(function(a){a.contentCssTags=f("script[title='editor-css']").html();a.language=b.Meta.get("action-locale");var c=b.Meta.get("min-editor-height");if(c)a.autoresize_min_height=c});
if(c=!(b.Meta.get("remote-user")&&b.Meta.get("confluence.prefs.editor.disable.autocomplete")))a.plugins=a.plugins+",autocomplete,autocompletelink,autocompletemedia";if(b.Meta.get("auto-start")){var e=f("#"+a.editor_id);j.isCollaborativeContentType()&&b.trigger("rte-collaborative-content-ready",{title:d.get("page-title")||d.get("original-content-title")||"",editorContent:e.val(),confRev:d.get("conf-revision"),syncRev:f("#syncRev").val(),syncRevSource:d.get("sync-revision-source")});h.debugTime("confluence.editor");
if(c)a.plugins=a.plugins+",autocompletemacro";c=""+b.Meta.get("page-id")==="0";e=b.Meta.get("content-type");c=e==="template"?g.createProfileForTemplateEditor():e==="comment"?g.createProfileForCommentEditor():g.createProfileForPageEditor({versionComment:!c,notifyWatchers:!c});if(c=c.plugins.join(","))a.plugins=a.plugins+(","+c);b.Rte.BootstrapManager.preInitialise(a);b.Rte.BootstrapManager.initialise();h.debugTimeEnd("confluence.editor")}else b.Rte.BootstrapManager.preInitialise(a)}});
require("confluence/module-exporter").safeRequire("confluence-editor/loader/tinymce-adapter",function(b){require("ajs").toInit(b)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'com/atlassian/confluence/tinymceplugin/tinymce-adapter-deprecated.js' */
define("confluence-editor/tinymceplugin/tinymce-adapter-deprecated",["ajs","confluence-link-browser/link-adapter","confluence-link-browser/link-object","jquery","tinymce"],function(a,g,h,i,e){return{putCursorAtPostionInElement:function(b,a,c){var d=e.activeEditor,j=d.getDoc(),b=i(b,c||j),b=b.contents().filter(function(){return 3===this.nodeType})[0],c=d.selection.getRng(!0);c.setStart(b,a);c.setEnd(b,a);d.selection.setRng(c)},storeCurrentSelectionState:a.Rte.BookmarkManager.storeBookmark,restoreSelectionState:a.Rte.BookmarkManager.restoreBookmark,
insertLink:function(b,f){f&&a.Rte.getEditor().selection.select(f);g.setLink(b)},getCurrentBaseUrl:a.Rte.getCurrentBaseUrl,addOnInitCallback:function(b){a.debug("Adding callback to AJS.Rte.BootstrapManager. AJS.Rte.BootstrapManager = "+a.Rte.BootstrapManager);a.Rte.BootstrapManager.addOnInitCallback(b)},bindScroll:function(b,f){a.Rte.bindScroll(b,f)},unbindScroll:function(b){a.Rte.unbindScroll(b)},getTinyMceHasInit:function(){return a.Rte.BootstrapManager.isInitComplete()},getEditor:a.Rte.getEditor,
addTinyMcePluginInit:function(b){a.Rte.BootstrapManager.addTinyMcePluginInit(b)},isExternalLink:function(a){return h.isExternalLink(a)},isInMacroPlaceholder:function(a){return e.confluence.MacroUtils.isInMacro(a)},initialiseTinyMce:function(){var b=a.Editor.Adapter;e.EditorManager.preInit.apply(e.EditorManager);e.EditorManager.init(b.settings)},offset:function(b){a.Rte.Content.offset(b)},getSelectedText:function(){return a.Rte.Content.getSelectedText()},setEditorValue:function(b){a.Rte.Content.setHtml(b)},
getEditorHTML:function(){return""+a.Rte.getEditor.getContent()},editorHasContentChanged:function(){return a.Rte.getEditor().isDirty()},editorResetContentChanged:function(){a.Rte.getEditor().setDirty(!1)},getChildIndex:function(a,f){for(var c=a.childNodes,d=0,e=c.length;d<e;d++)if(c[d]==f)return d;return-1},getMainEditor:function(){return a.Rte.getMainEditor()},getEditorContainer:function(){return a.Rte.getEditorContainer()},getEditorFrame:function(){return a.Rte.getEditorFrame()},getEditorTable:function(){return a.Rte.getEditorTable()},
webResourcePath:a.Rte.webResourcePath,getResourceUrlPrefix:function(){return a.Rte.getResourceUrlPrefix()},getTinyMceBaseUrl:function(){return a.Rte.getTinyMceBaseUrl()},getMinEditorHeight:function(){return a.Rte.getMinEditorHeight()},getTinyMceEditorMinHeight:function(b){return a.Rte.getTinyMceEditorMinHeight(b)}}});require("confluence/module-exporter").exportModuleAsGlobal("confluence-editor/tinymceplugin/tinymce-adapter-deprecated","AJS.Editor.Adapter");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-javascript-resources', location = 'analytics/editor-analytics.js' */
define("confluence-editor/analytics/editor-analytics",["ajs","jquery","window","confluence/analytics-support"],function(e,k,l,m){function d(a,i){if(a&&(c[a]?c[a]++:c[a]=1,i)){var b=a+"Size";c[b]=c[b]?c[b]+i:i}}function g(){c.pageID=e.Meta.get("page-id");m.publish("confluence.editor.action",c);c={};clearTimeout(f);f=setTimeout(g,j)}var j=6E4,f,c={},h=0,n={Bold:"bold",confCharmap:"insert.symbol",confMonospace:"monospace",confTableRowToggleHeading:"table.row.toggle.heading",confTableColumnToggleHeading:"table.column.toggle.heading",
confTableSelectionToggleHighlight:"table.selection.toggle.highlight",ForeColor:"foreground.color",FormatBlock:"format.block",Indent:"indent",InsertHorizontalRule:"insert.horizontal.rule",InsertOrderedList:"insert.ordered.list",InsertUnorderedList:"insert.unordered.list",InsertWikiMarkup:"insert.wiki.markup",Italic:"italic",JustifyCenter:"justify.center",JustifyLeft:"justify.left",JustifyRight:"justify.right",mceConfimage:"insert.files.images",mceConflink:"insert.link",mceConfMacroBrowser:"open.other.macros.browser",
mceEmotion:"insert.emoticon",mceTableCopyRow:"table.copy.row",mceTableCutRow:"table.cut.row",mceTableDelete:"table.delete",mceTableDeleteCol:"table.delete.column",mceTableDeleteRow:"table.delete.row",mceTableInsertColAfter:"table.insert.column.after",mceTableInsertColBefore:"table.insert.column.before",mceTableInsertRowAfter:"table.insert.row.after",mceTableInsertRowBefore:"table.insert.row.before",mceTableMergeCells:"table.merge.cells",mceTablePasteRowBefore:"table.paste.row.before",mceTableSplitCells:"table.split.cells",
mcePageLayoutsToolbar:"page.layouts.toolbar.toggle",mcePageLayoutAddSection:"page.layouts.toolbar.add.section",mcePageLayoutRemoveSection:"page.layouts.toolbar.remove.section",mcePageLayoutMoveSectionDown:"page.layouts.toolbar.movedown.section",mcePageLayoutMoveSectionUp:"page.layouts.toolbar.moveup.section",mcePageLayoutChangeSection:"page.layouts.toolbar.change.section",mceConfShortcutDialog:"open.help.dialog",mceSearchReplaceToolbar:"search.replace.toolbar.toggle",mceConfSearchClose:"search.replace.toolbar.close",
mceConfSearch:"search",mceConfReplace:"replace",mceConfReplaceAll:"replace.all",Outdent:"outdent",Redo:"redo",Strikethrough:"strikethrough",subscript:"subscript",superscript:"superscript",Underline:"underline",Undo:"undo",InsertInlineTaskList:"insert.inline.tasklist",InsertInlineTaskListNoToggle:"insert.inline.tasklist.no.toggle"};return{bindAnalyticsToEditorCommands:function(){var a=require("tinymce");clearTimeout(f);f=setTimeout(g,j);a.activeEditor.onExecCommand.add(function(a,b){d(n[b])});a.activeEditor.onKeyPress.add(function(){d("keys")});
a.activeEditor.onKeyUp.add(function(a,b){46===b.keyCode?d("delete",h):8===b.keyCode&&d("backspace",h);h=a.selection.getContent().length});a.activeEditor.onMouseUp.add(function(a){h=a.selection.getContent().length});a.activeEditor.onPaste.add(function(a,b){d("paste",b.clipboardData.getData("text/plain").length)});a.activeEditor.onRemove.add(function(){g();clearTimeout(f)})},bindAnalyticsToIconClicks:function(){k("#rte-button-insert-table").on("click",function(){d("insert.table")})},bindAnalyticsPublishingToWindowUnload:function(){l.addEventListener("beforeunload",
function(){g()})}}});require("confluence/module-exporter").safeRequire("confluence-editor/analytics/editor-analytics",function(e){require("ajs").bind("rte-ready",function(){e.bindAnalyticsToEditorCommands();e.bindAnalyticsToIconClicks();e.bindAnalyticsPublishingToWindowUnload()})});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.extra.jira:jiraAnalytics', location = '/jira/jiraanalytics.js' */
AJS.Editor.JiraAnalytics={events:{paste:{key:"confluence.jira.plugin.paste"},search:{key:"confluence.jira.plugin.search"},trigger:{key:"confluence.jira.plugin.trigger"},customizeColumn:{key:"confluence.jira.plugin.column.customize"}},linkTypes:{jqlDirect:"direct_jql",jql:"jql_link",xml:"xml_link",rss:"rss_link",filter:"filter_link"},getDisplayType:function(a){var b="single";if(a.container.find("#opt-table").is(":checked")){b="table"}else{if(a.container.find("#opt-total").is(":checked")){b="count"}}return b},setupAnalyticPanelActionObject:function(a,c,b){return{name:a.analyticPanelActionName,properties:this.setupPanelActionProperties(a,c,b)}},setupPanelActionProperties:function(a,d,b){var c={};if(d===AJS.Editor.JiraConnector.source.instructionalText){if(a.analyticPanelActionName==="confluence.jira.plugin.issuecreated"){c.issueType=a.container.find('select[name="issuetype"] :selected').text()}else{if(a.analyticPanelActionName==="confluence.jira.plugin.searchadded"){c.display=this.getDisplayType(a)}}c.label=b}return c},triggerPasteEvent:function(a){AJS.EventQueue=AJS.EventQueue||[];AJS.EventQueue.push({name:AJS.Editor.JiraAnalytics.events.paste.key,properties:a})},triggerPannelActionEvent:function(a){AJS.EventQueue=AJS.EventQueue||[];AJS.EventQueue.push(a)},triggerSearchEvent:function(a){AJS.EventQueue=AJS.EventQueue||[];AJS.EventQueue.push({name:AJS.Editor.JiraAnalytics.events.search.key,properties:a})},triggerMarkupEvent:function(a){this.triggerSearchEvent(a)},triggerPannelTriggerEvent:function(a){AJS.EventQueue=AJS.EventQueue||[];AJS.EventQueue.push({name:AJS.Editor.JiraAnalytics.events.trigger.key,properties:a})},triggerCustomizeColumnEvent:function(a){AJS.EventQueue=AJS.EventQueue||[];AJS.EventQueue.push({name:AJS.Editor.JiraAnalytics.events.customizeColumn.key,properties:a})}};(function(a){a.aop.before({target:AJS.MacroBrowser,method:"loadMacroInBrowser"},function(b,c){if(b&&b[0]&&b[0].pluginKey=="confluence.extra.jira"){AJS.Editor.JiraAnalytics.triggerPannelTriggerEvent({source:AJS.Editor.JiraConnector.source.macroBrowser})}});a.aop.before({target:tinymce.confluence.macrobrowser,method:"macroBrowserToolbarButtonClicked"},function(b,c){if(b&&b[0]&&b[0].presetMacroMetadata&&b[0].presetMacroMetadata.pluginKey=="confluence.extra.jira"){AJS.Editor.JiraAnalytics.triggerPannelTriggerEvent({source:AJS.Editor.JiraConnector.source.editorBraceKey})}});AJS.bind("init.rte",function(){a.aop.before({target:tinyMCE.activeEditor,method:"execCommand"},function(l,k){if(l&&l[0]=="mceInsertContent"&&l[2]){var m=l[2];var e=AJS.$("<div></div>").html(m).children().first();var c=e.attr("data-macro-name");var h=["jira","jiraissues"];if(a.inArray(c,h)==-1){return}var j=AJS.Editor.JiraAnalytics;var n={source:"wiki_markup"};if(!e.attr("data-macro-parameters")){return}var g=e.attr("data-macro-parameters").split("|");for(var f=0;f<g.length;f++){var d=a.trim(g[f]);if(d.indexOf("jql")==0||d.indexOf("jqlQuery")==0){n.type=j.linkTypes.jqlDirect;break}else{if(d.indexOf("url")==0){var b=a.trim(d.substring(d.indexOf("=")+1,d.length));n.type=AJS.JQLHelper.checkQueryType(b);break}else{if(d.indexOf("http")==0){var b=d;n.type=AJS.JQLHelper.checkQueryType(b);break}}}}if(typeof n.type==="undefined"){n.type=j.linkTypes.jqlDirect}j.triggerMarkupEvent(n)}})})})(AJS.$);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.integration.jira.jira-integration-plugin:fields', location = '/fields/fields.soy' */
// This file was automatically generated from fields.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace jiraIntegration.templates.fields.
 */

if (typeof jiraIntegration == 'undefined') { var jiraIntegration = {}; }
if (typeof jiraIntegration.templates == 'undefined') { jiraIntegration.templates = {}; }
if (typeof jiraIntegration.templates.fields == 'undefined') { jiraIntegration.templates.fields = {}; }


jiraIntegration.templates.fields.stringField = function(opt_data, opt_ignored) {
  return '' + aui.form.textField({labelContent: '' + soy.$$escapeHtml(opt_data.labelText), id: opt_data.name, name: opt_data.name, value: opt_data.value, isRequired: opt_data.isRequired, extraClasses: 'jira-field' + (opt_data.extraClasses ? ' ' + opt_data.extraClasses : ''), extraAttributes: {'data-jira-type': opt_data.jiraType}, errorTexts: opt_data.errorTexts});
};
if (goog.DEBUG) {
  jiraIntegration.templates.fields.stringField.soyTemplateName = 'jiraIntegration.templates.fields.stringField';
}


jiraIntegration.templates.fields.textareaField = function(opt_data, opt_ignored) {
  var output = '<div class="field-group jira-field' + ((opt_data.extraClasses) ? ' ' + soy.$$escapeHtml(opt_data.extraClasses) : '') + '" data-jira-type="' + soy.$$escapeHtml(opt_data.jiraType) + '"><label for="' + soy.$$escapeHtml(opt_data.name) + '">' + soy.$$escapeHtml(opt_data.labelText) + ((opt_data.isRequired) ? '<span class="aui-icon icon-required"></span>' : '') + '</label><textarea rows="10" id="' + soy.$$escapeHtml(opt_data.name) + '" name="' + soy.$$escapeHtml(opt_data.name) + '" class="textarea long-field">' + soy.$$escapeHtml(opt_data.value) + '</textarea>';
  if (opt_data.errorTexts) {
    var errorList37 = opt_data.errorTexts;
    var errorListLen37 = errorList37.length;
    for (var errorIndex37 = 0; errorIndex37 < errorListLen37; errorIndex37++) {
      var errorData37 = errorList37[errorIndex37];
      output += '<div class="error">' + soy.$$escapeHtml(errorData37) + '</div>';
    }
  }
  output += '</div>';
  return output;
};
if (goog.DEBUG) {
  jiraIntegration.templates.fields.textareaField.soyTemplateName = 'jiraIntegration.templates.fields.textareaField';
}


jiraIntegration.templates.fields.arrayField = function(opt_data, opt_ignored) {
  return '' + aui.form.textField({id: opt_data.name, name: opt_data.name, labelContent: '' + soy.$$escapeHtml(opt_data.labelText), value: opt_data.value, isRequired: opt_data.isRequired, extraClasses: 'jira-field' + (opt_data.extraClasses ? ' ' + opt_data.extraClasses : ''), extraAttributes: {'data-jira-type': opt_data.jiraType}, errorTexts: opt_data.errorTexts});
};
if (goog.DEBUG) {
  jiraIntegration.templates.fields.arrayField.soyTemplateName = 'jiraIntegration.templates.fields.arrayField';
}


jiraIntegration.templates.fields.numberField = function(opt_data, opt_ignored) {
  return '' + aui.form.textField({id: opt_data.name, name: opt_data.name, labelContent: '' + soy.$$escapeHtml(opt_data.labelText), value: opt_data.value, isRequired: opt_data.isRequired, extraClasses: 'jira-field' + (opt_data.extraClasses ? ' ' + opt_data.extraClasses : ''), extraAttributes: {'data-jira-type': opt_data.jiraType}, errorTexts: opt_data.errorTexts});
};
if (goog.DEBUG) {
  jiraIntegration.templates.fields.numberField.soyTemplateName = 'jiraIntegration.templates.fields.numberField';
}


jiraIntegration.templates.fields.allowedValuesField = function(opt_data, opt_ignored) {
  return '' + ((opt_data.options.length) ? aui.form.selectField({id: opt_data.name, name: opt_data.name, labelContent: '' + soy.$$escapeHtml(opt_data.labelText), options: opt_data.options, isRequired: opt_data.isRequired, isMultiple: opt_data.isMultiple, extraClasses: 'jira-field' + (opt_data.extraClasses ? ' ' + opt_data.extraClasses : ''), extraAttributes: {'data-jira-type': opt_data.jiraType}, errorTexts: opt_data.errorTexts}) : aui.form.valueField({id: opt_data.name, name: opt_data.name, labelContent: '' + soy.$$escapeHtml(opt_data.labelText), value: 'None', isRequired: opt_data.isRequired, extraClasses: 'jira-field' + (opt_data.extraClasses ? ' ' + opt_data.extraClasses : ''), extraAttributes: {'data-jira-type': opt_data.jiraType}, errorTexts: opt_data.errorTexts}));
};
if (goog.DEBUG) {
  jiraIntegration.templates.fields.allowedValuesField.soyTemplateName = 'jiraIntegration.templates.fields.allowedValuesField';
}


jiraIntegration.templates.fields.timeTrackingField = function(opt_data, opt_ignored) {
  return '' + aui.form.textField({id: opt_data.name, name: opt_data.name, labelContent: '' + soy.$$escapeHtml(opt_data.labelText), value: opt_data.value, isRequired: opt_data.isRequired, extraClasses: 'jira-field' + (opt_data.extraClasses ? ' ' + opt_data.extraClasses : ''), extraAttributes: {'data-jira-type': opt_data.jiraType}, errorTexts: opt_data.errorTexts});
};
if (goog.DEBUG) {
  jiraIntegration.templates.fields.timeTrackingField.soyTemplateName = 'jiraIntegration.templates.fields.timeTrackingField';
}


jiraIntegration.templates.fields.unrenderableTypeField = function(opt_data, opt_ignored) {
  var output = '<div class="field-group jira-field jira-field-unrenderable' + ((opt_data.extraClasses) ? ' ' + soy.$$escapeHtml(opt_data.extraClasses) : '') + '"><label>' + soy.$$escapeHtml(opt_data.labelText) + ((opt_data.isRequired) ? '<span class="aui-icon icon-required"></span>' : '') + '</label>' + aui.form.value({content: opt_data.reasonContent});
  if (opt_data.errorTexts) {
    var errorList117 = opt_data.errorTexts;
    var errorListLen117 = errorList117.length;
    for (var errorIndex117 = 0; errorIndex117 < errorListLen117; errorIndex117++) {
      var errorData117 = errorList117[errorIndex117];
      output += '<div class="error">' + soy.$$escapeHtml(errorData117) + '</div>';
    }
  }
  output += '</div>';
  return output;
};
if (goog.DEBUG) {
  jiraIntegration.templates.fields.unrenderableTypeField.soyTemplateName = 'jiraIntegration.templates.fields.unrenderableTypeField';
}


jiraIntegration.templates.fields.dateField = function(opt_data, opt_ignored) {
  return '' + aui.form.textField({labelContent: '' + soy.$$escapeHtml(opt_data.labelText), id: opt_data.name, name: opt_data.name, value: opt_data.value, isRequired: opt_data.isRequired, extraClasses: 'jira-field' + (opt_data.extraClasses ? ' ' + opt_data.extraClasses : ''), extraAttributes: {'data-jira-type': opt_data.jiraType}, errorTexts: opt_data.errorTexts});
};
if (goog.DEBUG) {
  jiraIntegration.templates.fields.dateField.soyTemplateName = 'jiraIntegration.templates.fields.dateField';
}


jiraIntegration.templates.fields.select2WithIconField = function(opt_data, opt_ignored) {
  var output = '<div class="field-group jira-field' + ((opt_data.extraClasses) ? ' ' + soy.$$escapeHtml(opt_data.extraClasses) : '') + '" data-jira-type="' + soy.$$escapeHtml(opt_data.jiraType) + '"><label for="' + soy.$$escapeHtml(opt_data.name) + '">' + soy.$$escapeHtml(opt_data.labelText) + ((opt_data.isRequired) ? '<span class="aui-icon icon-required"></span>' : '') + '</label><select id="' + soy.$$escapeHtml(opt_data.name) + '" name="' + soy.$$escapeHtml(opt_data.name) + '">';
  var optionList154 = opt_data.options;
  var optionListLen154 = optionList154.length;
  for (var optionIndex154 = 0; optionIndex154 < optionListLen154; optionIndex154++) {
    var optionData154 = optionList154[optionIndex154];
    output += '<option value="' + soy.$$escapeHtml(optionData154.value) + '" ' + ((optionData154.selected) ? 'selected' : '') + ' data-icon-url="' + soy.$$escapeHtml(optionData154.iconUrl) + '">' + soy.$$escapeHtml(optionData154.text) + '</option>';
  }
  output += '</select>';
  if (opt_data.errorTexts) {
    var errorList170 = opt_data.errorTexts;
    var errorListLen170 = errorList170.length;
    for (var errorIndex170 = 0; errorIndex170 < errorListLen170; errorIndex170++) {
      var errorData170 = errorList170[errorIndex170];
      output += '<div class="error">' + soy.$$escapeHtml(errorData170) + '</div>';
    }
  }
  output += '</div>';
  return output;
};
if (goog.DEBUG) {
  jiraIntegration.templates.fields.select2WithIconField.soyTemplateName = 'jiraIntegration.templates.fields.select2WithIconField';
}


jiraIntegration.templates.fields.select2WithIconOption = function(opt_data, opt_ignored) {
  return ((opt_data.iconUrl) ? aui.avatar.avatar({avatarImageUrl: opt_data.iconUrl, size: 'xsmall', isProject: opt_data.isProject, extraClasses: 'select-option-image', tagName: 'span'}) : '') + '<span class="select-option" title="' + soy.$$escapeHtml(opt_data.optionValue) + '">' + soy.$$escapeHtml(opt_data.optionValue) + '</span>';
};
if (goog.DEBUG) {
  jiraIntegration.templates.fields.select2WithIconOption.soyTemplateName = 'jiraIntegration.templates.fields.select2WithIconOption';
}


jiraIntegration.templates.fields.labelFieldResult = function(opt_data, opt_ignored) {
  return '' + ((opt_data.label.isNew) ? soy.$$escapeHtml(AJS.format('\x22{0}\x22 - (New label)',opt_data.label.labelName)) : soy.$$escapeHtml(opt_data.label.labelName));
};
if (goog.DEBUG) {
  jiraIntegration.templates.fields.labelFieldResult.soyTemplateName = 'jiraIntegration.templates.fields.labelFieldResult';
}


jiraIntegration.templates.fields.userOptionSelect = function(opt_data, opt_ignored) {
  var output = '';
  var userOption__soy197 = soy.$$escapeHtml(opt_data.displayName) + ' - (' + soy.$$escapeHtml(opt_data.name) + ')';
  output += '<span title="' + soy.$$filterNoAutoescape(userOption__soy197) + '">' + soy.$$filterNoAutoescape(userOption__soy197) + '</span>';
  return output;
};
if (goog.DEBUG) {
  jiraIntegration.templates.fields.userOptionSelect.soyTemplateName = 'jiraIntegration.templates.fields.userOptionSelect';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.integration.jira.jira-integration-plugin:fields', location = '/fields/fields.js' */
var jiraIntegration=window.jiraIntegration||{};jiraIntegration.fields=(function(J,Q){var k="YYYY-MM-DD";var g={template:jiraIntegration.templates.fields.stringField,getContext:v,getValue:B};var z={template:jiraIntegration.templates.fields.stringField,getContext:q,getValue:E,behavior:o};var u={template:jiraIntegration.templates.fields.arrayField,getContext:h,getValue:C,behavior:j};var s={template:jiraIntegration.templates.fields.textareaField,getContext:v,getValue:B};var G={template:jiraIntegration.templates.fields.numberField,getContext:v,getValue:D};var c={template:jiraIntegration.templates.fields.arrayField,getContext:h,getValue:C};var P={template:jiraIntegration.templates.fields.allowedValuesField,getContext:f,getValue:Q.bind(b,null,"id"),behavior:S};var M={template:jiraIntegration.templates.fields.allowedValuesField,getContext:f,getValue:Q.bind(b,null,"id")};var L={template:jiraIntegration.templates.fields.timeTrackingField,getContext:R,getValue:e};var K={template:jiraIntegration.templates.fields.dateField,getContext:v,getValue:r,behavior:y};var i={template:jiraIntegration.templates.fields.select2WithIconField,getContext:I,getValue:Q.bind(b,null,"id"),behavior:a};var l={"com.pyxis.greenhopper.jira:gh-epic-label":g,string:g,summary:g,"com.atlassian.jira.plugin.system.customfieldtypes:textfield":g,"com.atlassian.jira.plugin.system.customfieldtypes:url":g,environment:s,"com.atlassian.jira.plugin.system.customfieldtypes:textarea":s,description:s,"com.atlassian.jira.plugin.system.customfieldtypes:float":G,array:c,labels:u,"com.atlassian.jira.plugin.system.customfieldtypes:labels":c,resolution:P,fixVersions:P,priority:i,versions:P,components:P,security:P,"com.atlassian.jira.plugin.system.customfieldtypes:version":P,"com.atlassian.jira.plugin.system.customfieldtypes:multiversion":P,"com.atlassian.jira.plugin.system.customfieldtypes:project":P,assignee:z,reporter:z,timetracking:L,duedate:K,"com.atlassian.jira.plugin.system.customfieldtypes:datepicker":K,"com.atlassian.jira.plugin.system.customfieldtypes:multiselect":M,"com.atlassian.jira.plugin.system.customfieldtypes:select":M};var w={ignoreFieldsWithDefaultValue:false};function m(V,T,W){var U=T.schema.system||"customfield_"+T.schema.customId;return{labelText:T.name,name:U,isRequired:T.required,errorTexts:W[U],jiraType:V}}function v(X,T,U,V){var W=X.name;X.value=(J.isPlainObject(V[W])?V[W].name:V[W])||(U&&U.fields[W])||"";return X}function B(T){return T.val()}function r(T){var U=T.val();if(U===""){return null}else{return U}}function D(T){var U=T.val();if(t(U)){return Number(U)}return U||null}function y(T){var V=T.find("input");if(!!navigator.userAgent.match(/Trident/)&&AJS.version<"5.3.5"){var U="placeholder" in document.createElement("input");V.attr("placeholder",k);if(!U){V.on("focus",function(){if(V.val()===V.attr("placeholder")){V.val("")}}).on("blur",function(){if(V.val()===""){V.val(V.attr("placeholder"))}}).blur()}}else{V.datePicker({overrideBrowserDefault:true})}}function h(X,T,U,V){var W=X.name;X.value=(V[W]&&V[W].join(","))||(U&&U.fields[W]&&U.fields[W].join(","));return X}function C(T){return Q.map(T.val().split(","),J.trim)}function f(Z,T,U,W){var X=Z.name;var V=W[X];var aa=U&&U.fields[X];var Y;if(V){Y=J.isArray(V)?Q.pluck(V,"name"):[V.name]}else{if(aa){Y=J.isArray(aa)?Q.pluck(aa,"name"):[aa.name]}else{Y=[]}}Z.options=Q.map(T.allowedValues,function(ab){return{value:ab.id,text:ab.name||ab.value,selected:Q.contains(Y,ab.name||ab.id)}});Z.isMultiple=Q.contains(T.operations,"add");return Z}function b(W,U){var X=U.val();var T=U.attr("multiple");var V=function(Z){var Y={};Y[W]=Z;return Y};if(T){return J.isArray(X)?Q.map(X,V):[V(X)]}return V(X)}function S(T){T.find("select[multiple]").auiSelect2()}function q(X,T,U,V){var W=X.name;X.value=(V[W]&&V[W].name)||(U&&U.fields[W]&&U.fields[W].name)||"";return X}function E(T){return{name:T.val()}}function O(U,X,W,V,Y){var aa=U.find("input");var Z=U.attr("name");aa.removeClass("text");var T={minimumInputLength:1,id:Z,name:Z,query:function(ac){function ab(ad){ac.callback({results:ad})}n(X,W,ac.term,V).done(ab)}};aa.auiSelect2(J.extend(T,Y));U.find("div.aui-select2-container").addClass("jira-select2-drop-box")}function o(T,W,V,U){var X={formatInputTooShort:function(){return "Find users..."},formatResult:function(Y){return jiraIntegration.templates.fields.userOptionSelect({name:Y.id,displayName:Y.text})}};O(T,W,V,U,X)}function j(T,W,V,U){var X=T.find("input");jiraIntegration.fields._labelPicker.build(X,function(Y){return n(W,V,Y,U)})}function n(X,V,W,U){var T=J.extend({restType:V,issueKey:(U&&U.key)||"",term:W},X);return J.ajax({type:"POST",timeout:0,contentType:"application/json",dataType:"json",url:AJS.contextPath()+"/rest/jira-integration/latest/fields/autocomplete",data:JSON.stringify(T)})}function R(X,T,U,V){var W=X.name;X.value=(V[W]&&V[W].remainingEstimate)||(U&&U.fields[W]&&U.fields[W].remainingEstimate)||"";return X}function e(T){return{remainingEstimate:T.val()}}function I(Y,T,U,V){var W=Y.name;var X=(V[W]&&V[W].name)||(U&&U.fields&&U.fields[W]&&U.fields[W].name)||"";Y.options=Q.map(T.allowedValues,function(Z){return{value:Z.id,text:Z.name,selected:X===Z.name,iconUrl:Z.iconUrl}});return Y}function A(U){var T;if(U.id){T=J(U.element).attr("data-icon-url")}return jiraIntegration.templates.fields.select2WithIconOption({optionValue:U.text,iconUrl:T})}function a(X,W,U,T){if(!J.fn.auiSelect2){AJS.log("AUI version 5.2 or greater is required as this plugin needs the .auiSelect2() jQuery plugin.");return}var V=X.find("select");V.addClass("jira-select2-drop-box");V.auiSelect2({hasAvatar:true,minimumResultsForSearch:-1,formatSelection:A,formatResult:A})}function p(U,T){if(Q.has(l,U)&&console&&console.warn){console.warn("Redefining handler for type "+U+".")}l[U]=T}function F(T){return T.schema?(T.schema.system||T.schema.custom||T.schema.customId):T}function N(T){return l[F(T)]}function x(T){var U=d(T);return U&&N(U)}function d(T){return T.closest(".jira-field").attr("data-jira-type")}function H(U,T){return J.ajax({type:"GET",timeout:0,url:AJS.contextPath()+"/rest/jira-integration/1.0/servers/"+U.serverId+"/projects/"+U.projectKey+"/issue-types/"+U.issueType+"/fields-meta"}).pipe(function(W){var V=[];Q.each(W.fields,function(Y){var X=F(Y);if(Y.required&&!Q.contains(T.excludedFields,X)){V.push(Y)}});return V})}function t(T){return/\d/.test(T)&&/^-?\d*\.?\d*$/.test(T)}return{addFieldHandler:p,getFieldHandler:N,canRender:function(T){var V=F(T);var U=l[V];if(!U){return false}return T.operations&&T.operations.length&&(!U.canRender||U.canRender(T))},renderField:function(X,Z,aa,Y){var T=Z.schema.system||Z.schema.custom||Z.schema.customId;var V=l[T];var W=m(T,Z,Y||{});var ab=!V||(V.canRender&&!V.canRender(Z));var U=!Z.operations||!Z.operations.length;if(ab||U){W.reasonContent=ab?AJS.format("{0}Edit{1} this field in JIRA",'<a href="'+(X?X.url:"#")+'">',"</a>"):U?AJS.format("{0}Edit{1} this field in JIRA",'<a href="'+(X?X.url:"#")+'">',"</a>"):null;if(!W.reasonContent){throw new Error("Invalid unrenderable reason.")}return jiraIntegration.templates.fields.unrenderableTypeField(W)}return V.template(V.getContext(W,Z,X,aa||{}))},getJSON:function(T){var U=x(T);return U&&U.getValue&&U.getValue(T)},attachFieldBehaviors:function(V,U,T){V.find(".jira-field").each(function(Y,X){var W=J(X);var aa=d(W);var Z=aa&&N(aa);var ab=Z&&Z.behavior;if(ab){ab(W,U,aa,T)}})},renderCreateRequiredFields:function(X,W,V,U,T){U=Q.extend({},w,U);function Y(Z){if(U.ignoreFieldsWithDefaultValue){Z=Q.filter(Z,function(ab){return !ab.hasDefaultValue})}var aa=Q.filter(Z,function(ab){return !jiraIntegration.fields.canRender(ab)});if(aa.length){if(T){T(aa)}return}X.html(Q.map(Z,function(ab){return jiraIntegration.fields.renderField(null,ab,null,null)}).join(""));jiraIntegration.fields.attachFieldBehaviors(X,{serverId:V.serverId,projectKey:V.projectKey},null)}if(U.requiredFields){Y(U.requiredFields)}else{H(V,U).done(Y)}}}}(AJS.$,window._));
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.integration.jira.jira-integration-plugin:fields', location = '/fields/label-picker.js' */
var jiraIntegration=window.jiraIntegration||{};jiraIntegration.fields=jiraIntegration.fields||{};jiraIntegration.fields._labelPicker=function(a){var b=function(d,c){d.auiSelect2({tags:true,multiple:true,tokenSeparators:[","," "],createSearchChoice:function(e){if(!e){return null}return{id:e,text:e,isNew:true}},query:function(f){var e=function(g){f.callback({results:g})};c(f.term).done(e)},formatResult:function(e){return jiraIntegration.templates.fields.labelFieldResult({label:{labelName:e.text,isNew:e.isNew}})}})};return{build:b}}(AJS.$);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.plugin.jslibs:underscore-1.5.2', location = 'libs/underscore/1.5.2/underscore-1.5.2.js' */
(function(l){define("atlassian/libs/underscore-1.5.2",function(){var o={};l.call(o);return o._.noConflict()})})(function(){(function(){var l=this,o=l._,p={},k=Array.prototype,q=Object.prototype,t=k.push,i=k.slice,r=k.concat,m=q.toString,L=q.hasOwnProperty,A=k.forEach,B=k.map,C=k.reduce,D=k.reduceRight,E=k.filter,F=k.every,G=k.some,s=k.indexOf,H=k.lastIndexOf,q=Array.isArray,M=Object.keys,u=Function.prototype.bind,b=function(a){if(a instanceof b)return a;if(!(this instanceof b))return new b(a);this._wrapped=
a};"undefined"!==typeof exports?("undefined"!==typeof module&&module.exports&&(exports=module.exports=b),exports._=b):l._=b;b.VERSION="1.5.2";var j=b.each=b.forEach=function(a,c,d){if(a!=null)if(A&&a.forEach===A)a.forEach(c,d);else if(a.length===+a.length)for(var e=0,f=a.length;e<f;e++){if(c.call(d,a[e],e,a)===p)break}else for(var g=b.keys(a),e=0,f=g.length;e<f;e++)if(c.call(d,a[g[e]],g[e],a)===p)break};b.map=b.collect=function(a,c,b){var e=[];if(a==null)return e;if(B&&a.map===B)return a.map(c,b);
j(a,function(a,g,h){e.push(c.call(b,a,g,h))});return e};b.reduce=b.foldl=b.inject=function(a,c,d,e){var f=arguments.length>2;a==null&&(a=[]);if(C&&a.reduce===C){e&&(c=b.bind(c,e));return f?a.reduce(c,d):a.reduce(c)}j(a,function(a,b,N){if(f)d=c.call(e,d,a,b,N);else{d=a;f=true}});if(!f)throw new TypeError("Reduce of empty array with no initial value");return d};b.reduceRight=b.foldr=function(a,c,d,e){var f=arguments.length>2;a==null&&(a=[]);if(D&&a.reduceRight===D){e&&(c=b.bind(c,e));return f?a.reduceRight(c,
d):a.reduceRight(c)}var g=a.length;if(g!==+g)var h=b.keys(a),g=h.length;j(a,function(b,i,j){i=h?h[--g]:--g;if(f)d=c.call(e,d,a[i],i,j);else{d=a[i];f=true}});if(!f)throw new TypeError("Reduce of empty array with no initial value");return d};b.find=b.detect=function(a,c,b){var e;I(a,function(a,g,h){if(c.call(b,a,g,h)){e=a;return true}});return e};b.filter=b.select=function(a,c,b){var e=[];if(a==null)return e;if(E&&a.filter===E)return a.filter(c,b);j(a,function(a,g,h){c.call(b,a,g,h)&&e.push(a)});return e};
b.reject=function(a,c,d){return b.filter(a,function(a,b,g){return!c.call(d,a,b,g)},d)};b.every=b.all=function(a,c,d){c||(c=b.identity);var e=true;if(a==null)return e;if(F&&a.every===F)return a.every(c,d);j(a,function(a,b,h){if(!(e=e&&c.call(d,a,b,h)))return p});return!!e};var I=b.some=b.any=function(a,c,d){c||(c=b.identity);var e=false;if(a==null)return e;if(G&&a.some===G)return a.some(c,d);j(a,function(a,b,h){if(e||(e=c.call(d,a,b,h)))return p});return!!e};b.contains=b.include=function(a,c){return a==
null?false:s&&a.indexOf===s?a.indexOf(c)!=-1:I(a,function(a){return a===c})};b.invoke=function(a,c){var d=i.call(arguments,2),e=b.isFunction(c);return b.map(a,function(a){return(e?c:a[c]).apply(a,d)})};b.pluck=function(a,c){return b.map(a,function(a){return a[c]})};b.where=function(a,c,d){return b.isEmpty(c)?d?void 0:[]:b[d?"find":"filter"](a,function(a){for(var b in c)if(c[b]!==a[b])return false;return true})};b.findWhere=function(a,c){return b.where(a,c,true)};b.max=function(a,c,d){if(!c&&b.isArray(a)&&
a[0]===+a[0]&&a.length<65535)return Math.max.apply(Math,a);if(!c&&b.isEmpty(a))return-Infinity;var e={computed:-Infinity,value:-Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;b>e.computed&&(e={value:a,computed:b})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a)&&a[0]===+a[0]&&a.length<65535)return Math.min.apply(Math,a);if(!c&&b.isEmpty(a))return Infinity;var e={computed:Infinity,value:Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;b<e.computed&&(e={value:a,computed:b})});return e.value};
b.shuffle=function(a){var c,d=0,e=[];j(a,function(a){c=b.random(d++);e[d-1]=e[c];e[c]=a});return e};b.sample=function(a,c,d){return arguments.length<2||d?a[b.random(a.length-1)]:b.shuffle(a).slice(0,Math.max(0,c))};var v=function(a){return b.isFunction(a)?a:function(c){return c[a]}};b.sortBy=function(a,c,d){var e=v(c);return b.pluck(b.map(a,function(a,c,b){return{value:a,index:c,criteria:e.call(d,a,c,b)}}).sort(function(a,c){var b=a.criteria,d=c.criteria;if(b!==d){if(b>d||b===void 0)return 1;if(b<
d||d===void 0)return-1}return a.index-c.index}),"value")};var w=function(a){return function(c,d,e){var f={},g=d==null?b.identity:v(d);j(c,function(b,d){var i=g.call(e,b,d,c);a(f,i,b)});return f}};b.groupBy=w(function(a,c,d){(b.has(a,c)?a[c]:a[c]=[]).push(d)});b.indexBy=w(function(a,c,b){a[c]=b});b.countBy=w(function(a,c){b.has(a,c)?a[c]++:a[c]=1});b.sortedIndex=function(a,c,d,e){for(var d=d==null?b.identity:v(d),c=d.call(e,c),f=0,g=a.length;f<g;){var h=f+g>>>1;d.call(e,a[h])<c?f=h+1:g=h}return f};
b.toArray=function(a){return!a?[]:b.isArray(a)?i.call(a):a.length===+a.length?b.map(a,b.identity):b.values(a)};b.size=function(a){return a==null?0:a.length===+a.length?a.length:b.keys(a).length};b.first=b.head=b.take=function(a,c,b){return a==null?void 0:c==null||b?a[0]:i.call(a,0,c)};b.initial=function(a,c,b){return i.call(a,0,a.length-(c==null||b?1:c))};b.last=function(a,c,b){return a==null?void 0:c==null||b?a[a.length-1]:i.call(a,Math.max(a.length-c,0))};b.rest=b.tail=b.drop=function(a,b,d){return i.call(a,
b==null||d?1:b)};b.compact=function(a){return b.filter(a,b.identity)};var J=function(a,c,d){if(c&&b.every(a,b.isArray))return r.apply(d,a);j(a,function(a){b.isArray(a)||b.isArguments(a)?c?t.apply(d,a):J(a,c,d):d.push(a)});return d};b.flatten=function(a,b){return J(a,b,[])};b.without=function(a){return b.difference(a,i.call(arguments,1))};b.uniq=b.unique=function(a,c,d,e){if(b.isFunction(c)){e=d;d=c;c=false}var d=d?b.map(a,d,e):a,f=[],g=[];j(d,function(d,e){if(c?!e||g[g.length-1]!==d:!b.contains(g,
d)){g.push(d);f.push(a[e])}});return f};b.union=function(){return b.uniq(b.flatten(arguments,true))};b.intersection=function(a){var c=i.call(arguments,1);return b.filter(b.uniq(a),function(a){return b.every(c,function(c){return b.indexOf(c,a)>=0})})};b.difference=function(a){var c=r.apply(k,i.call(arguments,1));return b.filter(a,function(a){return!b.contains(c,a)})};b.zip=function(){for(var a=b.max(b.pluck(arguments,"length").concat(0)),c=Array(a),d=0;d<a;d++)c[d]=b.pluck(arguments,""+d);return c};
b.object=function(a,b){if(a==null)return{};for(var d={},e=0,f=a.length;e<f;e++)b?d[a[e]]=b[e]:d[a[e][0]]=a[e][1];return d};b.indexOf=function(a,c,d){if(a==null)return-1;var e=0,f=a.length;if(d)if(typeof d=="number")e=d<0?Math.max(0,f+d):d;else{e=b.sortedIndex(a,c);return a[e]===c?e:-1}if(s&&a.indexOf===s)return a.indexOf(c,d);for(;e<f;e++)if(a[e]===c)return e;return-1};b.lastIndexOf=function(a,b,d){if(a==null)return-1;var e=d!=null;if(H&&a.lastIndexOf===H)return e?a.lastIndexOf(b,d):a.lastIndexOf(b);
for(d=e?d:a.length;d--;)if(a[d]===b)return d;return-1};b.range=function(a,b,d){if(arguments.length<=1){b=a||0;a=0}for(var d=arguments[2]||1,e=Math.max(Math.ceil((b-a)/d),0),f=0,g=Array(e);f<e;){g[f++]=a;a=a+d}return g};var x=function(){};b.bind=function(a,c){var d,e;if(u&&a.bind===u)return u.apply(a,i.call(arguments,1));if(!b.isFunction(a))throw new TypeError;d=i.call(arguments,2);return e=function(){if(!(this instanceof e))return a.apply(c,d.concat(i.call(arguments)));x.prototype=a.prototype;var b=
new x;x.prototype=null;var g=a.apply(b,d.concat(i.call(arguments)));return Object(g)===g?g:b}};b.partial=function(a){var b=i.call(arguments,1);return function(){return a.apply(this,b.concat(i.call(arguments)))}};b.bindAll=function(a){var c=i.call(arguments,1);if(c.length===0)throw Error("bindAll must be passed function names");j(c,function(c){a[c]=b.bind(a[c],a)});return a};b.memoize=function(a,c){var d={};c||(c=b.identity);return function(){var e=c.apply(this,arguments);return b.has(d,e)?d[e]:d[e]=
a.apply(this,arguments)}};b.delay=function(a,b){var d=i.call(arguments,2);return setTimeout(function(){return a.apply(null,d)},b)};b.defer=function(a){return b.delay.apply(b,[a,1].concat(i.call(arguments,1)))};b.throttle=function(a,b,d){var e,f,g,h=null,i=0;d||(d={});var j=function(){i=d.leading===false?0:new Date;h=null;g=a.apply(e,f)};return function(){var k=new Date;!i&&d.leading===false&&(i=k);var K=b-(k-i);e=this;f=arguments;if(K<=0){clearTimeout(h);h=null;i=k;g=a.apply(e,f)}else!h&&d.trailing!==
false&&(h=setTimeout(j,K));return g}};b.debounce=function(a,b,d){var e,f,g,h,i;return function(){g=this;f=arguments;h=new Date;var j=function(){var k=new Date-h;if(k<b)e=setTimeout(j,b-k);else{e=null;d||(i=a.apply(g,f))}},k=d&&!e;e||(e=setTimeout(j,b));k&&(i=a.apply(g,f));return i}};b.once=function(a){var b=false,d;return function(){if(b)return d;b=true;d=a.apply(this,arguments);a=null;return d}};b.wrap=function(a,b){return function(){var d=[a];t.apply(d,arguments);return b.apply(this,d)}};b.compose=
function(){var a=arguments;return function(){for(var b=arguments,d=a.length-1;d>=0;d--)b=[a[d].apply(this,b)];return b[0]}};b.after=function(a,b){return function(){if(--a<1)return b.apply(this,arguments)}};b.keys=M||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var c=[],d;for(d in a)b.has(a,d)&&c.push(d);return c};b.values=function(a){for(var c=b.keys(a),d=c.length,e=Array(d),f=0;f<d;f++)e[f]=a[c[f]];return e};b.pairs=function(a){for(var c=b.keys(a),d=c.length,e=Array(d),f=0;f<
d;f++)e[f]=[c[f],a[c[f]]];return e};b.invert=function(a){for(var c={},d=b.keys(a),e=0,f=d.length;e<f;e++)c[a[d[e]]]=d[e];return c};b.functions=b.methods=function(a){var c=[],d;for(d in a)b.isFunction(a[d])&&c.push(d);return c.sort()};b.extend=function(a){j(i.call(arguments,1),function(b){if(b)for(var d in b)a[d]=b[d]});return a};b.pick=function(a){var b={},d=r.apply(k,i.call(arguments,1));j(d,function(d){d in a&&(b[d]=a[d])});return b};b.omit=function(a){var c={},d=r.apply(k,i.call(arguments,1)),
e;for(e in a)b.contains(d,e)||(c[e]=a[e]);return c};b.defaults=function(a){j(i.call(arguments,1),function(b){if(b)for(var d in b)a[d]===void 0&&(a[d]=b[d])});return a};b.clone=function(a){return!b.isObject(a)?a:b.isArray(a)?a.slice():b.extend({},a)};b.tap=function(a,b){b(a);return a};var y=function(a,c,d,e){if(a===c)return a!==0||1/a==1/c;if(a==null||c==null)return a===c;if(a instanceof b)a=a._wrapped;if(c instanceof b)c=c._wrapped;var f=m.call(a);if(f!=m.call(c))return false;switch(f){case "[object String]":return a==
String(c);case "[object Number]":return a!=+a?c!=+c:a==0?1/a==1/c:a==+c;case "[object Date]":case "[object Boolean]":return+a==+c;case "[object RegExp]":return a.source==c.source&&a.global==c.global&&a.multiline==c.multiline&&a.ignoreCase==c.ignoreCase}if(typeof a!="object"||typeof c!="object")return false;for(var g=d.length;g--;)if(d[g]==a)return e[g]==c;var g=a.constructor,h=c.constructor;if(g!==h&&(!b.isFunction(g)||!(g instanceof g&&b.isFunction(h)&&h instanceof h)))return false;d.push(a);e.push(c);
g=0;h=true;if(f=="[object Array]"){g=a.length;if(h=g==c.length)for(;g--;)if(!(h=y(a[g],c[g],d,e)))break}else{for(var i in a)if(b.has(a,i)){g++;if(!(h=b.has(c,i)&&y(a[i],c[i],d,e)))break}if(h){for(i in c)if(b.has(c,i)&&!g--)break;h=!g}}d.pop();e.pop();return h};b.isEqual=function(a,b){return y(a,b,[],[])};b.isEmpty=function(a){if(a==null)return true;if(b.isArray(a)||b.isString(a))return a.length===0;for(var c in a)if(b.has(a,c))return false;return true};b.isElement=function(a){return!!(a&&a.nodeType===
1)};b.isArray=q||function(a){return m.call(a)=="[object Array]"};b.isObject=function(a){return a===Object(a)};j("Arguments Function String Number Date RegExp".split(" "),function(a){b["is"+a]=function(b){return m.call(b)=="[object "+a+"]"}});b.isArguments(arguments)||(b.isArguments=function(a){return!(!a||!b.has(a,"callee"))});"function"!==typeof/./&&(b.isFunction=function(a){return typeof a==="function"});b.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))};b.isNaN=function(a){return b.isNumber(a)&&
a!=+a};b.isBoolean=function(a){return a===true||a===false||m.call(a)=="[object Boolean]"};b.isNull=function(a){return a===null};b.isUndefined=function(a){return a===void 0};b.has=function(a,b){return L.call(a,b)};b.noConflict=function(){l._=o;return this};b.identity=function(a){return a};b.times=function(a,b,d){for(var e=Array(Math.max(0,a)),f=0;f<a;f++)e[f]=b.call(d,f);return e};b.random=function(a,b){if(b==null){b=a;a=0}return a+Math.floor(Math.random()*(b-a+1))};var n={escape:{"&":"&amp;","<":"&lt;",
">":"&gt;",'"':"&quot;","'":"&#x27;"}};n.unescape=b.invert(n.escape);var O={escape:RegExp("["+b.keys(n.escape).join("")+"]","g"),unescape:RegExp("("+b.keys(n.unescape).join("|")+")","g")};b.each(["escape","unescape"],function(a){b[a]=function(b){return b==null?"":(""+b).replace(O[a],function(b){return n[a][b]})}});b.result=function(a,c){if(a!=null){var d=a[c];return b.isFunction(d)?d.call(a):d}};b.mixin=function(a){j(b.functions(a),function(c){var d=b[c]=a[c];b.prototype[c]=function(){var a=[this._wrapped];
t.apply(a,arguments);a=d.apply(b,a);return this._chain?b(a).chain():a}})};var P=0;b.uniqueId=function(a){var b=++P+"";return a?a+b:b};b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var z=/(.)^/,Q={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},R=/\\|'|\r|\n|\t|\u2028|\u2029/g;b.template=function(a,c,d){var e,d=b.defaults({},d,b.templateSettings),f=RegExp([(d.escape||z).source,(d.interpolate||z).source,(d.evaluate||
z).source].join("|")+"|$","g"),g=0,h="__p+='";a.replace(f,function(b,c,d,e,f){h=h+a.slice(g,f).replace(R,function(a){return"\\"+Q[a]});c&&(h=h+("'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'"));d&&(h=h+("'+\n((__t=("+d+"))==null?'':__t)+\n'"));e&&(h=h+("';\n"+e+"\n__p+='"));g=f+b.length;return b});h=h+"';\n";d.variable||(h="with(obj||{}){\n"+h+"}\n");h="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+h+"return __p;\n";try{e=new Function(d.variable||"obj",
"_",h)}catch(i){i.source=h;throw i;}if(c)return e(c,b);c=function(a){return e.call(this,a,b)};c.source="function("+(d.variable||"obj")+"){\n"+h+"}";return c};b.chain=function(a){return b(a).chain()};b.mixin(b);j("pop push reverse shift sort splice unshift".split(" "),function(a){var c=k[a];b.prototype[a]=function(){var d=this._wrapped;c.apply(d,arguments);(a=="shift"||a=="splice")&&d.length===0&&delete d[0];return this._chain?b(d).chain():d}});j(["concat","join","slice"],function(a){var c=k[a];b.prototype[a]=
function(){var a=c.apply(this._wrapped,arguments);return this._chain?b(a).chain():a}});b.extend(b.prototype,{chain:function(){this._chain=true;return this},value:function(){return this._wrapped}})}).call(this)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.applinks.applinks-plugin:lodash-amd', location = 'applinks/internal/lib/lodash-jslibs.js' */
define("applinks/lib/lodash",["atlassian/libs/underscore-1.5.2"],function(a){return a});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-lib', location = 'applinks/internal/lib/lib-version.js' */
define("applinks/lib/version",["applinks/lib/lodash"],function(c){function d(f,g){if(c.isUndefined(f)){return 0}else{if(typeof f!=="number"||isNaN(f)){throw new Error(g+": expected a number, was: <"+f+">")}else{return Math.floor(f)}}}function a(f,g){if(!f||!(f instanceof e)){throw new Error(g+": expected a Version object, was: <"+f+">")}return f}function b(f,g){return f>g?1:f==g?0:-1}function e(g,h,f){this.major=d(g,"major");this.minor=d(h,"minor");this.bugfix=d(f,"bugfix")}e.parse=function(g,h){h=h||"versionString";if(!g){throw new Error(h+": expected a non-empty string")}var f=g.split(".");if(f.length!==3){throw new Error(h+": expected <major>.<minor>.<bugfix> string, was: <"+g+">")}return new e(parseInt(f[0]),parseInt(f[1]),parseInt(f[2]))};e.comparator=function(g,f){return a(g,"versionOne").compareTo(a(f,"versionTwo"))};e.prototype.compareTo=function(h){a(h,"that");var f=b(this.major,h.major);if(f!=0){return f}var g=b(this.minor,h.minor);if(g!=0){return g}return b(this.bugfix,h.bugfix)};e.prototype.greaterThan=function(f){return this.compareTo(f)>0};e.prototype.greaterThanOrEqual=function(f){return this.compareTo(f)>=0};e.prototype.lessThan=function(f){return this.compareTo(f)<0};e.prototype.lessThanOrEqual=function(f){return this.compareTo(f)<=0};e.prototype.equals=function(f){return this.compareTo(f)==0};e.prototype.toMinor=function(){return new e(this.major,this.minor)};e.prototype.toMajor=function(){return new e(this.major)};e.prototype.toString=function(){return this.major+"."+this.minor+"."+this.bugfix};return e});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-lib', location = 'applinks/internal/lib/aui-version-details.js' */
define("applinks/lib/aui-version-details",["applinks/lib/version"],function(g){var d=new g(5,8,15);var f=new g(5,9,13);var e=new g(5,8);var c=new g(5,9);function a(h){if(h.lessThan(d)){throw new Error("AUI version "+h+" is too low, you need to upgrade AUI to "+d+" or "+f+" for Applinks to work")}if(h.greaterThanOrEqual(c)&&h.lessThan(f)){throw new Error("AUI version "+h+" is too low, you need to upgrade AUI to "+f+" for Applinks to work")}}function b(h){var i=g.parse(h.version,"AUI version");a(i);h.versionDetails=i;h.versionDetails.is58=i.toMinor().equals(e);h.versionDetails.is59=i.toMinor().equals(c);return h}return{addVersionDetails:b}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-lib', location = 'applinks/internal/lib/console-amd.js' */
define("applinks/lib/console",function(){return window.console});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-lib', location = 'applinks/internal/lib/jquery-amd.js' */
define("applinks/lib/jquery",function(){return window.jQuery});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-lib', location = 'applinks/internal/lib/aui-amd.js' */
define("applinks/lib/aui",["applinks/lib/window","applinks/lib/aui-version-details"],function(b,c){var a=b.AJS;if(!a){throw new Error("window.AJS not defined, cannot load AUI")}return c.addVersionDetails(a)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-lib', location = 'applinks/internal/lib/wrm-amd.js' */
define("applinks/lib/wrm",function(){return window.WRM});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-lib', location = 'applinks/internal/lib/skate-amd.js' */
define("applinks/lib/skate",function(){return window.skate});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-lib', location = 'applinks/internal/lib/window-amd.js' */
define("applinks/lib/window",function(){return window});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-common-exported', location = 'applinks/internal/common/docs.js' */
define("applinks/common/docs",["applinks/lib/jquery","applinks/lib/aui","applinks/common/help-paths"],function(c,b,a){return{createDocLink:function(d,f,e){if(!e){e=""}else{e=" "+e}return c("<a/>",{"class":"ual-help-link help-link"+e,href:this.getDocHref(d,f),target:"_blank","data-help-link-key":d,text:"Help",title:"Help"})},getDocHref:function(e,f){var d=a.getFullPath(e);if(f){d+="#"+a.getPath(f)}return d}}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-common-exported', location = 'applinks/internal/common/help-paths.js' */
define("applinks/common/help-paths",["applinks/lib/console","applinks/lib/wrm","applinks/lib/lodash","applinks/common/modules","applinks/common/preconditions"],function(b,a,g,e,d){var f=g.memoize(function(){var j=a.data.claim(e.dataFqn(e.COMMON_EXPORTED,"applinks-help-paths"));if(!j.entries){b.warn("Help paths not found, all help links are likely to be broken.")}return j.entries||{}});var i=function(j,m){d.nonEmptyString(j,"key");var l=f()[j]||j;if(m){d.nonEmptyString(m,"sectionKey");var k=l.replace(/\+/g,"");l+="#"+k+"-"+m}return l};function c(j,k){return j.indexOf(k,j.length-k.length)!==-1}function h(j,k){return c(j,k)?j:j+k}return{getPath:i,getFullPath:function(j,l){var k=this.baseUrl();return h(k,"/")+this.getPath(j,l)},baseUrl:g.partial(i,"applinks.docs.root")}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-common-exported', location = 'applinks/internal/common/events.js' */
define("applinks/common/events",["applinks/lib/jquery","applinks/lib/lodash","applinks/lib/window","applinks/common/preconditions"],function(e,b,d,f){var c="applinks.event.";function a(g){return c+f.nonEmptyString(g,"eventId")}return{PREREADY:a("preready"),READY:a("ready"),APPLINKS_LOADED:a("loaded"),APPLINKS_UPDATED:a("updated"),NEW_APPLINK_CREATED:a("created"),V3_ONBOARDING_FINISHED:a("v3-onboarding-finished"),Legacy:{MESSAGE_BOX_DISPLAYED:a("message-box-displayed")},applinksEvent:a,on:function(h,i,g){var j=g?b.bind(i,g):i;e(d.document).on(h,j)},off:function(g,h){e(d.document).off(g,h)},trigger:function(g,h){e(d.document).trigger(g,h)}}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-common-exported', location = 'applinks/internal/common/i18n.js' */
define("applinks/common/i18n",["applinks/lib/lodash","applinks/lib/jquery","applinks/lib/wrm","applinks/common/modules","applinks/common/preconditions","applinks/common/products"],function(e,g,c,f,h,b){var a=e.memoize(function(){var i=c.data.claim(f.dataFqn(f.COMMON_EXPORTED,"entity-types"));return h.hasValue(i,"entity-types","Entity Types data not found")});var d=e.memoize(function(){var i=c.data.claim(f.dataFqn(f.COMMON_EXPORTED,"authentication-types"));return h.hasValue(i,"authentication-types","Authentication Types data not found")});return{getApplicationTypeName:function(i){return b.getTypeName(i)},getEntityTypeName:function(i){return a().singular[i]||i},getPluralizedEntityTypeName:function(i){return a().plural[i]||i},getAuthenticationTypeName:function(i){return d()[i]||i}}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-common-exported', location = 'applinks/internal/common/modules.js' */
define("applinks/common/modules",function(){return{PLUGIN_KEY:"com.atlassian.applinks.applinks-plugin",COMMON_EXPORTED:"applinks-common-exported",COMMON:"applinks-common",fqn:function(a){return this.PLUGIN_KEY+":"+a},dataFqn:function(a,b){return this.fqn(a)+"."+b}}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-common-exported', location = 'applinks/internal/common/preconditions.js' */
define("applinks/common/preconditions",["applinks/lib/lodash"],function(c){function f(i,j,h){return d(c.isString(i)&&!c.isEmpty(i),h,b(j,": expected a non-empty string, was: <"+i+">"),i)}function g(i,j,h){return d(c.isFunction(i),h,b(j,": expected a function, was: "+i),i)}function a(i,j,h){return d(c.isArray(i),h,b(j,": expected an array, was: "+i),i)}function e(i,j,h){return d(i,h,b(j,": expected a value"),i)}function d(l,i,h,k){var j=i?i:h;if(!l){throw new Error(j)}return k||l}function b(i,h){return(i||"[unspecified]")+h}return{checkArgument:c.partial(d,c,c,"",c),nonEmptyString:f,isArray:a,isFunction:g,hasValue:e}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-common-exported', location = 'applinks/internal/common/products.js' */
define("applinks/common/products",["applinks/lib/lodash","applinks/lib/wrm","applinks/common/modules","applinks/common/preconditions"],function(c,b,d,f){var a=c.memoize(function(){var g=b.data.claim(d.dataFqn(d.COMMON_EXPORTED,"applinks-types"));return f.hasValue(g,"types","Application Types data not found")});function e(g){return a()[g]||g}return{BAMBOO:"bamboo",BITBUCKET:"stash",CONFLUENCE:"confluence",FECRU:"fecru",JIRA:"jira",REFAPP:"refapp",STASH:"stash",getTypeName:e}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-util-js', location = 'applinks/internal/non-amd/rest-service.js' */
(function(a,c,b){AppLinks=AJS.$.extend(window.AppLinks||{},{Event:{NAMESPACE:"applinks"},I18n:a,Docs:c});AppLinks.Event=AJS.$.extend(window.AppLinks.Event,b);if(AJS.AppLinksInitialisationBinder){AppLinks.initialisationBinder=AJS.AppLinksInitialisationBinder}else{AppLinks.initialisationBinder=function(d){AJS.toInit(d)}}AppLinks.initialisationBinder(function(){var d=AJS.$;AppLinks=d.extend(window.AppLinks||{},{failure:function(g){if(g.status==401){window.location.reload()}else{var e=AppLinks.parseError(g);var f=d(".page-error");if(f.length>0){f.html(e).fadeIn("slow")}else{alert("REST request failed: "+e)}}},jsonRequest:function(f,g,h,i,e){if(h){h=JSON.stringify(h)}d(".page-error").fadeOut("fast");if(!e){e=AppLinks.failure}return jQuery.ajax({url:f,type:g,data:h,dataType:"json",contentType:"application/json; charset=utf-8",cache:false,success:i,error:e})},xmlRequest:function(f,g,h,i,e){if(h){h=JSON.stringify(h)}d(".page-error").fadeOut("fast");if(!e){e=AppLinks.failure}return jQuery.ajax({url:f,type:g,data:h,dataType:"xml",contentType:"application/xml; charset=utf-8",cache:false,success:i,error:e})},parseError:function(h){var f;try{f=JSON.parse(h.responseText)}catch(g){if(h.statusText){return f=h.statusText}else{return h}}if(f.message){if(d.isArray(f.message)){return f.message.join(" ")}return f.message}else{return h.statusText}},put:function(f,g,h,e){return AppLinks.jsonRequest(f,"PUT",g,h,e)},post:function(f,g,h,e){return AppLinks.jsonRequest(f,"POST",g,h,e)},update:function(f,g,e){AppLinks.put(AppLinks.self_link(f),f,g,e)},get:function(f,g,e){return AppLinks.jsonRequest(f,"GET",null,g,e)},getXml:function(f,g,e){return AppLinks.xmlRequest(f,"GET",null,g,e)},self_link:function(g){for(var e=0,h=g.link.length;e<h;e++){var f=g.link[e];if(f.rel=="self"){return f.href}}throw"No self-link found"},del:function(h,g,f){var e;if(typeof(h)=="string"){e=h}else{e=AppLinks.self_link(h)}return AppLinks.jsonRequest(e,"DELETE",null,g,f)},SPI:d.extend({},{API_VERSION:"1.0",REST_RESOURCE_URL:AJS.contextPath()+"/rest/applinks/",BASE_URL:AJS.contextPath()+"/rest/applinks/1.0",OAUTH_REST_RESOURCE_URL:AJS.contextPath()+"/rest/applinks-oauth/",OAUTH_BASE_URL:AJS.contextPath()+"/rest/applinks-oauth/1.0",setApiVersion:function(e){AppLinks.SPI.API_VERSION=e;AppLinks.SPI.setBaseUrl(AppLinks.SPI.REST_RESOURCE_URL+AppLinks.SPI.API_VERSION)},setBaseUrl:function(e){AppLinks.SPI.BASE_URL=e},setOAuthBaseUrl:function(e){AppLinks.SPI.OAUTH_BASE_URL=e},getRemoteRestBaseUrl:function(e){return e+"/rest/applinks/"+AppLinks.SPI.API_VERSION},getRemotePluginServletBaseUrl:function(e){return e+"/plugins/servlet"},getAllLinks:function(g,f){var e=AppLinks.SPI.BASE_URL+"/applicationlink";return AppLinks.get(e,g,f)},getAllLinksWithAuthInfo:function(g,f){var e=AppLinks.SPI.BASE_URL+"/listApplicationlinks";return AppLinks.get(e,g,f)},getApplicationLinkState:function(h,g,f){var e=AppLinks.SPI.BASE_URL+"/listApplicationlinkstates/id/"+h;return AppLinks.get(e,g,f)},getLinksOfType:function(g,h,f){var e=AppLinks.SPI.BASE_URL+"/applicationlink/type/"+g;return AppLinks.get(e,h,f)},tryToFetchManifest:function(g,h,f){var e=AppLinks.SPI.BASE_URL+"/applicationlinkForm/manifest.json?url="+encodeURIComponent(g);return AppLinks.get(e,h,f)},getManifestFor:function(h,g,f){var e=AppLinks.SPI.BASE_URL+"/manifest/"+h+".json";return AppLinks.get(e,g,f)},getLocalManifest:function(g,f){var e=AppLinks.SPI.BASE_URL+"/manifest.json";return AppLinks.get(e,g,f)},getRemoteManifest:function(g,h,f){var e=AppLinks.SPI.getRemoteRestBaseUrl(g)+"/manifest.json";return AppLinks.get(e,h,f)},getRemoteOAuthConsumerInfo:function(g,h,f){var e=AppLinks.SPI.getRemotePluginServletBaseUrl(g)+"/oauth/consumer-info";return AppLinks.getXml(e,h,f)},getApplinkStatus:function(h,g,f){var e=AppLinks.SPI.BASE_URL+"/status/"+h;return AppLinks.get(e,g,f)},createStaticUrlAppLink:function(h,g,f){var e=AppLinks.SPI.BASE_URL+"/applicationlinkForm/createStaticUrlAppLink?typeId="+h;return AppLinks.post(e,null,g,f)},createLink:function(l,j,n,f,k,m,h,o,g){var e=AppLinks.SPI.BASE_URL+"/applicationlinkForm/createAppLink";var i={applicationLink:l,username:j,password:n,createTwoWayLink:f,customRpcURL:k,rpcUrl:m,configFormValues:h};return AppLinks.post(e,i,o,g)},verifyTwoWayLinkDetails:function(e,k,l,h,j,g){var f=AppLinks.SPI.BASE_URL+"/applicationlinkForm/details";var i={username:l,password:h,remoteUrl:e,rpcUrl:k};return AppLinks.post(f,i,j,g)},getApplicationLinkInfo:function(g,h,f){var e=AppLinks.SPI.BASE_URL+"/applicationlinkInfo/id/"+g;return AppLinks.get(e,h,f)},deleteLink:function(i,e,h,g){var f=AppLinks.SPI.BASE_URL+"/applicationlink/"+i.id;if(e){f+="?reciprocate=true"}return AppLinks.del(f,h,g)},makePrimary:function(g,f){var e=AppLinks.SPI.BASE_URL+"/applicationlink/primary/"+g.id;return AppLinks.post(e,null,f)},relocate:function(j,h,e,i,g){var f=AppLinks.SPI.BASE_URL+"/relocateApplicationlink/"+j.id+"?newUrl="+encodeURIComponent(h)+"&nowarning="+(e?"true":"false");return AppLinks.post(f,null,i,g)},legacyUpgrade:function(h,g,f){var e=AppLinks.SPI.BASE_URL+"/upgrade/legacy/"+h.id;return AppLinks.post(e,null,g,f)},ualUpgrade:function(i,e,h,g){var f=AppLinks.SPI.BASE_URL+"/upgrade/ual/"+i.id;return AppLinks.post(f,e,h,g)},getEntityTypesForApplicationType:function(h,g,f){var e=AppLinks.SPI.BASE_URL+"/type/entity/"+h;return AppLinks.get(e,g,f)},getLocalEntitiesWithLinksToApplication:function(e,h,g){var f=AppLinks.SPI.BASE_URL+"/entitylink/localEntitiesWithLinksTo/"+e+".json";return AppLinks.get(f,h,g)},getEntityLinksForApplication:function(e,h,g){var f=AppLinks.SPI.BASE_URL+"/entities/"+e+".json";AppLinks.get(f,h,g)},getEntityLinksForApplicationUsingAnonymousAccess:function(e,h,g){var f=AppLinks.SPI.BASE_URL+"/entities/anonymous/"+e+".json";return AppLinks.get(f,h,g)},createNonUalEntityLink:function(n,i,f,h,l,g,m,k){var e=AppLinks.SPI.BASE_URL+"/entitylink/"+n+"/"+i+"?reciprocate=false";var j={applicationId:f,typeId:h,key:l,name:g,isPrimary:false};return AppLinks.put(e,j,m,k)},createEntityLink:function(j,i,f,e,k,h){var g=AppLinks.SPI.BASE_URL+"/entitylink/"+j+"/"+i+"?reciprocate=";g+=(e?"true":"false");return AppLinks.put(g,f,k,h)},getConfiguredEntityLinks:function(h,g,i,f){var e=AppLinks.SPI.BASE_URL+"/entitylink/primaryLinks/"+h+"/"+g+".json";return AppLinks.get(e,i,f)},deleteEntityLink:function(j,i,f,e,k,h){var g=AppLinks.SPI.BASE_URL+"/entitylink/"+j+"/"+i+"?typeId="+f.typeId+"&key="+f.key+"&applicationId="+f.applicationId+"&reciprocate="+e;return AppLinks.del(g,k,h)},makePrimaryEntityLink:function(i,h,e,j,g){var f=AppLinks.SPI.BASE_URL+"/entitylink/primary/"+i+"/"+h+"?typeId="+e.typeId+"&key="+e.key+"&applicationId="+e.applicationId;return AppLinks.post(f,null,j,g)},canDeleteAppLink:function(h,g,f){var e=AppLinks.SPI.BASE_URL+"/permission/reciprocate-application-delete/"+h;return AppLinks.get(e,g,f)},canDeleteEntityLink:function(i,h,e,j,g){var f=AppLinks.SPI.BASE_URL+"/permission/reciprocate-entity-delete/"+e.applicationId+"/"+i+"/"+h+"/"+e.typeId+"/"+e.key;return AppLinks.get(f,j,g)},canCreateReciprocateEntityLink:function(h,g,f){var e=AppLinks.SPI.BASE_URL+"/permission/reciprocate-entity-create/"+h;return AppLinks.get(e,g,f)},processPermissionCode:function(f){var e={noPermission:function(){},missing:function(){},credentialsRequired:function(g){},authenticationFailed:function(g){},noAuthentication:function(g){},noAuthenticationConfigured:function(){},noConnection:function(){},allowed:function(){},unrecognisedCode:function(g){},updateView:function(i,h,g){}};if(!f){f={}}f=d.extend(e,f);return function(h){var g=h.code;if(g=="NO_PERMISSION"){f.noPermission()}else{if(g=="MISSING"){f.missing()}else{if(g=="CREDENTIALS_REQUIRED"){f.credentialsRequired(h.url)}else{if(g=="AUTHENTICATION_FAILED"){f.authenticationFailed(h.url)}else{if(g=="NO_AUTHENTICATION"){f.noAuthentication(h.url)}else{if(g=="NO_AUTHENTICATION_CONFIGURED"){f.noAuthenticationConfigured()}else{if(g=="NO_CONNECTION"){f.noConnection()}else{if(g=="ALLOWED"){f.allowed()}else{f.unrecognisedCode(h.code)}}}}}}}}}},addAuthenticationTrigger:function(g,e,f){if(!f){f={}}if(typeof f.onSuccess=="undefined"){f.onSuccess=function(){location.reload()}}if(typeof f.onFailure=="undefined"){f.onFailure=function(){return true}}d(g).unbind("click");d(g).click(function(){if(f.before){f.before()}AppLinks.authenticateRemoteCredentials(e,f.onSuccess,f.onFailure)})},showCreateEntityLinkSuggestion:function(){return true},getApplicationLink:function(h,g,f){var e=AppLinks.SPI.BASE_URL+"/applicationlink/"+h;return AppLinks.get(e,g,f)},createApplicationLink:function(h,f,k,l,e,m,i){var g=AppLinks.SPI.BASE_URL+"/applicationlink";var j={id:h,name:f,rpcUrl:k,displayUrl:l,typeId:e};return AppLinks.put(g,j,m,i)},createConsumer:function(g,p,f,o,k,n,i,r,j,m,q,h){var e=AppLinks.SPI.OAUTH_BASE_URL+"/applicationlink/"+g+"/authentication/consumer";var l={key:p,name:f,description:o,sharedSecret:k,publicKey:n,outgoing:m,twoLOAllowed:i,executingTwoLOUser:r,twoLOImpersonationAllowed:j};return AppLinks.put(e,l,q,h)},createConsumerAutoConfigure:function(l,k,h,e,j,g){var f=AppLinks.SPI.OAUTH_BASE_URL+"/applicationlink/"+l+"/authentication/consumer?autoConfigure=true";var i={twoLOAllowed:k,executingTwoLOUser:h,twoLOImpersonationAllowed:e};return AppLinks.put(f,i,j,g)},registerProvider:function(k,j,g,i,f){var e=AppLinks.SPI.BASE_URL+"/applicationlink/"+k+"/authentication/provider";var h={config:g,provider:j};return AppLinks.put(e,h,i,f)},enableFeature:function(g,h,f){var e=AppLinks.SPI.BASE_URL+"/features/"+g;return AppLinks.put(e,{},h,f)},disableFeature:function(g,h,f){var e=AppLinks.SPI.BASE_URL+"/features/"+g;return AppLinks.del(e,h,f)}},(window.AppLinks&&window.AppLinks.SPI)||{})});AppLinks.UI={showInfoBox:function(e){d(".aui-message.success").remove();AppLinks.UI.createMessage("success",e,"page-info")},hideInfoBox:function(){d(".aui-message.success").remove()},showErrorBox:function(e){AppLinks.UI.createMessage("error",e,"page-error")},hideErrorBox:function(){d(".aui-message.error").remove()},showWarningBox:function(f){if(d.isArray(f)&&f.length>0){var e=d("<ul></ul>");d(f).each(function(h){e.append(d("<li/>",{text:f[h]}))});var g=d('<div class="page-warning"></div>').append(e);AppLinks.UI.createMessage("warning",g.html(),"page-warning")}else{AppLinks.UI.createMessage("warning",f,"page-warning")}},hideWarningBox:function(){d(".aui-message.warning").remove()},shortenString:function(f,e){if(f.length>e){f=f.substring(0,e)+"..."}return f},createMessage:function(f,g,e){var h=d('<div class="'+e+'">');h.html(g);AJS.messages[f](".applinks-message-bar",{title:"",body:h.wrap("<div></div>").parent().html(),closeable:true});d(document).trigger(AppLinks.Event.Legacy.MESSAGE_BOX_DISPLAYED)},displayValidationErrorMessages:function(e,g,f){if(d.isArray(f)){d(f).each(function(k,j){var l=d('<div class="error applinks-error">');l.text(j);d(g).find("."+e).append(l)})}else{if(typeof f!="undefined"){var h=d('<div class="error applinks-error">');h.text(f.toString());d(g).find("."+e).append(h)}}},displayValidationError:function(e,f,g){return function(l){if(l.status==401){window.location.reload();return}d(".applinks-error").remove();d(".loading").remove();var j=l.responseText;var k=d.parseJSON(j);var i=k.message;if(typeof k.fields=="undefined"){AppLinks.UI.displayValidationErrorMessages(e,f,i)}else{var h=k.fields;d(h).each(function(m){var n=d('<div class="error applinks-error" id="'+h[m]+'-error">');n.text(i[m]);if(d(f).find("."+h[m]).length>0){n.insertAfter(d(f).find("."+h[m]))}else{n.insertAfter(d(f).find("."+e).append(n))}})}d(f).find("."+e).addClass("fully-populated-errors");if(g){g()}}},addProtocolToURL:function(e){var h=d.trim(e);var g=h.toLowerCase();var f=false;if(g.length>=7){if(g.substring(0,7).indexOf("http")!=-1){f=true}}if(!f){h="http://"+h}return h},prettyJoin:function(f,i,h){if(!h){h="and"}var e=f.length;var g="";d.each(f,function(j,k){if(j==(e-1)&&e>1){g+=" "+h+"  "+i(k)}else{g+=i(k);if(j+2<e){g+=", "}}});return g},showLoadingIcon:function(e){d('<span class="loading">&nbsp;</span>').insertAfter(e)},hideLoadingIcon:function(e){d(e).next(".loading").remove()},findUrl:function(h){var g=undefined;var i=h.toLowerCase();var f=i.indexOf("http:");if(f==-1){f=i.indexOf("https:")}if(f>-1){var e=i.indexOf(" ",f);if(e==-1){e=i.length}g=h.substring(f,e)}return g},findApplicationType:function(e){e=e.toLowerCase();if(e.indexOf("jira")!=-1){return"jira"}else{if(e.indexOf("fisheye")!=-1){return"fecru"}else{if(e.indexOf("confluence")!=-1){return"confluence"}else{if(e.indexOf("refapp")!=-1){return"refapp"}else{return undefined}}}}},escapeSelector:function(e){return e.replace(/([#;&,\.\+\*\~':"\!\^$\[\]\(\)=>\|])/g,"\\$1")},sanitiseHTML:function(e){var f={"<":"&lt;",'"':"&quot;","&":"&amp;"};return e.replace(/[<"&]/g,function(g){return f[g]})},removeCssClass:function(e,f){d(e).removeClass(function(h,j){var i=j.split(" ");var g="";d.each(i,function(k,l){if(l.indexOf(f)!=-1){g=l}});return g})}};(function(){var e=d({});d.each(["bind","unbind","trigger"],function(f,g){AppLinks.UI[g]=function(){return e[g].apply(e,arguments)}})})();d(document).trigger(AppLinks.Event.PREREADY);d(document).trigger(AppLinks.Event.READY)})})(require("applinks/common/i18n"),require("applinks/common/docs"),require("applinks/common/events"));
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-util-js', location = 'applinks/internal/non-amd/autocomplete.js' */
AJS.$(document).bind(AppLinks.Event.READY,function(){AppLinks.autoComplete={cacheManager:function(c){var a={},b=[],c=c||30;return{get:function(d){return a[d]},put:function(d,e){a[d]=e;b.push(d);if(b.length>c){delete a[b.shift()]}},clear:function(){a={};b=[]}}}};(function(d){var c=function(f){AJS.log("InputDrivenDropDown: truncating text");var h=f.$.closest(".aui-dropdown").width(),g=20;d("a span:not(.icon)",f.$).each(function(){var j=d(this),i=AJS("var","&#8230;"),l=i.width(),k=false;j.wrapInner(d("<em>"));d("em",j).each(function(){var m=d(this);m.show();if(this.offsetLeft+this.offsetWidth>h){var t=this.childNodes,s=false;for(var o=t.length-1;o>=0;o--){var p=t[o],n=1,r=(p.nodeType==3)?"nodeValue":"innerHTML",q=p[r];do{if(n<=q.length){p[r]=q.substr(0,q.length-n++)}else{break}}while(this.offsetLeft+this.offsetWidth+l>h-g);if(n<=q.length){s=true;break}}if(s){k=true}else{m.hide()}}});if(k){j.append(i);this.elpss=i}})};var b=function(f,l){if(!l.length||!l[0]){return}AJS.log("InputDrivenDropDown: highlighting tokens");for(var h=0,j=l.length;h<j;h++){var g=l[h];l[h]=g?g.replace(/[\.\*\+\?\|\(\)\[\]{}\\]/g,"\\$"):""}var k=new RegExp("("+l.join("|")+")","gi");d("li a:not(.dropdown-prevent-highlight) span",f.$).each(function(){var m=d(this),i=m.html().replace(k,"<strong>$1</strong>");m.html(i)})};var e=function(j,g){var i=j.options,h=j.dd;if(h){h.hide();h.$.remove()}i.ajsDropDownOptions=i.ajsDropDownOptions||{};if(i.ajsDropDownOptions&&!i.ajsDropDownOptions.alignment){i.ajsDropDownOptions.alignment="left"}i.ajsDropDownOptions.selectionHandler=i.ajsDropDownOptions.selectionHandler||function(l,k){if(l.type!="click"){l.preventDefault();d("a",k).click();document.location=d("a",k).attr("href")}};i.ajsDropDownOptions.displayHandler=function(k){return AJS.escapeHtml(k.name)};var f=j.dd=new AJS.dropDown(g.matrix,i.ajsDropDownOptions)[0];if(i.ajsDropDownOptions&&i.ajsDropDownOptions.className){f.$.addClass(i.ajsDropDownOptions.className)}if(i.dropdownPlacement){i.dropdownPlacement(f.$)}else{AJS.log("No dropdownPlacement function specified. Appending dropdown to the body.");d("body").append(f.$)}b(f,g.queryTokens||[g.query]);c(f);if(i.dropdownPostprocess){i.dropdownPostprocess(f.$)}f.show(j._effect);if(typeof i.onShow=="function"){i.onShow.call(f,f.$)}return f};function a(g,f){this._effect="appear";this._timer=null;this.id=g;this.options=f;this.inactive=false;this.busy=false;this.cacheManager=AppLinks.autoComplete.cacheManager()}a.prototype.clearCache=function(){this.cacheManager.clear()};a.prototype.change=function(h,g){var f=this;if(h!=f._value||g){f._value=h;f.busy=false;clearTimeout(f._timer);if(g||(/\S{0,}/).test(h)){var i=f.cacheManager.get(h);if(i){e(f,i)}else{f.busy=true;f._timer=setTimeout(function(){f.options.getDataAndRunCallback.call(f,h,f.show)},200)}}else{f.dd&&f.dd.hide()}}};a.prototype.dropDownLength=function(){return this.dd.links?this.dd.links.length:0};a.prototype.dropDownItem=function(f){return this.dropDownLength()>f?this.dd.links[f]:null};a.prototype.hide=function(){this.dd&&this.dd.hide()};a.prototype.remove=function(){var f=this.dd;if(f){this.hide();f.$.remove()}this.inactive=true;this.options.onDeath&&this.options.onDeath()};a.prototype.show=function(g,i,h){if(this.inactive){AJS.log("Quick search abandoned before server response received, ignoring. "+this);return}var f={matrix:g,query:i,queryTokens:h};this.cacheManager.put(i,f);e(this,f);this.busy=false};AppLinks.inputDrivenDropdown=function(f){return new a("inputdriven-dropdown",f)}})(jQuery)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.integration.jira.jira-integration-plugin:jira-create-issue-form', location = '/jira-create-issue-form/jira-create-issue-form.js' */
var jiraIntegration=window.jiraIntegration||{};jiraIntegration.JiraCreateIssueForm=(function(c,a){b.defaults={formClass:"jira-interation-create-issue-form",ignoreFieldsWithDefaultValue:true,excludedField:["project","issuetype","reporter"],renderSummaryAndDescription:false,get$unsupportedFieldMessage:function(d,e){return c(jiraIntegration.templates.jiraCreateIssueForm.unsupportedFieldsMessage({unsupportedFields:d,createIssueUrl:e}))},get$unexpectedError:function(d){return c(aui.message.error({content:AJS.escapeHtml(d)}))},get$unauthorizeMessage:function(d){return c(jiraIntegration.templates.jiraCreateIssueForm.authorize({extraClasses:"jira-oauth-dialog",applicationName:d}))},get$unsupportedServerMessage:function(d){return c(jiraIntegration.templates.jiraCreateIssueForm.unsupportedServerMessage({serverUrl:d}))}};function b(d){this.configuration=a.extend({},b.defaults,d);if(this.configuration.renderSummaryAndDescription){this.configuration.excludedField.push("summary","description")}this._init()}b.prototype._trigger=function(d,e){var f=this.configuration[d];if(f){f.apply(this,Array.prototype.slice.call(arguments,1))}};b.prototype._bindEventListener=function(){var d=this;this.defaultFields.server.on("change",function(g){d.resetForm();var f=this.value;d.currentServerId=f;if(f){d.formIsLoading(d.defaultFields.server);jiraIntegration.JiraCreateIssueForm.Data.isIssueCreationSupported(f).done(function(e){if(e){d._loadProjectData(f);d.formLoadingCompleted(d.defaultFields.server)}else{var h=jiraIntegration.JiraCreateIssueForm.Data.getServerById(f).displayUrl;d._handleUnsupportedServer(h)}}).fail(function(e){d._handleAjaxError(e)})}else{jiraIntegration.JiraCreateIssueForm.FieldHelper.resetSelectField(d.defaultFields.project);d.defaultFields.project.trigger("change")}d._trigger("onServerChanged",this.value)});this.defaultFields.project.on("change",function(){if(this.value){c('option[value=""]',d.defaultFields.project).remove();d._loadIssueType(d.defaultFields.server.val(),this.value)}else{jiraIntegration.JiraCreateIssueForm.FieldHelper.resetSelectField(d.defaultFields.issueType)}d.resetForm();d.defaultFields.issueType.trigger("change");d._trigger("onProjectChanged",this.value)});this.defaultFields.issueType.on("change",function(){d.resetForm();if(this.value){d._loadRequireFields()}else{d.$containerRequireField&&d.$containerRequireField.html("");c(".aui-message",this.formEl).remove()}d._trigger("onTypeChanged",this.value)})};b.prototype._init=function(){this.container=c(this.configuration.container);if(this.container.length){this._renderForm();this._bindEventListener();this._loadServerData()}else{throw new Error("container property should be defined.")}};b.prototype._renderForm=function(){this.formEl=c(jiraIntegration.templates.jiraCreateIssueForm.form({formClass:this.configuration.formClass}));if(this.configuration.renderSummaryAndDescription){this._renderSummaryAndDescription()}this.container.append(this.formEl);this.defaultFields=this._getDefaultFields();a.each(this.defaultFields,a.bind(function(d){this.createSelect2WithIcon(c(d))},this));this.$containerRequireField=c(".create-issue-required-fields",this.container);this._trigger("onFormRendered")};b.prototype._renderSummaryAndDescription=function(){var d=c(".create-issue-default-fields",this.formEl);d.append(aui.form.textField({labelContent:"Summary",isRequired:true,name:"summary"}));d.append(aui.form.textareaField({labelContent:"Description",name:"description"}))};b.prototype._getDefaultFields=function(){var d=c("."+this.configuration.formClass,this.configuration.container);return{server:c(".server-select",d),project:c(".project-select",d),issueType:c(".issuetype-select",d)}};b.prototype._loadServerData=function(){var d=this;this.formIsLoading(this.defaultFields.server);c.when(jiraIntegration.JiraCreateIssueForm.Data.loadServers()).then(function(e){d.formLoadingCompleted(d.defaultFields.server);d._loadServerDataComplete(e)})};b.prototype._loadRequireFields=function(){var e=this;var d={serverId:this.defaultFields.server.val(),projectKey:this.defaultFields.project.val(),issueType:this.defaultFields.issueType.val()};this.formIsLoading(this.defaultFields.issueType);var f=jiraIntegration.JiraCreateIssueForm.Data.getFieldMetadata(d);f.done(function(j){var g=e._getValidRequiredFields(j);if(e.configuration.renderSummaryAndDescription){var h=j.fields.description;var i=!!(h&&h.required);e._setDescriptionAsRequiredField(i)}e._renderRequireFields(g,d);e.formLoadingCompleted(e.defaultFields.issueType)}).fail(a.bind(e._handleAjaxError,this))};b.prototype._loadServerDataComplete=function(d){if(d.length){if(d.length===1){jiraIntegration.JiraCreateIssueForm.FieldHelper.hideField(this.defaultFields.server)}jiraIntegration.JiraCreateIssueForm.FieldHelper.fillSelectData(this.defaultFields.server,d,true);this._loadProjectData(d[0].id);this.currentServerId=d[0].id;this._hasMultiServer=d.length>1}else{this._handlerUnexpectedError("Don\'t have any JIRA server, please check the application link configuration.")}};b.prototype._loadProjectData=function(d){var e=this;this.formIsLoading(this.defaultFields.project);var f=jiraIntegration.JiraCreateIssueForm.Data.loadProjects(d);f.then(function(g){if(g.errors&&g.errors.length){var h=g.errors[0];if(h.authenticationUri){e._handleAuthorizeError(h)}else{e._handlerUnexpectedError(h.message)}}else{if(g.length){jiraIntegration.JiraCreateIssueForm.FieldHelper.fillSelectData(e.defaultFields.project,g);jiraIntegration.JiraCreateIssueForm.FieldHelper.resetSelectField(e.defaultFields.issueType)}else{e._handlerUnexpectedError("You do not have permission to create issues on this JIRA server.")}}e.formLoadingCompleted(e.defaultFields.project)},a.bind(e._handleAjaxError,this))};b.prototype._loadIssueType=function(e,d){var f=jiraIntegration.JiraCreateIssueForm.Data.getIssueTypes(e,d);jiraIntegration.JiraCreateIssueForm.FieldHelper.fillSelectData(this.defaultFields.issueType,f,true)};b.prototype._renderRequireFields=function(d,e){this.$containerRequireField.html("");var f=a.reject(d,jiraIntegration.fields.canRender);if(f.length){this._handleUnsupportedFields(f)}else{this.$containerRequireField.html(a.map(d,function(g){return jiraIntegration.fields.renderField(null,g,null,null)}).join(""));jiraIntegration.fields.attachFieldBehaviors(this.$containerRequireField,{serverId:e.serverId,projectKey:e.projectKey},null);this._trigger("onRequiredFieldsRendered",d,f)}};b.prototype._handlerUnexpectedError=function(e){var d=this.configuration.get$unexpectedError(e);c(".aui-message",this.formEl).remove();this.formEl.prepend(d);this.formLoadingCompleted();this.formHasError()};b.prototype._handleUnsupportedFields=function(d){d=a.map(d,function(f){return AJS.escapeHtml(f.name)});var e=this.configuration.get$unsupportedFieldMessage(d,this._getCreateJiraIssueUrl());c(".aui-message",this.formEl).remove();this.formEl.prepend(e);this._trigger("onError");this.formLoadingCompleted()};b.prototype._handleUnsupportedServer=function(d){var e=this.configuration.get$unsupportedServerMessage(d);c(".aui-message",this.formEl).remove();this.formEl.prepend(e);this.formLoadingCompleted();this.formHasError()};b.prototype._handleAjaxError=function(e){var d=this;if(e.status>=500&&e.status<600){d._handlerUnexpectedError("Received the following HTTP error code from the server"+":"+e.status)}d.formHasError()};b.prototype._handleAuthorizeError=function(f){var e=this;this.formHasError();var d=this.configuration.get$unauthorizeMessage(f.applicationName);this.formEl.append(d);c(".oauth-init",d).on("click",function(g){AppLinks.authenticateRemoteCredentials(f.authenticationUri,function(){e.resetForm();e._loadProjectData(e.currentServerId)},function(){e._handlerUnexpectedError(AJS.format("You have refused to permit access to {0}.",f.applicationName))});g.preventDefault()})};b.prototype._getCreateJiraIssueUrl=function(){var f=this.defaultFields.project.find("option:selected").val();var g=this.defaultFields.issueType.find("option:selected").val();var h=jiraIntegration.JiraCreateIssueForm.Data.getServerById(this.currentServerId).displayUrl;h=h+"/secure/CreateIssueDetails!Init.jspa?pid="+f+"&issuetype="+g;var e=this._getFieldValue("summary");if(e.length){h=h+"&summary="+encodeURIComponent(e)}var d=this._getFieldValue("description");if(d.length){h=h+"&description="+encodeURIComponent(d)}return h};b.prototype._getValidRequiredFields=function(d){var e=this;return a.filter(d.fields,function(h){var g=h.schema?(h.schema.system||h.schema.custom||h.schema.customId):h;var f=a.contains(e.configuration.excludedField,g);return(h.required&&!f&&!h.hasDefaultValue)})};b.prototype._getFieldValue=function(e){var d=c("[name='"+e+"']",this.formEl);return(d)?c.trim(d.val()):""};b.prototype._setDescriptionAsRequiredField=function(d){var e=c('.field-group [name="description"]',this.formEl).prev("label");e.find(".aui-icon.aui-icon-required").remove();if(d){e.append(aui.icons.icon({icon:"required"}))}};b.prototype.resetForm=function(){c(".aui-message",this.formEl).remove();c(".field-group",this.formEl).show();if(this.configuration.renderSummaryAndDescription){this._setDescriptionAsRequiredField(false)}if(!this._hasMultiServer){jiraIntegration.JiraCreateIssueForm.FieldHelper.hideField(this.defaultFields.server)}this.$containerRequireField.html("")};b.prototype.formHasError=function(){c(".field-group",this.formEl).hide();this.$containerRequireField.html("");jiraIntegration.JiraCreateIssueForm.FieldHelper.showField(this.defaultFields.server);jiraIntegration.JiraCreateIssueForm.FieldHelper.setFieldDisabled(c(".insert-issue-button"),true);this._trigger("onError");this.formLoadingCompleted()};b.prototype.getCurrentServer=function(){return jiraIntegration.JiraCreateIssueForm.Data.getServerById(this.currentServerId)};b.prototype.formIsLoading=function(d){if(d){jiraIntegration.JiraCreateIssueForm.FieldHelper.setIsLoading(d,true)}var e=c(":input",c(this.formEl));jiraIntegration.JiraCreateIssueForm.FieldHelper.setFieldDisabled(e,true)};b.prototype.formLoadingCompleted=function(d){if(d){jiraIntegration.JiraCreateIssueForm.FieldHelper.setIsLoading(d,false)}else{c(".aui-icon.aui-icon-wait",this.formEl).remove()}var e=c(":input",c(this.formEl));jiraIntegration.JiraCreateIssueForm.FieldHelper.setFieldDisabled(e,false)};b.prototype.createSelect2WithIcon=function(d){if(d.is(".server-select")){d.auiSelect2({minimumResultsForSearch:-1})}else{var e=d.is(".project-select")?{formatSelection:this.projectSelectFormat,formatResult:this.projectSelectFormat,extraAttributes:this.defaultFields}:{formatSelection:this.issueTypeSelectFormat,formatResult:this.issueTypeSelectFormat,minimumResultsForSearch:-1,extraAttributes:this.defaultFields};d.auiSelect2(e)}d.auiSelect2("val","")};b.prototype.projectSelectFormat=function(f){var e=this.extraAttributes.server.find("option:selected").val();var d=jiraIntegration.JiraCreateIssueForm.Data.getProjectIconUrl(e,f.id);return jiraIntegration.templates.fields.select2WithIconOption({optionValue:f.text,iconUrl:d,isProject:true})};b.prototype.issueTypeSelectFormat=function(g){var f=this.extraAttributes.server.find("option:selected").val();var d=this.extraAttributes.project.find("option:selected").val();var e=jiraIntegration.JiraCreateIssueForm.Data.getIssueTypeIconUrl(f,d,g.id);return jiraIntegration.templates.fields.select2WithIconOption({optionValue:g.text,iconUrl:e,isProject:false})};return b})(AJS.$,window._);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.integration.jira.jira-integration-plugin:jira-create-issue-form', location = '/jira-create-issue-form/jira-create-issue-form-data.js' */
var jiraIntegration=window.jiraIntegration||{};jiraIntegration.JiraCreateIssueForm=jiraIntegration.JiraCreateIssueForm||{};jiraIntegration.JiraCreateIssueForm.Data=(function(d){var m={};var b={};var p=AJS.contextPath()+"/plugins/servlet/jira-integration/icons?serverId={0}&iconType={1}&{2}";var i=[];var g=function(r,q){return d.ajax({dataType:"json",timeout:0,url:r,success:q})};function o(){return g(AJS.contextPath()+"/rest/jira-integration/1.0/servers",function(q){if(q.length){d.each(q,function(r,s){m[s.id]=s})}})}function n(q){var r=(m[q])?m[q].projects:undefined;return r?d.Deferred().resolve(r):g(AJS.contextPath()+"/rest/jira-integration/1.0/servers/"+q+"/projects",function(s){if(s.length){d.each(s,function(v,x){var w=_.filter(x.issuetypes,function(y){return !y.subtask});x.issueTypes=w;var u=[];_.each(w,function(y){u[y.id]=y.iconUrl});var t={iconUrl:AJS.format(p,q,"project",x.avatarUrls["16x16"].split("/secure/projectavatar?")[1]),issueTypes:u};i[a(q,x.id)]=t});if(!m[q]){m[q]={}}m[q].projects=s}})}function f(r,q){var s=_.find(l(r),function(t){return t.id===q});return s?s.issueTypes:[]}function h(q){var r=a(q.serverId,q.projectKey,q.issueType);if(!_.has(b,r)){return d.ajax({type:"GET",timeout:0,url:AJS.contextPath()+"/rest/jira-integration/1.0/servers/"+q.serverId+"/projects/"+q.projectKey+"/issue-types/"+q.issueType+"/fields-meta"}).pipe(function(s){b[r]=s;return b[r]})}else{return d.Deferred().resolve(b[r])}}function e(q){return m?m[q]:{}}function k(q){if(!m||!m[q]){return false}return(m[q].isSupported!=undefined)?d.Deferred().resolve(m[q].issueCreationSupported):d.ajax({type:"GET",timeout:0,url:AJS.contextPath()+"/rest/jira-integration/1.0/servers/"+q+"/features"}).pipe(function(r){if(r!=undefined){m[q].issueCreationSupported=_.contains(r,"CREATE_ISSUE")}return m[q].issueCreationSupported})}function l(q){return m&&m[q]?m[q].projects:[]}function j(r,q){var s=a(r,q);return i[s]?i[s].iconUrl:""}function c(s,r,t){var u=a(s,r);var q=i[u];return(q&&q.issueTypes[t])?q.issueTypes[t]:""}function a(r,q,s){return r+(q?"-"+q:"")+(s?"-"+s:"")}return{loadServers:o,loadProjects:n,getIssueTypes:f,getFieldMetadata:h,getServerById:e,getProjectIconUrl:j,getIssueTypeIconUrl:c,getProjects:l,isIssueCreationSupported:k}})(AJS.$);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.integration.jira.jira-integration-plugin:jira-create-issue-form', location = '/jira-create-issue-form/jira-create-issue-form-field-helper.js' */
var jiraIntegration=window.jiraIntegration||{};jiraIntegration.JiraCreateIssueForm=jiraIntegration.JiraCreateIssueForm||{};jiraIntegration.JiraCreateIssueForm.FieldHelper=(function(c,h){function e(j,l,k){var m=k?[]:[a(j)];c.each(l,function(n,p){var o={value:p.id,text:p.name,iconUrl:p.iconUrl?p.iconUrl:(p.avatarUrls?p.avatarUrls["16x16"]:"")};if(k&&n===0){o.selected=true}m.push(aui.form.optionOrOptgroup(o))});j.html(m.join(""));j.auiSelect2("val","")}function b(j){j.html(a(j));j.auiSelect2("val","")}function a(j){var k=j.attr("data-placeholder");return aui.form.optionOrOptgroup({value:"",text:k,iconUrl:""})}function i(j){j.parent().hide()}function d(j){j.parent().show()}function f(k,j){j?k.disable():k.enable()}function g(k,j){return j?k.after(aui.icons.icon({icon:"wait"})):k.next(".aui-icon.aui-icon-wait").remove()}return{fillSelectData:e,resetSelectField:b,hideField:i,showField:d,setFieldDisabled:f,setIsLoading:g}})(AJS.$,window._);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.integration.jira.jira-integration-plugin:jira-create-issue-form', location = '/jira-create-issue-form/jira-create-issue-form.soy' */
// This file was automatically generated from jira-create-issue-form.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace jiraIntegration.templates.jiraCreateIssueForm.
 */

if (typeof jiraIntegration == 'undefined') { var jiraIntegration = {}; }
if (typeof jiraIntegration.templates == 'undefined') { jiraIntegration.templates = {}; }
if (typeof jiraIntegration.templates.jiraCreateIssueForm == 'undefined') { jiraIntegration.templates.jiraCreateIssueForm = {}; }


jiraIntegration.templates.jiraCreateIssueForm.form = function(opt_data, opt_ignored) {
  return '' + aui.form.form({id: 'jira-create-form', extraClasses: opt_data.formClass, method: 'post', action: '#', content: '<fieldset class="create-issue-default-fields"><div class="field-group"><label>' + soy.$$escapeHtml('Server') + '<span class="aui-icon icon-required"> required</span></label><select class="jira-select2-drop-box server-select" name="server" data-placeholder="' + soy.$$escapeHtml('Select a server') + '"><option disabled selected value="">' + soy.$$escapeHtml('Select a server') + '</option></select></div><div class="field-group"><label>' + soy.$$escapeHtml('Project') + '<span class="aui-icon icon-required"> required</span></label><select class="jira-select2-drop-box project-select" name="project" data-placeholder="' + soy.$$escapeHtml('Select a project') + '"><option disabled selected value="">' + soy.$$escapeHtml('Select a project') + '</option></select></div><div class="field-group"><label>' + soy.$$escapeHtml('Issue Type') + '<span class="aui-icon icon-required"> required</span></label><select class="jira-select2-drop-box issuetype-select" name="issue-type" data-placeholder="' + soy.$$escapeHtml('Select an issue type') + '"><option disabled selected value="">' + soy.$$escapeHtml('Select an issue type') + '</option></select></div></fieldset><fieldset class="create-issue-required-fields"></fieldset>'});
};
if (goog.DEBUG) {
  jiraIntegration.templates.jiraCreateIssueForm.form.soyTemplateName = 'jiraIntegration.templates.jiraCreateIssueForm.form';
}


jiraIntegration.templates.jiraCreateIssueForm.unsupportedFieldsMessage = function(opt_data, opt_ignored) {
  var param29 = '';
  if (opt_data.unsupportedFields.length == 1) {
    var field__soy32 = '<strong>' + soy.$$escapeHtml(opt_data.unsupportedFields) + '</strong>';
    param29 += soy.$$filterNoAutoescape(AJS.format('The required field {0} is not available in this form. You will need to',field__soy32));
  } else {
    var fieldList__soy39 = '' + jiraIntegration.templates.jiraCreateIssueForm.buildFieldList({fields: opt_data.unsupportedFields});
    param29 += soy.$$filterNoAutoescape(AJS.format('The required fields {0} are not available in this form. You will need to',fieldList__soy39));
  }
  param29 += ' <a href="' + soy.$$escapeHtml(opt_data.createIssueUrl) + '" target="_blank">' + soy.$$escapeHtml('create your issue directly in JIRA') + '</a>.';
  var output = '' + aui.message.warning({content: param29});
  return output;
};
if (goog.DEBUG) {
  jiraIntegration.templates.jiraCreateIssueForm.unsupportedFieldsMessage.soyTemplateName = 'jiraIntegration.templates.jiraCreateIssueForm.unsupportedFieldsMessage';
}


jiraIntegration.templates.jiraCreateIssueForm.buildFieldList = function(opt_data, opt_ignored) {
  var output = '';
  var joinText__soy51 = '' + ((opt_data.fields.length == 2) ? ' ' + soy.$$escapeHtml('and') + ' ' : ', ');
  var fieldList59 = opt_data.fields;
  var fieldListLen59 = fieldList59.length;
  for (var fieldIndex59 = 0; fieldIndex59 < fieldListLen59; fieldIndex59++) {
    var fieldData59 = fieldList59[fieldIndex59];
    output += ((! (fieldIndex59 == 0)) ? soy.$$escapeHtml(joinText__soy51) : '') + '<strong>' + soy.$$escapeHtml(fieldData59) + '</strong>';
  }
  return output;
};
if (goog.DEBUG) {
  jiraIntegration.templates.jiraCreateIssueForm.buildFieldList.soyTemplateName = 'jiraIntegration.templates.jiraCreateIssueForm.buildFieldList';
}


jiraIntegration.templates.jiraCreateIssueForm.authorize = function(opt_data, opt_ignored) {
  opt_data = opt_data || {};
  var output = '';
  var applicationNameEscaped__soy68 = '' + soy.$$escapeHtml(opt_data.applicationName);
  output += aui.message.info({content: '' + soy.$$filterNoAutoescape(AJS.format('{0}Log in and approve{1} to retrieve data from {2}','<a class="oauth-init" href="#">','</a>',applicationNameEscaped__soy68))});
  return output;
};
if (goog.DEBUG) {
  jiraIntegration.templates.jiraCreateIssueForm.authorize.soyTemplateName = 'jiraIntegration.templates.jiraCreateIssueForm.authorize';
}


jiraIntegration.templates.jiraCreateIssueForm.unsupportedServerMessage = function(opt_data, opt_ignored) {
  return '' + aui.message.warning({content: '' + soy.$$filterNoAutoescape(AJS.format('The version of selected JIRA server is not supported. You may want to upgrade to at least version 5.x or {0}create issue in JIRA{1}.','<a href="' + opt_data.serverUrl + '" target="_blank">','</a>'))});
};
if (goog.DEBUG) {
  jiraIntegration.templates.jiraCreateIssueForm.unsupportedServerMessage.soyTemplateName = 'jiraIntegration.templates.jiraCreateIssueForm.unsupportedServerMessage';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.applinks.applinks-plugin:feature-oauth-dance', location = 'applinks/internal/feature/oauth/oauth-callback.js' */
define("applinks/feature/oauth-callback",["applinks/lib/window","applinks/lib/lodash","applinks/common/preconditions"],function(c,a,d){function b(e){d.nonEmptyString(e,"url");this._url=e}b.prototype.source=function(e){d.hasValue(e,"source");this._source=e;return this};b.prototype.onSuccess=function(e){d.isFunction(e,"onSuccess");this._onSuccess=e;return this};b.prototype.onFailure=function(e){d.isFunction(e,"onFailure");this._onFailure=e;return this};b.prototype.success=function(){this.oauthWindow.close();if(this._onSuccess){this._onSuccess(this._source)}delete c.oauthCallback};b.prototype.failure=function(){this.oauthWindow.close();if(this._onFailure){this._onFailure(this._source)}delete c.oauthCallback};b.prototype.open=function(){c.oauthCallback=this;this.oauthWindow=c.open(this._url,"com_atlassian_applinks_authentication")};return b});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.applinks.applinks-plugin:feature-oauth-dance', location = 'applinks/internal/feature/oauth/oauth-dance.js' */
define("applinks/feature/oauth-dance",["applinks/lib/console","applinks/lib/jquery","applinks/lib/lodash","applinks/lib/window","applinks/common/events","applinks/common/preconditions","applinks/feature/oauth-callback"],function(a,f,c,e,b,h,d){function g(j,i){this._scope=j||e.document;this._selector=i}g.prototype.onSuccess=function(i){h.isFunction(i,"onSuccess");this._onSuccess=i;return this};g.prototype.onFailure=function(i){h.isFunction(i,"onFailure");this._onFailure=i;return this};g.prototype.defaultSuccess=function(){return this.onSuccess(function(){e.location.reload()})};g.prototype.defaultFailure=function(){return this.onFailure(function(){return true})};g.prototype.initialize=function(){var i=this;if(this._selector){f(this._scope).on("click",this._selector,function(j){j.preventDefault();i._open(f(this))})}else{f(this._scope).on("click",function(j){j.preventDefault();i._open(f(this))})}};g.prototype.start=function(){var j=f(this._scope);var i=this._selector?j.find(this._selector):j;this._open(i)};g.prototype._open=function(i){if(i.length!==1){a.warn("Could not trigger OAuth dance, the source is not a single HTML element: "+i);return}var j=i.attr("data-authorisation-uri");if(j){this._onSuccess||this.defaultSuccess();this._onFailure||this.defaultFailure();new d(j).source(i).onSuccess(this._onSuccess).onFailure(this._onFailure).open()}else{a.warn("Could not trigger OAuth dance, data-authorisation-uri missing for: "+i)}};return g});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-oauth-ui', location = 'js/oauth-dialog.js' */
(function(c,a,b){AppLinks.authenticateRemoteCredentials=function(d,f,e){c(".applinks-error").remove();new b(d).onSuccess(f).onFailure(e).open()}})(require("applinks/lib/jquery"),require("applinks/common/events"),require("applinks/feature/oauth-callback"));
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.extra.jira:proxy-js', location = '/jira/proxy.js' */
AppLinks=AJS.$.extend(window.AppLinks||{},{makeRequest:function(a){var b=contextPath||AJS.contextPath();if(a.processData){if(a.appId){a.data=AJS.$.extend(a.data||{},{appId:a.appId})}else{if(a.appType){a.data=AJS.$.extend(a.data||{},{appType:a.appType})}}a.data=AJS.$.extend(a.data||{},{path:a.url})}else{var c=a.url;a=AJS.$.extend(a,{beforeSend:function(d){if(a.appId){d.setRequestHeader("X-AppId",a.appId)}else{if(a.appType){d.setRequestHeader("X-AppType",a.appType)}}d.setRequestHeader("X-AppPath",c)}})}a=AJS.$.extend(a,{url:b+"/plugins/servlet/applinks/proxy"});return AJS.$.ajax(a)},createProxyGetUrl:function(b){var c="";if(b.includeContext){c=contextPath||AJS.contextPath()}var a=c+"/plugins/servlet/applinks/proxy";if(b.appId){a+="?appId="+encodeURIComponent(b.appId)}else{if(b.appType){a+="?appType="+encodeURIComponent(b.appType)}else{AJS.log("You need to specify an appType or appId");return""}}if(b.path){a+="&path="+encodeURIComponent(b.path)}return a}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.extra.jira:jqlHelper', location = '/jira/jqlhelper.js' */
AJS.JQLHelper=(function(){var a=/^\s*((key|issuekey)\s*=\s*)?"*([A-Z]+)([0-9]+)?([A-Z]+)?-([0-9]+)"*\s*$/i;var e=/\s*([A-Z][A-Z]+)-[0-9]+\s*/;var j=/(issue|searchrequest)-xml/i;var g=/\/(i#)?browse\/([\x00-\x19\x21-\x22\x24\x27-\x3E\x40-\x7F]+-[0-9]+$)/i;var i=/\/jira\.issueviews:issue-xml\/([\x00-\x19\x21-\x22\x24\x27-\x3E\x40-\x7F]+-[0-9]+)\//;var c=/(jqlQuery|jql)\s*\=([^&]+)/i;var h=/(\?|&)(requestId|filter)\=([^&]+)/i;var b=/(searchrequest-xml\/)([0-9]+)\/SearchRequest/i;var k=/(requestId|filter)\=([^&]+)/i;var d=/=|!=|~|>|<|!~| is | in | was | changed /i;var f=function(p){var m="";var q=g.exec(p);if(q){m="key="+q[2]}else{var n=c.exec(p);if(n){m=n[2]}else{var o=e.exec(p);if(o){m="key="+o[0]}}}m=m.replace(/\+/g," ");return m};var l=function(n,p){var m;var o=decodeURIComponent(n);var q=function(r){if(r.jql){m=r.jql}};AJS.JQLHelper.getJqlQueryFromJiraFilter(o,p,q);return m};return{isSingleKeyJQLExp:function(m){return a.exec(m)},isMultipleSingleKeyJQLExp:function(p){var o=p.split(",");for(var n in o){var m=AJS.$.trim(o[n]);if(!AJS.JQLHelper.isSingleKeyJQLExp(m)){return false}}return true},isIssueUrlOrXmlUrl:function(m){if(g.test(m)||j.test(m)||c.test(m)||i.test(m)){return true}return false},isFilterUrl:function(m){return h.test(m)||b.test(m)},getFilterFromFilterUrl:function(m){if(h.test(m)){var n=h.exec(m);return n[2]+"="+n[3]}else{if(b.test(m)){return"filter="+b.exec(m)[2]}}},getJqlQueryFromJiraFilter:function(p,q,r,o){var m=(h.exec(p)||b.exec(p))[2];var n="/rest/jiraanywhere/1.0/jira/appLink/"+q+"/filter/"+m;AJS.$.ajax({async:false,dataType:"json",url:Confluence.getContextPath()+n,success:r,error:o})},findServerIndexFromUrl:function(m,p){if(typeof(p)!=="undefined"||p.length>0){var o=m.toLowerCase();for(var n=0;n<p.length;n++){if(o.indexOf(p[n].url.toLowerCase())==0){if(m.charAt(p[n].url.length)=="/"){return n}}}}return -1},getJqlQueryFromUrl:f,getJqlAndServerIndexFromUrl:function(n,o){var m={};m.serverIndex=this.findServerIndexFromUrl(n,o);m.jqlQuery=f(n);return m},checkQueryType:function(m){if(!AJS.Editor.JiraAnalytics){return undefined}if(!m||AJS.$.trim(m).length==0){return}if(m.indexOf("http")!=0){return AJS.Editor.JiraAnalytics.linkTypes.jqlDirect}else{if(m.indexOf("jira.issueviews:searchrequest-xml")!=-1||m.indexOf("jira.issueviews:issue-xml")!=-1){return AJS.Editor.JiraAnalytics.linkTypes.xml}else{if(m.indexOf("jira.issueviews:searchrequest-rss")!=-1){return AJS.Editor.JiraAnalytics.linkTypes.rss}else{if(m.indexOf("filter=")!=-1||m.indexOf("filter\\=")!=-1){return AJS.Editor.JiraAnalytics.linkTypes.filter}else{return AJS.Editor.JiraAnalytics.linkTypes.jql}}}}},convertToJQL:function(n,p){var o;if(AJS.$.trim(n)!==""){if(n.indexOf("http")===0&&this.isFilterUrl(n)){o=l(n,p)}else{if(n.indexOf("http")===0&&this.isIssueUrlOrXmlUrl(n)){var m=f(decodeURIComponent(n));if(m.length>0){o=m}}else{if(n.indexOf("http")!==0&&n.match(d)){o=n}else{if(n.match(e)){o="key="+n}else{o='summary ~ "'+n+'" OR description ~ "'+n+'"'}}}}}return o}}})();
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.extra.jira:dialogsJs', location = '/jira/datatable.js' */
(function(a){AJS.DataTable=function(h,d,b){var g=null;if(h&&h.jquery){g=h}else{if(typeof h=="string"){g=a(h)}}g.addClass("data-table");if(d&&d.length){this.columns=d;var f=a("<tr></tr>").appendTo(g);f.addClass("data-table-header");for(var c=0;c<d.length;c++){var e=d[c];f.append('<th class="'+e.className+'">'+e.title+"</th>")}}this.tbl=g;this.rowIdx=0};AJS.DataTable.prototype.addRow=function(e){var f=a("<tr></tr>").appendTo(this.tbl);var c=this.columns;for(var b=0;b<this.columns.length;b++){var d=c[b];var g=a("<td></td>").appendTo(f);g.addClass(d.className);d.renderCell(g,e)}f.data("row-data",e);this._bindRowJs(f,this.rowIdx,"selected","hover");this.rowIdx+=1;f.attr("tabindex","-1")};AJS.DataTable.prototype.selectRow=function(b){var c=a("tbody tr",this.tbl)[b+1];a(c).focus()};AJS.DataTable.prototype._bindRowJs=function(f,g,c,b){var e=this;f.click(function(i){if(c){a(e.tbl).find("."+c).removeClass(c);a(this).addClass(c)}var h=f.data("row-data");e.tbl.trigger("row-select",[h])});var d=function(k){switch(k.keyCode){case 13:var j;var h=f.data("row-data");f.keyup(j=function(l){e.tbl.trigger("row-action",[h]);f.unbind("keyup",j);return AJS.stopEvent(l)});return AJS.stopEvent(k);break;case 38:if(g>0){f.prev().focus()}return AJS.stopEvent(k);case 40:var i=a("tbody tr",e.tbl).length;if(g<i-1){f.next().focus()}return AJS.stopEvent(k)}};if(a.browser.mozilla){f.keypress(d)}else{f.keydown(d)}f.focus(function(h){f.click()});if(b){f.hover(function(){a(this).addClass(b)},function(){a(this).removeClass(b)})}}})(AJS.$);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.extra.jira:dialogsJs', location = '/jira/dialogs.js' */
(function(){tinymce.create("tinymce.plugins.JiraLink",{init:function(a){a.addCommand("mceJiralink",AJS.Editor.JiraConnector.hotKey);a.onPostRender.add(function(b){AJS.$.get(Confluence.getContextPath()+"/rest/jiraanywhere/1.0/servers",function(c){AJS.Editor.JiraConnector.servers=c});AJS.$("#jiralink").click(function(c){AJS.Editor.JiraConnector.open(AJS.Editor.JiraConnector.source.editorDropdownLink,true);return AJS.stopEvent(c)});AJS.$("#insert-menu .macro-jiralink").show();b.addShortcut("ctrl+shift+j","","mceJiralink")})},getInfo:function(){return{longname:"Confluence Jira Connector",author:"Atlassian",authorurl:"http://www.atlassian.com",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("jiraconnector",tinymce.plugins.JiraLink)})();AJS.Editor.Adapter.addTinyMcePluginInit(function(b){b.plugins+=",jiraconnector";var c=b.theme_advanced_buttons1;var a=c.indexOf("confimage");b.theme_advanced_buttons1=c.substring(0,a)+"jiralinkButton,"+c.substring(a)});AJS.Editor.JiraConnector=(function(j){var f="";var c="Insert JIRA Issue/Filter";var a="Insert";var h="Cancel";var l=function(){var q=navigator.platform.toLowerCase().indexOf("mac")!=-1;return q?"Cmd":"Ctrl"};var b={macroBrowser:"macro_browser",editorBraceKey:"editor_brace_key",editorHotKey:"editor_hot_key",editorDropdownLink:"editor_dropdown_link",instructionalText:"instructional text"};var p=AJS.format("Hint: type \"{0}+Shift+J\" in the editor to quickly access this dialog.",l());var n,m,d;var i=function(){var q=j("#createPageLabelsString");if(q.length>0){m=q.val().split(" ").join();AJS.Editor.JiraAnalytics.triggerPannelTriggerEvent({source:n,label:m});return}j.getJSON(AJS.Meta.get("base-url")+"/rest/ui/1.0/content/"+AJS.Meta.get("page-id")+"/labels",function(s){var r=[];j.each(s.labels,function(u,t){r.push(t.name)});m=r.join();AJS.Editor.JiraAnalytics.triggerPannelTriggerEvent({source:n,label:m})})};var g=function(q,r){if(AJS.Editor.JiraAnalytics){AJS.Editor.JiraConnector.analyticPanelActionObject=AJS.Editor.JiraAnalytics.setupAnalyticPanelActionObject(r,n,m);if(q.customizedColumn){AJS.Editor.JiraAnalytics.triggerCustomizeColumnEvent({columns:q.customizedColumn})}}};var o=function(q){q.focusForm&&q.focusForm()};var e=function(t){if(!d){d=new AJS.ConfluenceDialog({width:840,height:590,id:"jira-connector"});d.addHeader(c);var s=AJS.Editor.JiraConnector.Panels;for(var u=0;u<s.length;u++){d.addPanel(s[u].title());var w=d.getCurrentPanel();var r=s[u];r.init(w)}d.addLink("Select Macro",function(){d.hide();AJS.MacroBrowser.open(false)},"dialog-back-link");d.addHelpText(p);j("#jira-connector .dialog-tip").attr("title",p);d.addButton(a,function(){var z=d.getCurrentPanel().id;var y=s[z];var x=s[0];g(x,y);y.insertLink()},"insert-issue-button");AJS.$(".insert-issue-button").disable();d.addCancel(h,function(){AJS.Editor.JiraConnector.closePopup()});d.gotoPanel(0);if(AJS.Editor.JiraConnector.servers){for(var u=0;u<AJS.Editor.JiraConnector.servers.length;u++){var v=AJS.Editor.JiraConnector.servers[u];AppLinks.makeRequest({appId:v.id,type:"GET",url:"/rest/api/2/field",dataType:"json",serverIndex:u,success:function(x){if(x&&x.length){AJS.Editor.JiraConnector.servers[this.serverIndex].columns=x}},error:function(){AJS.log("Jira Issues Macro: unable to retrieve fields from AppLink: "+v.id)}})}}j("#jira-connector ul.dialog-page-menu").append(Confluence.Templates.ConfluenceJiraPlugin.addCrossMacroLink({id:"open-jira-chart-dialog",label:"JIRA Charts"}));j("#jira-connector .dialog-page-menu button").click(function(){var x=AJS.Editor.JiraConnector.Panels[d.getCurrentPanel().id];x.setInsertButtonState&&x.setInsertButtonState();o(x)});j("#open-jira-chart-dialog").click(function(){AJS.Editor.JiraConnector.closePopup();if(AJS.Editor.JiraChart){AJS.Editor.JiraChart.open()}})}AJS.Editor.JiraConnector.Panels[0].refreshSearchForm();if(t){d.gotoPanel(1);var q=AJS.Editor.JiraConnector.Panels[1];q.setSummary(t);setTimeout(function(){o(q)},0)}else{d.gotoPanel(0)}d.overrideLastTab();d.show()};var k=function(){if(AJS.Editor.JiraConnector.clickConfigApplink){AJS.$.ajax({url:Confluence.getContextPath()+"/rest/jiraanywhere/1.0/servers",async:false}).done(function(q){AJS.Editor.JiraConnector.servers=q})}if(typeof(AJS.Editor.JiraConnector.servers)=="undefined"||AJS.Editor.JiraConnector.servers.length==0){AJS.Editor.JiraConnector.warningPopup(AJS.Meta.get("is-admin"));return false}AJS.Editor.JiraConnector.clickConfigApplink=false;if(AJS.Editor.JiraConnector.refreshAppLink){AJS.Editor.JiraConnector.refreshAppLink.call();AJS.Editor.JiraConnector.refreshAppLink=false}return true};return{warningPopup:function(s){var q=new AJS.ConfluenceDialog({width:600,height:400,id:"warning-applink-dialog"});var r="Connect Confluence To JIRA";q.addHeader(r);var t=Confluence.Templates.ConfluenceJiraPlugin.warningDialog({isAdministrator:s});q.addPanel("Panel 1",t);q.get("panel:0").setPadding(0);if(s){q.addButton("Set connection",function(u){AJS.Editor.JiraConnector.clickConfigApplink=true;u.hide();tinymce.confluence.macrobrowser.macroBrowserCancel();window.open(Confluence.getContextPath()+"/admin/listapplicationlinks.action")},"create-dialog-create-button app_link");q.popup.element.find(".create-dialog-create-button").removeClass("button-panel-button").addClass("aui-button aui-button-primary")}else{q.addButton("Contact admin",function(u){u.hide();tinymce.confluence.macrobrowser.macroBrowserCancel();window.open(Confluence.getContextPath()+"/wiki/contactadministrators.action")})}q.addLink("Cancel",function(u){u.hide();tinymce.confluence.macrobrowser.macroBrowserCancel()});q.show();q.gotoPanel(0)},closePopup:function(){d.hide();tinymce.confluence.macrobrowser.macroBrowserCancel()},open:function(s,t){if(!k()){return}AJS.Editor.Adapter.storeCurrentSelectionState();n=s;if(AJS.Editor.JiraAnalytics&&n){if(n===AJS.Editor.JiraConnector.source.instructionalText){i()}else{m=null;AJS.Editor.JiraAnalytics.triggerPannelTriggerEvent({source:n})}}var r=tinymce.confluence.macrobrowser,q=r.getCurrentNode();if(r.isMacroTag(q)&&"jira"==j(q).attr("data-macro-name")){r.editMacro(q);return}AJS.Editor.JiraConnector.openCleanDialog(t)},openCleanDialog:function(s){var r=s&&tinyMCE.activeEditor.selection&&tinyMCE.activeEditor.selection.getContent({format:"text"});e(r);var q=AJS.Editor.JiraConnector.Panels[0];q.setMacroParams(null)},edit:function(u){if(!k()){return}if(typeof(u.params)=="undefined"){AJS.Editor.JiraConnector.openCleanDialog(false);return}n=f;m=f;var w=function(z){if(z.hasOwnProperty("jqlQuery")){return z.jqlQuery}var y=/^([0-9]\d*)$/;var x=["count","columns","title","renderMode","cache","width","height","server","serverId","anonymous","baseurl","showSummary"];for(var A in z){if(j.inArray(A,x)==-1&&z.hasOwnProperty(A)){if(y.test(A)){return z[A]}return A+=" = "+z[A]}}return""};var r=function(z){var A={};if(z.params.url){A.searchStr=z.params.url;return A}A.maximumIssues=z.params.maximumIssues;var x=z.defaultParameterValue||w(z.params);if(typeof(x)=="undefined"){A.searchStr=f}else{A.searchStr=x}if(typeof(z.params.server)!="undefined"){A.serverName=z.params.server}else{for(var y=0;y<AJS.Editor.JiraConnector.servers.length;y++){if(AJS.Editor.JiraConnector.servers[y].selected){A.serverName=AJS.Editor.JiraConnector.servers[y].name;break}}}return A};var t=function(z){var A=r(z);var y=z.params.count;if(typeof y==="undefined"){y="false"}A.count=y;var x=z.params.columns;if(typeof(x)!="undefined"){if(x.length){A.columns=x}}return A};var s=t(u);if(u&&!AJS.Editor.inRichTextMode()){j("#markupTextarea").selectionRange(u.startIndex,u.startIndex+u.markup.length)}e();if(s.searchStr){d.gotoPanel(0);var q=AJS.Editor.JiraConnector.Panels[0];q.setMacroParams(s);var v={searchValue:s.searchStr,serverName:s.serverName,isJqlQuery:u.params.hasOwnProperty("jqlQuery"),isAutoSearch:true};q.doSearch(v)}},source:b}})(AJS.$);AJS.MacroBrowser.setMacroJsOverride("jira",{opener:AJS.Editor.JiraConnector.edit});AJS.MacroBrowser.setMacroJsOverride("jiraissues",{opener:AJS.Editor.JiraConnector.edit});AJS.Editor.JiraConnector.Panels=[];AJS.Editor.JiraConnector.clickConfigApplink=false;AJS.Editor.JiraConnector.hotKey=function(){AJS.Editor.JiraConnector.open(AJS.Editor.JiraConnector.source.editorHotKey,true)};
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.extra.jira:dialogsJs', location = '/jira/panelhelper.js' */
AJS.Editor.JiraConnector.Panel=function(){};AJS.Editor.JiraConnector.Panel.prototype={SHOW_MESSAGE_ON_TOP:false,insertIssueLink:function(a){this.insertIssueLinkWithParams({key:a})},insertJqlLink:function(a){this.insertIssueLinkWithParams({jqlQuery:a})},insertIssueLinkWithParams:function(e){var f=function(g){tinymce.confluence.macrobrowser.macroBrowserComplete(g)};e.server=this.selectedServer.name;e.serverId=this.selectedServer.id;if(AJS.Editor.inRichTextMode()){f({name:"jira",params:e})}else{var a="{jira:";for(var b in e){a=a+b+"="+e[b]+"|"}if(a.charAt(a.length-1)=="|"){a=a.substr(0,a.length-1)}var d=AJS.$("#markupTextarea");var c=d.selectionRange();d.selectionRange(c.start,c.end);d.selection(a);c=d.selectionRange();d.selectionRange(c.end,c.end)}if(AJS.Editor.JiraAnalytics&&AJS.Editor.JiraConnector.analyticPanelActionObject){AJS.Editor.JiraAnalytics.triggerPannelActionEvent(AJS.Editor.JiraConnector.analyticPanelActionObject);AJS.Editor.JiraConnector.analyticPanelActionObject=null}AJS.Editor.JiraConnector.closePopup()},disableInsert:function(){AJS.$(".insert-issue-button").disable()},isInsertDisabled:function(){return AJS.$(".insert-issue-button").is(":disabled")},getOAuthRealm:function(d){var b=d.getResponseHeader("WWW-Authenticate")||"";var a=/OAuth realm\=\"([^\"]+)\"/;var c=a.exec(b);if(c){return c[1]}else{return null}},enableInsert:function(){AJS.$(".insert-issue-button").enable()},handleInsertWaiting:function(b){var a=AJS.$(".insert-issue-button");return b?a.before(aui.icons.icon({icon:"wait"})):a.prev(".aui-icon.aui-icon-wait").remove()},msg:function(a,c,b){if(aui&&aui.message){try{var h=AJS.$('<div class="aui-message-container"/>');var f=c;if(c.html){f=c.html()}var i={content:f};var d;switch(b){case"error":d=aui.message.error(i);break;case"success":d=aui.message.success(i);break;case"warning":d=aui.message.warning(i);break;default:d=aui.message.info(i)}h.append(d);c=h}catch(g){if(AJS&&AJS.logError){AJS.logError("jira-connector",g)}}}a.append(c)},errorMsg:function(a,c){this.removeError(a);var b=this.SHOW_MESSAGE_ON_TOP?AJS.$('<div class="jira-error"></div>').prependTo(a):AJS.$('<div class="jira-error"></div>').appendTo(a);this.msg(b,c,"error")},warningMsg:function(a,b){this.removeError(a);var c=this.SHOW_MESSAGE_ON_TOP?AJS.$('<div class="jira-error"></div>').prependTo(a):AJS.$('<div class="jira-error"></div>').appendTo(a);this.msg(c,b,"warning")},noServerMsg:function(a,b){var d=AJS.$('<div class="data-table jiraSearchResults" ></div>').appendTo(a);var c=this.SHOW_MESSAGE_ON_TOP?AJS.$('<div class="message-panel"/>').prependTo(d):AJS.$('<div class="message-panel"/>').appendTo(d);this.msg(c,b,"info")},ajaxError:function(c,b){if(c.status==401){var a=this.getOAuthRealm(c);this.selectedServer.authUrl=a;b.call(this)}else{this.errorMsg(this.container,"Received the following HTTP error code from the server"+":"+c.status)}},removeError:function(a){AJS.$("div.jira-error",a).remove()},setActionOnEnter:function(a,c,b){a.unbind("keydown").keydown(function(d){if(d.which==13){var f=function(g){a.unbind("keyup",f);c(b);return AJS.stopEvent(g)};a.keyup(f);return AJS.stopEvent(d)}})},createOauthForm:function(e){var d=this.selectedServer;var c={onSuccess:function(){d.authUrl=null;e(d)},onFailure:function(){}};var a='<a class="oauth-init" href="#">'+"Login & Approve"+"</a> "+"to retrieve data from"+" "+AJS.escapeHtml(this.selectedServer.name);var b=AJS.$('<div class="jira-oauth-message-marker"/>');if(!(aui&&aui.message)){b.addClass("oauth-message")}this.msg(b,a,"info");AJS.$(".oauth-init",b).click(function(f){AppLinks.authenticateRemoteCredentials(d.authUrl,c.onSuccess,c.onFailure);f.preventDefault()});return b},applinkServerSelect:function(a,b){var c=AJS.Editor.JiraConnector.servers;AJS.$(c).each(function(){var d="<option ";if(this.selected){selectedServer=this;d+='selected="selected"'}d+='value="'+this.id+'"></option>';d=AJS.$(d);d.text(this.name);AJS.$(a).append(d);d.data("jiraapplink",this)});AJS.$(a).change(function(g){var d=AJS.$("option:selected",a);var f=d.data("jiraapplink");b(f)})},showSpinner:function(d,a,c,b){AJS.$.data(d,"spinner",Raphael.spinner(d,a,"#666"));if(c){AJS.$(d).css("marginLeft",-a*1.2)}if(b){AJS.$(d).css("marginTop",-a*1.2)}},hideSpinner:function(a){AJS.$(a).css("marginTop","");AJS.$(a).css("marginLeft","");var b=AJS.$.data(a,"spinner");if(b){b();delete b;AJS.$.data(a,"spinner",null)}},setSelectedIssue:function(a){this.selectedIssue=a;this.enableInsert()},insertSelected:function(){if(this.selectedIssue){this.insertIssueLink(this.selectedIssue.key)}},createIssueTableFromUrl:function(c,k,b,a,d,h,i,f,e){AJS.$("div.data-table",c).remove();var j=AJS.$('<div class="data-table jiraSearchResults" ></div>').appendTo(c);var l=AJS.$('<div class="loading-data"></div>').appendTo(j);this.removeError(c);this.showSpinner(l[0],50,true,true);var g=this;this.currentXhr=AppLinks.makeRequest({appId:k,type:"GET",url:b,dataType:"xml",success:function(q){l.remove();var r=AJS.$("item",q);AJS.$(":disabled",c).enable();if(r.length){var u=AJS.$('<table class="my-result aui"></table>');AJS.$(".jiraSearchResults",c).append(u);var o=[];if(e){var t={className:"issue-checkbox-column",title:'<input type="checkbox" name="jira-issue-all" checked/>',renderCell:function(y,w){var x=Confluence.Templates.ConfluenceJiraPlugin.issueCheckbox({issueKey:w.key});AJS.$(x).appendTo(y)}};o.push(t)}var s=[{className:"issue-key-column",title:"Key",renderCell:function(y,x){var w=Confluence.Templates.ConfluenceJiraPlugin.issueKey({issueIconUrl:x.iconUrl,issueKey:x.key});AJS.$(w).appendTo(y)}},{className:"issue-summary-column",title:"Summary",renderCell:function(x,w){x.text(w.summary)}}];o=o.concat(s);var m=new AJS.DataTable(u,o);AJS.$(r).each(function(){var w={iconUrl:AJS.$("type",this).attr("iconUrl"),key:AJS.$("key",this).text(),summary:AJS.$("summary",this).text(),url:AJS.$("link",this).text()};m.addRow(w)});u.bind("row-action",function(x,w){d.call(g,w)});u.bind("row-select",function(x,w){a.call(g,w)});m.selectRow(0);if(i){var n=AJS.$("issue",q).attr("total");i.call(g,n)}}else{if(h){h()}var v="No search results found.";var p=AJS.$('<div class="message-panel"/>');g.msg(p,v,"info");AJS.$(".jiraSearchResults",c).append(p)}},error:function(m){AJS.$(":disabled",c).enable();l.remove();f.call(g,m)}})},retrieveJson:function(c,a,d,b){AppLinks.makeRequest({appId:c,type:"GET",url:a,dataType:"json",success:d,error:b})}};
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.extra.jira:dialogsJs', location = '/jira/searchpanel.js' */
AJS.Editor.JiraConnector.Panel.Search=function(){this.jql_operators=/=|!=|~|>|<|!~| is | in /i};AJS.Editor.JiraConnector.Select2=AJS.Editor.JiraConnector.Select2||{};AJS.Editor.JiraConnector.Select2.getKeyColumnsSelectedOptions=function(b){var a=[];var d=b.select2("data");for(var c=0;c<d.length;c++){a[c]=d[c].id}return a.join()};AJS.Editor.JiraConnector.Panel.Search.prototype=AJS.$.extend(AJS.Editor.JiraConnector.Panel.Search.prototype,AJS.Editor.JiraConnector.Panel.prototype);AJS.Editor.JiraConnector.Panel.Search.prototype=AJS.$.extend(AJS.Editor.JiraConnector.Panel.Search.prototype,{defaultColumns:"key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution",DEFAULT_MAX_ISSUES_VAL:20,MAXIMUM_MAX_ISSUES_VAL:1000,MINIMUM_MAX_ISSUES_VAL:1,title:function(){return "Search"},init:function(a){a.html('<div id="my-jira-search"></div>');var f=this;var b=AJS.$("#my-jira-search");this.container=b;var h=function(){b.children(":not(div.jira-search-form)").remove()};var e=function(){AJS.$("input.text",b).enable();AJS.$("button",b).enable()};var l=function(){AJS.$("button",b).disable();AJS.$("input.text",b).disable()};var i=function(n){h();f.disableInsert();if(n){f.selectedServer=n}if(f.selectedServer.authUrl){l();var m=f.createOauthForm(function(){h();e()});b.append(m)}else{e();AJS.$(".search-help").show()}};this.authCheck=i;var g=function(x){var m=x&&x.searchValue;var o=x&&x.serverName;if(m){AJS.$("input:text",b).val(m)}if(o&&o!=this.selectedServer.name){var y=AJS.Editor.JiraConnector.servers;var q=false;for(var r=0;r<y.length;r++){if(y[r].name==o){AJS.$('option[value="'+y[r].id+'"]',b).attr("selected","selected");AJS.$("select",b).change();q=true;break}}if(!q){c(AJS.Meta.get("is-admin"));return}}if(this.currentXhr&&this.currentXhr.readyState!=4){return}var p=m||AJS.$("input",b).val();if(AJS.Editor.JiraAnalytics){var w=AJS.JQLHelper.checkQueryType(p);if(w){AJS.Editor.JiraAnalytics.triggerSearchEvent({type:w,source:"dialog"})}}var s=function(C,E,D){var B=b.find("#jiraIssueColumnSelector");var A=B.val()&&B.val().join();AJS.$("select",b).disable();l();f.lastSearch=C;f.createIssueTableFromUrl(b,f.selectedServer.id,"/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery="+encodeURIComponent(C)+"&returnMax=true&tempMax=20&field=summary&field=type&field=link",f.selectHandler,f.insertLinkFromForm,function(){f.addDisplayOptionPanel();f.loadMacroParams(A);f.bindEventToDisplayOptionPanel(true,x);f.enableInsert()},function(F){f.addDisplayOptionPanel();f.loadMacroParams(A);f.bindEventToDisplayOptionPanel(false,x);f.updateTotalIssuesDisplay(F);f.checkAutoSelectColumns();x&&x.isAutoSearch&&f.focusForm()},function(F){f.disableInsert();if(F.status==400){if(D){D()}else{AJS.$("div.data-table",b).remove();f.warningMsg(b,AJS.format("The JIRA server didn\'\'t understand your search query. If you entered JQL, please ensure that it\'\'s correctly formed. If you entered an issue key, ensure that it exists and you have permission to view it. {0}",Confluence.Templates.ConfluenceJiraPlugin.learnMore()))}}else{AJS.$("div.data-table",b).remove();f.ajaxError(F,i)}x&&x.isAutoSearch&&f.focusForm()},true)};if(AJS.JQLHelper.isFilterUrl(p)){var n=decodeURIComponent(p);var v=AJS.JQLHelper.findServerIndexFromUrl(n,AJS.Editor.JiraConnector.servers);if(v!=-1){var t=AJS.Editor.JiraConnector.servers[v].id;AJS.$('option[value="'+t+'"]',b).attr("selected","selected");AJS.$("select",b).change();var z=AJS.JQLHelper.getFilterFromFilterUrl(n);if(z){AJS.$("input",b).val(z);s(z)}else{h();f.warningMsg(b,AJS.format("The JIRA server didn\'\'t understand your search query. If you entered JQL, please ensure that it\'\'s correctly formed. If you entered an issue key, ensure that it exists and you have permission to view it. {0}",Confluence.Templates.ConfluenceJiraPlugin.learnMore()))}}else{h();f.disableInsert();c(AJS.Meta.get("is-admin"))}}else{if(AJS.JQLHelper.isIssueUrlOrXmlUrl(p)){var n=decodeURIComponent(p);var u=AJS.JQLHelper.getJqlAndServerIndexFromUrl(n,AJS.Editor.JiraConnector.servers);if(d(u)){AJS.$("input",b).val(u.jqlQuery);s(u.jqlQuery,false,null)}}else{if(p.match(f.jql_operators)){s(p,false,null)}else{if(AJS.JQLHelper.isSingleKeyJQLExp(p)){s("key = "+p,true)}else{if(AJS.JQLHelper.isMultipleSingleKeyJQLExp(p)){s("key in ("+p+")",true)}else{s('summary ~ "'+p+'" OR description ~ "'+p+'"',false,null)}}}}}};this.doSearch=g;f.addSearchForm();var d=function(m){var n;if(m.serverIndex!=-1){AJS.$('option[value="'+AJS.Editor.JiraConnector.servers[m.serverIndex].id+'"]',b).attr("selected","selected");AJS.$("select",b).change();if(m.jqlQuery.length==0){h();f.errorMsg(b,"The JIRA server didn\'t understand your search query. If you entered JQL, please ensure that it\'s correctly formed. If you entered an issue key, ensure that it exists and you have permission to view it. {0}")}else{n=m.jqlQuery}}else{h();f.disableInsert();c(AJS.Meta.get("is-admin"))}return n};f.processJiraParams=d;var c=function(m){var o=Confluence.Templates.ConfluenceJiraPlugin.showMessageNoServer({isAdministrator:m,contextPath:Confluence.getContextPath()});f.noServerMsg(b,o);var n=AJS.$("#open_applinks");n.bind("click",function(){AJS.Editor.JiraConnector.clickConfigApplink=true;AJS.Editor.JiraConnector.refreshAppLink=function(){f.refreshSearchForm()}})};f.bindPasteEvent();AJS.$(a).select(function(){f.validate()});var k=AJS.$(".jql-display-opts-open.disabled");var j={live:true,title:function(){return AJS.$(".jql-display-opts-open.disabled").data("title")},gravity:"s",delayIn:300,delayOut:0};k.tooltip(j)},focusForm:function(){AJS.$('input[name="jiraSearch"]',this.container).focus()},addSearchForm:function(){var d=this;d.container.empty();var f=AJS.Editor.JiraConnector.servers;d.selectedServer=f[0];var a=false;if(f.length>1){a=true}var e=Confluence.Templates.ConfluenceJiraPlugin.searchForm({isMultiServer:a});var c=AJS.$(e).appendTo(d.container);if(f.length>1){var b=AJS.$('<select class="select" tabindex="0"></select>').insertAfter("div.search-input",c);d.applinkServerSelect(b,d.authCheck)}d.authCheck(d.selectedServer);AJS.$("button",d.container).click(function(){d.doSearch()});d.setActionOnEnter(AJS.$("input.text",d.container),d.doSearch)},bindPasteEvent:function(){var a=this;AJS.$("#my-jira-search input:text").bind("paste",function(){var b=this;setTimeout(function(){var d=AJS.$(b).val();if(AJS.JQLHelper.isFilterUrl(d)){a.doSearch()}else{if(AJS.JQLHelper.isIssueUrlOrXmlUrl(d)){var e=decodeURIComponent(d);var c=AJS.JQLHelper.getJqlAndServerIndexFromUrl(e,AJS.Editor.JiraConnector.servers);if(a.processJiraParams(c)){AJS.$(b).val(c.jqlQuery);a.doSearch()}}}},100)})},refreshSearchForm:function(){this.container.empty();this.addSearchForm();this.bindPasteEvent()},validate:function(e,d){var c=this.container;var f=AJS.$("input:checkbox[name=jira-issue]",c);var b=AJS.Editor.JiraConnector.Panel.Search.prototype;if(f.length||e){var a=AJS.$("input:checkbox[name=jira-issue]:checked",c).length;if(a>0||e){b.enableInsert()}else{b.disableInsert()}b.changeInsertOptionStatus(a,e,d)}else{if(AJS.$(".jira-oauth-message-marker",c).length){b.authCheck(this.selectedServer)}AJS.$("input",c).focus();b.disableInsert()}if(b.isInsertDisabled()){return}b.validateMaxIssues()},isValidMaxIssues:function(a){return AJS.$.isNumeric(a)&&(this.MINIMUM_MAX_ISSUES_VAL<=a&&a<=this.MAXIMUM_MAX_ISSUES_VAL)},validateMaxIssues:function(i){var b=AJS.$("#jira-maximum-issues");function d(){b.next("#jira-max-number-error").remove()}function f(){b.attr("disabled","disabled")}function h(){b.removeAttr("disabled")}function c(){d();b.after(Confluence.Templates.ConfluenceJiraPlugin.warningValMaxiumIssues())}switch(AJS.$("input:radio[name=insert-advanced]:checked").val()){case"insert-single":case"insert-count":d();f();break;case"insert-table":var a=AJS.Editor.JiraConnector.Panel.Search.prototype;h();var g=b.val();if(AJS.$.trim(g)===""){if(i&&i.type==="keyup"){d();break}if(i&&i.type==="blur"){g=a.MAXIMUM_MAX_ISSUES_VAL;b.val(g);break}}if(a.isValidMaxIssues(g)){d();a.enableInsert()}else{c();a.disableInsert()}break}},customizedColumn:null,parseColumnsStringToArray:function(g){var f="";var b=[];var a=null;var c=function(i,h){i=AJS.$.trim(i);if(i!=""){h.push(i)}};for(var e=0;e<g.length;e++){var d=g.charAt(e);if(d!==","&&d!=='"'&&d!=="'"){f+=d}if(d==='"'||d==="'"){if(a==null){a=d}else{if(a===d){c(f,b);f="";a=null}}}else{if(d===","){if(a==null){c(f,b);f=""}else{f+=d}}}}c(f,b);return b},parseArrayToColumnString:function(b){var a="";for(var c=0;c<b.length;c++){var d=AJS.$.trim(b[c]);if(d!=""){if(d.indexOf(",")>=0){d='"'+d+'"'}if(c!=0){a+=","}a+=d}}},checkAndSetDefaultValueMaximumIssues:function(a){if(!a){AJS.log("Cannot set default value for Maximum Issues");return}var b=a.element||AJS.$("#jira-maximum-issues");var d=a.defaultVal||this.MAXIMUM_MAX_ISSUES_VAL;var c=AJS.$.trim(b.val());if(c===""){b.val(d)}},setMacroParams:function(a){this.macroParams=a},getMacroParamsFromUserInput:function(){var e=((AJS.$("input:radio[name=insert-advanced]:checked").val()=="insert-count")?true:false);var d=[];var a=[];AJS.$("#my-jira-search .my-result.aui input:checkbox[name=jira-issue]").each(function(f){var g=AJS.$(this);if(g.is(":checked")){d[d.length]=g.val()}else{a[a.length]=g.val()}});var c={};if(e){c.count="true"}else{if(!AJS.Editor.JiraConnector.Panel.Search.jiraColumnSelectBox){c.columns=this.defaultColumns;return}c.columns=AJS.Editor.JiraConnector.Select2.getKeyColumnsSelectedOptions(AJS.Editor.JiraConnector.Panel.Search.jiraColumnSelectBox);if(!c.columns){c.columns=this.defaultColumns}}var b=AJS.$("input:radio[name=insert-advanced]:checked").val();if(b==="insert-single"){c.key=d.toString()}else{if(a.length==0){c.jqlQuery=this.lastSearch+" "}else{if(d.length==1){c.jqlQuery="key = "+d.toString()}else{c.jqlQuery="key in ("+d.toString()+")"}}}if(b==="insert-table"){c.maximumIssues=AJS.$("#jira-maximum-issues").val()}return c},insertLinkFromForm:function(){var c=this;var b=c.container;var d=AJS.$("input:checkbox[name=jira-issue]",b);if(d.length){var a=AJS.$("input:checkbox[name=jira-issue]:checked",b).length;if(a>0){c.insertLink()}}},insertLink:function(c){var a;if(c&&typeof c.insertIssueLinkWithParams==="function"){a=c}else{a=this}var b=a.getMacroParamsFromUserInput();a.insertIssueLinkWithParams(b);return true},loadMacroParams:function(a){var b=this.macroParams;if(!b){this.prepareColumnInput(a||this.defaultColumns);this.checkAndSetDefaultValueMaximumIssues({defaultVal:20})}else{b.columns=a||b.columns||this.defaultColumns;if(!b.maximumIssues){AJS.$("#jira-maximum-issues").attr("disabled","disabled")}if(b.count=="true"){AJS.$("#opt-total").prop("checked",true)}else{AJS.$("#opt-table").prop("checked",true);AJS.$("#jira-maximum-issues").removeAttr("disabled");var c=b.maximumIssues||this.DEFAULT_MAX_ISSUES_VAL;this.checkAndSetDefaultValueMaximumIssues({defaultVal:c})}this.prepareColumnInput(b.columns)}},selectHandler:function(){var a=this.container;var b=a.find("tr.selected");if(b.length){b.unbind("keydown.space").bind("keydown.space",function(c){if(c.which==32||c.keyCode==32){var d=b.find("[type=checkbox]");d.trigger("click")}})}},addDisplayOptionPanel:function(){var a=Confluence.Templates.ConfluenceJiraPlugin.displayOptsOverlayHtml;AJS.$(".jiraSearchResults").after(a());AJS.$("#jiraMacroDlg").unbind("submit").on("submit",function(b){return false})},updateTotalIssuesDisplay:function(b){var a=this.selectedServer.url+"/issues/?jql="+this.lastSearch;if(b>20){AJS.$(".my-result.aui").after(Confluence.Templates.ConfluenceJiraPlugin.viewAll({jiraIssuesLink:a}))}var c=AJS.format("{0} issues",b);AJS.$(".total-issues-text").html(c);AJS.$(".total-issues-link").attr("href",a)},prepareColumnInput:function(c){var b=c.split(/\s*,\s*/);for(var a in b){var g=b[a];if(g&&typeof g.toLowerCase==="function"){b[a]=g.toLowerCase()}}var f=this.selectedServer;var d={issuekey:"key",duedate:"due",issuetype:"type"};var e=function(j){var p=[];var s=AJS.$("#jiraIssueColumnSelector");var l="";var o="";var r;for(var k=0;k<j.length;k++){var q=j[k];if(q.navigable){if(d[q.id]){q.id=d[q.id]}if(q.custom===true){r=q.name.toLowerCase()}else{r=q.id.toLowerCase()}var n=AJS.template("<option value='{value}'>{displayValue}</option>");p[r]=q.name;if(AJS.$.inArray(r,b)<0){l+=n.fill({value:r,displayValue:q.name})}}}p.key="Key";for(var k=0;k<b.length;k++){var h=AJS.template("<option selected='true' value='{value}'>{displayValue}</option>");r=b[k].toLowerCase();if(p[r]!=null){o+=h.fill({value:r,displayValue:p[r]})}}var m=o+l;s.hide();s.html(m);s.show();s.auiSelect2({width:"415px",containerCssClass:"select2-container-jira-issue-columns"});AJS.Editor.JiraConnector.Panel.Search.jiraColumnSelectBox=s};if(f.columns&&f.columns.length>0){e(f.columns);return}this.retrieveJson(f.id,"/rest/api/2/field",function(h){if(h&&h.length){f.columns=h;e(f.columns)}})},expandDisplayOptPanel:function(){var b=AJS.$(".jql-display-opts-overlay");var c=b.height();var d=40;b.css("top","");var a=-(c-d);b.css("bottom",a+"px");b.animate({bottom:0},500)},minimizeDisplayOptPanel:function(){var a=AJS.$(".jql-display-opts-overlay");a.css("top",a.position().top+"px");a.css("bottom","");a.animate({top:420},500)},disableAutoSelectColumns:function(){AJS.Editor.JiraConnector.Panel.Search.jiraColumnSelectBox.auiSelect2("enable",false)},enableAutoSelectColumns:function(){AJS.Editor.JiraConnector.Panel.Search.jiraColumnSelectBox.auiSelect2("enable",true)},checkAutoSelectColumns:function(){if(AJS.$("#opt-table").prop("checked")){this.enableAutoSelectColumns()}else{this.disableAutoSelectColumns();this.enableInsert()}},bindEventToDisplayOptionPanel:function(f,h){var d=this;var b=AJS.$(".jql-display-opts-close, .jql-display-opts-open"),c=AJS.$(".jql-display-opts-overlay"),i=AJS.$(".jql-display-opts-inner .radio"),a=AJS.$("#my-jira-search input:checkbox[name=jira-issue-all]"),e=AJS.$("#my-jira-search input:checkbox[name=jira-issue]");var g=AJS.$("#jira-maximum-issues");g.on("blur keyup",AJS.Editor.JiraConnector.Panel.Search.prototype.validateMaxIssues);c.css("top","420px");b.click(function(j){j.preventDefault();if(AJS.$(this).hasClass("disabled")){return}var k=AJS.$(this).hasClass("jql-display-opts-open");if(k){d.expandDisplayOptPanel();jQuery(this).addClass("jql-display-opts-close");jQuery(this).removeClass("jql-display-opts-open")}else{d.minimizeDisplayOptPanel();jQuery(this).removeClass("jql-display-opts-close");jQuery(this).addClass("jql-display-opts-open")}});i.change(function(){d.checkAutoSelectColumns();d.validateMaxIssues()});a.bind("click",function(){var j=AJS.$(this);if(j.prop("checked")){e.prop("checked","checked")}else{e.removeAttr("checked")}d.validate()});e.change(function(){var j=AJS.$("#my-jira-search input:checkbox[name=jira-issue]:not(:checked)").length;if(j>0){a.removeAttr("checked")}else{a.prop("checked","checked")}d.validate()});d.validate(f,h)},changeInsertOptionStatus:function(q,n,f){var r=this;var g=AJS.$("#opt-single");var d=AJS.$("#opt-total");var m=AJS.$("#opt-table");var j=AJS.$("#my-jira-search input:checkbox[name=jira-issue]:checked");var i=AJS.$("#my-jira-search input:checkbox[name=jira-issue-all]").attr("checked")==="checked";var l=j.length===1;var p=j.length>1;var h=j.length===0;var b=AJS.JQLHelper.isSingleKeyJQLExp(AJS.$("#my-jira-search input[name=jiraSearch]").val());var c=function(){if(f&&f.isJqlQuery){m.click()}else{g.click()}};var k=function(){d.attr("disabled","disabled");m.removeAttr("disabled");g.removeAttr("disabled");c();setTimeout(function(){c()},100)};var e=function(){g.attr("disabled","disabled");d.removeAttr("disabled");if(AJS.$("input[name=insert-advanced]:checked").val()==="insert-single"){setTimeout(function(){m.removeAttr("disabled").click()},100)}};var o=function(){m.removeAttr("disabled","disabled");d.removeAttr("disabled","disabled");g.removeAttr("disabled","disabled");var s=AJS.$("input:radio[name=insert-advanced]:checked").val();if(s==="insert-single"){setTimeout(function(){m.click()},100)}};var a=function(){g.attr("disabled","disabled");d.attr("disabled","disabled");m.attr("disabled","disabled");AJS.$(".jql-display-opts-close").click();AJS.$(".jql-display-opts-open").addClass("disabled")};AJS.$(".jql-display-opts-open").removeClass("disabled");g.removeAttr("disabled");d.removeAttr("disabled");m.removeAttr("disabled");if(i&&l&&b){k()}else{if(i&&l&&!b){o()}else{if(p){e()}else{if(l&&!i){k()}else{if(n){e()}else{if(h){a()}}}}}}},isInsertTableType:function(){return AJS.$("input:radio[name=insert-advanced]:checked").val()==="insert-table"},setInsertButtonState:function(){var a=AJS.$(".jql-display-opts-close, .jql-display-opts-open");var b=AJS.$("#jira-maximum-issues");if(!a.length||(a.length&&this.isInsertTableType()&&!this.isValidMaxIssues(b.val()))){this.disableInsert()}else{this.enableInsert()}},analyticPanelActionName:"confluence.jira.plugin.searchadded"});AJS.Editor.JiraConnector.Panels.push(new AJS.Editor.JiraConnector.Panel.Search());
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.extra.jira:dialogsJs', location = '/jira/jip_createissuepanel.js' */
AJS.Editor.JiraConnector.Panel.Create=function(){};AJS.Editor.JiraConnector.Panel.Create.prototype=AJS.$.extend(AJS.Editor.JiraConnector.Panel.Create.prototype,AJS.Editor.JiraConnector.Panel.prototype);AJS.Editor.JiraConnector.Panel.Create.prototype=AJS.$.extend(AJS.Editor.JiraConnector.Panel.Create.prototype,{DEFAULT_PROJECT_VALUE:"-1",SHOW_MESSAGE_ON_TOP:true,EXCLUDED_FIELDS:["project","issuetype","summary","description"],PROJECTS_META:{},setSummary:function(b){var a=AJS.$('.field-group [name="summary"]',this.jipForm.formEl);a.length&&a.val(b)},resetIssue:function(){AJS.$(".issue-summary",this.container).empty();AJS.$(".issue-description",this.container).empty()},focusForm:function(){var a=AJS.$("select.server-select",this.container);if(a.length){a.focus()}else{var b=AJS.$(".project-select",this.container);b.length&&b.focus()}},authCheck:function(){this.selectedServer=this.jipForm.getCurrentServer();if(this.selectedServer.authUrl){this.showOauthChallenge()}else{this.serverSelect()}},ajaxAuthCheck:function(b){var a=this;this.endLoading();this.ajaxError(b,function(){a.authCheck(a.jipForm.getCurrentServer())})},showOauthChallenge:function(){AJS.$("div.field-group",this.container).not(".servers").hide();AJS.$(".jira-oauth-message-marker",this.container).remove();var a=this;var b=this.createOauthForm(function(){a.serverSelect()});this.container.append(b)},projectOk:function(){var a=AJS.$(".project-select option:selected",this.container).val();return a&&a.length&&a!=this.DEFAULT_PROJECT_VALUE},setInsertButtonState:function(){if(this.formHasError===false&&this.projectOk()){this.enableInsert();return true}else{this.disableInsert();return false}},startLoading:function(){this.removeError(this.container);AJS.$(".loading-blanket",this.container).removeClass("hidden");AJS.$("input,select,textarea",this.container).disable();this.disableInsert();this.handleInsertWaiting(true)},endLoading:function(){AJS.$(".loading-blanket",this.container).addClass("hidden");AJS.$("input,select,textarea",this.container).enable();if(AJS.$(".project-select",this.container).val()===this.DEFAULT_PROJECT_VALUE){AJS.$(".issuetype-select",this.container).disable()}this.setInsertButtonState();this.handleInsertWaiting(false)},bindEvent:function(){var b=this;var a=AJS.$('.field-group [name="summary"]',this.jipForm.formEl);a.keyup(function(){b.setInsertButtonState()});this.container.on("focus","input[data-aui-dp-uuid]",function(){var c=AJS.$(this).attr("data-aui-dp-uuid");setTimeout(function(){AJS.$("[data-aui-dp-popup-uuid="+c+"]").parents(".aui-inline-dialog").addClass("datepicker-patch")},0)})},title:function(){return "Create New Issue"},init:function(b){var c=this;b.html('<div class="create-issue-container"></div>');this.container=AJS.$("div.create-issue-container");var a=this.container;var d=AJS.Editor.JiraConnector.servers;this.selectedServer=d[0];this.jipForm=new jiraIntegration.JiraCreateIssueForm({container:".create-issue-container",renderSummaryAndDescription:true,onError:function(){AJS.$(".field-group .error",this.container).remove();c.formHasError=true;c.disableInsert()},onServerChanged:function(){AJS.$(".field-group .error",this.container).remove();c.setInsertButtonState();c.selectedServer=this.getCurrentServer()},onRequiredFieldsRendered:function(f,e){AJS.$(".field-group .error",this.container).remove();c.formHasError=!!e.length;c.setInsertButtonState()}});b.onselect=function(){c.onselect()};this.bindEvent()},convertFormToJSON:function(b){if(!jiraIntegration){AJS.logError("Jira integration plugin is missing!");return""}var c={};c.issues=[];var a={};a.fields={project:{id:AJS.$(".project-select option:selected",b).val()},issuetype:{id:AJS.$(".issuetype-select option:selected",b).val()},summary:AJS.$('.field-group [name="summary"]',b).val(),description:AJS.$('.field-group [name="description"]',b).val()};b.children(".create-issue-required-fields").children(".jira-field").children("input,select,textarea").not(".select2-input").each(function(d,e){var f=AJS.$(e);a.fields[f.attr("name")]=jiraIntegration.fields.getJSON(f)});c.issues.push(a);return JSON.stringify(c)},validateRequiredFieldInForm:function(b){var d=true;var a="placeholder" in document.createElement("input");var c=b.find(".field-group .icon-required, .field-group .aui-icon-required");c.each(function(h,l){var k=AJS.$(l).parent();var g=k.text();var i=k.nextAll("input,select,textarea");var j=AJS.$.trim(i.val());if(!j||(!a&&j==i.attr("placeholder"))){d=false;var f=k.parent();var e=AJS.format("{0} is required",g);f.append(aui.form.fieldError({message:e}))}});return d},clearFieldErrors:function(){AJS.$("form div.error",this.container).remove()},insertLink:function(){var b=this;var c=Confluence.getContextPath()+"/rest/jira-integration/1.0/issues";var a=AJS.$("div.create-issue-container form");var d=this.jipForm.getCurrentServer();b.clearFieldErrors();if(!b.validateRequiredFieldInForm(a)){return}this.startLoading();AJS.$.ajax({type:"POST",contentType:"application/json",url:c+"?applicationId="+this.selectedServer.id,data:this.convertFormToJSON(a),success:function(h){var f=h&&h.issues&&h.issues[0]&&h.issues[0].issue&&h.issues[0].issue.key;if(!f){if(!_.isEmpty(h.errors[0].elementErrors.errorMessages)){var g=h.errors[0].elementErrors.errorMessages;var i=Confluence.Templates.ConfluenceJiraPlugin.renderCreateErrorPanel({errors:g,serverUrl:d.displayUrl});b.errorMsg(AJS.$("div.create-issue-container"),i)}var e=h.errors[0].elementErrors.errors;_.each(e,function(l,k){var j=aui.form.fieldError({message:l});AJS.$(AJS.format(".field-group [name={0}]",k),a).after(j)})}else{b.insertIssueLink(f,d.displayUrl+"/browse/"+f);b.resetIssue()}b.endLoading()},error:function(f,e){b.ajaxAuthCheck(f)}})},onselect:function(){var a=!!AJS.$(".aui-message > .oauth-init",this.container).length;if(this.selectedServer&&!this.selectedServer.authUrl&&a){this.jipForm.defaultFields.server.trigger("change")}else{this.setInsertButtonState()}},analyticPanelActionName:"confluence.jira.plugin.issuecreated"});AJS.Editor.JiraConnector.Panels.push(new AJS.Editor.JiraConnector.Panel.Create());
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.extra.jira:dialogsJs', location = '/jira/recentlyviewedpanel.js' */
AJS.Editor.JiraConnector.Panel.Recent=function(){};AJS.Editor.JiraConnector.Panel.Recent.prototype=AJS.$.extend(AJS.Editor.JiraConnector.Panel.Recent.prototype,AJS.Editor.JiraConnector.Panel.prototype);AJS.Editor.JiraConnector.Panel.Recent.prototype=AJS.$.extend(AJS.Editor.JiraConnector.Panel.Recent.prototype,{title:function(){return "Recently Viewed"},init:function(a){var d=AJS.Editor.JiraConnector.servers;a.html('<div id="my-recent-issues" '+(d.length>1?'class="multi-server" ':"")+"></div>");var c=this;this.selectedServer=d[0];if(d.length>1){var b=AJS.$('<div class="jira-server-select"><form action="#" method="post" class="aui"><div class="field-group"><label>Server</label><select class="select" ></select></div></form></div>').appendTo("div#my-recent-issues");this.applinkServerSelect(AJS.$(".select",b),function(e){c.selectedServer=e;c.onselect()})}a.onselect=function(){c.onselect()}},insertLink:function(){this.insertSelected()},onselect:function(){var c=this;var b=AJS.$("div#my-recent-issues");this.container=b;var d=function(){b.children().not(".jira-server-select").remove()};var e;var a=function(){if(c.selectedServer.authUrl){d();var f=c.createOauthForm(function(){e()});b.append(f)}else{e()}};e=function(){if(c.currentXhr&&c.currentXhr.readyState!=4){return}var f=AJS.$(".select",b);f.disable();d();var g="key+in+issueHistory()+ORDER+BY+lastViewed+DESC";c.createIssueTableFromUrl(b,c.selectedServer.id,"/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery="+g+"&field=summary&field=type&field=link&tempMax=50&returnMax=true",c.setSelectedIssue,c.insertLink,c.disableInsert,function(){f.length&&f.focus()},function(h){AJS.$("div.data-table",b).remove();c.ajaxError(h,a)},false)};a()},analyticPanelActionName:"confluence.jira.plugin.recentlyviewadded"});AJS.Editor.JiraConnector.Panels.push(new AJS.Editor.JiraConnector.Panel.Recent());
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.extra.jira:dialogsJs', location = 'templates/soy/dialog.soy' */
// This file was automatically generated from dialog.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.ConfluenceJiraPlugin.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.ConfluenceJiraPlugin == 'undefined') { Confluence.Templates.ConfluenceJiraPlugin = {}; }


Confluence.Templates.ConfluenceJiraPlugin.displayOptsHtml = function(opt_data, opt_ignored) {
  return '<div class=\'jql-display-opts-bar data-table\'><a href=\'#\' class=\'jql-display-opts-open\' data-title="' + soy.$$escapeHtml('Display options panel is not available without a selection.') + '"><span></span><strong>' + soy.$$escapeHtml('Display options') + '</strong></a></div>';
};
if (goog.DEBUG) {
  Confluence.Templates.ConfluenceJiraPlugin.displayOptsHtml.soyTemplateName = 'Confluence.Templates.ConfluenceJiraPlugin.displayOptsHtml';
}


Confluence.Templates.ConfluenceJiraPlugin.displayOptsOverlayHtml = function(opt_data, opt_ignored) {
  return '<div class=\'jql-display-opts-overlay data-table\' data-js="display-option-wrapper"><form id="jiraMacroDlg" class="aui" action="#"><div class=\'jql-display-opts-inner\'><a href=\'#\' class=\'jql-display-opts-open\' data-js="display-option-trigger" data-title="' + soy.$$escapeHtml('Display options panel is not available without a selection.') + '"><span></span><strong>' + soy.$$escapeHtml('Display options') + '</strong></a><fieldset class="group"><legend><span>' + soy.$$escapeHtml('Display as') + '</span></legend><div class="radio"><input type=\'radio\' class=\'radio\' name=\'insert-advanced\' id=\'opt-single\' value=\'insert-single\'><label for=\'opt-single\'>' + soy.$$escapeHtml('Single issue') + '</label><div class=\'description\'>' + soy.$$escapeHtml('Display the macro as a single issue.') + '</div></div><div class="radio"><input type=\'radio\' class=\'radio\' name=\'insert-advanced\' id=\'opt-total\' value=\'insert-count\'><label for=\'opt-total\'>' + soy.$$escapeHtml('Total issue count') + '</label><div class=\'description\'>' + soy.$$escapeHtml('Display total number of issues as a link. E.g.') + '<a class=\'total-issues-link\' target=\'_blank\' href=\'#\'><span class=\'total-issues-text\'>' + soy.$$escapeHtml(AJS.format('{0} issues',12)) + '</span></a></div></div><div class="radio"><input type=\'radio\' class=\'radio\' checked=\'checked\' name=\'insert-advanced\' id=\'opt-table\' value=\'insert-table\'><label for=\'opt-table\'>' + soy.$$escapeHtml('Table') + '</label><div class=\'description\'>' + soy.$$escapeHtml('Customise your columns below.') + '</div></div></fieldset><fieldset><div class="field-group"><label>' + soy.$$escapeHtml('Maximum issues') + '</label><input type="text" name="jira-maximum-issues" id="jira-maximum-issues" class="text short-field" /><div class="description">' + soy.$$escapeHtml('Leave empty to get all issues.') + '</div></div></fieldset><fieldset><div class="field-group"><label>' + soy.$$escapeHtml('Columns to display') + '</label><select id="jiraIssueColumnSelector" data-placeholder="' + soy.$$escapeHtml('Start typing to see possible columns') + '" multiple="true" class="select long-field"></select></div></fieldset></div></form></div>';
};
if (goog.DEBUG) {
  Confluence.Templates.ConfluenceJiraPlugin.displayOptsOverlayHtml.soyTemplateName = 'Confluence.Templates.ConfluenceJiraPlugin.displayOptsOverlayHtml';
}


Confluence.Templates.ConfluenceJiraPlugin.searchForm = function(opt_data, opt_ignored) {
  return '<div class=\'jira-search-form\'><form class=\'aui\'><fieldset class=\'inline\'>' + ((opt_data.isMultiServer == true) ? '<div class=\'search-input\'><input type=\'text\' class=\'text search-text\' name=\'jiraSearch\' placeholder="' + soy.$$escapeHtml('e.g. filter \x3d \x22My JIRA filter\x22') + '"/></div>' : '<div class=\'search-input one-server\'><input type=\'text\' class=\'text one-server long-field\' name=\'jiraSearch\' placeholder="' + soy.$$escapeHtml('e.g. filter \x3d \x22My JIRA filter\x22') + '"/></div>') + '<button type=\'button\' title="' + soy.$$escapeHtml('Search') + '" class=\'button\'><span class="aui-icon aui-icon-small aui-iconfont-search"></span></button></fieldset><div class=\'search-help\'>' + soy.$$escapeHtml('Search using any issue key, search URL, JIRA link, JQL, plain text or filter') + '</div></form></div>';
};
if (goog.DEBUG) {
  Confluence.Templates.ConfluenceJiraPlugin.searchForm.soyTemplateName = 'Confluence.Templates.ConfluenceJiraPlugin.searchForm';
}


Confluence.Templates.ConfluenceJiraPlugin.warningDialog = function(opt_data, opt_ignored) {
  return '<div class=\'warning-body\'><p>' + soy.$$escapeHtml('If you connect Confluence to JIRA you can easily link issues...') + '</p>' + ((opt_data.isAdministrator == false) ? '<p>' + soy.$$escapeHtml('Your administrator can set this up.') + '</p>' : '') + '</div>';
};
if (goog.DEBUG) {
  Confluence.Templates.ConfluenceJiraPlugin.warningDialog.soyTemplateName = 'Confluence.Templates.ConfluenceJiraPlugin.warningDialog';
}


Confluence.Templates.ConfluenceJiraPlugin.issueCheckbox = function(opt_data, opt_ignored) {
  return '<input type=\'checkbox\' name=\'jira-issue\' value=\'' + soy.$$escapeHtml(opt_data.issueKey) + '\' checked/>';
};
if (goog.DEBUG) {
  Confluence.Templates.ConfluenceJiraPlugin.issueCheckbox.soyTemplateName = 'Confluence.Templates.ConfluenceJiraPlugin.issueCheckbox';
}


Confluence.Templates.ConfluenceJiraPlugin.issueKey = function(opt_data, opt_ignored) {
  return '<span><img class="icon" src="' + soy.$$escapeHtml(opt_data.issueIconUrl) + '"/> ' + soy.$$escapeHtml(opt_data.issueKey) + '</span>';
};
if (goog.DEBUG) {
  Confluence.Templates.ConfluenceJiraPlugin.issueKey.soyTemplateName = 'Confluence.Templates.ConfluenceJiraPlugin.issueKey';
}


Confluence.Templates.ConfluenceJiraPlugin.showMessageNoServer = function(opt_data, opt_ignored) {
  return '' + ((opt_data.isAdministrator == true) ? soy.$$escapeHtml('No server found match with your URL.') + '<a id="open_applinks" target="_blank" href="' + soy.$$escapeHtml(opt_data.contextPath) + '/admin/listapplicationlinks.action">' + soy.$$escapeHtml('Click here to set this up') + '</a>' : soy.$$escapeHtml('No server found match with your URL. Your administrator can set this up.') + '<a id="open_applinks" target="_blank" href="' + soy.$$escapeHtml(opt_data.contextPath) + '/wiki/contactadministrators.action">' + soy.$$escapeHtml('Click here to contact your admin') + '</a>');
};
if (goog.DEBUG) {
  Confluence.Templates.ConfluenceJiraPlugin.showMessageNoServer.soyTemplateName = 'Confluence.Templates.ConfluenceJiraPlugin.showMessageNoServer';
}


Confluence.Templates.ConfluenceJiraPlugin.viewAll = function(opt_data, opt_ignored) {
  return '<div class=\'view-all\'>' + soy.$$escapeHtml('Displaying first 20 results.') + '<a href=\'' + soy.$$escapeHtml(opt_data.jiraIssuesLink) + '\' target=\'_blank\'>' + soy.$$escapeHtml('View all.') + '</a></div>';
};
if (goog.DEBUG) {
  Confluence.Templates.ConfluenceJiraPlugin.viewAll.soyTemplateName = 'Confluence.Templates.ConfluenceJiraPlugin.viewAll';
}


Confluence.Templates.ConfluenceJiraPlugin.learnMore = function(opt_data, opt_ignored) {
  return '<a href="' + soy.$$escapeHtml('JIRA+Issues+Macro') + '" target=\'_blank\'>' + soy.$$escapeHtml('Learn More') + '</a>';
};
if (goog.DEBUG) {
  Confluence.Templates.ConfluenceJiraPlugin.learnMore.soyTemplateName = 'Confluence.Templates.ConfluenceJiraPlugin.learnMore';
}


Confluence.Templates.ConfluenceJiraPlugin.contentJiraChart = function(opt_data, opt_ignored) {
  return '<div id="jira-chart-content-' + soy.$$escapeHtml(opt_data.chartType) + '"><div class=\'jira-chart-search\'><form class=\'aui\'><fieldset class=\'inline\'>' + ((opt_data.isMultiServer == true) ? '<div class=\'jira-chart-search-input\'><input type=\'text\' id="jira-chart-search-input" class=\'text search-text\' name=\'jiraSearch\' placeholder="' + soy.$$escapeHtml('e.g. filter \x3d \x22My JIRA filter\x22') + '"/></div><select id="jira-chart-servers" class="select" name="server" tabindex="0" />' : '<div class=\'jira-chart-search-input one-server\'><input type=\'text\' id="jira-chart-search-input" class=\'text one-server long-field\' name=\'jiraSearch\' placeholder="' + soy.$$escapeHtml('e.g. filter \x3d \x22My JIRA filter\x22') + '"/></div>') + '<button id="jira-chart-search-button" type=\'button\' class=\'button\'>' + soy.$$escapeHtml('Preview') + '</button></fieldset><div class=\'search-help\'>' + soy.$$escapeHtml('Search using any issue key, search URL, JIRA link, JQL, plain text or filter') + '</div></form></div><div class="jira-chart-img"></div><div class="jira-chart-option" data-js="display-option-wrapper" ><form action="#" class="aui" id="jiraChartMacroOption"><div class="jiraChartOption"><a class="jirachart-display-opts-open" data-js="display-option-trigger" href="#"><span class="display-option-icon"></span><strong>' + soy.$$escapeHtml('Display options') + '</strong></a>' + ((opt_data.chartType == 'pie') ? Confluence.Templates.ConfluenceJiraPlugin.piechartForm(null) : (opt_data.chartType == 'createdvsresolved') ? Confluence.Templates.ConfluenceJiraPlugin.createdVsResolved(null) : (opt_data.chartType == 'twodimensional') ? Confluence.Templates.ConfluenceJiraPlugin.twoDimensional(null) : '') + '</div></form></div></div>';
};
if (goog.DEBUG) {
  Confluence.Templates.ConfluenceJiraPlugin.contentJiraChart.soyTemplateName = 'Confluence.Templates.ConfluenceJiraPlugin.contentJiraChart';
}


Confluence.Templates.ConfluenceJiraPlugin.piechartForm = function(opt_data, opt_ignored) {
  return '<fieldset><div class="field-group"><label for="jira-chart-statType">' + soy.$$escapeHtml('Chart by') + '</label><select name="type" id="jira-chart-statType" class="select"></select></div></fieldset><fieldset class="group"><div class="field-group"><label for="jira-chart-width">' + soy.$$escapeHtml('Width') + '</label><input type="text" name="jira-chart-width" id="jira-chart-width" class="text short-field"><span class="aui-icon aui-icon-small aui-iconfont-help help-aligment widthInfo" title="' + soy.$$escapeHtml('Enter pixels, percent or leave blank to auto-resize.') + '"></span><div class="checkbox"><input type="checkbox" id="jira-pie-chart-show-border" class="checkbox jira-chart-show-border"><label for="jira-pie-chart-show-border">' + soy.$$escapeHtml('Show border') + '</label></div><div class="checkbox"><input type="checkbox" id="jira-pie-chart-show-infor" class="checkbox jira-chart-show-infor"><label for="jira-pie-chart-show-infor">' + soy.$$escapeHtml('Show chart information') + '</label></div></div></fieldset>';
};
if (goog.DEBUG) {
  Confluence.Templates.ConfluenceJiraPlugin.piechartForm.soyTemplateName = 'Confluence.Templates.ConfluenceJiraPlugin.piechartForm';
}


Confluence.Templates.ConfluenceJiraPlugin.createdVsResolved = function(opt_data, opt_ignored) {
  return '<fieldset><div class="field-group"><label for="created-vs-resolved-chart-periodName">' + soy.$$escapeHtml('Period') + '</label><select class="select" id="created-vs-resolved-chart-periodName" name="created-vs-resolved-chart-periodName"><option value="hourly">' + soy.$$escapeHtml('Hourly') + '</option><option value="daily">' + soy.$$escapeHtml('Daily') + '</option><option value="weekly">' + soy.$$escapeHtml('Weekly') + '</option><option value="monthly">' + soy.$$escapeHtml('Monthly') + '</option><option value="quarterly">' + soy.$$escapeHtml('Quarterly') + '</option><option value="yearly">' + soy.$$escapeHtml('Yearly') + '</option></select><div class="error"></div></div><div class="field-group"><label for="created-vs-resolved-chart-daysprevious">' + soy.$$escapeHtml('Days previously') + '<span class="aui-icon icon-required"></span></label><input type="text" class="text" id="created-vs-resolved-chart-daysprevious" value="30"><span class="aui-icon aui-icon-small aui-iconfont-help help-aligment daysPreviousInfo" title="' + soy.$$escapeHtml('Number of days to include (counting back from today).') + '"></span><div class="error days-previous-error"></div></div><fieldset class="group"><div class="checkbox"><input type="checkbox" id="created-vs-resolved-chart-cumulative" name="created-vs-resolved-chart-cumulative" class="checkbox"><label for="created-vs-resolved-chart-cumulative">' + soy.$$escapeHtml('Cumulative totals') + '</label><span class="aui-icon aui-icon-small aui-iconfont-help help-aligment cumulativeInfo" title="' + soy.$$escapeHtml('Progressively add totals (1, 2, 3) or show individual values (1,1,1).') + '"></span></div><div class="checkbox"><input type="checkbox" id="created-vs-resolved-chart-showunresolvedtrend" name="created-vs-resolved-chart-showunresolvedtrend" class="checkbox"><label for="created-vs-resolved-chart-showunresolvedtrend">' + soy.$$escapeHtml('Show unresolved trend') + '</label><span class="aui-icon aui-icon-small aui-iconfont-help help-aligment showunresolvedtrendInfo" title="' + soy.$$escapeHtml('Include a subplot showing unresolved issues.') + '"></span></div></fieldset><div class="field-group"><label for="created-vs-resolved-chart-versionLabel">' + soy.$$escapeHtml('Show versions') + '</label><select class="select" id="created-vs-resolved-chart-versionLabel" name="created-vs-resolved-chart-versionLabel"><option value="all">' + soy.$$escapeHtml('All versions') + '</option><option value="major">' + soy.$$escapeHtml('Only major versions') + '</option><option value="none">' + soy.$$escapeHtml('None') + '</option></select><span class="aui-icon aui-icon-small aui-iconfont-help help-aligment versionLabelInfo" title="' + soy.$$escapeHtml('Mark version release dates in the chart.') + '"></span><div class="error"></div></div></fieldset><fieldset class="group"><div class="field-group"><label for="jira-chart-width">' + soy.$$escapeHtml('Width') + '</label><input type="text" name="jira-chart-width" id="jira-chart-width" class="text short-field"><span class="aui-icon aui-icon-small aui-iconfont-help help-aligment widthInfo" title="' + soy.$$escapeHtml('Enter pixels, percent or leave blank to auto-resize.') + '"></span><div class="checkbox"><input type="checkbox" id="jira-createdvsresolved-chart-show-border" class="checkbox jira-chart-show-border"><label for="jira-createdvsresolved-chart-show-border">' + soy.$$escapeHtml('Show border') + '</label></div><div class="checkbox"><input type="checkbox" id="jira-createdvsresolved-chart-show-infor" class="checkbox jira-chart-show-infor"><label for="jira-createdvsresolved-chart-show-infor">' + soy.$$escapeHtml('Show chart information') + '</label></div></div></fieldset>';
};
if (goog.DEBUG) {
  Confluence.Templates.ConfluenceJiraPlugin.createdVsResolved.soyTemplateName = 'Confluence.Templates.ConfluenceJiraPlugin.createdVsResolved';
}


Confluence.Templates.ConfluenceJiraPlugin.twoDimensional = function(opt_data, opt_ignored) {
  return '<fieldset><div id="jira-chart-support-all-version" class="hidden"/><div class="field-group"><label for="twodimensional-xaxis">' + soy.$$escapeHtml('XAxis') + '</label><select class="select" id="twodimensional-xaxis"><option value="statuses">' + soy.$$escapeHtml('Status') + '</option><option value="priorities">' + soy.$$escapeHtml('Priority') + '</option><option value="assignees">' + soy.$$escapeHtml('Assignee') + '</option><option value="allFixfor">' + soy.$$escapeHtml('Fix For Versions (all)') + '</option><option value="components">' + soy.$$escapeHtml('Component') + '</option><option value="issuetype">' + soy.$$escapeHtml('Issue Type') + '</option></select></div><div class="field-group"><label for="twodimensional-yaxis">' + soy.$$escapeHtml('YAxis') + '</label><select class="select" id="twodimensional-yaxis"><option value="statuses">' + soy.$$escapeHtml('Status') + '</option><option value="priorities">' + soy.$$escapeHtml('Priority') + '</option><option value="assignees">' + soy.$$escapeHtml('Assignee') + '</option><option value="allFixfor">' + soy.$$escapeHtml('Fix For Versions (all)') + '</option><option value="components">' + soy.$$escapeHtml('Component') + '</option><option value="issuetype">' + soy.$$escapeHtml('Issue Type') + '</option></select></div><div class="field-group"><label for="twodimensional-number-of-result">' + soy.$$escapeHtml('Rows to display') + '</label><input type="text" name="twodimensional-number-of-result" id="twodimensional-number-of-result" class="text short-field"><div class="error twodimensional-number-of-result-error"></div></div></fieldset>';
};
if (goog.DEBUG) {
  Confluence.Templates.ConfluenceJiraPlugin.twoDimensional.soyTemplateName = 'Confluence.Templates.ConfluenceJiraPlugin.twoDimensional';
}


Confluence.Templates.ConfluenceJiraPlugin.jiraChartErrorMessage = function(opt_data, opt_ignored) {
  return '<div class="aui-message-container"><div class="aui-message error closeable shadowed"><p class="title"><span class="aui-icon icon-error"></span><strong></strong></p><span class=\'message\'>' + soy.$$escapeHtml(opt_data.message) + '</span><span class="aui-icon icon-close" role="button" tabindex="0"></span></div></div>';
};
if (goog.DEBUG) {
  Confluence.Templates.ConfluenceJiraPlugin.jiraChartErrorMessage.soyTemplateName = 'Confluence.Templates.ConfluenceJiraPlugin.jiraChartErrorMessage';
}


Confluence.Templates.ConfluenceJiraPlugin.noServerWarning = function(opt_data, opt_ignored) {
  return '<div class="aui-message-container"><div class="aui-message warning">' + ((opt_data.isAdministrator == true) ? soy.$$escapeHtml('No server found match with your URL.') + '<a id="open_applinks" target="_blank" href="' + soy.$$escapeHtml(opt_data.contextPath) + '/admin/listapplicationlinks.action">' + soy.$$escapeHtml('Click here to set this up') + '</a>' : soy.$$escapeHtml('No server found match with your URL. Your administrator can set this up.') + '<a id="open_applinks" target="_blank" href="' + soy.$$escapeHtml(opt_data.contextPath) + '/wiki/contactadministrators.action">' + soy.$$escapeHtml('Click here to contact your admin') + '</a>') + '<span class="aui-icon icon-warning"></span></div></div>';
};
if (goog.DEBUG) {
  Confluence.Templates.ConfluenceJiraPlugin.noServerWarning.soyTemplateName = 'Confluence.Templates.ConfluenceJiraPlugin.noServerWarning';
}


Confluence.Templates.ConfluenceJiraPlugin.addMoreToComeLink = function(opt_data, opt_ignored) {
  return '<li class="page-menu-item"><button class="item-button moreToCome"><a target="_blank" href="http://go.atlassian.com/confluencejiracharts">' + soy.$$escapeHtml('More to come...') + '</a></button></li>';
};
if (goog.DEBUG) {
  Confluence.Templates.ConfluenceJiraPlugin.addMoreToComeLink.soyTemplateName = 'Confluence.Templates.ConfluenceJiraPlugin.addMoreToComeLink';
}


Confluence.Templates.ConfluenceJiraPlugin.addCrossMacroLink = function(opt_data, opt_ignored) {
  return '<li class="page-menu-item"><hr><span class="aui-nav-heading jira-padding-left-10px"><strong>' + soy.$$escapeHtml('OTHER JIRA CONTENT') + '</strong></span><nav class="aui-navgroup aui-navgroup-vertical"><div class="aui-navgroup-inner"><ul class="aui-nav"><li><button class="item-button jira-left-panel-link" id="' + soy.$$escapeHtml(opt_data.id) + '">' + soy.$$escapeHtml(opt_data.label) + '</button></li></ul></div></nav></li>';
};
if (goog.DEBUG) {
  Confluence.Templates.ConfluenceJiraPlugin.addCrossMacroLink.soyTemplateName = 'Confluence.Templates.ConfluenceJiraPlugin.addCrossMacroLink';
}


Confluence.Templates.ConfluenceJiraPlugin.jqlInvalid = function(opt_data, opt_ignored) {
  return '<div class="aui-message-container"><div class="aui-message warning">' + soy.$$escapeHtml('The JIRA server didn\x27t understand your search query. If you entered JQL, please ensure that it\x27s correctly formed. If you entered an issue key, ensure that it exists and you have permission to view it.') + '<span class="aui-icon icon-warning"></span></div></div>';
};
if (goog.DEBUG) {
  Confluence.Templates.ConfluenceJiraPlugin.jqlInvalid.soyTemplateName = 'Confluence.Templates.ConfluenceJiraPlugin.jqlInvalid';
}


Confluence.Templates.ConfluenceJiraPlugin.warningValWidthColumn = function(opt_data, opt_ignored) {
  return '<div class="error width-error">' + ((opt_data.error == 'wrongFormat') ? soy.$$escapeHtml('The width must be in correct format') : (opt_data.error == 'wrongNumber') ? soy.$$escapeHtml('The width must be a number between 100 and 9000') : '') + '</div>';
};
if (goog.DEBUG) {
  Confluence.Templates.ConfluenceJiraPlugin.warningValWidthColumn.soyTemplateName = 'Confluence.Templates.ConfluenceJiraPlugin.warningValWidthColumn';
}


Confluence.Templates.ConfluenceJiraPlugin.warningValMaxiumIssues = function(opt_data, opt_ignored) {
  return '<div id="jira-max-number-error" class="error">' + soy.$$escapeHtml('Must be a number between 1 and 1000.') + '</div>';
};
if (goog.DEBUG) {
  Confluence.Templates.ConfluenceJiraPlugin.warningValMaxiumIssues.soyTemplateName = 'Confluence.Templates.ConfluenceJiraPlugin.warningValMaxiumIssues';
}


Confluence.Templates.ConfluenceJiraPlugin.showJiraUnsupportedVersion = function(opt_data, opt_ignored) {
  return '<div class="jira-unsupported-version aui-message-container"><div class="aui-message warning">' + soy.$$escapeHtml('JIRA Charts are not available for your version of JIRA. Upgrade to JIRA 6.1.1 or later to use this macro.') + '<span class="aui-icon icon-warning"></span></div></div>';
};
if (goog.DEBUG) {
  Confluence.Templates.ConfluenceJiraPlugin.showJiraUnsupportedVersion.soyTemplateName = 'Confluence.Templates.ConfluenceJiraPlugin.showJiraUnsupportedVersion';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.extra.jira:dialogsJs', location = 'templates/soy/create_issues.soy' */
// This file was automatically generated from create_issues.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.ConfluenceJiraPlugin.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.ConfluenceJiraPlugin == 'undefined') { Confluence.Templates.ConfluenceJiraPlugin = {}; }


Confluence.Templates.ConfluenceJiraPlugin.createIssuesForm = function(opt_data, opt_ignored) {
  return '<form action="#" method="post" class="aui" id="create-issues-form"><div class="loading-blanket hidden"><div class="loading-data"/></div><div class="field-group servers"><label>' + soy.$$escapeHtml('Server') + '</label><select class="select server-select"></select></div><div class="field-group project-select-parent" ><label>' + soy.$$escapeHtml('Project') + '</label><select class="select project-select" name="pid"></select></div><div class="field-group type-select-parent issues-type-group" ><label>' + soy.$$escapeHtml('Issue Type') + '</label><select class="select type-select" name="issuetype"></select></div><div class="field-group"><label>' + soy.$$escapeHtml('Summary') + '<span class="aui-icon icon-required"/></label><input class="text issue-summary" type="text" name="summary"/></div><div id="jira-required-fields-panel"></div><div class="field-group"><label>' + soy.$$escapeHtml('Description') + '</label><textarea class="issue-description textarea" rows="5" name="description"/></div></form>';
};
if (goog.DEBUG) {
  Confluence.Templates.ConfluenceJiraPlugin.createIssuesForm.soyTemplateName = 'Confluence.Templates.ConfluenceJiraPlugin.createIssuesForm';
}


Confluence.Templates.ConfluenceJiraPlugin.renderOptions = function(opt_data, opt_ignored) {
  var output = '';
  var optionList15 = opt_data.options;
  var optionListLen15 = optionList15.length;
  for (var optionIndex15 = 0; optionIndex15 < optionListLen15; optionIndex15++) {
    var optionData15 = optionList15[optionIndex15];
    output += '<option value="' + soy.$$escapeHtml(optionData15.id) + '">' + soy.$$escapeHtml(optionData15.name) + '</option>';
  }
  return output;
};
if (goog.DEBUG) {
  Confluence.Templates.ConfluenceJiraPlugin.renderOptions.soyTemplateName = 'Confluence.Templates.ConfluenceJiraPlugin.renderOptions';
}


Confluence.Templates.ConfluenceJiraPlugin.renderOption = function(opt_data, opt_ignored) {
  return '<option value="' + soy.$$escapeHtml(opt_data.option.id) + '" data-jira-option-key="' + soy.$$escapeHtml(opt_data.option.key) + '">' + soy.$$escapeHtml(opt_data.option.name) + '</option>';
};
if (goog.DEBUG) {
  Confluence.Templates.ConfluenceJiraPlugin.renderOption.soyTemplateName = 'Confluence.Templates.ConfluenceJiraPlugin.renderOption';
}


Confluence.Templates.ConfluenceJiraPlugin.renderCreateErrorPanel = function(opt_data, opt_ignored) {
  var output = '<div>' + soy.$$escapeHtml('There were errors creating an issue in') + '<a target="_blank" href=' + soy.$$escapeHtml(opt_data.serverUrl) + '>JIRA</a></div><ul>';
  var errorList36 = opt_data.errors;
  var errorListLen36 = errorList36.length;
  for (var errorIndex36 = 0; errorIndex36 < errorListLen36; errorIndex36++) {
    var errorData36 = errorList36[errorIndex36];
    output += '<li>' + soy.$$escapeHtml(errorData36) + '</li>';
  }
  output += '</ul>';
  return output;
};
if (goog.DEBUG) {
  Confluence.Templates.ConfluenceJiraPlugin.renderCreateErrorPanel.soyTemplateName = 'Confluence.Templates.ConfluenceJiraPlugin.renderCreateErrorPanel';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-paste:autoconvert-core', location = 'js/autoconvert/tinymce-autoconvert.js' */
define("confluence-paste/autoconvert/tinymce-autoconvert",["tinymce","ajs","jquery","document","confluence/api/constants"],function(k,h,e,n,o){function l(a){for(var d=l.options,a=d.parser[d.strictMode?"strict":"loose"].exec(a),c={},b=14;b--;)c[d.key[b]]=a[b]||"";c[d.q.name]={};c[d.key[12]].replace(d.q.parser,function(a,b,e){b&&(c[d.q.name][b]=e)});return c}var f=function(a){a.onUndo.add(this.cleanLinks);this.editor=a;this.weightedHandlers=[];this.handlers=[]};f.prototype={addHandler:function(a,d){this.weightedHandlers.push({handler:a,
weight:d||0});this.weightedHandlers.sort(function(a,b){return a.weight-b.weight});this.handlers=[];for(var c=this.weightedHandlers.length,b=0;b<c;b++)this.handlers.push(this.weightedHandlers[b].handler)},cleanLinks:function(a){e("a.atlassian-autoconvert",a.getDoc()).removeClass("atlassian-autoconvert");return!0},callHandlers:function(a){function d(a){if(a&&(1!==a.length||!a.attr("href")))return b(a);if(a)j=a,g=0,m=l(j.attr("href")),c(i.handlers[g],m,j);else if(g++,g<i.handlers.length)c(i.handlers[g],
m,j);else return b(j)}function c(a,b,c){var e=d,f;f=setTimeout(function(){h.log("Autoconvert: Callback #"+g+" failed to call continuation in time. If there is no subsequent log, the handler is improperly implemented and should be uninstalled.");e=function(){h.log("Autoconvert: Callback #"+g+" did eventualy return. Probably a slow async call.")};d()},k.plugins.Autoconvert.callbackTimeout);a(b,c,function(){var a=g;clearTimeout(f);e.apply(i,arguments);e=function(){h.log("Autoconvert: Callback #"+a+" called the continuation multiple times.")}})}
function b(a){i.editor.undoManager.beforeChange();var b=i.editor.selection,c=i.editor.selection.getBookmark();f.replaceWith(a);b.moveToBookmark(c);i.editor.undoManager.add()}var g=0,i=this,f=e(a),j=e(a).clone(),a=j.attr("href"),m=l(a.replace(/^(.*?\/\/[^/]*?\/.*?)(@)/,"$1%40"));0!==this.handlers.length&&c(this.handlers[0],m,j)}};f.callbackTimeout=5E3;f.convertMacroToDom=function(a,d,c){a={macro:a,contentId:h.Meta.get("content-id")};e.ajax({type:"POST",contentType:"application/json; charset=utf-8",
url:o.CONTEXT_PATH+"/rest/tinymce/1/macro/placeholder",data:e.toJSON(a),dataType:"text",success:d,error:c,timeout:45E3})};f.convertMacroToDomViaWikiText=function(a,d,c){var b=["{",a.name],g=!0;a.defaultParameterValue&&(b.push(":",a.defaultParameterValue),g=!1);for(var i in a.params)g?(b.push(":"),g=!1):b.push("|"),b.push(i,"=",a.params[i]);b.push("}");f.getHtmlFromWikiMarkup(b.join(""),function(a){d(e(a)[0])},function(){c()})};f.getHtmlFromWikiMarkup=function(a,d,c){a={wiki:a,entityId:h.Meta.get("content-id"),
spaceKey:h.Meta.get("space-key")};e.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:o.CONTEXT_PATH+"/rest/tinymce/1/wikixhtmlconverter",data:e.toJSON(a),dataType:"text",success:d,error:c,timeout:45E3})};l.options={strictMode:!1,key:"source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,
loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}};return{autoConverter:f,plugin:{init:function(a){function d(b,d,f){b=e(f.node).children("a");1===b.length&&("A"===b[0].tagName&&b.text()===b.attr("href"))&&(b.attr("class","atlassian-autoconvert"),setTimeout(function(){var b=e("a.atlassian-autoconvert",e(a.selection.getNode().ownerDocument)).removeClass("atlassian-autoconvert");
c.callHandlers(b)},0))}var c=new f(a);k.plugins.Autoconvert.autoConvert=c;a.onInit.add(function(){e(n).bind("postPaste",d);a.addCommand("addAutoconverter",function(a,d){c.addHandler(d)})});a.onRemove.add(function(){e(n).unbind("postPaste",d)})},getInfo:function(){return{longname:"Atlassian Autoconvert",author:"Atlassian",authorurl:"http://www.atlassian.com",infourl:"http://www.atlassian.com",version:"1.0"}}}}});
require("confluence/module-exporter").safeRequire("confluence-paste/autoconvert/tinymce-autoconvert",function(k){var h=require("tinymce");h.plugins.Autoconvert=k.autoConverter;h.create("tinymce.plugins.AutoconvertPlugin",k.plugin);h.PluginManager.add("autoconvert",h.plugins.AutoconvertPlugin)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.extra.jira:amd-support', location = 'amd/confluence-shim.js' */
define("confluence/jim/confluence-shim",function(){return window.Confluence});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.extra.jira:amd-support', location = 'amd/amd-exporter.js' */
define("confluence/jim/amd/module-exporter",[],function(){var a={};a.namespace=function(e,f,d){var g=e.split(".");d=d||window;for(var c=0,h=g.length-1;c<h;c++){var b=d[g[c]];d=(b!=null)?b:d[g[c]]={}}if(d[g[c]]){if(window.console&&window.console.warn){window.console.warn('Value of "'+e+'" was overridden')}}d[g[c]]=f||d[g[c]]||{};return d[g[c]]};a.safeRequire=function(c,b){if(define&&define.amd===undefined){var d=require(c);if(b){b(d)}}};a.exportModuleAsGlobal=function(c,d,b){a.safeRequire(c,function(e){a.namespace(d,e);if(b){b(e)}})};return a});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.extra.jira:autoconvert-jira', location = 'editor-plugins/jira-paste-link.js' */
define("confluence/jim/editor-plugins/jira-paste-link",["ajs",],function(b){var a={issueKeyOnlyRegEx:/\/(i#)?browse\/([\x00-\x19\x21-\x22\x24\x27-\x3E\x40-\x7F]+-[0-9]+$)/,singleTicketXMLEx:/\/jira\.issueviews:issue-xml\/([\x00-\x19\x21-\x22\x24\x27-\x3E\x40-\x7F]+-[0-9]+)\//,issueKeyWithinRegex:/\/(i#)?browse\/([\x00-\x19\x21-\x22\x24\x27-\x3E\x40-\x7F]+-[0-9]+)(?:\?|#)/,jqlRegEx:/jqlQuery\=([^&]+)/,jqlRegExAlternateFormat:/jql\=([^&]+)/,_getMatchedServerFromLink:function(d,j){var h=null;for(var f in j){if(j.hasOwnProperty(f)){var g=j[f];var c=g.url;var e=g.url[g.url.length-1];if(e!=="/"){c+="/"}if(d.indexOf(c)===0){h=g;break}}}return h},pasteHandler:function(g,h,k){var m=b.Editor.JiraConnector.servers;if(!m){k();return null}var l=b.Editor.JiraAnalytics;var f={};var n=a._getMatchedServerFromLink(g.source,m);var i=null;if(n){var d=a.jqlRegEx.exec(g.source)||a.jqlRegExAlternateFormat.exec(g.source);var c=b.JQLHelper.isFilterUrl(g.source);var j=a.issueKeyOnlyRegEx.exec(g.source)||a.issueKeyWithinRegex.exec(g.source);if(j){j=j[2];if(l){f.type=l.linkTypes.jql}}else{j=a.singleTicketXMLEx.exec(g.source);if(j){j=j[1];if(l){f.type=l.linkTypes.xml}}}if(d){f.is_single_issue=false;f.type=b.JQLHelper.checkQueryType(g.source);i={name:"jira",params:{server:n.name,serverId:n.id,jqlQuery:decodeURIComponent(d[1].replace(/\+/g,"%20"))}}}else{if(c){var e=g.source;f.is_single_issue=false;f.type=b.JQLHelper.checkQueryType(e);i={name:"jira",params:{server:n.name,serverId:n.id,jqlQuery:b.JQLHelper.getFilterFromFilterUrl(e)}}}else{if(j){f.is_single_issue=true;i={name:"jira",params:{server:n.name,serverId:n.id,key:j}}}}}}if(i){window.tinymce.plugins.Autoconvert.convertMacroToDom(i,k,k);if(l){l.triggerPasteEvent(f)}}else{k()}}};return a});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.extra.jira:autoconvert-jira', location = 'editor-plugins/init.js' */
require(["ajs","confluence/jim/editor-plugins/jira-paste-link"],function(b,a){b.bind("init.rte",function(){window.tinymce.plugins.Autoconvert.autoConvert.addHandler(a.pasteHandler)})});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.extra.jira:text-placeholders-jira', location = '/jira/placeholder.js' */
(function(){AJS.bind("init.rte",function(){AJS.bind("editor.text-placeholder.activated",function(b,a){if(a&&a.placeholderType==="jira"){AJS.Editor.JiraConnector.open(AJS.Editor.JiraConnector.source.instructionalText)}});if(AJS.Rte.Placeholder&&AJS.Rte.Placeholder.addPlaceholderType){AJS.Rte.Placeholder.addPlaceholderType({type:"jira",label:"JIRA Macro",tooltip:"Instructional text is replaced with a JIRA Macro on click.",activation:{click:true,keypress:false}})}})})(AJS.$);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.extra.jira:jirachart-macro', location = '/jirachart/jirachart-dialog.js' */
AJS.Editor.JiraChart=(function(j){var m=-1;var A=6109;var e=6155;var d="Insert";var q="Cancel";var x="Insert JIRA Chart";var c;var g;var E=function(H){if(!c){c=new AJS.ConfluenceDialog({width:840,height:590,id:"jira-chart"});c.addHeader(x);g=AJS.Editor.JiraChart.Panels;for(var G=0;G<g.length;G++){if(typeof(g[G].title)==="function"){c.addPanel(g[G].title())}else{if(g[G].title!==undefined){c.addPanel(g[G].title)}}var J=c.getCurrentPanel();g[G].init(J)}j("#jira-chart ul.dialog-page-menu").show().append(Confluence.Templates.ConfluenceJiraPlugin.addCrossMacroLink({id:"open-jira-issue-dialog",label:"JIRA Issue/Filter"}));c.addButton(d,function(){var K=g[c.getCurrentPanel().id];if(b(K.chartType)&&K.isImageChartExisted()){var L=K.getMacroParamsFromDialog();C(L);AJS.Editor.JiraChart.close()}else{y(j("#jira-chart-content-"+K.chartType))}},"insert-jira-chart-macro-button");c.addLink("Select Macro",function(){c.hide();AJS.MacroBrowser.open(false)},"dialog-back-link");c.addCancel(q,function(){AJS.Editor.JiraChart.close()})}AJS.$("#jira-chart .dialog-page-menu button").click(function(){var M=g[c.getCurrentPanel().id];var L=c.getCurrentPanel().body;var K=AJS.Editor.JiraChart.Helper.getSelectedServer(L);n(L,K);p(L);M.handleInsertButton();M.focusForm();M.resetDisplayOption()});var I=c.getCurrentPanel().body;p(I);var F=F||function(L){var K={};_.each(L,function(M,N){K[M.chartType]=N});return K}(g);f(F,H);a();c.gotoPanel(r(F,H));c.overrideLastTab();c.show();i()};var r=function(F,G){if(G&&G.params){return F[G.params.chartType]}return 0};var s=function(){_.each(AJS.Editor.JiraChart.Panels,function(F){F.preBinding&&typeof F.preBinding==="function"&&F.preBinding()})};var i=function(){j("#open-jira-issue-dialog").click(function(){AJS.Editor.JiraChart.close();if(AJS.Editor.JiraConnector){AJS.Editor.JiraConnector.openCleanDialog(false)}})};var D=function(F){if(AJS.Editor.JiraConnector.servers.length>0){AJS.Editor.JiraConnector.Panel.prototype.applinkServerSelect(F.find("#jira-chart-servers"),function(G){l(F);if(p(F)){n(F,G);B(F)}})}};var b=function(G){var F=c.getCurrentPanel().body;return F.find("#jira-chart-content-"+G).length>0};var k=function(F){F(g[c.getCurrentPanel().id])};var y=function(F){if(AJS.Editor.JiraChart.Helper.convertSearchTextToJQL(F)===undefined){return}k(function(G){G.renderChart()})};var p=function(F){if(F.find("#jira-chart-support-all-version").length){return true}var G=AJS.Editor.JiraChart.Helper.getSelectedServer(F);if(w(G)){t(F);z(F);return false}return true};var C=function(F){var G=function(H){tinymce.confluence.macrobrowser.macroBrowserComplete(H)};if(AJS.Editor.inRichTextMode()){G({name:"jirachart",params:F})}};var f=function(F,H){for(var G=0;G<g.length;G++){g[G].resetDialogValue()}s();if(H&&H.params){var I=g[F[H.params.chartType]];I.bindingDataFromMacroToForm(H.params)}};var v=function(){if(AJS.Editor.JiraConnector.servers===undefined||AJS.Editor.JiraConnector.servers.length===0){AJS.Editor.JiraConnector.warningPopup(AJS.Meta.get("is-admin"));return false}return true};var l=function(F){F.find(".jira-oauth-message-marker").remove();F.find(".jira-chart-img").empty();F.find("#jira-chart-search-input").empty()};var a=function(){j("#jira-chart").find(".insert-jira-chart-macro-button").disable()};var h=function(){var F=AJS.$("#jira-chart").find(".insert-jira-chart-macro-button");if(F.is(":disabled")){F.enable()}};var o=function(F){F.find("#jira-chart-search-button").disable()};var u=function(F){if(F.find("#jira-chart-search-button").is(":disabled")){F.find("#jira-chart-search-button").enable()}};var n=function(H,G){j(".jira-oauth-message-marker",H).remove();var I={selectedServer:G,msg:AJS.Editor.JiraConnector.Panel.prototype.msg};if(G&&G.authUrl){var F=AJS.Editor.JiraConnector.Panel.prototype.createOauthForm.call(I,function(){j(".jira-oauth-message-marker",H).remove();AJS.Editor.JiraChart.search(H)});H.find("div.jira-chart-search").append(F)}};var t=function(F){F.find(".jira-chart-img").html(Confluence.Templates.ConfluenceJiraPlugin.showJiraUnsupportedVersion())};var z=function(G){G.find("#jira-chart-search-input").attr("disabled","disabled");G.find("#jira-chart-search-button").attr("disabled","disabled");var F=G.find(".jirachart-display-opts-close, .jirachart-display-opts-open");if(F.hasClass("jirachart-display-opts-close")){F.click()}F.addClass("disabled");a()};var B=function(F){F.find("#jira-chart-search-input").removeAttr("disabled");F.find("#jira-chart-search-button").removeAttr("disabled");F.find(".jirachart-display-opts-open").removeClass("disabled")};var w=function(G){var F=G.buildNumber;return F==m||(F>=A&&F<e)};return{close:function(){c.hide();tinymce.confluence.macrobrowser.macroBrowserCancel()},edit:function(F){if(!v()){return}E(F);var H=c.getCurrentPanel().body;if(!p(H)){return}B(H);if(F.params!==undefined&&F.params.serverId!==undefined){y(H)}var G=AJS.Editor.JiraChart.Helper.getSelectedServer(H);n(H,G)},search:y,disableInsert:a,enableInsert:h,disableSearch:o,enableSearch:u,insertJiraChartMacroWithParams:C,open:E,clearChartContent:l,loadServers:D,validateServerSupportedChart:p}})(AJS.$);AJS.Editor.JiraChart.Panels=[];AJS.MacroBrowser.setMacroJsOverride("jirachart",{opener:AJS.Editor.JiraChart.edit});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.extra.jira:jirachart-macro', location = '/jirachart/jirachart-helper.js' */
AJS.Editor.JiraChart.Helper=(function(g){var a=/^\d+$/;var m={};var f=function(o){o=(o&&typeof o==="string")?o.replace("px",""):"";if(o==="auto"){o=""}if(o.indexOf("%")>0){o=o.replace("%","")*4}return o};var n=function(o){return a.test(o)};var k=function(o){var p=AJS.Editor.JiraConnector.servers;if(p.length>1){return o.find("#jira-chart-servers option:selected").data("jiraapplink")}return p[0]};var h=function(p){var u=AJS.Editor.JiraConnector.servers;var r;var q=p.find("#jira-chart-search-input").val();if(q.indexOf("http")===0){var t=AJS.JQLHelper.findServerIndexFromUrl(q,u);if(t!==-1){r=u[t].id;p.find("#jira-chart-servers").val(r)}else{var s=Confluence.Templates.ConfluenceJiraPlugin.noServerWarning({isAdministrator:AJS.Meta.get("is-admin"),contextPath:Confluence.getContextPath()});p.find(".jira-chart-img").html(s);AJS.Editor.JiraChart.disableInsert();return}}var o=AJS.JQLHelper.convertToJQL(q,r);if(o){p.find("#jira-chart-search-input").val(o)}else{p.find(".jira-chart-img").html(Confluence.Templates.ConfluenceJiraPlugin.jqlInvalid());AJS.Editor.JiraChart.disableInsert()}return o};var d=function(o,q){var s=k(o);if(q){var p=s.id;var t=m[p];if(!t){AppLinks.makeRequest({appId:s.id,type:"GET",url:"/rest/gadget/1.0/statTypes",dataType:"json",async:false,success:function(u){if(u){m[s.id]=u;t=u}},error:function(u){if(u){m[s.id]=JSON.parse(u.responseText);t=JSON.parse(u.responseText)}AJS.log("Jira Chart Macro: unable to retrieve statTypes from AppLink: "+s.id)}}).fail(function(u){if(u){m[s.id]=JSON.parse(u.responseText);t=JSON.parse(u.responseText)}})}var r="";_.each(t.stats,function(u){r+="<option value = '"+u.value+"'>"+AJS.escapeHtml(u.label)+" </option>"});q.html(r)}};var l=function(o){o.next().next(".width-error").remove();var p=f(o.val());var q;if(p){if(n(p)){if(p<100||p>9000){q="wrongNumber"}}else{q="wrongFormat"}}if(q){o.next().after(Confluence.Templates.ConfluenceJiraPlugin.warningValWidthColumn({error:q}));AJS.Editor.JiraChart.disableInsert();return false}return true};var j=function(o){return{jql:o.find("#jira-chart-search-input"),width:o.find("#jira-chart-width"),border:o.find(".jira-chart-show-border"),showinfor:o.find(".jira-chart-show-infor"),displayOption:o.find(".jirachart-display-opts-close, .jirachart-display-opts-open"),server:o.find("#jira-chart-servers")}};var c=function(p,o){p.jql.val(decodeURIComponent(o.jql));p.width.val(o.width);p.border.attr("checked",(o.border==="true"));p.showinfor.attr("checked",(o.showinfor==="true"));if(AJS.Editor.JiraConnector.servers.length>1){p.server.val(o.serverId)}};var b=function(q,o){var p=k(o);return{jql:encodeURIComponent(q.jql.val()),width:f(q.width.val()),border:q.border.prop("checked"),showinfor:q.showinfor.prop("checked"),serverId:p.id,server:p.name,isAuthenticated:!p.authUrl}};var i=function(p,o){return{contentId:AJS.Meta.get("page-id"),macro:{name:"jirachart",params:{jql:p.jql,serverId:p.serverId,width:p.width,border:p.border,showinfor:p.showinfor,chartType:o}}}};var e=function(o){if(o){return AJS.$.trim(o.val())!==""&&o.val()!==o.attr("placeholder")}return false};return{getSelectedServer:k,bindingCommonChartElements:j,bindingCommonDataFromMacroToForm:c,getCommonMacroParamsFromDialog:b,getCommonChartParamsRequest:i,convertSearchTextToJQL:h,convertFormatWidth:f,isChartWidthValid:l,isNumber:n,isJqlNotEmpty:e,populateStatType:d}})(AJS.$);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.extra.jira:jirachart-macro', location = '/jirachart/jirachart-panel.js' */
AJS.Editor.JiraChart.Panel=function(){};AJS.Editor.JiraChart.Panel.prototype={init:function(a){var b=this.chartType;var c=Confluence.Templates.ConfluenceJiraPlugin.contentJiraChart({isMultiServer:AJS.Editor.JiraConnector.servers.length>1,chartType:b});a.html(c);this.container=AJS.$(this.containerId);AJS.Editor.JiraChart.clearChartContent(this.container);AJS.Editor.JiraChart.loadServers(this.container);this.bindingChartElements();this.bindingActions()},bindingActions:function(){var e=this;var d=function(){if(e.isFormValid()){AJS.Editor.JiraChart.search(e.container)}else{AJS.Editor.JiraChart.disableInsert()}};var b=e.container.find(e.clickableElements);b.click(d);var f=e.container.find(e.onChangeElements);f.change(d);e.chartElements.jql.change(function(){if(this.value!==e.jqlWhenEnterKeyPress){e.container.find(".jira-chart-img").empty();AJS.Editor.JiraChart.disableInsert()}e.jqlWhenEnterKeyPress=""}).bind("paste",function(){setTimeout(function(){if(e.isFormValid()){e.jqlWhenEnterKeyPress=e.chartElements.jql.val();AJS.Editor.JiraChart.search(e.container)}},100)});var a=e.container.find("input[type='text']");var c=function(g){if(g.attr("id")==="jira-chart-search-input"){e.jqlWhenEnterKeyPress=g.val()}};a.unbind("keydown").keydown(function(g){if(g.which==13){var h=function(i){a.unbind("keyup",h);if(e.isFormValid()){AJS.Editor.JiraChart.search(e.container)}c(a);return AJS.stopEvent(i)};a.keyup(h);return AJS.stopEvent(g)}});e.bindSelectOption();e.bindingServerChange()},bindingServerChange:function(){var a=this;a.chartElements.server.change(function(){if(a.isFormValid()&&AJS.Editor.JiraChart.validateServerSupportedChart(a.container)){AJS.Editor.JiraChart.search(a.container)}else{AJS.Editor.JiraChart.disableInsert()}})},renderChart:function(){var e=this;var b=this.getChartParamsRequest();var a=Confluence.getContextPath()+"/rest/tinymce/1/macro/preview";var d=this.container.find(".jira-chart-img");d.html('<div class="loading-data"></div>');var c=d.find(".loading-data")[0];AJS.$.data(c,"spinner",Raphael.spinner(c,50,"#666"));if(e.request){e.request.abort()}e.request=AJS.$.ajax({url:a,type:"POST",contentType:"application/json",data:JSON.stringify(b)}).done(function(f){d.html("").hide();var i=AJS.$('<iframe frameborder="0" id="chart-preview-iframe"></iframe>');i.appendTo(d);var h=i[0].contentWindow,g=h.document;i.on("load",function(){h.AJS.$("#main").addClass("chart-preview-main");d.show();e.handleInsertButton()});f=f.replace("window.onload","var chartTest");g.open();g.write(f);g.close()}).error(function(f){if(f.statusText!="abort"){AJS.log("Jira Chart Macro - Fail to get data from macro preview");d.html(Confluence.Templates.ConfluenceJiraPlugin.jiraChartErrorMessage({message:"Unable to render JIRA chart macro due to an execution error."}))}AJS.Editor.JiraChart.disableInsert()})},resetDialogValue:function(){var a=AJS.$("input",this.container);a.filter(":text").val("");a.filter(":checked").removeAttr("checked");this.container.find("#jira-chart-search-input").val();this.container.find(".jira-chart-img").empty();this.resetDisplayOption()},resetDisplayOption:function(){var b=this;var a=this.chartElements.displayOption;a.addClass("jirachart-display-opts-open");a.removeClass("jirachart-display-opts-close");setTimeout(function(){var c=b.container.find(".jira-chart-option");c.scrollTop(0);c.css({overflow:"hidden",top:"430px"})},0)},bindSelectOption:function(){var c=this;var b=c.container.find(".jira-chart-option");var d=function(g){var f=40;var i=b.position().top+"px";var e="";var h={top:430};if(g){i="";e=f-b.find("#jiraChartMacroOption").height()+"px";h={bottom:0};b.css("overflow","auto")}else{b.css("overflow","hidden")}b.css("top",i);b.css("bottom",e);b.animate(h,500)};b.css("top","430px");var a=this.chartElements.displayOption;a.click(function(g){var f=AJS.$(this);g.preventDefault();if(f.hasClass("disabled")){return}var h=f.hasClass("jirachart-display-opts-open");if(h){d(true);f.addClass("jirachart-display-opts-close");f.removeClass("jirachart-display-opts-open")}else{d();f.removeClass("jirachart-display-opts-close");f.addClass("jirachart-display-opts-open")}})},isImageChartExisted:function(){return this.container.find("#chart-preview-iframe").contents().find(".jira-chart-macro-img").length>0},focusForm:function(){this.container.find("#jira-chart-search-input").focus()},handleInsertButton:function(){if(this.isFormValid()&&this.isResultValid()){AJS.Editor.JiraChart.enableInsert()}else{AJS.Editor.JiraChart.disableInsert()}}};
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.extra.jira:jirachart-macro', location = '/jirachart/piechart-panel.js' */
AJS.Editor.JiraChart.Panel.PieChart=function(d){AJS.Editor.JiraChart.Panel.call(this);var a="Pie Chart";var c="pie";var b=this;this.title=a;this.chartType=c;this.containerId="#jira-chart-content-pie";this.clickableElements=".jira-chart-search button, .jira-chart-show-border, .jira-chart-show-infor";this.onChangeElements="#jira-chart-statType, #jira-chart-width";this.isFormValid=function(){return AJS.Editor.JiraChart.Helper.isChartWidthValid(b.chartElements.width)&&AJS.Editor.JiraChart.Helper.isJqlNotEmpty(b.chartElements.jql)};this.isResultValid=function(){return this.container.find("#chart-preview-iframe").contents().find(".jira-chart-macro-wrapper").length};this.bindingActions=function(){var e=this;AJS.Editor.JiraChart.Panel.prototype.bindingActions.call(e);e.container.find(".widthInfo").tooltip({gravity:"w"})};this.bindingServerChange=function(){b.chartElements.server.change(function(){AJS.Editor.JiraChart.Helper.populateStatType(b.container,b.chartElements.statType);if(b.isFormValid()){AJS.Editor.JiraChart.search(b.container)}else{AJS.Editor.JiraChart.disableInsert()}})};this.bindingChartElements=function(){this.chartElements=AJS.Editor.JiraChart.Helper.bindingCommonChartElements(this.container);this.chartElements.statType=this.container.find("#jira-chart-statType")};this.getChartParamsRequest=function(){var f=this.getMacroParamsFromDialog();var e=AJS.Editor.JiraChart.Helper.getCommonChartParamsRequest(f,this.chartType);e.macro.params.statType=f.statType;return e};this.getMacroParamsFromDialog=function(){var e=AJS.Editor.JiraChart.Helper.getCommonMacroParamsFromDialog(this.chartElements,this.container);e.chartType=c;e.statType=this.chartElements.statType.val();return e};this.bindingDataFromMacroToForm=function(e){if(e){AJS.Editor.JiraChart.Helper.bindingCommonDataFromMacroToForm(this.chartElements,e);this.chartElements.statType.val(e.statType)}};this.preBinding=function(){AJS.Editor.JiraChart.Helper.populateStatType(this.container,this.container.find("#jira-chart-statType"))}};AJS.Editor.JiraChart.Panel.PieChart.prototype=AJS.Editor.JiraChart.Panel.prototype;AJS.Editor.JiraChart.Panel.PieChart.prototype.constructor=AJS.Editor.JiraChart.Panel.PieChart;AJS.Editor.JiraChart.Panels.push(new AJS.Editor.JiraChart.Panel.PieChart(AJS.$));
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.extra.jira:jirachart-macro', location = '/jirachart/createdvsresolvedchart-panel.js' */
AJS.Editor.JiraChart.Panel.CreatedVsResolvedChart=function(e){AJS.Editor.JiraChart.Panel.call(this);var d="createdvsresolved";var c=this;var a=function(){c.container.find("#created-vs-resolved-chart-periodName").val("daily");c.container.find("#created-vs-resolved-chart-daysprevious").val("30")};var b=function(){var h=c.chartElements.periodName.val();var g=e.trim(c.chartElements.daysprevious.val());var f=c.container.find(".days-previous-error");if(g===""){c.container.find(".days-previous-error").html("Days Previously is required field.");return false}if(!AJS.Editor.JiraChart.Helper.isNumber(g)||g<0){f.html("Days Previously must be a number and positive.");return false}switch(h){case"hourly":isValid=g<=10;if(!isValid){f.html(AJS.format("Days must not exceed {0} for {1} period",10,h))}break;case"daily":isValid=g<=300;if(!isValid){f.html(AJS.format("Days must not exceed {0} for {1} period",300,h))}break;case"weekly":isValid=g<=1750;if(!isValid){f.html(AJS.format("Days must not exceed {0} for {1} period",1750,h))}break;case"monthly":isValid=g<=7500;if(!isValid){f.html(AJS.format("Days must not exceed {0} for {1} period",7500,h))}break;case"quarterly":isValid=g<=22500;if(!isValid){f.html(AJS.format("Days must not exceed {0} for {1} period",22500,h))}break;case"yearly":isValid=g<=36500;if(!isValid){f.html(AJS.format("Days must not exceed {0} for {1} period",36500,h))}break;default:isValid=false}if(isValid){f.empty()}return isValid};this.title="Created vs Resolved";this.chartType=d;this.containerId="#jira-chart-content-createdvsresolved";this.clickableElements=".jira-chart-search button, .jira-chart-show-border, .jira-chart-show-infor, #created-vs-resolved-chart-cumulative, #created-vs-resolved-chart-showunresolvedtrend";this.onChangeElements="#created-vs-resolved-chart-periodName, #created-vs-resolved-chart-daysprevious, #created-vs-resolved-chart-versionLabel, #jira-chart-width";this.isFormValid=function(){var f=AJS.Editor.JiraChart.Helper.isChartWidthValid(c.chartElements.width);return b()&&f&&AJS.Editor.JiraChart.Helper.isJqlNotEmpty(c.chartElements.jql)};this.isResultValid=function(){return this.container.find("#chart-preview-iframe").contents().find(".jira-chart-macro-wrapper").length};this.init=function(f){AJS.Editor.JiraChart.Panel.prototype.init.call(this,f);a()};this.bindingChartElements=function(){this.chartElements=AJS.Editor.JiraChart.Helper.bindingCommonChartElements(this.container);this.chartElements.periodName=this.container.find("#created-vs-resolved-chart-periodName");this.chartElements.daysprevious=this.container.find("#created-vs-resolved-chart-daysprevious");this.chartElements.isCumulative=this.container.find("#created-vs-resolved-chart-cumulative");this.chartElements.showUnresolvedTrend=this.container.find("#created-vs-resolved-chart-showunresolvedtrend");this.chartElements.versionLabel=this.container.find("#created-vs-resolved-chart-versionLabel")};this.bindingActions=function(){AJS.Editor.JiraChart.Panel.prototype.bindingActions.call(this);this.container.find(".widthInfo").tooltip({gravity:"w"});this.container.find(".showunresolvedtrendInfo").tooltip({gravity:"w"});this.container.find(".cumulativeInfo").tooltip({gravity:"w"});this.container.find(".versionLabelInfo").tooltip({gravity:"w"});this.container.find(".daysPreviousInfo").tooltip({gravity:"w"})};this.getChartParamsRequest=function(){var g=this.getMacroParamsFromDialog();var f=AJS.Editor.JiraChart.Helper.getCommonChartParamsRequest(g,this.chartType);f.macro.params.periodName=g.periodName;f.macro.params.daysprevious=g.daysprevious;f.macro.params.isCumulative=g.isCumulative;f.macro.params.showUnresolvedTrend=g.showUnresolvedTrend;f.macro.params.versionLabel=g.versionLabel;return f};this.getMacroParamsFromDialog=function(){var f=AJS.Editor.JiraChart.Helper.getCommonMacroParamsFromDialog(this.chartElements,this.container);f.chartType=d;f.periodName=this.chartElements.periodName.val();f.daysprevious=e.trim(this.chartElements.daysprevious.val());f.isCumulative=this.chartElements.isCumulative.prop("checked");f.showUnresolvedTrend=this.chartElements.showUnresolvedTrend.prop("checked");f.versionLabel=this.chartElements.versionLabel.val();return f};this.resetDialogValue=function(){AJS.Editor.JiraChart.Panel.prototype.resetDialogValue.call(this);a()};this.bindingDataFromMacroToForm=function(f){if(f){AJS.Editor.JiraChart.Helper.bindingCommonDataFromMacroToForm(c.chartElements,f);c.chartElements.isCumulative.attr("checked",(f.isCumulative!=="false"));c.chartElements.showUnresolvedTrend.attr("checked",(f.showUnresolvedTrend==="true"));c.chartElements.periodName.val(f.periodName===""?"daily":f.periodName);c.chartElements.versionLabel.val(f.versionLabel);c.chartElements.daysprevious.val(f.daysprevious===""?"30":f.daysprevious)}}};AJS.Editor.JiraChart.Panel.CreatedVsResolvedChart.prototype=AJS.Editor.JiraChart.Panel.prototype;AJS.Editor.JiraChart.Panel.CreatedVsResolvedChart.prototype.constructor=AJS.Editor.JiraChart.Panels.CreatedVsResolvedChart;AJS.Editor.JiraChart.Panels.push(new AJS.Editor.JiraChart.Panel.CreatedVsResolvedChart(AJS.$));
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.extra.jira:jirachart-macro', location = '/jirachart/twodimensionalchart-panel.js' */
AJS.Editor.JiraChart.Panel.TwoDimensionalChart=function(d){AJS.Editor.JiraChart.Panel.call(this);var c="twodimensional";var f=5;var b=this;var e=function(){var h=d(".twodimensional-number-of-result-error");var g=b.chartElements.numberToShow.val();if(AJS.Editor.JiraChart.Helper.isNumber(g)&&g>0){h.empty();return true}h.html("The number of rows should be a positive integer");return false};var a=function(){b.chartElements.numberToShow.val(f);b.chartElements.xstattype.val("statuses");b.chartElements.ystattype.val("assignees")};this.title="Two Dimensional";this.chartType=c;this.containerId="#jira-chart-content-twodimensional";this.clickableElements=".jira-chart-search button, .jira-chart-show-border, .jira-chart-show-infor, #twodimensional-show-total";this.onChangeElements="#twodimensional-xaxis, #twodimensional-yaxis, #twodimensional-number-of-result";this.isFormValid=function(){var g=e();return g&&AJS.Editor.JiraChart.Helper.isJqlNotEmpty(b.chartElements.jql)};this.isResultValid=function(){return this.container.find("#chart-preview-iframe").contents().find(".two-dimensional-chart-table").length};this.init=function(g){AJS.Editor.JiraChart.Panel.prototype.init.call(this,g);a()};this.bindingChartElements=function(){this.chartElements=AJS.Editor.JiraChart.Helper.bindingCommonChartElements(this.container);this.chartElements.xstattype=this.container.find("#twodimensional-xaxis");this.chartElements.ystattype=this.container.find("#twodimensional-yaxis");this.chartElements.sortBy=this.container.find("#twodimensional-sortby");this.chartElements.sortDirection=this.container.find("#twodimensional-sort-direction");this.chartElements.showTotals=this.container.find("#twodimensional-show-total");this.chartElements.numberToShow=this.container.find("#twodimensional-number-of-result")};this.getChartParamsRequest=function(){var h=this.getMacroParamsFromDialog();var g=AJS.Editor.JiraChart.Helper.getCommonChartParamsRequest(h,this.chartType);g.macro.params.xstattype=h.xstattype;g.macro.params.ystattype=h.ystattype;g.macro.params.sortBy=h.sortBy;g.macro.params.sortDirection=h.sortDirection;g.macro.params.showTotals=h.showTotals;g.macro.params.numberToShow=h.numberToShow;return g};this.getMacroParamsFromDialog=function(){var g=AJS.Editor.JiraChart.Helper.getCommonMacroParamsFromDialog(this.chartElements,this.container);g.chartType=c;g.xstattype=this.chartElements.xstattype.val();g.ystattype=d.trim(this.chartElements.ystattype.val());g.sortBy=d.trim(this.chartElements.sortBy.val());g.sortDirection=d.trim(this.chartElements.sortDirection.val());g.showTotals=this.chartElements.showTotals.prop("checked");g.numberToShow=this.chartElements.numberToShow.val();return g};this.bindingDataFromMacroToForm=function(g){if(g){AJS.Editor.JiraChart.Helper.bindingCommonDataFromMacroToForm(b.chartElements,g);b.chartElements.xstattype.val(g.xstattype);b.chartElements.ystattype.val(g.ystattype);b.chartElements.sortBy.val(g.sortBy);b.chartElements.sortDirection.val(g.sortDirection);b.chartElements.showTotals.attr("checked",g.showTotals==="true");b.chartElements.numberToShow.val(g.numberToShow)}};this.resetDialogValue=function(){AJS.Editor.JiraChart.Panel.prototype.resetDialogValue.call(this);a()};this.isImageChartExisted=function(){return this.container.find("#chart-preview-iframe").contents().find(".two-dimensional-chart-table").length>0};this.preBinding=function(){AJS.Editor.JiraChart.Helper.populateStatType(this.container,this.container.find("#twodimensional-xaxis"));AJS.Editor.JiraChart.Helper.populateStatType(this.container,this.container.find("#twodimensional-yaxis"));b.chartElements.xstattype.val("statuses");b.chartElements.ystattype.val("assignees")};this.bindingServerChange=function(){b.chartElements.server.change(function(){AJS.Editor.JiraChart.Helper.populateStatType(b.container,b.chartElements.xstattype);AJS.Editor.JiraChart.Helper.populateStatType(b.container,b.chartElements.ystattype);b.chartElements.xstattype.val("statuses");b.chartElements.ystattype.val("assignees");if(b.isFormValid()){AJS.Editor.JiraChart.search(b.container)}else{AJS.Editor.JiraChart.disableInsert()}})}};AJS.Editor.JiraChart.Panel.TwoDimensionalChart.prototype=AJS.Editor.JiraChart.Panel.prototype;AJS.Editor.JiraChart.Panel.TwoDimensionalChart.prototype.constructor=AJS.Editor.JiraChart.Panel.TwoDimensionalChart;AJS.Editor.JiraChart.Panels.push(new AJS.Editor.JiraChart.Panel.TwoDimensionalChart(AJS.$));
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.plugins.atlassian-connect-plugin:confluence-macro-api', location = 'js/confluence/macro/macro.js' */
define("ac/confluence/macro",["confluence/root","confluence-macro-browser/macro-browser","ajs"],function(e,d,a){var b=undefined;
var c={};
return{closeCurrentMacroPropertyPanel:function(){a.Confluence.PropertyPanel.destroy()
},setLastSelectedConnectMacroNode:function(f){c.locationToInsert=undefined;
c.params=undefined;
c.body=undefined;
c.name=undefined;
var g=d.getMacroName(f);
if(g!==undefined){b=f
}else{b=undefined
}},setUnsavedMacroData:function(i,g,f,h){c.body=g;
c.params=f;
c.locationToInsert=h;
c.name=i
},getCurrentMacroParameters:function(){if(b===undefined){return c.params
}return d.getMacroParams(b)
},saveMacro:function(){return tinymce.confluence.MacroUtils.updateMacro.apply(this,arguments)
},saveCurrentMacro:function(i,f){if(b===undefined){c.params=i;
c.body=f;
var h={contentId:e.getContentId(),macro:{name:c.name,params:c.params,body:c.body===null?"":c.body}};
a.Rte.getEditor().selection.moveToBookmark(c.locationToInsert);
return tinymce.confluence.MacroUtils.insertMacro(h)
}var g=d.getMacroName(b);
if(g===undefined){return undefined
}return tinymce.confluence.MacroUtils.updateMacro(i,f,g,b)
}}
});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.plugins.atlassian-connect-plugin:confluence-macro-v3', location = 'js/confluence/macro/editor.js' */
(function(a,b){b("ac/confluence/macro/editor",["connect-host","ac/dialog","ac/confluence/macro","ajs"],function(h,f,d,c){var g;
var e={close:function(){f.close()
},getMacroData:function(i){return i(d.getCurrentMacroParameters())
},getMacroBody:function(i){return i(g)
},openCustomEditor:function(i,k){c.Rte.getEditor().focus();
var l=c.Rte.getEditor().selection;
var j=l.getNode();
d.setLastSelectedConnectMacroNode(j);
d.setUnsavedMacroData(i.name,(i.body?i.body:""),i.params,l.getBookmark());
g=i.body;
function n(o){var p={width:"100%",height:"100%","ui-params":h.uiParams.encode({dlg:1})};
a.extend(p,i.params);
return a.ajax(o,{data:p})
}var m={header:i.params?k.editTitle:k.insertTitle,submitText:i.params?"Save":"Insert",chrome:true,key:k.addonKey,moduleKey:i.name,ns:k.addonKey+"__"+i.name,width:k.width||null,height:k.height||null};
f.create(m,false);
n(k.url).done(function(r){var p=a(r);
var o=p.find(".ap-content");
o.addClass("ap-dialog-container");
var q=a(document.getElementById(p.attr("id")));
if(q.length!=="0"){q.empty();
q.append(o);
q.append(p[1])
}else{console.error("AC macro: cannot locate existing container"+p.attr("id"))
}})
}};
return e
})
})(AJS.$,define);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.plugins.atlassian-connect-plugin:confluence-macro-v3', location = 'js/confluence/macro/property-panel-iframe.js' */
(function(a,b){b("ac/confluence/macro/property-panel-iframe",["connect-host","ac/confluence/macro","ajs"],function(e,c,d){return function(f){return{propertyPanelIFrameInjector:function(g){var h={"ui-params":e.uiParams.encode({dlg:1}),classifier:"property-panel"};
var i=d.Rte.getEditor().selection;
c.setLastSelectedConnectMacroNode(i.getNode());
a.ajax(f,{data:h}).done(function(k){var j=a(k);
j.css("display","none");
g.panel.append(j)
})
}}
}
})
})(AJS.$,define);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.plugins.atlassian-connect-plugin:confluence-macro-v3', location = 'js/confluence/macro/property-panel-controls.js' */
(function(a,b){b("ac/confluence/macro/property-panel-controls",["underscore"],function(d){var c;
return function(f){function e(h){try{return d.first(d.filter(d.pluck(h,f),d.isObject))
}catch(g){return null
}}return{getControls:function(g){c=c||WRM.data.claim("com.atlassian.plugins.atlassian-connect-plugin:confluence-macro.property-panel-controls");
g(e(c))
}}
}
})
})(AJS.$,define);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.plugins.atlassian-connect-plugin:confluence-macro-v3', location = 'js/confluence/macro/property-panel-event.js' */
(function(a,b){b("ac/confluence/macro/property-panel-event",["connect-host"],function(i){var g;
var e=[];
var c=".property-panel";
var d=function(j,k){return"click."+j+"."+k+".macro"+c
};
var f=function(k,j){if(e.length<10){e.push({eventKey:k,doneCallback:j})
}};
var h=function(k,j){i._addons.emitToAll(k);
j()
};
return{waitForPropertyPanelEventBindings:function(){g=false;
e=[]
},propertyPanelEventsBound:function(){g=true;
while(e.length>0){var j=e.shift();
h(j.eventKey,j.doneCallback)
}},handlePropertyPanelEvent:function(l,m,n){var j=a.Deferred();
if(l==="click"){var k=d(m,n);
if(g){h(k,j.resolve)
}else{f(k,j.resolve)
}}return j
},_getQueueLength:function(){return e.length
}}
})
})(AJS.$,define);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.plugins.atlassian-connect-plugin:confluence-macro-v3', location = 'js/confluence/macro/rpc.js' */
(function(b,a){a(["ac/confluence/macro/editor","ac/confluence/macro","ac/confluence/macro/property-panel-event","connect-host"],function(d,e,c,f){f.extend(function(){return{internals:{onMacroPropertyPanelEvent:c.propertyPanelEventsBound,saveMacro:e.saveCurrentMacro,closeMacroPropertyPanel:e.closeCurrentMacroPropertyPanel,closeMacroEditor:d.close,getMacroData:d.getMacroData,getMacroBody:d.getMacroBody}}
})
})
}(AJS.$,require));
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.plugins.atlassian-connect-plugin:macro-editor-resources', location = 'js/confluence/macro/metadata-cache.js' */
define("ac/confluence/macro/metadata-cache",[],function(){var a={};
return{getMetaData:function(b){if(a.hasOwnProperty(b)){return a[b]
}var c=WRM.data.claim(b);
a[b]=c;
return c
}}
});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.plugins.atlassian-connect-plugin:macro-editor-resources', location = 'js/confluence/macro/editor-override-no-transformer.js' */
require(["ac/confluence/macro/editor","confluence/macro-js-overrides","ac/confluence/macro/metadata-cache"],function(c,b,a){AJS.bind("init.rte",function(){var e=a.getMetaData("com.atlassian.plugins.atlassian-connect-plugin:macro-editor-resources.editorData");
for(var f in e){if(e.hasOwnProperty(f)){var d=e[f];
var g={width:d.WIDTH,height:d.HEIGHT,addonKey:d.ADDON_KEY,editTitle:d.EDIT_TITLE,insertTitle:d.INSERT_TITLE,url:AJS.params.contextPath+d.URL};
(function(h,i){b.assignFunction(h,{opener:function(j){j=$.extend({name:h},j);
c.openCustomEditor(j,i)
}})
})(f,g)
}}})
});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.plugins.atlassian-connect-plugin:macro-editor-resources', location = 'js/confluence/macro/property-panel-override-no-transformer.js' */
require(["ac/confluence/macro/property-panel-controls","ac/confluence/macro/property-panel-iframe","ac/confluence/macro/property-panel-event","confluence/macro-js-overrides","ac/confluence/macro/metadata-cache"],function(d,e,b,c,a){AJS.bind("init.rte",function(){var g=a.getMetaData("com.atlassian.plugins.atlassian-connect-plugin:macro-editor-resources.propertyPanelData");
for(var h in g){if(g.hasOwnProperty(h)){var f=AJS.params.contextPath+g[h].URL;
(function(j,i){c.assignFunction(j,e(i));
c.assignFunction(j,d(j));
c.assignFunction(j,b)
})(h,f)
}}})
});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-support-util', location = 'support/atlassian-editor-support.js' */
define("confluence-editor/support/atlassian-editor-support",["ajs","confluence/meta"],function(c,b){return{inlineTasks:function(){var a=b.get("use-inline-tasks");return"true"===a||!0===a},isCollaborativeContentType:function(){var a=b.get("content-type");return b.get("collaborative-content")&&("page"===a||"blogpost"===a)}}});require("confluence/module-exporter").exportModuleAsGlobal("confluence-editor/support/atlassian-editor-support","AJS.Rte.Support");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:page-editor-quit-dialog', location = 'editor/page-editor-quit-dialog.js' */
define("confluence-editor/editor/page-editor-quit-dialog","jquery confluence/templates ajs confluence/meta window document confluence-editor/editor/page-editor-message confluence/api/constants underscore confluence/legacy-editor-global-AVOID-IF-POSSIBLE".split(" "),function(e,l,c,g,v,G,m,w,x,d){function y(b){b.stopPropagation();b.preventDefault();c.trigger("analyticsEvent",{name:"confluence.synchrony.editor.quit-dialog.show-diff-clicked"});a.showDiffButton.hide();a.hideDiffButton.show();r()}function z(b){b.stopPropagation();
b.preventDefault();c.trigger("analyticsEvent",{name:"confluence.synchrony.editor.quit-dialog.hide-diff-clicked"});a.hideDiffButton.hide();a.showDiffButton.show();a.dialogEl.removeClass("aui-dialog2-xlarge").addClass("aui-dialog2-medium");j(n)}function A(b){c.trigger("analyticsEvent",{name:"confluence.synchrony.editor.quit-dialog.discard"});b.stopPropagation();b.preventDefault();d.UI.setButtonsState(false,a.buttonsAll);var h=g.get("content-id"),b=c.contextPath(),b=f?b+"/rest/synchrony/1.0/content/"+
h+"/changes/unpublished":b+"/rest/api/content/"+h+"?status=draft";f&&m.suppressMessage("editor.synchrony.revert-page");e.ajax({url:b,type:"DELETE",data:{draftId:h},contentType:"application/json",dataType:"json"}).done(function(){f&&m.handleMessage("collaborative-editor-discard-error",{type:"success",close:"auto",message:"Successfully reverted to the last published version"});c.trigger("analyticsEvent",{name:"confluence.synchrony.editor.quit-dialog.discard-success",data:{contentId:h}});s()}).fail(function(b){m.handleMessage("collaborative-editor-discard-error",
{type:"error",title:f?"Can\'t revert to last published version":"There were errors discarding your draft.",message:f?"We can\'t get the last published version of the page at the moment. Give it a few moments then try discarding the draft again.":b.errors||"An unknown error has occurred. Please check your logs."});c.trigger("analyticsEvent",{name:"confluence.synchrony.editor.quit-dialog.discard-error",data:{contentId:h}});d.UI.setButtonsState(true,a.buttonsAll)})}function s(){a.editorForm.append(l.Editor.Page.hiddenInputCancel()).submit()}function t(a){if(a){a.stopPropagation();
a.preventDefault()}s()}function B(b){d.UI.setButtonsState(false,a.buttonsAll);o.save(b)}function C(b){b.stopPropagation();b.preventDefault();c.trigger("analyticsEvent",{name:"confluence.synchrony.editor.draft-status-indicator.click"});p(function(){a.closeButton.show();r()})}function D(b){b.stopPropagation();b.preventDefault();a.dialog.hide()}function r(){a.dialogEl.removeClass("aui-dialog2-medium").addClass("aui-dialog2-xlarge");j(i.SHOW_DIFF);e.ajax({url:w.CONTEXT_PATH+"/rest/tinymce/1/content/"+
g.get("page-id")+"/draft/diff",type:"GET"}).success(function(b){a.dialogContent.find(".wiki-content").html(b).children().first().hasClass("diff-context-placeholder")&&a.dialogContent.find("hr").hide()})}function j(b){a.dialogHeader.html(l.Editor.Page.quitDialogHeader({dialogType:b}));a.dialogContent.html(l.Editor.Page.quitDialogContent({dialogType:b,contributors:k}));a.dialogFooter.find("."+b).show();a.dialog.show()}function E(){c.trigger("analyticsEvent",{name:"confluence.synchrony.editor.quit-dialog.dialog-closed"});
a.dialogEl.removeClass("aui-dialog2-xlarge").addClass("aui-dialog2-medium");d.UI.toggleSavebarBusy(false);a.dialogFooter.find(".aui-button").hide();a.dialogContent.empty()}function F(a,c){c&&c.contributors&&(k=x.reject(c.contributors,function(a){return a.name===g.get("remote-user")}))}function p(a){d.Drafts.save({forceSave:f,skipErrorHandler:true,onSuccessHandler:a||e.noop})}var a={},f,u,i={EXIT:"exit",PUBLISH:"publish",SHOW_DIFF:"diff"},k=[],q=false,o={},n;return{init:function(b){if(u=g.getBoolean("shared-drafts")&&
(g.get("content-type")==="page"||g.get("content-type")==="blogpost"))if(q){o.save=b.saveHandler;a.publishButton.click(B)}else{f=!g.get("new-page");a.discardButton=e("#qed-discard-button").tooltip({gravity:"s",className:"quit-editor-dialog"});if(d.isLimitedModeEnabled()&&f){d.UI.setButtonState(false,a.discardButton);a.discardButton.removeAttr("disabled")}else a.discardButton.click(A);a.saveExitButton=e("#qed-save-exit-button").click(t);a.showDiffButton=e("#qed-show-diff-button").click(y);a.hideDiffButton=
e("#qed-hide-diff-button").click(z);a.publishButton=e("#qed-publish-button");a.closeButton=e("#qed-close-button").click(D);a.buttonsAll=[a.discardButton,a.saveExitButton,a.showDiffButton,a.hideDiffButton,a.publishButton];a.dialog=c.dialog2("#quit-editor-dialog");a.dialogEl=a.dialog.$el;a.dialogHeader=a.dialogEl.find(".aui-dialog2-header");a.dialogContent=a.dialogEl.find(".aui-dialog2-content");a.dialogFooter=a.dialogEl.find(".aui-dialog2-footer");a.editorForm=e("#wysiwyg").closest("form");e("#pluggable-status").on("click",
"a",C);a.dialog.on("hide",E);c.bind("editor-heartbeat",F);q=true}},process:function(b){if(u){b.stopPropagation();b.preventDefault();e(v).one("editor-heartbeat",function(){switch(b.target.id){case d.UI.saveButton.attr("id"):case d.UI.versionCommentInput.attr("id"):d.UI.toggleSavebarBusy(true);if(k.length===0)o.save();else{p();f&&a.showDiffButton.show();j(i.PUBLISH);n=i.PUBLISH}break;case d.UI.cancelButton.attr("id"):if(d.Drafts.isDraftDirty()){p();f&&a.showDiffButton.show();d.UI.toggleSavebarBusy(true);
k.length===0?a.discardButton.html("Discard \u003cstrong\u003eall\u003c/strong\u003e changes"):a.discardButton.html("Discard \u003cstrong\u003eeveryone\'s\u003c/strong\u003e changes");j(i.EXIT);n=i.EXIT}else t()}});d.heartbeat()}},_destroy:function(){q=false}}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.reliablesave:reliable-save', location = 'templates/reliable-save.soy' */
// This file was automatically generated from reliable-save.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.Editor.Reliable.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.Editor == 'undefined') { Confluence.Templates.Editor = {}; }
if (typeof Confluence.Templates.Editor.Reliable == 'undefined') { Confluence.Templates.Editor.Reliable = {}; }


Confluence.Templates.Editor.Reliable.draftMessage = function(opt_data, opt_ignored) {
  var output = '<div id="draft-messages">';
  if (opt_data.isNewPage) {
    if (opt_data.existingDraft.title) {
      var escapedTitle__soy8 = '' + soy.$$escapeHtml(opt_data.existingDraft.title);
      output += soy.$$filterNoAutoescape(AJS.format('A new page you were adding on {0} called \x26#8216;{1}\x26#8217; was saved as a draft.',opt_data.existingDraft.date,escapedTitle__soy8));
    } else {
      output += soy.$$filterNoAutoescape(AJS.format('A new page you were adding on {0} was saved as a draft.',opt_data.existingDraft.date));
    }
    output += ' ' + soy.$$filterNoAutoescape(AJS.format('Do you want to {0}resume editing{1} or {2}discard{3} it?','<a href="#" class="use-draft"> ','</a>','<a href="#" class="discard-draft"> ','</a>'));
  } else {
    output += soy.$$filterNoAutoescape(AJS.format('A version of this page you were editing at {0} was saved as a draft.',opt_data.existingDraft.date)) + ((opt_data.mergeRequired) ? ' ' + soy.$$escapeHtml('The page has since been updated. Your changes will be merged with the latest version.') : '') + ((opt_data.conflictFound) ? ' ' + soy.$$filterNoAutoescape(AJS.format('The page has since been updated. The changes made conflict with your changes and cannot be merged. Do you want to {0}view the conflict{1} or {2}discard{3} your changes?','<a href="?pageId=' + opt_data.pageId + '&viewConflict=true&spaceKey=' + opt_data.spaceKey + '" >','</a>','<a href="#" class="discard-draft">','</a>','<a href="' + "/wiki" + '/users/viewmydrafts.action">','</a>')) : (opt_data.mergeRequired) ? ' ' + soy.$$filterNoAutoescape(AJS.format('Do you want to {0}view{1}, {2}merge and resume editing{3} or {4}discard{5} it?','<a id="view-diff-link-notification" href="#" class="view-diff-link">','</a>','<a href="#" class="use-draft"> ','</a>','<a href="#" class="discard-draft">','</a>')) : ' ' + soy.$$filterNoAutoescape(AJS.format('Do you want to {0}view the change{1}, {2}resume editing{3} or {4}discard{5} it?','<a id="view-diff-link-notification" href="#" class="view-diff-link">','</a>','<a href="#" class="use-draft"> ','</a>','<a href="#" class="discard-draft">','</a>')));
  }
  output += '</div>';
  return output;
};
if (goog.DEBUG) {
  Confluence.Templates.Editor.Reliable.draftMessage.soyTemplateName = 'Confluence.Templates.Editor.Reliable.draftMessage';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.reliablesave:reliable-save', location = 'js/reliable-save.js' */
define("confluence-editor-reliable-save/reliable-save","ajs confluence/templates underscore jquery window document confluence/api/constants confluence-editor/editor/page-editor-message confluence-editor/editor/page-editor-quit-dialog confluence/analytics-support confluence/legacy-editor-global-AVOID-IF-POSSIBLE".split(" "),function(a,k,l,d,t,H,o,b,z,q,h){function r(){return a.Meta.get("shared-drafts")}function s(){return a.Meta.getBoolean("new-page")}function u(j){var n="There was an error processing the request.";
b.closeMessages(["generic-error"]);b.handleMessage("generic-error",{type:"error",message:n},e);a.logError("Generic error: "+JSON.stringify(j))}function e(){var b=d("#draft-messages");if(b.length>0){b.is(":visible")&&q.publish("rte.notification.draft");b.find("a.use-draft").click(function(a){a.stopPropagation();a.preventDefault();h.Drafts.useDraft();q.publish("rte.notification.draft.resume")});b.find("a.discard-draft").click(function(b){b.stopPropagation();b.preventDefault();m.Draft.discardDraft(a.Meta.get("page-id"),
a.Meta.get("existing-draft-id")).done(m.Draft.onSuccessDiscardDraft).fail(m.Draft.onErrorDiscardDraft)})}}function E(){d("#editor-restore-title-link").click(function(j){j.stopPropagation();j.preventDefault();d("#content-title").val(a.Meta.get("latest-published-page-title"));b.closeMessages(["rename-during-limited-mode"])})}function v(j){var d="Looks like your session expired. Log in again to keep working.\n \u003cdiv\u003e\u003ca href=\"dashboard.action\" target=\"_blank\"\u003eLogin\u003c/a\u003e\u003c/div\u003e";b.closeMessages(["noauthorized"]);b.handleMessage("noauthorized",{title:"Can\'t connect to the server",
type:"error",message:d},e);j&&a.trigger("rte.safe-save.invalid-xsrf-token")}function A(){var d="Unable to communicate with server. Saving is not possible at the moment.";b.closeMessages(["server-offline"]);b.handleMessage("server-offline",{type:"error",message:d},e)}var B=[],w="confluence.editor.publish",m={Draft:{discardDraft:function(b,e){var h={draftId:e,pageId:b,type:a.Meta.get("draft-type"),spaceKey:a.Meta.get("space-key")};return d.ajax({type:"DELETE",url:o.CONTEXT_PATH+"/rest/tinymce/1/drafts/discard",data:d.toJSON(h),contentType:"application/json",
dataType:"json"})},onSuccessDiscardDraft:function(){s()||a.Meta.set("draft-id","0");b.closeMessages(["draft-message"]);b.handleMessage("discarding-successfull",{type:"info",message:"Your draft has been discarded.",close:"auto"},e);q.publish("rte.notification.draft.discard")},onErrorDiscardDraft:function(d){switch(d.status){case 403:v(true);break;case 404:b.handleMessage("draft-deleted",{type:"info",message:"This draft has been discarded."},e);break;case 422:b.handleMessage("discarding-invalid",
{type:"error",message:"This draft is invalid. It can be deleted by someone or looks like your session expired."},e);break;default:b.handleMessage("discarding-error",{type:"error",message:"An unknown error has occurred. Please check your logs."},e)}}},_internal:{}};m._internal.onSuccessfulResponse=function(b){d("#rte-button-overwrite").unbind("click.overwrite");var e={dataType:"json",contentId:a.Meta.get("content-id"),draftType:a.Meta.get("draft-type")};a.safe.post(o.CONTEXT_PATH+"/json/stopheartbeatactivity.action",e,function(){a.log("Stop heartbeat activity on",
e.draftType,"id",e.contentId)},"json").fail(function(b,d,e){a.logError("Server error on stop heartbeat activity request:");a.log(e)}).always(function(){var a=b._links.webui;a?t.location=a.indexOf("/")!==0?a:o.CONTEXT_PATH+a:h.UI.toggleSavebarBusy(false)})};m.initialize=function(){function j(c){function D(b){a.trigger("rte.safe-save.error",{status:b.status})}a.trigger("synchrony.stop",{id:w});c&&c.preventDefault();var i=d("#content-title");if(i.hasClass("placeholded")||i.val().trim()===""){a.trigger("rte.safe-save.error");
a.trigger("synchrony.start",{id:w});b.closeMessages(["title-too-long","duplicate-title"]);b.handleMessage("empty-title",{title:"This page needs a name",type:"error",message:"Add a page title before hitting publish."},e);h.UI.toggleSavebarBusy(false)}else{h.Drafts.unBindUnloadMessage();var f={},g=a.Meta.get("draft-id"),p=a.Meta.get("content-id"),c=o.CONTEXT_PATH+"/rest/api/content",k=d("#sourceTemplateId").val();f.status="current";f.title=i.val();f.space={key:a.Meta.get("space-key")};
var l=a.Rte.getEditor().getContent();B.forEach(function(a){l=a(l)});f.body={editor:{value:l,representation:"editor"}};if(k)f.extensions={sourceTemplateId:k};i=(i=h.UI.postingDatePicker)&&i.getDate();if(C.type==="blogpost"&&i&&i.toISOString)f.history={createdDate:i.toISOString()};if(s()&&!a.Meta.get("shared-drafts")){i="POST";a.Meta.get("is-blueprint-page")&&(c=c+"/blueprint/instance/"+g);c=c+"?status=draft";f.id=g;f.type=a.Meta.get("content-type");f.body.editor.content={id:g}}else{i="PUT";s()&&a.Meta.get("is-blueprint-page")&&
(c=c+"/blueprint/instance");c=c+"/"+p;if(s()&&r()){f.id=g;f.body.editor.content={id:g}}else{f.id=a.Meta.get("page-id");f.body.editor.content={id:a.Meta.get("page-id")}}c=g==="0"?c+"?status=current":c+"?status=draft";g=a.Meta.getNumber("page-version")||0;f.type=a.Meta.get("content-type");f.version={number:g+1,message:d("#versionComment").val(),minorEdit:d("#notifyWatchers").is(":checked")?false:true,syncRev:d("#syncRev").val()}}g={};g.id=a.Meta.get("parent-page-id")||"0";g.type=a.Meta.get("content-type");
p=a.Meta.get("parent-page-id");if(!p||f.space.key!==a.Meta.get("space-key"))g.id="0";if(p&&g.id!==p)g.id=d("#parentPageString").val()===a.Meta.get("from-page-title")?g.id:p;if(g.id!=="0")f.ancestors=[g];d.ajax({type:i,url:c,contentType:"application/json; charset=utf-8",dataType:"json",data:JSON.stringify(f),success:function(b){(f.type==="page"||f.type==="blogpost")&&a.trigger("analytics",{name:"confluence.editor.close",data:{source:"publishButton"}});a.trigger("rte.safe-save.success",b);m._internal.onSuccessfulResponse(b)},
error:function(c){var g=false;h.UI.toggleSavebarBusy(false);switch(c.status){case 400:b.closeMessages(["empty-title","duplicate-title","title-too-long","legacy-draft-deprecated"]);if(c.responseText.indexOf(n.duplicatedTitle)>=0)b.handleMessage("duplicate-title",{type:"error",message:a.format("A page with the title \'\'{0}\'\' already exists in this space. Enter a different title for your page.",a.escapeHtml(d("#content-title").val()))});else if(c.responseText.indexOf(n.titleTooLong)>=0)b.handleMessage("title-too-long",{type:"error",message:"Title cannot be longer than 255 characters."},
e);else if(c.responseText.indexOf(n.publishNewDraftDeprecated)>=0||c.responseText.indexOf(n.existingDraftNotFound)>=0)if(a.Meta.get("new-page")&&r()&&!h.hasContentChanged()){a.trigger("rte.legacy-draft-can-be-migrated");b.handleMessage("legacy-draft-deprecated",{type:"error",message:a.format("Collaborative editing is here! So that you can keep working on this page, we need to migrate the content to a new draft for you.\u003cbr\u003e \u003ca href={0}\u003eMigrate now\u003c/a\u003e",o.CONTEXT_PATH+"/pages/resumedraft.action?draftId="+a.Meta.get("draft-id"))},e)}else{a.trigger("rte.legacy-draft-cannot-be-migrated");b.handleMessage("legacy-draft-deprecated",
{type:"error",message:"Collaborative editing is here! That means we need a little help from you to restart your editing session. All you need to do is copy the content, edit this page again, then paste it in and save."},e)}else u(c);break;case 403:v(true);break;case 404:b.closeMessages(["page-not-accessible","noauthorized"]);b.handleMessage("page-not-accessible",{title:"This content cannot be accessed.",type:"error",message:a.format("Your session may have expired, you can attempt to \u003ca href=\"dashboard.action\" target=\"_blank\"\u003elog in\u003c/a\u003e.",f.space.key)},e);break;case 409:if(r()){g=true;if(x<F){x++;y.push(setTimeout(function(){j()},G))}else{a.trigger("analyticsEvent",{name:"editor.save.error.conflict"});
x=0;b.handleMessage("page-conflict",{title:"Can\'t sync with the server.",type:"error",message:a.format("Refresh the page to try to re-establish the connection.",f.space.key)},e);D(c)}}else{h.restoreDefaultSave();h.UI.saveButton.click()}break;case 410:b.closeMessages(["page-deleted"]);b.handleMessage("page-deleted",{title:"This content has been deleted",type:"error",message:a.format("Copy your content, then add it to a new page or \u003cdiv\u003e\u003ca href=\"viewtrash.action?key={0}\" target=\"_blank\"\u003erestore this page from the trash\u003c/a\u003e and try again.\u003c/div\u003e",f.space.key)},e);break;case 413:b.closeMessages(["page-too-big"]);b.handleMessage("page-too-big",
{type:"error",message:"This page is too big to save. You could split it into multiple pages, then use the \u003ca href=\"https://confluence.atlassian.com/conf51/include-page-macro-336169384.html\" target=\"_blank\"\u003einclude page macro\u003c/a\u003e to display the content."},e);break;case 0:case 500:case 503:for(;y.length;)clearTimeout(y.shift());A();break;case 501:c.responseText.indexOf(n.renameDuringLimitedMode)>=0?b.handleMessage("rename-during-limited-mode",{type:"error",message:"Changing page titles isn\'t possible right now, as collaborative editing is offline. \u003cdiv\u003e\u003ca id=\"editor-restore-title-link\" href=\"#\"\u003eRestore the page title\u003c/a\u003e if you\'d like to publish the page.\u003c/div\u003e"},E):u(c);break;default:u(c)}g||D(c);a.trigger("synchrony.start",{id:w})}})}}if(!(d("#editpageform").length===0&&d("#createpageform").length===0)){var n={duplicatedTitle:"A page with this title already exists",
titleTooLong:"Title cannot be longer than 255 characters.",publishNewDraftDeprecated:"Unsupported call to publishNewDraft",existingDraftNotFound:"Could not find existing draft, perhaps you're trying to publish a personal draft?",renameDuringLimitedMode:"Unable to perform a page rename when limited mode is enabled"},C={existingDraftId:a.Meta.get("existing-draft-id")?a.Meta.get("existing-draft-id"):0,pageId:a.Meta.get("page-id"),type:a.Meta.get("draft-type"),spaceKey:a.Meta.get("space-key")};if(a.Meta.get("show-draft-message")===
true){if(d("#conflict-diffs").length>0)return;d.ajax({type:"GET",url:o.CONTEXT_PATH+"/rest/tinymce/1/drafts/message",data:C,contentType:"application/json",dataType:"text json",success:function(c){if(c&&c.draftData){c=k.Editor.Reliable.draftMessage({existingDraft:c.draftData,conflictFound:c.conflictFound,mergeRequired:c.mergeRequired,isNewPage:c.newPage,pageId:a.Meta.get("page-id"),spaceKey:a.Meta.get("space-key")});b.handleMessage("draft-message",{type:"info",message:c},e)}}})}var t=d("#editor-notifications-container #all-messages .aui-message-error").length>
0;if(r()){z.init({saveHandler:j});h.overrideSave(z.process)}else t?h.restoreDefaultSave():h.overrideSave(j);d("#rte-button-overwrite").bind("click.overwrite",function(a){q.publish("confluence.editor.legacy.draft.conflict",{action:"clickOverwrite"});j(a)});var x=0,F=3,G=1E3,y=[];a.bind("rte.heartbeat-error",function(c,d){switch(d.status){case 401:case 403:b.isDisplayed(["page-not-accessible"])||v(false);break;case 0:case 404:case 500:case 503:h.metadataSyncRequired()||A();break;default:a.logError("Heartbeat action error: "+
JSON.stringify(d))}});a.bind("rte.heartbeat",function(){var c=false;l.each(b.displayedErrors(),function(a){if(l.contains(["noauthorized","server-offline","page-not-accessible"],a)){c=true;b.closeMessages([a])}});c&&b.handleMessage("reconnect",{type:"info",title:"Successfully reconnected",message:"We\'re back in business. You\'re free to save your page again.",close:"auto"},e)})}};m.registerCleanupFunction=function(a){B.push(a)};return m});
require("confluence/module-exporter").safeRequire("confluence-editor-reliable-save/reliable-save",function(a){var k=require("ajs"),l=0<window.document.referrer.indexOf("createDialog=true&flashId");k.DarkFeatures.isEnabled("editor.ajax.save")&&!(""===k.Meta.get("remote-user")||l)&&k.bind("rte.init.ui",function(){a.initialize();Confluence.Editor=Confluence.Editor||{};Confluence.Editor.SafeSave=Confluence.Editor.SafeSave||{};Confluence.Editor.SafeSave.Draft=a.Draft;Confluence.Editor.SafeSave._internal=
a._internal||{}})});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.reliablesave:reliable-save', location = 'js/ajax-login.js' */
define("confluence-editor-reliable-save/ajax-login",["confluence/dark-features","confluence/meta","ajs","jquery","document"],function(d,c,f,g,u){return function(){function v(c,j){var a=q.call(g,c,j),d=c&&c.url;if(r&&(!j||j&&!j.preventAjaxLogin)&&d&&(l&&0===d.indexOf(l)||k&&0===d.indexOf(k))){var t=function(a,d,w,l){function k(){b.readyState=a.readyState;b.status=a.status;b.statusText=a.statusText;a.responseXML?b.responseXML=a.responseXML:b.responseText=a.responseText;d.apply(w,l)}var n=a.getResponseHeader("X-AUSERNAME");
r===n?k():(m.push({deferred:e,url:c,settings:j,defaultCallback:k}),o||(p=!1,h||(h=new f.Dialog(840,700),h.addPanel("ajax-login","ajax-login-content","ajax-login-panel",1),n=g(".ajax-login-panel"),i=g("<iframe></iframe>"),i.bind("load",function(){var a=i[0].contentDocument.location.pathname;a&&0<=a.indexOf("/"+s)&&(o=!1,p=!0,h.hide(),i.attr("src","about:blank"))}),n.append(i),g(u).bind("hideLayer",function(a,b,d){if("popup"===b&&d===h.popup){f.debug("hiding login dialog");if(p){a=m;b=0;for(d=a.length;b<
d;b++){var c=a[b];f.debug("Rerunning ajax query to: "+c.url,c);q.call(g,c.url,c.settings).done(function(){f.debug("Rerunning done");c.deferred.resolve(arguments)}).fail(function(){f.debug("Rerunning failed");c.deferred.reject(arguments)})}}else{a=m;b=0;for(d=a.length;b<d;b++){var e=a[b];f.debug("Executing with original response for: "+e.url,e);e.defaultCallback&&e.defaultCallback()}}m=[]}})),i.attr("src",x),h.show(),o=!0))};f.debug("Using authenticatingPromise");var b={abort:function(){a.abort.apply(a,
arguments)},getAllResponseHeaders:function(){a.getAllResponseHeaders.apply(a,arguments)},getResponseHeader:function(){a.getResponseHeader.apply(a,arguments)},overrideMimeType:function(){a.overrideMimeType.apply(a,arguments)},readyState:a.readyState,setRequestHeader:function(b,c){a.setRequestHeader.apply(a,arguments)},state:function(){a.state.apply(a,arguments)},status:a.status,statusCode:function(){a.statusCode.apply(a,arguments)},statusText:a.statusText},e=g.Deferred();e.promise(b);b.success=b.done;
b.error=b.fail;a.done(function(a,b,c){t(c,e.resolve,e,arguments)});a.fail(function(a,b,c){t(a,e.reject,e,arguments)});return b}return a}if(d.isEnabled("ajax.login")){f.debug("AJAX login support enabled");var o=!1,h,i,p,m=[],q=g.ajax,r=c.get("remote-user"),l=c.get("base-url"),k=c.get("context-path"),s="ajaxlogincomplete.action",x=c.get("context-path")+"/login.action?os_destination=%2F"+s;g.ajax=v}}});require("confluence/module-exporter").safeRequire("confluence-editor-reliable-save/ajax-login",function(d){require("ajs").toInit(d)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-collaborative-editor-plugin:confluence-collaborative-editor-plugin-resources', location = '/template/synchrony-presence.soy' */
// This file was automatically generated from synchrony-presence.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.SynchronyPresence.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.SynchronyPresence == 'undefined') { Confluence.Templates.SynchronyPresence = {}; }


Confluence.Templates.SynchronyPresence.container = function(opt_data, opt_ignored) {
  return '<ul id="avatar-list" class="synchrony-doc-' + soy.$$escapeHtml(opt_data.docId) + ' collaborative-avatars-list"></ul><aui-inline-dialog id="more-avatars" alignment="bottom right" responds-to="toggle" aria-hidden="true"><h3>' + soy.$$escapeHtml('Also edited') + '</h3><ul id="more-avatars-list" class="collaborative-avatars-list"></ul></aui-inline-dialog>';
};
if (goog.DEBUG) {
  Confluence.Templates.SynchronyPresence.container.soyTemplateName = 'Confluence.Templates.SynchronyPresence.container';
}


Confluence.Templates.SynchronyPresence.avatar = function(opt_data, opt_ignored) {
  return '<li class="avatar-item' + ((opt_data.active) ? ' p' + soy.$$escapeHtml(opt_data.telepointer) + ' active' : '') + '"><span title="' + soy.$$escapeHtml(opt_data.fullname) + ' ' + ((opt_data.active) ? soy.$$escapeHtml('is editing this page.') : soy.$$escapeHtml('has made changes that haven\x27t been published.')) + '" avatar="' + soy.$$escapeHtml(opt_data.initial) + '"' + ((opt_data.active) ? ' data-origin="' + soy.$$escapeHtml(opt_data.origin) + '"' : '') + ' class="avatar' + ((opt_data.active) ? ' active' : '') + '"><img src="' + soy.$$escapeHtml(opt_data.avatarUrl) + '"></span></li>';
};
if (goog.DEBUG) {
  Confluence.Templates.SynchronyPresence.avatar.soyTemplateName = 'Confluence.Templates.SynchronyPresence.avatar';
}


Confluence.Templates.SynchronyPresence.overlay = function(opt_data, opt_ignored) {
  return '<span id="synchrony-presence-overlay" class="overlay avatar"><a href="#" aria-controls="more-avatars" class="aui-button" data-aui-trigger></a></span>';
};
if (goog.DEBUG) {
  Confluence.Templates.SynchronyPresence.overlay.soyTemplateName = 'Confluence.Templates.SynchronyPresence.overlay';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-collaborative-editor-plugin:confluence-collaborative-editor-plugin-resources', location = '/js/synchrony-presence.js' */
define("confluence-collaborative-editor-plugin/synchrony-presence","backbone confluence-collaborative-editor-plugin/avatar-list-view confluence-collaborative-editor-plugin/overlay-view ajs confluence/meta confluence/templates jquery underscore".split(" "),function(i,r,n,e,o,s,j,f){function k(){var d=[];b.each(function(a){!a.get("active")&&!f.some(g,function(b){return a.get("id")===b.name})&&d.push(a)});f.each(d,function(a){b.remove(a)});f.each(g,function(a){if(!(a.name===o.get("remote-user")||b.any(function(b){return b.get("id")===
a.name||b.get("name")===a.name}))){a.active=false;a.id=a.name;b.add(a)}})}var b=new i.Collection,p=false,q="",h,g=[];return{appendTo:function(d,a,i,l,t){q=d;d=null;if(!p){h=h||require("tinymce");if(!l){e.log("synchronyPresence error: specify a valid container.");return}p=true;d=j(s.SynchronyPresence.container({docId:i}));j(l).append(d);new r({el:"#avatar-list",collection:b});var m=new n({collection:b});j(l).append(m.render());g=t;k();e.bind("editor-heartbeat",function(b,c){if(f.isArray(c.contributors)){g=
c.contributors;k()}});a.on("presence",function(a){m.hideInlineDialog();a.joined.filter(function(c){return c.origin!==q}).forEach(function(c){c.id=c.origin;c.fullname=c.fullname||"Anonymous";c.name=c.name||"anonymous";c.avatarURL=e.contextPath()+c.avatarURL;c.active=true;var a=b.findWhere({active:false,id:c.name});a&&b.remove(a);b.add(c,{at:b.filter(function(a){return a.get("active")}).length})});a.left.forEach(function(a){a.id=a.origin;b.remove(a);k()});e.trigger("analyticsEvent",
{name:"confluence.synchrony.user.in.session",data:{numOtherUsers:b.length,draftId:o.get("draft-id")}})});h.EditorManager.activeEditor.onClick.add(f.bind(n.prototype.hideInlineDialog,m))}return d},setTinyMce:function(b){h=b}}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-collaborative-editor-plugin:confluence-collaborative-editor-plugin-resources', location = '/js/avatar-list-view.js' */
define("confluence-collaborative-editor-plugin/avatar-list-view",["backbone","confluence-collaborative-editor-plugin/avatar-view","ajs","jquery","underscore"],function(d,e,c,g,f){return d.View.extend({initialize:function(){this.collection.on("add",this.addAvatar,this);this.collection.on("remove",this.removeAvatar,this);this.collection.each(this.addAvatar,this)},addAvatar:function(a){var b=new e({model:a});a.get("active")?(c.log(a.get("fullname")+" joined. ("+a.get("origin")+")"),a=this.$el.find("li.active").last(),
b=a.length?b.render().insertAfter(a):b.render().prependTo(this.$el)):b=b.render().appendTo(this.$el);a=function(a){a.addClass("show");a.children(".avatar").tooltip({fade:true,gravity:"ne"})};6===this.collection.length?a(b):f.defer(a,b);this._manageOverlayClass()},removeAvatar:function(a){a.get("active")&&c.log(a.get("fullname")+" left. ("+a.get("origin")+")");this._manageOverlayClass()},_manageOverlayClass:function(){var a=this.collection.length;this.collection.each(function(b,c){b.set("hidden",5<
a&&4<=c)});5<a?this.$el.addClass("has-overlay"):this.$el.removeClass("has-overlay")}})});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-collaborative-editor-plugin:confluence-collaborative-editor-plugin-resources', location = '/js/avatar-view.js' */
define("confluence-collaborative-editor-plugin/avatar-view",["backbone","ajs","confluence/templates","jquery"],function(e,g,f,d){return e.View.extend({initialize:function(){this.model.on("remove",this.remove,this)},render:function(){return this.$el=d(f.SynchronyPresence.avatar({fullname:this.model.get("fullname"),initial:this.model.get("fullname").charAt(0).toUpperCase(),avatarUrl:this.model.get("avatarURL"),origin:this.model.get("origin"),active:this.model.get("active"),telepointer:this._synchronyTelepointerId()}))},
remove:function(){this.$el.removeClass().addClass("avatar-item animate");this.model.get("hidden")||this.$el.addClass("removing");this.$el.one(this._getSupportedTransition(),function(){d(this).removeClass("animate removing");d(this).remove()})},_getSupportedTransition:function(){var c={transition:"transitionend",MozTransition:"transitionend",OTransition:"oTransitionEnd",MsTransition:"msTransitionEnd",WebkitTransition:"webkitTransitionEnd"},a=document.createElement("_"),b;for(b in c)if(void 0!==a.style[b])return c[b]},
_synchronyTelepointerId:function(){for(var c=""+(this.model.get("sub")||this.model.get("origin")||""),a=0,b=0;b<c.length;b++)a=(a<<5)-a+c.charCodeAt(b),a&=a;return Math.abs(a)%10}})});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-collaborative-editor-plugin:confluence-collaborative-editor-plugin-resources', location = '/js/overlay-view.js' */
define("confluence-collaborative-editor-plugin/overlay-view","backbone aui/inline-dialog2 confluence-collaborative-editor-plugin/avatar-view confluence/templates ajs jquery underscore".split(" "),function(c,g,d,e,f,b){return c.View.extend({initialize:function(){this.collection.on("add remove",this.reconcile,this);this.inlineDialog2=document.querySelector("#more-avatars")},render:function(){this.$el=b(e.SynchronyPresence.overlay());this.$el.children("a").tooltip({fade:true,gravity:"ne"});this.$el.on("click",
function(){b(".tipsy").remove()});return this.$el},reconcile:function(){var a=this.collection.where({hidden:true});if(a.length>0){this.$el.addClass("show");this.$el.children(".aui-button").html("+"+a.length).attr("title",a.length+" "+"other users are editing.");b("#more-avatars-list").children().remove();a.forEach(function(a){a=new d({model:a});b("#more-avatars-list").append(a.render())})}else{this.$el.removeClass("show");this.hideInlineDialog()}},hideInlineDialog:function(){if(this.inlineDialog2&&
this.inlineDialog2.isVisible&&this.inlineDialog2.isVisible())this.inlineDialog2.open=false}})});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-collaborative-editor-plugin:confluence-collaborative-editor-plugin-resources', location = '/template/status-indicator.soy' */
// This file was automatically generated from status-indicator.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.CollaborativeEditor.StatusIndicator.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.CollaborativeEditor == 'undefined') { Confluence.Templates.CollaborativeEditor = {}; }
if (typeof Confluence.Templates.CollaborativeEditor.StatusIndicator == 'undefined') { Confluence.Templates.CollaborativeEditor.StatusIndicator = {}; }


Confluence.Templates.CollaborativeEditor.StatusIndicator.container = function(opt_data, opt_ignored) {
  return '<div class="synchrony-status-indicator"><div class="status-indicator-icon aui-icon aui-icon-small' + ((opt_data.error) ? ' aui-iconfont-warning' : (opt_data.saving) ? ' aui-iconfont-devtools-task-in-progress' : ' aui-iconfont-approve') + '" data-tooltip="' + soy.$$escapeHtml(opt_data.tooltipMessage) + '"></div><div class="status-indicator-message" data-tooltip="' + soy.$$escapeHtml(opt_data.tooltipMessage) + '">' + ((opt_data.error || opt_data.saving) ? soy.$$escapeHtml(opt_data.statusMessage) : (opt_data.isReadyToGo) ? soy.$$escapeHtml(opt_data.statusMessage) : '<a href="#">' + soy.$$escapeHtml(opt_data.statusMessage) + '</a>') + '</div></div>';
};
if (goog.DEBUG) {
  Confluence.Templates.CollaborativeEditor.StatusIndicator.container.soyTemplateName = 'Confluence.Templates.CollaborativeEditor.StatusIndicator.container';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-collaborative-editor-plugin:confluence-collaborative-editor-plugin-resources', location = '/js/status-indicator-view.js' */
define("confluence-collaborative-editor-plugin/status-indicator-view",["confluence/templates","backbone","ajs","jquery","underscore"],function(e,f,c,g,d){return f.View.extend({initialize:function(){this.$el.addClass("synchrony");this.listenTo(this.model,"change:saving change:error",this.render);this.model.set("confluenceUnreachable",!1);this.model.set("synchronyUnreachable",!1);this.model.set("tokenExpired",!1);c.bind("rte.heartbeat",d.bind(this.onConfluenceConnectedState,this));c.bind("rte.safe-save.error",
d.bind(this._errorPublishing,this));c.bind("rte.preview.error",d.bind(this._errorPublishing,this));this.model.set("connecting",!0);this._setProgressState()},render:function(){g(".tipsy").remove();this.$el.html(e.CollaborativeEditor.StatusIndicator.container(this.model.attributes))},onConnectedState:function(a){this.model.set("synchronyUnreachable",!1);if(!this.model.has("synchronyEntity")){this.model.set("synchronyEntity",a);var b=this;this.model.get("synchronyEntity").on("update",function(a){b._handleSynchronyUpdateEvent(a,
b)});this.model.get("synchronyEntity").on("ack",function(a){b._handleSynchronyAckEvent(a,b)})}this._setSavedState()},onDisconnectedState:function(){this.model.set("synchronyUnreachable",!0);this.model.set("connecting",!0);this._setErrorState()},onConfluenceConnectedState:function(){this.model.get("confluenceUnreachable")&&(this.model.set("confluenceUnreachable",!1),this._setSavedState())},onConfluenceDisconnectedState:function(){this.model.set("confluenceUnreachable",!0);this.model.set("connecting",
!0);this._setErrorState()},onTokenRenewedState:function(){this.model.get("tokenExpired")&&(this.model.set("tokenExpired",!1),this._setSavedState())},onTokenExpiredState:function(){this.model.set("tokenExpired",!0);this.model.set("connecting",!0);this._setErrorState()},_handleSynchronyUpdateEvent:function(a,b){"local"===a.updateType&&(b.model.set("pendingChanges",!0),b._saving())},_handleSynchronyAckEvent:function(a,b){var c=0<a.pending.length;b.model.set("pendingChanges",c);c||b.model.set("lastSavedTime",
(new Date).getTime())},_saving:function(){var a=this,b=function(){setTimeout(function(){a.model.get("pendingChanges")||(new Date).getTime()-a.model.get("lastSavedTime")<a.model.get("minActiveTime")?b():a._setSavedState()},a.model.get("minActiveTime"))};this.model.get("saving")||(this.model.set("connecting",!1),this._setProgressState(),b())},_reachable:function(){return!this.model.get("confluenceUnreachable")&&!this.model.get("synchronyUnreachable")&&!this.model.get("tokenExpired")},_errorPublishing:function(a,
b){switch(b.status){case 0:this.onConfluenceDisconnectedState();break;case 500:case 503:this.onConfluenceDisconnectedState()}},_setSavedState:function(){this._reachable()?(this.model.set("statusMessage",this.model.get("connecting")?"Ready to go":"Changes saved"),this.model.set("isReadyToGo",this.model.get("connecting")?!0:!1),this.model.set("tooltipMessage","We\'re automatically saving all of your changes in a draft. Click to view changes."),this.model.set("connecting",!1),this.model.set("saving",
!1),this.model.set("error",!1)):this._setErrorState()},_setErrorState:function(){this.model.set("statusMessage","Can\'t save changes");this.model.set("tooltipMessage","Can\'t reach the server. Check your internet connection, and we\'ll keep trying to reconnect you.");this.model.set("saving",!1);this.model.set("error",!0)},_setProgressState:function(){this._reachable()?(this.model.set("statusMessage",this.model.get("connecting")?"Connecting...":"Saving changes"),this.model.set("tooltipMessage",
"We\'re automatically saving all of your changes in a draft. Click to view changes."),this.model.set("saving",!0),this.model.set("error",!1)):this._setErrorState()}})});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-collaborative-editor-plugin:confluence-collaborative-editor-plugin-resources', location = '/js/initialise-metrics.js' */
define("confluence-collaborative-editor-plugin/initialise-metrics",["confluence/performance-session"],function(a){return function(){a.register("confluence.editor.quickedit.loading.times",{"confluence.editor":!0,"confluence.editor.preload":!0,"confluence.editor.quick.fetchContent":!0,"confluence.editor.tinymce":!0,"confluence.editor.synchrony":!0,"confluence.editor.synchrony.CR":!0,"confluence.editor.synchrony.connect":!0,"confluence.editor.synchrony.deps":!0,"confluence.editor.synchrony.init":!0,
"confluence.editor.synchrony.jsLoad":!0,"confluence.editor.synchrony.snapshot":!0,"confluence.editor.synchrony.unmarshal":!0},{"confluence.editor.synchrony.connect":!0})}});require("confluence/module-exporter").safeRequire("confluence-collaborative-editor-plugin/initialise-metrics",function(a){a()});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-collaborative-editor-plugin:confluence-collaborative-editor-plugin-resources', location = '/js/sync-manager.js' */
define("confluence-collaborative-editor-plugin/sync-manager",["ajs","jquery"],function(d,e){var f=["id"],g={START_SYNCHRONIZING_EVENT_NAME:"start",STOP_SYNCHRONIZING_EVENT_NAME:"stop",MAX_CONSECUTIVE_AUTO_RECOVERY_TRIGGERED:10,MAX_WAIT_TIME_TO_RESTART:3E4,DEBUG_MODE:!1},b=function(a,c){this.entity=a;this.settings=e.extend({},g,c||{});this.controlSyncState={};this.recoveryTimeoutTasks={};var b=function(a,c,b){f.every(function(a){return"undefined"!==typeof b[a]})?a(b):this.displayLogMessage("Invalid payload, missing required params",
c,b)};d.bind("synchrony."+this.settings.START_SYNCHRONIZING_EVENT_NAME,b.bind(this,this.enableSynchronization.bind(this)));d.bind("synchrony."+this.settings.STOP_SYNCHRONIZING_EVENT_NAME,b.bind(this,this.disableSynchronization.bind(this)))};b.prototype.getOrCreateControlSyncState=function(a){return this.controlSyncState[a]=this.controlSyncState[a]||{DISABLED_SYNC_STATUS:!1,RECOVERY_TIMER_RUNNING:!1,CONSECUTIVE_AUTO_RECOVERY_TRIGGERED:0}};b.prototype.enableDebug=function(a){this.settings.DEBUG_MODE=
"undefined"!==typeof a?a:!0};b.prototype.displayLogMessage=function(){if(this.settings.DEBUG_MODE){var a=Array.prototype.slice.call(arguments);a.splice(0,0,"DEBUG: "+(new Date).toLocaleTimeString());console.log.apply(console,a)}};b.prototype.disableSynchronization=function(a){var c=a.id;this.getOrCreateControlSyncState(c).DISABLED_SYNC_STATUS=!0;this.clearAutoRecoveryTimer(c);this.setAutoRecoveryTimer(a);this.entity.stop(c);this.displayLogMessage("Stoping entity synchronization",c,e.extend(!0,{},
this.controlSyncState))};b.prototype.enableSynchronization=function(a){a=a.id;this.getOrCreateControlSyncState(a).DISABLED_SYNC_STATUS=!1;this.clearAutoRecoveryTimer(a);this.entity.start(a);this.displayLogMessage("Starting entity synchronization",a,e.extend(!0,{},this.controlSyncState))};b.prototype.clearAutoRecoveryTimer=function(a){var c=this.getOrCreateControlSyncState(a);clearTimeout(this.recoveryTimeoutTasks[a]);delete this.recoveryTimeoutTasks[a];c.RECOVERY_TIMER_RUNNING=!1};b.prototype.setAutoRecoveryTimer=
function(a){var c=a.id,b=this.getOrCreateControlSyncState(c);b.RECOVERY_TIMER_RUNNING=!0;this.recoveryTimeoutTasks[c]=setTimeout(function(){this.displayLogMessage("Auto recovery has been triggered",c);this.clearAutoRecoveryTimer(c);b.DISABLED_SYNC_STATUS=!1;b.RECOVERY_TIMER_RUNNING=!1;b.CONSECUTIVE_AUTO_RECOVERY_TRIGGERED++;d.trigger("analyticsEvent",{name:"confluence.synchrony.syncmanager.failed-to-restart",data:{id:c}});b.CONSECUTIVE_AUTO_RECOVERY_TRIGGERED>=this.settings.MAX_CONSECUTIVE_AUTO_RECOVERY_TRIGGERED&&
(this.displayLogMessage("Auto recovery has been triggered too many times for the same action",c,this.controlSyncState[c].CONSECUTIVE_AUTO_RECOVERY_TRIGGERED),d.trigger("analyticsEvent",{name:"confluence.synchrony.syncmanager.consecutive-failed-to-restart",data:{id:c}}));this.entity.start(c)}.bind(this),a.maxWaitTimeToRestart||this.settings.MAX_WAIT_TIME_TO_RESTART)};return b});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-collaborative-editor-plugin:confluence-collaborative-editor-plugin-resources', location = '/js/telepointer-cleaner.js' */
define("confluence-collaborative-editor-plugin/telepointer-cleaner",["confluence-editor-reliable-save/reliable-save","jquery"],function(a,c){a.registerCleanupFunction(function(a){var b=c("<div>");b.append(a);b.find(".synchrony-container, .synchrony-tp").remove();return b.html()})});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-collaborative-editor-plugin:confluence-collaborative-editor-plugin-resources', location = '/js/editor-blanket.js' */
define("confluence-collaborative-editor-plugin/editor-blanket",["ajs","jquery","confluence/meta","confluence-editor/support/atlassian-editor-support"],function(j,a,k,h){var c,d,e;function f(b){switch(b){case "block":c="editor-block";d="aria-disabled";e="";break;default:c="editor-loading editor-loading-spinner",d="aria-busy",e="editor-loading"}b=a("#editpageform, #createpageform");b.addClass(c);b.attr(d,!0);a("#content-title").attr("tabindex",-1);a("#wysiwygTextarea_ifr").attr("tabindex",-1);a(".aui-toolbar2-primary").addClass(e)}
function i(){var b=a("#editpageform, #createpageform");b.removeClass(c);b.attr(d,!1);a("#rte").css("opacity",1).addClass("editor-blanket-ease-in");a("#content-title").attr("tabindex",1);a("#wysiwygTextarea_ifr").attr("tabindex",100);a("#content-title-div").css("opacity",1).addClass("editor-blanket-ease-in");a(".aui-toolbar2-primary").removeClass(e);e=d=c=void 0}function g(){a("#rte").css("opacity",1);a("#content-title-div").css("opacity",1)}e=d=c=void 0;return{applyBlanket:function(a){h.isCollaborativeContentType()&&
"pending"===a.state()?(f(),a.done(i)):g()},showEditor:g,showBlanket:f}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-collaborative-editor-plugin:confluence-collaborative-editor-plugin-resources', location = '/js/synchrony-auth.js' */
define("confluence-collaborative-editor-plugin/synchrony-auth",["jquery","ajs","confluence/meta","confluence/get-content-id","confluence-collaborative-editor-plugin/synchrony-util"],function(i,d,j,k,f){function g(b){var c=i.Deferred(),a;if(a=!b)a=parseInt(f.retrieveMetadata("synchrony-expiry")),a=isNaN(a)?!1:a>Date.now()/1E3;a?c.resolve(f.retrieveMetadata("synchrony-token")):(d.log("["+new Date+"] Synchrony JWT expired or invalid, retrieving new token."),f.time("confluence.editor.synchrony.token"),
a=b&&b.errorType?"?errorType="+b.errorType:"",i.ajax({dataType:"json",method:"GET",url:encodeURI(d.contextPath()+"/rest/synchrony/1.0/token/"+k()+"/generate"+a)}).done(function(a){j.set("synchrony-token",a.synchronyToken);j.set("synchrony-expiry",a.synchronyExpiry);h=0;c.resolve(a.synchronyToken);e&&(e.onConfluenceConnectedState(),e.onTokenRenewedState());d.trigger("dismiss.editor.error.message",{messageKey:"synchrony-token-expired",enablePublish:!0});d.debug("Synchrony JWT token updated.");f.timeEnd("confluence.editor.synchrony.token")}).fail(function(){h++;
10<=h&&d.trigger("editor.error.message",{messageKey:"synchrony-token-expired",message:"We couldn\'t process your request, as it was missing a required security token. Copy your work, then re-submit the form or reload the page.",disablePublish:!0});e&&(e.onConfluenceDisconnectedState(),e.onTokenExpiredState());d.log(b?b.message:"Confluence failed to renew JWT token.");c.reject("token")}));return c.promise()}var e,h=0;return{init:function(b){e=b},performRequest:function(b){return g().pipe(b).pipe(function(c){var a;a="error"===c[1]&&c[0].responseText?JSON.parse(c[0].responseText):
c[0];return"error"===c[1]&&a.type&&a.type.match(/^jwt\//)?g({errorType:a.type,message:a.message}).pipe(b):c})},getTokenPromise:g}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-collaborative-editor-plugin:confluence-collaborative-editor-plugin-resources', location = '/js/unsupported-extension.js' */
define("confluence-collaborative-editor-plugin/unsupported-extension","ajs jquery confluence-editor/editor/page-editor-message window confluence-collaborative-editor-plugin/editor-blanket confluence/legacy-editor-global-AVOID-IF-POSSIBLE".split(" "),function(a,c,e,f,g,d){return{check:function(){var b=a.Rte.getEditor().getBody();if(b.hasAttribute("data-gramm")&&b.hasAttribute("data-gramm_id")){a.trigger("synchrony.stop",{id:"confluence.editor.block.by.grammarly",maxWaitTimeToRestart:31536E6});a.trigger("analyticsEvent",
{name:"confluence.synchrony.editor.grammarly.block"});b.setAttribute("contentEditable",false);c(b).find(".contentLayout2 .innerCell").each(function(){this.setAttribute("contentEditable",false)});g.showBlanket("block");d.UI.setButtonsState(false,d.UI.buttons);e.handleMessage("collaborative-editor-unsupported-extension",{type:"error",title:"Grammarly isn\'t supported",message:a.format("The Grammarly extension doesn\'\'t play well with collaborative editing. Disable it and \u003ca {0}\u003ereload the page\u003c/a\u003e to keep working.",'href="#" id="collabGrammarlyReload"')});c("#collabGrammarlyReload").click(function(){a.trigger("analyticsEvent",
{name:"confluence.synchrony.editor.grammarly.reload.click"});f.location.reload();return false});a.trigger("synchrony-unsupported-extension")}}}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-collaborative-editor-plugin:confluence-collaborative-editor-plugin-resources', location = '/js/synchrony-entity.js' */
define("confluence-collaborative-editor-plugin/synchrony-entity",["jquery","ajs","confluence-collaborative-editor-plugin/synchrony-auth","confluence-collaborative-editor-plugin/synchrony-util","confluence-collaborative-editor-plugin/unsupported-extension"],function(c,g,h,d,j){function k(b,d,e){var f,i,h=/^[\w\.\-\+\%]+$/i;i=function(a){return null==a||h.test(a)};f=c.extend({},b.whitelists.tinymce,{styles:c.extend({},b.whitelists.tinymce.styles,{"padding-top":!1,"padding-right":!1,"padding-bottom":!1,
"padding-left":!1,padding:!1,display:i,"list-style-type":i}),attributes:c.extend({},b.whitelists.tinymce.attributes,{"confluence-query-params":!0,"data-element-title":!0,"data-ref":!0,accesskey:!0,datetime:!0,"data-anchor":!0,"data-encoded-xml":!0,"data-highlight-class":!0,"data-highlight-colour":!0,"data-space-key":!0,"data-username":!0,"data-entity-id":!0,"data-entity-type":!0,"data-favourites-bound":!0,"data-macro-id":!0,"data-macro-name":!0,"data-macro-schema-version":!0,"data-macro-body-type":!0,
"data-macro-parameters":!0,"data-macro-default-parameter":!0,"data-atlassian-layout":!0,"data-placeholder-type":!0,"data-layout":!0,"data-title":!0,"data-type":!0,"data-inline-task-id":!0,"data-inline-tasks-content-id":!0,"data-base-url":!0,"data-linked-resource-id":!0,"data-linked-resource-type":!0,"data-linked-resource-version":!0,"data-linked-resource-default-alias":!0,"data-linked-resource-container-version":!0,"data-linked-resource-content-type":!0,"data-unresolved-comment-count":!0,"data-location":!0,
"data-image-height":!0,"data-image-width":!0,"data-attachment-copy":!0,"data-content-title":!0}),classes:function(a){switch(a){case "mceSelected":return!1;default:return!0}},elements:c.extend({},b.whitelists.tinymce.elements,{time:!0,mark:!0,label:!0,form:!0})});return{profile:"tinymce",selectionCorrections:!1,telepointer:{refreshOnResize:!0,label:{hover:!0,movement:1E3,text:function(a){try{return(a.fullname||"Anonymous").charAt(0).toUpperCase()}catch(b){g.log(b)}return"&#9786;"}}},
tinymce:{monkeyPatchUndoManager:!0,instance:d},whitelist:function(a){var d="node"===a.type,c="attribute"===a.type&&"data-title"===a.name;return a.domNode===e?d||c:b.isWhitelisted(f,a)},domReadHook:function(){g.trigger("cursor-target-refresh");j.check()}}}return{bind:function(b,c,e,f){return b.entity({url:d.getServiceUrl(),entityId:d.getEntityId(),jwt:h.getTokenPromise,history:f,presence:!0,useFallback:d.getXhrFallbackFlag()}).bind(e,k(b,c,e))}}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-collaborative-editor-plugin:confluence-collaborative-editor-plugin-resources', location = '/js/synchrony-handlers.js' */
define("confluence-collaborative-editor-plugin/synchrony-handlers","jquery ajs confluence/meta confluence-editor/editor/page-editor-message confluence-collaborative-editor-plugin/sync-manager confluence-collaborative-editor-plugin/synchrony-util confluence-collaborative-editor-plugin/synchrony-content confluence-collaborative-editor-plugin/synchrony-presence confluence/get-content-id confluence/legacy-editor-global-AVOID-IF-POSSIBLE".split(" "),function(e,b,f,l,v,d,g,w,n,i){function o(a,p){if(p.contributors){q=
p.contributors;b.unbind(a,o)}}function x(a){j.val(a.rev.toString())}function y(a){j.val(a.rev.toString());b.trigger("synchrony.entity.ack",{pendingChanges:a.pending.length>0})}function z(){m.onDisconnectedState();b.log("Synchrony disconnected!")}function A(a){a.level==="fatal"&&b.trigger("editor.error.message",{disablePublish:true})}function B(a){d.timeEnd("confluence.editor.synchrony.connect");b.log("Synchrony connected.");w.appendTo(a.sid,c,n(),e("#rte-toolbar"),q);m.onConnectedState(c);b.trigger("synchrony.connected");
g.fixTinymceCaretContainer(k,h)}function r(a,b,c){return{origin:"synchrony",cause:a,messageKey:b,disablePublish:c}}function C(a){function b(e){if(!e.pending.length){c.off("ack",b);j.val(e.rev.toString());d.resolve(a)}}var d=e.Deferred();if(c.ackState().pending.length){c.on("ack",b);setTimeout(function(){c.off("ack",b);d.reject(r("timeout"))},5E3)}else d.resolve(a);return e.when(d,s).promise()}function t(a){return(a=d.getLatestRevisionWithAttr(a.revisions,"user"))?a.meta.user:"Anonymous"}
function D(a){if(a.updateType==="remote"){j.val(a.revisions[a.revisions.length-1].rev.toString());if(d.hasRevisionTrigger(a.revisions,"reset")){l.handleMessage("editor.synchrony.revert-page",{type:"info",message:b.format("{0} reverted to a previous version of this page.",t(a))});f.set("has-collaborated",false);u();b.trigger("analyticsEvent",{name:"confluence.synchrony.external-changes.revert"});b.trigger("editor-shared-drafts-discarded");i.heartbeat()}if(d.hasRevisionTrigger(a.revisions,"publish")){if(g.isUnpublished()){f.set("new-page",
false);f.set("page-id",n());f.set("draft-id","0");i.isLimitedModeEnabled()||i.UI.setButtonState(true,e("#rte-button-discard"))}f.set("has-collaborated",false);u();var c=t(a);l.handleMessage("editor.synchrony.page-published",{type:"info",message:b.format("{0} published this page.",c),close:"auto"});b.trigger("analyticsEvent",{name:"confluence.synchrony.external-changes.publish"});b.trigger("editor-shared-drafts-published");i.heartbeat()}d.hasRevisionType(a.revisions,"external")&&
b.trigger("editor.external.change");if((c=d.getLatestRevisionWithAttr(a.revisions,"confVersion"))&&c.meta.confVersion){e('meta[name="page-version"]').attr("content",c.meta.confVersion);e('meta[name="ajs-page-version"]').attr("content",c.meta.confVersion);f.set("page-version",c.meta.confVersion)}}setTimeout(function(){if(a.updateType==="init"||a.updateType==="remote"){b.trigger("editor.remote.change");g.readTitleFromRootElement(k)}g.fixTinymceCaretContainer(k,h);if(a.updateType==="local"){h.undoManager.hasUndo()||
h.setDirty(false);b.trigger("editor.local.change")}},0)}function u(){c.ackState().pending.length===0&&h.setDirty(false)}var j,m,h,k,c,s,q=[];b.bind("editor-heartbeat",o);return{handle:function(a,b,f,l){d.time("confluence.editor.synchrony.connect");c=a;h=b;m=f;s=l.pipe(null,function(a){c.destroy();m.onDisconnectedState();return r(a,"collaborative-editor-load-failure",true)});j=e("#syncRev");k=h.getBody();c.on("init",x).on("update",D).on("ack",y).on("connected",B).on("disconnected",z).on("error",A);
new v(c,{DEBUG_MODE:true});g.bindPostPasteFix();g.readTitleFromRootElement(k);i.overrideBeforeSave(C);e("#content-title").keyup(g.writeTitleToRootElement)}}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-collaborative-editor-plugin:confluence-collaborative-editor-plugin-resources', location = '/js/synchrony-editor.js' */
define("confluence-collaborative-editor-plugin/synchrony-editor","window jquery ajs backbone confluence/get-content-id confluence-collaborative-editor-plugin/editor-blanket confluence-collaborative-editor-plugin/synchrony-util confluence-collaborative-editor-plugin/synchrony-content confluence-collaborative-editor-plugin/synchrony-auth confluence-collaborative-editor-plugin/synchrony-entity confluence-collaborative-editor-plugin/synchrony-handlers confluence-editor-loader/editor-loader confluence-editor/support/atlassian-editor-support".split(" "),
function(j,e,c,J,A,B,d,r,o,K,L,l,M){function s(b){e('meta[name="ajs-collaborative-editor-status"]').attr("content",b)}function N(){return!c.Rte.isQuickEdit}function t(b){var a;switch(b){case "timeout":b="The editor didn\'t load this time";a="The connection timed out. If it happens again, speak to your Confluence admin. You may be using a proxy server that prevents WebSocket connections.\u003c/br\u003e\u003ca href=\"#\" id=\"websocketRetry\"\u003eTry again\u003c/a\u003e&nbsp;.&nbsp;\u003ca href=\"https://confluence.atlassian.com/display/CONFKB/Confluence+throws+The+editor+didn%27t+load+this+time+error+when+trying+to+edit+a+page\" target=\"_blank\" id=\"websocketFindmore\"\u003eFind out more\u003c/a\u003e";break;case "synchrony-requests":u=true;b="";a="Something went wrong after loading the editor. Copy your unsaved changes and refresh the page to keep editing.";break;case "limited-mode":u=true;b="";a="Something went wrong while loading the editor, please try again.";
break;default:u=true;b="";a="Loading the editor\'s taking longer than usual. Give it a few moments, then refresh your page if it still doesn\'t load. Speak to your Confluence admin if that doesn\'t fix it."}c.trigger("editor.error.message",{title:b,messageKey:"collaborative-editor-load-failure",message:a,disablePublish:true,close:"manual"})}function C(){c.trigger("dismiss.editor.error.message",{messageKey:"collaborative-editor-load-failure",enablePublish:true})}function D(b,a){var f=e.Deferred();b.done(function(){d.timeEnd(a)},f.resolve);b.fail(function(a){c.trigger("analyticsEvent",{name:"confluence.synchrony.client.snapshot.request.failure",
data:{statusCode:a[0].status,statusText:a[0].statusText}})},f.resolve);return f.promise()}function E(b,a){var f=a[1]==="error"&&a[0].responseText?JSON.parse(a[0].responseText):"",d=false;f.type==="invalid-ancestor"?d="synchrony":f.type==="out-of-order-revision"&&(d="confluence");if(d){j.__DEBUG__&&c.log("Performing synchrony recovery");e.ajax({url:c.contextPath()+"/rest/synchrony/1.0/content/"+A()+"/recovery?behind="+d+"&conflictingRev="+f["conflicting-rev"],type:"PUT"});return"synchrony-requests"}if(a[1]!==
"success"&&b[1]!=="success"||a[1]!=="success"&&f.type!=="duplicate-mismatch"){c.trigger("analyticsEvent",{name:"confluence.synchrony.client.content.reconciliation.failure",data:{type:f.type}});return"synchrony-requests"}return false}function F(b){return o.performRequest(function(a){d.time("confluence.editor.synchrony.snapshot");return D(e.ajax({type:"POST",url:encodeURI(d.getServiceUrl()+"/data"+d.getEntityId()+"?state-at=@head&state-format=type-tagged&rewrite-request=true&cached="+b),contentType:"text/plain",
dataType:"json",data:JSON.stringify({headers:{"content-type":"application/json","x-token":a},method:"GET"})}).pipe(d.asArray,d.asArray),"confluence.editor.synchrony.snapshot")})}function O(b){if(!b.syncRev&&r.isUnpublished()&&(b.raw.length===0||/^\s+$/.test(b.raw)))return e.Deferred().resolve([{},"success"]);if(r.isContentEmpty(b.raw)){c.trigger("analyticsEvent",{name:"confluence.synchrony.client.content.reconciliation.blank-content"});return e.Deferred().resolve([{},"success"])}return o.performRequest(function(a){d.time("confluence.editor.synchrony.CR");
return D(e.ajax({type:"POST",url:encodeURI(d.getServiceUrl()+"/data"+d.getEntityId()+"?optimistic=true&rewrite-request=true"),dataType:"json",contentType:"text/plain",data:JSON.stringify({body:{ancestor:b.syncRev,rev:b.confRev,state:{format:"html",value:b.html},merges:{master:{meta:{type:"client-reconciliation"}}}},headers:{"content-type":"application/json","x-token":a},method:"PUT"})}).pipe(d.asArray,d.asArray),"confluence.editor.synchrony.CR")})}function G(){if(M.isCollaborativeContentType()){var b=
h("rte-quick-edit-init rte-collaborative-content-ready",true),a=h("rte-quick-edit-init rte-collaborative-content-ready rte-collab-editor-loaded",false),f=h("rte-collaborative-content-ready",false,r.getContent),g=h("rte-collab-editor-loaded",false,c.Rte.getEditor),g=h("rte-begin-collab-editing",false,c.Rte.getEditor,N,g);b.pipe(function(){var b=a.promise(),i=f.promise(),m=g.promise(),x=k._initialiseSynchrony(),y=v("synchrony.connected.fake"),n=v(null);b.pipe(function(){setTimeout(n.reject,H,"synchrony-requests")});
var h=k._initialiseCollabEditingComponents(n),o=Date.now(),p=null,l=null;if(!c.DarkFeatures.isEnabled("synchrony-pessimistic-snapshot")){p=F(true);p.done(function(a){l=a[1]})}var q=b.pipe(function(){return!p||p.state()==="rejected"||l==="error"||P<Date.now()-o?F(false):p});m.pipe(function(){var a=v("synchrony.connected synchrony.connected.fake");v("synchrony.connected synchrony.connected.fake synchrony-unsupported-extension",H).fail(function(b){t(b);c.trigger("analyticsEvent",{name:"confluence.synchrony.editor.load.timeout"});
e("#websocketRetry").on("click",function(){c.trigger("analyticsEvent",{name:"confluence.synchrony.editor.websocket.retry.click"});j.location.reload();return false});e("#websocketFindmore").on("click",function(){c.trigger("analyticsEvent",{name:"confluence.synchrony.editor.websocket.findmore.click"})});a.done(function(){u||C()})});d.time("confluence.editor.synchrony");e.when(Date.now(),y).pipe(function(a){s("on");var b=Date.now();c.trigger("analyticsEvent",{name:"confluence.synchrony.editor.loaded",
data:{durationMillis:b-a}});c.trigger("rte-collab-ready");d.timeEnd("confluence.editor.synchrony");d.timeEnd("confluence.editor")});B.applyBlanket(y)});i.pipe(function(a){var b=O(a);q=e.when(q,x).pipe(function(a,b){d.time("confluence.editor.synchrony.unmarshal");var c=a;a[1]==="success"&&(c=[{stateAt:a[0].stateAt,state:b.unmarshal(a[0].state.value)},a[1]]);d.timeEnd("confluence.editor.synchrony.unmarshal");return c});e.when(q,b).pipe(function(a,b){var c=E(a,b);c?n.reject(c):n.resolve()});if(!c.DarkFeatures.isEnabled("synchrony-pessimistic-CR")&&
(a.syncRevSource==="synchrony-ack"||r.isUnpublished())){j.__DEBUG__&&c.debug("confluence.editor.synchrony: content up to date, not waiting for CR");n.fail(t);return e.when(a,m,q,[{},"success"],h)}return e.when(a,m,q,b,h)}).pipe(function(a,b,d,f){if(!k._bindEditor(a,b,d,f,n)){c.trigger("analyticsEvent",{name:"confluence.synchrony.bind.failure"});return e.Deferred().reject("editor-binding-failed")}y.resolve()}).fail(function(a){m.always(function(){if(a!=="synchrony-not-enabled"){c.logError("Failed to load the collaborative editor",
a);t(a);c.$(function(){w.onDisconnectedState()});s("failed")}})})});f.fail(t);c.trigger("synchrony-events-bound");g.fail(function(a){if(a==="synchrony-not-enabled"){B.showEditor();s("off");j.__DEBUG__&&c.log("Synchrony is not available in this context.")}})}}function v(b,a,d){var g=e.Deferred();b&&c.bind(b,function i(a,d){j.__DEBUG__&&c.debug("confluence.editor.synchrony.event: "+a.type+"."+a.namespace);c.unbind(b,i);g.resolve(d)});a&&setTimeout(g.reject,a,d||"timeout");return g}function h(b,a,f,
g,h){var i=h||e.Deferred();if(d.isEditorInitialised()||a&&d.synchronyReady())return I(i,f);c.bind(b,function x(a,d){j.__DEBUG__&&c.debug("confluence.editor.event "+a.type+"."+a.namespace);i.always(function(){c.unbind(b,x)});I(i,f,d,g)});return i}function I(b,a,c,e){if(!d.synchronyReady())return b.reject("synchrony-not-enabled");if(!e||e())return(a=a?a(c):c)&&a.error?b.reject(a.error):b.resolve(a);return b}var k={},z=j.Synchrony=j.Synchrony||{};d.time("confluence.editor.synchrony.jsLoad");var P=6E5,
H=3E4,w,u=false;k._bindEditor=function(b,a,f,g,h){d.time("confluence.editor.synchrony.init");if(E(f,g))return null;var g=e("#syncRev"),i=null;if(f[1]==="success"){f=f[0];i={base:{rev:z.rev(f.stateAt),state:f.state}};g.val(i.base.rev.toString())}j.__DEBUG__&&c.log("Synchrony will load with contentId: ",A());try{var m=a.getBody();m.setAttribute("data-title",b.title);var k=K.bind(z,a,m,i);L.handle(k,a,w,h);c.trigger("editor.remote.change");a.setDirty(false);d.timeEnd("confluence.editor.synchrony.init");
return k}catch(l){c.logError(l);return null}};k._initialiseCollabEditingComponents=function(b){var a=e.Deferred();c.$(function(){c.$("body").addClass("synchrony-active");w=new (require("confluence-collaborative-editor-plugin/status-indicator-view"))({el:"#pluggable-status",model:new J.Model({minActiveTime:500})});o.init(w);a.resolve()});e(j).one("synchrony.connected.fake",function(c){if(c.namespace==="connected.fake"){a.resolve();b.resolve();C();s("fake")}});return a};k._initialiseSynchrony=function(){d.time("confluence.editor.synchrony.deps");
var b=j,a=b.Synchrony=b.Synchrony||{};if(!a.ready){var c=a._cbs=a._cbs||[];a.ready=function(a){c.push(a)}}var g=function(){if(a.state===1){a.SockJS=b.SockJS;a.init()}};if(b.SockJS)a.init&&g();else{var h=b._sockjs_onload;b._sockjs_onload=function(){g();h&&h.apply(this,arguments)}}var i=e.Deferred();z.ready(i.resolve);return e.when(i.promise(),d.loadScript("/js/vendor/sockjs.min.js"),d.loadScript("/js/synchrony.min.js")).pipe(function(a){d.timeEnd("confluence.editor.synchrony.deps");j.__DEBUG__&&console.info("Synchrony successfully initialised.");
return a})};k.init=function(){l.getEditorLoadingStatus()&&l.getEditorLoadingStatus().done?l.getEditorLoadingStatus().done(G):G()};d.timeEnd("confluence.editor.synchrony.jsLoad");return k});require("confluence/module-exporter").safeRequire("confluence-collaborative-editor-plugin/synchrony-editor",function(j){j.init()});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.extra.officeconnector:officeconnector-editor-resources', location = 'javascript/property-panel.js' */
(function(){AJS.Confluence.PropertyPanel.Macro.registerButtonHandler("office-connector-download-file-button",function(n,h){var c=AJS.$(h).attr("data-macro-parameters");var l=c.split("|");var d={};var j;for(j=0;j<l.length;j++){var p=l[j];var g=p.split("=");if(g.length>1){d[g[0]]=g[1]}}var b=AJS.Meta.get("page-id");var q=AJS.Meta.get("content-type");if(!d.space){d.space=AJS.Meta.get("space-key")}addToUrlIfDefined=function(i,r,e){if(i&&r){if(e.charAt(e.length-1)!="?"){e+="&"}e=e+i+"="+encodeURI(r)}return e};var m=AJS.Meta.get("context-path");var f="/plugins/servlet/oc/getattachment?";var a=m+f;a=addToUrlIfDefined("title",d.page,a);a=addToUrlIfDefined("date",d.date,a);a=addToUrlIfDefined("space",d.space,a);a=addToUrlIfDefined("filename",d.name,a);a=addToUrlIfDefined("contextid",b,a);a=addToUrlIfDefined("contexttype",q,a);var o=(AJS.$.browser&&AJS.$.browser.msie)?"_blank":"download-office-attachment";var k=window.open(a,o)})})();
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.web.resources:mouse', location = 'includes/js/api/mouse.js' */
define("confluence/api/mouse",["jquery","window"],function(d,e){var b={MotionDetector:function(){this.reset()}};b.MotionDetector.prototype.reset=function(){this._y=this._x=this._handler=null;this.moved=!1};b.MotionDetector.prototype.wait=function(b){var a=this;a._handler||(this.reset(),d(e.top.document).bind("mousemove",a._handler=function(c){!a._x&&!a._y?(a._x=c.pageX,a._y=c.pageY):c.pageX===a._x&&c.pageY===a._y||(a.unbind(),a.moved=!0,b&&b.call(this,c))}))};b.MotionDetector.prototype.unbind=function(){this._handler&&
(d(e.top.document).unbind("mousemove",this._handler),this.reset())};return b});require("confluence/module-exporter").exportModuleAsGlobal("confluence/api/mouse","AJS.Mouse");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.web.resources:class', location = 'includes/js/class.js' */
define("confluence/class",["jquery"],function(f){var j=function(d){var a=function(){};a.prototype=d;return new a},i=!1,l=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/,k=function(){};k.extend=function(){function d(){!i&&this.init&&this.init.apply(this,arguments)}var a,g=this.prototype;if(1<arguments.length){var c=f.makeArray(arguments);a=c.pop();var h;f.each(c,function(b,a){h=h?h.extend(a):a});return h.extend(this.prototype).extend(a)}a=arguments[0];i=!0;c=new this;i=!1;for(var b in a)if(c[b]="function"===
typeof a[b]&&"function"===typeof g[b]&&l.test(a[b]))c[b]=function(a,b){return function(){var c=this._super;this._super=g[a];var d=b.apply(this,arguments);this._super=c;return d}}(b,a[b]);else if("object"===typeof g[b]){var e=j(a[b]);f.each(g[b],function(a,b){if(e[a]){if("object"===typeof e[a]){var c=j(e[a]);f.each(b,function(a,b){c[a]||(c[a]=b)});e[a]=c}}else e[a]=b});c[b]=e}else c[b]=a[b];d.prototype=c;d.constructor=d;d.extend=arguments.callee;return d};return k});
require("confluence/module-exporter").exportModuleAsGlobal("confluence/class","Class");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.web.resources:keyboard', location = 'includes/js/api/keyboard.js' */
define("confluence/api/keyboard",["jquery"],function(f){function b(a,b,c){h[b]=a;i[a]=b;c&&(j[b]=!0);return a}function g(a){a=a.originalEvent||a;return null==a.which?a.keyCode:0!==a.which&&0!==a.charCode?a.which:null}function k(a){var a=a.originalEvent||a,b=e.specialKeyEntered(a);if(b)return b;if(f.browser.mozilla){if("keypress"===a.type&&(a=g(a),null!==a))return String.fromCharCode(a).toLowerCase()}else if("keypress"!==a.type)return String.fromCharCode(a.keyCode).toLowerCase()}var e={},h={},i={},
j={},c=e.SpecialKey={BACKSPACE:b("backspace",8,!0),TAB:b("tab",9,!0),RETURN:b("return",13,!0),SHIFT:b("shift",16),CTRL:b("ctrl",17),ALT:b("alt",18),PAUSE:b("pause",19),CAPS_LOCK:b("capslock",20),ESC:b("esc",27,!0),SPACE:b("space",32,!0),PAGE_UP:b("pageup",33),PAGE_DOWN:b("pagedown",34),END:b("end",35),HOME:b("home",36),LEFT:b("left",37),UP:b("up",38),RIGHT:b("right",39),DOWN:b("down",40),INSERT:b("insert",45),DELETE:b("del",46),F1:b("f1",112),F2:b("f2",113),F3:b("f3",114),F4:b("f4",115),F5:b("f5",
116),F6:b("f6",117),F7:b("f7",118),F8:b("f8",119),F9:b("f9",120),F10:b("f10",121),F11:b("f11",122),F12:b("f12",123),NUMLOCK:b("numlock",144),SCROLL:b("scroll",145),META:b("meta",224)};c.eventType=function(){return f.browser.mozilla?"keypress":"keydown"};c.fromKeyCode=function(a){return h[a]};c.toKeyCode=function(a){return i[a]};c.isAscii=function(a){return!!j[a]};c.isSpecialKey=function(a){return!!c.toKeyCode(a)};e.characterEntered=function(a){a=a.originalEvent||a;if("keypress"===a.type&&(a=g(a),
null!==a&&(!c.isAscii(a)||c.fromKeyCode(a)===c.SPACE)))return String.fromCharCode(a)};e.specialKeyEntered=function(a){a=a.originalEvent||a;if(f.browser.mozilla){if("keypress"===a.type){var b=g(a);if(null===b)return c.fromKeyCode(a.keyCode);if(c.isAscii(b))return c.fromKeyCode(b)}}else if("keypress"!==a.type)return c.fromKeyCode(a.keyCode)};e.shortcutEntered=function(a){a=a.originalEvent||a;if(a.type===e.SpecialKey.eventType()){var b=e.specialKeyEntered(a),d="";a.altKey&&b!==c.ALT&&(d+=c.ALT+"+");
a.ctrlKey&&b!==c.CTRL&&(d+=c.CTRL+"+");a.metaKey&&(!a.ctrlKey&&b!==c.META)&&(d+=c.META+"+");a.shiftKey&&b!==c.SHIFT&&(d+=c.SHIFT+"+");if(b)return d+b;if(0<d.length&&"shift+"!==d&&(a=k(a)))return d+a}};return e});require("confluence/module-exporter").exportModuleAsGlobal("confluence/api/keyboard","AJS.Keyboard");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.web.resources:trigger', location = 'includes/js/trigger.js' */
define("confluence/trigger",["jquery","window"],function(b,c){return function(a,d){a=new b.Event(a);b(d||c.top.document).trigger(a);return!a.isDefaultPrevented()}});require("confluence/module-exporter").exportModuleAsGlobal("confluence/trigger","AJS.jiraTrigger");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.web.resources:control', location = 'includes/js/control.js' */
define("confluence/control","confluence/class confluence/trigger confluence/api/logger confluence/api/keyboard jquery document".split(" "),function(k,l,i,g,d,e){return k.extend({INVALID:"INVALID",_throwReadOnlyError:function(a){Error(this.CLASS_SIGNATURE+": Sorry ["+a+"] is a read-only property")},_assignEvents:function(a,b){this._unassignEvents(a,b);if(typeof b==="string")for(var c in this._events[a])d(e).delegate(b,c,this._getDispatcher(a,c));else{b=d(b);for(c in this._events[a]){b.bind(c,this._getDispatcher(a,
c));i.debug("Control bound eventType '"+c+"' for group '"+a+"' on target '"+(b[0].type||b[0])+"'")}}},_unassignEvents:function(a,b){if(typeof b==="string")for(var c in this._events[a])d(e).undelegate(b,c,this._getDispatcher(a,c));else{b=d(b);try{for(c in this._events[a])b.unbind(c,this._getDispatcher(a,c))}catch(g){var f=b.data("events");if(f)for(c in f)if(c in this._events[a]){for(var m=this._getDispatcher(a,c),j=f[c],h=0;h<j.length;h++)if(j[h]===m){j.splice(h,1);break}i.debug("Control unbound eventType '"+
c+"' for group '"+a+"' on target '"+(b[0].type||b[0])+"'")}}}},_getDispatcher:function(a,b){var c=a+"/"+b;if(!this._dispatchers)this._dispatchers={};if(!this._dispatchers[c]){var e=this._events[a][b],f=this;this._dispatchers[c]=function(c){i.debug("Control dispatching eventType '"+b+"' for group '"+a+"' on instance '"+f.type+"'");return e.call(f,c,d(this))}}return this._dispatchers[c]},_isValidInput:function(){return true},_handleKeyEvent:function(a){if(this._isValidInput(a)){var b=g.SpecialKey,c=
g.shortcutEntered(a);if(c){if(this.keys[c]){this.keys[c].call(this,a);return}if((c===b.BACKSPACE||c===b.DELETE)&&this.keys.onEdit){this.keys.onEdit.call(this,a);return}}(b=g.characterEntered(a))&&this.keys.onEdit&&this.keys.onEdit.call(this,a,b)}},getCustomEventName:function(a){return(this.CLASS_SIGNATURE||"")+"_"+a},_getCustomEventArgs:function(){return[this]},trigger:function(a){return l(a,this)},_supportsBoxShadow:function(){var a=e.body.style;return a.WebkitBoxShadow!==void 0||a.MozBoxShadow!==
void 0||a.boxShadow!==void 0},_setOptions:function(a){var b,c,a=a||{};if(a instanceof d||typeof a==="string"||typeof a==="object"&&a.nodeName)a={element:a};b=d(a.element);c=b.getOptionsFromAttributes();this.options=d.extend(true,this._getDefaultOptions(a),c,a);if(b.length===0)return this.INVALID},getCaret:function(a){var b=a.selectionStart;if(b>=0)return a.selectionEnd>b?-1:b;if(e.selection){b=e.selection.createRange();if(b.text.length===0){var c=b.duplicate();c.moveToElementText(a);c.setEndPoint("EndToStart",
b);return c.text.length}}return-1},_render:function(){var a,b=arguments[0],c=[];for(a=1;a<arguments.length;a++)c.push(arguments[a]);return this._renders[b].apply(this,c)}})});require("confluence/module-exporter").exportModuleAsGlobal("confluence/control","AJS.Control");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.web.resources:group', location = 'includes/js/group.js' */
define("confluence/group",["confluence/control","confluence/api/logger","jquery"],function(d,e,c){return d.extend({init:function(){this.type=this.type||"Group";this.items=[];this.index=-1;this._assignEvents("instance",this)},addItem:function(a){this.items.push(a);this._assignEvents("item",a)},removeItem:function(a){var b=c.inArray(a,this.items);if(0>b)throw Error("Group: item ["+a+"] is not a member of this group");a.trigger("blur");b<this.index&&this.index--;this.items.splice(b,1);this._unassignEvents("item",
a)},removeAllItems:function(){for(var a=0;a<this.items.length;a++)this._unassignEvents("item",this.items[a]),this.items[a].trigger("blur");this.index=-1;this.items.length=0;this._unassignEvents("keys",document)},shiftFocus:function(a){e.debug("Group.shiftFocus called with offset: "+a);-1===this.index&&1===a&&(a=0);0<this.items.length&&(a=(Math.max(0,this.index)+this.items.length+a)%this.items.length,this.items[a].trigger("focus"))},prepareForInput:function(){this._assignEvents("keys",document)},_events:{instance:{focus:function(){0!==
this.items.length&&(0>this.index?this.items[0].trigger("focus"):this._assignEvents("keys",document))},blur:function(){0<=this.index?this.items[this.index].trigger("blur"):this._unassignEvents("keys",document)}},keys:{"keydown keypress":function(a){this._handleKeyEvent(a)}},item:{focus:function(a){var b=this.index;this.index=c.inArray(a.target,this.items);0>b?this.trigger("focus"):b!==this.index&&this.items[b].trigger("blur")},blur:function(a){this.index===c.inArray(a.target,this.items)&&(this.index=
-1,this.trigger("blur"))},remove:function(a){this.removeItem(a.target)}}},keys:{}})});require("confluence/module-exporter").exportModuleAsGlobal("confluence/group","AJS.Group");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.web.resources:select-grid', location = 'includes/js/select-grid.soy' */
// This file was automatically generated from select-grid.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.SelectGrid.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.SelectGrid == 'undefined') { Confluence.Templates.SelectGrid = {}; }


Confluence.Templates.SelectGrid.gridOutline = function(opt_data, opt_ignored) {
  return '<table class="select-grid aui"><thead><tr class="data-table-header"></tr></thead><tbody></tbody></table>';
};
if (goog.DEBUG) {
  Confluence.Templates.SelectGrid.gridOutline.soyTemplateName = 'Confluence.Templates.SelectGrid.gridOutline';
}


Confluence.Templates.SelectGrid.cellWithLink = function(opt_data, opt_ignored) {
  return '<td class="' + soy.$$escapeHtml(opt_data.outerClass) + '"><a class="' + soy.$$escapeHtml(opt_data.innerClass) + '" href="' + soy.$$escapeHtml(opt_data.href) + '" title="' + soy.$$escapeHtml(opt_data.title) + '"><span>' + soy.$$escapeHtml(opt_data.text) + '</span></a></td>';
};
if (goog.DEBUG) {
  Confluence.Templates.SelectGrid.cellWithLink.soyTemplateName = 'Confluence.Templates.SelectGrid.cellWithLink';
}


Confluence.Templates.SelectGrid.cellWithoutLink = function(opt_data, opt_ignored) {
  return '<td class="' + soy.$$escapeHtml(opt_data.outerClass) + '"><span class="' + soy.$$escapeHtml(opt_data.innerClass) + '" title="' + soy.$$escapeHtml(opt_data.title) + '">' + soy.$$escapeHtml(opt_data.text) + '</span></td>';
};
if (goog.DEBUG) {
  Confluence.Templates.SelectGrid.cellWithoutLink.soyTemplateName = 'Confluence.Templates.SelectGrid.cellWithoutLink';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.web.resources:select-grid', location = 'includes/js/select-grid.js' */
define("confluence/select-grid",["ajs","jquery","confluence/templates","confluence/group","confluence/control"],function(c,f,k,g,i){var g=g.extend({init:function(a){this.type=this.type||"SelectGrid";this._super();var b=f(k.SelectGrid.gridOutline()),d=b.find("thead tr");f(a.columns).each(function(a,b){var e=c("th").addClass(b.getClassName()).text(b.heading);d.append(e)});this.gridContainer=f(a.gridContainer).append(b);this.getRowId=a.getRowId;this.table=b;this.columns=a.columns;this.selectionCallback=
a.selectionCallback;this.body=b.find("tbody");this.body.delegate("a","click",function(a){a.preventDefault()});this.dontShiftFocus=a.dontShiftFocus||function(){}},keys:{up:function(a){this.table.is(":visible")&&!this.dontShiftFocus()&&(this.shiftFocus(-1),a.preventDefault())},down:function(a){this.table.is(":visible")&&!this.dontShiftFocus()&&(this.shiftFocus(1),a.preventDefault())}},_addRow:function(a,b,d,c){f.isFunction(d)&&(c=d,d=!1);d?this.body.prepend(a):this.body.append(a);a=new n({row:a,data:b,
callback:c,getRowId:this.getRowId,selectionCallback:c});this.addItem(a);return a},clear:function(){this.removeAllItems();this.body.children().remove()},_addRows:function(a,b){var d=this,g=[];f(a).each(function(a,e){var i=d.columns,h,j,l,m;h=c("tr");f(i).each(function(a,b){j={outerClass:b.getClassName(e)||"",href:b.getHref&&b.getHref(e)||"",innerClass:b.getInnerClass&&b.getInnerClass(e)||"",title:b.getTitle&&b.getTitle(e)||"",text:b.getText(e)||""};l=j.href?"cellWithLink":"cellWithoutLink";m=k.SelectGrid[l](j);
h.append(m)});h.attr("data-id",d.getRowId(e));g.push(d._addRow(h,e,b,d.selectionCallback))});return g},update:function(a){this.clear();!a||!a.length?c.debug("SelectGrid.update called with no data, returning."):(this._addRows(a),this.prepareForInput())},prependAndSelect:function(a,b){!a||!a.length?c.debug("SelectGrid.prependAndSelect called with no data, returning."):this._addRows(a,!0)[b||0].selectRow()},findItem:function(a){for(var b=0;b<this.items.length;b++)if(this.items[b].getRowId()==a)return this.items[b];
c.debug("SelectGrid.findItem didn't find item, returning null.");return null},select:function(a){(a=this.findItem(a))&&a.selectRow()},selectIndex:function(a){a=a||0;this.items[a]?this.items[a].selectRow():c.debug("SelectGrid.selectIndex couldn't select row with index "+a+", not found")},show:function(){this.gridContainer.removeClass("hidden")},hide:function(){this.gridContainer.addClass("hidden")},isVisible:function(){return!this.gridContainer.hasClass("hidden")}}),n=i.extend({init:function(a){this.type=
"SelectableRow";this.$row=f(a.row);this.$row.data("properties",a.data);this.getRowId=function(){return a.getRowId(a.data)};this.selectionCallback=a.selectionCallback;this._assignEvents("element",this.$row);this._assignEvents("instance",this);c.debug("SelectableRow initialized")},_events:{instance:{focus:function(){var a=this.$row;a.addClass("selected");this.selectionCallback(a,a.data("properties"))},blur:function(){this.$row.removeClass("selected")}},element:{click:function(){this.trigger("focus")}}},
selectRow:function(){this.trigger("focus")}});g.Column=function(a){var b=function(b){return b[a.key]};return{key:a.key,heading:a.heading,getClassName:a.getClassName||function(){return a.className||a.key+"-field"},getHref:a.getHref,getInnerClass:a.getInnerClass,getTitle:a.getTitle,getText:a.getText||b}};return g});require("confluence/module-exporter").exportModuleAsGlobal("confluence/select-grid","AJS.SelectGrid");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.web.resources:result-grid', location = 'includes/js/result-grid.js' */
define("confluence/result-grid",["ajs","jquery","confluence/control","confluence/select-grid","raphael"],function(g,e,l,m,n){return l.extend({init:function(a){this.type=this.type||"ResultGrid";var c,f,k,h,j,d,i;f=a.gridContainer||e(a.baseElement).find(".data-table");f.length||g.debug("gridContainer for AJS.ResultGrid not found!");k=function(b){return b.id};c=new m({gridContainer:f,columns:a.columns,selectionCallback:a.selectionCallback,getRowId:a.getRowId||k,dontShiftFocus:a.dontShiftFocus});d=a.messageHandler||
g.MessageHandler({baseElement:e(a.baseElement).find(".message-panel")});i=a.noResultMessage||g.I18n.getText("result.grid.no.result.message");e.extend(this,{update:function(b,a){d.clearMessages();h&&(h(),j.remove(),h=null);c.clear();if(!b||!b.length){c.hide();var o=e.isFunction(i)?i(a):i;d.displayMessages(o);return!1}c.update(b);c.show();return!0},updateAndSelect:function(b,c,a){this.update(b,c)&&this.selectIndex(a)},prependAndSelect:function(b,a){!b||!b.length?g.debug("ResultGrid.prependAndSelect called with no data, returning."):
(d.clearMessages(),c.prependAndSelect(b,a),c.show())},select:function(b){c.select(b)},selectIndex:function(b){c.selectIndex(b)},clear:function(){d.clearMessages();c.hide()},loading:function(){c.show();var b=f.width(),a=f.height();this.clear();if(!h){var d,e;d=b/2-73;e=a/2-73;j=g("div").addClass("spinner-container").width(b-d).height(a-e).css({"padding-left":d,"padding-top":e}).insertAfter(f);h=n.spinner(j[0],60,"#666")}},isVisible:function(){return c.isVisible()}})}})});
require("confluence/module-exporter").exportModuleAsGlobal("confluence/result-grid","AJS.ResultGrid");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.web.resources:breadcrumbs-jquery', location = 'includes/js/breadcrumbs-jquery.js' */
define("confluence/breadcrumbs-jquery",["jquery","confluence/templates"],function(e,h){return function(a){var i=this,f=[],b=0,c=a.length-1,d=a[b],j=i.closest(".breadcrumbs-container").width(),g=function(){return i.width()<j};for(f.push(h.Dialog.breadcrumbItem({text:d.title,title:d.title,className:b===c?"last":""}));b++<c;)d=a[b],f.push(h.Dialog.breadcrumbItem({text:d.title,title:d.title,className:b===c?"last":""}));this.html(f.join(""));a=e("li a span",this);a.each(function(a){0!==a&&a!==c&&e(this).shortenUntil(g)});
e(a.get(0)).shortenUntil(g);e(a.get(c)).shortenUntil(g);return this}});require("confluence/module-exporter").exportModuleAsGlobal("confluence/breadcrumbs-jquery","jQuery.fn.renderBreadcrumbs");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.web.resources:dialog-breadcrumbs', location = 'includes/js/dialog-breadcrumbs.js' */
define("confluence/dialog-breadcrumbs","ajs jquery confluence/meta confluence/templates confluence/breadcrumbs-jquery confluence-rest/confluence-rest".split(" "),function(c,d,l,k,o,n){var g={},m=function(a,i,e){var f=a.userName?a.userName:a.pageId?a.pageId+":"+a.fileName:a.spaceKey+":"+a.title+":"+a.postingDay+":"+a.fileName;f in g?i(g[f],"success"):d.ajax({type:"GET",dataType:"json",data:a,url:c.contextPath()+"/pages/breadcrumb.action",error:e||function(){},success:function(a,c){if(!a||!a.breadcrumbs)e(a,
c);else{for(var b=d.makeArray(a.breadcrumbs);b[0]&&a.type!=="userinfo"&&/peopledirectory\.action$/.test(b[0].url);)b.shift();a.type==="page"&&(b[1]&&/pages\.action/.test(b[1].url))&&b.splice(1,1);b.type=a.type;g[f]=b;i(b,c)}}})};return{getBreadcrumbsDefault:m,Breadcrumbs:function(a,i){var e=0;return{update:function(f,j){a.html(k.Dialog.breadcrumbLoading());var g=e=e+1,b=function(){if(g!==e){c.debug("Breadcrumb response for ",f," is stale, ignoring.");return true}return false};(i||m)(f,function(e,
g){if(!b())if(g!=="success"||!e)a.html(k.Dialog.breadcrumbError());else{var h=f.spaceKey;a.renderBreadcrumbs(e);if(!(h=h!==l.get("space-key")))a:{for(h=1;h<e.length;h++)if(e[h].title===l.get("page-title")){h=false;break a}h=true}if(h){j.clearErrors();d(j.moveButton).prop("disabled",false)}else{j.error("You cannot move a page to be underneath itself or its children.");d("li:last-child",a).addClass("warning")}}},function(d){if(!b()){a.html(k.Dialog.breadcrumbError());d.status===404&&j.error("The specified page was not found.")}})}}},
getBreadcrumbsLegacy:function(a,i,e){if(!a.id)throw Error("id is a required parameter in 'options'");if(!a.type)throw Error("type is a required parameter in 'options'");var f=a.id+":"+a.type;f in g?i(g[f],"success"):d.ajax({type:"GET",dataType:"json",data:a,url:c.contextPath()+n.REST.getBaseUrl()+"breadcrumb",error:e||function(){},success:function(a,c){if(!a||!a.breadcrumbs)e(a,c);else{for(var b=d.makeArray(a.breadcrumbs);b[0]&&a.type!=="userinfo"&&/peopledirectory.action$/.test(b[0].url);)b.shift();
b.type=a.type;g[f]=b;i(b,c)}}})}}});
require("confluence/module-exporter").safeRequire("confluence/dialog-breadcrumbs",function(c){var d=require("ajs");d.toInit(function(){d.MoveDialog||(d.MoveDialog={});d.MoveDialog.Breadcrumbs=c.Breadcrumbs;d.MoveDialog.getBreadcrumbs=c.getBreadcrumbsDefault;d.Breadcrumbs={};d.Breadcrumbs.getBreadcrumbs=c.getBreadcrumbsLegacy;Confluence.Dialogs||(Confluence.Dialogs={});Confluence.Dialogs.Breadcrumbs=d.Breadcrumbs;Confluence.Dialogs.Breadcrumbs.getBreadcrumbs=c.getBreadcrumbsLegacy;Confluence.Dialogs.Breadcrumbs.Controller=
c.Breadcrumbs;Confluence.Dialogs.Breadcrumbs.defaultGetBreadcrumbs=c.getBreadcrumbsDefault})});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.web.resources:dialog-breadcrumbs', location = 'includes/soy/dialog-breadcrumbs.soy' */
// This file was automatically generated from dialog-breadcrumbs.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.Dialog.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.Dialog == 'undefined') { Confluence.Templates.Dialog = {}; }


Confluence.Templates.Dialog.breadcrumbItem = function(opt_data, opt_ignored) {
  return '<li><a class="' + soy.$$escapeHtml(opt_data.className) + '" title="' + soy.$$escapeHtml(opt_data.title) + '" tabindex="-1"><span>' + soy.$$escapeHtml(opt_data.text) + '</span></a></li>';
};
if (goog.DEBUG) {
  Confluence.Templates.Dialog.breadcrumbItem.soyTemplateName = 'Confluence.Templates.Dialog.breadcrumbItem';
}


Confluence.Templates.Dialog.breadcrumbLoading = function(opt_data, opt_ignored) {
  return '<li class="loading"><span>' + soy.$$filterNoAutoescape('Loading breadcrumbs\u2026') + '</span></li>';
};
if (goog.DEBUG) {
  Confluence.Templates.Dialog.breadcrumbLoading.soyTemplateName = 'Confluence.Templates.Dialog.breadcrumbLoading';
}


Confluence.Templates.Dialog.breadcrumbError = function(opt_data, opt_ignored) {
  return '<li class="warning last"><span>' + soy.$$escapeHtml('Error retrieving breadcrumbs.') + '</span></li>';
};
if (goog.DEBUG) {
  Confluence.Templates.Dialog.breadcrumbError.soyTemplateName = 'Confluence.Templates.Dialog.breadcrumbError';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-link-browser:link-browser-location', location = 'js/link-browser-location.js' */
define("confluence-link-browser/link-browser-location",["jquery","confluence/templates","ajs","confluence/dialog-breadcrumbs"],function(v,w,i,o){return function(x){function j(){return i.escapeHtml(p())}function p(){return d.val()}function q(a){f.closest(".row").toggleClass("hidden",!a);b.toggleClass("has-breadcrumbs",!!a)}function r(){return d.is(":visible")}var b,f,k,e,d,l,s,t,m,g,n,c,h;b=v(w.LinkBrowser.locationPanel());f=b.find("#breadcrumbs-container");k=o.Breadcrumbs(f,o.getBreadcrumbsLegacy);
s=b.find(".link-image");t=b.find(".link-mixed");g=b.find("#link-image-filename");m=b.find("#link-mixed-content");l=b.find(".link-text");d=l.find("input");d.change(function(a){a.keyCode=a.keyCode||a.which;a.keyCode&&13!==a.keyCode&&d.removeClass("default-alias")});return{setLink:function(a,b){i.debug("Link Browser: setting link : "+a);var c=a.attrs["data-linked-resource-default-alias"]||a.getHtml();if(""===j()||d.hasClass("default-alias"))d.addClass("default-alias"),d.val(c);if(b&&a.getResourceId()&&
a.getResourceType()){var u={clearErrors:function(){},error:function(){},select:function(a){k.update(a,u)}},c={id:a.getResourceId(),type:a.getResourceType()};k.update(c,u)}q(b);e=a;x.linkValid(e&&e.isHrefValid())},getLink:function(){if(!e)return null;var a=n;a||((a=j())||(a=e.getDefaultAlias()||e.getHref()),a={html:a});e.body=a;return e},refresh:function(a){e&&q(a)},setLinkBody:function(a){n||(a.isEditable?d.val(a.text):a.isImage?g.text(a.imgName):m.text(a.text),n=a.isEditable?null:a,l.toggleClass("hidden",
!a.isEditable),s.toggleClass("hidden",!a.isImage),t.toggleClass("hidden",a.isEditable||a.isImage))},getContainer:function(){return b},isLinkTextVisible:r,isLinkImageVisible:function(){return g.is(":visible")},isLinkMixedContentVisible:function(){return m.is(":visible")},focusLinkText:function(){return r()?(i.debug("LinkInfoPresenter.focusLinkText focusing alias"),d.select(),!0):!1},getLinkText:j,getRawLinkText:p,getLinkImageName:function(){return g.text()},moveLocationPanel:function(a){c||(c=b.find(".row:not(.hidden) .field-group"),
h=c.parent());a.append(c);b.hide()},restoreLocationPanel:function(){h&&(h.append(c),b.show(),h=c=null)},hasBreadcrumbs:function(a){if(!f.is(":visible"))return!1;var b=a.length,d=f.find("li");if(d.length!==b)return!1;for(var c=0;c<b;c++)if(d.eq(c).text()!==a[c])return!1;return!0}}}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-link-browser:link-browser-location', location = 'templates/link-browser-location.soy' */
// This file was automatically generated from link-browser-location.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.LinkBrowser.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.LinkBrowser == 'undefined') { Confluence.Templates.LinkBrowser = {}; }


Confluence.Templates.LinkBrowser.locationPanel = function(opt_data, opt_ignored) {
  return '<div id="link-browser-location" class="location-info"><form class="aui"><div class="row hidden field-group"><label class="link-location-label" for="breadcrumbs-link">' + soy.$$escapeHtml('Link location') + '</label><div class="breadcrumbs-container" id="breadcrumbs-link"><div class="breadcrumbs-line"><ol id="breadcrumbs-container" class="breadcrumbs"></ol></div></div></div></form><div class="row link-text"><form class="aui" onsubmit="return false;"><div class="field-group"><label for="alias" id="alias-label">' + soy.$$escapeHtml('Link text') + '</label><input type="text" tabindex="0" class="text" name="alias" id="alias"></div></form></div><div class="row link-image hidden"><div class="readonly"><label for="link-image-filename">' + soy.$$escapeHtml('Link image') + '</label><span id="link-image-filename" class="content-type-attachment-image"></span></div></div><div class="row link-mixed hidden"><div class="readonly"><label for="link-mixed-content">' + soy.$$escapeHtml('Link text') + '</label><span id="link-mixed-content"></span></div></div></div>';
};
if (goog.DEBUG) {
  Confluence.Templates.LinkBrowser.locationPanel.soyTemplateName = 'Confluence.Templates.LinkBrowser.locationPanel';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-link-browser:link-browser-tab-advanced-resources', location = 'js/link-browser-tab-advanced.js' */
define("confluence-link-browser/link-browser-tab-advanced",["jquery","ajs","confluence/api/constants","confluence-link-browser/link-object"],function(g,d,k,l){return{dialogCreatedLinkBrowserAdvanced:function(o,e){var b,f,h,j,m=function(a){a=g(a);if(a.length){var c=a.find("a:first");c.length?c.hasClass("unresolved")?(a=c.attr("shortcut-key"),c=c.attr("data-space-key"),a?f.text(d.format("{0} is not a recognised shortcut",a)):c&&f.text(d.format("{0} is not a recognised space",
c))):(a=l.fromNode(c[0],b.val()),e.setLink(a)):f.text("The markup provided is not valid link markup")}},n=function(a,c,b){d.debug("Error during conversion: textStatus = "+c+", errorThrown = "+b);f.text("An internal server error occurred")},i=e.tabs.advanced={createPanel:function(a){h=a.baseElement;b=h.find("input[name='advanced-link']");f=h.find("div[name='advanced-error']");h.find("form").keydown(function(a){13===a.keyCode&&!e.isSubmitButtonEnabled()&&a.preventDefault()});
b.keyup(function(){clearTimeout(j);f.text("");b.val()&&(j=setTimeout(function(){var a={wiki:"["+b.val()+"]",entityId:d.Meta.get("content-id"),spaceKey:d.Meta.get("space-key")};g.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:k.CONTEXT_PATH+"/rest/tinymce/1/wikixhtmlconverter",data:g.toJSON(a),dataType:"text",success:m,error:n,timeout:1E4})},200))})},setLink:function(a){b.val(a);b.keyup();b.change()},getLink:function(){return b.val()},onSelect:function(){e.moveLocationPanel(h.find("form"));
this.openedLink&&(this.openedLink.isShortcutLink()?i.setLink(this.openedLink.getShortcut()):this.openedLink.getResourceId()?i.setLink(this.openedLink.getDefaultAlias()):i.setLink("#"+this.openedLink.getAnchor()),e.setLink(this.openedLink));setTimeout(function(){b.focus()})},onDeselect:function(){e.restoreLocationPanel()},handlesLink:function(a){return a.isShortcutLink()||a.hasAnchor()}}}}});
require("confluence/module-exporter").safeRequire("confluence-link-browser/link-browser-tab-advanced",function(g){require("ajs").bind("dialog-created.link-browser",g.dialogCreatedLinkBrowserAdvanced)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-link-browser:link-browser-tab-advanced-resources', location = 'templates/link-browser-tab-advanced.soy' */
// This file was automatically generated from link-browser-tab-advanced.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.LinkBrowser.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.LinkBrowser == 'undefined') { Confluence.Templates.LinkBrowser = {}; }


Confluence.Templates.LinkBrowser.advancedPanel = function(opt_data, opt_ignored) {
  return '<form class="aui" onsubmit="return false;"><div class="advanced-desc title">' + soy.$$filterNoAutoescape(AJS.format('Here you can insert a link into the page using \x3ca href\x3d\x22{0}\x22 target\x3d\x22_blank\x22\x3ewiki markup\x3c/a\x3e.',"https://confluence.atlassian.com/display/ConfCloud/Links")) + '</div><div class="field-group"><label id="advanced-label" for="advanced-link">' + soy.$$escapeHtml('Link') + '</label><input type="text" tabindex="0" class="text" id="advanced-link" name="advanced-link"><div class="advanced-desc description">' + soy.$$escapeHtml('To insert a link to a new page, type in the desired page title.') + '<br/>' + soy.$$escapeHtml('To insert an anchor link, type #anchorname.') + '</div><div name="advanced-error" class="advanced-error error"></div></div></form>';
};
if (goog.DEBUG) {
  Confluence.Templates.LinkBrowser.advancedPanel.soyTemplateName = 'Confluence.Templates.LinkBrowser.advancedPanel';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-link-browser:link-browser-tab-attachment-resources', location = 'js/link-browser-tab-attachment.js' */
define("confluence-link-browser/link-browser-tab-attachment",["jquery","ajs","confluence-link-browser/link-object","confluence/attachment-uploader","confluence-rest/confluence-rest"],function(h,a,m,n,f){return{dialogCreatedLinkBrowserAttachment:function(o,i){var g=f.REST.makeUrl("content/"+a.Meta.get("attachment-source-content-id")+"/attachments.json"),j,k,l,d;i.tabs.attachments={hasBreadcrumbs:!1,createPanel:function(b,c){var e=b.baseElement.find(".attach-file-form");j=h.extend({getUploaderController:function(){return n({baseElement:e},
function(){return{onUploadSuccess:function(a){for(var b=0,c=a.length;b<c;b++)a[b].type="attachment";d.prependAndSelect(a)}}})}},c&&c(b));k=j.getUploaderController(b);l=k.getMessageHandler();var g=[a.SelectGrid.Column({key:"title",heading:"Name",getHref:function(a){return a.link?f.REST.findLink(a.link):a.url},getInnerClass:function(a){return a.iconClass}}),a.SelectGrid.Column({key:"size",heading:"Size",getText:function(a){return a.niceFileSize}}),
a.SelectGrid.Column({key:"comment",heading:"Comment"})];d=new a.ResultGrid({baseElement:b.baseElement,columns:g,selectionCallback:function(b,c){var d=m.fromREST(c);d.attrs["data-linked-resource-container-id"]=a.Meta.get("content-id");if(h.isArray(c.link))for(var e=0,g=c.link.length;e<g;e++){var f=c.link[e];"download"===f.rel&&(d.attrs.href=f.href)}i.setLink(d);i.focusLinkText()},noResultMessage:"There are no files on this page."})},onSelect:function(){var b=
this.openedLink,c=i.getLink();d.loading();a.getJSONWrap({url:g,messageHandler:l,successCallback:function(e){d.update(e.attachment);c?"attachment"==c.getResourceType()&&d.select(c.getResourceId()):b?d.select(b.getResourceId()):e.attachment.length&&d.select(e.attachment[0].id);a.debug("Loaded attachments")}})},handlesLink:function(b){return b.isToAttachmentOnSamePage(a.Meta.get("content-id"))}}}}});
require("confluence/module-exporter").safeRequire("confluence-link-browser/link-browser-tab-attachment",function(h){var a=require("ajs");"template"!==a.Meta.get("content-type")&&a.bind("dialog-created.link-browser",h.dialogCreatedLinkBrowserAttachment)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-link-browser:link-browser-tab-attachment-resources', location = 'templates/link-browser-tab-attachment.soy' */
// This file was automatically generated from link-browser-tab-attachment.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.LinkBrowser.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.LinkBrowser == 'undefined') { Confluence.Templates.LinkBrowser = {}; }


Confluence.Templates.LinkBrowser.attachmentsPanel = function(opt_data, opt_ignored) {
  return '<div class="attach-file-form"><form method="post" enctype="multipart/form-data" id="attachments-attachfile-form" action="' + soy.$$escapeHtml("/wiki") + '/pages/attachfile.action" class="aui"><p>' + soy.$$escapeHtml('Link to a file that is attached to this page or attach a new one.') + '</p><div class="upload-field field-group"><label for="file_0">' + soy.$$escapeHtml('Upload file') + '</label><label id="fancy-file-upload" class="ffi" data-ffi-button-text="Browse"><input type="file" name="file_0" id="file_0"></label><input type="hidden" name="minorEdit_0" value="true"></div><input type="hidden" name="atl_token" value="' + soy.$$escapeHtml(opt_data.atlToken) + '" /></form><div class="upload-in-progress upload-field hidden">' + soy.$$escapeHtml('Upload in progress\u2026') + '</div><div class="warning"><ul class="hidden message-panel"></ul></div></div><div class="message-panel hidden"></div><div id="attachments-table" class="attachment-list data-table"></div>';
};
if (goog.DEBUG) {
  Confluence.Templates.LinkBrowser.attachmentsPanel.soyTemplateName = 'Confluence.Templates.LinkBrowser.attachmentsPanel';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-link-browser:link-browser-tab-history-resources', location = 'js/link-browser-tab-history.js' */
define("confluence-link-browser/link-browser-tab-history",["ajs","confluence-rest/confluence-rest","confluence-link-browser/link-object"],function(b,h,i){return{dialogCreatedLinkBrowserHistory:function(j,d){var e=h.REST.makeUrl("session/history.json?max-results=20"),f,g;d.tabs.recentlyviewed={createPanel:function(c){var e=[b.SelectGrid.Column({key:"title",heading:"Title",getHref:function(a){return h.REST.findLink(a.link)},getInnerClass:function(a){return a.iconClass||
"content-type-"+a.type}}),b.SelectGrid.Column({key:"space",heading:"Space",getText:function(a){return a.space&&a.space.title||""}}),b.SelectGrid.Column({key:"last-modified",heading:"Last Modified",getText:function(a){return a.lastModifiedDate&&a.lastModifiedDate.friendly||""},getTitle:function(a){return a.lastModifiedDate&&a.lastModifiedDate.date||""}})];g=b.MessageHandler({baseElement:c.baseElement.find(".message-panel")});
f=new b.ResultGrid({baseElement:c.baseElement,columns:e,getRowId:function(a){return a.attachmentId},selectionCallback:function(a,b){var c=i.fromREST(b);d.setLink(c);d.focusLinkText()},messageHandler:g,noResultMessage:"You have no recently viewed content."})},onSelect:function(){f.loading();b.getJSONWrap({url:e,messageHandler:g,successCallback:function(c){f.update(c.content);b.trigger("updated.link-browser-recently-viewed")}})}}}}});
require("confluence/module-exporter").safeRequire("confluence-link-browser/link-browser-tab-history",function(b){require("ajs").bind("dialog-created.link-browser",b.dialogCreatedLinkBrowserHistory)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-link-browser:link-browser-tab-history-resources', location = 'templates/link-browser-tab-history.soy' */
// This file was automatically generated from link-browser-tab-history.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.LinkBrowser.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.LinkBrowser == 'undefined') { Confluence.Templates.LinkBrowser = {}; }


Confluence.Templates.LinkBrowser.recentlyviewedPanel = function(opt_data, opt_ignored) {
  return '<div class="recently-viewed-panel"><div class="message-panel hidden"></div><div class="data-table"></div></div>';
};
if (goog.DEBUG) {
  Confluence.Templates.LinkBrowser.recentlyviewedPanel.soyTemplateName = 'Confluence.Templates.LinkBrowser.recentlyviewedPanel';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.web.resources:page-location', location = 'includes/js/page-location.js' */
define("confluence/page-location",["ajs","confluence/meta"],function(c,a){var b=null;return{get:function(){return b?b:{spaceName:a.get("space-name"),spaceKey:a.get("space-key"),parentPageTitle:a.get("parent-page-title")}},set:function(a){b=a}}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-link-browser:link-browser-tab-search-resources', location = 'js/link-browser-tab-search.js' */
define("confluence-link-browser/link-browser-tab-search","jquery ajs document confluence/page-location confluence-rest/confluence-rest confluence-link-browser/link-object confluence/autocomplete-content".split(" "),function(d,b,o,p,l,m,q){return{dialogCreatedLinkBrowserSearch:function(o,i){var c,e,f,n,r=l.REST.getBaseUrl()+"search.json",j=function(a,b){m.isLink(a)||(a=m.fromREST(a));b&&c.val(a.attrs["data-linked-resource-default-alias"]);i.setLink(a,true);i.focusLinkText()},k=function(a){b.debug("link-browser-tab-search.js: doing search");
c.trigger("hide.autocomplete");var g=d.trim(c.val());if(g){f.loading();b.getJSONWrap({url:r,data:{search:"site",query:g,spaceKey:e.val()},successCallback:function(b){if(d.isFunction(a)){f.update(b.result);a()}else f.updateAndSelect(b.result);c.trigger("hide.autocomplete")},messageHandler:n})}else d.isFunction(a)&&a()};i.tabs.search={hasBreadcrumbs:true,createPanel:function(a){var g=a.baseElement;c=g.find("#link-search-text");e=g.find("#search-panel-space");var h=p.get();e.find("option:eq(1)").text(h.spaceName).val(h.spaceKey);
e.change(function(){c.attr("data-spacekey",e.val());c.trigger("clearCache.autocomplete")});q.autocompleteSearch(c.parent());c.bind("selected.autocomplete-content",function(a,b){if(b.searchFor)k();else{f.clear();j(b.content,false)}});h=[b.SelectGrid.Column({key:"title",heading:"Title",getHref:function(a){return l.REST.findLink(a.link)},getInnerClass:function(a){return a.iconClass||"content-type-"+a.type}}),b.SelectGrid.Column({key:"space",heading:"Space",
getText:function(a){return a.space&&a.space.title||""}}),b.SelectGrid.Column({key:"last-modified",heading:"Last Modified",getText:function(a){return a.lastModifiedDate&&a.lastModifiedDate.friendly||""},getTitle:function(a){return a.lastModifiedDate&&a.lastModifiedDate.date||""}})];n=b.MessageHandler({baseElement:a.baseElement.find(".message-panel")});f=new b.ResultGrid({baseElement:a.baseElement,columns:h,selectionCallback:function(a,b){j(b)},noResultMessage:"No search results found.",
dontShiftFocus:function(){return d(c).add(e).is(":focus")}});g.find(".search-form").submit(function(){k();return false}).keydown(function(a){if(a.keyCode===13&&!d(".aui-dropdown:visible .active",this).length){d("#search-panel-button").focus();a.stopPropagation()}})},onSelect:function(){b.debug("Link Browser Search panel selected");var a=this.openedLink;if(a){b.debug("Link Browser Search panel setting link info");j(a,true)}else c.focus()},handlesLink:function(a){return a.isCustomAtlassianContentLink()&&
!a.hasAnchor()&&!a.isShortcutLink()&&!a.isToAttachmentOnSamePage(b.Meta.get("content-id"))},doSearch:function(a,b){c.val(a);k(b)},isResultGridVisible:function(){return f.isVisible()},getSearchTextField:function(){return c}}}}});require("confluence/module-exporter").safeRequire("confluence-link-browser/link-browser-tab-search",function(d){require("ajs").bind("dialog-created.link-browser",d.dialogCreatedLinkBrowserSearch)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-link-browser:link-browser-tab-search-resources', location = 'templates/link-browser-tab-search.soy' */
// This file was automatically generated from link-browser-tab-search.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.LinkBrowser.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.LinkBrowser == 'undefined') { Confluence.Templates.LinkBrowser = {}; }


Confluence.Templates.LinkBrowser.searchPanel = function(opt_data, opt_ignored) {
  return '<form class="aui search-form" onsubmit="return false;"><fieldset class="inline"><div class="search-input"><label for="link-search-text" id="linkSearch-label" class="assistive">' + soy.$$escapeHtml('Search') + '</label><input id="link-search-text" type="text" tabindex="0" class="text autocomplete-search" name="linkSearch" autocomplete="off" data-search-link-message="' + soy.$$escapeHtml('Search for \x26lsquo;{0}\x26rsquo;') + '"></div><select tabindex="0" class="search-space select" id="search-panel-space"><option value="">' + soy.$$escapeHtml('All content') + '</option><option value=""> </option></select><button type="submit" tabindex="0" class="aui-button" id="search-panel-button">' + soy.$$escapeHtml('Search') + '</button></fieldset></form><div class="message-panel hidden"></div><div id="search-results-table" class="data-table hidden"></div>';
};
if (goog.DEBUG) {
  Confluence.Templates.LinkBrowser.searchPanel.soyTemplateName = 'Confluence.Templates.LinkBrowser.searchPanel';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-link-browser:link-browser-tab-weblink-resources', location = 'js/link-browser-tab-weblink.js' */
define("confluence-link-browser/link-browser-tab-weblink",["ajs","jquery","confluence-link-browser/link-object"],function(c,j,h){return{dialogCreatedLinkBrowserWeblink:function(l,d){function e(){return j.trim(b.val())}function f(){var a=e();if(!(c.Validate.url(a)||0===a.indexOf("mailto:"))){if(c.Validate.email(a))a="mailto:"+a;else{if(k.test(a))return;a="http://"+a}c.debug("Updating Link Browser Web Link URL to: "+a);b.val(a);a=h.makeExternalLink(a);d.setLink(a)}}var b,g,i,k=/[:/]/;i=d.tabs.weblink=
{createPanel:function(a){g=a.baseElement;b=g.find("input[name='destination']");b.keyup(function(){var a=e();(a=a?h.makeExternalLink(a):null)&&d.setLink(a)});b.change(f);b.bind("paste",function(){c.debug("Link Browser web link url pasted");setTimeout(f,0)})},onSelect:function(){d.moveLocationPanel(g.find("form"));this.openedLink&&(i.setURL(this.openedLink.attrs.href),d.setLink(this.openedLink));setTimeout(function(){b.focus()})},onDeselect:d.restoreLocationPanel,preSubmit:f,handlesLink:function(a){return!a.isCustomAtlassianContentLink()},
setURL:function(a){b.val(a);b.keyup();b.change()},getURL:e}}}});require("confluence/module-exporter").safeRequire("confluence-link-browser/link-browser-tab-weblink",function(c){require("ajs").bind("dialog-created.link-browser",c.dialogCreatedLinkBrowserWeblink)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-link-browser:link-browser-tab-weblink-resources', location = 'templates/link-browser-tab-weblink.soy' */
// This file was automatically generated from link-browser-tab-weblink.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.LinkBrowser.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.LinkBrowser == 'undefined') { Confluence.Templates.LinkBrowser = {}; }


Confluence.Templates.LinkBrowser.weblinkPanel = function(opt_data, opt_ignored) {
  return '<form class="aui" onsubmit="return false;"><div class="field-group"><label id="destination-label" for="weblink-destination">' + soy.$$escapeHtml('Address') + '</label><input type="text" tabindex="0" class="text" id="weblink-destination" name="destination"><div class="web-link-desc description">' + soy.$$escapeHtml('Web, email or any other internet address') + '</div></div></form>';
};
if (goog.DEBUG) {
  Confluence.Templates.LinkBrowser.weblinkPanel.soyTemplateName = 'Confluence.Templates.LinkBrowser.weblinkPanel';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-link-browser:link-browser', location = 'js/link-browser.js' */
define("confluence-link-browser/link-browser","ajs confluence/templates confluence-editor/atlassian-editor-bookmark-manager confluence-link-browser/link-adapter confluence-link-browser/link-browser-location jquery".split(" "),function(b,s,u,v,w,h){function q(){if(!e.prop("disabled")){e.prop("disabled",true);b.debug("link-browser.js: submit");i.preSubmit&&i.preSubmit();var a=f.getLink();k.hide().remove();n.restoreBookmark();r.setLink(a);b.trigger("closed.link-browser")}}function o(){k.hide().remove();
n.restoreBookmark();b.trigger("closed.link-browser")}function x(a,e,l){var c=e.key,e=e.label,d=c+"-panel",g=s.LinkBrowser[c+"Panel"]({atlToken:b.Meta.get("atl-token")});k.addPanel(e,g,d,d+"-id");var a=k.get("panel:"+a),j=l.tabs[c];j.panelObj=a;j.key=c;j.createPanel({baseElement:h(a[0].body)});a[0].onblur=j.onDeselect;a[0].onselect=function(){var a=!!j.hasBreadcrumbs;b.debug("Link Browser: on tab select, breadcrumbs enabled: "+a);j.onSelect();f.refresh(a);i=j};return j}var k,f,e,i,r,n;return{SEARCH_PANEL:"search",
ATTACHMENTS_PANEL:"attachments",WEBLINK_PANEL:"weblink",ADVANCED_PANEL:"advanced",open:function(a){h(function(){h('.ffi input[type="file"]#file_0').fancyFileInput()});if(h(".aui-dialog:visible").length)return null;a=a||{};r=a.linkAdapter||v;n=a.bookmarkManager||u;n.storeBookmark();a.linkInfo=a.linkInfo||r.getLink();if(a.opener)return a.opener(a.linkInfo.alias,a.linkInfo);var p=a,a={tabs:{},setLink:function(a,b){f.setLink(a,b)},getLink:function(){return f.getLink()},getSelectedDataTableItem:function(){return h(".data-table:visible tr.selected")},
linkValid:function(a){e.prop("disabled",!a)},focusLinkText:function(){if(!f.focusLinkText()){b.debug("LinkBrowser: focusing submit button");e.focus()}},getLinkText:function(){return f.getLinkText()},isLinkTextVisible:function(){return f.isLinkTextVisible()},hasBreadcrumbs:function(a){return f.hasBreadcrumbs(a)},getLocationPresenter:function(){return f},doSearch:function(a){this.tabs.search.doSearch(a)},getSearchTextField:function(){return this.tabs.search.getSearchTextField()},moveLocationPanel:function(a){f.moveLocationPanel(a)},
restoreLocationPanel:function(){f.restoreLocationPanel()},gotoPanel:function(a){this.popup.gotoPanel(a)},getCurrentPanel:function(){return this.popup.getCurrentPanel()},setWebLinkURL:function(a){var c=this.tabs.weblink;i!=c?b.debug("Cannot set URL "+a+" on hidden Web Link panel"):c.setURL(a)},getWebLinkUrl:function(){var a=this.tabs.weblink;if(i!=a){b.debug("Cannot get URL on hidden Web Link panel");return null}return a.getURL()},getTitle:function(){return this.popup.getTitle()},getSubmitButtonText:function(){return e.text()},
isSubmitButtonEnabled:function(){return e.is(":enabled")},isVisible:function(){return this.popup.isVisible()},getAdvancedTextField:function(){var a=this.tabs.advanced;if(i!=a){b.debug("Cannot get link text on hidden advanced panel");return null}return a.getLink()},setAdvancedTextField:function(a){var c=this.tabs.advanced;i!=c?b.debug("Cannot set link text on hidden advanced panel"):c.setLink(a)},submit:q,cancel:o},l=p.linkInfo,c=l.isNewLink(),d,g;d=new b.ConfluenceDialog({width:840,height:590,id:"insert-link-dialog",
onCancel:o,onSubmit:q});g=c?"Insert link":"Edit link";c=c?"Insert":"Save";d.addHeader(g);d.addButton(c,q);d.addCancel("Cancel",o);d.addHelpText("Hint: type \"[\" in the editor to see a list of suggested pages and insert a link.");g=h("#insert-link-dialog .dialog-tip");g.attr("title",g.text());h("#insert-link-dialog .dialog-components .dialog-title").prepend(s.LinkBrowser.helpLink());
e=d.get("button:0")[0].item;e.attr("id","link-browser-insert");e.prop("disabled",true);k=d;a.popup=k;b.trigger("dialog-created.link-browser",[a]);f=w(a);f.setLinkBody(l.body);p=p.panelKey;d=h("#link-browser-tab-items").find("div").map(function(){var a=h(this);return{key:a.text(),weight:a.attr("data-weight"),label:this.title}}).sort(function(a,b){return a.weight-b.weight});var j=b.Meta.get("content-type")!=="template";d=h.grep(d,function(a){return j||a.key!=="attachments"});var t;g=null;for(var c=
0,y=d.length;c<y;c++){var m=x(c,d[c],a);c===0&&(t=m);if(!l.isNewLink()&&h.isFunction(m.handlesLink)&&m.handlesLink(l)){g=m;m.openedLink=l}else p==m.key&&(g=m)}g?a.popup.overrideLastTab():g=t;i=g;k.popup.element.find(".dialog-page-body:first").append(f.getContainer());i.panelObj.select();i.openedLink=null;k.show();b.trigger("dialog-shown.link-browser",k);return a},cancel:o}});require("confluence/module-exporter").exportModuleAsGlobal("confluence-link-browser/link-browser","Confluence.Editor.LinkBrowser");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-link-browser:link-browser', location = 'templates/link-browser.soy' */
// This file was automatically generated from link-browser.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.LinkBrowser.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.LinkBrowser == 'undefined') { Confluence.Templates.LinkBrowser = {}; }


Confluence.Templates.LinkBrowser.helpLink = function(opt_data, opt_ignored) {
  return '<div class="dialog-help-link"><a href="' + soy.$$escapeHtml("https://confluence.atlassian.com/display/ConfCloud/Links") + '" target="_blank">' + soy.$$escapeHtml('Help') + '</a></div>';
};
if (goog.DEBUG) {
  Confluence.Templates.LinkBrowser.helpLink.soyTemplateName = 'Confluence.Templates.LinkBrowser.helpLink';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-link-browser:link-browser-editor-resources', location = 'tinymce/editor_plugin_src.js' */
define("confluence-link-browser/tinymce/editor_plugin_src",["tinymce","confluence-link-browser/link-browser"],function(a,b){return{init:function(a){a.addButton("linkbrowserButton",{title:"confluence.conflink_desc",cmd:"mceConflink","class":"mce_conflink"});a.addCommand("mceConflink",b.open);a.addCommand("mceConfAttachments",function(){return b.open({panelKey:b.ATTACHMENTS_PANEL})})},getInfo:function(){return{longname:"Confluence Link Browser",author:"Atlassian",authorurl:"http://www.atlassian.com",
version:a.majorVersion+"."+a.minorVersion}}}});require("confluence/module-exporter").safeRequire("confluence-link-browser/tinymce/editor_plugin_src",function(a){var b=require("tinymce");b.create("tinymce.plugins.LinkBrowser",a);b.PluginManager.add("linkbrowser",b.plugins.LinkBrowser)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-create-content-plugin:editor-resources', location = 'com/atlassian/confluence/plugins/createcontent/js/move-hidden-fields-hack.js' */
AJS.toInit(function(a){a("fieldset.create-content-template-fields > input").appendTo("form.editor")});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-create-content-plugin:create-from-template-macro-browser-resources', location = 'com/atlassian/confluence/plugins/createcontent/js/create-from-template-macro-fields.js' */
AJS.toInit(function(f){function b(h,i){h=h||AJS.Meta.get("space-key");Confluence.Blueprint.Dialog.requestWebItems(h,false).done(function(j){var k=Confluence.Blueprint.Dialog.loadedWebitems[h];if(_.isEmpty(k)){AJS.log("create-from-template-macro-fields: No Create dialog web items found for spaceKey >"+h+"<");return}i(j,k)}).fail(function(){AJS.log("create-from-template-macro-fields: requestWebItems call for spaceKey >"+h+"< failed")})}function c(h,i){b(i,function(k,l){var j=h.val();h.empty();_.each(l,function(m){var o=m.itemModuleCompleteKey;if((o=="com.atlassian.confluence.plugins.confluence-create-content-plugin:create-blank-page"||o=="com.atlassian.confluence.plugins.confluence-create-content-plugin:create-blog-post")){return}if(!(m.templateId||m.contentBlueprintId)){return}var n=f("<option></option>").text(m.name);n.attr("data-template-id",m.templateId);n.attr("data-blueprint-module-complete-key",m.blueprintModuleCompleteKey);n.attr("data-content-blueprint-id",m.contentBlueprintId);n.attr("data-create-result",m.createResult);n.val(m.templateId||m.contentBlueprintId);h.append(n)});h.val(j)})}var g={fields:{spacekey:{spaceKey:function e(k){var j=AJS.MacroBrowser.ParameterFields.spacekey(k),h=j.input.val();var i=function(){var l=j.input.val();if(l!=h){c(AJS.MacroBrowser.fields.templateName.input,l)}h=l};j.input.bind("selected.autocomplete-content",i);j.input.blur(i);return j}}},beforeParamsSet:function a(i,h){i.buttonLabel=i.buttonLabel||i.createButtonLabel||"Create from template";c(f("#macro-param-templateName"),i.spaceKey);return i},beforeParamsRetrieved:function d(j,k,h){var i=AJS.MacroBrowser.fields.templateName.input.find("option:selected");j.blueprintModuleCompleteKey=i.data("blueprint-module-complete-key");j.contentBlueprintId=i.data("content-blueprint-id");j.templateId=i.data("template-id");j.createResult=i.data("create-result");return j}};AJS.MacroBrowser.setMacroJsOverride("create-from-template",g)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:table-resizable-plugin', location = 'tinymce3/plugins/table/table-resizable.js' */
define("confluence-editor/tinymce3/plugins/table/table-resizable",["jquery","ajs","tinymce","confluence/analytics-support"],function(c,k,u,L){function E(b){var g=0;b.find(">tbody >tr").each(function(){var a=0;c(this).find(">th,>td").each(function(){var b=c(this);b.attr("colspan")?a+=parseInt(b.attr("colspan")):a++});a>g&&(g=a)});var a=b.find(">colgroup"),d=a.find("col"),f=d.length;if(f!==g){var h=0<a.length;h||(a=c("<colgroup>"));if(g>f)for(d=0;d<g-f;d++){var i=c("<col>");a.append(i)}else for(i=0;i<
f-g;i++)d.last().remove();h||b.prepend(a);return a}}function x(b,g,a){var d=b.find(">colgroup>col");0===d.length&&(E(b),d=b.find(">colgroup>col"));for(var f=d.length,h,i,j,l=b.find(">thead>tr,>tbody>tr,>tr"),e=0;e<l.length;e++)if(f===l.eq(e).find(">th, >td").length){h=l.eq(e);break}if(h)i=h.find(">th, >td");else{h=c("<tr>");j=c("<tfoot>");j.append(h);for(e=0;e<f;e++)h.append(c("<td>"));b.append(j);i=h.find(">td")}h=b.outerWidth()-1;for(var l=[],k=[],e=0;e<f;e++){var p=i.eq(e),q=p[0].getBoundingClientRect(),
p=g?100*(q.width/h)+"%":p.outerWidth();l[e]=p;k[e]=q}g=0;u.activeEditor&&(g=u.activeEditor.getWin().pageXOffset);for(e=0;e<f;e++)d.eq(e).attr("data-resize-pixel",k[e].width).attr("data-resize-percent",100*(k[e].width/h)).attr("data-offset-left",k[e].left+g).attr("data-offset-right",k[e].right+g).removeAttr("data-mce-style"),(!a||!(e!==a.index()||e!==a.next().index()))&&d.eq(e).css({width:l[e]});j&&j.remove();b.removeAttr("data-mce-style")}function F(b){b.find(".resize-alignment-bar").remove()}var M=
function(b){var g={$doc:c(document)},a=this,d=a.data("uuid");if(!a.data("initialized")){if(!d){var f=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)},d=f()+f()+"-"+f()+"-"+f()+"-"+f()+"-"+f()+f()+f();a.data("uuid",d)}var b=c.extend(g,b||{}),h=b.$doc,i=b.editor,j=h.find("body"),l=!1,e,u,p,q,y,m=-1,z=!1,G,A,B,H,v=c('<div contenteditable="false" class="synchrony-exclude" id="resize-indicator">'),D=c('<div contenteditable="false" class="synchrony-exclude resize-width-holder" unselectable="on">'),
I,r=!1,s=function(){v.remove();a.removeClass("active-resizable");r=!1;A=void 0;y=q=null;j.attr("data-table-resizing",!1)},J=function(b){0<h.find("#resize-indicator").length?v=h.find("#resize-indicator"):v.appendTo(j);a.addClass("active-resizable");v.css({top:parseInt(a.offset().top),left:b,height:a.height()});r=!0},K=function(b){j.outerWidth(!0)!==j[0].scrollWidth&&(b&&C(a),j.find("#"+d+"-holder").length||(D.css("width",a.width()+parseInt(c(i.getBody()).css("margin-right"))),D.attr("id",d+"-holder"),
a.after(D)))};a.on("mousemove.table-resizable"+d,"th, td",function(b){if(!l&&!(1<c(this).parents("table.confluenceTable").length)&&(w(a)||t(a)||!k.DarkFeatures.isEnabled("confluence.table.resizable.hide-indicator-on-fluid"))){E(a);var d=c(this),o=d.offset().left,g=Math.round(v.outerWidth()/2),f=d.index(),h=d.parent().children();m=-1;var j=d.closest("tr").index();d.closest("table.confluenceTable tr").prevAll("tr").each(function(){var a=c(this),b=a.index();a.children("td, th").each(function(){if(d.offset().left>
c(this).offset().left){var a=parseInt(c(this).attr("colspan")),e=parseInt(c(this).attr("rowspan"));a&&e?b+e>j&&(f+=a):e&&b+e>j&&(f+=1)}})});z=!1;if(b.pageX-d.offset().left<d.outerWidth()/2){f-=1;if(0===f&&d.prev().hasClass("numberingColumn"))return;if(0>f){z=!0;var i=h.eq(0);i.attr("colspan")?m+=parseInt(i.attr("colspan")):m++}else for(var n=0;n<=f;n++)i=h.eq(n),i.attr("colspan")?m+=parseInt(i.attr("colspan")):m++;o=z?o+d.outerWidth()-g:o-g}else{if(0===f&&d.hasClass("numberingColumn"))return;for(n=
0;n<=f;n++)i=h.eq(n),i.attr("colspan")?m+=parseInt(i.attr("colspan")):m++;o=o+d.outerWidth()-g}e=d.closest("table").find("col").eq(m);1>=Math.abs(G-o)?r?4>=Math.abs(b.pageX-o-g)||s():4>=Math.abs(b.pageX-o-g)&&J(o):4>=Math.abs(b.pageX-o-g)?J(o):s();G=o;t(a)&&K()}});a.on("mousedown.table-resizable"+d,function(b){if(e&&r){I=t(a)?"fixed":w(a)?"relative":"fluid";l=!0;x(a);a.updateTableModeInToolbar();k.DarkFeatures.isEnabled("confluence.table.resizable.relative.keep.width")?e.next().length||a.css({width:""}):
a.css({width:""});u=b.pageX;a[0].setCapture&&a[0].setCapture();h.find("body").attr("data-table-resizing",!0);p=parseInt(e.width(),10);parseInt(e.next().width(),10);parseInt(v.css("left"));var d=a.nextAll(".confluenceTable").first(),f=a.prevAll(".confluenceTable").first();H=c.merge(f,d);b.preventDefault()}});a.on("mouseout.table-resizable"+d,function(){l||s()});h.on("keypress.table-resizable"+d,function(){r&&s()});h.on("mousemove.table-resizable"+d,function(b){if(l){k.trigger("synchrony.stop",{id:"confluence.table-resize-plugin"});
a:{var d=b.pageX-u;p||(p=e.width());e.attr("data-mce-style")&&e.removeAttr("data-mce-style");var f=!1;if(B){var g=d-B,i=a.parent().width(),i=100*(a.width()/i);w(a)&&(99.9<i&&1<g)&&(f=!0,!y&&(y=e.width()+e.next().width()));g=Math.abs(Math.abs(d)-Math.abs(B));7<=g&&(A=!1);if(A&&7>g)break a}g=p+d;29>g&&(g=29);e.width(g);if(f||q)e.next().width(y-g),!q&&(q=b.pageX);q&&q>b.pageX&&(q=null);x(a,!1,e);if(!z&&(v.css({display:"block",top:parseInt(a.offset().top),left:parseInt(e.attr("data-offset-right"))-1,
height:a.height()}),t(a))){var m=e,r={},s=!1;H.each(function(){var a=c(this);t(a)&&a.find("th, td").each(function(){if(!r[a]){var b=c(this),b=b.offset().left+b.innerWidth();0>=Math.abs(b-parseInt(m.attr("data-offset-right")))&&(s=r[a]=!0,c('<div contenteditable="false" class="resize-alignment-bar">').css({top:parseInt(a.offset().top),left:b,height:a.height()}).appendTo(h.find("body")))}})});if(!(f=s)){var f=e,n;1>=Math.abs(parseInt(f.next().attr("data-resize-pixel"))-parseInt(f.attr("data-resize-pixel")))&&
(n=!0,j.find(".resizable-align-right").remove(),c('<div contenteditable="false" class="resize-alignment-bar resizable-align-right">').css({height:a.height(),top:parseInt(a.offset().top),left:parseInt(f.next().attr("data-offset-right"))-1}).appendTo(j).clone().css({left:parseInt(f.attr("data-offset-left"))-1}).appendTo(j));1>=Math.abs(parseInt(f.prev().attr("data-resize-pixel"))-parseInt(f.attr("data-resize-pixel")))&&(n=!0,c('<div contenteditable="false" class="resize-alignment-bar">').css({height:a.height(),
top:parseInt(a.offset().top),left:parseInt(f.prev().attr("data-offset-right"))-1}).appendTo(j).clone().css({left:parseInt(f.prev().attr("data-offset-left"))-1}).appendTo(j));f=n}(n=f)&&(A=!0);!n&&F(j)}B=Math.abs(d)}b.preventDefault()}});h.on("mouseup.table-resizable"+d,function(){if(l){a[0].releaseCapture&&a[0].releaseCapture();l=!1;s();F(h);C(a);e&&e.width()!==p&&(!w(a)&&!t(a)&&a.addClass("relative-table"),L.publish("confluence.table.resize.from."+I,{pageId:k.Meta.get("page-id")}));if(w(a)){var b=
a.parent().width(),b=100*(a.width()/b);100<b&&(b=100);a.css({width:b+"%"}).attr("data-resize-percent",b);x(a,!0)}t(a)&&K(!0);i&&(i.undoManager.add(),k.trigger("synchrony.start",{id:"confluence.table-resize-plugin"}))}});a.data("initialized",!0);return this}},C=function(b){b.parent("body").find("#"+b.data("uuid")+"-holder").remove();return b},w=function(b){return b.hasClass("relative-table")},t=function(b){return b.hasClass("fixed-table")},N=function(b){var g={$doc:c(document)},b=c.extend(g,b||{}),
b=b.$doc,g=this.data("uuid");b.find("#resize-indicator").remove();this.off("mousemove.table-resizable"+g);this.off("mouseout.table-resizable"+g);this.off("mousedown.table-resizable"+g);b.off("keypress.table-resizable"+g);b.off("mousemove.table-resizable"+g);b.off("mouseup.table-resizable"+g);this.data("initialized",!1);return this},O=function(){C(c(this)).removeClass("relative-table fixed-table").removeAttr("style").find(">colgroup").remove();return this},P=function(){var b=c(this);C(b);x(b);b.css("width",
"").removeClass("relative-table").addClass("fixed-table");return this},Q=function(){var b=require("confluence-editor/i18n/translations.i18n");this.parent().closest("table.confluenceTable").length?(c("#table-mode-picker .dropdown-text").text(b.table.responsive),c("#table-mode-picker .aui-dd-parent").addClass("disabled")):(c("#table-mode-picker .aui-dd-parent").removeClass("disabled"),t(this)?c("#table-mode-picker .dropdown-text").text(b.table.fixed_width):c("#table-mode-picker .dropdown-text").text(b.table.responsive))},
R=function(b,g,a){a.content&&(b=c("<div/>").append(a.content),b.find("table.confluenceTable.relative-table, table.confluenceTable.relative-table > colgroup > col").each(function(){var a=c(this);a.data("resize-percent")?a.css({width:a.data("resize-percent")+"%"}):a.attr("style",a.data("mce-style"))}),a.content=b.html())};return{createJQueryPlugin:function(){c.fn.tableResizable=M;c.fn.removeTableResizable=N;c.fn.toggleFluidColumnWidth=O;c.fn.toggleFixedColumnWidth=P;c.fn.updateTableModeInToolbar=Q},
initTableResize:function(b,g){var a=c(g.editor.getWin().document),d=g.editor;d.onChange.add(function(){var b=d.selection.getNode(),b=c(b).parent().closest("table.confluenceTable").not("table.confluenceTable table.confluenceTable");b.is(".confluenceTable")&&b.removeTableResizable({$doc:a}).tableResizable({$doc:a,editor:d,force:!0})});k.bind("confluence.editor.on.save",function(){a.find("table.confluenceTable").each(function(){c(this).removeTableResizable({$doc:a})});a.find("#resize-indicator").remove();
a.find(".resize-width-holder").remove();c(d.getBody()).removeAttr("data-table-resizing")});a.on("mousemove","table.confluenceTable",function(){var b=c(this);b.parents("table.confluenceTable").length||b.data("initialized")||b.tableResizable({$doc:a,editor:d})});u.isWebKit&&c(document).bind("prePaste",R);u.isIE&&c('<style type="text/css"></style>').html(".confluenceTable td, .confluenceTable th {overflow: hidden !important;}.confluenceTable .content-wrapper {overflow-x : visible !important}").appendTo(a.find("head"));
return this}}});require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/table/table-resizable",function(c){var k=require("ajs");k.DarkFeatures.isEnabled("confluence.table.resizable")&&(c.createJQueryPlugin(),k.bind("init.rte",c.initTableResize))});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:search-ms-edge', location = 'tinymce3/plugins/searchreplace/search-ms-edge.js' */
define("confluence-editor/tinymce3/plugins/searchreplace/search-ms-edge",[],function(){function j(a){var c=[];if(a.nodeType===Node.TEXT_NODE)c.push(a);else for(var a=a.childNodes,b=0,d=a.length;b<d;++b)c.push.apply(c,j(a[b]));return c}function n(a){return a.nodeValue.toLowerCase()}return{search:function(a,c,b,d,f){var k=a.getSel(),d=j(d),c=c.replace(/\s/g,"").toLowerCase(),e=d.map(n).join(""),a=a.getRng();a.endContainer.nodeValue&&(a=e.indexOf(a.endContainer.nodeValue.toLowerCase())+a.endOffset,b=
b!==a&&-1!==b?a:b);var a=c,h=f?e.lastIndexOf(a,b-1):e.indexOf(a,b+1);0>h&&!f?h=e.indexOf(a):0===h&&(0===b&&f)&&(h=e.lastIndexOf(a));f=h;if(0>f)return[!1,f];a:{for(var g,i,l,m,b=e=0;b<d.length;b++)if(d[b].nodeType===Node.TEXT_NODE&&(a=f+c.length,!i&&d[b].length+e>=a&&(i=d[b],m=a-e),!g&&d[b].length+e>f&&(g=d[b],l=f-e),e+=d[b].length),g&&i){c={startNode:g,startIndex:l,endNode:i,endIndex:m};break a}c=void 0}g=document.createRange();g.setStart(c.startNode,c.startIndex);g.setEnd(c.endNode,c.endIndex);k.removeAllRanges();
k.addRange(g);g.startContainer.parentNode.scrollIntoView();return[!0,f]}}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-autocomplete-resources-only', location = 'tinymce3/plugins/autocomplete/autocomplete-settings.js' */
define("confluence-editor/tinymce3/plugins/autocomplete/autocomplete-settings",["ajs"],function(b){return{Settings:{},log:function(d){return function(e,f,a){var c=null!=a&&"object"!==typeof a;b.debug(d+" - "+e+" : "+(f||null)+(null!=a?c?" = "+a:" >":""));a&&!c&&b.debug(a)}}}});require("confluence/module-exporter").exportModuleAsGlobal("confluence-editor/tinymce3/plugins/autocomplete/autocomplete-settings","Confluence.Editor.Autocompleter");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-autocomplete-resources-only', location = 'tinymce3/plugins/autocomplete/autocomplete-util.js' */
define("confluence-editor/tinymce3/plugins/autocomplete/autocomplete-util",["jquery","confluence-rest/confluence-rest"],function(k,f){var h=function(a,c,g,b,d){var e;a.statusMessage?e=[[{html:a.statusMessage,className:"error"}]]:(a=c?f.REST.makeRestMatrixFromSearchData(a):f.REST.makeRestMatrixFromData(a,b),e=f.REST.convertFromRest(a));g(e,c,function(a,b){d&&typeof d==="function"&&d(e,a,b)})};return{dropdownLink:function(a,c,g){return"<a href='#' class='"+(c||"")+"'><span class='icon "+(g||"")+"'></span><span>"+
a+"</span></a>"},getRestData:function(a,c,g,b,d,e,f){var i=c(b),j=a.settings.cacheManager,c=j.get(b);i?(a=k.ajax({type:"GET",url:i,data:g(a,b),dataType:"json",global:!1,timeout:5E3}),a.done(function(a){j.put(b,a)}),c?h(c,b,d,e,f):(a.done(function(a){h(a,b,d,e,f)}),a.fail(function(a,c){"timeout"==c&&h({statusMessage:"Timeout",query:b},b,d,e)}))):d([],b)}}});require("confluence/module-exporter").exportModuleAsGlobal("confluence-editor/tinymce3/plugins/autocomplete/autocomplete-util","Confluence.Editor.Autocompleter.Util");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-autocomplete-resources-only', location = 'tinymce3/plugins/autocomplete/autocomplete-control.js' */
define("confluence-editor/tinymce3/plugins/autocomplete/autocomplete-control",["ajs","jquery","confluence-editor/tinymce3/plugins/autocomplete/autocomplete-settings","document","confluence/property-panel"],function(c,g,z,A,t){var v=function(d,r){var a,e,h=z.log("Autocompleter.Control"),s=require("tinymce"),b={},p=d.selection,u=p.getRng(!0),n=u.startOffset,q=u.startContainer;e=q.nodeValue;var l=r.leadingChar,x=d.getDoc(),m=r.backWords||0,i=z.Settings[l||"["];a=!i||"undefined"===typeof i.preventStartNodes?
"div.code, a[href], img, pre":i.preventStartNodes;if(g("#autocomplete",x).length)return c.debug("init","Autocomplete already exists, returning null."),null;b.backWords=m;b.maxResults=r.maxResults||10;null==e&&(u.collapsed&&n&&q.childNodes[n-1])&&(q=q.childNodes[n-1],n=(e=q.nodeValue)&&e.length||0);var o="";if(null!=e)for(var o=(e+"").substring(0,n),k=q.previousSibling;k&&3===k.nodeType;)o=k.nodeValue+o,k=k.previousSibling;var k=[/([("'<\(\u201c\u2018]\[|[\ufeff\u200b\u2014\s\xa0].)$/,/(\([^!])$/,
/(\/\/)$/],f;if(f=!m)if(f=o){a:{o+=l;f=0;for(var F=k.length;f<F;f++)if(k[f].test(o)){k=!0;break a}k=!1}f=!k}if(f)return h("init","Cursor is in wrong word location to start autocomplete, returning null."),null;if(g(q).closest(a).length)return h("init","Cursor is in wrong node to start autocomplete, returning null."),null;t&&t.current&&(t.shouldCreate=!1,t.destroy());!l&&null==e&&(c.debug("init","No text available for suggestion, range is",u),e="");b.getContainer=function(){return g("#autocomplete",
x)};a="";if(u.collapsed&&m&&e){a=q;e=n;k=function(b,j,c){!j.global&&(j=RegExp(j.source,"g"+"i".slice(0,j.ignoreCase)+"m".slice(0,j.multiLine)));c==null?c=b.length:c<0&&(c=0);for(var b=b.substring(0,c+1),c=-1,a=0,d;(d=j.exec(b))!=null;){c=d.index;j.lastIndex=++a}return c};for(o=0;o<m;o++){f=a.nodeValue.substring(0,e);for(e=k(f,/\s+/,e);-1==e;)if((f=a.previousSibling)&&3===f.nodeType)a=f,(f=f.nodeValue)&&(e=k(f,/\s+/,f.length));else{o=m;break}}e+=1;s.isIE&&1==m?(m=p.getRng(),m.moveStart("character",
e-n),m.select()):(m=p.getRng(!0),m.setStart(a,e),m.setEnd(q,n),p.setRng(m))}a=p.getContent({format:"text"}).replace("\n","");h("init","suggestionHtml",a);n=c("span").attr("id","autocomplete");l&&n.append(c("span").attr("id","autocomplete-trigger").text(l));l=c("span").attr("id","autocomplete-search-text");l.text(c.Rte.HIDDEN_CHAR);n.append(l);p.setNode(n[0]);var w=b.getContainer();b.previousSearchText="";b.settings=i;!1!==i.cache&&!i.cacheManager?i.cacheManager=new c.Confluence.localStorageCacheManager(i.ch):
!1===i.cache&&!i.cacheManager&&(i.cacheManager={get:g.noop,put:g.noop});i=g("#autocomplete-search-text",b.getContainer());l=g(x.createElement("span")).text(a||c.Rte.HIDDEN_CHAR);i.empty().append(l);p.select(l[0],!0);p.collapse();var B=function(c,j){if(b.onBeforeKey&&!b.onBeforeKey(j,b.text())){s.dom.Event.cancel(j);h("before","blocked by onBeforeKey: "+j.keyCode);return false}},C=function(c,j){var a=p.getRng(true),d=b.getContainer(),e=a.startContainer,a=e.parentNode;e.nodeType===3&&(a=a.parentNode);
var f=(e=a?a.parentNode:null)?e.parentNode:null,d=a!==d[0]&&e!==d[0]&&f!==d[0];if(j.keyCode===27||d){h("after","dying because of: "+(d?"outside search span":"escape pressed"));b.die()}else if(b.onAfterKey&&!b.onAfterKey(j,b.text())){s.dom.Event.cancel(j);h("after","blocked by onAfterKey: "+j.keyCode);return false}},D=function(c,a){if(b.onKeyPress&&!b.onKeyPress(a,b.text())){s.dom.Event.cancel(a);h("press","blocked by onKeyPress: "+a.keyCode);return false}},E=function(a,c){if(b.getContainer()[0]!=
c.target.parentNode){h("click","Clicked outside of autocomplete, closing.");b.die()}};d.onKeyDown.addToTop(B);d.onKeyUp.addToTop(C);d.onKeyPress.addToTop(D);d.onClick.addToTop(E);b.word="";r.keepAlias?h("init","No suggestion based on previous or selected text"):b.word=a;c.Rte.showElement(w[0]);i=s.DOM.getPos(w[0]);l=w.height();b.left=i.x;b.top=i.y+l;b.text=function(a){var d=g("#autocomplete-search-text",b.getContainer());if(a!=null){d.html(a);return this}a=c.escapeEntities(d.text());return a.replace(c.Rte.HIDDEN_CHAR,
"")};b.plainText=function(a){var d=g("#autocomplete-search-text",b.getContainer());if(a!=null){d.text(a);return this}a=d.text();return a.replace(c.Rte.HIDDEN_CHAR,"")};var y=function(a,c){var d=b.getContainer();return v.replaceWithTextAndGetRange(d,a,c)};b.replaceWithSelectedSearchText=function(){var a=b.text();h("replaceWithSelectedSearchText",a);y(a,false);return a};b.die=function(a){if(b.dying)c.debug("die","Already dying, returning.");else{b.dying=true;if(t)t.shouldCreate=true;if(b.getContainer().length){h("die",
"Tearing down autocomplete, cleaning up autocompleter");a=(a||r.backWords?"":b.settings.ch)+b.text();u=y(a,true)}setTimeout(function(){h("die","Removing autocomplete-control keyboard listeners.");d.onKeyDown.remove(B);d.onKeyUp.remove(C);d.onClick.remove(E);d.onKeyPress.remove(D)},1);c.Rte.unbindScroll("autocomplete");g(A).unbind("click.autocomplete-outside");this.onDeath&&this.onDeath()}};c.Rte.bindScroll("autocomplete",function(a){c.debug("scrolling:",a);if(c.Rte.isAnyPartShown(w))b.onScroll();
else b.die()});g(A).bind("click.autocomplete-outside",function(a){g(a.target).closest("#autocomplete-dropdown, .aui-datepicker-dialog, .ui-datepicker-header").length||b.die()});c.Rte.getEditor().onBeforeExecCommand.add(function(a,c){c=="mceConfSavePage"&&b.die()});b.update=function(a){c.Rte.BookmarkManager.storeBookmark();y("",true);this.settings.update(this,a)};b.removeSpan=function(){b.getContainer().remove()};return b};v.removeOrphanedControl=function(){var d=g(c.Rte.getEditor().getDoc()),r=d.find("#autocomplete"),
a;if(!r.length)return null;a=d.find("#autocomplete-trigger").text();d=d.find("#autocomplete-search-text").text();v.replaceWithTextAndGetRange(r,d,!1);return{leadingChar:a,content:d}};v.replaceWithTextAndGetRange=function(d,g,a){if(d.length){var g=g||"",a=a||!g,e=c.Rte.getEditor(),h=d[0].parentNode,s=c.Rte.Content.getChildIndex(h,d[0]),b=a?1:0,a=e.selection.getRng(!0);a.setStart(h,s+b);a.setEnd(h,s+1);d.before(g||c.Rte.HIDDEN_CHAR).remove();e.selection.setRng(a);return a}c.log("replaceWithTextAndGetRange Error: attempting to replace a non-existent element")};
return v});require("confluence/module-exporter").exportModuleAsGlobal("confluence-editor/tinymce3/plugins/autocomplete/autocomplete-control","Confluence.Editor.Autocompleter.Control");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-autocomplete-resources-only', location = 'tinymce3/plugins/autocomplete/autocomplete-manager.js' */
define("confluence-editor/tinymce3/plugins/autocomplete/autocomplete-manager","ajs jquery window confluence/input-driven-dropdown confluence-editor/tinymce3/plugins/autocomplete/autocomplete-settings confluence-editor/tinymce3/plugins/autocomplete/autocomplete-control".split(" "),function(e,j,p,q,h,k){h.log("Autocompleter.Manager");var c,a,n=function(m){c=k(e.Rte.getEditor(),m);if(!c)return false;e.trigger("synchrony.stop",{id:"confluence.autocomplete-plugin"});e.trigger("rte-autocomplete-on-start",
{triggerChar:c.settings.ch});var r=j(p).width(),i,g=function(b){var f=j("#autocomplete-dropdown"),d=c.getContainer(),a,m,g,h,l;f.length||(f=e("div").addClass("aui-dd-parent quick-nav-drop-down").attr("id","autocomplete-dropdown").appendTo("body"));a=e.Position.spaceAboveBelow(e.Rte.getEditorFrame(),d);b.find("ol:has(a.menu-header)").addClass("top-menu-item");b.find("ol:empty").hide();f.append(b);g=e.Rte.Content.offset(d);h=Math.max(f.width()+g.left-r+10,0);m=g.left-h-0;b=b.outerHeight(true);l=b+10;
if(i){var k;k=i==1?a.above>=l:a.below>=l;k||(i=null)}if(!i)i=a.below>=l?2:a.above>=l?1:a.below>a.above?2:1;a=f.find(".autocomplete-dropdown-arrow");a.length||(a=j('<div class="autocomplete-dropdown-arrow"></div>'));if(i===1){a.addClass("autocomplete-dropdown-bottom-arrow").css({top:b-1});d=g.top-b-10}else{a.removeClass("autocomplete-dropdown-bottom-arrow").css("top","");d=g.top+d.height()+10}a.css({left:h}).appendTo(f);f.css({position:"absolute",top:d,left:m})};a=new q("inputdriven-dropdown",{onShow:function(b){e.trigger("rte-autocomplete-on-show",
{triggerChar:c.settings.ch});var a=e.Rte.getEditorFrame();a&&a.shim&&a.shim.hide();b.find("a.menu-header").unbind().click(function(b){b.preventDefault();c.die()});this.reset();c.settings.selectFirstItem&&b.find("a:not('.menu-header')").length&&e.dropDown.current.moveDown()},dropdownPlacement:g,onDeath:function(){j("#autocomplete-dropdown").remove()},ajsDropDownOptions:{selectionHandler:function(b,a){b.preventDefault();var d=j.data(a[0],"properties");d&&typeof d.callback==="function"?d.callback(c):
d.className!=="menu-header"&&c.update(d);e.trigger("rte-autocomplete-on-select",{triggerChar:c.settings.ch,result:d});c.die()},moveHandler:function(b,a){var c=e.dropDown.current;b&&b.find("a").is(".menu-header")&&(a=="up"?c.moveUp():c.moveDown())},className:"autocomplete "+c.settings.dropDownClassName},getDataAndRunCallback:function(b){c&&c.settings.getDataAndRunCallback&&c.settings.getDataAndRunCallback(c,b,function(f,d,e,g){f.unshift([{className:"menu-header dropdown-prevent-highlight",href:"#",
name:c.settings.getHeaderText(c,b)}]);f.push(c.settings.getAdditionalLinks(c,b,e));a&&a.show(f,d,g||[d])})},dropDownDelay:c.settings.dropDownDelay});c.onBeforeKey=function(b,a){var c=require("tinymce");if(b.keyCode===40||b.keyCode===38||b.keyCode===13){c.dom.Event.cancel(b);return false}if(b.keyCode===27||b.keyCode===9||b.keyCode===8&&!a){this.die(b.keyCode===8);return false}return true};c.onKeyPress=function(b){var a=require("tinymce"),d=String.fromCharCode(j.browser.msie?b.keyCode:b.which);if(b.keyCode===
13){a.dom.Event.cancel(b);return false}e.indexOf(this.settings.endChars,d)!==-1&&c.die();return true};var h=/\S{2,}/;c.onAfterKey=function(b,f){if(b.keyCode===40||b.keyCode===38||b.keyCode===13){var d=e.dropDown.current;if(!d)return false;if(d.getFocusIndex()==-1&&b.keyCode===13){c.die();c=null;return true}if(!b.which)b.which=b.keyCode;return d.moveFocus(b)}if(!(d=b.keyCode===8&&!f))d=/[\u4E00-\u9FFF]/gi.test(f);(d||h.test(f))&&a.change(f,d);return true};c.onDeath=function(){if(a){a.remove();a.closing=
true}e.trigger("synchrony.start",{id:"confluence.autocomplete-plugin"});e.trigger("rte-autocomplete-on-death",{triggerChar:c.settings.ch})};c.onScroll=function(){a.dd&&g(a.dd.$)};a.change(c.text(),"force");return true},o={getInputDrivenDropdown:function(){return a},triggerListener:function(c,e){var i=require("tinymce");if(e.metaKey)return true;var g=j.browser.msie?e.keyCode:e.which;a&&a.closing&&(a=null);g=String.fromCharCode(g);!a&&g in h.Settings&&n({leadingChar:g})&&i.dom.Event.cancel(e);return true},
shortcutFired:function(e,h){var i=h?0:1;a&&a.closing&&(a=null);if(a){i=h?0:c.backWords+1;c.die();c=null}return n({leadingChar:e,backWords:i})},reattach:function(){var a=k.removeOrphanedControl();a&&o.shortcutFired(a.leadingChar)}};return o});require("confluence/module-exporter").exportModuleAsGlobal("confluence-editor/tinymce3/plugins/autocomplete/autocomplete-manager","Confluence.Editor.Autocompleter.Manager");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-autocomplete-resources-only', location = 'tinymce3/plugins/autocomplete/editor_plugin_src.js' */
define("confluence-editor/tinymce3/plugins/autocomplete/editor_plugin_src",["tinymce","confluence/legacy-editor-global-AVOID-IF-POSSIBLE","ajs"],function(a,b,c){return{init:function(a){b.Autocompleter.Settings={};a.onPostRender.add(function(){c.debug("Autocomplete enabled, adding keyPress listener");a.onKeyPress.addToTop(b.Autocompleter.Manager.triggerListener);c.trigger("ready-editor-autocomplete")});a.onUndo.add(b.Autocompleter.Manager.reattach);a.onRedo.add(b.Autocompleter.Manager.reattach)},getInfo:function(){return{longname:"Auto Complete",
author:"Atlassian",authorurl:"http://www.atlassian.com",version:a.majorVersion+"."+a.minorVersion}}}});require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/autocomplete/editor_plugin_src",function(a){var b=require("tinymce");b.create("tinymce.plugins.AutoComplete",a);b.PluginManager.add("autocomplete",b.plugins.AutoComplete)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-autocomplete-resources-only', location = 'tinymce3/plugins/autocomplete-link/autocomplete-settings-links.js' */
define("confluence-editor/tinymce3/plugins/autocomplete-link/autocomplete-settings-links","jquery ajs confluence-link-browser/link-object confluence-link-browser/link-adapter confluence/legacy-editor-global-AVOID-IF-POSSIBLE confluence/unescape-entities".split(" "),function(m,d,g,j,e,h){return function(){var i=e.Autocompleter,k=function(a){return a?d.contextPath()+"/rest/prototype/1/search.json":d.Meta.get("remote-user")?d.contextPath()+"/rest/prototype/1/session/history.json":null},l=function(a,
b){var c={"max-results":a.maxResults};if(b){c.query=h(b);c.search="name";c.preferredSpaceKey=d.Meta.get("space-key")}return c};e.Autocompleter.Settings["["]={ch:"[",cache:false,endChars:["]"],dropDownClassName:"autocomplete-links",selectFirstItem:true,getHeaderText:function(){return "Link suggestions"},getAdditionalLinks:function(a,b,c){if(b){a="Search for &lsquo;{0}&rsquo;";a=d.format(a,b)}else a="Search";
var f=e.LinkBrowser,a=[{className:"search-for",name:a,href:"#",callback:function(a){a.replaceWithSelectedSearchText();a=f.open({panelKey:f.SEARCH_PANEL});a.doSearch(a.getLocationPresenter().getRawLinkText())}},{className:"dropdown-insert-link",html:i.Util.dropdownLink("Insert web link","dropdown-prevent-highlight","editor-icon"),callback:function(a){a.replaceWithSelectedSearchText();f.open({panelKey:f.WEBLINK_PANEL})}}];c&&c(b,a);return a},getDataAndRunCallback:function(a,
b,c){e.Autocompleter.Util.getRestData(a,k,l,b,c,"content",function(a,b,c){if(b){var e;if(!(e=a.length<2)){a=a[1][0].restObj;a=a.type==="page"?a.space.key==d.Meta.get("space-key")&&a.title.toLowerCase()===b.toLowerCase():false;e=!a}e&&c.push({className:"insert-create-page-link",html:i.Util.dropdownLink("Insert link to create page","dropdown-prevent-highlight","editor-icon"),callback:function(a){var c=h(b),c=g.createLinkToNewPage(c,d.Meta.get("space-key"));a.update(c)}})}})},
update:function(a,b){b.restObj&&(b=g.fromREST(b.restObj));j.setLink(b)}}}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-autocomplete-resources-only', location = 'tinymce3/plugins/autocomplete-link/editor_plugin_src.js' */
define("confluence-editor/tinymce3/plugins/autocomplete-link/editor_plugin_src",["tinymce","confluence-editor/tinymce3/plugins/autocomplete-link/autocomplete-settings-links","confluence/legacy-editor-global-AVOID-IF-POSSIBLE"],function(a,b,c){return{init:function(a){a.addCommand("mceConfAutocompleteLink",function(){c.Autocompleter.Manager.shortcutFired("[")});a.addShortcut("ctrl+shift+k",a.getLang("AutoComplete"),"mceConfAutocompleteLink");b()},getInfo:function(){return{longname:"Auto Complete Link",
author:"Atlassian",authorurl:"http://www.atlassian.com",version:a.majorVersion+"."+a.minorVersion}}}});require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/autocomplete-link/editor_plugin_src",function(a){var b=require("tinymce");b.create("tinymce.plugins.AutoCompleteLink",a);b.PluginManager.add("autocompletelink",b.plugins.AutoCompleteLink)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-autocomplete-resources-only', location = 'tinymce3/plugins/autocomplete-media/autocomplete-settings-media.js' */
define("confluence-editor/tinymce3/plugins/autocomplete-media/autocomplete-settings-media","jquery ajs confluence-editor/utils/attachments-insert-utils tinymce confluence/macro-js-overrides confluence-rest/confluence-rest confluence/legacy-editor-global-AVOID-IF-POSSIBLE".split(" "),function(j,d,k,h,i,l,f){return function(){var m=function(c){var b=d.params.attachmentSourceContentId||d.Meta.get("content-id");return c?d.contextPath()+"/rest/prototype/1/search.json":+b?d.contextPath()+"/rest/prototype/1/content/"+
b+"/attachments.json":null},n=function(c,b){var a=d.MacroBrowser.getMacroMetadata("view-file")?[]:["image","word","excel","pdf","powerpoint","multimedia"];return b?{type:"attachment",attachmentType:a,search:"name","max-results":c.maxResults,query:b}:{attachmentType:a,"max-results":c.maxResults}};f.Autocompleter.Settings["!"]={ch:"!",cache:false,endChars:["!"],dropDownClassName:"autocomplete-media",selectFirstItem:true,getHeaderText:function(){return d.MacroBrowser.getMacroMetadata("view-file")?"File suggestions":
"Media suggestions"},getAdditionalLinks:function(){var c="Open file library";return[{className:"dropdown-insert-image",html:f.Autocompleter.Util.dropdownLink(c,"dropdown-prevent-highlight","editor-icon"),callback:function(b){b.replaceWithSelectedSearchText();f.defaultInsertImageDialog()}},{className:"dropdown-insert-macro",html:f.Autocompleter.Util.dropdownLink("Insert other media",
"dropdown-prevent-highlight","editor-icon"),callback:function(b){b.replaceWithSelectedSearchText();h.confluence.macrobrowser.macroBrowserToolbarButtonClicked({selectedCategory:"media"})}}]},getDataAndRunCallback:function(c,b,a){f.Autocompleter.Util.getRestData(c,m,n,b,a,"attachment")},update:function(c,b){d.trigger("rte-autocomplete-on-insert",{triggerChar:"!",selectedFile:b});var a=b.restObj,e=l.REST.wikiLink(a),f=a&&a.title||b.name;if(a.niceType=="Image"){e.destination&&e.destination.replace(/^\^/,
"");a=j.extend({filename:f,contentId:b.ownerId||a.ownerId},e.params);h.confluence.ImageUtils.insertFromProperties(a)}else{var i=!!d.MacroBrowser.getMacroMetadata("view-file"),g=a.contentType;i&&(!(g&&g==="application/x-shockwave-flash")||g&&(g==="audio/mp3"||g==="video/mp4")||a.niceType!=="Multimedia")?k.insertFilePlaceholder({name:f,page:a.parentTitle,space:a.space?a.space.key:"",date:a.datePath,ownerId:a.ownerId}):this._insertFile(f,b,e)}},_insertFile:function(c,b,a){var e;switch(b.restObj.niceType){case "PDF Document":e=
"viewpdf";break;case "Word Document":e="viewdoc";break;case "Excel Spreadsheet":e="viewxls";break;case "PowerPoint Presentation":e="viewppt";break;case "Multimedia":e="multimedia"}c={page:a.destination.substring(0,a.destination.indexOf("^")),name:c};i.get("viewdoc").beforeParamsRetrieved(c);c.page||delete c.page;e={contentId:d.Meta.get("content-id")||"0",macro:{name:e,params:c,body:""}};h.confluence.MacroUtils.insertMacro(e)}}}});require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/autocomplete-media/autocomplete-settings-media");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-autocomplete-resources-only', location = 'tinymce3/plugins/autocomplete-media/editor_plugin_src.js' */
define("confluence-editor/tinymce3/plugins/autocomplete-media/editor_plugin_src",["tinymce","confluence/legacy-editor-global-AVOID-IF-POSSIBLE","confluence-editor/tinymce3/plugins/autocomplete-media/autocomplete-settings-media"],function(a,b,c){return{init:function(a){a.addCommand("mceConfAutocompleteImage",function(){b.Autocompleter.Manager.shortcutFired("!")});a.addShortcut("ctrl+shift+m",a.getLang("AutoComplete"),"mceConfAutocompleteImage");c()},getInfo:function(){return{longname:"Auto Complete Media",
author:"Atlassian",authorurl:"http://www.atlassian.com",version:a.majorVersion+"."+a.minorVersion}}}});require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/autocomplete-media/editor_plugin_src",function(a){var b=require("tinymce");b.create("tinymce.plugins.AutoCompleteMedia",a);b.PluginManager.add("autocompletemedia",b.plugins.AutoCompleteMedia)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-autocomplete-resources-only', location = 'tinymce3/plugins/autocomplete-media/autocomplete-analytics-media.js' */
require(["ajs"],function(a){a.bind("init.rte",function(){a.bind("rte-autocomplete-on-show",function(d,c){"!"===c.triggerChar&&a.trigger("analytics",{name:"confluence.editor.autocomplete.trigger",data:{type:"media"}})});a.bind("rte-autocomplete-on-insert",function(d,c){if("!"===c.triggerChar){var b=c.selectedFile;b&&b.name&&(b={extension:b.name.split(".").pop(),type:"media"},a.trigger("analytics",{name:"confluence.editor.autocomplete.insert",data:b}))}})});a.bind("rte-destroyed",function(){a.unbind("rte-autocomplete-on-insert");
a.unbind("rte-autocomplete-on-show")})});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-autocomplete-resources-only', location = 'tinymce3/plugins/autocomplete-macro/autocomplete-settings-macros.js' */
define("confluence-editor/tinymce3/plugins/autocomplete-macro/autocomplete-settings-macros",["jquery","underscore","ajs","tinymce","confluence/legacy-editor-global-AVOID-IF-POSSIBLE"],function(h,n,b,e,d){return function(){function j(c){h("#autocomplete-dropdown .top-menu-item").spin(c)}var f=function(c,a){var g=a.presetMacroMetadata;c.replaceWithSelectedSearchText();g?b.MacroBrowser.hasRequiredParameters(g)||g.alwaysShowConfig?e.confluence.macrobrowser.macroBrowserToolbarButtonClicked(a):(b.Rte.BookmarkManager.storeBookmark(),
e.confluence.MacroUtils.insertMacro({contentId:b.Meta.get("content-id")||"0",macro:{name:g.macroName,body:""}})):e.confluence.macrobrowser.macroBrowserToolbarButtonClicked(a)},k=function(c){if(c.hidden&&!b.MacroBrowser.isHiddenMacroShown(c))return null;var a={className:"autocomplete-macro-"+c.macroName,callback:function(b){f(b,{ignoreEditorSelection:!0,presetMacroMetadata:c})}};c.icon?(a.name=c.title,a.href="#",a.icon=(c.icon.relative?b.params.staticResourceUrlPrefix:"")+c.icon.location):a.html=d.Autocompleter.Util.dropdownLink(c.title);
return a};d.Autocompleter.Settings["{"]={ch:"{",cache:!1,endChars:["}",":","{"],dropDownClassName:"autocomplete-macros",dropDownDelay:0,selectFirstItem:!0,getHeaderText:function(){return "Macro suggestions"},getAdditionalLinks:function(){return[{className:"dropdown-insert-macro",html:d.Autocompleter.Util.dropdownLink("Open macro browser","dropdown-prevent-highlight","editor-icon"),callback:function(b){var a=b.text();f(b,{searchText:a})}}]},
getDataAndRunCallback:function(c,a,g){function e(a){a.preventDefault();a.stopPropagation();b.trigger("analytics",{name:"autocomplete-macrobrowser.load-retry"});b.MacroBrowser.reset();b.MacroBrowser.preLoadMacro();i.getDataAndRunCallback.apply(i,f)}var d=b.MacroBrowser.getMetadataPromise(),i=this,f=arguments;i.alreadyBinded||(i.alreadyBinded=!0,d.always(function(){var d;if(a){d=[];for(var e=b.MacroBrowser.searchSummaries(a,{keywordsField:"keywordsNoDesc"}),f=0,o=e.length;f<o;f++){var l=k(e[f]);if(l&&
d.push(l)==c.maxResults)break}}else{var p=b.MacroBrowser.metadataList,m=[];h("#macro-insert-list li").each(function(){var b=h(this),a=n.find(p,function(a){return a.macroName===b.attr("data-macro-name")});a&&(a=k(a))&&m.push(a)});d=m}j(!1);g([d],a);i.alreadyBinded=!1}),d.fail(function(){b.trigger("analytics",{name:"autocomplete-macrobrowser.fail-to-load"});b.messages.warning("#autocomplete-dropdown ol:nth(1)",{title:"Failed to get macro details",body:'<p><a id="macro-retry-link" href="#">'+
"Try again"+"</a></p>"});h("#macro-retry-link").click(e);h("#autocomplete-dropdown ol:nth(1)").show()}));"pending"===d.state()&&(g([],a),j(!0))},update:function(){throw Error("All items in the Macro Autocomplete dropdown must have a callback function");}}}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-autocomplete-resources-only', location = 'tinymce3/plugins/autocomplete-macro/editor_plugin_src.js' */
define("confluence-editor/tinymce3/plugins/autocomplete-macro/editor_plugin_src",["tinymce","confluence-editor/tinymce3/plugins/autocomplete-macro/autocomplete-settings-macros"],function(b,a){return{init:function(){a()},getInfo:function(){return{longname:"Auto Complete Macro",author:"Atlassian",authorurl:"http://www.atlassian.com",version:b.majorVersion+"."+b.minorVersion}}}});
require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/autocomplete-macro/editor_plugin_src",function(b){var a=require("tinymce");a.create("tinymce.plugins.AutoCompleteMacro",b);a.PluginManager.add("autocompletemacro",a.plugins.AutoCompleteMacro)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-autocomplete-resources-only', location = 'tinymce3/plugins/searchreplace/editor_plugin_src.js' */
define("confluence-editor/tinymce3/plugins/searchreplace/editor_plugin_src",["jquery","ajs","confluence/legacy-editor-global-AVOID-IF-POSSIBLE","document","tinymce"],function(f,g,c,l,e){var i=null,j=!1,h=function(c,b){b.preventDefault();b.stopPropagation()},m=function(c,b){h(c,b);var a=b.which;a||(a=b.charCode?b.charCode:b.keyCode);48>a||i.push(a)},k=function(c){var b=f("#rte-button-searchreplace a");b.length&&(c?b.unbind("click",!1):b.bind("click",!1))};return{init:function(d){d.addCommand("mceSearchReplaceToolbar",
function(){if(!j){j=!0;var b=f("#rte-button-searchreplace"),a=!b.hasClass("active"),d=f("body"),d=!d.hasClass("no-tools")||d.hasClass("no-tools-toolbars-visible");a?(b.addClass("active"),c.searchManager||(c.searchManager=new c.SearchManager("searchreplace")),f(l).trigger("createContextToolbarRow.Toolbar",{id:"searchreplace",buttons:c.searchToolbar.Buttons,topToolbar:!0,editorAdjacent:!0,animate:d,onVisible:function(){var a;a=g.Rte.getEditor();a.onKeyDown.remove(m);a.onKeyPress.remove(h);a.onKeyUp.remove(h);
var b="";for(a=0;a<i.length;a++){var d;d=i[a];if(d>65535){d=d-65536;d=String.fromCharCode(55296+(d>>10),56320+(d&1023))}else d=String.fromCharCode(d);b=b+d}a=b.toLowerCase();c.searchManager.onVisible(a);k(true);j=false;c.searchManager.initialised=true}}).trigger("enableContextToolbarRow.Toolbar"),b=g.Rte.getEditor(),i=[],b.onKeyDown.add(m),b.onKeyPress.add(h),b.onKeyUp.add(h),c.searchManager.init(),k(!1)):(b.removeClass("active"),c.searchManager.onHide(),f(l).trigger("removeContextToolbarRow.Toolbar",
{id:"searchreplace",animate:d,onHide:function(){f(l).trigger("contextToolbarRowRemoved.Toolbar");k(!0);j=!1;c.searchManager.initialised=!1}}),k(!1),e.isGecko||frames.wysiwygTextarea_ifr.focus(),e.activeEditor.focus())}});d.addCommand("mceConfSearch",function(b,a){c.searchManager&&(a=a||{},a.backwards&&!e.activeEditor.plugins.customtoolbar.isToolbarButtonEnabled("search-toolbar-find-previous-button")?c.searchManager.focus():!a.backwards&&!e.activeEditor.plugins.customtoolbar.isToolbarButtonEnabled("search-toolbar-find-next-button")?
c.searchManager.focus():c.searchManager.find(a.backwards,a.onFound,a.onNotFound))});d.addCommand("mceConfReplace",function(b,a){c.searchManager&&(a=a||{},e.activeEditor.plugins.customtoolbar.isToolbarButtonEnabled("search-toolbar-replace-button")?c.searchManager.replace(a.onFound,a.onNotFound):a.onInactive&&a.onInactive())});d.addCommand("mceConfReplaceAll",function(b,a){c.searchManager&&(a=a||{},e.activeEditor.plugins.customtoolbar.isToolbarButtonEnabled("search-toolbar-replaceall-button")&&c.searchManager.replaceAll(a.onReplaced,
a.onNotReplaced))});d.addCommand("mceConfSearchClose",function(){c.searchManager&&d.execCommand("mceSearchReplaceToolbar",!1,null)});d.addButton("searchreplace",{title:"searchreplace.search_desc",cmd:"mceSearchReplaceToolbar"});e.isIE8||d.addShortcut("ctrl+f","searchreplace.search_desc",function(){c.searchManager&&c.searchManager.isVisible()?c.searchManager.focus():d.execCommand("mceSearchReplaceToolbar",!1,!1,{skip_undo:!0})})},getInfo:function(){return{longname:"Search/Replace",author:"Atlassian",
authorurl:"http://www.atlassian.com",infourl:"http://www.atlassian.com",version:e.majorVersion+"."+e.minorVersion}}}});require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/searchreplace/editor_plugin_src",function(f){var g=require("tinymce");g.create("tinymce.plugins.AtlassianSearchReplacePlugin",f);g.PluginManager.add("searchreplace",g.plugins.AtlassianSearchReplacePlugin)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-autocomplete-resources-only', location = 'tinymce3/plugins/searchreplace/searchreplace.js' */
define("confluence-editor/tinymce3/plugins/searchreplace/searchreplace",["jquery","tinymce","confluence/api/browser","confluence-editor/tinymce3/plugins/searchreplace/search-ms-edge","confluence/editor-notifications"],function(j,d,w,u,s){var v=w(window.navigator.userAgent),q=function(a){var b=null,c=null,h=null,j=null,l=null,o=function(d,m){m.content=m.content.replace(RegExp('<mark data-searching class="find-current">',"g"),"");m.content=m.content.replace(RegExp("</mark>","g"),"")};return{initialised:!1,
find:function(d,m,a){var i=b.getFindInput().val();(d=h.findText(i,!0,d))&&m?m():!d&&a&&a()},replace:function(d,a){var c=b.getFindInput(),i=b.getReplaceInput(),p="";i&&(p=i.val());(c=h.replaceText(c.val(),p,!0))&&d?d():!c&&a&&a()},replaceAll:function(d,a){var c=b.getFindInput(),i=b.getReplaceInput(),p="";i&&(p=i.val());(c=h.replaceAll(c.val(),p))&&d?d():!c&&a&&a()},focus:function(){b.focusFindTextBox()},isVisible:function(){return null!=b},init:function(){b=q.UI(a,j,l);c=new q.MarkManager;c.addListener(b);
h=null;h=d.isIE?new q.implIE(b):new q.impl(b,c);d.activeEditor.undoManager.onAdd.add(o)},onVisible:function(d){if(null!=d&&0<d.length){var a=b.getFindInput(),c=a.val();a.val(c+d)}b.onVisible()},onHide:function(){j=b.getFindInput().val();l=b.getReplaceInput().val();h.destroy();h=null;b.destroy();b=null;c.destroy();c=null;d.activeEditor.undoManager.onAdd.remove(o)},_clearSavedValues:function(){l=j=null}}};q.utils={moveCursorToEnd:function(a){if(d.isIE)a=a.createTextRange(),a.execCommand("SelectAll"),
a.move("textedit"),a.select();else if(d.isGecko){var b=j(a).val().length;a.setSelectionRange(b,b)}},createTextRange:function(d,b){return d.selection?d.selection.createRange():b.getBody().createTextRange()}};q.impl=function(a,b){var c=new d.html.Writer,h=b,j=-1,l=function(a,b,i){function c(){h.markCurrentlySelectedRange();return!0}function k(){h.removeCurrentMark(!0);d.activeEditor.selection.isCollapsed()||d.activeEditor.selection.collapse();return!1}if(!a)return!1;var e=d.activeEditor,g=e.selection,
f=e.getWin();h.isCursorAtCurrentMark()&&(g=h.selectCurrentMark());g.isCollapsed()||g.collapse(i);if(d.isGecko)return f.find(a,!1,i)?c():b?(g.select(e.getBody(),!1),g.collapse(!i),l(a,!1,i)):k();if(v.isMSEdge()){if(a=u.search(g,a,j,e.getBody(),i),j=a[1],a[0])return c()}else return f.find(a,!1,i,!0,!1,!1,!1)?c():k()},o=function(a){var b=d.activeEditor;c.text(a);b.selection.setContent(c.getContent(),{format:"raw"});c.reset();b.selection.collapse(!0)},n={};n.findText=l;n.replaceText=function(a,b,i){if(!h.hasCurrentMark())return l(a,
i);(b=h.replaceCurrentMark(b))&&d.activeEditor.selection.select(b);return l(a,i)};n.replaceAll=function(a,b){var i=d.activeEditor,c=i.selection,k=i.getWin();h.removeCurrentMark(!1);i.execCommand("selectAll");i.selection.collapse(!0);var e=0;if(v.isMSEdge())for(k=-1;;)if(k=u.search(c,a,k,i.getBody(),!1),k[0])k=k[1],o(b),e++;else break;else for(;k.find(a,!1,!1,!1,!1,!1,!1);)o(b),e++;i.undoManager.add();0===e?s.notify("info",i.getLang("searchreplace_dlg.notfound")):1===e?s.notify("success",i.getLang("searchreplace_dlg.allreplacedsingular")):
1<e&&(i=i.getLang("searchreplace_dlg.allreplacedplural"),s.notify("success",i.replace("{0}",e)));return e};n.destroy=function(){c=h=null};return n};q.implIE=function(a){var b={},c=a,h=null,t=new d.html.Writer,l=q.utils.createTextRange,o=function(a,p,k){if(!a)return!1;var e=d.activeEditor,g=e.getDoc(),f=b.storedRange=b.storedRange||g.body.createTextRange();e.focus();h&&h.select();e.selection.collapse(!k);m();k&&h&&(g=g.body.createTextRange(),g.moveToElementText(j("p:first",e.getBody())[0]),f.setEndPoint("StartToStart",
g),g=h.text,g.length&&(g=g.replace(/s+$/,""),g.length&&f.moveEnd("character",-g.length)),g=f.text.length,f.moveEnd("word",-1),f.text.length>=g&&f.moveEnd("character",-1),f.select(),f.collapse(!1));h=null;if(f.findText(a,k?-1:1,0))return f.scrollIntoView(),a=f,a.pasteHTML('<mark data-searching class="find-current">'+a.htmlText+"</mark>"),c.marked(),p=d.activeEditor,p.onChange.add(n),p.onBeforeSetContent.add(n),f=a,f.select(),h=f,!0;if(p)return e.selection.select(d.activeEditor.getBody(),!0),e.selection.collapse(!k),
o(a,!1,k);b.storedRange=null},n=function(){m()},m=function(){var a=d.activeEditor;a.onChange.remove(n);a.onBeforeSetContent.remove(n);var a=d.activeEditor,b=j("mark",a.getDoc());if(b.length){var k=!1,e=a.selection.getRng(!0).commonAncestorContainer;j(e).closest("mark").length&&(k=!0);b.each(function(a,f){var e=j(f);e.contents().each(function(a,f){e.before(f)})}).remove();k&&a.execCommand("RemoveFormat")}c.markRemoved()},r=function(){m()};b.findText=o;b.replaceText=function(a,b,c){var e=d.activeEditor;
if(h){var g=e.getDoc().createTextNode(b),f=j("mark",e.getDoc());f.parent()[0].replaceChild(g,f[0]);e.undoManager.add();f=e.getDoc().createElement("mark");f.setAttribute("class","current");f.dataset.searching=!0;g.parentNode.insertBefore(f,g);f.appendChild(e.getDoc().createTextNode(b));f.parentNode.removeChild(g)}return o(a,c)};b.replaceAll=function(a,b){var c=d.activeEditor,e=c.selection;c.getWin();var g=c.undoManager,f=c.getDoc();m();e.select(c.getBody(),!1);e.collapse(!0);c.focus();f=l(f,c);for(e=
0;f.findText(a,1,0);)f.scrollIntoView(),f.select(),t.text(b),c.selection.setContent(t.getContent(),{format:"raw"}),t.reset(),e++,f.moveStart("character",b.length);g.add();0==e?s.notify("info",c.getLang("searchreplace_dlg.notfound")):1==e?s.notify("success",c.getLang("searchreplace_dlg.allreplacedsingular")):1<e&&(c=c.getLang("searchreplace_dlg.allreplacedplural"),s.notify("success",c.replace("{0}",e)));return e};b.destroy=function(){d.activeEditor.onBeforeGetContent.remove(r);m();t=h=c=null};d.activeEditor.onBeforeGetContent.add(r);
return b};q.UI=function(a,b,c){var h=null,t=q.utils.moveCursorToEnd;d.activeEditor&&(d.activeEditor.plugins&&d.activeEditor.plugins.customtoolbar)&&(h=d.activeEditor.plugins.customtoolbar.getToolbarRow(a));var l=function(){var a=j(".toolbar-find-input",h);return!a.length?null:a},o=function(){var a=j(".toolbar-replace-input",h);return!a.length?null:a},n=function(a){a?(d.activeEditor.plugins.customtoolbar.enableToolbarButton("search-toolbar-find-next-button"),d.activeEditor.plugins.customtoolbar.enableToolbarButton("search-toolbar-find-previous-button")):
(d.activeEditor.plugins.customtoolbar.disableToolbarButton("search-toolbar-find-next-button"),d.activeEditor.plugins.customtoolbar.disableToolbarButton("search-toolbar-find-previous-button"))},m=function(a){var d=l(),f;f=j(".search-toolbar-find-next-button",h).closest(".aui-button");f=f.length?f:null;f.toggleClass("default-action",a&&0<d.val().length)},r=function(a){var b=d.activeEditor.plugins.customtoolbar;a?b.enableToolbarButton("search-toolbar-replace-button"):b.disableToolbarButton("search-toolbar-replace-button")},
i=function(a){var b=d.activeEditor.plugins.customtoolbar;a?b.enableToolbarButton("search-toolbar-replaceall-button"):b.disableToolbarButton("search-toolbar-replaceall-button")},a={};a.getFindInput=l;a.getReplaceInput=o;a.focusFindTextBox=function(){top.focus();l().focus()};a.onVisible=function(){var a=l();a.focus();0<a.val().length&&(t(a[0]),n(!0),i(!0))};a.destroy=function(){};a.marked=function(){r(!0)};a.markRemoved=function(){r(!1)};var p=l(),k=!1;b&&b.length&&(p.val(b),k=!0);c&&c.length&&o().val(c);
b=function(a,b){a&&(d.isIE9?a[0].attachEvent("onpropertychange",b):a.bind(d.isIE8?"propertychange":"input",b))};c=l();b(c,function(a){if(a.type==="input"||a.type==="propertychange"){a=l();a=a!=null&&a.val().length>0;n(a);m(a)}});b(c,function(){var a=l();i(a&&a.val())});j(h).focusin(function(){m(true)}).focusout(function(){m(false)});c.focus(function(){m(true)});n(k);i(k);r(!1);return a};q.MarkManager=function(){var a=null,b=new d.html.Writer,c=null,h=[],q=function(){n()},l=function(){if(!a)return null;
var f=d.activeEditor;f.selection.select(a[0]);return f.selection},o=function(f){e();if(m(a,f)||c&&d.activeEditor.selection.getRng(!0).toString()==c)c=a=null,j.each(h,function(a,f){f.markRemoved()})},n=function(){e();j("mark",d.activeEditor.getDoc()).each(function(a,b){m(j(b),!1)});c=a=null;j.each(h,function(a,b){b.markRemoved()})},m=function(a,b){var c=d.activeEditor.selection.getRng(!0);if(!a)return!1;var e=a[0];if(c.intersectsNode)c=c.intersectsNode(e);else{var h=d.activeEditor.getDoc().createRange();
h.selectNodeContents(e);c=0>=c.compareBoundaryPoints(Range.START_TO_END,h)||0<=c.compareBoundaryPoints(Range.END_TO_START,h)?!1:!0}var g=null,i=null;a.contents().each(function(b,c){a.before(c);g||(g=c);i=c});if(c||b)c=d.activeEditor.selection.getRng(!0),c.setStartBefore(g),c.setEndAfter(i),b||c.collapse(!1),d.activeEditor.selection.setRng(c);a.remove();return!0},r=function(){if(a)return!0;if(c)return d.activeEditor.selection.getRng(!0).toString()==c},i=function(){n()},p=function(){e();j.each(h,function(a,
b){b.markRemoved()})},k=function(a){var b=d.activeEditor;b.onChange.add(q);b.onBeforeSetContent.add(q);a&&(b.onClick.add(p),b.onDblClick.add(p))},e=function(){var a=d.activeEditor;a.onChange.remove(q);a.onBeforeSetContent.remove(q);a.onClick.remove(p);a.onDblClick.remove(p)},g={markCurrentlySelectedRange:function(){var b=d.activeEditor;if(a){var e=b.selection.getBookmark();o(!1);b.selection.moveToBookmark(e)}c=null;e=b.selection.getRng(!0);a=j('<mark data-searching class="find-current"></mark>',b.getDoc());
try{e.surroundContents(a[0]),k(!1)}catch(g){1==g.code&&(c=e.toString(),a=null,k(!0))}j.each(h,function(a,b){b.marked()});c||l().collapse()}};g.removeCurrentMark=o;g.removeAllMarks=n;g.selectCurrentMark=l;g.isCursorAtCurrentMark=function(){if(!a)return!1;var b=d.activeEditor.selection;b.isCollapsed()||b.collapse();var c=b.getRng(!0);if(3===c.startContainer.nodeType)return c.startContainer.parentNode.normalize(),c.startContainer.nextSibling===a[0]||c.startContainer.previousSibling===a[0];if(1===c.startContainer.nodeType)return b=
c.startContainer.childNodes,c=c.startOffset,0<c&&b[c-1]===a[0]||c+1<b.length&&b[c+1===a[0]]?!0:!1};g.hasCurrentMark=r;g.replaceCurrentMark=function(c){var e;a||!r()?e=!1:(e=d.activeEditor,b.text(c),e.selection.setContent(b.getContent(),{format:"raw"}),b.reset(),e.undoManager.add(),o(!1),e=!0);if(e||!a)return null;var g=[];a.contents().each(function(a,b){g.push(b)});o(!1);e=d.activeEditor;for(var c=j(g[0]).before(e.getDoc().createTextNode(c))[0].previousSibling,h=g.length-1;0<=h;h--)j(g[h]).remove();
e.undoManager.add();return c};g.addListener=function(a){h.push(a)};g.destroy=function(){o(!0);d.activeEditor.onBeforeGetContent.remove(i)};d.activeEditor.onBeforeGetContent.add(i);return g};return q});require("confluence/module-exporter").exportModuleAsGlobal("confluence-editor/tinymce3/plugins/searchreplace/searchreplace","Confluence.Editor.SearchManager");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-autocomplete-resources-only', location = 'tinymce3/plugins/searchreplace/search-toolbar.js' */
define("confluence-editor/tinymce3/plugins/searchreplace/search-toolbar",["jquery","tinymce","confluence/legacy-editor-global-AVOID-IF-POSSIBLE"],function(f,b,d){return{initContextToolbars:function(r,c){var h=function(a){if(b.isIE)a=a.createTextRange(),a.execCommand("SelectAll"),a.move("textedit"),a.select();else if(b.isGecko){var c=f(a).val().length;a.setSelectionRange(c,c)}},g=function(a){top.focus();b.activeEditor.plugins.customtoolbar.focusToolbarButton(a)},e=function(){top.focus();var a=f("#search-toolbar-find-text");
a.focus();h(a[0])},i=function(){top.focus();var a=f("#search-toolbar-replace-text");a.focus();h(a[0])},k=function(){b.isIE&&frames.wysiwygTextarea_ifr.focus();if(b.isIE||b.isGecko){var a=b.activeEditor;a.focus();a.selection.select(a.getBody());a.selection.collapse(!1);a.focus()}},l=new d.Toolbar.Components.TextBox({id:"search-toolbar-find-text",text:c.getLang("searchreplace_dlg.findlabel"),name:"find",keydown:function(a){!b.isIE8&&(a.ctrlKey||b.isMac&&a.metaKey)&&70===a.which?a.preventDefault():13===
a.which?(a.preventDefault(),b.activeEditor.execCommand("mceConfSearch",!1,{backwards:!1,onFound:e,onNotFound:e},{skip_undo:!0})):27===a.which&&(a.preventDefault(),b.activeEditor.execCommand("mceSearchReplaceToolbar",!1,!1,{skip_undo:!0}))},cssClass:"toolbar-find-input"}),m=new d.Toolbar.Components.TextBox({id:"search-toolbar-replace-text",text:c.getLang("searchreplace_dlg.replacelabel"),name:"replace",keydown:function(a){!b.isIE8&&(a.ctrlKey||b.isMac&&a.metaKey)&&70===a.which?a.preventDefault():13===
a.which?(a.preventDefault(),b.activeEditor.execCommand("mceConfReplace",!1,{onFound:i,onNotFound:e,onInactive:function(){b.activeEditor.execCommand("mceConfSearch",false,{backwards:false,onFound:i,onNotFound:e},{skip_undo:true})}},{skip_undo:!0})):27===a.which&&(a.preventDefault(),b.activeEditor.execCommand("mceSearchReplaceToolbar",!1,!1,{skip_undo:!0}))},cssClass:"toolbar-replace-input"}),n=new d.Toolbar.Components.TextButton({text:c.getLang("searchreplace_dlg.findprevious"),click:function(){c.execCommand("mceConfSearch",
!1,{backwards:!0,onFound:function(){top.focus();g("search-toolbar-find-previous-button")},onNotFound:e},{skip_undo:!0})},textClass:"search-toolbar-find-previous-button"}),j=new d.Toolbar.Components.TextButton({text:b.isIE?c.getLang("searchreplace_dlg.findlabel"):c.getLang("searchreplace_dlg.findnext"),click:function(){c.execCommand("mceConfSearch",!1,{backwards:!1,onFound:function(){top.focus();g("search-toolbar-find-next-button")},onNotFound:e},{skip_undo:!0})},textClass:"search-toolbar-find-next-button"}),
o=new d.Toolbar.Components.TextButton({text:c.getLang("searchreplace_dlg.replace"),click:function(){c.execCommand("mceConfReplace",!1,{onFound:function(){top.focus();g("search-toolbar-replace-button")},onNotFound:e},{skip_undo:!0})},textClass:"search-toolbar-replace-button"}),p=new d.Toolbar.Components.TextButton({text:c.getLang("searchreplace_dlg.replaceall"),click:function(){c.execCommand("mceConfReplaceAll",!1,{onReplaced:k,onNotReplaced:e})},textClass:"search-toolbar-replaceall-button"}),q=new d.Toolbar.Components.Button({text:c.getLang("searchreplace_dlg.close"),
iconClass:"icon-close",click:function(){c.execCommand("mceConfSearchClose",!1,null)}});return{Buttons:[new d.Toolbar.Components.Group([q],{groupClass:"close"}),new d.Toolbar.Components.Group([l,m],{groupClass:"no-separator"}),new d.Toolbar.Components.Group(b.isIE?[j]:[n,j]),new d.Toolbar.Components.Group([o,p])]}}}});
require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/searchreplace/search-toolbar",function(f){var b=require("jquery"),d=require("document");b(d).bind("initContextToolbars.Toolbar",function(b,c){Confluence.Editor.searchToolbar=f.initContextToolbars(b,c)})});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.editor:editor-insert-files', location = 'tinymce3/plugins/insert-files/insert-files-plugin.js' */
define("confluence-editor/tinymce3/plugins/insert-files/insert-files-plugin",["ajs","jquery","confluence-editor/utils/environment"],function(b,a,c){return{init:function(a){a.addButton("confluence-insert-files",{title:"Files",tooltip:"Insert files and images"+" ("+c.transformCmdKeyTextBasingOnOS("Ctrl+M")+")",cmd:"mceConfimage",className:"insert-files",icon:"aui-icon aui-icon-small aui-iconfont-editor-files",
locationGroup:"rte-toolbar-group-files",weight:0})},getInfo:function(){return{longname:"Insert Files",author:"Atlassian",authorurl:"http://www.atlassian.com",infourl:"http://www.atlassian.com/",version:"1.0"}}}});require("confluence/module-exporter").safeRequire("confluence-editor/tinymce3/plugins/insert-files/insert-files-plugin",function(b){var a=require("tinymce");a.create("tinymce.plugins.InsertFiles",b);a.PluginManager.add("insertfiles",a.plugins.InsertFiles)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-templates:template-editor-variables-resources', location = 'js/variable-manager.js' */
define("confluence-templates/variable-manager",["confluence/api/event","jquery"],function(g,f){function i(c,a){var b=c.toLocaleLowerCase(),d=a.toLocaleLowerCase(),b=b.localeCompare(d);0==b&&(b=c.localCompare(a));return b}function h(c){return f.extend(!0,{},e.defaults[c]||e.defaults.string)}var e=function(){var c={};return{find:function(a){var a=a.toLocaleLowerCase(),b={},d;for(d in c)if(c.hasOwnProperty(d)&&(!a.length||0===d.toLocaleLowerCase().indexOf(a)))b[d]=c[d];return b},contains:function(a){return!!c[a]},
get:function(a){return c[a]},getAll:function(){return f.extend(!0,{},c)},getSortedNames:function(){var a=[],b;for(b in c)a.push(b);return a.sort(i)},add:function(a,b){c[a]=b||h();g.trigger("add.confluence-variable",{name:a,details:f.extend(!0,{},b)})},del:function(a){var b=c[a];delete c[a];g.trigger("delete.confluence-variable",{name:a,details:f.extend(!0,{},b)})},rename:function(a,b){var d=c[a];delete c[a];d&&(c[b]=d,g.trigger("rename.confluence-variable",{oldName:a,newName:b,details:f.extend(!0,
{},details)}))},createDefault:h}};e.defaultVariableManager=e();e.defaults={textarea:{type:"textarea",rows:5,columns:100},list:{type:"list",options:[]},string:{type:"string"}};return e});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-templates:template-editor-variables-resources', location = 'js/variable-placeholder.js' */
define("confluence-templates/variable-placeholder",["ajs","jquery"],function(a,d){return{component:{insertPlaceholder:function(c,e){var b;b="$"+c;var f=a.Rte.getEditor();a.Rte.BookmarkManager.storeBookmark();b={title:b,src:a.Meta.get("context-path")+"/plugins/servlet/confluence/placeholder/template-variable?name="+encodeURIComponent(c),"data-variable-name":c,"class":"template-variable",alt:"$"+c};e&&d.extend(b,e);b=d("<img/>").attr(b);f.selection.setNode(b[0])}},init:function(){d(a.Rte.getEditor().getBody()).delegate("img.template-variable",
"dragstart",function(a){a.preventDefault()})}}});"template"===AJS.Meta.get("content-type")&&require("confluence/module-exporter").safeRequire("confluence-templates/variable-placeholder",function(a){Confluence.VariablePlaceHolder=a.component;require("ajs").bind("init.rte",a.init)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-templates:template-editor-variables-resources', location = 'js/variable-toolbar.js' */
define("confluence-templates/variable-toolbar","ajs document confluence/api/event jquery confluence/templates confluence/legacy-editor-global-AVOID-IF-POSSIBLE confluence-templates/variable-placeholder confluence-templates/variable-manager".split(" "),function(c,k,g,e,l,h,m,n){return{init:function(){g.bind("init.rte",function(){var f=n.defaultVariableManager,a=e("#template-menu"),i=a.find(".variables-list");g.bind("add.confluence-variable,delete.confluence-variable,rename.confluence-variable",function(){var b=
f.getSortedNames(),j=b.length,d="";i.toggleClass("hidden",!j);for(var a=0;a<j;a++)d=d+l.Variables.renderVariableItem({variableName:"$"+b[a],tooltip:c.format("Insert the \'\'{0}\'\' field into the page for the template user to fill out.",b[a])});i.html(d)});a.delegate(".variables-list a","click",function(){var b=e(this).attr("data-variable-name");!f.contains(b)&&f.add(b);m.insertPlaceholder(b)});a.delegate(".variables-add","click",function(b){var a=h.Autocompleter.Manager.getInputDrivenDropdown();c.Rte.getEditor().focus();(!a||
a.inactive)&&h.Autocompleter.Manager.shortcutFired("$",true);b.stopPropagation()});e(k).bind("showLayer",function(b,c,d){c==="dropdown"&&d.$.closest(a).length&&d.reset()})})}}});"template"===AJS.Meta.get("content-type")&&require("confluence/module-exporter").safeRequire("confluence-templates/variable-toolbar",function(c){c.init()});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-templates:template-editor-variables-resources', location = 'js/autocomplete-settings-variables.js' */
define("confluence-templates/autocomplete-settings-variables",["confluence/unescape-entities","confluence-templates/variable-manager","confluence-templates/variable-placeholder","ajs"],function(h,d,e,c){return function(){function k(a,b){return{callback:function(c){c.replaceWithSelectedSearchText();!f.contains(a)&&f.add(a);e.component.insertPlaceholder(a,b)},name:c.escapeHtml(a),href:"#"}}function l(a,b){return!a&&!b?0:!a?-1:!b?1:a.toLocaleLowerCase().localeCompare(b.toLocaleLowerCase())}var f=d.defaultVariableManager;
return{ch:"$",cache:!1,endChars:[],dropDownDelay:0,preventStartNodes:"",dropDownClassName:"autocomplete-variables",selectFirstItem:!0,getHeaderText:function(a,b){return b?"Variable suggestions":"Variable suggestions"},getAdditionalLinks:function(a,b){var d=h(b);return f.get(d)||0===b.length?[]:[{className:"dropdown-create-variable",href:"#",callback:function(a){var b=a.plainText();a.replaceWithSelectedSearchText();!f.contains(b)&&
f.add(b);e.component.insertPlaceholder(b,void 0)},name:c.format("Create variable \'\'{0}\'\'",b)}]},getDataAndRunCallback:function(a,b,c){var g,d,a=h(b),e=f.find(a),i=[],j=[];for(g in e)e.hasOwnProperty(g)&&i.push(g);i.sort(l);a=0;for(d=i.length;a<d;a++)g=i[a],j.push(k(g,e[g]));c([j],b)},update:function(){}}}});
require("confluence/module-exporter").safeRequire("confluence-templates/autocomplete-settings-variables",function(h){var d=require("ajs"),e=require("confluence/meta");d.bind("init.rte",function(){var c=require("tinymce");"template"===e.get("content-type")&&(Confluence.Editor.Autocompleter||(Confluence.Editor.Autocompleter=c.confluence.Autocompleter),Confluence.Editor.Autocompleter.Settings.$=h())})});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-templates:template-editor-variables-resources', location = 'js/property-panel-variables.js' */
define("confluence-templates/property-panel-variables",["ajs","jquery","confluence/property-panel","confluence-templates/variable-manager"],function(c,a,o,h){return{name:"variable",canHandleElement:function(a){return a.hasClass("template-variable")},handle:function(f){function l(d){c.debug("clicked type: "+d);var b=a("#property-panel");b.find(".panel-buttons").toggleClass("no-inputs","string"===d);b.find(".textarea-section,.list-section,.string-section").addClass("hidden");b.find("."+d+"-section").removeClass("hidden");
"textarea"===d?(a("#variable-property-panel-textarea-rows").val(e.rows),a("#variable-property-panel-textarea-columns").val(e.columns)):"list"===d&&a("#variable-property-panel-list-values").val(e.options.join(","))}function i(d,b,c){return{className:"variable-property-panel-type-item variable-property-panel-type-"+d,text:b,tooltip:c,selected:m===d,click:function(){e.type=d;e=j.createDefault(d);j.add(k,e);a(".variable-property-panel-type-item").removeClass("selected");a(".variable-property-panel-type-"+
d).addClass("selected");l(d)}}}function g(a){return m===a?"":" hidden"}if(!("click"!==f.e.type&&"mouseup"!==f.e.type)){var f=f.containerEl,n=a(f),k,b=[],p={originalHeight:n.height(),anchorIframe:c.Rte.getEditorFrame()};k=n.attr("data-variable-name");var j=h.defaultVariableManager,e=j.get(k),m=e&&e.type||"string";b.push(i("string","Text","Single line text input field."));b.push(i("textarea","Multi-line Text",
"Multi-line text input field."));b.push(i("list","List","Drop down list."));b.push(null);b.push({className:"editable textarea-section"+g("textarea"),tooltip:"Number of rows to display for the field.",html:'<input id="variable-property-panel-textarea-rows"/>'});b.push({className:"variable-property-panel-textarea-split textarea-section"+g("textarea"),
tooltip:"",html:"<span>x</span>"});b.push({className:"editable textarea-section"+g("textarea"),tooltip:"Number of columns to display for the field.",html:'<input id="variable-property-panel-textarea-columns"/>'});b.push(null);b.push({className:"editable list-section"+g("list"),tooltip:"Enter each item for the list, separating each with a comma.",html:"<input id=\"variable-property-panel-list-values\" size='50'/>"});o.createFromButtonModel("variable",f,b,p);l(e.type);a("#variable-property-panel-textarea-rows").change(function(){e.rows=
+a(this).val()||h.defaults.textarea.rows});a("#variable-property-panel-textarea-columns").change(function(){e.columns=+a(this).val()||h.defaults.textarea.columns});a("#variable-property-panel-list-values").change(function(){var d,b,c,f=a(this).val().split(",");e.options=[];d=0;for(b=f.length;d<b;d++)(c=a.trim(f[d]))&&e.options.push(c)});a("#variable-property-panel-textarea-rows,#variable-property-panel-textarea-columns,#variable-property-panel-list-values").keypress(function(b){13===b.which&&a(this).blur()})}}}});
require("confluence/module-exporter").exportModuleAsGlobal("confluence-templates/property-panel-variables","AJS.Confluence.PropertyPanel.Variable",function(c){var a=require("ajs");a.bind("init.rte",function(){a.trigger("add-handler.property-panel",c)})});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-templates:template-editor-variables-resources', location = 'js/variable-marshaller.js' */
define("confluence-templates/variable-marshaller",["ajs","jquery","confluence-templates/variable-manager"],function(d,b,q){function r(c){var a=c.attr("data-variable-type");return"textarea"===a?{type:a,rows:+c.attr("data-variable-rows")||i,columns:+c.attr("data-variable-columns")||s}:"list"===a?{type:a,options:c.find("li").map(function(){return b(this).attr("data-variable-option")}).toArray()}:{type:"string"}}function m(){var c=b(d.Rte.getEditor().getBody()).find("img[data-variable-name]"),a={};b.map(c,
function(c){var f={};b(c).attr("data-variable-raw-xhtml")&&(f={"data-variable-raw-xhtml":!0});a[b(c).attr("data-variable-name")]=f});return a}var i=5,s=100;return function(){function c(a){for(var b in a)a.hasOwnProperty(b)&&!f.contains(b)&&(d.debug("adding: ",b),f.add(b,a[b]))}var a=d.Rte.getEditor(),i=b(a.getBody()),f=q.defaultVariableManager;a.onGetContent.add(function(a,d){var i=b("<div></div>"),n=b("<ul></ul>").attr("data-variable-declarations","true"),e;i.append(n);var o=m();c(o);var p=f.getAll(),
l;for(l in p)if(o.hasOwnProperty(l)){var j=l;e=p[l];var g=void 0,k=void 0,g=e.type,h=b("<li></li>");h.attr("data-variable-name",j);h.attr("data-variable-type",g);h.text(j);if("textarea"===g)h.attr("data-variable-rows",e.rows),h.attr("data-variable-columns",e.columns);else if("list"===g){g=b("<ul></ul>");j=void 0;for(j in e.options)k=e.options[j],k=b("<li></li>").text(k).attr("data-variable-option",k),g.append(k);h.append(g)}e=h;n.append(e)}d.content=i.html()+d.content});a=i.find("ul[data-variable-declarations]");
a.remove();a.find("li[data-variable-name]").each(function(){var a=b(this);f.add(a.attr("data-variable-name"),r(a))});c(m())}});"template"===AJS.Meta.get("content-type")&&require("confluence/module-exporter").safeRequire("confluence-templates/variable-marshaller",function(d){require("ajs").bind("init.rte",d)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-templates:template-editor-variables-template-resources', location = 'js/variable-templates.soy' */
// This file was automatically generated from variable-templates.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.Variables.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.Variables == 'undefined') { Confluence.Templates.Variables = {}; }


Confluence.Templates.Variables.renderVariableItem = function(opt_data, opt_ignored) {
  return '<li class="dropdown-item" data-tooltip="' + soy.$$escapeHtml(opt_data.tooltip) + '"><a href="#" class="item-link variable-item" title="' + soy.$$escapeHtml(opt_data.variableName) + '" data-variable-name="' + soy.$$escapeHtml(opt_data.variableName) + '">' + soy.$$escapeHtml(opt_data.variableName) + '</a></li>';
};
if (goog.DEBUG) {
  Confluence.Templates.Variables.renderVariableItem.soyTemplateName = 'Confluence.Templates.Variables.renderVariableItem';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.status-macro:editor_status', location = 'js/status-editor.js' */
(function(d){var v="macro-placeholder-property-panel-edit-button";var n="status-macro-title first last editable";var r=13;var f=27;var o="status";var q=["Grey","Red","Yellow","Green","Blue"];var k=q[0];var t;var u,m,a;function s(){e();var z=Confluence.MacroParameterSerializer.deserialize(d(u).attr("data-macro-parameters")),A=false,y=false;if(z&&m){A=z.title!==m.title;y=z.colour!==m.colour}return A||y}function e(){if(a){var y=(b(m)==a.val());var z=(a.val()==="");if(y||z){delete m.title}else{m.title=a.val()}}}function p(){if(t&&t.state&&t.state()==="pending"){AJS.log("Macro update already in progress.");return}e();var z={contentId:Confluence.Editor.getContentId(),macro:{name:o,params:m,defaultParameterValue:"",body:""}};t=tinymce.confluence.MacroUtils.insertMacro(z,u);function y(A){AJS.Rte.getEditor().selection.select(A);AJS.Rte.BookmarkManager.storeBookmark();AJS.Rte.getEditor().selection.collapse()}t.done(function(A,B){u=A;y(u)}).fail(function(A){AJS.logError("Failed to load status macro - "+A)})}function b(y){return((y.colour||y.color)||k)}function j(){a=null;return true}function c(y){var z=d("<input/>");z.attr("class",n);z.keyup(function(A){if(A.keyCode===r){AJS.Confluence.PropertyPanel.destroy();return false}return true});z.keydown(function(A){if(A.keyCode===f){return j()}return true});return z}function x(y){a=c(m);a.val(y.find("span.panel-button-text").text());y.replaceWith(a);a.select().focus()}function h(){d.each(q,function(y,A){var z=function(C,B){m.colour=A;AJS.Confluence.PropertyPanel.destroy()};AJS.Confluence.PropertyPanel.Macro.registerButtonHandler(A,z,o)})}function i(y){return y.title||b(y)}function g(y){return{className:n,text:AJS.escapeHtml(y),click:x}}function l(z){for(var y=0;y<z.length;y++){if(z[y].className.indexOf(v)>-1){return z[y]}}return null}function w(y){var z=l(y);var A=function(B){tinymce.confluence.macrobrowser.editMacro(d(B))};z.click=function(){AJS.Confluence.PropertyPanel.destroy();if(!s()){A(u)}else{t.always(A)}}}AJS.Confluence.PropertyPanel.Macro.registerInitHandler(function(A,z,y){u=A;w(z);m=Confluence.MacroParameterSerializer.deserialize(d(u).attr("data-macro-parameters"));a=null;z.splice(1,0,g(i(m)))},"status");h();AJS.bind("destroyed.property-panel",function(y){if(s()){p()}})})(AJS.$);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-mentions-plugin:editor-autocomplete-mentions-analytics', location = 'js/tinyMce-autocomplete-analytics-mentions.js' */
define("confluence-mentions-plugin/tinyMce-autocomplete-analytics-mentions",["confluence/api/event"],function(e){var d;var c=false;function b(i,j){if(j.triggerChar==="@"){d=Date.now();c=false;e.trigger("analytics",{name:"confluence.editor.autocomplete.mentions.trigger",data:{}})}}function f(j,k){if(k.triggerChar==="@"){var i=a(false);c=true;e.trigger("analytics",{name:g("confluence.editor.autocomplete.mentions.insert",i),data:{sessionDurationInMillis:i}})}}function h(j,k){if(k.triggerChar==="@"){if(!c){var i=a(true);e.trigger("analytics",{name:g("confluence.editor.autocomplete.mentions.close",i),data:{sessionDurationInMillis:i}})}c=false}}function a(j){var i=-1;if(d){i=Date.now()-d;if(j){d=null}}return i}function g(j,i){if(i===-1){return j}else{if(i<1000){return j+".less.than.1s"}else{if(i<5000){return j+".less.than.5s"}else{if(i<10000){return j+".less.than.10s"}else{if(i<20000){return j+".less.than.20s"}else{return j+".more.than.20s"}}}}}}return{init:function(){e.bind("init.rte",function(){if(!AJS.DarkFeatures.isEnabled("fabric.mentions")||!AJS.Meta.getBoolean("editor-frontend-enabled")){e.bind("rte-autocomplete-on-start",b);e.bind("rte-autocomplete-on-select",f);e.bind("rte-autocomplete-on-death",h)}});e.bind("rte-destroyed",function(){if(!AJS.DarkFeatures.isEnabled("fabric.mentions")||!AJS.Meta.getBoolean("editor-frontend-enabled")){e.unbind("rte-autocomplete-on-death",h);e.unbind("rte-autocomplete-on-select",f);e.unbind("rte-autocomplete-on-start",b)}})}}});require("confluence/module-exporter").safeRequire("confluence-mentions-plugin/tinyMce-autocomplete-analytics-mentions",function(a){a.init()});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-mentions-plugin:editor-autocomplete-mentions', location = 'js/tinyMce-autocomplete-settings-mentions.js' */
define("confluence-mentions-plugin/tinyMce-autocomplete-settings-mentions",["jquery","ajs","confluence/legacy"],function(c,b,d){function a(){if(b.DarkFeatures.isEnabled("fabric.mentions")&&b.Meta.getBoolean("editor-frontend-enabled")){return}var h;if(!d.Editor.Autocompleter){d.Editor.Autocompleter=tinymce.confluence.Autocompleter}var f=function(k){if(k){return b.contextPath()+"/rest/prototype/1/search.json"}else{if(b.Meta.get("remote-user")){return b.contextPath()+"/rest/mentions/1/network.json"}}return null},g=function(m,l){var k={"max-results":m.maxResults||10};if(l){k.query=d.unescapeEntities(l);k.search="user"}return k},i=function(o,n){var p=o.split(/\s/);var m=n.title;var k=-1;for(var l=0;l<p.length;l++){var q=m.indexOf(p[l]);if(q<k){return false}k=q}return true},e=function(s,l,r,n,m){if(h!==l){return}var q=s.statusMessage;var o;if(q){o=[[{html:s.statusMessage,className:"error"}]]}else{var k=[];o=[k];if(s.result){b.$.each(s.result,function(t,v){var u=b.$.extend({},v);u.key=u.username;u.linkAlias=u.title;u.title=u.title+" ("+u.username+")";k.push(u)});k.sort(function(u,t){var w=i(l,u);var v=i(l,t);if(w==v){return(u<t?u:t)}return w?-1:1})}o=b.REST.convertFromRest(o)}function p(u,t){if(m&&typeof m=="function"){m(o,u,t)}}r(o,l,p,l.split(/\s/))},j=function(m,o,s,l,r,u,p){var k=o(l),q=m.settings.cacheManager,n=q.get(l),t;if(k){t=c.ajax({type:"GET",url:k,data:s(m,l),dataType:"json",global:false,timeout:10000});t.done(function(v){q.put(l,v)});if(n){e(n,l,r,u,p)}else{t.done(function(v){e(v,l,r,u,p)});t.fail(function(w,v){if(v=="timeout"){e({statusMessage:"Timeout",query:l},l,r,u)}})}}else{r([],l)}};d.Editor.Autocompleter.Settings["@"]={ch:"@",endChars:[],dropDownClassName:"autocomplete-mentions",selectFirstItem:true,getHeaderText:function(l,k){if(k){return "User suggestions"}else{return "Mention someone by typing their name..."}},getAdditionalLinks:function(n,l,m){var k=[];m(l,k);return k},getDataAndRunCallback:function(m,k,l){k=c.trim(k);h=k;j(m,f,g,k,l,"content",function(n,p,o){if(p!==""&&n.length<2){if(o.length==0){o.push({html:'<span class="no-result">'+"No user found"+"</span>"})}}else{o.length=0}})},update:function(m,k){if(k.restObj){var l=b.$.extend(k.restObj,{title:k.restObj.linkAlias});k=d.Link.fromREST(l)}k.insert()}}}return a});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-mentions-plugin:editor-autocomplete-mentions', location = 'js/mention_editor_plugin.js' */
define("confluence-mentions-plugin/mention_editor_plugin",["jquery","ajs","confluence/legacy","confluence-mentions-plugin/tinyMce-autocomplete-settings-mentions"],function(c,a,d,b){return{init:function(){if(a.DarkFeatures.isEnabled("fabric.mentions")&&a.Meta.getBoolean("editor-frontend-enabled")){return}a.EventQueue=a.EventQueue||[];function f(){a.EventQueue.push({name:"confluencementioninsert"});d.Editor.Autocompleter.Manager.shortcutFired("@",true)}function e(g){return g&&g.shiftKey&&!g.ctrlKey&&!g.altKey&&!g.altGraphKey&&!g.metaKey&&g.which===64}tinymce.create("tinymce.plugins.InsertMention",{init:function(g){b();c("#insertmention-button").click(function(h){h.stopPropagation();h.preventDefault();var i=d.Editor.Autocompleter.Manager.getInputDrivenDropdown();if(!i||i.inactive){tinymce.execCommand("mceFocus",false,g.id);f()}});a.bind("editor.text-placeholder.activated",function(i,h){if(h&&h.placeholderType==="mention"){if(e(h.triggerEvent)){tinymce.dom.Event.cancel(h.triggerEvent)}f()}});if(a.Rte.Placeholder&&a.Rte.Placeholder.addPlaceholderType){a.Rte.Placeholder.addPlaceholderType({type:"mention",label:"User mention",tooltip:"Instructional text is replaced with suggested people when a person types."})}},getInfo:function(){return{longname:"Insert Mention",author:"Atlassian",authorurl:"http://www.atlassian.com",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("insertmention",tinymce.plugins.InsertMention);a.Rte.BootstrapManager.addTinyMcePluginInit(function(g){g.plugins+=",insertmention"})}}});require("confluence/module-exporter").safeRequire("confluence-mentions-plugin/mention_editor_plugin",function(a){require("ajs").bind("rte-pre-resolveplugins",function(){a.init()})});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.keyboardshortcuts:confluence-tinymce-keyboard-shortcuts', location = 'js/tinymce-plugin.js' */
define("confluence-keyboard-shortcuts/tinymce-plugin",["ajs","confluence-keyboard-shortcuts/confluence-keyboard-shortcuts"],function(e,b){return{init:function(a){e.debug("Init Editor Keyboard shortcuts plugin");for(var c=function(b){return function(){a.execCommand("FormatBlock",!1,b)}},d=1;7>d;d++)a.addCommand("FormatBlock-h"+d,c("h"+d));a.addCommand("FormatBlock-p",c("p"));a.addCommand("FormatBlock-pre",c("pre"));a.addCommand("FormatBlock-blockquote",c("blockquote"));a.addCommand("mceConfShortcutDialog",
b.keyboardShortcuts.openDialog);a.addButton("help",{title:"confluence.conf_shortcuts_help_desc",cmd:"mceConfShortcutDialog"})},getInfo:function(){var a=require("tinymce");return{longname:"Atlassian Editor Keyboard Shortcuts Plugin",author:"Atlassian",authorurl:"http://www.atlassian.com",version:a.majorVersion+"."+a.minorVersion}}}});
require("confluence/module-exporter").safeRequire("confluence-keyboard-shortcuts/tinymce-plugin",function(e){var b=require("tinymce");b.create("tinymce.plugins.KeyboardShortcutsPlugin",e);b.PluginManager.add("keyboardshortcuts",b.plugins.KeyboardShortcutsPlugin)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.sticky-table-headers:stickytableheaders-resources', location = '/js/vendor/jquery.stickytableheaders.js' */
/*! Modified by Atlassian | Copyright (c) 2011 by Jonas Mosbech - https://github.com/jmosbech/StickyTableHeaders
	MIT license info: https://github.com/jmosbech/StickyTableHeaders/blob/master/license.txt */
(function(d,c,f){var a="stickyTableHeaders",g=0,e={fixedOffset:0,leftOffset:0,marginTop:0,objDocument:document,objHead:"head",objWindow:c,scrollableArea:c,cacheHeaderHeight:false};function b(i,h){var j=this;j.$el=d(i);j.el=i;j.id=g++;j.$el.bind("destroyed",d.proxy(j.teardown,j));j.$clonedHeader=null;j.$originalHeader=null;j.cachedHeaderHeight=null;j.isSticky=false;j.hasBeenSticky=false;j.leftOffset=null;j.topOffset=null;j.init=function(){j.setOptions(h);j.$el.each(function(){var k=d(this);k.css("padding",0);j.$originalHeader=d("thead:first",this);j.$clonedHeader=j.$originalHeader.clone();k.trigger("clonedHeader."+a,[j.$clonedHeader]);j.$clonedHeader.addClass("tableFloatingHeader");j.$clonedHeader.css("display","none");j.$originalHeader.addClass("tableFloatingHeaderOriginal");j.$originalHeader.after(j.$clonedHeader);j.$printStyle=d('<style type="text/css" media="print">.tableFloatingHeader{display:none !important;}.tableFloatingHeaderOriginal{position:static !important;}</style>');j.$head.append(j.$printStyle)});j.updateWidth();j.toggleHeaders();j.bind()};j.destroy=function(){j.$el.unbind("destroyed",j.teardown);j.teardown()};j.teardown=function(){if(j.isSticky){j.$originalHeader.css("position","static")}d.removeData(j.el,"plugin_"+a);j.unbind();j.$clonedHeader.remove();j.$originalHeader.removeClass("tableFloatingHeaderOriginal");j.$originalHeader.css("visibility","visible");j.$printStyle.remove();j.el=null;j.$el=null};j.bind=function(){j.$scrollableArea.on("scroll."+a,j.toggleHeaders);if(!j.isWindowScrolling){j.$window.on("scroll."+a+j.id,j.setPositionValues);j.$window.on("resize."+a+j.id,j.toggleHeaders)}j.$scrollableArea.on("resize."+a,j.toggleHeaders);j.$scrollableArea.on("resize."+a,j.updateWidth)};j.unbind=function(){j.$scrollableArea.off("."+a,j.toggleHeaders);if(!j.isWindowScrolling){j.$window.off("."+a+j.id,j.setPositionValues);j.$window.off("."+a+j.id,j.toggleHeaders)}j.$scrollableArea.off("."+a,j.updateWidth)};j.debounce=function(l,k){var m=null;return function(){var o=this,n=arguments;clearTimeout(m);m=setTimeout(function(){l.apply(o,n)},k)}};j.toggleHeaders=j.debounce(function(){if(j.$el){j.$el.each(function(){var q=d(this),r,n=j.isWindowScrolling?(isNaN(j.options.fixedOffset)?j.options.fixedOffset.outerHeight():j.options.fixedOffset):j.$scrollableArea.offset().top+(!isNaN(j.options.fixedOffset)?j.options.fixedOffset:0),m=q.offset(),k=j.$scrollableArea.scrollTop()+n,l=j.$scrollableArea.scrollLeft(),o=j.options.cacheHeaderHeight?j.cachedHeaderHeight:j.$clonedHeader.height(),p=j.isWindowScrolling?k>m.top:n>m.top,s=(j.isWindowScrolling?k:0)<(m.top+q.height()-o-(j.isWindowScrolling?0:n));if(p&&s){r=m.left-l+j.options.leftOffset;j.$originalHeader.css({position:"fixed","margin-top":j.options.marginTop,left:r,"z-index":3});j.leftOffset=r;j.topOffset=n;j.$clonedHeader.css("display","");if(!j.isSticky){j.isSticky=true;j.updateWidth();q.trigger("enabledStickiness."+a)}j.setPositionValues()}else{if(j.isSticky){j.$originalHeader.css("position","static");j.$clonedHeader.css("display","none");j.isSticky=false;j.resetWidth(d("td,th",j.$clonedHeader),d("td,th",j.$originalHeader));q.trigger("disabledStickiness."+a)}}})}},0);j.setPositionValues=j.debounce(function(){var k=j.$window.scrollTop(),l=j.$window.scrollLeft();if(!j.isSticky||k<0||k+j.$window.height()>j.$document.height()||l<0||l+j.$window.width()>j.$document.width()){return}j.$originalHeader.css({top:j.topOffset-(j.isWindowScrolling?0:k),left:j.leftOffset-(j.isWindowScrolling?0:l)})},0);j.updateWidth=j.debounce(function(){if(!j.isSticky){return}if(!j.$originalHeaderCells){j.$originalHeaderCells=d("th,td",j.$originalHeader)}if(!j.$clonedHeaderCells){j.$clonedHeaderCells=d("th,td",j.$clonedHeader)}var k=j.getWidth(j.$clonedHeaderCells);j.setWidth(k,j.$clonedHeaderCells,j.$originalHeaderCells);j.$originalHeader.css("width",j.$clonedHeader.width());if(j.options.cacheHeaderHeight){j.cachedHeaderHeight=j.$clonedHeader.height()}},0);j.getWidth=function(k){var l=[];k.each(function(p){var r,s=d(this);if(s.css("box-sizing")==="border-box"){var t=s[0].getBoundingClientRect();if(t.width){r=t.width}else{r=t.right-t.left}}else{var n=d("th",j.$originalHeader);if(n.css("border-collapse")==="collapse"){if(c.getComputedStyle){r=parseFloat(c.getComputedStyle(this,null).width)}else{var q=parseFloat(s.css("padding-left"));var m=parseFloat(s.css("padding-right"));var o=parseFloat(s.css("border-width"));r=s.outerWidth()-q-m-o}}else{r=s.width()}}l[p]=r});return l};j.setWidth=function(m,k,l){k.each(function(n){var o=m[n];l.eq(n).css({"min-width":o,"max-width":o})})};j.resetWidth=function(k,l){k.each(function(m){var n=d(this);l.eq(m).css({"min-width":n.css("min-width"),"max-width":n.css("max-width")})})};j.setOptions=function(k){j.options=d.extend({},e,k);j.$window=d(j.options.objWindow);j.$head=d(j.options.objHead);j.$document=d(j.options.objDocument);j.$scrollableArea=d(j.options.scrollableArea);j.isWindowScrolling=j.$scrollableArea[0]===j.$window[0]};j.updateOptions=function(k){j.setOptions(k);j.unbind();j.bind();j.updateWidth();j.toggleHeaders()};j.init()}d.fn[a]=function(h){return this.each(function(){var i=d.data(this,"plugin_"+a);if(i){if(typeof h==="string"){i[h].apply(i)}else{i.updateOptions(h)}}else{if(h!=="destroy"){d.data(this,"plugin_"+a,new b(this,h))}}})}})(jQuery,window);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.sticky-table-headers:stickytableheaders-resources', location = '/js/lib/utils.js' */
define("sticky-table-headers/utils",["jquery"],function(d){var c=function(m){return !m.hasClass("stickyTableHeaders")};var f=function(m){return !m.parents("table").length>0};var l=function(m){return m.find("> thead:first").is(":visible")};var b=function(m){return m.find("thead").children().length===1};var i=function(m){return !m.closest(".columnLayout").length>0};var h=function(){return !d("body").hasClass("theme-documentation")};var a=function(m){return m.find(".confluenceTh").parent().length===1};var j=function(m){return m.find(".confluenceTh").siblings().hasClass("confluenceTh")};var g=function(n){var m=d(n);return h()&&c(m)&&i(m)&&f(m)&&l(m)&&b(m)&&a(m)&&j(m)};var k=function(m,o){var n=o||d(window);m.closest(".table-wrap").scroll(function(){n.trigger("scroll.stickyTableHeaders")})};var e=function(m){d(m).each(function(){var r=d(this);var s=r.find(".confluenceTh[rowspan]").length>0;var o=r.find("> :first-child > :first-child .confluenceTh");var n=o.length&&o.closest("thead").length>0;var q=o.length&&o.parent().index()===0;if(f(r)&&i(r)&&!n&&q&&!s){var p=d("<thead />").append(o.parent());r.prepend(p)}})};return{isAValidTable:g,bindHorizontalScrolling:k,moveHeaderRowsToTHead:e,isNotDocumentationTheme:h}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.sticky-table-headers:stickytableheaders-resources', location = '/js/lib/viewpage.js' */
define("sticky-table-headers/viewpage",["jquery","ajs","sticky-table-headers/utils"],function(e,b,d){var c=function(h,g){var f=e(h).filter(function(){return d.isAValidTable(this)});f.stickyTableHeaders(g).addClass("stickyTableHeaders");b.bind("sticky-table-headers.change.options",function(i,j){f.stickyTableHeaders(j)});d.bindHorizontalScrolling(f)};var a=function(){var g=e(".confluenceTable");var j=e(window);if(!d.isNotDocumentationTheme()){return}d.moveHeaderRowsToTHead(g);if(window.MutationObserver){var i=document.querySelector("#page");var h=/sticky|tableFloating|confluenceTh/;var f=new MutationObserver(e.debounce(function(l){var n=false;var o;for(var m=0,k=l.length;m<k;m++){o=l[m].target.className;if(!h.test(o)){n=true;break}}if(n){j.trigger("resize.stickyTableHeaders")}},0));f.observe(i,{subtree:true,attributes:true,childList:true})}c(g,{cacheHeaderHeight:true})};return{initialize:a,setupTable:c}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.sticky-table-headers:stickytableheaders-resources', location = '/js/lib/editor.js' */
define("sticky-table-headers/editor",["ajs","jquery","sticky-table-headers/utils",],function(b,f,e){var d=function(g){var h={};h.objWindow=f(g.getWin());h.scrollableArea=h.objWindow;h.objDocument=f(g.getDoc());h.objHead=h.objDocument.find("head");return h};var c=function(k,h){var j=b.Rte.getEditor();if(j){var l=d(j);var i=f.extend({},l,h);var g=f(k).filter(function(){return e.isAValidTable(this)});g.stickyTableHeaders(i).addClass("stickyTableHeaders");e.bindHorizontalScrolling(g,i.objWindow)}};var a=function(){var h=b.Rte.getEditor();if(h){var g=f(h.getBody()).find(".confluenceTable");e.moveHeaderRowsToTHead(g);c(g)}};return{initialize:a,setupTable:c}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.sticky-table-headers:stickytableheaders-resources', location = '/js/stickytableheaders.js' */
define("sticky-table-headers",["ajs","sticky-table-headers/viewpage","sticky-table-headers/editor"],function(a,c,b){return{initialize:function(){if(!a.DarkFeatures.isEnabled("confluence-table-enhancements.sticky-headers.disabled")){a.toInit(c.initialize)}if(a.DarkFeatures.isEnabled("confluence-table-enhancements.sticky-headers-editor")){a.bind("rte-ready",b.initialize);a.bind("rte-quick-edit-push-state",b.initialize);a.bind("rte-quick-edit-push-hash",b.initialize)}}}});require("sticky-table-headers").initialize();
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.image.effects.ImageEffectsPlugin:propertiespanel', location = 'com/atlassian/confluence/image/effects/property-panel.js' */
AJS.toInit(function(e){var p,i=/(\?|\&)(effects\=[^&]+)($|&)/,t=/(^|\&)(effects\=([^&]+))($|&)/,s=null,j=[],h=2000;q();if(Confluence.Editor.ImageProps){f()}else{l()}function f(){AJS.bind("dialog-created.image-properties",function(x,y){p=y.img;var z="image-effects",w="image-effects-panel";if(!a()){Confluence.Editor.ImageProps.registerPanel(z,c("Image effects can\'t be applied to web images"),w,null)}else{if(!n()){Confluence.Editor.ImageProps.registerPanel(z,c("The image\'s pixel count is too large to apply effects."),w,null)}else{Confluence.Editor.ImageProps.registerPanel("image-effects",c(),"image-effects-panel",r)}}});AJS.bind("dialog-before-show.image-properties",function(){b();o(m(e(p)))})}function l(){var w=new AJS.Dialog({width:600,height:500,id:"image-effects-dialog"});w.addHeader("Add Image Effect");w.addPanel("",c(),"");b();w.addSubmit("Save",function(){var x=v();x.done(function(){w.hide()})});w.addCancel("Close",function(){w.hide()});AJS.Confluence.PropertyPanel.Image.pluginButtons.push(null,{create:function(x){p=x[0];var z=m(x),y=!a();return{className:"image-effects",text:"Effects...",tooltip:y?"Image effects can\'t be applied to web images":"Add an image effect like drop shadow or picture frame",click:function(){if(!n()){alert("The image\'s pixel count is too large to apply effects.");return false}o(m(e(p)));AJS.Confluence.PropertyPanel.destroy();w.show()},disabled:y,selected:!!z}}})}function g(y,A){var B=y.attr("src");var x=i.exec(B);var w=A?"effects="+A:"";if(x){B=B.replace(x[2],w)}else{if(A){B=B+(B.indexOf("?")!=-1?"&":"?")+w}}y.attr("src",B);y.attr("data-mce-src",B);var z=y.attr("confluence-query-params");if(z){var x=t.exec(z);if(x){z=z.replace(x[2],w)}else{z=z+"&"+w}}else{z=w}y.attr("confluence-query-params",z)}function m(x){var y=x.attr("confluence-query-params");var w=t.exec(y);if(w){return w[3]}}function o(w){e(".image-effect-preview.selected").removeClass("selected");if(w){e(j).each(function(x,y){if(y.effects==w){e(e(".image-effect-preview")[x]).addClass("selected");return false}})}else{e(".image-effect-preview.image-effect-none").addClass("selected")}s=w}function q(){j.push({name:"None",effects:null});j.push({name:"Taped",effects:"border-simple,blur-border,tape"});j.push({name:"Instant Camera",effects:"border-polaroid,blur-border"});j.push({name:"Curl Shadow",effects:"border-simple,shadow-kn"});j.push({name:"Snapshot",effects:"border-simple,blur-border"});j.push({name:"Drop Shadow",effects:"drop-shadow"})}function c(w){if(w){return'<div class="aui-message warning"><span class="aui-icon icon-warning"></span>'+w+"</div>"}return'<div class="image-effects"><ul class="image-list"></ul></div>'}function b(){var x=e("div.image-effects ul.image-list");var z=Math.floor(Math.random()*22)+1;for(var y=0;y<j.length;y++){var w=e('<li class="attached-image image-effect-preview'+(!j[y].effects?" image-effect-none":"")+'"><div class="image-container"><img class="thumbnail" src="'+AJS.contextPath()+"/plugins/servlet/imgFilter.png?preview=true&id="+z+"&effects="+j[y].effects+'" title="'+j[y].name+'" style="margin-top: 5px"></div><span class="caption filename" title="'+j[y].name+'">'+j[y].name+"</span></li>");w.hover(function(){e(this).addClass("hover")},function(){e(this).removeClass("hover")});x.append(w);var A=j[y];w.click(A,function(B){e(".image-effect-preview.selected").removeClass("selected");e(this).addClass("selected");s=B.data.effects})}}function a(){return !e(p).hasClass("confluence-external-resource")}function n(){return !(p.naturalHeight&&p.naturalWidth&&(p.naturalHeight*p.naturalWidth)>(h*h))}function r(){return u()}function v(){return u(d,k)}function u(w,z){var y=e.Deferred();w&&w();p.onload=A;var x=p.src;g(e(p),s);if(p.src==x){A()}function A(){z&&z();y.resolve();p.onload=null;tinyMCE.activeEditor.undoManager.add()}return y}function d(){var C=dialog.popup.element,x=50,z=x*13/60,D=x*30/60,w=x-D,y=e('<div class="image-properties-loading-blanket"><div class="loading-data"></div></div>').appendTo(C.find(".dialog-page-body")),B=y.find(".loading-data");y.css({width:y.parent().width(),height:C.height()});B.css({marginTop:-x*1.2,marginLeft:-x*1.2});var A={color:"#666",width:z,radius:D,length:w,top:0,left:0,zIndex:0,speed:1.042};B.spin(A)}function k(){var w=dialog.popup.element.find(".image-properties-loading-blanket .loading-data");w.css({marginTop:"",marginLeft:""});w.spinStop();w.closest(".image-properties-loading-blanket").remove()}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-browser-metrics:editor', location = '/js/editor.js' */
require(["internal/browser-metrics","jquery"],function(b,c){function a(){var h=AJS.Meta.get("content-type");var g=AJS.Meta.getBoolean("new-page")?"create":"edit";var f=c("body");var d=f.hasClass("edit")||f.hasClass("create");if(d&&h&&g){if(AJS.Meta.getBoolean("collaborative-content")){var e="confluence."+h+"."+g+".collaborative.view";b.start({key:e,isInitial:true});AJS.bind("rte-collab-ready",function(){b.end({key:e});b.start({key:e+".connected"})});AJS.bind("synchrony.connected",function(){b.end({key:e+".connected"})})}else{if(!AJS.Meta.getBoolean("collaborative-content")){b.start({key:"confluence."+h+"."+g+".view",ready:".active-richtext",isInitial:true})}}}}c(a)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-image-attributes:soy-resources', location = 'soy/image-attributes-panel.soy' */
// This file was automatically generated from image-attributes-panel.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.Editor.ImageAttributes.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.Editor == 'undefined') { Confluence.Templates.Editor = {}; }
if (typeof Confluence.Templates.Editor.ImageAttributes == 'undefined') { Confluence.Templates.Editor.ImageAttributes = {}; }


Confluence.Templates.Editor.ImageAttributes.content = function(opt_data, opt_ignored) {
  return '<form class="aui" onsubmit="return false;"><div class="field-group"><label for="image-title-attribute">' + soy.$$escapeHtml('Title text') + '</label><input class="text" type="text" id="image-title-attribute" name="image-title-attribute" value="' + ((opt_data.imgTitle) ? soy.$$escapeHtml(opt_data.imgTitle) : '') + '"><div class="description">' + soy.$$escapeHtml('Appears when the cursor hovers over the image') + '</div></div><div class="field-group"><label for="image-alt-attribute">' + soy.$$escapeHtml('Alt text') + '</label><input class="text" type="text" id="image-alt-attribute" name="image-alt-attribute" value="' + ((opt_data.imgAlt) ? soy.$$escapeHtml(opt_data.imgAlt) : '') + '"><div class="description">' + soy.$$escapeHtml('Used by screen readers and when the image cannot be shown') + '</div></div></form>';
};
if (goog.DEBUG) {
  Confluence.Templates.Editor.ImageAttributes.content.soyTemplateName = 'Confluence.Templates.Editor.ImageAttributes.content';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-image-attributes:image-attributes', location = 'js/image-attributes-panel.js' */
define("confluence-image-attributes/image-attributes-panel",["jquery","ajs","confluence/templates","confluence/legacy-editor-global-AVOID-IF-POSSIBLE"],function(f,h,i,j){return function(){function k(){var a=c.val();d.attr({"data-element-title":a,title:l(d.attr("data-location"),a),alt:e.val()})}function l(a,b){return a&&0<a.length&&b&&0<b.length?a+" ("+b+")":a&&0<a.length?a:b&&0<b.length?"("+b+")":""}h.bind("dialog-created.image-properties",function(a,b){d=f(b.img);var g=f(i.Editor.ImageAttributes.content({imgTitle:d.attr("data-element-title"),
imgAlt:d.attr("alt")}));c=g.find("#image-title-attribute");e=g.find("#image-alt-attribute");c.val()===e.val()&&(c.bind("input.chained",function(){e.val(c.val())}),e.on("change",function(){c.unbind("input.chained")}));j.ImageProps.registerPanel(m,g,n,k)});var m="image-attributes",n="image-attributes-panel",d,c,e}});require("confluence/module-exporter").safeRequire("confluence-image-attributes/image-attributes-panel",function(f){require("ajs").toInit(f)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.ext.newcode-macro-plugin:editor-scripts', location = 'scripts/paste-cleanup.js' */
AJS.$(document).bind("postPaste",function(b,a,c){AJS.$(c.node).find('span[class|="code"]').contents().unwrap();AJS.$(c.node).find('pre[class|="code"]').each(function(d,f){f.className=f.className.replace(/\bcode-.[^\s]*\b/gi,"")})});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-roadmap-plugin:roadmap-utilities-resources', location = 'utils/roadmap-helper.js' */
(function(b,a){var c=Confluence.Roadmap=Confluence.Roadmap||{};c.Helper={getPosXOnMonthTimeline:function(g,e){var j=moment(g.startDate).startOf("month");var f=moment(e).startOf("month");var d=c.DateUtilities.getNumberOfMonths(j,f);var i=d*Roadmap.MONTH_WIDTH;var h=c.DateUtilities.getMilisecondsFromStartMonth(e)*Roadmap.MONTH_WIDTH/c.DateUtilities.getMilisecondsInMonth(e);return Math.round(i+h)},getPosXOnWeekTimeline:function(g,d){var e=moment(g.startDate).startOf("isoWeek");var f=moment(d).diff(e,"weeks",true);var h=f*Roadmap.WEEK_WIDTH;return Math.round(h)},getWidthTimeline:function(f,e){var d=e.duration;if(f.displayOption===Roadmap.TIMELINE_DISPLAY_OPTION.MONTH){d*=Roadmap.MONTH_WIDTH}else{d*=Roadmap.WEEK_WIDTH}return d<Roadmap.EXTRA_SPACE_AROUND?0:Math.round(d-Roadmap.EXTRA_SPACE_AROUND)},getMonthStartDateByPosition:function(i,h){var d=Math.floor(h/Roadmap.MONTH_WIDTH);var g=moment(i.startDate).startOf("month");var e=g.add(d,"months").toDate();var f=Math.abs(h)%Roadmap.MONTH_WIDTH;if(f!==0&&d<0){f=Roadmap.MONTH_WIDTH-f}var j=c.DateUtilities.getMilisecondsInMonth(e)*f/Roadmap.MONTH_WIDTH;return new Date(e.getTime()+j)},getWeekStartDateByPosition:function(f,e){var h=moment(f.startDate).startOf("isoWeek");var d=e/Roadmap.WEEK_WIDTH;var g=d*c.DateUtilities.MILLISECONDS_A_WEEK;return new Date(h.valueOf()+g)},guid:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(f){var e=Math.random()*16|0,d=f=="x"?e:(e&3|8);return d.toString(16)})}};c.ColorHelper={resetColorCounts:function(){a.each(Roadmap.COLORS,function(d){d.count=0})},findColor:function(d){return a.find(Roadmap.COLORS,function(e){return e.lane===d.lane})},adjustColorCount:function(e,f){var d=c.ColorHelper.findColor(e);if(d){d.count=d.count+f}},getColor:function(){return a.min(Roadmap.COLORS,function(d){return d.count})}}}(AJS.$,window._));
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-roadmap-plugin:roadmap-utilities-resources', location = 'utils/roadmap-utilities.js' */
(function(b,a){var c=Confluence.Roadmap=Confluence.Roadmap||{};c.DateUtilities={MILLISECONDS_A_DAY:86400000,MILLISECONDS_A_WEEK:604800000,parseDate:function(e){var d=moment(e,Roadmap.SHORT_DATE_FORMAT,true);if(d.isValid()){return d}d=moment(e,Roadmap.TWO_YY_SHORT_DATE_FORMAT,true);return d.isValid()?d:null},getDateStringFromDate:function(e,d){if(d){return moment(e).format(d)}return moment(e).format(Roadmap.DATE_FORMAT)},getDateFromDateString:function(e,d){return moment(e,d||Roadmap.DATE_FORMAT).toDate()},getNumberOfMonths:function(e,d){var g=moment(e),f=moment(d);return f.diff(g,"months")},getMilisecondsInMonth:function(d){return moment(d).daysInMonth()*c.DateUtilities.MILLISECONDS_A_DAY},getMilisecondsFromStartMonth:function(d){return d.getTime()-moment(d).startOf("month").valueOf()},calculateDurationInformation:function(d){var g=c.DateUtilities.getMilisecondsInMonth(d.toDate());var e=c.DateUtilities.getMilisecondsFromStartMonth(d.toDate());var f=g-e;return{totalMillisOfMonth:g,millisFromStartMonth:e,millisRemainingOfMonth:f,durationOfMonth:e/g,remainingDurationOfMonth:f/g}},convertToWeekDuration:function(e,g){var l=moment(e);var j=l.clone();var m=c.DateUtilities.calculateDurationInformation(l);if(g<=m.remainingDurationOfMonth){var f=g*m.totalMillisOfMonth;j=j.add(f,"ms")}else{j=j.add(m.millisRemainingOfMonth,"ms");g=g-m.remainingDurationOfMonth;var h=Math.floor(g);if(h>0){j=j.add(h,"months")}var k=g%1;var i=c.DateUtilities.getMilisecondsInMonth(j.toDate());var d=k*i;j.add(d,"ms")}return j.diff(l,"weeks",true)},convertToMonthDuration:function(e,j){var k=moment(e);var f=j*c.DateUtilities.MILLISECONDS_A_WEEK;var i=k.clone().add(f,"ms");var h=i.get("year")*12+i.get("month");h=h-(k.get("year")*12+k.get("month"));var l=c.DateUtilities.calculateDurationInformation(k);if(h===0){return f/l.totalMillisOfMonth}else{var g=l.remainingDurationOfMonth;var d=c.DateUtilities.calculateDurationInformation(i);g=g+d.durationOfMonth;g=g+(h-1);return g}}};c.FieldUtilities={fixDatePickerFields:function(d){var e=d.find("input[data-aui-dp-uuid]");e.each(function(f,g){var i=b(g),h=i.attr("data-aui-dp-uuid");i.on("click focus",function(){var j=b("[data-aui-dp-popup-uuid="+h+"]");if(AJS.version<="5.4.5"){var k=j.datepicker("option","onSelect");j.datepicker("option","onSelect",function(m,l){k(m,l);i.change()})}j.parents(".aui-inline-dialog").addClass("datepicker-roadmap-patch")})})}}}(AJS.$,window._));
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-roadmap-plugin:roadmap-models', location = '/models/model.js' */
(function(){window.Roadmap=window.Roadmap||{};Roadmap.Bar=Backbone.Model.extend({defaults:function(){return{id:Confluence.Roadmap.Helper.guid(),title:"New Bar",description:"",startDate:new Date(),duration:1,rowIndex:0,pageLink:{}}}});Roadmap.Lane=Backbone.Model.extend({defaults:function(){return{title:"New Lane",color:Confluence.Roadmap.ColorHelper.getColor(),bars:[]}},initialize:function(){var a=new Roadmap.Bars(this.get("bars"));this.set("bars",a)},getNumberOfRows:function(){var a=this.get("bars");if(a.length===0){return 0}var b=0;a.each(function(c){b=Math.max(c.get("rowIndex"),b)});return b+1}});Roadmap.Marker=Backbone.Model.extend({defaults:function(){return{title:"Marker"}}});Roadmap.Timeline=Backbone.Model.extend({defaults:function(){return{displayOption:Roadmap.TIMELINE_DISPLAY_OPTION.MONTH}},validate:function(a){var d=[];var c=Confluence.Roadmap.DateUtilities.parseDate(a.startDateString);var b=Confluence.Roadmap.DateUtilities.parseDate(a.endDateString);if(!c||!b){d.push({name:"date",message:"Enter dates in yy-mm-dd"})}else{if(c.diff(b)>=0){d.push({name:"endDate",message:"Start date needs to be before the end date"})}else{if(b.diff(c,"years",true)>Roadmap.TIMELINE_YEARS_LIMIT){d.push({name:"endDate",message:AJS.format("You cannot plan more than {0} years ahead.",Roadmap.TIMELINE_YEARS_LIMIT)})}}}return d.length>0?d:false},calculateTimelineColumns:function(){var d=this.get("startDate");var f=this.get("endDate");var c=[];var e;if(this.get("displayOption")===Roadmap.TIMELINE_DISPLAY_OPTION.MONTH){e=moment(d).clone().startOf("month");var b=moment(f).clone().endOf("month");do{c.push({month:Confluence.Roadmap.DateUtilities.getDateStringFromDate(e,Roadmap.MONTH_FORMAT),year:e.get("year")});e.add(1,"months")}while(e.diff(b)<0)}else{e=moment(d).clone().startOf("isoWeek");var a=moment(f).clone().endOf("isoWeek");do{c.push({month:Confluence.Roadmap.DateUtilities.getDateStringFromDate(e,Roadmap.WEEK_FORMAT),year:e.get("year")});e.add(1,"weeks")}while(e.diff(a)<0)}this.attributes.displayTimelineColumns=c}});Roadmap.Roadmap=Backbone.Model.extend({defaults:function(){return{title:"Roadmap Planner",lanes:[],markers:[]}},initialize:function(){var a=new Roadmap.Lanes(this.get("lanes"));this.set("lanes",a);var c=new Roadmap.Markers(this.get("markers"));this.set("markers",c);var b=new Roadmap.Timeline(this.get("timeline"));this.set("timeline",b)},parse:function(a){if(!a.timeline){return Roadmap.getDefaultRoadmapData()}return this.fromMacroData(a)},fromMacroData:function(c){var b=c.timeline;b.startDate=Confluence.Roadmap.DateUtilities.getDateFromDateString(b.startDate);b.endDate=Confluence.Roadmap.DateUtilities.getDateFromDateString(b.endDate);var a=c.lanes;_.each(a,function(e){var f=e.bars;_.each(f,function(g){g.startDate=Confluence.Roadmap.DateUtilities.getDateFromDateString(g.startDate);if(!g.id){g.id=Confluence.Roadmap.Helper.guid()}});e.bars=f});c.lanes=a;var d=c.markers;_.each(d,function(e){e.markerDate=Confluence.Roadmap.DateUtilities.getDateFromDateString(e.markerDate)});c.markers=d;return c},toMacroData:function(){var c=this.toJSON();var b=c.timeline.toJSON();b.startDate=Confluence.Roadmap.DateUtilities.getDateStringFromDate(b.startDate);b.endDate=Confluence.Roadmap.DateUtilities.getDateStringFromDate(b.endDate);delete b.displayTimelineColumns;c.timeline=b;var a=c.lanes.toJSON();_.each(a,function(e){var f=e.bars.toJSON();_.each(f,function(g){g.startDate=Confluence.Roadmap.DateUtilities.getDateStringFromDate(g.startDate)});e.bars=f});c.lanes=a;var d=c.markers.toJSON();_.each(d,function(e){e.markerDate=Confluence.Roadmap.DateUtilities.getDateStringFromDate(e.markerDate)});c.markers=d;return c},updateDurationUnit:function(a){this.get("lanes").each(function(b){b.get("bars").each(function(c){var d;d=a===Roadmap.TIMELINE_DISPLAY_OPTION.MONTH?Confluence.Roadmap.DateUtilities.convertToMonthDuration(c.get("startDate"),c.get("duration")):Confluence.Roadmap.DateUtilities.convertToWeekDuration(c.get("startDate"),c.get("duration"));c.attributes.duration=d})})}})})();
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-roadmap-plugin:roadmap-models', location = '/models/collection.js' */
(function(){window.Roadmap=window.Roadmap||{};Roadmap.Bars=Backbone.Collection.extend({model:Roadmap.Bar});Roadmap.Lanes=Backbone.Collection.extend({model:Roadmap.Lane});Roadmap.Markers=Backbone.Collection.extend({model:Roadmap.Marker})})();
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-roadmap-plugin:roadmap-editor-toolbar-view-resources', location = 'view/roadmap-editor/toolbar/toolbar-templates.soy' */
// This file was automatically generated from toolbar-templates.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.Roadmap.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.Roadmap == 'undefined') { Confluence.Templates.Roadmap = {}; }


Confluence.Templates.Roadmap.toolbar = function(opt_data, opt_ignored) {
  return '<div id="roadmap-editor-toolbar" class="aui-toolbar2"><div class="aui-toolbar2-inner"><div class="aui-toolbar2-group"><div class="aui-toolbar2-primary">' + aui.buttons.buttons({content: '' + aui.buttons.button({id: 'toolbar-button-add-lane', text: ' ' + soy.$$escapeHtml('Add lane'), iconType: 'aui', iconClass: 'aui-icon-small aui-iconfont-add', iconText: 'Add'}) + aui.buttons.button({id: 'toolbar-button-add-bar', text: ' ' + soy.$$escapeHtml('Add bar'), iconType: 'aui', iconClass: 'aui-icon-small aui-iconfont-add', iconText: 'Add'}) + aui.buttons.button({id: 'toolbar-button-add-marker', text: ' ' + soy.$$escapeHtml('Add marker'), iconType: 'aui', iconClass: 'aui-icon-small aui-iconfont-add', iconText: 'Add'})}) + '</div><div class="aui-toolbar2-secondary">' + Confluence.Templates.Roadmap.timelineOptionsForm(null) + '</div></div></div></div>';
};
if (goog.DEBUG) {
  Confluence.Templates.Roadmap.toolbar.soyTemplateName = 'Confluence.Templates.Roadmap.toolbar';
}


Confluence.Templates.Roadmap.timelineOptionsForm = function(opt_data, opt_ignored) {
  return '' + aui.form.form({id: 'timeline-options-form', action: '#', content: '<fieldset>' + aui.form.selectField({id: 'timeline-display-options-select', labelContent: '' + soy.$$escapeHtml('View by'), options: [{text: 'Months', value: 'MONTH'}, {text: 'Weeks', value: 'WEEK'}], extraClasses: 'view-by'}) + aui.form.textField({id: 'timeline-startdate-input', name: 'startDate', isRequired: true, extraClasses: 'roadmap-toolbar-date start-date aui-date-picker'}) + ' - ' + aui.form.textField({id: 'timeline-enddate-input', name: 'endDate', isRequired: true, extraClasses: 'roadmap-toolbar-date end-date aui-date-picker'}) + '<div class="field-group timeline-field-group-error"><div id="roadmap-timeline-error" class="error" /></div></fieldset>'});
};
if (goog.DEBUG) {
  Confluence.Templates.Roadmap.timelineOptionsForm.soyTemplateName = 'Confluence.Templates.Roadmap.timelineOptionsForm';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-roadmap-plugin:roadmap-editor-toolbar-view-resources', location = 'view/roadmap-editor/toolbar/toolbar.js' */
(function(b,a){window.Roadmap=window.Roadmap||{};Roadmap.ToolbarView=Backbone.View.extend({className:"roadmap-toolbar",events:{"click #toolbar-button-add-bar":"onAddBarClick","click #toolbar-button-add-lane":"onAddLaneClick","click #toolbar-button-add-marker":"onAddMarkerClick","change #timeline-display-options-select":"onTimelineOptionChange"},initialize:function(){a.bindAll(this,"render")},render:function(){b(this.$el).html(Confluence.Templates.Roadmap.toolbar());this._initVariables();this._setupTimelineOptionsForm();return this},onAddBarClick:function(i){i.preventDefault();var d=this.model.get("lanes").at(0);var c=d.get("bars");var g=this.model.get("timeline");var f=this.model.get("timeline").get("startDate");var h=g.get("displayOption")===Roadmap.TIMELINE_DISPLAY_OPTION.MONTH?moment(f).startOf("month"):moment(f).startOf("isoWeek");c.add(new Roadmap.Bar({rowIndex:d.getNumberOfRows(),startDate:h.toDate()}))},onAddLaneClick:function(d){d.preventDefault();var c=this.model.get("lanes");c.add(new Roadmap.Lane())},onAddMarkerClick:function(f){var g=this.model.get("markers");var d=this.model.get("timeline");var h=moment(d.get("startDate"));var c=d.get("displayOption")===Roadmap.TIMELINE_DISPLAY_OPTION.MONTH?h.date(15):h.isoWeekday(4);g.add(new Roadmap.Marker({markerDate:c.toDate()}))},onTimelineOptionChange:function(d){var c=this.model.get("timeline");c.set({displayOption:this.$timelineSelect.val()})},_initVariables:function(){this.$timelineForm=this.$el.find("#timeline-options-form");this.$startDateInput=this.$timelineForm.find("#timeline-startdate-input");this.$endDateInput=this.$timelineForm.find("#timeline-enddate-input");this.$timelineSelect=this.$timelineForm.find("#timeline-display-options-select");this.$timelineError=this.$timelineForm.find("#roadmap-timeline-error");this.newTimeline=new Roadmap.Timeline()},_clearTimelineErrors:function(){this.$timelineError.empty()},_showTimelineErrors:function(){var c=this;a.each(c.newTimeline.validationError,function(d){c.$timelineError.append(d.message)})},_applyNewTimeline:function(){var c=this.model.get("timeline");var e=Confluence.Roadmap.DateUtilities.parseDate(this.$startDateInput.val());var d=Confluence.Roadmap.DateUtilities.parseDate(this.$endDateInput.val());c.set({startDate:e.toDate(),endDate:d.toDate()});this._showTimeLineFormat()},_showTimeLineFormat:function(){var c=this.model.get("timeline");this.$startDateInput.val(Confluence.Roadmap.DateUtilities.getDateStringFromDate(c.get("startDate"),Roadmap.SHORT_DATE_FORMAT));this.$endDateInput.val(Confluence.Roadmap.DateUtilities.getDateStringFromDate(c.get("endDate"),Roadmap.SHORT_DATE_FORMAT))},_validate:function(){this._clearTimelineErrors();if(this.newTimeline.isValid()){this._applyNewTimeline()}else{this._showTimelineErrors()}},_setupTimelineOptionsForm:function(){var e=this.model.get("timeline");var g=Confluence.Roadmap.DateUtilities.getDateStringFromDate(e.get("startDate"),Roadmap.SHORT_DATE_FORMAT),c=Confluence.Roadmap.DateUtilities.getDateStringFromDate(e.get("endDate"),Roadmap.SHORT_DATE_FORMAT);this.$startDateInput.val(g);this.$endDateInput.val(c);this.newTimeline.set({startDateString:g,endDateString:c});this.$timelineSelect.val(e.get("displayOption"));var f={overrideBrowserDefault:true,firstDay:1};this.$startDateInput.datePicker(f);this.$endDateInput.datePicker(f);Confluence.Roadmap.FieldUtilities.fixDatePickerFields(this.$timelineForm);var d=this;this.$startDateInput.on("change",function(){d.newTimeline.set({startDateString:d.$startDateInput.val()});d._validate()});this.$endDateInput.on("change",function(){d.newTimeline.set({endDateString:d.$endDateInput.val()});d._validate()})}})})(AJS.$,window._);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-roadmap-plugin:roadmap-editor-timeline-view-resources', location = 'view/roadmap-editor/timeline/timeline-templates.soy' */
// This file was automatically generated from timeline-templates.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.Roadmap.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.Roadmap == 'undefined') { Confluence.Templates.Roadmap = {}; }


Confluence.Templates.Roadmap.timeline = function(opt_data, opt_ignored) {
  var output = '';
  var displayTimelineList3 = opt_data.displayTimelines;
  var displayTimelineListLen3 = displayTimelineList3.length;
  for (var displayTimelineIndex3 = 0; displayTimelineIndex3 < displayTimelineListLen3; displayTimelineIndex3++) {
    var displayTimelineData3 = displayTimelineList3[displayTimelineIndex3];
    output += '<div class="roadmap-column-title">' + ((displayTimelineIndex3 == 0 || displayTimelineData3.year != opt_data.displayTimelines[displayTimelineIndex3 - 1].year) ? '<span class="roadmap-column-year">' + soy.$$escapeHtml(displayTimelineData3.year) + '</span><br/>' : '') + soy.$$escapeHtml(displayTimelineData3.month) + '</div>';
  }
  return output;
};
if (goog.DEBUG) {
  Confluence.Templates.Roadmap.timeline.soyTemplateName = 'Confluence.Templates.Roadmap.timeline';
}


Confluence.Templates.Roadmap.timelineColumn = function(opt_data, opt_ignored) {
  var output = '';
  var iLimit14 = opt_data.numberOfColumns;
  for (var i14 = 0; i14 < iLimit14; i14++) {
    output += '<div class="roadmap-column-item">&nbsp;</div>';
  }
  return output;
};
if (goog.DEBUG) {
  Confluence.Templates.Roadmap.timelineColumn.soyTemplateName = 'Confluence.Templates.Roadmap.timelineColumn';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-roadmap-plugin:roadmap-editor-timeline-view-resources', location = 'view/roadmap-editor/timeline/timeline.js' */
(function(b,a){window.Roadmap=window.Roadmap||{};var c={};c.Helper=Confluence.Roadmap.Helper;Roadmap.TimelineView=Backbone.View.extend({className:"roadmap-frame-title",initialize:function(){a.bindAll(this,"render")},render:function(){this.model.calculateTimelineColumns();this.$el.html(Confluence.Templates.Roadmap.timeline({displayTimelines:this.model.get("displayTimelineColumns")}));return this},update:function(){this.render()},getBarPosition:function(d){if(this.model.get("displayOption")===Roadmap.TIMELINE_DISPLAY_OPTION.MONTH){return{left:c.Helper.getPosXOnMonthTimeline(this.model.attributes,d.startDate),width:c.Helper.getWidthTimeline(this.model.attributes,d)}}return{left:c.Helper.getPosXOnWeekTimeline(this.model.attributes,d.startDate),width:c.Helper.getWidthTimeline(this.model.attributes,d)}},getBarDuration:function(d){return(this.model.get("displayOption")===Roadmap.TIMELINE_DISPLAY_OPTION.MONTH)?(d/Roadmap.MONTH_WIDTH):(d/Roadmap.WEEK_WIDTH)},getBarStartDate:function(d){return(this.model.get("displayOption")===Roadmap.TIMELINE_DISPLAY_OPTION.MONTH)?c.Helper.getMonthStartDateByPosition(this.model.attributes,d):c.Helper.getWeekStartDateByPosition(this.model.attributes,d)}})})(AJS.$,window._);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-roadmap-plugin:roadmap-editor-timeline-view-resources', location = 'view/roadmap-editor/timeline/timeline-column.js' */
(function(b,a){window.Roadmap=window.Roadmap||{};Roadmap.TimelineColumnView=Backbone.View.extend({className:"roadmap-frame-content",initialize:function(){a.bindAll(this,"render")},render:function(){var c=this.model.get("displayTimelineColumns").length;this.$el.html(Confluence.Templates.Roadmap.timelineColumn({numberOfColumns:c}));return this},updateHeight:function(c){this.$el.height(c)},update:function(){this.render()},getSizeAndPosition:function(){return{width:this.$el.width(),height:this.$el.height(),left:this.$el.position().left,top:this.$el.position().top}}})})(AJS.$,window._);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-roadmap-plugin:roadmap-dialog-resources', location = 'view/dialog-view.js' */
(function(b,a){window.Roadmap=window.Roadmap||{};Roadmap.InlineDialogView=Backbone.View.extend({initialize:function(c){a.bindAll(this,"_onDocumentClick","_onKeyDown","_shouldHide","_onHide");this._trigger=c.trigger;this._dialogOptions=c.dialogOptions;this._reset();var d=this;b(".roadmap-editor-popup, .roadmap-macro-view").scroll(function(){d.hide()})},_shouldHideWhenClick:function(c){return !b.contains(this._inlineDialog[0],c.target)},_createInlineDialog:function(d,f){var e,g=this;function h(l,k,j){g._getContent(l);j()}function c(){g._onBeforeShow();a.delay(function(){AJS.InlineDialog.current=null;g._onShow();b(document).on({click:g._onDocumentClick,keydown:g._onKeyDown})},g._inlineDialog.getOptions().fadeTime)}var i={hideCallback:this._onHide,initCallback:c,noBind:true,persistent:true,preHideCallback:this._shouldHide};if(f&&f.isSideInlineDialog){a.extend(i,{calculatePositions:a.compose(this._calculateSidePositions,this._getSideDimensions),offsetX:8,offsetY:0});if(Raphael.version){a.extend(i,{getArrowPath:this._getSideArrowPath})}}e=new AJS.InlineDialog(d,"roadmap-dialog",h,a.extend({},i,f));return e},_onHide:function(){b(document).off({click:this._onDocumentClick,keydown:this._onKeyDown})},hide:function(){this._inlineDialog.remove()},_onDocumentClick:function(c){this._shouldHideWhenClick(c)&&this.hide()},_onBeforeShow:b.noop,_onKeyDown:function(f){var c=f.which===b.ui.keyCode.ESCAPE,d=b(f.target).is(":input");if(c&&!d){this.hide()}},_onShow:b.noop,_reset:function(){this._inlineDialog=this._createInlineDialog(this._trigger,this._dialogOptions);this.setElement(this._inlineDialog)},_shouldHide:function(){return true},show:function(){this._inlineDialog.show()},disable:function(){this.$el.find(":input").attr("disabled","disabled")},enable:function(){this.$el.find(":input").removeAttr("disabled")},_onSubmit:function(){throw new Error("DialogView subclasses must implement _onSubmit().")},_getSideDimensions:function(e,i,p,c){var k=c.container.toLowerCase()!=="body";var d=AJS.$(c.container);var l=k?AJS.$(c.container).parent():AJS.$(window);var n=k?d.offset():{left:0,top:0};var j=k?l.offset():{left:0,top:0};var g=i.target;var q=g.offset();var m=g[0].getBoundingClientRect&&g[0].getBoundingClientRect();var f=m?m.width:g.outerWidth();if(c.timelineWidth){var h=g.position();if(h.left+f>c.timelineWidth){f=c.timelineWidth-h.left-1}}var o={screenPadding:10,arrowMargin:5,window:{top:j.top,left:j.left,scrollTop:l.scrollTop(),scrollLeft:l.scrollLeft(),width:l.width(),height:l.height()},scrollContainer:{width:d.width(),height:d.height()},trigger:{top:q.top-n.top,left:q.left-n.left,width:f,height:m?m.height:g.outerHeight()},dialog:{width:e.width(),height:e.height(),offset:{top:c.offsetY,left:c.offsetX}},arrow:{height:e.find(".arrow").outerHeight()}};return o},_calculateSidePositions:function(i){var g=i.screenPadding;var h=i.window;var o=i.trigger;var y=i.dialog;var f=i.arrow;var s=i.scrollContainer;var A={top:o.top-h.scrollTop,left:o.left-h.scrollLeft};var t=Math.floor(o.height/2);var q=Math.floor(y.height/2);var p=Math.floor(f.height/2);var x=A.left-y.offset.left-g;var B=s.width-A.left-o.width-y.offset.left-g;var u=x>=y.width;var e=B>=y.width;var w=!e&&u?"left":"right";var k=A.top+t-p;var m=h.height-k-f.height;g=Math.min(g,k-i.arrowMargin);g=Math.min(g,m-i.arrowMargin);var l=Math.max(A.top-g,0);var c=Math.max(h.height-A.top-o.height-g,0);var d=Math.max(q-t-y.offset.top-l,0);var v=Math.max(q-t+y.offset.top-c,0);var j=d||-v||0;var r={top:o.top+t-q+y.offset.top+j,left:w==="right"?o.left+o.width+y.offset.left:o.left-y.width-y.offset.left};var z="w";var n={position:"absolute",top:q-p-j};if(w==="right"){n.right="auto";n.left=Raphael.version?"-7px":"0px"}else{n.right="-7px";n.left="auto";z="e"}return{dialogLocation:w,popupCss:r,arrowCss:n,gravity:z}},_getSideArrowPath:function(c){return c.dialogLocation==="right"?"M8,0L0,8,8,16":"M8,0L16,8,8,16"},refresh:function(){this._inlineDialog&&this._inlineDialog.refresh()}})})(AJS.$,window._);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-roadmap-plugin:roadmap-bar-dialog-resources', location = 'view/roadmap-editor/bar-dialog/bar-dialog-templates.soy' */
// This file was automatically generated from bar-dialog-templates.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.Roadmap.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.Roadmap == 'undefined') { Confluence.Templates.Roadmap = {}; }


Confluence.Templates.Roadmap.barDialog = function(opt_data, opt_ignored) {
  var output = '';
  var hasPageLink__soy3 = opt_data.bar.pageLink != null && opt_data.bar.pageLink.id != null;
  output += '<h3 id="bar-title" class="editable-field">' + soy.$$escapeHtml(opt_data.bar.title) + '</h3><div class="information"><div class="bar-page-link-wrapper">' + ((opt_data.linkPageEditable) ? '<div class="link-update-page ' + ((hasPageLink__soy3) ? 'hidden-field' : '') + '"><a href="#">' + soy.$$escapeHtml('Link page') + '</a></div>' : '') + '<div class="bar-page-link editable-field ' + ((! hasPageLink__soy3) ? 'hidden-field' : '') + '">' + ((hasPageLink__soy3) ? Confluence.Templates.Roadmap.buildPageLink({pageLink: opt_data.bar.pageLink, isEditMode: opt_data.renderOption.isEditMode}) : '') + '</div>' + ((opt_data.linkPageEditable) ? '<div class="link-new-page' + ((hasPageLink__soy3) ? ' hidden-field' : '') + '"><span class=\'page-link-separator\'>\u2022</span><a href="#">' + soy.$$escapeHtml('Create page') + '</a></div>' : '') + '</div><div class="clear" /><div class="bar-description editable-field">' + soy.$$filterNoAutoescape(opt_data.bar.description) + '</div></div>' + ((opt_data.renderOption.isEditMode) ? '<div class="inner">' + aui.buttons.button({id: 'delete-button', text: 'Delete bar', type: 'link'}) + '</div>' : '');
  return output;
};
if (goog.DEBUG) {
  Confluence.Templates.Roadmap.barDialog.soyTemplateName = 'Confluence.Templates.Roadmap.barDialog';
}


Confluence.Templates.Roadmap.buildPageLink = function(opt_data, opt_ignored) {
  return '<a href=' + soy.$$escapeHtml("/wiki") + '/pages/viewpage.action?pageId=' + soy.$$escapeHtml(opt_data.pageLink.id) + ' ' + ((opt_data.isEditMode) ? 'target=\'_blank\'' : '') + ' class=\'confluence-link content-type-' + soy.$$escapeHtml(opt_data.pageLink.type) + '\'><span class="link-page-title">' + soy.$$escapeHtml(opt_data.pageLink.title) + '</span></a>';
};
if (goog.DEBUG) {
  Confluence.Templates.Roadmap.buildPageLink.soyTemplateName = 'Confluence.Templates.Roadmap.buildPageLink';
}


Confluence.Templates.Roadmap.inlineEditSaveButton = function(opt_data, opt_ignored) {
  return '' + aui.buttons.button({id: 'inline-edit-save', iconType: 'aui', extraClasses: 'aui-button-compact', text: '', extraAttributes: {title: 'Save'}, iconClass: 'aui-icon-small aui-iconfont-success'});
};
if (goog.DEBUG) {
  Confluence.Templates.Roadmap.inlineEditSaveButton.soyTemplateName = 'Confluence.Templates.Roadmap.inlineEditSaveButton';
}


Confluence.Templates.Roadmap.inlineEditCancelButton = function(opt_data, opt_ignored) {
  return '' + aui.buttons.button({id: 'inline-edit-cancel', iconType: 'aui', extraClasses: 'aui-button-compact', text: '', extraAttributes: {title: 'Cancel'}, iconClass: 'aui-icon-small aui-iconfont-close-dialog'});
};
if (goog.DEBUG) {
  Confluence.Templates.Roadmap.inlineEditCancelButton.soyTemplateName = 'Confluence.Templates.Roadmap.inlineEditCancelButton';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-roadmap-plugin:roadmap-bar-dialog-resources', location = 'view/roadmap-editor/bar-dialog/roadmap-editinplace.js' */
(function(g){g.fn.editInPlace=function(h){var i=g.extend({},g.fn.editInPlace.defaults,h);d(i);e(i.saving_image);return this.each(function(){var j=g(this);if(j.data("editInPlace")){return}j.data("editInPlace",true);new f(i,j).init()})};g.fn.editInPlace.defaults={url:"",bg_over:"#ffc",bg_out:"transparent",hover_class:"",form_extra_classes:[],show_buttons:false,save_button:'<button class="inplace_save">Save</button>',cancel_button:'<button class="inplace_cancel">Cancel</button>',params:"",field_type:"text",field_extra_classes:[],default_text:"(Click here to add text)",use_html:false,textarea_rows:10,textarea_cols:25,select_text:"Choose new value",select_options:"",text_size:null,saving_text:undefined,saving_image:"",saving_animation_color:"transparent",value_required:false,disable_submit_when_empty:false,element_id:"element_id",update_value:"update_value",original_value:"original_value",original_html:"original_html",save_if_nothing_changed:false,on_blur:"save",cancel:"",callback:null,callback_skip_dom_reset:false,success:null,error:null,error_sink:function(h,i){alert(i)},preinit:null,postclose:null,delegate:null,isAutoCompleteField:false};var c={shouldOpenEditInPlace:function(j,i,h){},willOpenEditInPlace:function(i,h){},didOpenEditInPlace:function(i,h){},shouldCloseEditInPlace:function(j,i,h){},willCloseEditInPlace:function(i,h){},didCloseEditInPlace:function(i,h){},missingCommaErrorPreventer:""};function f(h,i){this.settings=h;this.dom=i;this.originalValue=null;this.didInsertDefaultText=false;this.shouldDelayReinit=false}g.extend(f.prototype,{init:function(){this.setDefaultTextIfNeccessary();this.connectOpeningEvents()},reinit:function(){if(this.shouldDelayReinit){return}this.triggerCallback(this.settings.postclose,this.dom);this.triggerDelegateCall("didCloseEditInPlace");this.markEditorAsInactive();this.connectOpeningEvents()},setDefaultTextIfNeccessary:function(){if(""!==this.dom.html()){return}this.dom.html(this.settings.default_text);this.didInsertDefaultText=true},connectOpeningEvents:function(){var h=this;this.dom.bind("mouseenter.editInPlace",function(){h.addHoverEffect()}).bind("mouseleave.editInPlace",function(){h.removeHoverEffect()}).bind("click.editInPlace",function(i){h.openEditor(i)})},disconnectOpeningEvents:function(){this.dom.unbind(".editInPlace")},addHoverEffect:function(){if(this.settings.hover_class){this.dom.addClass(this.settings.hover_class)}else{this.dom.css("background-color",this.settings.bg_over)}},removeHoverEffect:function(){if(this.settings.hover_class){this.dom.removeClass(this.settings.hover_class)}else{this.dom.css("background-color",this.settings.bg_out)}},openEditor:function(h){if(!this.shouldOpenEditor(h)){return}this.disconnectOpeningEvents();this.removeHoverEffect();this.removeInsertedDefaultTextIfNeccessary();this.saveOriginalValue();this.markEditorAsActive();this.replaceContentWithEditor();this.setInitialValue();this.workAroundMissingBlurBug();this.connectClosingEventsToEditor();this.triggerDelegateCall("didOpenEditInPlace")},shouldOpenEditor:function(h){if(this.isClickedObjectCancelled(h.target)){return false}if(false===this.triggerCallback(this.settings.preinit,this.dom)){return false}if(false===this.triggerDelegateCall("shouldOpenEditInPlace",true,h)){return false}if(this.settings.isAutoCompleteField&&g(h.target).hasClass("link-page-title")){return false}return true},removeInsertedDefaultTextIfNeccessary:function(){if(!this.didInsertDefaultText||this.dom.html()!==this.settings.default_text){return}this.dom.html("");this.didInsertDefaultText=false},isClickedObjectCancelled:function(j){if(!this.settings.cancel){return false}var h=g(j).parents().andSelf();var i=h.filter(this.settings.cancel);return 0!==i.length},saveOriginalValue:function(){if(this.settings.use_html){this.originalValue=this.dom.html()}else{this.originalValue=a(this.dom.text())}},restoreOriginalValue:function(){this.setClosedEditorContent(this.originalValue)},setClosedEditorContent:function(h){h=h||this.settings.default_text;if(this.settings.use_html){this.dom.html(h)}else{this.dom.text(h)}},workAroundMissingBlurBug:function(){var h=this.dom.find(":input");this.dom.parents(":last").find(".editInPlace-active :input").not(h).blur()},replaceContentWithEditor:function(){var m=this.createEditorElement();var h="inplace_form";if(this.settings.form_extra_classes instanceof Array){h=h+" "+this.settings.form_extra_classes.join(" ")}this.dom.html('<form class="'+h+'" style="display: inline; margin: 0; padding: 0;"></form>');var j=this.dom.find("form");j.append(m);if(this.settings.show_buttons){var i=g('<div class="inline-edit-buttons"></div>');var k=g(this.settings.save_button);k.addClass("inplace_save");i.append(k);var l=g(this.settings.cancel_button);l.addClass("inplace_cancel");i.append(l);j.append(i)}},createEditorElement:function(){if(-1===g.inArray(this.settings.field_type,["text","textarea","select"])){throw"Unknown field_type <fnord>, supported are 'text', 'textarea' and 'select'"}var h=null;if("select"===this.settings.field_type){h=this.createSelectEditor()}else{if("text"===this.settings.field_type){h=g('<input type="text" '+this.inputNameAndClass()+' size="'+this.settings.text_size+'" />')}else{if("textarea"===this.settings.field_type){h=g("<textarea "+this.inputNameAndClass()+' rows="'+this.settings.textarea_rows+'"  cols="'+this.settings.textarea_cols+'" />')}}}return h},setInitialValue:function(){var h=this.triggerDelegateCall("willOpenEditInPlace",this.originalValue);var i=this.dom.find(":input");i.val(h);if(i.val()!==h){i.val("")}},inputNameAndClass:function(){var h="inplace_field";if(this.settings.field_extra_classes instanceof Array){h=h+" "+this.settings.field_extra_classes.join(" ")}return' name="inplace_value" class="'+h+'"'},createSelectEditor:function(){var m=g("<select"+this.inputNameAndClass()+'><option disabled="true" value="">'+this.settings.select_text+"</option></select>");var j=this.settings.select_options;if(!g.isArray(j)){j=j.split(",")}for(var k=0;k<j.length;k++){var h=j[k];if(!g.isArray(h)){h=h.split(":")}var n=a(h[1]||h[0]);var o=a(h[0]);var l=g("<option>").val(n).text(o);m.append(l)}return m},connectClosingEventsToEditor:function(){var k=this;function j(l){if(!k.settings.isAutoCompleteField){k.handleCancelEditor(l)}return false}function h(l){k.handleSaveEditor(l);return false}var i=this.dom.find("form");i.find(".inplace_field").focus().select();i.find(".inplace_cancel").click(j);i.find(".inplace_save").click(h);if(!this.settings.show_buttons){if("save"===this.settings.on_blur){i.find(".inplace_field").blur(h)}else{i.find(".inplace_field").blur(j)}}i.keyup(function(l){var m=27;if(m===l.which){return j()}});this.bindInputKeyup();i.submit(h)},bindSubmitOnEnterInInput:function(){if("textarea"===this.settings.field_type){return}var h=this;this.dom.find(":input").keyup(function(i){var j=13;if(j===i.which){return h.dom.find("form").submit()}})},bindInputKeyup:function(){if("textarea"===this.settings.field_type){return}var i=this;var h=this.dom.find(":input");var j=this.dom.find(".inplace_save");h.keyup(function(k){var l=13;if(l===k.which){return i.dom.find("form").submit()}else{if(i.settings.disable_submit_when_empty){if(g.trim(h.val()).length){j.removeAttr("disabled")}else{j.attr("disabled","disabled")}}}})},handleCancelEditor:function(h){if(false===this.triggerDelegateCall("shouldCloseEditInPlace",true,h)){return}var i=this.dom.find(":input").val();i=this.triggerDelegateCall("willCloseEditInPlace",i);this.restoreOriginalValue();this.reinit()},handleSaveEditor:function(h){if(false===this.triggerDelegateCall("shouldCloseEditInPlace",true,h)){return}var i=g.trim(this.dom.find(":input").val());i=this.triggerDelegateCall("willCloseEditInPlace",i);if(this.isDisabledDefaultSelectChoice()||this.isUnchangedInput(i)){this.handleCancelEditor(h);return}if(this.didForgetRequiredText(i)){if(this.settings.disable_submit_when_empty){return}this.handleCancelEditor(h);this.reportError("Error: You must enter a value to save this field");return}this.showSaving(i);if(this.settings.callback){this.handleSubmitToCallback(i)}else{this.handleSubmitToServer(i)}},didForgetRequiredText:function(h){return this.settings.value_required&&(""===h||undefined===h||null===h)},isDisabledDefaultSelectChoice:function(){return this.dom.find("option").eq(0).is(":selected:disabled")},isUnchangedInput:function(h){return !this.settings.save_if_nothing_changed&&this.originalValue===h},showSaving:function(i){if(this.settings.callback&&this.settings.callback_skip_dom_reset){return}var h=i;if(b(this.settings.saving_text)){h=this.settings.saving_text}if(b(this.settings.saving_image)){h=g("<img />").attr("src",this.settings.saving_image).attr("alt",h)}this.dom.html(encodeURIComponent(h))},handleSubmitToCallback:function(h){this.enableOrDisableAnimationCallbacks(true,false);var i=this.triggerCallback(this.settings.callback,this.id(),h,this.originalValue,this.settings.params,this.savingAnimationCallbacks());if(this.settings.callback_skip_dom_reset){}else{if(undefined===i){this.reportError("Error: Failed to save value: "+h);this.restoreOriginalValue()}else{this.dom.html(i)}}if(this.didCallNoCallbacks()){this.enableOrDisableAnimationCallbacks(false,false);this.reinit()}},handleSubmitToServer:function(h){var j=this.settings.update_value+"="+encodeURIComponent(h)+"&"+this.settings.element_id+"="+this.dom.attr("id")+((this.settings.params)?"&"+this.settings.params:"")+"&"+this.settings.original_html+"="+encodeURIComponent(this.originalValue)+"&"+this.settings.original_value+"="+encodeURIComponent(this.originalValue);this.enableOrDisableAnimationCallbacks(true,false);this.didStartSaving();var i=this;g.ajax({url:i.settings.url,type:"POST",data:j,dataType:"html",complete:function(k){i.didEndSaving()},success:function(l){var k=l||i.settings.default_text;i.dom.html(k);i.triggerCallback(i.settings.success,l)},error:function(k){i.dom.html(i.originalHTML);if(i.settings.error){i.triggerCallback(i.settings.error,k)}else{i.reportError("Failed to save value: "+k.responseText||"Unspecified Error")}}})},triggerCallback:function(i){if(!i){return}var h=Array.prototype.slice.call(arguments,1);return i.apply(this.dom[0],h)},triggerDelegateCall:function(j,i,h){if(!this.settings.delegate||!g.isFunction(this.settings.delegate[j])){return i}var k=this.settings.delegate[j](this.dom,this.settings,h);return(undefined===k)?i:k},reportError:function(h){this.triggerCallback(this.settings.error_sink,this.id(),h)},id:function(){return this.dom.attr("id")},markEditorAsActive:function(){this.dom.addClass("editInPlace-active")},markEditorAsInactive:function(){this.dom.removeClass("editInPlace-active")},savingAnimationCallbacks:function(){var h=this;return{didStartSaving:function(){h.didStartSaving()},didEndSaving:function(){h.didEndSaving()}}},enableOrDisableAnimationCallbacks:function(i,h){this.didStartSaving.enabled=i;this.didEndSaving.enabled=h},didCallNoCallbacks:function(){return this.didStartSaving.enabled&&!this.didEndSaving.enabled},assertCanCall:function(h){if(!this[h].enabled){throw new Error("Cannot call "+h+" now. See documentation for details.")}},didStartSaving:function(){this.assertCanCall("didStartSaving");this.shouldDelayReinit=true;this.enableOrDisableAnimationCallbacks(false,true);this.startSavingAnimation()},didEndSaving:function(){this.assertCanCall("didEndSaving");this.shouldDelayReinit=false;this.enableOrDisableAnimationCallbacks(false,false);this.reinit();this.stopSavingAnimation()},startSavingAnimation:function(){var h=this;this.dom.animate({backgroundColor:this.settings.saving_animation_color},400).animate({backgroundColor:"transparent"},400,"swing",function(){setTimeout(function(){h.startSavingAnimation()},10)})},stopSavingAnimation:function(){this.dom.stop(true).css({backgroundColor:""})},missingCommaErrorPreventer:""});function d(h){if(h.url||h.callback){return}throw new Error("Need to set either url: or callback: option for the inline editor to work.")}function e(i){if(""===i){return}var h=new Image();h.src=i}function a(h){return h.replace(/^\s+/,"").replace(/\s+$/,"")}function b(h){if(undefined===h||null===h){return false}if(0===h.length){return false}return true}})(jQuery);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-roadmap-plugin:roadmap-bar-dialog-resources', location = 'view/roadmap-editor/bar-dialog/bar-dialog.js' */
(function(c,a){var b=Roadmap.InlineDialogView;Roadmap.BarDialogView=b.extend({events:{"click #delete-button":"_onDeleteClick","click .link-new-page":"_goToCreateLinkPage","click .link-update-page":"_goToUpdateLinkPage"},initialize:function(){a.bindAll(this,"_onPageLinkOpen","_onPageLinkSelectCompleted","_onPageLinkCallback","_onPageLinkBlur","_goToCreateLinkPage");this.options.dialogOptions={width:260,timelineWidth:this.options.timelineWidth,isSideInlineDialog:true,renderOption:this.options.renderOption,linkPageEditable:this.options.linkPageEditable,createLinkPageCallback:this.options.createLinkPageCallback};b.prototype.initialize.call(this,this.options)},_getContent:function(d){d.html(Confluence.Templates.Roadmap.barDialog({bar:a.extend({},this.model.attributes,{description:AJS.escapeHtml(this.model.attributes.description).replace(/\r?\n/g,"<br />")}),renderOption:this.options.dialogOptions.renderOption,linkPageEditable:this.options.dialogOptions.linkPageEditable}))},_onBeforeShow:function(){this.fields=this._getFields();this._setupInlineEdit();this._addEvents()},_getFields:function(){return{$title:this.$el.find("#bar-title"),$description:this.$el.find(".bar-description"),$pageLink:this.$el.find(".bar-page-link"),$pageLinkNew:this.$el.find(".link-new-page"),$pageLinkUpdate:this.$el.find(".link-update-page")}},_setupInlineEdit:function(){var f=this;var d=this.fields;var i=this.options.dialogOptions.renderOption.editInplace;var e={form_extra_classes:["aui"],hover_class:"editable-field-hover aui-icon-small aui-iconfont-edit",field_extra_classes:["text"],show_buttons:true,save_button:Confluence.Templates.Roadmap.inlineEditSaveButton(),cancel_button:Confluence.Templates.Roadmap.inlineEditCancelButton(),error_sink:null,use_html:true,default_text:"Click to add description.",delegate:{shouldOpenEditInPlace:function(){f.$el.find(".inplace_cancel").trigger("click")},didCloseEditInPlace:function(){setTimeout(function(){f.refresh()},0)}}};i.title&&d.$title.editInPlace(c.extend(true,{},e,{callback:function(j,k){f.options.updateTitle(k);return AJS.escapeHtml(k)},value_required:true,disable_submit_when_empty:true,delegate:{willOpenEditInPlace:function(){f.refresh();d.$title.find(".text").attr("maxlength",Roadmap.BarDialog.MAX_LENGTH_TITLE)}}}));(c.trim(d.$description.text())==="")?d.$description.addClass("empty-field"):d.$description.removeClass("empty-field");var g=c.extend(true,{},e,{field_type:"textarea",field_extra_classes:["textarea"],value_required:false,save_if_nothing_changed:true,callback:function(j,k){k=c.trim(k);f.options.updateDescription(k);if(k===""){k="Click to add description.";c(this).addClass("empty-field")}else{c(this).removeClass("empty-field");Confluence.Roadmap.Analytics.addDescription()}return AJS.escapeHtml(k).replace(/\r?\n/g,"<br />")},delegate:{willOpenEditInPlace:function(){f.refresh();d.$description.find(".textarea").attr("maxlength",Roadmap.BarDialog.MAX_LENGTH_DESCRIPTION);return f.model.attributes.description.replace(/<br\s*[\/]?>/gi,"\n")}}});i.description&&d.$description.editInPlace(g);var h=c.extend(true,{},e,{isAutoCompleteField:true,show_buttons:false,default_text:"",field_extra_classes:["text","autocomplete-confluence-content"],delegate:{willOpenEditInPlace:f._onPageLinkOpen,didCloseEditInPlace:function(){if(a.isEmpty(d.$pageLink.data("linkData"))){d.$pageLink.hide();d.$pageLinkNew.show();d.$pageLinkUpdate.show()}}},on_blur:null,callback:f._onPageLinkCallback});i.pageLink&&this.options.dialogOptions.linkPageEditable&&this.fields.$pageLink.editInPlace(h)},_onPageLinkOpen:function(e){var f=this;e.append('<div class="link-page-dropdown" />');var g=e.find(".autocomplete-confluence-content");g.attr({placeholder:"Search page","data-dropdown-target":"#inline-dialog-roadmap-dialog .link-page-dropdown","data-none-message":"No matches found"});Confluence.Binder.autocompleteConfluenceContent(e);g.bind("selected.autocomplete-content",this._onPageLinkSelectCompleted);g.on("blur",function(){setTimeout(f._onPageLinkBlur,150)});var d=this.model.attributes.pageLink;this.fields.$pageLink.data("linkData",d);if(!a.isEmpty(d)){return d.title}return true},_onPageLinkSelectCompleted:function(d,g){d.stopPropagation();var f=this.fields.$pageLink.find(".autocomplete-confluence-content");var e=g.content;f.val(e.title);this.fields.$pageLink.data("linkData",g.content);a.defer(this._onPageLinkBlur)},_onPageLinkBlur:function(){var d=this.fields.$pageLink.find(".autocomplete-confluence-content");var f=c.Event("keyup");f.which=AJS.keyCode.ENTER;d.trigger(f)},_onPageLinkCallback:function(e,f){var d=(f==="")?{}:this.fields.$pageLink.data("linkData");return this._updatePageLink(d)},_updatePageLink:function(e){if(e.id===this.model.attributes.pageLink.id){return}var d=this.fields;if(a.isEmpty(e)){this.options.updatePageLink({});d.$pageLink.hide();d.$pageLinkNew.show();d.$pageLinkUpdate.show();return "No linked page"}else{var f=a.pick(e,"id","title","type","spaceKey","wikiLink");if(!e.spaceKey){f.spaceKey=e.space.key}this.options.updatePageLink(f);d.$pageLink.show();d.$pageLinkNew.hide();d.$pageLinkUpdate.hide();if(this.options.renderOption.isEditMode){Confluence.Roadmap.Analytics.addPageLinkEditMode({linkedPageId:e.id,pageId:AJS.Meta.get("page-id")>0?AJS.Meta.get("page-id"):AJS.Meta.get("draft-id"),isDraft:AJS.Meta.get("page-id")<=0})}else{Confluence.Roadmap.Analytics.addPageLinkViewMode({linkedPageId:e.id,pageId:AJS.Meta.get("page-id")})}return Confluence.Templates.Roadmap.buildPageLink({pageLink:e,isEditMode:this.options.renderOption.isEditMode})}},_addEvents:function(){if(c.browser.msie&&parseInt(c.browser.version,10)<=9){var d=function(h,f){if(h.ctrlKey||h.altKey||h.metaKey||h.keyCode===AJS.keyCode.BACKSPACE||h.keyCode===AJS.keyCode.DELETE){return true}var g=c.trim(this.value);return g.length<=f};this.fields.$description.on("keypress",".textarea",function(f){return d.call(this,f,Roadmap.BarDialog.MAX_LENGTH_DESCRIPTION)});this.fields.$description.on("paste",".textarea",function(g){var f=this;setTimeout(function(){if(d.call(f,g,Roadmap.BarDialog.MAX_LENGTH_DESCRIPTION)){f.value=f.value.substr(0,Roadmap.BarDialog.MAX_LENGTH_DESCRIPTION)}},0)})}},_onDeleteClick:function(){this.options.deleteBar();this.remove()},_goToCreateLinkPage:function(f){var e=this.options.dialogOptions;if(e.createLinkPageCallback){var d=a.bind(e.createLinkPageCallback,{me:this},f);d()}},_goToUpdateLinkPage:function(d){d.preventDefault();this.fields.$pageLink.show();this.fields.$pageLinkNew.hide();this.fields.$pageLinkUpdate.hide();this.fields.$pageLink.click()}})})(AJS.$,window._);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-roadmap-plugin:roadmap-bar-dialog-resources', location = 'view/roadmap-editor/bar-dialog/bar-link-new-page.js' */
Confluence.RoadmapLink=(function(f,a){Roadmap.trackingBars=[];function c(i,j){var g={};if(parseInt(i.pageId)<=0){i.parentPageId=AJS.Meta.get("parent-page-id")}var h=f.param(i);window.open(AJS.contextPath()+"/plugins/roadmap/create-page.action?"+h,"_blank");b(i.roadmapBarId).done(function(k){Roadmap.trackingBars.push(i.roadmapBarId)});f(window).off("focus");f(window).on("focus",function(){if(!Roadmap.trackingBars.length){f(window).off("focus")}a.each(Roadmap.trackingBars,function(k){d(k).done(function(m){var l=m.status;if(l=="REDEEM"){e(k);j({barId:k,pageLink:f.parseJSON(m.pageLink)})}else{if(l=="UNKNOWN"){e(k)}}})})})}function e(g){Roadmap.trackingBars.splice(Roadmap.trackingBars.indexOf(g),1)}function b(g){return f.ajax({contentType:"application/json",type:"PUT",url:AJS.contextPath()+"/rest/roadmap/1.0/bar/"+g+"/PENDING"})}function d(g){return f.ajax({contentType:"application/json",type:"GET",url:AJS.contextPath()+"/rest/roadmap/1.0/bar/"+g+"/status"})}return{addCreateLinkPageListener:c}})(AJS.$,window._);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.auiplugin:jquery-ui-interactions', location = 'node_modules/@atlassian/aui/src/js-vendor/jquery/jquery-ui/jquery.ui.droppable.js' */
(function(d){d.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect"},_create:function(){var a=this.options,b=a.accept;this.isover=0;this.isout=1;this.accept=d.isFunction(b)?b:function(a){return a.is(b)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};d.ui.ddmanager.droppables[a.scope]=d.ui.ddmanager.droppables[a.scope]||[];d.ui.ddmanager.droppables[a.scope].push(this);
a.addClasses&&this.element.addClass("ui-droppable")},destroy:function(){for(var a=d.ui.ddmanager.droppables[this.options.scope],b=0;b<a.length;b++)a[b]==this&&a.splice(b,1);this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable");return this},_setOption:function(a,b){"accept"==a&&(this.accept=d.isFunction(b)?b:function(a){return a.is(b)});d.Widget.prototype._setOption.apply(this,arguments)},_activate:function(a){var b=d.ui.ddmanager.current;this.options.activeClass&&
this.element.addClass(this.options.activeClass);b&&this._trigger("activate",a,this.ui(b))},_deactivate:function(a){var b=d.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass);b&&this._trigger("deactivate",a,this.ui(b))},_over:function(a){var b=d.ui.ddmanager.current;if(b&&(b.currentItem||b.element)[0]!=this.element[0])if(this.accept.call(this.element[0],b.currentItem||b.element))this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",
a,this.ui(b))},_out:function(a){var b=d.ui.ddmanager.current;if(b&&(b.currentItem||b.element)[0]!=this.element[0])if(this.accept.call(this.element[0],b.currentItem||b.element))this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",a,this.ui(b))},_drop:function(a,b){var c=b||d.ui.ddmanager.current;if(!c||(c.currentItem||c.element)[0]==this.element[0])return!1;var f=!1;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var a=d.data(this,
"droppable");if(a.options.greedy&&!a.options.disabled&&a.options.scope==c.options.scope&&a.accept.call(a.element[0],c.currentItem||c.element)&&d.ui.intersect(c,d.extend(a,{offset:a.element.offset()}),a.options.tolerance))return f=!0,!1});return f?!1:this.accept.call(this.element[0],c.currentItem||c.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",a,this.ui(c)),this.element):
!1},ui:function(a){return{draggable:a.currentItem||a.element,helper:a.helper,position:a.position,offset:a.positionAbs}}});d.extend(d.ui.droppable,{version:"1.8.24"});d.ui.intersect=function(a,b,c){if(!b.offset)return!1;var f=(a.positionAbs||a.position.absolute).left,g=f+a.helperProportions.width,e=(a.positionAbs||a.position.absolute).top,h=e+a.helperProportions.height,i=b.offset.left,k=i+b.proportions.width,j=b.offset.top,l=j+b.proportions.height;switch(c){case "fit":return i<=f&&g<=k&&j<=e&&h<=l;
case "intersect":return i<f+a.helperProportions.width/2&&g-a.helperProportions.width/2<k&&j<e+a.helperProportions.height/2&&h-a.helperProportions.height/2<l;case "pointer":return d.ui.isOver((a.positionAbs||a.position.absolute).top+(a.clickOffset||a.offset.click).top,(a.positionAbs||a.position.absolute).left+(a.clickOffset||a.offset.click).left,j,i,b.proportions.height,b.proportions.width);case "touch":return(e>=j&&e<=l||h>=j&&h<=l||e<j&&h>l)&&(f>=i&&f<=k||g>=i&&g<=k||f<i&&g>k);default:return!1}};
d.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(a,b){var c=d.ui.ddmanager.droppables[a.options.scope]||[],f=b?b.type:null,g=(a.currentItem||a.element).find(":data(droppable)").andSelf(),e=0;a:for(;e<c.length;e++)if(!(c[e].options.disabled||a&&!c[e].accept.call(c[e].element[0],a.currentItem||a.element))){for(var h=0;h<g.length;h++)if(g[h]==c[e].element[0]){c[e].proportions.height=0;continue a}c[e].visible="none"!=c[e].element.css("display");c[e].visible&&("mousedown"==
f&&c[e]._activate.call(c[e],b),c[e].offset=c[e].element.offset(),c[e].proportions={width:c[e].element[0].offsetWidth,height:c[e].element[0].offsetHeight})}},drop:function(a,b){var c=!1;d.each(d.ui.ddmanager.droppables[a.options.scope]||[],function(){if(this.options&&(!this.options.disabled&&(this.visible&&d.ui.intersect(a,this,this.options.tolerance))&&(c=this._drop.call(this,b)||c),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],a.currentItem||a.element)))this.isout=1,this.isover=
0,this._deactivate.call(this,b)});return c},dragStart:function(a,b){a.element.parents(":not(body,html)").bind("scroll.droppable",function(){a.options.refreshPositions||d.ui.ddmanager.prepareOffsets(a,b)})},drag:function(a,b){a.options.refreshPositions&&d.ui.ddmanager.prepareOffsets(a,b);d.each(d.ui.ddmanager.droppables[a.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var c=d.ui.intersect(a,this,this.options.tolerance);if(c=!c&&1==this.isover?"isout":c&&0==
this.isover?"isover":null){var f;if(this.options.greedy){var g=this.options.scope,e=this.element.parents(":data(droppable)").filter(function(){return d.data(this,"droppable").options.scope===g});e.length&&(f=d.data(e[0],"droppable"),f.greedyChild="isover"==c?1:0)}f&&"isover"==c&&(f.isover=0,f.isout=1,f._out.call(f,b));this[c]=1;this["isout"==c?"isover":"isout"]=0;this["isover"==c?"_over":"_out"].call(this,b);f&&"isout"==c&&(f.isout=0,f.isover=1,f._over.call(f,b))}}})},dragStop:function(a,b){a.element.parents(":not(body,html)").unbind("scroll.droppable");
a.options.refreshPositions||d.ui.ddmanager.prepareOffsets(a,b)}}})(jQuery);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.auiplugin:jquery-ui-interactions', location = 'node_modules/@atlassian/aui/src/js-vendor/jquery/jquery-ui/jquery.ui.resizable.js' */
(function(e){e.widget("ui.resizable",e.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1E3},_create:function(){var b=this,a=this.options;this.element.addClass("ui-resizable");e.extend(this,{_aspectRatio:!!a.aspectRatio,aspectRatio:a.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],
_helper:a.helper||a.ghost||a.animate?a.helper||"ui-resizable-helper":null});this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(e('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("resizable",this.element.data("resizable")),this.elementIsWrapper=
!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,
display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize());this.handles=a.handles||(!e(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){"all"==this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw");var c=this.handles.split(",");this.handles=
{};for(var d=0;d<c.length;d++){var f=e.trim(c[d]),g=e('<div class="ui-resizable-handle ui-resizable-'+f+'"></div>');g.css({zIndex:a.zIndex});"se"==f&&g.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[f]=".ui-resizable-"+f;this.element.append(g)}}this._renderAxis=function(a){var a=a||this.element,b;for(b in this.handles){this.handles[b].constructor==String&&(this.handles[b]=e(this.handles[b],this.element).show());if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var c=
e(this.handles[b],this.element),d=0,d=/sw|ne|nw|se|n|s/.test(b)?c.outerHeight():c.outerWidth(),c=["padding",/ne|nw|n/.test(b)?"Top":/se|sw|s/.test(b)?"Bottom":/^e$/.test(b)?"Right":"Left"].join("");a.css(c,d);this._proportionallyResize()}e(this.handles[b])}};this._renderAxis(this.element);this._handles=e(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!b.resizing){if(this.className)var a=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=
a&&a[1]?a[1]:"se"}});a.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").hover(function(){if(!a.disabled){e(this).removeClass("ui-resizable-autohide");b._handles.show()}},function(){if(!a.disabled&&!b.resizing){e(this).addClass("ui-resizable-autohide");b._handles.hide()}}));this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(a){e(a).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};
if(this.elementIsWrapper){b(this.element);var a=this.element;a.after(this.originalElement.css({position:a.css("position"),width:a.outerWidth(),height:a.outerHeight(),top:a.css("top"),left:a.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);b(this.originalElement);return this},_mouseCapture:function(b){var a=!1,c;for(c in this.handles)e(this.handles[c])[0]==b.target&&(a=!0);return!this.options.disabled&&a},_mouseStart:function(b){var a=this.options,c=this.element.position(),
d=this.element;this.resizing=!0;this.documentScroll={top:e(document).scrollTop(),left:e(document).scrollLeft()};(d.is(".ui-draggable")||/absolute/.test(d.css("position")))&&d.css({position:"absolute",top:c.top,left:c.left});this._renderProxy();var c=j(this.helper.css("left")),f=j(this.helper.css("top"));a.containment&&(c+=e(a.containment).scrollLeft()||0,f+=e(a.containment).scrollTop()||0);this.offset=this.helper.offset();this.position={left:c,top:f};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:
{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:c,top:f};this.sizeDiff={width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:b.pageX,top:b.pageY};this.aspectRatio="number"==typeof a.aspectRatio?a.aspectRatio:this.originalSize.width/this.originalSize.height||1;a=e(".ui-resizable-"+this.axis).css("cursor");e("body").css("cursor",
"auto"==a?this.axis+"-resize":a);d.addClass("ui-resizable-resizing");this._propagate("start",b);return!0},_mouseDrag:function(b){var a=this.helper,c=this.originalMousePosition,d=this._change[this.axis];if(!d)return!1;c=d.apply(this,[b,b.pageX-c.left||0,b.pageY-c.top||0]);this._updateVirtualBoundaries(b.shiftKey);if(this._aspectRatio||b.shiftKey)c=this._updateRatio(c,b);c=this._respectSize(c,b);this._propagate("resize",b);a.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+
"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(c);this._trigger("resize",b,this.ui());return!1},_mouseStop:function(b){this.resizing=!1;var a=this.options;if(this._helper){var c=this._proportionallyResizeElements,d=c.length&&/textarea/i.test(c[0].nodeName),c=d&&e.ui.hasScroll(c[0],"left")?0:this.sizeDiff.height,d=d?0:this.sizeDiff.width,d={width:this.helper.width()-d,height:this.helper.height()-c},c=parseInt(this.element.css("left"),
10)+(this.position.left-this.originalPosition.left)||null,f=parseInt(this.element.css("top"),10)+(this.position.top-this.originalPosition.top)||null;a.animate||this.element.css(e.extend(d,{top:f,left:c}));this.helper.height(this.size.height);this.helper.width(this.size.width);this._helper&&!a.animate&&this._proportionallyResize()}e("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",b);this._helper&&this.helper.remove();return!1},_updateVirtualBoundaries:function(b){var a=
this.options,c,d,e,a={minWidth:i(a.minWidth)?a.minWidth:0,maxWidth:i(a.maxWidth)?a.maxWidth:Infinity,minHeight:i(a.minHeight)?a.minHeight:0,maxHeight:i(a.maxHeight)?a.maxHeight:Infinity};if(this._aspectRatio||b)if(b=a.minHeight*this.aspectRatio,d=a.minWidth/this.aspectRatio,c=a.maxHeight*this.aspectRatio,e=a.maxWidth/this.aspectRatio,b>a.minWidth&&(a.minWidth=b),d>a.minHeight&&(a.minHeight=d),c<a.maxWidth&&(a.maxWidth=c),e<a.maxHeight)a.maxHeight=e;this._vBoundaries=a},_updateCache:function(b){this.offset=
this.helper.offset();i(b.left)&&(this.position.left=b.left);i(b.top)&&(this.position.top=b.top);i(b.height)&&(this.size.height=b.height);i(b.width)&&(this.size.width=b.width)},_updateRatio:function(b){var a=this.position,c=this.size,d=this.axis;i(b.height)?b.width=b.height*this.aspectRatio:i(b.width)&&(b.height=b.width/this.aspectRatio);"sw"==d&&(b.left=a.left+(c.width-b.width),b.top=null);"nw"==d&&(b.top=a.top+(c.height-b.height),b.left=a.left+(c.width-b.width));return b},_respectSize:function(b){var a=
this._vBoundaries,c=this.axis,d=i(b.width)&&a.maxWidth&&a.maxWidth<b.width,e=i(b.height)&&a.maxHeight&&a.maxHeight<b.height,g=i(b.width)&&a.minWidth&&a.minWidth>b.width,h=i(b.height)&&a.minHeight&&a.minHeight>b.height;g&&(b.width=a.minWidth);h&&(b.height=a.minHeight);d&&(b.width=a.maxWidth);e&&(b.height=a.maxHeight);var k=this.originalPosition.left+this.originalSize.width,l=this.position.top+this.size.height,m=/sw|nw|w/.test(c),c=/nw|ne|n/.test(c);g&&m&&(b.left=k-a.minWidth);d&&m&&(b.left=k-a.maxWidth);
h&&c&&(b.top=l-a.minHeight);e&&c&&(b.top=l-a.maxHeight);(a=!b.width&&!b.height)&&!b.left&&b.top?b.top=null:a&&(!b.top&&b.left)&&(b.left=null);return b},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var b=this.helper||this.element,a=0;a<this._proportionallyResizeElements.length;a++){var c=this._proportionallyResizeElements[a];if(!this.borderDif){var d=[c.css("borderTopWidth"),c.css("borderRightWidth"),c.css("borderBottomWidth"),c.css("borderLeftWidth")],f=[c.css("paddingTop"),
c.css("paddingRight"),c.css("paddingBottom"),c.css("paddingLeft")];this.borderDif=e.map(d,function(a,b){var c=parseInt(a,10)||0,d=parseInt(f[b],10)||0;return c+d})}if(!e.browser.msie||!e(b).is(":hidden")&&!e(b).parents(":hidden").length)c.css({height:b.height()-this.borderDif[0]-this.borderDif[2]||0,width:b.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var b=this.options;this.elementOffset=this.element.offset();if(this._helper){this.helper=this.helper||e('<div style="overflow:hidden;"></div>');
var a=e.browser.msie&&7>e.browser.version,c=a?1:0,a=a?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+a,height:this.element.outerHeight()+a,position:"absolute",left:this.elementOffset.left-c+"px",top:this.elementOffset.top-c+"px",zIndex:++b.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(b,a){return{width:this.originalSize.width+a}},w:function(b,a){return{left:this.originalPosition.left+a,width:this.originalSize.width-
a}},n:function(b,a,c){return{top:this.originalPosition.top+c,height:this.originalSize.height-c}},s:function(b,a,c){return{height:this.originalSize.height+c}},se:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},sw:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,a,c]))},ne:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},nw:function(b,a,
c){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,a,c]))}},_propagate:function(b,a){e.ui.plugin.call(this,b,[a,this.ui()]);"resize"!=b&&this._trigger(b,a,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});e.extend(e.ui.resizable,{version:"1.8.24"});e.ui.plugin.add("resizable","alsoResize",
{start:function(){var b=e(this).data("resizable").options,a=function(a){e(a).each(function(){var a=e(this);a.data("resizable-alsoresize",{width:parseInt(a.width(),10),height:parseInt(a.height(),10),left:parseInt(a.css("left"),10),top:parseInt(a.css("top"),10)})})};"object"==typeof b.alsoResize&&!b.alsoResize.parentNode?b.alsoResize.length?(b.alsoResize=b.alsoResize[0],a(b.alsoResize)):e.each(b.alsoResize,function(b){a(b)}):a(b.alsoResize)},resize:function(b,a){var c=e(this).data("resizable"),d=c.options,
f=c.originalSize,g=c.originalPosition,h={height:c.size.height-f.height||0,width:c.size.width-f.width||0,top:c.position.top-g.top||0,left:c.position.left-g.left||0},i=function(b,c){e(b).each(function(){var b=e(this),d=e(this).data("resizable-alsoresize"),f={},g=c&&c.length?c:b.parents(a.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(g,function(a,b){var c=(d[b]||0)+(h[b]||0);c&&0<=c&&(f[b]=c||null)});b.css(f)})};"object"==typeof d.alsoResize&&!d.alsoResize.nodeType?
e.each(d.alsoResize,function(a,b){i(a,b)}):i(d.alsoResize)},stop:function(){e(this).removeData("resizable-alsoresize")}});e.ui.plugin.add("resizable","animate",{stop:function(b){var a=e(this).data("resizable"),c=a.options,d=a._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName),g=f&&e.ui.hasScroll(d[0],"left")?0:a.sizeDiff.height,f={width:a.size.width-(f?0:a.sizeDiff.width),height:a.size.height-g},g=parseInt(a.element.css("left"),10)+(a.position.left-a.originalPosition.left)||
null,h=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||null;a.element.animate(e.extend(f,h&&g?{top:h,left:g}:{}),{duration:c.animateDuration,easing:c.animateEasing,step:function(){var c={width:parseInt(a.element.css("width"),10),height:parseInt(a.element.css("height"),10),top:parseInt(a.element.css("top"),10),left:parseInt(a.element.css("left"),10)};d&&d.length&&e(d[0]).css({width:c.width,height:c.height});a._updateCache(c);a._propagate("resize",b)}})}});e.ui.plugin.add("resizable",
"containment",{start:function(){var b=e(this).data("resizable"),a=b.element,c=b.options.containment;if(a=c instanceof e?c.get(0):/parent/.test(c)?a.parent().get(0):c)if(b.containerElement=e(a),/document/.test(c)||c==document)b.containerOffset={left:0,top:0},b.containerPosition={left:0,top:0},b.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight};else{var d=e(a),f=[];e(["Top","Right","Left","Bottom"]).each(function(a,
b){f[a]=j(d.css("padding"+b))});b.containerOffset=d.offset();b.containerPosition=d.position();b.containerSize={height:d.innerHeight()-f[3],width:d.innerWidth()-f[1]};var c=b.containerOffset,g=b.containerSize.height,h=b.containerSize.width,h=e.ui.hasScroll(a,"left")?a.scrollWidth:h,g=e.ui.hasScroll(a)?a.scrollHeight:g;b.parentData={element:a,left:c.left,top:c.top,width:h,height:g}}},resize:function(b){var a=e(this).data("resizable"),c=a.options,d=a.containerOffset,f=a.position,b=a._aspectRatio||b.shiftKey,
g={top:0,left:0},h=a.containerElement;h[0]!=document&&/static/.test(h.css("position"))&&(g=d);if(f.left<(a._helper?d.left:0))a.size.width+=a._helper?a.position.left-d.left:a.position.left-g.left,b&&(a.size.height=a.size.width/a.aspectRatio),a.position.left=c.helper?d.left:0;if(f.top<(a._helper?d.top:0))a.size.height+=a._helper?a.position.top-d.top:a.position.top,b&&(a.size.width=a.size.height*a.aspectRatio),a.position.top=a._helper?d.top:0;a.offset.left=a.parentData.left+a.position.left;a.offset.top=
a.parentData.top+a.position.top;c=Math.abs(a.offset.left-g.left+a.sizeDiff.width);d=Math.abs((a._helper?a.offset.top-g.top:a.offset.top-d.top)+a.sizeDiff.height);f=a.containerElement.get(0)==a.element.parent().get(0);g=/relative|absolute/.test(a.containerElement.css("position"));f&&g&&(c-=a.parentData.left);c+a.size.width>=a.parentData.width&&(a.size.width=a.parentData.width-c,b&&(a.size.height=a.size.width/a.aspectRatio));d+a.size.height>=a.parentData.height&&(a.size.height=a.parentData.height-d,
b&&(a.size.width=a.size.height*a.aspectRatio))},stop:function(){var b=e(this).data("resizable"),a=b.options,c=b.containerOffset,d=b.containerPosition,f=b.containerElement,g=e(b.helper),h=g.offset(),i=g.outerWidth()-b.sizeDiff.width,g=g.outerHeight()-b.sizeDiff.height;b._helper&&(!a.animate&&/relative/.test(f.css("position")))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g});b._helper&&(!a.animate&&/static/.test(f.css("position")))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g})}});
e.ui.plugin.add("resizable","ghost",{start:function(){var b=e(this).data("resizable"),a=b.options,c=b.size;b.ghost=b.originalElement.clone();b.ghost.css({opacity:0.25,display:"block",position:"relative",height:c.height,width:c.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof a.ghost?a.ghost:"");b.ghost.appendTo(b.helper)},resize:function(){var b=e(this).data("resizable");b.ghost&&b.ghost.css({position:"relative",height:b.size.height,width:b.size.width})},stop:function(){var b=
e(this).data("resizable");b.ghost&&b.helper&&b.helper.get(0).removeChild(b.ghost.get(0))}});e.ui.plugin.add("resizable","grid",{resize:function(){var b=e(this).data("resizable"),a=b.options,c=b.size,d=b.originalSize,f=b.originalPosition,g=b.axis;a.grid="number"==typeof a.grid?[a.grid,a.grid]:a.grid;var h=Math.round((c.width-d.width)/(a.grid[0]||1))*(a.grid[0]||1),a=Math.round((c.height-d.height)/(a.grid[1]||1))*(a.grid[1]||1);/^(se|s|e)$/.test(g)?(b.size.width=d.width+h,b.size.height=d.height+a):
/^(ne)$/.test(g)?(b.size.width=d.width+h,b.size.height=d.height+a,b.position.top=f.top-a):(/^(sw)$/.test(g)?(b.size.width=d.width+h,b.size.height=d.height+a):(b.size.width=d.width+h,b.size.height=d.height+a,b.position.top=f.top-a),b.position.left=f.left-h)}});var j=function(b){return parseInt(b,10)||0},i=function(b){return!isNaN(parseInt(b,10))}})(jQuery);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.auiplugin:jquery-ui-interactions', location = 'node_modules/@atlassian/aui/src/js-vendor/jquery/jquery-ui/jquery.ui.selectable.js' */
(function(e){e.widget("ui.selectable",e.ui.mouse,{options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch"},_create:function(){var b=this;this.element.addClass("ui-selectable");this.dragged=!1;var f;this.refresh=function(){f=e(b.options.filter,b.element[0]);f.addClass("ui-selectee");f.each(function(){var b=e(this),c=b.offset();e.data(this,"selectable-item",{element:this,$element:b,left:c.left,top:c.top,right:c.left+b.outerWidth(),bottom:c.top+b.outerHeight(),startselected:!1,
selected:b.hasClass("ui-selected"),selecting:b.hasClass("ui-selecting"),unselecting:b.hasClass("ui-unselecting")})})};this.refresh();this.selectees=f.addClass("ui-selectee");this._mouseInit();this.helper=e("<div class='ui-selectable-helper'></div>")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(b){var f=
this;this.opos=[b.pageX,b.pageY];if(!this.options.disabled){var d=this.options;this.selectees=e(d.filter,this.element[0]);this._trigger("start",b);e(d.appendTo).append(this.helper);this.helper.css({left:b.clientX,top:b.clientY,width:0,height:0});d.autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function(){var c=e.data(this,"selectable-item");c.startselected=!0;!b.metaKey&&!b.ctrlKey&&(c.$element.removeClass("ui-selected"),c.selected=!1,c.$element.addClass("ui-unselecting"),
c.unselecting=!0,f._trigger("unselecting",b,{unselecting:c.element}))});e(b.target).parents().andSelf().each(function(){var c=e.data(this,"selectable-item");if(c){var d=!b.metaKey&&!b.ctrlKey||!c.$element.hasClass("ui-selected");c.$element.removeClass(d?"ui-unselecting":"ui-selected").addClass(d?"ui-selecting":"ui-unselecting");c.unselecting=!d;c.selecting=d;(c.selected=d)?f._trigger("selecting",b,{selecting:c.element}):f._trigger("unselecting",b,{unselecting:c.element});return!1}})}},_mouseDrag:function(b){var f=
this;this.dragged=!0;if(!this.options.disabled){var d=this.options,c=this.opos[0],g=this.opos[1],i=b.pageX,j=b.pageY;if(c>i)var h=i,i=c,c=h;g>j&&(h=j,j=g,g=h);this.helper.css({left:c,top:g,width:i-c,height:j-g});this.selectees.each(function(){var a=e.data(this,"selectable-item");if(a&&a.element!=f.element[0]){var h=false;d.tolerance=="touch"?h=!(a.left>i||a.right<c||a.top>j||a.bottom<g):d.tolerance=="fit"&&(h=a.left>c&&a.right<i&&a.top>g&&a.bottom<j);if(h){if(a.selected){a.$element.removeClass("ui-selected");
a.selected=false}if(a.unselecting){a.$element.removeClass("ui-unselecting");a.unselecting=false}if(!a.selecting){a.$element.addClass("ui-selecting");a.selecting=true;f._trigger("selecting",b,{selecting:a.element})}}else{if(a.selecting)if((b.metaKey||b.ctrlKey)&&a.startselected){a.$element.removeClass("ui-selecting");a.selecting=false;a.$element.addClass("ui-selected");a.selected=true}else{a.$element.removeClass("ui-selecting");a.selecting=false;if(a.startselected){a.$element.addClass("ui-unselecting");
a.unselecting=true}f._trigger("unselecting",b,{unselecting:a.element})}if(a.selected&&!b.metaKey&&!b.ctrlKey&&!a.startselected){a.$element.removeClass("ui-selected");a.selected=false;a.$element.addClass("ui-unselecting");a.unselecting=true;f._trigger("unselecting",b,{unselecting:a.element})}}}});return!1}},_mouseStop:function(b){var f=this;this.dragged=!1;e(".ui-unselecting",this.element[0]).each(function(){var d=e.data(this,"selectable-item");d.$element.removeClass("ui-unselecting");d.unselecting=
!1;d.startselected=!1;f._trigger("unselected",b,{unselected:d.element})});e(".ui-selecting",this.element[0]).each(function(){var d=e.data(this,"selectable-item");d.$element.removeClass("ui-selecting").addClass("ui-selected");d.selecting=!1;d.selected=!0;d.startselected=!0;f._trigger("selected",b,{selected:d.element})});this._trigger("stop",b);this.helper.remove();return!1}});e.extend(e.ui.selectable,{version:"1.8.24"})})(jQuery);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.auiplugin:jquery-ui-widgets', location = 'node_modules/@atlassian/aui/src/js-vendor/jquery/jquery-ui/jquery.ui.accordion.js' */
(function(d){d.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:!0,clearStyle:!1,collapsible:!1,event:"click",fillSpace:!1,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:!1,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var a=this,b=a.options;a.running=0;a.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix");
a.headers=a.element.find(b.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){b.disabled||d(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){b.disabled||d(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){b.disabled||d(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){b.disabled||d(this).removeClass("ui-state-focus")});a.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");
if(b.navigation){var c=a.element.find("a").filter(b.navigationFilter).eq(0);if(c.length){var f=c.closest(".ui-accordion-header");a.active=f.length?f:c.closest(".ui-accordion-content").prev()}}a.active=a._findActive(a.active||b.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");a.active.next().addClass("ui-accordion-content-active");a._createIcons();a.resize();a.element.attr("role","tablist");a.headers.attr("role","tab").bind("keydown.accordion",
function(b){return a._keydown(b)}).next().attr("role","tabpanel");a.headers.not(a.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide();a.active.length?a.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):a.headers.eq(0).attr("tabIndex",0);d.browser.safari||a.headers.find("a").attr("tabIndex",-1);b.event&&a.headers.bind(b.event.split(" ").join(".accordion ")+".accordion",function(b){a._clickHandler.call(a,b,this);b.preventDefault()})},_createIcons:function(){var a=
this.options;a.icons&&(d("<span></span>").addClass("ui-icon "+a.icons.header).prependTo(this.headers),this.active.children(".ui-icon").toggleClass(a.icons.header).toggleClass(a.icons.headerSelected),this.element.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons")},destroy:function(){var a=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex");
this.headers.find("a").removeAttr("tabIndex");this._destroyIcons();var b=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");(a.autoHeight||a.fillHeight)&&b.css("height","");return d.Widget.prototype.destroy.call(this)},_setOption:function(a,b){d.Widget.prototype._setOption.apply(this,arguments);"active"==a&&this.activate(b);"icons"==a&&(this._destroyIcons(),
b&&this._createIcons());if("disabled"==a)this.headers.add(this.headers.next())[b?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(a){if(!this.options.disabled&&!a.altKey&&!a.ctrlKey){var b=d.ui.keyCode,c=this.headers.length,f=this.headers.index(a.target),g=!1;switch(a.keyCode){case b.RIGHT:case b.DOWN:g=this.headers[(f+1)%c];break;case b.LEFT:case b.UP:g=this.headers[(f-1+c)%c];break;case b.SPACE:case b.ENTER:this._clickHandler({target:a.target},a.target),a.preventDefault()}return g?
(d(a.target).attr("tabIndex",-1),d(g).attr("tabIndex",0),g.focus(),!1):!0}},resize:function(){var a=this.options,b;if(a.fillSpace){if(d.browser.msie){var c=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}b=this.element.parent().height();d.browser.msie&&this.element.parent().css("overflow",c);this.headers.each(function(){b-=d(this).outerHeight(!0)});this.headers.next().each(function(){d(this).height(Math.max(0,b-d(this).innerHeight()+d(this).height()))}).css("overflow",
"auto")}else a.autoHeight&&(b=0,this.headers.next().each(function(){b=Math.max(b,d(this).height("").height())}).height(b));return this},activate:function(a){this.options.active=a;a=this._findActive(a)[0];this._clickHandler({target:a},a);return this},_findActive:function(a){return a?"number"===typeof a?this.headers.filter(":eq("+a+")"):this.headers.not(this.headers.not(a)):!1===a?d([]):this.headers.filter(":eq(0)")},_clickHandler:function(a,b){var c=this.options;if(!c.disabled)if(a.target){var f=d(a.currentTarget||
b),g=f[0]===this.active[0];c.active=c.collapsible&&g?!1:this.headers.index(f);if(!(this.running||!c.collapsible&&g)){var i=this.active,e=f.next(),h=this.active.next(),k={options:c,newHeader:g&&c.collapsible?d([]):f,oldHeader:this.active,newContent:g&&c.collapsible?d([]):e,oldContent:h},j=this.headers.index(this.active[0])>this.headers.index(f[0]);this.active=g?d([]):f;this._toggle(e,h,k,g,j);i.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(c.icons.headerSelected).addClass(c.icons.header);
g||(f.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(c.icons.header).addClass(c.icons.headerSelected),f.next().addClass("ui-accordion-content-active"))}}else if(c.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(c.icons.headerSelected).addClass(c.icons.header);this.active.next().addClass("ui-accordion-content-active");var h=this.active.next(),
k={options:c,newHeader:d([]),oldHeader:c.active,newContent:d([]),oldContent:h},e=this.active=d([]);this._toggle(e,h,k)}},_toggle:function(a,b,c,f,g){var i=this,e=i.options;i.toShow=a;i.toHide=b;i.data=c;var h=function(){if(i)return i._completed.apply(i,arguments)};i._trigger("changestart",null,i.data);i.running=0===b.size()?a.size():b.size();if(e.animated){c={};c=e.collapsible&&f?{toShow:d([]),toHide:b,complete:h,down:g,autoHeight:e.autoHeight||e.fillSpace}:{toShow:a,toHide:b,complete:h,down:g,autoHeight:e.autoHeight||
e.fillSpace};e.proxied||(e.proxied=e.animated);e.proxiedDuration||(e.proxiedDuration=e.duration);e.animated=d.isFunction(e.proxied)?e.proxied(c):e.proxied;e.duration=d.isFunction(e.proxiedDuration)?e.proxiedDuration(c):e.proxiedDuration;var f=d.ui.accordion.animations,k=e.duration,j=e.animated;j&&(!f[j]&&!d.easing[j])&&(j="slide");f[j]||(f[j]=function(a){this.slide(a,{easing:j,duration:k||700})});f[j](c)}else e.collapsible&&f?a.toggle():(b.hide(),a.show()),h(!0);b.prev().attr({"aria-expanded":"false",
"aria-selected":"false",tabIndex:-1}).blur();a.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;this.running||(this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""}),this.toHide.removeClass("ui-accordion-content-active"),this.toHide.length&&(this.toHide.parent()[0].className=this.toHide.parent()[0].className),this._trigger("change",null,this.data))}});d.extend(d.ui.accordion,{version:"1.8.24",
animations:{slide:function(a,b){a=d.extend({easing:"swing",duration:300},a,b);if(a.toHide.size())if(a.toShow.size()){var c=a.toShow.css("overflow"),f=0,g={},i={},e,h=a.toShow;e=h[0].style.width;h.width(h.parent().width()-parseFloat(h.css("paddingLeft"))-parseFloat(h.css("paddingRight"))-(parseFloat(h.css("borderLeftWidth"))||0)-(parseFloat(h.css("borderRightWidth"))||0));d.each(["height","paddingTop","paddingBottom"],function(b,c){i[c]="hide";var e=(""+d.css(a.toShow[0],c)).match(/^([\d+-.]+)(.*)$/);
g[c]={value:e[1],unit:e[2]||"px"}});a.toShow.css({height:0,overflow:"hidden"}).show();a.toHide.filter(":hidden").each(a.complete).end().filter(":visible").animate(i,{step:function(b,c){"height"==c.prop&&(f=0===c.end-c.start?0:(c.now-c.start)/(c.end-c.start));a.toShow[0].style[c.prop]=f*g[c.prop].value+g[c.prop].unit},duration:a.duration,easing:a.easing,complete:function(){a.autoHeight||a.toShow.css("height","");a.toShow.css({width:e,overflow:c});a.complete()}})}else a.toHide.animate({height:"hide",
paddingTop:"hide",paddingBottom:"hide"},a);else a.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},a)},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1E3:200})}}})})(jQuery);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.auiplugin:jquery-ui-widgets', location = 'node_modules/@atlassian/aui/src/js-vendor/jquery/jquery-ui/jquery.ui.autocomplete.js' */
(function(d){var c=0;d.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var a=this,b=this.element[0].ownerDocument,c;this.isMultiLine=this.element.is("textarea");this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(b){if(!a.options.disabled&&
!a.element.propAttr("readOnly")){c=!1;var f=d.ui.keyCode;switch(b.keyCode){case f.PAGE_UP:a._move("previousPage",b);break;case f.PAGE_DOWN:a._move("nextPage",b);break;case f.UP:a._keyEvent("previous",b);break;case f.DOWN:a._keyEvent("next",b);break;case f.ENTER:case f.NUMPAD_ENTER:a.menu.active&&(c=!0,b.preventDefault());case f.TAB:if(!a.menu.active)break;a.menu.select(b);break;case f.ESCAPE:a.element.val(a.term);a.close(b);break;default:clearTimeout(a.searching),a.searching=setTimeout(function(){a.term!=
a.element.val()&&(a.selectedItem=null,a.search(null,b))},a.options.delay)}}}).bind("keypress.autocomplete",function(a){c&&(c=!1,a.preventDefault())}).bind("focus.autocomplete",function(){a.options.disabled||(a.selectedItem=null,a.previous=a.element.val())}).bind("blur.autocomplete",function(b){a.options.disabled||(clearTimeout(a.searching),a.closing=setTimeout(function(){a.close(b);a._change(b)},150))});this._initSource();this.menu=d("<ul></ul>").addClass("ui-autocomplete").appendTo(d(this.options.appendTo||
"body",b)[0]).mousedown(function(b){var c=a.menu.element[0];d(b.target).closest(".ui-menu-item").length||setTimeout(function(){d(document).one("mousedown",function(b){b.target!==a.element[0]&&(b.target!==c&&!d.ui.contains(c,b.target))&&a.close()})},1);setTimeout(function(){clearTimeout(a.closing)},13)}).menu({focus:function(b,d){var c=d.item.data("item.autocomplete");!1!==a._trigger("focus",b,{item:c})&&/^key/.test(b.originalEvent.type)&&a.element.val(c.value)},selected:function(c,d){var e=d.item.data("item.autocomplete"),
h=a.previous;a.element[0]!==b.activeElement&&(a.element.focus(),a.previous=h,setTimeout(function(){a.previous=h;a.selectedItem=e},1));!1!==a._trigger("select",c,{item:e})&&a.element.val(e.value);a.term=a.element.val();a.close(c);a.selectedItem=e},blur:function(){a.menu.element.is(":visible")&&a.element.val()!==a.term&&a.element.val(a.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");d.fn.bgiframe&&this.menu.element.bgiframe();a.beforeunloadHandler=function(){a.element.removeAttr("autocomplete")};
d(window).bind("beforeunload",a.beforeunloadHandler)},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");this.menu.element.remove();d(window).unbind("beforeunload",this.beforeunloadHandler);d.Widget.prototype.destroy.call(this)},_setOption:function(a,b){d.Widget.prototype._setOption.apply(this,arguments);"source"===a&&this._initSource();"appendTo"===a&&this.menu.element.appendTo(d(b||
"body",this.element[0].ownerDocument)[0]);"disabled"===a&&(b&&this.xhr)&&this.xhr.abort()},_initSource:function(){var a=this,b,c;d.isArray(this.options.source)?(b=this.options.source,this.source=function(a,c){c(d.ui.autocomplete.filter(b,a.term))}):"string"===typeof this.options.source?(c=this.options.source,this.source=function(b,f){a.xhr&&a.xhr.abort();a.xhr=d.ajax({url:c,data:b,dataType:"json",success:function(a){f(a)},error:function(){f([])}})}):this.source=this.options.source},search:function(a,
b){a=null!=a?a:this.element.val();this.term=this.element.val();if(a.length<this.options.minLength)return this.close(b);clearTimeout(this.closing);if(!1!==this._trigger("search",b))return this._search(a)},_search:function(a){this.pending++;this.element.addClass("ui-autocomplete-loading");this.source({term:a},this._response())},_response:function(){var a=this,b=++c;return function(d){b===c&&a.__response(d);a.pending--;a.pending||a.element.removeClass("ui-autocomplete-loading")}},__response:function(a){!this.options.disabled&&
a&&a.length?(a=this._normalize(a),this._suggest(a),this._trigger("open")):this.close()},close:function(a){clearTimeout(this.closing);this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.deactivate(),this._trigger("close",a))},_change:function(a){this.previous!==this.element.val()&&this._trigger("change",a,{item:this.selectedItem})},_normalize:function(a){return a.length&&a[0].label&&a[0].value?a:d.map(a,function(a){return"string"===typeof a?{label:a,value:a}:d.extend({label:a.label||
a.value,value:a.value||a.label},a)})},_suggest:function(a){var b=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(b,a);this.menu.deactivate();this.menu.refresh();b.show();this._resizeMenu();b.position(d.extend({of:this.element},this.options.position));this.options.autoFocus&&this.menu.next(new d.Event("mouseover"))},_resizeMenu:function(){var a=this.menu.element;a.outerWidth(Math.max(a.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(a,b){var c=
this;d.each(b,function(b,d){c._renderItem(a,d)})},_renderItem:function(a,b){return d("<li></li>").data("item.autocomplete",b).append(d("<a></a>").text(b.label)).appendTo(a)},_move:function(a,b){if(this.menu.element.is(":visible"))if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a))this.element.val(this.term),this.menu.deactivate();else this.menu[a](b);else this.search(null,b)},widget:function(){return this.menu.element},_keyEvent:function(a,b){if(!this.isMultiLine||this.menu.element.is(":visible"))this._move(a,
b),b.preventDefault()}});d.extend(d.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(a,b){var c=RegExp(d.ui.autocomplete.escapeRegex(b),"i");return d.grep(a,function(a){return c.test(a.label||a.value||a)})}})})(jQuery);
(function(d){d.widget("ui.menu",{_create:function(){var c=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(a){d(a.target).closest(".ui-menu-item a").length&&(a.preventDefault(),c.select(a))});this.refresh()},refresh:function(){var c=this;this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem").children("a").addClass("ui-corner-all").attr("tabindex",
-1).mouseenter(function(a){c.activate(a,d(this).parent())}).mouseleave(function(){c.deactivate()})},activate:function(c,a){this.deactivate();if(this.hasScroll()){var b=a.offset().top-this.element.offset().top,d=this.element.scrollTop(),g=this.element.height();0>b?this.element.scrollTop(d+b):b>=g&&this.element.scrollTop(d+b-g+a.height())}this.active=a.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",c,{item:a})},deactivate:function(){this.active&&
(this.active.children("a").removeClass("ui-state-hover").removeAttr("id"),this._trigger("blur"),this.active=null)},next:function(c){this.move("next",".ui-menu-item:first",c)},previous:function(c){this.move("prev",".ui-menu-item:last",c)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(c,a,b){this.active?(c=this.active[c+"All"](".ui-menu-item").eq(0),c.length?this.activate(b,
c):this.activate(b,this.element.children(a))):this.activate(b,this.element.children(a))},nextPage:function(c){if(this.hasScroll())if(!this.active||this.last())this.activate(c,this.element.children(".ui-menu-item:first"));else{var a=this.active.offset().top,b=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var c=d(this).offset().top-a-b+d(this).height();return 10>c&&-10<c});e.length||(e=this.element.children(".ui-menu-item:last"));this.activate(c,e)}else this.activate(c,
this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(c){if(this.hasScroll())if(!this.active||this.first())this.activate(c,this.element.children(".ui-menu-item:last"));else{var a=this.active.offset().top,b=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var c=d(this).offset().top-a+b-d(this).height();return 10>c&&-10<c});e.length||(e=this.element.children(".ui-menu-item:first"));this.activate(c,e)}else this.activate(c,
this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()<this.element[d.fn.prop?"prop":"attr"]("scrollHeight")},select:function(c){this._trigger("selected",c,{item:this.active})}})})(jQuery);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.auiplugin:jquery-ui-widgets', location = 'node_modules/@atlassian/aui/src/js-vendor/jquery/jquery-ui/jquery.ui.button.js' */
(function(b){var g,h,i,e,k=function(){var a=b(this).find(":ui-button");setTimeout(function(){a.button("refresh")},1)},j=function(a){var c=a.name,d=a.form,f=b([]);c&&(f=d?b(d).find("[name='"+c+"']"):b("[name='"+c+"']",a.ownerDocument).filter(function(){return!this.form}));return f};b.widget("ui.button",{options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",k);"boolean"!==typeof this.options.disabled?
this.options.disabled=!!this.element.propAttr("disabled"):this.element.propAttr("disabled",this.options.disabled);this._determineButtonType();this.hasTitle=!!this.buttonElement.attr("title");var a=this,c=this.options,d="checkbox"===this.type||"radio"===this.type,f="ui-state-hover"+(!d?" ui-state-active":"");null===c.label&&(c.label=this.buttonElement.html());this.buttonElement.addClass("ui-button ui-widget ui-state-default ui-corner-all").attr("role","button").bind("mouseenter.button",function(){if(!c.disabled){b(this).addClass("ui-state-hover");
this===g&&b(this).addClass("ui-state-active")}}).bind("mouseleave.button",function(){c.disabled||b(this).removeClass(f)}).bind("click.button",function(a){if(c.disabled){a.preventDefault();a.stopImmediatePropagation()}});this.element.bind("focus.button",function(){a.buttonElement.addClass("ui-state-focus")}).bind("blur.button",function(){a.buttonElement.removeClass("ui-state-focus")});d&&(this.element.bind("change.button",function(){e||a.refresh()}),this.buttonElement.bind("mousedown.button",function(a){if(!c.disabled){e=
false;h=a.pageX;i=a.pageY}}).bind("mouseup.button",function(a){if(!c.disabled&&(h!==a.pageX||i!==a.pageY))e=true}));"checkbox"===this.type?this.buttonElement.bind("click.button",function(){if(c.disabled||e)return false;b(this).toggleClass("ui-state-active");a.buttonElement.attr("aria-pressed",a.element[0].checked)}):"radio"===this.type?this.buttonElement.bind("click.button",function(){if(c.disabled||e)return false;b(this).addClass("ui-state-active");a.buttonElement.attr("aria-pressed","true");var d=
a.element[0];j(d).not(d).map(function(){return b(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown.button",function(){if(c.disabled)return false;b(this).addClass("ui-state-active");g=this;b(document).one("mouseup",function(){g=null})}).bind("mouseup.button",function(){if(c.disabled)return false;b(this).removeClass("ui-state-active")}).bind("keydown.button",function(a){if(c.disabled)return false;(a.keyCode==b.ui.keyCode.SPACE||
a.keyCode==b.ui.keyCode.ENTER)&&b(this).addClass("ui-state-active")}).bind("keyup.button",function(){b(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(a){a.keyCode===b.ui.keyCode.SPACE&&b(this).click()}));this._setOption("disabled",c.disabled);this._resetButton()},_determineButtonType:function(){this.type=this.element.is(":checkbox")?"checkbox":this.element.is(":radio")?"radio":this.element.is("input")?"input":"button";if("checkbox"===this.type||
"radio"===this.type){var a=this.element.parents().filter(":last"),b="label[for='"+this.element.attr("id")+"']";this.buttonElement=a.find(b);this.buttonElement.length||(a=a.length?a.siblings():this.element.siblings(),this.buttonElement=a.filter(b),this.buttonElement.length||(this.buttonElement=a.find(b)));this.element.addClass("ui-helper-hidden-accessible");(a=this.element.is(":checked"))&&this.buttonElement.addClass("ui-state-active");this.buttonElement.attr("aria-pressed",a)}else this.buttonElement=
this.element},widget:function(){return this.buttonElement},destroy:function(){this.element.removeClass("ui-helper-hidden-accessible");this.buttonElement.removeClass("ui-button ui-widget ui-state-default ui-corner-all ui-state-hover ui-state-active  ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only").removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html());this.hasTitle||
this.buttonElement.removeAttr("title");b.Widget.prototype.destroy.call(this)},_setOption:function(a,c){b.Widget.prototype._setOption.apply(this,arguments);"disabled"===a?c?this.element.propAttr("disabled",!0):this.element.propAttr("disabled",!1):this._resetButton()},refresh:function(){var a=this.element.is(":disabled");a!==this.options.disabled&&this._setOption("disabled",a);"radio"===this.type?j(this.element[0]).each(function(){b(this).is(":checked")?b(this).button("widget").addClass("ui-state-active").attr("aria-pressed",
"true"):b(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):"checkbox"===this.type&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if("input"===this.type)this.options.label&&this.element.val(this.options.label);else{var a=this.buttonElement.removeClass("ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only"),
c=b("<span></span>",this.element[0].ownerDocument).addClass("ui-button-text").html(this.options.label).appendTo(a.empty()).text(),d=this.options.icons,f=d.primary&&d.secondary,e=[];d.primary||d.secondary?(this.options.text&&e.push("ui-button-text-icon"+(f?"s":d.primary?"-primary":"-secondary")),d.primary&&a.prepend("<span class='ui-button-icon-primary ui-icon "+d.primary+"'></span>"),d.secondary&&a.append("<span class='ui-button-icon-secondary ui-icon "+d.secondary+"'></span>"),this.options.text||
(e.push(f?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||a.attr("title",c))):e.push("ui-button-text-only");a.addClass(e.join(" "))}}});b.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(a,c){"disabled"===a&&this.buttons.button("option",a,c);b.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var a="rtl"===
this.element.css("direction");this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return b(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(a?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(a?"ui-corner-left":"ui-corner-right").end().end()},destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return b(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy");
b.Widget.prototype.destroy.call(this)}})})(jQuery);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.auiplugin:jquery-ui-widgets', location = 'node_modules/@atlassian/aui/src/js-vendor/jquery/jquery-ui/jquery.ui.dialog.js' */
(function(c){var i={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},j={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0};c.widget("ui.dialog",{options:{autoOpen:!0,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",collision:"fit",using:function(a){var b=c(this).css(a).offset().top;0>b&&c(this).css("top",a.top-b)}},resizable:!0,
show:null,stack:!0,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");"string"!==typeof this.originalTitle&&(this.originalTitle="");this.options.title=this.options.title||this.originalTitle;var a=this,b=a.options,d=b.title||"&#160;",e=c.ui.dialog.getTitleId(a.element),f=(a.uiDialog=c("<div></div>")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b.dialogClass).css({zIndex:b.zIndex}).attr("tabIndex",-1).css("outline",
0).keydown(function(d){if(b.closeOnEscape&&!d.isDefaultPrevented()&&d.keyCode&&d.keyCode===c.ui.keyCode.ESCAPE){a.close(d);d.preventDefault()}}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(b){a.moveToTop(false,b)});a.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(f);var h=(a.uiDialogTitlebar=c("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(f),g=c('<a href="#"></a>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role",
"button").hover(function(){g.addClass("ui-state-hover")},function(){g.removeClass("ui-state-hover")}).focus(function(){g.addClass("ui-state-focus")}).blur(function(){g.removeClass("ui-state-focus")}).click(function(b){a.close(b);return false}).appendTo(h);(a.uiDialogTitlebarCloseText=c("<span></span>")).addClass("ui-icon ui-icon-closethick").text(b.closeText).appendTo(g);c("<span></span>").addClass("ui-dialog-title").attr("id",e).html(d).prependTo(h);c.isFunction(b.beforeclose)&&!c.isFunction(b.beforeClose)&&
(b.beforeClose=b.beforeclose);h.find("*").add(h).disableSelection();b.draggable&&c.fn.draggable&&a._makeDraggable();b.resizable&&c.fn.resizable&&a._makeResizable();a._createButtons(b.buttons);a._isOpen=!1;c.fn.bgiframe&&f.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){this.overlay&&this.overlay.destroy();this.uiDialog.hide();this.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");this.uiDialog.remove();
this.originalTitle&&this.element.attr("title",this.originalTitle);return this},widget:function(){return this.uiDialog},close:function(a){var b=this,d,e;if(!1!==b._trigger("beforeClose",a))return b.overlay&&b.overlay.destroy(),b.uiDialog.unbind("keypress.ui-dialog"),b._isOpen=!1,b.options.hide?b.uiDialog.hide(b.options.hide,function(){b._trigger("close",a)}):(b.uiDialog.hide(),b._trigger("close",a)),c.ui.dialog.overlay.resize(),b.options.modal&&(d=0,c(".ui-dialog").each(function(){if(this!==b.uiDialog[0]){e=
c(this).css("z-index");isNaN(e)||(d=Math.max(d,e))}}),c.ui.dialog.maxZ=d),b},isOpen:function(){return this._isOpen},moveToTop:function(a,b){var d=this.options;if(d.modal&&!a||!d.stack&&!d.modal)return this._trigger("focus",b);d.zIndex>c.ui.dialog.maxZ&&(c.ui.dialog.maxZ=d.zIndex);this.overlay&&(c.ui.dialog.maxZ+=1,this.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=c.ui.dialog.maxZ));d={scrollTop:this.element.scrollTop(),scrollLeft:this.element.scrollLeft()};c.ui.dialog.maxZ+=1;this.uiDialog.css("z-index",
c.ui.dialog.maxZ);this.element.attr(d);this._trigger("focus",b);return this},open:function(){if(!this._isOpen){var a=this.options,b=this.uiDialog;this.overlay=a.modal?new c.ui.dialog.overlay(this):null;this._size();this._position(a.position);b.show(a.show);this.moveToTop(!0);a.modal&&b.bind("keydown.ui-dialog",function(a){if(a.keyCode===c.ui.keyCode.TAB){var b=c(":tabbable",this),f=b.filter(":first"),b=b.filter(":last");if(a.target===b[0]&&!a.shiftKey)return f.focus(1),!1;if(a.target===f[0]&&a.shiftKey)return b.focus(1),
!1}});c(this.element.find(":tabbable").get().concat(b.find(".ui-dialog-buttonpane :tabbable").get().concat(b.get()))).eq(0).focus();this._isOpen=!0;this._trigger("open");return this}},_createButtons:function(a){var b=this,d=!1,e=c("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),f=c("<div></div>").addClass("ui-dialog-buttonset").appendTo(e);b.uiDialog.find(".ui-dialog-buttonpane").remove();"object"===typeof a&&null!==a&&c.each(a,function(){return!(d=!0)});d&&(c.each(a,
function(a,d){var d=c.isFunction(d)?{click:d,text:a}:d,e=c('<button type="button"></button>').click(function(){d.click.apply(b.element[0],arguments)}).appendTo(f);c.each(d,function(a,b){if("click"!==a)if(a in e)e[a](b);else e.attr(a,b)});c.fn.button&&e.button()}),e.appendTo(b.uiDialog))},_makeDraggable:function(){function a(a){return{position:a.position,offset:a.offset}}var b=this,d=b.options,e=c(document),f;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",
containment:"document",start:function(e,g){f="auto"===d.height?"auto":c(this).height();c(this).height(c(this).height()).addClass("ui-dialog-dragging");b._trigger("dragStart",e,a(g))},drag:function(c,d){b._trigger("drag",c,a(d))},stop:function(h,g){d.position=[g.position.left-e.scrollLeft(),g.position.top-e.scrollTop()];c(this).removeClass("ui-dialog-dragging").height(f);b._trigger("dragStop",h,a(g));c.ui.dialog.overlay.resize()}})},_makeResizable:function(a){function b(a){return{originalPosition:a.originalPosition,
originalSize:a.originalSize,position:a.position,size:a.size}}var a=void 0===a?this.options.resizable:a,d=this,e=d.options,f=d.uiDialog.css("position"),a="string"===typeof a?a:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:a,start:function(a,e){c(this).addClass("ui-dialog-resizing");d._trigger("resizeStart",a,b(e))},resize:function(a,c){d._trigger("resize",
a,b(c))},stop:function(a,f){c(this).removeClass("ui-dialog-resizing");e.height=c(this).height();e.width=c(this).width();d._trigger("resizeStop",a,b(f));c.ui.dialog.overlay.resize()}}).css("position",f).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return"auto"===a.height?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(a){var b=[],d=[0,0],e;if(a){if("string"===typeof a||"object"===typeof a&&"0"in a)b=a.split?a.split(" "):
[a[0],a[1]],1===b.length&&(b[1]=b[0]),c.each(["left","top"],function(a,c){+b[a]===b[a]&&(d[a]=b[a],b[a]=c)}),a={my:b.join(" "),at:b.join(" "),offset:d.join(" ")};a=c.extend({},c.ui.dialog.prototype.options.position,a)}else a=c.ui.dialog.prototype.options.position;(e=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position(c.extend({of:window},a));e||this.uiDialog.hide()},_setOptions:function(a){var b=this,d={},e=!1;c.each(a,function(a,c){b._setOption(a,c);a in
i&&(e=!0);a in j&&(d[a]=c)});e&&this._size();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",d)},_setOption:function(a,b){var d=this.uiDialog;switch(a){case "beforeclose":a="beforeClose";break;case "buttons":this._createButtons(b);break;case "closeText":this.uiDialogTitlebarCloseText.text(""+b);break;case "dialogClass":d.removeClass(this.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b);break;case "disabled":b?d.addClass("ui-dialog-disabled"):
d.removeClass("ui-dialog-disabled");break;case "draggable":var e=d.is(":data(draggable)");e&&!b&&d.draggable("destroy");!e&&b&&this._makeDraggable();break;case "position":this._position(b);break;case "resizable":(e=d.is(":data(resizable)"))&&!b&&d.resizable("destroy");e&&"string"===typeof b&&d.resizable("option","handles",b);!e&&!1!==b&&this._makeResizable(b);break;case "title":c(".ui-dialog-title",this.uiDialogTitlebar).html(""+(b||"&#160;"))}c.Widget.prototype._setOption.apply(this,arguments)},
_size:function(){var a=this.options,b,d,e=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0});a.minWidth>a.width&&(a.width=a.minWidth);b=this.uiDialog.css({height:"auto",width:a.width}).height();d=Math.max(0,a.minHeight-b);"auto"===a.height?c.support.minHeight?this.element.css({minHeight:d,height:"auto"}):(this.uiDialog.show(),a=this.element.css("height","auto").height(),e||this.uiDialog.hide(),this.element.height(Math.max(a,d))):this.element.height(Math.max(a.height-
b,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}});c.extend(c.ui.dialog,{version:"1.8.24",uuid:0,maxZ:0,getTitleId:function(a){a=a.attr("id");a||(a=this.uuid+=1);return"ui-dialog-title-"+a},overlay:function(a){this.$el=c.ui.dialog.overlay.create(a)}});c.extend(c.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:c.map("focus mousedown mouseup keydown keypress click".split(" "),function(a){return a+".dialog-overlay"}).join(" "),
create:function(a){0===this.instances.length&&(setTimeout(function(){c.ui.dialog.overlay.instances.length&&c(document).bind(c.ui.dialog.overlay.events,function(a){if(c(a.target).zIndex()<c.ui.dialog.overlay.maxZ)return!1})},1),c(document).bind("keydown.dialog-overlay",function(b){a.options.closeOnEscape&&(!b.isDefaultPrevented()&&b.keyCode&&b.keyCode===c.ui.keyCode.ESCAPE)&&(a.close(b),b.preventDefault())}),c(window).bind("resize.dialog-overlay",c.ui.dialog.overlay.resize));var b=(this.oldInstances.pop()||
c("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});c.fn.bgiframe&&b.bgiframe();this.instances.push(b);return b},destroy:function(a){var b=c.inArray(a,this.instances);-1!=b&&this.oldInstances.push(this.instances.splice(b,1)[0]);0===this.instances.length&&c([document,window]).unbind(".dialog-overlay");a.remove();var d=0;c.each(this.instances,function(){d=Math.max(d,this.css("z-index"))});this.maxZ=d},height:function(){var a,b;return c.browser.msie&&
7>c.browser.version?(a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),b=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight),a<b?c(window).height()+"px":a+"px"):c(document).height()+"px"},width:function(){var a,b;return c.browser.msie?(a=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),b=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth),a<b?c(window).width()+"px":a+"px"):c(document).width()+"px"},resize:function(){var a=
c([]);c.each(c.ui.dialog.overlay.instances,function(){a=a.add(this)});a.css({width:0,height:0}).css({width:c.ui.dialog.overlay.width(),height:c.ui.dialog.overlay.height()})}});c.extend(c.ui.dialog.overlay.prototype,{destroy:function(){c.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.auiplugin:jquery-ui-widgets', location = 'node_modules/@atlassian/aui/src/js-vendor/jquery/jquery-ui/jquery.ui.progressbar.js' */
(function(b){b.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()});this.valueDiv=b("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element);this.oldValue=this._value();this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow");
this.valueDiv.remove();b.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(void 0===a)return this._value();this._setOption("value",a);return this},_setOption:function(a,c){"value"===a&&(this.options.value=c,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete"));b.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;"number"!==typeof a&&(a=0);return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100*
this._value()/this.options.max},_refreshValue:function(){var a=this.value(),b=this._percentage();this.oldValue!==a&&(this.oldValue=a,this._trigger("change"));this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(b.toFixed(0)+"%");this.element.attr("aria-valuenow",a)}});b.extend(b.ui.progressbar,{version:"1.8.24"})})(jQuery);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.auiplugin:jquery-ui-widgets', location = 'node_modules/@atlassian/aui/src/js-vendor/jquery/jquery-ui/jquery.ui.slider.js' */
(function(d){d.widget("ui.slider",d.ui.mouse,{widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var a=this,b=this.options,c=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f=b.values&&b.values.length||1,e=[];this._mouseSliding=this._keySliding=!1;this._animateOff=!0;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+
this.orientation+" ui-widget ui-widget-content ui-corner-all"+(b.disabled?" ui-slider-disabled ui-disabled":""));this.range=d([]);if(b.range){if(!0===b.range&&(b.values||(b.values=[this._valueMin(),this._valueMin()]),b.values.length&&2!==b.values.length))b.values=[b.values[0],b.values[0]];this.range=d("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+("min"===b.range||"max"===b.range?" ui-slider-range-"+b.range:""))}for(var g=c.length;g<f;g+=1)e.push("<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>");
this.handles=c.add(d(e.join("")).appendTo(a.element));this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(a){a.preventDefault()}).hover(function(){b.disabled||d(this).addClass("ui-state-hover")},function(){d(this).removeClass("ui-state-hover")}).focus(function(){b.disabled?d(this).blur():(d(".ui-slider .ui-state-focus").removeClass("ui-state-focus"),d(this).addClass("ui-state-focus"))}).blur(function(){d(this).removeClass("ui-state-focus")});this.handles.each(function(a){d(this).data("index.ui-slider-handle",
a)});this.handles.keydown(function(b){var c=d(this).data("index.ui-slider-handle"),e,f,g;if(!a.options.disabled){switch(b.keyCode){case d.ui.keyCode.HOME:case d.ui.keyCode.END:case d.ui.keyCode.PAGE_UP:case d.ui.keyCode.PAGE_DOWN:case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(b.preventDefault(),!a._keySliding&&(a._keySliding=!0,d(this).addClass("ui-state-active"),e=a._start(b,c),!1===e))return}g=a.options.step;e=a.options.values&&a.options.values.length?
f=a.values(c):f=a.value();switch(b.keyCode){case d.ui.keyCode.HOME:f=a._valueMin();break;case d.ui.keyCode.END:f=a._valueMax();break;case d.ui.keyCode.PAGE_UP:f=a._trimAlignValue(e+(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.PAGE_DOWN:f=a._trimAlignValue(e-(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:if(e===a._valueMax())return;f=a._trimAlignValue(e+g);break;case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(e===a._valueMin())return;f=a._trimAlignValue(e-
g)}a._slide(b,c,f)}}).keyup(function(b){var c=d(this).data("index.ui-slider-handle");a._keySliding&&(a._keySliding=!1,a._stop(b,c),a._change(b,c),d(this).removeClass("ui-state-active"))});this._refreshValue();this._animateOff=!1},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy();return this},
_mouseCapture:function(a){var b=this.options,c,f,e,g,h;if(b.disabled)return!1;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();c=this._normValueFromMouse({x:a.pageX,y:a.pageY});f=this._valueMax()-this._valueMin()+1;g=this;this.handles.each(function(b){var a=Math.abs(c-g.values(b));f>a&&(f=a,e=d(this),h=b)});!0===b.range&&this.values(1)===b.min&&(h+=1,e=d(this.handles[h]));if(!1===this._start(a,h))return!1;this._mouseSliding=
!0;g._handleIndex=h;e.addClass("ui-state-active").focus();b=e.offset();this._clickOffset=!d(a.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:a.pageX-b.left-e.width()/2,top:a.pageY-b.top-e.height()/2-(parseInt(e.css("borderTopWidth"),10)||0)-(parseInt(e.css("borderBottomWidth"),10)||0)+(parseInt(e.css("marginTop"),10)||0)};this.handles.hasClass("ui-state-hover")||this._slide(a,h,c);return this._animateOff=!0},_mouseStart:function(){return!0},_mouseDrag:function(a){var b=this._normValueFromMouse({x:a.pageX,
y:a.pageY});this._slide(a,this._handleIndex,b);return!1},_mouseStop:function(a){this.handles.removeClass("ui-state-active");this._mouseSliding=!1;this._stop(a,this._handleIndex);this._change(a,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(a){var b;"horizontal"===this.orientation?(b=this.elementSize.width,a=a.x-this.elementOffset.left-
(this._clickOffset?this._clickOffset.left:0)):(b=this.elementSize.height,a=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0));b=a/b;1<b&&(b=1);0>b&&(b=0);"vertical"===this.orientation&&(b=1-b);a=this._valueMax()-this._valueMin();b=this._valueMin()+b*a;return this._trimAlignValue(b)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values());return this._trigger("start",
a,c)},_slide:function(a,b,c){var d;if(this.options.values&&this.options.values.length){d=this.values(b?0:1);if(2===this.options.values.length&&!0===this.options.range&&(0===b&&c>d||1===b&&c<d))c=d;c!==this.values(b)&&(d=this.values(),d[b]=c,a=this._trigger("slide",a,{handle:this.handles[b],value:c,values:d}),this.values(b?0:1),!1!==a&&this.values(b,c,!0))}else c!==this.value()&&(a=this._trigger("slide",a,{handle:this.handles[b],value:c}),!1!==a&&this.value(c))},_stop:function(a,b){var c={handle:this.handles[b],
value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values());this._trigger("stop",a,c)},_change:function(a,b){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values());this._trigger("change",a,c)}},value:function(a){if(arguments.length)this.options.value=this._trimAlignValue(a),this._refreshValue(),this._change(null,
0);else return this._value()},values:function(a,b){var c,f,e;if(1<arguments.length)this.options.values[a]=this._trimAlignValue(b),this._refreshValue(),this._change(null,a);else if(arguments.length)if(d.isArray(arguments[0])){c=this.options.values;f=arguments[0];for(e=0;e<c.length;e+=1)c[e]=this._trimAlignValue(f[e]),this._change(null,e);this._refreshValue()}else return this.options.values&&this.options.values.length?this._values(a):this.value();else return this._values()},_setOption:function(a,b){var c,
f=0;d.isArray(this.options.values)&&(f=this.options.values.length);d.Widget.prototype._setOption.apply(this,arguments);switch(a){case "disabled":b?(this.handles.filter(".ui-state-focus").blur(),this.handles.removeClass("ui-state-hover"),this.handles.propAttr("disabled",!0),this.element.addClass("ui-disabled")):(this.handles.propAttr("disabled",!1),this.element.removeClass("ui-disabled"));break;case "orientation":this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+
this.orientation);this._refreshValue();break;case "value":this._animateOff=!0;this._refreshValue();this._change(null,0);this._animateOff=!1;break;case "values":this._animateOff=!0;this._refreshValue();for(c=0;c<f;c+=1)this._change(null,c);this._animateOff=!1}},_value:function(){var a=this.options.value;return a=this._trimAlignValue(a)},_values:function(a){var b,c;if(arguments.length)return b=this.options.values[a],b=this._trimAlignValue(b);b=this.options.values.slice();for(c=0;c<b.length;c+=1)b[c]=
this._trimAlignValue(b[c]);return b},_trimAlignValue:function(a){if(a<=this._valueMin())return this._valueMin();if(a>=this._valueMax())return this._valueMax();var b=0<this.options.step?this.options.step:1,c=(a-this._valueMin())%b,a=a-c;2*Math.abs(c)>=b&&(a+=0<c?b:-b);return parseFloat(a.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var a=this.options.range,b=this.options,c=this,f=!this._animateOff?b.animate:!1,e,g=
{},h,k,i,j;if(this.options.values&&this.options.values.length)this.handles.each(function(a){e=100*((c.values(a)-c._valueMin())/(c._valueMax()-c._valueMin()));g["horizontal"===c.orientation?"left":"bottom"]=e+"%";d(this).stop(1,1)[f?"animate":"css"](g,b.animate);if(!0===c.options.range)if("horizontal"===c.orientation){if(0===a)c.range.stop(1,1)[f?"animate":"css"]({left:e+"%"},b.animate);if(1===a)c.range[f?"animate":"css"]({width:e-h+"%"},{queue:!1,duration:b.animate})}else{if(0===a)c.range.stop(1,
1)[f?"animate":"css"]({bottom:e+"%"},b.animate);if(1===a)c.range[f?"animate":"css"]({height:e-h+"%"},{queue:!1,duration:b.animate})}h=e});else{k=this.value();i=this._valueMin();j=this._valueMax();e=j!==i?100*((k-i)/(j-i)):0;g["horizontal"===c.orientation?"left":"bottom"]=e+"%";this.handle.stop(1,1)[f?"animate":"css"](g,b.animate);if("min"===a&&"horizontal"===this.orientation)this.range.stop(1,1)[f?"animate":"css"]({width:e+"%"},b.animate);if("max"===a&&"horizontal"===this.orientation)this.range[f?
"animate":"css"]({width:100-e+"%"},{queue:!1,duration:b.animate});if("min"===a&&"vertical"===this.orientation)this.range.stop(1,1)[f?"animate":"css"]({height:e+"%"},b.animate);if("max"===a&&"vertical"===this.orientation)this.range[f?"animate":"css"]({height:100-e+"%"},{queue:!1,duration:b.animate})}}});d.extend(d.ui.slider,{version:"1.8.24"})})(jQuery);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.auiplugin:jquery-ui-widgets', location = 'node_modules/@atlassian/aui/src/js-vendor/jquery/jquery-ui/jquery.ui.tabs.js' */
(function(d){var n=0,o=0;d.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:!1,cookie:null,collapsible:!1,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"<div></div>",remove:null,select:null,show:null,spinner:"<em>Loading&#8230;</em>",tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},_create:function(){this._tabify(!0)},_setOption:function(a,d){"selected"==a?this.options.collapsible&&d==this.options.selected||this.select(d):
(this.options[a]=d,this._tabify())},_tabId:function(a){return a.title&&a.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+ ++n},_sanitizeSelector:function(a){return a.replace(/:/g,"\\:")},_cookie:function(){var a=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+ ++o);return d.cookie.apply(null,[a].concat(d.makeArray(arguments)))},_ui:function(a,d){return{tab:a,panel:d,index:this.anchors.index(a)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var a=
d(this);a.html(a.data("label.tabs")).removeData("label.tabs")})},_tabify:function(a){function e(b,a){b.css("display","");!d.support.opacity&&a.opacity&&b[0].style.removeAttribute("filter")}var b=this,c=this.options,g=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=d(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return d("a",this)[0]});this.panels=d([]);this.anchors.each(function(a,e){var h=d(e).attr("href"),f=h.split("#")[0],k;if(f&&(f===location.toString().split("#")[0]||
(k=d("base")[0])&&f===k.href))h=e.hash,e.href=h;g.test(h)?b.panels=b.panels.add(b.element.find(b._sanitizeSelector(h))):h&&"#"!==h?(d.data(e,"href.tabs",h),d.data(e,"load.tabs",h.replace(/#.*$/,"")),h=b._tabId(e),e.href="#"+h,f=b.element.find("#"+h),f.length||(f=d(c.panelTemplate).attr("id",h).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(b.panels[a-1]||b.list),f.data("destroy.tabs",!0)),b.panels=b.panels.add(f)):c.disabled.push(a)});a?(this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"),
this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.lis.addClass("ui-state-default ui-corner-top"),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom"),void 0===c.selected?(location.hash&&this.anchors.each(function(b,a){if(a.hash==location.hash)return c.selected=b,!1}),"number"!==typeof c.selected&&c.cookie&&(c.selected=parseInt(b._cookie(),10)),"number"!==typeof c.selected&&this.lis.filter(".ui-tabs-selected").length&&(c.selected=
this.lis.index(this.lis.filter(".ui-tabs-selected"))),c.selected=c.selected||(this.lis.length?0:-1)):null===c.selected&&(c.selected=-1),c.selected=0<=c.selected&&this.anchors[c.selected]||0>c.selected?c.selected:0,c.disabled=d.unique(c.disabled.concat(d.map(this.lis.filter(".ui-state-disabled"),function(a){return b.lis.index(a)}))).sort(),-1!=d.inArray(c.selected,c.disabled)&&c.disabled.splice(d.inArray(c.selected,c.disabled),1),this.panels.addClass("ui-tabs-hide"),this.lis.removeClass("ui-tabs-selected ui-state-active"),
0<=c.selected&&this.anchors.length&&(b.element.find(b._sanitizeSelector(b.anchors[c.selected].hash)).removeClass("ui-tabs-hide"),this.lis.eq(c.selected).addClass("ui-tabs-selected ui-state-active"),b.element.queue("tabs",function(){b._trigger("show",null,b._ui(b.anchors[c.selected],b.element.find(b._sanitizeSelector(b.anchors[c.selected].hash))[0]))}),this.load(c.selected)),d(window).bind("unload",function(){b.lis.add(b.anchors).unbind(".tabs");b.lis=b.anchors=b.panels=null})):c.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"));
this.element[c.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");c.cookie&&this._cookie(c.selected,c.cookie);for(var a=0,f;f=this.lis[a];a++)d(f)[-1!=d.inArray(a,c.disabled)&&!d(f).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");!1===c.cache&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if("mouseover"!==c.event){var k=function(b,a){a.is(":not(.ui-state-disabled)")&&a.addClass("ui-state-"+b)};this.lis.bind("mouseover.tabs",
function(){k("hover",d(this))});this.lis.bind("mouseout.tabs",function(){d(this).removeClass("ui-state-hover")});this.anchors.bind("focus.tabs",function(){k("focus",d(this).closest("li"))});this.anchors.bind("blur.tabs",function(){d(this).closest("li").removeClass("ui-state-focus")})}var j,i;c.fx&&(d.isArray(c.fx)?(j=c.fx[0],i=c.fx[1]):j=i=c.fx);var l=i?function(a,c){d(a).closest("li").addClass("ui-tabs-selected ui-state-active");c.hide().removeClass("ui-tabs-hide").animate(i,i.duration||"normal",
function(){e(c,i);b._trigger("show",null,b._ui(a,c[0]))})}:function(a,c){d(a).closest("li").addClass("ui-tabs-selected ui-state-active");c.removeClass("ui-tabs-hide");b._trigger("show",null,b._ui(a,c[0]))},m=j?function(a,c){c.animate(j,j.duration||"normal",function(){b.lis.removeClass("ui-tabs-selected ui-state-active");c.addClass("ui-tabs-hide");e(c,j);b.element.dequeue("tabs")})}:function(a,c){b.lis.removeClass("ui-tabs-selected ui-state-active");c.addClass("ui-tabs-hide");b.element.dequeue("tabs")};
this.anchors.bind(c.event+".tabs",function(){var a=this,e=d(a).closest("li"),f=b.panels.filter(":not(.ui-tabs-hide)"),g=b.element.find(b._sanitizeSelector(a.hash));if(e.hasClass("ui-tabs-selected")&&!c.collapsible||e.hasClass("ui-state-disabled")||e.hasClass("ui-state-processing")||b.panels.filter(":animated").length||b._trigger("select",null,b._ui(this,g[0]))===false){this.blur();return false}c.selected=b.anchors.index(this);b.abort();if(c.collapsible){if(e.hasClass("ui-tabs-selected")){c.selected=
-1;c.cookie&&b._cookie(c.selected,c.cookie);b.element.queue("tabs",function(){m(a,f)}).dequeue("tabs");this.blur();return false}if(!f.length){c.cookie&&b._cookie(c.selected,c.cookie);b.element.queue("tabs",function(){l(a,g)});b.load(b.anchors.index(this));this.blur();return false}}c.cookie&&b._cookie(c.selected,c.cookie);if(g.length){f.length&&b.element.queue("tabs",function(){m(a,f)});b.element.queue("tabs",function(){l(a,g)});b.load(b.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier.";
d.browser.msie&&this.blur()});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(a){"string"==typeof a&&(a=this.anchors.index(this.anchors.filter("[href$='"+a+"']")));return a},destroy:function(){var a=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var a=
d.data(this,"href.tabs");a&&(this.href=a);var b=d(this).unbind(".tabs");d.each(["href","load","cache"],function(a,d){b.removeData(d+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){d.data(this,"destroy.tabs")?d(this).remove():d(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")});a.cookie&&this._cookie(null,a.cookie);return this},add:function(a,
e,b){void 0===b&&(b=this.anchors.length);var c=this,g=this.options,e=d(g.tabTemplate.replace(/#\{href\}/g,a).replace(/#\{label\}/g,e)),a=!a.indexOf("#")?a.replace("#",""):this._tabId(d("a",e)[0]);e.addClass("ui-state-default ui-corner-top").data("destroy.tabs",!0);var f=c.element.find("#"+a);f.length||(f=d(g.panelTemplate).attr("id",a).data("destroy.tabs",!0));f.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");b>=this.lis.length?(e.appendTo(this.list),f.appendTo(this.list[0].parentNode)):
(e.insertBefore(this.lis[b]),f.insertBefore(this.panels[b]));g.disabled=d.map(g.disabled,function(a){return a>=b?++a:a});this._tabify();1==this.anchors.length&&(g.selected=0,e.addClass("ui-tabs-selected ui-state-active"),f.removeClass("ui-tabs-hide"),this.element.queue("tabs",function(){c._trigger("show",null,c._ui(c.anchors[0],c.panels[0]))}),this.load(0));this._trigger("add",null,this._ui(this.anchors[b],this.panels[b]));return this},remove:function(a){var a=this._getIndex(a),e=this.options,b=this.lis.eq(a).remove(),
c=this.panels.eq(a).remove();b.hasClass("ui-tabs-selected")&&1<this.anchors.length&&this.select(a+(a+1<this.anchors.length?1:-1));e.disabled=d.map(d.grep(e.disabled,function(b){return b!=a}),function(b){return b>=a?--b:b});this._tabify();this._trigger("remove",null,this._ui(b.find("a")[0],c[0]));return this},enable:function(a){var a=this._getIndex(a),e=this.options;if(-1!=d.inArray(a,e.disabled))return this.lis.eq(a).removeClass("ui-state-disabled"),e.disabled=d.grep(e.disabled,function(b){return b!=
a}),this._trigger("enable",null,this._ui(this.anchors[a],this.panels[a])),this},disable:function(a){var a=this._getIndex(a),d=this.options;a!=d.selected&&(this.lis.eq(a).addClass("ui-state-disabled"),d.disabled.push(a),d.disabled.sort(),this._trigger("disable",null,this._ui(this.anchors[a],this.panels[a])));return this},select:function(a){a=this._getIndex(a);if(-1==a)if(this.options.collapsible&&-1!=this.options.selected)a=this.options.selected;else return this;this.anchors.eq(a).trigger(this.options.event+
".tabs");return this},load:function(a){var a=this._getIndex(a),e=this,b=this.options,c=this.anchors.eq(a)[0],g=d.data(c,"load.tabs");this.abort();if(!g||0!==this.element.queue("tabs").length&&d.data(c,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(a).addClass("ui-state-processing");if(b.spinner){var f=d("span",c);f.data("label.tabs",f.html()).html(b.spinner)}this.xhr=d.ajax(d.extend({},b.ajaxOptions,{url:g,success:function(f,g){e.element.find(e._sanitizeSelector(c.hash)).html(f);e._cleanup();
b.cache&&d.data(c,"cache.tabs",!0);e._trigger("load",null,e._ui(e.anchors[a],e.panels[a]));try{b.ajaxOptions.success(f,g)}catch(i){}},error:function(d,f){e._cleanup();e._trigger("load",null,e._ui(e.anchors[a],e.panels[a]));try{b.ajaxOptions.error(d,f,a,c)}catch(g){}}}));e.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]);this.panels.stop(!1,!0);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));this.xhr&&(this.xhr.abort(),delete this.xhr);this._cleanup();
return this},url:function(a,d){this.anchors.eq(a).removeData("cache.tabs").data("load.tabs",d);return this},length:function(){return this.anchors.length}});d.extend(d.ui.tabs,{version:"1.8.24"});d.extend(d.ui.tabs.prototype,{rotation:null,rotate:function(a,d){var b=this,c=this.options,g=b._rotate||(b._rotate=function(d){clearTimeout(b.rotation);b.rotation=setTimeout(function(){var a=c.selected;b.select(++a<b.anchors.length?a:0)},a);d&&d.stopPropagation()}),f=b._unrotate||(b._unrotate=!d?function(a){a.clientX&&
b.rotate(null)}:function(){g()});a?(this.element.bind("tabsshow",g),this.anchors.bind(c.event+".tabs",f),g()):(clearTimeout(b.rotation),this.element.unbind("tabsshow",g),this.anchors.unbind(c.event+".tabs",f),delete this._rotate,delete this._unrotate);return this}})})(jQuery);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.auiplugin:jquery-effects', location = 'node_modules/@atlassian/aui/src/js-vendor/jquery/jquery-ui/jquery.effects.core.js' */
jQuery.effects||function(d){function l(a){var b;return a&&a.constructor==Array&&3==a.length?a:(b=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(a))?[parseInt(b[1],10),parseInt(b[2],10),parseInt(b[3],10)]:(b=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(a))?[2.55*parseFloat(b[1]),2.55*parseFloat(b[2]),2.55*parseFloat(b[3])]:(b=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(a))?[parseInt(b[1],16),parseInt(b[2],
16),parseInt(b[3],16)]:(b=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(a))?[parseInt(b[1]+b[1],16),parseInt(b[2]+b[2],16),parseInt(b[3]+b[3],16)]:/rgba\(0, 0, 0, 0\)/.exec(a)?m.transparent:m[d.trim(a).toLowerCase()]}function n(){var a=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,b={},c,d;if(a&&a.length&&a[0]&&a[a[0]])for(var f=a.length;f--;)c=a[f],"string"==typeof a[c]&&(d=c.replace(/\-(\w)/g,function(a,b){return b.toUpperCase()}),b[d]=a[c]);else for(c in a)"string"===
typeof a[c]&&(b[c]=a[c]);return b}function o(a){var b,c;for(b in a)c=a[b],(null==c||d.isFunction(c)||b in q||/scrollbar/.test(b)||!/color/i.test(b)&&isNaN(parseFloat(c)))&&delete a[b];return a}function r(a,b){var c={_:0},d;for(d in b)a[d]!=b[d]&&(c[d]=b[d]);return c}function i(a,b,c,e){"object"==typeof a&&(e=b,c=null,b=a,a=b.effect);d.isFunction(b)&&(e=b,c=null,b={});if("number"==typeof b||d.fx.speeds[b])e=c,c=b,b={};d.isFunction(c)&&(e=c,c=null);b=b||{};c=c||b.duration;c=d.fx.off?0:"number"==typeof c?
c:c in d.fx.speeds?d.fx.speeds[c]:d.fx.speeds._default;e=e||b.complete;return[a,b,c,e]}function j(a){return!a||("number"===typeof a||d.fx.speeds[a])||"string"===typeof a&&!d.effects[a]?!0:!1}d.effects={};d.each("backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor borderColor color outlineColor".split(" "),function(a,b){d.fx.step[b]=function(a){if(!a.colorInit){var e;e=a.elem;var f=b,g;do{g=(d.curCSS||d.css)(e,f);if(g!=""&&g!="transparent"||d.nodeName(e,"body"))break;
f="backgroundColor"}while(e=e.parentNode);e=l(g);a.start=e;a.end=l(a.end);a.colorInit=true}a.elem.style[b]="rgb("+Math.max(Math.min(parseInt(a.pos*(a.end[0]-a.start[0])+a.start[0],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[1]-a.start[1])+a.start[1],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[2]-a.start[2])+a.start[2],10),255),0)+")"}});var m={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,
0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,
255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},p=["add","remove","toggle"],q={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};d.effects.animateClass=function(a,b,c,e){d.isFunction(c)&&(e=c,c=null);return this.queue(function(){var f=
d(this),g=f.attr("style")||" ",h=o(n.call(this)),i,j=f.attr("class")||"";d.each(p,function(b,c){if(a[c])f[c+"Class"](a[c])});i=o(n.call(this));f.attr("class",j);f.animate(r(h,i),{queue:false,duration:b,easing:c,complete:function(){d.each(p,function(b,c){if(a[c])f[c+"Class"](a[c])});if(typeof f.attr("style")=="object"){f.attr("style").cssText="";f.attr("style").cssText=g}else f.attr("style",g);e&&e.apply(this,arguments);d.dequeue(this)}})})};d.fn.extend({_addClass:d.fn.addClass,addClass:function(a,
b,c,e){return b?d.effects.animateClass.apply(this,[{add:a},b,c,e]):this._addClass(a)},_removeClass:d.fn.removeClass,removeClass:function(a,b,c,e){return b?d.effects.animateClass.apply(this,[{remove:a},b,c,e]):this._removeClass(a)},_toggleClass:d.fn.toggleClass,toggleClass:function(a,b,c,e,f){return"boolean"==typeof b||void 0===b?c?d.effects.animateClass.apply(this,[b?{add:a}:{remove:a},c,e,f]):this._toggleClass(a,b):d.effects.animateClass.apply(this,[{toggle:a},b,c,e])},switchClass:function(a,b,c,
e,f){return d.effects.animateClass.apply(this,[{add:b,remove:a},c,e,f])}});d.extend(d.effects,{version:"1.8.24",save:function(a,b){for(var c=0;c<b.length;c++)null!==b[c]&&a.data("ec.storage."+b[c],a[0].style[b[c]])},restore:function(a,b){for(var c=0;c<b.length;c++)null!==b[c]&&a.css(b[c],a.data("ec.storage."+b[c]))},setMode:function(a,b){"toggle"==b&&(b=a.is(":hidden")?"show":"hide");return b},getBaseline:function(a,b){var c,d;switch(a[0]){case "top":c=0;break;case "middle":c=0.5;break;case "bottom":c=
1;break;default:c=a[0]/b.height}switch(a[1]){case "left":d=0;break;case "center":d=0.5;break;case "right":d=1;break;default:d=a[1]/b.width}return{x:d,y:c}},createWrapper:function(a){if(a.parent().is(".ui-effects-wrapper"))return a.parent();var b={width:a.outerWidth(!0),height:a.outerHeight(!0),"float":a.css("float")},c=d("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e=document.activeElement;try{e.id}catch(f){e=document.body}a.wrap(c);
(a[0]===e||d.contains(a[0],e))&&d(e).focus();c=a.parent();"static"==a.css("position")?(c.css({position:"relative"}),a.css({position:"relative"})):(d.extend(b,{position:a.css("position"),zIndex:a.css("z-index")}),d.each(["top","left","bottom","right"],function(c,d){b[d]=a.css(d);isNaN(parseInt(b[d],10))&&(b[d]="auto")}),a.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"}));return c.css(b).show()},removeWrapper:function(a){var b,c=document.activeElement;return a.parent().is(".ui-effects-wrapper")?
(b=a.parent().replaceWith(a),(a[0]===c||d.contains(a[0],c))&&d(c).focus(),b):a},setTransition:function(a,b,c,e){e=e||{};d.each(b,function(b,d){var h=a.cssUnit(d);0<h[0]&&(e[d]=h[0]*c+h[1])});return e}});d.fn.extend({effect:function(a,b,c,e){var f=i.apply(this,arguments),g={options:f[1],duration:f[2],callback:f[3]},f=g.options.mode,h=d.effects[a];return d.fx.off||!h?f?this[f](g.duration,g.callback):this.each(function(){g.callback&&g.callback.call(this)}):h.call(this,g)},_show:d.fn.show,show:function(a){if(j(a))return this._show.apply(this,
arguments);var b=i.apply(this,arguments);b[1].mode="show";return this.effect.apply(this,b)},_hide:d.fn.hide,hide:function(a){if(j(a))return this._hide.apply(this,arguments);var b=i.apply(this,arguments);b[1].mode="hide";return this.effect.apply(this,b)},__toggle:d.fn.toggle,toggle:function(a){if(j(a)||"boolean"===typeof a||d.isFunction(a))return this.__toggle.apply(this,arguments);var b=i.apply(this,arguments);b[1].mode="toggle";return this.effect.apply(this,b)},cssUnit:function(a){var b=this.css(a),
c=[];d.each(["em","px","%","pt"],function(a,d){0<b.indexOf(d)&&(c=[parseFloat(b),d])});return c}});var k={};d.each(["Quad","Cubic","Quart","Quint","Expo"],function(a,b){k[b]=function(b){return Math.pow(b,a+2)}});d.extend(k,{Sine:function(a){return 1-Math.cos(a*Math.PI/2)},Circ:function(a){return 1-Math.sqrt(1-a*a)},Elastic:function(a){return 0===a||1===a?a:-Math.pow(2,8*(a-1))*Math.sin((80*(a-1)-7.5)*Math.PI/15)},Back:function(a){return a*a*(3*a-2)},Bounce:function(a){for(var b,c=4;a<((b=Math.pow(2,
--c))-1)/11;);return 1/Math.pow(4,3-c)-7.5625*Math.pow((3*b-2)/22-a,2)}});d.each(k,function(a,b){d.easing["easeIn"+a]=b;d.easing["easeOut"+a]=function(a){return 1-b(1-a)};d.easing["easeInOut"+a]=function(a){return 0.5>a?b(2*a)/2:b(-2*a+2)/-2+1}})}(jQuery);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.auiplugin:jquery-effects', location = 'node_modules/@atlassian/aui/src/js-vendor/jquery/jquery-ui/jquery.effects.blind.js' */
(function(b){b.effects.blind=function(c){return this.queue(function(){var a=b(this),g=["position","top","bottom","left","right"],f=b.effects.setMode(a,c.options.mode||"hide"),d=c.options.direction||"vertical";b.effects.save(a,g);a.show();var e=b.effects.createWrapper(a).css({overflow:"hidden"}),h="vertical"==d?"height":"width",d="vertical"==d?e.height():e.width();"show"==f&&e.css(h,0);var i={};i[h]="show"==f?d:0;e.animate(i,c.duration,c.options.easing,function(){"hide"==f&&a.hide();b.effects.restore(a,
g);b.effects.removeWrapper(a);c.callback&&c.callback.apply(a[0],arguments);a.dequeue()})})}})(jQuery);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.auiplugin:jquery-effects', location = 'node_modules/@atlassian/aui/src/js-vendor/jquery/jquery-ui/jquery.effects.bounce.js' */
(function(e){e.effects.bounce=function(b){return this.queue(function(){var a=e(this),l=["position","top","bottom","left","right"],h=e.effects.setMode(a,b.options.mode||"effect"),d=b.options.direction||"up",c=b.options.distance||20,m=b.options.times||5,i=b.duration||250;/show|hide/.test(h)&&l.push("opacity");e.effects.save(a,l);a.show();e.effects.createWrapper(a);var f="up"==d||"down"==d?"top":"left",d="up"==d||"left"==d?"pos":"neg",c=b.options.distance||("top"==f?a.outerHeight(!0)/3:a.outerWidth(!0)/
3);"show"==h&&a.css("opacity",0).css(f,"pos"==d?-c:c);"hide"==h&&(c/=2*m);"hide"!=h&&m--;if("show"==h){var g={opacity:1};g[f]=("pos"==d?"+=":"-=")+c;a.animate(g,i/2,b.options.easing);c/=2;m--}for(g=0;g<m;g++){var j={},k={};j[f]=("pos"==d?"-=":"+=")+c;k[f]=("pos"==d?"+=":"-=")+c;a.animate(j,i/2,b.options.easing).animate(k,i/2,b.options.easing);c="hide"==h?2*c:c/2}"hide"==h?(g={opacity:0},g[f]=("pos"==d?"-=":"+=")+c,a.animate(g,i/2,b.options.easing,function(){a.hide();e.effects.restore(a,l);e.effects.removeWrapper(a);
b.callback&&b.callback.apply(this,arguments)})):(j={},k={},j[f]=("pos"==d?"-=":"+=")+c,k[f]=("pos"==d?"+=":"-=")+c,a.animate(j,i/2,b.options.easing).animate(k,i/2,b.options.easing,function(){e.effects.restore(a,l);e.effects.removeWrapper(a);b.callback&&b.callback.apply(this,arguments)}));a.queue("fx",function(){a.dequeue()});a.dequeue()})}})(jQuery);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.auiplugin:jquery-effects', location = 'node_modules/@atlassian/aui/src/js-vendor/jquery/jquery-ui/jquery.effects.clip.js' */
(function(b){b.effects.clip=function(e){return this.queue(function(){var a=b(this),h="position top bottom left right height width".split(" "),f=b.effects.setMode(a,e.options.mode||"hide"),c=e.options.direction||"vertical";b.effects.save(a,h);a.show();var d=b.effects.createWrapper(a).css({overflow:"hidden"}),d="IMG"==a[0].tagName?d:a,i="vertical"==c?"height":"width",j="vertical"==c?"top":"left",c="vertical"==c?d.height():d.width();"show"==f&&(d.css(i,0),d.css(j,c/2));var g={};g[i]="show"==f?c:0;g[j]=
"show"==f?0:c/2;d.animate(g,{queue:!1,duration:e.duration,easing:e.options.easing,complete:function(){f=="hide"&&a.hide();b.effects.restore(a,h);b.effects.removeWrapper(a);e.callback&&e.callback.apply(a[0],arguments);a.dequeue()}})})}})(jQuery);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.auiplugin:jquery-effects', location = 'node_modules/@atlassian/aui/src/js-vendor/jquery/jquery-ui/jquery.effects.drop.js' */
(function(c){c.effects.drop=function(d){return this.queue(function(){var a=c(this),h="position top bottom left right opacity".split(" "),e=c.effects.setMode(a,d.options.mode||"hide"),b=d.options.direction||"left";c.effects.save(a,h);a.show();c.effects.createWrapper(a);var f="up"==b||"down"==b?"top":"left",b="up"==b||"left"==b?"pos":"neg",g=d.options.distance||("top"==f?a.outerHeight(!0)/2:a.outerWidth(!0)/2);"show"==e&&a.css("opacity",0).css(f,"pos"==b?-g:g);var i={opacity:"show"==e?1:0};i[f]=("show"==
e?"pos"==b?"+=":"-=":"pos"==b?"-=":"+=")+g;a.animate(i,{queue:!1,duration:d.duration,easing:d.options.easing,complete:function(){"hide"==e&&a.hide();c.effects.restore(a,h);c.effects.removeWrapper(a);d.callback&&d.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.auiplugin:jquery-effects', location = 'node_modules/@atlassian/aui/src/js-vendor/jquery/jquery-ui/jquery.effects.explode.js' */
(function(j){j.effects.explode=function(a){return this.queue(function(){var c=a.options.pieces?Math.round(Math.sqrt(a.options.pieces)):3,d=a.options.pieces?Math.round(Math.sqrt(a.options.pieces)):3;a.options.mode="toggle"==a.options.mode?j(this).is(":visible")?"hide":"show":a.options.mode;var b=j(this).show().css("visibility","hidden"),e=b.offset();e.top-=parseInt(b.css("marginTop"),10)||0;e.left-=parseInt(b.css("marginLeft"),10)||0;for(var h=b.outerWidth(!0),i=b.outerHeight(!0),f=0;f<c;f++)for(var g=
0;g<d;g++)b.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-g*(h/d),top:-f*(i/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:h/d,height:i/c,left:e.left+g*(h/d)+("show"==a.options.mode?(g-Math.floor(d/2))*(h/d):0),top:e.top+f*(i/c)+("show"==a.options.mode?(f-Math.floor(c/2))*(i/c):0),opacity:"show"==a.options.mode?0:1}).animate({left:e.left+g*(h/d)+("show"==a.options.mode?0:(g-Math.floor(d/2))*(h/d)),top:e.top+
f*(i/c)+("show"==a.options.mode?0:(f-Math.floor(c/2))*(i/c)),opacity:"show"==a.options.mode?1:0},a.duration||500);setTimeout(function(){"show"==a.options.mode?b.css({visibility:"visible"}):b.css({visibility:"visible"}).hide();a.callback&&a.callback.apply(b[0]);b.dequeue();j("div.ui-effects-explode").remove()},a.duration||500)})}})(jQuery);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.auiplugin:jquery-effects', location = 'node_modules/@atlassian/aui/src/js-vendor/jquery/jquery-ui/jquery.effects.fade.js' */
(function(b){b.effects.fade=function(a){return this.queue(function(){var c=b(this),d=b.effects.setMode(c,a.options.mode||"hide");c.animate({opacity:d},{queue:!1,duration:a.duration,easing:a.options.easing,complete:function(){a.callback&&a.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.auiplugin:jquery-effects', location = 'node_modules/@atlassian/aui/src/js-vendor/jquery/jquery-ui/jquery.effects.fold.js' */
(function(c){c.effects.fold=function(a){return this.queue(function(){var b=c(this),j=["position","top","bottom","left","right"],d=c.effects.setMode(b,a.options.mode||"hide"),g=a.options.size||15,h=!!a.options.horizFirst,k=a.duration?a.duration/2:c.fx.speeds._default/2;c.effects.save(b,j);b.show();var e=c.effects.createWrapper(b).css({overflow:"hidden"}),f="show"==d!=h,l=f?["width","height"]:["height","width"],f=f?[e.width(),e.height()]:[e.height(),e.width()],i=/([0-9]+)%/.exec(g);i&&(g=parseInt(i[1],
10)/100*f["hide"==d?0:1]);"show"==d&&e.css(h?{height:0,width:g}:{height:g,width:0});h={};i={};h[l[0]]="show"==d?f[0]:g;i[l[1]]="show"==d?f[1]:0;e.animate(h,k,a.options.easing).animate(i,k,a.options.easing,function(){"hide"==d&&b.hide();c.effects.restore(b,j);c.effects.removeWrapper(b);a.callback&&a.callback.apply(b[0],arguments);b.dequeue()})})}})(jQuery);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.auiplugin:jquery-effects', location = 'node_modules/@atlassian/aui/src/js-vendor/jquery/jquery-ui/jquery.effects.highlight.js' */
(function(b){b.effects.highlight=function(c){return this.queue(function(){var a=b(this),e=["backgroundImage","backgroundColor","opacity"],d=b.effects.setMode(a,c.options.mode||"show"),f={backgroundColor:a.css("backgroundColor")};"hide"==d&&(f.opacity=0);b.effects.save(a,e);a.show().css({backgroundImage:"none",backgroundColor:c.options.color||"#ffff99"}).animate(f,{queue:!1,duration:c.duration,easing:c.options.easing,complete:function(){d=="hide"&&a.hide();b.effects.restore(a,e);d=="show"&&!b.support.opacity&&
this.style.removeAttribute("filter");c.callback&&c.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.auiplugin:jquery-effects', location = 'node_modules/@atlassian/aui/src/js-vendor/jquery/jquery-ui/jquery.effects.pulsate.js' */
(function(e){e.effects.pulsate=function(a){return this.queue(function(){var b=e(this),d=e.effects.setMode(b,a.options.mode||"show"),g=2*(a.options.times||5)-1,h=a.duration?a.duration/2:e.fx.speeds._default/2,f=b.is(":visible"),c=0;f||(b.css("opacity",0).show(),c=1);("hide"==d&&f||"show"==d&&!f)&&g--;for(d=0;d<g;d++)b.animate({opacity:c},h,a.options.easing),c=(c+1)%2;b.animate({opacity:c},h,a.options.easing,function(){c==0&&b.hide();a.callback&&a.callback.apply(this,arguments)});b.queue("fx",function(){b.dequeue()}).dequeue()})}})(jQuery);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.auiplugin:jquery-effects', location = 'node_modules/@atlassian/aui/src/js-vendor/jquery/jquery-ui/jquery.effects.scale.js' */
(function(c){c.effects.puff=function(b){return this.queue(function(){var a=c(this),d=c.effects.setMode(a,b.options.mode||"hide"),e=parseInt(b.options.percent,10)||150,i=e/100,g={height:a.height(),width:a.width()};c.extend(b.options,{fade:!0,mode:d,percent:"hide"==d?e:100,from:"hide"==d?g:{height:g.height*i,width:g.width*i}});a.effect("scale",b.options,b.duration,b.callback);a.dequeue()})};c.effects.scale=function(b){return this.queue(function(){var a=c(this),d=c.extend(!0,{},b.options),e=c.effects.setMode(a,
b.options.mode||"effect"),i=parseInt(b.options.percent,10)||(0==parseInt(b.options.percent,10)?0:"hide"==e?0:100),g=b.options.direction||"both",f=b.options.origin;"effect"!=e&&(d.origin=f||["middle","center"],d.restore=!0);f={height:a.height(),width:a.width()};a.from=b.options.from||("show"==e?{height:0,width:0}:f);a.to={height:f.height*("horizontal"!=g?i/100:1),width:f.width*("vertical"!=g?i/100:1)};if(b.options.fade&&("show"==e&&(a.from.opacity=0,a.to.opacity=1),"hide"==e))a.from.opacity=1,a.to.opacity=
0;d.from=a.from;d.to=a.to;d.mode=e;a.effect("size",d,b.duration,b.callback);a.dequeue()})};c.effects.size=function(b){return this.queue(function(){var a=c(this),d="position top bottom left right width height overflow opacity".split(" "),e="position top bottom left right overflow opacity".split(" "),i=["width","height","overflow"],g=["fontSize"],f=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],j=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],r=c.effects.setMode(a,
b.options.mode||"effect"),q=b.options.restore||!1,n=b.options.scale||"both",k=b.options.origin,h={height:a.height(),width:a.width()};a.from=b.options.from||h;a.to=b.options.to||h;k&&(k=c.effects.getBaseline(k,h),a.from.top=(h.height-a.from.height)*k.y,a.from.left=(h.width-a.from.width)*k.x,a.to.top=(h.height-a.to.height)*k.y,a.to.left=(h.width-a.to.width)*k.x);var l=a.from.height/h.height,o=a.from.width/h.width,m=a.to.height/h.height,p=a.to.width/h.width;if("box"==n||"both"==n)if(l!=m&&(d=d.concat(f),
a.from=c.effects.setTransition(a,f,l,a.from),a.to=c.effects.setTransition(a,f,m,a.to)),o!=p)d=d.concat(j),a.from=c.effects.setTransition(a,j,o,a.from),a.to=c.effects.setTransition(a,j,p,a.to);if(("content"==n||"both"==n)&&l!=m)d=d.concat(g),a.from=c.effects.setTransition(a,g,l,a.from),a.to=c.effects.setTransition(a,g,m,a.to);c.effects.save(a,q?d:e);a.show();c.effects.createWrapper(a);a.css("overflow","hidden").css(a.from);if("content"==n||"both"==n)f=f.concat(["marginTop","marginBottom"]).concat(g),
j=j.concat(["marginLeft","marginRight"]),i=d.concat(f).concat(j),a.find("*[width]").each(function(){var a=c(this);q&&c.effects.save(a,i);var d=a.height(),e=a.width();a.from={height:d*l,width:e*o};a.to={height:d*m,width:e*p};if(l!=m){a.from=c.effects.setTransition(a,f,l,a.from);a.to=c.effects.setTransition(a,f,m,a.to)}if(o!=p){a.from=c.effects.setTransition(a,j,o,a.from);a.to=c.effects.setTransition(a,j,p,a.to)}a.css(a.from);a.animate(a.to,b.duration,b.options.easing,function(){q&&c.effects.restore(a,
i)})});a.animate(a.to,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){a.to.opacity===0&&a.css("opacity",a.from.opacity);r=="hide"&&a.hide();c.effects.restore(a,q?d:e);c.effects.removeWrapper(a);b.callback&&b.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.auiplugin:jquery-effects', location = 'node_modules/@atlassian/aui/src/js-vendor/jquery/jquery-ui/jquery.effects.shake.js' */
(function(d){d.effects.shake=function(a){return this.queue(function(){var b=d(this),j=["position","top","bottom","left","right"];d.effects.setMode(b,a.options.mode||"effect");var c=a.options.direction||"left",e=a.options.distance||20,l=a.options.times||3,f=a.duration||a.options.duration||140;d.effects.save(b,j);b.show();d.effects.createWrapper(b);var g="up"==c||"down"==c?"top":"left",h="up"==c||"left"==c?"pos":"neg",c={},i={},k={};c[g]=("pos"==h?"-=":"+=")+e;i[g]=("pos"==h?"+=":"-=")+2*e;k[g]=("pos"==
h?"-=":"+=")+2*e;b.animate(c,f,a.options.easing);for(e=1;e<l;e++)b.animate(i,f,a.options.easing).animate(k,f,a.options.easing);b.animate(i,f,a.options.easing).animate(c,f/2,a.options.easing,function(){d.effects.restore(b,j);d.effects.removeWrapper(b);a.callback&&a.callback.apply(this,arguments)});b.queue("fx",function(){b.dequeue()});b.dequeue()})}})(jQuery);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.auiplugin:jquery-effects', location = 'node_modules/@atlassian/aui/src/js-vendor/jquery/jquery-ui/jquery.effects.slide.js' */
(function(c){c.effects.slide=function(d){return this.queue(function(){var a=c(this),h=["position","top","bottom","left","right"],f=c.effects.setMode(a,d.options.mode||"show"),b=d.options.direction||"left";c.effects.save(a,h);a.show();c.effects.createWrapper(a).css({overflow:"hidden"});var g="up"==b||"down"==b?"top":"left",b="up"==b||"left"==b?"pos":"neg",e=d.options.distance||("top"==g?a.outerHeight(!0):a.outerWidth(!0));"show"==f&&a.css(g,"pos"==b?isNaN(e)?"-"+e:-e:e);var i={};i[g]=("show"==f?"pos"==
b?"+=":"-=":"pos"==b?"-=":"+=")+e;a.animate(i,{queue:!1,duration:d.duration,easing:d.options.easing,complete:function(){"hide"==f&&a.hide();c.effects.restore(a,h);c.effects.removeWrapper(a);d.callback&&d.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.auiplugin:jquery-effects', location = 'node_modules/@atlassian/aui/src/js-vendor/jquery/jquery-ui/jquery.effects.transfer.js' */
(function(e){e.effects.transfer=function(a){return this.queue(function(){var b=e(this),c=e(a.options.to),d=c.offset(),c={top:d.top,left:d.left,height:c.innerHeight(),width:c.innerWidth()},d=b.offset(),f=e('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(a.options.className).css({top:d.top,left:d.left,height:b.innerHeight(),width:b.innerWidth(),position:"absolute"}).animate(c,a.duration,a.options.easing,function(){f.remove();a.callback&&a.callback.apply(b[0],arguments);b.dequeue()})})}})(jQuery);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.auiplugin:jquery-ui-other', location = 'node_modules/@atlassian/aui/src/js-vendor/jquery/jquery.ui.menu.js' */
(function(d){d.widget("ui.menu",{_create:function(){var a=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(b){d(b.target).closest(".ui-menu-item a").length&&(b.preventDefault(),a.select(b))});this.refresh()},refresh:function(){var a=this;this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem").children("a").addClass("ui-corner-all").attr("tabindex",
-1).mouseenter(function(b){a.activate(b,d(this).parent())}).mouseleave(function(){a.deactivate()})},activate:function(a,b){this.deactivate();if(this.hasScroll()){var c=b.offset().top-this.element.offset().top,e=this.element.attr("scrollTop"),d=this.element.height();0>c?this.element.attr("scrollTop",e+c):c>d&&this.element.attr("scrollTop",e+c-d+b.height())}this.active=b.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",a,{item:b})},deactivate:function(){this.active&&
(this.active.children("a").removeClass("ui-state-hover").removeAttr("id"),this._trigger("blur"),this.active=null)},next:function(a){this.move("next",".ui-menu-item:first",a)},previous:function(a){this.move("prev",".ui-menu-item:last",a)},first:function(){return this.active&&!this.active.prev().length},last:function(){return this.active&&!this.active.next().length},move:function(a,b,c){this.active?(a=this.active[a+"All"](".ui-menu-item").eq(0),a.length?this.activate(c,a):this.activate(c,this.element.children(b))):
this.activate(c,this.element.children(b))},nextPage:function(a){if(this.hasScroll())if(!this.active||this.last())this.activate(a,this.element.children(":first"));else{var b=this.active.offset().top,c=this.element.height(),e=this.element.children("li").filter(function(){var a=d(this).offset().top-b-c+d(this).height();return 10>a&&-10<a});e.length||(e=this.element.children(":last"));this.activate(a,e)}else this.activate(a,this.element.children(!this.active||this.last()?":first":":last"))},previousPage:function(a){if(this.hasScroll())if(!this.active||
this.first())this.activate(a,this.element.children(":last"));else{var b=this.active.offset().top,c=this.element.height();result=this.element.children("li").filter(function(){var a=d(this).offset().top-b+c-d(this).height();return 10>a&&-10<a});result.length||(result=this.element.children(":first"));this.activate(a,result)}else this.activate(a,this.element.children(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()<this.element.attr("scrollHeight")},select:function(a){this._trigger("selected",
a,{item:this.active})}})})(jQuery);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-roadmap-plugin:roadmap-editor-view-resources', location = 'view/roadmap-editor/templates.soy' */
// This file was automatically generated from templates.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.Roadmap.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.Roadmap == 'undefined') { Confluence.Templates.Roadmap = {}; }


Confluence.Templates.Roadmap.roadmapPopupPanel = function(opt_data, opt_ignored) {
  return '<div class="roadmap-editor-popup"><div id=\'' + soy.$$escapeHtml(opt_data.roadmapPopupPanelId) + '\'></div></div>';
};
if (goog.DEBUG) {
  Confluence.Templates.Roadmap.roadmapPopupPanel.soyTemplateName = 'Confluence.Templates.Roadmap.roadmapPopupPanel';
}


Confluence.Templates.Roadmap.roadmapEditor = function(opt_data, opt_ignored) {
  return '<div id="roadmap-editor-edit-area"><div id="roadmap-editor-edit-content"><!-- START GENERATE ROADMAP --><div id="roadmap-container"><div class="roadmap-drag-area"></div><div class="roadmap-frame"><div class="roadmap-marker"></div></div><div class="roadmap-content"></div></div><!-- END GENERATE ROADMAP --></div></div>';
};
if (goog.DEBUG) {
  Confluence.Templates.Roadmap.roadmapEditor.soyTemplateName = 'Confluence.Templates.Roadmap.roadmapEditor';
}


Confluence.Templates.Roadmap.lane = function(opt_data, opt_ignored) {
  return '<div class="roadmap-lane-title" style="background-color: ' + soy.$$escapeHtml(opt_data.color.lane) + '; color: ' + soy.$$escapeHtml(opt_data.color.text) + '" title="' + soy.$$escapeHtml(opt_data.title) + '"><div class="title-outer"><div class="title-inner">' + soy.$$escapeHtml(opt_data.title) + '</div></div></div><div class="roadmap-separate-content">&nbsp;</div><div class="roadmap-lane-content"></div>';
};
if (goog.DEBUG) {
  Confluence.Templates.Roadmap.lane.soyTemplateName = 'Confluence.Templates.Roadmap.lane';
}


Confluence.Templates.Roadmap.marker = function(opt_data, opt_ignored) {
  return '<div class="marker-drag-placeholder" /><div class="marker-title-wrapper"><span class="marker-title" title="' + soy.$$escapeHtml(opt_data.title) + '">' + soy.$$escapeHtml(opt_data.title) + '</span></div>';
};
if (goog.DEBUG) {
  Confluence.Templates.Roadmap.marker.soyTemplateName = 'Confluence.Templates.Roadmap.marker';
}


Confluence.Templates.Roadmap.bar = function(opt_data, opt_ignored) {
  return '<p class="roadmap-bar-title">' + soy.$$escapeHtml(opt_data.title) + '</p>';
};
if (goog.DEBUG) {
  Confluence.Templates.Roadmap.bar.soyTemplateName = 'Confluence.Templates.Roadmap.bar';
}


Confluence.Templates.Roadmap.newRowLine = function(opt_data, opt_ignored) {
  return '<hr class="new-row-line" />';
};
if (goog.DEBUG) {
  Confluence.Templates.Roadmap.newRowLine.soyTemplateName = 'Confluence.Templates.Roadmap.newRowLine';
}


Confluence.Templates.Roadmap.deprecationDialog = function(opt_data, opt_ignored) {
  return '<section role="dialog" id="' + soy.$$escapeHtml(opt_data.id) + '" class="aui-layer aui-dialog2 aui-dialog2-medium" aria-hidden="true"><header class="aui-dialog2-header"><h1 class="aui-dialog2-header-main">' + soy.$$escapeHtml('Macro unavailable') + '</h1></header><div class="aui-dialog2-content">' + soy.$$filterNoAutoescape('\x3cp\x3eThe roadmap macro has been deprecated as of version 12. You can still view your existing roadmap macros but you will no longer be able to edit them or create new ones.\x3c/p\x3e\x3cp\x3ePlease use our new Roadmap Planner macro to plan your roadmap.\x3c/p\x3e') + '<div class="new-roadmap-thumb"></div></div><footer class="aui-dialog2-footer"><div class="aui-dialog2-footer-actions"><button id="dialog-close-button" class="aui-button aui-button-link">' + soy.$$escapeHtml('Close') + '</button></div></footer></section>';
};
if (goog.DEBUG) {
  Confluence.Templates.Roadmap.deprecationDialog.soyTemplateName = 'Confluence.Templates.Roadmap.deprecationDialog';
}


Confluence.Templates.Roadmap.newRowPlaceholder = function(opt_data, opt_ignored) {
  return '<hr class= "new-row-placeholder" />';
};
if (goog.DEBUG) {
  Confluence.Templates.Roadmap.newRowPlaceholder.soyTemplateName = 'Confluence.Templates.Roadmap.newRowPlaceholder';
}


Confluence.Templates.Roadmap.laneDialog = function(opt_data, opt_ignored) {
  return '' + aui.buttons.button({id: 'add-bar-button', type: 'subtle', iconType: 'aui', extraClasses: 'aui-button-compact', text: '', extraAttributes: {title: 'Add bar'}, iconClass: 'aui-icon-small aui-iconfont-add'}) + aui.buttons.button({id: 'rename-button', type: 'subtle', iconType: 'aui', extraClasses: 'aui-button-compact', text: '', extraAttributes: {title: 'Rename lane'}, iconClass: 'aui-icon-small aui-iconfont-edit'}) + Confluence.Templates.Roadmap.laneColorSelect(opt_data) + ((opt_data.canDelete) ? aui.buttons.button({id: 'delete-button', type: 'subtle', iconType: 'aui', extraClasses: 'aui-button-compact', text: '', extraAttributes: {title: 'Delete lane'}, iconClass: 'aui-icon-small delete-icon'}) : '');
};
if (goog.DEBUG) {
  Confluence.Templates.Roadmap.laneDialog.soyTemplateName = 'Confluence.Templates.Roadmap.laneDialog';
}


Confluence.Templates.Roadmap.markerDialog = function(opt_data, opt_ignored) {
  return '' + aui.buttons.button({id: 'rename-button', type: 'subtle', iconType: 'aui', extraClasses: 'aui-button-compact', text: '', extraAttributes: {title: 'Rename marker'}, iconClass: 'aui-icon-small aui-iconfont-edit'}) + aui.buttons.button({id: 'delete-button', type: 'subtle', iconType: 'aui', extraClasses: 'aui-button-compact', text: '', extraAttributes: {title: 'Delete marker'}, iconClass: 'aui-icon-small delete-icon'});
};
if (goog.DEBUG) {
  Confluence.Templates.Roadmap.markerDialog.soyTemplateName = 'Confluence.Templates.Roadmap.markerDialog';
}


Confluence.Templates.Roadmap.markerRenameDialog = function(opt_data, opt_ignored) {
  return '' + aui.form.form({action: '', content: '' + aui.form.input({extraClasses: 'marker-title', name: 'marker-title', type: 'text', value: opt_data.markerTitle}) + aui.buttons.button({extraClasses: 'rename-button', text: 'Save'})});
};
if (goog.DEBUG) {
  Confluence.Templates.Roadmap.markerRenameDialog.soyTemplateName = 'Confluence.Templates.Roadmap.markerRenameDialog';
}


Confluence.Templates.Roadmap.laneRenameDialog = function(opt_data, opt_ignored) {
  return '' + aui.form.form({action: '', content: '' + aui.form.input({extraClasses: 'lane-title', name: 'lane-title', type: 'text', value: opt_data.laneTitle}) + aui.buttons.button({extraClasses: 'rename-button', text: 'Save'})});
};
if (goog.DEBUG) {
  Confluence.Templates.Roadmap.laneRenameDialog.soyTemplateName = 'Confluence.Templates.Roadmap.laneRenameDialog';
}


Confluence.Templates.Roadmap.laneColorSelect = function(opt_data, opt_ignored) {
  var output = '<a id="lane-color-select" href="#" aria-owns="lane-color-picker" aria-haspopup="true" class="aui-button aui-button-subtle aui-button-compact aui-dropdown2-trigger aui-style-default" title="' + soy.$$escapeHtml('Lane color') + '"><span class="color-item" style="background-color: ' + soy.$$escapeHtml(opt_data.laneColor) + ';">&nbsp;</span></a></a><div id="lane-color-picker" class="aui-dropdown2"><ul class="aui-list-truncate">';
  var colorList120 = opt_data.colors;
  var colorListLen120 = colorList120.length;
  for (var colorIndex120 = 0; colorIndex120 < colorListLen120; colorIndex120++) {
    var colorData120 = colorList120[colorIndex120];
    output += '<li class="color-display-item"><a href="#" ><span class="color-item ' + ((colorData120.lane == opt_data.laneColor) ? 'aui-icon aui-icon-small aui-iconfont-success' : '') + '" style="background-color: ' + soy.$$escapeHtml(colorData120.lane) + ';"></span></a></li>';
  }
  output += '</ul></div>';
  return output;
};
if (goog.DEBUG) {
  Confluence.Templates.Roadmap.laneColorSelect.soyTemplateName = 'Confluence.Templates.Roadmap.laneColorSelect';
}


Confluence.Templates.Roadmap.linkPageTitle = function(opt_data, opt_ignored) {
  return '<span class="link-page-title" />';
};
if (goog.DEBUG) {
  Confluence.Templates.Roadmap.linkPageTitle.soyTemplateName = 'Confluence.Templates.Roadmap.linkPageTitle';
}


Confluence.Templates.Roadmap.footerActionContent = function(opt_data, opt_ignored) {
  return '' + aui.buttons.button({text: 'Insert', id: 'roadmapInsertBtn'}) + aui.buttons.button({text: 'Cancel', type: 'link', id: 'roadmapCancelBtn'});
};
if (goog.DEBUG) {
  Confluence.Templates.Roadmap.footerActionContent.soyTemplateName = 'Confluence.Templates.Roadmap.footerActionContent';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-roadmap-plugin:roadmap-editor-view-resources', location = 'view/roadmap-editor/bar/bar.js' */
(function(b,a){Roadmap.BarView=Backbone.View.extend({className:"roadmap-bar",events:{click:"_showDialog",dragstart:"_onDragstart",dragstop:"_onDragStop",dropover:"_onDropOver",dropout:"_onDropOut"},attributes:function(){return{cid:this.cid}},initialize:function(){a.bindAll(this,"render","_updateBar","_beforeResize","updateMaxWidth","_deleteBar","_updateTitle");this._addEvents()},_addEvents:function(){var c=this;this.$el.draggable({opacity:0.3,cursor:"move",appendTo:".roadmap-drag-area",snap:".roadmap-bar-row, .new-bar-row",snapMode:"inner",snapTolerance:17,scroll:true,zIndex:4020,helper:function(){return c.$el.clone().addClass("roadmap-bar-clone").data("View",c)}});this.$el.droppable({accept:".roadmap-bar",tolerance:"touch",hoverClass:"bar-hover-bar"});this.$el.data("View",this)},render:function(){this.updateColor(this.options.color);var c=this.options.timelineView.getBarPosition(this.model.attributes);this.$el.css({left:c.left+"px",width:c.width+"px"});this.$el.attr("title",this.model.get("title"));this.$el.append(Confluence.Templates.Roadmap.bar({title:this.model.get("title")}));this.$el.resizable({handles:"e, w",minWidth:Roadmap.barMinWidth,start:this._beforeResize,stop:this._updateBar});return this},updateMaxWidth:function(d){this.$el.resizable("option","maxWidth",d);var c=this.$el.resizable("option","minWidth");if(d<c){this.$el.resizable("option","minWidth",d)}},_beforeResize:function(d,c){this._barDialog&&this._barDialog.remove();this.trigger("beforeResize",this,this._checkHandleDirection(d))},_checkHandleDirection:function(c){var d=b(c.toElement?c.toElement:c.originalEvent.target);if(d.hasClass("ui-resizable-w")){return"left"}else{if(d.hasClass("ui-resizable-e")){return"right"}}throw"Unsupport resize direction handling = "+d},_updateBar:function(d,c){if(c.originalPosition.left!=c.position.left){this.model.set({startDate:this.options.timelineView.getBarStartDate(c.position.left),duration:this.options.timelineView.getBarDuration(c.element.outerWidth())})}else{if(c.originalSize.width!=c.size.width){this.model.set("duration",this.options.timelineView.getBarDuration(c.element.outerWidth()))}}},appendTo:function(c){this.$el.appendTo(c)},updateColor:function(c){this.$el.css({"background-color":c.bar,"border-color":c.lane,color:c.text})},updatePositionLeft:function(c){this.$el.css("left",c)},_onDragStop:function(d,c){this.options.lane.cleanLaneAfterDrop();this.$el.trigger("BarView.dragstop")},updateDeleteBar:function(c){this.options.deleteBar=c},_showDialog:function(c){if(!b(c.target).is(".ui-resizable-handle")){this._barDialog&&this._barDialog.remove();this._barDialog=this._createDialog();this._barDialog.show();Confluence.Roadmap.Analytics.openBarDialogInEdit()}},_createDialog:function(){return new Roadmap.BarDialogView({trigger:this.$el,model:this.model,timelineWidth:this.options.timelineView.$el.width(),renderOption:{isEditMode:true,editInplace:{title:true,pageLink:true,description:true}},linkPageEditable:true,deleteBar:this._deleteBar,updateTitle:this._updateTitle,updateDescription:this._updateDescription,updatePageLink:this._updatePageLink,createLinkPageCallback:this._goToCreateLinkPage})},_deleteBar:function(){this.options.deleteBar(this)},_updateTitle:function(c){this.model.set("title",c);this.$el.attr("title",c);this.$el.find(".roadmap-bar-title").html(AJS.escapeHtml(c))},_updateDescription:function(c){this.model.set("description",c)},_updatePageLink:function(c){this.model.set("pageLink",c)},_onDragstart:function(d,c){Roadmap.DragDrop.barDraggingOver={};this.$el.trigger("BarView.dragstart",[c])},_onDropOver:function(d,c){Roadmap.DragDrop.barDraggingOver[this.cid]=this.cid;if(Roadmap.DragDrop.barDraggingOver&&c.helper.data("isAddingNewRow")!==true){c.helper.addClass("roadmap-bar-overlapped")}},_onDropOut:function(f,d){var c=this;delete Roadmap.DragDrop.barDraggingOver[c.cid];d.helper.removeClass("roadmap-bar-overlapped");a.each(Roadmap.DragDrop.barDraggingOver,function(g){var e=d.helper.data("isAddingNewRow")!==true;if(e){if(typeof g==="string"){d.helper.addClass("roadmap-bar-overlapped")}else{if(g.className==="roadmap-bar-row"){g.$el.addClass("roadmap-bar-drag-hover")}}}})},_goToCreateLinkPage:function(f){f.preventDefault();var e=this.me;var c=parseInt(AJS.Meta.get("page-id"));var d=c>0?c:AJS.Meta.get("parent-page-id");var g={roadmapBarId:e.model.id,roadmapContentId:d,updateRoadmap:false};Confluence.RoadmapLink.addCreateLinkPageListener(g,function(i){var h=e._updatePageLink(i.pageLink);e.fields.$pageLink.html(h)})}})})(AJS.$,window._);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-roadmap-plugin:roadmap-editor-view-resources', location = 'view/roadmap-editor/bar/bar-row.js' */
(function(b,a){Roadmap.BarRowView=Backbone.View.extend({className:"roadmap-bar-row",initialize:function(){a.bindAll(this,"_addEvents");this._addEvents();return this},attributes:function(){return{cid:this.cid}},_addEvents:function(){var c=this;this.$el.droppable({greedy:true,tolerance:"pointer",hoverClass:"roadmap-bar-drag-hover",activeClass:"roadmap-bar-drag-active",accept:".roadmap-bar",over:function(f,d){Roadmap.DragDrop.barDraggingOver[c.cid]=c;if(d.helper.data("isAddingNewRow")!==true){var g=b(this);g.closest(".roadmap-content").find(".new-row-placeholder").remove()}else{c.$el.removeClass("roadmap-bar-drag-hover")}},out:function(){var d=b(this);delete Roadmap.DragDrop.barDraggingOver[c.cid];d.closest(".roadmap-content").find(".new-row-placeholder").remove()},drop:function(g,f){var d=a.reject(Roadmap.DragDrop.barDraggingOver,function(e){return(typeof e==="object")}).length>0;if(!f.helper.hasClass("roadmap-bar-overlapped")&&!d){b(this).trigger("BarView.drop",[{$barViewHelper:f.helper,$barViewOriginal:f.draggable,$barRow:b(this)},f])}}})},isEmptyRow:function(){return this.$el.is(":empty")}})})(AJS.$,window._);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-roadmap-plugin:roadmap-editor-view-resources', location = 'view/roadmap-editor/bar/bar-row-new.js' */
(function(b,a){Roadmap.BarRowNewView=Backbone.View.extend({className:"new-bar-row",overlayTop:3,margin:5,events:{drop:"_onDrop",dropover:"_onDropOver",dropout:"_onDropOut"},initialize:function(){a.bindAll(this,"render","_addEvent");return this},render:function(){this.$el.append(Confluence.Templates.Roadmap.newRowLine());this._addEvent();this._setSizePosition();return this},_addEvent:function(){this.$el.droppable({accept:".roadmap-bar",tolerance:"pointer",hoverClass:"new-bar-row-hover"})},_setSizePosition:function(){var f=this.options.$barRow;var c=this.options.renderBottom===false?(this.margin*-1):f.height();var e=f.index()===0;var d=(e)?this.overlayTop+this.margin:this.overlayTop;this.$el.css({top:f.position().top+c-d,width:f.width()})},_onDrop:function(d,c){this.$el.trigger("BarView.drop",[{barRowNewView:this},c])},_onDropOver:function(d,c){this.$el.trigger("BarRowNew.dropover",[this,c])},_onDropOut:function(d,c){this.$el.trigger("BarRowNew.dropout",[this,c])}})})(AJS.$,window._);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-roadmap-plugin:roadmap-editor-view-resources', location = 'view/roadmap-editor/lane-dialog/lane-dialog.js' */
(function(c,a){var b=Roadmap.InlineDialogView;Roadmap.LaneDialogView=b.extend({events:{"click #delete-button":"_onDeleteClick","click #rename-button":"_onRenameClick","click #add-bar-button":"_onAddBarClick"},initialize:function(){a.bindAll(this,"_onHide");this.options.dialogOptions={width:this._getDialogWidth(),hideCallback:this._onHide};c(".roadmap-editor-popup, .roadmap-macro-view").scroll(function(){c("#lane-color-picker").hide()});b.prototype.initialize.call(this,this.options)},_getContent:function(d){var g=this.options.lane.model.get("color").lane;d.html(Confluence.Templates.Roadmap.laneDialog({canDelete:this.options.canDelete,colors:Roadmap.COLORS,laneColor:g}));this.$el.find(".aui-button").tooltip({gravity:"s"});var e=this;var f=this.$el.find("#lane-color-picker .color-item");f.click(function(i){i.preventDefault();var h=Roadmap.COLORS[f.index(this)];if(h.lane!=g){e.options.changeColor(h)}c("#lane-color-picker").hide()})},_getDialogWidth:function(){var e=29;var f=51;var d=2;if(this.options.canDelete){d++}return d*e+f},_onDeleteClick:function(){this.options.deleteLane();this.remove()},_onRenameClick:function(){if(!this._laneRenameDialog){this._laneRenameDialog=new Roadmap.LaneRenameDialogView({trigger:this.options.trigger,lane:this.options.lane})}this._laneRenameDialog.show();this.hide()},_onAddBarClick:function(){this.options.addBar();this.remove()},_onHide:function(){c("#lane-color-picker").hide();b.prototype._onHide.call(this)}})})(AJS.$,window._);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-roadmap-plugin:roadmap-editor-view-resources', location = 'view/roadmap-editor/lane-dialog/lane-rename-dialog.js' */
(function(c,a){var b=Roadmap.InlineDialogView;Roadmap.LaneRenameDialogView=b.extend({events:{"click .rename-button":"_onRenameButtonClick","keyup .lane-title":"_onChangeLaneTitle"},initialize:function(){this.options.dialogOptions={width:this._getDialogWidth()};b.prototype.initialize.call(this,this.options)},_getContent:function(d){d.html(Confluence.Templates.Roadmap.laneRenameDialog({laneTitle:this.options.trigger.text()}));this.controls={$renameButton:this.$el.find(".rename-button"),$laneTitle:this.$el.find(".lane-title")}},_getDialogWidth:function(){return 315},_onChangeLaneTitle:function(d){var f=c.trim(this.controls.$laneTitle.val());if(!f){this.controls.$renameButton.disable()}else{this.controls.$renameButton.enable();if(d.which==AJS.$.ui.keyCode.ENTER){this.controls.$renameButton.click()}}},_onShow:function(d){this.controls.$laneTitle.select()},_onRenameButtonClick:function(d){d.preventDefault();this.hide();var e=this.controls.$laneTitle.val();this.options.lane.renameTitle(e)}})})(AJS.$,window._);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-roadmap-plugin:roadmap-editor-view-resources', location = 'view/roadmap-editor/marker-dialog/marker-dialog.js' */
(function(c,a){var b=Roadmap.InlineDialogView;Roadmap.MarkerDialogView=b.extend({events:{"click #rename-button":"_onRenameButtonClick","click #delete-button":"_onDeleteButtonClick"},initialize:function(){this.options.dialogOptions={width:60};b.prototype.initialize.call(this,this.options)},_getContent:function(d){d.html(Confluence.Templates.Roadmap.markerDialog());this.$el.find(".aui-button.aui-button-compact").tooltip({gravity:"s"})},_onRenameButtonClick:function(){if(!this._markerRenameDialog){this._markerRenameDialog=new Roadmap.MarkerRenameDialogView({trigger:this.options.trigger,marker:this.options.marker})}this._markerRenameDialog.show();this.hide()},_onDeleteButtonClick:function(){this.options.marker.removeMarker();this.hide()}})})(AJS.$,window._);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-roadmap-plugin:roadmap-editor-view-resources', location = 'view/roadmap-editor/marker-dialog/marker-rename-dialog.js' */
(function(c,a){var b=Roadmap.InlineDialogView;Roadmap.MarkerRenameDialogView=b.extend({events:{"click .rename-button":"_onSaveButtonClick","keyup .marker-title":"_onChangeMarkerTitle"},initialize:function(){this.options.dialogOptions={width:315};b.prototype.initialize.call(this,this.options)},_getContent:function(d){d.html(Confluence.Templates.Roadmap.markerRenameDialog({markerTitle:this.options.marker.model.get("title")}));this.controls={$renameButton:this.$el.find(".rename-button"),$title:this.$el.find(".marker-title")}},_onChangeMarkerTitle:function(d){var f=c.trim(this.controls.$title.val());if(!f){this.controls.$renameButton.disable()}else{this.controls.$renameButton.enable();if(d.which==AJS.$.ui.keyCode.ENTER){this.controls.$renameButton.click()}}},_onShow:function(d){this.controls.$title.select()},_onSaveButtonClick:function(d){d.preventDefault();this.hide();this.options.marker.renameTitle(this.controls.$title.val())}})})(AJS.$,window._);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-roadmap-plugin:roadmap-editor-view-resources', location = 'view/roadmap-editor/lane.js' */
(function(b,a){window.Roadmap=window.Roadmap||{};Roadmap.LaneView=Backbone.View.extend({tagName:"div",className:"roadmap-lane",events:{"click .roadmap-lane-title":"_showDialog","BarView.drop":"_onBarDropped","BarRowNew.dropover":"_onBarRowNewDropover","BarRowNew.dropout":"_onBarRowNewDropout"},attributes:function(){return{cid:this.cid}},initialize:function(){a.bindAll(this,"render","renameTitle","updateRowIndex","removeEmptyRow","cleanLaneAfterDrop","_deleteLane","_updateLaneHeight","_renderComplete","_deleteBar","_addBar","_changeColor","addDefaultBarRow");this._barViews=[];this._barRowViews=[];this.listenTo(this.model.get("bars"),"add",function(d){var c=this._newBarRowView();var e=this._newBarView(d);c.$el.append(e.render().$el);this._$laneContent.append(c.$el);this._barViews.push(e);this.$el.trigger("BarView.add",e);a.defer(this._updateLaneHeight)})},render:function(){var c=this;this.$el.append(Confluence.Templates.Roadmap.lane({title:this.model.get("title"),color:this.model.get("color")}));Confluence.Roadmap.ColorHelper.adjustColorCount(this.model.get("color"),1);var d=this.model.get("bars").models;d=a.sortBy(d,function(e){return e.attributes.rowIndex});a.each(d,function(e){var f=c._newBarView(e);c._barViews.push(f)});this._renderBars();a.defer(this._renderComplete);return this},_renderComplete:function(){this._updateLaneHeight()},renameTitle:function(c){this.model.set("title",c);this.$el.find(".roadmap-lane-title").attr("title",c);this.$el.find(".title-inner").html(AJS.escapeHtml(c));this._updateLaneHeight()},_updateLaneHeight:function(){var d=this.$el.find(".title-inner");d.hide();var c=this._$laneContent.outerHeight();d.width(c-2*Roadmap.LANE_PADDING);d.show()},_barBeforeResize:function(e,k){var l=e.$el;var g=Math.ceil(l.outerWidth()-l.width());var j;if(k=="left"){var f=this._getNearestBarView(e,k);var c=f==null?0:f.position().left+f.width()+g;var d=l.position().left-c;j=l.width()+d}else{var i=this._getNearestBarView(e,k);var h=i==null?this._getLaneContentWidth()-g:i.position().left-g;j=h-l.position().left}e.updateMaxWidth(j-Roadmap.BAR_MARGIN)},_renderBars:function(){var c=this;this._$laneContent=this.$el.find(".roadmap-lane-content");var d={};a.each(this._barViews,function(f){var g="row-"+f.model.get("rowIndex");var e=d[g];if(!e){e=c._newBarRowView(f.model.get("rowIndex"));d[g]=e}e.$el.append(f.render().$el);c._$laneContent.append(e.$el)})},_newBarRowView:function(){var c=new Roadmap.BarRowView();this._barRowViews.push(c);return c},_newBarView:function(c){var d=new Roadmap.BarView({model:c,lane:this,color:this.model.get("color"),timelineView:this.options.timelineView,deleteBar:this._deleteBar});d.on("beforeResize",a.bind(this._barBeforeResize,this));return d},_getNearestBarView:function(d,e){var f=a.filter(d.options.lane._barViews,function(g){return g.model.get("rowIndex")===d.model.get("rowIndex")});var c=null;if(e=="left"){a.each(f,function(g){if(g.$el.position().left<d.$el.position().left&&(c==null||g.$el.position().left>c.$el.position().left)){c=g}})}else{a.each(f,function(g){if(g.$el.position().left>d.$el.position().left&&(c==null||g.$el.position().left<c.$el.position().left)){c=g}})}return c!=null?c.$el:null},_getLaneContentWidth:function(){return this.$el.find(".roadmap-lane-content").width()},_showDialog:function(){this._laneDialog&&this._laneDialog.remove();this._laneDialog=this._createLaneDialog();this._laneDialog.show()},_createLaneDialog:function(){return new Roadmap.LaneDialogView({trigger:this.$el.find(".title-outer"),canDelete:this.options.canDelete,deleteLane:this._deleteLane,addBar:this._addBar,changeColor:this._changeColor,lane:this})},_onBarDropped:function(i,k,l){var n=!!k.barRowNewView;var f=l.draggable.data("View");var m=f.model;var h=f.options.lane;var j=(h.cid===this.cid);var g=this.model.get("bars");var o=l.position.left;var d=this.options.timelineView.getBarStartDate(o);if(j&&g.models.length===1&&n){return}f.updatePositionLeft(o);f.updateColor(this.model.get("color"));m.attributes.startDate=d;if(n){var c=this._newBarRowView();k.barRowNewView.$el.replaceWith(c.$el);f.appendTo(c.$el)}else{f.appendTo(k.$barRow)}l.helper.remove();if(!j){f.options.lane.removeEmptyRow();g._byId[m.id]=m;this._barViews.push(f);f.updateDeleteBar(this._deleteBar);h.model.get("bars").remove(m);g.models.push(m);h._barViews.splice(a.indexOf(h._barViews,f),1);this.updateRowIndex(h.$el);f.options=a.extend(f.options,{color:this.model.get("color"),lane:this});h._updateLaneHeight()}this.removeEmptyRow();this.updateRowIndex(this.$el);this._updateLaneHeight()},updateRowIndex:function(c){c.find(".roadmap-bar-row").each(function(e,d){b(d).find('.roadmap-bar:not(".roadmap-bar-clone")').each(function(h,f){var g=b(f).data("View");if(g){g.model.attributes.rowIndex=e}})})},removeEmptyRow:function(){var c=0;a.each(this._barRowViews,function(d){if(d.isEmptyRow()){d.remove();c++}});return !!c},cleanLaneAfterDrop:function(){this._$laneContent.find(".roadmap-bar-drag-active").removeClass("roadmap-bar-drag-active");this._$laneContent.find(".new-row-placeholder").remove()},_deleteLane:function(){Confluence.Roadmap.ColorHelper.adjustColorCount(this.model.get("color"),-1);this.$el.trigger("Lane.delete",this)},updateDeleteStatus:function(c){if(this._laneDialog){this._laneDialog.remove();delete this._laneDialog}this.options.canDelete=c},_deleteBar:function(c){this.model.get("bars").remove(c.model);this._barViews.splice(a.indexOf(this._barViews,c),1);c.remove();if(this.removeEmptyRow()){this.updateRowIndex(this.$el);this._updateLaneHeight();this.$el.trigger("BarRowView.remove")}},_addBar:function(){var c=this.model.get("bars");var e=this.options.timelineView.model;var f=moment(e.get("startDate"));var d=e.get("displayOption")===Roadmap.TIMELINE_DISPLAY_OPTION.MONTH?f.startOf("month"):f.startOf("isoWeek");c.add(new Roadmap.Bar({rowIndex:this.model.getNumberOfRows(),startDate:d.toDate()}))},_changeColor:function(c){Confluence.Roadmap.ColorHelper.adjustColorCount(this.model.get("color"),-1);this.model.set("color",c);Confluence.Roadmap.ColorHelper.adjustColorCount(c,1);this.$el.find(".roadmap-lane-title").css({"background-color":c.lane,color:c.text});a.each(this._barViews,function(d){d.updateColor(c)})},addNewBarRow:function(h){var g=this._$laneContent.find(".roadmap-bar-row");var c=[];var d=function(){g.each(function(){var k=b(this);var j=k.index()===0;if(j){var l=new Roadmap.BarRowNewView({$barRow:k,renderBottom:false});k.before(l.render().$el);c.push(l)}var i=new Roadmap.BarRowNewView({$barRow:k});k.after(i.render().$el);c.push(i)})};if(g.length==0){this.addDefaultBarRow()}else{var e=g.find(".roadmap-bar");if(e.length>0){var f=(e.length>0)&&(e.length==1)&&(e.attr("cid")===h.attr("cid"));if(!f){d()}}}return c},addDefaultBarRow:function(){var c=this._newBarRowView();this._$laneContent.append(c.$el)},_onBarRowNewDropover:function(f,d,c){if(!a.isEmpty(Roadmap.DragDrop.barDraggingOver)){a.each(Roadmap.DragDrop.barDraggingOver,function(e){e.$el&&e.$el.removeClass("new-bar-row-hover roadmap-bar-drag-hover")})}Roadmap.DragDrop.barDraggingOver[d.cid]=d;c.helper.removeClass("roadmap-bar-overlapped");c.helper.data("isAddingNewRow",true)},_onBarRowNewDropout:function(f,d,c){c.helper.data("isAddingNewRow",false);delete Roadmap.DragDrop.barDraggingOver[d.cid];a.each(Roadmap.DragDrop.barDraggingOver,function(e){if(typeof e==="string"){c.helper.addClass("roadmap-bar-overlapped")}else{if(e.className==="roadmap-bar-row"&&c.helper.data("isAddingNewRow")!==true){e.$el.addClass("roadmap-bar-drag-hover")}}})}})})(AJS.$,window._);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-roadmap-plugin:roadmap-editor-view-resources', location = 'view/roadmap-editor/marker.js' */
(function(b,a){window.Roadmap=window.Roadmap||{};Roadmap.MarkerView=Backbone.View.extend({className:"vertical-line",events:{dragstop:"_onDragStop",dragstart:"_onDragStart"},initialize:function(){a.bindAll(this,"render","updateHeight","renameTitle","_renderComplete","_onMarkerClick")},render:function(){var d=this.options.roadmap._timelineView.model;var c;if(d.get("displayOption")===Roadmap.TIMELINE_DISPLAY_OPTION.MONTH){c=Confluence.Roadmap.Helper.getPosXOnMonthTimeline(d.attributes,this.model.get("markerDate"))}else{c=Confluence.Roadmap.Helper.getPosXOnWeekTimeline(d.attributes,this.model.get("markerDate"))}if(c<0||c>this.options.roadmap._timelineView.$el.width()){return false}this.$el.css({left:(c+Roadmap.LANE_TITLE_WIDTH)+"px"});this.$el.append(Confluence.Templates.Roadmap.marker({title:this.model.get("title")}));this.updateHeight(this.options.roadmap._getLaneHeight());a.defer(this._renderComplete);return this},_renderComplete:function(){this._setupMarkerDragging();this.$el.click(this._onMarkerClick);this.$el.find(".marker-title").ellipsis({row:Roadmap.MARKER_TITLE_LINE})},_setupMarkerDragging:function(){this.$el.draggable({axis:"x",zIndex:4013,containment:".roadmap-frame-content",cursor:"move"})},_onDragStop:function(g,f){var c=f.position.left-Roadmap.LANE_TITLE_WIDTH;var d=this.options.roadmap._timelineView.model.attributes;var h;if(d.displayOption===Roadmap.TIMELINE_DISPLAY_OPTION.MONTH){h=Confluence.Roadmap.Helper.getMonthStartDateByPosition(d,c)}else{h=Confluence.Roadmap.Helper.getWeekStartDateByPosition(d,c)}this.model.set("markerDate",h)},_onDragStart:function(d,c){this.options.roadmap.hideDialog()},_onMarkerClick:function(c){if(!b(c.target).hasClass("marker-title")){return}this._markerDialog&&this._markerDialog.remove();this._markerDialog=this._createMarkerDialog();this._markerDialog.show()},_createMarkerDialog:function(){return new Roadmap.MarkerDialogView({trigger:this.$el.find(".marker-title"),marker:this})},updateHeight:function(c){this.$el.height(c+Roadmap.MARKER_HEIGHT_PADDING)},renameTitle:function(d){this.model.set("title",d);var c=this.$el.find(".marker-title");c.attr("title",d);c.html(AJS.escapeHtml(d)).ellipsis({row:Roadmap.MARKER_TITLE_LINE})},removeMarker:function(){this.model.collection.remove(this.model);this.remove()}})})(AJS.$,window._);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-roadmap-plugin:roadmap-editor-view-resources', location = 'view/roadmap-editor/roadmap.js' */
(function(b,a){window.Roadmap=window.Roadmap||{};Roadmap.RoadmapEditorView=Backbone.View.extend({className:"roadmap-editor-container",events:{"BarView.add":"_onAddBar","BarView.dragstart":"_onBarDragstart","BarView.dragstop":"_onBarDragstop","BarView.drop":"_onBarDropped","LaneView.drop":"_onBarDropped","Lane.delete":"_onDeleteLane","BarRowView.remove":"_onBarRowViewRemove","sortstart .roadmap-content":"_onSortStart","sortstop .roadmap-content":"_onSortStop",remove:"_onRemove"},initialize:function(){a.bindAll(this,"render");this.listenTo(this.model.get("lanes"),"add",function(c){var d=new Roadmap.LaneView({model:c,timelineView:this._timelineView,canDelete:true});if(this._laneViews.length===1){this._laneViews[0].updateDeleteStatus(true)}this._laneViews.push(d);this.$roadmapContent.append(d.render().$el);this._updateTimelineColumnHeight();this._scrollToBottom()});this.listenTo(this.model.get("markers"),"add",function(c){var d=new Roadmap.MarkerView({model:c,roadmap:this});this.$roadmapMarker.append(d.render().$el);this._markerViews.push(d)});this.listenTo(this.model.get("timeline"),"change",function(){if(this._isTimelineChanged()){this._calculateMinWidthOfABar();this._timelineView.update();this._timelineColumnView.update();this.$roadmapContent.empty();a.each(this._laneViews,function(c){c.remove()});this._laneViews=[];this._renderLanes();this.$roadmapMarker.empty();this._markerViews=[];this._renderMarkers();this._updateDragArea()}})},render:function(){this.$el.html(Confluence.Templates.Roadmap.roadmapEditor());this._calculateMinWidthOfABar();this._initVariables();this._renderToolbar();this._renderTimeline();this._renderLanes();this._renderMarkers();this._renderTimelineColumn();this._updateDragArea();return this},_calculateMinWidthOfABar:function(){Roadmap.barMinWidth=this.model.get("timeline").get("displayOption")===Roadmap.TIMELINE_DISPLAY_OPTION.MONTH?Roadmap.MONTH_BAR_MIN_WIDTH:Roadmap.WEEK_BAR_MIN_WIDTH},_initVariables:function(){this.$roadmapContainer=this.$el.find("#roadmap-container");this.$roadmapTimeline=this.$roadmapContainer.find(".roadmap-frame");this.$roadmapContent=this.$roadmapContainer.find(".roadmap-content");this.$roadmapMarker=this.$roadmapContainer.find(".roadmap-marker");this._timelineView=new Roadmap.TimelineView({model:this.model.get("timeline")});this._timelineColumnView=new Roadmap.TimelineColumnView({model:this.model.get("timeline")});this._laneViews=[];this._markerViews=[]},_renderTimeline:function(){this.$roadmapTimeline.prepend(this._timelineView.render().$el)},_renderTimelineColumn:function(){this._updateTimelineColumnHeight();this.$roadmapTimeline.append(this._timelineColumnView.render().$el)},_renderMarkers:function(){var c=this;this.model.get("markers").each(function(d){var e=new Roadmap.MarkerView({model:d,roadmap:c});c.$roadmapMarker.append(e.render().$el);c._markerViews.push(e)})},_renderLanes:function(){Confluence.Roadmap.ColorHelper.resetColorCounts();var d=this;this._updateLaneWidth();var c=this.model.get("lanes").models.length>1;this.model.get("lanes").each(function(e){var f=new Roadmap.LaneView({model:e,timelineView:d._timelineView,canDelete:c});d._laneViews.push(f);d.$roadmapContent.append(f.render().$el)});this._setupLaneReordering()},_onAddBar:function(d,c){this._updateTimelineColumnHeight();var e=c.$el;if(!this._isInViewScreen(e)){this._scrollToBar(e)}},_renderToolbar:function(){var d=b("#"+this.options.dialogId+" .aui-dialog2-content");d.find(".roadmap-toolbar").remove();var c=new Roadmap.ToolbarView({model:this.model,timelineView:this._timelineView});d.prepend(c.render().$el)},_getTimelineWidth:function(){return this.$roadmapTimeline.find(".roadmap-frame-title").width()},_getLaneHeight:function(){return this.$roadmapContent.height()},_updateLaneWidth:function(){this.$roadmapContent.width(this._getTimelineWidth()+Roadmap.LANE_TITLE_WIDTH)},_scrollToBottom:function(){this.options.roadmapEditorPopup.scrollTop(this._getLaneHeight())},_isInViewScreen:function(c){return b.inviewport(c,{threshold:-200})},_scrollToBar:function(c){this.options.roadmapEditorPopup.scrollTop(c.parent().position().top);this.options.roadmapEditorPopup.scrollLeft(0)},_onBarDropped:function(){this._updateTimelineColumnHeight()},_onDeleteLane:function(d,c){this.model.get("lanes").remove(c.model);this._laneViews.splice(a.indexOf(this._laneViews,c),1);c.remove();this._updateTimelineColumnHeight();if(this._laneViews.length===1){this._laneViews[0].updateDeleteStatus(false)}},_onBarRowViewRemove:function(){this._updateTimelineColumnHeight()},_updateTimelineColumnHeight:function(){var c=this._getLaneHeight();this._timelineColumnView.updateHeight(c);a.each(this._markerViews,function(d){d.updateHeight(c)})},hideDialog:function(){b("#inline-dialog-roadmap-dialog, #inline-dialog-timeline-options").hide()},removeDialog:function(){b("#inline-dialog-roadmap-dialog, #inline-dialog-timeline-options").remove()},_onBarDragstart:function(f,d){var c=this;this.hideDialog();this._updateDragArea();this._barRowNewViewList=[];a.each(this._laneViews,function(e){c._barRowNewViewList.push(e.addNewBarRow(d.helper))})},_updateDragArea:function(){var c=this.$roadmapContainer.find(".roadmap-drag-area");c.css(this._timelineColumnView.getSizeAndPosition())},_onBarDragstop:function(){a.each(a.flatten(this._barRowNewViewList),function(c){c.remove()});delete this._barRowNewViewList;a.each(this._laneViews,function(c){c.removeEmptyRow()})},_setupLaneReordering:function(){this.$roadmapContent.sortable({axis:"y",cursor:"move",handle:".roadmap-lane-title",opacity:0.3,placeholder:"roadmap-lane lane-sorting-placeholder",helper:function(d,c){return b(c).clone().addClass("lane-sorting-hepler")}})},_onSortStart:function(d,c){this.hideDialog();this._timelineColumnView.$el.hide();c.placeholder.css({height:Math.min(c.helper.height(),100),width:c.helper.width()}).html(Confluence.Templates.Roadmap.lane(Roadmap.TRANSPARENT_LANE));c.helper.find(".roadmap-lane-content").css({width:c.helper.width()-(c.helper.find(".roadmap-lane-title").outerWidth()+c.helper.find(".roadmap-separate-content").outerWidth())})},_onSortStop:function(h,g){this._timelineColumnView.$el.show();var d=g.item.attr("cid");var f=a.find(this._laneViews,function(e){return e.cid===d});var c=f.model;var i=this.model.get("lanes");i.remove(c);i.models.splice(g.item.index(),0,c);i._byId[c.cid]=c},_onRemove:function(){this.$roadmapTimeline.remove()},_isMonthYearChanged:function(){var d=function(f,e){if(f.getMonth()!==e.getMonth()||f.getYear()!==e.getYear()){return true}return false};var c=this.model.get("timeline");return d(c._previousAttributes.startDate,c.attributes.startDate)||d(c._previousAttributes.endDate,c.attributes.endDate)},_isWeekChanged:function(){var c=function(l,k){var j=moment(l);var i=moment(k);return j.get("year")===i.get("year")&&j.isoWeek()===i.isoWeek()};var d=this.model.get("timeline");var g=d._previousAttributes.startDate;var h=d.attributes.startDate;var f=d._previousAttributes.endDate;var e=d.attributes.endDate;return !(c(g,h)&&c(f,e))},_isTimelineChanged:function(){var d=this.model.get("timeline");var c=d.changed.displayOption;if(c){this.model.updateDurationUnit(d.get("displayOption"))}else{c=d.get("displayOption")===Roadmap.TIMELINE_DISPLAY_OPTION.MONTH?this._isMonthYearChanged():this._isWeekChanged()}return c},resize:function(){this._updateLaneWidth();this._updateTimelineColumnHeight();this.$roadmapContent.css({top:this.$roadmapTimeline.find(".roadmap-column-title:first").innerHeight()})}})})(AJS.$,window._);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-roadmap-plugin:roadmap-analytics-resources', location = 'analytics/roadmap-analytics.js' */
Confluence.Roadmap=Confluence.Roadmap||{};Confluence.Roadmap.Analytics=(function(f,j){var c={INSERT:"confluence.roadmap.insert",CREATE:"confluence.roadmap.create",EDIT:"confluence.roadmap.edit",EDIT_ACTIONS:{OPEN_BAR_DIALOG:"confluence.roadmap.editmode.open_bar_dialog",ADD_DESCRIPTION:"confluence.roadmap.editmode.add_description",ADD_PAGE_LINK:"confluence.roadmap.editmode.add_page_link"},VIEW_ACTIONS:{OPEN_BAR_DIALOG:"confluence.roadmap.viewmode.open_bar_dialog",CLICK_PAGE_LINK:"confluence.roadmap.viewmode.click_page_link",ADD_PAGE_LINK:"confluence.roadmap.viewmode.add_page_link"}};function h(o,p){AJS.trigger("analytics",{name:o,data:p})}function m(p){var o=0;j.each(p.lanes,function(q){o=o+q.bars.length});return{lanes:p.lanes.length,bars:o,markers:p.markers.length,months:Confluence.Roadmap.DateUtilities.getNumberOfMonths(p.timeline.startDate,p.timeline.endDate)+1}}function k(){h(c.INSERT)}function d(p){var o=m(p);h(c.CREATE,o)}function e(p){var o=m(p);h(c.EDIT,o)}function a(){h(c.EDIT_ACTIONS.OPEN_BAR_DIALOG)}function n(){h(c.VIEW_ACTIONS.OPEN_BAR_DIALOG)}function b(){h(c.VIEW_ACTIONS.CLICK_PAGE_LINK)}function l(){h(c.EDIT_ACTIONS.ADD_DESCRIPTION)}function g(o){h(c.EDIT_ACTIONS.ADD_PAGE_LINK,o)}function i(o){h(c.VIEW_ACTIONS.ADD_PAGE_LINK,o)}return{insertRoadmap:k,createRoadmap:d,editRoadmap:e,openBarDialogInEdit:a,addDescription:l,addPageLinkEditMode:g,addPageLinkViewMode:i,openBarDialogInView:n,clickPageLink:b}})(AJS.$,window._);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-roadmap-plugin:roadmap-editor-resources', location = 'lib/jquery.viewport.js' */
(function(a){a.belowthefold=function(c,d){var b=a(window).height()+a(window).scrollTop();return b<=a(c).offset().top-d.threshold};a.abovethetop=function(b,c){var d=a(window).scrollTop();return d>=a(b).offset().top+a(b).height()-c.threshold};a.rightofscreen=function(c,d){var b=a(window).width()+a(window).scrollLeft();return(b<=a(c).offset().left-d.threshold)||a(c).offset().left<0};a.leftofscreen=function(b,c){var d=a(window).scrollLeft();return d>=a(b).offset().left+a(b).width()-c.threshold};a.inviewport=function(b,c){return !a.rightofscreen(b,c)&&!a.leftofscreen(b,c)&&!a.belowthefold(b,c)&&!a.abovethetop(b,c)};a.extend(a.expr[":"],{"below-the-fold":function(c,d,b){return a.belowthefold(c,{threshold:0})},"above-the-top":function(c,d,b){return a.abovethetop(c,{threshold:0})},"left-of-screen":function(c,d,b){return a.leftofscreen(c,{threshold:0})},"right-of-screen":function(c,d,b){return a.rightofscreen(c,{threshold:0})},"in-viewport":function(c,d,b){return a.inviewport(c,{threshold:0})}})})(jQuery);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-roadmap-plugin:roadmap-editor-resources', location = 'lib/jquery.ellipsis.min.js' */
/*! jQuery ellipsis - v1.1.1 - 2014-02-23
* https://github.com/STAR-ZERO/jquery-ellipsis
* Copyright (c) 2014 Kenji Abe; Licensed MIT */
!function(a){a.fn.ellipsis=function(b){var c={row:1,onlyFullWords:!1,"char":"...",callback:function(){},position:"tail"};return b=a.extend(c,b),this.each(function(){var c=a(this),d=c.text(),e=d,f=e.length,g=c.height();c.text("a");var h=parseFloat(c.css("lineHeight"),10),i=c.height(),j=h>i?h-i:0,k=j*(b.row-1)+i*b.row;if(k>=g)return c.text(d),void b.callback.call(this);var l=1,m=0,n=d.length;if("tail"===b.position){for(;n>l;)m=Math.ceil((l+n)/2),c.text(d.slice(0,m)+b["char"]),c.height()<=k?l=m:n=m-1;d=d.slice(0,l),b.onlyFullWords&&(d=d.replace(/[\u00AD\w\uac00-\ud7af]+$/,"")),d+=b["char"]}else if("middle"===b.position){for(var o=0;n>l;)m=Math.ceil((l+n)/2),o=Math.max(f-m,0),c.text(e.slice(0,Math.floor((f-o)/2))+b["char"]+e.slice(Math.floor((f+o)/2),f)),c.height()<=k?l=m:n=m-1;o=Math.max(f-l,0);var p=e.slice(0,Math.floor((f-o)/2)),q=e.slice(Math.floor((f+o)/2),f);b.onlyFullWords&&(p=p.replace(/[\u00AD\w\uac00-\ud7af]+$/,"")),d=p+b["char"]+q}c.text(d),b.callback.call(this)}),this}}(jQuery);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-roadmap-plugin:roadmap-editor-resources', location = 'editor/md5.js' */
var hexcase=0;var b64pad="";function hex_md5(a){return rstr2hex(rstr_md5(str2rstr_utf8(a)))}function b64_md5(a){return rstr2b64(rstr_md5(str2rstr_utf8(a)))}function any_md5(a,b){return rstr2any(rstr_md5(str2rstr_utf8(a)),b)}function hex_hmac_md5(a,b){return rstr2hex(rstr_hmac_md5(str2rstr_utf8(a),str2rstr_utf8(b)))}function b64_hmac_md5(a,b){return rstr2b64(rstr_hmac_md5(str2rstr_utf8(a),str2rstr_utf8(b)))}function any_hmac_md5(a,c,b){return rstr2any(rstr_hmac_md5(str2rstr_utf8(a),str2rstr_utf8(c)),b)}function md5_vm_test(){return hex_md5("abc").toLowerCase()=="900150983cd24fb0d6963f7d28e17f72"}function rstr_md5(a){return binl2rstr(binl_md5(rstr2binl(a),a.length*8))}function rstr_hmac_md5(c,f){var e=rstr2binl(c);if(e.length>16){e=binl_md5(e,c.length*8)}var a=Array(16),d=Array(16);for(var b=0;b<16;b++){a[b]=e[b]^909522486;d[b]=e[b]^1549556828}var g=binl_md5(a.concat(rstr2binl(f)),512+f.length*8);return binl2rstr(binl_md5(d.concat(g),512+128))}function rstr2hex(c){try{hexcase}catch(g){hexcase=0}var f=hexcase?"0123456789ABCDEF":"0123456789abcdef";var b="";var a;for(var d=0;d<c.length;d++){a=c.charCodeAt(d);b+=f.charAt((a>>>4)&15)+f.charAt(a&15)}return b}function rstr2b64(c){try{b64pad}catch(h){b64pad=""}var g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var b="";var a=c.length;for(var f=0;f<a;f+=3){var k=(c.charCodeAt(f)<<16)|(f+1<a?c.charCodeAt(f+1)<<8:0)|(f+2<a?c.charCodeAt(f+2):0);for(var d=0;d<4;d++){if(f*8+d*6>c.length*8){b+=b64pad}else{b+=g.charAt((k>>>6*(3-d))&63)}}}return b}function rstr2any(m,c){var b=c.length;var l,f,a,n,e;var k=Array(Math.ceil(m.length/2));for(l=0;l<k.length;l++){k[l]=(m.charCodeAt(l*2)<<8)|m.charCodeAt(l*2+1)}var h=Math.ceil(m.length*8/(Math.log(c.length)/Math.log(2)));var g=Array(h);for(f=0;f<h;f++){e=Array();n=0;for(l=0;l<k.length;l++){n=(n<<16)+k[l];a=Math.floor(n/b);n-=a*b;if(e.length>0||a>0){e[e.length]=a}}g[f]=n;k=e}var d="";for(l=g.length-1;l>=0;l--){d+=c.charAt(g[l])}return d}function str2rstr_utf8(c){var b="";var d=-1;var a,e;while(++d<c.length){a=c.charCodeAt(d);e=d+1<c.length?c.charCodeAt(d+1):0;if(55296<=a&&a<=56319&&56320<=e&&e<=57343){a=65536+((a&1023)<<10)+(e&1023);d++}if(a<=127){b+=String.fromCharCode(a)}else{if(a<=2047){b+=String.fromCharCode(192|((a>>>6)&31),128|(a&63))}else{if(a<=65535){b+=String.fromCharCode(224|((a>>>12)&15),128|((a>>>6)&63),128|(a&63))}else{if(a<=2097151){b+=String.fromCharCode(240|((a>>>18)&7),128|((a>>>12)&63),128|((a>>>6)&63),128|(a&63))}}}}}return b}function str2rstr_utf16le(b){var a="";for(var c=0;c<b.length;c++){a+=String.fromCharCode(b.charCodeAt(c)&255,(b.charCodeAt(c)>>>8)&255)}return a}function str2rstr_utf16be(b){var a="";for(var c=0;c<b.length;c++){a+=String.fromCharCode((b.charCodeAt(c)>>>8)&255,b.charCodeAt(c)&255)}return a}function rstr2binl(b){var a=Array(b.length>>2);for(var c=0;c<a.length;c++){a[c]=0}for(var c=0;c<b.length*8;c+=8){a[c>>5]|=(b.charCodeAt(c/8)&255)<<(c%32)}return a}function binl2rstr(b){var a="";for(var c=0;c<b.length*32;c+=8){a+=String.fromCharCode((b[c>>5]>>>(c%32))&255)}return a}function binl_md5(p,k){p[k>>5]|=128<<((k)%32);p[(((k+64)>>>9)<<4)+14]=k;var o=1732584193;var n=-271733879;var m=-1732584194;var l=271733878;for(var g=0;g<p.length;g+=16){var j=o;var h=n;var f=m;var e=l;o=md5_ff(o,n,m,l,p[g+0],7,-680876936);l=md5_ff(l,o,n,m,p[g+1],12,-389564586);m=md5_ff(m,l,o,n,p[g+2],17,606105819);n=md5_ff(n,m,l,o,p[g+3],22,-1044525330);o=md5_ff(o,n,m,l,p[g+4],7,-176418897);l=md5_ff(l,o,n,m,p[g+5],12,1200080426);m=md5_ff(m,l,o,n,p[g+6],17,-1473231341);n=md5_ff(n,m,l,o,p[g+7],22,-45705983);o=md5_ff(o,n,m,l,p[g+8],7,1770035416);l=md5_ff(l,o,n,m,p[g+9],12,-1958414417);m=md5_ff(m,l,o,n,p[g+10],17,-42063);n=md5_ff(n,m,l,o,p[g+11],22,-1990404162);o=md5_ff(o,n,m,l,p[g+12],7,1804603682);l=md5_ff(l,o,n,m,p[g+13],12,-40341101);m=md5_ff(m,l,o,n,p[g+14],17,-1502002290);n=md5_ff(n,m,l,o,p[g+15],22,1236535329);o=md5_gg(o,n,m,l,p[g+1],5,-165796510);l=md5_gg(l,o,n,m,p[g+6],9,-1069501632);m=md5_gg(m,l,o,n,p[g+11],14,643717713);n=md5_gg(n,m,l,o,p[g+0],20,-373897302);o=md5_gg(o,n,m,l,p[g+5],5,-701558691);l=md5_gg(l,o,n,m,p[g+10],9,38016083);m=md5_gg(m,l,o,n,p[g+15],14,-660478335);n=md5_gg(n,m,l,o,p[g+4],20,-405537848);o=md5_gg(o,n,m,l,p[g+9],5,568446438);l=md5_gg(l,o,n,m,p[g+14],9,-1019803690);m=md5_gg(m,l,o,n,p[g+3],14,-187363961);n=md5_gg(n,m,l,o,p[g+8],20,1163531501);o=md5_gg(o,n,m,l,p[g+13],5,-1444681467);l=md5_gg(l,o,n,m,p[g+2],9,-51403784);m=md5_gg(m,l,o,n,p[g+7],14,1735328473);n=md5_gg(n,m,l,o,p[g+12],20,-1926607734);o=md5_hh(o,n,m,l,p[g+5],4,-378558);l=md5_hh(l,o,n,m,p[g+8],11,-2022574463);m=md5_hh(m,l,o,n,p[g+11],16,1839030562);n=md5_hh(n,m,l,o,p[g+14],23,-35309556);o=md5_hh(o,n,m,l,p[g+1],4,-1530992060);l=md5_hh(l,o,n,m,p[g+4],11,1272893353);m=md5_hh(m,l,o,n,p[g+7],16,-155497632);n=md5_hh(n,m,l,o,p[g+10],23,-1094730640);o=md5_hh(o,n,m,l,p[g+13],4,681279174);l=md5_hh(l,o,n,m,p[g+0],11,-358537222);m=md5_hh(m,l,o,n,p[g+3],16,-722521979);n=md5_hh(n,m,l,o,p[g+6],23,76029189);o=md5_hh(o,n,m,l,p[g+9],4,-640364487);l=md5_hh(l,o,n,m,p[g+12],11,-421815835);m=md5_hh(m,l,o,n,p[g+15],16,530742520);n=md5_hh(n,m,l,o,p[g+2],23,-995338651);o=md5_ii(o,n,m,l,p[g+0],6,-198630844);l=md5_ii(l,o,n,m,p[g+7],10,1126891415);m=md5_ii(m,l,o,n,p[g+14],15,-1416354905);n=md5_ii(n,m,l,o,p[g+5],21,-57434055);o=md5_ii(o,n,m,l,p[g+12],6,1700485571);l=md5_ii(l,o,n,m,p[g+3],10,-1894986606);m=md5_ii(m,l,o,n,p[g+10],15,-1051523);n=md5_ii(n,m,l,o,p[g+1],21,-2054922799);o=md5_ii(o,n,m,l,p[g+8],6,1873313359);l=md5_ii(l,o,n,m,p[g+15],10,-30611744);m=md5_ii(m,l,o,n,p[g+6],15,-1560198380);n=md5_ii(n,m,l,o,p[g+13],21,1309151649);o=md5_ii(o,n,m,l,p[g+4],6,-145523070);l=md5_ii(l,o,n,m,p[g+11],10,-1120210379);m=md5_ii(m,l,o,n,p[g+2],15,718787259);n=md5_ii(n,m,l,o,p[g+9],21,-343485551);o=safe_add(o,j);n=safe_add(n,h);m=safe_add(m,f);l=safe_add(l,e)}return Array(o,n,m,l)}function md5_cmn(h,e,d,c,g,f){return safe_add(bit_rol(safe_add(safe_add(e,h),safe_add(c,f)),g),d)}function md5_ff(g,f,k,j,e,i,h){return md5_cmn((f&k)|((~f)&j),g,f,e,i,h)}function md5_gg(g,f,k,j,e,i,h){return md5_cmn((f&j)|(k&(~j)),g,f,e,i,h)}function md5_hh(g,f,k,j,e,i,h){return md5_cmn(f^k^j,g,f,e,i,h)}function md5_ii(g,f,k,j,e,i,h){return md5_cmn(k^(f|(~j)),g,f,e,i,h)}function safe_add(a,d){var c=(a&65535)+(d&65535);var b=(a>>16)+(d>>16)+(c>>16);return(b<<16)|(c&65535)}function bit_rol(a,b){return(a<<b)|(a>>>(32-b))};
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-roadmap-plugin:roadmap-editor-resources', location = 'editor/roadmap-editor.js' */
AJS.toInit(function(g){var h,d,a,c,e;var f="~~~~~";AJS.MacroBrowser.setMacroJsOverride("roadmap",{opener:function(m){var o=function(t,r,s,u){var q=s?s.split(f):[];var p=r?r.split(f):[];if(!_.isEmpty(q)){g.ajax({type:"POST",contentType:"application/json",url:AJS.contextPath()+"/rest/roadmap/1.0/extractPageLinks",data:JSON.stringify({wikiLinks:_.object(q,p),roadmapSpace:AJS.Meta.get("space-key")}),success:function(v){_.each(t.lanes,function(w){_.chain(w.bars).filter(function(x){return _.contains(q,x.id)}).each(function(x){if(v[x.id]){x.pageLink=v[x.id]}})});u&&u()},error:function(v){AJS.log(v);u&&u()}})}else{u&&u()}},n=function(q){var r=[];var p=[];q.lanes.forEach(function(s){s.bars.forEach(function(t){if(!_.isEmpty(t.pageLink)){var u=t.pageLink.wikiLink.replace(/[\][]/g,"");r.push(_.escape(u));p.push(t.id)}})});return{pageLinks:r.join(f),mapLinks:p.join(f)}};if(m.params&&m.params.timeline!=="true"){var j="roadmap-deprecation-dialog";var k=g(Confluence.Templates.Roadmap.deprecationDialog({id:j}));AJS.dialog2(k).on("hide",function(){g("#"+j).remove()}).on("show",function(){g("#dialog-close-button",k).click(function(p){p.preventDefault();AJS.dialog2("#"+j).hide()})}).show();return false}var i;var l=function(){var q="confluence-roadmap-dialog";var u="roadmap-popup-panel";var t;if(typeof h=="undefined"){h=aui.dialog.dialog2({id:q,size:"xlarge",titleText:"Insert Roadmap Planner",content:Confluence.Templates.Roadmap.roadmapPopupPanel({roadmapPopupPanelId:u}),footerActionContent:Confluence.Templates.Roadmap.footerActionContent(),modal:true});d=g(h).appendTo(g("body"));d.find("#roadmapInsertBtn").on("click",function(z){c.removeDialog();var w=c.model.toMacroData();var x=encodeURIComponent(JSON.stringify(w));var y=hex_md5(x);var A=n(w);var v={timeline:"true",source:x,hash:y,title:encodeURIComponent(w.title),pagelinks:A.pageLinks,maplinks:A.mapLinks};tinymce.confluence.macrobrowser.macroBrowserComplete({name:"roadmap",params:v});c.remove();t.hide();if(e){Confluence.Roadmap.Analytics.createRoadmap(w)}else{Confluence.Roadmap.Analytics.editRoadmap(w)}});d.find("#roadmapCancelBtn").on("click",function(v){c.removeDialog();c.remove();t.hide()});a=d.find(".roadmap-editor-popup")}t=AJS.dialog2("#"+q).show();var p=g("#"+u);var r=p.find(".roadmap-view");if(!r.length){r=g('<div class="roadmap-view"/>');p.append(r)}var s=new Roadmap.Roadmap(i,{parse:true});c=new Roadmap.RoadmapEditorView({model:s,dialogId:q,el:r,roadmapEditorPopup:a});c.render();b()};if(m.params&&m.params.source){e=false;i=JSON.parse(decodeURIComponent(m.params.source));o(i,m.params.pagelinks,m.params.maplinks,l)}else{e=true;Confluence.Roadmap.Analytics.insertRoadmap();l()}}});function b(){setTimeout(function(){if(d&&d.is(":visible")){var l=d.height(),k=d.find(".aui-dialog2-header").outerHeight(),m=d.find(".aui-dialog2-footer").outerHeight(),j=d.find("#roadmap-editor-toolbar").outerHeight(),i=d.find(".roadmap-editor-popup");i.css("height",l-k-m-j)}},0)}g(window).resize(function(){b();c&&c.resize()})})(AJS.$);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-roadmap-plugin:roadmap-editor-resources', location = 'editor/roadmap-editor-config.js' */
(function(){window.Roadmap=window.Roadmap||{};Roadmap.COLORS=[{lane:"#f6c342",bar:"#fadb8e",text:"#594300"},{lane:"#3b7fc4",bar:"#6c9fd3",text:"#ffffff"},{lane:"#d04437",bar:"#dc7369",text:"#ffffff"},{lane:"#8eb021",bar:"#aac459",text:"#ffffff"},{lane:"#ea632b",bar:"#ef8a60",text:"#ffffff"},{lane:"#654982",bar:"#8c77a1",text:"#ffffff"},{lane:"#f15c75",bar:"#f58598",text:"#ffffff"},{lane:"#815b3a",bar:"#a1846b",text:"#ffffff"}];Roadmap.TIMELINE_DISPLAY_OPTION={MONTH:"MONTH",WEEK:"WEEK"};Roadmap.SHORT_DATE_FORMAT="YYYY-MM-DD";Roadmap.TWO_YY_SHORT_DATE_FORMAT="YY-MM-DD";Roadmap.DATE_FORMAT="YYYY-MM-DD HH:mm:ss";Roadmap.WEEK_FORMAT="DD-MMM";Roadmap.MONTH_FORMAT="MMM";Roadmap.TIMELINE_YEARS_LIMIT=5;Roadmap.LANE_TITLE_WIDTH=45;Roadmap.MARKER_HEIGHT_PADDING=10;Roadmap.MARKER_TITLE_LINE=2;Roadmap.LANE_PADDING=11;Roadmap.BAR_PADDING=8;Roadmap.BAR_MARGIN=1;Roadmap.BAR_BORDER=1;Roadmap.MONTH_WIDTH=101;Roadmap.WEEK_WIDTH=101;Roadmap.EXTRA_SPACE_AROUND=Roadmap.BAR_PADDING*2+Roadmap.BAR_BORDER*2;Roadmap.MONTH_BAR_MIN_WIDTH=Roadmap.MONTH_WIDTH/4-Roadmap.EXTRA_SPACE_AROUND;Roadmap.WEEK_BAR_MIN_WIDTH=Roadmap.WEEK_WIDTH-Roadmap.EXTRA_SPACE_AROUND;Roadmap.barMinWidth=Roadmap.MONTH_BAR_MIN_WIDTH;Roadmap.TRANSPARENT_LANE={title:"",color:{lane:"#ffffff",bar:"#ffffff",text:"#ffffff"}};Roadmap.DragDrop={};Roadmap.BarDialog={MAX_LENGTH_TITLE:100,MAX_LENGTH_DESCRIPTION:150};Roadmap.getDefaultRoadmapData=function(){var a=moment(new Date()).hours(0).minutes(0).seconds(0).milliseconds(0).toDate();var b=moment(a).add(11,"months").toDate();return{title:"Roadmap Planner",timeline:{startDate:new Date(a),endDate:b,displayOption:Roadmap.TIMELINE_DISPLAY_OPTION.MONTH},lanes:[{title:"Lane 1",color:Roadmap.COLORS[0],bars:[{title:"Bar 1",description:"This is the first bar.",startDate:new Date(a.setDate(1)),duration:2,rowIndex:0},{title:"Bar 2",description:"This is the second bar.",startDate:new Date(a),duration:1,rowIndex:1}]},{title:"Lane 2",color:Roadmap.COLORS[1],bars:[{title:"Bar 3",description:"This is the third bar.",startDate:a,duration:2.5,rowIndex:0}]}],markers:[{title:"Marker 1",markerDate:moment(a).date(15).toDate()}]}}})();
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.content-formatting-macros:content-formatting-macros-resources', location = '/templates/align.soy' */
// This file was automatically generated from align.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.ContentFormatting.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.ContentFormatting == 'undefined') { Confluence.Templates.ContentFormatting = {}; }


Confluence.Templates.ContentFormatting.align = function(opt_data, opt_ignored) {
  return '<div style="text-align: ' + soy.$$escapeHtml(opt_data.align) + ';"' + ((opt_data['class']) ? 'class="' + soy.$$escapeHtml(opt_data['class']) + '"' : '') + ((opt_data.id) ? 'id="' + soy.$$escapeHtml(opt_data.id) + '"' : '') + '>' + soy.$$filterNoAutoescape(opt_data.macroBodyWithHtml) + '</div>';
};
if (goog.DEBUG) {
  Confluence.Templates.ContentFormatting.align.soyTemplateName = 'Confluence.Templates.ContentFormatting.align';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.content-formatting-macros:content-formatting-macros-resources', location = '/templates/center.soy' */
// This file was automatically generated from center.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.ContentFormatting.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.ContentFormatting == 'undefined') { Confluence.Templates.ContentFormatting = {}; }


Confluence.Templates.ContentFormatting.center = function(opt_data, opt_ignored) {
  return '<div style="text-align:center;"' + ((opt_data['class']) ? 'class="' + soy.$$escapeHtml(opt_data['class']) + '"' : '') + ((opt_data.id) ? 'id="' + soy.$$escapeHtml(opt_data.id) + '"' : '') + '>' + soy.$$filterNoAutoescape(opt_data.macroBodyWithHtml) + '</div>';
};
if (goog.DEBUG) {
  Confluence.Templates.ContentFormatting.center.soyTemplateName = 'Confluence.Templates.ContentFormatting.center';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.content-formatting-macros:content-formatting-macros-resources', location = '/js/clickable.js' */
jQuery(function(a){a(".clickable").live("click",function(c){if(a(c.target).closest("a[href]").length===0&&a(c.target).closest(".clickable").length===1){var b=a(this).attr("href")||a("a[href]:first",this).attr("href");if(b){location.href=b}}})});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.content-formatting-macros:content-formatting-macros-resources', location = '/templates/colgroup.soy' */
// This file was automatically generated from colgroup.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.ContentFormatting.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.ContentFormatting == 'undefined') { Confluence.Templates.ContentFormatting = {}; }


Confluence.Templates.ContentFormatting.colgroup = function(opt_data, opt_ignored) {
  return '<colgroup' + ((opt_data.id) ? ' id="' + soy.$$escapeHtml(opt_data.id) + '"' : '') + ((opt_data['class']) ? ' class="' + soy.$$escapeHtml(opt_data['class']) + '"' : '') + ((opt_data.width) ? ' width="' + soy.$$escapeHtml(opt_data.width) + '"' : '') + ((opt_data.span) ? ' span="' + soy.$$escapeHtml(opt_data.span) + '"' : '') + '>' + soy.$$escapeHtml(opt_data.macroBodyWithHtml) + '</colgroup>';
};
if (goog.DEBUG) {
  Confluence.Templates.ContentFormatting.colgroup.soyTemplateName = 'Confluence.Templates.ContentFormatting.colgroup';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.content-formatting-macros:content-formatting-macros-resources', location = '/templates/comment.soy' */
// This file was automatically generated from comment.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.ContentFormatting.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.ContentFormatting == 'undefined') { Confluence.Templates.ContentFormatting = {}; }


Confluence.Templates.ContentFormatting.comment = function(opt_data, opt_ignored) {
  return '<!--' + soy.$$filterNoAutoescape(opt_data.macroBodyWithHtml) + '-->';
};
if (goog.DEBUG) {
  Confluence.Templates.ContentFormatting.comment.soyTemplateName = 'Confluence.Templates.ContentFormatting.comment';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.content-formatting-macros:content-formatting-macros-resources', location = '/templates/img.soy' */
// This file was automatically generated from img.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.ContentFormatting.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.ContentFormatting == 'undefined') { Confluence.Templates.ContentFormatting = {}; }


Confluence.Templates.ContentFormatting.img = function(opt_data, opt_ignored) {
  return '<img' + ((opt_data.id) ? '        id ="' + soy.$$escapeHtml(opt_data.id) + '"              ' : '') + ((opt_data['class']) ? '     class="' + soy.$$escapeHtml(opt_data['class']) + '"         ' : '') + ((opt_data.title) ? '     title="' + soy.$$escapeHtml(opt_data.title) + '"         ' : '') + ((opt_data.style) ? '     style="' + soy.$$escapeHtml(opt_data.style) + '"         ' : '') + ((opt_data.dir) ? '       dir="' + soy.$$escapeHtml(opt_data.dir) + '"             ' : '') + ((opt_data.align) ? '     align="' + soy.$$escapeHtml(opt_data.align) + '"         ' : '') + ((opt_data.lang) ? '      lang="' + soy.$$escapeHtml(opt_data.lang) + '"           ' : '') + ((opt_data.height) ? '    height="' + soy.$$escapeHtml(opt_data.height) + '"       ' : '') + ((opt_data.width) ? '     width="' + soy.$$escapeHtml(opt_data.width) + '"         ' : '') + ((opt_data.border) ? '    border="' + soy.$$escapeHtml(opt_data.border) + '"       ' : '') + ((opt_data.src) ? '       src="' + soy.$$escapeHtml(opt_data.src) + '"             ' : '') + ((opt_data.alt) ? '       alt="' + soy.$$escapeHtml(opt_data.alt) + '"             ' : '') + ((opt_data.longdesc) ? '  longdesc="' + soy.$$escapeHtml(opt_data.longdesc) + '"   ' : '') + ((opt_data.ismap) ? '     ismap                    ' : '') + ((opt_data.usemap) ? '    usemap="' + soy.$$escapeHtml(opt_data.usemap) + '"       ' : '') + '/>';
};
if (goog.DEBUG) {
  Confluence.Templates.ContentFormatting.img.soyTemplateName = 'Confluence.Templates.ContentFormatting.img';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.content-formatting-macros:content-formatting-macros-resources', location = '/templates/list.soy' */
// This file was automatically generated from list.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.ContentFormatting.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.ContentFormatting == 'undefined') { Confluence.Templates.ContentFormatting = {}; }


Confluence.Templates.ContentFormatting.orderedList = function(opt_data, opt_ignored) {
  return '<ol' + ((opt_data.id) ? ' id="' + soy.$$escapeHtml(opt_data.id) + '"' : '') + ((opt_data['class']) ? ' class="' + soy.$$escapeHtml(opt_data['class']) + '"' : '') + ((opt_data.style) ? ' style="' + soy.$$escapeHtml(opt_data.style) + '"' : '') + ((opt_data.title) ? ' title="' + soy.$$escapeHtml(opt_data.title) + '"' : '') + ((opt_data.dir) ? ' dir="' + soy.$$escapeHtml(opt_data.dir) + '"' : '') + ((opt_data.lang) ? ' lang="' + soy.$$escapeHtml(opt_data.lang) + '"' : '') + '>' + soy.$$filterNoAutoescape(opt_data.macroBodyWithHtml) + '</ol>';
};
if (goog.DEBUG) {
  Confluence.Templates.ContentFormatting.orderedList.soyTemplateName = 'Confluence.Templates.ContentFormatting.orderedList';
}


Confluence.Templates.ContentFormatting.unorderedList = function(opt_data, opt_ignored) {
  return '<ul' + ((opt_data.id) ? ' id="' + soy.$$escapeHtml(opt_data.id) + '"' : '') + ((opt_data['class']) ? ' class="' + soy.$$escapeHtml(opt_data['class']) + '"' : '') + ((opt_data.style) ? ' style="' + soy.$$escapeHtml(opt_data.style) + '"' : '') + ((opt_data.title) ? ' title="' + soy.$$escapeHtml(opt_data.title) + '"' : '') + ((opt_data.dir) ? ' dir="' + soy.$$escapeHtml(opt_data.dir) + '"' : '') + ((opt_data.lang) ? ' lang="' + soy.$$escapeHtml(opt_data.lang) + '"' : '') + '>' + soy.$$filterNoAutoescape(opt_data.macroBodyWithHtml) + '</ul>';
};
if (goog.DEBUG) {
  Confluence.Templates.ContentFormatting.unorderedList.soyTemplateName = 'Confluence.Templates.ContentFormatting.unorderedList';
}


Confluence.Templates.ContentFormatting.listItem = function(opt_data, opt_ignored) {
  return '<li' + ((opt_data.id) ? ' id="' + soy.$$escapeHtml(opt_data.id) + '"' : '') + ((opt_data['class']) ? ' class="' + soy.$$escapeHtml(opt_data['class']) + '"' : '') + ((opt_data.style) ? ' style="' + soy.$$escapeHtml(opt_data.style) + '"' : '') + ((opt_data.title) ? ' title="' + soy.$$escapeHtml(opt_data.title) + '"' : '') + ((opt_data.dir) ? ' dir="' + soy.$$escapeHtml(opt_data.dir) + '"' : '') + ((opt_data.lang) ? ' lang="' + soy.$$escapeHtml(opt_data.lang) + '"' : '') + '>' + soy.$$escapeHtml(opt_data.macroBodyWithHtml) + '</li>';
};
if (goog.DEBUG) {
  Confluence.Templates.ContentFormatting.listItem.soyTemplateName = 'Confluence.Templates.ContentFormatting.listItem';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.content-formatting-macros:content-formatting-macros-resources', location = '/templates/lozenge.soy' */
// This file was automatically generated from lozenge.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.ContentFormatting.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.ContentFormatting == 'undefined') { Confluence.Templates.ContentFormatting = {}; }


Confluence.Templates.ContentFormatting.lozenge = function(opt_data, opt_ignored) {
  return soy.$$escapeHtml(webResourceManager_requireResource('com.atlassian.confluence.plugins.content-formatting-macros:content-formatting-macros-lozenge-resources')) + '<table cellspacing="0" cellpadding="0" data-hasbody="true" data-macro-name="lozenge"' + ((opt_data.width) ? 'style="' + soy.$$escapeHtml(opt_data.width) + '"' : '') + ((opt_data.link) ? 'class="lozenge clickable" href="' + soy.$$escapeHtml(opt_data.link) + '"' : 'class="lozenge"') + '><tbody><tr><td style="background-image: url(\'' + soy.$$escapeHtml("/wiki") + soy.$$escapeHtml(opt_data.lozengeImage) + '\')" class="lozenge-icon" rowspan="3"></td><td class="top" colspan="2"> </td><td class="topRight"> </td></tr><tr><td class="breaker"> </td><td style="width:240px" class="body"><div class="lozenge-heading"><a class="external-link" rel="nofollow"' + ((opt_data.link) ? 'href="' + soy.$$escapeHtml(opt_data.link) + '"' : '') + ((opt_data.title) ? 'title="' + soy.$$escapeHtml(opt_data.title) + '"' : '') + '>' + ((opt_data.title) ? soy.$$escapeHtml(opt_data.title) : '') + '</a></div><div class="lozenge-body">' + soy.$$filterNoAutoescape(opt_data.macroBodyWithHtml) + '</div></td><td class="right"> </td></tr><tr><td class="bottom" colspan="2"> </td><td class="bottomRight"> </td></tr></tbody></table>';
};
if (goog.DEBUG) {
  Confluence.Templates.ContentFormatting.lozenge.soyTemplateName = 'Confluence.Templates.ContentFormatting.lozenge';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.content-formatting-macros:content-formatting-macros-resources', location = '/templates/pre.soy' */
// This file was automatically generated from pre.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.ContentFormatting.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.ContentFormatting == 'undefined') { Confluence.Templates.ContentFormatting = {}; }


Confluence.Templates.ContentFormatting.pre = function(opt_data, opt_ignored) {
  return '<pre' + ((opt_data.id) ? ' id="' + soy.$$escapeHtml(opt_data.id) + '"' : '') + ((opt_data['class']) ? ' class="' + soy.$$escapeHtml(opt_data['class']) + '"' : '') + ((opt_data.title) ? ' title="' + soy.$$escapeHtml(opt_data.title) + '"' : '') + ((opt_data.style) ? ' style="' + soy.$$escapeHtml(opt_data.style) + '"' : '') + ((opt_data.dir) ? ' dir="' + soy.$$escapeHtml(opt_data.dir) + '"' : '') + ((opt_data.lang) ? ' lang="' + soy.$$escapeHtml(opt_data.lang) + '"' : '') + ((opt_data.width) ? ' width="' + soy.$$escapeHtml(opt_data.width) + '"' : '') + '>' + soy.$$filterNoAutoescape(opt_data.macroBodyWithHtml) + '</pre>';
};
if (goog.DEBUG) {
  Confluence.Templates.ContentFormatting.pre.soyTemplateName = 'Confluence.Templates.ContentFormatting.pre';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.content-formatting-macros:content-formatting-macros-resources', location = '/templates/roundRect.soy' */
// This file was automatically generated from roundRect.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.ContentFormatting.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.ContentFormatting == 'undefined') { Confluence.Templates.ContentFormatting = {}; }


Confluence.Templates.ContentFormatting.roundRect = function(opt_data, opt_ignored) {
  return '<table cellspacing="0" cellpadding="0"' + ((opt_data.width) ? 'width="' + soy.$$escapeHtml(opt_data.width) + '"' : '') + ((opt_data.height) ? 'height="' + soy.$$escapeHtml(opt_data.height) + '"' : '') + ((opt_data['class']) ? 'class="' + soy.$$escapeHtml(opt_data['class']) + '"' : '') + ((opt_data.id) ? 'id="' + soy.$$escapeHtml(opt_data.id) + '"' : '') + '>' + ((opt_data.topRowVisible) ? '<tr valign="top" style="background-color:' + soy.$$escapeHtml(opt_data.titlebgcolor) + '"><td style="text-align:left; vertical-align:top; width:25px; height:25px;' + ((opt_data.topLeftCornerRounded) ? 'border-top-left-radius:' + soy.$$escapeHtml(opt_data.hSize) + ' ' + soy.$$escapeHtml(opt_data.vSize) + ';' : '') + '" > </td><td style="height:25px;">' + ((opt_data.title) ? soy.$$escapeHtml(opt_data.title) : '') + '</td><td style="text-align:right; vertical-align:top; width:25px; height:25px;' + ((opt_data.topRightCornerRounded) ? 'border-top-right-radius:' + soy.$$escapeHtml(opt_data.hSize) + ' ' + soy.$$escapeHtml(opt_data.vSize) + ';' : '') + '" > </td></tr>' : '') + ((opt_data.middleRowVisible) ? '<tr valign="top" style="background-color:' + soy.$$escapeHtml(opt_data.bgcolor) + '"><td colspan="3" style="padding: 0px 25px 0px 25px;"> ' + soy.$$filterNoAutoescape(opt_data.macroBodyWithHtml) + ' </td></tr>' : '') + ((opt_data.bottomRowVisible) ? '<tr valign="bottom" style="background-color:' + soy.$$escapeHtml(opt_data.footerbgcolor) + '"><td style="line-height:0; text-align:left; vertical-align:bottom; width:25px; height:25px;' + ((opt_data.bottomLeftCornerRounded) ? 'border-bottom-left-radius:' + soy.$$escapeHtml(opt_data.hSize) + ' ' + soy.$$escapeHtml(opt_data.vSize) + ';' : '') + '" > </td><td style="height:25px;">' + ((opt_data.footer) ? soy.$$escapeHtml(opt_data.footer) : '') + '</td><td style="text-align:right; vertical-align:bottom; width:25px; height:25px; line-height:0;' + ((opt_data.bottomRightCornerRounded) ? 'border-bottom-right-radius:' + soy.$$escapeHtml(opt_data.hSize) + ' ' + soy.$$escapeHtml(opt_data.vSize) + ';' : '') + '"> </td></tr>' : '') + '</table>';
};
if (goog.DEBUG) {
  Confluence.Templates.ContentFormatting.roundRect.soyTemplateName = 'Confluence.Templates.ContentFormatting.roundRect';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.content-formatting-macros:content-formatting-macros-resources', location = '/templates/style.soy' */
// This file was automatically generated from style.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.ContentFormatting.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.ContentFormatting == 'undefined') { Confluence.Templates.ContentFormatting = {}; }


Confluence.Templates.ContentFormatting.style = function(opt_data, opt_ignored) {
  return '<style>' + ((opt_data['import']) ? '@import url(\'' + soy.$$escapeHtml(opt_data['import']) + '\');\n' : '') + '@media ' + soy.$$escapeHtml(opt_data.media) + ' {\n' + soy.$$filterNoAutoescape(opt_data.macroBodyWithHtml) + '\n}</style>';
};
if (goog.DEBUG) {
  Confluence.Templates.ContentFormatting.style.soyTemplateName = 'Confluence.Templates.ContentFormatting.style';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.content-formatting-macros:content-formatting-macros-resources', location = '/templates/table.soy' */
// This file was automatically generated from table.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.ContentFormatting.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.ContentFormatting == 'undefined') { Confluence.Templates.ContentFormatting = {}; }


Confluence.Templates.ContentFormatting.table = function(opt_data, opt_ignored) {
  return '<table border="1" cellpadding="2" cellspacing="0" style="border-collapse:collapse;">' + soy.$$filterNoAutoescape(opt_data.macroBody) + '</table>';
};
if (goog.DEBUG) {
  Confluence.Templates.ContentFormatting.table.soyTemplateName = 'Confluence.Templates.ContentFormatting.table';
}


Confluence.Templates.ContentFormatting.tableRow = function(opt_data, opt_ignored) {
  return '<tr>' + soy.$$filterNoAutoescape(opt_data.macroBody) + '</tr>';
};
if (goog.DEBUG) {
  Confluence.Templates.ContentFormatting.tableRow.soyTemplateName = 'Confluence.Templates.ContentFormatting.tableRow';
}


Confluence.Templates.ContentFormatting.tableCell = function(opt_data, opt_ignored) {
  return '<td ' + ((opt_data.rowspan) ? 'rowspan="' + soy.$$escapeHtml(opt_data.rowspan) + '"' : '') + ((opt_data.colspan) ? 'colspan="' + soy.$$escapeHtml(opt_data.colspan) + '"' : '') + '>' + soy.$$filterNoAutoescape(opt_data.macroBody) + '</td>';
};
if (goog.DEBUG) {
  Confluence.Templates.ContentFormatting.tableCell.soyTemplateName = 'Confluence.Templates.ContentFormatting.tableCell';
}


Confluence.Templates.ContentFormatting.tableHead = function(opt_data, opt_ignored) {
  return '<thead>' + soy.$$filterNoAutoescape(opt_data.macroBody) + '</thead>';
};
if (goog.DEBUG) {
  Confluence.Templates.ContentFormatting.tableHead.soyTemplateName = 'Confluence.Templates.ContentFormatting.tableHead';
}


Confluence.Templates.ContentFormatting.tableHeaderCell = function(opt_data, opt_ignored) {
  return '<th>' + soy.$$filterNoAutoescape(opt_data.macroBody) + '</th>';
};
if (goog.DEBUG) {
  Confluence.Templates.ContentFormatting.tableHeaderCell.soyTemplateName = 'Confluence.Templates.ContentFormatting.tableHeaderCell';
}


Confluence.Templates.ContentFormatting.tableBody = function(opt_data, opt_ignored) {
  return '<tbody>' + soy.$$filterNoAutoescape(opt_data.macroBody) + '</tbody>';
};
if (goog.DEBUG) {
  Confluence.Templates.ContentFormatting.tableBody.soyTemplateName = 'Confluence.Templates.ContentFormatting.tableBody';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.web.resources:confluence-fixed-headers-editor-resources', location = 'includes/js/fh/slow-edit-handler.js' */
require(["confluence/fh/utils/dom","ajs","jquery"],function(c,a,d){a.toInit(function(){var b=a.Meta.get("browse-page-tree-mode");"create"!==b&&"edit"!==b||(c.addClassToPage(),d("#content").css({paddingRight:0}))})});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-paste:paste-resources', location = 'js/clipboard-access.js' */
define("confluence-paste/clipboard-access",["jquery","ajs","window","tinymce"],function(f,b,i,j){return function(){var g={initializeEditor:function(){b&&b.Rte&&b.Rte.BootstrapManager?b.Rte.BootstrapManager.addOnInitCallback(function(){var a=b.Rte.getEditor();a?i.MutationObserver&&!f.browser.webkit?(new MutationObserver(function(a){for(var d=0;d<a.length;d++){var b=a[d];if(b.addedNodes.length)for(var c=0;c<b.addedNodes.length;c++)if("img"===b.addedNodes[c].localName){i.setTimeout(g.pasteFromDataURL,
0);return}}})).observe(a.getDoc(),{childList:!0,subtree:!0}):a.onPaste.add(function(a,b){if(g.onPaste(b))return!0;j.dom.Event.cancel(b);return!1}):b.log("Could not getEditor from adapter")}):b.log("Could not initialize pasteHandler on Confluence.Editor")},pasteFromDataURL:function(){var a=f('img[src^="data:image"]:not(".editor-inline-macro")',j.activeEditor.getDoc());f.each(a,function(){var a=this.src,d,e;if(b.DarkFeatures.isEnabled("filestore.direct.upload")&&!b.DarkFeatures.isEnabled("filestore.direct.upload.force.disable")){var a=
a.split(","),c=atob(a[1]),h=c.length;d=c.length;for(a=new Uint8Array(h);h--;)a[h]=c.charCodeAt(h)}else{e="base64";a=a.substring(22,a.length);d=3*a.length/4;c=0;for(h=a.length-1;"="==a[h];h--)c++;d-=c}b.Confluence.Uploader.upload([g.createUploadFile(a,d,e)])});a.remove()},onPaste:function(a){return a&&a.clipboardData?g.pasteFromEvent(a):!0},showClipboardAccessError:function(){(new b.Dialog({width:400,closeOnOutsideClick:!0})).addPanel("alert",f("<div />",{text:"Your browser does not support pasting images from the clipboard."})).addButton("OK",
function(a){a.remove()}).show().updateHeight()},pasteFromEvent:function(a){if(a&&a.clipboardData){if(a.clipboardData.items){a=a.clipboardData.items[0];if(!a||"file"!=a.kind)return!0;a=a.getAsFile();a=g.createUploadFile(a,a.size);b.Confluence.Uploader.upload([a]);return!1}i.setTimeout(function(a){var b=f("img[src^='webkit-fake-url://']",j.activeEditor.getDoc());b.length&&(b.remove(),a.showClipboardAccessError())},0,this)}return!0},createUploadFile:function(a,b,d){var e=new Date,c=e.getMonth()+1;return{fileName:"image"+
e.getFullYear()+"-"+c+"-"+e.getDate()+"_"+e.getHours()+"-"+e.getMinutes()+"-"+e.getSeconds()+".png",fileSize:b,slice:function(b,c){return a.slice(b,b+c)},getAsBinary:function(){return a},getData:function(){return a},encoding:d}}};g.initializeEditor(f);return g}});require("confluence/module-exporter").safeRequire("confluence-paste/clipboard-access",function(f){require("ajs").toInit(f)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-paste:autoconvert-confluence', location = 'js/autoconvert/transformers/confluencepaste.js' */
define("confluence-paste/autoconvert/transformers/confluencepaste",["ajs","tinymce","jquery","document"],function(f,g,j,k){function i(){var d=this,e=function(c,a){return!a.anchor||0===a.anchor.indexOf("comment-")?c:c+"#"+a.anchor.substring(a.anchor.indexOf("-")+1)},l=function(c,a,h){if(a=(a=c.authority===k.location.host)&&(!f.contextPath()||0===c.path.indexOf(f.contextPath()))){var a=f.contextPath()?c.path.substring(f.contextPath().length+1):c.path.substring(1),a=decodeURIComponent(a).split("/"),
b;c.queryKey=c.queryKey||{};if(c.queryKey.focusedCommentId)b="$"+c.queryKey.focusedCommentId,b=e(b,c);else if(c.queryKey.pageId)b="$"+c.queryKey.pageId,b=e(b,c);else if("display"===a[0])2===a.length&&0===a[1].indexOf("~")?b=a[1]:3===a.length?(b=a[1]+":"+a[2].replace(/\+/g," "),b=e(b,c)):4===a.length&&"status"===a[1]?b="$"+a[3]:6===a.length&&(b=a[1]+":/"+a[2]+"/"+a[3]+"/"+a[4]+"/"+a[5].replace(/\+/g," "),b=e(b,c));else if("spaces"===a[0]){if(b=(b=d.spaViewPageLinkHandler(a))||d.spaBlogPostLinkHandler(a))c=
e(b,c);else{if((2===a.length||3===a.length)&&-1===a[1].indexOf(".action"))b=a[1]+":",b=e(b,c);c=b}b=c}else"users"===a[0]&&(2===a.length&&"viewuserprofile.action"==a[1]?b="~"+c.queryKey.username:2===a.length&&"viewmyprofile.action"==a[1]&&(b="~"+f.Meta.get("remote-user")));b?g.plugins.Autoconvert.getHtmlFromWikiMarkup("["+b+"]",function(a){h(j(a).children()[0])},function(){h()}):h()}else h()};this.init=function(){g.plugins.Autoconvert.autoConvert.addHandler(l)}}i.prototype.spaViewPageLinkHandler=function(d){var e=
d[3];if("spaces"===d[0]&&"pages"===d[2]&&e)return"$"+e};i.prototype.spaBlogPostLinkHandler=function(d){var e=d[1],g=d[3],c=d[4],a=d[5],h=d[6],b=d[7];if("spaces"===d[0]&&"blog"===d[2]&&e&&g&&c&&a&&h&&b)return f.format("{0}:/{1}/{2}/{3}/{4}",e,g,c,a,b.replace(/\+/g," "))};return i});require("confluence/module-exporter").safeRequire("confluence-paste/autoconvert/transformers/confluencepaste",function(f){var g=require("ajs"),f=new f;g.bind("init.rte",f.init)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-paste:autoconvert-youtu.be-rewrite', location = 'js/autoconvert/transformers/youtube.js' */
define("confluence-paste/autoconvert/transformers/youtube",["tinymce","jquery"],function(a,d){return function(){a.plugins.Autoconvert.autoConvert.addHandler(function(b,a,c){b.host.match(".*youtu.be.*")?(b="http://youtube.com/watch?v="+b.path.substr(1),c(d(a).attr("href",b).html(b))):c()})}});require("confluence/module-exporter").safeRequire("confluence-paste/autoconvert/transformers/youtube",function(a){require("ajs").bind("init.rte",a)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-paste:autoconvert-skitch', location = 'js/autoconvert/transformers/skitchpaste.js' */
define("confluence-paste/autoconvert/transformers/skitchpaste",["ajs","jquery","confluence/api/constants"],function(a,b,c){return{pasteHandler:function(a,e,d){"www.skitch.com"===a.host||"skitch.com"===a.host?b.get(c.CONTEXT_PATH+"/rest/autoconvert/1.0/skitchembed?url="+a.source,function(a){a&&a.url?d(b('<img class="confluence-embedded-image confluence-external-resource" src="'+a.url+'" data-image-src="'+a.url+'"/>')[0]):d()}):d()}}});
require("confluence/module-exporter").safeRequire("confluence-paste/autoconvert/transformers/skitchpaste",function(a){var b=require("ajs"),c=require("tinymce");b.bind("init.rte",function(){b.Editor.SkitchPaste=a;c.plugins.Autoconvert.autoConvert.addHandler(a.pasteHandler)})});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-paste:autoconvert-cloudapp', location = 'js/autoconvert/transformers/cloudapppaste.js' */
define("confluence-paste/autoconvert/transformers/cloudapppaste",["ajs","jquery","confluence/api/constants"],function(b,c,e){return function(g,f,d){"cl.ly"==g.host?c.get(e.CONTEXT_PATH+"/rest/autoconvert/1.0/cloudappembed?resource="+g.path.substr(1),function(a){if(a)switch(a.item_type){case "image":a=b.escapeHtml(a.content_url);d(c('<img class="confluence-embedded-image confluence-external-resource" src="'+a+'" data-image-src="'+a+'"/>')[0]);break;case "bookmark":f.text(a.name),f.attr("href",b.escapeHtml(a.redirect_url)),
d(f)}else d()}):d()}});require("confluence/module-exporter").exportModuleAsGlobal("confluence-paste/autoconvert/transformers/cloudapppaste","AJS.Editor.CloudAppPaste",function(b){var c=require("ajs"),e=require("tinymce");c.bind("init.rte",function(){e.plugins.Autoconvert.autoConvert.addHandler(b)})});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-paste:autoconvert-widget-connector', location = 'js/autoconvert/transformers/widgetpaste.js' */
define("confluence-paste/autoconvert/transformers/widgetpaste",["tinymce"],function(a){return function(){var e=[/youtube.com\/watch\?/,/vimeo.com\/[0-9]+/,/maps.google(.[a-z]+)+\/maps/,/[^\.]\.wufoo\.com\/(?:forms|reports)/];a.plugins.Autoconvert.autoConvert.addHandler(function(b,c,d){b=decodeURI(b.source);for(c=0;c<e.length;c++)if(b.match(e[c])){a.plugins.Autoconvert.convertMacroToDom({name:"widget",params:{url:b}},d,d);return}d()})}});
require("confluence/module-exporter").safeRequire("confluence-paste/autoconvert/transformers/widgetpaste",function(a){require("ajs").bind("init.rte",a)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-paste:autoconvert-shortcut-links', location = 'js/autoconvert/transformers/shortcutlinks.js' */
define("confluence-paste/autoconvert/transformers/shortcutlinks",["ajs","tinymce","jquery"],function(e,k,i){return function(){var f=[],j;j=e.contextPath()?e.contextPath():"";k.plugins.Autoconvert.autoConvert.addHandler(function(a,c,g){if(a.source===c.text())for(var h=0;h<f.length;h++){var b=f[h],d=a.source.match(b.regex);if(d){a=d[1];if(b.defaultAlias){b=b.defaultAlias.replace(/%s/,a);g(i(c).text(b));return}g(i(c).text(a));return}}g()});setTimeout(function(){i.ajax({url:j+"/rest/autoconvert/latest/shortcutlinkconfigurations",
type:"GET",dataType:"json",success:function(a){f=a.configurations;for(a=0;a<f.length;a++){var c=f[a];try{var g=c,h=RegExp,b;var d=c.expandedValue;b=0<=d.indexOf("%s")?d.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&").replace("%s","(.*)"):d.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")+"(.*)";g.regex=new h(b)}catch(e){console.log("Failed to generated regex for "+c)}}},error:function(a){console.log("Failed to load shortcut link configurations "+a.statusText)}})},0)}});
require("confluence/module-exporter").safeRequire("confluence-paste/autoconvert/transformers/shortcutlinks",function(e){require("ajs").bind("init.rte",e)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-paste:autoconvert-google-redirect', location = 'js/autoconvert/transformers/google-redirect-convert.js' */
define("confluence-paste/autoconvert/transformers/google-redirect-convert",["jquery","tinymce"],function(c,e){return function(){e.plugins.Autoconvert.autoConvert.addHandler(function(a,b,d){a.host.match(/google.*/)&&"/url"===a.path&&a.queryKey&&a.queryKey.url?(a=decodeURIComponent(a.queryKey.url),b=c(b),b.attr("href",a),b.attr("data-mce-href",a),b.text(a),d(b)):d()})}});
require("confluence/module-exporter").safeRequire("confluence-paste/autoconvert/transformers/google-redirect-convert",function(c){require("ajs").bind("init.rte",c)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-paste:autoconvert-linkedin-links', location = 'js/autoconvert/transformers/linkedin.js' */
define("confluence-paste/autoconvert/transformers/linkedin",["jquery","ajs"],function(c,a){return function(d,e,f){-1===d.host.search(".linkedin.")?f():c.ajax("https://card-meta.atlassian.io/meta?url="+d.source,{timeout:5E3,success:function(b){if(-1===b.title.search("Sign In")){var a=b.title.indexOf("|"),b=-1===a?b.title:b.title.substring(0,a);e.text(b);e.attr("href",d.source)}},error:function(b,c){a.log("Link conversion failed, Error: "+c)},complete:function(){f()}})}});
require("confluence/module-exporter").safeRequire("confluence-paste/autoconvert/transformers/linkedin",function(c){var a=require("ajs");a.DarkFeatures.isEnabled("autoconvert-link-to-page-title")&&a.bind("init.rte",function(){require("tinymce").plugins.Autoconvert.autoConvert.addHandler(c)})});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.extra.team-calendars:calendar-init-editor', location = 'com/atlassian/confluence/extra/calendar3/components/initialiser/initialiser-editor.js' */
require(["tc/init-resources"],function(a){a.requireResources()});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.extra.team-calendars:macro-button-panel-resources', location = 'com/atlassian/confluence/extra/calendar3/js/calendar-macro-button-panel.js' */
(function(a){AJS.bind("init.rte",function(){var b={initViewButtons:function(){a.each(b.getButtonIdToViewMap(),function(d,c){AJS.Confluence.PropertyPanel.Macro.registerButtonHandler(d,function(g,f){var h=a(f);AJS.Rte.getEditor().selection.select(h[0]);AJS.Rte.BookmarkManager.storeBookmark();tinymce.confluence.MacroUtils.insertMacro({contentId:Confluence.Editor.getContentId(),macro:{name:b.getMacroName(h),params:a.extend(b.parseMacroParams(h),{defaultView:c}),defaultParameterValue:"",body:""}})})})},initAddButton:function(){AJS.Confluence.PropertyPanel.Macro.registerButtonHandler("add-subcalendar",function(d,c){var f=a(c);Confluence.TeamCalendars.Dialogs.getAddDialogForMacro({name:b.getMacroName(f),params:b.parseMacroParams(f),defaultParameterValue:"",body:""})})},parseMacroParams:function(f){var c=f.attr("data-macro-parameters")||"",d=c.split("|"),e={};if(d){a.each(d,function(h,g){var i=g.split("=",2);if(i.length>0){e[i[0]]=i.length>1?i[1]:""}})}return e},getMacroName:function(c){return c.attr("data-macro-name")},getButtonIdToViewMap:function(){return{"calendar-view-month":"month","calendar-view-week":"week","calendar-view-list":"list","calendar-view-upcoming":"upcoming","calendar-view-timeline":"timeline"}},initViewButtonHighlight:function(){AJS.bind("created.property-panel",function(d,c){var f=b.parseMacroParams(a(c.anchor))["defaultView"]||"month";if(f==="upcoming"){f="list"}a(".macro-property-panel-calendar-view-"+f,c.panel).addClass("selected")})}};b.initViewButtons();b.initAddButton();b.initViewButtonHighlight()})})(jQuery);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.extra.team-calendars:autoconvert-resources', location = 'com/atlassian/confluence/extra/calendar3/js/team-calendars-autoconvert.js' */
(function(b){var a=function(){if(window.tinymce&&window.tinymce.plugins&&window.tinymce.plugins.Autoconvert&&window.tinymce.plugins.Autoconvert.autoConvert&&window.tinymce.plugins.Autoconvert.autoConvert.addHandler&&b.isFunction(window.tinymce.plugins.Autoconvert.autoConvert.addHandler)){window.tinymce.plugins.Autoconvert.autoConvert.addHandler(function(g,f,d){var e=g.queryKey||{};var i=e.subCalendarId?e.subCalendarId:e.calendarId;var h=/display\/(.*)\/calendar\/(.*)/.test(g.path);if(h){var c=/display\/(.*)\/calendar\/(.*)/.exec(g.path);i=c[2]?c[2]:"unknown"}if((/\/calendar\/previewcalendar.action$/.test(g.path)||/\/calendar\/calendarPage.action$/.test(g.path)||h)&&i){window.tinymce.plugins.Autoconvert.convertMacroToDom({name:"calendar",params:{id:i}},d,d)}else{return d()}})}};b(a);AJS.bind("init.rte",a)})(jQuery);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.extra.team-calendars:util', location = '/com/atlassian/confluence/extra/calendar3/util/util.js' */
define("tc/util",["jquery"],function(b){var a={};a.showDialogInUpdatedHeight=function(c){if(!c.getCurrentPanel().body.is(":visible")){c.show()}c.updateHeight();c.popup.element.css("height","");c.popup.element.find("div.dialog-panel-body").css("height","");c.popup.element.find("form, div.buttons-container").css("margin-bottom","0");c.popup.changeSize(undefined,c.popup.element.outerHeight());c.hide();c.show()};a.getRestBaseUrl=function(){return Confluence.getContextPath()+"/rest/calendar-services/1.0"};return a});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.extra.team-calendars:calendar-util', location = 'com/atlassian/confluence/extra/calendar3/components/calendar-util/calendar-util-component.js' */
define("tc/calendar-util",["jquery","ajs","tc-backbone","tc/templates"],function($,AJS,Backbone,Templates){function removeDuplicatedErrorMessages(infoMessagesList){var uniqueMessageItems={};$("li",infoMessagesList).each(function(){var item=$(this).text();if(uniqueMessageItems[item]){$(this).remove()}else{uniqueMessageItems[item]=true}})}var calendarUtils={panelEditCalendar:{GENERAL_PANEL:0,EVENT_TYPE_PANEL:1,RESTRICTION_PANEL:2,SHARE_EMBEDDED_PANEL:3,SUBSCRIBE_PANEL:4},ajaxTimeout:120000,isCalendarSearchDisabled:$("#team-calendars-search-disabled").length,hasJiraLink:$("#team-calendars-has-jira-link").length,getParameter:function(calendarDiv,configKey){return this.getParameters(calendarDiv)[configKey]},getParameters:function(calendarDiv){if(!calendarDiv.data("parameters")){var parameters={};$("fieldset.parameters input",calendarDiv).each(function(){if(parameters[this.name]){if($.isArray(parameters[this.name])){parameters[this.name].push(this.value)}else{parameters[this.name]=[parameters[this.name],this.value]}}else{parameters[this.name]=this.value}});calendarDiv.data("parameters",parameters)}return calendarDiv.data("parameters")},setParameter:function(calendarDiv,configKey,value){calendarDiv.removeData("parameters");var paramsFieldset=$("fieldset.parameters",calendarDiv);$("input[name='"+configKey+"']",paramsFieldset).remove();if($.isArray(value)){$.each(value,function(idx,aValue){$("<input type='hidden'/>").attr("name",configKey).val(aValue).appendTo(paramsFieldset)})}else{$("<input type='hidden'/>").attr("name",configKey).val(value).appendTo(paramsFieldset)}},getSortedSubCalendarsByTypeAndName:function(subCalendars){if(!subCalendars){return[]}var subCalendarsByTypes={};$.each(subCalendars,function(subCalendarIdx,subCalendar){var subCalendarType=subCalendar.subscriptionType||subCalendar.type,subCalendarsOfType;if(!subCalendarsByTypes[subCalendarType]){subCalendarsOfType=[];subCalendarsByTypes[subCalendarType]=subCalendarsOfType}else{subCalendarsOfType=subCalendarsByTypes[subCalendarType]}subCalendarsOfType.push(subCalendar)});$.each(subCalendarsByTypes,function(subCalendarType,subCalendarsOfType){subCalendarsOfType.sort(function(leftSubCalendar,rightSubCalendar){var leftName=(leftSubCalendar.name||"").toLowerCase(),rightName=(rightSubCalendar.name||"").toLowerCase();return leftName>rightName?-1:(rightName>leftName?1:0)})});var sortedSubCalendars=[];$.each($.grep((function(){var theOrder=[];$.each(Confluence.TeamCalendars.subcalendar,function(handleType,handler){theOrder.push(handleType)});theOrder.sort(function(leftType,rightType){return Confluence.TeamCalendars.subcalendar[leftType].weight-Confluence.TeamCalendars.subcalendar[rightType].weight});return theOrder})(),function(subCalendarType){return subCalendarsByTypes[subCalendarType]}),function(typeIdx,subCalendarType){$.each(subCalendarsByTypes[subCalendarType],function(subCalendarIdx,subCalendar){sortedSubCalendars.push(subCalendar)})});$.each(sortedSubCalendars,function(subCalendarIdx,subCalendar){if($.isArray(subCalendar.childSubCalendars)&&subCalendar.childSubCalendars.length){subCalendar.childSubCalendars.sort(function(leftChild,rightChild){var leftChildWeight=window.Confluence.TeamCalendars.subcalendar[leftChild.subscriptionType||leftChild.type].weight,rightChildWeight=window.Confluence.TeamCalendars.subcalendar[rightChild.subscriptionType||rightChild.type].weight;return leftChildWeight<rightChildWeight?-1:(leftChildWeight>rightChildWeight?1:0)})}});return sortedSubCalendars},getAsArray:function(){var theArray=[];$.each(arguments,function(argIdx,argument){if($.isArray(argument)){$.each(argument,function(argIdx,argElem){if(typeof argElem==="string"){theArray.push(argElem)}else{if($.isPlainObject(argElem)&&argElem.id&&typeof argElem.id==="string"){theArray.push(argElem.id)}else{theArray.push(argElem.toString())}}})}else{theArray.push(argument.toString())}});return theArray},populateTimeZoneDropDown:function(timeZoneSelect,timeZoneToSelect,onSuccess,onError){var spinner=$(".spinner",timeZoneSelect.parent());spinner.removeClass("hidden");$.ajax({type:"GET",timeout:this.ajaxTimeout,url:this.getRestBaseUrl()+"/timezones/calendar",success:function(timeZones){timeZoneSelect.html(Templates.timeZoneDropDown(timeZones)).val(timeZoneToSelect);spinner.addClass("hidden");onSuccess()},error:function(XMLHttpRequest,textStatus,errorThrown){spinner.addClass("hidden");onError(XMLHttpRequest,textStatus,errorThrown)}})},getRestBaseUrl:function(){return Confluence.getContextPath()+"/rest/calendar-services/1.0"},getCalendarServiceBaseUrl:function(relativePath){return this.getRestBaseUrl()+"/calendar"+relativePath},mergeSubCalendarObjectsToArray:function(arrayWithSubCalendarObject){var that=this;if(arrayWithSubCalendarObject&&$.isArray(arrayWithSubCalendarObject)){var mergeSubCalendarIntoContainingObject=function(objectContainingSubCalendar){$.extend(objectContainingSubCalendar,objectContainingSubCalendar.subCalendar);delete objectContainingSubCalendar.subCalendar};$.each(arrayWithSubCalendarObject,function(idx,arrayElement){mergeSubCalendarIntoContainingObject(arrayElement);$.each(arrayElement.childSubCalendars||[],function(childIdx,objectContainingChildSubCalendar){mergeSubCalendarIntoContainingObject(objectContainingChildSubCalendar)})})}var rearrangeSubCalendars=function(subCalendars){if(!(subCalendars&&subCalendars.length)){return}var subscriptionsParent={name:"Subscriptions",type:"subscription",dummy:true,id:"dummy"},subscriptionChildSubCalendars=[],rearrangedSubCalendars=[];$.each(subCalendars,function(idx,subCalendar){if(that.isSubscriptionSubCalendar(subCalendar)){subscriptionChildSubCalendars.push(subCalendar)}else{rearrangedSubCalendars.push(subCalendar)}});if(subscriptionChildSubCalendars.length){subscriptionsParent.childSubCalendars=subscriptionChildSubCalendars;rearrangedSubCalendars.push(subscriptionsParent)}subCalendars.length=0;$.merge(subCalendars,rearrangedSubCalendars)};rearrangeSubCalendars(arrayWithSubCalendarObject);return arrayWithSubCalendarObject},isRequireOauth:function(XMLHttpRequest){var authHeader=XMLHttpRequest.getResponseHeader("WWW-Authenticate")||"";var realmRegEx=/OAuth realm\=\"([^\"]+)\"/;var matches=realmRegEx.exec(authHeader);if(matches){return matches[1]}else{return null}},setFieldErrors:function(container,fieldErrors){$("div.error",container).empty();if(!fieldErrors){return}var _fieldErrors=$.isArray(fieldErrors)?fieldErrors:[fieldErrors];if($.isArray(fieldErrors)){for(var fieldErrorIndex=0;fieldErrorIndex<_fieldErrors.length;++fieldErrorIndex){var fieldName=_fieldErrors[fieldErrorIndex].field;var _errorMessages=$.isArray(_fieldErrors[fieldErrorIndex].errorMessages)?_fieldErrors[fieldErrorIndex].errorMessages:[_fieldErrors[fieldErrorIndex].errorMessages];if(fieldName&&_errorMessages){var errorDiv=$("div."+fieldName+"-error");for(var errorMsgIndex=0;errorMsgIndex<_errorMessages.length;++errorMsgIndex){$(document.createElement("div")).html(_errorMessages[errorMsgIndex]).appendTo(errorDiv)}}}}},showHTMLGenericError:function(container,message,errorClass,subcalendar){var isError=message[0]==="html-error-type"||message[0]==="error-jql-wrong";var infoHTMLPanel=isError===true?$(".calendar-error",container):$(".calendar-warning",container);var _infoHTMLClass=errorClass||"general";var infoMessagesList=isError===true?$("ul.error-messages",infoHTMLPanel):$("ul.warning-messages",infoHTMLPanel);var infoMessageItem=$("li."+errorClass,infoMessagesList);if(!infoMessageItem.length){infoMessageItem=$(document.createElement("li")).addClass(_infoHTMLClass).appendTo(infoMessagesList)}if(message[0]==="error-jql-wrong"){infoMessageItem.text(message[1]);if(subcalendar&&subcalendar.eventsEditable){infoMessageItem.data("jiraCalendarId",subcalendar.id);infoMessageItem.append("Try \u003ca href=\"#\" id=\"calendar-change-jql\"\u003echanging the query.\u003c/a\u003e")}}else{infoMessageItem.html(message[1])}removeDuplicatedErrorMessages(infoMessagesList);if(infoMessagesList.children().length){infoMessagesList.removeClass("hidden");infoHTMLPanel.removeClass("hidden")}else{infoMessagesList.addClass("hidden");infoHTMLPanel.addClass("hidden")}},setGenericErrors:function(container,message,errorClass){var errorPanel=$(".calendar-error",container);var _errorClass=errorClass||"general";var errorMessagesList=$("ul.error-messages",errorPanel);var errorMessageItem=$("li."+errorClass,errorMessagesList);if(message){if(!errorMessageItem.length){errorMessageItem=$(document.createElement("li")).addClass(_errorClass).appendTo(errorMessagesList)}if($.isArray(message)){if(message.length>1){var subMessagesList=$(document.createElement("ul"));$.each(message,function(index,value){$(document.createElement("li")).text(value).appendTo(subMessagesList)});subMessagesList.appendTo(errorMessageItem)}else{errorMessageItem.text(message[0])}}else{if($.isPlainObject(message)){var theMessage=message.message||"";if(message["status-code"]){errorMessageItem.text(message["status-code"]+" - "+theMessage)}else{errorMessageItem.text(theMessage)}}else{errorMessageItem.text(message)}}removeDuplicatedErrorMessages(errorMessagesList);if(message.length>1&&$("ul",errorMessageItem).children().length===0){errorMessageItem.remove()}}else{errorMessageItem.remove()}if(errorMessagesList.children().length){errorMessagesList.removeClass("hidden");errorPanel.removeClass("hidden")}else{errorMessagesList.addClass("hidden");errorPanel.addClass("hidden")}},showAjaxError:function(container,XMLHttpRequest,textStatus,errorThrown,errorClass,subCalendar){var messageResponse=eval("("+XMLHttpRequest.responseText+")");if("application/json"===XMLHttpRequest.getResponseHeader("Content-Type")&&$.isArray(messageResponse)&&messageResponse.length===2&&(messageResponse[0]==="warning-type"||messageResponse[0]==="html-error-type"||messageResponse[0]==="error-jql-wrong")){this.showHTMLGenericError(container,messageResponse,errorClass,subCalendar)}else{this.setGenericErrors(container,("application/json"===XMLHttpRequest.getResponseHeader("Content-Type")?messageResponse:(errorThrown||textStatus||XMLHttpRequest.responseText||"Uh oh. Looks like something unexpectedly went wrong. Please check the Confluence log file.")),errorClass)}},getUserTimeZone:function(){return $("input[name='userTimeZoneId']").val()||$("#team-calendars-user-timezone").attr("content")},shouldShowTimezoneSetup:function(){var hasMessageKey=!$("#team-calendars-timezone-setup-dialog").length&&$("#team-calendars-show-timezone-setup").length;if(AJS.Meta.get("space-key")){var isSpaceCalendarPage=$(".plugin-calendar-container.spaceCalendars").length;return hasMessageKey&&isSpaceCalendarPage}return hasMessageKey},suppressMessage:function(errorContainer,messageKey,successCallback){var that=this;$.ajax({cache:false,data:{messageKey:messageKey},error:function(XMLHttpRequest,textStatus,errorThrown){that.showAjaxError(errorContainer,XMLHttpRequest,textStatus,errorThrown,"error-config-update")},success:function(){that.setGenericErrors(errorContainer,null,"error-config-update");if(successCallback&&$.isFunction(successCallback)){successCallback()}},type:"DELETE",url:this.getCalendarServiceBaseUrl("/preferences/messagekey.json")})},fireEventForAnalytics:function(eventName,properties){AJS.EventQueue=AJS.EventQueue||[];AJS.EventQueue.push({name:"teamcalendars."+eventName,properties:properties||{}})},isPDLEnabled:function(){return AJS.Meta.getNumber("build-number")>=4000},isJiraSubCalendar:function(subCalendar){return subCalendar.type==="jira"||subCalendar.subscriptionType==="jira"||subCalendar.type==="jira-agile-sprint"||subCalendar.subscriptionType==="jira-agile-sprint"||subCalendar.type==="jira-project-releases"||subCalendar.subscriptionType==="jira-project-releases"},isSubscriptionSubCalendar:function(subCalendar){return subCalendar.type==="subscription"||subCalendar.subscriptionType==="subscription"},isInternalSubscriptionSubCalendar:function(subCalendar){return subCalendar.type==="internal-subscription"},isDummySubscriptionParentSubCalendar:function(subCalendar){return subCalendar.dummy&&this.isSubscriptionSubCalendar(subCalendar)},hasRestriction:function(subCalendar){return subCalendar.usersPermittedToView.length>0||subCalendar.usersPermittedToEdit.length>0||subCalendar.groupsPermittedToView.length>0||subCalendar.groupsPermittedToEdit.length>0},updateDateDisplay:function(calendarDiv,displayHtml){$(".date-display",calendarDiv).html(displayHtml||"")},showCalendarPopupHaveAnEmptySubcalendar:function(showPopularDialog,showCalendarDialog){$.ajax({dataType:"json",success:function(responseEntity){if(responseEntity){showPopularDialog()}else{showCalendarDialog()}},type:"GET",timeout:this.ajaxTimeout,url:this.getCalendarServiceBaseUrl("/haspopular.json")})},disableButton:function(elButton,label){elButton.text(label).attr("disabled","disabled").addClass("ui-state-disabled")},enableButton:function(elButton,label){elButton.text(label).removeAttr("disabled").removeClass("ui-state-disabled")},isJiraEventStream:function(type){return type==="jira-calendar"||type==="jira-agile-sprint-calendar"||type==="jira-project-releases-calendar"},isCustomEventType:function(type){return !this.isJiraEventStream(type)&&!this.isJiraType(type)&&!this.isEventTypeSanbox(type)},isEventTypeSanbox:function(type){return type==="other"||type==="leaves"||type==="birthdays"||type==="travel"},isJiraEvent:function(event){var type=event.eventType;return this.isJiraType(type)},isJiraType:function(type){return type==="jira"||type==="jira-agile-sprint"||type==="jira-project-releases"},showInforReminder:function(periodInMins){var inforReminder=null,intPeriodInMins=periodInMins!==""?parseInt(periodInMins):0;if(intPeriodInMins===0){inforReminder="None"}else{if(intPeriodInMins<60){inforReminder=AJS.format("{0} minutes",intPeriodInMins)}else{var periodInHours=Math.floor(intPeriodInMins/60);if(periodInHours<24){inforReminder=AJS.format(periodInHours===1?"{0} hour":"{0} hours",periodInHours)}else{var periodInDays=Math.floor(periodInHours/24);if(periodInDays<7){inforReminder=AJS.format(periodInDays===1?"{0} day":"{0} days",periodInDays)}else{var periodInWeek=Math.floor(periodInDays/7);inforReminder=AJS.format(periodInWeek===1?"{0} week":"{0} weeks",periodInWeek)}}}}return inforReminder},getPeriodReminderEventTypeSanboxOrJira:function(subCalendar,eventType){var sanboxEventTypeReminders=subCalendar.sanboxEventTypeReminders;if(sanboxEventTypeReminders!=undefined&&sanboxEventTypeReminders.length>0){if(this.isJiraType(eventType)){eventType+="-calendar"}for(var item in sanboxEventTypeReminders){if(eventType===sanboxEventTypeReminders[item].eventTypeId){return sanboxEventTypeReminders[item].periodInMins}}}},getCalendarContext:function(calendarDiv){var context;if(calendarDiv){context=this.getParameter(calendarDiv,"calendarContext")}return context||(AJS.Meta.get("space-key")?"spaceCalendars":"myCalendars")},isSingleCalendarView:function(calendarDiv){return"singleCalendar"===this.getParameter(calendarDiv,"calendarContext")},isSpaceCalendarView:function(calendarDiv){return"spaceCalendars"===this.getParameter(calendarDiv,"calendarContext")},isEmbeddedCalendarView:function(calendarDiv){return"page"===this.getParameter(calendarDiv,"calendarContext")},isMyCalendarView:function(calendarDiv){return"myCalendars"===this.getParameter(calendarDiv,"calendarContext")},putCalendarContextParams:function(data){data.calendarContext=this.getCalendarContext();data.viewingSpaceKey=AJS.Meta.get("space-key")||""},toggleNoCalendarPage:function(show){if(show){$(".no-calendar-page").removeClass("hidden");$(".space-calendar-wrapper").addClass("hidden");$(".space-calendar-buttons").addClass("hidden")}else{$(".no-calendar-page").addClass("hidden");$(".space-calendar-buttons").removeClass("hidden");$(".space-calendar-wrapper").removeClass("hidden")}},isValidLicense:function(){var licencseMessages=$(".aui-message.error.license-invalid");return licencseMessages.size()===0},getParamsFromUrl:function(){var vars=[],hash;var q=window.location.href.split("?")[1];if(q!=undefined){q=q.split("&");for(var i=0;i<q.length;i++){hash=q[i].split("=");vars.push(hash[1]);vars[hash[0]]=hash[1]}}return vars},isCalendarNameTruncated:function($element){var isTruncated=false;var $c=$element.clone().css({display:"inline",width:"auto",visibility:"hidden"}).appendTo("body");if($c.width()>$element.width()){isTruncated=true}$c.remove();return isTruncated}};return calendarUtils});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.extra.team-calendars:calendar-util', location = 'com/atlassian/confluence/extra/calendar3/components/calendar-util/calendar-util-component-compat.js' */
(function(a){if(!Confluence.TeamCalendars){Confluence.TeamCalendars={}}if(!Confluence.TeamCalendars.Dialogs){Confluence.TeamCalendars.Dialogs={}}if(!Confluence.TeamCalendars.hasJiraLink){Confluence.TeamCalendars.hasJiraLink=a("#team-calendars-has-jira-link").length}if(!Confluence.TeamCalendars.getRestBaseUrl){Confluence.TeamCalendars.getRestBaseUrl=function(){return Confluence.getContextPath()+"/rest/calendar-services/1.0"}}})(AJS.$);require(["tc/calendar-util"],function(a){if(!Confluence.TeamCalendars.Dialogs){Confluence.TeamCalendars.Dialogs={}}for(var b in a){if(a.hasOwnProperty(b)){Confluence.TeamCalendars[b]=a[b]}}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.extra.team-calendars:helptip-resources', location = 'com/atlassian/confluence/extra/calendar3/components/helptip/helpTip-component.js' */
(function(f){function b(){return false}function d(){return true}var l=0,g=new Date().getTime();var k=Confluence.TeamCalendars.getRestBaseUrl()+"/tips";function h(n){n=""+(n||"");return n.replace(/\./g,"-")}function j(o,n){if(AJS.EventQueue&&n&&n.attributes.id){var q={};var p=h(n.attributes.id);q.name="helptips."+p+"."+o;q.properties={};AJS.EventQueue.push(q)}}function c(){return"c"+g+(l++)}var a={dismissedTipIds:[],loaded:f.Deferred(),url:function(){return k},sync:function(o,n){o||(o="get");n||(n=null);return f.ajax(this.url(),{type:o,context:this,dataType:"json",contentType:"application/json",data:n&&JSON.stringify(n),processData:false}).promise()},fetch:function(){var n=this.sync();n.done(function(o){f.merge(this.dismissedTipIds,o);this.loaded.resolve()});return n.promise()},show:function(n){this.loaded.done(n)},dismiss:function(n){var o=n.attributes.id;if(!o){n._dismissed=true}else{this.dismissedTipIds.push(o);this.sync("post",{id:o})}},undismiss:function(n){var o=n.attributes.id;if(!o){n._dismissed=false}else{this.dismissedTipIds.splice(f.inArray(o,this.dismissedTipIds),1);this.sync("delete",{id:o})}},isDismissed:function(n){var o=n.attributes.id;return(o)?f.inArray(o,this.dismissedTipIds)>=0:n._dismissed}};var e=Confluence.TeamCalendars.HelpTip=function(n){var o;this.attributes=f.extend({},n);this.attributes.id||(this.attributes.id=false);if(this.attributes.body){this.attributes.bodyHtml=this.attributes.body;delete this.attributes.body}this.cid=c();o=this.attributes.anchor;delete this.attributes.anchor;this.view=(o)?new i(this,o):new m(this);this.view.$el.addClass("tc-aui-help-tip")};Confluence.TeamCalendars.HelpTip.Manager=a;f.extend(e.prototype,{show:function(){var n=this;Confluence.TeamCalendars.HelpTip.Manager.show(function(){if(!n.isDismissed()){n.view.show();j("shown",n)}})},dismiss:function(){var n=h(arguments[0]||"programmatically");this.view.dismiss();if(!this.isDismissed()){Confluence.TeamCalendars.HelpTip.Manager.dismiss(this);j("dismissed."+n,this)}},isVisible:function(){return this.view.$el.is(":visible")},isDismissed:function(){return Confluence.TeamCalendars.HelpTip.Manager.isDismissed(this)}});var i=function(o,n){this.initialize(o,n)};f.extend(i.prototype,{initialize:function(t,s){var p=this;var r=9;var o=AJS.$("#rte").height()-s.offset().top;var n=200;var q=o<n;var u=f(AJS.Rte.getEditor().getDoc()).scrollTop();this.model=t;this.beforeHide=b;this.closeButton=f(Confluence.TeamCalendars.Templates.tipClose());this.closeButton.click(function(v){t.dismiss("close-button");v.preventDefault()});this.popup=AJS.InlineDialog(s,t.cid,function(x,w,v){x.html(Confluence.TeamCalendars.Templates.tipContent(t.attributes));x.append(p.closeButton);x.unbind("mouseover mouseout");x.find(".tc-helptip-link").click(function(){j("learn-more.clicked",t)});v()},{container:"#content",noBind:true,onTop:q,preHideCallback:function(){return p.beforeHide()},calculatePositions:function(v,y,z,x){var w=AJS.InlineDialog.opts.calculatePositions(v,y,z,x);if(q){w.popupCss.top=f("#rte").offset().top+s.offset().top-v.height()-r}else{w.popupCss.top=f("#rte").offset().top+(s.offset().top-u)+s.height()+r}w.popupCss.left=s.offset().left;w.displayAbove=q;return w}});this._popupHide=this.popup.hide;this.popup.hide=b;this.$el=f(this.popup[0]);AJS.$(document).bind("showLayer",function(x,w,v){if(w==="inlineDialog"&&v.id===t.cid){AJS.InlineDialog.current=null;AJS.$(document.body).unbind("click."+t.cid+".inline-dialog-check");v._validateClickToClose=b;v.hide=b}})},show:function(){var n=this.popup,o=function(p){if(!n.has(p.target).length){n.shadow.remove();n.remove()}};n.show();AJS.$("#full-height-container").click(o);AJS.Rte.getEditor().onClick.add(o)},dismiss:function(){this.beforeHide=d;this._popupHide()}});var m=function(n){this.initialize(n)};f.extend(m.prototype,{initialize:function(){this.$el=f("<div></div>")},show:function(){},dismiss:function(){}});a.fetch()})(AJS.$);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.extra.team-calendars:helptip-resources', location = 'com/atlassian/confluence/extra/calendar3/components/helptip/helpTip-component.soy' */
// This file was automatically generated from helpTip-component.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.TeamCalendars.Templates.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.TeamCalendars == 'undefined') { Confluence.TeamCalendars = {}; }
if (typeof Confluence.TeamCalendars.Templates == 'undefined') { Confluence.TeamCalendars.Templates = {}; }


Confluence.TeamCalendars.Templates.tipContent = function(opt_data, opt_ignored) {
  return ((opt_data.title) ? '<h4 class="tc-helptip-title">' + soy.$$escapeHtml(opt_data.title) + '</h4>' : '') + '<div class="tc-helptip-body">' + soy.$$filterNoAutoescape(opt_data.bodyHtml) + '</div>' + ((opt_data.url) ? '<a class="tc-helptip-link" href="' + soy.$$escapeHtml(opt_data.url) + '" target="_blank">' + soy.$$escapeHtml('Learn More') + '</a>' : '');
};
if (goog.DEBUG) {
  Confluence.TeamCalendars.Templates.tipContent.soyTemplateName = 'Confluence.TeamCalendars.Templates.tipContent';
}


Confluence.TeamCalendars.Templates.tipClose = function(opt_data, opt_ignored) {
  return '<button class="tc-helptip-close aui-button aui-style"><span>' + soy.$$escapeHtml('Got it, thanks!') + '</span></button>';
};
if (goog.DEBUG) {
  Confluence.TeamCalendars.Templates.tipClose.soyTemplateName = 'Confluence.TeamCalendars.Templates.tipClose';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-sortable-tables:ConfluenceSortableTablesEditorPlugin', location = 'js/editor_plugin_src.js' */
define("confluence-sortable-tables/tinymce-plugin",["jquery","document"],function(d,a){return{init:function(e){var c=function(a,e,c){d(".tablesorter",c.node).each(function(a,c){var b=d(c).find("thead"),e,f;1===b.length&&(b=b[0],"THEAD"===b.nodeName&&1===b.childNodes.length&&(f=b.removeChild(b.childNodes[0]),e=d(c).find("tbody")[0],c.removeChild(b),e.insertBefore(f,e.childNodes[0])))})};e.onInit.add(function(){d(a).bind("postPaste",c)});e.onRemove.add(function(){d(a).unbind("postPaste",c)})},getInfo:function(){return{longname:"ConfluenceSortableTablesPlugin",
author:"Atlassian",authorurl:"http://www.atlassian.com",infourl:"http://www.atlassian.com",version:"1.0"}}}});require("confluence/module-exporter").safeRequire("confluence-sortable-tables/tinymce-plugin",function(d){var a=require("tinymce");a.create("tinymce.plugins.ConfluenceSortableTablesPlugin",d);a.PluginManager.add("confluencesortabletablesplugin",a.plugins.ConfluenceSortableTablesPlugin)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.macros.advanced:editor_includemacro', location = 'com/atlassian/confluence/plugins/macros/advanced/js/include-macro.js' */
define("confluence-advanced-macros/include-macro","ajs window jquery confluence/meta confluence/api/browser confluence-editor/tinymce3/plugins/propertypanel/js/property-panel-macros".split(" "),function(c,f,h,d,e,i){var a={ID_BUTTON:"goto-page",init:function(){var c=d.get("context-path"),j=d.get("content-id"),g=new e(f.navigator.userAgent);i.registerButtonHandler(a.ID_BUTTON,function(d,a){var b=h(a).attr("data-macro-default-parameter"),b=c+"/plugins/servlet/confluence/include-page-macro/goto?location="+
b+"&contentId="+j,e=g&&g.isIE()?"_blank":"confluence-goto-link-include-macro-"+a.id;(b=f.open(b,e))&&b.focus()})}};return a});require("confluence/module-exporter").safeRequire("confluence-advanced-macros/include-macro",function(c){require("ajs").bind("init.rte",c.init)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-page-layout:pagelayout', location = 'js/pagelayout/page-layout.soy' */
// This file was automatically generated from page-layout.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.PageLayout.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.PageLayout == 'undefined') { Confluence.Templates.PageLayout = {}; }


Confluence.Templates.PageLayout.contentLayout = function(opt_data, opt_ignored) {
  return '<div class="contentLayout"></div>';
};
if (goog.DEBUG) {
  Confluence.Templates.PageLayout.contentLayout.soyTemplateName = 'Confluence.Templates.PageLayout.contentLayout';
}


Confluence.Templates.PageLayout.cellLayout = function(opt_data, opt_ignored) {
  return '<div class="cell"><div class="innerCell"></div></div>';
};
if (goog.DEBUG) {
  Confluence.Templates.PageLayout.cellLayout.soyTemplateName = 'Confluence.Templates.PageLayout.cellLayout';
}


Confluence.Templates.PageLayout.smallCellLayout = function(opt_data, opt_ignored) {
  return '<div class="cell aside"><div class="innerCell"></div></div>';
};
if (goog.DEBUG) {
  Confluence.Templates.PageLayout.smallCellLayout.soyTemplateName = 'Confluence.Templates.PageLayout.smallCellLayout';
}


Confluence.Templates.PageLayout.headerLayout = function(opt_data, opt_ignored) {
  return '<div class="header"><div class="innerCell"></div></div>';
};
if (goog.DEBUG) {
  Confluence.Templates.PageLayout.headerLayout.soyTemplateName = 'Confluence.Templates.PageLayout.headerLayout';
}


Confluence.Templates.PageLayout.footerLayout = function(opt_data, opt_ignored) {
  return '<div class="footer"><div class="innerCell"></div></div>';
};
if (goog.DEBUG) {
  Confluence.Templates.PageLayout.footerLayout.soyTemplateName = 'Confluence.Templates.PageLayout.footerLayout';
}


Confluence.Templates.PageLayout.columnLayout = function(opt_data, opt_ignored) {
  return '<div class="columnLayout"></div>';
};
if (goog.DEBUG) {
  Confluence.Templates.PageLayout.columnLayout.soyTemplateName = 'Confluence.Templates.PageLayout.columnLayout';
}


Confluence.Templates.PageLayout.emptyLayout2 = function(opt_data, opt_ignored) {
  return '<div class="contentLayout2">' + Confluence.Templates.PageLayout.emptySection2(null) + '</div>';
};
if (goog.DEBUG) {
  Confluence.Templates.PageLayout.emptyLayout2.soyTemplateName = 'Confluence.Templates.PageLayout.emptyLayout2';
}


Confluence.Templates.PageLayout.emptySection2 = function(opt_data, opt_ignored) {
  return '<div class="columnLayout single" data-layout="single">' + Confluence.Templates.PageLayout.cell2({type: 'normal'}) + '</div>';
};
if (goog.DEBUG) {
  Confluence.Templates.PageLayout.emptySection2.soyTemplateName = 'Confluence.Templates.PageLayout.emptySection2';
}


Confluence.Templates.PageLayout.newSection2 = function(opt_data, opt_ignored) {
  return '<div class="columnLayout single" data-layout="single">' + Confluence.Templates.PageLayout.cell2({type: 'normal'}) + '</div>';
};
if (goog.DEBUG) {
  Confluence.Templates.PageLayout.newSection2.soyTemplateName = 'Confluence.Templates.PageLayout.newSection2';
}


Confluence.Templates.PageLayout.cell2 = function(opt_data, opt_ignored) {
  return '<div class="cell ' + soy.$$escapeHtml(opt_data.type) + '" data-type="' + soy.$$escapeHtml(opt_data.type) + '"><div class="innerCell">' + ((opt_data.content) ? soy.$$filterNoAutoescape(opt_data.content) : '') + '</div></div>';
};
if (goog.DEBUG) {
  Confluence.Templates.PageLayout.cell2.soyTemplateName = 'Confluence.Templates.PageLayout.cell2';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-page-layout:pagelayout', location = 'js/pagelayout/tinymce-page-layout.js' */
define("confluence-page-layout/pagelayout/tinymce-page-layout",["jquery","ajs","tinymce"],function(e,f,c){function j(a){a=e(a.getBody());if(a.children(".contentLayout").length)return!1;a.children(".contentLayout2");return!0}var i=function(a){var c=e("#pagelayout-menu"),h=e(".icon-check",c);i=function(a){var b=h.not(".hidden"),a=h.siblings("."+a.name).siblings();b.addClass("hidden");a.removeClass("hidden")};i(a)};return{init:function(a){function l(){j(a)||c.plugins.PageLayoutPlugin.PageLayout.needsContentEditableBody(b.getLayout())||
c.webkit||f.Rte.editorFocus(a)}function h(){c.isGecko&&setTimeout(function(){a.focus();a.dom.getRoot().focus()},1)}function k(){var g=e("#pagelayout-menu").parent(),d=e("#page-layout-2-group");j(a)?(g.addClass("hidden"),d.removeClass("hidden"),b=new c.plugins.PageLayoutPlugin.PageLayout2(a),c.plugins.PageLayoutPlugin.PageLayout2.needsContentEditableBody()&&e(a.getBody()).attr("contenteditable","true")):(g.removeClass("hidden"),d.addClass("hidden"),b=new c.plugins.PageLayoutPlugin.PageLayout(a),c.plugins.PageLayoutPlugin.PageLayout.needsContentEditableBody(b.getLayout())?
b.body.attr("contenteditable","true"):h(),i(b.getLayout()))}var b;this.ed=a;"comment"!==f.Meta.get("content-type")&&(a.onInit.add(function(){a.undoManager.clear();a.undoManager.add();k();f.bind("editor.remote.change editor.local.change",function(){a.undoManager.ignore(function(){b.setup()})});f.bind("rte-ready",function(){var b=e('[contenteditable="true"]',a.getBody()),d=!1!==f.Meta.get("editor-auto-focus");b.attr("contenteditable","false");b.attr("contenteditable","true");d&&f.Rte.editorFocus(a)});
a.selection.onSetContent.add(l);j(a)&&a.undoManager.onUndo.add(function(){c.plugins.PageLayoutPlugin.PageLayout2.needsContentEditableBody()&&b.body.attr("contenteditable","true");h()})}),e("#pagelayout-menu").delegate("li.dropdown-item a","click",function(){a.execCommand("mcePageLayout",!1,c.plugins.PageLayoutPlugin.PageLayout.getLayoutOptions(this))}),a.addCommand("mcePageLayoutInitialize",function(){a.undoManager.add();b.createInitialLayoutIfNone()}),a.addCommand("mcePageLayout",function(g,d){a.undoManager.add();
b.setLayout(d);i(b.getLayout())}),a.addCommand("mcePageLayoutAddSection",function(g,d){a.undoManager.add();b.addSection&&b.addSection(d&&d.section)}),a.addCommand("mcePageLayoutChangeSection",function(g,d){a.undoManager.add();b.changeSection&&b.changeSection(d&&d.layout,d&&d.section)}),a.addCommand("mcePageLayoutRemoveSection",function(g,d){a.undoManager.add();b.removeSection&&b.removeSection(d&&d.section)}),a.addCommand("mcePageLayoutMoveSectionUp",function(g,d){a.undoManager.add();b.moveSectionUp&&
b.moveSectionUp(d&&d.section)}),a.addCommand("mcePageLayoutMoveSectionDown",function(g,d){a.undoManager.add();b.moveSectionDown&&b.moveSectionDown(d&&d.section)}),a.onSetContent.add(k),a.onClick.add(function(a,d){var b=e(d.target);b.is("div.cell")&&b.children(".innerCell").focus();if(c.isWebKit&&(d.target===a.getBody()||d.target===a.getBody().parentNode))b=b.find(".innerCell"),b.length&&(a.execCommand("selectAll"),b=d.target!==a.getBody(),a.selection.collapse(b))}),!c.isIE9&&a.onKeyUp.add(function(a,
b){var c=b.keyCode;if(8!==c&&46!==c)return!0;c=a.selection.getRng(!0).startContainer;if(e(c).closest(".contentLayout,.contentLayout2",a.getBody()).length&&(c=e(c).closest(".innerCell"))&&c.length&&a.dom.isEmpty(c.clone()[0]))c.html('<p><br data-mce-bogus="1"></p>'),a.selection.select(c[0],!0),a.selection.collapse(!0)}))},execCommand:function(a){if("selectAll"===a){var a=this.ed,c=a.getBody(),e,f;if("true"==a.dom.getAttrib(c,"contenteditable"))return!1;e=a.dom.select(".innerCell",c);c=e[0];e=e[e.length-
1];f=a.dom.createRng();f.setStart(c,0);f.setEnd(e,e.childNodes.length);a.selection.setRng(f);return!0}return!1},getInfo:function(){return{longname:"Page Layout Plugin",author:"Atlassian",authorurl:"http://www.atlassian.com",infourl:"http://www.atlassian.com",version:"1.0"}}}});
require("confluence/module-exporter").safeRequire("confluence-page-layout/pagelayout/tinymce-page-layout",function(e){var f=require("tinymce");f.create("tinymce.plugins.PageLayoutPlugin",e);f.PluginManager.add("pagelayoutplugin",f.plugins.PageLayoutPlugin)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-page-layout:pagelayout', location = 'js/pagelayout/page-layout.js' */
define("confluence-page-layout/pagelayout/page-layout",["jquery","confluence/templates","ajs"],function(c,k,r){var h=function(a){this.editor=a;this.body=c(a.getBody());this.setup()};h.DEFAULT_LAYOUT={name:"pagelayout-none",columns:0};h.prototype.setup=function(){var a=c(".contentLayout",this.body);a.length?(n(a),o(a,this.body,this.editor),this.editor.undoManager.add()):this.body.attr("contenteditable","true")};h.prototype.setLayout=function(a){var g=require("tinymce"),b;b=c(".contentLayout",this.body);
if(h.getLayoutOptions(b).name!==a.name){r.trigger("analyticsEvent",{name:"PageLayoutEvent.pageLayoutChanged",data:{name:a.name}});if(1===b.length)b=b.clone();else{var d=this.editor;b=this.body;var e=k.PageLayout.contentLayout(),d=d.dom.create("div");d.innerHTML=e;b=c(d).children().html(b.html())}n(b);var e=b,d=c(".columnLayout > .cell",e).length,i=a.name,j=a.columns,f;if(0===d){f=e.html();for(e.html(k.PageLayout.columnLayout());d!==j.length;)p(e),d++}i=i.substring(i.indexOf("-")+1);i=i.substring(0,
Math.max(0,i.indexOf("-"))||void 0);c(".columnLayout",e).attr("class","columnLayout "+i+"Columns");if(j)for(c(".columnLayout > .cell",e).each(function(a,b){void 0!==j[a]&&c(b).attr("class","cell "+j[a])});d!==j.length;)if(d<j.length)p(e),d++;else{var i=c(".columnLayout .cell:nth-child("+d+") .innerCell",e),s=c(".columnLayout > .cell:nth-child("+(d-1)+") .innerCell",e),t=l(i);s.append(t);i.parent().remove();d--}else{var m="";c(".columnLayout > .cell",e).each(function(){m+=l(c(".innerCell",this))});
c(".columnLayout",e).replaceWith(m)}f&&q(e).html(f);a.header?(f=b,c(".header",f).length||f.prepend(k.PageLayout.headerLayout())):(e=b,f=c(".header",e),e=q(e),d=l(c(".innerCell",f)),e.length?(e.prepend(d),f.remove()):f.replaceWith(d));a.footer?(f=b,c(".footer",f).length||f.append(k.PageLayout.footerLayout())):(e=b,f=c(".footer",e),e=c(".columnLayout > .cell:last-child .innerCell",e),d=l(c(".innerCell",f)),e.length?(e.append(d),f.remove()):f.replaceWith(d));h.needsContentEditableBody(a)?(b=b.contents().unwrap(),
this.body.attr("contenteditable","true")):(o(b,this.body,this.editor),b.attr("data-atlassian-layout",JSON.stringify(a)));this.body.empty().append(b);g.isIE&&this.editor.dom.setRoot();b=this.editor;a=b.selection;g=a.getRng(!0);f=c('[contenteditable="true"]',b.getBody());f.length?(b.focus(),f[0].focus(),b=f.children()[0],g.setStart(b,0),g.setEnd(b,0),a.setRng(g)):b.focus()}};h.prototype.getLayout=function(){var a=c(".contentLayout",this.body);return a.length&&a.attr("data-atlassian-layout")?JSON.parse(a.attr("data-atlassian-layout")):
h.DEFAULT_LAYOUT};h.getLayoutOptions=function(a){return(a=(a.jquery?a:c(a)).attr("data-atlassian-layout"))?JSON.parse(a):h.DEFAULT_LAYOUT};h.needsContentEditableBody=function(a){return!(a.header||a.footer||a.columns)};var l=function(a){a=a.jquery?a:c(a);if(a.length)for(var g=a[0].childNodes,b=0;b<g.length;b++){var d=g[b];if(!("P"===d.nodeName&&1===d.childNodes.length&&"BR"===d.firstChild.nodeName))return a.html()}return""},n=function(a){for(var g,b,a=c(".cell, .header, .footer",a),d=0,e=a.length;d<
e;d++)g=c(a[d]),b=g.html(),c(".innerCell",g).length||(g.removeAttr("contenteditable"),g.html('<div class="innerCell">'+b+"</div>"))},o=function(a,g,b){var d=require("tinymce");g.attr("contenteditable","false");c(".innerCell",a).each(function(){var a=c(this);a.attr("contenteditable","true");a.children().length||a.append("<p><br /></p>")});d.isIE&&g.delegate(".innerCell","focus.pageLayout",function(){b.dom.settings.root_element=this})},q=function(a){return c(".columnLayout > .cell:first-child .innerCell",
a)},p=function(a){return c(".columnLayout",a).append(k.PageLayout.cellLayout())};return h});require("confluence/module-exporter").exportModuleAsGlobal("confluence-page-layout/pagelayout/page-layout","tinymce.plugins.PageLayoutPlugin.PageLayout");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-page-layout:pagelayout', location = 'js/pagelayout/page-layout-2.js' */
define("confluence-page-layout/pagelayout/page-layout-2",["jquery","confluence/templates","ajs"],function(h,n,f){function q(a,b,c,d){var e=a.find(".cell"),f=e.length,i=h(),l=b.cells.length,j=[],m=[],g,k;a.attr("class","columnLayout");a.addClass(b.id);a.attr("data-layout",b.id);g=0;for(k=f;g<k;g++)m=e.eq(g).detach(),j.push(s(m.children(".innerCell")));g=0;for(k=l;g<k;g++)i=i.add(n.PageLayout.cell2({type:b.cells[g].type||""}));if(f<=l)m=j;else{m=j.slice(0,l);g=l;for(k=f;g<k;g++)m[l-1]+=j[g]}a.prepend(i);
g=0;for(k=l;g<k;g++)i.eq(g).find(".innerCell").html(m[g]);p(a,c,d)}var e=function(a){this.editor=a;this.body=h(a.getBody());this.setup()};e.prototype.setup=function(){var a=this.body.find(".contentLayout2");a.length?(p(a,this.body,this.editor),this.body.find("> p").each(function(){""===this.id.trim()&&0===this.classList.length&&h(this).remove()}),this.editor.undoManager.add()):this.body.attr("contenteditable","true")};e.prototype.addSection=function(a){var b=this,c=h(n.PageLayout.newSection2()),d=
a||i(this.body,this.editor,!0);if(d.length){var o=e.Layouts.get(d.attr("data-layout"));this.editor.undoManager.ignore(function(){q(c,o,b.body,b.editor);d.after(c)});j(this.editor,c);f.trigger("editor.page-layout.add-section",{section:c})}else this.createInitialLayoutIfNone()};e.prototype.changeSection=function(a,b){var c=this;e.isPageLayout()||this.createInitialLayoutIfNone();var d=b||i(this.body,this.editor,!1);if(d.length){var o=e.Layouts.get(d.attr("data-layout"));this.editor.undoManager.ignore(function(){q(d,
a,c.body,c.editor)});j(this.editor,d);f.trigger("editor.page-layout.change-layout",{section:d,originalLayout:o,currentLayout:a})}};e.prototype.removeSection=function(a){if(e.isPageLayout()){var a=a||i(this.body,this.editor,!0),b=a.next(),c=a.prev(),d;b.length?(d=b,a.remove()):c.length?(d=c,a.remove()):(a.closest(".contentLayout2").remove(),a=this.body.find(".contentLayout2").find(".columnLayout").first(),a.length?d=a:(a=this.editor,a.getBody().setAttribute("contenteditable",!0),a.setContent("<p></p>"),
r(a),a=h("#rte-button-pagelayout-2"),a.hasClass("active")&&a.click()));d&&d.length&&j(this.editor,d);f.trigger("editor.page-layout.remove-section",{})}};e.prototype.moveSectionUp=function(a){if(e.isPageLayout()){var a=a||i(this.body,this.editor,!0),b=a.prev();b.length&&(a.detach(),b.before(a),j(this.editor,a));f.trigger("editor.page-layout.move-section-up",{section:a})}};e.prototype.moveSectionDown=function(a){if(e.isPageLayout()){var a=a||i(this.body,this.editor,!0),b=a.next();b.length&&(a.detach(),
b.after(a),j(this.editor,a));f.trigger("editor.page-layout.move-section-down",{section:a})}};e.prototype.createInitialLayoutIfNone=function(){if(!e.isPageLayout()){var a=h(n.PageLayout.emptyLayout2()),b=a.find(".innerCell"),c=this.body.children().detach();b.append(c);this.body.append(a);p(a,this.body,this.editor);r(this.editor)}};e.isPageLayout=function(){return!!h(f.Rte.getEditor().getBody()).find("div.contentLayout2").length};e.needsContentEditableBody=function(){return!e.isPageLayout()};e.Layouts=
[{id:"single",icon:"1col",name:"Single column section",cells:[{type:"normal"}]},{id:"two-equal",icon:"2col",name:"Two column section",cells:[{type:"normal"},{type:"normal"}]},{id:"two-left-sidebar",icon:"2col-right",name:"Two column section with left side-bar",cells:[{type:"aside"},{type:"normal"}]},{id:"two-right-sidebar",icon:"2col-left",name:"Two column section with right side-bar",cells:[{type:"normal"},{type:"aside"}]},
{id:"three-equal",icon:"3col",name:"Three column section",cells:[{type:"normal"},{type:"normal"},{type:"normal"}]},{id:"three-with-sidebars",icon:"3col-center",name:"Three column section with side-bars",cells:[{type:"sidebars"},{type:"normal"},{type:"sidebars"}]}];e.Layouts.get=function(a){for(var b=e.Layouts,c=0,d=b.length;c<d;c++)if(b[c].id===a)return b[c];return null};e.Layouts.findNearestSection=function(a){var b=f.Rte.getEditor(),c=h(b.getBody());
return i(c,b,a)};var s=function(a){a=h(a);if(a.length)for(var b=a[0].childNodes,c=0;c<b.length;c++){var d=b[c];if(!("P"===d.nodeName&&1===d.childNodes.length&&"BR"===d.firstChild.nodeName))return a.html()}return""},i=function(a,b,c){b=h(b.selection.getRng(!0).startContainer).closest(".columnLayout");!b.length&&c&&(b=a.find(".columnLayout").last());return b},p=function(a,b,c){var d=require("tinymce");b.attr("contenteditable","false");h(".innerCell",a).each(function(){var a=h(this);a.attr("contenteditable",
"true");a.children().length||a.append("<p><br /></p>")});d.isIE&&b.delegate(".innerCell","focus.pageLayout",function(){c.dom.settings.root_element=this})},r=function(a){var b=a.selection,c=b.getRng(!0),d=h('[contenteditable="true"]',a.getBody());d.length?(a.focus(),d[0].focus(),a=d.children()[0],c.setStart(a,0),c.setEnd(a,0),b.setRng(c)):a.focus()},j=function(a,b){var c=a.selection,d=c.getRng(!0),e=b.find('[contenteditable="true"]').first(),h=e.children();h.length?(a.focus(),e[0].focus(),e=h[0],d.setStart(e,
0),d.setEnd(e,0),c.setRng(d),f.Rte.showElement(e)):a.focus()};return e});require("confluence/module-exporter").exportModuleAsGlobal("confluence-page-layout/pagelayout/page-layout-2","tinymce.plugins.PageLayoutPlugin.PageLayout2");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-page-layout:pagelayout', location = 'js/pagelayout/tinymce-page-layout-toolbar.js' */
define("confluence-page-layout/pagelayout/tinymce-page-layout-toolbar",["jquery","ajs","tinymce","document","confluence/legacy-editor-global-AVOID-IF-POSSIBLE"],function(d,b,e,f,a){var i=function(a){var a=a||e.plugins.PageLayoutPlugin.PageLayout2.Layouts.findNearestSection(),c=a.attr("data-layout"),a=d("#rte-toolbar-row-pl2-toolbar").find(".layouts button"),c=a.find(".pl2-layout-"+c).closest(".aui-button");c.hasClass("active")||(a.filter(".active").removeClass("active"),c.addClass("active"))};return{initContextToolbars:function(p,
c){var j=d(f),m=d("#page-layout-2"),g=d("#rte-button-pagelayout-2");c.addCommand("mcePageLayoutsToolbar",function(){g.hasClass("active")?j.trigger("removeContextToolbarRow.Toolbar",{id:"pl2-toolbar",animate:!0}):(j.trigger("createContextToolbarRow.Toolbar",{id:"pl2-toolbar",buttons:a.PageLayoutToolbar.Buttons,topToolbar:!0,animate:!0}),i(),c.execCommand("mcePageLayoutInitialize"));g.toggleClass("active")});g.click(function(a){a.preventDefault();m.hasClass("disabled")||c.execCommand("mcePageLayoutsToolbar",
!1,null)});c.onNodeChange.add(function(a,c,b){a=d(b).closest(".columnLayout");i(a)});for(var k=e.plugins.PageLayoutPlugin.PageLayout2.Layouts,l=[],n=function(b){l.push(new a.Toolbar.Components.Button({text:b.name,iconClass:"aui-icon aui-icon-small aui-iconfont-layout-"+b.icon+"-large",click:function(){c.execCommand("mcePageLayoutChangeSection",!1,{layout:b})}}))},h=0,o=k.length;h<o;h++)n(k[h]);return{Buttons:[new a.Toolbar.Components.Group([new a.Toolbar.Components.Button({triggerText:"Add section",
id:"add-layout-section",tooltip:"Add a new section below",iconClass:"aui-icon aui-icon-small aui-iconfont-add",click:function(){c.execCommand("mcePageLayoutAddSection")}}),new a.Toolbar.Components.Button({triggerText:"Remove section",id:"remove-layout-section",tooltip:"Remove the current section",iconClass:"aui-icon aui-icon-small aui-iconfont-delete",click:function(){c.execCommand("mcePageLayoutRemoveSection")}})]),
new a.Toolbar.Components.Group([new a.Toolbar.Components.Button({triggerText:"Move up",id:"move-up-layout-section",tooltip:"Move section up",iconClass:"aui-icon aui-icon-small aui-iconfont-up",click:function(){c.execCommand("mcePageLayoutMoveSectionUp")}}),new a.Toolbar.Components.Button({triggerText:"Move down",id:"move-down-layout-section",tooltip:"Move section down",
iconClass:"aui-icon aui-icon-small aui-iconfont-down",click:function(){c.execCommand("mcePageLayoutMoveSectionDown")}})]),new a.Toolbar.Components.Group(l,{id:"pagelayout2-toolbar",text:"Apply layout",groupClass:"layouts"}),new a.Toolbar.Components.Group([new a.Toolbar.Components.Button({text:"Close toolbar",iconClass:"aui-icon aui-icon-small aui-iconfont-close-dialog",click:function(){c.execCommand("mcePageLayoutsToolbar",!1,null)}})],{groupClass:"close"})],
Events:[]}}}});require("confluence/module-exporter").safeRequire("confluence-page-layout/pagelayout/tinymce-page-layout-toolbar",function(d){var b=require("confluence/meta"),e=require("jquery"),f=require("document");"comment"!==b.get("content-type")&&e(f).bind("initContextToolbars.Toolbar",function(a,b){Confluence.Editor.PageLayoutToolbar=d.initContextToolbars(a,b)})});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-inline-tasks:inline-tasks-editor', location = 'js/editor_plugin_src.js' */
(function(b){var c=/^\u200b?(\[)$/;AJS.bind("confluence.editor.registerHandlers",function(n,m){if(!AJS.Rte.Support.inlineTasks()){return}var k=m.handlerManager,j=m.ed,l=m.createHandler;k.registerHandler("]".charCodeAt(0),l(c,function(){j.plugins.lists.applyList("UL","OL","inline-task-list",{attributesOnItems:{"data-inline-task-id":""},placeholderText:"Type your task here, using \"@\" to assign to a user and \"//\" to select a due date"})},true))});function e(j){j.plugins.lists.applyList=_.bind(_.wrap(j.plugins.lists.applyList,function(k){k.apply(this,Array.prototype.slice.call(arguments,1));g(j)}),j.plugins.lists)}function g(j,l){if(!(tinymce.isIE8||tinymce.isIE11||tinymce.isGecko||tinymce.isWebKit)){return}var k=l||b(d(j));if(k.height()===0||tinymce.isIE8){k.append("&nbsp;");(tinymce.isWebKit||tinymce.isIE8)&&j.selection.setCursorLocation(k[0],0)}}function h(m,k){var j,n,l;if(tinymce.isGecko){l=k.getBoundingClientRect();j=m.pageX-(l.left+tinymce.DOM.getViewPort(tinymce.activeEditor.getWin()).x);n=m.pageY-(l.top+tinymce.DOM.getViewPort(tinymce.activeEditor.getWin()).y)}else{if(tinymce.isIE8){j=m.offsetX-k.offsetLeft;n=m.offsetY-k.offsetTop}else{j=m.offsetX;n=m.offsetY}}return j>=3&&j<=14&&n>=3&&n<=14}function i(j,m){var k=m.target;if(k.tagName!=="LI"){return}var l=j.dom.getParent(k,"ul,ol");if(l.tagName==="UL"&&j.dom.hasClass(l,"inline-task-list")){if(h(m,k)){if(j.dom.hasClass(k,"checked")){j.dom.removeClass(k,"checked")}else{j.dom.addClass(k,"checked")}}}}function d(k){var l=k.selection.getStart();var j=(l&&l.tagName&&l.tagName.toUpperCase()==="LI")?l:k.dom.getParent(l,"li");return j}function a(k,l){if(l.keyCode===tinymce.VK.ENTER&&!l.shiftKey){var j=d(k);if(j){var m=b(j);if(k.dom.hasClass(j.parentNode,"inline-task-list")){m.removeClass("checked").attr("data-inline-task-id","")}else{m.removeClass("checked").removeAttr("data-inline-task-id")}g(k,m)}}}function f(k,l){var j=d(k);if(j){var m=b(j);if(k.dom.hasClass(j.parentNode,"inline-task-list")){m.find("font").contents().unwrap()}}}tinymce.create("tinymce.plugins.ConfluenceTaskListPlugin",{init:function(j,k){e(j);j.onClick.add(i);j.onKeyUp.add(a);if(tinymce.isIE){j.onKeyUp.add(f)}},getInfo:function(){return{longname:"Confluence Task List Plugin",author:"Atlassian",authorurl:"http://www.atlassian.com",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("confluencetasklist",tinymce.plugins.ConfluenceTaskListPlugin);AJS.Editor.Adapter.addTinyMcePluginInit(function(j){j.plugins+=",confluencetasklist"})})(AJS.$);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-inline-tasks:inline-tasks-editor', location = 'js/inline-tasks-rte.js' */
(function(c){function a(e){var d=c(e).find("li[data-inline-task-id]");d.each(function(){var g=c(this),f=g.parent();if(!f.is("ul")){f.wrapInner('<ul class="inline-task-list"/>')}else{if(!f.hasClass("inline-task-list")){f.addClass("inline-task-list")}}})}function b(e){a(e);var g;if(Confluence.Editor&&Confluence.Editor.getContentType){g=Confluence.Editor.getContentType()}else{g=AJS.Meta.get("content-type")}var f=c(e).find("ul.inline-task-list"),d=f.find("> li");if(g=="comment"){d.removeClass("checked").removeAttr("data-inline-task-id");f.removeClass("inline-task-list")}else{d.attr("data-pasted-task","true")}}c(document).bind("postPaste",function(f,d,g){b(g.node)})})(AJS.$);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-inline-tasks:date-helper-js-resources', location = '/js/lib/lang/de.js' */
(function(a){if(typeof define==="function"&&define.amd){define(["moment"],a)}else{if(typeof exports==="object"){module.exports=a(require("../moment"))}else{a(window.moment)}}}(function(b){function a(e,d,c,g){var f={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return d?f[c][0]:f[c][1]}return b.lang("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),longDateFormat:{LT:"H:mm [Uhr]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd, D. MMMM YYYY LT"},calendar:{sameDay:"[Heute um] LT",sameElse:"L",nextDay:"[Morgen um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gestern um] LT",lastWeek:"[letzten] dddd [um] LT"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:a,mm:"%d Minuten",h:a,hh:"%d Stunden",d:a,dd:a,M:a,MM:a,y:a,yy:a},ordinal:"%d.",week:{dow:1,doy:4}})}));
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-inline-tasks:date-helper-js-resources', location = '/js/lib/lang/es.js' */
(function(a){if(typeof define==="function"&&define.amd){define(["moment"],a)}else{if(typeof exports==="object"){module.exports=a(require("../moment"))}else{a(window.moment)}}}(function(c){var b="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),a="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_");return c.lang("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(d,e){if(/-MMM-/.test(e)){return a[d.month()]}else{return b[d.month()]}},weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"Do_Lu_Ma_Mi_Ju_Vi_Sá".split("_"),longDateFormat:{LT:"H:mm",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY LT",LLLL:"dddd, D [de] MMMM [de] YYYY LT"},calendar:{sameDay:function(){return"[hoy a la"+((this.hours()!==1)?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+((this.hours()!==1)?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+((this.hours()!==1)?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+((this.hours()!==1)?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+((this.hours()!==1)?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:"%dº",week:{dow:1,doy:4}})}));
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-inline-tasks:date-helper-js-resources', location = '/js/lib/lang/fr.js' */
(function(a){if(typeof define==="function"&&define.amd){define(["moment"],a)}else{if(typeof exports==="object"){module.exports=a(require("../moment"))}else{a(window.moment)}}}(function(a){return a.lang("fr",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Je_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[Aujourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinal:function(b){return b+(b===1?"er":"")},week:{dow:1,doy:4}})}));
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-inline-tasks:date-helper-js-resources', location = '/js/lib/lang/ja.js' */
(function(a){if(typeof define==="function"&&define.amd){define(["moment"],a)}else{if(typeof exports==="object"){module.exports=a(require("../moment"))}else{a(window.moment)}}}(function(a){return a.lang("ja",{months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"Ah時m分",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日LT",LLLL:"YYYY年M月D日LT dddd"},meridiem:function(b,d,c){if(b<12){return"午前"}else{return"午後"}},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:"[来週]dddd LT",lastDay:"[昨日] LT",lastWeek:"[前週]dddd LT",sameElse:"L"},relativeTime:{future:"%s後",past:"%s前",s:"数秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}})}));
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-inline-tasks:date-helper-js-resources', location = '/js/lib/lang/en-gb.js' */
(function(a){if(typeof define==="function"&&define.amd){define(["moment"],a)}else{if(typeof exports==="object"){module.exports=a(require("../moment"))}else{a(window.moment)}}}(function(a){return a.lang("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinal:function(e){var c=e%10,d=(~~(e%100/10)===1)?"th":(c===1)?"st":(c===2)?"nd":(c===3)?"rd":"th";return e+d},week:{dow:1,doy:4}})}));
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-inline-tasks:date-helper-js-resources', location = '/js/inline-tasks-util.js' */
(function(a){var b=window.Confluence||{};b.InlineTasks=b.InlineTasks||{};b.InlineTasks.Util={NODE_TYPE:{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12},KEY:{BACKSPACE:8,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,INS:45,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46,META:91},addContentEditableIfApplicable:function(d){var c=a(d);c.attr({contenteditable:false,"class":"non-editable",onselectstart:"return false;"});tinymce.isIE&&c.attr({contenteditable:true,unselectable:"on",oncontrolselect:"return false;"})}}})(AJS.$);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-inline-tasks:date-helper-js-resources', location = '/js/dateutil.js' */
var Confluence=window.Confluence||{};Confluence.InlineTasks=Confluence.InlineTasks||{};Confluence.InlineTasks.DateUtil=(function(b,a){a={PATTERN_INSERTING:"DD-MM-YYYY",PATTERN_LOZENGE:"DD MMM YYYY",PATTERN_INSIDE_TIME_ELE:"YYYY-MM-DD",convertDateIntoHtml:function(e,f,g,h){if(!h){h=a.PATTERN_INSERTING}if(!g){g=""}if(!f){f="<time>"}var c=b("<div>"),d="",i=e.format(h);if(f.indexOf("time")>=0){d=b(f,{datetime:e.format(a.PATTERN_INSIDE_TIME_ELE)});Confluence.InlineTasks.Util.addContentEditableIfApplicable(d);g&&d.attr("class",g);d.text(i)}else{d=b(f);g&&d.attr("class",g);d.text(i)}c.append(d);return c.html()},insertDateIntoCurrentCursor:function(f,d,l,k,m){var i=tinyMCE.activeEditor,j=a.convertDateIntoHtml(f,d,l,k),e=b(j,i.getDoc())[0],g=tinymce.confluence.NodeUtils.replaceSelection(e);if(m){i.execCommand("mceInsertContent",false,m,{skip_undo:true})}var c=b(i.selection.getRng(true).startContainer).closest("li[data-inline-task-id]").length?"task":"page";var h={context:c,trigger:"character"};AJS.trigger("analyticsEvent",{name:"confluence-spaces.date.added",data:h});return g},parse:function(d,e){if(!e){e=a.PATTERN_INSIDE_TIME_ELE}var c=moment(b.trim(d),e,true);return c.isValid()?c:null},format:function(c,d){if(!d){d=a.PATTERN_INSIDE_TIME_ELE}return c?c.format(d):null},guessPartialDate:function(c,g){if(c==null){return null}c=b.trim(c.replace(/[-\.\/]/g,"-"));var f=c.split("-"),e=moment().format(g).split("-");for(var d=0;d<3;d++){if(!f[d]){f[d]=e[d]}if(/^\d$/.test(f[d])){f[d]="0"+f[d]}}return a.parse(f.join("-"),g)},datepicker:{POSITION_ABOVE:true,POSITION_BELOW:false,POSITION_RIGHT:true,POSITION_LEFT:false,dropDownStillFitsVertically:function(d,e,c){if(d===this.POSITION_ABOVE){return e.above>=c}return e.below>=c},dropDownStillFitsHorizontally:function(d,e,c){if(d===this.POSITION_RIGHT){return e.right>=c}return e.left>=c},getPreferredHorizontalPosition:function(d,c){if(d.right>=c){return this.POSITION_RIGHT}else{if(d.left>=c){return this.POSITION_LEFT}}return d.right>d.left?this.POSITION_RIGHT:this.POSITION_LEFT},getPreferredVerticalPosition:function(d,c){if(d.below>=c){return this.POSITION_BELOW}else{if(d.above>=c){return this.POSITION_ABOVE}}return d.below>d.above?this.POSITION_BELOW:this.POSITION_ABOVE},calculateDatepickerPosition:function(c){var d=this;return function(f,o){var l,p,r,i,j,s=16,u=0,e,h,k,m,n=AJS.Rte.getEditorFrame();AJS.Position.spaceLeftRight=function(z,y){var x=y.position().left;return{left:x,right:b(z).width()-x}};l=AJS.Position.spaceAboveBelow(n,c);p=AJS.Position.spaceLeftRight(n,c);j=AJS.Rte.Content.offset(c);e=f.outerHeight(true);h=f.outerWidth(true);k=e+s;m=h+u;var w=d.POSITION_BELOW;var v=d.POSITION_RIGHT;if(w){if(!d.dropDownStillFitsVertically(w,l,k)){w=null}}if(!w){w=d.getPreferredVerticalPosition(l,k)}if(v){if(!d.dropDownStillFitsHorizontally(v,p,k)){v=null}}v=d.getPreferredHorizontalPosition(p,m);if(w===d.POSITION_ABOVE){r=j.top-e-s}else{r=j.top+c.height()+s}if(v===d.POSITION_RIGHT){i=j.left-u}else{i=(j.left+c.outerWidth())-h}var t={top:r,left:i};var g=(v==d.POSITION_RIGHT)?c.outerWidth()/2:h-c.outerWidth()/2;if((g<0)||(g>h)){g=(h/10)}var q={left:g,top:(w===d.POSITION_ABOVE)?e:-s/2};return{displayAbove:w,popupCss:t,arrowCss:q}}},getHintTextOfDatePicker:function(c){return c?"Select a due date for this task.":"Select a date."},create:function(k){var j=k.$attachTo,d=k.$positionTo,c=k.startDate,i=k.onSelect,e=k.isSetDueDate;var h=b("<input>").attr("type","date").addClass("aui-date-picker").css("display","none");var g=h.datePicker({overrideBrowserDefault:true,dateFormat:"yy-mm-dd",languageCode:AJS.Meta.get("user-locale")&&AJS.Meta.get("user-locale").split("_")[0],position:this.calculateDatepickerPosition(d),onSelect:function(l){i(a.parse(l));f()},hint:this.getHintTextOfDatePicker(e)});var f=function(){g&&g.destroyPolyfill&&g.destroyPolyfill();h&&h.remove();b(".aui-datepicker-dialog").remove();g=null;h=null};g.show();g.setDate(a.format(c));b(".aui-datepicker-dialog .aui-datepicker-hint").addClass(e?"set-duedate":"set-date");j.before(h);return{die:function(){f()},show:function(){g.show()},hide:function(){g.hide()},getContainer:function(){return h},setDate:function(m){var l=a.guessPartialDate(m,a.PATTERN_INSERTING);AJS.debug("Set date: "+m);l&&g.setDate(a.format(l))},placeDatePicker:function(){var m=AJS.InlineDialog.current;var l=m&&m.popup;l&&l.refresh()}}}}};return a}(AJS.$,Confluence.InlineTasks.DateUtil||{}));AJS.toInit(function(){var b=function(g,d,f){if(d&&d.toLowerCase()==="en_us"){return"MM"+f+"DD"+f+"YYYY"}var e=_.uniq(g.replace(/[^MDY]/g,"").split(""));return e.join(f).replace("D","DD").replace("M","MM").replace("Y","YYYY")};var c=AJS.Meta.get("user-locale");if(c){moment.lang(c.split("_")[0].toLowerCase())}var a=AJS.Meta.get("user-date-pattern");if(a){Confluence.InlineTasks.DateUtil.PATTERN_LOZENGE=a.toUpperCase();Confluence.InlineTasks.DateUtil.PATTERN_INSERTING=b(a.toUpperCase(),c,"-");Confluence.InlineTasks.DateUtil.PATTERN_INSERTING_ALTERNATE=b(a.toUpperCase(),c,"/")}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-inline-tasks:editor-autocomplete-date-js', location = '/js/editor-plugin/date-autocomplete-help-dialog.js' */
AJS.toInit(function(){if(!(Confluence.KeyboardShortcuts&&Confluence.KeyboardShortcuts.Autoformat)){return}Confluence.KeyboardShortcuts.Autoformat.push({action:"//",context:"autoformat.autocomplete",description:"Date"})});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-inline-tasks:editor-autocomplete-date-js', location = '/js/editor-plugin/autocomplete-manager.js' */
(function(d){var f=window.Confluence||{};var e="confluence.date-autocomplete-manager.plugin";f.Editor=f.Editor||{};f.Editor.AutoComplete=f.Editor.AutoComplete||{};var b=f.InlineTasks.Util.KEY,a=f.InlineTasks.DateUtil,c=f.Editor.AutoComplete;c.SETTING_DEFAULT={leadingChar:"",isDataValid:function(g){return false},backWords:0,onBeforeDie:function(){},onAfterStart:function(){},onScroll:function(){}};c.Manager=function(g){this.ed=AJS.Rte.getEditor();this.settings=d.extend({},c.SETTING_DEFAULT,g);this.log=AJS.debug;this.control=null};c.Manager.prototype={start:function(g){AJS.trigger("synchrony.stop",{id:e});this.log("startAutoComplete - Started");var h=d.extend({},this.settings,g);this.control=f.Editor.Autocompleter.Control(this.ed,h);if(!this.control){return false}this.attachEventsToControl();h.onAfterStart&&h.onAfterStart({date:g.date,isTriggerFromOrphan:g.isTriggerFromOrphan?true:false});return true},attachEventsToControl:function(){var j=this,m=j.control,i=j.log,h=j.settings;if(typeof this.settings.onBeforeDie==="function"){var l=this.control.die;this.control.die=function(){j.settings.onBeforeDie.apply(j.control,arguments);if(j.dateInserted()){l.apply(j.control,[true]);AJS.trigger("analyticsEvent",{name:"confluence-spaces.tasks.daterecognition.killed"})}else{l.apply(j.control,arguments)}}}var g=_.bind(_.throttle(j.settings.onScroll,40),this);var k={onBeforeKey:function(n,o){if(n.keyCode!==b.ESCAPE&&n.keyCode!==b.ENTER){j.control&&j.control.getContainer().addClass("isDirty")}if(n.keyCode===b.DOWN||n.keyCode===b.UP||n.keyCode===b.ENTER){tinymce.dom.Event.cancel(n);return false}if(n.keyCode===b.ESCAPE||n.keyCode===b.TAB||n.keyCode===b.BACKSPACE&&!o){i("autoCompleteControl.onBeforeKey - killing autoCompleteControl");this.die(n.keyCode===b.BACKSPACE);return false}return true},onKeyPress:function(q,r){var o=AJS.$.browser.msie?q.keyCode:q.which;if(q.keyCode===b.ENTER){tinymce.dom.Event.cancel(q);return false}var p=String.fromCharCode(o),n=AJS.indexOf(this.settings.endChars,p);if(n>=0){i("autoCompleteControl.onKeyPress - caught autocomplete-closing char - character");m.die()}return true},onAfterKey:function(p,q){var o=d("#autocomplete-trigger",j.control.getContainer()),n=o.text();if(o.length>0&&n!==j.settings.leadingChar){i("after","dying because of: trigger text is modified");j.reset();return false}if(p.keyCode===b.ENTER){if(h.isDataValid(q)){m.update(q)}else{i("autoCompleteControl.onAfterKey - closing autocomplete due to invalid data - "+q);m.die(false)}return false}if(j.dateInserted()&&(q.length>10)&&(!a.parse(q,[a.PATTERN_INSERTING,a.PATTERN_INSERTING_ALTERNATE]))){j.reset();return false}if(p.keyCode===b.SPACE){j.reset();return false}return true},onDeath:function(){j.reset()},onScroll:function(){if(!j.isAlive()){return}g()}};d.extend(m,k)},isAlive:function(){return this.control&&!this.control.dying},reset:function(){if(!this.control){return}this.control.die();this.control=null;AJS.trigger("synchrony.start",{id:e})},dateInserted:function(g){if(g===true){return this.control.getContainer().addClass("hasDateInserted")}else{if(g===false){return this.control.getContainer().removeClass("hasDateInserted")}else{return this.control.getContainer().hasClass("hasDateInserted")}}},dirty:function(g){if(g===true){return this.control.getContainer().addClass("isDirty")}else{return this.control.getContainer().hasClass("isDirty")}},reattach:function(){var g=f.Editor.Autocompleter.Control.removeOrphanedControl();if(g&&g.leadingChar===this.settings.leadingChar){this.reset();return this.start({backWords:1,isTriggerFromOrphan:true})}return false}}})(AJS.$);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-inline-tasks:editor-autocomplete-date-js', location = '/js/editor-plugin/date-autocomplete.js' */
(function(h,e){var r="dateautocomplete",m="tinymce.plugins.DateAutocomplete",p="mceConfInsertDateAutocomplete",k="//";var q="confluence.date-autocomplete.plugin";var s=Confluence.InlineTasks.Util,n=s.NODE_TYPE,d=s.KEY,a=Confluence.InlineTasks.DateUtil,g=null,o=null,b=false,i=e.dom.TreeWalker;var j={initDateAutoCompleteObject:function(t){if(!Confluence.Editor.Autocompleter){Confluence.Editor.Autocompleter=e.confluence.Autocompleter}Confluence.Editor.Autocompleter.Settings[k]={ch:k,endChars:[],update:function(x,w){o.picker.die();var v=(w==a.PATTERN_INSERTING.toLowerCase())?moment():a.guessPartialDate(w,a.PATTERN_INSERTING);v&&a.insertDateIntoCurrentCursor(v,"<time>","",a.PATTERN_LOZENGE,"&nbsp;");if(o.dateInserted()){AJS.trigger("analyticsEvent",{name:"confluence-spaces.tasks.daterecognition.used"})}o.reset();t.undoManager.add();AJS.trigger("synchrony.start",{id:q})}};var u={leadingChar:k,isDataValid:function(v){return !o.dirty()||a.guessPartialDate(v,a.PATTERN_INSERTING)!=null},onBeforeDie:function(){o.picker&&o.picker.die();if(o.control){var v=h(o.control.getContainer());if(!o.dirty()){v.find("#autocomplete-search-text").remove()}}},onAfterStart:function(w){if(w&&w.date){j.fillPlaceholderDateAutoComplete(t,w.date,true);o.dirty(true);o.dateInserted(true)}else{if(w&&!w.isTriggerFromOrphan){j.fillPlaceholderDateAutoComplete(t,a.PATTERN_INSERTING.toLowerCase(),false);o.dateInserted(false)}}var v=o.control.text();var x=a.guessPartialDate(v,a.PATTERN_INSERTING)||moment();j.bindDatePickerToAutoComplete(x)},onScroll:function(){o.picker&&o.picker.placeDatePicker()}};o=new Confluence.Editor.AutoComplete.Manager(u)},activateDateAutocomplete:function(v,u){if(!o.isAlive()){var t=o.start(u);if(!t){g.execCommand("mceInsertContent",false,k,{skip_undo:true});return false}}},bindDatePickerToAutoComplete:function(w){var t=o.control&&o.control.getContainer();if(!t.length){return}t.addClass("date-autocomplete");t.find("#autocomplete-search-text span").addClass("inserting");var v=function(x){o.control.update(x.format(a.PATTERN_INSERTING))},u=j.isInsideTaskAndFirstTimeNode(t);o.picker=a.datepicker.create({$attachTo:t,$positionTo:t,startDate:w,onSelect:v,isSetDueDate:u})},fillPlaceholderDateAutoComplete:function(u,x,w){var t=o.control.getContainer().find("#autocomplete-search-text span");t.text(AJS.Rte.HIDDEN_CHAR+x);var v=u.dom.createRng();v.setStart(t[0].firstChild,1);v.setEnd(t[0].firstChild,x.length+1);w&&v.collapse(false);u.selection.setRng(v)},autocompleteDoubleSlash:function(y,x){var v=x.handlerManager,u=x.ed,w=x.createHandler;var t=w(/(?:\s|\xA0|^|\ufeff|\u200b)(\/)$/,function(){u.execCommand(p,false,{},{skip_undo:true})},true,"#autocomplete");v.registerHandler("/".charCodeAt(0),t)},registerTriggerDoubleSlash:function(t){t.addCommand(p,j.activateDateAutocomplete);AJS.bind("confluence.editor.registerHandlers",this.autocompleteDoubleSlash)},isTimeNode:function(t){return t&&t.nodeType===n.ELEMENT_NODE&&t.tagName.toLowerCase()==="time"},getTimeNodeAtCursor:function(t){if(!t){t=g}var u=t.selection.getNode();if(j.isTimeNode(u)){return u}u=t.selection.getStart();if(j.isTimeNode(u)){return u}u=t.selection.getEnd();if(j.isTimeNode(u)){return u}},makeTimeNodesUnEditable:function(t){t.each(function(){var u=h(this);if(h.trim(u.text())===""){u.remove()}e.isWebKit&&u.remove("br.Apple-interchange-newline");s.addContentEditableIfApplicable(this)})},wrapTimeNodesWithHiddenChar:function(t){t.each(function(){var u=h(this);if(!this.previousSibling||this.previousSibling.nodeType!==n.TEXT_NODE||this.previousSibling.nodeValue===""){u.before(AJS.Rte.HIDDEN_CHAR)}if(!this.nextSibling||this.nextSibling.nodeType!==n.TEXT_NODE||this.previousSibling.nodeValue===""){u.after(AJS.Rte.HIDDEN_CHAR)}})},putCursorAtEdge:function(u,w,t){t=!!t;if(t){if(!w.nextSibling||w.nextSibling.nodeType!==n.TEXT_NODE){h(w).after(u.dom.doc.createTextNode(""))}}else{if(!w.previousSibling||w.previousSibling.nodeType!==n.TEXT_NODE){h(w).before(u.dom.doc.createTextNode(""))}}var v=u.selection.dom.createRng();v.selectNode(t?w.nextSibling:w.previousSibling);v.collapse(t);u.selection.setRng(v)},findFirstTimeNodeInClosestBlock:function(u,z,w){var y=new i(z,u.getBody());var x=z,v=0;do{if(v==1&&j.isTimeNode(z)){return z}var t=w?z.previousSibling:z.nextSibling;if(z!==x&&t&&(u.dom.isBlock(z)||u.dom.isBlock(t))){v++}}while((z=w?y.next():y.prev())&&v<2)},findFirstTimeNodeNearby:function(t,x,u){var w=x;var v=new i(x,t.getBody());do{if(j.isTimeNode(x)){return x}if(t.dom.isBlock(x)||(x!==w&&x.nodeType===n.TEXT_NODE&&x.nodeValue!=="")){return}}while(x=u?v.next():v.prev())},convertInvalidTimeNodeToPlainText:function(t){t.each(function(){var w=h(this);var u=w.attr("datetime");var v=a.parse(u);if(!v){w.before(w.text());w.remove()}})},isInsideTaskAndFirstTimeNode:function(u){var t=h(u),v=t.closest("ul.inline-task-list > li[data-inline-task-id]");if(!v.length){return false}return v.find("time, span.date-autocomplete")[0]===t[0]}};var c={handleRemoveDateLozenge:function(u,A){var z=A.keyCode;if(z!==d.BACKSPACE&&z!==d.DELETE){return}var x=(z===d.DELETE),t=u.selection.getRng(true),v=t.startContainer,w=v;if(v.nodeType==n.TEXT_NODE&&(x?t.startOffset!=v.nodeValue.length:t.startOffset!=0)){return}if(v.nodeType===n.ELEMENT_NODE){if(x){w=(v.childNodes.length===t.startOffset)?v:v.childNodes.item(t.startOffset)}else{w=(t.startOffset===0)?v:v.childNodes.item(t.startOffset-1)}}var y=j.findFirstTimeNodeNearby(u,w,x);y&&u.dom.remove(y)},handleClickingDateLozenge:function(y,B){var v=h(B.target);if(!v.is("time")){return}AJS.trigger("synchrony.stop",{id:q});var t=(v.closest("li[data-inline-task-id]").length)?"task":"page";var w={mode:"editor",context:t};AJS.trigger("analyticsEvent",{name:"confluence-spaces.date.clicked",data:w});var E=v.closest("body");var A=function(){AJS.Rte.unbindScroll("date-lozenge-date-picker");z.die();AJS.trigger("synchrony.start",{id:q})};E.one("keydown click",A);var D=function(G){var H=G.format(a.PATTERN_INSIDE_TIME_ELE);var F=G.format(a.PATTERN_LOZENGE);if(H!==v.attr("datetime")){var I={context:t};AJS.trigger("analyticsEvent",{name:"confluence-spaces.date.changed",data:I})}v.attr("datetime",H);v.text(F);E.unbind("keydown click",A);AJS.trigger("synchrony.start",{id:q})};var u=a.parse(v.attr("datetime")),x=j.isInsideTaskAndFirstTimeNode(v),z=a.datepicker.create({$attachTo:v,$positionTo:v,startDate:u,onSelect:D,isSetDueDate:x});var C=_.bind(_.throttle(function(){if(z&&AJS.Rte.isAnyPartShown(v)){z.placeDatePicker()}else{A()}},40),this);AJS.Rte.bindScroll("date-lozenge-date-picker",C)},handleTypingDate:function(u,w){var v=w.keyCode;if(v===d.UP||v===d.DOWN||v===d.LEFT||v===d.RIGHT||v===d.HOME||v===d.END||v===d.PAGEDOWN||v===d.PAGEUP||w.metaKey||w.ctrlKey||w.altKey){return}if(o.control&&o.picker){var t=o.control.text();o.picker.setDate(t)}},handleOnLoadContent:function(t){var v=h(t.dom.doc),u=v.find("time");j.makeTimeNodesUnEditable(u);j.wrapTimeNodesWithHiddenChar(u)},handlePostPaste:function(u,t,v){j.convertInvalidTimeNodeToPlainText(h(v.node).find("time"))},handlePostPasteContent:function(v,t,w){var u=h(w.node).find("time");j.makeTimeNodesUnEditable(u)},handlePrePasteContent:function(u,t,v){if(j.getTimeNodeAtCursor(g)){v.content="";return false}},fixWhenUpDownNavOnList:function(u,A){var w=A.keyCode;if(w!==d.UP&&w!==d.DOWN){return}var t=u.selection.getRng(true),v=t.startContainer,x=v,y=w===d.DOWN;if(v.nodeType===n.ELEMENT_NODE){if(y){x=(v.childNodes.length===t.startOffset)?v:v.childNodes.item(t.startOffset)}else{x=(t.startOffset===0)?v:v.childNodes.item(t.startOffset-1)}}var z=j.findFirstTimeNodeInClosestBlock(u,x,y);if(z){j.wrapTimeNodesWithHiddenChar(h(z))}},preventCursorInsideDateLozenge:function(u,t,w){var v=(w.nodeType===n.TEXT_NODE)?w.parentNode:w;if(j.isTimeNode(v)){if(b||u.selection.getRng().startOffset>1){j.putCursorAtEdge(u,v,true)}else{j.putCursorAtEdge(u,v,false)}}},handleUndoRedo:function(){o&&o.reattach()}};var f={init:function(t){j.initDateAutoCompleteObject(t);j.registerTriggerDoubleSlash(t);g=t;t.onContextMenu.add(function(){o.reset()});t.onSetContent.add(c.handleOnLoadContent);t.onClick.add(c.handleClickingDateLozenge);t.onKeyUp.add(c.handleTypingDate);if(e.isWebKit){t.onKeyDown.add(c.fixWhenUpDownNavOnList);t.onInit.add(function(){h(document).bind("postPaste",c.handlePostPasteContent)});t.onRemove.add(function(){h(document).unbind("postPaste",c.handlePostPasteContent)})}t.onKeyUp.add(function(z,B){b=(B.keyCode===d.RIGHT);var y=z.selection.getRng(true);var x=y.commonAncestorContainer;var A=!!x&&x.data;if(!!A&&!AJS.$(x).closest("pre,.text-placeholder").length){var C=String.prototype.slice.apply(A,[-11]);if((B.keyCode>=48&&B.keyCode<=57)||(B.keyCode>=96&&B.keyCode<=105)){var u=/(^| )\d{2}[\/\-]\d{2}[\/\-]\d{4}$/;var w=String.prototype.slice.apply(A,[-10]);if(u.test(A)&&a.parse(w,[a.PATTERN_INSERTING,a.PATTERN_INSERTING_ALTERNATE])){var v=y.commonAncestorContainer;y.setStart(v,y.endOffset-w.length);z.undoManager.add();z.undoManager.beforeChange();z.selection.setRng(y);z.execCommand("mceConfInsertDateAutocomplete",false,{date:w},{skip_undo:true});AJS.trigger("analyticsEvent",{name:"confluence-spaces.tasks.daterecognition.triggered"})}}}});if(e.isGecko){t.onKeyDown.add(c.handleRemoveDateLozenge);t.onInit.add(function(){h(document).bind("prePaste",c.handlePrePasteContent)});t.onRemove.add(function(){h(document).unbind("prePaste",c.handlePrePasteContent)})}if(e.isWebKit||e.isGecko){t.onNodeChange.add(c.preventCursorInsideDateLozenge)}t.onUndo.add(c.handleUndoRedo);t.onRedo.add(c.handleUndoRedo);t.onInit.add(function(){h(document).bind("postPaste",c.handlePostPaste)});t.onRemove.add(function(){h(document).unbind("postPaste",c.handlePostPaste);AJS.unbind("confluence.editor.registerHandlers",j.autocompleteDoubleSlash)});AJS.bind("editor.remote.change",function(){j.makeTimeNodesUnEditable(h(t.dom.doc).find("time"))})},getInfo:function(){return{longname:"Insert Date Autocomplete",author:"Atlassian",authorurl:"http://www.atlassian.com",version:e.majorVersion+"."+e.minorVersion}}};function l(){e.create(m,f);e.PluginManager.add(r,e.plugins.DateAutocomplete);AJS.Rte.BootstrapManager.addTinyMcePluginInit(function(t){t.plugins+=","+r})}l()})(AJS.$,tinymce);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.drag-and-drop:drag-and-drop-overlay', location = 'js/drag-and-drop-overlay.js' */
define("conf/confluence-drag-and-drop/drag-and-drop-overlay",["confluence/templates","jquery"],function(h,e){var g;return{bindFileDragOverlay:function(a){var f=a.$dragZone,d=a.$overlayZone||f.eq(0),i=a.isTransparent||!1,j=a.zIndex||1;f.on("dragover",function(c){c=c.originalEvent.dataTransfer.types;if(-1!==e.inArray("Files",c)&&(!e.browser.mozilla||-1!==e.inArray("application/x-moz-file",c))){var c=!!i,b;if(!g){var a=h.DragAndDrop.dragOverlay();g=e(a)}b=g;if(b.parent()[0]!==d[0]){a=0<d.closest(".quick-comment-container, .ic-container, .cp-editor").length;
b.toggleClass("dnd-small",a);var f=b.find(".overlay-center p");a?f.text("Drop a file here"):f.text("Drop files to insert them into the page");b.toggleClass("dnd-overlay-transparent",c);c=getComputedStyle(d[0]);b.css({"z-index":j});b.css({"margin-left":"-"+c.paddingLeft,"margin-top":"-"+c.paddingTop,width:d.innerWidth()+"px",height:d.innerHeight()+"px"}).prependTo(d);b.off("dragleave").on("dragleave",function(a){(!a.relatedTarget||!e.contains(b[0],a.relatedTarget))&&
b.remove()});b.off("drop").on("drop",function(){b.remove()})}}})}}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.drag-and-drop:image-dialog-client', location = 'js/insert-dialog-upload-controller.js' */
define("confluence-drag-and-drop/insert-dialog-upload-controller",["confluence/meta","jquery","confluence/message-handler"],function(d,c,e){var b=function(a){this.messageHandler=null;this.context=a;a=this.getForm();d.getBoolean("can-attach-files")||a.remove()};b.prototype.getForm=function(){return c("form",this.context.baseElement)};b.prototype.pack=function(){};b.prototype.displayErrors=function(a){this.getMessageHandler().displayMessages(a);a=this.getMessageHandler().getMessageContainer().find("ul");
a.toggleClass("one-message",1===a.find("li").length);a.closest(".aui-message").append("<span class='aui-icon icon-warning'></span>");this.pack()};b.prototype.clearErrors=function(){this.getMessageHandler().clearMessages();this.pack()};b.prototype.getMessageHandler=function(){this.messageHandler||(this.messageHandler=e({baseElement:c(".aui-message",this.context.baseElement)}));return this.messageHandler};return b});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.drag-and-drop:image-dialog-client', location = 'js/image-dialog-client.js' */
define("confluence-drag-and-drop/image-dialog-client","jquery ajs confluence/meta underscore confluence-drag-and-drop/files-uploader-factory confluence/legacy-editor-global-AVOID-IF-POSSIBLE confluence-drag-and-drop/insert-dialog-upload-controller confluence-drag-and-drop/upload-utils confluence-drag-and-drop/drag-and-drop-utils".split(" "),function(m,i,h,n,p,g,q,o,r){var k=function(){this._workIdToBytesUploaded={};this._totalBytes=0};k.prototype={update:function(a,f,e){if(!(a in this._workIdToBytesUploaded))this._totalBytes=
this._totalBytes+e;this._workIdToBytesUploaded[a]=f},percentComplete:function(){var a=0;m.each(this._workIdToBytesUploaded,function(f,e){a=a+e});return Math.round(a*100/this._totalBytes)}};var l=p.get(),j=function(a){this.pageId=parseInt(h.get("page-id"),10);this.draftId=parseInt(h.get("draft-id"),10);this.dragAndDropEntityId=h.get("drag-and-drop-entity-id");this.spaceKey=h.get("space-key")||"";this.atlToken=h.get("atl-token");this.base=/^\w+:\/\/[^\/?#]+/.exec(location.href);this.metaMaxFileSize=
h.get("global-settings-attachment-max-size");this.errors=[];this.batchProgress=new k;this.attachmentPanelComponent=a.attachmentPanelComponent;this.dropZone=a.dropZone;this.browserButtonId=a.browserButtonId;this.uploader=null;this.isUploadUsingDragAndDrop=false;var f=this;m(this.dropZone).bind("drop",function(){f.isUploadUsingDragAndDrop=true})};j.prototype.createPlupload=function(){var a=this,f=function(d){if(d){var b,c;if(d.generalError){c=[d.generalError.message];b=d.generalError.fileIds}else if(d.fileErrors){c=
[];b=[];n.each(d.fileErrors,function(a){b.push(a.id);c.push(a.message)})}if(c&&c.length){a.attachmentPanelComponent.displayErrors(c);a.errors=a.errors.concat(c)}b&&b.length&&n.each(b,function(b){a.attachmentPanelComponent.attachmentUploadingCancelled(b);a.cancelUpload(b)})}},e=new plupload.Uploader({runtimes:"html5",dragdrop:true,drop_element:a.dropZone,browse_button:a.browserButtonId,multipart:false,stop_propagation:true,max_file_size:parseInt(a.metaMaxFileSize,10),inputFileClazz:"file-library-input-file"});
e.init();e.bind("Started",function(d,b){a.errors=[];a.attachmentPanelComponent.clearErrors();a.batchProgress=new k;require(["conf/confluence-drag-and-drop/analytics/files-upload-analytics"],function(c){c.triggerEvent(a.isUploadUsingDragAndDrop?"confluence.insert-files-dialog.drag-and-drop":"confluence.insert-files-dialog.upload",b);a.isUploadUsingDragAndDrop=false})});e.bind("FilesAdded",function(d,b){function c(b,c){for(var d=0;d<c.length;d++)if(c[d].status===plupload.FAILED)b.removeFile(c[d]);else{var e=
n.find(b.files,function(a){return a.name===c[d].name&&a.id!==c[d].id});e&&b.removeFile(e);a.metaMaxFileSize>c[d].size&&a.attachmentPanelComponent.addPreviewImage(c[d])}l.filesAdded(b,c,a).then(function(a){f(a);b.start()})}if(b.length>0){a.attachmentPanelComponent.getNoFileContainer().hide();o.filterFiles(d,b,c)}});e.bind("BeforeUpload",function(d,b){l.beforeUpload(d,b,a);a.batchProgress=new k});e.bind("UploadProgress",function(d,b){a.batchProgress.update(b.id,b.loaded,b.size);a.attachmentPanelComponent.setUploadInProgress(a.batchProgress.percentComplete()/
100,b.id)});e.bind("FileUploaded",function(d,b,c){d.getFile(b.id)?l.fileUploaded(d,b,c).done(function(b){a.attachmentPanelComponent.attachmentUploaded(b.fileId,b.fileServerId)}).fail(function(a){f(a)}):a.attachmentPanelComponent.attachmentUploadingCancelled(b.id)});e.bind("Error",function(d,b){var c="";if(b.response){c=l.serverError(b.response)||b.message;a.attachmentPanelComponent.displayErrors([c]);a.errors.push(c);i.trigger("analyticsEvent",{name:"confluence.image-dialog.upload.error.server-unknown"})}else{var c=
b.message,e=b.file.name;if(b.code===plupload.FILE_SIZE_ERROR){c=r.niceSize(a.metaMaxFileSize).toString();c=i.format("{0} is too big to upload. Files must be less than {1}.",e,c);i.trigger("analyticsEvent",{name:"confluence.image-dialog.upload.error.file-size"})}else if(b.code===o.ErrorCode.FILE_IS_A_FOLDER_ERROR){c=i.format("Cannot upload {0} - it might be a folder or an unsupported file type.",e);i.trigger("analyticsEvent",{name:"confluence.image-dialog.upload.error.file-type"})}a.attachmentPanelComponent.displayErrors([c]);
a.errors.push(c)}});require(["conf/confluence-drag-and-drop/drag-and-drop-overlay"],function(d){d.bindFileDragOverlay({$dragZone:m(a.dropZone),zIndex:3005})});return e};j.prototype.init=function(){this.uploader=this.createPlupload()};j.prototype.cancelUpload=function(a){(a=this.uploader.getFile(a))&&this.uploader.removeFile(a)};if(g&&g.FileDialog)g.FileDialog.eventListener.on("AttachmentsPanelView.render",function(a){a.getUploaderController=function(){return new q(a.context)}});i.toInit(function(){if(g&&
g.ImageDialog){var a=g.ImageDialog.beforeShowListeners,f=g.ImageDialog.findPanelComponentById("attachments");a&&a.push(function(){if(f){var a=f.getPanelElement();if(a.length&&h.getBoolean("can-attach-files")){var d=new j({dropZone:a[0],browserButtonId:"upload-files-button",attachmentPanelComponent:f});d.init();g.FileDialog.eventListener.on("uploadingfile.cancelled",function(a){d.cancelUpload(a)})}}else console.debug("Do not support Attachment Panel and Drag-Drop in Insert Image Dialog (ex: in creating Template)")})}});
return j});require("confluence/module-exporter").safeRequire("confluence-drag-and-drop/image-dialog-client");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.web.resources:confluence-storage-manager', location = 'includes/js/confluence-storage-manager.js' */
define("confluence/confluence-storage-manager",["ajs"],function(a){return function(b){return a.storageManager("confluence",b)}});require("confluence/module-exporter").exportModuleAsGlobal("confluence/confluence-storage-manager","Confluence.storageManager");
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.drag-and-drop:drag-and-drop-tip', location = 'js/drag-and-drop-tip.js' */
define("confluence-drag-and-drop/drag-and-drop-tip","confluence/legacy-editor-global-AVOID-IF-POSSIBLE jquery confluence/confluence-storage-manager confluence/templates confluence/api/constants confluence/meta".split(" "),function(d,b,i,j,g,k){return function(){function h(c,a){if(a==="true"){c.append(j.DragAndDrop.dragAndDropTip());c.find(".attach-tip-discovery .close-tip").on("click",function(a){a.preventDefault();b(this).closest(".attach-tip-discovery").remove();c.sizeToFit();b.ajax({url:g.CONTEXT_PATH+
"/rest/drag-and-drop/1/tip/disable",type:"POST",contentType:"application/json",dataType:"json",success:function(){e.setItem(f,false)}})})}}var f="show-drag-and-drop-tip",e=i("confluence-editor");d.ImageDialog.beforeShowListeners.push(function(){var c=b("#attached-files");if(k.getBoolean("can-attach-files")){var a=e.getItem(f);a===null?b.ajax({url:g.CONTEXT_PATH+"/rest/drag-and-drop/1/tip/setting",contentType:"application/json",dataType:"json",success:function(b){a=(b!==false).toString();e.setItem(f,
a);h(c,a)}}):h(c,a)}})}});require("confluence/module-exporter").safeRequire("confluence-drag-and-drop/drag-and-drop-tip",function(d){require("ajs").toInit(d)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.drag-and-drop:drag-and-drop-for-editor', location = 'js/editor.js' */
define("confluence-drag-and-drop/editor","ajs jquery conf/confluence-drag-and-drop/analytics/files-upload-analytics conf/confluence-drag-and-drop/drag-and-drop-overlay document confluence-drag-and-drop/files-uploader-factory plupload underscore".split(" "),function(a,f,r,s,n,t,k,i){var e,l=t.get(),o=function(a,b,f){if(!b)return false;if(b.generalError){i.each(b.generalError.fileIds,function(d){e.renderError(d,b.generalError.message);(d=a.getFile(d))&&a.removeFile(d)});return true}if(b.fileErrors){i.each(b.fileErrors,
function(d){e.renderError(d.id,d.message);(d=a.getFile(d.id))&&a.removeFile(d)});return b.fileErrors.length===f.length}},p=function(f){if(!f.total.queued){f.stop();e.showCloseButton();e.hasErrors()||setTimeout(function(){e.hide();e.clearRenderOutput();a.Rte.BookmarkManager.restoreBookmark()},1E3)}},q=false;return function(){var m=a.Rte.getEditor().getBody().parentNode,b;b=n.getElementById("fileuploadShim");var j=false;if(!b){b=n.createElement("div");b.setAttribute("id","fileuploadShim");n.body.appendChild(b)}var d=
new k.Uploader({runtimes:"html5",dragdrop:true,drop_element:m,browse_button:b.getAttribute("id"),multipart:false,max_file_size:+a.Meta.get("global-settings-attachment-max-size")});e||(e=new a.DragAndDropProgressDialog);d.init();var i={};d.bind("Started",function(a,c){r.triggerEvent("confluence.editor.files.drag-and-drop",c)});d.bind("FilesAdded",function(b,c){function f(c,b){for(var h=0;h<b.length;h++){var g=b[h];g.status!==k.FAILED?e.render({workId:g.id,status:g.status,file:g}):c.removeFile(g)}l.filesAdded(c,
b,i).then(function(g){g=o(c,g,b);e.show();if(g)e.showCloseButton();else{e.cancelListeners.push(function(b,d){var g=c.getFile(d.workId);g&&c.removeFile(g);e.renderInfo(d.workId,"File was manually removed from the queue.")});d.start()}})}if(a.Meta.get("content-type")==="template"){b.stop();if(!q){var h=new a.Dialog(450,180);h.addHeader("Not Supported");h.addSubmit("Ok",function(){h.remove()});h.addPanel("Panel 1",
"panel1");h.getCurrentPanel().html("\u003cp\u003eAttachments are not supported in Templates.\u003c/p\u003e \u003cp\u003eFiles may be attached to a Page, and added as an image via the Insert menu.\u003c/p\u003e");h.show();q=true}}else a.UploadUtils.filterFiles(b,c,f)});d.bind("BeforeUpload",function(a,c){l.beforeUpload(a,c,i)});d.bind("UploadProgress",function(a,c){e.renderUpdateToBytesUploaded(c.id,c.loaded,c.size);e.hideCloseButton()});f.browser.mozilla&&k.addEvent(m,"dragenter",function(a){j=a.rangeParent&&a.rangeOffset!=void 0?{startElement:a.rangeParent,startOffset:a.rangeOffset}:false});d.bind("FileUploaded",function(b,
c,u){l.fileUploaded(b,c,u,true).done(function(b){j&&f(j.startElement.parentNode).closest('[contenteditable="true"]',m).length&&tinymce.activeEditor.selection.setCursorLocation(j.startElement,j.startOffset);b.htmlForEditor.substr(0,4)==="<img"?tinymce.confluence.ImageUtils.insertImagePlaceholder(b.htmlForEditor):a.Rte.getEditor().execCommand("mceInsertContent",false,b.htmlForEditor,{skip_focus:true});e.renderComplete(c.id)}).fail(function(a){o(b,a,[c])}).always(function(){p(d)})});d.bind("Error",function(b,
c){var f;if(c.response){f=l.serverError(c.response)||c.message;e.renderError(c.file.id,f);a.trigger("analyticsEvent",{name:"confluence.editor.upload.error.server-unknown"})}else{f=c.message;if(c.code===k.FILE_SIZE_ERROR){f=a.format("is too big to upload. Files must be less than {0}.",a.DragAndDropUtils.niceSize(a.Meta.get("global-settings-attachment-max-size")));a.trigger("analyticsEvent",{name:"confluence.editor.upload.error.file-size"})}else if(c.code===a.UploadUtils.ErrorCode.FILE_IS_A_FOLDER_ERROR){f="might be a folder or an unsupported file type.";
a.trigger("analyticsEvent",{name:"confluence.editor.upload.error.file-type"})}e.render({workId:c.file.id,status:c.file.status,file:c.file,errorMessage:f});if(!e.isVisible()){e.show();e.showCloseButton()}}p(d)});b={instance:d,uploadProgressDialog:e};s.bindFileDragOverlay({$dragZone:f(m).add("#toolbar ~ #editor-precursor"),$overlayZone:f("#rte"),isTransparent:true});return b}});
require("confluence/module-exporter").safeRequire("confluence-drag-and-drop/editor",function(a){AJS.toInit(function(){AJS.Rte.BootstrapManager.addOnInitCallback(function(){var f=a();AJS.Confluence.Uploader=f.instance;AJS.Confluence.EditorUploadProgressDialog=f.uploadProgressDialog})})});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.drag-and-drop:drag-and-drop-for-editor', location = 'js/link-dialog-drop-zone.js' */
define("confluence-drag-and-drop/link-dialog-drop-zone",["ajs","confluence-drag-and-drop/drag-and-drop-utils"],function(a,c){return function(b){a.bind("dialog-shown.link-browser",function(){b.browser.msie||c.bindDrop(b("#insert-link-dialog")[0],function(a){a.preventDefault();a.stopPropagation()})})}});require("confluence/module-exporter").safeRequire("confluence-drag-and-drop/link-dialog-drop-zone",function(a){require("ajs").toInit(a)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.web.resources:i18n', location = 'includes/js/i18n.js' */
define("confluence/i18n",[],function(){var b={"dnd.drop.here":"Drop Here","dnd.drop.zone.text":"Drop files here to attach them"};return{getText:function(a){return!b[a]?(console.error('Translation with key "'+a+'" is missing. Did you remember to add it to i18n.js?'),a):b[a]}}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.drag-and-drop:drop-zone-for-image-dialog', location = 'js/image-dialog-drop-zone.js' */
define("confluence-drag-and-drop/image-dialog-drop-zone","ajs confluence/legacy-editor-global-AVOID-IF-POSSIBLE jquery confluence-drag-and-drop/drag-and-drop-utils confluence/meta confluence/i18n".split(" "),function(b,h,c,d,i,e){return function(){if(i.get("remote-user")){var b=h.ImageDialog.findPanelComponentById("attachments");b?c(b).bind("afterThumbnail",function(b,f){if(!f.find(".image-dialog-drop-zone-container").length){var g=c("<li/>").addClass("attached-image"),a=c("<div/>").addClass("image-dialog-drop-zone-container image-container");
c("<div/>").addClass("drop-zone-image").attr("title",e.getText("dnd.drop.zone.text")).appendTo(a);c("<div/>").addClass("drop-zone-text").text(e.getText("dnd.drop.here")).appendTo(a);a.appendTo(g);f.prepend(g);if(!c.browser.msie){d.bindDragEnter(a[0],function(){a.addClass("drop-zone-on-hover")});d.bindDragOver(a[0],function(){a.addClass("drop-zone-on-hover")});d.bindDragLeave(a[0],function(){a.removeClass("drop-zone-on-hover")})}}}):console.log("Skipping image attachment drop-zone - no Image Dialog attachment panel")}else console.debug("Skipping image attachment drop-zone for anonymous user creating new content")}});
require("confluence/module-exporter").safeRequire("confluence-drag-and-drop/image-dialog-drop-zone",function(b){require("ajs").toInit(b)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-hipchat-emoticons-plugin:hipchat-emoticons', location = 'lib/rivets.js' */
(function(){var g,u,v,e,s=[].indexOf||function(a){for(var b=0,c=this.length;b<c;b++)if(b in this&&this[b]===a)return b;return-1},h=function(a,b){return function(){return a.apply(b,arguments)}},t=[].slice,x={}.hasOwnProperty,q=function(a,b){function c(){this.constructor=a}for(var d in b)x.call(b,d)&&(a[d]=b[d]);c.prototype=b.prototype;a.prototype=new c;a.__super__=b.prototype;return a};g={binders:{},components:{},formatters:{},adapters:{},config:{prefix:"rv",templateDelimiters:["{","}"],rootInterface:".",
preloadData:!0,handler:function(a,b,c){return this.call(a,b,c.view.models)}}};if("jQuery"in window)e="on"in jQuery.prototype?["on","off"]:["bind","unbind"],u=e[0],v=e[1],g.Util={bindEvent:function(a,b,c){return jQuery(a)[u](b,c)},unbindEvent:function(a,b,c){return jQuery(a)[v](b,c)},getInputValue:function(a){a=jQuery(a);return"checkbox"===a.attr("type")?a.is(":checked"):a.val()}};else{e="addEventListener"in window?function(a,b,c){return a.addEventListener(b,c,!1)}:function(a,b,c){return a.attachEvent("on"+
b,c)};var w;w="removeEventListener"in window?function(a,b,c){return a.removeEventListener(b,c,!1)}:function(a,b,c){return a.detachEvent("on"+b,c)};g.Util={bindEvent:e,unbindEvent:w,getInputValue:function(a){var b,c,d,f;if("checkbox"===a.type)return a.checked;if("select-multiple"===a.type){f=[];c=0;for(d=a.length;c<d;c++)b=a[c],b.selected&&f.push(b.value);return f}return a.value}}}e=function(){};e.parse=function(a,b,c){var d,f,j,g;f=[];c={"interface":c,path:""};d=j=0;for(g=a.length;j<g;d=j+=1)d=a.charAt(d),
0<=s.call(b,d)?(f.push(c),c={"interface":d,path:""}):c.path+=d;f.push(c);return f};g.KeypathParser=e;e=function(){};e.types={text:0,binding:1};e.parse=function(a,b){var c,d,f,j;j=[];f=a.length;for(d=0;d<f;)if(c=a.indexOf(b[0],d),0>c){j.push({type:this.types.text,value:a.slice(d)});break}else{0<c&&d<c&&j.push({type:this.types.text,value:a.slice(d,c)});d=c+b[0].length;c=a.indexOf(b[1],d);if(0>c){f=a.slice(d-b[1].length);c=j[j.length-1];(null!=c?c.type:void 0)===this.types.text?c.value+=f:j.push({type:this.types.text,
value:f});break}d=a.slice(d,c).trim();j.push({type:this.types.binding,value:d});d=c+b[1].length}return j};g.TextTemplateParser=e;e=function(a,b,c,d){this.view=a;this.model=b;this.keypath=c;this.callback=d;this.unobserve=h(this.unobserve,this);this.realize=h(this.realize,this);this.value=h(this.value,this);this.publish=h(this.publish,this);this.read=h(this.read,this);this.set=h(this.set,this);this.adapter=h(this.adapter,this);this.update=h(this.update,this);this.initialize=h(this.initialize,this);
this.parse=h(this.parse,this);this.parse();this.initialize()};e.prototype.parse=function(){var a,b,c,d,f;d=this.view.adapters;f=[];for(a in d)(b=d[a])&&f.push(a);(c=this.keypath[0],0<=s.call(f,c))?(b=this.keypath[0],a=this.keypath.substr(1)):(b=this.view.config.rootInterface,a=this.keypath);this.tokens=g.KeypathParser.parse(a,f,b);return this.key=this.tokens.pop()};e.prototype.initialize=function(){this.objectPath=[];this.target=this.realize();if(null!=this.target)return this.set(!0,this.key,this.target,
this.callback)};e.prototype.update=function(){var a,b;if((a=this.realize())!==this.target)if(null!=this.target&&this.set(!1,this.key,this.target,this.callback),null!=a&&this.set(!0,this.key,a,this.callback),b=this.value(),this.target=a,this.value()!==b)return this.callback()};e.prototype.adapter=function(a){return this.view.adapters[a["interface"]]};e.prototype.set=function(a,b,c,d){return this.adapter(b)[a?"subscribe":"unsubscribe"](c,b.path,d)};e.prototype.read=function(a,b){return this.adapter(a).read(b,
a.path)};e.prototype.publish=function(a){if(null!=this.target)return this.adapter(this.key).publish(this.target,this.key.path,a)};e.prototype.value=function(){if(null!=this.target)return this.read(this.key,this.target)};e.prototype.realize=function(){var a,b,c,d,f,j,g,e;a=this.model;f=null;e=this.tokens;b=j=0;for(g=e.length;j<g;b=++j)if(d=e[b],null!=a){if(null!=this.objectPath[b]){if(a!==(c=this.objectPath[b]))this.set(!1,d,c,this.update),this.set(!0,d,a,this.update),this.objectPath[b]=a}else this.set(!0,
d,a,this.update),this.objectPath[b]=a;a=this.read(d,a)}else null==f&&(f=b),(c=this.objectPath[b])&&this.set(!1,d,c,this.update);null!=f&&this.objectPath.splice(f);return a};e.prototype.unobserve=function(){var a,b,c,d,f,j;j=this.tokens;a=d=0;for(f=j.length;d<f;a=++d)c=j[a],(b=this.objectPath[a])&&this.set(!1,c,b,this.update);if(null!=this.target)return this.set(!1,this.key,this.target,this.callback)};g.Observer=e;e=function(a,b,c){var d,f,j,e,i;this.els=a;this.models=b;this.options=null!=c?c:{};this.update=
h(this.update,this);this.publish=h(this.publish,this);this.sync=h(this.sync,this);this.unbind=h(this.unbind,this);this.bind=h(this.bind,this);this.select=h(this.select,this);this.build=h(this.build,this);this.componentRegExp=h(this.componentRegExp,this);this.bindingRegExp=h(this.bindingRegExp,this);this.els.jquery||this.els instanceof Array||(this.els=[this.els]);e=["config","binders","formatters","adapters"];c=0;for(j=e.length;c<j;c++){a=e[c];this[a]={};if(this.options[a])for(d in f=this.options[a],
f)b=f[d],this[a][d]=b;i=g[a];for(d in i)if(b=i[d],null==(f=this[a])[d])f[d]=b}this.build()};e.prototype.bindingRegExp=function(){return RegExp("^"+this.config.prefix+"-")};e.prototype.componentRegExp=function(){return RegExp("^"+this.config.prefix.toUpperCase()+"-")};e.prototype.build=function(){var a,b,c,d,f,j,e,h,n;this.bindings=[];j=[];a=this.bindingRegExp();c=this.componentRegExp();var k=this;b=function(a,b,c,d){var f,j,e;j={};var h,p;p=d.split("|");d=[];f=0;for(h=p.length;f<h;f++)e=p[f],d.push(e.trim());
var i;i=d.shift().split("<");e=[];h=0;for(p=i.length;h<p;h++)f=i[h],e.push(f.trim());f=e.shift();j.formatters=d;if(d=e.shift())j.dependencies=d.split(/\s+/);return k.bindings.push(new g[a](k,b,c,f,j))};var l=this;f=function(d){var e,h,p,i,k,m,n,q,r,o,t;if(0>s.call(j,d)){if(3===d.nodeType){if(m=g.TextTemplateParser,i=l.config.templateDelimiters)if((e=m.parse(d.data,i)).length&&!(1===e.length&&e[0].type===m.types.text)){r=0;for(o=e.length;r<o;r++)m=e[r],i=document.createTextNode(m.value),d.parentNode.insertBefore(i,
d),1===m.type&&b("TextBinding",i,null,m.value);d.parentNode.removeChild(d)}}else if(c.test(d.tagName))k=d.tagName.replace(c,"").toLowerCase(),l.bindings.push(new g.ComponentBinding(l,d,k));else if(null!=d.attributes){o=d.attributes;m=0;for(r=o.length;m<r;m++)if(e=o[m],a.test(e.name)){k=e.name.replace(a,"");if(!(p=l.binders[k]))for(i in t=l.binders,t)q=t[i],"*"!==i&&-1!==i.indexOf("*")&&(n=RegExp("^"+i.replace("*",".+")+"$"),n.test(k)&&(p=q));p||(p=l.binders["*"]);if(p.block){n=d.childNodes;h=0;for(p=
n.length;h<p;h++)k=n[h],j.push(k);h=[e]}}r=h||d.attributes;i=0;for(m=r.length;i<m;i++)e=r[i],a.test(e.name)&&(k=e.name.replace(a,""),b("Binding",d,k,e.value))}m=d.childNodes;d=[];i=0;for(e=m.length;i<e;i++)k=m[i],d.push(k);r=[];m=0;for(i=d.length;m<i;m++)e=d[m],r.push(f(e));return r}};n=this.els;e=0;for(h=n.length;e<h;e++)d=n[e],f(d)};e.prototype.select=function(a){var b,c,d,f,e;f=this.bindings;e=[];c=0;for(d=f.length;c<d;c++)b=f[c],a(b)&&e.push(b);return e};e.prototype.bind=function(){var a,b,c,
d,f;d=this.bindings;f=[];b=0;for(c=d.length;b<c;b++)a=d[b],f.push(a.bind());return f};e.prototype.unbind=function(){var a,b,c,d,f;d=this.bindings;f=[];b=0;for(c=d.length;b<c;b++)a=d[b],f.push(a.unbind());return f};e.prototype.sync=function(){var a,b,c,d,f;d=this.bindings;f=[];b=0;for(c=d.length;b<c;b++)a=d[b],f.push(a.sync());return f};e.prototype.publish=function(){var a,b,c,d,f;d=this.select(function(a){return a.binder.publishes});f=[];b=0;for(c=d.length;b<c;b++)a=d[b],f.push(a.publish());return f};
e.prototype.update=function(a){var b,c,d,f,e;null==a&&(a={});for(b in a)c=a[b],this.models[b]=c;f=this.bindings;e=[];c=0;for(d=f.length;c<d;c++)b=f[c],e.push(b.update(a));return e};g.View=e;e=function(a,b,c,d,f){this.view=a;this.el=b;this.type=c;this.keypath=d;this.options=null!=f?f:{};this.update=h(this.update,this);this.unbind=h(this.unbind,this);this.bind=h(this.bind,this);this.publish=h(this.publish,this);this.sync=h(this.sync,this);this.set=h(this.set,this);this.eventHandler=h(this.eventHandler,
this);this.formattedValue=h(this.formattedValue,this);this.setBinder=h(this.setBinder,this);this.formatters=this.options.formatters||[];this.dependencies=[];this.model=void 0;this.setBinder()};e.prototype.setBinder=function(){var a,b,c,d;if(!(this.binder=this.view.binders[this.type]))for(a in d=this.view.binders,d)c=d[a],"*"!==a&&-1!==a.indexOf("*")&&(b=RegExp("^"+a.replace("*",".+")+"$"),b.test(this.type)&&(this.binder=c,this.args=RegExp("^"+a.replace("*","(.+)")+"$").exec(this.type),this.args.shift()));
this.binder||(this.binder=this.view.binders["*"]);if(this.binder instanceof Function)return this.binder={routine:this.binder}};e.prototype.formattedValue=function(a){var b,c,d,f,e;e=this.formatters;d=0;for(f=e.length;d<f;d++)c=e[d],b=c.split(/\s+/),c=b.shift(),c=this.view.formatters[c],(null!=c?c.read:void 0)instanceof Function?a=c.read.apply(c,[a].concat(t.call(b))):c instanceof Function&&(a=c.apply(null,[a].concat(t.call(b))));return a};e.prototype.eventHandler=function(a){var b,c;c=(b=this).view.config.handler;
return function(d){return c.call(a,this,d,b)}};e.prototype.set=function(a){var b,a=a instanceof Function&&!this.binder["function"]?this.formattedValue(a.call(this.model)):this.formattedValue(a);return null!=(b=this.binder.routine)?b.call(this,this.el,a):void 0};e.prototype.sync=function(){var a,b,c,d,f;if(this.model!==this.observer.target){d=this.dependencies;b=0;for(c=d.length;b<c;b++)a=d[b],a.unobserve();this.dependencies=[];if(null!=(this.model=this.observer.target)&&null!=(f=this.options.dependencies)&&
f.length){d=this.options.dependencies;b=0;for(c=d.length;b<c;b++)a=d[b],a=new g.Observer(this.view,this.model,a,this.sync),this.dependencies.push(a)}}return this.set(this.observer.value())};e.prototype.publish=function(){var a,b,c,d,f,e,h,i;c=g.Util.getInputValue(this.el);e=this.formatters.slice(0).reverse();d=0;for(f=e.length;d<f;d++)if(a=e[d],a=a.split(/\s+/),b=a.shift(),null!=(h=this.view.formatters[b])&&h.publish)c=(i=this.view.formatters[b]).publish.apply(i,[c].concat(t.call(a)));return this.observer.publish(c)};
e.prototype.bind=function(){var a,b,c,d;null!=(b=this.binder.bind)&&b.call(this,this.el);this.observer=new g.Observer(this.view,this.view.models,this.keypath,this.sync);this.model=this.observer.target;if(null!=this.model&&null!=(c=this.options.dependencies)&&c.length){d=this.options.dependencies;b=0;for(c=d.length;b<c;b++)a=d[b],a=new g.Observer(this.view,this.model,a,this.sync),this.dependencies.push(a)}if(this.view.config.preloadData)return this.sync()};e.prototype.unbind=function(){var a,b,c,d;
null!=(a=this.binder.unbind)&&a.call(this,this.el);this.observer.unobserve();d=this.dependencies;b=0;for(c=d.length;b<c;b++)a=d[b],a.unobserve();return this.dependencies=[]};e.prototype.update=function(a){var b;null==a&&(a={});this.model=this.observer.target;this.unbind();null!=(b=this.binder.update)&&b.call(this,a);return this.bind()};g.Binding=e;e=function(a,b,c){var d,f;this.view=a;this.el=b;this.type=c;this.unbind=h(this.unbind,this);this.bind=h(this.bind,this);this.update=h(this.update,this);
this.locals=h(this.locals,this);this.component=g.components[this.type];this.attributes={};this.inflections={};d=this.el.attributes||[];b=0;for(c=d.length;b<c;b++)a=d[b],(f=a.name,0<=s.call(this.component.attributes,f))?this.attributes[a.name]=a.value:this.inflections[a.name]=a.value};q(e,g.Binding);e.prototype.sync=function(){};e.prototype.locals=function(a){var b,c,d,f,e,g,h;null==a&&(a=this.view.models);f={};d=this.inflections;for(c in d){b=d[c];h=b.split(".");e=0;for(g=h.length;e<g;e++)b=h[e],
f[c]=(f[c]||a)[b]}for(c in a)d=a[c],null==f[c]&&(f[c]=d);return f};e.prototype.update=function(a){var b;return null!=(b=this.componentView)?b.update(this.locals(a)):void 0};e.prototype.bind=function(){var a;if(null!=this.componentView)return null!=(a=this.componentView)?a.bind():void 0;a=this.component.build.call(this.attributes);(this.componentView=new g.View(a,this.locals(),this.view.options)).bind();return this.el.parentNode.replaceChild(a,this.el)};e.prototype.unbind=function(){var a;return null!=
(a=this.componentView)?a.unbind():void 0};g.ComponentBinding=e;var o=function(a,b,c,d,f){this.view=a;this.el=b;this.type=c;this.keypath=d;this.options=null!=f?f:{};this.sync=h(this.sync,this);this.formatters=this.options.formatters||[];this.dependencies=[]};q(o,g.Binding);o.prototype.binder={routine:function(a,b){return a.data=null!=b?b:""}};o.prototype.sync=function(){return o.__super__.sync.apply(this,arguments)};g.TextBinding=o;g.adapters["."]={id:"_rv",counter:0,weakmap:{},weakReference:function(a){var b;
a.hasOwnProperty(this.id)||(b=this.counter++,this.weakmap[b]={callbacks:{}},Object.defineProperty(a,this.id,{value:b}));return this.weakmap[a[this.id]]},stubFunction:function(a,b){var c,d,f;d=a[b];c=this.weakReference(a);f=this.weakmap;return a[b]=function(){var b,e,g,h,k,l,o,s,q;g=d.apply(a,arguments);l=c.pointers;for(e in l){b=l[e];q=null!=(o=null!=(s=f[e])?s.callbacks[b]:void 0)?o:[];h=0;for(k=q.length;h<k;h++)b=q[h],b()}return g}},observeMutations:function(a,b,c){var d,f,e,g,h;if(Array.isArray(a)){e=
this.weakReference(a);if(null==e.pointers){e.pointers={};f="push pop shift unshift sort reverse splice".split(" ");g=0;for(h=f.length;g<h;g++)d=f[g],this.stubFunction(a,d)}if(null==(a=e.pointers)[b])a[b]=[];if(0>s.call(e.pointers[b],c))return e.pointers[b].push(c)}},unobserveMutations:function(a,b,c){var d,f;if(Array.isArray(a&&null!=a[this.id])&&(d=null!=(f=this.weakReference(a).pointers)?f[b]:void 0))if(a=d.indexOf(c),0<=a)return d.splice(a,1)},subscribe:function(a,b,c){var d,f;d=this.weakReference(a).callbacks;
null==d[b]&&(d[b]=[],f=a[b],Object.defineProperty(a,b,{enumerable:!0,get:function(){return f},set:function(e){return function(g){var h,n,k;if(g!==f){f=g;k=d[b].slice();h=0;for(n=k.length;h<n;h++)c=k[h],0<=s.call(d[b],c)&&c();return e.observeMutations(g,a[e.id],b)}}}(this)}));0>s.call(d[b],c)&&d[b].push(c);return this.observeMutations(a[b],a[this.id],b)},unsubscribe:function(a,b,c){var d;d=this.weakmap[a[this.id]].callbacks[b];c=d.indexOf(c);0<=c&&d.splice(c,1);return this.unobserveMutations(a[b],
a[this.id],b)},read:function(a,b){return a[b]},publish:function(a,b,c){return a[b]=c}};g.binders.text=function(a,b){return null!=a.textContent?a.textContent=null!=b?b:"":a.innerText=null!=b?b:""};g.binders.html=function(a,b){return a.innerHTML=null!=b?b:""};g.binders.show=function(a,b){return a.style.display=b?"":"none"};g.binders.hide=function(a,b){return a.style.display=b?"none":""};g.binders.enabled=function(a,b){return a.disabled=!b};g.binders.disabled=function(a,b){return a.disabled=!!b};g.binders.checked=
{publishes:!0,bind:function(a){return g.Util.bindEvent(a,"change",this.publish)},unbind:function(a){return g.Util.unbindEvent(a,"change",this.publish)},routine:function(a,b){var c;return"radio"===a.type?a.checked=(null!=(c=a.value)?c.toString():void 0)===(null!=b?b.toString():void 0):a.checked=!!b}};g.binders.unchecked={publishes:!0,bind:function(a){return g.Util.bindEvent(a,"change",this.publish)},unbind:function(a){return g.Util.unbindEvent(a,"change",this.publish)},routine:function(a,b){var c;
return"radio"===a.type?a.checked=(null!=(c=a.value)?c.toString():void 0)!==(null!=b?b.toString():void 0):a.checked=!b}};g.binders.value={publishes:!0,bind:function(a){return g.Util.bindEvent(a,"change",this.publish)},unbind:function(a){return g.Util.unbindEvent(a,"change",this.publish)},routine:function(a,b){var c,d,f,e,g;if(null!=window.jQuery){if(a=jQuery(a),(null!=b?b.toString():void 0)!==(null!=(c=a.val())?c.toString():void 0))return a.val(null!=b?b:"")}else if("select-multiple"===a.type){if(null!=
b){g=[];d=0;for(f=a.length;d<f;d++)c=a[d],g.push(c.selected=(e=c.value,0<=s.call(b,e)));return g}}else if((null!=b?b.toString():void 0)!==(null!=(d=a.value)?d.toString():void 0))return a.value=null!=b?b:""}};g.binders["if"]={block:!0,bind:function(a){var b,c;if(null==this.marker)return b=[this.view.config.prefix,this.type].join("-").replace("--","-"),c=a.getAttribute(b),this.marker=document.createComment(" rivets: "+this.type+" "+c+" "),a.removeAttribute(b),a.parentNode.insertBefore(this.marker,a),
a.parentNode.removeChild(a)},unbind:function(){var a;return null!=(a=this.nested)?a.unbind():void 0},routine:function(a,b){var c,d,f,e;if(!!b===(null==this.nested)){if(b){f={};e=this.view.models;for(c in e)d=e[c],f[c]=d;c={binders:this.view.options.binders,formatters:this.view.options.formatters,adapters:this.view.options.adapters,config:this.view.options.config};(this.nested=new g.View(a,f,c)).bind();return this.marker.parentNode.insertBefore(a,this.marker.nextSibling)}a.parentNode.removeChild(a);
this.nested.unbind();return delete this.nested}},update:function(a){var b;return null!=(b=this.nested)?b.update(a):void 0}};g.binders.unless={block:!0,bind:function(a){return g.binders["if"].bind.call(this,a)},unbind:function(){return g.binders["if"].unbind.call(this)},routine:function(a,b){return g.binders["if"].routine.call(this,a,!b)},update:function(a){return g.binders["if"].update.call(this,a)}};g.binders["on-*"]={"function":!0,unbind:function(a){if(this.handler)return g.Util.unbindEvent(a,this.args[0],
this.handler)},routine:function(a,b){this.handler&&g.Util.unbindEvent(a,this.args[0],this.handler);return g.Util.bindEvent(a,this.args[0],this.handler=this.eventHandler(b))}};g.binders["each-*"]={block:!0,bind:function(a){var b,c,d;if(null==this.marker)b=[this.view.config.prefix,this.type].join("-").replace("--","-"),this.marker=document.createComment(" rivets: "+this.type+" "),this.iterated=[],a.removeAttribute(b),a.parentNode.insertBefore(this.marker,a),a.parentNode.removeChild(a);else{d=this.iterated;
b=0;for(c=d.length;b<c;b++)a=d[b],a.bind()}},unbind:function(){var a,b,c,d,f;if(null!=this.iterated){d=this.iterated;f=[];b=0;for(c=d.length;b<c;b++)a=d[b],f.push(a.unbind());return f}},routine:function(a,b){var c,d,f,e,h,i,n,k,l,o;i=this.args[0];b=b||[];if(this.iterated.length>b.length){l=Array(this.iterated.length-b.length);k=0;for(l=l.length;k<l;k++)d=this.iterated.pop(),d.unbind(),this.marker.parentNode.removeChild(d.els[0])}f=k=0;for(l=b.length;k<l;f=++k)if(h=b[f],d={index:f},d[i]=h,null==this.iterated[f]){f=
this.view.models;for(e in f)h=f[e],null==d[e]&&(d[e]=h);h=this.iterated.length?this.iterated[this.iterated.length-1].els[0]:this.marker;f={binders:this.view.options.binders,formatters:this.view.options.formatters,adapters:this.view.options.adapters,config:{}};o=this.view.options.config;for(c in o)n=o[c],f.config[c]=n;f.config.preloadData=!0;n=a.cloneNode(!0);d=new g.View(n,d,f);d.bind();this.iterated.push(d);this.marker.parentNode.insertBefore(n,h.nextSibling)}else this.iterated[f].models[i]!==h&&
this.iterated[f].update(d);if("OPTION"===a.nodeName){k=this.view.bindings;l=[];e=0;for(i=k.length;e<i;e++)c=k[e],c.el===this.marker.parentNode&&"value"===c.type?l.push(c.sync()):l.push(void 0);return l}},update:function(a){var b,c,d,e,g;b={};for(c in a)d=a[c],c!==this.args[0]&&(b[c]=d);e=this.iterated;g=[];c=0;for(d=e.length;c<d;c++)a=e[c],g.push(a.update(b));return g}};g.binders["class-*"]=function(a,b){var c;c=" "+a.className+" ";if(!b===(-1!==c.indexOf(" "+this.args[0]+" ")))return a.className=
b?""+a.className+" "+this.args[0]:c.replace(" "+this.args[0]+" "," ").trim()};g.binders["*"]=function(a,b){return null!=b?a.setAttribute(this.type,b):a.removeAttribute(this.type)};g.factory=function(a){a._=g;a.binders=g.binders;a.components=g.components;a.formatters=g.formatters;a.adapters=g.adapters;a.config=g.config;a.configure=function(a){var c,d;null==a&&(a={});for(c in a)d=a[c],g.config[c]=d};return a.bind=function(a,c,d){null==c&&(c={});null==d&&(d={});a=new g.View(a,c,d);a.bind();return a}};
q={};g.factory(q);define("rivets",q)}).call(this);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-hipchat-emoticons-plugin:hipchat-emoticons', location = 'data/DataManager.js' */
define("confluence-hipchat-emoticons/data/DataManager",["ajs","jquery"],function(g,h){var d,b=[],c={},e=function(a){a&&(c={},a.forEach(function(a){c[a.shortcut]=a}))},f=function(){return h.ajax({url:g.contextPath()+"/rest/emoticons/1.0/",type:"get",dataType:"json",cache:!1}).then(function(a){localStorage.setItem("hipchat.emoticons.data",JSON.stringify(a))}).then(function(a){b=a.hipchat;e(b)})};return{initializeData:function(){var a=JSON.parse(localStorage.getItem("hipchat.emoticons.data"));a&&(b=
a.hipchat,e(b));d=f()},loadRemoteData:f,getAuthoritativeEmoticons:function(){return d},getHipChatEmoticon:function(a){return c[a]}}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-hipchat-emoticons-plugin:hipchat-emoticons', location = 'insertion/EmoticonInserter.js' */
define("confluence-hipchat-emoticons/insertion/EmoticonInserter",["ajs"],function(e){return{insertEmoticon:function(a,f){var c=e.Rte.getEditor();if(f){var b=$(c.getContainer()),d=null;if(b.parents("#comments-section").length)d="comment";else if(b.parents(".ic-comment-container").length)d="inlinecomment";else if(b.parents("#editpageform").length||b.parents("#createpageform").length)d=b.parents(".blogpost").length?"blog":"page";d&&e.trigger("analyticsEvent",{name:"confluence.hipchat.emoticons.insert."+
f,data:{shortcut:a.shortcut,source:d}})}b=c.dom.createHTML("img",a.name?{src:a.url,alt:a.name+" "+a.shortcut,title:a.name+" "+a.shortcut,border:0,"class":"emoticon emoticon-"+a.name,"data-emoticon-name":a.name}:{src:a.url,alt:"("+a.shortcut+")",title:"("+a.shortcut+")",border:0,"class":"emoticon emoticon-"+a.shortcut,"data-hipchat-emoticon":a.shortcut});c.execCommand("mceInsertContent",!1,b,{skip_undo:!0});c.undoManager.beforeChange();c.undoManager.add()}}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-hipchat-emoticons-plugin:hipchat-emoticons', location = 'completion/CompletionManager.js' */
define("confluence-hipchat-emoticons/completion/CompletionManager","ajs jquery underscore confluence-hipchat-emoticons/completion/Utilities confluence-hipchat-emoticons/data/DataManager confluence-hipchat-emoticons/insertion/EmoticonInserter".split(" "),function(g,h,n,f,i,j){function k(c,b,a){if(!b)throw Error("text node is null");if(b.nodeType!=3){b=b.childNodes[a-1];a=b.length}for(;b&&b.nodeType==3;b=b.previousSibling){if(a==-1)a=b.nodeValue.length;if(a>c)return{container:b,offset:a-c};if(a==c){a=
0;for(c=b.parentNode;b.previousSibling;){b=b.previousSibling;a++}return{container:c,offset:a}}c=c-a;a=-1}return null}var l=/\(([A-Za-z0-9]+)$/,m=function(c,b){if(f.getCharCode(b)===41){var a;a=f.getTextFromPreviousSiblingTextNodes(c.selection.getRng(true));if(a=l.exec(a)){a=a[1];if(a=i.getHipChatEmoticon(a)){var d,e;c.execCommand("mceInsertContent",false,")");c.undoManager.beforeChange();c.undoManager.add();d=c.selection.getRng(true);f.getTextFromPreviousSiblingTextNodes(d);e=k(a.shortcut.length+
1+1,d.commonAncestorContainer,d.startOffset);d.setStart(e.container,e.offset);e=h(d.commonAncestorContainer);c.selection.setRng(d);if(e.closest(".wysiwyg-macro-body").length&&d.toString()==e.text()){e[0].innerHTML="<br>";c.selection.select(e[0].childNodes[0]);c.selection.collapse(true)}else c.execCommand("delete",false,{},{skip_undo:true});j.insertEmoticon(a,"autoformat");tinymce.dom.Event.cancel(b);a=false}else a=true}else a=true;return a}};return{start:function(){g.Rte.BootstrapManager.addOnInitCallback(function(){g.Rte.getEditor().onKeyPress.addToTop(m)})}}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-hipchat-emoticons-plugin:hipchat-emoticons', location = 'completion/Utilities.js' */
define("confluence-hipchat-emoticons/completion/Utilities",["jquery"],function(d){return{getTextFromPreviousSiblingTextNodes:function(b){var a,c;if(!b||!b.collapsed)throw Error("range is null or not collapsed");a=b.startContainer;c=b.startOffset;if(1==a.nodeType&&0<c)if(a=a.childNodes[b.startOffset-1],3==a.nodeType)c=a.nodeValue.length;else return"";else if(3!=a.nodeType)return"";b=a.nodeValue.substring(0,c);for(a=a.previousSibling;a&&3==a.nodeType;a=a.previousSibling)b=a.nodeValue+b;return b},getCharCode:function(b){return d.browser.msie?
b.keyCode:b.which}}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-hipchat-emoticons-plugin:hipchat-emoticons', location = 'dialog/DialogEmoticon.js' */
define("confluence-hipchat-emoticons/dialog/DialogEmoticon",["underscore"],function(b){var c=function(a){this.name=a.name;this.shortcut=a.shortcut;this.fullShortcut=a.fullShortcut;this.url=a.url;this.onClick=a.onClick&&b.bind(a.onClick,this,this);this.visible=!0;this._initializeCaption(a)};b.extend(c.prototype,{onKeypress:function(a){13==a.keyCode&&this.click()},_initializeCaption:function(a){a.selectedText?(this.selectedCaptionPortion=a.selectedText,a=this.fullShortcut.indexOf(this.selectedCaptionPortion),
this.leftCaptionPortion=this.fullShortcut.substring(0,a),this.rightCaptionPortion=this.fullShortcut.substring(a+this.selectedCaptionPortion.length)):(this.leftCaptionPortion=this.fullShortcut,this.rightCaptionPortion=this.selectedCaptionPortion="")}});return c});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-hipchat-emoticons-plugin:hipchat-emoticons', location = 'dialog/EmoticonDialog.js' */
define("confluence-hipchat-emoticons/dialog/EmoticonDialog","ajs jquery rivets underscore confluence-hipchat-emoticons/dialog/DialogEmoticon confluence-hipchat-emoticons/dialog/EmoticonDialogModel confluence-hipchat-emoticons/dialog/Templates".split(" "),function(d,c,e,f,a,g,h){a=function(){var a=new g({dialog:this}),b=c(h.emoticonDialog())[0];document.body.appendChild(b);this._dialog=d.dialog2(b);e.bind(b,a);c(b.querySelector(".loading-spinner")).spin("large");this._dialog.on("show",function(){a.update(a.filterText=
"")})};f.extend(a.prototype,{show:function(){this._dialog.show()},close:function(){this._dialog.hide()}});return a});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-hipchat-emoticons-plugin:hipchat-emoticons', location = 'dialog/EmoticonDialogModel.js' */
define("confluence-hipchat-emoticons/dialog/EmoticonDialogModel",["ajs","underscore","confluence-hipchat-emoticons/data/DataManager","confluence-hipchat-emoticons/insertion/EmoticonInserter","confluence-hipchat-emoticons/dialog/DialogEmoticon"],function(d,h,e,f,g){var c=function(b){var a=this;this.close=function(){b.dialog.close()};this.onFilterSubmit=function(a){return a.preventDefault()};this.onFilterUpdate=function(){a.update(this.value)};var c=function(b){f.insertEmoticon(b);a.close()},i=function(b){f.insertEmoticon(b,
"gallery");a.close()};this.isAdmin=d.Meta.getBoolean("is-admin");this.isHipChatIntegrated=!1;this.loadEmoticons=function(){var b=a.isError?e.loadRemoteData():e.getAuthoritativeEmoticons();a.isLoading=!0;a.isError=!1;a.showEmoticons=!1;a.showHipChatEmoticons=!1;b.then(function(b){a.isLoading=!1;a.hipchatEmoticons=b.hipchat.map(function(a){return new g({shortcut:a.shortcut,fullShortcut:"("+a.shortcut+")",url:a.url,onClick:i})});a.confluenceEmoticons=b.confluence.map(function(a){return new g({name:a.name,
shortcut:a.shortcut,fullShortcut:a.shortcut,url:a.url,onClick:c})});a.showEmoticons=!0;a.showHipChatEmoticons=Boolean(d.Meta.get("remote-user"));a.allEmoticons=h.union(a.confluenceEmoticons,a.hipchatEmoticons);a.isHipChatIntegrated=b.hipchatIntegrated;setTimeout(function(){document.querySelector("#hipchat-emoticons-filter").focus();document.querySelector("#hipchat-emoticons-filter").select()},100)}).fail(function(){a.isError=!0;a.isLoading=!1})}.bind(this);this.loadEmoticons()};c.prototype.update=
function(b){this._previousFilterText!==b&&(this._previousFilterText=b,(this.allEmoticons||[]).forEach(function(a){a.visible=0<=a.fullShortcut.indexOf(b)}))};return c});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-hipchat-emoticons-plugin:hipchat-emoticons', location = 'dialog/templates.soy' */
// This file was automatically generated from templates.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.Templates.HipChatEmoticons.Dialog.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; }
if (typeof Confluence.Templates.HipChatEmoticons == 'undefined') { Confluence.Templates.HipChatEmoticons = {}; }
if (typeof Confluence.Templates.HipChatEmoticons.Dialog == 'undefined') { Confluence.Templates.HipChatEmoticons.Dialog = {}; }


Confluence.Templates.HipChatEmoticons.Dialog.emoticonDialog = function(opt_data, opt_ignored) {
  return '<section role="dialog" id="insert-hipchat-emoticon-dialog" class="aui-layer aui-dialog2 aui-dialog2-medium" aria-hidden="true"><header class="aui-dialog2-header"><h2 class="aui-dialog2-header-main">' + soy.$$escapeHtml('Insert emoticon') + '</h2><div class="aui-dialog2-header-secondary"><form class="aui" action="#"><input id="hipchat-emoticons-filter" class="text medium-field" type="search" rv-show="showEmoticons" rv-value="filterText" rv-on-keyup="onFilterUpdate" rv-on-submit="onFilterSubmit" placeholder="' + soy.$$escapeHtml('Search') + '"></form></div><a class="aui-dialog2-header-close"><span class="aui-icon aui-icon-small aui-iconfont-close-dialog">' + soy.$$escapeHtml('Cancel') + '</span></a></header><div class="aui-dialog2-content"><div class="emoticon-gallery"><div rv-show="isLoading" class="loading-spinner"></div><div rv-show="isError" class="error"><p><span class="aui-icon aui-icon-large aui-iconfont-error"></span></p><p>Oh dear, it seems we had some trouble loading your emoticons. Please click the button below to try loading them again.</p><p><button class="aui-button aui-button-primary" id="hipchat-emoticons-error-rety" rv-on-click="loadEmoticons">Retry</button></p></div><div rv-show="showEmoticons" class="emoticons-panel confluence-emoticons-panel"><h4 class="emoticons-panel-header">' + soy.$$escapeHtml('Confluence') + '</h4><hr>' + Confluence.Templates.HipChatEmoticons.Dialog.confluenceEmoticons(null) + '</div><div rv-show="showHipChatEmoticons" class="emoticons-panel hipchat-emoticons-panel"><h4 class="emoticons-panel-header">' + soy.$$escapeHtml('HipChat') + '</h4><hr>' + Confluence.Templates.HipChatEmoticons.Dialog.hipchatEmoticons(null) + '<div rv-hide="isHipChatIntegrated" class="aui-message info"><span class="aui-icon icon-hint"></span><span rv-show="isAdmin">' + soy.$$filterNoAutoescape(AJS.format('HipChat emoticons are not available as Confluence is not integrated with HipChat. {0}Click here{1} to integrate.','<a target="_blank" href="' + "/wiki" + '/plugins/servlet/hipchat/configure">','</a>')) + '</span><span rv-hide="isAdmin">' + soy.$$filterNoAutoescape('HipChat emoticons are not available as Confluence is not integrated with HipChat. Please contact your administrator for integration.') + '</span></div></div></div></div><footer class="aui-dialog2-footer"><div class="aui-dialog2-footer-actions"><button class="aui-button aui-button-link close-button" rv-on-click="close">' + soy.$$escapeHtml('Cancel') + '</button></div></footer></section>';
};
if (goog.DEBUG) {
  Confluence.Templates.HipChatEmoticons.Dialog.emoticonDialog.soyTemplateName = 'Confluence.Templates.HipChatEmoticons.Dialog.emoticonDialog';
}


Confluence.Templates.HipChatEmoticons.Dialog.confluenceEmoticons = function(opt_data, opt_ignored) {
  return '<div class="confluence-emoticons">' + Confluence.Templates.HipChatEmoticons.Dialog.genericEmoticonRepeater({modelDataAttribute: 'confluenceEmoticons'}) + '</div>';
};
if (goog.DEBUG) {
  Confluence.Templates.HipChatEmoticons.Dialog.confluenceEmoticons.soyTemplateName = 'Confluence.Templates.HipChatEmoticons.Dialog.confluenceEmoticons';
}


Confluence.Templates.HipChatEmoticons.Dialog.hipchatEmoticons = function(opt_data, opt_ignored) {
  return '<div class="hipchat-emoticons">' + Confluence.Templates.HipChatEmoticons.Dialog.genericEmoticonRepeater({modelDataAttribute: 'hipchatEmoticons'}) + '</div>';
};
if (goog.DEBUG) {
  Confluence.Templates.HipChatEmoticons.Dialog.hipchatEmoticons.soyTemplateName = 'Confluence.Templates.HipChatEmoticons.Dialog.hipchatEmoticons';
}


Confluence.Templates.HipChatEmoticons.Dialog.genericEmoticonRepeater = function(opt_data, opt_ignored) {
  return '<div rv-show="emoticon.visible" rv-each-emoticon="' + soy.$$escapeHtml(opt_data.modelDataAttribute) + '" class="gallery-item" rv-data-shortcut="emoticon.shortcut" rv-data-full-shortcut="emoticon.fullShortcut" rv-on-click="emoticon.onClick" rv-on-keydown="emoticon.onKeypress" tabindex="0"><img rv-src="emoticon.url"><br/><span class="caption"><span rv-text="emoticon.leftCaptionPortion"></span><strong rv-text="emoticon.selectedCaptionPortion"></strong><span rv-text="emoticon.rightCaptionPortion"></span></span></div>';
};
if (goog.DEBUG) {
  Confluence.Templates.HipChatEmoticons.Dialog.genericEmoticonRepeater.soyTemplateName = 'Confluence.Templates.HipChatEmoticons.Dialog.genericEmoticonRepeater';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-hipchat-emoticons-plugin:hipchat-emoticons', location = 'dialog/Templates.js' */
define("confluence-hipchat-emoticons/dialog/Templates",function(){return window.Confluence.Templates.HipChatEmoticons.Dialog});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-hipchat-emoticons-plugin:hipchat-emoticons', location = 'menu/MenuItemOverrider.js' */
define("confluence-hipchat-emoticons/menu/MenuItemOverrider",["ajs","jquery","confluence-hipchat-emoticons/dialog/EmoticonDialog"],function(d,a,c){return{start:function(){var b=null;a(".content-emoticon").off("click").on("click",function(a){b||(b=new c);b.show();a.preventDefault()})}}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-hipchat-emoticons-plugin:hipchat-emoticons', location = 'hipchat-emoticons.js' */
define("confluence-hipchat-emoticons",["jquery","confluence-hipchat-emoticons/completion/CompletionManager","confluence-hipchat-emoticons/data/DataManager","confluence-hipchat-emoticons/menu/MenuItemOverrider"],function(c,d,a,e){c(document).on("postPaste",function(b,d,a){b=c("img",a.node);b.data("hipchatEmoticon")&&b.removeClass("confluence-embedded-image confluence-external-resource")});return{start:function(){a.initializeData();d.start();e.start()}}});AJS.bind("init.rte",function(){require("confluence-hipchat-emoticons").start()});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-inline-comments:strip-inline-comment-marker', location = 'editor/paste-handler.js' */
(function(a){AJS.bind("init.rte",function(){a(document).unbind("postPaste",b).bind("postPaste",b);tinymce.activeEditor&&tinymce.activeEditor.onRemove.add(function(){a(document).unbind("postPaste",b)});function b(d,e,c){if(c&&c.node){a(".inline-comment-marker",c.node).contents().unwrap()}}})})(AJS.$);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.profile-picture:profile-picture-editor_resources', location = 'js/profile-picture.js' */
AJS.bind("init.rte", function() {
    AJS.Confluence.PropertyPanel.Macro.registerButtonHandler("viewProfile", function(e, macroNode) {
        var $macroDiv = AJS.$(macroNode);

        var params = {};
        if ($macroDiv.attr("data-macro-parameters")) {
            AJS.$.each($macroDiv.attr("data-macro-parameters").split("|"), function(idx, item) {
                var param = item.split("=");
                params[param[0]] = param[1];
            });
        }
        window.open(AJS.Confluence.getBaseUrl() + "/display/~" + params["user"]);
    });
});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-view-file-macro:view-file-macro-editor-resources', location = 'templates/view-file-macro-editor.soy' */
// This file was automatically generated from view-file-macro-editor.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace Confluence.ViewFileMacro.Templates.Editor.
 */

if (typeof Confluence == 'undefined') { var Confluence = {}; }
if (typeof Confluence.ViewFileMacro == 'undefined') { Confluence.ViewFileMacro = {}; }
if (typeof Confluence.ViewFileMacro.Templates == 'undefined') { Confluence.ViewFileMacro.Templates = {}; }
if (typeof Confluence.ViewFileMacro.Templates.Editor == 'undefined') { Confluence.ViewFileMacro.Templates.Editor = {}; }


Confluence.ViewFileMacro.Templates.Editor.viewFilePropertyPanelHeader = function(opt_data, opt_ignored) {
  return '<div class="view-file-property-panel-header"><span class="file-name"><span class="aui-icon aui-icon-small ' + soy.$$escapeHtml(opt_data.fileIcon) + '"></span>' + soy.$$escapeHtml(opt_data.fileName) + '</span></div>';
};
if (goog.DEBUG) {
  Confluence.ViewFileMacro.Templates.Editor.viewFilePropertyPanelHeader.soyTemplateName = 'Confluence.ViewFileMacro.Templates.Editor.viewFilePropertyPanelHeader';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-view-file-macro:view-file-macro-editor-resources', location = '/js/components/view-file-macro-properties-panel.js' */
define("vfm/components/view-file-macro-properties-panel",["jquery","underscore","ajs","confluence","confluence/jsUri","tinymce","vfm/view-file-macro-utils"],function(d,x,f,l,m,b,r){var t="view-file";var a="macro-placeholder-property-panel-edit-button";var y="macro-placeholder-property-panel-remove-button";var c="placeholder/unknown-attachment";var i="data-macro-parameters";var q={"view-file-size-small":"150","view-file-size-medium":"250","view-file-size-large":"400"};var h=[{className:"macro-property-panel-view-file-size-small",text:"",tooltip:"Small thumbnail",click:j},{className:"macro-property-panel-view-file-size-medium",text:"",tooltip:"Medium thumbnail",click:j},{className:"macro-property-panel-view-file-size-large",text:"",tooltip:"Large thumbnail",click:j},null,{className:"macro-property-panel-view-file-convert-to-link",text:"Show as link",tooltip:"Show as link",click:g}];function u(E,B){var F=x.find(Object.keys(q),function(G){return q[G]===B});if(F){for(var A=0,D=E.length;A<D;A++){var z=E[A];var C=z.className.replace(" selected","");if(C.indexOf("macro-property-panel-"+F)!==-1){C+=" selected"}z.className=C}}}function s(A){var B=x.reject(A,function(C){return C.className.indexOf(a)>-1||C.className.indexOf(y)>-1});A.splice(0,A.length);for(var z=0;z<B.length;z++){A.push(B[z])}}function k(A,z){var B=d(A);B.attr("height",z);var C=B.attr("src");if(o(C)){B.attr("src",p(B.attr("src"),z));B.attr("data-mce-src",p(B.attr("data-mce-src"),z));if(b.isGecko){f.Rte.getEditor().execCommand("mceRepaint",false)}}v(B,z);b.activeEditor.undoManager.add()}function o(z){return(z!=null&&z.indexOf("/servlet/view-file-macro/placeholder")>=0)}function p(B,z){var A=new m(B);if(A.getQueryParamValue("height")!==""){A.replaceQueryParam("height",z)}return A.toString()}function w(C){var z=C.attr(i);var D=[];var A="";for(var B=0;B<z.length;B++){var E=z[B];if(E==="\\"){A+=E;if(B+1!==z.length){A+=z[++B]}}else{if(E==="|"){D.push(A);A=""}else{A+=E}}}D.push(A);return D}function v(C,A){var B="height="+A;var E=w(C);var D=e(C,"height");if(D){var z=x.indexOf(E,"height="+D);E[z]=B}else{E.push(B)}C.attr(i,E.join("|"))}function e(B,z){var C=w(B);var A=x.find(C,function(D){return(D.indexOf(z+"=")>=0)});return A?A.split("=")[1]:null}function j(B,z){if(d(B).attr("class").indexOf("selected")!==-1){return}f.Confluence.PropertyPanel.destroy();var C=Object.keys(q);var D=d(B).attr("class");for(var A=0;A<C.length;A++){if(D.indexOf(C[A])!==-1){k(z,q[C[A]]);d(z).click();f.trigger("analyticsEvent",{name:"confluence.view-file.resize."+C[A].substring(C[A].lastIndexOf("-")+1,C[A].length)});return}}}function g(B,z){f.trigger("analyticsEvent",{name:"confluence.view-file.convert.to-link-trigger"});f.Confluence.PropertyPanel.destroy();A(z);function A(C){var E=r.getParameterByName(d(C).attr("src"),"attachmentId");var D=f.REST.makeUrl("attachment/"+E+".json");d.ajax({type:"GET",url:D,contentType:"application/json; charset=utf-8",dataType:"json"}).success(function(H){var F=l.Link.fromREST(H);var G=F.insert();b.activeEditor.undoManager.add();b.activeEditor.focus();G.click()})}}function n(){f.bind("created.property-panel",function(G,F){var H=d(F.anchor);var C=H.attr("data-macro-name");if(C!==t){return}var D=l.ViewFileMacro.Templates.Editor.viewFilePropertyPanelHeader;var E=e(H,"name");var B=r.getParameterByName(H.attr("src"),"mimeType");var A=f.Confluence.FileTypesUtils.getAUIIconFromMime(B);var z=d(D({fileName:E,fileIcon:A}));F.panel.find(".aui-property-panel").prepend(z);if(F.shouldFlip){F.tip.css({top:F.panel.outerHeight()})}})}return{init:function(){f.Confluence.PropertyPanel.Macro.registerInitHandler(function(G,D,z){s(D);var E=d(G);var B=E.attr("data-mce-src");if(B&&B.indexOf(c)>-1){return}for(var A=0,C=h.length;A<C;A++){D.push(h[A])}var F=E.attr("height");if(!F){F=(f.Meta.get("content-type")==="comment")?r.DEFAULT_HEIGHT_IN_COMMENT:r.DEFAULT_HEIGHT}u(D,F)},t);n()}}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-view-file-macro:view-file-macro-editor-resources', location = '/js/components/view-file-macro-link-properties-panel.js' */
define("vfm/components/view-file-macro-link-properties-panel",["jquery","ajs","tinymce","vfm/view-file-macro-utils"],function(g,b,e,a){var c="view-file";function f(h){if(h){var k=g(h);var i=k.attr("data-linked-resource-type");var j=k.attr("data-linked-resource-content-type");return b.MacroBrowser.getMacroMetadata(c)&&i==="attachment"&&!(j&&j.indexOf("image")===0)}return false}function d(h){var i=b.REST.makeUrl("attachment/"+g(h).attr("data-linked-resource-id")+".json");g.ajax({type:"GET",url:i,contentType:"application/json; charset=utf-8",dataType:"json"}).success(function(k){var n={name:k.fileName};if(b.Data.get("content-id")!==k.ownerId){n.page=k.parentTitle;n.space=k.space.key;if(k.parentContentType==="blogpost"){var l=k.createdDate.date.split("-");n.date=l[0]+"/"+l[1]+"/"+l[2].substring(0,2)+"/"}}n.height=(b.Meta.get("content-type")==="comment")?a.DEFAULT_HEIGHT_IN_COMMENT:a.DEFAULT_HEIGHT;var j={contentId:b.Meta.get("content-id")||"0",macro:{name:c,params:n}};var m=e.confluence.MacroUtils.insertMacro(j,h);m.done(function(o){g(o).click()})})}return{init:function(){b.bind("link-property-panel-buttons.created",function(j,k){var i=k.buttons;var h=k.link;if(f(h)){i.push({className:"link-property-panel-convert-to-thumbnail-button",text:"Show as thumbnail",tooltip:"Show as thumbnail",click:function(){b.Confluence.PropertyPanel.destroy();d(h);b.trigger("analyticsEvent",{name:"confluence.view-file.convert.to-thumbnail-trigger"})}})}})}}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-view-file-macro:view-file-macro-editor-resources', location = '/js/components/vfm-editor-poller.js' */
define("vfm/components/vfm-editor-poller",["ajs","jquery","underscore","tinymce","vfm/view-file-macro-utils","vfm/services/conversion-service"],function(k,e,m,p,q,c){var o;var l=false;var d={};var f=q.THUMBNAIL_POLLING_PERIOD;var h=q.THUMBNAIL_POLLING_BACKOFF_RATIO;function a(){if(!p.activeEditor||!l){return}var s=e("img[data-macro-name='view-file'][src*='thumbnailStatus="+q.THUMBNAIL_STATUS_IN_PROGRESS+"'][data-thumbnail-status!='"+q.THUMBNAIL_STATUS_ERROR+"']",p.activeEditor.dom.doc);if(s.length>0){var r=false;s.each(function(){var u=e(this);var w=u.attr("src");var v=q.getParameterByName(w,"attachmentId");var t=q.getParameterByName(w,"version");if(!d[v]||d[v].version!==t){d[v]={version:t};r=true}});if(r){j()}c.postThumbnailConversionResults(d).then(function(t){if(!p.activeEditor||!l){return}m.each(t,function(x,y){if(!d[y]){return}var w=e("img[data-macro-name='view-file'][src*='attachmentId="+y+"']",p.activeEditor.dom.doc);var v=d[y].version;w.attr("data-thumbnail-status",x);if(x===q.THUMBNAIL_STATUS_CONVERTED){var u=w.attr("src");var z=c.getThumbnailUrl(y,v);z=q.addParamsToUrl(z,{attachmentId:y,mimeType:q.getParameterByName(u,"mimeType")});w.attr("src",z);delete d[y]}else{if(x===q.THUMBNAIL_STATUS_ERROR){delete d[y]}}});if(!m.isEmpty(d)){n()}else{j()}i()})}else{if(s.length===0){j();i()}}}function n(){f=f*h}function j(){f=q.THUMBNAIL_POLLING_PERIOD}function i(){l=true;if(o){clearTimeout(o)}o=setTimeout(a,f)}function g(){if(o){clearTimeout(o);o=undefined}l=false;d={};j()}var b={startPolling:i,stopPolling:g};return b});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-view-file-macro:view-file-macro-editor-resources', location = '/js/vfm-editor.js' */
require(["ajs","tinymce","vfm/components/view-file-macro-properties-panel","vfm/components/view-file-macro-link-properties-panel","vfm/components/vfm-editor-poller"],function(a,d,b,c,e){a.toInit(function(){a.MacroBrowser.setMacroJsOverride("view-file",{opener:function(f){}});b.init();c.init()});d.create("tinymce.plugins.ViewFilePoller",{init:function(f){a.bind("rte-ready",function(){e.startPolling()});a.bind("rte-destroyed",function(){e.stopPolling()})}});d.PluginManager.add("viewFilePoller",d.plugins.ViewFilePoller);a.Rte.BootstrapManager.addTinyMcePluginInit(function(f){f.plugins+=",viewFilePoller"})},undefined,true);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.extra.widgetconnector:twitter-autoconvert-webresources', location = 'com/atlassian/confluence/extra/widgetconnector/js/autoconvert-twitter.js' */
(function(){AJS.bind("init.rte",function(){var a=/^\/(.*?)\/status\/([^/]+\/?$)/,c=/^\/(.*?)\/statuses\/([^/]+\/?$)/,b=function(h,g,d){var e,i,f;if(h.host.match(/^twitter.com/)){if(e=decodeURI(h.path).match(a)){i=h.protocol+"://twitter.com/"+e[1]+"/status/"+e[2]}else{if(e=decodeURI(h.path).match(c)){i=h.protocol+"://twitter.com/"+e[1]+"/statuses/"+e[2]}}if(i){f={name:"widget",params:{url:i}};tinymce.plugins.Autoconvert.convertMacroToDom(f,d,d)}else{d()}}else{d()}};tinymce.plugins.Autoconvert.autoConvert.addHandler(b)})})();
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.extra.officeconnector:macro-browser-smart-fields', location = 'javascript/office-connector-macro-fields.js' */
(function(b){var a=function(c){this.fileTypes=c};a.prototype.beforeParamsSet=function(e,c){if(!e.page&&!(e.date||e.space)){if(AJS.params.contentType=="page"||AJS.params.contentType=="blogpost"){e.page=b("#content-title").val()}else{if(AJS.params.contentType=="comment"){e.page=AJS.params.pageTitle}}}if(e.date){var d=e.date.split("/");e.page=["",d[2],d[0],d[1],e.page].join("/")}if(e.space){e.page=e.space+":"+e.page}return e};a.prototype.beforeParamsRetrieved=function(e){if(e.page){var d=e.page.split(":");if(d.length>1){e.space=d[0];e.page=d[1]}var c=e.page.split("/");if(c.length>1){e.date=[c[2],c[3],c[1]].join("/");e.page=c[4]}if(((AJS.params.contentType=="page"||AJS.params.contentType=="blogpost")&&e.page==b("#content-title").val())||(AJS.params.contentType=="comment"&&e.page==AJS.params.pageTitle)){delete e.page}}return e};a.prototype.fields={attachment:function(f){var c=function(g){var i={};var h=g.split(":",2);i.spaceKey=((h.length==2)&&h[0])||AJS.params.spaceKey;i.title=h[h.length-1];if(i.title.indexOf("/")==0){i.postingDay=i.title.substr(1,10);i.title=i.title.substr(12)}if(i.title==b("#content-title").val()){i.title=""}if(!i.title){if(AJS.params.newPage){i.draftId=AJS.params.contentId}else{i.pageId=AJS.params.pageId}}return i};var d={fileTypes:this.fileTypes};var e=AJS.MacroBrowser.ParameterFields.attachment(f,d);e.dependencyUpdated=function(i,h){AJS.log("attachment:dependencyUpdated called: "+i+", "+h);var g=c(h);this.getData(g)};return e},spacekey:function(c){return AJS.MacroBrowser.ParameterFields._hidden(c,{})},date:function(c){return AJS.MacroBrowser.ParameterFields._hidden(c,{})},"confluence-content":function(d){var c={dependencies:["name"]};return AJS.MacroBrowser.ParameterFields["confluence-content"](d,c)}};AJS.MacroBrowser.Macros.viewdoc=new a(["doc","docx"]);AJS.MacroBrowser.Macros.viewpdf=new a(["pdf"]);AJS.MacroBrowser.Macros.viewxls=new a(["xls","xlsx"]);AJS.MacroBrowser.Macros.viewppt=new a(["ppt","pptx"]);AJS.MacroBrowser.Macros.viewfile={updateSelectedMacro:function(d){var f=d.params[""]||d.params.name;if(f){var e=f.lastIndexOf(".");if(e>0){var c=f.substring(e+1);if(c){(c=="doc")&&(c=="docx")&&(d.name="viewdoc");(c=="pdf")&&(d.name="viewpdf");(c=="ppt")&&(c=="pptx")&&(d.name="viewppt");(c=="xls")&&(c=="xlsx")&&(d.name="viewxls")}}}}}})(AJS.$);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.ext.newcode-macro-plugin:code-macro-editor', location = '/scripts/code-macro-languages.js' */
(function(d){var b=function(){};b.prototype.fields={string:{language:function(h,f){var g=d(Confluence.Templates.MacroBrowser.macroParameterSelect());var e=d("select",g);if(f==null){f={}}f.setValue=function(k){var j=e.find("option[value='"+k+"']");if(j.length==0){var i=d("<option/>");i.val(k);i.text(k);e.append(i)}};a(e);return new AJS.MacroBrowser.Field(g,e,f)}}};AJS.MacroBrowser.Macros.code=new b();function a(e){c(function(g){if(!g.length){AJS.log("Configured code macro languages result was not in the expected format.");return}var f=e.val();e.empty();e.append(d("<option/>").attr("value",""));d.each(g,function(h,j){var i=d("<option />");i.val(j.aliases[0]);i.text(j.friendlyName);e.append(i)});e.val(f)},function(g,h,f){AJS.log("Failed to retrieve syntax highlighters from Confluence "+h+" - "+f)})}function c(f,e){AJS.$.ajax({async:true,url:AJS.contextPath()+"/plugins/newcode/getlanguages.action",dataType:"json",timeout:10000,error:function(h,i,g){if(e&&typeof(e)=="function"){e(h,i,g)}},success:function(g){if(f&&typeof(f)=="function"){f(g)}}})}})(AJS.$);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.extra.team-calendars:macro-browser-web-resources', location = 'com/atlassian/confluence/extra/calendar3/js/macro-browser.js' */
(function(e){var c=function(){a("space-calendar")();a("team-calendar")();a("calendar")()};function b(f){return function(g){if(g.params){AJS.MacroBrowser.setMacroJsOverride(f,{opener:null,fields:d(),postPreview:a(f)});tinymce.confluence.macrobrowser.editMacro(AJS.Editor.Adapter.getEditor().selection.getNode())}else{Confluence.TeamCalendars.Dialogs.getAddDialogForMacro(g)}}}function a(f){return function(){AJS.MacroBrowser.setMacroJsOverride(f,{opener:b(f),fields:d()})}}function d(){return{string:{id:function(j,g){var f;if(AJS.MacroBrowser.makeParameterDiv){f=AJS.MacroBrowser.makeParameterDiv({},{name:"id",type:"string"})}else{f=AJS.MacroBrowser.ParameterFields.string(j,g).paramDiv}var h=e("<input/>",{"class":"subcalendars-select",type:"hidden"});var k=e("input",f).addClass("hidden").after(h);var i=function(m){if(m){var l=e.isArray(m)?m.join(","):m;k.val(l);if(!k.data("renderedInitialSelection")){k.data("renderedInitialSelection",true);e.ajax({cache:false,data:{subCalendarIds:l},dataType:"json",success:function(n){if(n&&e.isArray(n)){h.auiSelect2("data",e.map(n,function(o){return{id:o.id,text:e("<span/>",{text:o.name}).html()}}))}},timeout:Confluence.TeamCalendars.ajaxTimeout,url:AJS.contextPath()+"/rest/calendar-services/1.0/calendar/util/format/subcalendar/ids.json"})}}else{k.val("")}k.trigger("change")};h.change(function(){i(e.trim(h.auiSelect2("val")))}).auiSelect2({minimumInputLength:1,formatNoMatches:function(l){return e("<div/>").append(e("<span/>",{text:AJS.format("No calendars found with {0}.",l||"")})).html()},formatInputTooShort:function(){return e("<div/>").append(e("<span/>",{text:"Start typing for suggestions"})).html()},multiple:true,query:function(l){e.ajax({cache:false,data:{term:l.term,limit:5,showSubCalendarsInView:"true"},dataType:"json",success:function(m){l.callback({results:(function(){if(m.payload&&m.payload.length){return e.map(m.payload,function(n){return{id:n.subCalendar.id,text:e("<span/>",{text:n.subCalendar.name}).html()}})}return[]})(),more:false});e(".select2-drop-active").addClass("select2-drop")},timeout:Confluence.TeamCalendars.ajaxTimeout,url:AJS.contextPath()+"/rest/calendar-services/1.0/calendar/search/subcalendars.json"})}});e(".select2-container",f).after(e("<div/>",{"class":"id-desc",html:"Start typing for calendar suggestions or \u003cspan class=\"add-subcalendar\"\u003eadd a new calendar\u003c/span\u003e."}).click(function(){AJS.MacroBrowser.close();Confluence.TeamCalendars.Dialogs.getAddDialogForMacro({name:e("#macro-insert-container .macro-name").val(),params:(function(){var l={};e(".macro-param-input").each(function(){var m=e(this);l[m.attr("id").substring(12)]=m.attr("type")==="checkbox"?m.prop("checked"):m.val()});return l})(),defaultParameterValue:""})}));return AJS.MacroBrowser.Field(f,k,e.extend({setValue:function(l){i(l)}}),g)}}}}AJS.bind("init.rte",c)})(jQuery);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.extra.team-calendars:macro-browser-web-resources', location = 'com/atlassian/confluence/extra/calendar3/eventmacro/js/macro-browser.js' */
AJS.bind("init.rte",function(){var a=function(){return Math.random().toString(36).substring(2)};tinymce.activeEditor.onPostProcess.add(function(c,e){try{if(e.getInner){if(e.content.indexOf("editor-inline-macro")===-1){return}var b=$("<div>").html(e.content);b.find(".editor-inline-macro").each(function(g,f){var j=$(f);var l=Confluence.MacroParameterSerializer;var i=j.hasClass("editor-inline-macro");if(i){var h=j.attr("data-macro-name");if(h==="event"){var k=l.deserialize(j.attr("data-macro-parameters"));k.id=a();j.attr("data-macro-parameters",l.serialize(k))}}});e.content=b.html()}}catch(d){if(AJS.logError){AJS.logError("Could not parse paste content to handle copy Event Macro",d)}}});AJS.MacroBrowser.setMacroJsOverride("event",{beforeParamsRetrieved:function(c,d,b){var e=AJS.$("#macro-param-id").val();if(!e){e=a();AJS.$("#macro-param-id").val(e);c.id=e}return c}});AJS.MacroBrowser.getMacroJsOverride("event").fields={};AJS.MacroBrowser.getMacroJsOverride("event").fields.string={id:function(b){return AJS.MacroBrowser.ParameterFields._hidden(b,{})}}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.macros.multimedia:macro-browser-smart-fields', location = 'javascript/macro-fields.js' */
(function(a){AJS.MacroBrowser.activateSmartFieldsAttachmentsOnPage("multimedia",["swf","avi","mov","mp4","mpeg","mpg","wmv","wma","mp3","ram","rm"])})(AJS.$);
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-inline-tasks:space-page-picker-shim', location = 'js/space-page-picker-shim.js' */
define("confluence-inline-tasks/space-page-picker-shim",[],function(){function c(d){var f=d.space;var g=d.page;var e=[];if(f){e=e.concat(_.map(f.split(","),function(h){return"space:"+h}))}if(g){e=e.concat(_.map(g.split(","),function(h){return"page:"+h}))}return e.join(",")}function b(e){var d={page:[],space:[]};if(!e){return d}var f=e.split(",");f.forEach(function(g){var j=g.split(":");var i=j[0];var h=j[1];d[i].push(h)});return d}function a(d){return b(d.val())}return{build:function(d){return Confluence.UI.Components.SpacePagePicker.build(d)},setValue:function(e,d){return Confluence.UI.Components.SpacePagePicker.setValue(e,d)},splitStringToMap:b,combineMapToString:c,getValueAsMap:a}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-inline-tasks:inline-tasks-macro-browser', location = 'js/macro-browser-overrides.js' */
define("confluence-inline-tasks/macro-browser-overrides",["jquery","ajs","confluence-inline-tasks/space-page-picker-shim"],function(c,a,b){return{fields:{string:{spaceAndPage:function(g){var f=g.multiple?"autocomplete-multi-space-and-page":"autocomplete-space-and-page";var e=c(Confluence.Templates.MacroBrowser.macroParameter());var h=e.find("input[type='text']");h.addClass(f).attr("data-none-message","Not found");if(g.required){h.keyup(a.MacroBrowser.processRequiredParameters)}h.auiSelect2(b.build({multiple:g.multiple,orgElement:h,inputSpaceId:"legacy-macro-param-spaces",inputSpaceCatId:"legacy-macro-param-space-cats",inputPageId:"legacy-macro-param-pages"}));var d={setValue:function(i){b.setValue(i,h)}};return a.MacroBrowser.Field(e,h,d)}}},beforeParamsSet:function(d){var e=b.combineMapToString({page:d.pages,space:d.spaces});if(e){d.spaceAndPage=e}delete d.pages;delete d.spaces;return d},beforeParamsRetrieved:function(e){var d=b.splitStringToMap(e.spaceAndPage);if(d.page.length){e.pages=d.page.join(",")}if(d.space.length){e.spaces=d.space.join(",")}delete e.spaceAndPage;return e}}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.confluence-inline-tasks:inline-tasks-macro-browser', location = 'js/macro-browser-overrides-call.js' */
require("confluence/module-exporter").safeRequire("confluence-inline-tasks/macro-browser-overrides",function(a){require("ajs").MacroBrowser.setMacroJsOverride("tasks-report-macro",a)});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.gadgets.embedded:gadget-core-resources', location = 'js/rpc.js' */
var gadgets=gadgets||{};gadgets.rpc=function(){var CALLBACK_NAME="__cb";var DEFAULT_NAME="";var FE_G2C_CHANNEL="__g2c_rpc";var FE_C2G_CHANNEL="__c2g_rpc";var services={};var iframePool=[];var relayUrl={};var useLegacyProtocol={};var authToken={};var callId=0;var callbacks={};var setup={};var sameDomain={};var params={};if(gadgets.util){params=gadgets.util.getUrlParameters()}authToken[".."]=params.rpctoken||params.ifpctok||0;function getRelayChannel(){return typeof window.postMessage==="function"?"wpm":typeof document.postMessage==="function"?"dpm":navigator.product==="Gecko"?"fe":"ifpc"}function setupChannel(){if(relayChannel==="dpm"||relayChannel==="wpm"){window.addEventListener("message",function(packet){try{if(packet&&packet.origin&&packet.origin!=="null"&&typeof packet.data==="string"){if(packet.origin===location.origin){process(gadgets.json.parse(packet.data))}else{AJS.$.get(AJS.contextPath()+"/rest/whitelist/1/check",{url:packet.origin}).done(function(result){if(result&&result.inbound&&result.inbound===true){process(gadgets.json.parse(packet.data))}else{if(AJS.debug){AJS.log("RPC: request rejected (bad origin): "+(packet&&packet.origin?packet.origin:"undefined origin"))}}}).fail(function(jqXHR,textStatus,errorThrown){AJS.log("RPC: REST "+textStatus,errorThrown)})}}else{if(AJS.debug){AJS.log("RPC: request rejected (bad origin): "+(packet&&packet.origin?packet.origin:"undefined origin"))}}}catch(e){if(AJS.debug){var origin=packet&&packet.origin?packet.origin:"undefined origin";AJS.log("Error processing gadget rpc message from '"+origin+"': "+e)}}},false)}}var relayChannel=getRelayChannel();setupChannel();services[DEFAULT_NAME]=function(){throw new Error("Unknown RPC service: "+this.s)};services[CALLBACK_NAME]=function(callbackId,result){var callback=callbacks[callbackId];if(callback){delete callbacks[callbackId];callback(result)}};function setupFrame(frameId){if(setup[frameId]){return }if(relayChannel==="fe"){try{var frame=document.getElementById(frameId);frame[FE_G2C_CHANNEL]=function(args){process(gadgets.json.parse(args))}}catch(e){}}setup[frameId]=true}function encodeLegacyData(args){var stringify=gadgets.json.stringify;var argsEscaped=[];for(var i=0,j=args.length;i<j;++i){argsEscaped.push(encodeURIComponent(stringify(args[i])))}return argsEscaped.join("&")}function process(rpc){if(rpc&&typeof rpc.s==="string"&&typeof rpc.f==="string"&&rpc.a instanceof Array){if(authToken[rpc.f]){if(authToken[rpc.f]!=rpc.t){if(AJS.debug){console.log("Invalid auth token received for operation: "+rpc.s)}return }}if(rpc.c){rpc.callback=function(result){gadgets.rpc.call(rpc.f,CALLBACK_NAME,null,rpc.c,result)}}var result=(services[rpc.s]||services[DEFAULT_NAME]).apply(rpc,rpc.a);if(rpc.c&&typeof result!="undefined"){gadgets.rpc.call(rpc.f,CALLBACK_NAME,null,rpc.c,result)}}}function callFrameElement(targetId,serviceName,from,rpcData,callArgs){try{if(from!=".."){var fe=window.frameElement;if(typeof fe[FE_G2C_CHANNEL]==="function"){if(typeof fe[FE_G2C_CHANNEL][FE_C2G_CHANNEL]!=="function"){fe[FE_G2C_CHANNEL][FE_C2G_CHANNEL]=function(args){process(gadgets.json.parse(args))}}fe[FE_G2C_CHANNEL](rpcData);return }}else{var frame=document.getElementById(targetId);if(typeof frame[FE_G2C_CHANNEL]==="function"&&typeof frame[FE_G2C_CHANNEL][FE_C2G_CHANNEL]==="function"){frame[FE_G2C_CHANNEL][FE_C2G_CHANNEL](rpcData);return }}}catch(e){}callIfpc(targetId,serviceName,from,rpcData,callArgs)}function callIfpc(targetId,serviceName,from,rpcData,callArgs){var relay=gadgets.rpc.getRelayUrl(targetId);if(!relay){throw new Error("No relay file assigned for IFPC")}var src=null;if(useLegacyProtocol[targetId]){src=[relay,"#",encodeLegacyData([from,callId,1,0,encodeLegacyData([from,serviceName,"","",from].concat(callArgs))])].join("")}else{src=[relay,"#",targetId,"&",from,"@",callId,"&1&0&",encodeURIComponent(rpcData)].join("")}emitInvisibleIframe(src)}function emitInvisibleIframe(src){var iframe;for(var i=iframePool.length-1;i>=0;--i){var ifr=iframePool[i];try{if(ifr&&(ifr.recyclable||ifr.readyState==="complete")){ifr.parentNode.removeChild(ifr);if(window.ActiveXObject){iframePool[i]=ifr=null;iframePool.splice(i,1)}else{ifr.recyclable=false;iframe=ifr;break}}}catch(e){}}if(!iframe){iframe=document.createElement("iframe");iframe.style.border=iframe.style.width=iframe.style.height="0px";iframe.style.visibility="hidden";iframe.style.position="absolute";iframe.onload=function(){this.recyclable=true};iframePool.push(iframe)}iframe.src=src;setTimeout(function(){document.body.appendChild(iframe)},0)}function callSameDomain(target,rpc){if(typeof sameDomain[target]==="undefined"){sameDomain[target]=false;var targetEl=null;if(target===".."){targetEl=parent}else{targetEl=frames[target]}try{sameDomain[target]=targetEl.gadgets.rpc.receiveSameDomain}catch(e){}}if(typeof sameDomain[target]==="function"){sameDomain[target](rpc);return true}return false}if(gadgets.config){function init(config){if(config.rpc.parentRelayUrl.substring(0,7)==="http://"){relayUrl[".."]=config.rpc.parentRelayUrl}else{var params=document.location.search.substring(0).split("&");var parentParam="";for(var i=0,param;param=params[i];++i){if(param.indexOf("parent=")===0){parentParam=decodeURIComponent(param.substring(7));break}}relayUrl[".."]=parentParam+config.rpc.parentRelayUrl}useLegacyProtocol[".."]=!!config.rpc.useLegacyProtocol}var requiredConfig={parentRelayUrl:gadgets.config.NonEmptyStringValidator};gadgets.config.register("rpc",requiredConfig,init)}return{register:function(serviceName,handler){if(serviceName==CALLBACK_NAME){throw new Error("Cannot overwrite callback service")}if(serviceName==DEFAULT_NAME){throw new Error("Cannot overwrite default service:"+" use registerDefault")}services[serviceName]=handler},unregister:function(serviceName){if(serviceName==CALLBACK_NAME){throw new Error("Cannot delete callback service")}if(serviceName==DEFAULT_NAME){throw new Error("Cannot delete default service:"+" use unregisterDefault")}delete services[serviceName]},registerDefault:function(handler){services[""]=handler},unregisterDefault:function(){delete services[""]},call:function(targetId,serviceName,callback,var_args){++callId;targetId=targetId||"..";if(callback){callbacks[callId]=callback}var from="..";if(targetId===".."){from=window.name}var rpc={s:serviceName,f:from,c:callback?callId:0,a:Array.prototype.slice.call(arguments,3),t:authToken[targetId]};if(callSameDomain(targetId,rpc)){return }var rpcData=gadgets.json.stringify(rpc);var channelType=relayChannel;if(useLegacyProtocol[targetId]){channelType="ifpc"}switch(channelType){case"dpm":var targetDoc=targetId===".."?parent.document:frames[targetId].document;targetDoc.postMessage(rpcData);break;case"wpm":var targetWin=targetId===".."?parent:frames[targetId];targetWin.postMessage(rpcData,relayUrl[targetId]);break;case"fe":callFrameElement(targetId,serviceName,from,rpcData,rpc.a);break;default:callIfpc(targetId,serviceName,from,rpcData,rpc.a);break}},getRelayUrl:function(targetId){return relayUrl[targetId]},setRelayUrl:function(targetId,url,opt_useLegacy){relayUrl[targetId]=url;useLegacyProtocol[targetId]=!!opt_useLegacy},setAuthToken:function(targetId,token){authToken[targetId]=token;setupFrame(targetId)},getRelayChannel:function(){return relayChannel},receive:function(fragment){if(fragment.length>4){process(gadgets.json.parse(decodeURIComponent(fragment[fragment.length-1])))}},receiveSameDomain:function(rpc){rpc.a=Array.prototype.slice.call(rpc.a);window.setTimeout(function(){process(rpc)},0)}}}();
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.gadgets.embedded:gadget-core-resources', location = 'js/util.js' */
Function.prototype.inherits=function(parentCtor){function tempCtor(){}tempCtor.prototype=parentCtor.prototype;this.superClass_=parentCtor.prototype;this.prototype=new tempCtor();this.prototype.constructor=this};
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.gadgets.embedded:gadget-core-resources', location = 'js/json.js' */
var gadgets=gadgets||{};gadgets.json=function(){function f(n){return n<10?"0"+n:n}Date.prototype.toJSON=function(){return[this.getUTCFullYear(),"-",f(this.getUTCMonth()+1),"-",f(this.getUTCDate()),"T",f(this.getUTCHours()),":",f(this.getUTCMinutes()),":",f(this.getUTCSeconds()),"Z"].join("")};var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function stringify(value){var a,i,k,l,r=/["\\\x00-\x1f\x7f-\x9f]/g,v;switch(typeof value){case"string":return r.test(value)?'"'+value.replace(r,function(a){var c=m[a];if(c){return c}c=a.charCodeAt();return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16)})+'"':'"'+value+'"';case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}a=[];if(typeof value.length==="number"&&!(value.propertyIsEnumerable("length"))){l=value.length;for(i=0;i<l;i+=1){a.push(stringify(value[i])||"null")}return"["+a.join(",")+"]"}for(k in value){if(value.hasOwnProperty(k)){if(typeof k==="string"){v=stringify(value[k]);if(v){a.push(stringify(k)+":"+v)}}}}return"{"+a.join(",")+"}"}}return{stringify:stringify,parse:function(text){if(/^[\],:{}\s]*$/.test(text.replace(/\\["\\\/b-u]/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){return eval("("+text+")")}return false}}}();
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.gadgets.embedded:gadget-core-resources', location = 'js/gadgets-core.js' */
var gadgets=gadgets||{};gadgets.error={};gadgets.error.SUBCLASS_RESPONSIBILITY="subclass responsibility";gadgets.error.TO_BE_DONE="to be done";gadgets.log=function(message){if(window.console&&console.log){console.log(message)}else{var logEntry=document.createElement("div");logEntry.className="gadgets-log-entry";logEntry.innerHTML=message;document.body.appendChild(logEntry)}};gadgets.Extensible=function(){};gadgets.Extensible.prototype.setDependencies=function(dependencies){for(var p in dependencies){this[p]=dependencies[p]}};gadgets.Extensible.prototype.getDependencies=function(name){return this[name]};gadgets.UserPrefStore=function(){};gadgets.UserPrefStore.prototype.getPrefs=function(gadget){throw Error(gadgets.error.SUBCLASS_RESPONSIBILITY)};gadgets.UserPrefStore.prototype.savePrefs=function(gadget){throw Error(gadgets.error.SUBCLASS_RESPONSIBILITY)};gadgets.DefaultUserPrefStore=function(){gadgets.UserPrefStore.call(this)};gadgets.DefaultUserPrefStore.inherits(gadgets.UserPrefStore);gadgets.DefaultUserPrefStore.prototype.getPrefs=function(gadget){};gadgets.DefaultUserPrefStore.prototype.savePrefs=function(gadget){};gadgets.GadgetService=function(){};gadgets.GadgetService.prototype.setHeight=function(elementId,height){throw Error(gadgets.error.SUBCLASS_RESPONSIBILITY)};gadgets.GadgetService.prototype.setTitle=function(gadget,title){throw Error(gadgets.error.SUBCLASS_RESPONSIBILITY)};gadgets.GadgetService.prototype.setUserPref=function(id){throw Error(gadgets.error.SUBCLASS_RESPONSIBILITY)};gadgets.IfrGadgetService=function(){gadgets.GadgetService.call(this);var service=this;gadgets.rpc.register("resize_iframe",function(){service.setHeight.apply(this,arguments)});gadgets.rpc.register("set_pref",function(){service.setUserPref.apply(this,arguments)});gadgets.rpc.register("set_title",function(){service.setTitle.apply(this,arguments)});gadgets.rpc.register("requestNavigateTo",function(){service.requestNavigateTo.apply(this,arguments)})};gadgets.IfrGadgetService.inherits(gadgets.GadgetService);gadgets.IfrGadgetService.prototype.setHeight=function(height){if(height>gadgets.container.maxheight_){height=gadgets.container.maxheight_}var element=document.getElementById(this.f);if(element){element.style.height=height+"px"}};gadgets.IfrGadgetService.prototype.requestNavigateTo=function(view,opt_params){var id=this.getGadgetIdFromModuleId(this.f);var url=this.getUrlForView(view);if(opt_params){var paramStr=JSON.stringify(opt_params);if(paramStr.length>0){url+="&appParams="+encodeURIComponent(paramStr)}}if(url&&document.location.href.indexOf(url)==-1){document.location.href=url}};gadgets.IfrGadgetService.prototype.getUrlForView=function(view){if(view==="canvas"){return"/canvas"}else{if(view==="profile"){return"/profile"}else{return null}}};gadgets.IfrGadgetService.prototype.getGadgetIdFromModuleId=function(moduleId){return parseInt(moduleId.match(/_([0-9]+)$/)[1],10)};gadgets.LayoutManager=function(){};gadgets.LayoutManager.prototype.getGadgetChrome=function(gadget){throw Error(gadgets.error.SUBCLASS_RESPONSIBILITY)};gadgets.StaticLayoutManager=function(){gadgets.LayoutManager.call(this)};gadgets.StaticLayoutManager.inherits(gadgets.LayoutManager);gadgets.StaticLayoutManager.prototype.setGadgetChromeIds=function(gadgetChromeIds){this.gadgetChromeIds_=gadgetChromeIds};gadgets.StaticLayoutManager.prototype.getGadgetChrome=function(gadget){var chromeId=this.gadgetChromeIds_[gadget.id];return chromeId?document.getElementById(chromeId):null};gadgets.FloatLeftLayoutManager=function(layoutRootId){gadgets.LayoutManager.call(this);this.layoutRootId_=layoutRootId};gadgets.FloatLeftLayoutManager.inherits(gadgets.LayoutManager);gadgets.FloatLeftLayoutManager.prototype.getGadgetChrome=function(gadget){var layoutRoot=document.getElementById(this.layoutRootId_);if(layoutRoot){var chrome=document.createElement("div");chrome.className="gadgets-gadget-chrome";chrome.style.cssFloat="left";layoutRoot.appendChild(chrome);return chrome}else{return null}};
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.confluence.plugins.gadgets:macro-browser-for-gadgetsplugin', location = 'script/gadget-macro-browser.js' */
AJS.toInit(function(a){var b={};b.postPreview=function(h,d){var f=h.contentWindow.AJS;var c={};var k=a("#macro-param-div-preferences input").val().split("&");for(var j=0,o=k.length;j<o;j++){var g=k[j].split("=");try{c[decodeURI(g[0])]=decodeURI(g[1])}catch(l){}}if(d.needsConfig&&f){var m=!!c.isConfigured;if(!m){var n=a("#macro-browser-dialog .dialog-button-panel .ok");a("#save-warning-span").addClass("gadget-not-configured-warning").text("Please complete the configuration in the preview area first").removeClass("hidden");n.prop("disabled",true)}}};b.beforeParamsSet=function(j,c){var h=j.preferences;if(!c&&h){var g=h.split("&");for(var d=0,f=g.length;d<f;d++){var e=g[d].split("=");j[decodeURI(e[0])]=decodeURI(e[1])}}return j};b.updateMacroParametersForPreview=function(c){c.forceWrite=true;return c};b.manipulateMarkup=function(f){if(AJS.MacroBrowser.gadgetPrefsChanged){var d=top.document.getElementById("macro-insert-container");var g=a("#macro-param-div-preferences input",d);var c="";for(var e in AJS.MacroBrowser.gadgetPrefs){if(c.length!=0){c+="&"}c=c+encodeURI(e)+"="+encodeURI(AJS.MacroBrowser.gadgetPrefs[e])}g.val(c)}};b.getMacroDetailsFromSelectedMacro=function(f,g){var c=g.params.url;for(var e=0,h=f.length;e<h;e++){var d=f[e];if(d.macroName===g.name&&d.gadgetUrl===c){return d}}};b.beforeParamsRetrieved=function(p,h,j){var s="";if(h.nonHiddenUserPrefs){var m=true;var d={},f=p.preferences;if(f){var n=f.split("&");for(var l=0,q=n.length;l<q;l++){var k=n[l].split("=");var o=decodeURI(k[0]);var r=decodeURI(k[1]);d[o]=r}}for(var e in j){d[e]=j[e]}var c=function(v,t,w){var x=v.formDetails.parameters;for(var u=0;u<x.length;u++){if(x[u].name==t){return w==x[u].defaultValue}}AJS.log("Unable to find matching param for "+t);return false};for(var g in d){if(!c(h,g,d[g])){if(!m){s+="&"}m=false;s=s+encodeURI(g)+"="+encodeURI(d[g])}}p.preferences=s}return p};AJS.MacroBrowser.setMacroJsOverride("gadget",b)});
}catch(e){WRMCB(e)};