1/** 2 * Place all off our per-app plugins in here 3 */ 4!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(t=t||self).barba=n()}(this,function(){function t(t,n){for(var r=0;r<n.length;r++){var e=n[r];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,e.key,e)}}function n(n,r,e){return r&&t(n.prototype,r),e&&t(n,e),n}function r(){return(r=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e])}return t}).apply(this,arguments)}function e(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n}function i(t){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function o(t,n){return(o=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function u(t,n,r){return(u=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}()?Reflect.construct:function(t,n,r){var e=[null];e.push.apply(e,n);var i=new(Function.bind.apply(t,e));return r&&o(i,r.prototype),i}).apply(null,arguments)}function f(t){var n="function"==typeof Map?new Map:void 0;return(f=function(t){if(null===t||-1===Function.toString.call(t).indexOf("[native code]"))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(t))return n.get(t);n.set(t,r)}function r(){return u(t,arguments,i(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),o(r,t)})(t)}function s(t,n){try{var r=t()}catch(t){return n(t)}return r&&r.then?r.then(void 0,n):r}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));var c,a="2.8.0",h=function(){};!function(t){t[t.off=0]="off",t[t.error=1]="error",t[t.warning=2]="warning",t[t.info=3]="info",t[t.debug=4]="debug"}(c||(c={}));var v=c.off,l=function(){function t(t){this.t=t}t.getLevel=function(){return v},t.setLevel=function(t){return v=c[t]};var n=t.prototype;return n.error=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];this.i(console.error,c.error,n)},n.warn=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];this.i(console.warn,c.warning,n)},n.info=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];this.i(console.info,c.info,n)},n.debug=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];this.i(console.log,c.debug,n)},n.i=function(n,r,e){r<=t.getLevel()&&n.apply(console,["["+this.t+"] "].concat(e))},t}(),d=function t(n,r,e){return n instanceof RegExp?function(t,n){if(!n)return t;var r=t.source.match(/\((?!\?)/g);if(r)for(var e=0;e<r.length;e++)n.push({name:e,prefix:null,delimiter:null,optional:!1,repeat:!1,pattern:null});return t}(n,r):Array.isArray(n)?function(n,r,e){for(var i=[],o=0;o<n.length;o++)i.push(t(n[o],r,e).source);return new RegExp("(?:"+i.join("|")+")",k(e))}(n,r,e):function(t,n,r){return A(P(t,r),n,r)}(n,r,e)},m=P,w=g,p=A,b="/",y=new RegExp(["(\\\\.)","(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?"].join("|"),"g");function P(t,n){for(var r,e=[],i=0,o=0,u="",f=n&&n.delimiter||b,s=n&&n.whitelist||void 0,c=!1;null!==(r=y.exec(t));){var a=r[0],h=r[1],v=r.index;if(u+=t.slice(o,v),o=v+a.length,h)u+=h[1],c=!0;else{var l="",d=r[2],m=r[3],w=r[4],p=r[5];if(!c&&u.length){var P=u.length-1,g=u[P];(!s||s.indexOf(g)>-1)&&(l=g,u=u.slice(0,P))}u&&(e.push(u),u="",c=!1);var k=m||w,A=l||f;e.push({name:d||i++,prefix:l,delimiter:A,optional:"?"===p||"*"===p,repeat:"+"===p||"*"===p,pattern:k?x(k):"[^"+E(A===f?A:A+f)+"]+?"})}}return(u||o<t.length)&&e.push(u+t.substr(o)),e}function g(t){for(var n=new Array(t.length),r=0;r<t.length;r++)"object"==typeof t[r]&&(n[r]=new RegExp("^(?:"+t[r].pattern+")$"));return function(r,e){for(var i="",o=e&&e.encode||encodeURIComponent,u=0;u<t.length;u++){var f=t[u];if("string"!=typeof f){var s,c=r?r[f.name]:void 0;
4if(Array.isArray(c)){if(!f.repeat)throw new TypeError('Expected "'+f.name+'" to not repeat, but got array');if(0===c.length){if(f.optional)continue;throw new TypeError('Expected "'+f.name+'" to not be empty')}for(var a=0;a<c.length;a++){if(s=o(c[a],f),!n[u].test(s))throw new TypeError('Expected all "'+f.name+'" to match "'+f.pattern+'"');i+=(0===a?f.prefix:f.delimiter)+s}}else if("string"!=typeof c&&"number"!=typeof c&&"boolean"!=typeof c){if(!f.optional)throw new TypeError('Expected "'+f.name+'" to be '+(f.repeat?"an array":"a string"))}else{if(s=o(String(c),f),!n[u].test(s))throw new TypeError('Expected "'+f.name+'" to match "'+f.pattern+'", but got "'+s+'"');i+=f.prefix+s}}else i+=f}return i}}function E(t){return t.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function x(t){return t.replace(/([=!:$\/()])/g,"\\$1")}function k(t){return t&&t.sensitive?"":"i"}function A(t,n,r){for(var e=(r=r||{}).strict,i=!1!==r.start,o=!1!==r.end,u=r.delimiter||b,f=[].concat(r.endsWith||[]).map(E).concat("$").join("|"),s=i?"^":"",c=0;c<t.length;c++){var a=t[c];if("string"==typeof a)s+=E(a);else{var h=a.repeat?"(?:"+a.pattern+")(?:"+E(a.delimiter)+"(?:"+a.pattern+"))*":a.pattern;n&&n.push(a),s+=a.optional?a.prefix?"(?:"+E(a.prefix)+"("+h+"))?":"("+h+")?":E(a.prefix)+"("+h+")"}}if(o)e||(s+="(?:"+E(u)+")?"),s+="$"===f?"$":"(?="+f+")";else{var v=t[t.length-1],l="string"==typeof v?v[v.length-1]===u:void 0===v;e||(s+="(?:"+E(u)+"(?="+f+"))?"),l||(s+="(?="+E(u)+"|"+f+")")}return new RegExp(s,k(r))}d.parse=m,d.compile=function(t,n){return g(P(t,n))},d.tokensToFunction=w,d.tokensToRegExp=p;var R={container:"container",namespace:"namespace",prefix:"data-barba",prevent:"prevent",wrapper:"wrapper"},O=new(function(){function t(){this.o=R,this.u=new DOMParser}var n=t.prototype;return n.toString=function(t){return t.outerHTML},n.toDocument=function(t){return this.u.parseFromString(t,"text/html")},n.toElement=function(t){var n=document.createElement("div");return n.innerHTML=t,n},n.getHtml=function(t){return void 0===t&&(t=document),this.toString(t.documentElement)},n.getWrapper=function(t){return void 0===t&&(t=document),t.querySelector("["+this.o.prefix+'="'+this.o.wrapper+'"]')},n.getContainer=function(t){return void 0===t&&(t=document),t.querySelector("["+this.o.prefix+'="'+this.o.container+'"]')},n.removeContainer=function(t){document.body.contains(t)&&t.parentNode.removeChild(t)},n.addContainer=function(t,n){var r=this.getContainer();r?this.s(t,r):n.appendChild(t)},n.getNamespace=function(t){void 0===t&&(t=document);var n=t.querySelector("["+this.o.prefix+"-"+this.o.namespace+"]");return n?n.getAttribute(this.o.prefix+"-"+this.o.namespace):null},n.getHref=function(t){if(t.tagName&&"a"===t.tagName.toLowerCase()){if("string"==typeof t.href)return t.href;var n=t.getAttribute("href")||t.getAttribute("xlink:href");if(n)return this.resolveUrl(n.baseVal||n)}return null},n.resolveUrl=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var e=n.length;if(0===e)throw new Error("resolveUrl requires at least one argument; got none.");var i=document.createElement("base");if(i.href=arguments[0],1===e)return i.href;var o=document.getElementsByTagName("head")[0];o.insertBefore(i,o.firstChild);for(var u,f=document.createElement("a"),s=1;s<e;s++)f.href=arguments[s],i.href=u=f.href;return o.removeChild(i),u},n.s=function(t,n){n.parentNode.insertBefore(t,n.nextSibling)},t}()),T=new(function(){function t(){this.h=[]}var e=t.prototype;return e.init=function(t,n){var r={index:0,ns:n,scroll:{x:window.scrollX,y:window.scrollY},url:t};this.h.push(r),window.history&&window.history.replaceState(r,"",r.url)},e.add=function(t,n,r,e){void 0===r&&(r=null),void 0===e&&(e=!0);var i={index:r||this.size,ns:n,scroll:{x:window.scrollX,y:window.scrollY},url:t};this.h.push(i),e&&window.history&&window.history.pushState(i,"",i.url)},e.remove=function(){this.h.pop()},e.clear=function(){this.h=[]},e.update=function(t){var n=r({},this.current,{},t);this.current=n,window.history&&window.history.replaceState(n,"",n.url)},e.cancel=function(){this.remove(),window.history&&window.history.back()},e.get=function(t){return this.h[t]},e.getDirection=function(t){var n="popstate";return t<this.current.index?n="back":t>this.current.index&&(n="forward"),n},n(t,[{key:"current",get:function(){return this.h[this.h.length-1]},set:function(t){this.h[this.h.length-1]=t}},{key:"previous",get:function(){return this.h.length<2?null:this.h[this.h.length-2]}},{key:"size",get:function(){return this.h.length}}]),t}()),S=function(t,n){try{var r=function(){if(!n.next.html)return Promise.resolve(t).then(function(t){var r=n.next;if(t){var e=O.toElement(t);r.namespace=O.getNamespace(e),r.container=O.getContainer(e),r.html=t,T.update({ns:r.namespace});var i=O.toDocument(t);document.title=i.title}})}();return Promise.resolve(r&&r.then?r.then(function(){}):void 0)}catch(t){return Promise.reject(t)}},j=d,M={update:S,nextTick:function(){return new Promise(function(t){window.requestAnimationFrame(t)})},pathToRegexp:j},L=function(){return window.location.origin},$=function(t){return void 0===t&&(t=window.location.href),q(t).port},q=function(t){var n,r=t.match(/:\d+/);if(null===r)/^http/.test(t)&&(n=80),/^https/.test(t)&&(n=443);else{var e=r[0].substring(1);n=parseInt(e,10)}var i,o=t.replace(L(),""),u={},f=o.indexOf("#");f>=0&&(i=o.slice(f+1),o=o.slice(0,f));var s=o.indexOf("?");return s>=0&&(u=B(o.slice(s+1)),o=o.slice(0,s)),{hash:i,path:o,port:n,query:u}},B=function(t){return t.split("&").reduce(function(t,n){var r=n.split("=");return t[r[0]]=r[1],t},{})},D=function(t){return void 0===t&&(t=window.location.href),t.replace(/(\/#.*|\/|#.*)$/,"")},H={getHref:function(){return window.location.href},getOrigin:L,getPort:$,getPath:function(t){return void 0===t&&(t=window.location.href),q(t).path},parse:q,parseQuery:B,clean:D};function U(t,n,r){return void 0===n&&(n=2e3),new Promise(function(e,i){var o=new XMLHttpRequest;o.onreadystatechange=function(){if(o.readyState===XMLHttpRequest.DONE)if(200===o.status)e(o.responseText);else if(o.status){var n={status:o.status,statusText:o.statusText};r(t,n),i(n)}},o.ontimeout=function(){var e=new Error("Timeout error ["+n+"]");r(t,e),i(e)},o.onerror=function(){var n=new Error("Fetch error");r(t,n),i(n)},o.open("GET",t),o.timeout=n,o.setRequestHeader("Accept","text/html,application/xhtml+xml,application/xml"),o.setRequestHeader("x-barba","yes"),o.send()})}var F=function(t){return!!t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof t.then};function I(t,n){return void 0===n&&(n={}),function(){for(var r=arguments.length,e=new Array(r),i=0;i<r;i++)e[i]=arguments[i];var o=!1,u=new Promise(function(r,i){n.async=function(){return o=!0,function(t,n){t?i(t):r(n)}};var u=t.apply(n,e);o||(F(u)?u.then(r,i):r(u))});return u}}var N=new(function(t){function n(){var n;return(n=t.call(this)||this).logger=new l("@barba/core"),n.all=["ready","page","reset","currentAdded","currentRemoved","nextAdded","nextRemoved","beforeOnce","once","afterOnce","before","beforeLeave","leave","afterLeave","beforeEnter","enter","afterEnter","after"],n.registered=new Map,n.init(),n}e(n,t);var r=n.prototype;return r.init=function(){var t=this;this.registered.clear(),this.all.forEach(function(n){t[n]||(t[n]=function(r,e){void 0===e&&(e={}),t.registered.has(n)||t.registered.set(n,new Set),t.registered.get(n).add({ctx:e,fn:r})})})},r.do=function(t){for(var n=this,r=arguments.length,e=new Array(r>1?r-1:0),i=1;i<r;i++)e[i-1]=arguments[i];if(this.registered.has(t)){var o=Promise.resolve();return this.registered.get(t).forEach(function(t){o=o.then(function(){return I(t.fn,t.ctx).apply(void 0,e)})}
vendor: 8,077 bytes, line 4
4),o.catch(function(r){n.logger.debug("Hook error ["+t+"]"),n.logger.error(r)})}return Promise.resolve()},r.clear=function(){var t=this;this.all.forEach(function(n){delete t[n]}),this.init()},r.help=function(){this.logger.info("Available hooks: "+this.all.join(","));var t=[];this.registered.forEach(function(n,r){return t.push(r)}),this.logger.info("Registered hooks: "+t.join(","))},n}(h)),C=function(){function t(t){if(this.v=[],"boolean"==typeof t)this.l=t;else{var n=Array.isArray(t)?t:[t];this.v=n.map(function(t){return j(t)})}}return t.prototype.checkHref=function(t){if("boolean"==typeof this.l)return this.l;var n=q(t).path;return this.v.some(function(t){return null!==t.exec(n)})},t}(),X=function(t){function n(n){var r;return(r=t.call(this,n)||this).h=new Map,r}e(n,t);var i=n.prototype;return i.set=function(t,n,r){return this.checkHref(t)||this.h.set(t,{action:r,request:n}),{action:r,request:n}},i.get=function(t){return this.h.get(t)},i.getRequest=function(t){return this.h.get(t).request},i.getAction=function(t){return this.h.get(t).action},i.has=function(t){return this.h.has(t)},i.delete=function(t){return this.h.delete(t)},i.update=function(t,n){var e=r({},this.h.get(t),{},n);return this.h.set(t,e),e},n}(C),z=function(){return!window.history.pushState},G=function(t){return!t.el||!t.href},Q=function(t){var n=t.event;return n.which>1||n.metaKey||n.ctrlKey||n.shiftKey||n.altKey},W=function(t){var n=t.el;return n.hasAttribute("target")&&"_blank"===n.target},_=function(t){var n=t.el;return void 0!==n.protocol&&window.location.protocol!==n.protocol||void 0!==n.hostname&&window.location.hostname!==n.hostname},J=function(t){var n=t.el;return void 0!==n.port&&$()!==$(n.href)},K=function(t){var n=t.el;return n.getAttribute&&"string"==typeof n.getAttribute("download")},V=function(t){return t.el.hasAttribute(R.prefix+"-"+R.prevent)},Y=function(t){return Boolean(t.el.closest("["+R.prefix+"-"+R.prevent+'="all"]'))},Z=function(t){var n=t.href;return D(n)===D()&&$(n)===$()},tt=function(t){function n(n){var r;return(r=t.call(this,n)||this).suite=[],r.tests=new Map,r.init(),r}e(n,t);var r=n.prototype;return r.init=function(){this.add("pushState",z),this.add("exists",G),this.add("newTab",Q),this.add("blank",W),this.add("corsDomain",_),this.add("corsPort",J),this.add("download",K),this.add("preventSelf",V),this.add("preventAll",Y),this.add("sameUrl",Z,!1)},r.add=function(t,n,r){void 0===r&&(r=!0),this.tests.set(t,n),r&&this.suite.push(t)},r.run=function(t,n,r,e){return this.tests.get(t)({el:n,event:r,href:e})},r.checkLink=function(t,n,r){var e=this;return this.suite.some(function(i){return e.run(i,t,n,r)})},n}(C),nt=function(t){function n(r,e){var i;void 0===e&&(e="Barba error");for(var o=arguments.length,u=new Array(o>2?o-2:0),f=2;f<o;f++)u[f-2]=arguments[f];return(i=t.call.apply(t,[this].concat(u))||this).error=r,i.label=e,Error.captureStackTrace&&Error.captureStackTrace(function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(i),n),i.name="BarbaError",i}return e(n,t),n}(f(Error)),rt=function(){function t(t){void 0===t&&(t=[]),this.logger=new l("@barba/core"),this.all=[],this.once=[],this.m=[{name:"namespace",type:"strings"},{name:"custom",type:"function"}],t&&(this.all=this.all.concat(t)),this.update()}var n=t.prototype;return n.add=function(t,n){switch(t){case"rule":this.m.splice(n.position||0,0,n.value);break;case"transition":default:this.all.push(n)}this.update()},n.resolve=function(t,n){var r=this;void 0===n&&(n={});var e=n.once?this.once:this.all;e=e.filter(n.self?function(t){return t.name&&"self"===t.name}:function(t){return!t.name||"self"!==t.name});var i=new Map,o=e.find(function(e){var o=!0,u={};return!(!n.self||"self"!==e.name)||(r.m.reverse().forEach(function(n){o&&(o=r.p(e,n,t,u),e.from&&e.to&&(o=r.p(e,n,t,u,"from")&&r.p(e,n,t,u,"to")),e.from&&!e.to&&(o=r.p(e,n,t,u,"from")),!e.from&&e.to&&(o=r.p(e,n,t,u,"to")))}),i.set(e,u),o)}),u=i.get(o),f=[];if(f.push(n.once?"once":"page"),n.self&&f.push("self"),u){var s,c=[o];Object.keys(u).length>0&&c.push(u),(s=this.logger).info.apply(s,["Transition found ["+f.join(",")+"]"].concat(c))}else this.logger.info("No transition found ["+f.join(",")+"]");return o},n.update=function(){var t=this;this.all=this.all.map(function(n){return t.P(n)}).sort(function(t,n){return t.priority-n.priority}).reverse().map(function(t){return delete t.priority,t}),this.once=this.all.filter(function(t){return void 0!==t.once})},n.p=function(t,n,r,e,i){var o=!0,u=!1,f=t,s=n.name,c=s,a=s,h=s,v=i?f[i]:f,l="to"===i?r.next:r.current;if(i?v&&v[s]:v[s]){switch(n.type){case"strings":default:var d=Array.isArray(v[c])?v[c]:[v[c]];l[c]&&-1!==d.indexOf(l[c])&&(u=!0),-1===d.indexOf(l[c])&&(o=!1);break;case"object":var m=Array.isArray(v[a])?v[a]:[v[a]];l[a]&&(l[a].name&&-1!==m.indexOf(l[a].name)&&(u=!0),-1===m.indexOf(l[a].name)&&(o=!1));break;case"function":v[h](r)?u=!0:o=!1}u&&(i?(e[i]=e[i]||{},e[i][s]=f[i][s]):e[s]=f[s])}return o},n.g=function(t,n,r){var e=0;return(t[n]||t.from&&t.from[n]||t.to&&t.to[n])&&(e+=Math.pow(10,r),t.from&&t.from[n]&&(e+=1),t.to&&t.to[n]&&(e+=2)),e},n.P=function(t){var n=this;t.priority=0;var r=0;return this.m.forEach(function(e,i){r+=n.g(t,e.name,i+1)}),t.priority=r,t},t}(),et=function(){function t(t){void 0===t&&(t=[]),this.logger=new l("@barba/core"),this.k=!1,this.store=new rt(t)}var r=t.prototype;return r.get=function(t,n){return this.store.resolve(t,n)},r.doOnce=function(t){var n=t.data,r=t.transition;try{var e=function(){i.k=!1},i=this,o=r||{};i.k=!0;var u=s(function(){return Promise.resolve(i.A("beforeOnce",n,o)).then(function(){return Promise.resolve(i.once(n,o)).then(function(){return Promise.resolve(i.A("afterOnce",n,o)).then(function(){})})})},function(t){i.k=!1,i.logger.debug("Transition error [before/after/once]"),i.logger.error(t)});return Promise.resolve(u&&u.then?u.then(e):e())}catch(t){return Promise.reject(t)}},r.doPage=function(t){var n=t.data,r=t.transition,e=t.page,i=t.wrapper;try{var o=function(t){if(u)return t;f.k=!1},u=!1,f=this,c=r||{},a=!0===c.sync||!1;f.k=!0;var h=s(function(){function t(){return Promise.resolve(f.A("before",n,c)).then(function(){var t=!1;function r(r){return t?r:Promise.resolve(f.remove(n)).then(function(){return Promise.resolve(f.A("after",n,c)).then(function(){})})}var o=function(){if(a)return s(function(){return Promise.resolve(f.add(n,i)).then(function(){return Promise.resolve(f.A("beforeLeave",n,c)).then(function(){return Promise.resolve(f.A("beforeEnter",n,c)).then(function(){return Promise.resolve(Promise.all([f.leave(n,c),f.enter(n,c)])).then(function(){return Promise.resolve(f.A("afterLeave",n,c)).then(function(){return Promise.resolve(f.A("afterEnter",n,c)).then(function(){})})})})})})},function(t){throw new nt(t,"Transition error [sync]")});var r=function(r){return t?r:s(function(){var t=function(){if(!1!==o)return Promise.resolve(f.add(n,i)).then(function(){return Promise.resolve(f.A("beforeEnter",n,c)).then(function(){return Promise.resolve(f.enter(n,c,o)).then(function(){return Promise.resolve(f.A("afterEnter",n,c)).then(function(){})})})})}();if(t&&t.then)return t.then(function(){})},function(t){throw new nt(t,"Transition error [before/after/enter]")})},o=!1,u=s(function(){return Promise.resolve(f.A("beforeLeave",n,c)).then(function(){return Promise.resolve(Promise.all([f.leave(n,c),S(e,n)]).then(function(t){return t[0]})).then(function(t){return o=t,Promise.resolve(f.A("afterLeave",n,c)).then(function(){})})})},function(t){throw new nt(t,"Transition error [before/after/leave]")});return u&&u.then?u.then(r):r(u)}();return o&&o.then?o.then(r):r(o)})}var r=function(){if(a)return Promise.resolve(S(e,n)).then(function(){})}();return r&&r.then?r.then(t):t()},function(t){if(f.k=!1,t.name&&"BarbaError"===t.name)throw f.logger.debug(t.label),f.logger.error(t.error),t;throw f.logger.debug("Transition error [page]"),f.logger.error(t),t});return Promise.resolve(h&&h.then?h.then(o):o(h))}catch(t){return Promise.reject(t)}},r.once=function(t,n){try{return Promise.resolve(N.do("once",t,n
4)).then(function(){return n.once?I(n.once,n)(t):Promise.resolve()})}catch(t){return Promise.reject(t)}},r.leave=function(t,n){try{return Promise.resolve(N.do("leave",t,n)).then(function(){return n.leave?I(n.leave,n)(t):Promise.resolve()})}catch(t){return Promise.reject(t)}},r.enter=function(t,n,r){try{return Promise.resolve(N.do("enter",t,n)).then(function(){return n.enter?I(n.enter,n)(t,r):Promise.resolve()})}catch(t){return Promise.reject(t)}},r.add=function(t,n){try{return O.addContainer(t.next.container,n),N.do("nextAdded",t),Promise.resolve()}catch(t){return Promise.reject(t)}},r.remove=function(t){try{return O.removeContainer(t.current.container),N.do("currentRemoved",t),Promise.resolve()}catch(t){return Promise.reject(t)}},r.A=function(t,n,r){try{return Promise.resolve(N.do(t,n,r)).then(function(){return r[t]?I(r[t],r)(n):Promise.resolve()})}catch(t){return Promise.reject(t)}},n(t,[{key:"isRunning",get:function(){return this.k},set:function(t){this.k=t}},{key:"hasOnce",get:function(){return this.store.once.length>0}},{key:"hasSelf",get:function(){return this.store.all.some(function(t){return"self"===t.name})}},{key:"shouldWait",get:function(){return this.store.all.some(function(t){return t.to&&!t.to.route||t.sync})}}]),t}(),it=function(){function t(t){var n=this;this.names=["beforeLeave","afterLeave","beforeEnter","afterEnter"],this.byNamespace=new Map,0!==t.length&&(t.forEach(function(t){n.byNamespace.set(t.namespace,t)}),this.names.forEach(function(t){N[t](n.R(t))}))}return t.prototype.R=function(t){var n=this;return function(r){var e=t.match(/enter/i)?r.next:r.current,i=n.byNamespace.get(e.namespace);return i&&i[t]?I(i[t],i)(r):Promise.resolve()}},t}();Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(t){var n=this;do{if(n.matches(t))return n;n=n.parentElement||n.parentNode}while(null!==n&&1===n.nodeType);return null});var ot={container:void 0,html:void 0,namespace:void 0,url:{hash:void 0,href:void 0,path:void 0,port:void 0,query:{}}};return new(function(){function t(){this.version=a,this.schemaPage=ot,this.Logger=l,this.logger=new l("@barba/core"),this.plugins=[],this.hooks=N,this.dom=O,this.helpers=M,this.history=T,this.request=U,this.url=H}var e=t.prototype;return e.use=function(t,n){var r=this.plugins;r.indexOf(t)>-1?this.logger.warn("Plugin ["+t.name+"] already installed."):"function"==typeof t.install?(t.install(this,n),r.push(t)):this.logger.warn("Plugin ["+t.name+'] has no "install" method.')},e.init=function(t){var n=void 0===t?{}:t,e=n.transitions,i=void 0===e?[]:e,o=n.views,u=void 0===o?[]:o,f=n.schema,s=void 0===f?R:f,c=n.requestError,a=n.timeout,h=void 0===a?2e3:a,v=n.cacheIgnore,d=void 0!==v&&v,m=n.prefetchIgnore,w=void 0!==m&&m,p=n.preventRunning,b=void 0!==p&&p,y=n.prevent,P=void 0===y?null:y,g=n.debug,E=n.logLevel;if(l.setLevel(!0===(void 0!==g&&g)?"debug":void 0===E?"off":E),this.logger.info(this.version),Object.keys(s).forEach(function(t){R[t]&&(R[t]=s[t])}),this.O=c,this.timeout=h,this.cacheIgnore=d,this.prefetchIgnore=w,this.preventRunning=b,this.T=this.dom.getWrapper(),!this.T)throw new Error("[@barba/core] No Barba wrapper found");this.T.setAttribute("aria-live","polite"),this.S();var x=this.data.current;if(!x.container)throw new Error("[@barba/core] No Barba container found");if(this.cache=new X(d),this.prevent=new tt(w),this.transitions=new et(i),this.views=new it(u),null!==P){if("function"!=typeof P)throw new Error("[@barba/core] Prevent should be a function");this.prevent.add("preventCustom",P)}this.history.init(x.url.href,x.namespace),this.j=this.j.bind(this),this.M=this.M.bind(this),this.L=this.L.bind(this),this.$(),this.plugins.forEach(function(t){return t.init()});var k=this.data;k.trigger="barba",k.next=k.current,k.current=r({},this.schemaPage),this.hooks.do("ready",k),this.once(k),this.S()},e.destroy=function(){this.S(),this.q(),this.history.clear(),this.hooks.clear(),this.plugins=[]},e.force=function(t){window.location.assign(t)},e.go=function(t,n,r){var e;if(void 0===n&&(n="barba"),this.transitions.isRunning)this.force(t);else if(!(e="popstate"===n?this.history.current&&this.url.getPath(this.history.current.url)===this.url.getPath(t):this.prevent.run("sameUrl",null,null,t))||this.transitions.hasSelf){if("popstate"===n){var i=r.state;null===i?this.history.add(t,"tmp",null,!1):(n=this.history.getDirection(i.index),this.history.add(t,i.ns,i.index,!1))}else this.history.add(t,"tmp");return r&&(r.stopPropagation(),r.preventDefault()),this.page(t,n,e)}},e.once=function(t){try{var n=this;return Promise.resolve(n.hooks.do("beforeEnter",t)).then(function(){function r(){return Promise.resolve(n.hooks.do("afterEnter",t)).then(function(){})}var e=function(){if(n.transitions.hasOnce){var r=n.transitions.get(t,{once:!0});return Promise.resolve(n.transitions.doOnce({transition:r,data:t})).then(function(){})}}();return e&&e.then?e.then(r):r()})}catch(t){return Promise.reject(t)}},e.page=function(t,n,e){try{var i=function(){var t=o.data;return Promise.resolve(o.hooks.do("page",t)).then(function(){var n=s(function(){var n=o.transitions.get(t,{once:!1,self:e});return Promise.resolve(o.transitions.doPage({data:t,page:u,transition:n,wrapper:o.T})).then(function(){o.S()})},function(){0===l.getLevel()&&o.force(t.current.url.href)});if(n&&n.then)return n.then(function(){})})},o=this;o.data.next.url=r({href:t},o.url.parse(t)),o.data.trigger=n;var u=o.cache.has(t)?o.cache.update(t,{action:"click"}).request:o.cache.set(t,o.request(t,o.timeout,o.onRequestError.bind(o,n)),"click").request,f=function(){if(o.transitions.shouldWait)return Promise.resolve(S(u,o.data)).then(function(){})}();return Promise.resolve(f&&f.then?f.then(i):i())}catch(t){return Promise.reject(t)}},e.onRequestError=function(t){this.transitions.isRunning=!1;for(var n=arguments.length,r=new Array(n>1?n-1:0),e=1;e<n;e++)r[e-1]=arguments[e];var i=r[0],o=r[1],u=this.cache.getAction(i);return this.cache.delete(i),!(this.O&&!1===this.O(t,u,i,o)||("click"===u&&this.force(i),1))},e.prefetch=function(t){var n=this;this.cache.has(t)||this.cache.set(t,this.request(t,this.timeout,this.onRequestError.bind(this,"barba")).catch(function(t){n.logger.error(t)}),"prefetch")},e.$=function(){!0!==this.prefetchIgnore&&(document.addEventListener("mouseover",this.j),document.addEventListener("touchstart",this.j)),document.addEventListener("click",this.M),window.addEventListener("popstate",this.L)},e.q=function(){!0!==this.prefetchIgnore&&(document.removeEventListener("mouseover",this.j),document.removeEventListener("touchstart",this.j)),document.removeEventListener("click",this.M),window.removeEventListener("popstate",this.L)},e.j=function(t){var n=this,r=this.B(t);if(r){var e=this.dom.getHref(r);this.prevent.checkHref(e)||this.cache.has(e)||this.cache.set(e,this.request(e,this.timeout,this.onRequestError.bind(this,r)).catch(function(t){n.logger.error(t)}),"enter")}},e.M=function(t){var n=this.B(t);if(n)return this.transitions.isRunning&&this.preventRunning?(t.preventDefault(),void t.stopPropagation()):void this.go(this.dom.getHref(n),n,t)},e.L=function(t){this.go(this.url.getHref(),"popstate",t)},e.B=function(t){for(var n=t.target;
vendor: 474 bytes, line 4
4n&&!this.dom.getHref(n);)n=n.parentNode;if(n&&!this.prevent.checkLink(n,t,this.dom.getHref(n)))return n},e.S=function(){var t=this.url.getHref(),n={container:this.dom.getContainer(),html:this.dom.getHtml(),namespace:this.dom.getNamespace(),url:r({href:t},this.url.parse(t))};this.D={current:n,next:r({},this.schemaPage),trigger:void 0},this.hooks.do("reset",this.data)},n(t,[{key:"data",get:function(){return this.D}},{key:"wrapper",get:function(){return this.T}}]),t}())});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.