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:jira-issues-view-mode-async-resource', location = 'jira/jira-issues-view-mode/lazy-loading.js' */
define("confluence/jim/jira/jira-issues-view-mode/lazy-loading",["jquery","ajs","underscore","confluence/jim/jira/jira-issues-view-mode/fetching-job"],function(g,t,h,u){var l,k={queryJiraIssuesEls:function(){return g(".wiki-content [data-jira-key][data-client-id]")},renderUISingleJIMFromMacroHTML:function(a,b){h.each(a,function(c,f){b.filter('[data-jira-key\x3d"'+f+'"]').each(function(e,d){d=g(d);d.hasClass("jira-table")?l.updateRefreshedElement(d,c[0]):d.replaceWith(c[e]||c[0])})})},renderUISingleJIMInErrorCase:function(a,
b){var c=["aui-message","aui-message-warning","jim-error-message"];b=t.I18n.getText("jiraissues.unexpected.error")+" "+b;a.hasClass("jira-table")?(c.push("jim-error-message-table"),l.updateRefreshedElement(a,b)):(c.push("jim-error-message-single"),a.find(".summary").text(b),a.find(".jira-status").remove(),a.find(".issue-placeholder").remove(),a.find(".aui-icon-wait").remove());a.removeClass("jira-issue jira-table").addClass(c.join(" "))}},m={handleAjaxSuccess:function(a,b,c){var f=k.queryJiraIssuesEls();
h.each(a,function(e){var d=f.filter('[data-client-id\x3d"'+e.clientId+'"]');200===e.status?k.renderUISingleJIMFromMacroHTML(JSON.parse(e.data).htmlMacro,d):202!==e.status&&k.renderUISingleJIMInErrorCase(d,e.data)})},handleAjaxError:function(a,b){a=a.clientIds.split(",");var c=k.queryJiraIssuesEls();h.each(a,function(f){f=c.filter('[data-client-id\x3d"'+f+'"]');k.renderUISingleJIMInErrorCase(f,b)})}},n={findAllClientIdInPageContent:function(){var a=k.queryJiraIssuesEls();a=h.map(a,function(b){if(b=
g(b).attr("data-client-id"))return b});return h.uniq(a)},collectFetchingJobs:function(){var a=n.findAllClientIdInPageContent(),b=[];a=new u({clientIds:a.join(",")});a.clientIds&&b.push(a);return b}},x=function(){var a=n.collectFetchingJobs(),b=a.length,c=g.Deferred(),f=0;a.forEach(function(e){e.startJobWithRetry().fail(function(d,v,p){m.handleAjaxError(d,p)}).always(function(){++f===b&&c.resolve()}).progress(function(d,v,p){m.handleAjaxSuccess.apply(this,arguments);var w=h.reduce(d,function(q,r){202==
r.status&&q.push(r.clientId);return q},[]);e.clientIds=w.join(",")})});return c.promise()},y={loadTableResourceIfNeeded:function(){var a=g.Deferred();g(".wiki-content .jira-table[data-jira-key]").length?WRM.require("wr!confluence.extra.jira:refresh-resources",function(){l=require("confluence/jim/jira/jira-issues-view-mode/refresh-table");l.init();a.resolve()}):a.resolve();return a.promise()}};return{init:function(a){return g.when(y.loadTableResourceIfNeeded()).pipe(x)}}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.extra.jira:jira-issues-view-mode-async-resource', location = 'jira/jira-issues-view-mode/fix-ui.js' */
define("confluence/jim/jira/jira-issues-view-mode/fix-ui",["jquery","ajs"],function(d,f){var e={fixBreakIconInOldConf:function(){0>=e.compareVersion(f.version,"5.4.4")&&d(".jim-error-message").each(function(){var a=d(this),b=a;a.hasClass("jim-error-message-table")&&(b=a.find(".aui-message"));b.addClass("warning").prepend('\x3cspan class\x3d"aui-icon icon-warning"\x3e\x3c/span\x3e')})},compareVersion:function(a,b){if("string"!==typeof a||"string"!==typeof b)return!1;a=a.split(".");b=b.split(".");for(var c=
0,g=Math.max(a.length,b.length);c<g;c++){if(a[c]&&!b[c]&&0<parseInt(a[c])||parseInt(a[c])>parseInt(b[c]))return 1;if(b[c]&&!a[c]&&0<parseInt(b[c])||parseInt(a[c])<parseInt(b[c]))return-1}return 0}};return e});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'confluence.extra.jira:jira-issues-view-mode-async-resource', location = 'jira/jira-issues-view-mode/fetching-job.js' */
define("confluence/jim/jira/jira-issues-view-mode/fetching-job",["jquery","ajs","confluence/jim/confluence-shim","confluence/jim/util/retry-caller"],function(d,e,b,f){b=function(a){this.clientIds=a.clientIds;this.TICK_RETRIES=[0,1E3,1E3,2E3,3E3,5E3,8E3,13E3,13E3,13E3];this.RETRY_HTTP_CODE=202};b.prototype.startJob=function(){return this.fetchSingeJiraServer()};b.prototype.fetchSingeJiraServer=function(){var a=e.contextPath()+"/rest/jiraanywhere/1.0/jira/clientIds/";a=d.ajax({type:"POST",url:a,data:this.clientIds,
contentType:"application/json",cache:!0});a.clientIds=this.clientIds;return a};b.prototype.startJobWithRetry=function(){return f(this.startJob,{name:this.clientIds,delays:this.TICK_RETRIES,context:this,tester:function(a,g,c){return c&&c.status===this.RETRY_HTTP_CODE}})};return b});
}catch(e){WRMCB(e)};