!function(t,n,c){var i,e,a,l,o,r,u,s=t.loco,f=n.getElementById("loco-fs"),d=n.getElementById("loco-poinit"),v=f&&s.fs.init(f),g=(a=(e=d)["select-locale"],l=e["custom-locale"],o=e["use-selector"],r=c(a).focus(p).closest("fieldset").click(p)[0],u=c(l).focus(x).closest("fieldset").click(x)[0],c(o).change(m),m(),s.watchtext(l,function(t){c(l.form).triggerHandler("change")}),{val:function(){var t=b();return t?s.locale.parse(t):s.locale.clone({lang:"zxx"})}});function h(){return o[0].checked}function p(){y(o[0].checked=!0)}function x(){l.value||(l.value=b()),y(!(o[1].checked=!0))}function b(){var t=c(h()?a:l).serializeArray();return t[0]&&t[0].value||""}function m(){return y(h()),!0}function y(t){l.disabled=t,a.disabled=!t,u.className=t?"disabled":"active",r.className=t?"active":"disabled",I()}var z,A=(z=d["select-path"],{val:function(){var t=k("path");return t&&t.value},txt:function(){var t=k("path");return t&&c(t.parentNode).find("code.path").text()}});function k(t){var n=function(){var t=c(z).serializeArray()[0];return t&&t.value||null}();return n&&d[t+"["+n+"]"]}function w(e){c(d).find("button.button-primary").each(function(t,n){n.disabled=e})}function I(){var t=g&&g.val(),n=t&&t.isValid()&&"zxx"!==t.lang,e=A&&A.val(),a=n&&e;if(j(t),w(!0),a){var c=A.txt();c!==i?(i=c,f.path.value=i,v.listen(N).connect()):w(!1)}}function N(t){w(!t)}function j(e){var t=c(d),n=e&&e.toString("_")||"",a=n?"zxx"===n?"<locale>":n:"<invalid>";t.find("code.path span").each(function(t,n){n.textContent=a}),t.find("span.lang").each(function(t,n){!function(t,n){n&&"zxx"!==n.lang?(t.setAttribute("lang",n.lang),t.setAttribute("class",n.getIcon())):(t.setAttribute("lang",""),t.setAttribute("class","lang nolang"))}(n,e)})}function B(t){var n=t&&t.redirect;n&&location.assign(n)}c(d).change(I).submit(function(t){return t.preventDefault(),v.applyCreds(d),s.ajax.submit(t.target,B),!1}),j(g.val())}(window,document,jQuery);