!function(e,t,u){var i,o=[],n=e.locoConf,s=e.locoScope,a=0,r=n.paths.length-2,d=t.getElementById("loco-ui"),l=t.getElementById("loco-fs"),f=d.getElementsByTagName("form").item(0),c=d.getElementsByTagName("button"),m=u(d).find("div.diff-meta"),p=c.item(0),g=c.item(1);function h(){return u(d).removeClass("loading")}function v(e){return u(d).find("div.diff").html(e)}function C(e){return h(),u('<p class="error"></p>').text(e).appendTo(v(""))}function y(e,t){var n,a=t.getElementsByTagName("tr"),r=a.length,i=t.getAttribute("data-diff").split(/\D+/),o=i[0],s=i[1],d=i[2],l=i[3];function f(e,t,n){t<=n&&u("<span></span>").text(String(t)).prependTo(e)}for(e=0;e<r;e++)f((n=a[e].getElementsByTagName("td"))[0],o++,s),f(n[2],d++,l)}function j(a){i&&i.abort();var r=o[a];if(null!=r)return v(r),void h();v(""),u(d).addClass("loading"),i=s.ajax.post("diff",{lhs:n.paths[a],rhs:n.paths[a+1]},function(e,t,n){n===i&&((r=e&&e.html)?(v(o[a]=r).find("tbody").each(y),h()):C(e&&e.error||"Unknown error"))},function(e,t,n){e===i&&(i=null,C("Failed to generate diff"))})}function b(e){0<=e&&e<=r&&(j(a=e),function(){var e=a,t=e+1;p.disabled=r<=e,g.disabled=e<=0,m.addClass("jshide").removeClass("diff-meta-current"),m.eq(e).removeClass("jshide").addClass("diff-meta-current"),m.eq(t).removeClass("jshide")}())}l&&f&&s.fs.init(l).setForm(f),r&&(u(p).click(function(e){return e.preventDefault(),b(a+1),!1}).parent().removeClass("jshide"),u(g).click(function(e){return e.preventDefault(),b(a-1),!1}).parent().removeClass("jshide")),b(0)}(window,document,jQuery);