Socket
Socket
Sign inDemoInstall

history

Package Overview
Dependencies
2
Maintainers
1
Versions
101
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.1.0 to 5.2.0

13

browser.js

@@ -1,7 +0,8 @@

function p(){p=Object.assign||function(b){for(var e=1;e<arguments.length;e++){var f=arguments[e],m;for(m in f)Object.prototype.hasOwnProperty.call(f,m)&&(b[m]=f[m])}return b};return p.apply(this,arguments)}var u,x=u||(u={});x.Pop="POP";x.Push="PUSH";x.Replace="REPLACE";var A="production"!==process.env.NODE_ENV?function(b){return Object.freeze(b)}:function(b){return b};function B(b,e){if(!b){"undefined"!==typeof console&&console.warn(e);try{throw Error(e);}catch(f){}}}
function C(b){b.preventDefault();b.returnValue=""}function G(){var b=[];return{get length(){return b.length},push:function(e){b.push(e);return function(){b=b.filter(function(f){return f!==e})}},call:function(e){b.forEach(function(f){return f&&f(e)})}}}
var H=function(b){function e(){var a=q.location,c=r.state||{};return[c.idx,A({pathname:a.pathname,search:a.search,hash:a.hash,state:c.usr||null,key:c.key||"default"})]}function f(a){if("string"===typeof a)var c=a;else{c=a.pathname;var h=a.search;a=a.hash;c=(void 0===c?"/":c)+(void 0===h?"":h)+(void 0===a?"":a)}return c}function m(a,c){void 0===c&&(c=null);var h=p,k={pathname:v.pathname,hash:"",search:""};if("string"===typeof a){var d={};if(a){var g=a.indexOf("#");0<=g&&(d.hash=a.substr(g),a=a.substr(0,
g));g=a.indexOf("?");0<=g&&(d.search=a.substr(g),a=a.substr(0,g));a&&(d.pathname=a)}a=d}return A(h(k,a,{state:c,key:Math.random().toString(36).substr(2,8)}))}function y(a){z=a;a=e();n=a[0];v=a[1];D.call({action:z,location:v})}function E(a,c){function h(){E(a,c)}var k=u.Push,d=m(a,c);if(!l.length||(l.call({action:k,location:d,retry:h}),!1)){var g=[{usr:d.state,key:d.key,idx:n+1},f(d)];d=g[0];g=g[1];try{r.pushState(d,"",g)}catch(I){q.location.assign(g)}y(k)}}function F(a,c){function h(){F(a,c)}var k=
u.Replace,d=m(a,c);l.length&&(l.call({action:k,location:d,retry:h}),1)||(d=[{usr:d.state,key:d.key,idx:n},f(d)],r.replaceState(d[0],"",d[1]),y(k))}function t(a){r.go(a)}void 0===b&&(b={});b=b.window;var q=void 0===b?document.defaultView:b,r=q.history,w=null;q.addEventListener("popstate",function(){if(w)l.call(w),w=null;else{var a=u.Pop,c=e(),h=c[0];c=c[1];if(l.length)if(null!=h){var k=n-h;k&&(w={action:a,location:c,retry:function(){t(-1*k)}},t(k))}else"production"!==process.env.NODE_ENV?B(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation."):
void 0;else y(a)}});var z=u.Pop;b=e();var n=b[0],v=b[1],D=G(),l=G();null==n&&(n=0,r.replaceState(p({},r.state,{idx:n}),""));return{get action(){return z},get location(){return v},createHref:f,push:E,replace:F,go:t,back:function(){t(-1)},forward:function(){t(1)},listen:function(a){return D.push(a)},block:function(a){var c=l.push(a);1===l.length&&q.addEventListener("beforeunload",C);return function(){c();l.length||q.removeEventListener("beforeunload",C)}}}}();export default H
function p(){p=Object.assign||function(c){for(var f=1;f<arguments.length;f++){var g=arguments[f],m;for(m in g)Object.prototype.hasOwnProperty.call(g,m)&&(c[m]=g[m])}return c};return p.apply(this,arguments)}var u,x=u||(u={});x.Pop="POP";x.Push="PUSH";x.Replace="REPLACE";var A="production"!==process.env.NODE_ENV?function(c){return Object.freeze(c)}:function(c){return c};function B(c,f){if(!c){"undefined"!==typeof console&&console.warn(f);try{throw Error(f);}catch(g){}}}
function C(c){c.preventDefault();c.returnValue=""}function G(){var c=[];return{get length(){return c.length},push:function(f){c.push(f);return function(){c=c.filter(function(g){return g!==f})}},call:function(f){c.forEach(function(g){return g&&g(f)})}}}
var H=function(c){function f(){var a=q.location,b=r.state||{};return[b.idx,A({pathname:a.pathname,search:a.search,hash:a.hash,state:b.usr||null,key:b.key||"default"})]}function g(a){if("string"===typeof a)var b=a;else{b=a.pathname;b=void 0===b?"/":b;var e=a.search;e=void 0===e?"":e;a=a.hash;a=void 0===a?"":a;e&&"?"!==e&&(b+="?"===e.charAt(0)?e:"?"+e);a&&"#"!==a&&(b+="#"===a.charAt(0)?a:"#"+a)}return b}function m(a,b){void 0===b&&(b=null);var e=p,k={pathname:v.pathname,hash:"",search:""};if("string"===
typeof a){var d={};if(a){var h=a.indexOf("#");0<=h&&(d.hash=a.substr(h),a=a.substr(0,h));h=a.indexOf("?");0<=h&&(d.search=a.substr(h),a=a.substr(0,h));a&&(d.pathname=a)}a=d}return A(e(k,a,{state:b,key:Math.random().toString(36).substr(2,8)}))}function y(a){z=a;a=f();n=a[0];v=a[1];D.call({action:z,location:v})}function E(a,b){function e(){E(a,b)}var k=u.Push,d=m(a,b);if(!l.length||(l.call({action:k,location:d,retry:e}),!1)){var h=[{usr:d.state,key:d.key,idx:n+1},g(d)];d=h[0];h=h[1];try{r.pushState(d,
"",h)}catch(I){q.location.assign(h)}y(k)}}function F(a,b){function e(){F(a,b)}var k=u.Replace,d=m(a,b);l.length&&(l.call({action:k,location:d,retry:e}),1)||(d=[{usr:d.state,key:d.key,idx:n},g(d)],r.replaceState(d[0],"",d[1]),y(k))}function t(a){r.go(a)}void 0===c&&(c={});c=c.window;var q=void 0===c?document.defaultView:c,r=q.history,w=null;q.addEventListener("popstate",function(){if(w)l.call(w),w=null;else{var a=u.Pop,b=f(),e=b[0];b=b[1];if(l.length)if(null!=e){var k=n-e;k&&(w={action:a,location:b,
retry:function(){t(-1*k)}},t(k))}else"production"!==process.env.NODE_ENV?B(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation."):void 0;else y(a)}});var z=u.Pop;c=f();var n=c[0],v=c[1],D=G(),l=G();null==n&&(n=0,r.replaceState(p({},r.state,{idx:n}),""));return{get action(){return z},
get location(){return v},createHref:g,push:E,replace:F,go:t,back:function(){t(-1)},forward:function(){t(1)},listen:function(a){return D.push(a)},block:function(a){var b=l.push(a);1===l.length&&q.addEventListener("beforeunload",C);return function(){b();l.length||q.removeEventListener("beforeunload",C)}}}}();export default H
//# sourceMappingURL=browser.js.map

@@ -1,9 +0,9 @@

function p(){p=Object.assign||function(a){for(var d=1;d<arguments.length;d++){var e=arguments[d],l;for(l in e)Object.prototype.hasOwnProperty.call(e,l)&&(a[l]=e[l])}return a};return p.apply(this,arguments)}var v,x=v||(v={});x.Pop="POP";x.Push="PUSH";x.Replace="REPLACE";var y="production"!==process.env.NODE_ENV?function(a){return Object.freeze(a)}:function(a){return a};function z(a,d){if(!a){"undefined"!==typeof console&&console.warn(d);try{throw Error(d);}catch(e){}}}
function C(a){a.preventDefault();a.returnValue=""}function D(){var a=[];return{get length(){return a.length},push:function(d){a.push(d);return function(){a=a.filter(function(e){return e!==d})}},call:function(d){a.forEach(function(e){return e&&e(d)})}}}function E(a){var d=a.pathname,e=a.search;a=a.hash;return(void 0===d?"/":d)+(void 0===e?"":e)+(void 0===a?"":a)}
function F(a){var d={};if(a){var e=a.indexOf("#");0<=e&&(d.hash=a.substr(e),a=a.substr(0,e));e=a.indexOf("?");0<=e&&(d.search=a.substr(e),a=a.substr(0,e));a&&(d.pathname=a)}return d}
var K=function(a){function d(){var b=F(m.location.hash.substr(1)),c=b.pathname,g=b.search;b=b.hash;var h=q.state||{};return[h.idx,y({pathname:void 0===c?"/":c,search:void 0===g?"":g,hash:void 0===b?"":b,state:h.usr||null,key:h.key||"default"})]}function e(){if(w)k.call(w),w=null;else{var b=v.Pop,c=d(),g=c[0];c=c[1];if(k.length)if(null!=g){var h=n-g;h&&(w={action:b,location:c,retry:function(){r(-1*h)}},r(h))}else"production"!==process.env.NODE_ENV?z(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation."):
void 0;else A(b)}}function l(b){var c=document.querySelector("base"),g="";c&&c.getAttribute("href")&&(c=m.location.href,g=c.indexOf("#"),g=-1===g?c:c.slice(0,g));return g+"#"+("string"===typeof b?b:E(b))}function G(b,c){void 0===c&&(c=null);return y(p({pathname:t.pathname,hash:"",search:""},"string"===typeof b?F(b):b,{state:c,key:Math.random().toString(36).substr(2,8)}))}function A(b){B=b;b=d();n=b[0];t=b[1];H.call({action:B,location:t})}function I(b,c){function g(){I(b,c)}var h=v.Push,f=G(b,c);"production"!==
process.env.NODE_ENV?z("/"===f.pathname.charAt(0),"Relative pathnames are not supported in hash history.push("+JSON.stringify(b)+")"):void 0;if(!k.length||(k.call({action:h,location:f,retry:g}),!1)){var u=[{usr:f.state,key:f.key,idx:n+1},l(f)];f=u[0];u=u[1];try{q.pushState(f,"",u)}catch(L){m.location.assign(u)}A(h)}}function J(b,c){function g(){J(b,c)}var h=v.Replace,f=G(b,c);"production"!==process.env.NODE_ENV?z("/"===f.pathname.charAt(0),"Relative pathnames are not supported in hash history.replace("+
JSON.stringify(b)+")"):void 0;k.length&&(k.call({action:h,location:f,retry:g}),1)||(f=[{usr:f.state,key:f.key,idx:n},l(f)],q.replaceState(f[0],"",f[1]),A(h))}function r(b){q.go(b)}void 0===a&&(a={});a=a.window;var m=void 0===a?document.defaultView:a,q=m.history,w=null;m.addEventListener("popstate",e);m.addEventListener("hashchange",function(){var b=d()[1];E(b)!==E(t)&&e()});var B=v.Pop;a=d();var n=a[0],t=a[1],H=D(),k=D();null==n&&(n=0,q.replaceState(p({},q.state,{idx:n}),""));return{get action(){return B},
get location(){return t},createHref:l,push:I,replace:J,go:r,back:function(){r(-1)},forward:function(){r(1)},listen:function(b){return H.push(b)},block:function(b){var c=k.push(b);1===k.length&&m.addEventListener("beforeunload",C);return function(){c();k.length||m.removeEventListener("beforeunload",C)}}}}();export default K
function p(){p=Object.assign||function(a){for(var d=1;d<arguments.length;d++){var c=arguments[d],l;for(l in c)Object.prototype.hasOwnProperty.call(c,l)&&(a[l]=c[l])}return a};return p.apply(this,arguments)}var v,x=v||(v={});x.Pop="POP";x.Push="PUSH";x.Replace="REPLACE";var y="production"!==process.env.NODE_ENV?function(a){return Object.freeze(a)}:function(a){return a};function z(a,d){if(!a){"undefined"!==typeof console&&console.warn(d);try{throw Error(d);}catch(c){}}}
function C(a){a.preventDefault();a.returnValue=""}function D(){var a=[];return{get length(){return a.length},push:function(d){a.push(d);return function(){a=a.filter(function(c){return c!==d})}},call:function(d){a.forEach(function(c){return c&&c(d)})}}}function E(a){var d=a.pathname;d=void 0===d?"/":d;var c=a.search;c=void 0===c?"":c;a=a.hash;a=void 0===a?"":a;c&&"?"!==c&&(d+="?"===c.charAt(0)?c:"?"+c);a&&"#"!==a&&(d+="#"===a.charAt(0)?a:"#"+a);return d}
function F(a){var d={};if(a){var c=a.indexOf("#");0<=c&&(d.hash=a.substr(c),a=a.substr(0,c));c=a.indexOf("?");0<=c&&(d.search=a.substr(c),a=a.substr(0,c));a&&(d.pathname=a)}return d}
var K=function(a){function d(){var b=F(m.location.hash.substr(1)),e=b.pathname,g=b.search;b=b.hash;var h=q.state||{};return[h.idx,y({pathname:void 0===e?"/":e,search:void 0===g?"":g,hash:void 0===b?"":b,state:h.usr||null,key:h.key||"default"})]}function c(){if(w)k.call(w),w=null;else{var b=v.Pop,e=d(),g=e[0];e=e[1];if(k.length)if(null!=g){var h=n-g;h&&(w={action:b,location:e,retry:function(){r(-1*h)}},r(h))}else"production"!==process.env.NODE_ENV?z(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation."):
void 0;else A(b)}}function l(b){var e=document.querySelector("base"),g="";e&&e.getAttribute("href")&&(e=m.location.href,g=e.indexOf("#"),g=-1===g?e:e.slice(0,g));return g+"#"+("string"===typeof b?b:E(b))}function G(b,e){void 0===e&&(e=null);return y(p({pathname:t.pathname,hash:"",search:""},"string"===typeof b?F(b):b,{state:e,key:Math.random().toString(36).substr(2,8)}))}function A(b){B=b;b=d();n=b[0];t=b[1];H.call({action:B,location:t})}function I(b,e){function g(){I(b,e)}var h=v.Push,f=G(b,e);"production"!==
process.env.NODE_ENV?z("/"===f.pathname.charAt(0),"Relative pathnames are not supported in hash history.push("+JSON.stringify(b)+")"):void 0;if(!k.length||(k.call({action:h,location:f,retry:g}),!1)){var u=[{usr:f.state,key:f.key,idx:n+1},l(f)];f=u[0];u=u[1];try{q.pushState(f,"",u)}catch(L){m.location.assign(u)}A(h)}}function J(b,e){function g(){J(b,e)}var h=v.Replace,f=G(b,e);"production"!==process.env.NODE_ENV?z("/"===f.pathname.charAt(0),"Relative pathnames are not supported in hash history.replace("+
JSON.stringify(b)+")"):void 0;k.length&&(k.call({action:h,location:f,retry:g}),1)||(f=[{usr:f.state,key:f.key,idx:n},l(f)],q.replaceState(f[0],"",f[1]),A(h))}function r(b){q.go(b)}void 0===a&&(a={});a=a.window;var m=void 0===a?document.defaultView:a,q=m.history,w=null;m.addEventListener("popstate",c);m.addEventListener("hashchange",function(){var b=d()[1];E(b)!==E(t)&&c()});var B=v.Pop;a=d();var n=a[0],t=a[1],H=D(),k=D();null==n&&(n=0,q.replaceState(p({},q.state,{idx:n}),""));return{get action(){return B},
get location(){return t},createHref:l,push:I,replace:J,go:r,back:function(){r(-1)},forward:function(){r(1)},listen:function(b){return H.push(b)},block:function(b){var e=k.push(b);1===k.length&&m.addEventListener("beforeunload",C);return function(){e();k.length||m.removeEventListener("beforeunload",C)}}}}();export default K
//# sourceMappingURL=hash.js.map

@@ -1,16 +0,16 @@

var p,C=p||(p={});C.Pop="POP";C.Push="PUSH";C.Replace="REPLACE";function D(e,g){if(!e){"undefined"!==typeof console&&console.warn(g);try{throw Error(g);}catch(h){}}}function E(e){e.preventDefault();e.returnValue=""}function F(){let e=[];return{get length(){return e.length},push(g){e.push(g);return function(){e=e.filter(h=>h!==g)}},call(g){e.forEach(h=>h&&h(g))}}}function H(){return Math.random().toString(36).substr(2,8)}
function I({pathname:e="/",search:g="",hash:h=""}){return e+g+h}function J(e){let g={};if(e){var h=e.indexOf("#");0<=h&&(g.hash=e.substr(h),e=e.substr(0,h));h=e.indexOf("?");0<=h&&(g.search=e.substr(h),e=e.substr(0,h));e&&(g.pathname=e)}return g}
function createBrowserHistory(e={}){function g(){let {pathname:b,search:a,hash:d}=q.location,f=k.state||{};return[f.idx,Object.freeze({pathname:b,search:a,hash:d,state:f.usr||null,key:f.key||"default"})]}function h(b){return"string"===typeof b?b:I(b)}function w(b,a=null){return Object.freeze(Object.assign(Object.assign({pathname:r.pathname,hash:"",search:""},"string"===typeof b?J(b):b),{state:a,key:H()}))}function z(b){u=b;[n,r]=g();v.call({action:u,location:r})}function A(b,a){function d(){A(b,
a)}let f=p.Push,l=w(b,a);if(!c.length||(c.call({action:f,location:l,retry:d}),!1)){let [t,B]=[{usr:l.state,key:l.key,idx:n+1},h(l)];try{k.pushState(t,"",B)}catch(G){q.location.assign(B)}z(f)}}function x(b,a){function d(){x(b,a)}let f=p.Replace,l=w(b,a);if(!c.length||(c.call({action:f,location:l,retry:d}),!1)){let [t,B]=[{usr:l.state,key:l.key,idx:n},h(l)];k.replaceState(t,"",B);z(f)}}function y(b){k.go(b)}let {window:q=document.defaultView}=e,k=q.history,m=null;q.addEventListener("popstate",function(){if(m)c.call(m),
m=null;else{let b=p.Pop,[a,d]=g();if(c.length)if(null!=a){let f=n-a;f&&(m={action:b,location:d,retry(){y(-1*f)}},y(f))}else D(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation.");else z(b)}});let u=p.Pop,[n,r]=g(),v=F(),c=F();null==n&&(n=0,k.replaceState(Object.assign(Object.assign({},
k.state),{idx:n}),""));return{get action(){return u},get location(){return r},createHref:h,push:A,replace:x,go:y,back(){y(-1)},forward(){y(1)},listen(b){return v.push(b)},block(b){let a=c.push(b);1===c.length&&q.addEventListener("beforeunload",E);return function(){a();c.length||q.removeEventListener("beforeunload",E)}}}};
function createHashHistory(e={}){function g(){let {pathname:a="/",search:d="",hash:f=""}=J(k.location.hash.substr(1)),l=m.state||{};return[l.idx,Object.freeze({pathname:a,search:d,hash:f,state:l.usr||null,key:l.key||"default"})]}function h(){if(u)b.call(u),u=null;else{let a=p.Pop,[d,f]=g();if(b.length)if(null!=d){let l=r-d;l&&(u={action:a,location:f,retry(){q(-1*l)}},q(l))}else D(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation.");
else A(a)}}function w(a){var d=document.querySelector("base"),f="";d&&d.getAttribute("href")&&(d=k.location.href,f=d.indexOf("#"),f=-1===f?d:d.slice(0,f));return f+"#"+("string"===typeof a?a:I(a))}function z(a,d=null){return Object.freeze(Object.assign(Object.assign({pathname:v.pathname,hash:"",search:""},"string"===typeof a?J(a):a),{state:d,key:H()}))}function A(a){n=a;[r,v]=g();c.call({action:n,location:v})}function x(a,d){function f(){x(a,d)}let l=p.Push,t=z(a,d);D("/"===t.pathname.charAt(0),`Relative pathnames are not supported in hash history.push(${JSON.stringify(a)})`);
if(!b.length||(b.call({action:l,location:t,retry:f}),!1)){let [B,G]=[{usr:t.state,key:t.key,idx:r+1},w(t)];try{m.pushState(B,"",G)}catch(K){k.location.assign(G)}A(l)}}function y(a,d){function f(){y(a,d)}let l=p.Replace,t=z(a,d);D("/"===t.pathname.charAt(0),`Relative pathnames are not supported in hash history.replace(${JSON.stringify(a)})`);if(!b.length||(b.call({action:l,location:t,retry:f}),!1)){let [B,G]=[{usr:t.state,key:t.key,idx:r},w(t)];m.replaceState(B,"",G);A(l)}}function q(a){m.go(a)}let {window:k=
document.defaultView}=e,m=k.history,u=null;k.addEventListener("popstate",h);k.addEventListener("hashchange",()=>{let [,a]=g();I(a)!==I(v)&&h()});let n=p.Pop,[r,v]=g(),c=F(),b=F();null==r&&(r=0,m.replaceState(Object.assign(Object.assign({},m.state),{idx:r}),""));return{get action(){return n},get location(){return v},createHref:w,push:x,replace:y,go:q,back(){q(-1)},forward(){q(1)},listen(a){return c.push(a)},block(a){let d=b.push(a);1===b.length&&k.addEventListener("beforeunload",E);return function(){d();
var p,C=p||(p={});C.Pop="POP";C.Push="PUSH";C.Replace="REPLACE";function D(e,f){if(!e){"undefined"!==typeof console&&console.warn(f);try{throw Error(f);}catch(g){}}}function E(e){e.preventDefault();e.returnValue=""}function F(){let e=[];return{get length(){return e.length},push(f){e.push(f);return function(){e=e.filter(g=>g!==f)}},call(f){e.forEach(g=>g&&g(f))}}}function H(){return Math.random().toString(36).substr(2,8)}
function I({pathname:e="/",search:f="",hash:g=""}){f&&"?"!==f&&(e+="?"===f.charAt(0)?f:"?"+f);g&&"#"!==g&&(e+="#"===g.charAt(0)?g:"#"+g);return e}function J(e){let f={};if(e){var g=e.indexOf("#");0<=g&&(f.hash=e.substr(g),e=e.substr(0,g));g=e.indexOf("?");0<=g&&(f.search=e.substr(g),e=e.substr(0,g));e&&(f.pathname=e)}return f}
function createBrowserHistory(e={}){function f(){let {pathname:b,search:a,hash:d}=q.location,h=k.state||{};return[h.idx,Object.freeze({pathname:b,search:a,hash:d,state:h.usr||null,key:h.key||"default"})]}function g(b){return"string"===typeof b?b:I(b)}function w(b,a=null){return Object.freeze(Object.assign(Object.assign({pathname:r.pathname,hash:"",search:""},"string"===typeof b?J(b):b),{state:a,key:H()}))}function z(b){u=b;[n,r]=f();v.call({action:u,location:r})}function A(b,a){function d(){A(b,
a)}let h=p.Push,l=w(b,a);if(!c.length||(c.call({action:h,location:l,retry:d}),!1)){let [t,B]=[{usr:l.state,key:l.key,idx:n+1},g(l)];try{k.pushState(t,"",B)}catch(G){q.location.assign(B)}z(h)}}function x(b,a){function d(){x(b,a)}let h=p.Replace,l=w(b,a);if(!c.length||(c.call({action:h,location:l,retry:d}),!1)){let [t,B]=[{usr:l.state,key:l.key,idx:n},g(l)];k.replaceState(t,"",B);z(h)}}function y(b){k.go(b)}let {window:q=document.defaultView}=e,k=q.history,m=null;q.addEventListener("popstate",function(){if(m)c.call(m),
m=null;else{let b=p.Pop,[a,d]=f();if(c.length)if(null!=a){let h=n-a;h&&(m={action:b,location:d,retry(){y(-1*h)}},y(h))}else D(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation.");else z(b)}});let u=p.Pop,[n,r]=f(),v=F(),c=F();null==n&&(n=0,k.replaceState(Object.assign(Object.assign({},
k.state),{idx:n}),""));return{get action(){return u},get location(){return r},createHref:g,push:A,replace:x,go:y,back(){y(-1)},forward(){y(1)},listen(b){return v.push(b)},block(b){let a=c.push(b);1===c.length&&q.addEventListener("beforeunload",E);return function(){a();c.length||q.removeEventListener("beforeunload",E)}}}};
function createHashHistory(e={}){function f(){let {pathname:a="/",search:d="",hash:h=""}=J(k.location.hash.substr(1)),l=m.state||{};return[l.idx,Object.freeze({pathname:a,search:d,hash:h,state:l.usr||null,key:l.key||"default"})]}function g(){if(u)b.call(u),u=null;else{let a=p.Pop,[d,h]=f();if(b.length)if(null!=d){let l=r-d;l&&(u={action:a,location:h,retry(){q(-1*l)}},q(l))}else D(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation.");
else A(a)}}function w(a){var d=document.querySelector("base"),h="";d&&d.getAttribute("href")&&(d=k.location.href,h=d.indexOf("#"),h=-1===h?d:d.slice(0,h));return h+"#"+("string"===typeof a?a:I(a))}function z(a,d=null){return Object.freeze(Object.assign(Object.assign({pathname:v.pathname,hash:"",search:""},"string"===typeof a?J(a):a),{state:d,key:H()}))}function A(a){n=a;[r,v]=f();c.call({action:n,location:v})}function x(a,d){function h(){x(a,d)}let l=p.Push,t=z(a,d);D("/"===t.pathname.charAt(0),`Relative pathnames are not supported in hash history.push(${JSON.stringify(a)})`);
if(!b.length||(b.call({action:l,location:t,retry:h}),!1)){let [B,G]=[{usr:t.state,key:t.key,idx:r+1},w(t)];try{m.pushState(B,"",G)}catch(K){k.location.assign(G)}A(l)}}function y(a,d){function h(){y(a,d)}let l=p.Replace,t=z(a,d);D("/"===t.pathname.charAt(0),`Relative pathnames are not supported in hash history.replace(${JSON.stringify(a)})`);if(!b.length||(b.call({action:l,location:t,retry:h}),!1)){let [B,G]=[{usr:t.state,key:t.key,idx:r},w(t)];m.replaceState(B,"",G);A(l)}}function q(a){m.go(a)}let {window:k=
document.defaultView}=e,m=k.history,u=null;k.addEventListener("popstate",g);k.addEventListener("hashchange",()=>{let [,a]=f();I(a)!==I(v)&&g()});let n=p.Pop,[r,v]=f(),c=F(),b=F();null==r&&(r=0,m.replaceState(Object.assign(Object.assign({},m.state),{idx:r}),""));return{get action(){return n},get location(){return v},createHref:w,push:x,replace:y,go:q,back(){q(-1)},forward(){q(1)},listen(a){return c.push(a)},block(a){let d=b.push(a);1===b.length&&k.addEventListener("beforeunload",E);return function(){d();
b.length||k.removeEventListener("beforeunload",E)}}}};
function createMemoryHistory(e={}){function g(c,b=null){return Object.freeze(Object.assign(Object.assign({pathname:n.pathname,search:"",hash:""},"string"===typeof c?J(c):c),{state:b,key:H()}))}function h(c,b,a){return!v.length||(v.call({action:c,location:b,retry:a}),!1)}function w(c,b){u=c;n=b;r.call({action:u,location:n})}function z(c,b){let a=p.Push,d=g(c,b);D("/"===n.pathname.charAt(0),`Relative pathnames are not supported in memory history.push(${JSON.stringify(c)})`);h(a,d,function(){z(c,
b)})&&(m+=1,k.splice(m,k.length,d),w(a,d))}function A(c,b){let a=p.Replace,d=g(c,b);D("/"===n.pathname.charAt(0),`Relative pathnames are not supported in memory history.replace(${JSON.stringify(c)})`);h(a,d,function(){A(c,b)})&&(k[m]=d,w(a,d))}function x(c){let b=Math.min(Math.max(m+c,0),k.length-1),a=p.Pop,d=k[b];h(a,d,function(){x(c)})&&(m=b,w(a,d))}let {initialEntries:y=["/"],initialIndex:q}=e,k=y.map(c=>{let b=Object.freeze(Object.assign({pathname:"/",search:"",hash:"",state:null,key:H()},"string"===
function createMemoryHistory(e={}){function f(c,b=null){return Object.freeze(Object.assign(Object.assign({pathname:n.pathname,search:"",hash:""},"string"===typeof c?J(c):c),{state:b,key:H()}))}function g(c,b,a){return!v.length||(v.call({action:c,location:b,retry:a}),!1)}function w(c,b){u=c;n=b;r.call({action:u,location:n})}function z(c,b){let a=p.Push,d=f(c,b);D("/"===n.pathname.charAt(0),`Relative pathnames are not supported in memory history.push(${JSON.stringify(c)})`);g(a,d,function(){z(c,
b)})&&(m+=1,k.splice(m,k.length,d),w(a,d))}function A(c,b){let a=p.Replace,d=f(c,b);D("/"===n.pathname.charAt(0),`Relative pathnames are not supported in memory history.replace(${JSON.stringify(c)})`);g(a,d,function(){A(c,b)})&&(k[m]=d,w(a,d))}function x(c){let b=Math.min(Math.max(m+c,0),k.length-1),a=p.Pop,d=k[b];g(a,d,function(){x(c)})&&(m=b,w(a,d))}let {initialEntries:y=["/"],initialIndex:q}=e,k=y.map(c=>{let b=Object.freeze(Object.assign({pathname:"/",search:"",hash:"",state:null,key:H()},"string"===
typeof c?J(c):c));D("/"===b.pathname.charAt(0),`Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: ${JSON.stringify(c)})`);return b}),m=Math.min(Math.max(null==q?k.length-1:q,0),k.length-1),u=p.Pop,n=k[m],r=F(),v=F();return{get index(){return m},get action(){return u},get location(){return n},createHref:function(c){return"string"===typeof c?c:I(c)},push:z,replace:A,go:x,back(){x(-1)},forward(){x(1)},listen(c){return r.push(c)},block(c){return v.push(c)}}};
export{p as Action,createBrowserHistory,createHashHistory,createMemoryHistory,I as createPath,J as parsePath}
//# sourceMappingURL=history.development.js.map

@@ -1,2 +0,2 @@

var t,e=t||(t={});function n(t){t.preventDefault(),t.returnValue=""}function a(){let t=[];return{get length(){return t.length},push:e=>(t.push(e),function(){t=t.filter((t=>t!==e))}),call(e){t.forEach((t=>t&&t(e)))}}}function l(){return Math.random().toString(36).substr(2,8)}function r({pathname:t="/",search:e="",hash:n=""}){return t+e+n}function i(t){let e={};if(t){var n=t.indexOf("#");0<=n&&(e.hash=t.substr(n),t=t.substr(0,n)),0<=(n=t.indexOf("?"))&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}function o(e={}){function o(){let{pathname:t,search:e,hash:n}=f.location,a=p.state||{};return[a.idx,{pathname:t,search:e,hash:n,state:a.usr||null,key:a.key||"default"}]}function c(t){return"string"==typeof t?t:r(t)}function s(t,e=null){return Object.assign(Object.assign({pathname:b.pathname,hash:"",search:""},"string"==typeof t?i(t):t),{state:e,key:l()})}function u(t){d=t,[y,b]=o(),m.call({action:d,location:b})}function h(t){p.go(t)}let{window:f=document.defaultView}=e,p=f.history,g=null;f.addEventListener("popstate",(function(){if(g)k.call(g),g=null;else{let e=t.Pop,[n,a]=o();if(k.length){if(null!=n){let t=y-n;t&&(g={action:e,location:a,retry(){h(-1*t)}},h(t))}}else u(e)}}));let d=t.Pop,[y,b]=o(),m=a(),k=a();return null==y&&(y=0,p.replaceState(Object.assign(Object.assign({},p.state),{idx:y}),"")),{get action(){return d},get location(){return b},createHref:c,push:function e(n,a){let l=t.Push,r=s(n,a);if(!k.length||(k.call({action:l,location:r,retry:function(){e(n,a)}}),0)){let[t,e]=[{usr:r.state,key:r.key,idx:y+1},c(r)];try{p.pushState(t,"",e)}catch(i){f.location.assign(e)}u(l)}},replace:function e(n,a){let l=t.Replace,r=s(n,a);if(!k.length||(k.call({action:l,location:r,retry:function(){e(n,a)}}),0)){let[t,e]=[{usr:r.state,key:r.key,idx:y},c(r)];p.replaceState(t,"",e),u(l)}},go:h,back(){h(-1)},forward(){h(1)},listen:t=>m.push(t),block(t){let e=k.push(t);return 1===k.length&&f.addEventListener("beforeunload",n),function(){e(),k.length||f.removeEventListener("beforeunload",n)}}}}function c(e={}){function o(){let{pathname:t="/",search:e="",hash:n=""}=i(p.location.hash.substr(1)),a=g.state||{};return[a.idx,{pathname:t,search:e,hash:n,state:a.usr||null,key:a.key||"default"}]}function c(){if(d)P.call(d),d=null;else{let e=t.Pop,[n,a]=o();if(P.length){if(null!=n){let t=b-n;t&&(d={action:e,location:a,retry(){f(-1*t)}},f(t))}}else h(e)}}function s(t){var e=document.querySelector("base"),n="";return e&&e.getAttribute("href")&&(n=-1===(n=(e=p.location.href).indexOf("#"))?e:e.slice(0,n)),n+"#"+("string"==typeof t?t:r(t))}function u(t,e=null){return Object.assign(Object.assign({pathname:m.pathname,hash:"",search:""},"string"==typeof t?i(t):t),{state:e,key:l()})}function h(t){y=t,[b,m]=o(),k.call({action:y,location:m})}function f(t){g.go(t)}let{window:p=document.defaultView}=e,g=p.history,d=null;p.addEventListener("popstate",c),p.addEventListener("hashchange",(()=>{let[,t]=o();r(t)!==r(m)&&c()}));let y=t.Pop,[b,m]=o(),k=a(),P=a();return null==b&&(b=0,g.replaceState(Object.assign(Object.assign({},g.state),{idx:b}),"")),{get action(){return y},get location(){return m},createHref:s,push:function e(n,a){let l=t.Push,r=u(n,a);if(!P.length||(P.call({action:l,location:r,retry:function(){e(n,a)}}),0)){let[t,e]=[{usr:r.state,key:r.key,idx:b+1},s(r)];try{g.pushState(t,"",e)}catch(i){p.location.assign(e)}h(l)}},replace:function e(n,a){let l=t.Replace,r=u(n,a);if(!P.length||(P.call({action:l,location:r,retry:function(){e(n,a)}}),0)){let[t,e]=[{usr:r.state,key:r.key,idx:b},s(r)];g.replaceState(t,"",e),h(l)}},go:f,back(){f(-1)},forward(){f(1)},listen:t=>k.push(t),block(t){let e=P.push(t);return 1===P.length&&p.addEventListener("beforeunload",n),function(){e(),P.length||p.removeEventListener("beforeunload",n)}}}}function s(e={}){function n(t,e=null){return Object.assign(Object.assign({pathname:d.pathname,search:"",hash:""},"string"==typeof t?i(t):t),{state:e,key:l()})}function o(t,e,n){return!b.length||(b.call({action:t,location:e,retry:n}),!1)}function c(t,e){g=t,d=e,y.call({action:g,location:d})}function s(e){let n=Math.min(Math.max(p+e,0),f.length-1),a=t.Pop,l=f[n];o(a,l,(function(){s(e)}))&&(p=n,c(a,l))}let{initialEntries:u=["/"],initialIndex:h}=e,f=u.map((t=>Object.assign({pathname:"/",search:"",hash:"",state:null,key:l()},"string"==typeof t?i(t):t))),p=Math.min(Math.max(null==h?f.length-1:h,0),f.length-1),g=t.Pop,d=f[p],y=a(),b=a();return{get index(){return p},get action(){return g},get location(){return d},createHref:function(t){return"string"==typeof t?t:r(t)},push:function e(a,l){let r=t.Push,i=n(a,l);o(r,i,(function(){e(a,l)}))&&(p+=1,f.splice(p,f.length,i),c(r,i))},replace:function e(a,l){let r=t.Replace,i=n(a,l);o(r,i,(function(){e(a,l)}))&&(f[p]=i,c(r,i))},go:s,back(){s(-1)},forward(){s(1)},listen:t=>y.push(t),block:t=>b.push(t)}}e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE";export{t as Action,o as createBrowserHistory,c as createHashHistory,s as createMemoryHistory,r as createPath,i as parsePath};
var t,e=t||(t={});function n(t){t.preventDefault(),t.returnValue=""}function a(){let t=[];return{get length(){return t.length},push:e=>(t.push(e),function(){t=t.filter((t=>t!==e))}),call(e){t.forEach((t=>t&&t(e)))}}}function r(){return Math.random().toString(36).substr(2,8)}function l({pathname:t="/",search:e="",hash:n=""}){return e&&"?"!==e&&(t+="?"===e.charAt(0)?e:"?"+e),n&&"#"!==n&&(t+="#"===n.charAt(0)?n:"#"+n),t}function i(t){let e={};if(t){var n=t.indexOf("#");0<=n&&(e.hash=t.substr(n),t=t.substr(0,n)),0<=(n=t.indexOf("?"))&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}function c(e={}){function c(){let{pathname:t,search:e,hash:n}=f.location,a=p.state||{};return[a.idx,{pathname:t,search:e,hash:n,state:a.usr||null,key:a.key||"default"}]}function o(t){return"string"==typeof t?t:l(t)}function s(t,e=null){return Object.assign(Object.assign({pathname:b.pathname,hash:"",search:""},"string"==typeof t?i(t):t),{state:e,key:r()})}function u(t){d=t,[y,b]=c(),m.call({action:d,location:b})}function h(t){p.go(t)}let{window:f=document.defaultView}=e,p=f.history,g=null;f.addEventListener("popstate",(function(){if(g)k.call(g),g=null;else{let e=t.Pop,[n,a]=c();if(k.length){if(null!=n){let t=y-n;t&&(g={action:e,location:a,retry(){h(-1*t)}},h(t))}}else u(e)}}));let d=t.Pop,[y,b]=c(),m=a(),k=a();return null==y&&(y=0,p.replaceState(Object.assign(Object.assign({},p.state),{idx:y}),"")),{get action(){return d},get location(){return b},createHref:o,push:function e(n,a){let r=t.Push,l=s(n,a);if(!k.length||(k.call({action:r,location:l,retry:function(){e(n,a)}}),0)){let[t,e]=[{usr:l.state,key:l.key,idx:y+1},o(l)];try{p.pushState(t,"",e)}catch(i){f.location.assign(e)}u(r)}},replace:function e(n,a){let r=t.Replace,l=s(n,a);if(!k.length||(k.call({action:r,location:l,retry:function(){e(n,a)}}),0)){let[t,e]=[{usr:l.state,key:l.key,idx:y},o(l)];p.replaceState(t,"",e),u(r)}},go:h,back(){h(-1)},forward(){h(1)},listen:t=>m.push(t),block(t){let e=k.push(t);return 1===k.length&&f.addEventListener("beforeunload",n),function(){e(),k.length||f.removeEventListener("beforeunload",n)}}}}function o(e={}){function c(){let{pathname:t="/",search:e="",hash:n=""}=i(p.location.hash.substr(1)),a=g.state||{};return[a.idx,{pathname:t,search:e,hash:n,state:a.usr||null,key:a.key||"default"}]}function o(){if(d)P.call(d),d=null;else{let e=t.Pop,[n,a]=c();if(P.length){if(null!=n){let t=b-n;t&&(d={action:e,location:a,retry(){f(-1*t)}},f(t))}}else h(e)}}function s(t){var e=document.querySelector("base"),n="";return e&&e.getAttribute("href")&&(n=-1===(n=(e=p.location.href).indexOf("#"))?e:e.slice(0,n)),n+"#"+("string"==typeof t?t:l(t))}function u(t,e=null){return Object.assign(Object.assign({pathname:m.pathname,hash:"",search:""},"string"==typeof t?i(t):t),{state:e,key:r()})}function h(t){y=t,[b,m]=c(),k.call({action:y,location:m})}function f(t){g.go(t)}let{window:p=document.defaultView}=e,g=p.history,d=null;p.addEventListener("popstate",o),p.addEventListener("hashchange",(()=>{let[,t]=c();l(t)!==l(m)&&o()}));let y=t.Pop,[b,m]=c(),k=a(),P=a();return null==b&&(b=0,g.replaceState(Object.assign(Object.assign({},g.state),{idx:b}),"")),{get action(){return y},get location(){return m},createHref:s,push:function e(n,a){let r=t.Push,l=u(n,a);if(!P.length||(P.call({action:r,location:l,retry:function(){e(n,a)}}),0)){let[t,e]=[{usr:l.state,key:l.key,idx:b+1},s(l)];try{g.pushState(t,"",e)}catch(i){p.location.assign(e)}h(r)}},replace:function e(n,a){let r=t.Replace,l=u(n,a);if(!P.length||(P.call({action:r,location:l,retry:function(){e(n,a)}}),0)){let[t,e]=[{usr:l.state,key:l.key,idx:b},s(l)];g.replaceState(t,"",e),h(r)}},go:f,back(){f(-1)},forward(){f(1)},listen:t=>k.push(t),block(t){let e=P.push(t);return 1===P.length&&p.addEventListener("beforeunload",n),function(){e(),P.length||p.removeEventListener("beforeunload",n)}}}}function s(e={}){function n(t,e=null){return Object.assign(Object.assign({pathname:d.pathname,search:"",hash:""},"string"==typeof t?i(t):t),{state:e,key:r()})}function c(t,e,n){return!b.length||(b.call({action:t,location:e,retry:n}),!1)}function o(t,e){g=t,d=e,y.call({action:g,location:d})}function s(e){let n=Math.min(Math.max(p+e,0),f.length-1),a=t.Pop,r=f[n];c(a,r,(function(){s(e)}))&&(p=n,o(a,r))}let{initialEntries:u=["/"],initialIndex:h}=e,f=u.map((t=>Object.assign({pathname:"/",search:"",hash:"",state:null,key:r()},"string"==typeof t?i(t):t))),p=Math.min(Math.max(null==h?f.length-1:h,0),f.length-1),g=t.Pop,d=f[p],y=a(),b=a();return{get index(){return p},get action(){return g},get location(){return d},createHref:function(t){return"string"==typeof t?t:l(t)},push:function e(a,r){let l=t.Push,i=n(a,r);c(l,i,(function(){e(a,r)}))&&(p+=1,f.splice(p,f.length,i),o(l,i))},replace:function e(a,r){let l=t.Replace,i=n(a,r);c(l,i,(function(){e(a,r)}))&&(f[p]=i,o(l,i))},go:s,back(){s(-1)},forward(){s(1)},listen:t=>y.push(t),block:t=>b.push(t)}}e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE";export{t as Action,c as createBrowserHistory,o as createHashHistory,s as createMemoryHistory,l as createPath,i as parsePath};
//# sourceMappingURL=history.production.min.js.map
/**
* Actions represent the type of change to a location value.
*
* @see https://github.com/ReactTraining/history/tree/master/docs/api-reference.md#action
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#action
*/

@@ -30,3 +30,3 @@ export declare enum Action {

*
* @see https://github.com/ReactTraining/history/tree/master/docs/api-reference.md#location.pathname
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#location.pathname
*/

@@ -37,3 +37,3 @@ export declare type Pathname = string;

*
* @see https://github.com/ReactTraining/history/tree/master/docs/api-reference.md#location.search
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#location.search
*/

@@ -44,3 +44,3 @@ export declare type Search = string;

*
* @see https://github.com/ReactTraining/history/tree/master/docs/api-reference.md#location.hash
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#location.hash
*/

@@ -52,5 +52,6 @@ export declare type Hash = string;

*
* @see https://github.com/ReactTraining/history/tree/master/docs/api-reference.md#location.state
* @deprecated
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#location.state
*/
export declare type State = object | null;
export declare type State = unknown;
/**

@@ -60,3 +61,3 @@ * A unique string associated with a location. May be used to safely store

*
* @see https://github.com/ReactTraining/history/tree/master/docs/api-reference.md#location.key
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#location.key
*/

@@ -71,3 +72,3 @@ export declare type Key = string;

*
* @see https://github.com/ReactTraining/history/tree/master/docs/api-reference.md#location.pathname
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#location.pathname
*/

@@ -78,3 +79,3 @@ pathname: Pathname;

*
* @see https://github.com/ReactTraining/history/tree/master/docs/api-reference.md#location.search
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#location.search
*/

@@ -85,3 +86,3 @@ search: Search;

*
* @see https://github.com/ReactTraining/history/tree/master/docs/api-reference.md#location.hash
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#location.hash
*/

@@ -94,3 +95,3 @@ hash: Hash;

*
* @see https://github.com/ReactTraining/history/tree/master/docs/api-reference.md#location
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#location
*/

@@ -101,5 +102,5 @@ export interface Location extends Path {

*
* @see https://github.com/ReactTraining/history/tree/master/docs/api-reference.md#location.state
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#location.state
*/
state: any;
state: unknown;
/**

@@ -111,3 +112,3 @@ * A unique string associated with this location. May be used to safely store

*
* @see https://github.com/ReactTraining/history/tree/master/docs/api-reference.md#location.key
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#location.key
*/

@@ -118,2 +119,4 @@ key: Key;

* A partial Path object that may be missing some properties.
*
* @deprecated
*/

@@ -123,2 +126,4 @@ export declare type PartialPath = Partial<Path>;

* A partial Location object that may be missing some properties.
*
* @deprecated
*/

@@ -166,3 +171,3 @@ export declare type PartialLocation = Partial<Location>;

*/
export declare type To = string | PartialPath;
export declare type To = string | Partial<Path>;
/**

@@ -181,3 +186,3 @@ * A history is an interface to the navigation stack. The history serves as the

*
* @see https://github.com/ReactTraining/history/tree/master/docs/api-reference.md#history.action
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#history.action
*/

@@ -188,3 +193,3 @@ readonly action: Action;

*
* @see https://github.com/ReactTraining/history/tree/master/docs/api-reference.md#history.location
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#history.location
*/

@@ -198,3 +203,3 @@ readonly location: Location;

*
* @see https://github.com/ReactTraining/history/tree/master/docs/api-reference.md#history.createHref
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#history.createHref
*/

@@ -210,3 +215,3 @@ createHref(to: To): string;

*
* @see https://github.com/ReactTraining/history/tree/master/docs/api-reference.md#history.push
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#history.push
*/

@@ -221,3 +226,3 @@ push(to: To, state?: any): void;

*
* @see https://github.com/ReactTraining/history/tree/master/docs/api-reference.md#history.replace
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#history.replace
*/

@@ -231,3 +236,3 @@ replace(to: To, state?: any): void;

*
* @see https://github.com/ReactTraining/history/tree/master/docs/api-reference.md#history.go
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#history.go
*/

@@ -241,3 +246,3 @@ go(delta: number): void;

*
* @see https://github.com/ReactTraining/history/tree/master/docs/api-reference.md#history.back
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#history.back
*/

@@ -248,3 +253,3 @@ back(): void;

*
* @see https://github.com/ReactTraining/history/tree/master/docs/api-reference.md#history.forward
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#history.forward
*/

@@ -259,3 +264,3 @@ forward(): void;

*
* @see https://github.com/ReactTraining/history/tree/master/docs/api-reference.md#history.listen
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#history.listen
*/

@@ -270,3 +275,3 @@ listen(listener: Listener): () => void;

*
* @see https://github.com/ReactTraining/history/tree/master/docs/api-reference.md#history.block
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#history.block
*/

@@ -280,3 +285,3 @@ block(blocker: Blocker): () => void;

*
* @see https://github.com/ReactTraining/history/tree/master/docs/api-reference.md#browserhistory
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#browserhistory
*/

@@ -294,3 +299,3 @@ export interface BrowserHistory extends History {

*
* @see https://github.com/ReactTraining/history/tree/master/docs/api-reference.md#hashhistory
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#hashhistory
*/

@@ -304,6 +309,6 @@ export interface HashHistory extends History {

*
* @see https://github.com/ReactTraining/history/tree/master/docs/api-reference.md#memoryhistory
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#memoryhistory
*/
export interface MemoryHistory extends History {
index: number;
readonly index: number;
}

@@ -318,3 +323,3 @@ export declare type BrowserHistoryOptions = {

*
* @see https://github.com/ReactTraining/history/tree/master/docs/api-reference.md#createbrowserhistory
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createbrowserhistory
*/

@@ -331,3 +336,3 @@ export declare function createBrowserHistory(options?: BrowserHistoryOptions): BrowserHistory;

*
* @see https://github.com/ReactTraining/history/tree/master/docs/api-reference.md#createhashhistory
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createhashhistory
*/

@@ -339,3 +344,3 @@ export declare function createHashHistory(options?: HashHistoryOptions): HashHistory;

*/
export declare type InitialEntry = string | PartialLocation;
export declare type InitialEntry = string | Partial<Location>;
export declare type MemoryHistoryOptions = {

@@ -349,3 +354,3 @@ initialEntries?: InitialEntry[];

*
* @see https://github.com/ReactTraining/history/tree/master/docs/api-reference.md#creatememoryhistory
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#creatememoryhistory
*/

@@ -356,10 +361,10 @@ export declare function createMemoryHistory(options?: MemoryHistoryOptions): MemoryHistory;

*
* @see https://github.com/ReactTraining/history/tree/master/docs/api-reference.md#createpath
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createpath
*/
export declare function createPath({ pathname, search, hash }: PartialPath): string;
export declare function createPath({ pathname, search, hash }: Partial<Path>): string;
/**
* Parses a string URL path into its separate pathname, search, and hash components.
*
* @see https://github.com/ReactTraining/history/tree/master/docs/api-reference.md#parsepath
* @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#parsepath
*/
export declare function parsePath(path: string): PartialPath;
export declare function parsePath(path: string): Partial<Path>;

@@ -1,17 +0,17 @@

import _extends from'@babel/runtime/helpers/esm/extends';var r,B=r||(r={});B.Pop="POP";B.Push="PUSH";B.Replace="REPLACE";var C="production"!==process.env.NODE_ENV?function(b){return Object.freeze(b)}:function(b){return b};function D(b,h){if(!b){"undefined"!==typeof console&&console.warn(h);try{throw Error(h);}catch(k){}}}function E(b){b.preventDefault();b.returnValue=""}
function F(){var b=[];return{get length(){return b.length},push:function(h){b.push(h);return function(){b=b.filter(function(k){return k!==h})}},call:function(h){b.forEach(function(k){return k&&k(h)})}}}function H(){return Math.random().toString(36).substr(2,8)}function I(b){var h=b.pathname,k=b.search;b=b.hash;return(void 0===h?"/":h)+(void 0===k?"":k)+(void 0===b?"":b)}
function J(b){var h={};if(b){var k=b.indexOf("#");0<=k&&(h.hash=b.substr(k),b=b.substr(0,k));k=b.indexOf("?");0<=k&&(h.search=b.substr(k),b=b.substr(0,k));b&&(h.pathname=b)}return h}
function createBrowserHistory(b){function h(){var c=p.location,a=m.state||{};return[a.idx,C({pathname:c.pathname,search:c.search,hash:c.hash,state:a.usr||null,key:a.key||"default"})]}function k(c){return"string"===typeof c?c:I(c)}function x(c,a){void 0===a&&(a=null);return C(_extends({pathname:q.pathname,hash:"",search:""},"string"===typeof c?J(c):c,{state:a,key:H()}))}function z(c){t=c;c=h();v=c[0];q=c[1];d.call({action:t,location:q})}function A(c,a){function e(){A(c,a)}var l=r.Push,g=x(c,
a);if(!f.length||(f.call({action:l,location:g,retry:e}),!1)){var n=[{usr:g.state,key:g.key,idx:v+1},k(g)];g=n[0];n=n[1];try{m.pushState(g,"",n)}catch(G){p.location.assign(n)}z(l)}}function y(c,a){function e(){y(c,a)}var l=r.Replace,g=x(c,a);f.length&&(f.call({action:l,location:g,retry:e}),1)||(g=[{usr:g.state,key:g.key,idx:v},k(g)],m.replaceState(g[0],"",g[1]),z(l))}function w(c){m.go(c)}void 0===b&&(b={});b=b.window;var p=void 0===b?document.defaultView:b,m=p.history,u=null;p.addEventListener("popstate",
function(){if(u)f.call(u),u=null;else{var c=r.Pop,a=h(),e=a[0];a=a[1];if(f.length)if(null!=e){var l=v-e;l&&(u={action:c,location:a,retry:function(){w(-1*l)}},w(l))}else"production"!==process.env.NODE_ENV?D(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation."):
void 0;else z(c)}});var t=r.Pop;b=h();var v=b[0],q=b[1],d=F(),f=F();null==v&&(v=0,m.replaceState(_extends({},m.state,{idx:v}),""));return{get action(){return t},get location(){return q},createHref:k,push:A,replace:y,go:w,back:function(){w(-1)},forward:function(){w(1)},listen:function(c){return d.push(c)},block:function(c){var a=f.push(c);1===f.length&&p.addEventListener("beforeunload",E);return function(){a();f.length||p.removeEventListener("beforeunload",E)}}}};
function createHashHistory(b){function h(){var a=J(m.location.hash.substr(1)),e=a.pathname,l=a.search;a=a.hash;var g=u.state||{};return[g.idx,C({pathname:void 0===e?"/":e,search:void 0===l?"":l,hash:void 0===a?"":a,state:g.usr||null,key:g.key||"default"})]}function k(){if(t)c.call(t),t=null;else{var a=r.Pop,e=h(),l=e[0];e=e[1];if(c.length)if(null!=l){var g=q-l;g&&(t={action:a,location:e,retry:function(){p(-1*g)}},p(g))}else"production"!==process.env.NODE_ENV?D(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation."):
void 0;else A(a)}}function x(a){var e=document.querySelector("base"),l="";e&&e.getAttribute("href")&&(e=m.location.href,l=e.indexOf("#"),l=-1===l?e:e.slice(0,l));return l+"#"+("string"===typeof a?a:I(a))}function z(a,e){void 0===e&&(e=null);return C(_extends({pathname:d.pathname,hash:"",search:""},"string"===typeof a?J(a):a,{state:e,key:H()}))}function A(a){v=a;a=h();q=a[0];d=a[1];f.call({action:v,location:d})}function y(a,e){function l(){y(a,e)}var g=r.Push,n=z(a,e);"production"!==process.env.NODE_ENV?
D("/"===n.pathname.charAt(0),"Relative pathnames are not supported in hash history.push("+JSON.stringify(a)+")"):void 0;if(!c.length||(c.call({action:g,location:n,retry:l}),!1)){var G=[{usr:n.state,key:n.key,idx:q+1},x(n)];n=G[0];G=G[1];try{u.pushState(n,"",G)}catch(K){m.location.assign(G)}A(g)}}function w(a,e){function l(){w(a,e)}var g=r.Replace,n=z(a,e);"production"!==process.env.NODE_ENV?D("/"===n.pathname.charAt(0),"Relative pathnames are not supported in hash history.replace("+JSON.stringify(a)+
")"):void 0;c.length&&(c.call({action:g,location:n,retry:l}),1)||(n=[{usr:n.state,key:n.key,idx:q},x(n)],u.replaceState(n[0],"",n[1]),A(g))}function p(a){u.go(a)}void 0===b&&(b={});b=b.window;var m=void 0===b?document.defaultView:b,u=m.history,t=null;m.addEventListener("popstate",k);m.addEventListener("hashchange",function(){var a=h()[1];I(a)!==I(d)&&k()});var v=r.Pop;b=h();var q=b[0],d=b[1],f=F(),c=F();null==q&&(q=0,u.replaceState(_extends({},u.state,{idx:q}),""));return{get action(){return v},get location(){return d},
createHref:x,push:y,replace:w,go:p,back:function(){p(-1)},forward:function(){p(1)},listen:function(a){return f.push(a)},block:function(a){var e=c.push(a);1===c.length&&m.addEventListener("beforeunload",E);return function(){e();c.length||m.removeEventListener("beforeunload",E)}}}};
function createMemoryHistory(b){function h(d,f){void 0===f&&(f=null);return C(_extends({pathname:t.pathname,search:"",hash:""},"string"===typeof d?J(d):d,{state:f,key:H()}))}function k(d,f,c){return!q.length||(q.call({action:d,location:f,retry:c}),!1)}function x(d,f){u=d;t=f;v.call({action:u,location:t})}function z(d,f){var c=r.Push,a=h(d,f);"production"!==process.env.NODE_ENV?D("/"===t.pathname.charAt(0),"Relative pathnames are not supported in memory history.push("+JSON.stringify(d)+")"):
void 0;k(c,a,function(){z(d,f)})&&(m+=1,p.splice(m,p.length,a),x(c,a))}function A(d,f){var c=r.Replace,a=h(d,f);"production"!==process.env.NODE_ENV?D("/"===t.pathname.charAt(0),"Relative pathnames are not supported in memory history.replace("+JSON.stringify(d)+")"):void 0;k(c,a,function(){A(d,f)})&&(p[m]=a,x(c,a))}function y(d){var f=Math.min(Math.max(m+d,0),p.length-1),c=r.Pop,a=p[f];k(c,a,function(){y(d)})&&(m=f,x(c,a))}void 0===b&&(b={});var w=b;b=w.initialEntries;w=w.initialIndex;var p=(void 0===
b?["/"]:b).map(function(d){var f=C(_extends({pathname:"/",search:"",hash:"",state:null,key:H()},"string"===typeof d?J(d):d));"production"!==process.env.NODE_ENV?D("/"===f.pathname.charAt(0),"Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: "+JSON.stringify(d)+")"):void 0;return f}),m=Math.min(Math.max(null==w?p.length-1:w,0),p.length-1),u=r.Pop,t=p[m],v=F(),q=F();return{get index(){return m},get action(){return u},get location(){return t},createHref:function(d){return"string"===
import _extends from'@babel/runtime/helpers/esm/extends';var r,B=r||(r={});B.Pop="POP";B.Push="PUSH";B.Replace="REPLACE";var C="production"!==process.env.NODE_ENV?function(b){return Object.freeze(b)}:function(b){return b};function D(b,h){if(!b){"undefined"!==typeof console&&console.warn(h);try{throw Error(h);}catch(e){}}}function E(b){b.preventDefault();b.returnValue=""}
function F(){var b=[];return{get length(){return b.length},push:function(h){b.push(h);return function(){b=b.filter(function(e){return e!==h})}},call:function(h){b.forEach(function(e){return e&&e(h)})}}}function H(){return Math.random().toString(36).substr(2,8)}function I(b){var h=b.pathname;h=void 0===h?"/":h;var e=b.search;e=void 0===e?"":e;b=b.hash;b=void 0===b?"":b;e&&"?"!==e&&(h+="?"===e.charAt(0)?e:"?"+e);b&&"#"!==b&&(h+="#"===b.charAt(0)?b:"#"+b);return h}
function J(b){var h={};if(b){var e=b.indexOf("#");0<=e&&(h.hash=b.substr(e),b=b.substr(0,e));e=b.indexOf("?");0<=e&&(h.search=b.substr(e),b=b.substr(0,e));b&&(h.pathname=b)}return h}
function createBrowserHistory(b){function h(){var c=p.location,a=m.state||{};return[a.idx,C({pathname:c.pathname,search:c.search,hash:c.hash,state:a.usr||null,key:a.key||"default"})]}function e(c){return"string"===typeof c?c:I(c)}function x(c,a){void 0===a&&(a=null);return C(_extends({pathname:q.pathname,hash:"",search:""},"string"===typeof c?J(c):c,{state:a,key:H()}))}function z(c){t=c;c=h();v=c[0];q=c[1];d.call({action:t,location:q})}function A(c,a){function f(){A(c,a)}var l=r.Push,k=x(c,
a);if(!g.length||(g.call({action:l,location:k,retry:f}),!1)){var n=[{usr:k.state,key:k.key,idx:v+1},e(k)];k=n[0];n=n[1];try{m.pushState(k,"",n)}catch(G){p.location.assign(n)}z(l)}}function y(c,a){function f(){y(c,a)}var l=r.Replace,k=x(c,a);g.length&&(g.call({action:l,location:k,retry:f}),1)||(k=[{usr:k.state,key:k.key,idx:v},e(k)],m.replaceState(k[0],"",k[1]),z(l))}function w(c){m.go(c)}void 0===b&&(b={});b=b.window;var p=void 0===b?document.defaultView:b,m=p.history,u=null;p.addEventListener("popstate",
function(){if(u)g.call(u),u=null;else{var c=r.Pop,a=h(),f=a[0];a=a[1];if(g.length)if(null!=f){var l=v-f;l&&(u={action:c,location:a,retry:function(){w(-1*l)}},w(l))}else"production"!==process.env.NODE_ENV?D(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation."):
void 0;else z(c)}});var t=r.Pop;b=h();var v=b[0],q=b[1],d=F(),g=F();null==v&&(v=0,m.replaceState(_extends({},m.state,{idx:v}),""));return{get action(){return t},get location(){return q},createHref:e,push:A,replace:y,go:w,back:function(){w(-1)},forward:function(){w(1)},listen:function(c){return d.push(c)},block:function(c){var a=g.push(c);1===g.length&&p.addEventListener("beforeunload",E);return function(){a();g.length||p.removeEventListener("beforeunload",E)}}}};
function createHashHistory(b){function h(){var a=J(m.location.hash.substr(1)),f=a.pathname,l=a.search;a=a.hash;var k=u.state||{};return[k.idx,C({pathname:void 0===f?"/":f,search:void 0===l?"":l,hash:void 0===a?"":a,state:k.usr||null,key:k.key||"default"})]}function e(){if(t)c.call(t),t=null;else{var a=r.Pop,f=h(),l=f[0];f=f[1];if(c.length)if(null!=l){var k=q-l;k&&(t={action:a,location:f,retry:function(){p(-1*k)}},p(k))}else"production"!==process.env.NODE_ENV?D(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation."):
void 0;else A(a)}}function x(a){var f=document.querySelector("base"),l="";f&&f.getAttribute("href")&&(f=m.location.href,l=f.indexOf("#"),l=-1===l?f:f.slice(0,l));return l+"#"+("string"===typeof a?a:I(a))}function z(a,f){void 0===f&&(f=null);return C(_extends({pathname:d.pathname,hash:"",search:""},"string"===typeof a?J(a):a,{state:f,key:H()}))}function A(a){v=a;a=h();q=a[0];d=a[1];g.call({action:v,location:d})}function y(a,f){function l(){y(a,f)}var k=r.Push,n=z(a,f);"production"!==process.env.NODE_ENV?
D("/"===n.pathname.charAt(0),"Relative pathnames are not supported in hash history.push("+JSON.stringify(a)+")"):void 0;if(!c.length||(c.call({action:k,location:n,retry:l}),!1)){var G=[{usr:n.state,key:n.key,idx:q+1},x(n)];n=G[0];G=G[1];try{u.pushState(n,"",G)}catch(K){m.location.assign(G)}A(k)}}function w(a,f){function l(){w(a,f)}var k=r.Replace,n=z(a,f);"production"!==process.env.NODE_ENV?D("/"===n.pathname.charAt(0),"Relative pathnames are not supported in hash history.replace("+JSON.stringify(a)+
")"):void 0;c.length&&(c.call({action:k,location:n,retry:l}),1)||(n=[{usr:n.state,key:n.key,idx:q},x(n)],u.replaceState(n[0],"",n[1]),A(k))}function p(a){u.go(a)}void 0===b&&(b={});b=b.window;var m=void 0===b?document.defaultView:b,u=m.history,t=null;m.addEventListener("popstate",e);m.addEventListener("hashchange",function(){var a=h()[1];I(a)!==I(d)&&e()});var v=r.Pop;b=h();var q=b[0],d=b[1],g=F(),c=F();null==q&&(q=0,u.replaceState(_extends({},u.state,{idx:q}),""));return{get action(){return v},get location(){return d},
createHref:x,push:y,replace:w,go:p,back:function(){p(-1)},forward:function(){p(1)},listen:function(a){return g.push(a)},block:function(a){var f=c.push(a);1===c.length&&m.addEventListener("beforeunload",E);return function(){f();c.length||m.removeEventListener("beforeunload",E)}}}};
function createMemoryHistory(b){function h(d,g){void 0===g&&(g=null);return C(_extends({pathname:t.pathname,search:"",hash:""},"string"===typeof d?J(d):d,{state:g,key:H()}))}function e(d,g,c){return!q.length||(q.call({action:d,location:g,retry:c}),!1)}function x(d,g){u=d;t=g;v.call({action:u,location:t})}function z(d,g){var c=r.Push,a=h(d,g);"production"!==process.env.NODE_ENV?D("/"===t.pathname.charAt(0),"Relative pathnames are not supported in memory history.push("+JSON.stringify(d)+")"):
void 0;e(c,a,function(){z(d,g)})&&(m+=1,p.splice(m,p.length,a),x(c,a))}function A(d,g){var c=r.Replace,a=h(d,g);"production"!==process.env.NODE_ENV?D("/"===t.pathname.charAt(0),"Relative pathnames are not supported in memory history.replace("+JSON.stringify(d)+")"):void 0;e(c,a,function(){A(d,g)})&&(p[m]=a,x(c,a))}function y(d){var g=Math.min(Math.max(m+d,0),p.length-1),c=r.Pop,a=p[g];e(c,a,function(){y(d)})&&(m=g,x(c,a))}void 0===b&&(b={});var w=b;b=w.initialEntries;w=w.initialIndex;var p=(void 0===
b?["/"]:b).map(function(d){var g=C(_extends({pathname:"/",search:"",hash:"",state:null,key:H()},"string"===typeof d?J(d):d));"production"!==process.env.NODE_ENV?D("/"===g.pathname.charAt(0),"Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: "+JSON.stringify(d)+")"):void 0;return g}),m=Math.min(Math.max(null==w?p.length-1:w,0),p.length-1),u=r.Pop,t=p[m],v=F(),q=F();return{get index(){return m},get action(){return u},get location(){return t},createHref:function(d){return"string"===
typeof d?d:I(d)},push:z,replace:A,go:y,back:function(){y(-1)},forward:function(){y(1)},listen:function(d){return v.push(d)},block:function(d){return q.push(d)}}};export{r as Action,createBrowserHistory,createHashHistory,createMemoryHistory,I as createPath,J as parsePath}
//# sourceMappingURL=index.js.map

@@ -1,1 +0,9 @@

'use strict';module.exports="production"===process.env.NODE_ENV?require("./umd/history.production.min.js"):require("./umd/history.development.js")
'use strict';
/* eslint-env node */
if (process.env.NODE_ENV === 'production') {
module.exports = require('./umd/history.production.min.js');
} else {
module.exports = require('./umd/history.development.js');
}
{
"name": "history",
"version": "5.1.0",
"version": "5.2.0",
"description": "Manage session history with JavaScript",
"author": "React Training <hello@reacttraining.com>",
"repository": "ReactTraining/history",
"author": "Remix Software <hello@remix.run>",
"repository": "remix-run/history",
"license": "MIT",

@@ -8,0 +8,0 @@ "main": "main.js",

@@ -1,7 +0,5 @@

# history &middot; [![npm package][npm-badge]][npm] [![Travis][build-badge]][build]
# history &middot; [![npm package][npm-badge]][npm]
[npm-badge]: https://img.shields.io/npm/v/history.svg?style=flat-square
[npm]: https://www.npmjs.org/package/history
[build-badge]: https://img.shields.io/travis/ReactTraining/history/master.svg?style=flat-square
[build]: https://travis-ci.org/ReactTraining/history

@@ -14,13 +12,13 @@ The history library lets you easily manage session history anywhere JavaScript runs. A `history` object abstracts away the differences in various environments and provides a minimal API that lets you manage the history stack, navigate, and persist state between sessions.

Documentation for version 4 can be found [on the v4 branch](https://github.com/ReactTraining/history/tree/v4/docs). Version 4 is used in React Router versions 4 and 5.
Documentation for version 4 can be found [on the v4 branch](https://github.com/remix-run/history/tree/v4/docs). Version 4 is used in React Router versions 4 and 5.
## Changes
To see the changes that were made in a given release, please lookup the tag on [the releases page](https://github.com/ReactTraining/history/releases).
To see the changes that were made in a given release, please lookup the tag on [the releases page](https://github.com/remix-run/history/releases).
For changes released in version 4.6.3 and earlier, please see [the `CHANGES.md` file](https://github.com/ReactTraining/history/blob/845d690c5576c7f55ecbe14babe0092e8e5bc2bb/CHANGES.md).
For changes released in version 4.6.3 and earlier, please see [the `CHANGES.md` file](https://github.com/remix-run/history/blob/845d690c5576c7f55ecbe14babe0092e8e5bc2bb/CHANGES.md).
## Development
Development of the current stable release, version 5, happens on [the `master` branch](https://github.com/ReactTraining/history/tree/master). Please keep in mind that this branch may include some work that has not yet been published as part of an official release. However, since `master` is always stable, you should feel free to build your own working release straight from master at any time.
Development of the current stable release, version 5, happens on [the `main` branch](https://github.com/remix-run/history/tree/main). Please keep in mind that this branch may include some work that has not yet been published as part of an official release. However, since `main` is always stable, you should feel free to build your own working release straight from `main` at any time.

@@ -27,0 +25,0 @@ If you're interested in helping out, please read [our contributing guidelines](CONTRIBUTING.md).

@@ -1,15 +0,16 @@

'use strict';(function(l,y){"object"===typeof exports&&"undefined"!==typeof module?y(exports):"function"===typeof define&&define.amd?define(["exports"],y):(l="undefined"!==typeof globalThis?globalThis:l||self,y(l.HistoryLibrary={}))})(this,function(l){function y(){y=Object.assign||function(b){for(var g=1;g<arguments.length;g++){var h=arguments[g],t;for(t in h)Object.prototype.hasOwnProperty.call(h,t)&&(b[t]=h[t])}return b};return y.apply(this,arguments)}function C(b,g){if(!b){"undefined"!==typeof console&&
console.warn(g);try{throw Error(g);}catch(h){}}}function H(b){b.preventDefault();b.returnValue=""}function D(){var b=[];return{get length(){return b.length},push:function(g){b.push(g);return function(){b=b.filter(function(h){return h!==g})}},call:function(g){b.forEach(function(h){return h&&h(g)})}}}function I(){return Math.random().toString(36).substr(2,8)}function E(b){var g=b.pathname,h=b.search;b=b.hash;return(void 0===g?"/":g)+(void 0===h?"":h)+(void 0===b?"":b)}function F(b){var g={};if(b){var h=
b.indexOf("#");0<=h&&(g.hash=b.substr(h),b=b.substr(0,h));h=b.indexOf("?");0<=h&&(g.search=b.substr(h),b=b.substr(0,h));b&&(g.pathname=b)}return g}l.Action=void 0;(function(b){b.Pop="POP";b.Push="PUSH";b.Replace="REPLACE"})(l.Action||(l.Action={}));l.createBrowserHistory=function(b){function g(){var c=q.location,a=n.state||{};return[a.idx,Object.freeze({pathname:c.pathname,search:c.search,hash:c.hash,state:a.usr||null,key:a.key||"default"})]}function h(c){return"string"===typeof c?c:E(c)}function t(c,
a){void 0===a&&(a=null);return Object.freeze(y({pathname:r.pathname,hash:"",search:""},"string"===typeof c?F(c):c,{state:a,key:I()}))}function A(c){u=c;c=g();w=c[0];r=c[1];d.call({action:u,location:r})}function B(c,a){function e(){B(c,a)}var m=l.Action.Push,k=t(c,a);if(!f.length||(f.call({action:m,location:k,retry:e}),!1)){var p=[{usr:k.state,key:k.key,idx:w+1},h(k)];k=p[0];p=p[1];try{n.pushState(k,"",p)}catch(G){q.location.assign(p)}A(m)}}function z(c,a){function e(){z(c,a)}var m=l.Action.Replace,
k=t(c,a);f.length&&(f.call({action:m,location:k,retry:e}),1)||(k=[{usr:k.state,key:k.key,idx:w},h(k)],n.replaceState(k[0],"",k[1]),A(m))}function x(c){n.go(c)}void 0===b&&(b={});b=b.window;var q=void 0===b?document.defaultView:b,n=q.history,v=null;q.addEventListener("popstate",function(){if(v)f.call(v),v=null;else{var c=l.Action.Pop,a=g(),e=a[0];a=a[1];if(f.length)if(null!=e){var m=w-e;m&&(v={action:c,location:a,retry:function(){x(-1*m)}},x(m))}else C(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation.");
else A(c)}});var u=l.Action.Pop;b=g();var w=b[0],r=b[1],d=D(),f=D();null==w&&(w=0,n.replaceState(y({},n.state,{idx:w}),""));return{get action(){return u},get location(){return r},createHref:h,push:B,replace:z,go:x,back:function(){x(-1)},forward:function(){x(1)},listen:function(c){return d.push(c)},block:function(c){var a=f.push(c);1===f.length&&q.addEventListener("beforeunload",H);return function(){a();f.length||q.removeEventListener("beforeunload",H)}}}};l.createHashHistory=function(b){function g(){var a=
F(n.location.hash.substr(1)),e=a.pathname,m=a.search;a=a.hash;var k=v.state||{};return[k.idx,Object.freeze({pathname:void 0===e?"/":e,search:void 0===m?"":m,hash:void 0===a?"":a,state:k.usr||null,key:k.key||"default"})]}function h(){if(u)c.call(u),u=null;else{var a=l.Action.Pop,e=g(),m=e[0];e=e[1];if(c.length)if(null!=m){var k=r-m;k&&(u={action:a,location:e,retry:function(){q(-1*k)}},q(k))}else C(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation.");
else B(a)}}function t(a){var e=document.querySelector("base"),m="";e&&e.getAttribute("href")&&(e=n.location.href,m=e.indexOf("#"),m=-1===m?e:e.slice(0,m));return m+"#"+("string"===typeof a?a:E(a))}function A(a,e){void 0===e&&(e=null);return Object.freeze(y({pathname:d.pathname,hash:"",search:""},"string"===typeof a?F(a):a,{state:e,key:I()}))}function B(a){w=a;a=g();r=a[0];d=a[1];f.call({action:w,location:d})}function z(a,e){function m(){z(a,e)}var k=l.Action.Push,p=A(a,e);C("/"===p.pathname.charAt(0),
"Relative pathnames are not supported in hash history.push("+JSON.stringify(a)+")");if(!c.length||(c.call({action:k,location:p,retry:m}),!1)){var G=[{usr:p.state,key:p.key,idx:r+1},t(p)];p=G[0];G=G[1];try{v.pushState(p,"",G)}catch(J){n.location.assign(G)}B(k)}}function x(a,e){function m(){x(a,e)}var k=l.Action.Replace,p=A(a,e);C("/"===p.pathname.charAt(0),"Relative pathnames are not supported in hash history.replace("+JSON.stringify(a)+")");c.length&&(c.call({action:k,location:p,retry:m}),1)||(p=
[{usr:p.state,key:p.key,idx:r},t(p)],v.replaceState(p[0],"",p[1]),B(k))}function q(a){v.go(a)}void 0===b&&(b={});b=b.window;var n=void 0===b?document.defaultView:b,v=n.history,u=null;n.addEventListener("popstate",h);n.addEventListener("hashchange",function(){var a=g()[1];E(a)!==E(d)&&h()});var w=l.Action.Pop;b=g();var r=b[0],d=b[1],f=D(),c=D();null==r&&(r=0,v.replaceState(y({},v.state,{idx:r}),""));return{get action(){return w},get location(){return d},createHref:t,push:z,replace:x,go:q,back:function(){q(-1)},
forward:function(){q(1)},listen:function(a){return f.push(a)},block:function(a){var e=c.push(a);1===c.length&&n.addEventListener("beforeunload",H);return function(){e();c.length||n.removeEventListener("beforeunload",H)}}}};l.createMemoryHistory=function(b){function g(d,f){void 0===f&&(f=null);return Object.freeze(y({pathname:u.pathname,search:"",hash:""},"string"===typeof d?F(d):d,{state:f,key:I()}))}function h(d,f,c){return!r.length||(r.call({action:d,location:f,retry:c}),!1)}function t(d,f){v=d;
u=f;w.call({action:v,location:u})}function A(d,f){var c=l.Action.Push,a=g(d,f);C("/"===u.pathname.charAt(0),"Relative pathnames are not supported in memory history.push("+JSON.stringify(d)+")");h(c,a,function(){A(d,f)})&&(n+=1,q.splice(n,q.length,a),t(c,a))}function B(d,f){var c=l.Action.Replace,a=g(d,f);C("/"===u.pathname.charAt(0),"Relative pathnames are not supported in memory history.replace("+JSON.stringify(d)+")");h(c,a,function(){B(d,f)})&&(q[n]=a,t(c,a))}function z(d){var f=Math.min(Math.max(n+
d,0),q.length-1),c=l.Action.Pop,a=q[f];h(c,a,function(){z(d)})&&(n=f,t(c,a))}void 0===b&&(b={});var x=b;b=x.initialEntries;x=x.initialIndex;var q=(void 0===b?["/"]:b).map(function(d){var f=Object.freeze(y({pathname:"/",search:"",hash:"",state:null,key:I()},"string"===typeof d?F(d):d));C("/"===f.pathname.charAt(0),"Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: "+JSON.stringify(d)+")");return f}),n=Math.min(Math.max(null==x?q.length-1:x,0),q.length-
'use strict';(function(l,y){"object"===typeof exports&&"undefined"!==typeof module?y(exports):"function"===typeof define&&define.amd?define(["exports"],y):(l="undefined"!==typeof globalThis?globalThis:l||self,y(l.HistoryLibrary={}))})(this,function(l){function y(){y=Object.assign||function(b){for(var f=1;f<arguments.length;f++){var e=arguments[f],t;for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(b[t]=e[t])}return b};return y.apply(this,arguments)}function C(b,f){if(!b){"undefined"!==typeof console&&
console.warn(f);try{throw Error(f);}catch(e){}}}function H(b){b.preventDefault();b.returnValue=""}function D(){var b=[];return{get length(){return b.length},push:function(f){b.push(f);return function(){b=b.filter(function(e){return e!==f})}},call:function(f){b.forEach(function(e){return e&&e(f)})}}}function I(){return Math.random().toString(36).substr(2,8)}function E(b){var f=b.pathname;f=void 0===f?"/":f;var e=b.search;e=void 0===e?"":e;b=b.hash;b=void 0===b?"":b;e&&"?"!==e&&(f+="?"===e.charAt(0)?
e:"?"+e);b&&"#"!==b&&(f+="#"===b.charAt(0)?b:"#"+b);return f}function F(b){var f={};if(b){var e=b.indexOf("#");0<=e&&(f.hash=b.substr(e),b=b.substr(0,e));e=b.indexOf("?");0<=e&&(f.search=b.substr(e),b=b.substr(0,e));b&&(f.pathname=b)}return f}l.Action=void 0;(function(b){b.Pop="POP";b.Push="PUSH";b.Replace="REPLACE"})(l.Action||(l.Action={}));l.createBrowserHistory=function(b){function f(){var c=q.location,a=n.state||{};return[a.idx,Object.freeze({pathname:c.pathname,search:c.search,hash:c.hash,state:a.usr||
null,key:a.key||"default"})]}function e(c){return"string"===typeof c?c:E(c)}function t(c,a){void 0===a&&(a=null);return Object.freeze(y({pathname:r.pathname,hash:"",search:""},"string"===typeof c?F(c):c,{state:a,key:I()}))}function A(c){u=c;c=f();w=c[0];r=c[1];d.call({action:u,location:r})}function B(c,a){function g(){B(c,a)}var m=l.Action.Push,k=t(c,a);if(!h.length||(h.call({action:m,location:k,retry:g}),!1)){var p=[{usr:k.state,key:k.key,idx:w+1},e(k)];k=p[0];p=p[1];try{n.pushState(k,"",p)}catch(G){q.location.assign(p)}A(m)}}
function z(c,a){function g(){z(c,a)}var m=l.Action.Replace,k=t(c,a);h.length&&(h.call({action:m,location:k,retry:g}),1)||(k=[{usr:k.state,key:k.key,idx:w},e(k)],n.replaceState(k[0],"",k[1]),A(m))}function x(c){n.go(c)}void 0===b&&(b={});b=b.window;var q=void 0===b?document.defaultView:b,n=q.history,v=null;q.addEventListener("popstate",function(){if(v)h.call(v),v=null;else{var c=l.Action.Pop,a=f(),g=a[0];a=a[1];if(h.length)if(null!=g){var m=w-g;m&&(v={action:c,location:a,retry:function(){x(-1*m)}},
x(m))}else C(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation.");else A(c)}});var u=l.Action.Pop;b=f();var w=b[0],r=b[1],d=D(),h=D();null==w&&(w=0,n.replaceState(y({},n.state,{idx:w}),""));return{get action(){return u},get location(){return r},createHref:e,
push:B,replace:z,go:x,back:function(){x(-1)},forward:function(){x(1)},listen:function(c){return d.push(c)},block:function(c){var a=h.push(c);1===h.length&&q.addEventListener("beforeunload",H);return function(){a();h.length||q.removeEventListener("beforeunload",H)}}}};l.createHashHistory=function(b){function f(){var a=F(n.location.hash.substr(1)),g=a.pathname,m=a.search;a=a.hash;var k=v.state||{};return[k.idx,Object.freeze({pathname:void 0===g?"/":g,search:void 0===m?"":m,hash:void 0===a?"":a,state:k.usr||
null,key:k.key||"default"})]}function e(){if(u)c.call(u),u=null;else{var a=l.Action.Pop,g=f(),m=g[0];g=g[1];if(c.length)if(null!=m){var k=r-m;k&&(u={action:a,location:g,retry:function(){q(-1*k)}},q(k))}else C(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation.");
else B(a)}}function t(a){var g=document.querySelector("base"),m="";g&&g.getAttribute("href")&&(g=n.location.href,m=g.indexOf("#"),m=-1===m?g:g.slice(0,m));return m+"#"+("string"===typeof a?a:E(a))}function A(a,g){void 0===g&&(g=null);return Object.freeze(y({pathname:d.pathname,hash:"",search:""},"string"===typeof a?F(a):a,{state:g,key:I()}))}function B(a){w=a;a=f();r=a[0];d=a[1];h.call({action:w,location:d})}function z(a,g){function m(){z(a,g)}var k=l.Action.Push,p=A(a,g);C("/"===p.pathname.charAt(0),
"Relative pathnames are not supported in hash history.push("+JSON.stringify(a)+")");if(!c.length||(c.call({action:k,location:p,retry:m}),!1)){var G=[{usr:p.state,key:p.key,idx:r+1},t(p)];p=G[0];G=G[1];try{v.pushState(p,"",G)}catch(J){n.location.assign(G)}B(k)}}function x(a,g){function m(){x(a,g)}var k=l.Action.Replace,p=A(a,g);C("/"===p.pathname.charAt(0),"Relative pathnames are not supported in hash history.replace("+JSON.stringify(a)+")");c.length&&(c.call({action:k,location:p,retry:m}),1)||(p=
[{usr:p.state,key:p.key,idx:r},t(p)],v.replaceState(p[0],"",p[1]),B(k))}function q(a){v.go(a)}void 0===b&&(b={});b=b.window;var n=void 0===b?document.defaultView:b,v=n.history,u=null;n.addEventListener("popstate",e);n.addEventListener("hashchange",function(){var a=f()[1];E(a)!==E(d)&&e()});var w=l.Action.Pop;b=f();var r=b[0],d=b[1],h=D(),c=D();null==r&&(r=0,v.replaceState(y({},v.state,{idx:r}),""));return{get action(){return w},get location(){return d},createHref:t,push:z,replace:x,go:q,back:function(){q(-1)},
forward:function(){q(1)},listen:function(a){return h.push(a)},block:function(a){var g=c.push(a);1===c.length&&n.addEventListener("beforeunload",H);return function(){g();c.length||n.removeEventListener("beforeunload",H)}}}};l.createMemoryHistory=function(b){function f(d,h){void 0===h&&(h=null);return Object.freeze(y({pathname:u.pathname,search:"",hash:""},"string"===typeof d?F(d):d,{state:h,key:I()}))}function e(d,h,c){return!r.length||(r.call({action:d,location:h,retry:c}),!1)}function t(d,h){v=d;
u=h;w.call({action:v,location:u})}function A(d,h){var c=l.Action.Push,a=f(d,h);C("/"===u.pathname.charAt(0),"Relative pathnames are not supported in memory history.push("+JSON.stringify(d)+")");e(c,a,function(){A(d,h)})&&(n+=1,q.splice(n,q.length,a),t(c,a))}function B(d,h){var c=l.Action.Replace,a=f(d,h);C("/"===u.pathname.charAt(0),"Relative pathnames are not supported in memory history.replace("+JSON.stringify(d)+")");e(c,a,function(){B(d,h)})&&(q[n]=a,t(c,a))}function z(d){var h=Math.min(Math.max(n+
d,0),q.length-1),c=l.Action.Pop,a=q[h];e(c,a,function(){z(d)})&&(n=h,t(c,a))}void 0===b&&(b={});var x=b;b=x.initialEntries;x=x.initialIndex;var q=(void 0===b?["/"]:b).map(function(d){var h=Object.freeze(y({pathname:"/",search:"",hash:"",state:null,key:I()},"string"===typeof d?F(d):d));C("/"===h.pathname.charAt(0),"Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: "+JSON.stringify(d)+")");return h}),n=Math.min(Math.max(null==x?q.length-1:x,0),q.length-
1),v=l.Action.Pop,u=q[n],w=D(),r=D();return{get index(){return n},get action(){return v},get location(){return u},createHref:function(d){return"string"===typeof d?d:E(d)},push:A,replace:B,go:z,back:function(){z(-1)},forward:function(){z(1)},listen:function(d){return w.push(d)},block:function(d){return r.push(d)}}};l.createPath=E;l.parsePath=F;Object.defineProperty(l,"__esModule",{value:!0})})
//# sourceMappingURL=history.development.js.map

@@ -1,2 +0,2 @@

"use strict";!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).HistoryLibrary={})}(this,(function(t){function n(){return(n=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e,r=arguments[n];for(e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e])}return t}).apply(this,arguments)}function e(t){t.preventDefault(),t.returnValue=""}function r(){var t=[];return{get length(){return t.length},push:function(n){return t.push(n),function(){t=t.filter((function(t){return t!==n}))}},call:function(n){t.forEach((function(t){return t&&t(n)}))}}}function o(){return Math.random().toString(36).substr(2,8)}function a(t){var n=t.pathname,e=t.search;return(void 0===n?"/":n)+(void 0===e?"":e)+(void 0===(t=t.hash)?"":t)}function i(t){var n={};if(t){var e=t.indexOf("#");0<=e&&(n.hash=t.substr(e),t=t.substr(0,e)),0<=(e=t.indexOf("?"))&&(n.search=t.substr(e),t=t.substr(0,e)),t&&(n.pathname=t)}return n}var c;t.Action=void 0,(c=t.Action||(t.Action={})).Pop="POP",c.Push="PUSH",c.Replace="REPLACE",t.createBrowserHistory=function(c){function u(){var t=p.location,n=d.state||{};return[n.idx,{pathname:t.pathname,search:t.search,hash:t.hash,state:n.usr||null,key:n.key||"default"}]}function l(t){return"string"==typeof t?t:a(t)}function s(t,e){return void 0===e&&(e=null),n({pathname:m.pathname,hash:"",search:""},"string"==typeof t?i(t):t,{state:e,key:o()})}function f(t){y=t,t=u(),g=t[0],m=t[1],b.call({action:y,location:m})}function h(t){d.go(t)}void 0===c&&(c={});var p=void 0===(c=c.window)?document.defaultView:c,d=p.history,v=null;p.addEventListener("popstate",(function(){if(v)k.call(v),v=null;else{var n=t.Action.Pop,e=u(),r=e[0];if(e=e[1],k.length){if(null!=r){var o=g-r;o&&(v={action:n,location:e,retry:function(){h(-1*o)}},h(o))}}else f(n)}}));var y=t.Action.Pop,g=(c=u())[0],m=c[1],b=r(),k=r();return null==g&&(g=0,d.replaceState(n({},d.state,{idx:g}),"")),{get action(){return y},get location(){return m},createHref:l,push:function n(e,r){var o=t.Action.Push,a=s(e,r);if(!k.length||(k.call({action:o,location:a,retry:function(){n(e,r)}}),0)){var i=[{usr:a.state,key:a.key,idx:g+1},l(a)];a=i[0],i=i[1];try{d.pushState(a,"",i)}catch(t){p.location.assign(i)}f(o)}},replace:function n(e,r){var o=t.Action.Replace,a=s(e,r);k.length&&(k.call({action:o,location:a,retry:function(){n(e,r)}}),1)||(a=[{usr:a.state,key:a.key,idx:g},l(a)],d.replaceState(a[0],"",a[1]),f(o))},go:h,back:function(){h(-1)},forward:function(){h(1)},listen:function(t){return b.push(t)},block:function(t){var n=k.push(t);return 1===k.length&&p.addEventListener("beforeunload",e),function(){n(),k.length||p.removeEventListener("beforeunload",e)}}}},t.createHashHistory=function(c){function u(){var t=i(d.location.hash.substr(1)),n=t.pathname,e=t.search;t=t.hash;var r=v.state||{};return[r.idx,{pathname:void 0===n?"/":n,search:void 0===e?"":e,hash:void 0===t?"":t,state:r.usr||null,key:r.key||"default"}]}function l(){if(y)P.call(y),y=null;else{var n=t.Action.Pop,e=u(),r=e[0];if(e=e[1],P.length){if(null!=r){var o=m-r;o&&(y={action:n,location:e,retry:function(){p(-1*o)}},p(o))}}else h(n)}}function s(t){var n=document.querySelector("base"),e="";return n&&n.getAttribute("href")&&(e=-1===(e=(n=d.location.href).indexOf("#"))?n:n.slice(0,e)),e+"#"+("string"==typeof t?t:a(t))}function f(t,e){return void 0===e&&(e=null),n({pathname:b.pathname,hash:"",search:""},"string"==typeof t?i(t):t,{state:e,key:o()})}function h(t){g=t,t=u(),m=t[0],b=t[1],k.call({action:g,location:b})}function p(t){v.go(t)}void 0===c&&(c={});var d=void 0===(c=c.window)?document.defaultView:c,v=d.history,y=null;d.addEventListener("popstate",l),d.addEventListener("hashchange",(function(){a(u()[1])!==a(b)&&l()}));var g=t.Action.Pop,m=(c=u())[0],b=c[1],k=r(),P=r();return null==m&&(m=0,v.replaceState(n({},v.state,{idx:m}),"")),{get action(){return g},get location(){return b},createHref:s,push:function n(e,r){var o=t.Action.Push,a=f(e,r);if(!P.length||(P.call({action:o,location:a,retry:function(){n(e,r)}}),0)){var i=[{usr:a.state,key:a.key,idx:m+1},s(a)];a=i[0],i=i[1];try{v.pushState(a,"",i)}catch(t){d.location.assign(i)}h(o)}},replace:function n(e,r){var o=t.Action.Replace,a=f(e,r);P.length&&(P.call({action:o,location:a,retry:function(){n(e,r)}}),1)||(a=[{usr:a.state,key:a.key,idx:m},s(a)],v.replaceState(a[0],"",a[1]),h(o))},go:p,back:function(){p(-1)},forward:function(){p(1)},listen:function(t){return k.push(t)},block:function(t){var n=P.push(t);return 1===P.length&&d.addEventListener("beforeunload",e),function(){n(),P.length||d.removeEventListener("beforeunload",e)}}}},t.createMemoryHistory=function(e){function c(t,e){return void 0===e&&(e=null),n({pathname:v.pathname,search:"",hash:""},"string"==typeof t?i(t):t,{state:e,key:o()})}function u(t,n,e){return!g.length||(g.call({action:t,location:n,retry:e}),!1)}function l(t,n){d=t,v=n,y.call({action:d,location:v})}function s(n){var e=Math.min(Math.max(p+n,0),h.length-1),r=t.Action.Pop,o=h[e];u(r,o,(function(){s(n)}))&&(p=e,l(r,o))}void 0===e&&(e={});var f=e;e=f.initialEntries,f=f.initialIndex;var h=(void 0===e?["/"]:e).map((function(t){return n({pathname:"/",search:"",hash:"",state:null,key:o()},"string"==typeof t?i(t):t)})),p=Math.min(Math.max(null==f?h.length-1:f,0),h.length-1),d=t.Action.Pop,v=h[p],y=r(),g=r();return{get index(){return p},get action(){return d},get location(){return v},createHref:function(t){return"string"==typeof t?t:a(t)},push:function n(e,r){var o=t.Action.Push,a=c(e,r);u(o,a,(function(){n(e,r)}))&&(p+=1,h.splice(p,h.length,a),l(o,a))},replace:function n(e,r){var o=t.Action.Replace,a=c(e,r);u(o,a,(function(){n(e,r)}))&&(h[p]=a,l(o,a))},go:s,back:function(){s(-1)},forward:function(){s(1)},listen:function(t){return y.push(t)},block:function(t){return g.push(t)}}},t.createPath=a,t.parsePath=i,Object.defineProperty(t,"__esModule",{value:!0})}));
"use strict";!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).HistoryLibrary={})}(this,(function(t){function n(){return(n=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e,r=arguments[n];for(e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e])}return t}).apply(this,arguments)}function e(t){t.preventDefault(),t.returnValue=""}function r(){var t=[];return{get length(){return t.length},push:function(n){return t.push(n),function(){t=t.filter((function(t){return t!==n}))}},call:function(n){t.forEach((function(t){return t&&t(n)}))}}}function o(){return Math.random().toString(36).substr(2,8)}function a(t){var n=t.pathname;n=void 0===n?"/":n;var e=t.search;return e=void 0===e?"":e,t=void 0===(t=t.hash)?"":t,e&&"?"!==e&&(n+="?"===e.charAt(0)?e:"?"+e),t&&"#"!==t&&(n+="#"===t.charAt(0)?t:"#"+t),n}function i(t){var n={};if(t){var e=t.indexOf("#");0<=e&&(n.hash=t.substr(e),t=t.substr(0,e)),0<=(e=t.indexOf("?"))&&(n.search=t.substr(e),t=t.substr(0,e)),t&&(n.pathname=t)}return n}var c;t.Action=void 0,(c=t.Action||(t.Action={})).Pop="POP",c.Push="PUSH",c.Replace="REPLACE",t.createBrowserHistory=function(c){function u(){var t=p.location,n=d.state||{};return[n.idx,{pathname:t.pathname,search:t.search,hash:t.hash,state:n.usr||null,key:n.key||"default"}]}function l(t){return"string"==typeof t?t:a(t)}function s(t,e){return void 0===e&&(e=null),n({pathname:m.pathname,hash:"",search:""},"string"==typeof t?i(t):t,{state:e,key:o()})}function f(t){y=t,t=u(),g=t[0],m=t[1],b.call({action:y,location:m})}function h(t){d.go(t)}void 0===c&&(c={});var p=void 0===(c=c.window)?document.defaultView:c,d=p.history,v=null;p.addEventListener("popstate",(function(){if(v)k.call(v),v=null;else{var n=t.Action.Pop,e=u(),r=e[0];if(e=e[1],k.length){if(null!=r){var o=g-r;o&&(v={action:n,location:e,retry:function(){h(-1*o)}},h(o))}}else f(n)}}));var y=t.Action.Pop,g=(c=u())[0],m=c[1],b=r(),k=r();return null==g&&(g=0,d.replaceState(n({},d.state,{idx:g}),"")),{get action(){return y},get location(){return m},createHref:l,push:function n(e,r){var o=t.Action.Push,a=s(e,r);if(!k.length||(k.call({action:o,location:a,retry:function(){n(e,r)}}),0)){var i=[{usr:a.state,key:a.key,idx:g+1},l(a)];a=i[0],i=i[1];try{d.pushState(a,"",i)}catch(t){p.location.assign(i)}f(o)}},replace:function n(e,r){var o=t.Action.Replace,a=s(e,r);k.length&&(k.call({action:o,location:a,retry:function(){n(e,r)}}),1)||(a=[{usr:a.state,key:a.key,idx:g},l(a)],d.replaceState(a[0],"",a[1]),f(o))},go:h,back:function(){h(-1)},forward:function(){h(1)},listen:function(t){return b.push(t)},block:function(t){var n=k.push(t);return 1===k.length&&p.addEventListener("beforeunload",e),function(){n(),k.length||p.removeEventListener("beforeunload",e)}}}},t.createHashHistory=function(c){function u(){var t=i(d.location.hash.substr(1)),n=t.pathname,e=t.search;t=t.hash;var r=v.state||{};return[r.idx,{pathname:void 0===n?"/":n,search:void 0===e?"":e,hash:void 0===t?"":t,state:r.usr||null,key:r.key||"default"}]}function l(){if(y)A.call(y),y=null;else{var n=t.Action.Pop,e=u(),r=e[0];if(e=e[1],A.length){if(null!=r){var o=m-r;o&&(y={action:n,location:e,retry:function(){p(-1*o)}},p(o))}}else h(n)}}function s(t){var n=document.querySelector("base"),e="";return n&&n.getAttribute("href")&&(e=-1===(e=(n=d.location.href).indexOf("#"))?n:n.slice(0,e)),e+"#"+("string"==typeof t?t:a(t))}function f(t,e){return void 0===e&&(e=null),n({pathname:b.pathname,hash:"",search:""},"string"==typeof t?i(t):t,{state:e,key:o()})}function h(t){g=t,t=u(),m=t[0],b=t[1],k.call({action:g,location:b})}function p(t){v.go(t)}void 0===c&&(c={});var d=void 0===(c=c.window)?document.defaultView:c,v=d.history,y=null;d.addEventListener("popstate",l),d.addEventListener("hashchange",(function(){a(u()[1])!==a(b)&&l()}));var g=t.Action.Pop,m=(c=u())[0],b=c[1],k=r(),A=r();return null==m&&(m=0,v.replaceState(n({},v.state,{idx:m}),"")),{get action(){return g},get location(){return b},createHref:s,push:function n(e,r){var o=t.Action.Push,a=f(e,r);if(!A.length||(A.call({action:o,location:a,retry:function(){n(e,r)}}),0)){var i=[{usr:a.state,key:a.key,idx:m+1},s(a)];a=i[0],i=i[1];try{v.pushState(a,"",i)}catch(t){d.location.assign(i)}h(o)}},replace:function n(e,r){var o=t.Action.Replace,a=f(e,r);A.length&&(A.call({action:o,location:a,retry:function(){n(e,r)}}),1)||(a=[{usr:a.state,key:a.key,idx:m},s(a)],v.replaceState(a[0],"",a[1]),h(o))},go:p,back:function(){p(-1)},forward:function(){p(1)},listen:function(t){return k.push(t)},block:function(t){var n=A.push(t);return 1===A.length&&d.addEventListener("beforeunload",e),function(){n(),A.length||d.removeEventListener("beforeunload",e)}}}},t.createMemoryHistory=function(e){function c(t,e){return void 0===e&&(e=null),n({pathname:v.pathname,search:"",hash:""},"string"==typeof t?i(t):t,{state:e,key:o()})}function u(t,n,e){return!g.length||(g.call({action:t,location:n,retry:e}),!1)}function l(t,n){d=t,v=n,y.call({action:d,location:v})}function s(n){var e=Math.min(Math.max(p+n,0),h.length-1),r=t.Action.Pop,o=h[e];u(r,o,(function(){s(n)}))&&(p=e,l(r,o))}void 0===e&&(e={});var f=e;e=f.initialEntries,f=f.initialIndex;var h=(void 0===e?["/"]:e).map((function(t){return n({pathname:"/",search:"",hash:"",state:null,key:o()},"string"==typeof t?i(t):t)})),p=Math.min(Math.max(null==f?h.length-1:f,0),h.length-1),d=t.Action.Pop,v=h[p],y=r(),g=r();return{get index(){return p},get action(){return d},get location(){return v},createHref:function(t){return"string"==typeof t?t:a(t)},push:function n(e,r){var o=t.Action.Push,a=c(e,r);u(o,a,(function(){n(e,r)}))&&(p+=1,h.splice(p,h.length,a),l(o,a))},replace:function n(e,r){var o=t.Action.Replace,a=c(e,r);u(o,a,(function(){n(e,r)}))&&(h[p]=a,l(o,a))},go:s,back:function(){s(-1)},forward:function(){s(1)},listen:function(t){return y.push(t)},block:function(t){return g.push(t)}}},t.createPath=a,t.parsePath=i,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=history.production.min.js.map

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc