Socket
Socket
Sign inDemoInstall

@cycle/history

Package Overview
Dependencies
24
Maintainers
3
Versions
40
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 6.8.0 to 6.9.0

10

CHANGELOG.md

@@ -0,1 +1,11 @@

<a name="6.9.0"></a>
# 6.9.0 (2017-11-14)
### Bug Fixes
* **history:** fix captureClicks listener cleanup ([5b5ce9b](https://github.com/cyclejs/cyclejs/commit/5b5ce9b))
<a name="6.8.0"></a>

@@ -2,0 +12,0 @@ # 6.8.0 (2017-10-26)

80

dist/cycle-history.min.js
(function(R){"object"===typeof exports&&"undefined"!==typeof module?module.exports=R():"function"===typeof define&&define.amd?define([],R):("undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:this).CycleHistory=R()})(function(){return function a(h,b,k){function l(c,m){if(!b[c]){if(!h[c]){var f="function"==typeof require&&require;if(!m&&f)return f(c,!0);if(q)return q(c,!0);m=Error("Cannot find module '"+c+"'");throw m.code="MODULE_NOT_FOUND",m;}m=b[c]=
{exports:{}};h[c][0].call(m.exports,function(e){var f=h[c][1][e];return l(f?f:e)},m,m.exports,a,h,b,k)}return b[c].exports}for(var q="function"==typeof require&&require,f=0;f<k.length;f++)l(k[f]);return l}({1:[function(a,h,b){function k(c){return function(l){if("undefined"===typeof window)var f=!1;else f=l||window.event,f=null===f.which?f.button:f.which;if(1===f&&!(l.metaKey||l.ctrlKey||l.shiftKey||l.defaultPrevented)){for(f=l.target;f&&"A"!==f.nodeName;)f=f.parentNode;if(f&&"A"===f.nodeName&&!f.hasAttribute("download")&&
"external"!==f.getAttribute("rel")&&!f.target){var e=f.getAttribute("href");e&&-1<e.indexOf("mailto:")||"#"===e.charAt(0)||(e=f.href,e="undefined"===typeof window?!1:e&&0===e.indexOf(window.location.origin),e&&(l.preventDefault(),l=f.hash,c(f.pathname+f.search+(void 0===l?"":l))))}}}}function l(c){c=k(c);"undefined"!==typeof window&&document.addEventListener(f,c,!1)}Object.defineProperty(b,"__esModule",{value:!0});var q=a("xstream"),f="undefined"!==typeof document&&document.ontouchstart?"touchstart":
"click";b.captureClicks=function(c){return function(f){var a=q.default.create();l(function(c){a._n({type:"push",pathname:c})});f._add(a);return c(a)}}},{xstream:20}],2:[function(a,h,b){function k(f){return function(c){"push"===c.type&&f.push(c.pathname,c.state);"replace"===c.type&&f.replace(c.pathname,c.state);"go"===c.type&&f.go(c.amount);"goBack"===c.type&&f.goBack();"goForward"===c.type&&f.goForward()}}function l(f,c){return{next:function(c){"string"===typeof c?f({type:"push",pathname:c}):f(c)},
error:function(f){c()},complete:function(){setTimeout(c)}}}Object.defineProperty(b,"__esModule",{value:!0});var q=a("xstream");b.createHistory$=function(f,c){var a=q.default.createWithMemory().startWith(f.location),b=k(f),e=f.listen(function(c){a._n(c)}),h=c.subscribe(l(b,e));a.dispose=function(){h.unsubscribe();e()};return a}},{xstream:20}],3:[function(a,h,b){Object.defineProperty(b,"__esModule",{value:!0});var k=a("history"),l=a("./createHistory$");b.makeHistoryDriver=function(a){var f=a&&a.createHref?
a:k.createBrowserHistory(a);return function(c){return l.createHistory$(f,c)}};b.makeServerHistoryDriver=function(a){var f=k.createMemoryHistory(a);return function(c){return l.createHistory$(f,c)}};b.makeHashHistoryDriver=function(a){var f=k.createHashHistory(a);return function(c){return l.createHistory$(f,c)}}},{"./createHistory$":2,history:12}],4:[function(a,h,b){Object.defineProperty(b,"__esModule",{value:!0});h=a("./drivers");b.makeHistoryDriver=h.makeHistoryDriver;h=a("./drivers");b.makeHashHistoryDriver=
h.makeHashHistoryDriver;h=a("./captureClicks");b.captureClicks=h.captureClicks;a=a("./drivers");b.makeServerHistoryDriver=a.makeServerHistoryDriver},{"./captureClicks":1,"./drivers":3}],5:[function(a,h,b){b.__esModule=!0;b.canUseDOM=!("undefined"===typeof window||!window.document||!window.document.createElement);b.addEventListener=function(a,l,b){return a.addEventListener?a.addEventListener(l,b,!1):a.attachEvent("on"+l,b)};b.removeEventListener=function(a,l,b){return a.removeEventListener?a.removeEventListener(l,
b,!1):a.detachEvent("on"+l,b)};b.getConfirmation=function(a,l){return l(window.confirm(a))};b.supportsHistory=function(){var a=window.navigator.userAgent;return-1===a.indexOf("Android 2.")&&-1===a.indexOf("Android 4.0")||-1===a.indexOf("Mobile Safari")||-1!==a.indexOf("Chrome")||-1!==a.indexOf("Windows Phone")?window.history&&"pushState"in window.history:!1};b.supportsPopStateOnHashChange=function(){return-1===window.navigator.userAgent.indexOf("Trident")};b.supportsGoWithoutReloadUsingHash=function(){return-1===
window.navigator.userAgent.indexOf("Firefox")};b.isExtraneousPopstateEvent=function(a){return void 0===a.state&&-1===navigator.userAgent.indexOf("CriOS")}},{}],6:[function(a,h,b){b.__esModule=!0;b.locationsAreEqual=b.createLocation=void 0;var k=Object.assign||function(c){for(var a=1;a<arguments.length;a++){var f=arguments[a],e;for(e in f)Object.prototype.hasOwnProperty.call(f,e)&&(c[e]=f[e])}return c},l=(h=a("resolve-pathname"))&&h.__esModule?h:{default:h},q=(h=a("value-equal"))&&h.__esModule?h:{default:h},
f=a("./PathUtils");b.createLocation=function(c,a,b,e){"string"===typeof c?(c=(0,f.parsePath)(c),c.state=a):(c=k({},c),void 0===c.pathname&&(c.pathname=""),c.search?"?"!==c.search.charAt(0)&&(c.search="?"+c.search):c.search="",c.hash?"#"!==c.hash.charAt(0)&&(c.hash="#"+c.hash):c.hash="",void 0!==a&&void 0===c.state&&(c.state=a));try{c.pathname=decodeURI(c.pathname)}catch(n){if(n instanceof URIError)throw new URIError('Pathname "'+c.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.');
throw n;}b&&(c.key=b);e?c.pathname?"/"!==c.pathname.charAt(0)&&(c.pathname=(0,l.default)(c.pathname,e.pathname)):c.pathname=e.pathname:c.pathname||(c.pathname="/");return c};b.locationsAreEqual=function(c,a){return c.pathname===a.pathname&&c.search===a.search&&c.hash===a.hash&&c.key===a.key&&(0,q.default)(c.state,a.state)}},{"./PathUtils":7,"resolve-pathname":14,"value-equal":18}],7:[function(a,h,b){b.__esModule=!0;b.addLeadingSlash=function(a){return"/"===a.charAt(0)?a:"/"+a};b.stripLeadingSlash=
function(a){return"/"===a.charAt(0)?a.substr(1):a};var k=b.hasBasename=function(a,b){return(new RegExp("^"+b+"(\\/|\\?|#|$)","i")).test(a)};b.stripBasename=function(a,b){return k(a,b)?a.substr(b.length):a};b.stripTrailingSlash=function(a){return"/"===a.charAt(a.length-1)?a.slice(0,-1):a};b.parsePath=function(a){a=a||"/";var b="",f="",c=a.indexOf("#");-1!==c&&(f=a.substr(c),a=a.substr(0,c));c=a.indexOf("?");-1!==c&&(b=a.substr(c),a=a.substr(0,c));return{pathname:a,search:"?"===b?"":b,hash:"#"===f?
"":f}};b.createPath=function(a){var b=a.search,f=a.hash;a=a.pathname||"/";b&&"?"!==b&&(a+="?"===b.charAt(0)?b:"?"+b);f&&"#"!==f&&(a+="#"===f.charAt(0)?f:"#"+f);return a}},{}],8:[function(a,h,b){function k(a){return a&&a.__esModule?a:{default:a}}b.__esModule=!0;var l="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"===typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},q=Object.assign||function(a){for(var c=
1;c<arguments.length;c++){var e=arguments[c],f;for(f in e)Object.prototype.hasOwnProperty.call(e,f)&&(a[f]=e[f])}return a};h=a("warning");var f=k(h);h=a("invariant");var c=k(h),m=a("./LocationUtils"),A=a("./PathUtils");h=a("./createTransitionManager");var e=k(h),n=a("./DOMUtils"),t=function(){try{return window.history.state||{}}catch(v){return{}}};b.default=function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};(0,c.default)(n.canUseDOM,"Browser history needs a DOM");var b=window.history,
k=(0,n.supportsHistory)(),h=!(0,n.supportsPopStateOnHashChange)(),y=a.forceRefresh,r=void 0===y?!1:y,y=a.getUserConfirmation,z=void 0===y?n.getConfirmation:y,y=a.keyLength,I=void 0===y?6:y,J=a.basename?(0,A.stripTrailingSlash)((0,A.addLeadingSlash)(a.basename)):"",O=function(g){var d=g||{};g=d.key;var d=d.state,p=window.location,p=p.pathname+p.search+p.hash;(0,f.default)(!J||(0,A.hasBasename)(p,J),'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "'+
p+'" to begin with "'+J+'".');J&&(p=(0,A.stripBasename)(p,J));return(0,m.createLocation)(p,d,g)},C=(0,e.default)(),E=function(g){q(u,g);u.length=b.length;C.notifyListeners(u.location,u.action)},G=function(g){(0,n.isExtraneousPopstateEvent)(g)||Q(O(g.state))},N=function(){Q(O(t()))},P=!1,Q=function(g){P?(P=!1,E()):C.confirmTransitionTo(g,"POP",z,function(d){if(d)E({action:"POP",location:g});else{d=x.indexOf(u.location.key);-1===d&&(d=0);var p=x.indexOf(g.key);-1===p&&(p=0);if(d-=p)P=!0,K(d)}})},a=
O(t()),x=[a.key],L=function(g){return J+(0,A.createPath)(g)},K=function(g){b.go(g)},M=0,H=function(g){M+=g;1===M?((0,n.addEventListener)(window,"popstate",G),h&&(0,n.addEventListener)(window,"hashchange",N)):0===M&&((0,n.removeEventListener)(window,"popstate",G),h&&(0,n.removeEventListener)(window,"hashchange",N))},w=!1,u={length:b.length,action:"POP",location:a,createHref:L,push:function(g,d){(0,f.default)(!("object"===("undefined"===typeof g?"undefined":l(g))&&void 0!==g.state&&void 0!==d),"You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");
var p=(0,m.createLocation)(g,d,Math.random().toString(36).substr(2,I),u.location);C.confirmTransitionTo(p,"PUSH",z,function(d){if(d){d=L(p);var g=p.key,a=p.state;k?(b.pushState({key:g,state:a},null,d),r?window.location.href=d:(d=x.indexOf(u.location.key),d=x.slice(0,-1===d?0:d+1),d.push(p.key),x=d,E({action:"PUSH",location:p}))):((0,f.default)(void 0===a,"Browser history cannot push state in browsers that do not support HTML5 history"),window.location.href=d)}})},replace:function(g,d){(0,f.default)(!("object"===
("undefined"===typeof g?"undefined":l(g))&&void 0!==g.state&&void 0!==d),"You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");var p=(0,m.createLocation)(g,d,Math.random().toString(36).substr(2,I),u.location);C.confirmTransitionTo(p,"REPLACE",z,function(d){if(d){d=L(p);var g=p.key,a=p.state;k?(b.replaceState({key:g,state:a},null,d),r?window.location.replace(d):(d=x.indexOf(u.location.key),-1!==d&&(x[d]=p.key),
E({action:"REPLACE",location:p}))):((0,f.default)(void 0===a,"Browser history cannot replace state in browsers that do not support HTML5 history"),window.location.replace(d))}})},go:K,goBack:function(){return K(-1)},goForward:function(){return K(1)},block:function(){var g=C.setPrompt(0<arguments.length&&void 0!==arguments[0]?arguments[0]:!1);w||(H(1),w=!0);return function(){w&&(w=!1,H(-1));return g()}},listen:function(g){var d=C.appendListener(g);H(1);return function(){H(-1);d()}}};return u}},{"./DOMUtils":5,
"./LocationUtils":6,"./PathUtils":7,"./createTransitionManager":11,invariant:13,warning:19}],9:[function(a,h,b){function k(a){return a&&a.__esModule?a:{default:a}}b.__esModule=!0;var l=Object.assign||function(a){for(var c=1;c<arguments.length;c++){var e=arguments[c],f;for(f in e)Object.prototype.hasOwnProperty.call(e,f)&&(a[f]=e[f])}return a};h=a("warning");var q=k(h);h=a("invariant");var f=k(h),c=a("./LocationUtils"),m=a("./PathUtils");h=a("./createTransitionManager");var A=k(h),e=a("./DOMUtils"),
n={hashbang:{encodePath:function(a){return"!"===a.charAt(0)?a:"!/"+(0,m.stripLeadingSlash)(a)},decodePath:function(a){return"!"===a.charAt(0)?a.substr(1):a}},noslash:{encodePath:m.stripLeadingSlash,decodePath:m.addLeadingSlash},slash:{encodePath:m.addLeadingSlash,decodePath:m.addLeadingSlash}},t=function(){var a=window.location.href,c=a.indexOf("#");return-1===c?"":a.substring(c+1)},v=function(a){var c=window.location.href.indexOf("#");window.location.replace(window.location.href.slice(0,0<=c?c:0)+
"#"+a)};b.default=function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};(0,f.default)(e.canUseDOM,"Hash history needs a DOM");var b=window.history,k=(0,e.supportsGoWithoutReloadUsingHash)(),h=a.getUserConfirmation,r=void 0===h?e.getConfirmation:h,h=a.hashType,h=void 0===h?"slash":h,z=a.basename?(0,m.stripTrailingSlash)((0,m.addLeadingSlash)(a.basename)):"",a=n[h],I=a.encodePath,J=a.decodePath,O=function(){var a=J(t());(0,q.default)(!z||(0,m.hasBasename)(a,z),'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "'+
a+'" to begin with "'+z+'".');z&&(a=(0,m.stripBasename)(a,z));return(0,c.createLocation)(a)},C=(0,A.default)(),E=function(a){l(w,a);w.length=b.length;C.notifyListeners(w.location,w.action)},G=!1,N=null,P=function(){var a=t(),g=I(a);a!==g?v(g):(a=O(),g=w.location,!G&&(0,c.locationsAreEqual)(g,a)||N===(0,m.createPath)(a)||(N=null,Q(a)))},Q=function(a){G?(G=!1,E()):C.confirmTransitionTo(a,"POP",r,function(g){if(g)E({action:"POP",location:a});else{g=w.location;g=x.lastIndexOf((0,m.createPath)(g));-1===
g&&(g=0);var d=x.lastIndexOf((0,m.createPath)(a));-1===d&&(d=0);if(g-=d)G=!0,L(g)}})},a=t(),h=I(a);a!==h&&v(h);var a=O(),x=[(0,m.createPath)(a)],L=function(a){(0,q.default)(k,"Hash history go(n) causes a full page reload in this browser");b.go(a)},K=0,M=function(a){K+=a;1===K?(0,e.addEventListener)(window,"hashchange",P):0===K&&(0,e.removeEventListener)(window,"hashchange",P)},H=!1,w={length:b.length,action:"POP",location:a,createHref:function(a){return"#"+I(z+(0,m.createPath)(a))},push:function(a,
g){(0,q.default)(void 0===g,"Hash history cannot push state; it is ignored");var d=(0,c.createLocation)(a,void 0,void 0,w.location);C.confirmTransitionTo(d,"PUSH",r,function(a){if(a){a=(0,m.createPath)(d);var g=I(z+a);t()!==g?(N=a,window.location.hash=g,g=x.lastIndexOf((0,m.createPath)(w.location)),g=x.slice(0,-1===g?0:g+1),g.push(a),x=g,E({action:"PUSH",location:d})):((0,q.default)(!1,"Hash history cannot PUSH the same path; a new entry will not be added to the history stack"),E())}})},replace:function(a,
g){(0,q.default)(void 0===g,"Hash history cannot replace state; it is ignored");var d=(0,c.createLocation)(a,void 0,void 0,w.location);C.confirmTransitionTo(d,"REPLACE",r,function(a){if(a){a=(0,m.createPath)(d);var g=I(z+a);t()!==g&&(N=a,v(g));g=x.indexOf((0,m.createPath)(w.location));-1!==g&&(x[g]=a);E({action:"REPLACE",location:d})}})},go:L,goBack:function(){return L(-1)},goForward:function(){return L(1)},block:function(){var a=C.setPrompt(0<arguments.length&&void 0!==arguments[0]?arguments[0]:
!1);H||(M(1),H=!0);return function(){H&&(H=!1,M(-1));return a()}},listen:function(a){var g=C.appendListener(a);M(1);return function(){M(-1);g()}}};return w}},{"./DOMUtils":5,"./LocationUtils":6,"./PathUtils":7,"./createTransitionManager":11,invariant:13,warning:19}],10:[function(a,h,b){b.__esModule=!0;var k="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"===typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":
typeof a},l=Object.assign||function(a){for(var c=1;c<arguments.length;c++){var f=arguments[c],b;for(b in f)Object.prototype.hasOwnProperty.call(f,b)&&(a[b]=f[b])}return a},q=(h=a("warning"))&&h.__esModule?h:{default:h},f=a("./PathUtils"),c=a("./LocationUtils"),m=(a=a("./createTransitionManager"))&&a.__esModule?a:{default:a};b.default=function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=a.getUserConfirmation,b=a.initialEntries,b=void 0===b?["/"]:b,h=a.initialIndex,h=void 0===
h?0:h,a=a.keyLength,v=void 0===a?6:a,B=(0,m.default)(),D=function(a){l(r,a);r.length=r.entries.length;B.notifyListeners(r.location,r.action)},F=function(){return Math.random().toString(36).substr(2,v)},a=Math.min(Math.max(h,0),b.length-1),b=b.map(function(a){return"string"===typeof a?(0,c.createLocation)(a,void 0,F()):(0,c.createLocation)(a,void 0,a.key||F())}),y=function(a){var c=Math.min(Math.max(r.index+a,0),r.entries.length-1),f=r.entries[c];B.confirmTransitionTo(f,"POP",e,function(a){a?D({action:"POP",
location:f,index:c}):D()})},r={length:b.length,action:"POP",location:b[a],index:a,entries:b,createHref:f.createPath,push:function(a,f){(0,q.default)(!("object"===("undefined"===typeof a?"undefined":k(a))&&void 0!==a.state&&void 0!==f),"You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");var b=(0,c.createLocation)(a,f,F(),r.location);B.confirmTransitionTo(b,"PUSH",e,function(a){if(a){a=r.index+1;var c=r.entries.slice(0);
c.length>a?c.splice(a,c.length-a,b):c.push(b);D({action:"PUSH",location:b,index:a,entries:c})}})},replace:function(a,f){(0,q.default)(!("object"===("undefined"===typeof a?"undefined":k(a))&&void 0!==a.state&&void 0!==f),"You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");var b=(0,c.createLocation)(a,f,F(),r.location);B.confirmTransitionTo(b,"REPLACE",e,function(a){a&&(r.entries[r.index]=b,D({action:"REPLACE",
location:b}))})},go:y,goBack:function(){return y(-1)},goForward:function(){return y(1)},canGo:function(a){a=r.index+a;return 0<=a&&a<r.entries.length},block:function(){return B.setPrompt(0<arguments.length&&void 0!==arguments[0]?arguments[0]:!1)},listen:function(a){return B.appendListener(a)}};return r}},{"./LocationUtils":6,"./PathUtils":7,"./createTransitionManager":11,warning:19}],11:[function(a,h,b){b.__esModule=!0;var k=(a=a("warning"))&&a.__esModule?a:{default:a};b.default=function(){var a=
null,b=[];return{setPrompt:function(b){(0,k.default)(null==a,"A history supports only one prompt at a time");a=b;return function(){a===b&&(a=null)}},confirmTransitionTo:function(b,c,h,l){null!=a?(b="function"===typeof a?a(b,c):a,"string"===typeof b?"function"===typeof h?h(b,l):((0,k.default)(!1,"A history needs a getUserConfirmation function in order to use a prompt message"),l(!0)):l(!1!==b)):l(!0)},appendListener:function(a){var c=!0,f=function(){c&&a.apply(void 0,arguments)};b.push(f);return function(){c=
!1;b=b.filter(function(a){return a!==f})}},notifyListeners:function(){for(var a=arguments.length,c=Array(a),h=0;h<a;h++)c[h]=arguments[h];b.forEach(function(a){return a.apply(void 0,c)})}}}},{warning:19}],12:[function(a,h,b){function k(a){return a&&a.__esModule?a:{default:a}}b.__esModule=!0;b.createPath=b.parsePath=b.locationsAreEqual=b.createLocation=b.createMemoryHistory=b.createHashHistory=b.createBrowserHistory=void 0;var l=a("./LocationUtils");Object.defineProperty(b,"createLocation",{enumerable:!0,
get:function(){return l.createLocation}});Object.defineProperty(b,"locationsAreEqual",{enumerable:!0,get:function(){return l.locationsAreEqual}});var q=a("./PathUtils");Object.defineProperty(b,"parsePath",{enumerable:!0,get:function(){return q.parsePath}});Object.defineProperty(b,"createPath",{enumerable:!0,get:function(){return q.createPath}});h=a("./createBrowserHistory");h=k(h);var f=a("./createHashHistory"),f=k(f);a=a("./createMemoryHistory");a=k(a);b.createBrowserHistory=h.default;b.createHashHistory=
f.default;b.createMemoryHistory=a.default},{"./LocationUtils":6,"./PathUtils":7,"./createBrowserHistory":8,"./createHashHistory":9,"./createMemoryHistory":10}],13:[function(a,h,b){(function(a){h.exports=function(b,h,f,c,k,A,e,n){if("production"!==a.env.NODE_ENV&&void 0===h)throw Error("invariant requires an error message argument");if(!b){if(void 0===h)b=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=
[f,c,k,A,e,n],q=0;b=Error(h.replace(/%s/g,function(){return l[q++]}));b.name="Invariant Violation"}b.framesToPop=1;throw b;}}}).call(this,a("_process"))},{_process:21}],14:[function(a,h,b){function k(a,b){for(var f=b+1,c=a.length;f<c;b+=1,f+=1)a[b]=a[f];a.pop()}b.__esModule=!0;b.default=function(a){var b=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"",f=a&&a.split("/")||[],c=b&&b.split("/")||[],h=a&&"/"===a.charAt(0),b=b&&"/"===b.charAt(0),h=h||b;a&&"/"===a.charAt(0)?c=f:f.length&&(c.pop(),
c=c.concat(f));if(!c.length)return"/";c.length?(f=c[c.length-1],f="."===f||".."===f||""===f):f=!1;for(var b=0,l=c.length;0<=l;l--){var e=c[l];"."===e?k(c,l):".."===e?(k(c,l),b++):b&&(k(c,l),b--)}if(!h)for(;b--;b)c.unshift("..");!h||""===c[0]||c[0]&&"/"===c[0].charAt(0)||c.unshift("");c=c.join("/");f&&"/"!==c.substr(-1)&&(c+="/");return c};h.exports=b["default"]},{}],15:[function(a,h,b){h.exports=a("./lib/index")},{"./lib/index":16}],16:[function(a,h,b){var k="undefined"!==typeof global?global:"undefined"!==
typeof self?self:"undefined"!==typeof window?window:{};Object.defineProperty(b,"__esModule",{value:!0});a=(a=a("./ponyfill"))&&a.__esModule?a:{"default":a};h="undefined"!==typeof self?self:"undefined"!==typeof window?window:"undefined"!==typeof k?k:"undefined"!==typeof h?h:Function("return this")();h=(0,a["default"])(h);b["default"]=h},{"./ponyfill":17}],17:[function(a,h,b){Object.defineProperty(b,"__esModule",{value:!0});b["default"]=function(a){var b=a.Symbol;"function"===typeof b?b.observable?
a=b.observable:(a=b("observable"),b.observable=a):a="@@observable";return a}},{}],18:[function(a,h,b){function k(a,b){if(a===b)return!0;if(null==a||null==b)return!1;if(Array.isArray(a))return Array.isArray(b)&&a.length===b.length&&a.every(function(a,c){return k(a,b[c])});var c="undefined"===typeof a?"undefined":l(a),f="undefined"===typeof b?"undefined":l(b);if(c!==f)return!1;if("object"===c){c=a.valueOf();f=b.valueOf();if(c!==a||f!==b)return k(c,f);c=Object.keys(a);f=Object.keys(b);return c.length!==
{exports:{}};h[c][0].call(m.exports,function(e){var m=h[c][1][e];return l(m?m:e)},m,m.exports,a,h,b,k)}return b[c].exports}for(var q="function"==typeof require&&require,f=0;f<k.length;f++)l(k[f]);return l}({1:[function(a,h,b){function k(c){return function(l){if("undefined"===typeof window)var f=!1;else f=l||window.event,f=null===f.which?f.button:f.which;if(1===f&&!(l.metaKey||l.ctrlKey||l.shiftKey||l.defaultPrevented)){for(f=l.target;f&&"A"!==f.nodeName;)f=f.parentNode;if(f&&"A"===f.nodeName&&!f.hasAttribute("download")&&
"external"!==f.getAttribute("rel")&&!f.target){var e=f.getAttribute("href");e&&-1<e.indexOf("mailto:")||"#"===e.charAt(0)||(e=f.href,e="undefined"===typeof window?!1:e&&0===e.indexOf(window.location.origin),e&&(l.preventDefault(),l=f.hash,c(f.pathname+f.search+(void 0===l?"":l))))}}}}function l(c){var l=k(c);"undefined"!==typeof window&&document.addEventListener(f,l,!1);return function(){return document.removeEventListener(f,l)}}Object.defineProperty(b,"__esModule",{value:!0});var q=a("xstream"),
f="undefined"!==typeof document&&document.ontouchstart?"touchstart":"click";b.captureClicks=function(c){return function(f){var a=q.default.create({start:function(){},stop:function(){return"function"===typeof e&&e()}});var e=l(function(c){a._n({type:"push",pathname:c})});f._add(a);return c(a)}}},{xstream:20}],2:[function(a,h,b){function k(f){return function(c){"push"===c.type&&f.push(c.pathname,c.state);"replace"===c.type&&f.replace(c.pathname,c.state);"go"===c.type&&f.go(c.amount);"goBack"===c.type&&
f.goBack();"goForward"===c.type&&f.goForward()}}function l(f,c){return{next:function(c){"string"===typeof c?f({type:"push",pathname:c}):f(c)},error:function(f){c()},complete:function(){setTimeout(c)}}}Object.defineProperty(b,"__esModule",{value:!0});var q=a("xstream");b.createHistory$=function(f,c){var a=q.default.createWithMemory().startWith(f.location),b=k(f),e=f.listen(function(c){a._n(c)}),h=c.subscribe(l(b,e));a.dispose=function(){h.unsubscribe();e()};return a}},{xstream:20}],3:[function(a,h,
b){Object.defineProperty(b,"__esModule",{value:!0});var k=a("history"),l=a("./createHistory$");b.makeHistoryDriver=function(a){var f=a&&a.createHref?a:k.createBrowserHistory(a);return function(c){return l.createHistory$(f,c)}};b.makeServerHistoryDriver=function(a){var f=k.createMemoryHistory(a);return function(c){return l.createHistory$(f,c)}};b.makeHashHistoryDriver=function(a){var f=k.createHashHistory(a);return function(c){return l.createHistory$(f,c)}}},{"./createHistory$":2,history:12}],4:[function(a,
h,b){Object.defineProperty(b,"__esModule",{value:!0});h=a("./drivers");b.makeHistoryDriver=h.makeHistoryDriver;h=a("./drivers");b.makeHashHistoryDriver=h.makeHashHistoryDriver;h=a("./captureClicks");b.captureClicks=h.captureClicks;a=a("./drivers");b.makeServerHistoryDriver=a.makeServerHistoryDriver},{"./captureClicks":1,"./drivers":3}],5:[function(a,h,b){b.__esModule=!0;b.canUseDOM=!("undefined"===typeof window||!window.document||!window.document.createElement);b.addEventListener=function(a,l,b){return a.addEventListener?
a.addEventListener(l,b,!1):a.attachEvent("on"+l,b)};b.removeEventListener=function(a,l,b){return a.removeEventListener?a.removeEventListener(l,b,!1):a.detachEvent("on"+l,b)};b.getConfirmation=function(a,l){return l(window.confirm(a))};b.supportsHistory=function(){var a=window.navigator.userAgent;return-1===a.indexOf("Android 2.")&&-1===a.indexOf("Android 4.0")||-1===a.indexOf("Mobile Safari")||-1!==a.indexOf("Chrome")||-1!==a.indexOf("Windows Phone")?window.history&&"pushState"in window.history:!1};
b.supportsPopStateOnHashChange=function(){return-1===window.navigator.userAgent.indexOf("Trident")};b.supportsGoWithoutReloadUsingHash=function(){return-1===window.navigator.userAgent.indexOf("Firefox")};b.isExtraneousPopstateEvent=function(a){return void 0===a.state&&-1===navigator.userAgent.indexOf("CriOS")}},{}],6:[function(a,h,b){b.__esModule=!0;b.locationsAreEqual=b.createLocation=void 0;var k=Object.assign||function(c){for(var a=1;a<arguments.length;a++){var f=arguments[a],e;for(e in f)Object.prototype.hasOwnProperty.call(f,
e)&&(c[e]=f[e])}return c},l=(h=a("resolve-pathname"))&&h.__esModule?h:{default:h},q=(h=a("value-equal"))&&h.__esModule?h:{default:h},f=a("./PathUtils");b.createLocation=function(c,a,b,e){"string"===typeof c?(c=(0,f.parsePath)(c),c.state=a):(c=k({},c),void 0===c.pathname&&(c.pathname=""),c.search?"?"!==c.search.charAt(0)&&(c.search="?"+c.search):c.search="",c.hash?"#"!==c.hash.charAt(0)&&(c.hash="#"+c.hash):c.hash="",void 0!==a&&void 0===c.state&&(c.state=a));try{c.pathname=decodeURI(c.pathname)}catch(n){if(n instanceof
URIError)throw new URIError('Pathname "'+c.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.');throw n;}b&&(c.key=b);e?c.pathname?"/"!==c.pathname.charAt(0)&&(c.pathname=(0,l.default)(c.pathname,e.pathname)):c.pathname=e.pathname:c.pathname||(c.pathname="/");return c};b.locationsAreEqual=function(c,a){return c.pathname===a.pathname&&c.search===a.search&&c.hash===a.hash&&c.key===a.key&&(0,q.default)(c.state,a.state)}},{"./PathUtils":7,"resolve-pathname":14,"value-equal":18}],
7:[function(a,h,b){b.__esModule=!0;b.addLeadingSlash=function(a){return"/"===a.charAt(0)?a:"/"+a};b.stripLeadingSlash=function(a){return"/"===a.charAt(0)?a.substr(1):a};var k=b.hasBasename=function(a,b){return(new RegExp("^"+b+"(\\/|\\?|#|$)","i")).test(a)};b.stripBasename=function(a,b){return k(a,b)?a.substr(b.length):a};b.stripTrailingSlash=function(a){return"/"===a.charAt(a.length-1)?a.slice(0,-1):a};b.parsePath=function(a){a=a||"/";var b="",f="",c=a.indexOf("#");-1!==c&&(f=a.substr(c),a=a.substr(0,
c));c=a.indexOf("?");-1!==c&&(b=a.substr(c),a=a.substr(0,c));return{pathname:a,search:"?"===b?"":b,hash:"#"===f?"":f}};b.createPath=function(a){var b=a.search,f=a.hash;a=a.pathname||"/";b&&"?"!==b&&(a+="?"===b.charAt(0)?b:"?"+b);f&&"#"!==f&&(a+="#"===f.charAt(0)?f:"#"+f);return a}},{}],8:[function(a,h,b){function k(a){return a&&a.__esModule?a:{default:a}}b.__esModule=!0;var l="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"===
typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},q=Object.assign||function(a){for(var c=1;c<arguments.length;c++){var e=arguments[c],f;for(f in e)Object.prototype.hasOwnProperty.call(e,f)&&(a[f]=e[f])}return a};h=a("warning");var f=k(h);h=a("invariant");var c=k(h),m=a("./LocationUtils"),A=a("./PathUtils");h=a("./createTransitionManager");var e=k(h),n=a("./DOMUtils"),t=function(){try{return window.history.state||{}}catch(v){return{}}};b.default=function(){var a=0<arguments.length&&
void 0!==arguments[0]?arguments[0]:{};(0,c.default)(n.canUseDOM,"Browser history needs a DOM");var b=window.history,k=(0,n.supportsHistory)(),h=!(0,n.supportsPopStateOnHashChange)(),y=a.forceRefresh,r=void 0===y?!1:y,y=a.getUserConfirmation,z=void 0===y?n.getConfirmation:y,y=a.keyLength,I=void 0===y?6:y,J=a.basename?(0,A.stripTrailingSlash)((0,A.addLeadingSlash)(a.basename)):"",O=function(g){var d=g||{};g=d.key;var d=d.state,p=window.location,p=p.pathname+p.search+p.hash;(0,f.default)(!J||(0,A.hasBasename)(p,
J),'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "'+p+'" to begin with "'+J+'".');J&&(p=(0,A.stripBasename)(p,J));return(0,m.createLocation)(p,d,g)},C=(0,e.default)(),E=function(g){q(u,g);u.length=b.length;C.notifyListeners(u.location,u.action)},G=function(g){(0,n.isExtraneousPopstateEvent)(g)||Q(O(g.state))},N=function(){Q(O(t()))},P=!1,Q=function(g){P?(P=!1,E()):C.confirmTransitionTo(g,"POP",z,function(d){if(d)E({action:"POP",location:g});
else{d=x.indexOf(u.location.key);-1===d&&(d=0);var p=x.indexOf(g.key);-1===p&&(p=0);if(d-=p)P=!0,K(d)}})},a=O(t()),x=[a.key],L=function(g){return J+(0,A.createPath)(g)},K=function(g){b.go(g)},M=0,H=function(g){M+=g;1===M?((0,n.addEventListener)(window,"popstate",G),h&&(0,n.addEventListener)(window,"hashchange",N)):0===M&&((0,n.removeEventListener)(window,"popstate",G),h&&(0,n.removeEventListener)(window,"hashchange",N))},w=!1,u={length:b.length,action:"POP",location:a,createHref:L,push:function(g,
d){(0,f.default)(!("object"===("undefined"===typeof g?"undefined":l(g))&&void 0!==g.state&&void 0!==d),"You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");var p=(0,m.createLocation)(g,d,Math.random().toString(36).substr(2,I),u.location);C.confirmTransitionTo(p,"PUSH",z,function(d){if(d){d=L(p);var g=p.key,a=p.state;k?(b.pushState({key:g,state:a},null,d),r?window.location.href=d:(d=x.indexOf(u.location.key),
d=x.slice(0,-1===d?0:d+1),d.push(p.key),x=d,E({action:"PUSH",location:p}))):((0,f.default)(void 0===a,"Browser history cannot push state in browsers that do not support HTML5 history"),window.location.href=d)}})},replace:function(g,d){(0,f.default)(!("object"===("undefined"===typeof g?"undefined":l(g))&&void 0!==g.state&&void 0!==d),"You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");var p=(0,m.createLocation)(g,
d,Math.random().toString(36).substr(2,I),u.location);C.confirmTransitionTo(p,"REPLACE",z,function(d){if(d){d=L(p);var g=p.key,a=p.state;k?(b.replaceState({key:g,state:a},null,d),r?window.location.replace(d):(d=x.indexOf(u.location.key),-1!==d&&(x[d]=p.key),E({action:"REPLACE",location:p}))):((0,f.default)(void 0===a,"Browser history cannot replace state in browsers that do not support HTML5 history"),window.location.replace(d))}})},go:K,goBack:function(){return K(-1)},goForward:function(){return K(1)},
block:function(){var g=C.setPrompt(0<arguments.length&&void 0!==arguments[0]?arguments[0]:!1);w||(H(1),w=!0);return function(){w&&(w=!1,H(-1));return g()}},listen:function(g){var d=C.appendListener(g);H(1);return function(){H(-1);d()}}};return u}},{"./DOMUtils":5,"./LocationUtils":6,"./PathUtils":7,"./createTransitionManager":11,invariant:13,warning:19}],9:[function(a,h,b){function k(a){return a&&a.__esModule?a:{default:a}}b.__esModule=!0;var l=Object.assign||function(a){for(var c=1;c<arguments.length;c++){var e=
arguments[c],f;for(f in e)Object.prototype.hasOwnProperty.call(e,f)&&(a[f]=e[f])}return a};h=a("warning");var q=k(h);h=a("invariant");var f=k(h),c=a("./LocationUtils"),m=a("./PathUtils");h=a("./createTransitionManager");var A=k(h),e=a("./DOMUtils"),n={hashbang:{encodePath:function(a){return"!"===a.charAt(0)?a:"!/"+(0,m.stripLeadingSlash)(a)},decodePath:function(a){return"!"===a.charAt(0)?a.substr(1):a}},noslash:{encodePath:m.stripLeadingSlash,decodePath:m.addLeadingSlash},slash:{encodePath:m.addLeadingSlash,
decodePath:m.addLeadingSlash}},t=function(){var a=window.location.href,c=a.indexOf("#");return-1===c?"":a.substring(c+1)},v=function(a){var c=window.location.href.indexOf("#");window.location.replace(window.location.href.slice(0,0<=c?c:0)+"#"+a)};b.default=function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};(0,f.default)(e.canUseDOM,"Hash history needs a DOM");var b=window.history,k=(0,e.supportsGoWithoutReloadUsingHash)(),h=a.getUserConfirmation,r=void 0===h?e.getConfirmation:
h,h=a.hashType,h=void 0===h?"slash":h,z=a.basename?(0,m.stripTrailingSlash)((0,m.addLeadingSlash)(a.basename)):"",a=n[h],I=a.encodePath,J=a.decodePath,O=function(){var a=J(t());(0,q.default)(!z||(0,m.hasBasename)(a,z),'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "'+a+'" to begin with "'+z+'".');z&&(a=(0,m.stripBasename)(a,z));return(0,c.createLocation)(a)},C=(0,A.default)(),E=function(a){l(w,a);w.length=b.length;C.notifyListeners(w.location,
w.action)},G=!1,N=null,P=function(){var a=t(),g=I(a);a!==g?v(g):(a=O(),g=w.location,!G&&(0,c.locationsAreEqual)(g,a)||N===(0,m.createPath)(a)||(N=null,Q(a)))},Q=function(a){G?(G=!1,E()):C.confirmTransitionTo(a,"POP",r,function(g){if(g)E({action:"POP",location:a});else{g=w.location;g=x.lastIndexOf((0,m.createPath)(g));-1===g&&(g=0);var d=x.lastIndexOf((0,m.createPath)(a));-1===d&&(d=0);if(g-=d)G=!0,L(g)}})},a=t(),h=I(a);a!==h&&v(h);var a=O(),x=[(0,m.createPath)(a)],L=function(a){(0,q.default)(k,"Hash history go(n) causes a full page reload in this browser");
b.go(a)},K=0,M=function(a){K+=a;1===K?(0,e.addEventListener)(window,"hashchange",P):0===K&&(0,e.removeEventListener)(window,"hashchange",P)},H=!1,w={length:b.length,action:"POP",location:a,createHref:function(a){return"#"+I(z+(0,m.createPath)(a))},push:function(a,g){(0,q.default)(void 0===g,"Hash history cannot push state; it is ignored");var d=(0,c.createLocation)(a,void 0,void 0,w.location);C.confirmTransitionTo(d,"PUSH",r,function(a){if(a){a=(0,m.createPath)(d);var g=I(z+a);t()!==g?(N=a,window.location.hash=
g,g=x.lastIndexOf((0,m.createPath)(w.location)),g=x.slice(0,-1===g?0:g+1),g.push(a),x=g,E({action:"PUSH",location:d})):((0,q.default)(!1,"Hash history cannot PUSH the same path; a new entry will not be added to the history stack"),E())}})},replace:function(a,g){(0,q.default)(void 0===g,"Hash history cannot replace state; it is ignored");var d=(0,c.createLocation)(a,void 0,void 0,w.location);C.confirmTransitionTo(d,"REPLACE",r,function(a){if(a){a=(0,m.createPath)(d);var g=I(z+a);t()!==g&&(N=a,v(g));
g=x.indexOf((0,m.createPath)(w.location));-1!==g&&(x[g]=a);E({action:"REPLACE",location:d})}})},go:L,goBack:function(){return L(-1)},goForward:function(){return L(1)},block:function(){var a=C.setPrompt(0<arguments.length&&void 0!==arguments[0]?arguments[0]:!1);H||(M(1),H=!0);return function(){H&&(H=!1,M(-1));return a()}},listen:function(a){var g=C.appendListener(a);M(1);return function(){M(-1);g()}}};return w}},{"./DOMUtils":5,"./LocationUtils":6,"./PathUtils":7,"./createTransitionManager":11,invariant:13,
warning:19}],10:[function(a,h,b){b.__esModule=!0;var k="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"===typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},l=Object.assign||function(a){for(var c=1;c<arguments.length;c++){var f=arguments[c],b;for(b in f)Object.prototype.hasOwnProperty.call(f,b)&&(a[b]=f[b])}return a},q=(h=a("warning"))&&h.__esModule?h:{default:h},f=a("./PathUtils"),c=a("./LocationUtils"),
m=(a=a("./createTransitionManager"))&&a.__esModule?a:{default:a};b.default=function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=a.getUserConfirmation,b=a.initialEntries,b=void 0===b?["/"]:b,h=a.initialIndex,h=void 0===h?0:h,a=a.keyLength,v=void 0===a?6:a,B=(0,m.default)(),D=function(a){l(r,a);r.length=r.entries.length;B.notifyListeners(r.location,r.action)},F=function(){return Math.random().toString(36).substr(2,v)},a=Math.min(Math.max(h,0),b.length-1),b=b.map(function(a){return"string"===
typeof a?(0,c.createLocation)(a,void 0,F()):(0,c.createLocation)(a,void 0,a.key||F())}),y=function(a){var c=Math.min(Math.max(r.index+a,0),r.entries.length-1),f=r.entries[c];B.confirmTransitionTo(f,"POP",e,function(a){a?D({action:"POP",location:f,index:c}):D()})},r={length:b.length,action:"POP",location:b[a],index:a,entries:b,createHref:f.createPath,push:function(a,f){(0,q.default)(!("object"===("undefined"===typeof a?"undefined":k(a))&&void 0!==a.state&&void 0!==f),"You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");
var b=(0,c.createLocation)(a,f,F(),r.location);B.confirmTransitionTo(b,"PUSH",e,function(a){if(a){a=r.index+1;var c=r.entries.slice(0);c.length>a?c.splice(a,c.length-a,b):c.push(b);D({action:"PUSH",location:b,index:a,entries:c})}})},replace:function(a,f){(0,q.default)(!("object"===("undefined"===typeof a?"undefined":k(a))&&void 0!==a.state&&void 0!==f),"You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");
var b=(0,c.createLocation)(a,f,F(),r.location);B.confirmTransitionTo(b,"REPLACE",e,function(a){a&&(r.entries[r.index]=b,D({action:"REPLACE",location:b}))})},go:y,goBack:function(){return y(-1)},goForward:function(){return y(1)},canGo:function(a){a=r.index+a;return 0<=a&&a<r.entries.length},block:function(){return B.setPrompt(0<arguments.length&&void 0!==arguments[0]?arguments[0]:!1)},listen:function(a){return B.appendListener(a)}};return r}},{"./LocationUtils":6,"./PathUtils":7,"./createTransitionManager":11,
warning:19}],11:[function(a,h,b){b.__esModule=!0;var k=(a=a("warning"))&&a.__esModule?a:{default:a};b.default=function(){var a=null,b=[];return{setPrompt:function(b){(0,k.default)(null==a,"A history supports only one prompt at a time");a=b;return function(){a===b&&(a=null)}},confirmTransitionTo:function(b,c,h,l){null!=a?(b="function"===typeof a?a(b,c):a,"string"===typeof b?"function"===typeof h?h(b,l):((0,k.default)(!1,"A history needs a getUserConfirmation function in order to use a prompt message"),
l(!0)):l(!1!==b)):l(!0)},appendListener:function(a){var c=!0,f=function(){c&&a.apply(void 0,arguments)};b.push(f);return function(){c=!1;b=b.filter(function(a){return a!==f})}},notifyListeners:function(){for(var a=arguments.length,c=Array(a),h=0;h<a;h++)c[h]=arguments[h];b.forEach(function(a){return a.apply(void 0,c)})}}}},{warning:19}],12:[function(a,h,b){function k(a){return a&&a.__esModule?a:{default:a}}b.__esModule=!0;b.createPath=b.parsePath=b.locationsAreEqual=b.createLocation=b.createMemoryHistory=
b.createHashHistory=b.createBrowserHistory=void 0;var l=a("./LocationUtils");Object.defineProperty(b,"createLocation",{enumerable:!0,get:function(){return l.createLocation}});Object.defineProperty(b,"locationsAreEqual",{enumerable:!0,get:function(){return l.locationsAreEqual}});var q=a("./PathUtils");Object.defineProperty(b,"parsePath",{enumerable:!0,get:function(){return q.parsePath}});Object.defineProperty(b,"createPath",{enumerable:!0,get:function(){return q.createPath}});h=a("./createBrowserHistory");
h=k(h);var f=a("./createHashHistory"),f=k(f);a=a("./createMemoryHistory");a=k(a);b.createBrowserHistory=h.default;b.createHashHistory=f.default;b.createMemoryHistory=a.default},{"./LocationUtils":6,"./PathUtils":7,"./createBrowserHistory":8,"./createHashHistory":9,"./createMemoryHistory":10}],13:[function(a,h,b){(function(a){h.exports=function(b,h,f,c,k,A,e,n){if("production"!==a.env.NODE_ENV&&void 0===h)throw Error("invariant requires an error message argument");if(!b){if(void 0===h)b=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");
else{var l=[f,c,k,A,e,n],q=0;b=Error(h.replace(/%s/g,function(){return l[q++]}));b.name="Invariant Violation"}b.framesToPop=1;throw b;}}}).call(this,a("_process"))},{_process:21}],14:[function(a,h,b){function k(a,b){for(var f=b+1,c=a.length;f<c;b+=1,f+=1)a[b]=a[f];a.pop()}b.__esModule=!0;b.default=function(a){var b=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"",f=a&&a.split("/")||[],c=b&&b.split("/")||[],h=a&&"/"===a.charAt(0),b=b&&"/"===b.charAt(0),h=h||b;a&&"/"===a.charAt(0)?c=f:f.length&&
(c.pop(),c=c.concat(f));if(!c.length)return"/";c.length?(f=c[c.length-1],f="."===f||".."===f||""===f):f=!1;for(var b=0,l=c.length;0<=l;l--){var e=c[l];"."===e?k(c,l):".."===e?(k(c,l),b++):b&&(k(c,l),b--)}if(!h)for(;b--;b)c.unshift("..");!h||""===c[0]||c[0]&&"/"===c[0].charAt(0)||c.unshift("");c=c.join("/");f&&"/"!==c.substr(-1)&&(c+="/");return c};h.exports=b["default"]},{}],15:[function(a,h,b){h.exports=a("./lib/index")},{"./lib/index":16}],16:[function(a,h,b){var k="undefined"!==typeof global?global:
"undefined"!==typeof self?self:"undefined"!==typeof window?window:{};Object.defineProperty(b,"__esModule",{value:!0});a=(a=a("./ponyfill"))&&a.__esModule?a:{"default":a};h="undefined"!==typeof self?self:"undefined"!==typeof window?window:"undefined"!==typeof k?k:"undefined"!==typeof h?h:Function("return this")();h=(0,a["default"])(h);b["default"]=h},{"./ponyfill":17}],17:[function(a,h,b){Object.defineProperty(b,"__esModule",{value:!0});b["default"]=function(a){var b=a.Symbol;"function"===typeof b?
b.observable?a=b.observable:(a=b("observable"),b.observable=a):a="@@observable";return a}},{}],18:[function(a,h,b){function k(a,b){if(a===b)return!0;if(null==a||null==b)return!1;if(Array.isArray(a))return Array.isArray(b)&&a.length===b.length&&a.every(function(a,c){return k(a,b[c])});var c="undefined"===typeof a?"undefined":l(a),f="undefined"===typeof b?"undefined":l(b);if(c!==f)return!1;if("object"===c){c=a.valueOf();f=b.valueOf();if(c!==a||f!==b)return k(c,f);c=Object.keys(a);f=Object.keys(b);return c.length!==
f.length?!1:c.every(function(c){return k(a[c],b[c])})}return!1}b.__esModule=!0;var l="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"===typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a};b.default=k;h.exports=b["default"]},{}],19:[function(a,h,b){(function(a){var b=function(){};"production"!==a.env.NODE_ENV&&(b=function(a,b,c){var f=arguments.length;c=Array(2<f?f-2:0);for(var h=2;h<f;h++)c[h-2]=

@@ -43,0 +43,0 @@ arguments[h];if(void 0===b)throw Error("`warning(condition, format, ...args)` requires a warning message argument");if(10>b.length||/^[s\W]*$/.test(b))throw Error("The warning format should be able to uniquely identify this warning. Please, use a more descriptive format than: "+b);if(!a){var e=0,f="Warning: "+b.replace(/%s/g,function(){return c[e++]});"undefined"!==typeof console&&console.error(f);try{throw Error(f);}catch(n){}}});h.exports=b}).call(this,a("_process"))},{_process:21}],20:[function(a,

@@ -62,7 +62,12 @@ "use strict";

}
return function () { return document.removeEventListener(CLICK_EVENT, listener); };
}
function captureClicks(historyDriver) {
return function historyDriverWithClickCapture(sink$) {
var internalSink$ = xstream_1.default.create();
captureAnchorClicks(function (pathname) {
var cleanup;
var internalSink$ = xstream_1.default.create({
start: function () { },
stop: function () { return typeof cleanup === 'function' && cleanup(); },
});
cleanup = captureAnchorClicks(function (pathname) {
internalSink$._n({ type: 'push', pathname: pathname });

@@ -69,0 +74,0 @@ });

@@ -60,7 +60,12 @@ import xs from 'xstream';

}
return function () { return document.removeEventListener(CLICK_EVENT, listener); };
}
export function captureClicks(historyDriver) {
return function historyDriverWithClickCapture(sink$) {
var internalSink$ = xs.create();
captureAnchorClicks(function (pathname) {
var cleanup;
var internalSink$ = xs.create({
start: function () { },
stop: function () { return typeof cleanup === 'function' && cleanup(); },
});
cleanup = captureAnchorClicks(function (pathname) {
internalSink$._n({ type: 'push', pathname: pathname });

@@ -67,0 +72,0 @@ });

{
"name": "@cycle/history",
"version": "6.8.0",
"version": "6.9.0",
"description": "The standard history driver for Cycle.js",

@@ -5,0 +5,0 @@ "main": "lib/cjs/index.js",

@@ -12,3 +12,5 @@ /// <reference path="../../node_modules/@types/mocha/index.d.ts" />

import {createMemoryHistory} from 'history';
import xs from 'xstream';
import xs, {Stream} from 'xstream';
import {setup} from '@cycle/run';
import {setAdapt} from '@cycle/run/lib/adapt';

@@ -80,3 +82,4 @@ describe('makeHistoryDriver', () => {

const historyDriver = makeHistoryDriver();
const history$ = captureClicks(historyDriver)(xs.never());
const sink = xs.never();
const history$ = captureClicks(historyDriver)(sink);

@@ -87,2 +90,3 @@ const sub = history$.drop(1).subscribe({

sub.unsubscribe();
sink.shamefullySendComplete();
done();

@@ -102,2 +106,49 @@ },

});
it('should remove click listener when disposed of', function(done) {
setAdapt(x => x);
function main(sources: {history: Stream<Location>}) {
return {
history: xs.never(),
};
}
const {sources: sources1, run: run1} = setup(main, {
history: captureClicks(makeHistoryDriver()),
});
const sub1 = sources1.history.drop(1).subscribe({
next: () => done(new Error('should not trigger')),
error: err => {},
complete: () => {},
});
const dispose1 = run1();
dispose1();
const {sources: sources2, run: run2} = setup(main, {
history: captureClicks(makeHistoryDriver()),
});
let dispose2 = () => {};
const sub2 = sources2.history.drop(1).subscribe({
next: (location: Location) => {
assert.strictEqual(location.pathname, '/dispose');
sub1.unsubscribe();
sub2.unsubscribe();
dispose2();
done();
},
error: err => done(err),
complete: () => {},
});
dispose2 = run2();
const a = document.createElement('a');
a.href = '/dispose';
document.body.appendChild(a);
setTimeout(() => {
a.click();
});
});
});

Sorry, the diff of this file is too big to display

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