!function(t){vare={support:{pjax:window.history&&window.history.pushState&&window.history.replaceState&&!navigator.userAgent.match(/(iPod|iPhone|iPad|WebApps\/.+CFNetwork)/),storage:!!window.localStorage},toInt:function(t){returnparseInt(t)},stack:{},getTime:function(){return1*newDate},getRealUrl:function(t){returnt=(t||"").replace(/\#.*?$/,""),t=t.replace("?pjax=true&","?").replace("?pjax=true","").replace("&pjax=true","")},getUrlHash:function(t){returnt.replace(/^[^\#]*(?:\#(.*?))?$/,"$1")},getLocalKey:function(t){vare="pjax_"+encodeURIComponent(t);return{data:e+"_data",time:e+"_time",title:e+"_title"}},removeAllCache:function(){if(e.support.storage)for(vartinlocalStorage)"pjax"===(t.split("_")||[""])[0]&&deletelocalStorage[t]},getCache:function(t,o,a){varn,l,r;if(o=e.toInt(o),tine.stack){if(n=e.stack[t],ctime=e.getTime(),n.time+1e3*o>ctime)returnn;deletee.stack[t]}elseif(a&&e.support.storage){vari=e.getLocalKey(t);if(l=i.data,r=i.time,n=localStorage.getItem(l)){if(e.toInt(localStorage.getItem(r))+1e3*o>e.getTime())return{data:n,title:localStorage.getItem(i.title)};localStorage.removeItem(l),localStorage.removeItem(r),localStorage.removeItem(i.title)}}returnnull},setCache:function(t,o,a,n){varl,r=e.getTime();e.stack[t]={data:o,title:a,time:r},n&&e.support.storage&&(l=e.getLocalKey(t),localStorage.setItem(l.data,o),localStorage.setItem(l.time,r),localStorage.setItem(l.title,a))},removeCache:function(t){if(t=e.getRealUrl(t||location.href),deletee.stack[t],e.support.storage){varo=e.getLocalKey(t);localStorage.removeItem(o.data),localStorage.removeItem(o.time),localStorage.removeItem(o.title)}}},o=function(a){if(a=t.extend({selector:"",container:"",callback:function(){},filter:function(){}},a),!a.container||!a.selector)thrownewError("selector & container options must be set");t("body").delegate(a.selector,"click",function(n){if(n.which>1||n.metaKey)return!0;varl=t(this),r=l.attr("href");if("function"==typeofa.filter&&!0===a.filter.call(this,r,this))return!0;if(r===location.href)return!0;if(e.getRealUrl(r)==e.getRealUrl(location.href)){vari=e.getUrlHash(r);returni&&(location.hash=i,a.callback&&a.callback.call(this,{type:"hash"})),!0}n.preventDefault(),a=t.extend(!0,a,{url:r,element:this,push:!0}),o.request(a)})};o.xhr=null,o.options={},o.state={},o.defaultOptions={timeout:2e3,element:null,cache:86400,storage:!0,url:"",push:!0,show:"",title:"",titleSuffix:"",type:"GET",data:{pjax:!0},dataType:"html",callback:null,beforeSend:function(e){t(o.options.container).trigger("pjax.start",[e,o.options]),e&&e.setRequestHeader("X-PJAX",!0)&&e.setRequestHeader("X-PJAX-Container",o.options.container)},error:function(){o.options.callback&&o.options.callback.call(o.options.element,{type:"error"}),location.href=o.options.url},complete:function(e){t(o.options.container).trigger("pjax.end",[e,o.options])}},o.showFx={_default:function(t,e,o){this.html(t),e&&e.call(this,t,o)},fade:function(t,e,o){vara=this;o?(a.html(t),e&&e.call(a,t,o)):this.fadeOut(200,function(){a.html(t).fadeIn(200,function(){e&&e.call(a,t,o)})})}},o.showFn=function(e,a,n,l,r){vari=null;"function"==typeofe?i=e:(eino.showFx||(e="_default"),i=o.showFx[e]),i&&i.call(a,n,function(){vare=location.hash;""!=e?(location.href=e,/Firefox/.test(navigator.userAgent)&&history.replaceState(t.extend({},o.state,{url:null}),document.title)):location.search.length>1&&window.scrollTo(0,0),l&&l.call(this,n,r)},r)},o.success=function(a,n){if(!0!==n&&(n=!1),o.html&&(a=t(a).find(o.html).html()),-1!=(a||"").indexOf("<html"))returno.options.callback&&o.options.callback.call(o.options.element,{type:"error"}),location.href=o.options.url,!1;varl=t(o.options.element).attr("pjax-title");if(!l){if(""==(l=o.options.title||"")&&o.options.element){varr=t(o.options.element);l=r.attr("title")||r.text()}vari=a.match(/<title>(.*?)<\/title>/);i&&(l=i[1])}l&&-1==l.indexOf(o.options.titleSuffix)&&(l+=o.options.titleSuffix),document.title=l,o.state={container:o.options.container,timeout:o.options.timeout,cache:o.options.cache,storage:o.options.storage,show:o.options.show,title:l,url:o.options.oldUrl};varc=t.param(o.options.data);""!=c&&(o.state.url=o.options.url+(/\?/.test(o.options.url)?"&":"?")+c),o.options.push?(o.active||(history.replaceState(t.extend({},o.state,{url:null}),document.title),o.active=!0),history.pushState(o.state,document.title,o.options.oldUrl)):!1===o.options.push&&history.replaceState(o.state,document.title,o.options.oldUrl),o.options.showFn&&o.options.showFn(a,function(){o.options.callback&&o.options.callback.call(o.options.element,{type:n?"cache":"success"})},n),o.options.cache&&!n&&e.setCache(o.options.url,a,l,o.options.storage)},o.request=function(a){a.hasOwnProperty("data")&&(o.defaultOptions.data=a.data),a=t.extend(!0,o.defaultOptions,a);varn,l=t(a.container);if(a.oldUrl=a.url,a.url=e.getRealUrl(a.url),t(a.element).length&&(n=e.toInt(t(a.element).attr("data-pjax-cache")))&&(a.cache=n),!0===a.cache&&(a.cache=86400),a.cache=e.toInt(a.cache),0===a.cache&&e.removeAllCache(),a.showFn||(a.showFn=function(t,e,n){o.showFn(a.show,l,t,e,n)}),o.options=a,o.options.success=o.success,a.cache&&(n=e.getCache(a.url,a.cache,a.storage)))returna.beforeSend(),a.title=n.title,o.success(n.data,!0),a.complete(),!0;o.xhr&&o.xhr.readyState<4&&(o.xhr.onreadystatechange=t.noop,o.xhr.abort()),o.xhr=t.ajax(o.options)};vara="state"inwindow.history,n=location.href;t(window).bind("popstate",function(e){varl=!a&&location.href==n;if(a=!0,!l){varr=e.state;if(r&&r.container)if(t(r.container).length){vari={url:r.url,container:r.container,push:null,timeout:r.timeout,cache:r.cache,storage:r.storage,title:r.title,element:null};o.request(i)}elsewindow.location=location.href}}),e.support.pjax||(o=function(){return!0},o.request=function(t){t&&t.url&&(location.href=t.url)}),t.pjax=o,t.pjax.util=e,"state"int.Event.prototype||t.event.addProp("state")}(jQuery);