WRMCB=function(e){var c=console;if(c&&c.log&&c.error){c.log('Error running batched script.');c.error(e);}}
;
try {
/* module-key = 'com.atlassian.jira.jira-header-plugin:newsletter-signup-tip', location = 'static/components/newsletter/NewsletterSignup.soy' */
// This file was automatically generated from NewsletterSignup.soy.
// Please don't edit this file by hand.

/**
 * @fileoverview Templates in namespace JIRA.Templates.
 */

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


JIRA.Templates.newsletterSignupTip = function(opt_data, opt_ignored) {
  return '<div><p>' + soy.$$escapeHtml(opt_data.description) + '</p>' + aui.form.form({action: '#', isTopLabels: true, extraClasses: 'insiders-signup-form', content: '' + aui.form.textField({id: 'jira-newsletter-user-email', placeholderText: '' + soy.$$escapeHtml('\u0410\u0434\u0440\u0435\u0441 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0439 \u043f\u043e\u0447\u0442\u044b'), value: opt_data.userEmail}) + aui.form.fieldGroup({content: '' + aui.form.select({id: 'jira-newsletter-role', options: opt_data.roles})}) + aui.form.textField({id: 'jira-newsletter-other-role-name', placeholderText: '' + soy.$$escapeHtml('\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, King of the North'), extraClasses: 'hidden'}) + aui.form.fieldGroup({content: '' + aui.form.field({id: 'jira-newsletter-opt-in', type: 'checkbox', isChecked: false, extraClasses: 'jira-newsletter-opt-in', labelContent: '' + soy.$$filterNoAutoescape('\u0423\u043a\u0430\u0437\u0430\u0432 \u0430\u0434\u0440\u0435\u0441 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0439 \u043f\u043e\u0447\u0442\u044b, \u0432\u044b \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442\u0435 \u043d\u0430\u0448\u0443 \x3ca href\x3d\x22https://www.atlassian.com/legal/privacy-policy\x22 data-track-click\x3d\x22jira.newsletter.signuptip.privacy.link.click\x22\x3e\u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443 \u043a\u043e\u043d\u0444\u0438\u0434\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438\x3c/a\x3e \u0438 \u0441\u043e\u0433\u043b\u0430\u0448\u0430\u0435\u0442\u0435\u0441\u044c \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e Atlassian \u043f\u043e \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0439 \u043f\u043e\u0447\u0442\u0435.')})}) + aui.form.buttons({content: '' + aui.form.submit({type: 'primary', text: '' + soy.$$filterNoAutoescape('\u0417\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f')}) + aui.form.linkButton({text: '' + soy.$$escapeHtml('\u041d\u0435\u0442, \u0441\u043f\u0430\u0441\u0438\u0431\u043e')})})}) + '</div>';
};
if (goog.DEBUG) {
  JIRA.Templates.newsletterSignupTip.soyTemplateName = 'JIRA.Templates.newsletterSignupTip';
}

}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.jira.jira-header-plugin:newsletter-signup-tip', location = 'static/components/newsletter/NewsletterRoles.js' */
define("jira/newsletter/roles",["jira/util/formatter","underscore","exports"],function(e,t,n){"use strict";n.getRoles=function(){var n=[{value:"",text:"\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0441\u0432\u043e\u044e \u0440\u043e\u043b\u044c",disabled:!0,selected:!0}],s=[{value:"software-engineer",text:"\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u041f\u041e"},{value:"product-manager",text:"\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430\u043c\u0438"},{value:"qa",text:"\u041a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430"},{value:"design",text:"\u041f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435"},{value:"management",text:"\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435"},{value:"sys-admin",text:"\u0421\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0435 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435"}],r=[{value:"other",text:"\u0414\u0440\u0443\u0433\u043e\u0435"}];return n.concat(t.shuffle(s)).concat(r)}});
}catch(e){WRMCB(e)};
;
try {
/* module-key = 'com.atlassian.jira.jira-header-plugin:newsletter-signup-tip', location = 'static/components/newsletter/NewsletterSignup.js' */
define("jira/newsletter/signuptip",["jira/analytics","jira/util/formatter","jira/util/data/meta","jira/newsletter/roles","jira-help-tips/feature/help-tip","atlassian/libs/underscore-1.8.3","jquery"],function(e,i,n,t,r,a,s){"use strict";function l(e){return!(e.length>255)&&d.test(e)}function o(e){return a.reduce(e,function(e,i){return(e=(e<<5)-e+i.charCodeAt(0))&e},0)}function u(e){return a.omit(e,a.isUndefined)}var d=/^[a-zA-Z0-9.!#$%'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;return{render:function(e){var i=a.random(1e4);setTimeout(function(){this.doRender(a.extend(e,{signupTipDelay:i}))}.bind(this),i)},doRender:function(a){var d={anchor:"#user-options",isSequence:!1,showCloseButton:!1};d.id=a.signupId,d.title=a.signupTitle,d.bodyHtml=JIRA.Templates.newsletterSignupTip({userEmail:a.userEmail,description:a.signupDescription,roles:t.getRoles()});var p=new r(d);if(!p.isDismissed()){var f=function(){return s("#aui-flag-container").find(".aui-flag").filter("[open]:visible").length};if(f())return void e.send({name:"jira.newsletter.signuptip.notshown",data:{flagsVisible:f(),signupTipDelay:a.signupTipDelay}});p.show(),e.send({name:"jira.newsletter.signuptip.shown"});var g=s("body");g.on("submit","form.aui.insiders-signup-form",function(t){t.preventDefault();var r=s(this);r.find(".error").remove();var d=r.find("#jira-newsletter-user-email"),g=r.find("#jira-newsletter-role"),m=r.find("#jira-newsletter-opt-in"),c=d.val(),w=g.val(),h=m.prop("checked"),j="other"===w?r.find("#jira-newsletter-other-role-name").val().substring(0,100):void 0,v=l(c),T=!0===h;v&&T?(s.ajax({type:"POST",url:i.format(a.formUrl,encodeURI(c)),dataType:"json",contentType:"application/json",data:JSON.stringify({role:w,otherRoleName:j,lang:n.getLanguage()})}).success(function(){e.send({name:"jira.newsletter.signuptip.submitted",data:u({role:w,otherRoleName:j,lang:n.getLanguage(),checksum:o(c.split("@")[0]),flagsVisible:f(),signupTipDelay:a.signupTipDelay})})}).error(function(i){e.send({name:"jira.newsletter.signuptip.error",data:{statusCode:i.status}})}),a.userEmail!==c&&e.send({name:"jira.newsletter.signuptip.email.changed"}),p.dismiss("newslettersubscribed")):(v||(e.send({name:"jira.newsletter.signuptip.email.validationerror",data:{flagsVisible:f()}}),d.after(aui.form.fieldError({message:"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0439 \u043f\u043e\u0447\u0442\u044b."}))),T||(e.send({name:"jira.newsletter.signuptip.opt-in.validationerror",data:{flagsVisible:f()}}),m.parent().after(aui.form.fieldError({message:"\u0421\u043e\u0433\u043b\u0430\u0441\u0438\u0442\u0435\u0441\u044c \u043d\u0430 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435."}))))}),g.on("click","form.aui.insiders-signup-form a.cancel",function(i){i.preventDefault(),e.send({name:"jira.newsletter.signuptip.dismissed",data:{flagsVisible:f(),signupTipDelay:a.signupTipDelay}}),p.dismiss("newslettercancelled")}),g.on("change","form.aui.insiders-signup-form",function(){var e=s(this),i=e.find("#jira-newsletter-role");e.find("#jira-newsletter-other-role-name").parent().closest("div").toggleClass("hidden","other"!==i.val())})}}}});
}catch(e){WRMCB(e)};