!function(){"use strict";var t=jQuery(document);t.on("contentloaded",function(t){var n=jQuery(t.target),e=n.find("form.settings"),a=e.find("input, select");if(a.length){var i=function(t){return getControlValue(t)!==getControlInitialValue(t)},o=function(){var t=!1;a.each(function(){return!(t=i(jQuery(this)))}),e.toggleClass("changed",t)};a.on("input change",function(t){o()}),o()}}),t.on("button:success",".button",function(t){var n=jQuery(t.target),e=n.text(),a=n.data("successText");n.addClass("successful").prop("disabled",!0).text(a);setTimeout(function(){n.removeClass("successful").prop("disabled",!1).text(e)},3e3)})}(),jQuery.fn.tabs=function(t){var n=$.extend({updateHash:!1,autoRotate:!1,alwaysScrollToTop:!1},t);return $(this).each(function(){function t(t,e){i.find("li.active").removeClass("active").find("a").attr("tabindex","-1"),t.attr("tabindex","0").parent().addClass("active"),o.find("> div.active").attr("aria-hidden",!0).removeClass("active"),$(t.attr("href")+r).addClass("active").attr("aria-hidden",!1),n.updateHash&&(location.hash=t.attr("href"))}function e(n){var e=n||window.location.hash,a=i.find('a[href="#'+e.replace("#","")+'"]');return a.length>0?t(a,!0):t(i.find("a:first"),!0),!!a.length}var a=$(this),i=a.find("ul:first"),o=$(i.find("a:eq(0)").attr("href")).parent(),r="-enhanced";if(i.addClass("tabs-nav").attr("role","tablist"),o.addClass("tabs-body"),o.find(">div").each(function(){$(this).addClass("tabs-panel").attr("role","tabpanel").attr("aria-hidden",!0).attr("aria-labelledby","tab-"+$(this).attr("id")).attr("id",$(this).attr("id")+r)}),i.find("li").each(function(){$(this).attr("role","tab").attr("id","tab-"+$(this).find("a").attr("href").split("#")[1])}),i.find("a").attr("tabindex","-1"),i.find("a").click(function(n){t($(this)),n.preventDefault()}).keydown(function(n){var e=$(this).parent(),a=!0;switch(n.keyCode){case 37:case 38:e.prev().length>0&&(t(e.prev().find("a")),e.prev().find("a").eq(0).focus(),a=!1);break;case 39:case 40:e.next().length>0&&(t(e.next().find("a")),e.next().find("a").eq(0).focus(),a=!1);break;case 36:t(i.find("li:first a")),i.find("li:first a").eq(0).focus(),a=!1;break;case 35:t(i.find("li:last a")),i.find("li:last a").eq(0).focus(),a=!1}return a}),a.bind("click keydown focus",function(){n.autoRotate&&clearInterval(s)}),e(null),n.updateHash&&$(window).bind("hashchange",function(){e(location.hash)}),n.autoRotate)var s=setInterval(function(){var n=i.find("li.active"),e=n.next();e.length?t(e.find("a"),!1):t(i.find("a:first"),!1)},n.autoRotate);n.alwaysScrollToTop&&$(window)[0].scrollTo(0,0)})},function(){"use strict";var t=jQuery(document);t.on("contentloaded",function(t){jQuery(t.target).find(".data-types").tabs()}),t.on("contentloaded",function(n){var e=jQuery(n.target),a=e.find(".panel").first();if(a.length){var i,o,r,s,d,c,f=a.find(".action .button"),l=function(){i=a.offset(),o={top:parseInt(a.css("padding-top")),right:parseInt(a.css("padding-right")),bottom:parseInt(a.css("padding-bottom")),left:parseInt(a.css("padding-left"))},r=i.top+o.top+o.bottom+f.outerHeight(),s=i.top+a.outerHeight(),d=jQuery(window).width(),c=jQuery(window).height()},u=function(){var t=jQuery(window).scrollTop()+c,n=t>=r&&t<s,e=d-(i.left+a.outerWidth())+o.right;f.toggleClass("sticky",n),f.css("right",n?e:"")},h=function(){if(jQuery(window).off("scroll",u),/^compact$/.test(t.data("layout")))return void f.removeClass("sticky").css("right","");l(),u(),jQuery(window).on("scroll",u)};t.on("resizeend",h),h()}}),t.on("contentloaded",function(n){var e=jQuery(n.target),a=e.find("form.settings"),i=a.find('.panel .button[type="submit"]');if(i.length){var o=function(){i.trigger("button:success")};i.on("click",function(n){n.preventDefault(),t.trigger("dialog:open",{source:".dialog.warning"}),o()})}}),t.on("contentloaded",function(t){var n=jQuery(t.target),e=n.find(".field.priority input");e.length<2||e.on("click",function(t){var n=jQuery(this);this.checked?e.not(n).prop("checked",!1):t.preventDefault()})})}();