!function(t){try{var e=t(".qr-modal"),n=t(".plan-modal"),o=t(".deletion-confirmation-modal"),a=t(".delete-totp-modal"),i=t(".logout-modal"),l=t(".downgrade-modal"),d=t(".wizard-modal"),c=t(".reload-warning-modal"),s=t(".credit-card-modal"),r=t(".error-modal"),u=t(".remove-config-modal"),f=t(".disable-totp-modal"),p=t(".disable-phone-modal"),m=t(".js-close-modal"),h=t(".js-open-qr-modal"),v=t(".js-open-plan-modal"),b=t(".js-plan-redirect"),j=t(".js-confirm"),g=t(".js-close-cc-complete"),D=t(".js-open-logout-modal"),y=t(".js-open-reload-warning-modal"),k=t(".js-open-downgrade-modal"),w=t(".js-open-credit-card-modal"),C=t(".js-open-deletion-confirmation-modal"),q=t(".js-open-delete-totp-modal"),x=t(".js-open-remove-config-modal"),z=t(".js-open-disable-totp-modal"),E=t(".js-open-disable-phone-modal"),Q=".modal-backdrop",S=!1,A=null;function B(e){e.css({display:"table"}).animate({opacity:1},500),S=!0}function F(e){e.animate({opacity:0},250,function(){t(this).css({display:""}),e.children().css({display:""}),S=!1})}function G(e){if(S){var n=t(".modal");if(!n.is(e.target)&&0===n.has(e.target).length)F(n.parents().find(Q))}}h.click(function(){B(e)}),v.click(function(){t(".update-card-before").removeClass("hidden"),t(".update-card-after").addClass("hidden"),B(n)}),b.click(function(){t(".update-card-before").addClass("hidden"),t(".update-card-after").removeClass("hidden")}),x.click(function(e){e.preventDefault(),B(u)}),g.click(function(e){!function(e){e.preventDefault(),location.reload()}(e)}),j.click(function(e){e.preventDefault(),A.trigger("submit")}),z.submit(function(e){S||(A=t(this),e.preventDefault(),B(f))}),E.submit(function(e){S||(A=t(this),e.preventDefault(),B(p))}),C.submit(function(e){S||(A=t(this),e.preventDefault(),B(o))}),q.submit(function(e){S||(A=t(this),e.preventDefault(),B(a))}),D.submit(function(e){S||(A=t(this),e.preventDefault(),B(i))}),y.submit(function(e){e.preventDefault(),B(c)}),c.on("close",function(){F(c)}),r.on("display",function(){B(r)}),d.length&&B(d),k.submit(function(e){S||(A=t(this),e.preventDefault(),B(l))}),w.submit(function(e){e.preventDefault(),B(s)}),m.click(function(e){e.preventDefault(),F(t(this).parents().find(Q))}),t(document).keyup(function(e){27===e.keyCode&&G(e)}),t(document).mouseup(function(e){S&&G(e)})}catch(e){Sentry.captureException(e)}}(jQuery);